@tscircuit/core 0.0.1160 → 0.0.1161
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 +56 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10524,6 +10524,39 @@ var shouldCheckPortForMissingTrace = (component, port) => {
|
|
|
10524
10524
|
return true;
|
|
10525
10525
|
};
|
|
10526
10526
|
|
|
10527
|
+
// lib/components/base-components/NormalComponent/utils/getLogicalPortsFromPortHintGroups.ts
|
|
10528
|
+
function getLogicalPortsFromPortHintGroups(portHintGroups, opts) {
|
|
10529
|
+
let implicitPinNumber = 1;
|
|
10530
|
+
const portsByPinNumber = /* @__PURE__ */ new Map();
|
|
10531
|
+
for (const portHintGroup of portHintGroups) {
|
|
10532
|
+
const filteredPortHints = portHintGroup.hints.filter(
|
|
10533
|
+
(hint) => hint && hint.trim() !== ""
|
|
10534
|
+
);
|
|
10535
|
+
if (filteredPortHints.length === 0) continue;
|
|
10536
|
+
let portHintsList = filteredPortHints;
|
|
10537
|
+
const hasPinIdentifier = portHintsList.some(
|
|
10538
|
+
(hint) => hint.startsWith("pin") || /^(?:pin)?\d+$/.test(hint)
|
|
10539
|
+
);
|
|
10540
|
+
if (!hasPinIdentifier) {
|
|
10541
|
+
portHintsList = [...portHintsList, `pin${implicitPinNumber}`];
|
|
10542
|
+
}
|
|
10543
|
+
implicitPinNumber++;
|
|
10544
|
+
const newPort = getPortFromHints(portHintsList, opts);
|
|
10545
|
+
if (!newPort) continue;
|
|
10546
|
+
newPort.originDescription = portHintGroup.originDescription;
|
|
10547
|
+
const pinNumber = newPort._parsedProps.pinNumber;
|
|
10548
|
+
if (pinNumber === void 0) continue;
|
|
10549
|
+
const existingPort = portsByPinNumber.get(pinNumber);
|
|
10550
|
+
if (!existingPort) {
|
|
10551
|
+
portsByPinNumber.set(pinNumber, newPort);
|
|
10552
|
+
continue;
|
|
10553
|
+
}
|
|
10554
|
+
const mergedAliases = newPort.getNameAndAliases().filter((alias) => !existingPort.getNameAndAliases().includes(alias));
|
|
10555
|
+
existingPort.externallyAddedAliases.push(...mergedAliases);
|
|
10556
|
+
}
|
|
10557
|
+
return Array.from(portsByPinNumber.values());
|
|
10558
|
+
}
|
|
10559
|
+
|
|
10527
10560
|
// lib/components/base-components/NormalComponent/NormalComponent.ts
|
|
10528
10561
|
var debug3 = Debug5("tscircuit:core");
|
|
10529
10562
|
var rotation32 = z9.object({
|
|
@@ -11372,41 +11405,31 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
11372
11405
|
this._queueInvalidFootprintPropMessage(footprint, error);
|
|
11373
11406
|
return [];
|
|
11374
11407
|
}
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11408
|
+
return getLogicalPortsFromPortHintGroups(
|
|
11409
|
+
fpCircuitJson.flatMap(
|
|
11410
|
+
(elm) => "port_hints" in elm && elm.port_hints ? [
|
|
11411
|
+
{
|
|
11412
|
+
hints: elm.port_hints,
|
|
11413
|
+
originDescription: `footprint:string:${footprint}:port_hints[0]:${elm.port_hints[0]}`
|
|
11414
|
+
}
|
|
11415
|
+
] : []
|
|
11416
|
+
),
|
|
11417
|
+
opts
|
|
11418
|
+
);
|
|
11385
11419
|
}
|
|
11386
11420
|
if (!isValidElement(footprint) && footprint && footprint.componentName === "Footprint") {
|
|
11387
11421
|
const fp2 = footprint;
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
);
|
|
11400
|
-
if (!hasPinIdentifier) {
|
|
11401
|
-
portHintsList = [...portHintsList, `pin${pinNumber}`];
|
|
11402
|
-
}
|
|
11403
|
-
pinNumber++;
|
|
11404
|
-
const newPort = getPortFromHints(portHintsList);
|
|
11405
|
-
if (!newPort) continue;
|
|
11406
|
-
newPort.originDescription = `footprint:${footprint}`;
|
|
11407
|
-
newPorts2.push(newPort);
|
|
11408
|
-
}
|
|
11409
|
-
return newPorts2;
|
|
11422
|
+
return getLogicalPortsFromPortHintGroups(
|
|
11423
|
+
fp2.children.flatMap(
|
|
11424
|
+
(fpChild) => fpChild.props.portHints ? [
|
|
11425
|
+
{
|
|
11426
|
+
hints: fpChild.props.portHints,
|
|
11427
|
+
originDescription: `footprint:${footprint}`
|
|
11428
|
+
}
|
|
11429
|
+
] : []
|
|
11430
|
+
),
|
|
11431
|
+
opts
|
|
11432
|
+
);
|
|
11410
11433
|
}
|
|
11411
11434
|
const newPorts = [];
|
|
11412
11435
|
if (!footprint) {
|
|
@@ -19322,7 +19345,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19322
19345
|
var package_default = {
|
|
19323
19346
|
name: "@tscircuit/core",
|
|
19324
19347
|
type: "module",
|
|
19325
|
-
version: "0.0.
|
|
19348
|
+
version: "0.0.1160",
|
|
19326
19349
|
types: "dist/index.d.ts",
|
|
19327
19350
|
main: "dist/index.js",
|
|
19328
19351
|
module: "dist/index.js",
|