@tscircuit/core 0.0.391 → 0.0.392

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
@@ -2914,7 +2914,7 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
2914
2914
  get config(): {
2915
2915
  schematicSymbolName: string;
2916
2916
  componentName: string;
2917
- zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
2917
+ zodProps: zod.ZodEffects<zod.ZodEffects<zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
2918
2918
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2919
2919
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2920
2920
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -3172,8 +3172,15 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
3172
3172
  symbolName: zod.ZodOptional<zod.ZodString>;
3173
3173
  }>, {
3174
3174
  connections: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["anode", "cathode", "pin1", "pin2", "pos", "neg"]>, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
3175
+ variant: zod.ZodDefault<zod.ZodOptional<zod.ZodEnum<["standard", "schottky", "zener", "photo", "tvs"]>>>;
3176
+ standard: zod.ZodOptional<zod.ZodBoolean>;
3177
+ schottky: zod.ZodOptional<zod.ZodBoolean>;
3178
+ zener: zod.ZodOptional<zod.ZodBoolean>;
3179
+ photo: zod.ZodOptional<zod.ZodBoolean>;
3180
+ tvs: zod.ZodOptional<zod.ZodBoolean>;
3175
3181
  }>, "strip", zod.ZodTypeAny, {
3176
3182
  name: string;
3183
+ variant: "standard" | "schottky" | "zener" | "photo" | "tvs";
3177
3184
  pcbX?: number | undefined;
3178
3185
  pcbY?: number | undefined;
3179
3186
  pcbRotation?: number | undefined;
@@ -3240,6 +3247,11 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
3240
3247
  children?: any;
3241
3248
  symbolName?: string | undefined;
3242
3249
  connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
3250
+ standard?: boolean | undefined;
3251
+ schottky?: boolean | undefined;
3252
+ zener?: boolean | undefined;
3253
+ photo?: boolean | undefined;
3254
+ tvs?: boolean | undefined;
3243
3255
  }, {
3244
3256
  name: string;
3245
3257
  pcbX?: string | number | undefined;
@@ -3310,6 +3322,312 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
3310
3322
  children?: any;
3311
3323
  symbolName?: string | undefined;
3312
3324
  connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
3325
+ standard?: boolean | undefined;
3326
+ schottky?: boolean | undefined;
3327
+ zener?: boolean | undefined;
3328
+ photo?: boolean | undefined;
3329
+ tvs?: boolean | undefined;
3330
+ variant?: "standard" | "schottky" | "zener" | "photo" | "tvs" | undefined;
3331
+ }>, {
3332
+ name: string;
3333
+ variant: "standard" | "schottky" | "zener" | "photo" | "tvs";
3334
+ pcbX?: number | undefined;
3335
+ pcbY?: number | undefined;
3336
+ pcbRotation?: number | undefined;
3337
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
3338
+ schX?: number | undefined;
3339
+ schY?: number | undefined;
3340
+ schRotation?: number | undefined;
3341
+ footprint?: _tscircuit_props.Footprint | undefined;
3342
+ supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3343
+ key?: any;
3344
+ cadModel?: string | {
3345
+ stlUrl: string;
3346
+ rotationOffset?: number | {
3347
+ x: string | number;
3348
+ y: string | number;
3349
+ z: string | number;
3350
+ } | undefined;
3351
+ positionOffset?: {
3352
+ x: number;
3353
+ y: number;
3354
+ z: number;
3355
+ } | undefined;
3356
+ size?: {
3357
+ x: number;
3358
+ y: number;
3359
+ z: number;
3360
+ } | undefined;
3361
+ } | {
3362
+ objUrl: string;
3363
+ rotationOffset?: number | {
3364
+ x: string | number;
3365
+ y: string | number;
3366
+ z: string | number;
3367
+ } | undefined;
3368
+ positionOffset?: {
3369
+ x: number;
3370
+ y: number;
3371
+ z: number;
3372
+ } | undefined;
3373
+ size?: {
3374
+ x: number;
3375
+ y: number;
3376
+ z: number;
3377
+ } | undefined;
3378
+ mtlUrl?: string | undefined;
3379
+ } | {
3380
+ jscad: Record<string, any>;
3381
+ rotationOffset?: number | {
3382
+ x: string | number;
3383
+ y: string | number;
3384
+ z: string | number;
3385
+ } | undefined;
3386
+ positionOffset?: {
3387
+ x: number;
3388
+ y: number;
3389
+ z: number;
3390
+ } | undefined;
3391
+ size?: {
3392
+ x: number;
3393
+ y: number;
3394
+ z: number;
3395
+ } | undefined;
3396
+ } | undefined;
3397
+ children?: any;
3398
+ symbolName?: string | undefined;
3399
+ connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
3400
+ standard?: boolean | undefined;
3401
+ schottky?: boolean | undefined;
3402
+ zener?: boolean | undefined;
3403
+ photo?: boolean | undefined;
3404
+ tvs?: boolean | undefined;
3405
+ }, {
3406
+ name: string;
3407
+ pcbX?: string | number | undefined;
3408
+ pcbY?: string | number | undefined;
3409
+ pcbRotation?: string | number | undefined;
3410
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3411
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3412
+ } | undefined;
3413
+ schX?: string | number | undefined;
3414
+ schY?: string | number | undefined;
3415
+ schRotation?: string | number | undefined;
3416
+ footprint?: _tscircuit_props.Footprint | undefined;
3417
+ supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3418
+ key?: any;
3419
+ cadModel?: string | {
3420
+ stlUrl: string;
3421
+ rotationOffset?: number | {
3422
+ x: string | number;
3423
+ y: string | number;
3424
+ z: string | number;
3425
+ } | undefined;
3426
+ positionOffset?: {
3427
+ x: string | number;
3428
+ y: string | number;
3429
+ z: string | number;
3430
+ } | undefined;
3431
+ size?: {
3432
+ x: string | number;
3433
+ y: string | number;
3434
+ z: string | number;
3435
+ } | undefined;
3436
+ } | {
3437
+ objUrl: string;
3438
+ rotationOffset?: number | {
3439
+ x: string | number;
3440
+ y: string | number;
3441
+ z: string | number;
3442
+ } | undefined;
3443
+ positionOffset?: {
3444
+ x: string | number;
3445
+ y: string | number;
3446
+ z: string | number;
3447
+ } | undefined;
3448
+ size?: {
3449
+ x: string | number;
3450
+ y: string | number;
3451
+ z: string | number;
3452
+ } | undefined;
3453
+ mtlUrl?: string | undefined;
3454
+ } | {
3455
+ jscad: Record<string, any>;
3456
+ rotationOffset?: number | {
3457
+ x: string | number;
3458
+ y: string | number;
3459
+ z: string | number;
3460
+ } | undefined;
3461
+ positionOffset?: {
3462
+ x: string | number;
3463
+ y: string | number;
3464
+ z: string | number;
3465
+ } | undefined;
3466
+ size?: {
3467
+ x: string | number;
3468
+ y: string | number;
3469
+ z: string | number;
3470
+ } | undefined;
3471
+ } | undefined;
3472
+ children?: any;
3473
+ symbolName?: string | undefined;
3474
+ connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
3475
+ standard?: boolean | undefined;
3476
+ schottky?: boolean | undefined;
3477
+ zener?: boolean | undefined;
3478
+ photo?: boolean | undefined;
3479
+ tvs?: boolean | undefined;
3480
+ variant?: "standard" | "schottky" | "zener" | "photo" | "tvs" | undefined;
3481
+ }>, {
3482
+ standard: boolean;
3483
+ schottky: boolean;
3484
+ zener: boolean;
3485
+ photo: boolean;
3486
+ tvs: boolean;
3487
+ name: string;
3488
+ variant: "standard" | "schottky" | "zener" | "photo" | "tvs";
3489
+ pcbX?: number | undefined;
3490
+ pcbY?: number | undefined;
3491
+ pcbRotation?: number | undefined;
3492
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
3493
+ schX?: number | undefined;
3494
+ schY?: number | undefined;
3495
+ schRotation?: number | undefined;
3496
+ footprint?: _tscircuit_props.Footprint | undefined;
3497
+ supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3498
+ key?: any;
3499
+ cadModel?: string | {
3500
+ stlUrl: string;
3501
+ rotationOffset?: number | {
3502
+ x: string | number;
3503
+ y: string | number;
3504
+ z: string | number;
3505
+ } | undefined;
3506
+ positionOffset?: {
3507
+ x: number;
3508
+ y: number;
3509
+ z: number;
3510
+ } | undefined;
3511
+ size?: {
3512
+ x: number;
3513
+ y: number;
3514
+ z: number;
3515
+ } | undefined;
3516
+ } | {
3517
+ objUrl: string;
3518
+ rotationOffset?: number | {
3519
+ x: string | number;
3520
+ y: string | number;
3521
+ z: string | number;
3522
+ } | undefined;
3523
+ positionOffset?: {
3524
+ x: number;
3525
+ y: number;
3526
+ z: number;
3527
+ } | undefined;
3528
+ size?: {
3529
+ x: number;
3530
+ y: number;
3531
+ z: number;
3532
+ } | undefined;
3533
+ mtlUrl?: string | undefined;
3534
+ } | {
3535
+ jscad: Record<string, any>;
3536
+ rotationOffset?: number | {
3537
+ x: string | number;
3538
+ y: string | number;
3539
+ z: string | number;
3540
+ } | undefined;
3541
+ positionOffset?: {
3542
+ x: number;
3543
+ y: number;
3544
+ z: number;
3545
+ } | undefined;
3546
+ size?: {
3547
+ x: number;
3548
+ y: number;
3549
+ z: number;
3550
+ } | undefined;
3551
+ } | undefined;
3552
+ children?: any;
3553
+ symbolName?: string | undefined;
3554
+ connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
3555
+ }, {
3556
+ name: string;
3557
+ pcbX?: string | number | undefined;
3558
+ pcbY?: string | number | undefined;
3559
+ pcbRotation?: string | number | undefined;
3560
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3561
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3562
+ } | undefined;
3563
+ schX?: string | number | undefined;
3564
+ schY?: string | number | undefined;
3565
+ schRotation?: string | number | undefined;
3566
+ footprint?: _tscircuit_props.Footprint | undefined;
3567
+ supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
3568
+ key?: any;
3569
+ cadModel?: string | {
3570
+ stlUrl: string;
3571
+ rotationOffset?: number | {
3572
+ x: string | number;
3573
+ y: string | number;
3574
+ z: string | number;
3575
+ } | undefined;
3576
+ positionOffset?: {
3577
+ x: string | number;
3578
+ y: string | number;
3579
+ z: string | number;
3580
+ } | undefined;
3581
+ size?: {
3582
+ x: string | number;
3583
+ y: string | number;
3584
+ z: string | number;
3585
+ } | undefined;
3586
+ } | {
3587
+ objUrl: string;
3588
+ rotationOffset?: number | {
3589
+ x: string | number;
3590
+ y: string | number;
3591
+ z: string | number;
3592
+ } | undefined;
3593
+ positionOffset?: {
3594
+ x: string | number;
3595
+ y: string | number;
3596
+ z: string | number;
3597
+ } | undefined;
3598
+ size?: {
3599
+ x: string | number;
3600
+ y: string | number;
3601
+ z: string | number;
3602
+ } | undefined;
3603
+ mtlUrl?: string | undefined;
3604
+ } | {
3605
+ jscad: Record<string, any>;
3606
+ rotationOffset?: number | {
3607
+ x: string | number;
3608
+ y: string | number;
3609
+ z: string | number;
3610
+ } | undefined;
3611
+ positionOffset?: {
3612
+ x: string | number;
3613
+ y: string | number;
3614
+ z: string | number;
3615
+ } | undefined;
3616
+ size?: {
3617
+ x: string | number;
3618
+ y: string | number;
3619
+ z: string | number;
3620
+ } | undefined;
3621
+ } | undefined;
3622
+ children?: any;
3623
+ symbolName?: string | undefined;
3624
+ connections?: Partial<Record<"pin1" | "pin2" | "anode" | "pos" | "cathode" | "neg", string | readonly string[] | string[]>> | undefined;
3625
+ standard?: boolean | undefined;
3626
+ schottky?: boolean | undefined;
3627
+ zener?: boolean | undefined;
3628
+ photo?: boolean | undefined;
3629
+ tvs?: boolean | undefined;
3630
+ variant?: "standard" | "schottky" | "zener" | "photo" | "tvs" | undefined;
3313
3631
  }>;
