@tscircuit/core 0.0.1077 → 0.0.1079
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 +18 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1712,6 +1712,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1712
1712
|
doInitialOptimizeSelectorCache() {
|
|
1713
1713
|
if (!this.isSubcircuit) return;
|
|
1714
1714
|
const ports = this.selectAll("port");
|
|
1715
|
+
const isValidShorthandName = (name) => /^[A-Za-z_][A-Za-z0-9_-]*$/.test(name);
|
|
1715
1716
|
for (const port of ports) {
|
|
1716
1717
|
const parentComponent = port.getParentNormalComponent?.() ?? port.parent;
|
|
1717
1718
|
const parentAliases = parentComponent?.getNameAndAliases();
|
|
@@ -1723,6 +1724,9 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1723
1724
|
`.${parentAlias} > .${portAlias}`,
|
|
1724
1725
|
`.${parentAlias} .${portAlias}`
|
|
1725
1726
|
];
|
|
1727
|
+
if (isValidShorthandName(parentAlias) && isValidShorthandName(portAlias)) {
|
|
1728
|
+
selectors.push(`${parentAlias}.${portAlias}`);
|
|
1729
|
+
}
|
|
1726
1730
|
for (const selector of selectors) {
|
|
1727
1731
|
const ar = this._cachedSelectAllQueries.get(selector);
|
|
1728
1732
|
if (ar) {
|
|
@@ -10366,7 +10370,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
10366
10370
|
);
|
|
10367
10371
|
if (!footprint && !hasFootprintChild && !this.isGroup) {
|
|
10368
10372
|
const footprint_error = db.pcb_missing_footprint_error.insert({
|
|
10369
|
-
message: `No footprint
|
|
10373
|
+
message: `No footprint specified for component: ${this.getString()}`,
|
|
10370
10374
|
source_component_id: `${this.source_component_id}`,
|
|
10371
10375
|
error_type: "pcb_missing_footprint_error"
|
|
10372
10376
|
});
|
|
@@ -11408,6 +11412,18 @@ var Chip = class extends NormalComponent3 {
|
|
|
11408
11412
|
const { db } = this.root;
|
|
11409
11413
|
const { _parsedProps: props } = this;
|
|
11410
11414
|
const { pcbX, pcbY } = this.getResolvedPcbPositionProp();
|
|
11415
|
+
const footprint = props.footprint ?? this._getImpliedFootprintString();
|
|
11416
|
+
const hasFootprintChild = this.children.some(
|
|
11417
|
+
(c) => c.componentName === "Footprint"
|
|
11418
|
+
);
|
|
11419
|
+
if (!footprint && !hasFootprintChild) {
|
|
11420
|
+
const footprint_error = db.pcb_missing_footprint_error.insert({
|
|
11421
|
+
message: `No footprint specified for component: ${this.getString()}`,
|
|
11422
|
+
source_component_id: `${this.source_component_id}`,
|
|
11423
|
+
error_type: "pcb_missing_footprint_error"
|
|
11424
|
+
});
|
|
11425
|
+
this.pcb_missing_footprint_error_id = footprint_error.pcb_missing_footprint_error_id;
|
|
11426
|
+
}
|
|
11411
11427
|
const componentLayer = props.layer ?? "top";
|
|
11412
11428
|
if (componentLayer !== "top" && componentLayer !== "bottom") {
|
|
11413
11429
|
const subcircuit = this.getSubcircuit();
|
|
@@ -18102,7 +18118,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
18102
18118
|
var package_default = {
|
|
18103
18119
|
name: "@tscircuit/core",
|
|
18104
18120
|
type: "module",
|
|
18105
|
-
version: "0.0.
|
|
18121
|
+
version: "0.0.1078",
|
|
18106
18122
|
types: "dist/index.d.ts",
|
|
18107
18123
|
main: "dist/index.js",
|
|
18108
18124
|
module: "dist/index.js",
|