@tscircuit/core 0.0.920 → 0.0.921
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 +11 -5
- package/dist/index.js +28 -6
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -2135,6 +2135,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2135
2135
|
x: string | number;
|
|
2136
2136
|
y: string | number;
|
|
2137
2137
|
}>>;
|
|
2138
|
+
anchorAlignment: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
2138
2139
|
boardAnchorAlignment: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
2139
2140
|
title: zod.ZodOptional<zod.ZodString>;
|
|
2140
2141
|
solderMaskColor: zod.ZodOptional<zod.ZodType<_tscircuit_props.BoardColor, zod.ZodTypeDef, _tscircuit_props.BoardColor>>;
|
|
@@ -2453,6 +2454,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2453
2454
|
x: number;
|
|
2454
2455
|
y: number;
|
|
2455
2456
|
} | undefined;
|
|
2457
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2456
2458
|
boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2457
2459
|
solderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
2458
2460
|
topSolderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
@@ -2772,6 +2774,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
|
|
|
2772
2774
|
x: string | number;
|
|
2773
2775
|
y: string | number;
|
|
2774
2776
|
} | undefined;
|
|
2777
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2775
2778
|
boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
2776
2779
|
solderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
2777
2780
|
topSolderMaskColor?: _tscircuit_props.BoardColor | undefined;
|
|
@@ -3351,6 +3354,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3351
3354
|
width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3352
3355
|
height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3353
3356
|
children: zod.ZodOptional<zod.ZodAny>;
|
|
3357
|
+
anchorAlignment: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
3354
3358
|
noSolderMask: zod.ZodOptional<zod.ZodBoolean>;
|
|
3355
3359
|
panelizationMethod: zod.ZodOptional<zod.ZodEnum<["tab-routing", "none"]>>;
|
|
3356
3360
|
boardGap: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
@@ -3621,6 +3625,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3621
3625
|
schGap?: string | number | undefined;
|
|
3622
3626
|
schPack?: boolean | undefined;
|
|
3623
3627
|
schMatchAdapt?: boolean | undefined;
|
|
3628
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
3624
3629
|
noSolderMask?: boolean | undefined;
|
|
3625
3630
|
panelizationMethod?: "none" | "tab-routing" | undefined;
|
|
3626
3631
|
boardGap?: number | undefined;
|
|
@@ -3891,6 +3896,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3891
3896
|
schGap?: string | number | undefined;
|
|
3892
3897
|
schPack?: boolean | undefined;
|
|
3893
3898
|
schMatchAdapt?: boolean | undefined;
|
|
3899
|
+
anchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
|
|
3894
3900
|
noSolderMask?: boolean | undefined;
|
|
3895
3901
|
panelizationMethod?: "none" | "tab-routing" | undefined;
|
|
3896
3902
|
boardGap?: string | number | undefined;
|
|
@@ -20530,8 +20536,8 @@ declare class FabricationNoteText extends PrimitiveComponent<typeof fabricationN
|
|
|
20530
20536
|
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
20531
20537
|
color: zod.ZodOptional<zod.ZodString>;
|
|
20532
20538
|
}, "strip", zod.ZodTypeAny, {
|
|
20533
|
-
text: string;
|
|
20534
20539
|
anchorAlignment: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right";
|
|
20540
|
+
text: string;
|
|
20535
20541
|
pcbX?: string | number | undefined;
|
|
20536
20542
|
pcbY?: string | number | undefined;
|
|
20537
20543
|
pcbLeftEdgeX?: string | number | undefined;
|
|
@@ -20599,8 +20605,8 @@ declare class FabricationNoteText extends PrimitiveComponent<typeof fabricationN
|
|
|
20599
20605
|
} | undefined;
|
|
20600
20606
|
pcbRelative?: boolean | undefined;
|
|
20601
20607
|
relative?: boolean | undefined;
|
|
20602
|
-
color?: string | undefined;
|
|
20603
20608
|
anchorAlignment?: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right" | undefined;
|
|
20609
|
+
color?: string | undefined;
|
|
20604
20610
|
font?: "tscircuit2024" | undefined;
|
|
20605
20611
|
fontSize?: string | number | undefined;
|
|
20606
20612
|
}>;
|
|
@@ -21184,8 +21190,8 @@ declare class PcbNoteText extends PrimitiveComponent<typeof pcbNoteTextProps> {
|
|
|
21184
21190
|
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
21185
21191
|
color: zod.ZodOptional<zod.ZodString>;
|
|
21186
21192
|
}, "strip", zod.ZodTypeAny, {
|
|
21187
|
-
text: string;
|
|
21188
21193
|
anchorAlignment: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right";
|
|
21194
|
+
text: string;
|
|
21189
21195
|
pcbX?: string | number | undefined;
|
|
21190
21196
|
pcbY?: string | number | undefined;
|
|
21191
21197
|
pcbLeftEdgeX?: string | number | undefined;
|
|
@@ -21253,8 +21259,8 @@ declare class PcbNoteText extends PrimitiveComponent<typeof pcbNoteTextProps> {
|
|
|
21253
21259
|
} | undefined;
|
|
21254
21260
|
pcbRelative?: boolean | undefined;
|
|
21255
21261
|
relative?: boolean | undefined;
|
|
21256
|
-
color?: string | undefined;
|
|
21257
21262
|
anchorAlignment?: "top_left" | "top_right" | "center" | "bottom_left" | "bottom_right" | undefined;
|
|
21263
|
+
color?: string | undefined;
|
|
21258
21264
|
font?: "tscircuit2024" | undefined;
|
|
21259
21265
|
fontSize?: string | number | undefined;
|
|
21260
21266
|
}>;
|
|
@@ -24972,8 +24978,8 @@ declare class SilkscreenText extends PrimitiveComponent<typeof silkscreenTextPro
|
|
|
24972
24978
|
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
24973
24979
|
}>, "many">>;
|
|
24974
24980
|
}, "strip", zod.ZodTypeAny, {
|
|
24975
|
-
text: string;
|
|
24976
24981
|
anchorAlignment: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right";
|
|
24982
|
+
text: string;
|
|
24977
24983
|
pcbX?: string | number | undefined;
|
|
24978
24984
|
pcbY?: string | number | undefined;
|
|
24979
24985
|
pcbLeftEdgeX?: string | number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -9468,7 +9468,9 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
9468
9468
|
db.pcb_component.update(this.pcb_component_id, {
|
|
9469
9469
|
position_mode: "relative_to_group_anchor",
|
|
9470
9470
|
positioned_relative_to_pcb_group_id: positionedRelativeToGroupId,
|
|
9471
|
-
positioned_relative_to_pcb_board_id: positionedRelativeToBoardId
|
|
9471
|
+
positioned_relative_to_pcb_board_id: positionedRelativeToBoardId,
|
|
9472
|
+
display_offset_x: props.pcbX,
|
|
9473
|
+
display_offset_y: props.pcbY
|
|
9472
9474
|
});
|
|
9473
9475
|
}
|
|
9474
9476
|
/**
|
|
@@ -13651,7 +13653,9 @@ function Group_doInitialPcbComponentAnchorAlignment(group) {
|
|
|
13651
13653
|
}
|
|
13652
13654
|
db.pcb_group.update(group.pcb_group_id, {
|
|
13653
13655
|
anchor_position: targetPosition,
|
|
13654
|
-
anchor_alignment: pcbPositionAnchor
|
|
13656
|
+
anchor_alignment: pcbPositionAnchor,
|
|
13657
|
+
display_offset_x: pcbX,
|
|
13658
|
+
display_offset_y: pcbY
|
|
13655
13659
|
});
|
|
13656
13660
|
}
|
|
13657
13661
|
|
|
@@ -14285,6 +14289,24 @@ var Group6 = class extends NormalComponent3 {
|
|
|
14285
14289
|
return "none";
|
|
14286
14290
|
}
|
|
14287
14291
|
doInitialPcbLayout() {
|
|
14292
|
+
if (this.root?.pcbDisabled) return;
|
|
14293
|
+
if (this.pcb_group_id) {
|
|
14294
|
+
const { db } = this.root;
|
|
14295
|
+
const props = this._parsedProps;
|
|
14296
|
+
const hasExplicitPcbPosition = props.pcbX !== void 0 || props.pcbY !== void 0;
|
|
14297
|
+
if (hasExplicitPcbPosition) {
|
|
14298
|
+
const parentGroup = this.parent?.getGroup?.();
|
|
14299
|
+
const pcbParentGroupId = parentGroup?.pcb_group_id ? db.pcb_group.get(parentGroup.pcb_group_id)?.pcb_group_id : void 0;
|
|
14300
|
+
const positionedRelativeToBoardId = !pcbParentGroupId ? this._getBoard()?.pcb_board_id ?? void 0 : void 0;
|
|
14301
|
+
db.pcb_group.update(this.pcb_group_id, {
|
|
14302
|
+
position_mode: "relative_to_group_anchor",
|
|
14303
|
+
positioned_relative_to_pcb_group_id: pcbParentGroupId,
|
|
14304
|
+
positioned_relative_to_pcb_board_id: positionedRelativeToBoardId,
|
|
14305
|
+
display_offset_x: props.pcbX,
|
|
14306
|
+
display_offset_y: props.pcbY
|
|
14307
|
+
});
|
|
14308
|
+
}
|
|
14309
|
+
}
|
|
14288
14310
|
const pcbLayoutMode = this._getPcbLayoutMode();
|
|
14289
14311
|
if (pcbLayoutMode === "grid") {
|
|
14290
14312
|
this._doInitialPcbLayoutGrid();
|
|
@@ -19278,7 +19300,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19278
19300
|
var package_default = {
|
|
19279
19301
|
name: "@tscircuit/core",
|
|
19280
19302
|
type: "module",
|
|
19281
|
-
version: "0.0.
|
|
19303
|
+
version: "0.0.920",
|
|
19282
19304
|
types: "dist/index.d.ts",
|
|
19283
19305
|
main: "dist/index.js",
|
|
19284
19306
|
module: "dist/index.js",
|
|
@@ -19322,7 +19344,7 @@ var package_default = {
|
|
|
19322
19344
|
"@tscircuit/math-utils": "^0.0.29",
|
|
19323
19345
|
"@tscircuit/miniflex": "^0.0.4",
|
|
19324
19346
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
19325
|
-
"@tscircuit/props": "^0.0.
|
|
19347
|
+
"@tscircuit/props": "^0.0.427",
|
|
19326
19348
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
19327
19349
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
19328
19350
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
@@ -19336,13 +19358,13 @@ var package_default = {
|
|
|
19336
19358
|
"bun-match-svg": "0.0.12",
|
|
19337
19359
|
"calculate-elbow": "^0.0.12",
|
|
19338
19360
|
"chokidar-cli": "^3.0.0",
|
|
19339
|
-
"circuit-json": "^0.0.
|
|
19361
|
+
"circuit-json": "^0.0.333",
|
|
19340
19362
|
"circuit-json-to-bpc": "^0.0.13",
|
|
19341
19363
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
19342
19364
|
"circuit-json-to-gltf": "^0.0.31",
|
|
19343
19365
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
19344
19366
|
"circuit-json-to-spice": "^0.0.30",
|
|
19345
|
-
"circuit-to-svg": "^0.0.
|
|
19367
|
+
"circuit-to-svg": "^0.0.293",
|
|
19346
19368
|
concurrently: "^9.1.2",
|
|
19347
19369
|
"connectivity-map": "^1.0.0",
|
|
19348
19370
|
debug: "^4.3.6",
|
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.921",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@tscircuit/math-utils": "^0.0.29",
|
|
46
46
|
"@tscircuit/miniflex": "^0.0.4",
|
|
47
47
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
48
|
-
"@tscircuit/props": "^0.0.
|
|
48
|
+
"@tscircuit/props": "^0.0.427",
|
|
49
49
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
50
50
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
51
51
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"bun-match-svg": "0.0.12",
|
|
60
60
|
"calculate-elbow": "^0.0.12",
|
|
61
61
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
62
|
+
"circuit-json": "^0.0.333",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.31",
|
|
66
66
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
67
67
|
"circuit-json-to-spice": "^0.0.30",
|
|
68
|
-
"circuit-to-svg": "^0.0.
|
|
68
|
+
"circuit-to-svg": "^0.0.293",
|
|
69
69
|
"concurrently": "^9.1.2",
|
|
70
70
|
"connectivity-map": "^1.0.0",
|
|
71
71
|
"debug": "^4.3.6",
|