@tscircuit/props 0.0.296 → 0.0.297

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/index.js CHANGED
@@ -63,6 +63,9 @@ var cadModelObj = cadModelBase.extend({
63
63
  objUrl: z4.string(),
64
64
  mtlUrl: z4.string().optional()
65
65
  });
66
+ var cadModelGltf = cadModelBase.extend({
67
+ gltfUrl: z4.string()
68
+ });
66
69
  var cadModelJscad = cadModelBase.extend({
67
70
  jscad: z4.record(z4.any())
68
71
  });
@@ -71,6 +74,7 @@ var cadModelProp = z4.union([
71
74
  z4.string(),
72
75
  cadModelStl,
73
76
  cadModelObj,
77
+ cadModelGltf,
74
78
  cadModelJscad
75
79
  ]);
76
80
  expectTypesMatch(true);
@@ -1437,6 +1441,41 @@ var pcbKeepoutProps = z67.union([
1437
1441
  })
1438
1442
  ]);
1439
1443
 
1444
+ // lib/components/copper-pour.ts
1445
+ import { z as z68 } from "zod";
1446
+ var rectCopperPourProps = pcbLayoutProps.omit({
1447
+ pcbRotation: true
1448
+ }).extend({
1449
+ shape: z68.literal("rect"),
1450
+ width: distance4,
1451
+ height: distance4,
1452
+ connectsTo: z68.string().or(z68.array(z68.string())).optional()
1453
+ });
1454
+ expectTypesMatch(true);
1455
+ var circleCopperPourProps = pcbLayoutProps.omit({
1456
+ pcbRotation: true
1457
+ }).extend({
1458
+ shape: z68.literal("circle"),
1459
+ radius: distance4,
1460
+ connectsTo: z68.string().or(z68.array(z68.string())).optional()
1461
+ });
1462
+ expectTypesMatch(
1463
+ true
1464
+ );
1465
+ var polygonCopperPourProps = pcbLayoutProps.omit({
1466
+ pcbRotation: true
1467
+ }).extend({
1468
+ shape: z68.literal("polygon"),
1469
+ points: z68.array(point),
1470
+ connectsTo: z68.string().or(z68.array(z68.string())).optional()
1471
+ });
1472
+ expectTypesMatch(true);
1473
+ var copperPourProps = z68.discriminatedUnion("shape", [
1474
+ rectCopperPourProps,
1475
+ circleCopperPourProps,
1476
+ polygonCopperPourProps
1477
+ ]);
1478
+
1440
1479
  // lib/components/power-source.ts
1441
1480
  import { voltage as voltage3 } from "circuit-json";
