@tscircuit/core 0.0.1020 → 0.0.1022

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.d.ts CHANGED
@@ -1544,6 +1544,12 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
1544
1544
  get portMap(): PortMap<PortNames>;
1545
1545
  getInstanceForReactElement(element: ReactElement): NormalComponent | null;
1546
1546
  doInitialSourceRender(): void;
1547
+ /**
1548
+ * After ports have their source_port_id assigned, create
1549
+ * source_component_internal_connection records so that the connectivity
1550
+ * map (and therefore DRC) knows which pins are internally connected.
1551
+ */
1552
+ doInitialSourceParentAttachment(): void;
1547
1553
  /**
1548
1554
  * Render the schematic component for this NormalComponent using the
1549
1555
  * config.schematicSymbolName if it exists, or create a generic box if
package/dist/index.js CHANGED
@@ -9137,6 +9137,25 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
9137
9137
  });
9138
9138
  this.source_component_id = source_component.source_component_id;
9139
9139
  }
9140
+ /**
9141
+ * After ports have their source_port_id assigned, create
9142
+ * source_component_internal_connection records so that the connectivity
9143
+ * map (and therefore DRC) knows which pins are internally connected.
9144
+ */
9145
+ doInitialSourceParentAttachment() {
9146
+ const { db } = this.root;
9147
+ const internallyConnectedPorts = this._getInternallyConnectedPins();
9148
+ for (const ports of internallyConnectedPorts) {
9149
+ const sourcePortIds = ports.map((port) => port.source_port_id).filter((id) => id !== null);
9150
+ if (sourcePortIds.length >= 2) {
9151
+ db.source_component_internal_connection.insert({
9152
+ source_component_id: this.source_component_id,
9153
+ subcircuit_id: this.getSubcircuit()?.subcircuit_id,
9154
+ source_port_ids: sourcePortIds
9155
+ });
9156
+ }
9157
+ }
9158
+ }
9140
9159
  /**
9141
9160
  * Render the schematic component for this NormalComponent using the
9142
9161
  * config.schematicSymbolName if it exists, or create a generic box if
@@ -15792,7 +15811,6 @@ var Chip = class extends NormalComponent3 {
15792
15811
  initPorts(opts = {}) {
15793
15812
  super.initPorts(opts);
15794
15813
  const { _parsedProps: props } = this;
15795
- const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
15796
15814
  if (props.externallyConnectedPins) {
15797
15815
  const requiredPorts = /* @__PURE__ */ new Set();
15798
15816
  for (const [pin1, pin2] of props.externallyConnectedPins) {
@@ -15833,7 +15851,6 @@ var Chip = class extends NormalComponent3 {
15833
15851
  doInitialSourceRender() {
15834
15852
  const { db } = this.root;
15835
15853
  const { _parsedProps: props } = this;
15836
- const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
15837
15854
  const source_component = db.source_component.insert({
15838
15855
  ftype: "simple_chip",
15839
15856
  name: this.name,
@@ -22249,7 +22266,7 @@ import { identity as identity5 } from "transformation-matrix";
22249
22266
  var package_default = {
22250
22267
  name: "@tscircuit/core",
22251
22268
  type: "module",
22252
- version: "0.0.1019",
22269
+ version: "0.0.1021",
22253
22270
  types: "dist/index.d.ts",
22254
22271
  main: "dist/index.js",
22255
22272
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1020",
4
+ "version": "0.0.1022",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",