@tscircuit/core 0.0.664 → 0.0.666
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 +21 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6999,8 +6999,9 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
6999
6999
|
const { db } = this.root;
|
|
7000
7000
|
const { boardThickness = 0 } = this.root?._getBoard() ?? {};
|
|
7001
7001
|
const cadModel = this._parsedProps.cadModel;
|
|
7002
|
+
const footprint = this.props.footprint ?? this._getImpliedFootprintString();
|
|
7002
7003
|
if (!this.pcb_component_id) return;
|
|
7003
|
-
if (!cadModel && !
|
|
7004
|
+
if (!cadModel && !footprint) return;
|
|
7004
7005
|
if (cadModel === null) return;
|
|
7005
7006
|
const bounds = this._getPcbCircuitJsonBounds();
|
|
7006
7007
|
const pcb_component = db.pcb_component.get(this.pcb_component_id);
|
|
@@ -7037,7 +7038,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
7037
7038
|
model_stl_url: "stlUrl" in (cadModel ?? {}) ? this._addCachebustToModelUrl(cadModel.stlUrl) : void 0,
|
|
7038
7039
|
model_obj_url: "objUrl" in (cadModel ?? {}) ? this._addCachebustToModelUrl(cadModel.objUrl) : void 0,
|
|
7039
7040
|
model_jscad: "jscad" in (cadModel ?? {}) ? cadModel.jscad : void 0,
|
|
7040
|
-
footprinter_string: typeof
|
|
7041
|
+
footprinter_string: typeof footprint === "string" && !cadModel ? footprint : void 0
|
|
7041
7042
|
});
|
|
7042
7043
|
}
|
|
7043
7044
|
_addCachebustToModelUrl(url) {
|
|
@@ -10949,6 +10950,23 @@ var Group6 = class extends NormalComponent {
|
|
|
10949
10950
|
if (props.matchAdapt) return "match-adapt";
|
|
10950
10951
|
if (props.flex) return "flex";
|
|
10951
10952
|
if (props.grid) return "grid";
|
|
10953
|
+
const groupHasCoords = props.pcbX !== void 0 || props.pcbY !== void 0;
|
|
10954
|
+
const hasManualEdits = (props.manualEdits?.pcb_placements?.length ?? 0) > 0;
|
|
10955
|
+
const anyDirectChildHasPcbCoords = this.children.some((child) => {
|
|
10956
|
+
const childProps = child._parsedProps;
|
|
10957
|
+
return childProps?.pcbX !== void 0 || childProps?.pcbY !== void 0;
|
|
10958
|
+
});
|
|
10959
|
+
if (anyDirectChildHasPcbCoords) return "none";
|
|
10960
|
+
const unpositionedDirectChildrenCount = this.children.reduce(
|
|
10961
|
+
(count, child) => {
|
|
10962
|
+
const childProps = child._parsedProps;
|
|
10963
|
+
const hasCoords = childProps?.pcbX !== void 0 || childProps?.pcbY !== void 0;
|
|
10964
|
+
return count + (hasCoords ? 0 : 1);
|
|
10965
|
+
},
|
|
10966
|
+
0
|
|
10967
|
+
);
|
|
10968
|
+
if (!groupHasCoords && !hasManualEdits && unpositionedDirectChildrenCount > 1)
|
|
10969
|
+
return "pack";
|
|
10952
10970
|
return "none";
|
|
10953
10971
|
}
|
|
10954
10972
|
doInitialPcbLayout() {
|
|
@@ -13830,7 +13848,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
13830
13848
|
var package_default = {
|
|
13831
13849
|
name: "@tscircuit/core",
|
|
13832
13850
|
type: "module",
|
|
13833
|
-
version: "0.0.
|
|
13851
|
+
version: "0.0.665",
|
|
13834
13852
|
types: "dist/index.d.ts",
|
|
13835
13853
|
main: "dist/index.js",
|
|
13836
13854
|
module: "dist/index.js",
|