1442
1481
  var powerSourceProps = commonComponentProps.extend({
@@ -1445,9 +1484,9 @@ var powerSourceProps = commonComponentProps.extend({
1445
1484
 
1446
1485
  // lib/components/voltagesource.ts
1447
1486
  import { frequency as frequency3, rotation as rotation4, voltage as voltage4 } from "circuit-json";
1448
- import { z as z68 } from "zod";
1487
+ import { z as z69 } from "zod";
1449
1488
  var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
1450
- var percentage = z68.union([z68.string(), z68.number()]).transform((val) => {
1489
+ var percentage = z69.union([z69.string(), z69.number()]).transform((val) => {
1451
1490
  if (typeof val === "string") {
1452
1491
  if (val.endsWith("%")) {
1453
1492
  return parseFloat(val.slice(0, -1)) / 100;
@@ -1456,13 +1495,13 @@ var percentage = z68.union([z68.string(), z68.number()]).transform((val) => {
1456
1495
  }
1457
1496
  return val;
1458
1497
  }).pipe(
1459
- z68.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
1498
+ z69.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
1460
1499
  );
1461
1500
  var voltageSourceProps = commonComponentProps.extend({
1462
1501
  voltage: voltage4.optional(),
1463
1502
  frequency: frequency3.optional(),
1464
1503
  peakToPeakVoltage: voltage4.optional(),
1465
- waveShape: z68.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
1504
+ waveShape: z69.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
1466
1505
  phase: rotation4.optional(),
1467
1506
  dutyCycle: percentage.optional(),
1468
1507
  connections: createConnectionsProp(voltageSourcePinLabels).optional()
@@ -1472,11 +1511,11 @@ expectTypesMatch(true);
1472
1511
 
1473
1512
  // lib/components/schematic-box.ts
1474
1513
  import { distance as distance19 } from "circuit-json";
1475
- import { z as z70 } from "zod";
1514
+ import { z as z71 } from "zod";
1476
1515
 
1477
1516
  // lib/common/ninePointAnchor.ts
1478
- import { z as z69 } from "zod";
1479
- var ninePointAnchor = z69.enum([
1517
+ import { z as z70 } from "zod";
1518
+ var ninePointAnchor = z70.enum([
1480
1519
  "top_left",
1481
1520
  "top_center",
1482
1521
  "top_right",
@@ -1489,23 +1528,23 @@ var ninePointAnchor = z69.enum([
1489
1528
  ]);
1490
1529
 
1491
1530
  // lib/components/schematic-box.ts
1492
- var schematicBoxProps = z70.object({
1531
+ var schematicBoxProps = z71.object({
1493
1532
  schX: distance19.optional(),
1494
1533
  schY: distance19.optional(),
1495
1534
  width: distance19.optional(),
1496
1535
  height: distance19.optional(),
1497
- overlay: z70.array(z70.string()).optional(),
1536
+ overlay: z71.array(z71.string()).optional(),
1498
1537
  padding: distance19.optional(),
1499
1538
  paddingLeft: distance19.optional(),
1500
1539
  paddingRight: distance19.optional(),
1501
1540
  paddingTop: distance19.optional(),
1502
1541
  paddingBottom: distance19.optional(),
1503
- title: z70.string().optional(),
1542
+ title: z71.string().optional(),
1504
1543
  titleAlignment: ninePointAnchor.default("top_left"),
1505
- titleColor: z70.string().optional(),
1544
+ titleColor: z71.string().optional(),
1506
1545
  titleFontSize: distance19.optional(),
1507
- titleInside: z70.boolean().default(false),
1508
- strokeStyle: z70.enum(["solid", "dashed"]).default("solid")
1546
+ titleInside: z71.boolean().default(false),
1547
+ strokeStyle: z71.enum(["solid", "dashed"]).default("solid")
1509
1548
  }).refine(
1510
1549
  (elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
1511
1550
  {
@@ -1520,8 +1559,8 @@ var schematicBoxProps = z70.object({
1520
1559
 
1521
1560
  // lib/components/schematic-line.ts
1522
1561
  import { distance as distance20 } from "circuit-json";
1523
- import { z as z71 } from "zod";
1524
- var schematicLineProps = z71.object({
1562
+ import { z as z72 } from "zod";
1563
+ var schematicLineProps = z72.object({
1525
1564
  x1: distance20,
1526
1565
  y1: distance20,
1527
1566
  x2: distance20,
@@ -1530,11 +1569,11 @@ var schematicLineProps = z71.object({
1530
1569
 
1531
1570
  // lib/components/schematic-text.ts
1532
1571
  import { distance as distance21, rotation as rotation5 } from "circuit-json";
1533
- import { z as z73 } from "zod";
1572
+ import { z as z74 } from "zod";
1534
1573
 
1535
1574
  // lib/common/fivePointAnchor.ts
1536
- import { z as z72 } from "zod";
1537
- var fivePointAnchor = z72.enum([
1575
+ import { z as z73 } from "zod";
1576
+ var fivePointAnchor = z73.enum([
1538
1577
  "center",
1539
1578
  "left",
1540
1579
  "right",
@@ -1543,32 +1582,32 @@ var fivePointAnchor = z72.enum([
1543
1582
  ]);
1544
1583
 
1545
1584
  // lib/components/schematic-text.ts
1546
- var schematicTextProps = z73.object({
1585
+ var schematicTextProps = z74.object({
1547
1586
  schX: distance21.optional(),
1548
1587
  schY: distance21.optional(),
1549
- text: z73.string(),
1550
- fontSize: z73.number().default(1),
1551
- anchor: z73.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
1552
- color: z73.string().default("#000000"),
1588
+ text: z74.string(),
1589
+ fontSize: z74.number().default(1),
1590
+ anchor: z74.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
1591
+ color: z74.string().default("#000000"),
1553
1592
  schRotation: rotation5.default(0)
1554
1593
  });
1555
1594
 
1556
1595
  // lib/components/schematic-path.ts
1557
1596
  import { point as point5 } from "circuit-json";
1558
- import { z as z74 } from "zod";
1559
- var schematicPathProps = z74.object({
1560
- points: z74.array(point5),
1561
- isFilled: z74.boolean().optional().default(false),
1562
- fillColor: z74.enum(["red", "blue"]).optional()
1597
+ import { z as z75 } from "zod";
1598
+ var schematicPathProps = z75.object({
1599
+ points: z75.array(point5),
1600
+ isFilled: z75.boolean().optional().default(false),
1601
+ fillColor: z75.enum(["red", "blue"]).optional()
1563
1602
  });
1564
1603
 
1565
1604
  // lib/components/schematic-table.ts
1566
1605
  import { distance as distance22 } from "circuit-json";
1567
- import { z as z75 } from "zod";
1568
- var schematicTableProps = z75.object({
1606
+ import { z as z76 } from "zod";
1607
+ var schematicTableProps = z76.object({
1569
1608
  schX: distance22.optional(),
1570
1609
  schY: distance22.optional(),
1571
- children: z75.any().optional(),
1610
+ children: z76.any().optional(),
1572
1611
  cellPadding: distance22.optional(),
1573
1612
  borderWidth: distance22.optional(),
1574
1613
  anchor: ninePointAnchor.optional(),
@@ -1578,44 +1617,44 @@ expectTypesMatch(true);
1578
1617
 
1579
1618
  // lib/components/schematic-row.ts
1580
1619
  import { distance as distance23 } from "circuit-json";
1581
- import { z as z76 } from "zod";
1582
- var schematicRowProps = z76.object({
1583
- children: z76.any().optional(),
1620
+ import { z as z77 } from "zod";
1621
+ var schematicRowProps = z77.object({
1622
+ children: z77.any().optional(),
1584
1623
  height: distance23.optional()
1585
1624
  });
1586
1625
  expectTypesMatch(true);
1587
1626
 
1588
1627
  // lib/components/schematic-cell.ts
1589
1628
  import { distance as distance24 } from "circuit-json";
1590
- import { z as z77 } from "zod";
1591
- var schematicCellProps = z77.object({
1592
- children: z77.string().optional(),
1593
- horizontalAlign: z77.enum(["left", "center", "right"]).optional(),
1594
- verticalAlign: z77.enum(["top", "middle", "bottom"]).optional(),
1629
+ import { z as z78 } from "zod";
1630
+ var schematicCellProps = z78.object({
1631
+ children: z78.string().optional(),
1632
+ horizontalAlign: z78.enum(["left", "center", "right"]).optional(),
1633
+ verticalAlign: z78.enum(["top", "middle", "bottom"]).optional(),
1595
1634
  fontSize: distance24.optional(),
1596
- rowSpan: z77.number().optional(),
1597
- colSpan: z77.number().optional(),
1635
+ rowSpan: z78.number().optional(),
1636
+ colSpan: z78.number().optional(),
1598
1637
  width: distance24.optional(),
1599
- text: z77.string().optional()
1638
+ text: z78.string().optional()
1600
1639
  });
1601
1640
  expectTypesMatch(true);
1602
1641
 
1603
1642
  // lib/components/silkscreen-text.ts
1604
1643
  import { layer_ref as layer_ref6, length as length5 } from "circuit-json";
1605
- import { z as z78 } from "zod";
1644
+ import { z as z79 } from "zod";
1606
1645
  var silkscreenTextProps = pcbLayoutProps.extend({
1607
- text: z78.string(),
1646
+ text: z79.string(),
1608
1647
  anchorAlignment: ninePointAnchor.default("center"),
1609
- font: z78.enum(["tscircuit2024"]).optional(),
1648
+ font: z79.enum(["tscircuit2024"]).optional(),
1610
1649
  fontSize: length5.optional(),
1611
- layers: z78.array(layer_ref6).optional()
1650
+ layers: z79.array(layer_ref6).optional()
1612
1651
  });
1613
1652
 
1614
1653
  // lib/components/silkscreen-path.ts
1615
1654
  import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
1616
- import { z as z79 } from "zod";
1655
+ import { z as z80 } from "zod";
1617
1656
  var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
1618
- route: z79.array(route_hint_point5),
1657
+ route: z80.array(route_hint_point5),
1619
1658
  strokeWidth: length6.optional()
1620
1659
  });
1621
1660
 
@@ -1631,10 +1670,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
1631
1670
 
1632
1671
  // lib/components/silkscreen-rect.ts
1633
1672
  import { distance as distance26 } from "circuit-json";
1634
- import { z as z80 } from "zod";
1673
+ import { z as z81 } from "zod";
1635
1674
  var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1636
- filled: z80.boolean().default(true).optional(),
1637
- stroke: z80.enum(["dashed", "solid", "none"]).optional(),
1675
+ filled: z81.boolean().default(true).optional(),
1676
+ stroke: z81.enum(["dashed", "solid", "none"]).optional(),
1638
1677
  strokeWidth: distance26.optional(),
1639
1678
  width: distance26,
1640
1679
  height: distance26
@@ -1642,64 +1681,64 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1642
1681
 
1643
1682
  // lib/components/silkscreen-circle.ts
1644
1683
  import { distance as distance27 } from "circuit-json";
1645
- import { z as z81 } from "zod";
1684
+ import { z as z82 } from "zod";
1646
1685
  var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1647
- isFilled: z81.boolean().optional(),
1648
- isOutline: z81.boolean().optional(),
1686
+ isFilled: z82.boolean().optional(),
1687
+ isOutline: z82.boolean().optional(),
1649
1688
  strokeWidth: distance27.optional(),
1650
1689
  radius: distance27
1651
1690
  });
1652
1691
 
1653
1692
  // lib/components/trace-hint.ts
1654
1693
  import { distance as distance28, layer_ref as layer_ref7, route_hint_point as route_hint_point6 } from "circuit-json";
1655
- import { z as z82 } from "zod";
1656
- var routeHintPointProps = z82.object({
1694
+ import { z as z83 } from "zod";
1695
+ var routeHintPointProps = z83.object({
1657
1696
  x: distance28,
1658
1697
  y: distance28,
1659
- via: z82.boolean().optional(),
1698
+ via: z83.boolean().optional(),
1660
1699
  toLayer: layer_ref7.optional()
1661
1700
  });
1662
- var traceHintProps = z82.object({
1663
- for: z82.string().optional().describe(
1701
+ var traceHintProps = z83.object({
1702
+ for: z83.string().optional().describe(
1664
1703
  "Selector for the port you're targeting, not required if you're inside a trace"
1665
1704
  ),
1666
- order: z82.number().optional(),
1705
+ order: z83.number().optional(),
1667
1706
  offset: route_hint_point6.or(routeHintPointProps).optional(),
1668
- offsets: z82.array(route_hint_point6).or(z82.array(routeHintPointProps)).optional(),
1669
- traceWidth: z82.number().optional()
1707
+ offsets: z83.array(route_hint_point6).or(z83.array(routeHintPointProps)).optional(),
1708
+ traceWidth: z83.number().optional()
1670
1709
  });
1671
1710
 
1672
1711
  // lib/components/port.ts
1673
- import { z as z83 } from "zod";
1712
+ import { z as z84 } from "zod";
1674
1713
  var portProps = commonLayoutProps.extend({
1675
- name: z83.string(),
1676
- pinNumber: z83.number().optional(),
1677
- aliases: z83.array(z83.string()).optional(),
1714
+ name: z84.string(),
1715
+ pinNumber: z84.number().optional(),
1716
+ aliases: z84.array(z84.string()).optional(),
1678
1717
  direction
1679
1718
  });
1680
1719
 
1681
1720
  // lib/platformConfig.ts
1682
- import { z as z84 } from "zod";
1683
- var unvalidatedCircuitJson = z84.array(z84.any()).describe("Circuit JSON");
1684
- var pathToCircuitJsonFn = z84.function().args(z84.string()).returns(z84.promise(z84.object({ footprintCircuitJson: z84.array(z84.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1685
- var platformConfig = z84.object({
1721
+ import { z as z85 } from "zod";
1722
+ var unvalidatedCircuitJson = z85.array(z85.any()).describe("Circuit JSON");
1723
+ var pathToCircuitJsonFn = z85.function().args(z85.string()).returns(z85.promise(z85.object({ footprintCircuitJson: z85.array(z85.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1724
+ var platformConfig = z85.object({
1686
1725
  partsEngine: partsEngine.optional(),
1687
1726
  autorouter: autorouterProp.optional(),
1688
- registryApiUrl: z84.string().optional(),
1689
- cloudAutorouterUrl: z84.string().optional(),
1690
- projectName: z84.string().optional(),
1691
- version: z84.string().optional(),
1692
- url: z84.string().optional(),
1693
- printBoardInformationToSilkscreen: z84.boolean().optional(),
1694
- localCacheEngine: z84.any().optional(),
1695
- pcbDisabled: z84.boolean().optional(),
1696
- schematicDisabled: z84.boolean().optional(),
1697
- partsEngineDisabled: z84.boolean().optional(),
1698
- footprintLibraryMap: z84.record(
1699
- z84.string(),
1700
- z84.record(
1701
- z84.string(),
1702
- z84.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1727
+ registryApiUrl: z85.string().optional(),
1728
+ cloudAutorouterUrl: z85.string().optional(),
1729
+ projectName: z85.string().optional(),
1730
+ version: z85.string().optional(),
1731
+ url: z85.string().optional(),
1732
+ printBoardInformationToSilkscreen: z85.boolean().optional(),
1733
+ localCacheEngine: z85.any().optional(),
1734
+ pcbDisabled: z85.boolean().optional(),
1735
+ schematicDisabled: z85.boolean().optional(),
1736
+ partsEngineDisabled: z85.boolean().optional(),
1737
+ footprintLibraryMap: z85.record(
1738
+ z85.string(),
1739
+ z85.record(
1740
+ z85.string(),
1741
+ z85.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1703
1742
  )
1704
1743
  ).optional()
1705
1744
  });
@@ -1717,6 +1756,7 @@ export {
1717
1756
  breakoutProps,
1718
1757
  bugProps,
1719
1758
  cadModelBase,
1759
+ cadModelGltf,
1720
1760
  cadModelJscad,
1721
1761
  cadModelObj,
1722
1762
  cadModelProp,
@@ -1725,6 +1765,7 @@ export {
1725
1765
  capacitorPins,
1726
1766
  capacitorProps,
1727
1767
  chipProps,
1768
+ circleCopperPourProps,
1728
1769
  circleCutoutProps,
1729
1770
  circleSmtPadProps,
1730
1771
  circleSolderPasteProps,
@@ -1734,6 +1775,7 @@ export {
1734
1775
  connectorProps,
1735
1776
  constrainedLayoutProps,
1736
1777
  constraintProps,
1778
+ copperPourProps,
1737
1779
  crystalPins,
1738
1780
  crystalProps,
1739
1781
  cutoutProps,
@@ -1793,6 +1835,7 @@ export {
1793
1835
  platedHoleProps,
1794
1836
  platformConfig,
1795
1837
  point3,
1838
+ polygonCopperPourProps,
1796
1839
  polygonCutoutProps,
1797
1840
  polygonSmtPadProps,
1798
1841
  portHints,
@@ -1801,6 +1844,7 @@ export {
1801
1844
  potentiometerProps,
1802
1845
  powerSourceProps,
1803
1846
  pushButtonProps,
1847
+ rectCopperPourProps,
1804
1848
  rectCutoutProps,
1805
1849
  rectSmtPadProps,
1806
1850
  rectSolderPasteProps,