@tscircuit/core 0.0.440 → 0.0.442

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 +18 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -476,7 +476,18 @@ var cssSelectPrimitiveComponentAdapterOnlySubcircuits = {
476
476
 
477
477
  // lib/components/base-components/PrimitiveComponent/preprocessSelector.ts
478
478
  var preprocessSelector = (selector) => {
479
- return selector.replace(/ pin/g, " port").replace(/ subcircuit\./g, " group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g, "$1 > $2").trim();
479
+ if (/net\.[^\s>]*\./.test(selector)) {
480
+ throw new Error(
481
+ 'Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3'
482
+ );
483
+ }
484
+ return selector.replace(/ pin/g, " port").replace(/ subcircuit\./g, " group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g, "$1 > $2").replace(
485
+ /(^|[ >])(?!pin\.)(?!port\.)(?!net\.)([A-Z][A-Za-z0-9_-]*)\.([A-Za-z0-9_-]+)/g,
486
+ (_, sep, name, pin) => {
487
+ const pinPart = /^\d+$/.test(pin) ? `pin${pin}` : pin;
488
+ return `${sep}.${name} > .${pinPart}`;
489
+ }
490
+ ).trim();
480
491
  };
481
492
 
482
493
  // lib/components/base-components/PrimitiveComponent/PrimitiveComponent.ts
@@ -1591,6 +1602,11 @@ var Net = class extends PrimitiveComponent2 {
1591
1602
  var createNetsFromProps = (component, props) => {
1592
1603
  for (const prop of props) {
1593
1604
  if (typeof prop === "string" && prop.startsWith("net.")) {
1605
+ if (/net\.[^\s>]*\./.test(prop)) {
1606
+ throw new Error(
1607
+ 'Net names cannot contain a period, try using "sel.net..." to autocomplete with conventional net names, e.g. V3_3'
1608
+ );
1609
+ }
1594
1610
  const subcircuit = component.getSubcircuit();
1595
1611
  if (!subcircuit.selectOne(prop)) {
1596
1612
  const net = new Net({
@@ -9381,7 +9397,7 @@ import { identity as identity4 } from "transformation-matrix";
9381
9397
  var package_default = {
9382
9398
  name: "@tscircuit/core",
9383
9399
  type: "module",
9384
- version: "0.0.439",
9400
+ version: "0.0.441",
9385
9401
  types: "dist/index.d.ts",
9386
9402
  main: "dist/index.js",
9387
9403
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.440",
4
+ "version": "0.0.442",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",