3314
3632
  sourceFtype: Ftype;
3315
3633
  };
@@ -3324,6 +3642,7 @@ declare class Diode extends NormalComponent<typeof diodeProps, PolarizedPassiveP
3324
3642
  declare class Jumper<PinLabels extends string = never> extends NormalComponent<typeof jumperProps, PinLabels> {
3325
3643
  schematicDimensions: SchematicBoxDimensions | null;
3326
3644
  get config(): {
3645
+ schematicSymbolName: string;
3327
3646
  componentName: string;
3328
3647
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
3329
3648
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -3716,6 +4035,8 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
3716
4035
  topPinCount?: number | undefined;
3717
4036
  bottomPinCount?: number | undefined;
3718
4037
  }>>;
4038
+ pinCount: zod.ZodOptional<zod.ZodUnion<[zod.ZodLiteral<2>, zod.ZodLiteral<3>]>>;
4039
+ internallyConnectedPins: zod.ZodOptional<zod.ZodArray<zod.ZodArray<zod.ZodString, "many">, "many">>;
3719
4040
  }>, "strip", zod.ZodTypeAny, {
3720
4041
  name: string;
3721
4042
  pcbX?: number | undefined;
@@ -3787,6 +4108,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
3787
4108
  schHeight?: number | undefined;
3788
4109
  manufacturerPartNumber?: string | undefined;
3789
4110
  pinLabels?: Record<string | number, string | string[]> | undefined;
4111
+ internallyConnectedPins?: string[][] | undefined;
3790
4112
  schPortArrangement?: {
3791
4113
  leftSize?: number | undefined;
3792
4114
  topSize?: number | undefined;
@@ -3825,6 +4147,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
3825
4147
  }> | undefined;
3826
4148
  schPinSpacing?: number | undefined;
3827
4149
  schDirection?: "left" | "right" | undefined;
4150
+ pinCount?: 2 | 3 | undefined;
3828
4151
  }, {
3829
4152
  name: string;
3830
4153
  pcbX?: string | number | undefined;
@@ -3898,6 +4221,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
3898
4221
  schHeight?: string | number | undefined;
3899
4222
  manufacturerPartNumber?: string | undefined;
3900
4223
  pinLabels?: Record<string | number, string | string[]> | undefined;
4224
+ internallyConnectedPins?: string[][] | undefined;
3901
4225
  schPortArrangement?: {
3902
4226
  leftSize?: number | undefined;
3903
4227
  topSize?: number | undefined;
@@ -3936,6 +4260,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
3936
4260
  }> | undefined;
3937
4261
  schPinSpacing?: string | number | undefined;
3938
4262
  schDirection?: "left" | "right" | undefined;
4263
+ pinCount?: 2 | 3 | undefined;
3939
4264
  }>;
