@tscircuit/core 0.0.1438 → 0.0.1440

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 +10 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1927,8 +1927,15 @@ var PrimitiveComponent2 = class extends Renderable {
1927
1927
  if (this.canHaveTextChildren || textContent.trim() === "") {
1928
1928
  return;
1929
1929
  }
1930
+ const parentName = this._parsedProps?.name;
1931
+ const parentDescriptor = parentName ? `<${this.componentName} name="${parentName}">` : `<${this.componentName}>`;
1932
+ const isNaNValuedText = /^NaN/.test(textContent.trim());
1933
+ const nanHint = isNaNValuedText ? ` This looks like a numeric expression that evaluated to NaN (e.g. \`\${value}${textContent.trim().replace(
1934
+ /^NaN/,
1935
+ ""
1936
+ )}\` where \`value\` is NaN) \u2014 check the computation that produces this value.` : "";
1930
1937
  throw new Error(
1931
- `Invalid JSX Element: Expected a React component but received text "${textContent}"`
1938
+ `Invalid JSX Element: ${parentDescriptor} received stray text "${textContent}" as a child, but it cannot hold text children. Remove the text or wrap it in an appropriate component.${nanHint}`
1932
1939
  );
1933
1940
  }
1934
1941
  if (Object.keys(component).length === 0) {
@@ -22557,7 +22564,7 @@ function Group_getRoutingPhasePlans(group) {
22557
22564
  var package_default = {
22558
22565
  name: "@tscircuit/core",
22559
22566
  type: "module",
22560
- version: "0.0.1437",
22567
+ version: "0.0.1439",
22561
22568
  types: "dist/index.d.ts",
22562
22569
  main: "dist/index.js",
22563
22570
  module: "dist/index.js",
@@ -22590,7 +22597,7 @@ var package_default = {
22590
22597
  "@resvg/resvg-js": "^2.6.2",
22591
22598
  "@tscircuit/alphabet": "0.0.25",
22592
22599
  "@tscircuit/breakout-point-solver": "github:tscircuit/breakout-point-solver#bac9629",
22593
- "@tscircuit/capacity-autorouter": "^0.0.665",
22600
+ "@tscircuit/capacity-autorouter": "^0.0.670",
22594
22601
  "@tscircuit/checks": "0.0.142",
22595
22602
  "@tscircuit/circuit-json-util": "^0.0.97",
22596
22603
  "@tscircuit/common": "^0.0.20",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1438",
4
+ "version": "0.0.1440",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -34,7 +34,7 @@
34
34
  "@resvg/resvg-js": "^2.6.2",
35
35
  "@tscircuit/alphabet": "0.0.25",
36
36
  "@tscircuit/breakout-point-solver": "github:tscircuit/breakout-point-solver#bac9629",
37
- "@tscircuit/capacity-autorouter": "^0.0.665",
37
+ "@tscircuit/capacity-autorouter": "^0.0.670",
38
38
  "@tscircuit/checks": "0.0.142",
39
39
  "@tscircuit/circuit-json-util": "^0.0.97",
40
40
  "@tscircuit/common": "^0.0.20",