@tscircuit/core 0.0.861 → 0.0.863
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 +5 -0
- package/dist/index.js +66 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2719,6 +2719,7 @@ declare class Board extends Group<typeof boardProps> {
|
|
|
2719
2719
|
}
|
|
2720
2720
|
|
|
2721
2721
|
declare class Panel extends Group<typeof panelProps> {
|
|
2722
|
+
pcb_panel_id: string | null;
|
|
2722
2723
|
get config(): {
|
|
2723
2724
|
componentName: string;
|
|
2724
2725
|
zodProps: zod.ZodObject<Omit<{
|
|
@@ -3731,8 +3732,12 @@ declare class Panel extends Group<typeof panelProps> {
|
|
|
3731
3732
|
}>;
|
|
3732
3733
|
};
|
|
3733
3734
|
get isGroup(): boolean;
|
|
3735
|
+
get isSubcircuit(): boolean;
|
|
3734
3736
|
add(component: PrimitiveComponent): void;
|
|
3735
3737
|
runRenderCycle(): void;
|
|
3738
|
+
doInitialPcbComponentRender(): void;
|
|
3739
|
+
updatePcbComponentRender(): void;
|
|
3740
|
+
removePcbComponentRender(): void;
|
|
3736
3741
|
}
|
|
3737
3742
|
|
|
3738
3743
|
declare class Capacitor extends NormalComponent<typeof capacitorProps, PolarizedPassivePorts> {
|
package/dist/index.js
CHANGED
|
@@ -14150,7 +14150,9 @@ var Board = class extends Group6 {
|
|
|
14150
14150
|
|
|
14151
14151
|
// lib/components/normal-components/Panel.ts
|
|
14152
14152
|
import { panelProps } from "@tscircuit/props";
|
|
14153
|
+
import { distance as distance7 } from "circuit-json";
|
|
14153
14154
|
var Panel = class extends Group6 {
|
|
14155
|
+
pcb_panel_id = null;
|
|
14154
14156
|
get config() {
|
|
14155
14157
|
return {
|
|
14156
14158
|
componentName: "Panel",
|
|
@@ -14160,6 +14162,9 @@ var Panel = class extends Group6 {
|
|
|
14160
14162
|
get isGroup() {
|
|
14161
14163
|
return true;
|
|
14162
14164
|
}
|
|
14165
|
+
get isSubcircuit() {
|
|
14166
|
+
return true;
|
|
14167
|
+
}
|
|
14163
14168
|
add(component) {
|
|
14164
14169
|
if (component.lowercaseComponentName !== "board") {
|
|
14165
14170
|
throw new Error("<panel> can only contain <board> elements");
|
|
@@ -14172,6 +14177,36 @@ var Panel = class extends Group6 {
|
|
|
14172
14177
|
}
|
|
14173
14178
|
super.runRenderCycle();
|
|
14174
14179
|
}
|
|
14180
|
+
doInitialPcbComponentRender() {
|
|
14181
|
+
super.doInitialPcbComponentRender();
|
|
14182
|
+
if (this.root?.pcbDisabled) return;
|
|
14183
|
+
const { db } = this.root;
|
|
14184
|
+
const props = this._parsedProps;
|
|
14185
|
+
const inserted = db.pcb_panel.insert({
|
|
14186
|
+
width: distance7.parse(props.width),
|
|
14187
|
+
height: distance7.parse(props.height),
|
|
14188
|
+
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
14189
|
+
covered_with_solder_mask: !(props.noSolderMask ?? false)
|
|
14190
|
+
});
|
|
14191
|
+
this.pcb_panel_id = inserted.pcb_panel_id;
|
|
14192
|
+
}
|
|
14193
|
+
updatePcbComponentRender() {
|
|
14194
|
+
if (this.root?.pcbDisabled) return;
|
|
14195
|
+
if (!this.pcb_panel_id) return;
|
|
14196
|
+
const { db } = this.root;
|
|
14197
|
+
const props = this._parsedProps;
|
|
14198
|
+
db.pcb_panel.update(this.pcb_panel_id, {
|
|
14199
|
+
width: distance7.parse(props.width),
|
|
14200
|
+
height: distance7.parse(props.height),
|
|
14201
|
+
center: this._getGlobalPcbPositionBeforeLayout(),
|
|
14202
|
+
covered_with_solder_mask: !(props.noSolderMask ?? false)
|
|
14203
|
+
});
|
|
14204
|
+
}
|
|
14205
|
+
removePcbComponentRender() {
|
|
14206
|
+
if (!this.pcb_panel_id) return;
|
|
14207
|
+
this.root?.db.pcb_panel.delete(this.pcb_panel_id);
|
|
14208
|
+
this.pcb_panel_id = null;
|
|
14209
|
+
}
|
|
14175
14210
|
};
|
|
14176
14211
|
|
|
14177
14212
|
// lib/components/normal-components/Capacitor.ts
|
|
@@ -15862,6 +15897,32 @@ function inflateSourceInductor(sourceElm, inflatorContext) {
|
|
|
15862
15897
|
}
|
|
15863
15898
|
}
|
|
15864
15899
|
|
|
15900
|
+
// lib/components/primitive-components/Group/Subcircuit/inflators/inflateSourceDiode.ts
|
|
15901
|
+
function inflateSourceDiode(sourceElm, inflatorContext) {
|
|
15902
|
+
const { injectionDb, subcircuit, groupsMap } = inflatorContext;
|
|
15903
|
+
const pcbElm = injectionDb.pcb_component.getWhere({
|
|
15904
|
+
source_component_id: sourceElm.source_component_id
|
|
15905
|
+
});
|
|
15906
|
+
const cadElm = injectionDb.cad_component.getWhere({
|
|
15907
|
+
source_component_id: sourceElm.source_component_id
|
|
15908
|
+
});
|
|
15909
|
+
const diode = new Diode({
|
|
15910
|
+
name: sourceElm.name
|
|
15911
|
+
});
|
|
15912
|
+
if (pcbElm) {
|
|
15913
|
+
inflatePcbComponent(pcbElm, {
|
|
15914
|
+
...inflatorContext,
|
|
15915
|
+
normalComponent: diode
|
|
15916
|
+
});
|
|
15917
|
+
}
|
|
15918
|
+
if (sourceElm.source_group_id && groupsMap?.has(sourceElm.source_group_id)) {
|
|
15919
|
+
const group = groupsMap.get(sourceElm.source_group_id);
|
|
15920
|
+
group.add(diode);
|
|
15921
|
+
} else {
|
|
15922
|
+
subcircuit.add(diode);
|
|
15923
|
+
}
|
|
15924
|
+
}
|
|
15925
|
+
|
|
15865
15926
|
// lib/components/primitive-components/Group/Subcircuit/Subcircuit.ts
|
|
15866
15927
|
var Subcircuit = class extends Group6 {
|
|
15867
15928
|
constructor(props) {
|
|
@@ -15913,6 +15974,9 @@ var Subcircuit = class extends Group6 {
|
|
|
15913
15974
|
case "simple_inductor":
|
|
15914
15975
|
inflateSourceInductor(sourceComponent, inflationCtx);
|
|
15915
15976
|
break;
|
|
15977
|
+
case "simple_diode":
|
|
15978
|
+
inflateSourceDiode(sourceComponent, inflationCtx);
|
|
15979
|
+
break;
|
|
15916
15980
|
case "simple_chip":
|
|
15917
15981
|
inflateSourceChip(sourceComponent, inflationCtx);
|
|
15918
15982
|
break;
|
|
@@ -17775,7 +17839,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
17775
17839
|
var package_default = {
|
|
17776
17840
|
name: "@tscircuit/core",
|
|
17777
17841
|
type: "module",
|
|
17778
|
-
version: "0.0.
|
|
17842
|
+
version: "0.0.862",
|
|
17779
17843
|
types: "dist/index.d.ts",
|
|
17780
17844
|
main: "dist/index.js",
|
|
17781
17845
|
module: "dist/index.js",
|
|
@@ -17833,7 +17897,7 @@ var package_default = {
|
|
|
17833
17897
|
"bun-match-svg": "0.0.12",
|
|
17834
17898
|
"calculate-elbow": "^0.0.12",
|
|
17835
17899
|
"chokidar-cli": "^3.0.0",
|
|
17836
|
-
"circuit-json": "^0.0.
|
|
17900
|
+
"circuit-json": "^0.0.307",
|
|
17837
17901
|
"circuit-json-to-bpc": "^0.0.13",
|
|
17838
17902
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
17839
17903
|
"circuit-json-to-gltf": "^0.0.31",
|
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.863",
|
|
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
|
"bun-match-svg": "0.0.12",
|
|
60
60
|
"calculate-elbow": "^0.0.12",
|
|
61
61
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
62
|
+
"circuit-json": "^0.0.307",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.31",
|