@tscircuit/core 0.0.577 → 0.0.579

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 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<{
@@ -1149,7 +1150,7 @@ declare class Board extends Group<typeof boardProps> {
1149
1150
  flex: zod.ZodOptional<zod.ZodUnion<[zod.ZodBoolean, zod.ZodString]>>;
1150
1151
  flexDirection: zod.ZodOptional<zod.ZodEnum<["row", "column"]>>;
1151
1152
  alignItems: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch"]>>;
1152
- justifyContent: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch"]>>;
1153
+ justifyContent: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch", "space-between", "space-around", "space-evenly"]>>;
1153
1154
  flexRow: zod.ZodOptional<zod.ZodBoolean>;
1154
1155
  flexColumn: zod.ZodOptional<zod.ZodBoolean>;
1155
1156
  gap: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
@@ -1180,7 +1181,7 @@ declare class Board extends Group<typeof boardProps> {
1180
1181
  gridGap?: string | number | undefined;
1181
1182
  flexDirection?: "row" | "column" | undefined;
1182
1183
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1183
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1184
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1184
1185
  flexRow?: boolean | undefined;
1185
1186
  flexColumn?: boolean | undefined;
1186
1187
  gap?: string | number | undefined;
@@ -1211,7 +1212,7 @@ declare class Board extends Group<typeof boardProps> {
1211
1212
  gridGap?: string | number | undefined;
1212
1213
  flexDirection?: "row" | "column" | undefined;
1213
1214
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1214
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1215
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1215
1216
  flexRow?: boolean | undefined;
1216
1217
  flexColumn?: boolean | undefined;
1217
1218
  gap?: string | number | undefined;
@@ -1243,7 +1244,7 @@ declare class Board extends Group<typeof boardProps> {
1243
1244
  flex: zod.ZodOptional<zod.ZodUnion<[zod.ZodBoolean, zod.ZodString]>>;
1244
1245
  flexDirection: zod.ZodOptional<zod.ZodEnum<["row", "column"]>>;
1245
1246
  alignItems: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch"]>>;
1246
- justifyContent: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch"]>>;
1247
+ justifyContent: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch", "space-between", "space-around", "space-evenly"]>>;
1247
1248
  flexRow: zod.ZodOptional<zod.ZodBoolean>;
1248
1249
  flexColumn: zod.ZodOptional<zod.ZodBoolean>;
1249
1250
  gap: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
@@ -1274,7 +1275,7 @@ declare class Board extends Group<typeof boardProps> {
1274
1275
  gridGap?: string | number | undefined;
1275
1276
  flexDirection?: "row" | "column" | undefined;
1276
1277
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1277
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1278
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1278
1279
  flexRow?: boolean | undefined;
1279
1280
  flexColumn?: boolean | undefined;
1280
1281
  gap?: string | number | undefined;
@@ -1305,7 +1306,7 @@ declare class Board extends Group<typeof boardProps> {
1305
1306
  gridGap?: string | number | undefined;
1306
1307
  flexDirection?: "row" | "column" | undefined;
1307
1308
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1308
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1309
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1309
1310
  flexRow?: boolean | undefined;
1310
1311
  flexColumn?: boolean | undefined;
1311
1312
  gap?: string | number | undefined;
@@ -1367,7 +1368,7 @@ declare class Board extends Group<typeof boardProps> {
1367
1368
  flex: zod.ZodOptional<zod.ZodUnion<[zod.ZodBoolean, zod.ZodString]>>;
1368
1369
  flexDirection: zod.ZodOptional<zod.ZodEnum<["row", "column"]>>;
1369
1370
  alignItems: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch"]>>;
1370
- justifyContent: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch"]>>;
1371
+ justifyContent: zod.ZodOptional<zod.ZodEnum<["start", "center", "end", "stretch", "space-between", "space-around", "space-evenly"]>>;
1371
1372
  flexRow: zod.ZodOptional<zod.ZodBoolean>;
1372
1373
  flexColumn: zod.ZodOptional<zod.ZodBoolean>;
1373
1374
  gap: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodString]>>;
@@ -1639,7 +1640,7 @@ declare class Board extends Group<typeof boardProps> {
1639
1640
  gridGap?: string | number | undefined;
1640
1641
  flexDirection?: "row" | "column" | undefined;
1641
1642
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1642
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1643
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1643
1644
  flexRow?: boolean | undefined;
1644
1645
  flexColumn?: boolean | undefined;
1645
1646
  gap?: string | number | undefined;
@@ -1675,7 +1676,7 @@ declare class Board extends Group<typeof boardProps> {
1675
1676
  gridGap?: string | number | undefined;
1676
1677
  flexDirection?: "row" | "column" | undefined;
1677
1678
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1678
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1679
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1679
1680
  flexRow?: boolean | undefined;
1680
1681
  flexColumn?: boolean | undefined;
1681
1682
  gap?: string | number | undefined;
@@ -1707,7 +1708,7 @@ declare class Board extends Group<typeof boardProps> {
1707
1708
  gridGap?: string | number | undefined;
1708
1709
  flexDirection?: "row" | "column" | undefined;
1709
1710
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1710
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1711
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1711
1712
  flexRow?: boolean | undefined;
1712
1713
  flexColumn?: boolean | undefined;
1713
1714
  gap?: string | number | undefined;
@@ -1823,7 +1824,7 @@ declare class Board extends Group<typeof boardProps> {
1823
1824
  gridGap?: string | number | undefined;
1824
1825
  flexDirection?: "row" | "column" | undefined;
1825
1826
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1826
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1827
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1827
1828
  flexRow?: boolean | undefined;
1828
1829
  flexColumn?: boolean | undefined;
1829
1830
  gap?: string | number | undefined;
@@ -1859,7 +1860,7 @@ declare class Board extends Group<typeof boardProps> {
1859
1860
  gridGap?: string | number | undefined;
1860
1861
  flexDirection?: "row" | "column" | undefined;
1861
1862
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1862
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1863
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1863
1864
  flexRow?: boolean | undefined;
1864
1865
  flexColumn?: boolean | undefined;
1865
1866
  gap?: string | number | undefined;
@@ -1891,7 +1892,7 @@ declare class Board extends Group<typeof boardProps> {
1891
1892
  gridGap?: string | number | undefined;
1892
1893
  flexDirection?: "row" | "column" | undefined;
1893
1894
  alignItems?: "center" | "start" | "end" | "stretch" | undefined;
1894
- justifyContent?: "center" | "start" | "end" | "stretch" | undefined;
1895
+ justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
1895
1896
  flexRow?: boolean | undefined;
1896
1897
  flexColumn?: boolean | undefined;
1897
1898
  gap?: string | number | undefined;
package/dist/index.js CHANGED
@@ -8085,6 +8085,39 @@ 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 { _parsedProps: props } = group;
8094
+ const circuitJson = group.lowercaseComponentName === "board" ? db.toArray() : buildSubtree3(db.toArray(), {
8095
+ source_group_id: group.source_group_id
8096
+ });
8097
+ const modifiedCircuitJson = layoutCircuitJsonWithFlex(circuitJson, {
8098
+ justifyContent: props.justifyContent === "start" ? "flex-start" : props.justifyContent === "end" ? "flex-end" : props.justifyContent === "stretch" ? "space-between" : props.justifyContent
8099
+ });
8100
+ const pcbSmtPads = db.pcb_smtpad.list();
8101
+ for (const smtpad of pcbSmtPads) {
8102
+ const modifiedElm = modifiedCircuitJson.find(
8103
+ (elm) => elm.type === "pcb_smtpad" && elm.pcb_smtpad_id === smtpad.pcb_smtpad_id
8104
+ );
8105
+ if (!modifiedElm) continue;
8106
+ db.pcb_smtpad.update(smtpad.pcb_smtpad_id, modifiedElm);
8107
+ }
8108
+ const pcbSilkScreenTexts = db.pcb_silkscreen_text.list();
8109
+ for (const silkscreenText of pcbSilkScreenTexts) {
8110
+ const modifiedElm = modifiedCircuitJson.find(
8111
+ (elm) => elm.type === "pcb_silkscreen_text" && elm.pcb_silkscreen_text_id === silkscreenText.pcb_silkscreen_text_id
8112
+ );
8113
+ if (!modifiedElm) continue;
8114
+ db.pcb_silkscreen_text.update(
8115
+ silkscreenText.pcb_silkscreen_text_id,
8116
+ modifiedElm
8117
+ );
8118
+ }
8119
+ };
8120
+
8088
8121
  // lib/components/primitive-components/Group/Group.ts
8089
8122
  var Group = class extends NormalComponent {
8090
8123
  pcb_group_id = null;
@@ -8619,6 +8652,8 @@ var Group = class extends NormalComponent {
8619
8652
  this._doInitialPcbLayoutGrid();
8620
8653
  } else if (pcbLayoutMode === "pack") {
8621
8654
  this._doInitialPcbLayoutPack();
8655
+ } else if (pcbLayoutMode === "flex") {
8656
+ this._doInitialPcbLayoutFlex();
8622
8657
  }
8623
8658
  }
8624
8659
  _doInitialPcbLayoutGrid() {
@@ -8627,6 +8662,9 @@ var Group = class extends NormalComponent {
8627
8662
  _doInitialPcbLayoutPack() {
8628
8663
  Group_doInitialPcbLayoutPack(this);
8629
8664
  }
8665
+ _doInitialPcbLayoutFlex() {
8666
+ Group_doInitialPcbLayoutFlex(this);
8667
+ }
8630
8668
  _insertSchematicBorder() {
8631
8669
  if (this.root?.schematicDisabled) return;
8632
8670
  const { db } = this.root;
@@ -11065,7 +11103,7 @@ import { identity as identity5 } from "transformation-matrix";
11065
11103
  var package_default = {
11066
11104
  name: "@tscircuit/core",
11067
11105
  type: "module",
11068
- version: "0.0.576",
11106
+ version: "0.0.578",
11069
11107
  types: "dist/index.d.ts",
11070
11108
  main: "dist/index.js",
11071
11109
  module: "dist/index.js",
@@ -11090,13 +11128,14 @@ var package_default = {
11090
11128
  "@biomejs/biome": "^1.8.3",
11091
11129
  "@tscircuit/capacity-autorouter": "^0.0.93",
11092
11130
  "@tscircuit/checks": "^0.0.56",
11131
+ "@tscircuit/circuit-json-flex": "^0.0.1",
11093
11132
  "@tscircuit/circuit-json-util": "^0.0.51",
11094
11133
  "@tscircuit/footprinter": "^0.0.204",
11095
11134
  "@tscircuit/import-snippet": "^0.0.4",
11096
11135
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
11097
11136
  "@tscircuit/log-soup": "^1.0.2",
11098
11137
  "@tscircuit/math-utils": "^0.0.18",
11099
- "@tscircuit/props": "^0.0.264",
11138
+ "@tscircuit/props": "^0.0.265",
11100
11139
  "@tscircuit/schematic-autolayout": "^0.0.6",
11101
11140
  "@tscircuit/schematic-corpus": "^0.0.52",
11102
11141
  "@tscircuit/schematic-match-adapt": "^0.0.16",
@@ -11138,6 +11177,7 @@ var package_default = {
11138
11177
  "@tscircuit/props": "*",
11139
11178
  "@tscircuit/schematic-autolayout": "*",
11140
11179
  "@tscircuit/schematic-match-adapt": "*",
11180
+ "@tscircuit/circuit-json-flex": "*",
11141
11181
  "@tscircuit/schematic-corpus": "*",
11142
11182
  "circuit-json-to-bpc": "*",
11143
11183
  "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.577",
4
+ "version": "0.0.579",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -26,13 +26,14 @@
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",
32
33
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
33
34
  "@tscircuit/log-soup": "^1.0.2",
34
35
  "@tscircuit/math-utils": "^0.0.18",
35
- "@tscircuit/props": "^0.0.264",
36
+ "@tscircuit/props": "^0.0.265",
36
37
  "@tscircuit/schematic-autolayout": "^0.0.6",
37
38
  "@tscircuit/schematic-corpus": "^0.0.52",
38
39
  "@tscircuit/schematic-match-adapt": "^0.0.16",
@@ -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": "*",