@tscircuit/core 0.0.274 → 0.0.275

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
@@ -919,6 +919,7 @@ interface SimpleRouteJson {
919
919
  }
920
920
 
921
921
  declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps> extends NormalComponent<Props> implements ISubcircuit {
922
+ subcircuit_id?: string;
922
923
  _asyncAutoroutingResult: {
923
924
  output_simple_route_json?: SimpleRouteJson;
924
925
  output_pcb_traces?: PcbTrace[];
@@ -927,6 +928,8 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
927
928
  zodProps: Props;
928
929
  componentName: string;
929
930
  };
931
+ doInitialSourceRender(): void;
932
+ doInitialPcbComponentRender(): void;
930
933
  doInitialCreateTraceHintsFromProps(): void;
931
934
  _getSimpleRouteJsonFromPcbTraces(): SimpleRouteJson;
932
935
  doInitialSourceAddConnectivityMapKey(): void;
package/dist/index.js CHANGED
@@ -3588,6 +3588,7 @@ var getSimpleRouteJsonFromTracesAndDb = ({
3588
3588
  // lib/components/primitive-components/Group/Group.ts
3589
3589
  import Debug5 from "debug";
3590
3590
  var Group = class extends NormalComponent {
3591
+ subcircuit_id;
3591
3592
  _asyncAutoroutingResult = null;
3592
3593
  get config() {
3593
3594
  return {
@@ -3595,6 +3596,30 @@ var Group = class extends NormalComponent {
3595
3596
  componentName: "Group"
3596
3597
  };
3597
3598
  }
3599
+ doInitialSourceRender() {
3600
+ const { db } = this.root;
3601
+ const source_group = db.source_group.insert({
3602
+ name: this._parsedProps.name
3603
+ // TODO add subcircuit_id
3604
+ });
3605
+ this.subcircuit_id = `subcircuit_${source_group.source_group_id}`;
3606
+ this.source_group_id = source_group.source_group_id;
3607
+ }
3608
+ doInitialPcbComponentRender() {
3609
+ if (this.root?.pcbDisabled) return;
3610
+ const { db } = this.root;
3611
+ const { _parsedProps: props } = this;
3612
+ const pcb_group = db.pcb_group.insert({
3613
+ is_subcircuit: this.isSubcircuit,
3614
+ subcircuit_id: this.subcircuit_id,
3615
+ name: this._parsedProps.name,
3616
+ center: this._getGlobalPcbPositionBeforeLayout(),
3617
+ width: 0,
3618
+ height: 0,
3619
+ pcb_component_ids: [],
3620
+ source_group_id: this.source_group_id
3621
+ });
3622
+ }
3598
3623
  doInitialCreateTraceHintsFromProps() {
3599
3624
  const { _parsedProps: props } = this;
3600
3625
  const { db } = this.root;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.274",
4
+ "version": "0.0.275",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -57,7 +57,7 @@
57
57
  "@tscircuit/props": "^0.0.130",
58
58
  "@tscircuit/schematic-autolayout": "^0.0.6",
59
59
  "@tscircuit/soup-util": "^0.0.41",
60
- "circuit-json": "^0.0.128",
60
+ "circuit-json": "^0.0.132",
61
61
  "circuit-json-to-connectivity-map": "^0.0.17",
62
62
  "format-si-unit": "^0.0.2",
63
63
  "nanoid": "^5.0.7",