@tscircuit/core 0.0.607 → 0.0.608
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 +1 -0
- package/dist/index.js +37 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3447,6 +3447,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
|
|
|
3447
3447
|
}>;
|
|
3448
3448
|
shouldRenderAsSchematicBox: boolean;
|
|
3449
3449
|
};
|
|
3450
|
+
initPorts(opts?: {}): void;
|
|
3450
3451
|
doInitialSchematicComponentRender(): void;
|
|
3451
3452
|
doInitialSourceRender(): void;
|
|
3452
3453
|
doInitialPcbComponentRender(): void;
|
package/dist/index.js
CHANGED
|
@@ -5081,7 +5081,7 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
|
|
|
5081
5081
|
pointsToConnect: []
|
|
5082
5082
|
};
|
|
5083
5083
|
const obstacles = getSchematicObstaclesForTrace(trace);
|
|
5084
|
-
const portsWithPosition = connectedPorts.map(({ port }) => ({
|
|
5084
|
+
const portsWithPosition = connectedPorts.filter(({ port }) => port.schematic_port_id !== null).map(({ port }) => ({
|
|
5085
5085
|
port,
|
|
5086
5086
|
position: port._getGlobalSchematicPositionAfterLayout(),
|
|
5087
5087
|
schematic_port_id: port.schematic_port_id ?? void 0,
|
|
@@ -9447,6 +9447,41 @@ var Chip = class extends NormalComponent {
|
|
|
9447
9447
|
shouldRenderAsSchematicBox: true
|
|
9448
9448
|
};
|
|
9449
9449
|
}
|
|
9450
|
+
initPorts(opts = {}) {
|
|
9451
|
+
super.initPorts(opts);
|
|
9452
|
+
const { _parsedProps: props } = this;
|
|
9453
|
+
if (props.externallyConnectedPins) {
|
|
9454
|
+
const requiredPorts = /* @__PURE__ */ new Set();
|
|
9455
|
+
for (const [pin1, pin2] of props.externallyConnectedPins) {
|
|
9456
|
+
requiredPorts.add(pin1);
|
|
9457
|
+
requiredPorts.add(pin2);
|
|
9458
|
+
}
|
|
9459
|
+
for (const pinIdentifier of requiredPorts) {
|
|
9460
|
+
const existingPort = this.children.find(
|
|
9461
|
+
(child) => child instanceof Port && child.isMatchingAnyOf([pinIdentifier])
|
|
9462
|
+
);
|
|
9463
|
+
if (!existingPort) {
|
|
9464
|
+
const pinMatch = pinIdentifier.match(/^pin(\d+)$/);
|
|
9465
|
+
if (pinMatch) {
|
|
9466
|
+
const pinNumber = parseInt(pinMatch[1]);
|
|
9467
|
+
this.add(
|
|
9468
|
+
new Port({
|
|
9469
|
+
pinNumber,
|
|
9470
|
+
aliases: [pinIdentifier]
|
|
9471
|
+
})
|
|
9472
|
+
);
|
|
9473
|
+
} else {
|
|
9474
|
+
this.add(
|
|
9475
|
+
new Port({
|
|
9476
|
+
name: pinIdentifier,
|
|
9477
|
+
aliases: [pinIdentifier]
|
|
9478
|
+
})
|
|
9479
|
+
);
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
}
|
|
9483
|
+
}
|
|
9484
|
+
}
|
|
9450
9485
|
doInitialSchematicComponentRender() {
|
|
9451
9486
|
const { _parsedProps: props } = this;
|
|
9452
9487
|
if (props?.noSchematicRepresentation === true) return;
|
|
@@ -11504,7 +11539,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
11504
11539
|
var package_default = {
|
|
11505
11540
|
name: "@tscircuit/core",
|
|
11506
11541
|
type: "module",
|
|
11507
|
-
version: "0.0.
|
|
11542
|
+
version: "0.0.607",
|
|
11508
11543
|
types: "dist/index.d.ts",
|
|
11509
11544
|
main: "dist/index.js",
|
|
11510
11545
|
module: "dist/index.js",
|