@tscircuit/runframe 0.0.314 → 0.0.316
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-PC663PVG.js → chunk-TPTDESBD.js} +1 -1
- package/dist/preview.js +1 -1
- package/dist/runner.d.ts +3 -2
- package/dist/runner.js +105 -142
- package/dist/standalone-preview.min.js +1 -1
- package/dist/standalone.min.js +551 -551
- package/package.json +3 -3
package/dist/runner.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
buttonVariants,
|
|
21
21
|
cn,
|
|
22
22
|
linkify
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TPTDESBD.js";
|
|
24
24
|
|
|
25
25
|
// lib/components/RunFrame/RunFrame.tsx
|
|
26
26
|
import { createCircuitWebWorker } from "@tscircuit/eval/worker";
|
|
@@ -338,22 +338,6 @@ var RunFrame = (props) => {
|
|
|
338
338
|
setIsRunning(false);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
if (!props.entrypoint) {
|
|
342
|
-
setError({
|
|
343
|
-
error: "No entrypoint provided. Please specify an entrypoint file.",
|
|
344
|
-
stack: ""
|
|
345
|
-
});
|
|
346
|
-
setIsRunning(false);
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
if (!fsMapObj[props.entrypoint]?.trim()) {
|
|
350
|
-
setError({
|
|
351
|
-
error: "No files provided. Please provide at least one file with code to execute.",
|
|
352
|
-
stack: ""
|
|
353
|
-
});
|
|
354
|
-
setIsRunning(false);
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
341
|
const wasTriggeredByRunButton = props.showRunButton && runCountTrigger !== lastRunCountTriggerRef.current;
|
|
358
342
|
if (lastFsMapRef.current && circuitJson) {
|
|
359
343
|
const changes = getChangesBetweenFsMaps(lastFsMapRef.current, fsMap);
|
|
@@ -370,7 +354,7 @@ var RunFrame = (props) => {
|
|
|
370
354
|
return;
|
|
371
355
|
}
|
|
372
356
|
lastFsMapRef.current = fsMap;
|
|
373
|
-
lastEntrypointRef.current = props.entrypoint;
|
|
357
|
+
lastEntrypointRef.current = props.entrypoint ?? null;
|
|
374
358
|
lastRunCountTriggerRef.current = runCountTrigger;
|
|
375
359
|
setIsRunning(true);
|
|
376
360
|
const runWorker = async () => {
|
|
@@ -401,14 +385,6 @@ var RunFrame = (props) => {
|
|
|
401
385
|
globalThis.runFrameWorker = worker;
|
|
402
386
|
props.onRenderStarted?.();
|
|
403
387
|
const fsMapObj2 = fsMap instanceof Map ? Object.fromEntries(fsMap.entries()) : fsMap;
|
|
404
|
-
if (!fsMapObj2[props.entrypoint]) {
|
|
405
|
-
setError({
|
|
406
|
-
error: `Entrypoint not found (entrypoint: "${props.entrypoint}", fsMapKeys: ${Object.keys(fsMapObj2).join(", ")})`,
|
|
407
|
-
stack: ""
|
|
408
|
-
});
|
|
409
|
-
setIsRunning(false);
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
388
|
const renderIds = /* @__PURE__ */ new Set();
|
|
413
389
|
const startRenderTime = Date.now();
|
|
414
390
|
let lastRenderLogSet = Date.now();
|
|
@@ -655,7 +631,7 @@ var useEditEventController = () => {
|
|
|
655
631
|
// lib/components/RunFrameWithApi/RunFrameWithApi.tsx
|
|
656
632
|
import { useEffect as useEffect3 } from "react";
|
|
657
633
|
import { applyEditEventsToManualEditsFile as applyEditEventsToManualEditsFile2 } from "@tscircuit/core";
|
|
658
|
-
import { jsx as jsx2
|
|
634
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
659
635
|
var debug5 = Debug3("run-frame:RunFrameWithApi");
|
|
660
636
|
var guessEntrypoint = (files) => files.find((file) => file.includes("entrypoint.")) ?? files.find((file) => file.includes("index.")) ?? files.find((file) => file.includes("main.")) ?? files.find((file) => file.endsWith(".tsx"));
|
|
661
637
|
var guessManualEditsFilePath = (files) => files.find((file) => file.includes("manual-edits.")) ?? files.find((file) => file.includes("manual-edit.")) ?? files.find((file) => file.endsWith(".json"));
|
|
@@ -691,19 +667,6 @@ var RunFrameWithApi = (props) => {
|
|
|
691
667
|
startPolling();
|
|
692
668
|
return () => stopPolling();
|
|
693
669
|
}, [startPolling, stopPolling]);
|
|
694
|
-
const entrypoint = guessEntrypoint(Array.from(fsMap.keys())) ?? "entrypoint.tsx";
|
|
695
|
-
useEffect3(() => {
|
|
696
|
-
debug5(`entrypoint set to ${entrypoint}`, {
|
|
697
|
-
fsKeys: Array.from(fsMap.keys())
|
|
698
|
-
});
|
|
699
|
-
}, [entrypoint]);
|
|
700
|
-
if (!fsMap.get(entrypoint)) {
|
|
701
|
-
return /* @__PURE__ */ jsxs2("div", { children: [
|
|
702
|
-
"No entrypoint found for Run Frame! Found files:",
|
|
703
|
-
" ",
|
|
704
|
-
Array.from(fsMap.keys()).join(",")
|
|
705
|
-
] });
|
|
706
|
-
}
|
|
707
670
|
return /* @__PURE__ */ jsx2(
|
|
708
671
|
RunFrame,
|
|
709
672
|
{
|
|
@@ -721,7 +684,6 @@ var RunFrameWithApi = (props) => {
|
|
|
721
684
|
debug5("onRenderFinished / markRenderComplete");
|
|
722
685
|
markRenderComplete();
|
|
723
686
|
},
|
|
724
|
-
entrypoint,
|
|
725
687
|
editEvents: editEventsForRender,
|
|
726
688
|
onEditEvent: (ee) => {
|
|
727
689
|
pushEditEvent(ee);
|
|
@@ -784,7 +746,7 @@ import { useEffect as useEffect8, useMemo as useMemo2, useState as useState10 }
|
|
|
784
746
|
|
|
785
747
|
// lib/components/RunFrameForCli/SelectSnippetDialog.tsx
|
|
786
748
|
import { useState as useState4 } from "react";
|
|
787
|
-
import { jsx as jsx3, jsxs as
|
|
749
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
788
750
|
var SelectSnippetDialog = ({
|
|
789
751
|
snippetNames,
|
|
790
752
|
onSelect,
|
|
@@ -807,7 +769,7 @@ var SelectSnippetDialog = ({
|
|
|
807
769
|
}
|
|
808
770
|
}
|
|
809
771
|
};
|
|
810
|
-
return /* @__PURE__ */ jsx3("div", { className: "rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-items-center rf-justify-center rf-z-[100]", children: /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ jsx3("div", { className: "rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-items-center rf-justify-center rf-z-[100]", children: /* @__PURE__ */ jsxs2("div", { className: "rf-bg-white rf-rounded-lg rf-p-6 rf-w-96", children: [
|
|
811
773
|
/* @__PURE__ */ jsx3("h2", { className: "rf-text-lg rf-font-semibold rf-mb-4", children: "Select Snippet" }),
|
|
812
774
|
/* @__PURE__ */ jsx3(
|
|
813
775
|
"input",
|
|
@@ -820,7 +782,7 @@ var SelectSnippetDialog = ({
|
|
|
820
782
|
onKeyDown: handleKeyDown
|
|
821
783
|
}
|
|
822
784
|
),
|
|
823
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ jsxs2("div", { className: "rf-h-60 rf-overflow-y-auto", children: [
|
|
824
786
|
filteredSnippets.map((name) => /* @__PURE__ */ jsx3(
|
|
825
787
|
"button",
|
|
826
788
|
{
|
|
@@ -831,7 +793,7 @@ var SelectSnippetDialog = ({
|
|
|
831
793
|
},
|
|
832
794
|
name
|
|
833
795
|
)),
|
|
834
|
-
showCreateNew && /* @__PURE__ */
|
|
796
|
+
showCreateNew && /* @__PURE__ */ jsxs2(
|
|
835
797
|
"button",
|
|
836
798
|
{
|
|
837
799
|
type: "button",
|
|
@@ -845,7 +807,7 @@ var SelectSnippetDialog = ({
|
|
|
845
807
|
}
|
|
846
808
|
)
|
|
847
809
|
] }),
|
|
848
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ jsxs2("div", { className: "rf-mt-4 rf-flex rf-justify-end rf-gap-2", children: [
|
|
849
811
|
/* @__PURE__ */ jsx3(
|
|
850
812
|
"button",
|
|
851
813
|
{
|
|
@@ -890,7 +852,7 @@ import "lucide-react";
|
|
|
890
852
|
// lib/components/ui/alert-dialog.tsx
|
|
891
853
|
import * as React from "react";
|
|
892
854
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
893
|
-
import { jsx as jsx4, jsxs as
|
|
855
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
894
856
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
895
857
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
896
858
|
var AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
@@ -905,7 +867,7 @@ var AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
905
867
|
}
|
|
906
868
|
));
|
|
907
869
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
908
|
-
var AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
870
|
+
var AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3(AlertDialogPortal, { children: [
|
|
909
871
|
/* @__PURE__ */ jsx4(AlertDialogOverlay, {}),
|
|
910
872
|
/* @__PURE__ */ jsx4(
|
|
911
873
|
AlertDialogPrimitive.Content,
|
|
@@ -1111,7 +1073,7 @@ var mapTscircuitSnippetToSearchResult = (tscircuitSnippet) => {
|
|
|
1111
1073
|
|
|
1112
1074
|
// lib/components/ImportComponentDialog/ImportComponentDialog.tsx
|
|
1113
1075
|
import { createSvgUrl as createPngUrl } from "@tscircuit/create-snippet-url";
|
|
1114
|
-
import { jsx as jsx7, jsxs as
|
|
1076
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1115
1077
|
var ImportComponentDialog = ({
|
|
1116
1078
|
isOpen,
|
|
1117
1079
|
onClose,
|
|
@@ -1173,24 +1135,24 @@ var ImportComponentDialog = ({
|
|
|
1173
1135
|
setDetailsComponent(component);
|
|
1174
1136
|
setDetailsOpen(true);
|
|
1175
1137
|
};
|
|
1176
|
-
return /* @__PURE__ */
|
|
1177
|
-
/* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ jsxs4(AlertDialog, { open: isOpen, onOpenChange: () => onClose(), children: [
|
|
1139
|
+
/* @__PURE__ */ jsxs4(AlertDialogContent, { className: "rf-max-w-3xl rf-w-full rf-max-h-[90vh] rf-overflow-y-auto rf-flex rf-flex-col", children: [
|
|
1140
|
+
/* @__PURE__ */ jsxs4(AlertDialogHeader, { children: [
|
|
1179
1141
|
/* @__PURE__ */ jsx7(AlertDialogTitle, { children: "Import Component" }),
|
|
1180
1142
|
/* @__PURE__ */ jsx7(AlertDialogDescription, { children: "Search for components from tscircuit.com or JLCPCB parts library." })
|
|
1181
1143
|
] }),
|
|
1182
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ jsxs4(
|
|
1183
1145
|
Tabs,
|
|
1184
1146
|
{
|
|
1185
1147
|
value: activeTab,
|
|
1186
1148
|
onValueChange: (value) => setActiveTab(value),
|
|
1187
1149
|
children: [
|
|
1188
|
-
/* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ jsxs4(TabsList, { className: "rf-grid rf-w-full rf-grid-cols-2", children: [
|
|
1189
1151
|
/* @__PURE__ */ jsx7(TabsTrigger, { value: "tscircuit.com", children: "tscircuit.com" }),
|
|
1190
1152
|
/* @__PURE__ */ jsx7(TabsTrigger, { value: "jlcpcb", children: "JLCPCB Parts" })
|
|
1191
1153
|
] }),
|
|
1192
|
-
/* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-items-center rf-gap-2 rf-mt-4", children: [
|
|
1155
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-relative rf-flex-grow", children: [
|
|
1194
1156
|
/* @__PURE__ */ jsx7(Search, { className: "rf-absolute rf-left-2 rf-top-2.5 rf-h-4 rf-w-4 rf-text-muted-foreground" }),
|
|
1195
1157
|
/* @__PURE__ */ jsx7(
|
|
1196
1158
|
Input,
|
|
@@ -1205,15 +1167,15 @@ var ImportComponentDialog = ({
|
|
|
1205
1167
|
] }),
|
|
1206
1168
|
/* @__PURE__ */ jsx7(Button, { onClick: handleSearch, disabled: isLoading, children: isLoading ? /* @__PURE__ */ jsx7(Loader22, { className: "rf-h-4 rf-w-4 rf-animate-spin" }) : "Search" })
|
|
1207
1169
|
] }),
|
|
1208
|
-
/* @__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__ */
|
|
1170
|
+
/* @__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(
|
|
1209
1171
|
"div",
|
|
1210
1172
|
{
|
|
1211
1173
|
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" : ""}`,
|
|
1212
1174
|
onClick: () => setSelectedComponent(result),
|
|
1213
1175
|
children: [
|
|
1214
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1215
1177
|
/* @__PURE__ */ jsx7("div", { className: "rf-font-medium", children: result.name }),
|
|
1216
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-text-sm rf-text-zinc-500", children: [
|
|
1217
1179
|
result.partNumber && /* @__PURE__ */ jsx7("span", { className: "rf-mr-2", children: result.partNumber }),
|
|
1218
1180
|
result.description
|
|
1219
1181
|
] })
|
|
@@ -1233,14 +1195,14 @@ var ImportComponentDialog = ({
|
|
|
1233
1195
|
]
|
|
1234
1196
|
},
|
|
1235
1197
|
result.id
|
|
1236
|
-
)) }) : isLoading ? /* @__PURE__ */
|
|
1198
|
+
)) }) : isLoading ? /* @__PURE__ */ jsxs4("div", { className: "rf-p-8 rf-text-center rf-text-zinc-500", children: [
|
|
1237
1199
|
/* @__PURE__ */ jsx7(Loader22, { className: "rf-h-8 rf-w-8 rf-animate-spin rf-mx-auto rf-mb-2" }),
|
|
1238
1200
|
/* @__PURE__ */ jsx7("p", { children: "Searching..." })
|
|
1239
1201
|
] }) : /* @__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" }) })
|
|
1240
1202
|
]
|
|
1241
1203
|
}
|
|
1242
1204
|
),
|
|
1243
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ jsxs4(AlertDialogFooter, { children: [
|
|
1244
1206
|
/* @__PURE__ */ jsx7(AlertDialogCancel, { onClick: onClose, children: "Cancel" }),
|
|
1245
1207
|
/* @__PURE__ */ jsx7(
|
|
1246
1208
|
Button,
|
|
@@ -1257,46 +1219,46 @@ var ImportComponentDialog = ({
|
|
|
1257
1219
|
)
|
|
1258
1220
|
] })
|
|
1259
1221
|
] }),
|
|
1260
|
-
/* @__PURE__ */ jsx7(AlertDialog, { open: detailsOpen, onOpenChange: setDetailsOpen, children: /* @__PURE__ */
|
|
1261
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ jsx7(AlertDialog, { open: detailsOpen, onOpenChange: setDetailsOpen, children: /* @__PURE__ */ jsxs4(AlertDialogContent, { className: "!rf-max-h-[70%] !rf-overflow-y-auto rf-flex rf-flex-col !rf-max-w-[60vw] !rf-overflow-x-hidden", children: [
|
|
1223
|
+
/* @__PURE__ */ jsxs4(AlertDialogHeader, { children: [
|
|
1262
1224
|
/* @__PURE__ */ jsx7(AlertDialogTitle, { children: detailsComponent?.name }),
|
|
1263
1225
|
/* @__PURE__ */ jsx7(AlertDialogDescription, { children: "Detailed information about the selected component" }),
|
|
1264
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-text-sm rf-text-muted-foreground", children: [
|
|
1265
1227
|
detailsComponent?.partNumber && /* @__PURE__ */ jsx7("div", { className: "rf-font-mono rf-text-sm rf-mb-2", children: detailsComponent.partNumber }),
|
|
1266
1228
|
detailsComponent?.description
|
|
1267
1229
|
] })
|
|
1268
1230
|
] }),
|
|
1269
|
-
detailsComponent?.source === "jlcpcb" && /* @__PURE__ */
|
|
1231
|
+
detailsComponent?.source === "jlcpcb" && /* @__PURE__ */ jsxs4("div", { className: "rf-my-4 rf-border rf-rounded-md rf-p-4", children: [
|
|
1270
1232
|
/* @__PURE__ */ jsx7("div", { className: "rf-text-sm rf-font-medium rf-mb-2", children: "JLCPCB Details" }),
|
|
1271
|
-
/* @__PURE__ */
|
|
1272
|
-
detailsComponent.package && /* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-grid rf-grid-cols-2 rf-gap-2", children: [
|
|
1234
|
+
detailsComponent.package && /* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-flex-col", children: [
|
|
1273
1235
|
/* @__PURE__ */ jsx7("span", { className: "rf-text-xs rf-text-zinc-500", children: "Package" }),
|
|
1274
1236
|
/* @__PURE__ */ jsx7("span", { className: "rf-font-medium", children: detailsComponent.package })
|
|
1275
1237
|
] }),
|
|
1276
|
-
detailsComponent.price !== void 0 && /* @__PURE__ */
|
|
1238
|
+
detailsComponent.price !== void 0 && /* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-flex-col", children: [
|
|
1277
1239
|
/* @__PURE__ */ jsx7("span", { className: "rf-text-xs rf-text-zinc-500", children: "Price" }),
|
|
1278
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ jsxs4("span", { className: "rf-font-medium", children: [
|
|
1279
1241
|
"$",
|
|
1280
1242
|
detailsComponent.price.toFixed(4)
|
|
1281
1243
|
] })
|
|
1282
1244
|
] })
|
|
1283
1245
|
] })
|
|
1284
1246
|
] }),
|
|
1285
|
-
detailsComponent?.source === "tscircuit.com" && /* @__PURE__ */
|
|
1247
|
+
detailsComponent?.source === "tscircuit.com" && /* @__PURE__ */ jsxs4("div", { className: "rf-my-4 rf-border rf-rounded-md rf-p-4 !rf-max-w-[60vw] !rf-overflow-x-hidden", children: [
|
|
1286
1248
|
/* @__PURE__ */ jsx7("div", { className: "rf-text-sm rf-font-medium rf-mb-2", children: "tscircuit Details" }),
|
|
1287
|
-
/* @__PURE__ */ jsx7("div", { className: "rf-grid rf-grid-cols-2 rf-gap-2", children: detailsComponent.owner && /* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx7("div", { className: "rf-grid rf-grid-cols-2 rf-gap-2", children: detailsComponent.owner && /* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-flex-col", children: [
|
|
1288
1250
|
/* @__PURE__ */ jsx7("span", { className: "rf-text-xs rf-text-zinc-500", children: "Owner" }),
|
|
1289
1251
|
/* @__PURE__ */ jsx7("span", { className: "rf-font-medium", children: detailsComponent.owner })
|
|
1290
1252
|
] }) }),
|
|
1291
|
-
detailsComponent.code && /* @__PURE__ */
|
|
1253
|
+
detailsComponent.code && /* @__PURE__ */ jsxs4("div", { className: "rf-mt-2", children: [
|
|
1292
1254
|
/* @__PURE__ */ jsx7("div", { className: "rf-text-xs rf-text-zinc-500 rf-mb-1", children: "Code Preview" }),
|
|
1293
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ jsxs4("pre", { className: "rf-bg-zinc-50 rf-p-2 rf-rounded rf-text-xs rf-font-mono rf-max-h-32 rf-overflow-y-auto", children: [
|
|
1294
1256
|
detailsComponent.code.substring(0, 500),
|
|
1295
1257
|
detailsComponent.code.length > 500 && "..."
|
|
1296
1258
|
] })
|
|
1297
1259
|
] })
|
|
1298
1260
|
] }),
|
|
1299
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-my-4 rf-border rf-rounded-md rf-p-4", children: [
|
|
1300
1262
|
/* @__PURE__ */ jsx7("div", { className: "rf-text-sm rf-font-medium rf-mb-2", children: "Preview" }),
|
|
1301
1263
|
detailsComponent?.source === "tscircuit.com" && detailsComponent.code ? /* @__PURE__ */ jsx7("div", { className: "rf-flex rf-justify-center", children: /* @__PURE__ */ jsx7("div", { className: "rf-border rf-rounded rf-p-4 rf-bg-zinc-50", children: /* @__PURE__ */ jsx7(
|
|
1302
1264
|
"img",
|
|
@@ -1307,8 +1269,8 @@ var ImportComponentDialog = ({
|
|
|
1307
1269
|
}
|
|
1308
1270
|
) }) }) : /* @__PURE__ */ jsx7("div", { className: "rf-text-center rf-text-zinc-500 rf-p-4", children: "No preview available" })
|
|
1309
1271
|
] }),
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ jsxs4("div", { className: "rf-flex rf-justify-between", children: [
|
|
1273
|
+
/* @__PURE__ */ jsxs4(
|
|
1312
1274
|
Button,
|
|
1313
1275
|
{
|
|
1314
1276
|
variant: "outline",
|
|
@@ -1447,6 +1409,7 @@ import { fetchEasyEDAComponent, convertRawEasyToTsx } from "easyeda/browser";
|
|
|
1447
1409
|
import ky from "ky";
|
|
1448
1410
|
var importComponentFromJlcpcb = async (jlcpcbPartNumber) => {
|
|
1449
1411
|
const component = await fetchEasyEDAComponent(jlcpcbPartNumber, {
|
|
1412
|
+
// @ts-ignore
|
|
1450
1413
|
fetch: (url, options) => {
|
|
1451
1414
|
return fetch(`${API_BASE}/proxy`, {
|
|
1452
1415
|
...options,
|
|
@@ -1490,7 +1453,7 @@ import { QueryClient, QueryClientProvider } from "react-query";
|
|
|
1490
1453
|
import { MapPin } from "lucide-react";
|
|
1491
1454
|
import { useState as useState6 } from "react";
|
|
1492
1455
|
import { toast as toast2 } from "react-hot-toast";
|
|
1493
|
-
import { jsx as jsx8, jsxs as
|
|
1456
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1494
1457
|
var CheckoutOrder = ({
|
|
1495
1458
|
finalCost,
|
|
1496
1459
|
onConfirmCheckout,
|
|
@@ -1558,14 +1521,14 @@ var CheckoutOrder = ({
|
|
|
1558
1521
|
toast2.success("Your PCB order has been placed successfully.");
|
|
1559
1522
|
onConfirmCheckout();
|
|
1560
1523
|
};
|
|
1561
|
-
return /* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ jsxs5("div", { className: "rf-bg-white rf-rounded-xl rf-p-6 rf-mx-auto", children: [
|
|
1562
1525
|
/* @__PURE__ */ jsx8("h2", { className: "rf-text-2xl rf-font-bold rf-mb-6", children: "Checkout" }),
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1526
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-grid rf-grid-cols-1 md:rf-grid-cols-2 rf-gap-8", children: [
|
|
1527
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-6", children: [
|
|
1565
1528
|
/* @__PURE__ */ jsx8("h3", { className: "rf-text-lg rf-font-semibold", children: "Shipping Address" }),
|
|
1566
|
-
savedAddresses.length > 0 && /* @__PURE__ */
|
|
1529
|
+
savedAddresses.length > 0 && /* @__PURE__ */ jsxs5("div", { className: "rf-space-y-4", children: [
|
|
1567
1530
|
/* @__PURE__ */ jsx8("div", { className: "rf-text-sm rf-font-medium rf-text-gray-500", children: "Saved Addresses" }),
|
|
1568
|
-
/* @__PURE__ */ jsx8("div", { className: "rf-flex rf-flex-wrap rf-gap-3", children: savedAddresses.map((address) => /* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ jsx8("div", { className: "rf-flex rf-flex-wrap rf-gap-3", children: savedAddresses.map((address) => /* @__PURE__ */ jsxs5(
|
|
1569
1532
|
"button",
|
|
1570
1533
|
{
|
|
1571
1534
|
type: "button",
|
|
@@ -1583,8 +1546,8 @@ var CheckoutOrder = ({
|
|
|
1583
1546
|
address.id
|
|
1584
1547
|
)) })
|
|
1585
1548
|
] }),
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */ jsx8("div", { className: "rf-grid rf-grid-cols-2 rf-gap-4", children: /* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-4", children: [
|
|
1550
|
+
/* @__PURE__ */ jsx8("div", { className: "rf-grid rf-grid-cols-2 rf-gap-4", children: /* @__PURE__ */ jsxs5("div", { className: "rf-space-y-2", children: [
|
|
1588
1551
|
/* @__PURE__ */ jsx8("label", { htmlFor: "name", children: "Address Name" }),
|
|
1589
1552
|
/* @__PURE__ */ jsx8(
|
|
1590
1553
|
Input,
|
|
@@ -1597,7 +1560,7 @@ var CheckoutOrder = ({
|
|
|
1597
1560
|
}
|
|
1598
1561
|
)
|
|
1599
1562
|
] }) }),
|
|
1600
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-2", children: [
|
|
1601
1564
|
/* @__PURE__ */ jsx8("label", { htmlFor: "street", children: "Street Address" }),
|
|
1602
1565
|
/* @__PURE__ */ jsx8(
|
|
1603
1566
|
Input,
|
|
@@ -1610,8 +1573,8 @@ var CheckoutOrder = ({
|
|
|
1610
1573
|
}
|
|
1611
1574
|
)
|
|
1612
1575
|
] }),
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-grid rf-grid-cols-2 rf-gap-4", children: [
|
|
1577
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-2", children: [
|
|
1615
1578
|
/* @__PURE__ */ jsx8("label", { htmlFor: "city", children: "City" }),
|
|
1616
1579
|
/* @__PURE__ */ jsx8(
|
|
1617
1580
|
Input,
|
|
@@ -1624,7 +1587,7 @@ var CheckoutOrder = ({
|
|
|
1624
1587
|
}
|
|
1625
1588
|
)
|
|
1626
1589
|
] }),
|
|
1627
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-2", children: [
|
|
1628
1591
|
/* @__PURE__ */ jsx8("label", { htmlFor: "state", children: "State" }),
|
|
1629
1592
|
/* @__PURE__ */ jsx8(
|
|
1630
1593
|
Input,
|
|
@@ -1638,8 +1601,8 @@ var CheckoutOrder = ({
|
|
|
1638
1601
|
)
|
|
1639
1602
|
] })
|
|
1640
1603
|
] }),
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-grid rf-grid-cols-2 rf-gap-4", children: [
|
|
1605
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-2", children: [
|
|
1643
1606
|
/* @__PURE__ */ jsx8("label", { htmlFor: "zipCode", children: "Zip Code" }),
|
|
1644
1607
|
/* @__PURE__ */ jsx8(
|
|
1645
1608
|
Input,
|
|
@@ -1652,7 +1615,7 @@ var CheckoutOrder = ({
|
|
|
1652
1615
|
}
|
|
1653
1616
|
)
|
|
1654
1617
|
] }),
|
|
1655
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-2", children: [
|
|
1656
1619
|
/* @__PURE__ */ jsx8("label", { htmlFor: "country", children: "Country" }),
|
|
1657
1620
|
/* @__PURE__ */ jsx8(
|
|
1658
1621
|
Input,
|
|
@@ -1668,42 +1631,42 @@ var CheckoutOrder = ({
|
|
|
1668
1631
|
] })
|
|
1669
1632
|
] })
|
|
1670
1633
|
] }),
|
|
1671
|
-
/* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-bg-gray-50 rf-p-6 rf-rounded-lg", children: [
|
|
1672
1635
|
/* @__PURE__ */ jsx8("h3", { className: "rf-text-lg rf-font-semibold rf-mb-4", children: "Order Summary" }),
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-space-y-4", children: [
|
|
1637
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-justify-between rf-py-2 rf-border-b rf-border-gray-200", children: [
|
|
1675
1638
|
/* @__PURE__ */ jsx8("span", { className: "rf-text-gray-600", children: "PCB Manufacturing" }),
|
|
1676
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ jsxs5("span", { className: "rf-font-medium", children: [
|
|
1677
1640
|
"$",
|
|
1678
1641
|
(finalCost * 0.6).toFixed(2)
|
|
1679
1642
|
] })
|
|
1680
1643
|
] }),
|
|
1681
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-justify-between rf-py-2 rf-border-b rf-border-gray-200", children: [
|
|
1682
1645
|
/* @__PURE__ */ jsx8("span", { className: "rf-text-gray-600", children: "Components" }),
|
|
1683
|
-
/* @__PURE__ */
|
|
1646
|
+
/* @__PURE__ */ jsxs5("span", { className: "rf-font-medium", children: [
|
|
1684
1647
|
"$",
|
|
1685
1648
|
(finalCost * 0.3).toFixed(2)
|
|
1686
1649
|
] })
|
|
1687
1650
|
] }),
|
|
1688
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-justify-between rf-py-2 rf-border-b rf-border-gray-200", children: [
|
|
1689
1652
|
/* @__PURE__ */ jsx8("span", { className: "rf-text-gray-600", children: "Assembly" }),
|
|
1690
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ jsxs5("span", { className: "rf-font-medium", children: [
|
|
1691
1654
|
"$",
|
|
1692
1655
|
(finalCost * 0.1).toFixed(2)
|
|
1693
1656
|
] })
|
|
1694
1657
|
] }),
|
|
1695
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-justify-between rf-py-2 rf-border-b rf-border-gray-200", children: [
|
|
1696
1659
|
/* @__PURE__ */ jsx8("span", { className: "rf-text-gray-600", children: "Shipping" }),
|
|
1697
1660
|
/* @__PURE__ */ jsx8("span", { className: "rf-font-medium", children: "$15.00" })
|
|
1698
1661
|
] }),
|
|
1699
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-justify-between rf-py-2 rf-text-lg rf-font-bold", children: [
|
|
1700
1663
|
/* @__PURE__ */ jsx8("span", { children: "Total" }),
|
|
1701
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1702
1665
|
"$",
|
|
1703
1666
|
(finalCost + 15).toFixed(2)
|
|
1704
1667
|
] })
|
|
1705
1668
|
] }),
|
|
1706
|
-
/* @__PURE__ */
|
|
1669
|
+
/* @__PURE__ */ jsxs5("div", { className: "rf-pt-4", children: [
|
|
1707
1670
|
/* @__PURE__ */ jsx8(
|
|
1708
1671
|
Button,
|
|
1709
1672
|
{
|
|
@@ -1732,10 +1695,10 @@ var CheckoutOrder = ({
|
|
|
1732
1695
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1733
1696
|
import { Check as Check2, ChevronDown, ChevronUp } from "lucide-react";
|
|
1734
1697
|
import * as React5 from "react";
|
|
1735
|
-
import { jsx as jsx9, jsxs as
|
|
1698
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1736
1699
|
var Select = SelectPrimitive.Root;
|
|
1737
1700
|
var SelectValue = SelectPrimitive.Value;
|
|
1738
|
-
var SelectTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1701
|
+
var SelectTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
1739
1702
|
SelectPrimitive.Trigger,
|
|
1740
1703
|
{
|
|
1741
1704
|
ref,
|
|
@@ -1777,7 +1740,7 @@ var SelectScrollDownButton = React5.forwardRef(({ className, ...props }, ref) =>
|
|
|
1777
1740
|
}
|
|
1778
1741
|
));
|
|
1779
1742
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1780
|
-
var SelectContent = React5.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.Portal, { children: /* @__PURE__ */
|
|
1743
|
+
var SelectContent = React5.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs6(
|
|
1781
1744
|
SelectPrimitive.Content,
|
|
1782
1745
|
{
|
|
1783
1746
|
ref,
|
|
@@ -1817,7 +1780,7 @@ var SelectLabel = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1817
1780
|
}
|
|
1818
1781
|
));
|
|
1819
1782
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1820
|
-
var SelectItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1783
|
+
var SelectItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
1821
1784
|
SelectPrimitive.Item,
|
|
1822
1785
|
{
|
|
1823
1786
|
ref,
|
|
@@ -1862,7 +1825,7 @@ function Skeleton({
|
|
|
1862
1825
|
import { ArrowDown } from "lucide-react";
|
|
1863
1826
|
import { useEffect as useEffect7 } from "react";
|
|
1864
1827
|
import { useState as useState7 } from "react";
|
|
1865
|
-
import { jsx as jsx11, jsxs as
|
|
1828
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1866
1829
|
var InitialOrderScreen = ({
|
|
1867
1830
|
onCancel,
|
|
1868
1831
|
onContinue
|
|
@@ -1894,9 +1857,9 @@ var InitialOrderScreen = ({
|
|
|
1894
1857
|
setIsLoading(false);
|
|
1895
1858
|
}, 1500);
|
|
1896
1859
|
};
|
|
1897
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ jsxs7("div", { className: "rf-flex rf-flex-col rf-bg-white rf-rounded-xl rf-p-8 rf-max-w-md rf-w-full rf-mx-auto", children: [
|
|
1898
1861
|
/* @__PURE__ */ jsx11("h2", { className: "rf-text-3xl rf-font-bold rf-text-center rf-mb-8", children: "Order PCB" }),
|
|
1899
|
-
/* @__PURE__ */
|
|
1862
|
+
/* @__PURE__ */ jsxs7("div", { className: "rf-mb-8", children: [
|
|
1900
1863
|
/* @__PURE__ */ jsx11(
|
|
1901
1864
|
"label",
|
|
1902
1865
|
{
|
|
@@ -1905,7 +1868,7 @@ var InitialOrderScreen = ({
|
|
|
1905
1868
|
children: "Select Product Category"
|
|
1906
1869
|
}
|
|
1907
1870
|
),
|
|
1908
|
-
/* @__PURE__ */
|
|
1871
|
+
/* @__PURE__ */ jsxs7(
|
|
1909
1872
|
Select,
|
|
1910
1873
|
{
|
|
1911
1874
|
onValueChange: handleSelectCategory,
|
|
@@ -1917,22 +1880,22 @@ var InitialOrderScreen = ({
|
|
|
1917
1880
|
}
|
|
1918
1881
|
)
|
|
1919
1882
|
] }),
|
|
1920
|
-
isLoading ? /* @__PURE__ */
|
|
1921
|
-
/* @__PURE__ */
|
|
1883
|
+
isLoading ? /* @__PURE__ */ jsxs7("div", { className: "rf-flex rf-flex-col rf-items-center rf-mb-8", children: [
|
|
1884
|
+
/* @__PURE__ */ jsxs7("div", { className: "rf-animate-pulse rf-flex rf-space-x-2 rf-items-center rf-mb-3", children: [
|
|
1922
1885
|
/* @__PURE__ */ jsx11(ArrowDown, { className: "rf-h-5 rf-w-5 rf-text-gray-400" }),
|
|
1923
1886
|
/* @__PURE__ */ jsx11("span", { className: "rf-text-gray-500", children: "Fetching estimate..." })
|
|
1924
1887
|
] }),
|
|
1925
1888
|
/* @__PURE__ */ jsx11(Skeleton, { className: "rf-h-6 rf-w-3/4 rf-mb-2" }),
|
|
1926
1889
|
/* @__PURE__ */ jsx11(Skeleton, { className: "rf-h-6 rf-w-1/2" })
|
|
1927
|
-
] }) : estimatedCost !== null ? /* @__PURE__ */
|
|
1890
|
+
] }) : estimatedCost !== null ? /* @__PURE__ */ jsxs7("div", { className: "rf-bg-gray-50 rf-p-4 rf-rounded-lg rf-mb-8", children: [
|
|
1928
1891
|
/* @__PURE__ */ jsx11("p", { className: "rf-text-sm rf-text-gray-600 rf-mb-2", children: "Estimated Cost:" }),
|
|
1929
|
-
/* @__PURE__ */
|
|
1892
|
+
/* @__PURE__ */ jsxs7("p", { className: "rf-text-2xl rf-font-bold rf-text-gray-900", children: [
|
|
1930
1893
|
"$",
|
|
1931
1894
|
estimatedCost.toFixed(2)
|
|
1932
1895
|
] }),
|
|
1933
1896
|
/* @__PURE__ */ jsx11("p", { className: "rf-text-xs rf-text-gray-500 rf-mt-1", children: "Pricing may vary based on specifications" })
|
|
1934
1897
|
] }) : null,
|
|
1935
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ jsxs7("div", { className: "rf-flex rf-justify-between rf-mt-auto", children: [
|
|
1936
1899
|
/* @__PURE__ */ jsx11(
|
|
1937
1900
|
Button,
|
|
1938
1901
|
{
|
|
@@ -2050,7 +2013,7 @@ var orderSteps = [
|
|
|
2050
2013
|
}));
|
|
2051
2014
|
|
|
2052
2015
|
// lib/components/OrderDialog/StepwiseProgress.tsx
|
|
2053
|
-
import { jsx as jsx13, jsxs as
|
|
2016
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2054
2017
|
var StepwiseProgressPanel = ({
|
|
2055
2018
|
orderId,
|
|
2056
2019
|
title = "Order PCB",
|
|
@@ -2095,10 +2058,10 @@ var StepwiseProgressPanel = ({
|
|
|
2095
2058
|
const totalSteps = steps.length;
|
|
2096
2059
|
const progress = Math.round(completedSteps.length / totalSteps * 100);
|
|
2097
2060
|
const loading = isLoading || externalLoading;
|
|
2098
|
-
return /* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2061
|
+
return /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-flex-col rf-bg-white rf-rounded-xl rf-p-6 rf-max-w-xl rf-w-full rf-mx-auto", children: [
|
|
2062
|
+
/* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-center rf-justify-between rf-mb-6", children: [
|
|
2100
2063
|
/* @__PURE__ */ jsx13("h2", { className: "rf-text-2xl rf-font-bold", children: title }),
|
|
2101
|
-
/* @__PURE__ */
|
|
2064
|
+
/* @__PURE__ */ jsxs8("div", { className: "rf-text-sm rf-text-muted-foreground", children: [
|
|
2102
2065
|
completedSteps.length,
|
|
2103
2066
|
" of ",
|
|
2104
2067
|
totalSteps,
|
|
@@ -2106,12 +2069,12 @@ var StepwiseProgressPanel = ({
|
|
|
2106
2069
|
] })
|
|
2107
2070
|
] }),
|
|
2108
2071
|
/* @__PURE__ */ jsx13(Progress, { value: progress, className: "rf-h-2 rf-mb-8" }),
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
lastCompletedStep && /* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ jsxs8("div", { className: "rf-space-y-6 rf-mb-8", children: [
|
|
2073
|
+
lastCompletedStep && /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-start rf-gap-4", children: [
|
|
2111
2074
|
/* @__PURE__ */ jsx13("div", { className: "rf-flex-shrink-0 rf-mt-0.5", children: /* @__PURE__ */ jsx13("div", { className: "rf-w-8 rf-h-8 rf-rounded-full rf-bg-green-100 rf-flex rf-items-center rf-justify-center", children: /* @__PURE__ */ jsx13(Check3, { className: "rf-h-5 rf-w-5 rf-text-green-600" }) }) }),
|
|
2112
|
-
/* @__PURE__ */
|
|
2075
|
+
/* @__PURE__ */ jsxs8("div", { className: "rf-flex-1", children: [
|
|
2113
2076
|
/* @__PURE__ */ jsx13("p", { className: "rf-text-sm rf-font-medium rf-text-muted-foreground", children: "Last Completed" }),
|
|
2114
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsxs8("p", { className: "rf-font-medium rf-text-green-600", children: [
|
|
2115
2078
|
lastCompletedStep.order_step_id,
|
|
2116
2079
|
". ",
|
|
2117
2080
|
lastCompletedStep.title
|
|
@@ -2119,11 +2082,11 @@ var StepwiseProgressPanel = ({
|
|
|
2119
2082
|
] })
|
|
2120
2083
|
] }),
|
|
2121
2084
|
lastCompletedStep && activeStep && /* @__PURE__ */ jsx13("div", { className: "rf-pl-4", children: /* @__PURE__ */ jsx13(ArrowDown2, { className: "rf-h-5 rf-w-5 rf-text-muted-foreground" }) }),
|
|
2122
|
-
activeStep && /* @__PURE__ */
|
|
2085
|
+
activeStep && /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-start rf-gap-4", children: [
|
|
2123
2086
|
/* @__PURE__ */ jsx13("div", { className: "rf-flex-shrink-0 rf-mt-0.5", children: /* @__PURE__ */ jsx13("div", { className: "rf-w-8 rf-h-8 rf-rounded-full rf-bg-blue-100 rf-flex rf-items-center rf-justify-center", children: loading ? /* @__PURE__ */ jsx13(Loader23, { className: "rf-h-5 rf-w-5 rf-text-blue-600 rf-animate-spin" }) : /* @__PURE__ */ jsx13("div", { className: "rf-h-2.5 rf-w-2.5 rf-rounded-full rf-bg-blue-600" }) }) }),
|
|
2124
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ jsxs8("div", { className: "rf-flex-1", children: [
|
|
2125
2088
|
/* @__PURE__ */ jsx13("p", { className: "rf-text-sm rf-font-medium rf-text-muted-foreground", children: "Current Step" }),
|
|
2126
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ jsxs8("p", { className: "rf-font-medium rf-text-blue-600", children: [
|
|
2127
2090
|
activeStep.order_step_id,
|
|
2128
2091
|
". ",
|
|
2129
2092
|
activeStep.title
|
|
@@ -2136,7 +2099,7 @@ var StepwiseProgressPanel = ({
|
|
|
2136
2099
|
};
|
|
2137
2100
|
|
|
2138
2101
|
// lib/components/OrderDialog/OrderDialog.tsx
|
|
2139
|
-
import { jsx as jsx14, jsxs as
|
|
2102
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2140
2103
|
var queryClient = new QueryClient();
|
|
2141
2104
|
var OrderDialog = ({
|
|
2142
2105
|
isOpen,
|
|
@@ -2163,7 +2126,7 @@ var OrderDialog = ({
|
|
|
2163
2126
|
setOrder(order2);
|
|
2164
2127
|
setStage("progress");
|
|
2165
2128
|
};
|
|
2166
|
-
return /* @__PURE__ */ jsx14(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx14(AlertDialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsx14(AlertDialogContent, { className: "!rf-max-w-[660px] !rf-p-0", children: /* @__PURE__ */
|
|
2129
|
+
return /* @__PURE__ */ jsx14(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx14(AlertDialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsx14(AlertDialogContent, { className: "!rf-max-w-[660px] !rf-p-0", children: /* @__PURE__ */ jsxs9("div", { className: "rf-relative rf-w-full", children: [
|
|
2167
2130
|
stage === "initial" && /* @__PURE__ */ jsx14(
|
|
2168
2131
|
InitialOrderScreen,
|
|
2169
2132
|
{
|
|
@@ -2251,7 +2214,7 @@ var useOrderDialog = () => {
|
|
|
2251
2214
|
};
|
|
2252
2215
|
|
|
2253
2216
|
// lib/components/RunFrameForCli/LeftHeader.tsx
|
|
2254
|
-
import { Fragment as Fragment2, jsx as jsx17, jsxs as
|
|
2217
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2255
2218
|
var RunframeCliLeftHeader = (props) => {
|
|
2256
2219
|
const lastRunEvalVersion = useRunnerStore((s) => s.lastRunEvalVersion);
|
|
2257
2220
|
const [snippetName, setSnippetName] = useState10(null);
|
|
@@ -2342,10 +2305,10 @@ var RunframeCliLeftHeader = (props) => {
|
|
|
2342
2305
|
};
|
|
2343
2306
|
const circuitJson = useRunFrameStore((state) => state.circuitJson);
|
|
2344
2307
|
const [isImportDialogOpen, setIsImportDialogOpen] = useState10(false);
|
|
2345
|
-
return /* @__PURE__ */
|
|
2346
|
-
/* @__PURE__ */
|
|
2308
|
+
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
2309
|
+
/* @__PURE__ */ jsxs10(DropdownMenu, { children: [
|
|
2347
2310
|
/* @__PURE__ */ jsx17(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx17("div", { className: "rf-whitespace-nowrap rf-text-xs font-medium rf-p-2 rf-mx-1 rf-cursor-pointer rf-relative", children: "File" }) }),
|
|
2348
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ jsxs10(DropdownMenuContent, { children: [
|
|
2349
2312
|
/* @__PURE__ */ jsx17(
|
|
2350
2313
|
DropdownMenuItem,
|
|
2351
2314
|
{
|
|
@@ -2374,7 +2337,7 @@ var RunframeCliLeftHeader = (props) => {
|
|
|
2374
2337
|
children: "Import"
|
|
2375
2338
|
}
|
|
2376
2339
|
),
|
|
2377
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ jsxs10(DropdownMenuSub, { children: [
|
|
2378
2341
|
/* @__PURE__ */ jsx17(
|
|
2379
2342
|
DropdownMenuSubTrigger,
|
|
2380
2343
|
{
|
|
@@ -2403,10 +2366,10 @@ var RunframeCliLeftHeader = (props) => {
|
|
|
2403
2366
|
i
|
|
2404
2367
|
)) }) })
|
|
2405
2368
|
] }),
|
|
2406
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ jsxs10(DropdownMenuSub, { children: [
|
|
2407
2370
|
/* @__PURE__ */ jsx17(DropdownMenuSubTrigger, { className: "rf-text-xs", children: "Advanced" }),
|
|
2408
|
-
/* @__PURE__ */ jsx17(DropdownMenuPortal, { children: /* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */ jsx17(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */
|
|
2371
|
+
/* @__PURE__ */ jsx17(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs10(DropdownMenuSubContent, { children: [
|
|
2372
|
+
/* @__PURE__ */ jsx17(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs10("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
|
|
2410
2373
|
/* @__PURE__ */ jsx17(
|
|
2411
2374
|
Checkbox,
|
|
2412
2375
|
{
|
|
@@ -2426,7 +2389,7 @@ var RunframeCliLeftHeader = (props) => {
|
|
|
2426
2389
|
}
|
|
2427
2390
|
)
|
|
2428
2391
|
] }) }),
|
|
2429
|
-
lastRunEvalVersion && /* @__PURE__ */ jsx17(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx17("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */
|
|
2392
|
+
lastRunEvalVersion && /* @__PURE__ */ jsx17(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx17("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs10("span", { className: "rf-text-xs", children: [
|
|
2430
2393
|
"@tscircuit/eval@",
|
|
2431
2394
|
lastRunEvalVersion
|
|
2432
2395
|
] }) }) }),
|
|
@@ -2443,8 +2406,8 @@ var RunframeCliLeftHeader = (props) => {
|
|
|
2443
2406
|
] }) })
|
|
2444
2407
|
] })
|
|
2445
2408
|
] }),
|
|
2446
|
-
/* @__PURE__ */ jsx17(AlertDialog, { open: isError, onOpenChange: setIsError, children: /* @__PURE__ */
|
|
2447
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx17(AlertDialog, { open: isError, onOpenChange: setIsError, children: /* @__PURE__ */ jsxs10(AlertDialogContent, { children: [
|
|
2410
|
+
/* @__PURE__ */ jsxs10(AlertDialogHeader, { children: [
|
|
2448
2411
|
/* @__PURE__ */ jsx17(AlertDialogTitle, { children: "Error Saving Snippet" }),
|
|
2449
2412
|
/* @__PURE__ */ jsx17(AlertDialogDescription, { children: errorMessage })
|
|
2450
2413
|
] }),
|
|
@@ -2512,7 +2475,7 @@ var RunframeCliLeftHeader = (props) => {
|
|
|
2512
2475
|
};
|
|
2513
2476
|
|
|
2514
2477
|
// lib/components/RunFrameForCli/RunFrameForCli.tsx
|
|
2515
|
-
import { jsx as jsx18, jsxs as
|
|
2478
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2516
2479
|
var RunFrameForCli = (props) => {
|
|
2517
2480
|
const [shouldLoadLatestEval, setLoadLatestEval] = useLocalStorageState(
|
|
2518
2481
|
"load-latest-eval",
|
|
@@ -2525,7 +2488,7 @@ var RunFrameForCli = (props) => {
|
|
|
2525
2488
|
forceLatestEvalVersion: shouldLoadLatestEval,
|
|
2526
2489
|
defaultToFullScreen: true,
|
|
2527
2490
|
showToggleFullScreen: false,
|
|
2528
|
-
leftHeaderContent: /* @__PURE__ */
|
|
2491
|
+
leftHeaderContent: /* @__PURE__ */ jsxs11("div", { className: "rf-flex rf-items-center rf-justify-between", children: [
|
|
2529
2492
|
/* @__PURE__ */ jsx18(
|
|
2530
2493
|
RunframeCliLeftHeader,
|
|
2531
2494
|
{
|