@tscircuit/core 0.0.899 → 0.0.901
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 +28 -9
- package/dist/index.js +19 -13
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -3322,19 +3322,24 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3322
3322
|
topMargin?: string | number | undefined;
|
|
3323
3323
|
bottomMargin?: string | number | undefined;
|
|
3324
3324
|
}>>>;
|
|
3325
|
-
}, "children" | "width" | "height"> & {
|
|
3326
|
-
width: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number
|
|
3327
|
-
height: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number
|
|
3325
|
+
}, "children" | "width" | "height" | "layoutMode"> & {
|
|
3326
|
+
width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3327
|
+
height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3328
3328
|
children: zod.ZodOptional<zod.ZodAny>;
|
|
3329
3329
|
noSolderMask: zod.ZodOptional<zod.ZodBoolean>;
|
|
3330
3330
|
panelizationMethod: zod.ZodOptional<zod.ZodEnum<["tab-routing", "none"]>>;
|
|
3331
3331
|
boardGap: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3332
|
+
boardAreaWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3333
|
+
boardAreaHeight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3334
|
+
layoutMode: zod.ZodOptional<zod.ZodEnum<["grid", "pack", "none"]>>;
|
|
3335
|
+
row: zod.ZodOptional<zod.ZodNumber>;
|
|
3336
|
+
col: zod.ZodOptional<zod.ZodNumber>;
|
|
3337
|
+
cellWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3338
|
+
cellHeight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3332
3339
|
tabWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3333
3340
|
tabLength: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
3334
3341
|
mouseBites: zod.ZodOptional<zod.ZodBoolean>;
|
|
3335
3342
|
}, "strip", zod.ZodTypeAny, {
|
|
3336
|
-
width: number;
|
|
3337
|
-
height: number;
|
|
3338
3343
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
3339
3344
|
key?: any;
|
|
3340
3345
|
pcbX?: string | number | undefined;
|
|
@@ -3386,7 +3391,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3386
3391
|
children?: any;
|
|
3387
3392
|
grid?: boolean | undefined;
|
|
3388
3393
|
flex?: string | boolean | undefined;
|
|
3389
|
-
layoutMode?: "none" | "
|
|
3394
|
+
layoutMode?: "none" | "grid" | "pack" | undefined;
|
|
3390
3395
|
position?: "relative" | "absolute" | undefined;
|
|
3391
3396
|
gridCols?: string | number | undefined;
|
|
3392
3397
|
gridRows?: string | number | undefined;
|
|
@@ -3396,6 +3401,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3396
3401
|
gridGap?: string | number | undefined;
|
|
3397
3402
|
gridRowGap?: string | number | undefined;
|
|
3398
3403
|
gridColumnGap?: string | number | undefined;
|
|
3404
|
+
row?: number | undefined;
|
|
3399
3405
|
flexDirection?: "row" | "column" | undefined;
|
|
3400
3406
|
alignItems?: "center" | "start" | "end" | "stretch" | undefined;
|
|
3401
3407
|
justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
@@ -3412,6 +3418,8 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3412
3418
|
paddingBottom?: number | undefined;
|
|
3413
3419
|
paddingX?: number | undefined;
|
|
3414
3420
|
paddingY?: number | undefined;
|
|
3421
|
+
width?: number | undefined;
|
|
3422
|
+
height?: number | undefined;
|
|
3415
3423
|
matchAdapt?: boolean | undefined;
|
|
3416
3424
|
matchAdaptTemplate?: any;
|
|
3417
3425
|
schTitle?: string | undefined;
|
|
@@ -3588,12 +3596,15 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3588
3596
|
noSolderMask?: boolean | undefined;
|
|
3589
3597
|
panelizationMethod?: "none" | "tab-routing" | undefined;
|
|
3590
3598
|
boardGap?: number | undefined;
|
|
3599
|
+
boardAreaWidth?: number | undefined;
|
|
3600
|
+
boardAreaHeight?: number | undefined;
|
|
3601
|
+
col?: number | undefined;
|
|
3602
|
+
cellWidth?: number | undefined;
|
|
3603
|
+
cellHeight?: number | undefined;
|
|
3591
3604
|
tabWidth?: number | undefined;
|
|
3592
3605
|
tabLength?: number | undefined;
|
|
3593
3606
|
mouseBites?: boolean | undefined;
|
|
3594
3607
|
}, {
|
|
3595
|
-
width: string | number;
|
|
3596
|
-
height: string | number;
|
|
3597
3608
|
symbol?: _tscircuit_props.SymbolProp | undefined;
|
|
3598
3609
|
key?: any;
|
|
3599
3610
|
pcbX?: string | number | undefined;
|
|
@@ -3647,7 +3658,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3647
3658
|
children?: any;
|
|
3648
3659
|
grid?: boolean | undefined;
|
|
3649
3660
|
flex?: string | boolean | undefined;
|
|
3650
|
-
layoutMode?: "none" | "
|
|
3661
|
+
layoutMode?: "none" | "grid" | "pack" | undefined;
|
|
3651
3662
|
position?: "relative" | "absolute" | undefined;
|
|
3652
3663
|
gridCols?: string | number | undefined;
|
|
3653
3664
|
gridRows?: string | number | undefined;
|
|
@@ -3657,6 +3668,7 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3657
3668
|
gridGap?: string | number | undefined;
|
|
3658
3669
|
gridRowGap?: string | number | undefined;
|
|
3659
3670
|
gridColumnGap?: string | number | undefined;
|
|
3671
|
+
row?: number | undefined;
|
|
3660
3672
|
flexDirection?: "row" | "column" | undefined;
|
|
3661
3673
|
alignItems?: "center" | "start" | "end" | "stretch" | undefined;
|
|
3662
3674
|
justifyContent?: "center" | "start" | "end" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
@@ -3673,6 +3685,8 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3673
3685
|
paddingBottom?: string | number | undefined;
|
|
3674
3686
|
paddingX?: string | number | undefined;
|
|
3675
3687
|
paddingY?: string | number | undefined;
|
|
3688
|
+
width?: string | number | undefined;
|
|
3689
|
+
height?: string | number | undefined;
|
|
3676
3690
|
matchAdapt?: boolean | undefined;
|
|
3677
3691
|
matchAdaptTemplate?: any;
|
|
3678
3692
|
schTitle?: string | undefined;
|
|
@@ -3849,6 +3863,11 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3849
3863
|
noSolderMask?: boolean | undefined;
|
|
3850
3864
|
panelizationMethod?: "none" | "tab-routing" | undefined;
|
|
3851
3865
|
boardGap?: string | number | undefined;
|
|
3866
|
+
boardAreaWidth?: string | number | undefined;
|
|
3867
|
+
boardAreaHeight?: string | number | undefined;
|
|
3868
|
+
col?: number | undefined;
|
|
3869
|
+
cellWidth?: string | number | undefined;
|
|
3870
|
+
cellHeight?: string | number | undefined;
|
|
3852
3871
|
tabWidth?: string | number | undefined;
|
|
3853
3872
|
tabLength?: string | number | undefined;
|
|
3854
3873
|
mouseBites?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1576,7 +1576,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
1576
1576
|
get [Symbol.toStringTag]() {
|
|
1577
1577
|
return this.getString();
|
|
1578
1578
|
}
|
|
1579
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
1579
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
1580
1580
|
return this.getString();
|
|
1581
1581
|
}
|
|
1582
1582
|
};
|
|
@@ -16177,14 +16177,19 @@ var Panel = class extends Group6 {
|
|
|
16177
16177
|
minY = Math.min(minY, bottom);
|
|
16178
16178
|
maxY = Math.max(maxY, top);
|
|
16179
16179
|
}
|
|
16180
|
-
|
|
16180
|
+
const hasExplicitWidth = this._parsedProps.width !== void 0;
|
|
16181
|
+
const hasExplicitHeight = this._parsedProps.height !== void 0;
|
|
16182
|
+
if (hasExplicitWidth && hasExplicitHeight) {
|
|
16183
|
+
db.pcb_panel.update(this.pcb_panel_id, {
|
|
16184
|
+
width: distance9.parse(this._parsedProps.width),
|
|
16185
|
+
height: distance9.parse(this._parsedProps.height)
|
|
16186
|
+
});
|
|
16187
|
+
} else if (isFinite(minX)) {
|
|
16181
16188
|
const boundsWidth = maxX - minX;
|
|
16182
16189
|
const boundsHeight = maxY - minY;
|
|
16183
|
-
const newPanelWidth = boundsWidth + 2 * DEFAULT_PANEL_MARGIN;
|
|
16184
|
-
const newPanelHeight = boundsHeight + 2 * DEFAULT_PANEL_MARGIN;
|
|
16185
16190
|
db.pcb_panel.update(this.pcb_panel_id, {
|
|
16186
|
-
width:
|
|
16187
|
-
height:
|
|
16191
|
+
width: hasExplicitWidth ? distance9.parse(this._parsedProps.width) : boundsWidth + 2 * DEFAULT_PANEL_MARGIN,
|
|
16192
|
+
height: hasExplicitHeight ? distance9.parse(this._parsedProps.height) : boundsHeight + 2 * DEFAULT_PANEL_MARGIN
|
|
16188
16193
|
});
|
|
16189
16194
|
}
|
|
16190
16195
|
}
|
|
@@ -16227,8 +16232,8 @@ var Panel = class extends Group6 {
|
|
|
16227
16232
|
const { db } = this.root;
|
|
16228
16233
|
const props = this._parsedProps;
|
|
16229
16234
|
const inserted = db.pcb_panel.insert({
|
|
16230
|
-
width: distance9.parse(props.width),
|
|
16231
|
-
height: distance9.parse(props.height),
|
|
16235
|
+
width: props.width !== void 0 ? distance9.parse(props.width) : 0,
|
|
16236
|
+
height: props.height !== void 0 ? distance9.parse(props.height) : 0,
|
|
16232
16237
|
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
16233
16238
|
covered_with_solder_mask: !(props.noSolderMask ?? false)
|
|
16234
16239
|
});
|
|
@@ -16239,9 +16244,10 @@ var Panel = class extends Group6 {
|
|
|
16239
16244
|
if (!this.pcb_panel_id) return;
|
|
16240
16245
|
const { db } = this.root;
|
|
16241
16246
|
const props = this._parsedProps;
|
|
16247
|
+
const currentPanel = db.pcb_panel.get(this.pcb_panel_id);
|
|
16242
16248
|
db.pcb_panel.update(this.pcb_panel_id, {
|
|
16243
|
-
width: distance9.parse(props.width),
|
|
16244
|
-
height: distance9.parse(props.height),
|
|
16249
|
+
width: props.width !== void 0 ? distance9.parse(props.width) : currentPanel?.width,
|
|
16250
|
+
height: props.height !== void 0 ? distance9.parse(props.height) : currentPanel?.height,
|
|
16245
16251
|
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
16246
16252
|
covered_with_solder_mask: !(props.noSolderMask ?? false)
|
|
16247
16253
|
});
|
|
@@ -19265,7 +19271,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
19265
19271
|
var package_default = {
|
|
19266
19272
|
name: "@tscircuit/core",
|
|
19267
19273
|
type: "module",
|
|
19268
|
-
version: "0.0.
|
|
19274
|
+
version: "0.0.900",
|
|
19269
19275
|
types: "dist/index.d.ts",
|
|
19270
19276
|
main: "dist/index.js",
|
|
19271
19277
|
module: "dist/index.js",
|
|
@@ -19298,7 +19304,7 @@ var package_default = {
|
|
|
19298
19304
|
"@resvg/resvg-js": "^2.6.2",
|
|
19299
19305
|
"@tscircuit/capacity-autorouter": "^0.0.140",
|
|
19300
19306
|
"@tscircuit/checks": "^0.0.87",
|
|
19301
|
-
"@tscircuit/circuit-json-util": "^0.0.
|
|
19307
|
+
"@tscircuit/circuit-json-util": "^0.0.73",
|
|
19302
19308
|
"@tscircuit/common": "^0.0.20",
|
|
19303
19309
|
"@tscircuit/copper-pour-solver": "^0.0.14",
|
|
19304
19310
|
"@tscircuit/footprinter": "^0.0.236",
|
|
@@ -19309,7 +19315,7 @@ var package_default = {
|
|
|
19309
19315
|
"@tscircuit/math-utils": "^0.0.29",
|
|
19310
19316
|
"@tscircuit/miniflex": "^0.0.4",
|
|
19311
19317
|
"@tscircuit/ngspice-spice-engine": "^0.0.4",
|
|
19312
|
-
"@tscircuit/props": "^0.0.
|
|
19318
|
+
"@tscircuit/props": "^0.0.424",
|
|
19313
19319
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
19314
19320
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
19315
19321
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
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.901",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@resvg/resvg-js": "^2.6.2",
|
|
35
35
|
"@tscircuit/capacity-autorouter": "^0.0.140",
|
|
36
36
|
"@tscircuit/checks": "^0.0.87",
|
|
37
|
-
"@tscircuit/circuit-json-util": "^0.0.
|
|
37
|
+
"@tscircuit/circuit-json-util": "^0.0.73",
|
|
38
38
|
"@tscircuit/common": "^0.0.20",
|
|
39
39
|
"@tscircuit/copper-pour-solver": "^0.0.14",
|
|
40
40
|
"@tscircuit/footprinter": "^0.0.236",
|
|
@@ -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.4",
|
|
48
|
-
"@tscircuit/props": "^0.0.
|
|
48
|
+
"@tscircuit/props": "^0.0.424",
|
|
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",
|