@powerhousedao/design-system 6.0.0-dev.191 → 6.0.0-dev.193
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/{command-Cl1OUbPV.d.ts → command-CnlOErMD.d.ts} +9 -9
- package/dist/command-CnlOErMD.d.ts.map +1 -0
- package/dist/connect/index.js +1 -1
- package/dist/{connect-9ej7S5NE.js → connect-DAOux5MY.js} +256 -12
- package/dist/connect-DAOux5MY.js.map +1 -0
- package/dist/{enum-field-Dw-mnOL_.d.ts → enum-field-B1adv_D3.d.ts} +2 -2
- package/dist/{enum-field-Dw-mnOL_.d.ts.map → enum-field-B1adv_D3.d.ts.map} +1 -1
- package/dist/index-CeKkrAgh.d.ts.map +1 -1
- package/dist/{radio-group-field-B6LrhnJT.d.ts → radio-group-field-BzsCboki.d.ts} +2 -2
- package/dist/{radio-group-field-B6LrhnJT.d.ts.map → radio-group-field-BzsCboki.d.ts.map} +1 -1
- package/dist/rwa/index.js +1 -1
- package/dist/{search-autocomplete-BwP4baRe.d.ts → search-autocomplete-C8QQB3YW.d.ts} +2 -2
- package/dist/{search-autocomplete-BwP4baRe.d.ts.map → search-autocomplete-C8QQB3YW.d.ts.map} +1 -1
- package/dist/style.css +49 -0
- package/dist/{types-bVze9lWE.d.ts → types-BghCtHb5.d.ts} +12 -2
- package/dist/types-BghCtHb5.d.ts.map +1 -0
- package/dist/ui/components/command/command.d.ts +1 -1
- package/dist/ui/components/enum-field/enum-field.d.ts +1 -1
- package/dist/ui/components/index.d.ts +7 -7
- package/dist/ui/components/radio-group-field/radio-group-field.d.ts +1 -1
- package/dist/ui/components/search-autocomplete/index.d.ts +4 -4
- package/dist/ui/components/search-autocomplete/search-autocomplete.d.ts +1 -1
- package/dist/ui/components/search-autocomplete/search-autocomplete.js +62 -40
- package/dist/ui/components/search-autocomplete/search-autocomplete.js.map +1 -1
- package/dist/ui/components/search-autocomplete/types.d.ts +2 -2
- package/dist/ui/components/search-autocomplete/use-search-autocomplete.d.ts +1 -1
- package/dist/ui/index.d.ts +7 -7
- package/dist/{use-search-autocomplete-pbku_c5c.d.ts → use-search-autocomplete-DNPhMdWQ.d.ts} +2 -2
- package/dist/{use-search-autocomplete-pbku_c5c.d.ts.map → use-search-autocomplete-DNPhMdWQ.d.ts.map} +1 -1
- package/package.json +5 -5
- package/dist/command-Cl1OUbPV.d.ts.map +0 -1
- package/dist/connect-9ej7S5NE.js.map +0 -1
- package/dist/types-bVze9lWE.d.ts.map +0 -1
|
@@ -7,7 +7,7 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
|
7
7
|
ref?: React.Ref<HTMLDivElement>;
|
|
8
8
|
} & {
|
|
9
9
|
asChild?: boolean;
|
|
10
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
10
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
11
11
|
label?: string;
|
|
12
12
|
shouldFilter?: boolean;
|
|
13
13
|
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -18,11 +18,11 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
|
18
18
|
disablePointerSelection?: boolean;
|
|
19
19
|
vimBindings?: boolean;
|
|
20
20
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
-
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof React.InputHTMLAttributes<HTMLInputElement
|
|
21
|
+
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
|
22
22
|
ref?: React.Ref<HTMLInputElement>;
|
|
23
23
|
} & {
|
|
24
24
|
asChild?: boolean;
|
|
25
|
-
}, keyof React.InputHTMLAttributes<HTMLInputElement
|
|
25
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
|
|
26
26
|
value?: string;
|
|
27
27
|
onValueChange?: (search: string) => void;
|
|
28
28
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & {
|
|
@@ -34,7 +34,7 @@ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
|
34
34
|
ref?: React.Ref<HTMLDivElement>;
|
|
35
35
|
} & {
|
|
36
36
|
asChild?: boolean;
|
|
37
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
37
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
38
38
|
label?: string;
|
|
39
39
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
40
|
declare const CommandLoading: React.ForwardRefExoticComponent<Omit<{
|
|
@@ -43,7 +43,7 @@ declare const CommandLoading: React.ForwardRefExoticComponent<Omit<{
|
|
|
43
43
|
ref?: React.Ref<HTMLDivElement>;
|
|
44
44
|
} & {
|
|
45
45
|
asChild?: boolean;
|
|
46
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
46
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
47
47
|
progress?: number;
|
|
48
48
|
label?: string;
|
|
49
49
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -53,14 +53,14 @@ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
|
53
53
|
ref?: React.Ref<HTMLDivElement>;
|
|
54
54
|
} & {
|
|
55
55
|
asChild?: boolean;
|
|
56
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
56
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
57
57
|
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
58
58
|
children?: React.ReactNode;
|
|
59
59
|
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
60
60
|
ref?: React.Ref<HTMLDivElement>;
|
|
61
61
|
} & {
|
|
62
62
|
asChild?: boolean;
|
|
63
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
63
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
|
|
64
64
|
heading?: React.ReactNode;
|
|
65
65
|
value?: string;
|
|
66
66
|
forceMount?: boolean;
|
|
@@ -71,7 +71,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
|
71
71
|
ref?: React.Ref<HTMLDivElement>;
|
|
72
72
|
} & {
|
|
73
73
|
asChild?: boolean;
|
|
74
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
74
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
|
|
75
75
|
disabled?: boolean;
|
|
76
76
|
onSelect?: (value: string) => void;
|
|
77
77
|
value?: string;
|
|
@@ -80,4 +80,4 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
|
80
80
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
81
81
|
//#endregion
|
|
82
82
|
export { CommandItem as a, CommandInput as i, CommandEmpty as n, CommandList as o, CommandGroup as r, CommandLoading as s, Command as t };
|
|
83
|
-
//# sourceMappingURL=command-
|
|
83
|
+
//# sourceMappingURL=command-CnlOErMD.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-CnlOErMD.d.ts","names":[],"sources":["../src/ui/components/command/command.tsx"],"mappings":";;;cAIM,OAAA,EAAO,KAAA,CAAA,yBAAA,CAAA,IAAA;;;;;;;;;;;;;;;;;cAeP,YAAA,EAAY,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,IAAA,CAAA,IAAA,CAAA,KAAA,CAAA,iBAAA,CAAA,KAAA,CAAA,mBAAA,CAAA,gBAAA,GAAA,gBAAA,iBAAA,KAAA,CAAA,mBAAA,CAAA,gBAAA;;;;;;;;;;cA2CZ,WAAA,EAAW,KAAA,CAAA,yBAAA,CAAA,IAAA;;;;;;;;;cAqBX,cAAA,EAAc,KAAA,CAAA,yBAAA,CAAA,IAAA;;;;;;;;;;cAMd,YAAA,EAAY,KAAA,CAAA,yBAAA,CAAA,IAAA;;;;;;;cAMZ,YAAA,EAAY,KAAA,CAAA,yBAAA,CAAA,IAAA;;;;;;;;;;;cAgBZ,WAAA,EAAW,KAAA,CAAA,yBAAA,CAAA,IAAA"}
|
package/dist/connect/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as HomeScreenItem, $t as Combobox, A as About, At as ConnectDropdownMenu, B as ProcessorsInspector, Bt as ConnectTooltip, C as PackageManager, Ct as nodeOptionsMap, D as DefaultEditor, Dt as ENSAvatar, E as PackageManagerInput, Et as sharingTypeOptions, F as InspectorModal, Ft as UploadFileItem, G as CreateDocumentModal, Gt as Divider, H as DriveSettingsModal, Ht as DocumentStateViewer, I as RemotesInspector, It as ConnectReplaceDuplicateModal, J as AddDriveModal, Jt as DebugInspector, K as AddRemoteDriveModal, Kt as Disclosure, L as ChannelInspector, Lt as useDrop, M as verifyPackageJsonFields, Mt as DropZone, N as ReadRequiredModal, Nt as UploadFileListContainer, O as DefaultEditorSelect, Ot as EditorUndoRedoButtons, P as PackageInstallModal, Pt as UploadFileList, Q as HomeScreenAddDriveItem, Qt as CookieBanner, R as ConnectionStateBadge, Rt as DocumentToolbar, S as SettingsModal, St as nodeOptions, T as PackageManagerListItem, Tt as normalNodeOptionsMap, U as ConnectDeleteItemModal, Ut as Tabs, V as ObjectInspectorModal, Vt as ConnectTooltipProvider, W as ConnectDeleteDriveModal, Wt as TabContent, X as IntegrityInspector, Xt as ConnectSelect, Y as LoadingScreen, Yt as DBExplorer, Z as HomeScreen, Zt as ConnectConfirmationModal, _ as formatEthAddress, _t as debugNodeOptions, a as ToastContainer, at as Footer, b as ClearStorageSettingsRow, bt as defaultNodeOptions, c as ConnectSidebar, ct as FileItem, d as SidebarUser, dt as ERROR, en as Breadcrumb, et as HomeBackgroundImage, f as SidebarLogin, ft as INITIAL_SYNC, g as RevisionHistory, gt as syncStatuses, h as ConnectSearchBar, ht as SYNCING, i as useEns, in as AccountPopover, it as FormInput, j as DependencyVersions, jt as DropZoneWrapper, k as DangerZone, kt as EditorActionButtons, l as ConnectSidebarHeader, lt as SyncStatusIcon, m as SidebarItem, mt as SUCCESS, n as removeSuccessFiles, nn as NodeInput, nt as AddLocalDriveForm, o as isConnectTypeOptions, ot as FooterLink, p as SidebarAddDriveItem, pt as MISSING, q as AddLocalDriveModal, qt as DefaultEditorLoader, r as sortFilesByStatus, rn as AnimatedLoader, rt as Toggle, s as toast, st as FolderItem, t as getFolderStatus, tn as Breadcrumbs, tt as AddRemoteDriveForm, u as ConnectSidebarFooter, ut as CONFLICT, v as ConnectUpgradeDriveModal, vt as debugNodeOptionsMap, w as PackageManagerList, wt as normalNodeOptions, x as SettingsRow, xt as locationInfoByLocation, y as SettingsModalOld, yt as defaultDriveOptions, z as QueueInspector, zt as DocumentTimeline } from "../connect-
|
|
1
|
+
import { $ as HomeScreenItem, $t as Combobox, A as About, At as ConnectDropdownMenu, B as ProcessorsInspector, Bt as ConnectTooltip, C as PackageManager, Ct as nodeOptionsMap, D as DefaultEditor, Dt as ENSAvatar, E as PackageManagerInput, Et as sharingTypeOptions, F as InspectorModal, Ft as UploadFileItem, G as CreateDocumentModal, Gt as Divider, H as DriveSettingsModal, Ht as DocumentStateViewer, I as RemotesInspector, It as ConnectReplaceDuplicateModal, J as AddDriveModal, Jt as DebugInspector, K as AddRemoteDriveModal, Kt as Disclosure, L as ChannelInspector, Lt as useDrop, M as verifyPackageJsonFields, Mt as DropZone, N as ReadRequiredModal, Nt as UploadFileListContainer, O as DefaultEditorSelect, Ot as EditorUndoRedoButtons, P as PackageInstallModal, Pt as UploadFileList, Q as HomeScreenAddDriveItem, Qt as CookieBanner, R as ConnectionStateBadge, Rt as DocumentToolbar, S as SettingsModal, St as nodeOptions, T as PackageManagerListItem, Tt as normalNodeOptionsMap, U as ConnectDeleteItemModal, Ut as Tabs, V as ObjectInspectorModal, Vt as ConnectTooltipProvider, W as ConnectDeleteDriveModal, Wt as TabContent, X as IntegrityInspector, Xt as ConnectSelect, Y as LoadingScreen, Yt as DBExplorer, Z as HomeScreen, Zt as ConnectConfirmationModal, _ as formatEthAddress, _t as debugNodeOptions, a as ToastContainer, at as Footer, b as ClearStorageSettingsRow, bt as defaultNodeOptions, c as ConnectSidebar, ct as FileItem, d as SidebarUser, dt as ERROR, en as Breadcrumb, et as HomeBackgroundImage, f as SidebarLogin, ft as INITIAL_SYNC, g as RevisionHistory, gt as syncStatuses, h as ConnectSearchBar, ht as SYNCING, i as useEns, in as AccountPopover, it as FormInput, j as DependencyVersions, jt as DropZoneWrapper, k as DangerZone, kt as EditorActionButtons, l as ConnectSidebarHeader, lt as SyncStatusIcon, m as SidebarItem, mt as SUCCESS, n as removeSuccessFiles, nn as NodeInput, nt as AddLocalDriveForm, o as isConnectTypeOptions, ot as FooterLink, p as SidebarAddDriveItem, pt as MISSING, q as AddLocalDriveModal, qt as DefaultEditorLoader, r as sortFilesByStatus, rn as AnimatedLoader, rt as Toggle, s as toast, st as FolderItem, t as getFolderStatus, tn as Breadcrumbs, tt as AddRemoteDriveForm, u as ConnectSidebarFooter, ut as CONFLICT, v as ConnectUpgradeDriveModal, vt as debugNodeOptionsMap, w as PackageManagerList, wt as normalNodeOptions, x as SettingsRow, xt as locationInfoByLocation, y as SettingsModalOld, yt as defaultDriveOptions, z as QueueInspector, zt as DocumentTimeline } from "../connect-DAOux5MY.js";
|
|
2
2
|
export { About, AccountPopover, AddDriveModal, AddLocalDriveForm, AddLocalDriveModal, AddRemoteDriveForm, AddRemoteDriveModal, AnimatedLoader, Breadcrumb, Breadcrumbs, CONFLICT, ChannelInspector, ClearStorageSettingsRow, Combobox, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, InspectorModal, IntegrityInspector, LoadingScreen, MISSING, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageManager, PackageManagerInput, PackageManagerList, PackageManagerListItem, ProcessorsInspector, QueueInspector, ReadRequiredModal, RemotesInspector, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SettingsModalOld, SettingsRow, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ToastContainer, Toggle, UploadFileItem, UploadFileList, UploadFileListContainer, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, formatEthAddress, getFolderStatus, isConnectTypeOptions, locationInfoByLocation, nodeOptions, nodeOptionsMap, normalNodeOptions, normalNodeOptionsMap, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, toast, useDrop, useEns, verifyPackageJsonFields };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { C as DropdownMenuTrigger, b as DropdownMenuContent, c as SidebarFooter, d as Pagination, f as mergeClassNameProps, g as getDimensions, h as Icon, l as SidebarHeader, m as Modal, p as PackageAnimation, r as usePagination, s as Sidebar, t as cn, u as SidebarPanel, w as PowerhouseButton, x as DropdownMenuItem, y as DropdownMenu } from "./src-BwsYkPPG.js";
|
|
2
2
|
import { Popover, PopoverContent, PopoverTrigger } from "./ui/components/popover/popover.js";
|
|
3
3
|
import { SelectFieldRaw } from "./ui/components/select-field/select-field.js";
|
|
4
|
+
import { Input } from "./ui/components/input/input.js";
|
|
4
5
|
import { JsonViewer } from "./ui/components/json-viewer/json-viewer.js";
|
|
5
6
|
import { SearchAutocomplete } from "./ui/components/search-autocomplete/search-autocomplete.js";
|
|
6
7
|
import React, { Fragment, createElement, forwardRef, memo, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
@@ -6653,26 +6654,247 @@ function buildPackageSpec(name, tag) {
|
|
|
6653
6654
|
return tag ? `${name}@${tag}` : name;
|
|
6654
6655
|
}
|
|
6655
6656
|
//#endregion
|
|
6657
|
+
//#region src/connect/components/modal/settings-modal-v2/package-manager/version-picker.tsx
|
|
6658
|
+
function resolveDefaultVersionSelection(options) {
|
|
6659
|
+
const { distTags, versions, version, preferredTag } = options;
|
|
6660
|
+
if (preferredTag && distTags && preferredTag in distTags) return {
|
|
6661
|
+
kind: "tag",
|
|
6662
|
+
value: preferredTag
|
|
6663
|
+
};
|
|
6664
|
+
if (distTags?.latest) return {
|
|
6665
|
+
kind: "tag",
|
|
6666
|
+
value: "latest"
|
|
6667
|
+
};
|
|
6668
|
+
const firstTag = distTags ? Object.keys(distTags)[0] : void 0;
|
|
6669
|
+
if (firstTag) return {
|
|
6670
|
+
kind: "tag",
|
|
6671
|
+
value: firstTag
|
|
6672
|
+
};
|
|
6673
|
+
if (versions && versions.length > 0) return {
|
|
6674
|
+
kind: "version",
|
|
6675
|
+
value: versions[versions.length - 1]
|
|
6676
|
+
};
|
|
6677
|
+
return {
|
|
6678
|
+
kind: "tag",
|
|
6679
|
+
value: version ?? "latest"
|
|
6680
|
+
};
|
|
6681
|
+
}
|
|
6682
|
+
const VersionPicker = (props) => {
|
|
6683
|
+
const { distTags, versions, selected, onChange, disabled, className } = props;
|
|
6684
|
+
const [open, setOpen] = useState(false);
|
|
6685
|
+
const [query, setQuery] = useState("");
|
|
6686
|
+
const tagEntries = useMemo(() => distTags ? Object.entries(distTags) : [], [distTags]);
|
|
6687
|
+
const filteredTags = useMemo(() => {
|
|
6688
|
+
const needle = query.trim().toLowerCase();
|
|
6689
|
+
if (!needle) return tagEntries;
|
|
6690
|
+
return tagEntries.filter(([tag, ver]) => tag.toLowerCase().includes(needle) || ver.toLowerCase().includes(needle));
|
|
6691
|
+
}, [tagEntries, query]);
|
|
6692
|
+
const filteredVersions = useMemo(() => {
|
|
6693
|
+
const all = versions ?? [];
|
|
6694
|
+
const needle = query.trim().toLowerCase();
|
|
6695
|
+
if (!needle) return all.slice().reverse();
|
|
6696
|
+
return all.filter((v) => v.toLowerCase().includes(needle)).reverse();
|
|
6697
|
+
}, [versions, query]);
|
|
6698
|
+
const hasAnyPickable = tagEntries.length > 0 || (versions?.length ?? 0) > 0;
|
|
6699
|
+
const triggerLabel = selected.value;
|
|
6700
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
6701
|
+
open: open && !disabled,
|
|
6702
|
+
onOpenChange: (next) => {
|
|
6703
|
+
setOpen(next);
|
|
6704
|
+
if (!next) setQuery("");
|
|
6705
|
+
},
|
|
6706
|
+
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
6707
|
+
disabled: disabled || !hasAnyPickable,
|
|
6708
|
+
className: cn("flex items-center justify-between gap-2 rounded-md border border-gray-300 bg-white px-2.5 py-1 text-xs font-medium text-gray-800 transition-colors", "hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900/20", "disabled:cursor-not-allowed disabled:opacity-60", className),
|
|
6709
|
+
"data-version-picker-trigger": true,
|
|
6710
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6711
|
+
className: "truncate",
|
|
6712
|
+
children: triggerLabel
|
|
6713
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
6714
|
+
name: "ChevronDown",
|
|
6715
|
+
size: 12,
|
|
6716
|
+
className: "shrink-0 text-gray-500"
|
|
6717
|
+
})]
|
|
6718
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
6719
|
+
"data-version-picker": true,
|
|
6720
|
+
align: "start",
|
|
6721
|
+
sideOffset: 4,
|
|
6722
|
+
className: "w-56 p-0",
|
|
6723
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
6724
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
6725
|
+
className: "border-b border-gray-200 p-2",
|
|
6726
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
6727
|
+
className: "relative",
|
|
6728
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
6729
|
+
name: "Search",
|
|
6730
|
+
size: 14,
|
|
6731
|
+
className: "absolute left-2 top-1/2 -translate-y-1/2 text-gray-400"
|
|
6732
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
6733
|
+
value: query,
|
|
6734
|
+
onChange: (e) => setQuery(e.target.value),
|
|
6735
|
+
placeholder: "Search versions...",
|
|
6736
|
+
className: "h-8 pl-7 text-xs"
|
|
6737
|
+
})]
|
|
6738
|
+
})
|
|
6739
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6740
|
+
className: "max-h-60 overflow-y-auto py-1",
|
|
6741
|
+
children: [
|
|
6742
|
+
filteredTags.length === 0 && filteredVersions.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
6743
|
+
className: "px-3 py-4 text-center text-xs text-gray-500",
|
|
6744
|
+
children: "No matches."
|
|
6745
|
+
}),
|
|
6746
|
+
filteredTags.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
6747
|
+
className: "pb-1",
|
|
6748
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
6749
|
+
className: "px-3 py-1 text-[11px] font-semibold uppercase tracking-wide text-gray-500",
|
|
6750
|
+
children: "Tags"
|
|
6751
|
+
}), filteredTags.map(([tag, ver]) => {
|
|
6752
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
6753
|
+
type: "button",
|
|
6754
|
+
onClick: () => {
|
|
6755
|
+
onChange({
|
|
6756
|
+
kind: "tag",
|
|
6757
|
+
value: tag
|
|
6758
|
+
});
|
|
6759
|
+
setOpen(false);
|
|
6760
|
+
setQuery("");
|
|
6761
|
+
},
|
|
6762
|
+
className: cn("flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-xs transition-colors", "hover:bg-gray-100", selected.kind === "tag" && selected.value === tag && "bg-gray-100 font-semibold"),
|
|
6763
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6764
|
+
className: "truncate text-gray-900",
|
|
6765
|
+
children: tag
|
|
6766
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6767
|
+
className: "truncate text-gray-500",
|
|
6768
|
+
children: ver
|
|
6769
|
+
})]
|
|
6770
|
+
}, `tag:${tag}`);
|
|
6771
|
+
})]
|
|
6772
|
+
}),
|
|
6773
|
+
filteredVersions.length > 0 && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
6774
|
+
className: "px-3 py-1 text-[11px] font-semibold uppercase tracking-wide text-gray-500",
|
|
6775
|
+
children: "Versions"
|
|
6776
|
+
}), filteredVersions.map((ver) => {
|
|
6777
|
+
return /* @__PURE__ */ jsx("button", {
|
|
6778
|
+
type: "button",
|
|
6779
|
+
onClick: () => {
|
|
6780
|
+
onChange({
|
|
6781
|
+
kind: "version",
|
|
6782
|
+
value: ver
|
|
6783
|
+
});
|
|
6784
|
+
setOpen(false);
|
|
6785
|
+
setQuery("");
|
|
6786
|
+
},
|
|
6787
|
+
className: cn("flex w-full items-center px-3 py-1.5 text-left text-xs transition-colors", "hover:bg-gray-100", selected.kind === "version" && selected.value === ver && "bg-gray-100 font-semibold"),
|
|
6788
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
6789
|
+
className: "truncate text-gray-900",
|
|
6790
|
+
children: ver
|
|
6791
|
+
})
|
|
6792
|
+
}, `ver:${ver}`);
|
|
6793
|
+
})] })
|
|
6794
|
+
]
|
|
6795
|
+
})]
|
|
6796
|
+
})]
|
|
6797
|
+
});
|
|
6798
|
+
};
|
|
6799
|
+
//#endregion
|
|
6656
6800
|
//#region src/connect/components/modal/settings-modal-v2/package-manager/package-manager-input.tsx
|
|
6657
6801
|
const NPM_NAME_RE = /^@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*$|^[a-z0-9][a-z0-9._-]*$/i;
|
|
6658
6802
|
function isPlausiblePackageName(name) {
|
|
6659
6803
|
return name.length >= 2 && NPM_NAME_RE.test(name);
|
|
6660
6804
|
}
|
|
6805
|
+
function PackageResultCard(props) {
|
|
6806
|
+
const { option, ctx, typedTag } = props;
|
|
6807
|
+
const { selectingValue, selectLabel, selectingContent, handleSelect } = ctx;
|
|
6808
|
+
const baseName = option.label.split(" @ ")[0] ?? option.value;
|
|
6809
|
+
const hasVersionMetadata = option.distTags && Object.keys(option.distTags).length > 0 || (option.versions?.length ?? 0) > 0;
|
|
6810
|
+
const [selected, setSelected] = useState(() => resolveDefaultVersionSelection({
|
|
6811
|
+
distTags: option.distTags,
|
|
6812
|
+
versions: option.versions,
|
|
6813
|
+
version: option.version,
|
|
6814
|
+
preferredTag: typedTag
|
|
6815
|
+
}));
|
|
6816
|
+
useEffect(() => {
|
|
6817
|
+
if (!typedTag) return;
|
|
6818
|
+
if (option.distTags && typedTag in option.distTags) setSelected({
|
|
6819
|
+
kind: "tag",
|
|
6820
|
+
value: typedTag
|
|
6821
|
+
});
|
|
6822
|
+
else if (option.versions?.includes(typedTag)) setSelected({
|
|
6823
|
+
kind: "version",
|
|
6824
|
+
value: typedTag
|
|
6825
|
+
});
|
|
6826
|
+
}, [
|
|
6827
|
+
typedTag,
|
|
6828
|
+
option.distTags,
|
|
6829
|
+
option.versions
|
|
6830
|
+
]);
|
|
6831
|
+
const installSpec = hasVersionMetadata ? buildPackageSpec(baseName, selected.value) : option.value;
|
|
6832
|
+
const isSelecting = selectingValue === installSpec;
|
|
6833
|
+
const isDisabled = option.disabled === true;
|
|
6834
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6835
|
+
className: "flex items-start justify-between gap-3 rounded-md px-2 py-2 hover:bg-gray-50",
|
|
6836
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6837
|
+
className: "min-w-0 flex-1",
|
|
6838
|
+
children: [
|
|
6839
|
+
/* @__PURE__ */ jsx("p", {
|
|
6840
|
+
className: "truncate text-sm font-medium text-gray-900",
|
|
6841
|
+
children: baseName
|
|
6842
|
+
}),
|
|
6843
|
+
option.description && /* @__PURE__ */ jsx("p", {
|
|
6844
|
+
className: "truncate text-xs text-gray-500",
|
|
6845
|
+
children: option.description
|
|
6846
|
+
}),
|
|
6847
|
+
option.meta && /* @__PURE__ */ jsx("p", {
|
|
6848
|
+
className: "truncate text-xs text-gray-400",
|
|
6849
|
+
children: option.meta
|
|
6850
|
+
}),
|
|
6851
|
+
hasVersionMetadata && /* @__PURE__ */ jsx("div", {
|
|
6852
|
+
className: "mt-2",
|
|
6853
|
+
children: /* @__PURE__ */ jsx(VersionPicker, {
|
|
6854
|
+
distTags: option.distTags,
|
|
6855
|
+
versions: option.versions,
|
|
6856
|
+
selected,
|
|
6857
|
+
onChange: setSelected,
|
|
6858
|
+
disabled: isDisabled
|
|
6859
|
+
})
|
|
6860
|
+
})
|
|
6861
|
+
]
|
|
6862
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6863
|
+
className: "shrink-0 self-center",
|
|
6864
|
+
children: isSelecting && selectingContent ? /* @__PURE__ */ jsx("div", {
|
|
6865
|
+
className: "flex items-center justify-center",
|
|
6866
|
+
children: selectingContent
|
|
6867
|
+
}) : isDisabled ? /* @__PURE__ */ jsx("span", {
|
|
6868
|
+
className: "rounded-md bg-gray-100 px-3 py-1 text-xs font-medium text-gray-500",
|
|
6869
|
+
children: option.disabledLabel ?? "Unavailable"
|
|
6870
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
6871
|
+
onClick: () => handleSelect(installSpec),
|
|
6872
|
+
disabled: isSelecting,
|
|
6873
|
+
className: "rounded-md bg-gray-900 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-gray-800 disabled:opacity-50",
|
|
6874
|
+
children: isSelecting ? "..." : selectLabel
|
|
6875
|
+
})
|
|
6876
|
+
})]
|
|
6877
|
+
});
|
|
6878
|
+
}
|
|
6661
6879
|
const PackageManagerInput = (props) => {
|
|
6662
6880
|
const { registryPackageList, onInstall, disabled, className } = props;
|
|
6881
|
+
const [typedTag, setTypedTag] = useState(void 0);
|
|
6663
6882
|
const fetchOptions = async (query) => {
|
|
6664
6883
|
const { name: namePart, tag } = parsePackageSpec(query);
|
|
6884
|
+
setTypedTag(tag);
|
|
6665
6885
|
const needle = namePart.toLowerCase();
|
|
6666
6886
|
const localOptions = registryPackageList.filter((pkg) => pkg.name.toLowerCase().includes(needle) || pkg.manifest?.description?.toLowerCase().includes(needle)).map((pkg) => {
|
|
6667
6887
|
const isInstalled = pkg.status === "local-install" || pkg.status === "registry-install";
|
|
6668
6888
|
return {
|
|
6669
|
-
value:
|
|
6670
|
-
label:
|
|
6671
|
-
version:
|
|
6889
|
+
value: pkg.name,
|
|
6890
|
+
label: pkg.name,
|
|
6891
|
+
version: pkg.version,
|
|
6672
6892
|
description: pkg.manifest?.description,
|
|
6673
6893
|
meta: pkg.manifest?.publisher?.name,
|
|
6674
6894
|
disabled: isInstalled,
|
|
6675
|
-
disabledLabel: isInstalled ? "Installed" : void 0
|
|
6895
|
+
disabledLabel: isInstalled ? "Installed" : void 0,
|
|
6896
|
+
distTags: pkg.distTags,
|
|
6897
|
+
versions: pkg.versions
|
|
6676
6898
|
};
|
|
6677
6899
|
});
|
|
6678
6900
|
if (!isPlausiblePackageName(namePart) || localOptions.length > 0) return Promise.resolve(localOptions);
|
|
@@ -6688,6 +6910,11 @@ const PackageManagerInput = (props) => {
|
|
|
6688
6910
|
const handleSelect = useCallback((value) => {
|
|
6689
6911
|
return onInstall(value);
|
|
6690
6912
|
}, [onInstall]);
|
|
6913
|
+
const renderRow = useCallback((option, ctx) => /* @__PURE__ */ jsx(PackageResultCard, {
|
|
6914
|
+
option,
|
|
6915
|
+
ctx,
|
|
6916
|
+
typedTag
|
|
6917
|
+
}), [typedTag]);
|
|
6691
6918
|
return /* @__PURE__ */ jsxs("div", {
|
|
6692
6919
|
className,
|
|
6693
6920
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
@@ -6704,7 +6931,9 @@ const PackageManagerInput = (props) => {
|
|
|
6704
6931
|
size: 48
|
|
6705
6932
|
}),
|
|
6706
6933
|
placeholder: "Search packages (e.g. my-pkg, my-pkg@dev, my-pkg@1.2.3)...",
|
|
6707
|
-
disabled
|
|
6934
|
+
disabled,
|
|
6935
|
+
renderRow,
|
|
6936
|
+
keepOpenSelector: "[data-version-picker],[data-version-picker-trigger]"
|
|
6708
6937
|
})]
|
|
6709
6938
|
});
|
|
6710
6939
|
};
|
|
@@ -6725,6 +6954,13 @@ const PackageDetail = ({ label, value }) => {
|
|
|
6725
6954
|
const PackageManagerListItem = (props) => {
|
|
6726
6955
|
const { registryPackage, onInstall, onUninstall, className } = props;
|
|
6727
6956
|
const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
|
|
6957
|
+
const canPickVersion = registryPackage.status === "available" || registryPackage.status === "dismissed";
|
|
6958
|
+
const hasVersionMetadata = registryPackage.distTags && Object.keys(registryPackage.distTags).length > 0 || (registryPackage.versions?.length ?? 0) > 0;
|
|
6959
|
+
const [selected, setSelected] = useState(() => resolveDefaultVersionSelection({
|
|
6960
|
+
distTags: registryPackage.distTags,
|
|
6961
|
+
versions: registryPackage.versions,
|
|
6962
|
+
version: registryPackage.version
|
|
6963
|
+
}));
|
|
6728
6964
|
const installDropdownItem = {
|
|
6729
6965
|
id: "install",
|
|
6730
6966
|
label: "Install",
|
|
@@ -6738,16 +6974,24 @@ const PackageManagerListItem = (props) => {
|
|
|
6738
6974
|
className: "text-red-900"
|
|
6739
6975
|
};
|
|
6740
6976
|
function getDropdownItems() {
|
|
6741
|
-
return [
|
|
6977
|
+
return [canPickVersion ? installDropdownItem : void 0, registryPackage.status === "registry-install" ? uninstallDropdownItem : void 0].filter((item) => item !== void 0);
|
|
6742
6978
|
}
|
|
6743
6979
|
const dropdownItems = getDropdownItems();
|
|
6744
6980
|
return /* @__PURE__ */ jsxs("li", {
|
|
6745
6981
|
className: twMerge("relative flex flex-col items-start rounded-md border border-gray-200 p-3 text-sm leading-5 shadow-sm", className),
|
|
6746
6982
|
children: [
|
|
6747
|
-
/* @__PURE__ */ jsxs("
|
|
6748
|
-
className: "
|
|
6749
|
-
children: [
|
|
6750
|
-
className: "
|
|
6983
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6984
|
+
className: "flex flex-wrap items-center gap-2 pr-8",
|
|
6985
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
6986
|
+
className: "font-semibold text-gray-900",
|
|
6987
|
+
children: registryPackage.name
|
|
6988
|
+
}), canPickVersion && hasVersionMetadata ? /* @__PURE__ */ jsx(VersionPicker, {
|
|
6989
|
+
distTags: registryPackage.distTags,
|
|
6990
|
+
versions: registryPackage.versions,
|
|
6991
|
+
selected,
|
|
6992
|
+
onChange: setSelected
|
|
6993
|
+
}) : registryPackage.version ? /* @__PURE__ */ jsxs("span", {
|
|
6994
|
+
className: "text-xs font-normal text-gray-500",
|
|
6751
6995
|
children: ["v", registryPackage.version]
|
|
6752
6996
|
}) : null]
|
|
6753
6997
|
}),
|
|
@@ -6781,7 +7025,7 @@ const PackageManagerListItem = (props) => {
|
|
|
6781
7025
|
items: dropdownItems,
|
|
6782
7026
|
onItemClick: (id) => {
|
|
6783
7027
|
if (id === "install") {
|
|
6784
|
-
onInstall(registryPackage.name).catch(console.error);
|
|
7028
|
+
onInstall(canPickVersion && hasVersionMetadata ? buildPackageSpec(registryPackage.name, selected.value) : registryPackage.name).catch(console.error);
|
|
6785
7029
|
return;
|
|
6786
7030
|
}
|
|
6787
7031
|
onUninstall(registryPackage.name);
|
|
@@ -8263,4 +8507,4 @@ const removeSuccessFiles = (files) => {
|
|
|
8263
8507
|
//#endregion
|
|
8264
8508
|
export { HomeScreenItem as $, Combobox as $t, About as A, ConnectDropdownMenu as At, ProcessorsInspector as B, ConnectTooltip as Bt, PackageManager as C, nodeOptionsMap as Ct, DefaultEditor as D, ENSAvatar as Dt, PackageManagerInput as E, sharingTypeOptions as Et, InspectorModal as F, UploadFileItem as Ft, CreateDocumentModal as G, Divider as Gt, DriveSettingsModal as H, DocumentStateViewer as Ht, RemotesInspector as I, ConnectReplaceDuplicateModal as It, AddDriveModal as J, DebugInspector as Jt, AddRemoteDriveModal as K, Disclosure as Kt, ChannelInspector as L, useDrop as Lt, verifyPackageJsonFields as M, DropZone as Mt, ReadRequiredModal as N, UploadFileListContainer as Nt, DefaultEditorSelect as O, EditorUndoRedoButtons as Ot, PackageInstallModal as P, UploadFileList as Pt, HomeScreenAddDriveItem as Q, CookieBanner as Qt, ConnectionStateBadge as R, DocumentToolbar as Rt, SettingsModal as S, nodeOptions as St, PackageManagerListItem as T, normalNodeOptionsMap as Tt, ConnectDeleteItemModal as U, Tabs as Ut, ObjectInspectorModal as V, ConnectTooltipProvider as Vt, ConnectDeleteDriveModal as W, TabContent as Wt, IntegrityInspector as X, ConnectSelect as Xt, LoadingScreen as Y, DBExplorer as Yt, HomeScreen as Z, ConnectConfirmationModal as Zt, formatEthAddress as _, debugNodeOptions as _t, ToastContainer$1 as a, Footer as at, ClearStorageSettingsRow as b, defaultNodeOptions as bt, ConnectSidebar as c, FileItem as ct, SidebarUser as d, ERROR as dt, Breadcrumb as en, HomeBackgroundImage as et, SidebarLogin as f, INITIAL_SYNC as ft, RevisionHistory as g, syncStatuses as gt, ConnectSearchBar as h, SYNCING as ht, useEns as i, AccountPopover as in, FormInput as it, DependencyVersions as j, DropZoneWrapper as jt, DangerZone as k, EditorActionButtons as kt, ConnectSidebarHeader as l, SyncStatusIcon as lt, SidebarItem as m, SUCCESS as mt, removeSuccessFiles as n, NodeInput as nn, AddLocalDriveForm as nt, isConnectTypeOptions as o, FooterLink as ot, SidebarAddDriveItem as p, MISSING as pt, AddLocalDriveModal as q, DefaultEditorLoader as qt, sortFilesByStatus as r, AnimatedLoader as rn, Toggle as rt, toast$1 as s, FolderItem as st, getFolderStatus as t, Breadcrumbs as tn, AddRemoteDriveForm as tt, ConnectSidebarFooter as u, CONFLICT as ut, ConnectUpgradeDriveModal as v, debugNodeOptionsMap as vt, PackageManagerList as w, normalNodeOptions as wt, SettingsRow as x, locationInfoByLocation as xt, SettingsModalOld as y, defaultDriveOptions as yt, QueueInspector as z, DocumentTimeline as zt };
|
|
8265
8509
|
|
|
8266
|
-
//# sourceMappingURL=connect-
|
|
8510
|
+
//# sourceMappingURL=connect-DAOux5MY.js.map
|