@tscircuit/core 0.0.471 → 0.0.472

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -546,8 +546,7 @@ var PrimitiveComponent2 = class extends Renderable {
546
546
  * components share the same names) unless you explicitly break out some ports
547
547
  */
548
548
  get isSubcircuit() {
549
- return Boolean(this.props.subcircuit) || // Implied opaque group for top-level group
550
- this.lowercaseComponentName === "group" && this?.parent?.isRoot;
549
+ return Boolean(this.props.subcircuit) || this.lowercaseComponentName === "group" && this?.parent?.isRoot;
551
550
  }
552
551
  get isGroup() {
553
552
  return this.lowercaseComponentName === "group";
@@ -9838,7 +9837,7 @@ import { identity as identity4 } from "transformation-matrix";
9838
9837
  var package_default = {
9839
9838
  name: "@tscircuit/core",
9840
9839
  type: "module",
9841
- version: "0.0.470",
9840
+ version: "0.0.471",
9842
9841
  types: "dist/index.d.ts",
9843
9842
  main: "dist/index.js",
9844
9843
  module: "dist/index.js",
@@ -9979,23 +9978,17 @@ var RootCircuit = class {
9979
9978
  }
9980
9979
  _guessRootComponent() {
9981
9980
  if (this.firstChild) return;
9982
- if (this.children.length === 1) {
9983
- this.firstChild = this.children[0];
9984
- return;
9985
- }
9986
9981
  if (this.children.length === 0) {
9987
9982
  throw new Error(
9988
9983
  "Not able to guess root component: RootCircuit has no children (use circuit.add(...))"
9989
9984
  );
9990
9985
  }
9991
- if (this.children.length > 0) {
9992
- const board = this.children.find((c) => c.componentName === "Board") ?? null;
9993
- if (board) {
9994
- this.firstChild = board;
9995
- return;
9996
- }
9986
+ if (this.children.length === 1 && this.children[0].isGroup) {
9987
+ this.firstChild = this.children[0];
9988
+ return;
9997
9989
  }
9998
- const group = new Group({ subcircuit: false });
9990
+ const group = new Group({ subcircuit: true });
9991
+ group.parent = this;
9999
9992
  group.addAll(this.children);
10000
9993
  this.children = [group];
10001
9994
  this.firstChild = group;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.471",
4
+ "version": "0.0.472",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",