@tscircuit/core 0.0.642 → 0.0.644

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.
Files changed (2) hide show
  1. package/dist/index.js +311 -224
  2. package/package.json +1 -2
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2
3
  var __export = (target, all) => {
3
4
  for (var name in all)
4
5
  __defProp(target, name, { get: all[name], enumerable: true });
5
6
  };
7
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
8
 
7
9
  // lib/components/index.ts
8
10
  var components_exports = {};
@@ -75,9 +77,8 @@ import {
75
77
  import Debug4 from "debug";
76
78
 
77
79
  // lib/fiber/create-instance-from-react-element.ts
78
- import React from "react";
80
+ import "react";
79
81
  import ReactReconciler from "react-reconciler";
80
- import ReactReconciler18 from "react-reconciler-18";
81
82
  import { DefaultEventPriority } from "react-reconciler/constants.js";
82
83
 
83
84
  // lib/components/base-components/Renderable.ts
@@ -124,18 +125,18 @@ var orderedRenderPhases = [
124
125
  ];
125
126
  var globalRenderCounter = 0;
126
127
  var Renderable = class {
127
- renderPhaseStates;
128
- shouldBeRemoved = false;
129
- children;
130
- /** PCB-only SMTPads, PlatedHoles, Holes, Silkscreen elements etc. */
131
- isPcbPrimitive = false;
132
- /** Schematic-only, lines, boxes, indicators etc. */
133
- isSchematicPrimitive = false;
134
- _renderId;
135
- _currentRenderPhase = null;
136
- _asyncEffects = [];
137
- parent = null;
138
128
  constructor(props) {
129
+ __publicField(this, "renderPhaseStates");
130
+ __publicField(this, "shouldBeRemoved", false);
131
+ __publicField(this, "children");
132
+ /** PCB-only SMTPads, PlatedHoles, Holes, Silkscreen elements etc. */
133
+ __publicField(this, "isPcbPrimitive", false);
134
+ /** Schematic-only, lines, boxes, indicators etc. */
135
+ __publicField(this, "isSchematicPrimitive", false);
136
+ __publicField(this, "_renderId");
137
+ __publicField(this, "_currentRenderPhase", null);
138
+ __publicField(this, "_asyncEffects", []);
139
+ __publicField(this, "parent", null);
139
140
  this._renderId = `${globalRenderCounter++}`;
140
141
  this.children = [];
141
142
  this.renderPhaseStates = {};
@@ -539,17 +540,58 @@ var cssSelectOptionsInsideSubcircuit = {
539
540
  cacheResults: true
540
541
  };
541
542
  var PrimitiveComponent2 = class extends Renderable {
542
- parent = null;
543
- children;
544
- childrenPendingRemoval;
543
+ constructor(props) {
544
+ super(props);
545
+ __publicField(this, "parent", null);
546
+ __publicField(this, "children");
547
+ __publicField(this, "childrenPendingRemoval");
548
+ __publicField(this, "props");
549
+ __publicField(this, "_parsedProps");
550
+ __publicField(this, "externallyAddedAliases");
551
+ /**
552
+ * A primitive container is a component that contains one or more ports and
553
+ * primitive components that are designed to interact.
554
+ *
555
+ * For example a resistor contains ports and smtpads that interact, so the
556
+ * resistor is a primitive container. Inside a primitive container, the ports
557
+ * and pads are likely to reference each other and look for eachother during
558
+ * the port matching phase.
559
+ *
560
+ */
561
+ __publicField(this, "isPrimitiveContainer", false);
562
+ __publicField(this, "canHaveTextChildren", false);
563
+ __publicField(this, "source_group_id", null);
564
+ __publicField(this, "source_component_id", null);
565
+ __publicField(this, "schematic_component_id", null);
566
+ __publicField(this, "pcb_component_id", null);
567
+ __publicField(this, "cad_component_id", null);
568
+ __publicField(this, "fallbackUnassignedName");
569
+ __publicField(this, "_cachedSelectAllQueries", /* @__PURE__ */ new Map());
570
+ __publicField(this, "_cachedSelectOneQueries", /* @__PURE__ */ new Map());
571
+ this.children = [];
572
+ this.childrenPendingRemoval = [];
573
+ this.props = props ?? {};
574
+ this.externallyAddedAliases = [];
575
+ const zodProps = "partial" in this.config.zodProps ? this.config.zodProps.partial({
576
+ name: true
577
+ }) : this.config.zodProps;
578
+ const parsePropsResult = zodProps.safeParse(props ?? {});
579
+ if (parsePropsResult.success) {
580
+ this._parsedProps = parsePropsResult.data;
581
+ } else {
582
+ throw new InvalidProps(
583
+ this.lowercaseComponentName,
584
+ this.props,
585
+ parsePropsResult.error.format()
586
+ );
587
+ }
588
+ }
545
589
  get config() {
546
590
  return {
547
591
  componentName: "",
548
592
  zodProps: z.object({}).passthrough()
549
593
  };
550
594
  }
551
- props;
552
- _parsedProps;
553
595
  get componentName() {
554
596
  return this.config.componentName;
555
597
  }
@@ -569,7 +611,6 @@ var PrimitiveComponent2 = class extends Renderable {
569
611
  get lowercaseComponentName() {
570
612
  return this.componentName.toLowerCase();
571
613
  }
572
- externallyAddedAliases;
573
614
  /**
574
615
  * An subcircuit is self-contained. All the selectors inside
575
616
  * a subcircuit are relative to the subcircuit group. You can have multiple
@@ -585,44 +626,6 @@ var PrimitiveComponent2 = class extends Renderable {
585
626
  get name() {
586
627
  return this._parsedProps.name ?? this.fallbackUnassignedName;
587
628
  }
588
- /**
589
- * A primitive container is a component that contains one or more ports and
590
- * primitive components that are designed to interact.
591
- *
592
- * For example a resistor contains ports and smtpads that interact, so the
593
- * resistor is a primitive container. Inside a primitive container, the ports
594
- * and pads are likely to reference each other and look for eachother during
595
- * the port matching phase.
596
- *
597
- */
598
- isPrimitiveContainer = false;
599
- canHaveTextChildren = false;
600
- source_group_id = null;
601
- source_component_id = null;
602
- schematic_component_id = null;
603
- pcb_component_id = null;
604
- cad_component_id = null;
605
- fallbackUnassignedName;
606
- constructor(props) {
607
- super(props);
608
- this.children = [];
609
- this.childrenPendingRemoval = [];
610
- this.props = props ?? {};
611
- this.externallyAddedAliases = [];
612
- const zodProps = "partial" in this.config.zodProps ? this.config.zodProps.partial({
613
- name: true
614
- }) : this.config.zodProps;
615
- const parsePropsResult = zodProps.safeParse(props ?? {});
616
- if (parsePropsResult.success) {
617
- this._parsedProps = parsePropsResult.data;
618
- } else {
619
- throw new InvalidProps(
620
- this.lowercaseComponentName,
621
- this.props,
622
- parsePropsResult.error.format()
623
- );
624
- }
625
- }
626
629
  setProps(props) {
627
630
  const newProps = this.config.zodProps.parse({
628
631
  ...this.props,
@@ -1030,7 +1033,6 @@ var PrimitiveComponent2 = class extends Renderable {
1030
1033
  }
1031
1034
  }
1032
1035
  }
1033
- _cachedSelectAllQueries = /* @__PURE__ */ new Map();
1034
1036
  selectAll(selectorRaw) {
1035
1037
  if (this._cachedSelectAllQueries.has(selectorRaw)) {
1036
1038
  return this._cachedSelectAllQueries.get(
@@ -1052,7 +1054,6 @@ var PrimitiveComponent2 = class extends Renderable {
1052
1054
  this._cachedSelectAllQueries.set(selectorRaw, result2);
1053
1055
  return result2;
1054
1056
  }
1055
- _cachedSelectOneQueries = /* @__PURE__ */ new Map();
1056
1057
  selectOne(selectorRaw, options) {
1057
1058
  if (this._cachedSelectOneQueries.has(selectorRaw)) {
1058
1059
  return this._cachedSelectOneQueries.get(selectorRaw);
@@ -1072,11 +1073,11 @@ var PrimitiveComponent2 = class extends Renderable {
1072
1073
  (n) => n.lowercaseComponentName === options.type
1073
1074
  );
1074
1075
  }
1075
- result ??= selectOne(
1076
+ result ?? (result = selectOne(
1076
1077
  selector,
1077
1078
  this,
1078
1079
  cssSelectOptionsInsideSubcircuit
1079
- );
1080
+ ));
1080
1081
  if (result) {
1081
1082
  this._cachedSelectOneQueries.set(selectorRaw, result);
1082
1083
  return result;
@@ -1352,12 +1353,7 @@ var hostConfig = {
1352
1353
  maySuspendCommit: () => false,
1353
1354
  supportsHydration: false
1354
1355
  };
1355
- var reconciler;
1356
- if (React.version.startsWith("19.")) {
1357
- reconciler = ReactReconciler(hostConfig);
1358
- } else {
1359
- reconciler = ReactReconciler18(hostConfig);
1360
- }
1356
+ var reconciler = ReactReconciler(hostConfig);
1361
1357
  var createInstanceFromReactElement = (reactElm) => {
1362
1358
  const rootContainer = {
1363
1359
  children: [],
@@ -1390,14 +1386,9 @@ var createInstanceFromReactElement = (reactElm) => {
1390
1386
  },
1391
1387
  null
1392
1388
  );
1393
- if (React.version.startsWith("19.")) {
1394
- reconciler.updateContainerSync(reactElm, container, null, () => {
1395
- });
1396
- reconciler.flushSyncWork();
1397
- } else {
1398
- reconciler.updateContainer(reactElm, container, null, () => {
1399
- });
1400
- }
1389
+ reconciler.updateContainerSync(reactElm, container, null, () => {
1390
+ });
1391
+ reconciler.flushSyncWork();
1401
1392
  if (containerErrors.length > 0) {
1402
1393
  throw containerErrors[0];
1403
1394
  }
@@ -1512,7 +1503,10 @@ var netProps = z4.object({
1512
1503
  )
1513
1504
  });
1514
1505
  var Net = class extends PrimitiveComponent2 {
1515
- source_net_id;
1506
+ constructor() {
1507
+ super(...arguments);
1508
+ __publicField(this, "source_net_id");
1509
+ }
1516
1510
  get config() {
1517
1511
  return {
1518
1512
  componentName: "Net",
@@ -1717,9 +1711,12 @@ var createNetsFromProps = (component, props) => {
1717
1711
  import { smtPadProps } from "@tscircuit/props";
1718
1712
  import { decomposeTSR } from "transformation-matrix";
1719
1713
  var SmtPad = class extends PrimitiveComponent2 {
1720
- pcb_smtpad_id = null;
1721
- matchedPort = null;
1722
- isPcbPrimitive = true;
1714
+ constructor() {
1715
+ super(...arguments);
1716
+ __publicField(this, "pcb_smtpad_id", null);
1717
+ __publicField(this, "matchedPort", null);
1718
+ __publicField(this, "isPcbPrimitive", true);
1719
+ }
1723
1720
  get config() {
1724
1721
  return {
1725
1722
  componentName: "SmtPad",
@@ -1977,8 +1974,11 @@ var SmtPad = class extends PrimitiveComponent2 {
1977
1974
  import { silkscreenPathProps } from "@tscircuit/props";
1978
1975
  import { applyToPoint as applyToPoint2 } from "transformation-matrix";
1979
1976
  var SilkscreenPath = class extends PrimitiveComponent2 {
1980
- pcb_silkscreen_path_id = null;
1981
- isPcbPrimitive = true;
1977
+ constructor() {
1978
+ super(...arguments);
1979
+ __publicField(this, "pcb_silkscreen_path_id", null);
1980
+ __publicField(this, "isPcbPrimitive", true);
1981
+ }
1982
1982
  get config() {
1983
1983
  return {
1984
1984
  componentName: "SilkscreenPath",
@@ -2073,8 +2073,11 @@ var pcbTraceProps = z5.object({
2073
2073
  source_trace_id: z5.string().optional()
2074
2074
  });
2075
2075
  var PcbTrace = class extends PrimitiveComponent2 {
2076
- pcb_trace_id = null;
2077
- isPcbPrimitive = true;
2076
+ constructor() {
2077
+ super(...arguments);
2078
+ __publicField(this, "pcb_trace_id", null);
2079
+ __publicField(this, "isPcbPrimitive", true);
2080
+ }
2078
2081
  get config() {
2079
2082
  return {
2080
2083
  componentName: "PcbTrace",
@@ -2141,9 +2144,12 @@ var PcbTrace = class extends PrimitiveComponent2 {
2141
2144
  // lib/components/primitive-components/PlatedHole.ts
2142
2145
  import { platedHoleProps } from "@tscircuit/props";
2143
2146
  var PlatedHole = class extends PrimitiveComponent2 {
2144
- pcb_plated_hole_id = null;
2145
- matchedPort = null;
2146
- isPcbPrimitive = true;
2147
+ constructor() {
2148
+ super(...arguments);
2149
+ __publicField(this, "pcb_plated_hole_id", null);
2150
+ __publicField(this, "matchedPort", null);
2151
+ __publicField(this, "isPcbPrimitive", true);
2152
+ }
2147
2153
  get config() {
2148
2154
  return {
2149
2155
  componentName: "PlatedHole",
@@ -2366,8 +2372,11 @@ var PlatedHole = class extends PrimitiveComponent2 {
2366
2372
  import { pcbKeepoutProps } from "@tscircuit/props";
2367
2373
  import { decomposeTSR as decomposeTSR2 } from "transformation-matrix";
2368
2374
  var Keepout = class extends PrimitiveComponent2 {
2369
- pcb_keepout_id = null;
2370
- isPcbPrimitive = true;
2375
+ constructor() {
2376
+ super(...arguments);
2377
+ __publicField(this, "pcb_keepout_id", null);
2378
+ __publicField(this, "isPcbPrimitive", true);
2379
+ }
2371
2380
  get config() {
2372
2381
  return {
2373
2382
  componentName: "Keepout",
@@ -2421,8 +2430,11 @@ var Keepout = class extends PrimitiveComponent2 {
2421
2430
  // lib/components/primitive-components/Hole.ts
2422
2431
  import { holeProps } from "@tscircuit/props";
2423
2432
  var Hole = class extends PrimitiveComponent2 {
2424
- pcb_hole_id = null;
2425
- isPcbPrimitive = true;
2433
+ constructor() {
2434
+ super(...arguments);
2435
+ __publicField(this, "pcb_hole_id", null);
2436
+ __publicField(this, "isPcbPrimitive", true);
2437
+ }
2426
2438
  get config() {
2427
2439
  return {
2428
2440
  componentName: "Hole",
@@ -2478,7 +2490,10 @@ var Hole = class extends PrimitiveComponent2 {
2478
2490
  // lib/components/primitive-components/SilkscreenText.ts
2479
2491
  import { silkscreenTextProps } from "@tscircuit/props";
2480
2492
  var SilkscreenText = class extends PrimitiveComponent2 {
2481
- isPcbPrimitive = true;
2493
+ constructor() {
2494
+ super(...arguments);
2495
+ __publicField(this, "isPcbPrimitive", true);
2496
+ }
2482
2497
  get config() {
2483
2498
  return {
2484
2499
  componentName: "SilkscreenText",
@@ -2528,8 +2543,11 @@ var SilkscreenText = class extends PrimitiveComponent2 {
2528
2543
  import { applyToPoint as applyToPoint4 } from "transformation-matrix";
2529
2544
  import { cutoutProps } from "@tscircuit/props";
2530
2545
  var Cutout = class extends PrimitiveComponent2 {
2531
- pcb_cutout_id = null;
2532
- isPcbPrimitive = true;
2546
+ constructor() {
2547
+ super(...arguments);
2548
+ __publicField(this, "pcb_cutout_id", null);
2549
+ __publicField(this, "isPcbPrimitive", true);
2550
+ }
2533
2551
  get config() {
2534
2552
  return {
2535
2553
  componentName: "Cutout",
@@ -2992,19 +3010,6 @@ var portProps = z6.object({
2992
3010
  aliases: z6.array(z6.string()).optional()
2993
3011
  });
2994
3012
  var Port = class extends PrimitiveComponent2 {
2995
- source_port_id = null;
2996
- pcb_port_id = null;
2997
- schematic_port_id = null;
2998
- schematicSymbolPortDef = null;
2999
- matchedComponents;
3000
- facingDirection = null;
3001
- originDescription = null;
3002
- get config() {
3003
- return {
3004
- componentName: "Port",
3005
- zodProps: portProps
3006
- };
3007
- }
3008
3013
  constructor(props, opts = {}) {
3009
3014
  if (!props.name && props.pinNumber !== void 0)
3010
3015
  props.name = `pin${props.pinNumber}`;
@@ -3012,11 +3017,24 @@ var Port = class extends PrimitiveComponent2 {
3012
3017
  throw new Error("Port must have a name or a pinNumber");
3013
3018
  }
3014
3019
  super(props);
3020
+ __publicField(this, "source_port_id", null);
3021
+ __publicField(this, "pcb_port_id", null);
3022
+ __publicField(this, "schematic_port_id", null);
3023
+ __publicField(this, "schematicSymbolPortDef", null);
3024
+ __publicField(this, "matchedComponents");
3025
+ __publicField(this, "facingDirection", null);
3026
+ __publicField(this, "originDescription", null);
3015
3027
  if (opts.originDescription) {
3016
3028
  this.originDescription = opts.originDescription;
3017
3029
  }
3018
3030
  this.matchedComponents = [];
3019
3031
  }
3032
+ get config() {
3033
+ return {
3034
+ componentName: "Port",
3035
+ zodProps: portProps
3036
+ };
3037
+ }
3020
3038
  _getGlobalPcbPositionBeforeLayout() {
3021
3039
  const matchedPcbElm = this.matchedComponents.find((c) => c.isPcbPrimitive);
3022
3040
  const parentComponent = this.parent;
@@ -3886,8 +3904,8 @@ import "circuit-json-to-connectivity-map";
3886
3904
 
3887
3905
  // lib/utils/autorouting/DirectLineRouter.ts
3888
3906
  var DirectLineRouter = class {
3889
- input;
3890
3907
  constructor({ input }) {
3908
+ __publicField(this, "input");
3891
3909
  this.input = input;
3892
3910
  }
3893
3911
  solveAndMapToTraces() {
@@ -5053,7 +5071,7 @@ var convertFacingDirectionToElbowDirection = (facingDirection) => {
5053
5071
  };
5054
5072
 
5055
5073
  // lib/errors/AutorouterError.ts
5056
- import packageJson from "@tscircuit/capacity-autorouter/package.json" with { type: "json" };
5074
+ import packageJson from "@tscircuit/capacity-autorouter/package.json";
5057
5075
  var autorouterVersion = packageJson.version ?? "unknown";
5058
5076
  var AutorouterError = class extends Error {
5059
5077
  constructor(message) {
@@ -5954,15 +5972,15 @@ function Trace__findConnectedPorts(trace) {
5954
5972
 
5955
5973
  // lib/components/primitive-components/Trace/Trace.ts
5956
5974
  var Trace3 = class extends PrimitiveComponent2 {
5957
- source_trace_id = null;
5958
- pcb_trace_id = null;
5959
- schematic_trace_id = null;
5960
- _portsRoutedOnPcb;
5961
- subcircuit_connectivity_map_key = null;
5962
- _traceConnectionHash = null;
5963
- _couldNotFindPort;
5964
5975
  constructor(props) {
5965
5976
  super(props);
5977
+ __publicField(this, "source_trace_id", null);
5978
+ __publicField(this, "pcb_trace_id", null);
5979
+ __publicField(this, "schematic_trace_id", null);
5980
+ __publicField(this, "_portsRoutedOnPcb");
5981
+ __publicField(this, "subcircuit_connectivity_map_key", null);
5982
+ __publicField(this, "_traceConnectionHash", null);
5983
+ __publicField(this, "_couldNotFindPort");
5966
5984
  this._portsRoutedOnPcb = [];
5967
5985
  }
5968
5986
  get config() {
@@ -6182,12 +6200,17 @@ var rotation3 = z8.object({
6182
6200
  z: rotation
6183
6201
  });
6184
6202
  var NormalComponent = class extends PrimitiveComponent2 {
6185
- reactSubtrees = [];
6186
- _impliedFootprint;
6187
- isPrimitiveContainer = true;
6188
- _asyncSupplierPartNumbers;
6189
- pcb_missing_footprint_error_id;
6190
- _hasStartedFootprintUrlLoad = false;
6203
+ constructor(props) {
6204
+ super(props);
6205
+ __publicField(this, "reactSubtrees", []);
6206
+ __publicField(this, "_impliedFootprint");
6207
+ __publicField(this, "isPrimitiveContainer", true);
6208
+ __publicField(this, "_asyncSupplierPartNumbers");
6209
+ __publicField(this, "pcb_missing_footprint_error_id");
6210
+ __publicField(this, "_hasStartedFootprintUrlLoad", false);
6211
+ this._addChildrenFromStringFootprint();
6212
+ this.initPorts();
6213
+ }
6191
6214
  /**
6192
6215
  * Override this property for component defaults
6193
6216
  */
@@ -6202,11 +6225,6 @@ var NormalComponent = class extends PrimitiveComponent2 {
6202
6225
  )
6203
6226
  );
6204
6227
  }
6205
- constructor(props) {
6206
- super(props);
6207
- this._addChildrenFromStringFootprint();
6208
- this.initPorts();
6209
- }
6210
6228
  /**
6211
6229
  * Override this method for better control over the auto-discovery of ports.
6212
6230
  *
@@ -6397,7 +6415,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
6397
6415
  _addChildrenFromStringFootprint() {
6398
6416
  const { pcbRotation, pinLabels, pcbPinLabels } = this.props;
6399
6417
  let { footprint } = this.props;
6400
- footprint ??= this._getImpliedFootprintString?.();
6418
+ footprint ?? (footprint = this._getImpliedFootprintString?.());
6401
6419
  if (!footprint) return;
6402
6420
  if (typeof footprint === "string") {
6403
6421
  if (this._isFootprintUrl(footprint)) return;
@@ -6653,7 +6671,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
6653
6671
  }
6654
6672
  doInitialPcbFootprintStringRender() {
6655
6673
  let { footprint } = this.props;
6656
- footprint ??= this._getImpliedFootprintString?.();
6674
+ footprint ?? (footprint = this._getImpliedFootprintString?.());
6657
6675
  if (!footprint) return;
6658
6676
  const { pcbRotation, pinLabels, pcbPinLabels } = this.props;
6659
6677
  if (typeof footprint === "string" && this._isFootprintUrl(footprint)) {
@@ -7054,18 +7072,18 @@ import {
7054
7072
  // lib/utils/autorouting/CapacityMeshAutorouter.ts
7055
7073
  import { CapacityMeshSolver } from "@tscircuit/capacity-autorouter";
7056
7074
  var CapacityMeshAutorouter = class {
7057
- input;
7058
- isRouting = false;
7059
- solver;
7060
- eventHandlers = {
7061
- complete: [],
7062
- error: [],
7063
- progress: []
7064
- };
7065
- cycleCount = 0;
7066
- stepDelay;
7067
- timeoutId;
7068
7075
  constructor(input, options = {}) {
7076
+ __publicField(this, "input");
7077
+ __publicField(this, "isRouting", false);
7078
+ __publicField(this, "solver");
7079
+ __publicField(this, "eventHandlers", {
7080
+ complete: [],
7081
+ error: [],
7082
+ progress: []
7083
+ });
7084
+ __publicField(this, "cycleCount", 0);
7085
+ __publicField(this, "stepDelay");
7086
+ __publicField(this, "timeoutId");
7069
7087
  this.input = input;
7070
7088
  const { capacityDepth, targetMinCapacity, stepDelay = 0 } = options;
7071
7089
  this.solver = new CapacityMeshSolver(input, {
@@ -7208,7 +7226,10 @@ import "zod";
7208
7226
  import { traceHintProps } from "@tscircuit/props";
7209
7227
  import { applyToPoint as applyToPoint6 } from "transformation-matrix";
7210
7228
  var TraceHint = class extends PrimitiveComponent2 {
7211
- matchedPort = null;
7229
+ constructor() {
7230
+ super(...arguments);
7231
+ __publicField(this, "matchedPort", null);
7232
+ }
7212
7233
  get config() {
7213
7234
  return {
7214
7235
  componentName: "TraceHint",
@@ -7722,7 +7743,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
7722
7743
  if (!conn) continue;
7723
7744
  if (![...tracePortIds].every((pid) => pointIdToConn.get(pid) === conn))
7724
7745
  continue;
7725
- conn.externallyConnectedPointIds ??= [];
7746
+ conn.externallyConnectedPointIds ?? (conn.externallyConnectedPointIds = []);
7726
7747
  conn.externallyConnectedPointIds.push([...tracePortIds]);
7727
7748
  }
7728
7749
  return {
@@ -9480,11 +9501,15 @@ var Group_doInitialPcbLayoutFlex = (group) => {
9480
9501
  // lib/components/primitive-components/Group/Group.ts
9481
9502
  import { convertSrjToGraphicsObject } from "@tscircuit/capacity-autorouter";
9482
9503
  var Group = class extends NormalComponent {
9483
- pcb_group_id = null;
9484
- schematic_group_id = null;
9485
- subcircuit_id = null;
9486
- _hasStartedAsyncAutorouting = false;
9487
- _asyncAutoroutingResult = null;
9504
+ constructor() {
9505
+ super(...arguments);
9506
+ __publicField(this, "pcb_group_id", null);
9507
+ __publicField(this, "schematic_group_id", null);
9508
+ __publicField(this, "subcircuit_id", null);
9509
+ __publicField(this, "_hasStartedAsyncAutorouting", false);
9510
+ __publicField(this, "_asyncAutoroutingResult", null);
9511
+ __publicField(this, "unnamedElementCounter", {});
9512
+ }
9488
9513
  get config() {
9489
9514
  return {
9490
9515
  zodProps: groupProps,
@@ -9581,9 +9606,9 @@ var Group = class extends NormalComponent {
9581
9606
  });
9582
9607
  }
9583
9608
  }
9584
- unnamedElementCounter = {};
9585
9609
  getNextAvailableName(elm) {
9586
- this.unnamedElementCounter[elm.lowercaseComponentName] ??= 1;
9610
+ var _a, _b;
9611
+ (_a = this.unnamedElementCounter)[_b = elm.lowercaseComponentName] ?? (_a[_b] = 1);
9587
9612
  return `unnamed_${elm.lowercaseComponentName}${this.unnamedElementCounter[elm.lowercaseComponentName]++}`;
9588
9613
  }
9589
9614
  _resolvePcbPadding() {
@@ -10212,9 +10237,12 @@ import {
10212
10237
  checkEachPcbTraceNonOverlapping
10213
10238
  } from "@tscircuit/checks";
10214
10239
  var Board = class extends Group {
10215
- pcb_board_id = null;
10216
- _drcChecksComplete = false;
10217
- _connectedSchematicPortPairs = /* @__PURE__ */ new Set();
10240
+ constructor() {
10241
+ super(...arguments);
10242
+ __publicField(this, "pcb_board_id", null);
10243
+ __publicField(this, "_drcChecksComplete", false);
10244
+ __publicField(this, "_connectedSchematicPortPairs", /* @__PURE__ */ new Set());
10245
+ }
10218
10246
  get isSubcircuit() {
10219
10247
  return true;
10220
10248
  }
@@ -10496,7 +10524,10 @@ var Capacitor = class extends NormalComponent {
10496
10524
  // lib/components/normal-components/Chip.ts
10497
10525
  import { chipProps } from "@tscircuit/props";
10498
10526
  var Chip = class extends NormalComponent {
10499
- schematicBoxDimensions = null;
10527
+ constructor() {
10528
+ super(...arguments);
10529
+ __publicField(this, "schematicBoxDimensions", null);
10530
+ }
10500
10531
  get config() {
10501
10532
  return {
10502
10533
  componentName: "Chip",
@@ -10639,6 +10670,13 @@ var Chip = class extends NormalComponent {
10639
10670
  // lib/components/normal-components/Diode.ts
10640
10671
  import { diodeProps } from "@tscircuit/props";
10641
10672
  var Diode = class extends NormalComponent {
10673
+ constructor() {
10674
+ super(...arguments);
10675
+ __publicField(this, "pos", this.portMap.pin1);
10676
+ __publicField(this, "anode", this.portMap.pin1);
10677
+ __publicField(this, "neg", this.portMap.pin2);
10678
+ __publicField(this, "cathode", this.portMap.pin2);
10679
+ }
10642
10680
  // @ts-ignore
10643
10681
  get config() {
10644
10682
  const symbolMap = {
@@ -10676,10 +10714,6 @@ var Diode = class extends NormalComponent {
10676
10714
  });
10677
10715
  this.source_component_id = source_component.source_component_id;
10678
10716
  }
10679
- pos = this.portMap.pin1;
10680
- anode = this.portMap.pin1;
10681
- neg = this.portMap.pin2;
10682
- cathode = this.portMap.pin2;
10683
10717
  };
10684
10718
 
10685
10719
  // lib/components/normal-components/Fuse.ts
@@ -10721,7 +10755,10 @@ var Fuse = class extends NormalComponent {
10721
10755
  // lib/components/normal-components/Jumper.ts
10722
10756
  import { jumperProps } from "@tscircuit/props";
10723
10757
  var Jumper = class extends NormalComponent {
10724
- schematicDimensions = null;
10758
+ constructor() {
10759
+ super(...arguments);
10760
+ __publicField(this, "schematicDimensions", null);
10761
+ }
10725
10762
  get config() {
10726
10763
  return {
10727
10764
  schematicSymbolName: void 0,
@@ -10820,7 +10857,10 @@ var Jumper = class extends NormalComponent {
10820
10857
  // lib/components/normal-components/SolderJumper.ts
10821
10858
  import { solderjumperProps } from "@tscircuit/props";
10822
10859
  var SolderJumper = class extends NormalComponent {
10823
- schematicDimensions = null;
10860
+ constructor() {
10861
+ super(...arguments);
10862
+ __publicField(this, "schematicDimensions", null);
10863
+ }
10824
10864
  _getPinNumberFromBridgedPinName(pinName) {
10825
10865
  const port = this.selectOne(`port.${pinName}`, {
10826
10866
  type: "port"
@@ -10974,6 +11014,13 @@ var SolderJumper = class extends NormalComponent {
10974
11014
  // lib/components/normal-components/Led.ts
10975
11015
  import { ledProps } from "@tscircuit/props";
10976
11016
  var Led = class extends NormalComponent {
11017
+ constructor() {
11018
+ super(...arguments);
11019
+ __publicField(this, "pos", this.portMap.pin1);
11020
+ __publicField(this, "anode", this.portMap.pin1);
11021
+ __publicField(this, "neg", this.portMap.pin2);
11022
+ __publicField(this, "cathode", this.portMap.pin2);
11023
+ }
10977
11024
  get config() {
10978
11025
  const symbolMap = {
10979
11026
  laser: "laser_diode"
@@ -11013,15 +11060,18 @@ var Led = class extends NormalComponent {
11013
11060
  });
11014
11061
  this.source_component_id = source_component.source_component_id;
11015
11062
  }
11016
- pos = this.portMap.pin1;
11017
- anode = this.portMap.pin1;
11018
- neg = this.portMap.pin2;
11019
- cathode = this.portMap.pin2;
11020
11063
  };
11021
11064
 
11022
11065
  // lib/components/normal-components/PowerSource.ts
11023
11066
  import { powerSourceProps } from "@tscircuit/props";
11024
11067
  var PowerSource = class extends NormalComponent {
11068
+ constructor() {
11069
+ super(...arguments);
11070
+ __publicField(this, "pos", this.portMap.pin1);
11071
+ __publicField(this, "positive", this.portMap.pin1);
11072
+ __publicField(this, "neg", this.portMap.pin2);
11073
+ __publicField(this, "negative", this.portMap.pin2);
11074
+ }
11025
11075
  // @ts-ignore
11026
11076
  get config() {
11027
11077
  return {
@@ -11052,10 +11102,6 @@ var PowerSource = class extends NormalComponent {
11052
11102
  });
11053
11103
  this.source_component_id = source_component.source_component_id;
11054
11104
  }
11055
- pos = this.portMap.pin1;
11056
- positive = this.portMap.pin1;
11057
- neg = this.portMap.pin2;
11058
- negative = this.portMap.pin2;
11059
11105
  };
11060
11106
 
11061
11107
  // lib/components/normal-components/VoltageSource.ts
@@ -11072,6 +11118,11 @@ var voltageSourceProps = commonComponentProps.extend({
11072
11118
  phase: rotation2.optional()
11073
11119
  });
11074
11120
  var VoltageSource = class extends NormalComponent {
11121
+ constructor() {
11122
+ super(...arguments);
11123
+ __publicField(this, "terminal1", this.portMap.terminal1);
11124
+ __publicField(this, "terminal2", this.portMap.terminal2);
11125
+ }
11075
11126
  get config() {
11076
11127
  return {
11077
11128
  componentName: "VoltageSource",
@@ -11132,8 +11183,6 @@ var VoltageSource = class extends NormalComponent {
11132
11183
  phase: props.phase
11133
11184
  });
11134
11185
  }
11135
- terminal1 = this.portMap.terminal1;
11136
- terminal2 = this.portMap.terminal2;
11137
11186
  };
11138
11187
 
11139
11188
  // lib/components/normal-components/Resistor.ts
@@ -11283,7 +11332,10 @@ var Constraint2 = class extends PrimitiveComponent2 {
11283
11332
  import { fabricationNotePathProps } from "@tscircuit/props";
11284
11333
  import { applyToPoint as applyToPoint7 } from "transformation-matrix";
11285
11334
  var FabricationNotePath = class extends PrimitiveComponent2 {
11286
- fabrication_note_path_id = null;
11335
+ constructor() {
11336
+ super(...arguments);
11337
+ __publicField(this, "fabrication_note_path_id", null);
11338
+ }
11287
11339
  get config() {
11288
11340
  return {
11289
11341
  componentName: "FabricationNotePath",
@@ -11404,10 +11456,13 @@ var Breakout = class extends Group {
11404
11456
  // lib/components/primitive-components/BreakoutPoint.ts
11405
11457
  import { breakoutPointProps } from "@tscircuit/props";
11406
11458
  var BreakoutPoint = class extends PrimitiveComponent2 {
11407
- pcb_breakout_point_id = null;
11408
- matchedPort = null;
11409
- matchedNet = null;
11410
- isPcbPrimitive = true;
11459
+ constructor() {
11460
+ super(...arguments);
11461
+ __publicField(this, "pcb_breakout_point_id", null);
11462
+ __publicField(this, "matchedPort", null);
11463
+ __publicField(this, "matchedNet", null);
11464
+ __publicField(this, "isPcbPrimitive", true);
11465
+ }
11411
11466
  get config() {
11412
11467
  return {
11413
11468
  componentName: "BreakoutPoint",
@@ -11487,7 +11542,10 @@ import {
11487
11542
  translate as translate6
11488
11543
  } from "transformation-matrix";
11489
11544
  var NetLabel = class extends PrimitiveComponent2 {
11490
- source_net_label_id;
11545
+ constructor() {
11546
+ super(...arguments);
11547
+ __publicField(this, "source_net_label_id");
11548
+ }
11491
11549
  get config() {
11492
11550
  return {
11493
11551
  componentName: "NetLabel",
@@ -11603,8 +11661,11 @@ var NetLabel = class extends PrimitiveComponent2 {
11603
11661
  // lib/components/primitive-components/SilkscreenCircle.ts
11604
11662
  import { silkscreenCircleProps } from "@tscircuit/props";
11605
11663
  var SilkscreenCircle = class extends PrimitiveComponent2 {
11606
- pcb_silkscreen_circle_id = null;
11607
- isPcbPrimitive = true;
11664
+ constructor() {
11665
+ super(...arguments);
11666
+ __publicField(this, "pcb_silkscreen_circle_id", null);
11667
+ __publicField(this, "isPcbPrimitive", true);
11668
+ }
11608
11669
  get config() {
11609
11670
  return {
11610
11671
  componentName: "SilkscreenCircle",
@@ -11649,8 +11710,11 @@ var SilkscreenCircle = class extends PrimitiveComponent2 {
11649
11710
  // lib/components/primitive-components/SilkscreenRect.ts
11650
11711
  import { silkscreenRectProps } from "@tscircuit/props";
11651
11712
  var SilkscreenRect = class extends PrimitiveComponent2 {
11652
- pcb_silkscreen_rect_id = null;
11653
- isPcbPrimitive = true;
11713
+ constructor() {
11714
+ super(...arguments);
11715
+ __publicField(this, "pcb_silkscreen_rect_id", null);
11716
+ __publicField(this, "isPcbPrimitive", true);
11717
+ }
11654
11718
  get config() {
11655
11719
  return {
11656
11720
  componentName: "SilkscreenRect",
@@ -11694,8 +11758,11 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
11694
11758
  // lib/components/primitive-components/SilkscreenLine.ts
11695
11759
  import { silkscreenLineProps } from "@tscircuit/props";
11696
11760
  var SilkscreenLine = class extends PrimitiveComponent2 {
11697
- pcb_silkscreen_line_id = null;
11698
- isPcbPrimitive = true;
11761
+ constructor() {
11762
+ super(...arguments);
11763
+ __publicField(this, "pcb_silkscreen_line_id", null);
11764
+ __publicField(this, "isPcbPrimitive", true);
11765
+ }
11699
11766
  get config() {
11700
11767
  return {
11701
11768
  componentName: "SilkscreenLine",
@@ -11739,9 +11806,12 @@ var SilkscreenLine = class extends PrimitiveComponent2 {
11739
11806
  // lib/components/primitive-components/Via.ts
11740
11807
  import { viaProps } from "@tscircuit/props";
11741
11808
  var Via = class extends PrimitiveComponent2 {
11742
- pcb_via_id = null;
11743
- matchedPort = null;
11744
- isPcbPrimitive = true;
11809
+ constructor() {
11810
+ super(...arguments);
11811
+ __publicField(this, "pcb_via_id", null);
11812
+ __publicField(this, "matchedPort", null);
11813
+ __publicField(this, "isPcbPrimitive", true);
11814
+ }
11745
11815
  get config() {
11746
11816
  return {
11747
11817
  componentName: "Via",
@@ -12163,6 +12233,12 @@ var Crystal = class extends NormalComponent {
12163
12233
  // lib/components/normal-components/Transistor.ts
12164
12234
  import { transistorProps } from "@tscircuit/props";
12165
12235
  var Transistor = class extends NormalComponent {
12236
+ constructor() {
12237
+ super(...arguments);
12238
+ __publicField(this, "emitter", this.portMap.pin1);
12239
+ __publicField(this, "collector", this.portMap.pin2);
12240
+ __publicField(this, "base", this.portMap.pin3);
12241
+ }
12166
12242
  get config() {
12167
12243
  const baseSymbolName = this.props.type === "npn" ? "npn_bipolar_transistor" : "pnp_bipolar_transistor";
12168
12244
  return {
@@ -12188,9 +12264,6 @@ var Transistor = class extends NormalComponent {
12188
12264
  additionalAliases: pinAliases
12189
12265
  });
12190
12266
  }
12191
- emitter = this.portMap.pin1;
12192
- collector = this.portMap.pin2;
12193
- base = this.portMap.pin3;
12194
12267
  doInitialCreateNetsFromProps() {
12195
12268
  this._createNetsFromProps([...this._getNetsFromConnectionsProp()]);
12196
12269
  }
@@ -12306,17 +12379,17 @@ var TestPoint = class extends NormalComponent {
12306
12379
  if (!footprintVariant && holeDiameter) {
12307
12380
  footprintVariant = "through_hole";
12308
12381
  }
12309
- footprintVariant ??= "through_hole";
12310
- padShape ??= "circle";
12382
+ footprintVariant ?? (footprintVariant = "through_hole");
12383
+ padShape ?? (padShape = "circle");
12311
12384
  if (footprintVariant === "pad") {
12312
12385
  if (padShape === "circle") {
12313
- padDiameter ??= TESTPOINT_DEFAULTS.SMT_CIRCLE_DIAMETER;
12386
+ padDiameter ?? (padDiameter = TESTPOINT_DEFAULTS.SMT_CIRCLE_DIAMETER);
12314
12387
  } else if (padShape === "rect") {
12315
- width ??= TESTPOINT_DEFAULTS.SMT_RECT_SIZE;
12316
- height ??= width;
12388
+ width ?? (width = TESTPOINT_DEFAULTS.SMT_RECT_SIZE);
12389
+ height ?? (height = width);
12317
12390
  }
12318
12391
  } else if (footprintVariant === "through_hole") {
12319
- holeDiameter ??= TESTPOINT_DEFAULTS.HOLE_DIAMETER;
12392
+ holeDiameter ?? (holeDiameter = TESTPOINT_DEFAULTS.HOLE_DIAMETER);
12320
12393
  }
12321
12394
  return {
12322
12395
  padShape,
@@ -12381,7 +12454,10 @@ var TestPoint = class extends NormalComponent {
12381
12454
  // lib/components/primitive-components/SchematicText.ts
12382
12455
  import { schematicTextProps } from "@tscircuit/props";
12383
12456
  var SchematicText = class extends PrimitiveComponent2 {
12384
- isSchematicPrimitive = true;
12457
+ constructor() {
12458
+ super(...arguments);
12459
+ __publicField(this, "isSchematicPrimitive", true);
12460
+ }
12385
12461
  get config() {
12386
12462
  return {
12387
12463
  componentName: "SchematicText",
@@ -12485,7 +12561,10 @@ function getTitleAnchorAndPosition({
12485
12561
 
12486
12562
  // lib/components/primitive-components/SchematicBox.ts
12487
12563
  var SchematicBox = class extends PrimitiveComponent2 {
12488
- isSchematicPrimitive = true;
12564
+ constructor() {
12565
+ super(...arguments);
12566
+ __publicField(this, "isSchematicPrimitive", true);
12567
+ }
12489
12568
  get config() {
12490
12569
  return {
12491
12570
  componentName: "SchematicBox",
@@ -12606,8 +12685,11 @@ var SchematicBox = class extends PrimitiveComponent2 {
12606
12685
  // lib/components/primitive-components/SchematicTable.ts
12607
12686
  import { schematicTableProps } from "@tscircuit/props";
12608
12687
  var SchematicTable = class extends PrimitiveComponent2 {
12609
- isSchematicPrimitive = true;
12610
- schematic_table_id = null;
12688
+ constructor() {
12689
+ super(...arguments);
12690
+ __publicField(this, "isSchematicPrimitive", true);
12691
+ __publicField(this, "schematic_table_id", null);
12692
+ }
12611
12693
  get config() {
12612
12694
  return {
12613
12695
  componentName: "SchematicTable",
@@ -12735,7 +12817,10 @@ var SchematicTable = class extends PrimitiveComponent2 {
12735
12817
  // lib/components/primitive-components/SchematicRow.ts
12736
12818
  import { schematicRowProps } from "@tscircuit/props";
12737
12819
  var SchematicRow = class extends PrimitiveComponent2 {
12738
- isSchematicPrimitive = true;
12820
+ constructor() {
12821
+ super(...arguments);
12822
+ __publicField(this, "isSchematicPrimitive", true);
12823
+ }
12739
12824
  get config() {
12740
12825
  return {
12741
12826
  componentName: "SchematicRow",
@@ -12747,8 +12832,11 @@ var SchematicRow = class extends PrimitiveComponent2 {
12747
12832
  // lib/components/primitive-components/SchematicCell.ts
12748
12833
  import { schematicCellProps } from "@tscircuit/props";
12749
12834
  var SchematicCell = class extends PrimitiveComponent2 {
12750
- isSchematicPrimitive = true;
12751
- canHaveTextChildren = true;
12835
+ constructor() {
12836
+ super(...arguments);
12837
+ __publicField(this, "isSchematicPrimitive", true);
12838
+ __publicField(this, "canHaveTextChildren", true);
12839
+ }
12752
12840
  get config() {
12753
12841
  return {
12754
12842
  componentName: "SchematicCell",
@@ -12766,7 +12854,7 @@ import { identity as identity5 } from "transformation-matrix";
12766
12854
  var package_default = {
12767
12855
  name: "@tscircuit/core",
12768
12856
  type: "module",
12769
- version: "0.0.641",
12857
+ version: "0.0.643",
12770
12858
  types: "dist/index.d.ts",
12771
12859
  main: "dist/index.js",
12772
12860
  module: "dist/index.js",
@@ -12866,7 +12954,6 @@ var package_default = {
12866
12954
  nanoid: "^5.0.7",
12867
12955
  "performance-now": "^2.1.0",
12868
12956
  "react-reconciler": "^0.32.0",
12869
- "react-reconciler-18": "npm:react-reconciler@0.29.2",
12870
12957
  "transformation-matrix": "^2.16.1",
12871
12958
  zod: "^3.25.67"
12872
12959
  }
@@ -12874,32 +12961,33 @@ var package_default = {
12874
12961
 
12875
12962
  // lib/RootCircuit.ts
12876
12963
  var RootCircuit = class {
12877
- firstChild = null;
12878
- children;
12879
- db;
12880
- root = null;
12881
- isRoot = true;
12882
- schematicDisabled = false;
12883
- pcbDisabled = false;
12884
- pcbRoutingDisabled = false;
12885
- /**
12886
- * The RootCircuit name is usually set by the platform, it's not required but
12887
- * if supplied can identify the circuit in certain effects, e.g. it is passed
12888
- * as the display_name parameter for autorouting effects.
12889
- */
12890
- name;
12891
- platform;
12892
- /**
12893
- * Optional URL pointing to where this project is hosted or documented.
12894
- * When provided it is stored in the source_project_metadata.project_url field
12895
- * of the generated Circuit JSON.
12896
- */
12897
- projectUrl;
12898
- _hasRenderedAtleastOnce = false;
12899
12964
  constructor({
12900
12965
  platform,
12901
12966
  projectUrl
12902
12967
  } = {}) {
12968
+ __publicField(this, "firstChild", null);
12969
+ __publicField(this, "children");
12970
+ __publicField(this, "db");
12971
+ __publicField(this, "root", null);
12972
+ __publicField(this, "isRoot", true);
12973
+ __publicField(this, "schematicDisabled", false);
12974
+ __publicField(this, "pcbDisabled", false);
12975
+ __publicField(this, "pcbRoutingDisabled", false);
12976
+ /**
12977
+ * The RootCircuit name is usually set by the platform, it's not required but
12978
+ * if supplied can identify the circuit in certain effects, e.g. it is passed
12979
+ * as the display_name parameter for autorouting effects.
12980
+ */
12981
+ __publicField(this, "name");
12982
+ __publicField(this, "platform");
12983
+ /**
12984
+ * Optional URL pointing to where this project is hosted or documented.
12985
+ * When provided it is stored in the source_project_metadata.project_url field
12986
+ * of the generated Circuit JSON.
12987
+ */
12988
+ __publicField(this, "projectUrl");
12989
+ __publicField(this, "_hasRenderedAtleastOnce", false);
12990
+ __publicField(this, "_eventListeners", {});
12903
12991
  this.children = [];
12904
12992
  this.db = su5([]);
12905
12993
  this.root = this;
@@ -13021,7 +13109,6 @@ var RootCircuit = class {
13021
13109
  this._guessRootComponent();
13022
13110
  return this.firstChild?.selectOne(selector, opts) ?? null;
13023
13111
  }
13024
- _eventListeners = {};
13025
13112
  emit(event, ...args) {
13026
13113
  if (!this._eventListeners[event]) return;
13027
13114
  for (const listener of this._eventListeners[event]) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.642",
4
+ "version": "0.0.644",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -101,7 +101,6 @@
101
101
  "nanoid": "^5.0.7",
102
102
  "performance-now": "^2.1.0",
103
103
  "react-reconciler": "^0.32.0",
104
- "react-reconciler-18": "npm:react-reconciler@0.29.2",
105
104
  "transformation-matrix": "^2.16.1",
106
105
  "zod": "^3.25.67"
107
106
  }