@tscircuit/core 0.0.577 → 0.0.578
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 +40 -1
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1082,6 +1082,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
|
|
|
1082
1082
|
doInitialPcbLayout(): void;
|
|
1083
1083
|
_doInitialPcbLayoutGrid(): void;
|
|
1084
1084
|
_doInitialPcbLayoutPack(): void;
|
|
1085
|
+
_doInitialPcbLayoutFlex(): void;
|
|
1085
1086
|
_insertSchematicBorder(): void;
|
|
1086
1087
|
_determineSideFromPosition(port: SchematicPort, component: SchematicComponent): "left" | "right" | "top" | "bottom";
|
|
1087
1088
|
_calculateSchematicBounds(boxes: Array<{
|
package/dist/index.js
CHANGED
|
@@ -8085,6 +8085,38 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
8085
8085
|
}
|
|
8086
8086
|
};
|
|
8087
8087
|
|
|
8088
|
+
// lib/components/primitive-components/Group/Group_doInitialPcbLayoutFlex.ts
|
|
8089
|
+
import { buildSubtree as buildSubtree3 } from "@tscircuit/circuit-json-util";
|
|
8090
|
+
import { layoutCircuitJsonWithFlex } from "@tscircuit/circuit-json-flex";
|
|
8091
|
+
var Group_doInitialPcbLayoutFlex = (group) => {
|
|
8092
|
+
const { db } = group.root;
|
|
8093
|
+
const subtreeCircuitJson = buildSubtree3(db.toArray(), {
|
|
8094
|
+
source_group_id: group.source_group_id
|
|
8095
|
+
});
|
|
8096
|
+
const modifiedCircuitJson = layoutCircuitJsonWithFlex(subtreeCircuitJson, {
|
|
8097
|
+
justifyContent: "space-between"
|
|
8098
|
+
});
|
|
8099
|
+
const pcbSmtPads = db.pcb_smtpad.list();
|
|
8100
|
+
for (const smtpad of pcbSmtPads) {
|
|
8101
|
+
const modifiedElm = modifiedCircuitJson.find(
|
|
8102
|
+
(elm) => elm.type === "pcb_smtpad" && elm.pcb_smtpad_id === smtpad.pcb_smtpad_id
|
|
8103
|
+
);
|
|
8104
|
+
if (!modifiedElm) continue;
|
|
8105
|
+
db.pcb_smtpad.update(smtpad.pcb_smtpad_id, modifiedElm);
|
|
8106
|
+
}
|
|
8107
|
+
const pcbSilkScreenTexts = db.pcb_silkscreen_text.list();
|
|
8108
|
+
for (const silkscreenText of pcbSilkScreenTexts) {
|
|
8109
|
+
const modifiedElm = modifiedCircuitJson.find(
|
|
8110
|
+
(elm) => elm.type === "pcb_silkscreen_text" && elm.pcb_silkscreen_text_id === silkscreenText.pcb_silkscreen_text_id
|
|
8111
|
+
);
|
|
8112
|
+
if (!modifiedElm) continue;
|
|
8113
|
+
db.pcb_silkscreen_text.update(
|
|
8114
|
+
silkscreenText.pcb_silkscreen_text_id,
|
|
8115
|
+
modifiedElm
|
|
8116
|
+
);
|
|
8117
|
+
}
|
|
8118
|
+
};
|
|
8119
|
+
|
|
8088
8120
|
// lib/components/primitive-components/Group/Group.ts
|
|
8089
8121
|
var Group = class extends NormalComponent {
|
|
8090
8122
|
pcb_group_id = null;
|
|
@@ -8619,6 +8651,8 @@ var Group = class extends NormalComponent {
|
|
|
8619
8651
|
this._doInitialPcbLayoutGrid();
|
|
8620
8652
|
} else if (pcbLayoutMode === "pack") {
|
|
8621
8653
|
this._doInitialPcbLayoutPack();
|
|
8654
|
+
} else if (pcbLayoutMode === "flex") {
|
|
8655
|
+
this._doInitialPcbLayoutFlex();
|
|
8622
8656
|
}
|
|
8623
8657
|
}
|
|
8624
8658
|
_doInitialPcbLayoutGrid() {
|
|
@@ -8627,6 +8661,9 @@ var Group = class extends NormalComponent {
|
|
|
8627
8661
|
_doInitialPcbLayoutPack() {
|
|
8628
8662
|
Group_doInitialPcbLayoutPack(this);
|
|
8629
8663
|
}
|
|
8664
|
+
_doInitialPcbLayoutFlex() {
|
|
8665
|
+
Group_doInitialPcbLayoutFlex(this);
|
|
8666
|
+
}
|
|
8630
8667
|
_insertSchematicBorder() {
|
|
8631
8668
|
if (this.root?.schematicDisabled) return;
|
|
8632
8669
|
const { db } = this.root;
|
|
@@ -11065,7 +11102,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
11065
11102
|
var package_default = {
|
|
11066
11103
|
name: "@tscircuit/core",
|
|
11067
11104
|
type: "module",
|
|
11068
|
-
version: "0.0.
|
|
11105
|
+
version: "0.0.577",
|
|
11069
11106
|
types: "dist/index.d.ts",
|
|
11070
11107
|
main: "dist/index.js",
|
|
11071
11108
|
module: "dist/index.js",
|
|
@@ -11090,6 +11127,7 @@ var package_default = {
|
|
|
11090
11127
|
"@biomejs/biome": "^1.8.3",
|
|
11091
11128
|
"@tscircuit/capacity-autorouter": "^0.0.93",
|
|
11092
11129
|
"@tscircuit/checks": "^0.0.56",
|
|
11130
|
+
"@tscircuit/circuit-json-flex": "^0.0.1",
|
|
11093
11131
|
"@tscircuit/circuit-json-util": "^0.0.51",
|
|
11094
11132
|
"@tscircuit/footprinter": "^0.0.204",
|
|
11095
11133
|
"@tscircuit/import-snippet": "^0.0.4",
|
|
@@ -11138,6 +11176,7 @@ var package_default = {
|
|
|
11138
11176
|
"@tscircuit/props": "*",
|
|
11139
11177
|
"@tscircuit/schematic-autolayout": "*",
|
|
11140
11178
|
"@tscircuit/schematic-match-adapt": "*",
|
|
11179
|
+
"@tscircuit/circuit-json-flex": "*",
|
|
11141
11180
|
"@tscircuit/schematic-corpus": "*",
|
|
11142
11181
|
"circuit-json-to-bpc": "*",
|
|
11143
11182
|
"bpc-graph": "*",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.578",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@biomejs/biome": "^1.8.3",
|
|
27
27
|
"@tscircuit/capacity-autorouter": "^0.0.93",
|
|
28
28
|
"@tscircuit/checks": "^0.0.56",
|
|
29
|
+
"@tscircuit/circuit-json-flex": "^0.0.1",
|
|
29
30
|
"@tscircuit/circuit-json-util": "^0.0.51",
|
|
30
31
|
"@tscircuit/footprinter": "^0.0.204",
|
|
31
32
|
"@tscircuit/import-snippet": "^0.0.4",
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
"@tscircuit/props": "*",
|
|
75
76
|
"@tscircuit/schematic-autolayout": "*",
|
|
76
77
|
"@tscircuit/schematic-match-adapt": "*",
|
|
78
|
+
"@tscircuit/circuit-json-flex": "*",
|
|
77
79
|
"@tscircuit/schematic-corpus": "*",
|
|
78
80
|
"circuit-json-to-bpc": "*",
|
|
79
81
|
"bpc-graph": "*",
|