@tscircuit/core 0.0.663 → 0.0.665
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 +7 -0
- package/dist/index.js +26 -5
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7570,6 +7570,7 @@ interface VoltageSourceProps extends CommonComponentProps {
|
|
|
7570
7570
|
peakToPeakVoltage?: number | string;
|
|
7571
7571
|
waveShape?: WaveShape;
|
|
7572
7572
|
phase?: number | string;
|
|
7573
|
+
dutyCycle?: number;
|
|
7573
7574
|
}
|
|
7574
7575
|
declare const voltageSourceProps: z.ZodObject<{
|
|
7575
7576
|
pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -7859,6 +7860,7 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
7859
7860
|
peakToPeakVoltage: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
7860
7861
|
waveShape: z.ZodOptional<z.ZodEnum<["sinewave", "square", "triangle", "sawtooth"]>>;
|
|
7861
7862
|
phase: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
7863
|
+
dutyCycle: z.ZodOptional<z.ZodNumber>;
|
|
7862
7864
|
}, "strip", z.ZodTypeAny, {
|
|
7863
7865
|
name: string;
|
|
7864
7866
|
children?: any;
|
|
@@ -7887,6 +7889,7 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
7887
7889
|
}> | undefined;
|
|
7888
7890
|
peakToPeakVoltage?: number | undefined;
|
|
7889
7891
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
7892
|
+
dutyCycle?: number | undefined;
|
|
7890
7893
|
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
7891
7894
|
cadModel?: string | {
|
|
7892
7895
|
stlUrl: string;
|
|
@@ -7973,6 +7976,7 @@ declare const voltageSourceProps: z.ZodObject<{
|
|
|
7973
7976
|
}> | undefined;
|
|
7974
7977
|
peakToPeakVoltage?: string | number | undefined;
|
|
7975
7978
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
7979
|
+
dutyCycle?: number | undefined;
|
|
7976
7980
|
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
7977
7981
|
cadModel?: string | {
|
|
7978
7982
|
stlUrl: string;
|
|
@@ -8322,6 +8326,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
8322
8326
|
peakToPeakVoltage: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
8323
8327
|
waveShape: z.ZodOptional<z.ZodEnum<["sinewave", "square", "triangle", "sawtooth"]>>;
|
|
8324
8328
|
phase: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
8329
|
+
dutyCycle: z.ZodOptional<z.ZodNumber>;
|
|
8325
8330
|
}, "strip", z.ZodTypeAny, {
|
|
8326
8331
|
name: string;
|
|
8327
8332
|
children?: any;
|
|
@@ -8350,6 +8355,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
8350
8355
|
}> | undefined;
|
|
8351
8356
|
peakToPeakVoltage?: number | undefined;
|
|
8352
8357
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
8358
|
+
dutyCycle?: number | undefined;
|
|
8353
8359
|
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
8354
8360
|
cadModel?: string | {
|
|
8355
8361
|
stlUrl: string;
|
|
@@ -8436,6 +8442,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
|
|
|
8436
8442
|
}> | undefined;
|
|
8437
8443
|
peakToPeakVoltage?: string | number | undefined;
|
|
8438
8444
|
waveShape?: "square" | "sinewave" | "triangle" | "sawtooth" | undefined;
|
|
8445
|
+
dutyCycle?: number | undefined;
|
|
8439
8446
|
supplierPartNumbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
8440
8447
|
cadModel?: string | {
|
|
8441
8448
|
stlUrl: string;
|
package/dist/index.js
CHANGED
|
@@ -10949,6 +10949,23 @@ var Group6 = class extends NormalComponent {
|
|
|
10949
10949
|
if (props.matchAdapt) return "match-adapt";
|
|
10950
10950
|
if (props.flex) return "flex";
|
|
10951
10951
|
if (props.grid) return "grid";
|
|
10952
|
+
const groupHasCoords = props.pcbX !== void 0 || props.pcbY !== void 0;
|
|
10953
|
+
const hasManualEdits = (props.manualEdits?.pcb_placements?.length ?? 0) > 0;
|
|
10954
|
+
const anyDirectChildHasPcbCoords = this.children.some((child) => {
|
|
10955
|
+
const childProps = child._parsedProps;
|
|
10956
|
+
return childProps?.pcbX !== void 0 || childProps?.pcbY !== void 0;
|
|
10957
|
+
});
|
|
10958
|
+
if (anyDirectChildHasPcbCoords) return "none";
|
|
10959
|
+
const unpositionedDirectChildrenCount = this.children.reduce(
|
|
10960
|
+
(count, child) => {
|
|
10961
|
+
const childProps = child._parsedProps;
|
|
10962
|
+
const hasCoords = childProps?.pcbX !== void 0 || childProps?.pcbY !== void 0;
|
|
10963
|
+
return count + (hasCoords ? 0 : 1);
|
|
10964
|
+
},
|
|
10965
|
+
0
|
|
10966
|
+
);
|
|
10967
|
+
if (!groupHasCoords && !hasManualEdits && unpositionedDirectChildrenCount > 1)
|
|
10968
|
+
return "pack";
|
|
10952
10969
|
return "none";
|
|
10953
10970
|
}
|
|
10954
10971
|
doInitialPcbLayout() {
|
|
@@ -12059,13 +12076,15 @@ var voltageSourceProps = commonComponentProps.extend({
|
|
|
12059
12076
|
frequency: frequency.optional(),
|
|
12060
12077
|
peakToPeakVoltage: voltage.optional(),
|
|
12061
12078
|
waveShape: z12.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
12062
|
-
phase: rotation2.optional()
|
|
12079
|
+
phase: rotation2.optional(),
|
|
12080
|
+
dutyCycle: z12.number().optional()
|
|
12063
12081
|
});
|
|
12064
12082
|
var VoltageSource = class extends NormalComponent {
|
|
12065
12083
|
get config() {
|
|
12084
|
+
const isSquare = this.props.waveShape === "square";
|
|
12066
12085
|
return {
|
|
12067
12086
|
componentName: "VoltageSource",
|
|
12068
|
-
schematicSymbolName: "ac_voltmeter",
|
|
12087
|
+
schematicSymbolName: isSquare ? "square_wave" : "ac_voltmeter",
|
|
12069
12088
|
zodProps: voltageSourceProps,
|
|
12070
12089
|
sourceFtype: "simple_voltage_source"
|
|
12071
12090
|
};
|
|
@@ -12100,6 +12119,7 @@ var VoltageSource = class extends NormalComponent {
|
|
|
12100
12119
|
peak_to_peak_voltage: props.peakToPeakVoltage,
|
|
12101
12120
|
wave_shape: props.waveShape,
|
|
12102
12121
|
phase: props.phase,
|
|
12122
|
+
duty_cycle: props.dutyCycle,
|
|
12103
12123
|
supplier_part_numbers: props.supplierPartNumbers,
|
|
12104
12124
|
are_pins_interchangeable: true
|
|
12105
12125
|
});
|
|
@@ -12119,7 +12139,8 @@ var VoltageSource = class extends NormalComponent {
|
|
|
12119
12139
|
frequency: props.frequency,
|
|
12120
12140
|
peak_to_peak_voltage: props.peakToPeakVoltage,
|
|
12121
12141
|
wave_shape: props.waveShape,
|
|
12122
|
-
phase: props.phase
|
|
12142
|
+
phase: props.phase,
|
|
12143
|
+
duty_cycle: props.dutyCycle
|
|
12123
12144
|
});
|
|
12124
12145
|
}
|
|
12125
12146
|
terminal1 = this.portMap.terminal1;
|
|
@@ -13826,7 +13847,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
13826
13847
|
var package_default = {
|
|
13827
13848
|
name: "@tscircuit/core",
|
|
13828
13849
|
type: "module",
|
|
13829
|
-
version: "0.0.
|
|
13850
|
+
version: "0.0.664",
|
|
13830
13851
|
types: "dist/index.d.ts",
|
|
13831
13852
|
main: "dist/index.js",
|
|
13832
13853
|
module: "dist/index.js",
|
|
@@ -13895,7 +13916,7 @@ var package_default = {
|
|
|
13895
13916
|
"pkg-pr-new": "^0.0.37",
|
|
13896
13917
|
react: "^19.1.0",
|
|
13897
13918
|
"react-dom": "^19.1.0",
|
|
13898
|
-
"schematic-symbols": "^0.0.
|
|
13919
|
+
"schematic-symbols": "^0.0.195",
|
|
13899
13920
|
"ts-expect": "^1.3.0",
|
|
13900
13921
|
tsup: "^8.2.4"
|
|
13901
13922
|
},
|
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.665",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"pkg-pr-new": "^0.0.37",
|
|
71
71
|
"react": "^19.1.0",
|
|
72
72
|
"react-dom": "^19.1.0",
|
|
73
|
-
"schematic-symbols": "^0.0.
|
|
73
|
+
"schematic-symbols": "^0.0.195",
|
|
74
74
|
"ts-expect": "^1.3.0",
|
|
75
75
|
"tsup": "^8.2.4"
|
|
76
76
|
},
|