@tscircuit/runframe 0.0.698 → 0.0.700
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/{chunk-VSUCGOKV.js → chunk-UA6KVLUV.js} +4 -4
- package/dist/preview.js +1 -1
- package/dist/runner.js +283 -236
- package/dist/standalone-preview.min.js +1 -1
- package/dist/standalone.min.js +468 -468
- package/package.json +2 -2
package/dist/runner.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
useOrderDialogCli,
|
|
38
38
|
useRunFrameStore,
|
|
39
39
|
useRunnerStore
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-UA6KVLUV.js";
|
|
41
41
|
|
|
42
42
|
// lib/components/RunFrame/RunFrame.tsx
|
|
43
43
|
import { createCircuitWebWorker } from "@tscircuit/eval/worker";
|
|
@@ -1071,7 +1071,7 @@ var mapTscircuitSnippetToSearchResult = (tscircuitSnippet) => {
|
|
|
1071
1071
|
};
|
|
1072
1072
|
|
|
1073
1073
|
// lib/components/ImportComponentDialog/ImportComponentDialog.tsx
|
|
1074
|
-
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1074
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1075
1075
|
var ImportComponentDialog = ({
|
|
1076
1076
|
isOpen,
|
|
1077
1077
|
onClose,
|
|
@@ -1159,256 +1159,303 @@ var ImportComponentDialog = ({
|
|
|
1159
1159
|
}
|
|
1160
1160
|
};
|
|
1161
1161
|
return /* @__PURE__ */ jsxs4(Dialog, { open: isOpen, onOpenChange: () => onClose(), children: [
|
|
1162
|
-
/* @__PURE__ */ jsxs4(
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
/* @__PURE__ */ jsx7(TabsTrigger, { value: "tscircuit.com", children: "tscircuit.com" }),
|
|
1175
|
-
/* @__PURE__ */ jsx7(TabsTrigger, { value: "jlcpcb", children: "JLCPCB Parts" })
|
|
1176
|
-
] }),
|
|
1177
|
-
/* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-items-center rf-gap-2 rf-mt-4", children: [
|
|
1178
|
-
/* @__PURE__ */ jsxs4("div", { className: "rf-relative rf-flex-grow", children: [
|
|
1179
|
-
/* @__PURE__ */ jsx7(Search, { className: "rf-absolute rf-left-2 rf-top-2.5 rf-h-4 rf-w-4 rf-text-muted-foreground" }),
|
|
1180
|
-
/* @__PURE__ */ jsx7(
|
|
1181
|
-
Input,
|
|
1182
|
-
{
|
|
1183
|
-
placeholder: activeTab === "tscircuit.com" ? "Search components..." : "Search JLCPCB parts (e.g. C14663)...",
|
|
1184
|
-
className: "rf-pl-8",
|
|
1185
|
-
spellCheck: false,
|
|
1186
|
-
autoComplete: "off",
|
|
1187
|
-
value: searchQuery,
|
|
1188
|
-
onChange: (e) => setSearchQuery(e.target.value),
|
|
1189
|
-
onKeyDown: handleKeyDown
|
|
1190
|
-
}
|
|
1191
|
-
)
|
|
1192
|
-
] }),
|
|
1193
|
-
/* @__PURE__ */ jsx7(
|
|
1194
|
-
Button,
|
|
1195
|
-
{
|
|
1196
|
-
onClick: handleSearch,
|
|
1197
|
-
disabled: isLoading || searchQuery.trim().length < 1,
|
|
1198
|
-
children: isLoading ? /* @__PURE__ */ jsx7(Loader22, { className: "rf-h-4 rf-w-4 rf-animate-spin" }) : "Search"
|
|
1199
|
-
}
|
|
1200
|
-
)
|
|
1201
|
-
] }),
|
|
1202
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-mt-4 rf-flex-1 rf-min-h-[200px] !rf-max-h-[40vh] !rf-overflow-y-auto rf-border rf-rounded-md", children: searchResults.length > 0 ? /* @__PURE__ */ jsx7("div", { className: "rf-divide-y", children: searchResults.map((result) => /* @__PURE__ */ jsxs4(
|
|
1203
|
-
"div",
|
|
1204
|
-
{
|
|
1205
|
-
className: `rf-p-3 rf-flex rf-items-center rf-justify-between rf-cursor-pointer hover:rf-bg-zinc-100 ${selectedComponent?.id === result.id ? "rf-bg-zinc-100" : ""}`,
|
|
1206
|
-
onClick: () => setSelectedComponent(result),
|
|
1207
|
-
children: [
|
|
1208
|
-
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1209
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-font-medium", children: result.name }),
|
|
1210
|
-
/* @__PURE__ */ jsxs4("div", { className: "rf-text-sm rf-text-zinc-500", children: [
|
|
1211
|
-
result.partNumber && /* @__PURE__ */ jsx7("span", { className: "rf-mr-2", children: result.partNumber }),
|
|
1212
|
-
result.description
|
|
1213
|
-
] })
|
|
1214
|
-
] }),
|
|
1215
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-flex rf-gap-2", children: result.source === "tscircuit.com" && /* @__PURE__ */ jsx7(
|
|
1216
|
-
Button,
|
|
1217
|
-
{
|
|
1218
|
-
variant: "outline",
|
|
1219
|
-
size: "sm",
|
|
1220
|
-
onClick: (e) => {
|
|
1221
|
-
e.stopPropagation();
|
|
1222
|
-
showDetails(result);
|
|
1223
|
-
},
|
|
1224
|
-
children: "See Details"
|
|
1225
|
-
}
|
|
1226
|
-
) })
|
|
1227
|
-
]
|
|
1228
|
-
},
|
|
1229
|
-
result.id
|
|
1230
|
-
)) }) : isLoading ? /* @__PURE__ */ jsxs4("div", { className: "rf-p-8 rf-text-center rf-text-zinc-500", children: [
|
|
1231
|
-
/* @__PURE__ */ jsx7(Loader22, { className: "rf-h-8 rf-w-8 rf-animate-spin rf-mx-auto rf-mb-2" }),
|
|
1232
|
-
/* @__PURE__ */ jsx7("p", { children: "Searching..." })
|
|
1233
|
-
] }) : /* @__PURE__ */ jsx7("div", { className: "rf-p-8 rf-text-center rf-text-zinc-500", children: hasSearched ? "No results found" : "Enter a search term to find components" }) })
|
|
1234
|
-
]
|
|
1235
|
-
}
|
|
1236
|
-
),
|
|
1237
|
-
/* @__PURE__ */ jsxs4(DialogFooter, { children: [
|
|
1238
|
-
/* @__PURE__ */ jsx7(Button, { variant: "outline", onClick: onClose, children: "Cancel" }),
|
|
1239
|
-
/* @__PURE__ */ jsx7(
|
|
1240
|
-
Button,
|
|
1241
|
-
{
|
|
1242
|
-
onClick: () => {
|
|
1243
|
-
if (selectedComponent) {
|
|
1244
|
-
onImport(selectedComponent);
|
|
1245
|
-
onClose();
|
|
1246
|
-
}
|
|
1247
|
-
},
|
|
1248
|
-
disabled: !selectedComponent,
|
|
1249
|
-
children: "Import Component"
|
|
1250
|
-
}
|
|
1251
|
-
)
|
|
1252
|
-
] })
|
|
1253
|
-
] }),
|
|
1254
|
-
/* @__PURE__ */ jsx7(Dialog, { open: detailsOpen, onOpenChange: setDetailsOpen, children: /* @__PURE__ */ jsxs4(DialogContent, { className: "rf-max-w-5xl rf-max-h-[90vh] rf-overflow-hidden rf-flex rf-flex-col rf-overflow-y-auto", children: [
|
|
1255
|
-
/* @__PURE__ */ jsx7(DialogHeader, { className: "rf-pb-4 rf-border-b", children: /* @__PURE__ */ jsx7("div", { className: "rf-flex rf-items-start rf-justify-between rf-gap-4", children: /* @__PURE__ */ jsx7("div", { className: "rf-flex-1 rf-min-w-0", children: /* @__PURE__ */ jsx7(DialogTitle, { className: "rf-text-xl rf-font-semibold rf-truncate", children: /* @__PURE__ */ jsx7(
|
|
1256
|
-
"a",
|
|
1257
|
-
{
|
|
1258
|
-
href: `https://tscircuit.com/${detailsComponent?.owner}/${detailsComponent?.name}`,
|
|
1259
|
-
target: "_blank",
|
|
1260
|
-
rel: "noopener noreferrer",
|
|
1261
|
-
className: "rf-text-black hover:rf-underline",
|
|
1262
|
-
children: detailsComponent?.name?.split("/").pop() || detailsComponent?.name
|
|
1263
|
-
}
|
|
1264
|
-
) }) }) }) }),
|
|
1265
|
-
/* @__PURE__ */ jsxs4("div", { className: "rf-flex-1 rf-overflow-y-auto rf-py-4 rf-space-y-6", children: [
|
|
1266
|
-
/* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsx7("div", { className: "rf-space-y-3", children: detailsComponent?.owner && /* @__PURE__ */ jsxs4("div", { children: [
|
|
1267
|
-
/* @__PURE__ */ jsx7("label", { className: "rf-text-xs rf-font-medium rf-text-gray-500 rf-uppercase rf-tracking-wide", children: "Created by" }),
|
|
1268
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-mt-1 rf-text-sm rf-font-medium", children: /* @__PURE__ */ jsx7(
|
|
1269
|
-
"a",
|
|
1270
|
-
{
|
|
1271
|
-
href: `https://tscircuit.com/${detailsComponent?.owner}`,
|
|
1272
|
-
target: "_blank",
|
|
1273
|
-
rel: "noopener noreferrer",
|
|
1274
|
-
className: "rf-text-black hover:rf-underline",
|
|
1275
|
-
children: detailsComponent?.owner
|
|
1276
|
-
}
|
|
1277
|
-
) })
|
|
1278
|
-
] }) }) }),
|
|
1279
|
-
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1280
|
-
/* @__PURE__ */ jsx7("h3", { className: "rf-text-lg rf-font-semibold rf-mb-4", children: "Preview" }),
|
|
1162
|
+
/* @__PURE__ */ jsxs4(
|
|
1163
|
+
DialogContent,
|
|
1164
|
+
{
|
|
1165
|
+
style: {
|
|
1166
|
+
width: "calc(100vw - 2rem)"
|
|
1167
|
+
},
|
|
1168
|
+
className: "rf-rounded-sm rf-max-h-[90vh] rf-overflow-y-auto rf-flex rf-flex-col",
|
|
1169
|
+
children: [
|
|
1170
|
+
/* @__PURE__ */ jsxs4(DialogHeader, { children: [
|
|
1171
|
+
/* @__PURE__ */ jsx7(DialogTitle, { className: "rf-text-lg sm:rf-text-xl", children: "Import Component" }),
|
|
1172
|
+
/* @__PURE__ */ jsx7(DialogDescription, { className: "rf-text-sm", children: "Search for components from tscircuit.com or JLCPCB parts library." })
|
|
1173
|
+
] }),
|
|
1281
1174
|
/* @__PURE__ */ jsxs4(
|
|
1282
1175
|
Tabs,
|
|
1283
1176
|
{
|
|
1284
|
-
value:
|
|
1285
|
-
onValueChange: (value) =>
|
|
1177
|
+
value: activeTab,
|
|
1178
|
+
onValueChange: (value) => setActiveTab(value),
|
|
1286
1179
|
children: [
|
|
1287
|
-
/* @__PURE__ */ jsxs4(TabsList, { className: "rf-
|
|
1180
|
+
/* @__PURE__ */ jsxs4(TabsList, { className: "rf-grid rf-w-full rf-grid-cols-2 rf-h-auto", children: [
|
|
1288
1181
|
/* @__PURE__ */ jsx7(
|
|
1289
1182
|
TabsTrigger,
|
|
1290
1183
|
{
|
|
1291
|
-
value: "
|
|
1292
|
-
className: "rf-
|
|
1293
|
-
children: "
|
|
1184
|
+
value: "tscircuit.com",
|
|
1185
|
+
className: "rf-text-xs sm:rf-text-sm",
|
|
1186
|
+
children: "tscircuit.com"
|
|
1294
1187
|
}
|
|
1295
1188
|
),
|
|
1189
|
+
/* @__PURE__ */ jsx7(TabsTrigger, { value: "jlcpcb", className: "rf-text-xs sm:rf-text-sm", children: "JLCPCB Parts" })
|
|
1190
|
+
] }),
|
|
1191
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-items-center rf-gap-2 rf-mt-4", children: [
|
|
1192
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-relative rf-flex-grow", children: [
|
|
1193
|
+
/* @__PURE__ */ jsx7(Search, { className: "rf-absolute rf-left-2 rf-top-2.5 rf-h-4 rf-w-4 rf-text-muted-foreground" }),
|
|
1194
|
+
/* @__PURE__ */ jsx7(
|
|
1195
|
+
Input,
|
|
1196
|
+
{
|
|
1197
|
+
placeholder: activeTab === "tscircuit.com" ? "Search components..." : "Search JLCPCB parts (e.g. C14663)...",
|
|
1198
|
+
className: "rf-pl-8",
|
|
1199
|
+
spellCheck: false,
|
|
1200
|
+
autoComplete: "off",
|
|
1201
|
+
value: searchQuery,
|
|
1202
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
1203
|
+
onKeyDown: handleKeyDown
|
|
1204
|
+
}
|
|
1205
|
+
)
|
|
1206
|
+
] }),
|
|
1296
1207
|
/* @__PURE__ */ jsx7(
|
|
1297
|
-
|
|
1208
|
+
Button,
|
|
1298
1209
|
{
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1210
|
+
onClick: handleSearch,
|
|
1211
|
+
disabled: isLoading || searchQuery.trim().length < 1,
|
|
1212
|
+
className: "sm:rf-px-4 rf-px-3",
|
|
1213
|
+
children: isLoading ? /* @__PURE__ */ jsx7(Loader22, { className: "rf-h-4 rf-w-4 rf-animate-spin" }) : /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1214
|
+
/* @__PURE__ */ jsx7(Search, { className: "rf-h-4 rf-w-4 sm:rf-hidden" }),
|
|
1215
|
+
/* @__PURE__ */ jsx7("span", { className: "rf-hidden sm:rf-inline", children: "Search" })
|
|
1216
|
+
] })
|
|
1302
1217
|
}
|
|
1303
1218
|
)
|
|
1304
1219
|
] }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
{
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
"
|
|
1220
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-mt-4 rf-flex-1 rf-min-h-[200px] !rf-max-h-[40vh] !rf-overflow-y-auto rf-border rf-rounded-md", children: searchResults.length > 0 ? /* @__PURE__ */ jsx7("div", { className: "rf-divide-y", children: searchResults.map((result) => /* @__PURE__ */ jsxs4(
|
|
1221
|
+
"div",
|
|
1222
|
+
{
|
|
1223
|
+
className: `rf-p-3 rf-flex rf-flex-col sm:rf-flex-row rf-items-start sm:rf-items-center rf-justify-between rf-cursor-pointer hover:rf-bg-zinc-100 rf-gap-2 ${selectedComponent?.id === result.id ? "rf-bg-zinc-100" : ""}`,
|
|
1224
|
+
onClick: () => setSelectedComponent(result),
|
|
1225
|
+
children: [
|
|
1226
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-flex-1 rf-min-w-0", children: [
|
|
1227
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-font-medium rf-text-sm rf-truncate", children: result.name }),
|
|
1228
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-text-xs rf-text-zinc-500 rf-break-words", children: [
|
|
1229
|
+
result.partNumber && /* @__PURE__ */ jsx7("span", { className: "rf-mr-2", children: result.partNumber }),
|
|
1230
|
+
result.description
|
|
1231
|
+
] })
|
|
1232
|
+
] }),
|
|
1233
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-flex rf-gap-2 rf-flex-shrink-0 rf-w-full sm:rf-w-auto", children: result.source === "tscircuit.com" && /* @__PURE__ */ jsx7(
|
|
1234
|
+
Button,
|
|
1235
|
+
{
|
|
1236
|
+
variant: "outline",
|
|
1237
|
+
size: "sm",
|
|
1238
|
+
className: "rf-text-xs rf-w-full sm:rf-w-auto",
|
|
1239
|
+
onClick: (e) => {
|
|
1240
|
+
e.stopPropagation();
|
|
1241
|
+
showDetails(result);
|
|
1242
|
+
},
|
|
1243
|
+
children: "See Details"
|
|
1244
|
+
}
|
|
1245
|
+
) })
|
|
1246
|
+
]
|
|
1247
|
+
},
|
|
1248
|
+
result.id
|
|
1249
|
+
)) }) : isLoading ? /* @__PURE__ */ jsxs4("div", { className: "rf-p-8 rf-text-center rf-text-zinc-500", children: [
|
|
1250
|
+
/* @__PURE__ */ jsx7(Loader22, { className: "rf-h-8 rf-w-8 rf-animate-spin rf-mx-auto rf-mb-2" }),
|
|
1251
|
+
/* @__PURE__ */ jsx7("p", { children: "Searching..." })
|
|
1252
|
+
] }) : /* @__PURE__ */ jsx7("div", { className: "rf-p-8 rf-text-center rf-text-zinc-500", children: hasSearched ? "No results found" : "Enter a search term to find components" }) })
|
|
1253
|
+
]
|
|
1254
|
+
}
|
|
1255
|
+
),
|
|
1256
|
+
/* @__PURE__ */ jsxs4(DialogFooter, { className: "rf-flex rf-flex-col sm:rf-flex-row rf-gap-2", children: [
|
|
1257
|
+
/* @__PURE__ */ jsx7(
|
|
1258
|
+
Button,
|
|
1259
|
+
{
|
|
1260
|
+
variant: "outline",
|
|
1261
|
+
onClick: onClose,
|
|
1262
|
+
className: "rf-order-2 sm:rf-order-1",
|
|
1263
|
+
children: "Cancel"
|
|
1264
|
+
}
|
|
1265
|
+
),
|
|
1266
|
+
/* @__PURE__ */ jsx7(
|
|
1267
|
+
Button,
|
|
1268
|
+
{
|
|
1269
|
+
onClick: () => {
|
|
1270
|
+
if (selectedComponent) {
|
|
1271
|
+
onImport(selectedComponent);
|
|
1272
|
+
onClose();
|
|
1273
|
+
}
|
|
1274
|
+
},
|
|
1275
|
+
disabled: !selectedComponent,
|
|
1276
|
+
children: "Import Component"
|
|
1277
|
+
}
|
|
1278
|
+
)
|
|
1279
|
+
] })
|
|
1280
|
+
]
|
|
1281
|
+
}
|
|
1282
|
+
),
|
|
1283
|
+
/* @__PURE__ */ jsx7(Dialog, { open: detailsOpen, onOpenChange: setDetailsOpen, children: /* @__PURE__ */ jsxs4(
|
|
1284
|
+
DialogContent,
|
|
1285
|
+
{
|
|
1286
|
+
showOverlay: false,
|
|
1287
|
+
style: {
|
|
1288
|
+
width: "calc(100vw - 2rem)"
|
|
1289
|
+
},
|
|
1290
|
+
className: "rf-max-w-5xl !rf-overflow-y-auto rf-max-h-[90vh] rf-overflow-hidden rf-flex rf-flex-col rf-rounded-sm",
|
|
1291
|
+
children: [
|
|
1292
|
+
/* @__PURE__ */ jsx7(DialogHeader, { className: "rf-pb-4 rf-border-b", children: /* @__PURE__ */ jsx7("div", { className: "rf-flex rf-items-start rf-justify-between rf-gap-4", children: /* @__PURE__ */ jsx7("div", { className: "rf-flex-1 rf-min-w-0", children: /* @__PURE__ */ jsx7(DialogTitle, { className: "rf-text-xl rf-font-semibold rf-truncate", children: /* @__PURE__ */ jsx7(
|
|
1293
|
+
"a",
|
|
1294
|
+
{
|
|
1295
|
+
href: `https://tscircuit.com/${detailsComponent?.owner}/${detailsComponent?.name}`,
|
|
1296
|
+
target: "_blank",
|
|
1297
|
+
rel: "noopener noreferrer",
|
|
1298
|
+
className: "rf-text-black hover:rf-underline",
|
|
1299
|
+
children: detailsComponent?.name?.split("/").pop() || detailsComponent?.name
|
|
1300
|
+
}
|
|
1301
|
+
) }) }) }) }),
|
|
1302
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-flex-1 rf-overflow-y-auto rf-py-4 rf-space-y-6", children: [
|
|
1303
|
+
/* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsx7("div", { className: "rf-space-y-3", children: detailsComponent?.owner && /* @__PURE__ */ jsxs4("div", { children: [
|
|
1304
|
+
/* @__PURE__ */ jsx7("label", { className: "rf-text-xs rf-font-medium rf-text-gray-500 rf-uppercase rf-tracking-wide", children: "Created by" }),
|
|
1305
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-mt-1 rf-text-sm rf-font-medium", children: /* @__PURE__ */ jsx7(
|
|
1306
|
+
"a",
|
|
1307
|
+
{
|
|
1308
|
+
href: `https://tscircuit.com/${detailsComponent?.owner}`,
|
|
1309
|
+
target: "_blank",
|
|
1310
|
+
rel: "noopener noreferrer",
|
|
1311
|
+
className: "rf-text-black hover:rf-underline",
|
|
1312
|
+
children: detailsComponent?.owner
|
|
1313
|
+
}
|
|
1314
|
+
) })
|
|
1315
|
+
] }) }) }),
|
|
1316
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1317
|
+
/* @__PURE__ */ jsx7("h3", { className: "rf-text-lg rf-font-semibold rf-mb-4", children: "Preview" }),
|
|
1318
|
+
/* @__PURE__ */ jsxs4(
|
|
1319
|
+
Tabs,
|
|
1320
|
+
{
|
|
1321
|
+
value: previewActiveTab,
|
|
1322
|
+
onValueChange: (value) => setPreviewActiveTab(value),
|
|
1323
|
+
children: [
|
|
1324
|
+
/* @__PURE__ */ jsxs4(TabsList, { className: "rf-inline-flex rf-h-9 rf-items-center rf-justify-center rf-rounded-lg rf-bg-zinc-100 rf-p-1 rf-text-zinc-500 dark:rf-bg-zinc-800 dark:rf-text-zinc-400", children: [
|
|
1325
|
+
/* @__PURE__ */ jsx7(
|
|
1326
|
+
TabsTrigger,
|
|
1327
|
+
{
|
|
1328
|
+
value: "pcb",
|
|
1329
|
+
className: "rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",
|
|
1330
|
+
children: "PCB"
|
|
1331
|
+
}
|
|
1332
|
+
),
|
|
1333
|
+
/* @__PURE__ */ jsx7(
|
|
1334
|
+
TabsTrigger,
|
|
1313
1335
|
{
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1336
|
+
value: "schematic",
|
|
1337
|
+
className: "rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",
|
|
1338
|
+
children: "Schematic"
|
|
1339
|
+
}
|
|
1340
|
+
)
|
|
1341
|
+
] }),
|
|
1342
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-mt-4", children: [
|
|
1343
|
+
/* @__PURE__ */ jsx7(
|
|
1344
|
+
TabsContent,
|
|
1345
|
+
{
|
|
1346
|
+
value: "pcb",
|
|
1347
|
+
className: "rf-border rf-rounded-lg rf-overflow-hidden rf-bg-gray-50",
|
|
1348
|
+
children: detailsComponent?.code ? /* @__PURE__ */ jsx7("div", { className: "rf-w-full rf-h-[400px] rf-bg-white rf-flex rf-items-center rf-justify-center rf-p-4", children: /* @__PURE__ */ jsx7(
|
|
1349
|
+
"img",
|
|
1350
|
+
{
|
|
1351
|
+
src: `https://registry-api.tscircuit.com/packages/images/${detailsComponent.owner}/${detailsComponent.name}/pcb.png`,
|
|
1352
|
+
alt: `${detailsComponent.name} PCB preview`,
|
|
1353
|
+
className: "rf-max-w-full rf-max-h-full rf-object-contain rf-rounded",
|
|
1354
|
+
onError: (e) => {
|
|
1355
|
+
const target = e.target;
|
|
1356
|
+
target.style.display = "none";
|
|
1357
|
+
const parent = target.parentElement;
|
|
1358
|
+
if (parent) {
|
|
1359
|
+
parent.innerHTML = '<div class="rf-text-center rf-text-gray-500"><div class="rf-text-sm rf-font-medium">PCB preview not available</div><div class="rf-text-xs rf-mt-1">Image failed to load</div></div>';
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1323
1362
|
}
|
|
1324
|
-
}
|
|
1363
|
+
) }) : /* @__PURE__ */ jsx7("div", { className: "rf-h-[400px] rf-flex rf-items-center rf-justify-center rf-text-gray-500", children: /* @__PURE__ */ jsxs4("div", { className: "rf-text-center", children: [
|
|
1364
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-text-sm rf-font-medium", children: "No PCB preview available" }),
|
|
1365
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-text-xs rf-mt-1", children: "Preview cannot be generated" })
|
|
1366
|
+
] }) })
|
|
1325
1367
|
}
|
|
1326
|
-
)
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
] }) })
|
|
1330
|
-
}
|
|
1331
|
-
),
|
|
1332
|
-
/* @__PURE__ */ jsx7(
|
|
1333
|
-
TabsContent,
|
|
1334
|
-
{
|
|
1335
|
-
value: "schematic",
|
|
1336
|
-
className: "rf-border rf-rounded-lg rf-overflow-hidden rf-bg-gray-50",
|
|
1337
|
-
children: detailsComponent?.code ? /* @__PURE__ */ jsx7("div", { className: "rf-w-full rf-h-[400px] rf-bg-white rf-flex rf-items-center rf-justify-center rf-p-4", children: /* @__PURE__ */ jsx7(
|
|
1338
|
-
"img",
|
|
1368
|
+
),
|
|
1369
|
+
/* @__PURE__ */ jsx7(
|
|
1370
|
+
TabsContent,
|
|
1339
1371
|
{
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
className: "rf-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1372
|
+
value: "schematic",
|
|
1373
|
+
className: "rf-border rf-rounded-lg rf-overflow-hidden rf-bg-gray-50",
|
|
1374
|
+
children: detailsComponent?.code ? /* @__PURE__ */ jsx7("div", { className: "rf-w-full rf-h-[400px] rf-bg-white rf-flex rf-items-center rf-justify-center rf-p-4", children: /* @__PURE__ */ jsx7(
|
|
1375
|
+
"img",
|
|
1376
|
+
{
|
|
1377
|
+
src: `https://registry-api.tscircuit.com/packages/images/${detailsComponent.owner}/${detailsComponent.name}/schematic.png`,
|
|
1378
|
+
alt: `${detailsComponent.name} schematic preview`,
|
|
1379
|
+
className: "rf-max-w-full rf-max-h-full rf-object-contain rf-rounded",
|
|
1380
|
+
onError: (e) => {
|
|
1381
|
+
const target = e.target;
|
|
1382
|
+
target.style.display = "none";
|
|
1383
|
+
const parent = target.parentElement;
|
|
1384
|
+
if (parent) {
|
|
1385
|
+
parent.innerHTML = '<div class="rf-text-center rf-text-gray-500"><div class="rf-text-sm rf-font-medium">Schematic preview not available</div><div class="rf-text-xs rf-mt-1">Image failed to load</div></div>';
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1349
1388
|
}
|
|
1350
|
-
}
|
|
1389
|
+
) }) : /* @__PURE__ */ jsx7("div", { className: "rf-h-[400px] rf-flex rf-items-center rf-justify-center rf-text-gray-500", children: /* @__PURE__ */ jsxs4("div", { className: "rf-text-center", children: [
|
|
1390
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-text-sm rf-font-medium", children: "No schematic preview available" }),
|
|
1391
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-text-xs rf-mt-1", children: "Preview cannot be generated" })
|
|
1392
|
+
] }) })
|
|
1351
1393
|
}
|
|
1352
|
-
)
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1394
|
+
)
|
|
1395
|
+
] })
|
|
1396
|
+
]
|
|
1397
|
+
}
|
|
1398
|
+
)
|
|
1399
|
+
] }),
|
|
1400
|
+
packageDetails?.ai_description && /* @__PURE__ */ jsxs4("div", { children: [
|
|
1401
|
+
/* @__PURE__ */ jsx7("h3", { className: "rf-text-lg rf-font-semibold rf-mb-3", children: "AI Description" }),
|
|
1402
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-bg-gray-50 rf-border rf-border-gray-200 rf-rounded-lg rf-p-4", children: /* @__PURE__ */ jsx7("p", { className: "rf-text-sm rf-text-gray-700 rf-leading-relaxed", children: packageDetails.ai_description }) })
|
|
1403
|
+
] }),
|
|
1404
|
+
packageDetails?.ai_usage_instructions && /* @__PURE__ */ jsxs4("div", { children: [
|
|
1405
|
+
/* @__PURE__ */ jsx7("h3", { className: "rf-text-lg rf-font-semibold rf-mb-3", children: "Usage Instructions" }),
|
|
1406
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-bg-gray-50 rf-border rf-border-gray-200 rf-rounded-lg rf-p-4", children: /* @__PURE__ */ jsx7("p", { className: "rf-text-sm rf-text-gray-700 rf-leading-relaxed rf-whitespace-pre-wrap", children: packageDetails.ai_usage_instructions }) })
|
|
1407
|
+
] }),
|
|
1408
|
+
packageDetailsLoading && /* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-justify-center rf-text-center rf-items-center rf-gap-2 rf-text-gray-500", children: [
|
|
1409
|
+
/* @__PURE__ */ jsx7(Loader22, { className: "rf-h-4 rf-w-4 rf-animate-spin" }),
|
|
1410
|
+
/* @__PURE__ */ jsx7("span", { className: "rf-text-sm", children: "Loading package details..." })
|
|
1411
|
+
] })
|
|
1412
|
+
] }),
|
|
1413
|
+
/* @__PURE__ */ jsxs4(DialogFooter, { className: "rf-pt-4 rf-border-t rf-flex rf-flex-col sm:rf-flex-row rf-justify-between rf-items-stretch sm:rf-items-center rf-gap-2", children: [
|
|
1414
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-flex-1 rf-order-3 sm:rf-order-1", children: /* @__PURE__ */ jsxs4(
|
|
1415
|
+
Button,
|
|
1416
|
+
{
|
|
1417
|
+
variant: "outline",
|
|
1418
|
+
size: "sm",
|
|
1419
|
+
className: "rf-gap-2 rf-w-full sm:rf-w-auto",
|
|
1420
|
+
onClick: () => {
|
|
1421
|
+
const url = `https://tscircuit.com/${detailsComponent?.owner}/${detailsComponent?.name.split("/").pop()}`;
|
|
1422
|
+
window.open(url, "_blank");
|
|
1423
|
+
},
|
|
1424
|
+
children: [
|
|
1425
|
+
/* @__PURE__ */ jsx7(ExternalLink, { className: "rf-h-4 rf-w-4" }),
|
|
1426
|
+
"View on tscircuit.com"
|
|
1427
|
+
]
|
|
1428
|
+
}
|
|
1429
|
+
) }),
|
|
1430
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-flex-col sm:rf-flex-row rf-gap-2 sm:rf-gap-3 rf-order-1 sm:rf-order-2", children: [
|
|
1431
|
+
/* @__PURE__ */ jsx7(
|
|
1432
|
+
Button,
|
|
1433
|
+
{
|
|
1434
|
+
variant: "outline",
|
|
1435
|
+
onClick: () => setDetailsOpen(false),
|
|
1436
|
+
className: "rf-order-2 sm:rf-order-1",
|
|
1437
|
+
children: "Close"
|
|
1438
|
+
}
|
|
1439
|
+
),
|
|
1440
|
+
/* @__PURE__ */ jsx7(
|
|
1441
|
+
Button,
|
|
1442
|
+
{
|
|
1443
|
+
onClick: () => {
|
|
1444
|
+
setDetailsOpen(false);
|
|
1445
|
+
if (detailsComponent) {
|
|
1446
|
+
onImport(detailsComponent);
|
|
1447
|
+
onClose();
|
|
1356
1448
|
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
}
|
|
1361
|
-
)
|
|
1362
|
-
] }),
|
|
1363
|
-
packageDetails?.ai_description && /* @__PURE__ */ jsxs4("div", { children: [
|
|
1364
|
-
/* @__PURE__ */ jsx7("h3", { className: "rf-text-lg rf-font-semibold rf-mb-3", children: "AI Description" }),
|
|
1365
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-bg-gray-50 rf-border rf-border-gray-200 rf-rounded-lg rf-p-4", children: /* @__PURE__ */ jsx7("p", { className: "rf-text-sm rf-text-gray-700 rf-leading-relaxed", children: packageDetails.ai_description }) })
|
|
1366
|
-
] }),
|
|
1367
|
-
packageDetails?.ai_usage_instructions && /* @__PURE__ */ jsxs4("div", { children: [
|
|
1368
|
-
/* @__PURE__ */ jsx7("h3", { className: "rf-text-lg rf-font-semibold rf-mb-3", children: "Usage Instructions" }),
|
|
1369
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-bg-gray-50 rf-border rf-border-gray-200 rf-rounded-lg rf-p-4", children: /* @__PURE__ */ jsx7("p", { className: "rf-text-sm rf-text-gray-700 rf-leading-relaxed rf-whitespace-pre-wrap", children: packageDetails.ai_usage_instructions }) })
|
|
1370
|
-
] }),
|
|
1371
|
-
packageDetailsLoading && /* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-justify-center rf-text-center rf-items-center rf-gap-2 rf-text-gray-500", children: [
|
|
1372
|
-
/* @__PURE__ */ jsx7(Loader22, { className: "rf-h-4 rf-w-4 rf-animate-spin" }),
|
|
1373
|
-
/* @__PURE__ */ jsx7("span", { className: "rf-text-sm", children: "Loading package details..." })
|
|
1374
|
-
] })
|
|
1375
|
-
] }),
|
|
1376
|
-
/* @__PURE__ */ jsxs4(DialogFooter, { className: "rf-pt-4 rf-border-t rf-flex rf-justify-between rf-items-center", children: [
|
|
1377
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-flex-1", children: /* @__PURE__ */ jsxs4(
|
|
1378
|
-
Button,
|
|
1379
|
-
{
|
|
1380
|
-
variant: "outline",
|
|
1381
|
-
size: "sm",
|
|
1382
|
-
className: "rf-gap-2",
|
|
1383
|
-
onClick: () => {
|
|
1384
|
-
const url = `https://tscircuit.com/${detailsComponent?.owner}/${detailsComponent?.name.split("/").pop()}`;
|
|
1385
|
-
window.open(url, "_blank");
|
|
1386
|
-
},
|
|
1387
|
-
children: [
|
|
1388
|
-
/* @__PURE__ */ jsx7(ExternalLink, { className: "rf-h-4 rf-w-4" }),
|
|
1389
|
-
"View on tscircuit.com"
|
|
1390
|
-
]
|
|
1391
|
-
}
|
|
1392
|
-
) }),
|
|
1393
|
-
/* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-gap-2", children: [
|
|
1394
|
-
/* @__PURE__ */ jsx7(Button, { variant: "outline", onClick: () => setDetailsOpen(false), children: "Close" }),
|
|
1395
|
-
/* @__PURE__ */ jsx7(
|
|
1396
|
-
Button,
|
|
1397
|
-
{
|
|
1398
|
-
onClick: () => {
|
|
1399
|
-
setDetailsOpen(false);
|
|
1400
|
-
if (detailsComponent) {
|
|
1401
|
-
onImport(detailsComponent);
|
|
1402
|
-
onClose();
|
|
1449
|
+
},
|
|
1450
|
+
className: "rf-bg-blue-600 hover:rf-bg-blue-700 rf-order-1 sm:rf-order-2",
|
|
1451
|
+
children: "Import Component"
|
|
1403
1452
|
}
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
] })
|
|
1411
|
-
] }) })
|
|
1453
|
+
)
|
|
1454
|
+
] })
|
|
1455
|
+
] })
|
|
1456
|
+
]
|
|
1457
|
+
}
|
|
1458
|
+
) })
|
|
1412
1459
|
] });
|
|
1413
1460
|
};
|
|
1414
1461
|
|
|
@@ -1508,7 +1555,7 @@ import { useState as useState8 } from "react";
|
|
|
1508
1555
|
|
|
1509
1556
|
// lib/components/AiReviewDialog/ListAiReviewsView.tsx
|
|
1510
1557
|
import { useEffect as useEffect8, useState as useState6 } from "react";
|
|
1511
|
-
import { Fragment as
|
|
1558
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1512
1559
|
var AiReviewListView = ({
|
|
1513
1560
|
packageName,
|
|
1514
1561
|
onSelectReview
|
|
@@ -1554,7 +1601,7 @@ var AiReviewListView = ({
|
|
|
1554
1601
|
setCreating(false);
|
|
1555
1602
|
}
|
|
1556
1603
|
};
|
|
1557
|
-
return /* @__PURE__ */ jsxs5(
|
|
1604
|
+
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
1558
1605
|
/* @__PURE__ */ jsxs5(DialogHeader, { children: [
|
|
1559
1606
|
/* @__PURE__ */ jsx8(DialogTitle, { children: "AI Review" }),
|
|
1560
1607
|
/* @__PURE__ */ jsx8(DialogDescription, { children: "Select an AI review or request a new one." })
|
|
@@ -1575,7 +1622,7 @@ var AiReviewListView = ({
|
|
|
1575
1622
|
// lib/components/AiReviewDialog/ViewAiReviewView.tsx
|
|
1576
1623
|
import { useEffect as useEffect9, useMemo as useMemo2, useState as useState7 } from "react";
|
|
1577
1624
|
import { marked } from "marked";
|
|
1578
|
-
import { Fragment as
|
|
1625
|
+
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1579
1626
|
var AiReviewViewView = ({
|
|
1580
1627
|
review,
|
|
1581
1628
|
onBack
|
|
@@ -1613,7 +1660,7 @@ var AiReviewViewView = ({
|
|
|
1613
1660
|
() => marked.parse(review.ai_review_text || ""),
|
|
1614
1661
|
[review.ai_review_text]
|
|
1615
1662
|
);
|
|
1616
|
-
return /* @__PURE__ */ jsxs6(
|
|
1663
|
+
return /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1617
1664
|
/* @__PURE__ */ jsxs6(DialogHeader, { className: "rf-flex rf-flex-row rf-items-center rf-justify-between", children: [
|
|
1618
1665
|
/* @__PURE__ */ jsx9(Button, { variant: "ghost", size: "sm", onClick: onBack, children: "Back" }),
|
|
1619
1666
|
/* @__PURE__ */ jsx9(DialogTitle, { children: "AI Review" })
|
|
@@ -1748,7 +1795,7 @@ var importComponentFromJlcpcb = async (jlcpcbPartNumber) => {
|
|
|
1748
1795
|
};
|
|
1749
1796
|
|
|
1750
1797
|
// lib/components/RunFrameForCli/LeftHeader.tsx
|
|
1751
|
-
import { Fragment as
|
|
1798
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1752
1799
|
var RunframeCliLeftHeader = (props) => {
|
|
1753
1800
|
const lastRunEvalVersion = useRunnerStore((s) => s.lastRunEvalVersion);
|
|
1754
1801
|
const [snippetName, setSnippetName] = useState9(null);
|
|
@@ -1840,7 +1887,7 @@ var RunframeCliLeftHeader = (props) => {
|
|
|
1840
1887
|
const circuitJson = useRunFrameStore((state) => state.circuitJson);
|
|
1841
1888
|
const [isImportDialogOpen, setIsImportDialogOpen] = useState9(false);
|
|
1842
1889
|
const [isAiReviewDialogOpen, setIsAiReviewDialogOpen] = useState9(false);
|
|
1843
|
-
return /* @__PURE__ */ jsxs8(
|
|
1890
|
+
return /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
1844
1891
|
/* @__PURE__ */ jsxs8(DropdownMenu, { children: [
|
|
1845
1892
|
/* @__PURE__ */ jsx11(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx11("div", { className: "rf-whitespace-nowrap rf-text-xs font-medium rf-p-2 rf-mx-1 rf-cursor-pointer rf-relative", children: "File" }) }),
|
|
1846
1893
|
/* @__PURE__ */ jsxs8(DropdownMenuContent, { children: [
|