@tscircuit/props 0.0.286 → 0.0.288

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
@@ -511,6 +511,7 @@ var subcircuitGroupProps = baseGroupProps.extend({
511
511
  manualEdits: manual_edits_file.optional(),
512
512
  schAutoLayoutEnabled: z23.boolean().optional(),
513
513
  schTraceAutoLabelEnabled: z23.boolean().optional(),
514
+ schMaxTraceDistance: distance5.optional(),
514
515
  routingDisabled: z23.boolean().optional(),
515
516
  defaultTraceWidth: length.optional(),
516
517
  minTraceWidth: length.optional(),
@@ -1425,13 +1426,37 @@ var powerSourceProps = commonComponentProps.extend({
1425
1426
  voltage: voltage2
1426
1427
  });
1427
1428
 
1429
+ // lib/components/voltagesource.ts
1430
+ import { frequency as frequency3, rotation as rotation4, voltage as voltage3 } from "circuit-json";
1431
+ import { z as z67 } from "zod";
1432
+ var percentage = z67.union([z67.string(), z67.number()]).transform((val) => {
1433
+ if (typeof val === "string") {
1434
+ if (val.endsWith("%")) {
1435
+ return parseFloat(val.slice(0, -1)) / 100;
1436
+ }
1437
+ return parseFloat(val);
1438
+ }
1439
+ return val;
1440
+ }).pipe(
1441
+ z67.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
1442
+ );
1443
+ var voltageSourceProps = commonComponentProps.extend({
1444
+ voltage: voltage3.optional(),
1445
+ frequency: frequency3.optional(),
1446
+ peakToPeakVoltage: voltage3.optional(),
1447
+ waveShape: z67.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
1448
+ phase: rotation4.optional(),
1449
+ dutyCycle: percentage.optional()
1450
+ });
1451
+ expectTypesMatch(true);
1452
+
1428
1453
  // lib/components/schematic-box.ts
1429
1454
  import { distance as distance19 } from "circuit-json";
1430
- import { z as z68 } from "zod";
1455
+ import { z as z69 } from "zod";
1431
1456
 
1432
1457
  // lib/common/ninePointAnchor.ts
1433
- import { z as z67 } from "zod";
1434
- var ninePointAnchor = z67.enum([
1458
+ import { z as z68 } from "zod";
1459
+ var ninePointAnchor = z68.enum([
1435
1460
  "top_left",
1436
1461
  "top_center",
1437
1462
  "top_right",
@@ -1444,23 +1469,23 @@ var ninePointAnchor = z67.enum([
1444
1469
  ]);
1445
1470
 
1446
1471
  // lib/components/schematic-box.ts
1447
- var schematicBoxProps = z68.object({
1472
+ var schematicBoxProps = z69.object({
1448
1473
  schX: distance19.optional(),
1449
1474
  schY: distance19.optional(),
1450
1475
  width: distance19.optional(),
1451
1476
  height: distance19.optional(),
1452
- overlay: z68.array(z68.string()).optional(),
1477
+ overlay: z69.array(z69.string()).optional(),
1453
1478
  padding: distance19.optional(),
1454
1479
  paddingLeft: distance19.optional(),
1455
1480
  paddingRight: distance19.optional(),
1456
1481
  paddingTop: distance19.optional(),
1457
1482
  paddingBottom: distance19.optional(),
1458
- title: z68.string().optional(),
1483
+ title: z69.string().optional(),
1459
1484
  titleAlignment: ninePointAnchor.default("top_left"),
1460
- titleColor: z68.string().optional(),
1485
+ titleColor: z69.string().optional(),
1461
1486
  titleFontSize: distance19.optional(),
1462
- titleInside: z68.boolean().default(false),
1463
- strokeStyle: z68.enum(["solid", "dashed"]).default("solid")
1487
+ titleInside: z69.boolean().default(false),
1488
+ strokeStyle: z69.enum(["solid", "dashed"]).default("solid")
1464
1489
  }).refine(
1465
1490
  (elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
1466
1491
  {
@@ -1475,8 +1500,8 @@ var schematicBoxProps = z68.object({
1475
1500
 
1476
1501
  // lib/components/schematic-line.ts
1477
1502
  import { distance as distance20 } from "circuit-json";
1478
- import { z as z69 } from "zod";
1479
- var schematicLineProps = z69.object({
1503
+ import { z as z70 } from "zod";
1504
+ var schematicLineProps = z70.object({
1480
1505
  x1: distance20,
1481
1506
  y1: distance20,
1482
1507
  x2: distance20,
@@ -1484,12 +1509,12 @@ var schematicLineProps = z69.object({
1484
1509
  });
1485
1510
 
1486
1511
  // lib/components/schematic-text.ts
1487
- import { distance as distance21, rotation as rotation4 } from "circuit-json";
1488
- import { z as z71 } from "zod";
1512
+ import { distance as distance21, rotation as rotation5 } from "circuit-json";
1513
+ import { z as z72 } from "zod";
1489
1514
 
1490
1515
  // lib/common/fivePointAnchor.ts
1491
- import { z as z70 } from "zod";
1492
- var fivePointAnchor = z70.enum([
1516
+ import { z as z71 } from "zod";
1517
+ var fivePointAnchor = z71.enum([
1493
1518
  "center",
1494
1519
  "left",
1495
1520
  "right",
@@ -1498,32 +1523,32 @@ var fivePointAnchor = z70.enum([
1498
1523
  ]);
1499
1524
 
1500
1525
  // lib/components/schematic-text.ts
1501
- var schematicTextProps = z71.object({
1526
+ var schematicTextProps = z72.object({
1502
1527
  schX: distance21.optional(),
1503
1528
  schY: distance21.optional(),
1504
- text: z71.string(),
1505
- fontSize: z71.number().default(1),
1506
- anchor: z71.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
1507
- color: z71.string().default("#000000"),
1508
- schRotation: rotation4.default(0)
1529
+ text: z72.string(),
1530
+ fontSize: z72.number().default(1),
1531
+ anchor: z72.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
1532
+ color: z72.string().default("#000000"),
1533
+ schRotation: rotation5.default(0)
1509
1534
  });
1510
1535
 
1511
1536
  // lib/components/schematic-path.ts
1512
1537
  import { point as point5 } from "circuit-json";
1513
- import { z as z72 } from "zod";
1514
- var schematicPathProps = z72.object({
1515
- points: z72.array(point5),
1516
- isFilled: z72.boolean().optional().default(false),
1517
- fillColor: z72.enum(["red", "blue"]).optional()
1538
+ import { z as z73 } from "zod";
1539
+ var schematicPathProps = z73.object({
1540
+ points: z73.array(point5),
1541
+ isFilled: z73.boolean().optional().default(false),
1542
+ fillColor: z73.enum(["red", "blue"]).optional()
1518
1543
  });
1519
1544
 
1520
1545
  // lib/components/schematic-table.ts
1521
1546
  import { distance as distance22 } from "circuit-json";
1522
- import { z as z73 } from "zod";
1523
- var schematicTableProps = z73.object({
1547
+ import { z as z74 } from "zod";
1548
+ var schematicTableProps = z74.object({
1524
1549
  schX: distance22.optional(),
1525
1550
  schY: distance22.optional(),
1526
- children: z73.any().optional(),
1551
+ children: z74.any().optional(),
1527
1552
  cellPadding: distance22.optional(),
1528
1553
  borderWidth: distance22.optional(),
1529
1554
  anchor: ninePointAnchor.optional(),
@@ -1533,44 +1558,44 @@ expectTypesMatch(true);
1533
1558
 
1534
1559
  // lib/components/schematic-row.ts
1535
1560
  import { distance as distance23 } from "circuit-json";
1536
- import { z as z74 } from "zod";
1537
- var schematicRowProps = z74.object({
1538
- children: z74.any().optional(),
1561
+ import { z as z75 } from "zod";
1562
+ var schematicRowProps = z75.object({
1563
+ children: z75.any().optional(),
1539
1564
  height: distance23.optional()
1540
1565
  });
1541
1566
  expectTypesMatch(true);
1542
1567
 
1543
1568
  // lib/components/schematic-cell.ts
1544
1569
  import { distance as distance24 } from "circuit-json";
1545
- import { z as z75 } from "zod";
1546
- var schematicCellProps = z75.object({
1547
- children: z75.string().optional(),
1548
- horizontalAlign: z75.enum(["left", "center", "right"]).optional(),
1549
- verticalAlign: z75.enum(["top", "middle", "bottom"]).optional(),
1570
+ import { z as z76 } from "zod";
1571
+ var schematicCellProps = z76.object({
1572
+ children: z76.string().optional(),
1573
+ horizontalAlign: z76.enum(["left", "center", "right"]).optional(),
1574
+ verticalAlign: z76.enum(["top", "middle", "bottom"]).optional(),
1550
1575
  fontSize: distance24.optional(),
1551
- rowSpan: z75.number().optional(),
1552
- colSpan: z75.number().optional(),
1576
+ rowSpan: z76.number().optional(),
1577
+ colSpan: z76.number().optional(),
1553
1578
  width: distance24.optional(),
1554
- text: z75.string().optional()
1579
+ text: z76.string().optional()
1555
1580
  });
1556
1581
  expectTypesMatch(true);
1557
1582
 
1558
1583
  // lib/components/silkscreen-text.ts
1559
1584
  import { layer_ref as layer_ref6, length as length5 } from "circuit-json";
1560
- import { z as z76 } from "zod";
1585
+ import { z as z77 } from "zod";
1561
1586
  var silkscreenTextProps = pcbLayoutProps.extend({
1562
- text: z76.string(),
1587
+ text: z77.string(),
1563
1588
  anchorAlignment: ninePointAnchor.default("center"),
1564
- font: z76.enum(["tscircuit2024"]).optional(),
1589
+ font: z77.enum(["tscircuit2024"]).optional(),
1565
1590
  fontSize: length5.optional(),
1566
- layers: z76.array(layer_ref6).optional()
1591
+ layers: z77.array(layer_ref6).optional()
1567
1592
  });
1568
1593
 
1569
1594
  // lib/components/silkscreen-path.ts
1570
1595
  import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
1571
- import { z as z77 } from "zod";
1596
+ import { z as z78 } from "zod";
1572
1597
  var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
1573
- route: z77.array(route_hint_point5),
1598
+ route: z78.array(route_hint_point5),
1574
1599
  strokeWidth: length6.optional()
1575
1600
  });
1576
1601
 
@@ -1586,10 +1611,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
1586
1611
 
1587
1612
  // lib/components/silkscreen-rect.ts
1588
1613
  import { distance as distance26 } from "circuit-json";
1589
- import { z as z78 } from "zod";
1614
+ import { z as z79 } from "zod";
1590
1615
  var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1591
- filled: z78.boolean().default(true).optional(),
1592
- stroke: z78.enum(["dashed", "solid", "none"]).optional(),
1616
+ filled: z79.boolean().default(true).optional(),
1617
+ stroke: z79.enum(["dashed", "solid", "none"]).optional(),
1593
1618
  strokeWidth: distance26.optional(),
1594
1619
  width: distance26,
1595
1620
  height: distance26
@@ -1597,64 +1622,64 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1597
1622
 
1598
1623
  // lib/components/silkscreen-circle.ts
1599
1624
  import { distance as distance27 } from "circuit-json";
1600
- import { z as z79 } from "zod";
1625
+ import { z as z80 } from "zod";
1601
1626
  var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
1602
- isFilled: z79.boolean().optional(),
1603
- isOutline: z79.boolean().optional(),
1627
+ isFilled: z80.boolean().optional(),
1628
+ isOutline: z80.boolean().optional(),
1604
1629
  strokeWidth: distance27.optional(),
1605
1630
  radius: distance27
1606
1631
  });
1607
1632
 
1608
1633
  // lib/components/trace-hint.ts
1609
1634
  import { distance as distance28, layer_ref as layer_ref7, route_hint_point as route_hint_point6 } from "circuit-json";
1610
- import { z as z80 } from "zod";
1611
- var routeHintPointProps = z80.object({
1635
+ import { z as z81 } from "zod";
1636
+ var routeHintPointProps = z81.object({
1612
1637
  x: distance28,
1613
1638
  y: distance28,
1614
- via: z80.boolean().optional(),
1639
+ via: z81.boolean().optional(),
1615
1640
  toLayer: layer_ref7.optional()
1616
1641
  });
1617
- var traceHintProps = z80.object({
1618
- for: z80.string().optional().describe(
1642
+ var traceHintProps = z81.object({
1643
+ for: z81.string().optional().describe(
1619
1644
  "Selector for the port you're targeting, not required if you're inside a trace"
1620
1645
  ),
1621
- order: z80.number().optional(),
1646
+ order: z81.number().optional(),
1622
1647
  offset: route_hint_point6.or(routeHintPointProps).optional(),
1623
- offsets: z80.array(route_hint_point6).or(z80.array(routeHintPointProps)).optional(),
1624
- traceWidth: z80.number().optional()
1648
+ offsets: z81.array(route_hint_point6).or(z81.array(routeHintPointProps)).optional(),
1649
+ traceWidth: z81.number().optional()
1625
1650
  });
1626
1651
 
1627
1652
  // lib/components/port.ts
1628
- import { z as z81 } from "zod";
1653
+ import { z as z82 } from "zod";
1629
1654
  var portProps = commonLayoutProps.extend({
1630
- name: z81.string(),
1631
- pinNumber: z81.number().optional(),
1632
- aliases: z81.array(z81.string()).optional(),
1655
+ name: z82.string(),
1656
+ pinNumber: z82.number().optional(),
1657
+ aliases: z82.array(z82.string()).optional(),
1633
1658
  direction
1634
1659
  });
1635
1660
 
1636
1661
  // lib/platformConfig.ts
1637
- import { z as z82 } from "zod";
1638
- var unvalidatedCircuitJson = z82.array(z82.any()).describe("Circuit JSON");
1639
- var pathToCircuitJsonFn = z82.function().args(z82.string()).returns(z82.promise(z82.object({ footprintCircuitJson: z82.array(z82.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1640
- var platformConfig = z82.object({
1662
+ import { z as z83 } from "zod";
1663
+ var unvalidatedCircuitJson = z83.array(z83.any()).describe("Circuit JSON");
1664
+ var pathToCircuitJsonFn = z83.function().args(z83.string()).returns(z83.promise(z83.object({ footprintCircuitJson: z83.array(z83.any()) }))).describe("A function that takes a path and returns Circuit JSON");
1665
+ var platformConfig = z83.object({
1641
1666
  partsEngine: partsEngine.optional(),
1642
1667
  autorouter: autorouterProp.optional(),
1643
- registryApiUrl: z82.string().optional(),
1644
- cloudAutorouterUrl: z82.string().optional(),
1645
- projectName: z82.string().optional(),
1646
- version: z82.string().optional(),
1647
- url: z82.string().optional(),
1648
- printBoardInformationToSilkscreen: z82.boolean().optional(),
1649
- localCacheEngine: z82.any().optional(),
1650
- pcbDisabled: z82.boolean().optional(),
1651
- schematicDisabled: z82.boolean().optional(),
1652
- partsEngineDisabled: z82.boolean().optional(),
1653
- footprintLibraryMap: z82.record(
1654
- z82.string(),
1655
- z82.record(
1656
- z82.string(),
1657
- z82.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1668
+ registryApiUrl: z83.string().optional(),
1669
+ cloudAutorouterUrl: z83.string().optional(),
1670
+ projectName: z83.string().optional(),
1671
+ version: z83.string().optional(),
1672
+ url: z83.string().optional(),
1673
+ printBoardInformationToSilkscreen: z83.boolean().optional(),
1674
+ localCacheEngine: z83.any().optional(),
1675
+ pcbDisabled: z83.boolean().optional(),
1676
+ schematicDisabled: z83.boolean().optional(),
1677
+ partsEngineDisabled: z83.boolean().optional(),
1678
+ footprintLibraryMap: z83.record(
1679
+ z83.string(),
1680
+ z83.record(
1681
+ z83.string(),
1682
+ z83.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
1658
1683
  )
1659
1684
  ).optional()
1660
1685
  });
@@ -1797,6 +1822,7 @@ export {
1797
1822
  transistorPins,
1798
1823
  transistorPinsLabels,
1799
1824
  transistorProps,
1800
- viaProps
1825
+ viaProps,
1826
+ voltageSourceProps
1801
1827
  };
1802
1828
  //# sourceMappingURL=index.js.map