3940
4265
  shouldRenderAsSchematicBox: boolean;
3941
4266
  };
package/dist/index.js CHANGED
@@ -7045,7 +7045,17 @@ import { jumperProps } from "@tscircuit/props";
7045
7045
  var Jumper = class extends NormalComponent {
7046
7046
  schematicDimensions = null;
7047
7047
  get config() {
7048
+ let symbolName = "";
7049
+ if (this.props.pinCount)
7050
+ symbolName += `solderjumper${this.props.pinCount || 2}`;
7051
+ if (Array.isArray(this.props.internallyConnectedPins) && this.props.internallyConnectedPins.length > 0) {
7052
+ const pins = Array.from(
7053
+ new Set(this.props.internallyConnectedPins.flat())
7054
+ ).sort().join("");
7055
+ symbolName += `_bridged${pins}`;
7056
+ }
7048
7057
  return {
7058
+ schematicSymbolName: symbolName,
7049
7059
  componentName: "Jumper",
7050
7060
  zodProps: jumperProps,
7051
7061
  shouldRenderAsSchematicBox: true
@@ -7972,12 +7982,12 @@ var Switch = class extends NormalComponent {
7972
7982
  const switchType = this._getSwitchType();
7973
7983
  const { isNormallyClosed } = this._parsedProps ?? {};
7974
7984
  const baseSymbolNameMap = {
7975
- spst: isNormallyClosed ? "spst_normally_closed_switch" : "SPST_switch",
7976
- spdt: isNormallyClosed ? "spdt_normally_closed_switch" : "SPDT_switch",
7985
+ spst: isNormallyClosed ? "spst_normally_closed_switch" : "spst_switch",
7986
+ spdt: isNormallyClosed ? "spdt_normally_closed_switch" : "spdt_switch",
7977
7987
  dpst: isNormallyClosed ? "dpst_normally_closed_switch" : "dpst_switch",
7978
7988
  dpdt: isNormallyClosed ? "dpdt_normally_closed_switch" : "dpdt_switch"
7979
7989
  };
7980
- const symbolName = baseSymbolNameMap[switchType] ?? "SPST_switch";
7990
+ const symbolName = baseSymbolNameMap[switchType] ?? "spst_switch";
7981
7991
  return {
7982
7992
  componentName: "Switch",
7983
7993
  schematicSymbolName: symbolName,
@@ -8008,7 +8018,7 @@ import { identity as identity4 } from "transformation-matrix";
8008
8018
  var package_default = {
8009
8019
  name: "@tscircuit/core",
8010
8020
  type: "module",
8011
- version: "0.0.390",
8021
+ version: "0.0.391",
8012
8022
  types: "dist/index.d.ts",
8013
8023
  main: "dist/index.js",
8014
8024
  module: "dist/index.js",
@@ -8066,7 +8076,7 @@ var package_default = {
8066
8076
  "@tscircuit/circuit-json-util": "^0.0.47",
8067
8077
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
8068
8078
  "@tscircuit/math-utils": "^0.0.14",
8069
- "@tscircuit/props": "^0.0.172",
8079
+ "@tscircuit/props": "^0.0.174",
8070
8080
  "@tscircuit/schematic-autolayout": "^0.0.6",
8071
8081
  "circuit-json": "0.0.164",
8072
8082
  "circuit-json-to-connectivity-map": "^0.0.20",
@@ -8076,7 +8086,7 @@ var package_default = {
8076
8086
  "performance-now": "^2.1.0",
8077
8087
  "react-reconciler": "^0.31.0",
8078
8088
  "react-reconciler-18": "npm:react-reconciler@0.29.2",
8079
- "schematic-symbols": "^0.0.121",
8089
+ "schematic-symbols": "^0.0.132",
8080
8090
  "transformation-matrix": "^2.16.1",
8081
8091
  zod: "^3.23.8"
8082
8092
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.391",
4
+ "version": "0.0.392",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -59,7 +59,7 @@
59
59
  "@tscircuit/circuit-json-util": "^0.0.47",
60
60
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
61
61
  "@tscircuit/math-utils": "^0.0.14",
62
- "@tscircuit/props": "^0.0.172",
62
+ "@tscircuit/props": "^0.0.174",
63
63
  "@tscircuit/schematic-autolayout": "^0.0.6",
64
64
  "circuit-json": "0.0.164",
65
65
  "circuit-json-to-connectivity-map": "^0.0.20",
@@ -69,7 +69,7 @@
69
69
  "performance-now": "^2.1.0",
70
70
  "react-reconciler": "^0.31.0",
71
71
  "react-reconciler-18": "npm:react-reconciler@0.29.2",
72
- "schematic-symbols": "^0.0.121",
72
+ "schematic-symbols": "^0.0.132",
73
73
  "transformation-matrix": "^2.16.1",
74
74
  "zod": "^3.23.8"
75
75
  }