@tscircuit/common 0.0.23 → 0.0.25
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 +21 -1
- package/dist/index.js +76 -30
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,26 @@ type XiaoBoardProps = ChipProps & BoardProps & {
|
|
|
28
28
|
};
|
|
29
29
|
declare const XiaoBoard: ({ variant, withPlatedHoles, children, ...rest }: XiaoBoardProps) => react_jsx_runtime.JSX.Element;
|
|
30
30
|
|
|
31
|
+
declare const PIN_LABELS: {
|
|
32
|
+
readonly pin1: "A0";
|
|
33
|
+
readonly pin2: "A1";
|
|
34
|
+
readonly pin3: "A2";
|
|
35
|
+
readonly pin4: "A3";
|
|
36
|
+
readonly pin5: "SDA";
|
|
37
|
+
readonly pin6: "SCL";
|
|
38
|
+
readonly pin7: "TX";
|
|
39
|
+
readonly pin8: "VBUS";
|
|
40
|
+
readonly pin9: "GND1";
|
|
41
|
+
readonly pin10: "V3_3";
|
|
42
|
+
readonly pin11: "MOSI";
|
|
43
|
+
readonly pin12: "MISO";
|
|
44
|
+
readonly pin13: "SCK";
|
|
45
|
+
readonly pin14: "RX";
|
|
46
|
+
};
|
|
47
|
+
declare const XiaoReceiver: (props: ChipProps<typeof PIN_LABELS> & {
|
|
48
|
+
children?: any;
|
|
49
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
31
51
|
type ProMicroBoardProps = ChipProps & BoardProps & {
|
|
32
52
|
children?: any;
|
|
33
53
|
};
|
|
@@ -39,4 +59,4 @@ type ViaGridBoardProps = ChipProps & BoardProps & {
|
|
|
39
59
|
};
|
|
40
60
|
declare const ViaGridBoard: ({ children, ...rest }: ViaGridBoardProps) => react_jsx_runtime.JSX.Element;
|
|
41
61
|
|
|
42
|
-
export { ArduinoShield, MicroModBoard, ProMicroBoard, RaspberryPiHatBoard, ViaGridBoard, XiaoBoard };
|
|
62
|
+
export { ArduinoShield, MicroModBoard, ProMicroBoard, RaspberryPiHatBoard, ViaGridBoard, XiaoBoard, XiaoReceiver };
|
package/dist/index.js
CHANGED
|
@@ -3311,9 +3311,54 @@ var XiaoBoard = (_a) => {
|
|
|
3311
3311
|
] }));
|
|
3312
3312
|
};
|
|
3313
3313
|
|
|
3314
|
+
// lib/XiaoBoard/XiaoReceiver.circuit.tsx
|
|
3315
|
+
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
3316
|
+
var PIN_LABELS = {
|
|
3317
|
+
pin1: "A0",
|
|
3318
|
+
pin2: "A1",
|
|
3319
|
+
pin3: "A2",
|
|
3320
|
+
pin4: "A3",
|
|
3321
|
+
pin5: "SDA",
|
|
3322
|
+
pin6: "SCL",
|
|
3323
|
+
pin7: "TX",
|
|
3324
|
+
pin8: "VBUS",
|
|
3325
|
+
pin9: "GND1",
|
|
3326
|
+
pin10: "V3_3",
|
|
3327
|
+
pin11: "MOSI",
|
|
3328
|
+
pin12: "MISO",
|
|
3329
|
+
pin13: "SCK",
|
|
3330
|
+
pin14: "RX"
|
|
3331
|
+
};
|
|
3332
|
+
var PIN_ARRANGEMENT = {
|
|
3333
|
+
leftSide: {
|
|
3334
|
+
direction: "top-to-bottom",
|
|
3335
|
+
pins: ["A0", "A1", "A2", "A3", "SDA", "SCL", "TX"]
|
|
3336
|
+
},
|
|
3337
|
+
rightSide: {
|
|
3338
|
+
direction: "top-to-bottom",
|
|
3339
|
+
pins: ["RX", "SCK", "MISO", "MOSI", "V3_3", "GND1", "VBUS"]
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
var XiaoReceiver = (props) => {
|
|
3343
|
+
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
3344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3345
|
+
"chip",
|
|
3346
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
3347
|
+
footprint: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(XiaoBoardFootprint, { variant: "Receiver" }),
|
|
3348
|
+
pinLabels: PIN_LABELS,
|
|
3349
|
+
schPinArrangement: PIN_ARRANGEMENT,
|
|
3350
|
+
schWidth: 1.5,
|
|
3351
|
+
pcbX: 0,
|
|
3352
|
+
pcbY: 0,
|
|
3353
|
+
doNotPlace: true,
|
|
3354
|
+
children
|
|
3355
|
+
})
|
|
3356
|
+
);
|
|
3357
|
+
};
|
|
3358
|
+
|
|
3314
3359
|
// lib/ProMicroBoard/ProMicroBoardFootprint.tsx
|
|
3315
3360
|
var import_react3 = __toESM(require_react(), 1);
|
|
3316
|
-
var
|
|
3361
|
+
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
3317
3362
|
var createPlatedHole3 = (props) => import_react3.default.createElement("platedhole", props);
|
|
3318
3363
|
var ProMicroBoardFootprint = ({
|
|
3319
3364
|
left = 12,
|
|
@@ -3354,11 +3399,11 @@ var ProMicroBoardFootprint = ({
|
|
|
3354
3399
|
);
|
|
3355
3400
|
pinNumber++;
|
|
3356
3401
|
}
|
|
3357
|
-
return /* @__PURE__ */ (0,
|
|
3402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("footprint", { children: pads });
|
|
3358
3403
|
};
|
|
3359
3404
|
|
|
3360
3405
|
// lib/ProMicroBoard/ProMicroBoard.circuit.tsx
|
|
3361
|
-
var
|
|
3406
|
+
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
3362
3407
|
var ProMicroBoard = (_a) => {
|
|
3363
3408
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
3364
3409
|
const { boardProps, chipProps = {} } = splitBoardAndChipProps(__spreadValues({}, rest));
|
|
@@ -3426,7 +3471,7 @@ var ProMicroBoard = (_a) => {
|
|
|
3426
3471
|
]
|
|
3427
3472
|
}
|
|
3428
3473
|
};
|
|
3429
|
-
return /* @__PURE__ */ (0,
|
|
3474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3430
3475
|
"board",
|
|
3431
3476
|
__spreadProps(__spreadValues({}, boardProps), {
|
|
3432
3477
|
outline: [
|
|
@@ -3437,11 +3482,11 @@ var ProMicroBoard = (_a) => {
|
|
|
3437
3482
|
{ x: -8.89, y: 16.51 }
|
|
3438
3483
|
],
|
|
3439
3484
|
children: [
|
|
3440
|
-
/* @__PURE__ */ (0,
|
|
3485
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3441
3486
|
"chip",
|
|
3442
3487
|
__spreadProps(__spreadValues({}, chipRest), {
|
|
3443
3488
|
name: resolvedName,
|
|
3444
|
-
footprint: /* @__PURE__ */ (0,
|
|
3489
|
+
footprint: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ProMicroBoardFootprint, {}),
|
|
3445
3490
|
doNotPlace: true,
|
|
3446
3491
|
pcbX: 0,
|
|
3447
3492
|
pcbY: 0,
|
|
@@ -3504,10 +3549,10 @@ function grid({
|
|
|
3504
3549
|
}
|
|
3505
3550
|
|
|
3506
3551
|
// lib/ViaGridBoard/viaGridElements.tsx
|
|
3507
|
-
var
|
|
3552
|
+
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
3508
3553
|
var ViaGridVia = (props) => {
|
|
3509
3554
|
const _a = props, { viaIndex } = _a, restProps = __objRest(_a, ["viaIndex"]);
|
|
3510
|
-
return /* @__PURE__ */ (0,
|
|
3555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3511
3556
|
"via",
|
|
3512
3557
|
__spreadValues({
|
|
3513
3558
|
name: `via_${viaIndex}`,
|
|
@@ -3520,23 +3565,23 @@ var ViaGridVia = (props) => {
|
|
|
3520
3565
|
};
|
|
3521
3566
|
var ViaGridPlus = (props) => {
|
|
3522
3567
|
const _a = props, { startIndex } = _a, restProps = __objRest(_a, ["startIndex"]);
|
|
3523
|
-
return /* @__PURE__ */ (0,
|
|
3524
|
-
/* @__PURE__ */ (0,
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
3526
|
-
/* @__PURE__ */ (0,
|
|
3527
|
-
/* @__PURE__ */ (0,
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
3568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("group", __spreadProps(__spreadValues({}, restProps), { children: [
|
|
3569
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ViaGridVia, { pcbX: 0, pcbY: 0, viaIndex: startIndex }),
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ViaGridVia, { pcbX: 2.5, pcbY: 0, viaIndex: startIndex + 1 }),
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ViaGridVia, { pcbX: 0, pcbY: 2.5, viaIndex: startIndex + 2 }),
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ViaGridVia, { pcbX: -2.5, pcbY: 0, viaIndex: startIndex + 3 }),
|
|
3573
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ViaGridVia, { pcbX: 0, pcbY: -2.5, viaIndex: startIndex + 4 })
|
|
3529
3574
|
] }));
|
|
3530
3575
|
};
|
|
3531
3576
|
var pacmanPolygonOutline = new OutlineBuilder(-0.2, -0.2).lineTo(-0.2, 2.5).arcTo(-2.5, 0, { radius: 2.5, sweep: true }).arcTo(0, -2.5, { radius: 2.5, sweep: true }).arcTo(2.5, -0.2, { radius: 2.5, sweep: true }).lineTo(-0.2, -0.2).toArray();
|
|
3532
3577
|
|
|
3533
3578
|
// lib/ViaGridBoard/ViaGridBoard.circuit.tsx
|
|
3534
|
-
var
|
|
3579
|
+
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
3535
3580
|
var ViaGridBoard = (_a) => {
|
|
3536
3581
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
3537
3582
|
const { boardProps = {} } = splitBoardAndChipProps(__spreadValues({}, rest));
|
|
3538
|
-
return /* @__PURE__ */ (0,
|
|
3539
|
-
/* @__PURE__ */ (0,
|
|
3583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("board", __spreadProps(__spreadValues({}, boardProps), { width: "100mm", height: "65mm", children: [
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3540
3585
|
"pcbnoterect",
|
|
3541
3586
|
{
|
|
3542
3587
|
pcbX: 0,
|
|
@@ -3551,7 +3596,7 @@ var ViaGridBoard = (_a) => {
|
|
|
3551
3596
|
const x = (cornerPositionName.includes("R") ? 90 : 0) + 5 - 50;
|
|
3552
3597
|
const y = (cornerPositionName.includes("T") ? 55 : 0) + 5 - 32.5;
|
|
3553
3598
|
const rotation = index * 90;
|
|
3554
|
-
return /* @__PURE__ */ (0,
|
|
3599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3555
3600
|
"chip",
|
|
3556
3601
|
{
|
|
3557
3602
|
name: cornerPositionName,
|
|
@@ -3559,7 +3604,7 @@ var ViaGridBoard = (_a) => {
|
|
|
3559
3604
|
pcbY: y,
|
|
3560
3605
|
noSchematicRepresentation: true,
|
|
3561
3606
|
pcbRotation: -rotation,
|
|
3562
|
-
footprint: /* @__PURE__ */ (0,
|
|
3607
|
+
footprint: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("footprint", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3563
3608
|
"smtpad",
|
|
3564
3609
|
{
|
|
3565
3610
|
pcbX: "0mm",
|
|
@@ -3574,11 +3619,11 @@ var ViaGridBoard = (_a) => {
|
|
|
3574
3619
|
"pacman_" + cornerPositionName
|
|
3575
3620
|
);
|
|
3576
3621
|
}),
|
|
3577
|
-
/* @__PURE__ */ (0,
|
|
3578
|
-
/* @__PURE__ */ (0,
|
|
3579
|
-
/* @__PURE__ */ (0,
|
|
3580
|
-
/* @__PURE__ */ (0,
|
|
3581
|
-
horizontalEdgeViaGridCells.map((cell) => /* @__PURE__ */ (0,
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ViaGridPlus, { pcbX: -20, pcbY: -7.5, startIndex: 0 }),
|
|
3623
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ViaGridPlus, { pcbX: 20, pcbY: -7.5, startIndex: 5 }),
|
|
3624
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ViaGridPlus, { pcbX: -20, pcbY: 7.5, startIndex: 10 }),
|
|
3625
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ViaGridPlus, { pcbX: 20, pcbY: 7.5, startIndex: 15 }),
|
|
3626
|
+
horizontalEdgeViaGridCells.map((cell) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3582
3627
|
ViaGridVia,
|
|
3583
3628
|
{
|
|
3584
3629
|
pcbX: cell.center.x - 50,
|
|
@@ -3587,7 +3632,7 @@ var ViaGridBoard = (_a) => {
|
|
|
3587
3632
|
},
|
|
3588
3633
|
cell.index
|
|
3589
3634
|
)),
|
|
3590
|
-
verticalEdgeViaGridCells.map((cell) => /* @__PURE__ */ (0,
|
|
3635
|
+
verticalEdgeViaGridCells.map((cell) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3591
3636
|
ViaGridVia,
|
|
3592
3637
|
{
|
|
3593
3638
|
pcbX: cell.center.x - 50,
|
|
@@ -3596,14 +3641,14 @@ var ViaGridBoard = (_a) => {
|
|
|
3596
3641
|
},
|
|
3597
3642
|
cell.index
|
|
3598
3643
|
)),
|
|
3599
|
-
/* @__PURE__ */ (0,
|
|
3644
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3600
3645
|
"chip",
|
|
3601
3646
|
{
|
|
3602
3647
|
name: "TOP_RECT",
|
|
3603
3648
|
pcbX: 0,
|
|
3604
3649
|
pcbY: 30,
|
|
3605
3650
|
noSchematicRepresentation: true,
|
|
3606
|
-
footprint: /* @__PURE__ */ (0,
|
|
3651
|
+
footprint: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("footprint", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3607
3652
|
"smtpad",
|
|
3608
3653
|
{
|
|
3609
3654
|
layer: "top",
|
|
@@ -3616,8 +3661,8 @@ var ViaGridBoard = (_a) => {
|
|
|
3616
3661
|
) })
|
|
3617
3662
|
}
|
|
3618
3663
|
),
|
|
3619
|
-
/* @__PURE__ */ (0,
|
|
3620
|
-
/* @__PURE__ */ (0,
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("silkscreentext", { text: "VIAGRID TOP", fontSize: "1.5mm", pcbX: 0, pcbY: -30 }),
|
|
3665
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("net", { name: "GND" }),
|
|
3621
3666
|
children
|
|
3622
3667
|
] }));
|
|
3623
3668
|
};
|
|
@@ -3661,7 +3706,8 @@ export {
|
|
|
3661
3706
|
ProMicroBoard,
|
|
3662
3707
|
RaspberryPiHatBoard,
|
|
3663
3708
|
ViaGridBoard,
|
|
3664
|
-
XiaoBoard
|
|
3709
|
+
XiaoBoard,
|
|
3710
|
+
XiaoReceiver
|
|
3665
3711
|
};
|
|
3666
3712
|
/*! Bundled license information:
|
|
3667
3713
|
|