@tscircuit/common 0.0.14 → 0.0.15
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 +6 -1
- package/dist/index.js +160 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,4 +28,9 @@ type XiaoBoardProps = ChipProps & BoardProps & {
|
|
|
28
28
|
};
|
|
29
29
|
declare const XiaoBoard: ({ variant, withPlatedHoles, children, ...rest }: XiaoBoardProps) => react_jsx_runtime.JSX.Element;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
type ProMicroBoardProps = ChipProps & BoardProps & {
|
|
32
|
+
children?: any;
|
|
33
|
+
};
|
|
34
|
+
declare const ProMicroBoard: ({ children, ...rest }: ProMicroBoardProps) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
export { ArduinoShield, MicroModBoard, ProMicroBoard, RaspberryPiHatBoard, XiaoBoard };
|
package/dist/index.js
CHANGED
|
@@ -154,7 +154,7 @@ var require_react_production = __commonJS({
|
|
|
154
154
|
}
|
|
155
155
|
var ReactSharedInternals = { H: null, A: null, T: null, S: null };
|
|
156
156
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
157
|
-
function
|
|
157
|
+
function ReactElement4(type, key, props) {
|
|
158
158
|
var refProp = props.ref;
|
|
159
159
|
return {
|
|
160
160
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
@@ -165,7 +165,7 @@ var require_react_production = __commonJS({
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
168
|
-
return
|
|
168
|
+
return ReactElement4(oldElement.type, newKey, oldElement.props);
|
|
169
169
|
}
|
|
170
170
|
function isValidElement(object) {
|
|
171
171
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
@@ -389,7 +389,7 @@ var require_react_production = __commonJS({
|
|
|
389
389
|
childArray[i] = arguments[i + 2];
|
|
390
390
|
props.children = childArray;
|
|
391
391
|
}
|
|
392
|
-
return
|
|
392
|
+
return ReactElement4(element.type, key, props);
|
|
393
393
|
};
|
|
394
394
|
exports.createContext = function(defaultValue) {
|
|
395
395
|
defaultValue = {
|
|
@@ -422,7 +422,7 @@ var require_react_production = __commonJS({
|
|
|
422
422
|
if (type && type.defaultProps)
|
|
423
423
|
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
424
424
|
void 0 === props[propName] && (props[propName] = childrenLength[propName]);
|
|
425
|
-
return
|
|
425
|
+
return ReactElement4(type, key, props);
|
|
426
426
|
};
|
|
427
427
|
exports.createRef = function() {
|
|
428
428
|
return { current: null };
|
|
@@ -686,7 +686,7 @@ var require_react_development = __commonJS({
|
|
|
686
686
|
componentName = this.props.ref;
|
|
687
687
|
return void 0 !== componentName ? componentName : null;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function ReactElement4(type, key, props, owner, debugStack, debugTask) {
|
|
690
690
|
var refProp = props.ref;
|
|
691
691
|
type = {
|
|
692
692
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
@@ -728,7 +728,7 @@ var require_react_development = __commonJS({
|
|
|
728
728
|
return type;
|
|
729
729
|
}
|
|
730
730
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
731
|
-
newKey =
|
|
731
|
+
newKey = ReactElement4(
|
|
732
732
|
oldElement.type,
|
|
733
733
|
newKey,
|
|
734
734
|
oldElement.props,
|
|
@@ -1251,7 +1251,7 @@ var require_react_development = __commonJS({
|
|
|
1251
1251
|
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
1252
1252
|
props.children = JSCompiler_inline_result;
|
|
1253
1253
|
}
|
|
1254
|
-
props =
|
|
1254
|
+
props = ReactElement4(
|
|
1255
1255
|
element.type,
|
|
1256
1256
|
key,
|
|
1257
1257
|
props,
|
|
@@ -1307,7 +1307,7 @@ var require_react_development = __commonJS({
|
|
|
1307
1307
|
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1308
1308
|
);
|
|
1309
1309
|
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1310
|
-
return
|
|
1310
|
+
return ReactElement4(
|
|
1311
1311
|
type,
|
|
1312
1312
|
key,
|
|
1313
1313
|
i,
|
|
@@ -1628,7 +1628,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
1628
1628
|
componentName = this.props.ref;
|
|
1629
1629
|
return void 0 !== componentName ? componentName : null;
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1631
|
+
function ReactElement4(type, key, props, owner, debugStack, debugTask) {
|
|
1632
1632
|
var refProp = props.ref;
|
|
1633
1633
|
type = {
|
|
1634
1634
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
@@ -1708,7 +1708,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
1708
1708
|
maybeKey,
|
|
1709
1709
|
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1710
1710
|
);
|
|
1711
|
-
return
|
|
1711
|
+
return ReactElement4(
|
|
1712
1712
|
type,
|
|
1713
1713
|
children,
|
|
1714
1714
|
maybeKey,
|
|
@@ -1723,18 +1723,18 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
1723
1723
|
function isValidElement(object) {
|
|
1724
1724
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1725
1725
|
}
|
|
1726
|
-
var
|
|
1726
|
+
var React4 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React4.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
1727
1727
|
return null;
|
|
1728
1728
|
};
|
|
1729
|
-
|
|
1729
|
+
React4 = {
|
|
1730
1730
|
react_stack_bottom_frame: function(callStackForError) {
|
|
1731
1731
|
return callStackForError();
|
|
1732
1732
|
}
|
|
1733
1733
|
};
|
|
1734
1734
|
var specialPropKeyWarningShown;
|
|
1735
1735
|
var didWarnAboutElementRef = {};
|
|
1736
|
-
var unknownOwnerDebugStack =
|
|
1737
|
-
|
|
1736
|
+
var unknownOwnerDebugStack = React4.react_stack_bottom_frame.bind(
|
|
1737
|
+
React4,
|
|
1738
1738
|
UnknownOwner
|
|
1739
1739
|
)();
|
|
1740
1740
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
@@ -3310,9 +3310,155 @@ var XiaoBoard = (_a) => {
|
|
|
3310
3310
|
children
|
|
3311
3311
|
] }));
|
|
3312
3312
|
};
|
|
3313
|
+
|
|
3314
|
+
// lib/ProMicroBoard/ProMicroBoardFootprint.tsx
|
|
3315
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
3316
|
+
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
3317
|
+
var createPlatedHole3 = (props) => import_react3.default.createElement("platedhole", props);
|
|
3318
|
+
var ProMicroBoardFootprint = ({
|
|
3319
|
+
left = 12,
|
|
3320
|
+
right = 12,
|
|
3321
|
+
pitch = 2.54
|
|
3322
|
+
}) => {
|
|
3323
|
+
const leftRowX = -7.62;
|
|
3324
|
+
const rightRowX = 7.62;
|
|
3325
|
+
const boardHeight = 33.02;
|
|
3326
|
+
const topMargin = 3.81;
|
|
3327
|
+
const boardTop = boardHeight / 2;
|
|
3328
|
+
const firstHoleY = boardTop - topMargin;
|
|
3329
|
+
const pads = [];
|
|
3330
|
+
let pinNumber = 1;
|
|
3331
|
+
for (let i = 0; i < right; i++) {
|
|
3332
|
+
pads.push(
|
|
3333
|
+
createPlatedHole3({
|
|
3334
|
+
portHints: [`${pinNumber}`],
|
|
3335
|
+
holeDiameter: 1.01,
|
|
3336
|
+
outerDiameter: 1.87,
|
|
3337
|
+
pcbX: rightRowX,
|
|
3338
|
+
pcbY: firstHoleY - i * pitch,
|
|
3339
|
+
shape: "circle"
|
|
3340
|
+
})
|
|
3341
|
+
);
|
|
3342
|
+
pinNumber++;
|
|
3343
|
+
}
|
|
3344
|
+
for (let i = 0; i < left; i++) {
|
|
3345
|
+
pads.push(
|
|
3346
|
+
createPlatedHole3({
|
|
3347
|
+
portHints: [`${pinNumber}`],
|
|
3348
|
+
holeDiameter: 1.01,
|
|
3349
|
+
outerDiameter: 1.87,
|
|
3350
|
+
pcbX: leftRowX,
|
|
3351
|
+
pcbY: firstHoleY - i * pitch,
|
|
3352
|
+
shape: "circle"
|
|
3353
|
+
})
|
|
3354
|
+
);
|
|
3355
|
+
pinNumber++;
|
|
3356
|
+
}
|
|
3357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("footprint", { children: pads });
|
|
3358
|
+
};
|
|
3359
|
+
|
|
3360
|
+
// lib/ProMicroBoard/ProMicroBoard.circuit.tsx
|
|
3361
|
+
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
3362
|
+
var ProMicroBoard = (_a) => {
|
|
3363
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
3364
|
+
const { boardProps, chipProps = {} } = splitBoardAndChipProps(__spreadValues({}, rest));
|
|
3365
|
+
const resolvedName = chipProps.name;
|
|
3366
|
+
const _a2 = chipProps, { name: _ } = _a2, chipRest = __objRest(_a2, ["name"]);
|
|
3367
|
+
const DefaultPinLabels = {
|
|
3368
|
+
pin1: "RAW",
|
|
3369
|
+
pin2: "GND1",
|
|
3370
|
+
pin3: "RST",
|
|
3371
|
+
pin4: "VCC",
|
|
3372
|
+
pin5: "A3",
|
|
3373
|
+
pin6: "A2",
|
|
3374
|
+
pin7: "A1",
|
|
3375
|
+
pin8: "A0",
|
|
3376
|
+
pin9: "SCK",
|
|
3377
|
+
pin10: "MISO",
|
|
3378
|
+
pin11: "MOSI",
|
|
3379
|
+
pin12: "D10",
|
|
3380
|
+
pin13: "TXO",
|
|
3381
|
+
pin14: "RX1",
|
|
3382
|
+
pin15: "GND2",
|
|
3383
|
+
pin16: "GND3",
|
|
3384
|
+
pin17: "D2",
|
|
3385
|
+
pin18: "D3",
|
|
3386
|
+
pin19: "D4",
|
|
3387
|
+
pin20: "D5",
|
|
3388
|
+
pin21: "D6",
|
|
3389
|
+
pin22: "D7",
|
|
3390
|
+
pin23: "D8",
|
|
3391
|
+
pin24: "D9"
|
|
3392
|
+
};
|
|
3393
|
+
const defaultPinArrangement = {
|
|
3394
|
+
leftSide: {
|
|
3395
|
+
direction: "top-to-bottom",
|
|
3396
|
+
pins: [
|
|
3397
|
+
"TXO",
|
|
3398
|
+
"RX1",
|
|
3399
|
+
"GND2",
|
|
3400
|
+
"GND3",
|
|
3401
|
+
"D2",
|
|
3402
|
+
"D3",
|
|
3403
|
+
"D4",
|
|
3404
|
+
"D5",
|
|
3405
|
+
"D6",
|
|
3406
|
+
"D7",
|
|
3407
|
+
"D8",
|
|
3408
|
+
"D9"
|
|
3409
|
+
]
|
|
3410
|
+
},
|
|
3411
|
+
rightSide: {
|
|
3412
|
+
direction: "top-to-bottom",
|
|
3413
|
+
pins: [
|
|
3414
|
+
"RAW",
|
|
3415
|
+
"GND1",
|
|
3416
|
+
"RST",
|
|
3417
|
+
"VCC",
|
|
3418
|
+
"A3",
|
|
3419
|
+
"A2",
|
|
3420
|
+
"A1",
|
|
3421
|
+
"A0",
|
|
3422
|
+
"SCK",
|
|
3423
|
+
"MISO",
|
|
3424
|
+
"MOSI",
|
|
3425
|
+
"D10"
|
|
3426
|
+
]
|
|
3427
|
+
}
|
|
3428
|
+
};
|
|
3429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3430
|
+
"board",
|
|
3431
|
+
__spreadProps(__spreadValues({}, boardProps), {
|
|
3432
|
+
outline: [
|
|
3433
|
+
{ x: -8.89, y: 16.51 },
|
|
3434
|
+
{ x: 8.89, y: 16.51 },
|
|
3435
|
+
{ x: 8.89, y: -16.51 },
|
|
3436
|
+
{ x: -8.89, y: -16.51 },
|
|
3437
|
+
{ x: -8.89, y: 16.51 }
|
|
3438
|
+
],
|
|
3439
|
+
children: [
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3441
|
+
"chip",
|
|
3442
|
+
__spreadProps(__spreadValues({}, chipRest), {
|
|
3443
|
+
name: resolvedName,
|
|
3444
|
+
footprint: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ProMicroBoardFootprint, {}),
|
|
3445
|
+
doNotPlace: true,
|
|
3446
|
+
pcbX: 0,
|
|
3447
|
+
pcbY: 0,
|
|
3448
|
+
pinLabels: DefaultPinLabels,
|
|
3449
|
+
schWidth: 1.8,
|
|
3450
|
+
schPinArrangement: defaultPinArrangement
|
|
3451
|
+
})
|
|
3452
|
+
),
|
|
3453
|
+
children
|
|
3454
|
+
]
|
|
3455
|
+
})
|
|
3456
|
+
);
|
|
3457
|
+
};
|
|
3313
3458
|
export {
|
|
3314
3459
|
ArduinoShield,
|
|
3315
3460
|
MicroModBoard,
|
|
3461
|
+
ProMicroBoard,
|
|
3316
3462
|
RaspberryPiHatBoard,
|
|
3317
3463
|
XiaoBoard
|
|
3318
3464
|
};
|