@tscircuit/core 0.0.862 → 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 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
@@ -17804,7 +17839,7 @@ import { identity as identity6 } from "transformation-matrix";
17804
17839
  var package_default = {
17805
17840
  name: "@tscircuit/core",
17806
17841
  type: "module",
17807
- version: "0.0.861",
17842
+ version: "0.0.862",
17808
17843
  types: "dist/index.d.ts",
17809
17844
  main: "dist/index.js",
17810
17845
  module: "dist/index.js",
@@ -17862,7 +17897,7 @@ var package_default = {
17862
17897
  "bun-match-svg": "0.0.12",
17863
17898
  "calculate-elbow": "^0.0.12",
17864
17899
  "chokidar-cli": "^3.0.0",
17865
- "circuit-json": "^0.0.306",
17900
+ "circuit-json": "^0.0.307",
17866
17901
  "circuit-json-to-bpc": "^0.0.13",
17867
17902
  "circuit-json-to-connectivity-map": "^0.0.22",
17868
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.862",
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.306",
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",