@anymux/ui-kit 0.1.0 → 0.2.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/{calendar-DSlrbHoj.js → calendar-DQKfYSQS.js} +48 -45
- package/dist/calendar-DQKfYSQS.js.map +1 -0
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{contacts-DQXTZzHc.js → contacts-By9Wg3kn.js} +35 -33
- package/dist/contacts-By9Wg3kn.js.map +1 -0
- package/dist/contacts.d.ts +1 -1
- package/dist/contacts.js +1 -1
- package/dist/{file-browser-m5atC3kF.js → file-browser-CkhNwADU.js} +61 -133
- package/dist/file-browser-CkhNwADU.js.map +1 -0
- package/dist/file-browser.d.ts +6 -6
- package/dist/file-browser.js +4 -4
- package/dist/{git-B55e6LL-.js → git-m4lboTfx.js} +29 -29
- package/dist/git-m4lboTfx.js.map +1 -0
- package/dist/git.js +1 -1
- package/dist/{iconMap-V4B8P-Uh.js → iconMap-DDpe35ek.js} +5 -5
- package/dist/iconMap-DDpe35ek.js.map +1 -0
- package/dist/icons.js +1 -1
- package/dist/{index-Bryv_GCG.d.ts → index-BP4IYXiF.d.ts} +46 -53
- package/dist/index-BP4IYXiF.d.ts.map +1 -0
- package/dist/{index-kHr9udZD.d.ts → index-BkIh8oov.d.ts} +17 -17
- package/dist/{index-kHr9udZD.d.ts.map → index-BkIh8oov.d.ts.map} +1 -1
- package/dist/{index-DSu19mq0.d.ts → index-D3Ob3aXg.d.ts} +9 -9
- package/dist/{index-DSu19mq0.d.ts.map → index-D3Ob3aXg.d.ts.map} +1 -1
- package/dist/{index-Ml_SgiKa.d.ts → index-DGoLQBX6.d.ts} +18 -42
- package/dist/index-DGoLQBX6.d.ts.map +1 -0
- package/dist/index-DnJaZr08.d.ts +67 -0
- package/dist/index-DnJaZr08.d.ts.map +1 -0
- package/dist/{index-DmsyeHFr.d.ts → index-Pty-N7-g.d.ts} +5 -5
- package/dist/{index-DmsyeHFr.d.ts.map → index-Pty-N7-g.d.ts.map} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +10 -10
- package/dist/layout-BYsc16hD.js +183 -0
- package/dist/layout-BYsc16hD.js.map +1 -0
- package/dist/layout.d.ts +2 -2
- package/dist/layout.js +2 -2
- package/dist/{list-CxfT6hix.js → list-DAq-b6RR.js} +49 -63
- package/dist/list-DAq-b6RR.js.map +1 -0
- package/dist/list.d.ts +2 -2
- package/dist/list.js +4 -3
- package/dist/{media-DZ292aKK.js → media-DuczOGsk.js} +32 -31
- package/dist/media-DuczOGsk.js.map +1 -0
- package/dist/media.js +1 -1
- package/dist/{tree-Dd9Z0Aso.js → tree-B9VQcKBp.js} +2 -2
- package/dist/{tree-Dd9Z0Aso.js.map → tree-B9VQcKBp.js.map} +1 -1
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +2 -2
- package/package.json +2 -2
- package/src/calendar/AgendaView.tsx +2 -2
- package/src/calendar/CalendarBrowser.tsx +11 -11
- package/src/calendar/CalendarSidebar.tsx +10 -10
- package/src/calendar/DayView.tsx +5 -5
- package/src/calendar/EventCard.tsx +3 -3
- package/src/calendar/MonthView.tsx +6 -6
- package/src/calendar/WeekView.tsx +10 -10
- package/src/contacts/ContactBrowser.tsx +8 -8
- package/src/contacts/ContactCard.tsx +4 -4
- package/src/contacts/ContactDetail.tsx +10 -10
- package/src/contacts/ContactGroupSidebar.tsx +6 -6
- package/src/contacts/ContactList.tsx +3 -3
- package/src/file-browser/components/FileBrowser.tsx +3 -2
- package/src/file-browser/components/FileBrowserContent.tsx +1 -1
- package/src/file-browser/examples/BasicUsage.tsx +2 -2
- package/src/file-browser/index.ts +1 -1
- package/src/file-browser/providers/FileSystemProvider.ts +1 -1
- package/src/git/BranchList.tsx +12 -12
- package/src/git/CommitList.tsx +11 -11
- package/src/git/DiffViewer.tsx +11 -11
- package/src/icons/iconMap.ts +4 -4
- package/src/layout/index.ts +6 -2
- package/src/layout/models/ResponsiveLayoutModel.ts +116 -0
- package/src/list/components/ListItem.tsx +1 -1
- package/src/list/index.ts +1 -1
- package/src/media/AlbumSidebar.tsx +4 -4
- package/src/media/MediaBrowser.tsx +11 -11
- package/src/media/MediaGrid.tsx +3 -3
- package/src/media/MediaList.tsx +6 -6
- package/src/media/MediaPreview.tsx +2 -2
- package/src/media/MediaTimeline.tsx +3 -3
- package/src/{file-browser/components/shared → shared}/ErrorBoundary.tsx +3 -3
- package/dist/calendar-DSlrbHoj.js.map +0 -1
- package/dist/contacts-DQXTZzHc.js.map +0 -1
- package/dist/file-browser-m5atC3kF.js.map +0 -1
- package/dist/git-B55e6LL-.js.map +0 -1
- package/dist/iconMap-V4B8P-Uh.js.map +0 -1
- package/dist/index-Bryv_GCG.d.ts.map +0 -1
- package/dist/index-DzfY1Tok.d.ts +0 -32
- package/dist/index-DzfY1Tok.d.ts.map +0 -1
- package/dist/index-Ml_SgiKa.d.ts.map +0 -1
- package/dist/layout-Ca_4r8ka.js +0 -89
- package/dist/layout-Ca_4r8ka.js.map +0 -1
- package/dist/list-CxfT6hix.js.map +0 -1
- package/dist/media-DZ292aKK.js.map +0 -1
- package/src/list/components/shared/ErrorBoundary.tsx +0 -123
package/dist/file-browser.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./types-common-CB3kRek8.js";
|
|
2
|
-
import "./index-
|
|
3
|
-
import "./index-
|
|
4
|
-
import { ActionContext, ActionResult, BreadcrumbProps, ColumnDefinition, ContextAction,
|
|
5
|
-
import "./index-
|
|
6
|
-
import "./index-
|
|
2
|
+
import "./index-D3Ob3aXg.js";
|
|
3
|
+
import "./index-Pty-N7-g.js";
|
|
4
|
+
import { ActionContext, ActionResult, BreadcrumbProps, ColumnDefinition, ContextAction, ErrorState, FileBrowser$1 as FileBrowser, FileBrowserContent, FileBrowserContentProps, FileBrowserEventHandlers, FileBrowserHeader, FileBrowserHeaderProps, FileBrowserItem, FileBrowserItemComponent, FileBrowserItemDetails, FileBrowserModel$1 as FileBrowserModel, FileBrowserProps, FileIcon, FileIconProps, FileMatchContext, FileSystemBridge$1 as FileSystemBridge, FileSystemListProvider$1 as FileSystemListProvider, FileSystemProvider$1 as FileSystemProvider, FileSystemTreeProvider$1 as FileSystemTreeProvider, FileViewerPlugin, FilterCriteria, FilterDefinition, GitProvider$1 as GitProvider, GitRepositoryProvider$1 as GitRepositoryProvider, IFileBrowserProvider, IconDefinition, ItemChange, KeyboardShortcut, ListView, ListViewProps, ListViewSettings, ListViewUIModel$1 as ListViewUIModel, LoadingState, NavigationButtons, NavigationButtonsProps, NavigationManagerModel$1 as NavigationManagerModel, NavigationState, PreviewData, ProviderCapabilities, ProviderConfiguration, ResolvedViewer, SelectionManagerModel$1 as SelectionManagerModel, SelectionState, SortCriteria, SortFieldDefinition, ThumbnailViewSettings, ThumbnailViewUIModel$1 as ThumbnailViewUIModel, ToolbarAction, ToolbarActionConfig, ToolbarManagerModel$1 as ToolbarManagerModel, TreeView, TreeViewProps, TreeViewSettings, TreeViewUIModel$1 as TreeViewUIModel, UIComponentProps, UploadFileEntry, UploadModel$1 as UploadModel, ViewModeCapabilities, ViewModeDefinition, ViewModeManagerModel$1 as ViewModeManagerModel, ViewModeSettings, ViewModeToggle, ViewModeToggleProps, ViewerConfig, ViewerHost$1 as ViewerHost, ViewerHostModel$1 as ViewerHostModel, ViewerHostProps, ViewerProps, ViewerRegistry$1 as ViewerRegistry, cn, globalViewerRegistry$1 as globalViewerRegistry, viewerConfigToPlugin$1 as viewerConfigToPlugin } from "./index-DGoLQBX6.js";
|
|
5
|
+
import { ErrorBoundary$1 as ErrorBoundary, ErrorBoundaryProps } from "./index-BP4IYXiF.js";
|
|
6
|
+
import "./index-BkIh8oov.js";
|
|
7
7
|
import "./index-BNmNIWBL.js";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-DnJaZr08.js";
|
|
9
9
|
import "./index-CuQIjSXs.js";
|
|
10
10
|
import "./index-DxnJ8FYM.js";
|
|
11
11
|
export { ActionContext, ActionResult, BreadcrumbProps, ColumnDefinition, ContextAction, ErrorBoundary, ErrorBoundaryProps, ErrorState, FileBrowser, FileBrowserContent, FileBrowserContentProps, FileBrowserEventHandlers, FileBrowserHeader, FileBrowserHeaderProps, FileBrowserItem, FileBrowserItemComponent, FileBrowserItemDetails, FileBrowserModel, FileBrowserProps, TreeView as FileBrowserTreeView, TreeViewProps as FileBrowserTreeViewProps, FileIcon, FileIconProps as FileIconUIProps, FileMatchContext, FileSystemBridge, FileSystemListProvider, FileSystemProvider, FileSystemTreeProvider, FileViewerPlugin, FilterCriteria, FilterDefinition, GitProvider, GitRepositoryProvider, IFileBrowserProvider, IconDefinition, ItemChange, KeyboardShortcut, ListView, ListViewProps, ListViewSettings, ListViewUIModel, LoadingState, NavigationButtons, NavigationButtonsProps, NavigationManagerModel, NavigationState, PreviewData, ProviderCapabilities, ProviderConfiguration, ResolvedViewer, SelectionManagerModel, SelectionState, SortCriteria, SortFieldDefinition, ThumbnailViewSettings, ThumbnailViewUIModel, ToolbarAction, ToolbarActionConfig, ToolbarManagerModel, TreeViewSettings, TreeViewUIModel, UIComponentProps, UploadFileEntry, UploadModel, ViewModeCapabilities, ViewModeDefinition, ViewModeManagerModel, ViewModeSettings, ViewModeToggle, ViewModeToggleProps, ViewerConfig, ViewerHost, ViewerHostModel, ViewerHostProps, ViewerProps, ViewerRegistry, cn, globalViewerRegistry, viewerConfigToPlugin };
|
package/dist/file-browser.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn$1 as cn } from "./utils-B4fdKKsy.js";
|
|
2
|
-
import "./tree-
|
|
3
|
-
import "./iconMap-
|
|
2
|
+
import "./tree-B9VQcKBp.js";
|
|
3
|
+
import "./iconMap-DDpe35ek.js";
|
|
4
4
|
import "./FileBrowserContext-B6jixa2j.js";
|
|
5
|
-
import "./list-
|
|
5
|
+
import { ErrorBoundary } from "./list-DAq-b6RR.js";
|
|
6
6
|
import "./ExplorerLayout-CSIJd7N4.js";
|
|
7
|
-
import {
|
|
7
|
+
import { FileBrowser, FileBrowserContent_default, FileBrowserHeader_default, FileBrowserItem_default, FileBrowserModel, FileIcon_default, FileSystemBridge, FileSystemListProvider, FileSystemProvider, FileSystemTreeProvider, GitProvider, GitRepositoryProvider, ListViewUIModel, ListView_default, NavigationButtons_default, NavigationManagerModel, SelectionManagerModel, ThumbnailViewUIModel, ToolbarManagerModel, TreeViewUIModel, TreeView_default, UploadModel, ViewModeManagerModel, ViewModeToggle_default, ViewerHost, ViewerHostModel, ViewerRegistry, globalViewerRegistry, viewerConfigToPlugin } from "./file-browser-CkhNwADU.js";
|
|
8
8
|
|
|
9
9
|
export { ErrorBoundary, FileBrowser, FileBrowserContent_default as FileBrowserContent, FileBrowserHeader_default as FileBrowserHeader, FileBrowserItem_default as FileBrowserItemComponent, FileBrowserModel, TreeView_default as FileBrowserTreeView, FileIcon_default as FileIcon, FileSystemBridge, FileSystemListProvider, FileSystemProvider, FileSystemTreeProvider, GitProvider, GitRepositoryProvider, ListView_default as ListView, ListViewUIModel, NavigationButtons_default as NavigationButtons, NavigationManagerModel, SelectionManagerModel, ThumbnailViewUIModel, ToolbarManagerModel, TreeViewUIModel, UploadModel, ViewModeManagerModel, ViewModeToggle_default as ViewModeToggle, ViewerHost, ViewerHostModel, ViewerRegistry, cn, globalViewerRegistry, viewerConfigToPlugin };
|
|
@@ -197,7 +197,7 @@ function CommitRow({ commit, isHead, changedFileCount, isSelected, onSelect }) {
|
|
|
197
197
|
const message = firstLine(commit.message);
|
|
198
198
|
const hasFullBody = commit.message.includes("\n");
|
|
199
199
|
return /* @__PURE__ */ jsxs("div", {
|
|
200
|
-
className: `group border-b border-
|
|
200
|
+
className: `group border-b border-border transition-colors ${isSelected ? "bg-primary/10" : "hover:bg-muted/50"}`,
|
|
201
201
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
202
202
|
onClick: onSelect,
|
|
203
203
|
className: "flex items-center gap-2.5 w-full px-3 py-2 text-left",
|
|
@@ -207,7 +207,7 @@ function CommitRow({ commit, isHead, changedFileCount, isSelected, onSelect }) {
|
|
|
207
207
|
e.stopPropagation();
|
|
208
208
|
setExpanded(!expanded);
|
|
209
209
|
},
|
|
210
|
-
className: "w-4 h-4 flex items-center justify-center text-
|
|
210
|
+
className: "w-4 h-4 flex items-center justify-center text-muted-foreground hover:text-foreground flex-shrink-0",
|
|
211
211
|
children: expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3 w-3" })
|
|
212
212
|
}),
|
|
213
213
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -228,26 +228,26 @@ function CommitRow({ commit, isHead, changedFileCount, isSelected, onSelect }) {
|
|
|
228
228
|
}), /* @__PURE__ */ jsxs("div", {
|
|
229
229
|
className: "flex items-center gap-2 mt-0.5",
|
|
230
230
|
children: [/* @__PURE__ */ jsx("span", {
|
|
231
|
-
className: "text-[10px] text-
|
|
231
|
+
className: "text-[10px] text-muted-foreground",
|
|
232
232
|
children: commit.author.name
|
|
233
233
|
}), /* @__PURE__ */ jsx("span", {
|
|
234
|
-
className: "text-[10px] text-
|
|
234
|
+
className: "text-[10px] text-muted-foreground",
|
|
235
235
|
children: formatRelativeTime(commit.author.date)
|
|
236
236
|
})]
|
|
237
237
|
})]
|
|
238
238
|
}),
|
|
239
239
|
/* @__PURE__ */ jsx("code", {
|
|
240
|
-
className: "text-[10px] font-mono text-
|
|
240
|
+
className: "text-[10px] font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded flex-shrink-0",
|
|
241
241
|
children: shortSha(commit.sha)
|
|
242
242
|
})
|
|
243
243
|
]
|
|
244
244
|
}), expanded && /* @__PURE__ */ jsxs("div", {
|
|
245
245
|
className: "px-3 pb-3 pl-[52px] space-y-2",
|
|
246
246
|
children: [hasFullBody && /* @__PURE__ */ jsx("div", {
|
|
247
|
-
className: "text-xs text-
|
|
247
|
+
className: "text-xs text-muted-foreground whitespace-pre-wrap bg-muted/50 rounded p-2 border border-border",
|
|
248
248
|
children: commit.message
|
|
249
249
|
}), /* @__PURE__ */ jsxs("div", {
|
|
250
|
-
className: "flex flex-wrap gap-x-4 gap-y-1 text-[10px] text-
|
|
250
|
+
className: "flex flex-wrap gap-x-4 gap-y-1 text-[10px] text-muted-foreground",
|
|
251
251
|
children: [
|
|
252
252
|
/* @__PURE__ */ jsxs("div", {
|
|
253
253
|
className: "flex items-center gap-1",
|
|
@@ -255,7 +255,7 @@ function CommitRow({ commit, isHead, changedFileCount, isSelected, onSelect }) {
|
|
|
255
255
|
/* @__PURE__ */ jsx(User, { className: "h-3 w-3" }),
|
|
256
256
|
/* @__PURE__ */ jsx("span", { children: commit.author.name }),
|
|
257
257
|
/* @__PURE__ */ jsxs("span", {
|
|
258
|
-
className: "text-
|
|
258
|
+
className: "text-muted-foreground",
|
|
259
259
|
children: [
|
|
260
260
|
"<",
|
|
261
261
|
commit.author.email,
|
|
@@ -302,7 +302,7 @@ const CommitList = ({ commits, headSha, changedFileCounts, onSelectCommit, selec
|
|
|
302
302
|
const graphNodes = useMemo(() => showGraph ? computeGraphLayout(commits) : [], [commits, showGraph]);
|
|
303
303
|
const gWidth = showGraph ? graphWidth(graphNodes) : 0;
|
|
304
304
|
if (commits.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
305
|
-
className: `flex items-center justify-center py-8 text-xs text-
|
|
305
|
+
className: `flex items-center justify-center py-8 text-xs text-muted-foreground ${className ?? ""}`,
|
|
306
306
|
children: "No commits found"
|
|
307
307
|
});
|
|
308
308
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -335,7 +335,7 @@ function statusIcon(status) {
|
|
|
335
335
|
case "added": return /* @__PURE__ */ jsx(FilePlus2, { className: "h-3.5 w-3.5 text-green-500" });
|
|
336
336
|
case "deleted": return /* @__PURE__ */ jsx(FileX2, { className: "h-3.5 w-3.5 text-red-500" });
|
|
337
337
|
case "modified": return /* @__PURE__ */ jsx(FileEdit, { className: "h-3.5 w-3.5 text-yellow-500" });
|
|
338
|
-
case "renamed": return /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-3.5 w-3.5 text-
|
|
338
|
+
case "renamed": return /* @__PURE__ */ jsx(ArrowRightLeft, { className: "h-3.5 w-3.5 text-primary" });
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
function statusLabel(status) {
|
|
@@ -380,20 +380,20 @@ function lineClassName(type) {
|
|
|
380
380
|
case "addition": return "bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-300";
|
|
381
381
|
case "deletion": return "bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-300";
|
|
382
382
|
case "header": return "bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 font-medium";
|
|
383
|
-
default: return "text-
|
|
383
|
+
default: return "text-foreground";
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
function FileDiffSection({ entry, defaultExpanded = false }) {
|
|
387
387
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
388
388
|
const patchLines = entry.patch ? parsePatch(entry.patch) : [];
|
|
389
389
|
return /* @__PURE__ */ jsxs("div", {
|
|
390
|
-
className: "border border-
|
|
390
|
+
className: "border border-border rounded-lg overflow-hidden",
|
|
391
391
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
392
392
|
onClick: () => setExpanded(!expanded),
|
|
393
|
-
className: "flex items-center gap-2 w-full px-3 py-2 bg-
|
|
393
|
+
className: "flex items-center gap-2 w-full px-3 py-2 bg-muted/50 hover:bg-muted transition-colors text-left",
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ jsx("span", {
|
|
396
|
-
className: "flex-shrink-0 text-
|
|
396
|
+
className: "flex-shrink-0 text-muted-foreground",
|
|
397
397
|
children: expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5" })
|
|
398
398
|
}),
|
|
399
399
|
statusIcon(entry.status),
|
|
@@ -401,11 +401,11 @@ function FileDiffSection({ entry, defaultExpanded = false }) {
|
|
|
401
401
|
className: "text-xs font-mono truncate flex-1",
|
|
402
402
|
children: entry.previousPath && entry.status === "renamed" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
403
403
|
/* @__PURE__ */ jsx("span", {
|
|
404
|
-
className: "text-
|
|
404
|
+
className: "text-muted-foreground",
|
|
405
405
|
children: entry.previousPath
|
|
406
406
|
}),
|
|
407
407
|
/* @__PURE__ */ jsx("span", {
|
|
408
|
-
className: "text-
|
|
408
|
+
className: "text-muted-foreground mx-1",
|
|
409
409
|
children: "→"
|
|
410
410
|
}),
|
|
411
411
|
/* @__PURE__ */ jsx("span", { children: entry.path })
|
|
@@ -435,7 +435,7 @@ function FileDiffSection({ entry, defaultExpanded = false }) {
|
|
|
435
435
|
children: line.content
|
|
436
436
|
}, i))
|
|
437
437
|
}) : /* @__PURE__ */ jsx("div", {
|
|
438
|
-
className: "px-3 py-4 text-center text-xs text-
|
|
438
|
+
className: "px-3 py-4 text-center text-xs text-muted-foreground italic",
|
|
439
439
|
children: "No diff content available"
|
|
440
440
|
})
|
|
441
441
|
})]
|
|
@@ -443,7 +443,7 @@ function FileDiffSection({ entry, defaultExpanded = false }) {
|
|
|
443
443
|
}
|
|
444
444
|
const DiffViewer = ({ entries, className }) => {
|
|
445
445
|
if (entries.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
446
|
-
className: `flex items-center justify-center py-8 text-xs text-
|
|
446
|
+
className: `flex items-center justify-center py-8 text-xs text-muted-foreground ${className ?? ""}`,
|
|
447
447
|
children: "No changes to display"
|
|
448
448
|
});
|
|
449
449
|
const totalAdditions = entries.reduce((sum, e) => sum + e.additions, 0);
|
|
@@ -451,12 +451,12 @@ const DiffViewer = ({ entries, className }) => {
|
|
|
451
451
|
return /* @__PURE__ */ jsxs("div", {
|
|
452
452
|
className: `space-y-2 ${className ?? ""}`,
|
|
453
453
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
454
|
-
className: "flex items-center gap-3 px-3 py-2 bg-
|
|
454
|
+
className: "flex items-center gap-3 px-3 py-2 bg-muted/50 rounded-lg text-xs text-muted-foreground",
|
|
455
455
|
children: [
|
|
456
456
|
/* @__PURE__ */ jsxs("div", {
|
|
457
457
|
className: "flex items-center gap-1",
|
|
458
458
|
children: [
|
|
459
|
-
/* @__PURE__ */ jsx(FileText, { className: "h-3.5 w-3.5 text-
|
|
459
|
+
/* @__PURE__ */ jsx(FileText, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
460
460
|
/* @__PURE__ */ jsx("span", {
|
|
461
461
|
className: "font-medium",
|
|
462
462
|
children: entries.length
|
|
@@ -505,34 +505,34 @@ const BranchList = ({ branches, currentBranch, onSelectBranch, className }) => {
|
|
|
505
505
|
return /* @__PURE__ */ jsxs("div", {
|
|
506
506
|
className: `flex flex-col h-full ${className ?? ""}`,
|
|
507
507
|
children: [/* @__PURE__ */ jsx("div", {
|
|
508
|
-
className: "px-2 py-2 border-b border-
|
|
508
|
+
className: "px-2 py-2 border-b border-border flex-shrink-0",
|
|
509
509
|
children: /* @__PURE__ */ jsxs("div", {
|
|
510
510
|
className: "relative",
|
|
511
|
-
children: [/* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-
|
|
511
|
+
children: [/* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground" }), /* @__PURE__ */ jsx("input", {
|
|
512
512
|
type: "text",
|
|
513
513
|
placeholder: "Filter branches...",
|
|
514
514
|
value: search,
|
|
515
515
|
onChange: (e) => setSearch(e.target.value),
|
|
516
|
-
className: "w-full pl-7 pr-2 py-1.5 text-xs rounded-md border border-
|
|
516
|
+
className: "w-full pl-7 pr-2 py-1.5 text-xs rounded-md border border-border bg-muted/50 focus:outline-none focus:ring-1 focus:ring-ring placeholder-muted-foreground"
|
|
517
517
|
})]
|
|
518
518
|
})
|
|
519
519
|
}), /* @__PURE__ */ jsx("div", {
|
|
520
520
|
className: "flex-1 overflow-auto",
|
|
521
521
|
children: sorted.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
522
|
-
className: "px-3 py-6 text-center text-xs text-
|
|
522
|
+
className: "px-3 py-6 text-center text-xs text-muted-foreground",
|
|
523
523
|
children: search ? "No matching branches" : "No branches found"
|
|
524
524
|
}) : sorted.map((branch) => {
|
|
525
525
|
const isCurrent = branch.name === currentBranch;
|
|
526
526
|
return /* @__PURE__ */ jsxs("button", {
|
|
527
527
|
onClick: () => onSelectBranch?.(branch),
|
|
528
|
-
className: `flex items-center gap-2 w-full px-3 py-2 text-left transition-colors border-b border-
|
|
528
|
+
className: `flex items-center gap-2 w-full px-3 py-2 text-left transition-colors border-b border-border ${isCurrent ? "bg-primary/10" : "hover:bg-muted/50"}`,
|
|
529
529
|
children: [
|
|
530
530
|
/* @__PURE__ */ jsx("span", {
|
|
531
531
|
className: "w-4 flex-shrink-0 flex items-center justify-center",
|
|
532
|
-
children: isCurrent ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-
|
|
532
|
+
children: isCurrent ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx(GitBranch, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
533
533
|
}),
|
|
534
534
|
/* @__PURE__ */ jsx("span", {
|
|
535
|
-
className: `text-xs truncate flex-1 ${isCurrent ? "font-semibold text-
|
|
535
|
+
className: `text-xs truncate flex-1 ${isCurrent ? "font-semibold text-primary" : "text-foreground"}`,
|
|
536
536
|
children: branch.name
|
|
537
537
|
}),
|
|
538
538
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -546,7 +546,7 @@ const BranchList = ({ branches, currentBranch, onSelectBranch, className }) => {
|
|
|
546
546
|
})]
|
|
547
547
|
}),
|
|
548
548
|
/* @__PURE__ */ jsx("code", {
|
|
549
|
-
className: "text-[10px] font-mono text-
|
|
549
|
+
className: "text-[10px] font-mono text-muted-foreground flex-shrink-0",
|
|
550
550
|
children: branch.sha.slice(0, 7)
|
|
551
551
|
})
|
|
552
552
|
]
|
|
@@ -558,4 +558,4 @@ const BranchList = ({ branches, currentBranch, onSelectBranch, className }) => {
|
|
|
558
558
|
|
|
559
559
|
//#endregion
|
|
560
560
|
export { BranchList, CommitGraph, CommitList, DiffViewer, computeGraphLayout, graphWidth };
|
|
561
|
-
//# sourceMappingURL=git-
|
|
561
|
+
//# sourceMappingURL=git-m4lboTfx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-m4lboTfx.js","names":["index: number","commits: GitCommit[]","lanes: (string | null)[]","nodes: GraphNode[]","sha: string","connections: GraphConnection[]","CommitGraph: React.FC<CommitGraphProps>","col: number","row: number","date: Date","sha: string","message: string","name: string","CommitList: React.FC<CommitListProps>","status: GitDiffEntry['status']","patch: string","type: PatchLine['type']","DiffViewer: React.FC<DiffViewerProps>","BranchList: React.FC<BranchListProps>"],"sources":["../src/git/CommitGraph.tsx","../src/git/CommitList.tsx","../src/git/DiffViewer.tsx","../src/git/BranchList.tsx"],"sourcesContent":["import React from 'react';\nimport type { GitCommit } from '@anymux/file-system';\n\n// ---- Graph Layout Types ----\n\nexport interface GraphNode {\n sha: string;\n column: number;\n /** Paths to draw FROM this node downward to parents */\n connections: GraphConnection[];\n}\n\nexport interface GraphConnection {\n /** Column of the parent commit */\n toColumn: number;\n /** Row index of the parent commit (-1 if parent is off-screen) */\n toRow: number;\n /** Color index for the connection line */\n colorIndex: number;\n}\n\n// ---- Lane Colors ----\n\nconst LANE_COLORS = [\n '#3b82f6', // blue-500\n '#10b981', // emerald-500\n '#f59e0b', // amber-500\n '#ef4444', // red-500\n '#8b5cf6', // violet-500\n '#06b6d4', // cyan-500\n '#ec4899', // pink-500\n '#14b8a6', // teal-500\n '#f97316', // orange-500\n '#6366f1', // indigo-500\n];\n\nfunction laneColor(index: number): string {\n return LANE_COLORS[index % LANE_COLORS.length]!;\n}\n\n// ---- Graph Layout Algorithm ----\n\nexport function computeGraphLayout(commits: GitCommit[]): GraphNode[] {\n const shaToRow = new Map<string, number>();\n commits.forEach((c, i) => shaToRow.set(c.sha, i));\n\n // Lanes: array of active SHAs that occupy each column\n // When a commit is encountered, it takes over the lane reserved for it.\n // When a commit has parents, lanes are allocated for them.\n const lanes: (string | null)[] = [];\n const nodes: GraphNode[] = [];\n\n function findLane(sha: string): number {\n const idx = lanes.indexOf(sha);\n return idx >= 0 ? idx : -1;\n }\n\n function allocateLane(sha: string): number {\n // Reuse empty lane if available\n for (let i = 0; i < lanes.length; i++) {\n if (lanes[i] === null) {\n lanes[i] = sha;\n return i;\n }\n }\n lanes.push(sha);\n return lanes.length - 1;\n }\n\n for (let row = 0; row < commits.length; row++) {\n const commit = commits[row]!;\n let column = findLane(commit.sha);\n\n if (column === -1) {\n // First commit or branch start — allocate new lane\n column = allocateLane(commit.sha);\n }\n\n // Free this lane (will be reassigned to first parent)\n lanes[column] = null;\n\n const connections: GraphConnection[] = [];\n const parents = commit.parents;\n\n for (let pi = 0; pi < parents.length; pi++) {\n const parentSha = parents[pi]!;\n const parentRow = shaToRow.get(parentSha) ?? -1;\n let parentLane = findLane(parentSha);\n\n if (parentLane === -1) {\n if (pi === 0) {\n // First parent: reuse this commit's column for continuity\n lanes[column] = parentSha;\n parentLane = column;\n } else {\n // Merge parent: allocate a new lane\n parentLane = allocateLane(parentSha);\n }\n }\n\n connections.push({\n toColumn: parentLane,\n toRow: parentRow,\n colorIndex: parentLane,\n });\n }\n\n nodes.push({ sha: commit.sha, column, connections });\n }\n\n return nodes;\n}\n\n// ---- Graph Renderer ----\n\nconst ROW_HEIGHT = 40; // Must match commit row height\nconst COL_WIDTH = 14;\nconst NODE_RADIUS = 4;\nconst LEFT_PAD = 8;\n\nexport interface CommitGraphProps {\n nodes: GraphNode[];\n totalRows: number;\n /** SHA of the HEAD commit — its lane will be visually highlighted */\n headSha?: string;\n className?: string;\n}\n\nexport const CommitGraph: React.FC<CommitGraphProps> = ({ nodes, totalRows, headSha, className }) => {\n if (nodes.length === 0) return null;\n\n // Find the column of the HEAD commit for lane highlighting\n const headNode = headSha ? nodes.find((n) => n.sha === headSha) : undefined;\n const headColumn = headNode?.column;\n\n const maxColumn = Math.max(...nodes.map((n) => {\n const connMax = n.connections.length > 0\n ? Math.max(...n.connections.map((c) => c.toColumn))\n : 0;\n return Math.max(n.column, connMax);\n }));\n\n const width = LEFT_PAD + (maxColumn + 1) * COL_WIDTH + NODE_RADIUS + 2;\n\n function x(col: number): number {\n return LEFT_PAD + col * COL_WIDTH + COL_WIDTH / 2;\n }\n\n function y(row: number): number {\n return row * ROW_HEIGHT + ROW_HEIGHT / 2;\n }\n\n return (\n <svg\n className={className}\n width={width}\n height={totalRows * ROW_HEIGHT}\n style={{ position: 'absolute', left: 0, top: 0, pointerEvents: 'none' }}\n >\n {/* Draw connections (lines) first so they're behind nodes */}\n {nodes.map((node, row) =>\n node.connections.map((conn, ci) => {\n const x1 = x(node.column);\n const y1 = y(row);\n const x2 = x(conn.toColumn);\n // If parent is off-screen, draw to bottom\n const y2 = conn.toRow >= 0 ? y(conn.toRow) : totalRows * ROW_HEIGHT;\n const color = laneColor(conn.colorIndex);\n const isHeadLane = headColumn !== undefined && node.column === headColumn && conn.toColumn === headColumn;\n const sw = isHeadLane ? 2.5 : 2;\n\n if (x1 === x2) {\n // Straight vertical line\n return (\n <line\n key={`${node.sha}-${ci}`}\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={sw}\n strokeLinecap=\"round\"\n opacity={headColumn !== undefined && !isHeadLane ? 0.5 : 1}\n />\n );\n }\n\n // Curved path for branch/merge\n const midY = y1 + ROW_HEIGHT * 0.6;\n return (\n <path\n key={`${node.sha}-${ci}`}\n d={`M ${x1} ${y1} C ${x1} ${midY}, ${x2} ${midY}, ${x2} ${y2}`}\n stroke={color}\n strokeWidth={sw}\n fill=\"none\"\n strokeLinecap=\"round\"\n opacity={headColumn !== undefined && !isHeadLane ? 0.5 : 1}\n />\n );\n })\n )}\n\n {/* Draw active lane lines (continuation between nodes) */}\n\n {/* Draw commit nodes on top */}\n {nodes.map((node, row) => {\n const isHead = node.sha === headSha;\n const isOnHeadLane = headColumn !== undefined && node.column === headColumn;\n const dimmed = headColumn !== undefined && !isOnHeadLane;\n return (\n <circle\n key={node.sha}\n cx={x(node.column)}\n cy={y(row)}\n r={isHead ? NODE_RADIUS + 1.5 : NODE_RADIUS}\n fill={laneColor(node.column)}\n stroke={isHead ? laneColor(node.column) : 'white'}\n strokeWidth={isHead ? 2.5 : 1.5}\n opacity={dimmed ? 0.5 : 1}\n />\n );\n })}\n </svg>\n );\n};\n\n/** Compute the width the graph will take, for adding left padding to commit rows */\nexport function graphWidth(nodes: GraphNode[]): number {\n if (nodes.length === 0) return 0;\n const maxColumn = Math.max(...nodes.map((n) => {\n const connMax = n.connections.length > 0\n ? Math.max(...n.connections.map((c) => c.toColumn))\n : 0;\n return Math.max(n.column, connMax);\n }));\n return LEFT_PAD + (maxColumn + 1) * COL_WIDTH + NODE_RADIUS + 2;\n}\n","import React, { useState, useMemo } from 'react';\nimport {\n GitCommit as GitCommitIcon,\n ChevronDown,\n ChevronRight,\n User,\n Clock,\n Hash,\n FileText,\n} from 'lucide-react';\nimport type { GitCommit } from '@anymux/file-system';\nimport { CommitGraph, computeGraphLayout, graphWidth } from './CommitGraph';\n\n// ---- Helpers ----\n\nfunction formatRelativeTime(date: Date): string {\n const now = Date.now();\n const diffMs = now - new Date(date).getTime();\n const seconds = Math.floor(diffMs / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const weeks = Math.floor(days / 7);\n const months = Math.floor(days / 30);\n\n if (seconds < 60) return 'just now';\n if (minutes < 60) return `${minutes}m ago`;\n if (hours < 24) return `${hours}h ago`;\n if (days < 7) return `${days}d ago`;\n if (weeks < 5) return `${weeks}w ago`;\n if (months < 12) return `${months}mo ago`;\n return new Date(date).toLocaleDateString();\n}\n\nfunction shortSha(sha: string): string {\n return sha.slice(0, 7);\n}\n\nfunction firstLine(message: string): string {\n return message.split('\\n')[0] ?? message;\n}\n\nfunction authorInitials(name: string): string {\n const parts = name.split(/\\s+/);\n if (parts.length >= 2) {\n return (parts[0]![0]! + parts[parts.length - 1]![0]!).toUpperCase();\n }\n return name.slice(0, 2).toUpperCase();\n}\n\n/** Deterministic color from a string (for avatar backgrounds). */\nfunction authorColor(name: string): string {\n let hash = 0;\n for (let i = 0; i < name.length; i++) {\n hash = name.charCodeAt(i) + ((hash << 5) - hash);\n }\n const colors = [\n 'bg-blue-500',\n 'bg-emerald-500',\n 'bg-violet-500',\n 'bg-amber-500',\n 'bg-rose-500',\n 'bg-cyan-500',\n 'bg-pink-500',\n 'bg-teal-500',\n ];\n return colors[Math.abs(hash) % colors.length]!;\n}\n\n// ---- Types ----\n\nexport interface CommitListProps {\n commits: GitCommit[];\n headSha?: string;\n /** Number of changed files per commit (keyed by sha). Optional enrichment. */\n changedFileCounts?: Record<string, number>;\n onSelectCommit?: (commit: GitCommit) => void;\n selectedSha?: string;\n /** Show commit graph (branch lanes) alongside the list */\n showGraph?: boolean;\n className?: string;\n}\n\n// ---- Commit Row ----\n\ninterface CommitRowProps {\n commit: GitCommit;\n isHead: boolean;\n changedFileCount?: number;\n isSelected: boolean;\n onSelect: () => void;\n}\n\nfunction CommitRow({ commit, isHead, changedFileCount, isSelected, onSelect }: CommitRowProps) {\n const [expanded, setExpanded] = useState(false);\n const message = firstLine(commit.message);\n const hasFullBody = commit.message.includes('\\n');\n\n return (\n <div\n className={`group border-b border-border transition-colors ${\n isSelected\n ? 'bg-primary/10'\n : 'hover:bg-muted/50'\n }`}\n >\n {/* Main row */}\n <button\n onClick={onSelect}\n className=\"flex items-center gap-2.5 w-full px-3 py-2 text-left\"\n >\n {/* Expand toggle */}\n <button\n onClick={(e) => {\n e.stopPropagation();\n setExpanded(!expanded);\n }}\n className=\"w-4 h-4 flex items-center justify-center text-muted-foreground hover:text-foreground flex-shrink-0\"\n >\n {expanded ? (\n <ChevronDown className=\"h-3 w-3\" />\n ) : (\n <ChevronRight className=\"h-3 w-3\" />\n )}\n </button>\n\n {/* Author avatar */}\n <div\n className={`w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-bold text-white flex-shrink-0 ${authorColor(commit.author.name)}`}\n >\n {authorInitials(commit.author.name)}\n </div>\n\n {/* Message + metadata */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs font-medium truncate\">\n {message}\n </span>\n {isHead && (\n <span className=\"px-1.5 py-0.5 text-[9px] font-bold bg-yellow-100 text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-300 rounded flex-shrink-0\">\n HEAD\n </span>\n )}\n </div>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <span className=\"text-[10px] text-muted-foreground\">\n {commit.author.name}\n </span>\n <span className=\"text-[10px] text-muted-foreground\">\n {formatRelativeTime(commit.author.date)}\n </span>\n </div>\n </div>\n\n {/* SHA badge */}\n <code className=\"text-[10px] font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded flex-shrink-0\">\n {shortSha(commit.sha)}\n </code>\n </button>\n\n {/* Expanded detail */}\n {expanded && (\n <div className=\"px-3 pb-3 pl-[52px] space-y-2\">\n {/* Full commit message */}\n {hasFullBody && (\n <div className=\"text-xs text-muted-foreground whitespace-pre-wrap bg-muted/50 rounded p-2 border border-border\">\n {commit.message}\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-[10px] text-muted-foreground\">\n <div className=\"flex items-center gap-1\">\n <User className=\"h-3 w-3\" />\n <span>{commit.author.name}</span>\n <span className=\"text-muted-foreground\"><{commit.author.email}></span>\n </div>\n <div className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n <span>{new Date(commit.author.date).toLocaleString()}</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <Hash className=\"h-3 w-3\" />\n <code className=\"font-mono\">{commit.sha}</code>\n </div>\n {commit.parents.length > 0 && (\n <div className=\"flex items-center gap-1\">\n <GitCommitIcon className=\"h-3 w-3\" />\n <span>\n {commit.parents.length === 1 ? 'Parent' : 'Parents'}:{' '}\n {commit.parents.map((p) => shortSha(p)).join(', ')}\n </span>\n </div>\n )}\n {changedFileCount !== undefined && (\n <div className=\"flex items-center gap-1\">\n <FileText className=\"h-3 w-3\" />\n <span>{changedFileCount} file{changedFileCount !== 1 ? 's' : ''} changed</span>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n );\n}\n\n// ---- CommitList Component ----\n\nexport const CommitList: React.FC<CommitListProps> = ({\n commits,\n headSha,\n changedFileCounts,\n onSelectCommit,\n selectedSha,\n showGraph = true,\n className,\n}) => {\n const graphNodes = useMemo(\n () => (showGraph ? computeGraphLayout(commits) : []),\n [commits, showGraph],\n );\n const gWidth = showGraph ? graphWidth(graphNodes) : 0;\n\n if (commits.length === 0) {\n return (\n <div className={`flex items-center justify-center py-8 text-xs text-muted-foreground ${className ?? ''}`}>\n No commits found\n </div>\n );\n }\n\n return (\n <div className={`overflow-auto ${className ?? ''}`}>\n <div className=\"relative\" style={{ minWidth: gWidth + 200 }}>\n {showGraph && graphNodes.length > 0 && (\n <CommitGraph\n nodes={graphNodes}\n totalRows={commits.length}\n headSha={headSha}\n />\n )}\n <div style={{ paddingLeft: gWidth }}>\n {commits.map((commit) => (\n <CommitRow\n key={commit.sha}\n commit={commit}\n isHead={commit.sha === headSha}\n changedFileCount={changedFileCounts?.[commit.sha]}\n isSelected={commit.sha === selectedSha}\n onSelect={() => onSelectCommit?.(commit)}\n />\n ))}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport {\n ChevronDown,\n ChevronRight,\n Plus,\n Minus,\n FileText,\n FilePlus2,\n FileX2,\n FileEdit,\n ArrowRightLeft,\n} from 'lucide-react';\nimport type { GitDiffEntry } from '@anymux/file-system';\n\n// ---- Helpers ----\n\nfunction statusIcon(status: GitDiffEntry['status']) {\n switch (status) {\n case 'added':\n return <FilePlus2 className=\"h-3.5 w-3.5 text-green-500\" />;\n case 'deleted':\n return <FileX2 className=\"h-3.5 w-3.5 text-red-500\" />;\n case 'modified':\n return <FileEdit className=\"h-3.5 w-3.5 text-yellow-500\" />;\n case 'renamed':\n return <ArrowRightLeft className=\"h-3.5 w-3.5 text-primary\" />;\n }\n}\n\nfunction statusLabel(status: GitDiffEntry['status']): string {\n switch (status) {\n case 'added': return 'Added';\n case 'deleted': return 'Deleted';\n case 'modified': return 'Modified';\n case 'renamed': return 'Renamed';\n }\n}\n\nfunction statusBadgeClass(status: GitDiffEntry['status']): string {\n switch (status) {\n case 'added':\n return 'bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400';\n case 'deleted':\n return 'bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400';\n case 'modified':\n return 'bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400';\n case 'renamed':\n return 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400';\n }\n}\n\ninterface PatchLine {\n type: 'context' | 'addition' | 'deletion' | 'header';\n content: string;\n}\n\nfunction parsePatch(patch: string): PatchLine[] {\n const lines = patch.split('\\n');\n return lines.map((line) => {\n if (line.startsWith('@@')) {\n return { type: 'header', content: line };\n } else if (line.startsWith('+')) {\n return { type: 'addition', content: line };\n } else if (line.startsWith('-')) {\n return { type: 'deletion', content: line };\n }\n return { type: 'context', content: line };\n });\n}\n\nfunction lineClassName(type: PatchLine['type']): string {\n switch (type) {\n case 'addition':\n return 'bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-300';\n case 'deletion':\n return 'bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-300';\n case 'header':\n return 'bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 font-medium';\n default:\n return 'text-foreground';\n }\n}\n\n// ---- Types ----\n\nexport interface DiffViewerProps {\n entries: GitDiffEntry[];\n className?: string;\n}\n\n// ---- File Diff Section ----\n\ninterface FileDiffSectionProps {\n entry: GitDiffEntry;\n defaultExpanded?: boolean;\n}\n\nfunction FileDiffSection({ entry, defaultExpanded = false }: FileDiffSectionProps) {\n const [expanded, setExpanded] = useState(defaultExpanded);\n const patchLines = entry.patch ? parsePatch(entry.patch) : [];\n\n return (\n <div className=\"border border-border rounded-lg overflow-hidden\">\n {/* File header */}\n <button\n onClick={() => setExpanded(!expanded)}\n className=\"flex items-center gap-2 w-full px-3 py-2 bg-muted/50 hover:bg-muted transition-colors text-left\"\n >\n <span className=\"flex-shrink-0 text-muted-foreground\">\n {expanded ? (\n <ChevronDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronRight className=\"h-3.5 w-3.5\" />\n )}\n </span>\n\n {statusIcon(entry.status)}\n\n <span className=\"text-xs font-mono truncate flex-1\">\n {entry.previousPath && entry.status === 'renamed' ? (\n <>\n <span className=\"text-muted-foreground\">{entry.previousPath}</span>\n <span className=\"text-muted-foreground mx-1\">→</span>\n <span>{entry.path}</span>\n </>\n ) : (\n entry.path\n )}\n </span>\n\n <span className={`px-1.5 py-0.5 text-[9px] font-medium rounded flex-shrink-0 ${statusBadgeClass(entry.status)}`}>\n {statusLabel(entry.status)}\n </span>\n\n <div className=\"flex items-center gap-1.5 flex-shrink-0 text-[10px]\">\n {entry.additions > 0 && (\n <span className=\"flex items-center gap-0.5 text-green-600 dark:text-green-400\">\n <Plus className=\"h-2.5 w-2.5\" />\n {entry.additions}\n </span>\n )}\n {entry.deletions > 0 && (\n <span className=\"flex items-center gap-0.5 text-red-600 dark:text-red-400\">\n <Minus className=\"h-2.5 w-2.5\" />\n {entry.deletions}\n </span>\n )}\n </div>\n </button>\n\n {/* Patch content */}\n {expanded && (\n <div className=\"overflow-x-auto\">\n {patchLines.length > 0 ? (\n <pre className=\"text-[11px] leading-[1.6] font-mono\">\n {patchLines.map((line, i) => (\n <div\n key={i}\n className={`px-3 ${lineClassName(line.type)}`}\n >\n {line.content}\n </div>\n ))}\n </pre>\n ) : (\n <div className=\"px-3 py-4 text-center text-xs text-muted-foreground italic\">\n No diff content available\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\n// ---- DiffViewer Component ----\n\nexport const DiffViewer: React.FC<DiffViewerProps> = ({ entries, className }) => {\n if (entries.length === 0) {\n return (\n <div className={`flex items-center justify-center py-8 text-xs text-muted-foreground ${className ?? ''}`}>\n No changes to display\n </div>\n );\n }\n\n const totalAdditions = entries.reduce((sum, e) => sum + e.additions, 0);\n const totalDeletions = entries.reduce((sum, e) => sum + e.deletions, 0);\n\n return (\n <div className={`space-y-2 ${className ?? ''}`}>\n {/* Summary bar */}\n <div className=\"flex items-center gap-3 px-3 py-2 bg-muted/50 rounded-lg text-xs text-muted-foreground\">\n <div className=\"flex items-center gap-1\">\n <FileText className=\"h-3.5 w-3.5 text-muted-foreground\" />\n <span className=\"font-medium\">{entries.length}</span>\n <span>file{entries.length !== 1 ? 's' : ''} changed</span>\n </div>\n <div className=\"flex items-center gap-1 text-green-600 dark:text-green-400\">\n <Plus className=\"h-3 w-3\" />\n <span>{totalAdditions}</span>\n </div>\n <div className=\"flex items-center gap-1 text-red-600 dark:text-red-400\">\n <Minus className=\"h-3 w-3\" />\n <span>{totalDeletions}</span>\n </div>\n </div>\n\n {/* File diffs */}\n {entries.map((entry) => (\n <FileDiffSection\n key={entry.path}\n entry={entry}\n defaultExpanded={entries.length <= 5}\n />\n ))}\n </div>\n );\n};\n","import React, { useState, useMemo } from 'react';\nimport {\n GitBranch as GitBranchIcon,\n Search,\n Shield,\n Check,\n} from 'lucide-react';\nimport type { GitBranch } from '@anymux/file-system';\n\n// ---- Types ----\n\nexport interface BranchListProps {\n branches: GitBranch[];\n currentBranch?: string;\n onSelectBranch?: (branch: GitBranch) => void;\n className?: string;\n}\n\n// ---- BranchList Component ----\n\nexport const BranchList: React.FC<BranchListProps> = ({\n branches,\n currentBranch,\n onSelectBranch,\n className,\n}) => {\n const [search, setSearch] = useState('');\n\n const filtered = useMemo(() => {\n if (!search) return branches;\n const lower = search.toLowerCase();\n return branches.filter((b) => b.name.toLowerCase().includes(lower));\n }, [branches, search]);\n\n // Sort: default branch first, then current, then alphabetical\n const sorted = useMemo(() => {\n return [...filtered].sort((a, b) => {\n if (a.isDefault && !b.isDefault) return -1;\n if (!a.isDefault && b.isDefault) return 1;\n if (a.name === currentBranch && b.name !== currentBranch) return -1;\n if (a.name !== currentBranch && b.name === currentBranch) return 1;\n return a.name.localeCompare(b.name);\n });\n }, [filtered, currentBranch]);\n\n return (\n <div className={`flex flex-col h-full ${className ?? ''}`}>\n {/* Search input */}\n <div className=\"px-2 py-2 border-b border-border flex-shrink-0\">\n <div className=\"relative\">\n <Search className=\"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground\" />\n <input\n type=\"text\"\n placeholder=\"Filter branches...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full pl-7 pr-2 py-1.5 text-xs rounded-md border border-border bg-muted/50 focus:outline-none focus:ring-1 focus:ring-ring placeholder-muted-foreground\"\n />\n </div>\n </div>\n\n {/* Branch list */}\n <div className=\"flex-1 overflow-auto\">\n {sorted.length === 0 ? (\n <div className=\"px-3 py-6 text-center text-xs text-muted-foreground\">\n {search ? 'No matching branches' : 'No branches found'}\n </div>\n ) : (\n sorted.map((branch) => {\n const isCurrent = branch.name === currentBranch;\n\n return (\n <button\n key={branch.name}\n onClick={() => onSelectBranch?.(branch)}\n className={`flex items-center gap-2 w-full px-3 py-2 text-left transition-colors border-b border-border ${\n isCurrent\n ? 'bg-primary/10'\n : 'hover:bg-muted/50'\n }`}\n >\n {/* Current indicator */}\n <span className=\"w-4 flex-shrink-0 flex items-center justify-center\">\n {isCurrent ? (\n <Check className=\"h-3.5 w-3.5 text-primary\" />\n ) : (\n <GitBranchIcon className=\"h-3.5 w-3.5 text-muted-foreground\" />\n )}\n </span>\n\n {/* Branch name */}\n <span\n className={`text-xs truncate flex-1 ${\n isCurrent\n ? 'font-semibold text-primary'\n : 'text-foreground'\n }`}\n >\n {branch.name}\n </span>\n\n {/* Badges */}\n <div className=\"flex items-center gap-1 flex-shrink-0\">\n {branch.isDefault && (\n <span className=\"px-1.5 py-0.5 text-[9px] font-medium bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 rounded\">\n default\n </span>\n )}\n {branch.isProtected && (\n <span className=\"flex items-center gap-0.5 px-1.5 py-0.5 text-[9px] font-medium bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400 rounded\">\n <Shield className=\"h-2.5 w-2.5\" />\n protected\n </span>\n )}\n </div>\n\n {/* Short SHA */}\n <code className=\"text-[10px] font-mono text-muted-foreground flex-shrink-0\">\n {branch.sha.slice(0, 7)}\n </code>\n </button>\n );\n })\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;AAuBA,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,SAAS,UAAUA,OAAuB;AACxC,QAAO,YAAY,QAAQ,YAAY;AACxC;AAID,SAAgB,mBAAmBC,SAAmC;CACpE,MAAM,WAAW,IAAI;AACrB,SAAQ,QAAQ,CAAC,GAAG,MAAM,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;CAKjD,MAAMC,QAA2B,CAAE;CACnC,MAAMC,QAAqB,CAAE;CAE7B,SAAS,SAASC,KAAqB;EACrC,MAAM,MAAM,MAAM,QAAQ,IAAI;AAC9B,SAAO,OAAO,IAAI,MAAA;CACnB;CAED,SAAS,aAAaA,KAAqB;AAEzC,OAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,IAChC,KAAI,MAAM,OAAO,MAAM;AACrB,SAAM,KAAK;AACX,UAAO;EACR;AAEH,QAAM,KAAK,IAAI;AACf,SAAO,MAAM,SAAS;CACvB;AAED,MAAK,IAAI,MAA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QAClB;;OA9CF,OAAO,KA+CL;GAEZ,EAAC;IAEA;GACF;AAET"}
|
package/dist/git.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BranchList, CommitGraph, CommitList, DiffViewer, computeGraphLayout, graphWidth } from "./git-
|
|
1
|
+
import { BranchList, CommitGraph, CommitList, DiffViewer, computeGraphLayout, graphWidth } from "./git-m4lboTfx.js";
|
|
2
2
|
|
|
3
3
|
export { BranchList, CommitGraph, CommitList, DiffViewer, computeGraphLayout, graphWidth };
|
|
@@ -31,8 +31,8 @@ const iconColorMap = {
|
|
|
31
31
|
"file-video": "text-orange-500",
|
|
32
32
|
"file-audio": "text-violet-500",
|
|
33
33
|
"file-code": "text-blue-500",
|
|
34
|
-
"file-text": "text-
|
|
35
|
-
"file-type": "text-
|
|
34
|
+
"file-text": "text-muted-foreground",
|
|
35
|
+
"file-type": "text-muted-foreground",
|
|
36
36
|
"file-json": "text-yellow-500",
|
|
37
37
|
"file-terminal": "text-green-500",
|
|
38
38
|
"file-spreadsheet": "text-emerald-600",
|
|
@@ -41,7 +41,7 @@ const iconColorMap = {
|
|
|
41
41
|
"database": "text-purple-500",
|
|
42
42
|
"globe": "text-blue-400",
|
|
43
43
|
"presentation": "text-orange-500",
|
|
44
|
-
"file": "text-
|
|
44
|
+
"file": "text-muted-foreground"
|
|
45
45
|
};
|
|
46
46
|
const fileExtensionIconMap = {
|
|
47
47
|
"jpg": "file-image",
|
|
@@ -196,11 +196,11 @@ const contextMenuIconMap = {
|
|
|
196
196
|
function resolveIcon(name, className) {
|
|
197
197
|
const iconName = name || "file";
|
|
198
198
|
const MappedIcon = lucideIconMap[iconName] || File;
|
|
199
|
-
const colorClass = iconColorMap[iconName] || "text-
|
|
199
|
+
const colorClass = iconColorMap[iconName] || "text-muted-foreground";
|
|
200
200
|
const finalClassName = className ? `${className} ${colorClass}` : `w-4 h-4 ${colorClass}`;
|
|
201
201
|
return React.createElement(MappedIcon, { className: finalClassName });
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
//#endregion
|
|
205
205
|
export { contextMenuIconMap as contextMenuIconMap$1, fileExtensionIconMap as fileExtensionIconMap$1, getIconForExtension as getIconForExtension$1, getIconForFile as getIconForFile$1, iconColorMap as iconColorMap$1, lucideIconMap as lucideIconMap$1, resolveIcon as resolveIcon$1 };
|
|
206
|
-
//# sourceMappingURL=iconMap-
|
|
206
|
+
//# sourceMappingURL=iconMap-DDpe35ek.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconMap-DDpe35ek.js","names":["lucideIconMap: Record<string, LucideIcon>","iconColorMap: Record<string, string>","fileExtensionIconMap: Record<string, string>","filename: string","isDirectory: boolean","contextMenuIconMap: Record<string, LucideIcon>","name: string","className?: string"],"sources":["../src/icons/iconMap.ts"],"sourcesContent":["import React from 'react';\nimport {\n File, FileText, FileImage, FileVideo, FileAudio, FileCode,\n Folder, FolderOpen, FolderPlus, FilePlus, Archive, FileSpreadsheet, FileType, Settings,\n FileJson, FileTerminal, Database, Globe, Presentation, FileKey,\n Eye, Pencil, Trash2, Copy, Download, Upload, Share2, Scissors,\n Star, Heart, Bookmark, Tag, Info, AlertTriangle, AlertCircle,\n CheckCircle, Plus, Minus, X, Check, ZoomIn, List,\n type LucideIcon\n} from 'lucide-react';\n\n// Icon name to Lucide component mapping for resolving string icon identifiers\nexport const lucideIconMap: Record<string, LucideIcon> = {\n 'file': File, 'file-text': FileText, 'file-image': FileImage,\n 'file-video': FileVideo, 'file-audio': FileAudio, 'file-code': FileCode,\n 'folder': Folder, 'folder-open': FolderOpen, 'folder-plus': FolderPlus, 'file-plus': FilePlus, 'archive': Archive,\n 'file-spreadsheet': FileSpreadsheet, 'file-type': FileType, 'settings': Settings,\n 'file-json': FileJson, 'file-terminal': FileTerminal,\n 'database': Database, 'globe': Globe, 'presentation': Presentation, 'file-key': FileKey,\n};\n\n// Semantic color mapping for icon types\nexport const iconColorMap: Record<string, string> = {\n 'folder': 'text-blue-500',\n 'folder-open': 'text-blue-500',\n 'file-image': 'text-emerald-500',\n 'file-video': 'text-orange-500',\n 'file-audio': 'text-violet-500',\n 'file-code': 'text-blue-500',\n 'file-text': 'text-muted-foreground',\n 'file-type': 'text-muted-foreground',\n 'file-json': 'text-yellow-500',\n 'file-terminal': 'text-green-500',\n 'file-spreadsheet': 'text-emerald-600',\n 'file-key': 'text-red-500',\n 'archive': 'text-amber-500',\n 'database': 'text-purple-500',\n 'globe': 'text-blue-400',\n 'presentation': 'text-orange-500',\n 'file': 'text-muted-foreground',\n};\n\n// Comprehensive file extension to icon name mapping\nexport const fileExtensionIconMap: Record<string, string> = {\n // Images\n 'jpg': 'file-image', 'jpeg': 'file-image', 'png': 'file-image', 'gif': 'file-image',\n 'svg': 'file-image', 'webp': 'file-image', 'bmp': 'file-image', 'ico': 'file-image',\n 'tiff': 'file-image', 'tif': 'file-image', 'avif': 'file-image', 'heic': 'file-image',\n // Video\n 'mp4': 'file-video', 'avi': 'file-video', 'mkv': 'file-video', 'mov': 'file-video',\n 'wmv': 'file-video', 'flv': 'file-video', 'webm': 'file-video', 'm4v': 'file-video',\n // Audio\n 'mp3': 'file-audio', 'wav': 'file-audio', 'flac': 'file-audio', 'aac': 'file-audio',\n 'ogg': 'file-audio', 'wma': 'file-audio', 'm4a': 'file-audio', 'opus': 'file-audio',\n // Documents\n 'txt': 'file-text', 'md': 'file-text', 'mdx': 'file-text', 'rst': 'file-text',\n 'rtf': 'file-text', 'log': 'file-text', 'csv': 'file-text',\n 'pdf': 'file-type', 'doc': 'file-text', 'docx': 'file-text',\n // Spreadsheets\n 'xls': 'file-spreadsheet', 'xlsx': 'file-spreadsheet', 'ods': 'file-spreadsheet',\n // Presentations\n 'ppt': 'presentation', 'pptx': 'presentation', 'odp': 'presentation',\n // Code - JavaScript/TypeScript\n 'js': 'file-code', 'jsx': 'file-code', 'ts': 'file-code', 'tsx': 'file-code',\n 'mjs': 'file-code', 'cjs': 'file-code',\n // Code - Web\n 'html': 'globe', 'htm': 'globe', 'css': 'file-code', 'scss': 'file-code',\n 'sass': 'file-code', 'less': 'file-code', 'vue': 'file-code', 'svelte': 'file-code',\n // Code - Data\n 'json': 'file-json', 'jsonc': 'file-json', 'json5': 'file-json',\n 'xml': 'file-code', 'yaml': 'file-code', 'yml': 'file-code', 'toml': 'file-code',\n // Code - General\n 'py': 'file-code', 'rb': 'file-code', 'java': 'file-code', 'kt': 'file-code',\n 'go': 'file-code', 'rs': 'file-code', 'c': 'file-code', 'cpp': 'file-code',\n 'h': 'file-code', 'hpp': 'file-code', 'cs': 'file-code', 'swift': 'file-code',\n 'php': 'file-code', 'r': 'file-code', 'lua': 'file-code', 'dart': 'file-code',\n 'scala': 'file-code', 'zig': 'file-code', 'ex': 'file-code', 'exs': 'file-code',\n // Shell / Config\n 'sh': 'file-terminal', 'bash': 'file-terminal', 'zsh': 'file-terminal',\n 'fish': 'file-terminal', 'ps1': 'file-terminal', 'bat': 'file-terminal',\n 'cmd': 'file-terminal',\n // Config files\n 'env': 'file-key', 'ini': 'settings', 'conf': 'settings', 'cfg': 'settings',\n 'properties': 'settings',\n // Database\n 'sql': 'database', 'sqlite': 'database', 'db': 'database',\n // Archives\n 'zip': 'archive', 'tar': 'archive', 'gz': 'archive', 'bz2': 'archive',\n 'xz': 'archive', '7z': 'archive', 'rar': 'archive', 'tgz': 'archive',\n // Lock / package files\n 'lock': 'file-key',\n};\n\n// Get icon name for a file extension\nexport function getIconForExtension(filename: string): string {\n const ext = filename.split('.').pop()?.toLowerCase() || '';\n return fileExtensionIconMap[ext] || 'file';\n}\n\n// Get icon name for a file (handles directories too)\nexport function getIconForFile(filename: string, isDirectory: boolean): string {\n if (isDirectory) return 'folder';\n return getIconForExtension(filename);\n}\n\n// Context menu icon mapping - Lucide icons for menu items\nexport const contextMenuIconMap: Record<string, LucideIcon> = {\n 'eye': Eye,\n 'edit': Pencil,\n 'trash': Trash2,\n 'folder-open': FolderOpen,\n 'copy': Copy,\n 'download': Download,\n 'upload': Upload,\n 'share': Share2,\n 'scissors': Scissors,\n 'star': Star,\n 'heart': Heart,\n 'bookmark': Bookmark,\n 'tag': Tag,\n 'settings': Settings,\n 'info': Info,\n 'warning': AlertTriangle,\n 'error': AlertCircle,\n 'success': CheckCircle,\n 'plus': Plus,\n 'minus': Minus,\n 'x': X,\n 'check': Check,\n 'file': File,\n 'folder': Folder,\n 'folder-plus': FolderPlus,\n 'file-plus': FilePlus,\n 'archive': Archive,\n 'zoom-in': ZoomIn,\n 'list': List,\n};\n\n// Resolve an icon name to a React element\nexport function resolveIcon(name: string, className?: string): React.ReactElement {\n const iconName = name || 'file';\n const MappedIcon = lucideIconMap[iconName] || File;\n const colorClass = iconColorMap[iconName] || 'text-muted-foreground';\n const finalClassName = className ? `${className} ${colorClass}` : `w-4 h-4 ${colorClass}`;\n return React.createElement(MappedIcon, { className: finalClassName });\n}\n"],"mappings":";;;;AAYA,MAAaA,gBAA4C;CACvD,QAAQ;CAAM,aAAa;CAAU,cAAc;CACnD,cAAc;CAAW,cAAc;CAAW,aAAa;CAC/D,UAAU;CAAQ,eAAe;CAAY,eAAe;CAAY,aAAa;CAAU,WAAW;CAC1G,oBAAoB;CAAiB,aAAa;CAAU,YAAY;CACxE,aAAa;CAAU,iBAAiB;CACxC,YAAY;CAAU,SAAS;CAAO,gBAAgB;CAAc,YAAY;AACjF;AAGD,MAAaC,eAAuC;CAClD,UAAU;CACV,eAAe;CACf,cAAc;CACd,cAAc;CACd,cAAc;CACd,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,iBAAiB;CACjB,oBAAoB;CACpB,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,SAAS;CACT,gBAAgB;CAChB,QAAQ;AACT;AAGD,MAAaC,uBAA+C;CAE1D,OAAO;CAAc,QAAQ;CAAc,OAAO;CAAc,OAAO;CACvE,OAAO;CAAc,QAAQ;CAAc,OAAO;CAAc,OAAO;CACvE,QAAQ;CAAc,OAAO;CAAc,QAAQ;CAA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AGD,SAAgB,oBAAoBC,UAA0B;CAC5D,MAAM,MAAM,SAAS,MAAM,IAAI,CAAC,KAAK,EAAE,aAAa,IAAI;AACxD,QAAO,qBAAqB,QAAQ;AACrC;AAGD,SAAgB,eAAeA,UAAkBC,aAA8B;AAC7E,KAAI,YAAa,QAAO;AACxB,QAAO,oBAAoB,SAAS;AACrC;AAGD,MAAaC,qBAAiD;CAC5D,OAAO;CACP,QAAQ;CACR,SAAS;CACT,eAAe;CACf,QAAQ;CACR,YAAY;CACZ,UAAU;CACV,SAAS;CACT,YAAY;CACZ,QAAQ;CACR,SAAS;CACT,YAAY;CACZ,OAAO;CACP,YAAY;CACZ,QAAQ;CACR,WAAW;CACX,SAAS;CACT,WAAW;CACX,QAAQ;CACR,SAAS;CACT,KAAK;CACL,SAAS;CACT,QAAQ;CACR,UAAU;CACV,eAAe;CACf,aAAa;CACb,WAAW;CACX,WAAW;CACX,QAAQ;AACT;AAGD,SAAgB,YAAYC,MAAcC,WAAwC;CAChF,MAAM,WAAW,QAAQ;CACzB,MAAM,aAAa,cAAc,aAAa;CAC9C,MAAM,aAAa,aAAa,aAAa;CAC7C,MAAM,iBAAiB,aAAa,EAAE,UAAU,GAAG,WAAW,KAAK,UAAU,WAAW;AACxF,QAAO,MAAM,cAAc,YAAY,EAAE,WAAW,eAAgB,EAAC;AACtE"}
|
package/dist/icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { contextMenuIconMap$1 as contextMenuIconMap, fileExtensionIconMap$1 as fileExtensionIconMap, getIconForExtension$1 as getIconForExtension, getIconForFile$1 as getIconForFile, iconColorMap$1 as iconColorMap, lucideIconMap$1 as lucideIconMap, resolveIcon$1 as resolveIcon } from "./iconMap-
|
|
1
|
+
import { contextMenuIconMap$1 as contextMenuIconMap, fileExtensionIconMap$1 as fileExtensionIconMap, getIconForExtension$1 as getIconForExtension, getIconForFile$1 as getIconForFile, iconColorMap$1 as iconColorMap, lucideIconMap$1 as lucideIconMap, resolveIcon$1 as resolveIcon } from "./iconMap-DDpe35ek.js";
|
|
2
2
|
import "./icons-CIsIOZXR.js";
|
|
3
3
|
|
|
4
4
|
export { contextMenuIconMap, fileExtensionIconMap, getIconForExtension, getIconForFile, iconColorMap, lucideIconMap, resolveIcon };
|
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
import React$1, { Component,
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
1
|
+
import React$1, { Component, ReactNode } from "react";
|
|
2
|
+
import * as mobx4 from "mobx";
|
|
3
|
+
import * as mobx5 from "mobx";
|
|
4
|
+
import * as mobx6 from "mobx";
|
|
5
|
+
import * as mobx7 from "mobx";
|
|
6
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
7
|
+
import * as mobx_dist_internal8 from "mobx/dist/internal";
|
|
8
|
+
import * as mobx_dist_internal9 from "mobx/dist/internal";
|
|
9
|
+
import * as mobx_dist_internal10 from "mobx/dist/internal";
|
|
10
|
+
import * as mobx_dist_internal11 from "mobx/dist/internal";
|
|
11
|
+
import * as mobx_dist_internal12 from "mobx/dist/internal";
|
|
12
|
+
import * as mobx_dist_internal13 from "mobx/dist/internal";
|
|
13
13
|
|
|
14
|
+
//#region src/shared/ErrorBoundary.d.ts
|
|
15
|
+
interface ErrorBoundaryProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
fallback?: (error: Error, errorInfo: string, onReset: () => void) => ReactNode;
|
|
18
|
+
onError?: (error: Error, errorInfo: string) => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
interface ErrorBoundaryState {
|
|
22
|
+
hasError: boolean;
|
|
23
|
+
error: Error | null;
|
|
24
|
+
errorInfo: string | null;
|
|
25
|
+
}
|
|
26
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
27
|
+
constructor(props: ErrorBoundaryProps);
|
|
28
|
+
static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
|
|
29
|
+
componentDidCatch(error: Error, errorInfo: React$1.ErrorInfo): void;
|
|
30
|
+
handleReset: () => void;
|
|
31
|
+
render(): string | number | bigint | boolean | react_jsx_runtime3.JSX.Element | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null | undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
14
35
|
//#region src/list/types/ListTypes.d.ts
|
|
15
|
-
/**
|
|
16
|
-
* Core Type Definitions for ListItemsComponent
|
|
17
|
-
*
|
|
18
|
-
* Defines the fundamental interfaces and types used throughout the component.
|
|
19
|
-
* These types support the provider pattern and multiple view types.
|
|
20
|
-
*/
|
|
21
36
|
/**
|
|
22
37
|
* Core Type Definitions for ListItemsComponent
|
|
23
38
|
*
|
|
@@ -453,16 +468,16 @@ declare class ListItemsModel implements ListItemsProviderListener {
|
|
|
453
468
|
provider: ListItemsProvider;
|
|
454
469
|
currentViewType: ListViewType;
|
|
455
470
|
_allItems: ListItemData[];
|
|
456
|
-
itemMap:
|
|
471
|
+
itemMap: mobx4.ObservableMap<string, ListItemData>;
|
|
457
472
|
totalItemCount: number;
|
|
458
473
|
searchQuery: string;
|
|
459
|
-
selectedItems:
|
|
474
|
+
selectedItems: mobx5.ObservableMap<string, ListItemData>;
|
|
460
475
|
previousSelection: ListItemData[];
|
|
461
476
|
focusedItem: string | null;
|
|
462
477
|
selectionAnchor: string | null;
|
|
463
478
|
isLoading: boolean;
|
|
464
|
-
loadingRanges:
|
|
465
|
-
errors:
|
|
479
|
+
loadingRanges: mobx6.ObservableMap<string, boolean>;
|
|
480
|
+
errors: mobx7.ObservableMap<string, Error>;
|
|
466
481
|
viewportRange: {
|
|
467
482
|
start: number;
|
|
468
483
|
end: number;
|
|
@@ -517,23 +532,23 @@ declare class ListItemsModel implements ListItemsProviderListener {
|
|
|
517
532
|
get totalPages(): number;
|
|
518
533
|
get hasNextPage(): boolean;
|
|
519
534
|
get hasPreviousPage(): boolean;
|
|
520
|
-
goToPage: (page: number) =>
|
|
521
|
-
nextPage: () =>
|
|
522
|
-
prevPage: () =>
|
|
535
|
+
goToPage: (page: number) => mobx_dist_internal8.CancellablePromise<void>;
|
|
536
|
+
nextPage: () => mobx_dist_internal9.CancellablePromise<void>;
|
|
537
|
+
prevPage: () => mobx_dist_internal10.CancellablePromise<void>;
|
|
523
538
|
setPageSize(size: number): void;
|
|
524
539
|
/**
|
|
525
540
|
* Load items from the provider
|
|
526
541
|
* Uses MobX flow for proper async action handling
|
|
527
542
|
*/
|
|
528
|
-
loadItems: (options?: ListLoadOptions | undefined) =>
|
|
543
|
+
loadItems: (options?: ListLoadOptions | undefined) => mobx_dist_internal11.CancellablePromise<void>;
|
|
529
544
|
/**
|
|
530
545
|
* Load a specific range of items for virtualization
|
|
531
546
|
*/
|
|
532
|
-
loadItemRange: (start: number, end: number) =>
|
|
547
|
+
loadItemRange: (start: number, end: number) => mobx_dist_internal12.CancellablePromise<void>;
|
|
533
548
|
/**
|
|
534
549
|
* Refresh items from provider
|
|
535
550
|
*/
|
|
536
|
-
refresh: () =>
|
|
551
|
+
refresh: () => mobx_dist_internal13.CancellablePromise<void>;
|
|
537
552
|
/**
|
|
538
553
|
* Select a single item with proper single/multi-selection logic
|
|
539
554
|
*/
|
|
@@ -1006,31 +1021,9 @@ declare const LoadingIndicator: React$1.FunctionComponent<LoadingIndicatorProps>
|
|
|
1006
1021
|
declare const InlineLoading: React$1.FunctionComponent<InlineLoadingProps>;
|
|
1007
1022
|
declare const LoadingProgress: React$1.FunctionComponent<LoadingProgressProps>;
|
|
1008
1023
|
|
|
1009
|
-
//#endregion
|
|
1010
|
-
//#region src/list/components/shared/ErrorBoundary.d.ts
|
|
1011
|
-
//# sourceMappingURL=LoadingIndicator.d.ts.map
|
|
1012
|
-
interface ErrorBoundaryProps {
|
|
1013
|
-
children: ReactNode;
|
|
1014
|
-
fallback?: (error: Error, errorInfo: ErrorInfo) => ReactNode;
|
|
1015
|
-
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
1016
|
-
className?: string;
|
|
1017
|
-
}
|
|
1018
|
-
interface ErrorBoundaryState {
|
|
1019
|
-
hasError: boolean;
|
|
1020
|
-
error: Error | null;
|
|
1021
|
-
errorInfo: ErrorInfo | null;
|
|
1022
|
-
}
|
|
1023
|
-
declare class ListErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
1024
|
-
constructor(props: ErrorBoundaryProps);
|
|
1025
|
-
static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
|
|
1026
|
-
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
1027
|
-
handleRetry: () => void;
|
|
1028
|
-
render(): string | number | bigint | boolean | react_jsx_runtime14.JSX.Element | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null | undefined;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
1024
|
//#endregion
|
|
1032
1025
|
//#region src/list/components/shared/ErrorDisplay.d.ts
|
|
1033
|
-
//# sourceMappingURL=
|
|
1026
|
+
//# sourceMappingURL=LoadingIndicator.d.ts.map
|
|
1034
1027
|
interface ErrorDisplayProps {
|
|
1035
1028
|
error: Error | string;
|
|
1036
1029
|
title?: string;
|
|
@@ -1477,5 +1470,5 @@ declare const MASONRY_PRESETS: {
|
|
|
1477
1470
|
//#endregion
|
|
1478
1471
|
//# sourceMappingURL=MasonryLayoutCalculator.d.ts.map
|
|
1479
1472
|
|
|
1480
|
-
export { AccessibilityConfig, BenchmarkReport, BenchmarkResult, CalculatedGridView as CalculatedGridView$1, DETAILS_VIEW_TYPE as DETAILS_VIEW_TYPE$1, EmptyState as EmptyState$1, ErrorDisplay as ErrorDisplay$1, FocusManager as FocusManager$1, GRID_PRESETS as GRID_PRESETS$1, GRID_VIEW_TYPE as GRID_VIEW_TYPE$1, GridItemLayout, GridLayoutCalculator as GridLayoutCalculator$1, GridLayoutConfig, GridLayoutResult, InlineLoading as InlineLoading$1, ItemAccessibilityConfig, KeyboardNavigationConfig, KeyboardNavigationOptions, LIST_VIEW_TYPE as LIST_VIEW_TYPE$1, ListContextMenu as ListContextMenu$1, ListContextMenuItem, ListDragDropInfo, ListError,
|
|
1481
|
-
//# sourceMappingURL=index-
|
|
1473
|
+
export { AccessibilityConfig, BenchmarkReport, BenchmarkResult, CalculatedGridView as CalculatedGridView$1, DETAILS_VIEW_TYPE as DETAILS_VIEW_TYPE$1, EmptyState as EmptyState$1, ErrorBoundary as ErrorBoundary$1, ErrorBoundaryProps, ErrorDisplay as ErrorDisplay$1, FocusManager as FocusManager$1, GRID_PRESETS as GRID_PRESETS$1, GRID_VIEW_TYPE as GRID_VIEW_TYPE$1, GridItemLayout, GridLayoutCalculator as GridLayoutCalculator$1, GridLayoutConfig, GridLayoutResult, InlineLoading as InlineLoading$1, ItemAccessibilityConfig, KeyboardNavigationConfig, KeyboardNavigationOptions, LIST_VIEW_TYPE as LIST_VIEW_TYPE$1, ListContextMenu as ListContextMenu$1, ListContextMenuItem, ListDragDropInfo, ListError, ListItem as ListItem$1, ListItemData, ListItemProps, ListItemRenderer, ListItems as ListItems$1, ListItemsModel as ListItemsModel$1, ListItemsProps, ListItemsProvider, ListItemsProviderListener, ListKeyboardHandler as ListKeyboardHandler$1, ListLoadOptions, ListLoadResult, ListLoader as ListLoader$1, ListSelectionInfo, ListViewType, ListViewType$1, LoadError as LoadError$1, LoadingIndicator as LoadingIndicator$1, LoadingProgress as LoadingProgress$1, MASONRY_HORIZONTAL_VIEW_TYPE as MASONRY_HORIZONTAL_VIEW_TYPE$1, MASONRY_PRESETS as MASONRY_PRESETS$1, MASONRY_VERTICAL_VIEW_TYPE as MASONRY_VERTICAL_VIEW_TYPE$1, MasonryItemData, MasonryItemLayout, MasonryLayoutCalculator as MasonryLayoutCalculator$1, MasonryLayoutConfig, MasonryLayoutResult, MasonryView as MasonryView$1, NetworkError as NetworkError$1, NoItems as NoItems$1, NoSearchResults as NoSearchResults$1, NoSelection as NoSelection$1, SearchFilter as SearchFilter$1, TREEMAP_VIEW_TYPE as TREEMAP_VIEW_TYPE$1, TestListProvider as TestListProvider$1, ThumbnailSize, TreemapModel as TreemapModel$1, TreemapNodeData, TreemapScanProgress, TreemapView as TreemapView$1, ViewSizeControls as ViewSizeControls$1, ViewTypeSelector as ViewTypeSelector$1, ViewTypeSelectorProps, VirtualizationConfig, VirtualizedGrid as VirtualizedGrid$1, VirtualizedGridProps, VirtualizedList as VirtualizedList$1, VirtualizedListProps, announceToScreenReader as announceToScreenReader$1, benchmark as benchmark$1, benchmarkLogger as benchmarkLogger$1, createGridCalculator as createGridCalculator$1, createLiveRegionAnnouncement as createLiveRegionAnnouncement$1, createMasonryCalculator as createMasonryCalculator$1, getItemAccessibilityProps as getItemAccessibilityProps$1, getListAccessibilityProps as getListAccessibilityProps$1, getNextFocusIndex as getNextFocusIndex$1, useListKeyboard as useListKeyboard$1 };
|
|
1474
|
+
//# sourceMappingURL=index-BP4IYXiF.d.ts.map
|