@tscircuit/runframe 0.0.371 → 0.0.373
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-43JV2KDS.js → chunk-SYVWM5DF.js} +86 -106
- package/dist/preview.js +1 -1
- package/dist/runner.js +209 -110
- package/dist/standalone-preview.min.js +652 -647
- package/dist/standalone.min.js +708 -703
- package/package.json +2 -1
|
@@ -440,42 +440,36 @@ ${errorMessage.slice(0, 2e3)}
|
|
|
440
440
|
import { SchematicViewer } from "@tscircuit/schematic-viewer";
|
|
441
441
|
import { AssemblyViewer } from "@tscircuit/assembly-viewer";
|
|
442
442
|
|
|
443
|
-
// lib/utils/getRandomTipForUser
|
|
443
|
+
// lib/utils/getRandomTipForUser.ts
|
|
444
444
|
var tips = [
|
|
445
|
-
"Always initialize your project using [
|
|
446
|
-
"
|
|
447
|
-
"
|
|
448
|
-
"Define reusable subcircuits for common electronic patterns.",
|
|
449
|
-
"Utilize board constraints to stay within manufacturing parameters.",
|
|
450
|
-
"Run 'tsci dev' to preview your boards before export.",
|
|
445
|
+
"Always initialize your project using [tsci init](https://github.com/tscircuit/cli) before adding components.",
|
|
446
|
+
"Define reusable modules with cached routes using [<subcircuit />](https://docs.tscircuit.com/elements/subcircuit)",
|
|
447
|
+
"Run `tsci dev` on the command line to preview your boards before export",
|
|
451
448
|
"Use units like mm or mils consistently across your designs.",
|
|
452
|
-
"
|
|
453
|
-
"
|
|
454
|
-
"Use
|
|
455
|
-
"
|
|
456
|
-
"
|
|
457
|
-
"
|
|
458
|
-
"
|
|
459
|
-
"
|
|
460
|
-
|
|
461
|
-
"
|
|
462
|
-
"
|
|
463
|
-
"
|
|
464
|
-
"
|
|
465
|
-
"
|
|
466
|
-
"
|
|
467
|
-
"
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"Use the RootCircuit platform configuration to customize registry and autorouter behavior.",
|
|
472
|
-
"Use the <constraint /> element to enforce geometric relationships in PCB designs.",
|
|
473
|
-
"Follow the recommended contribution order to understand the tscircuit ecosystem better.",
|
|
474
|
-
"Join the Discord server to discuss issues and get help directly from the community.",
|
|
475
|
-
"Reach out to enterprise support for running the tscircuit platform privately within your organization."
|
|
449
|
+
"Quickly set footprints with the [footprint prop](https://docs.tscircuit.com/footprints/footprinter-strings)",
|
|
450
|
+
"Check out the guide on [ordering prototypes](https://docs.tscircuit.com/building-electronics/ordering-prototypes)",
|
|
451
|
+
"Use [net labels](https://docs.tscircuit.com/elements/net) and [group elements](https://docs.tscircuit.com/elements/group) to organize complex schematics.",
|
|
452
|
+
"You can manually drag components on the PCB and Schematic using [manual edits](https://docs.tscircuit.com/guides/manual-edits)",
|
|
453
|
+
"Every tscircuit module can export to [Circuit JSON](https://github.com/tscircuit/circuit-json), Gerbers, Pick'n'Place CSV files, Bill of Materials CSV and more",
|
|
454
|
+
"You can import components from [JLCPCB](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-jlcpcb) or [KiCad](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-kicad)",
|
|
455
|
+
"Any module you push to the [registry](https://tscircuit.com/trending) will have [simple image urls](https://docs.tscircuit.com/web-apis/image-generation-api) you can use display images on a website",
|
|
456
|
+
"The default [Parts Engine](https://docs.tscircuit.com/guides/platform-configuration) will automatically find parts from common vendors for your BOM",
|
|
457
|
+
'[Pin selectors](https://docs.tscircuit.com/guides/using-sel-references) are similar to CSS selectors, ".R1 > .pin1" means "connect to the first pin of the component R1"',
|
|
458
|
+
"You can use the [sel](https://docs.tscircuit.com/guides/using-sel-references) object to select pins in a type-safe way",
|
|
459
|
+
"Publish modules via the [registry](https://tscircuit.com/trending) for working with a team or sharing your work",
|
|
460
|
+
"[Explore tutorials](https://docs.tscircuit.com/category/tutorials) for real-world circuit design examples.",
|
|
461
|
+
"Upload your Circuit JSON to [circuitjson.com](https://circuitjson.com) for a quick preview.",
|
|
462
|
+
"You can display Circuit JSON in 3D, PCB or Schematic mode with the [<CircuitJsonPreview />](https://docs.tscircuit.com/elements/circuitjsonpreview) React component",
|
|
463
|
+
"Use a [<group />](https://docs.tscircuit.com/elements/group) element to move multiple components at once in a schematic or PCB layout.",
|
|
464
|
+
"Refer to the [GitHub Discussions page](https://github.com/tscircuit/tscircuit/discussions) to request features",
|
|
465
|
+
"You can customize the autorouter using the [autorouter prop](https://docs.tscircuit.com/elements/board#setting-the-autorouter)",
|
|
466
|
+
"Use the [<constraint />](https://docs.tscircuit.com/footprints/constraint) element to enforce geometric relationships in PCB designs.",
|
|
467
|
+
"Join the [Discord server](https://tscircuit.com/join) to discuss issues and get help directly from the community."
|
|
476
468
|
];
|
|
477
469
|
var getRandomTipForUser = () => {
|
|
478
470
|
let tip = tips[Math.floor(Math.random() * tips.length)];
|
|
471
|
+
tip = tip.replace(/</g, "<");
|
|
472
|
+
tip = tip.replace(/>/g, ">");
|
|
479
473
|
tip = tip.replace(
|
|
480
474
|
/(?<!href=")(?<!\()(?<!\]\()(https?:\/\/[^\s\)\]]+)/g,
|
|
481
475
|
(match, p1) => `<a class="rf-text-blue-500 rf-underline" href="${match}" target="_blank">${match}</a>`
|
|
@@ -489,25 +483,29 @@ var getRandomTipForUser = () => {
|
|
|
489
483
|
|
|
490
484
|
// lib/components/PreviewEmptyState.tsx
|
|
491
485
|
import { LightbulbIcon, PlayIcon } from "lucide-react";
|
|
486
|
+
import { useMemo } from "react";
|
|
492
487
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
493
|
-
var PreviewEmptyState = ({ onRunClicked }) =>
|
|
494
|
-
|
|
495
|
-
/* @__PURE__ */ jsxs5("
|
|
496
|
-
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
488
|
+
var PreviewEmptyState = ({ onRunClicked }) => {
|
|
489
|
+
const tipHtml = useMemo(() => getRandomTipForUser(), []);
|
|
490
|
+
return /* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-flex-col rf-items-center rf-justify-center rf-h-full rf-bg-gray-50 rf-text-gray-500 rf-p-4", children: [
|
|
491
|
+
/* @__PURE__ */ jsx7(LightbulbIcon, { className: "rf-size-14 rf-mb-4" }),
|
|
492
|
+
/* @__PURE__ */ jsxs5("p", { className: "rf-text-md rf-break-words rf-max-w-xl rf-text-center", children: [
|
|
493
|
+
"Tip: ",
|
|
494
|
+
/* @__PURE__ */ jsx7("span", { dangerouslySetInnerHTML: { __html: tipHtml } })
|
|
495
|
+
] }),
|
|
496
|
+
onRunClicked && /* @__PURE__ */ jsxs5(
|
|
497
|
+
Button,
|
|
498
|
+
{
|
|
499
|
+
className: "rf-mt-4 rf-bg-blue-600 rf-hover:bg-blue-500",
|
|
500
|
+
onClick: onRunClicked,
|
|
501
|
+
children: [
|
|
502
|
+
"Run Code",
|
|
503
|
+
/* @__PURE__ */ jsx7(PlayIcon, { className: "rf-w-3 rf-h-3 rf-ml-2" })
|
|
504
|
+
]
|
|
505
|
+
}
|
|
506
|
+
)
|
|
507
|
+
] });
|
|
508
|
+
};
|
|
511
509
|
var PreviewEmptyState_default = PreviewEmptyState;
|
|
512
510
|
|
|
513
511
|
// lib/components/CircuitJsonTableViewer/CircuitJsonTableViewer.tsx
|
|
@@ -1039,7 +1037,7 @@ var RenderLogViewer = ({
|
|
|
1039
1037
|
};
|
|
1040
1038
|
|
|
1041
1039
|
// package.json
|
|
1042
|
-
var version = "0.0.
|
|
1040
|
+
var version = "0.0.372";
|
|
1043
1041
|
|
|
1044
1042
|
// lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
|
|
1045
1043
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -1563,14 +1561,14 @@ var useRunFrameStore = create()(
|
|
|
1563
1561
|
)
|
|
1564
1562
|
);
|
|
1565
1563
|
|
|
1566
|
-
// lib/components/ui/
|
|
1564
|
+
// lib/components/ui/dialog.tsx
|
|
1567
1565
|
import * as React6 from "react";
|
|
1568
|
-
import * as
|
|
1566
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1569
1567
|
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1570
|
-
var
|
|
1571
|
-
var
|
|
1572
|
-
var
|
|
1573
|
-
|
|
1568
|
+
var Dialog = DialogPrimitive.Root;
|
|
1569
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
1570
|
+
var DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1571
|
+
DialogPrimitive.Overlay,
|
|
1574
1572
|
{
|
|
1575
1573
|
className: cn(
|
|
1576
1574
|
"rf-fixed rf-inset-0 rf-z-50 rf-bg-black/80 data-[state=open]:rf-animate-in data-[state=closed]:rf-animate-out data-[state=closed]:rf-fade-out-0 data-[state=open]:rf-fade-in-0",
|
|
@@ -1580,23 +1578,24 @@ var AlertDialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1580
1578
|
ref
|
|
1581
1579
|
}
|
|
1582
1580
|
));
|
|
1583
|
-
|
|
1584
|
-
var
|
|
1585
|
-
/* @__PURE__ */ jsx17(
|
|
1581
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1582
|
+
var DialogContent = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs13(DialogPortal, { children: [
|
|
1583
|
+
/* @__PURE__ */ jsx17(DialogOverlay, {}),
|
|
1586
1584
|
/* @__PURE__ */ jsx17(
|
|
1587
|
-
|
|
1585
|
+
DialogPrimitive.Content,
|
|
1588
1586
|
{
|
|
1589
1587
|
ref,
|
|
1590
1588
|
className: cn(
|
|
1591
1589
|
"rf-fixed rf-left-[50%] rf-top-[50%] rf-z-50 rf-grid rf-w-full rf-max-w-lg rf-translate-x-[-50%] rf-translate-y-[-50%] rf-gap-4 rf-border rf-border-zinc-200 rf-bg-white rf-p-6 rf-shadow-lg rf-duration-200 data-[state=open]:rf-animate-in data-[state=closed]:rf-animate-out data-[state=closed]:rf-fade-out-0 data-[state=open]:rf-fade-in-0 data-[state=closed]:rf-zoom-out-95 data-[state=open]:rf-zoom-in-95 data-[state=closed]:rf-slide-out-to-left-1/2 data-[state=closed]:rf-slide-out-to-top-[48%] data-[state=open]:rf-slide-in-from-left-1/2 data-[state=open]:rf-slide-in-from-top-[48%] sm:rf-rounded-lg dark:rf-border-zinc-800 dark:rf-bg-zinc-950",
|
|
1592
1590
|
className
|
|
1593
1591
|
),
|
|
1594
|
-
...props
|
|
1592
|
+
...props,
|
|
1593
|
+
children
|
|
1595
1594
|
}
|
|
1596
1595
|
)
|
|
1597
1596
|
] }));
|
|
1598
|
-
|
|
1599
|
-
var
|
|
1597
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
1598
|
+
var DialogHeader = ({
|
|
1600
1599
|
className,
|
|
1601
1600
|
...props
|
|
1602
1601
|
}) => /* @__PURE__ */ jsx17(
|
|
@@ -1609,8 +1608,8 @@ var AlertDialogHeader = ({
|
|
|
1609
1608
|
...props
|
|
1610
1609
|
}
|
|
1611
1610
|
);
|
|
1612
|
-
|
|
1613
|
-
var
|
|
1611
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1612
|
+
var DialogFooter = ({
|
|
1614
1613
|
className,
|
|
1615
1614
|
...props
|
|
1616
1615
|
}) => /* @__PURE__ */ jsx17(
|
|
@@ -1623,18 +1622,18 @@ var AlertDialogFooter = ({
|
|
|
1623
1622
|
...props
|
|
1624
1623
|
}
|
|
1625
1624
|
);
|
|
1626
|
-
|
|
1627
|
-
var
|
|
1628
|
-
|
|
1625
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1626
|
+
var DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1627
|
+
DialogPrimitive.Title,
|
|
1629
1628
|
{
|
|
1630
1629
|
ref,
|
|
1631
1630
|
className: cn("rf-text-lg rf-font-semibold", className),
|
|
1632
1631
|
...props
|
|
1633
1632
|
}
|
|
1634
1633
|
));
|
|
1635
|
-
|
|
1636
|
-
var
|
|
1637
|
-
|
|
1634
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1635
|
+
var DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1636
|
+
DialogPrimitive.Description,
|
|
1638
1637
|
{
|
|
1639
1638
|
ref,
|
|
1640
1639
|
className: cn(
|
|
@@ -1644,29 +1643,7 @@ var AlertDialogDescription = React6.forwardRef(({ className, ...props }, ref) =>
|
|
|
1644
1643
|
...props
|
|
1645
1644
|
}
|
|
1646
1645
|
));
|
|
1647
|
-
|
|
1648
|
-
var AlertDialogAction = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1649
|
-
AlertDialogPrimitive.Action,
|
|
1650
|
-
{
|
|
1651
|
-
ref,
|
|
1652
|
-
className: cn(buttonVariants(), className),
|
|
1653
|
-
...props
|
|
1654
|
-
}
|
|
1655
|
-
));
|
|
1656
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
1657
|
-
var AlertDialogCancel = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
1658
|
-
AlertDialogPrimitive.Cancel,
|
|
1659
|
-
{
|
|
1660
|
-
ref,
|
|
1661
|
-
className: cn(
|
|
1662
|
-
buttonVariants({ variant: "outline" }),
|
|
1663
|
-
"rf-mt-2 sm:rf-mt-0",
|
|
1664
|
-
className
|
|
1665
|
-
),
|
|
1666
|
-
...props
|
|
1667
|
-
}
|
|
1668
|
-
));
|
|
1669
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
1646
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
1670
1647
|
|
|
1671
1648
|
// lib/components/OrderDialog/OrderDialog.tsx
|
|
1672
1649
|
import { QueryClient, QueryClientProvider } from "react-query";
|
|
@@ -1929,13 +1906,22 @@ var OrderDialog = ({
|
|
|
1929
1906
|
circuitJson,
|
|
1930
1907
|
packageReleaseId
|
|
1931
1908
|
}) => {
|
|
1932
|
-
return /* @__PURE__ */ jsx20(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx20(
|
|
1933
|
-
|
|
1909
|
+
return /* @__PURE__ */ jsx20(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx20(
|
|
1910
|
+
Dialog,
|
|
1934
1911
|
{
|
|
1935
|
-
|
|
1936
|
-
|
|
1912
|
+
open: isOpen,
|
|
1913
|
+
onOpenChange: (open) => {
|
|
1914
|
+
if (!open) onClose();
|
|
1915
|
+
},
|
|
1916
|
+
children: /* @__PURE__ */ jsx20(DialogContent, { className: "!rf-max-w-[660px] !rf-p-0", children: /* @__PURE__ */ jsx20("div", { className: "rf-relative rf-w-full", children: stage === "initial" && /* @__PURE__ */ jsx20(
|
|
1917
|
+
InitialOrderScreen,
|
|
1918
|
+
{
|
|
1919
|
+
onCancel: onClose,
|
|
1920
|
+
packageReleaseId: packageReleaseId ?? ""
|
|
1921
|
+
}
|
|
1922
|
+
) }) })
|
|
1937
1923
|
}
|
|
1938
|
-
) })
|
|
1924
|
+
) });
|
|
1939
1925
|
};
|
|
1940
1926
|
|
|
1941
1927
|
// lib/components/OrderDialog/CliOrderDialog.tsx
|
|
@@ -2000,6 +1986,7 @@ export {
|
|
|
2000
1986
|
Tabs,
|
|
2001
1987
|
TabsList,
|
|
2002
1988
|
TabsTrigger,
|
|
1989
|
+
buttonVariants,
|
|
2003
1990
|
Button,
|
|
2004
1991
|
DropdownMenu,
|
|
2005
1992
|
DropdownMenuTrigger,
|
|
@@ -2016,13 +2003,6 @@ export {
|
|
|
2016
2003
|
debug_default,
|
|
2017
2004
|
API_BASE,
|
|
2018
2005
|
useRunFrameStore,
|
|
2019
|
-
AlertDialog,
|
|
2020
|
-
AlertDialogContent,
|
|
2021
|
-
AlertDialogHeader,
|
|
2022
|
-
AlertDialogFooter,
|
|
2023
|
-
AlertDialogTitle,
|
|
2024
|
-
AlertDialogDescription,
|
|
2025
|
-
AlertDialogCancel,
|
|
2026
2006
|
toast,
|
|
2027
2007
|
useOrderDialogCli,
|
|
2028
2008
|
useOrderDialog,
|