easyeda 0.0.377 → 0.0.379
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/browser/index.d.ts +6 -3
- package/dist/browser/index.js +14 -17
- package/dist/browser/index.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +14 -17
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +15 -18
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -5346,19 +5346,22 @@ declare const EasyEdaJsonSchema: z.ZodObject<{
|
|
|
5346
5346
|
type RawEasyEdaJson = z.input<typeof EasyEdaJsonSchema>;
|
|
5347
5347
|
type BetterEasyEdaJson = z.infer<typeof EasyEdaJsonSchema>;
|
|
5348
5348
|
|
|
5349
|
-
declare const convertRawEasyToTsx: ({ rawEasy, pinAttributes, }: {
|
|
5349
|
+
declare const convertRawEasyToTsx: ({ rawEasy, pinAttributes, internallyConnectedPins, }: {
|
|
5350
5350
|
rawEasy: any;
|
|
5351
5351
|
pinAttributes?: ChipProps["pinAttributes"];
|
|
5352
|
+
internallyConnectedPins?: ChipProps["internallyConnectedPins"];
|
|
5352
5353
|
}) => Promise<string>;
|
|
5353
|
-
declare const convertBetterEasyToTsx: ({ betterEasy, pinAttributes, }: {
|
|
5354
|
+
declare const convertBetterEasyToTsx: ({ betterEasy, pinAttributes, internallyConnectedPins, }: {
|
|
5354
5355
|
betterEasy: BetterEasyEdaJson;
|
|
5355
5356
|
pinAttributes?: ChipProps["pinAttributes"];
|
|
5357
|
+
internallyConnectedPins?: ChipProps["internallyConnectedPins"];
|
|
5356
5358
|
}) => Promise<string>;
|
|
5357
5359
|
|
|
5358
5360
|
type GeneratedComponentType = "chip" | "diode" | "led" | "pushbutton" | "switch" | "capacitor" | "resistor" | "inductor" | "crystal" | "connector";
|
|
5359
5361
|
type GenerateTypescriptComponentParams = {
|
|
5360
5362
|
pinLabels: ChipProps["pinLabels"];
|
|
5361
5363
|
pinAttributes?: ChipProps["pinAttributes"];
|
|
5364
|
+
internallyConnectedPins?: ChipProps["internallyConnectedPins"];
|
|
5362
5365
|
componentName: string;
|
|
5363
5366
|
objUrl?: string;
|
|
5364
5367
|
stepUrl?: string;
|
|
@@ -5382,7 +5385,7 @@ type GenerateTypescriptComponentParams = {
|
|
|
5382
5385
|
footprint: string;
|
|
5383
5386
|
circuitJson?: AnyCircuitElement[];
|
|
5384
5387
|
});
|
|
5385
|
-
declare const generateTypescriptComponent: ({ pinLabels, pinAttributes, componentName, objUrl, stepUrl, circuitJson, footprint, supplierPartNumbers, manufacturerPartNumber, componentType, isPolarizedCapacitor, capacitance, resistance, inductance, crystalFrequency, crystalPinVariant, symbolTsx, schPinArrangement, useSymbolPortsOnly, inferPinAttributes, }: GenerateTypescriptComponentParams) => string;
|
|
5388
|
+
declare const generateTypescriptComponent: ({ pinLabels, pinAttributes, internallyConnectedPins, componentName, objUrl, stepUrl, circuitJson, footprint, supplierPartNumbers, manufacturerPartNumber, componentType, isPolarizedCapacitor, capacitance, resistance, inductance, crystalFrequency, crystalPinVariant, symbolTsx, schPinArrangement, useSymbolPortsOnly, inferPinAttributes, }: GenerateTypescriptComponentParams) => string;
|
|
5386
5389
|
|
|
5387
5390
|
declare function fetchEasyEDAComponent(jlcpcbPartNumber: string, { fetch, includeModelMetadata, }?: {
|
|
5388
5391
|
fetch?: typeof globalThis.fetch;
|
package/dist/browser/index.js
CHANGED
|
@@ -19154,15 +19154,6 @@ var handleHole = (hole, index) => {
|
|
|
19154
19154
|
pcb_hole_id: `pcb_hole_${index + 1}`
|
|
19155
19155
|
});
|
|
19156
19156
|
};
|
|
19157
|
-
var handleHoleCutout = (hole, index) => {
|
|
19158
|
-
return pcb_cutout.parse({
|
|
19159
|
-
type: "pcb_cutout",
|
|
19160
|
-
pcb_cutout_id: `pcb_cutout_from_hole_${index + 1}`,
|
|
19161
|
-
shape: "circle",
|
|
19162
|
-
center: { x: milx10(hole.center.x), y: milx10(hole.center.y) },
|
|
19163
|
-
radius: milx10(hole.radius)
|
|
19164
|
-
});
|
|
19165
|
-
};
|
|
19166
19157
|
var handleVia = (via, index) => {
|
|
19167
19158
|
const holeDiameter = via.holeRadius * 2;
|
|
19168
19159
|
return pcb_via.parse({
|
|
@@ -19377,7 +19368,6 @@ var convertEasyEdaJsonToCircuitJsonWithPinAttributes = (easyEdaJson, {
|
|
|
19377
19368
|
(shape) => shape.type === "HOLE"
|
|
19378
19369
|
).forEach((h, index) => {
|
|
19379
19370
|
circuitElements.push(handleHole(h, index));
|
|
19380
|
-
circuitElements.push(handleHoleCutout(h, index));
|
|
19381
19371
|
});
|
|
19382
19372
|
easyEdaJson.packageDetail.dataStr.shape.filter((shape) => shape.type === "VIA").forEach((v, index) => {
|
|
19383
19373
|
circuitElements.push(handleVia(v, index));
|
|
@@ -21239,6 +21229,7 @@ var inferPinAttributes = (pinLabels) => {
|
|
|
21239
21229
|
var generateTypescriptComponent = ({
|
|
21240
21230
|
pinLabels,
|
|
21241
21231
|
pinAttributes,
|
|
21232
|
+
internallyConnectedPins,
|
|
21242
21233
|
componentName,
|
|
21243
21234
|
objUrl,
|
|
21244
21235
|
stepUrl,
|
|
@@ -21307,6 +21298,8 @@ ${pinAttributesString}
|
|
|
21307
21298
|
|
|
21308
21299
|
` : "";
|
|
21309
21300
|
const pinAttributesProp = pinAttributesString ? ` pinAttributes={pinAttributes}
|
|
21301
|
+
` : "";
|
|
21302
|
+
const internallyConnectedPinsProp = internallyConnectedPins !== void 0 ? ` internallyConnectedPins={${JSON.stringify(internallyConnectedPins)}}
|
|
21310
21303
|
` : "";
|
|
21311
21304
|
const polarizedPinLabelsString = Object.entries(polarizedPinLabels ?? {}).map(([pin, labels]) => ` ${pin}: ${JSON.stringify(labels)}`).join(",\n");
|
|
21312
21305
|
const polarizedPinLabelsBlock = polarizedPinLabels ? `const pinLabels = {
|
|
@@ -21394,7 +21387,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: PushButtonProps<typ
|
|
|
21394
21387
|
pinLabels={pinLabels}
|
|
21395
21388
|
${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
21396
21389
|
manufacturerPartNumber=${manufacturerPartNumberTsx}
|
|
21397
|
-
${pinAttributesProp} footprint={${footprintTsx}}
|
|
21390
|
+
${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
|
|
21398
21391
|
${objUrl || stepUrl ? `cadModel={{
|
|
21399
21392
|
${cadModelLines}
|
|
21400
21393
|
}}` : ""}
|
|
@@ -21421,7 +21414,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: SwitchProps) => {
|
|
|
21421
21414
|
pinLabels={pinLabels}
|
|
21422
21415
|
${symbolProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
21423
21416
|
manufacturerPartNumber=${manufacturerPartNumberTsx}
|
|
21424
|
-
${pinAttributesProp} footprint={${footprintTsx}}
|
|
21417
|
+
${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
|
|
21425
21418
|
${objUrl || stepUrl ? `cadModel={{
|
|
21426
21419
|
${cadModelLines}
|
|
21427
21420
|
}}` : ""}
|
|
@@ -21549,7 +21542,7 @@ ${pinAttributesBlock}export const ${componentName} = (props: ConnectorProps) =>
|
|
|
21549
21542
|
pinLabels={pinLabels}
|
|
21550
21543
|
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
21551
21544
|
manufacturerPartNumber=${manufacturerPartNumberTsx}
|
|
21552
|
-
${pinAttributesProp} footprint={${footprintTsx}}
|
|
21545
|
+
${pinAttributesProp}${internallyConnectedPinsProp} footprint={${footprintTsx}}
|
|
21553
21546
|
${objUrl || stepUrl ? `cadModel={{
|
|
21554
21547
|
${cadModelLines}
|
|
21555
21548
|
}}` : ""}
|
|
@@ -21569,7 +21562,7 @@ ${pinLabelsString}
|
|
|
21569
21562
|
${pinAttributesBlock}export const ${componentName} = (props: ChipProps<typeof pinLabels>) => {
|
|
21570
21563
|
return (
|
|
21571
21564
|
<chip
|
|
21572
|
-
${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
21565
|
+
${useSymbolPortsOnly ? "" : " pinLabels={pinLabels}\n"}${pinAttributesProp}${internallyConnectedPinsProp}${symbolProp}${schPinArrangementProp} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
21573
21566
|
manufacturerPartNumber=${manufacturerPartNumberTsx}
|
|
21574
21567
|
footprint={${footprintTsx}}
|
|
21575
21568
|
${objUrl || stepUrl ? `cadModel={{
|
|
@@ -21806,18 +21799,21 @@ var getVisibleSchematicPinArrangement = (betterEasy) => {
|
|
|
21806
21799
|
};
|
|
21807
21800
|
var convertRawEasyToTsx = async ({
|
|
21808
21801
|
rawEasy,
|
|
21809
|
-
pinAttributes
|
|
21802
|
+
pinAttributes,
|
|
21803
|
+
internallyConnectedPins
|
|
21810
21804
|
}) => {
|
|
21811
21805
|
const betterEasy = EasyEdaJsonSchema.parse(rawEasy);
|
|
21812
21806
|
const result = await convertBetterEasyToTsx({
|
|
21813
21807
|
betterEasy,
|
|
21814
|
-
pinAttributes
|
|
21808
|
+
pinAttributes,
|
|
21809
|
+
internallyConnectedPins
|
|
21815
21810
|
});
|
|
21816
21811
|
return result;
|
|
21817
21812
|
};
|
|
21818
21813
|
var convertBetterEasyToTsx = async ({
|
|
21819
21814
|
betterEasy,
|
|
21820
|
-
pinAttributes
|
|
21815
|
+
pinAttributes,
|
|
21816
|
+
internallyConnectedPins
|
|
21821
21817
|
}) => {
|
|
21822
21818
|
const cadPlacement = await getEasyEdaCadModelPlacement(betterEasy);
|
|
21823
21819
|
const { circuitJson, resolvedPinAttributes } = convertEasyEdaJsonToCircuitJsonWithPinAttributes(betterEasy, {
|
|
@@ -21900,6 +21896,7 @@ var convertBetterEasyToTsx = async ({
|
|
|
21900
21896
|
manufacturerPartNumber,
|
|
21901
21897
|
pinLabels,
|
|
21902
21898
|
pinAttributes: resolvedPinAttributes,
|
|
21899
|
+
internallyConnectedPins,
|
|
21903
21900
|
objUrl: modelObjUrl,
|
|
21904
21901
|
stepUrl: modelStepUrl,
|
|
21905
21902
|
circuitJson,
|