@tscircuit/core 0.0.862 → 0.0.864

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
@@ -1932,7 +1932,6 @@ var SmtPad = class extends PrimitiveComponent2 {
1932
1932
  const { _parsedProps: props } = this;
1933
1933
  const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
1934
1934
  const shouldCreateSolderPaste = !isCoveredWithSolderMask;
1935
- if (!props.portHints) return;
1936
1935
  const subcircuit = this.getSubcircuit();
1937
1936
  const position = this._getGlobalPcbPositionBeforeLayout();
1938
1937
  const globalTransform = this._computePcbGlobalTransformBeforeLayout();
@@ -1950,6 +1949,7 @@ var SmtPad = class extends PrimitiveComponent2 {
1950
1949
  if (isFlipped) {
1951
1950
  finalRotationDegrees = (360 - finalRotationDegrees + 360) % 360;
1952
1951
  }
1952
+ const portHints = props.portHints?.map((ph) => ph.toString()) ?? [];
1953
1953
  let pcb_smtpad = null;
1954
1954
  const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
1955
1955
  if (props.shape === "circle") {
@@ -1960,7 +1960,7 @@ var SmtPad = class extends PrimitiveComponent2 {
1960
1960
  layer: maybeFlipLayer(props.layer ?? "top"),
1961
1961
  shape: "circle",
1962
1962
  radius: props.radius,
1963
- port_hints: props.portHints.map((ph) => ph.toString()),
1963
+ port_hints: portHints,
1964
1964
  is_covered_with_solder_mask: isCoveredWithSolderMask,
1965
1965
  x: position.x,
1966
1966
  y: position.y,
@@ -1992,7 +1992,7 @@ var SmtPad = class extends PrimitiveComponent2 {
1992
1992
  x: position.x,
1993
1993
  y: position.y,
1994
1994
  ccw_rotation: finalRotationDegrees,
1995
- port_hints: props.portHints.map((ph) => ph.toString()),
1995
+ port_hints: portHints,
1996
1996
  is_covered_with_solder_mask: isCoveredWithSolderMask,
1997
1997
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
1998
1998
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
@@ -2006,7 +2006,7 @@ var SmtPad = class extends PrimitiveComponent2 {
2006
2006
  width: isRotated90Degrees ? props.height : props.width,
2007
2007
  height: isRotated90Degrees ? props.width : props.height,
2008
2008
  corner_radius: props.cornerRadius ?? void 0,
2009
- port_hints: props.portHints.map((ph) => ph.toString()),
2009
+ port_hints: portHints,
2010
2010
  is_covered_with_solder_mask: isCoveredWithSolderMask,
2011
2011
  x: position.x,
2012
2012
  y: position.y,
@@ -2059,7 +2059,7 @@ var SmtPad = class extends PrimitiveComponent2 {
2059
2059
  x: position.x,
2060
2060
  y: position.y,
2061
2061
  ccw_rotation: padRotation,
2062
- port_hints: props.portHints.map((ph) => ph.toString()),
2062
+ port_hints: portHints,
2063
2063
  is_covered_with_solder_mask: isCoveredWithSolderMask,
2064
2064
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
2065
2065
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
@@ -2096,7 +2096,7 @@ var SmtPad = class extends PrimitiveComponent2 {
2096
2096
  layer: maybeFlipLayer(props.layer ?? "top"),
2097
2097
  shape: "polygon",
2098
2098
  points: transformedPoints,
2099
- port_hints: props.portHints.map((ph) => ph.toString()),
2099
+ port_hints: portHints,
2100
2100
  is_covered_with_solder_mask: isCoveredWithSolderMask,
2101
2101
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
2102
2102
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
@@ -2113,7 +2113,7 @@ var SmtPad = class extends PrimitiveComponent2 {
2113
2113
  radius: props.radius,
2114
2114
  height: props.height,
2115
2115
  width: props.width,
2116
- port_hints: props.portHints.map((ph) => ph.toString()),
2116
+ port_hints: portHints,
2117
2117
  is_covered_with_solder_mask: isCoveredWithSolderMask,
2118
2118
  subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
2119
2119
  pcb_group_id: this.getGroup()?.pcb_group_id ?? void 0
@@ -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.863",
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.864",
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",