@tscircuit/core 0.0.1439 → 0.0.1441

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
@@ -1,7 +1,7 @@
1
1
  import * as circuit_json from 'circuit-json';
2
2
  import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, PcbTrace as PcbTrace$1, PcbVia as PcbVia$1, PcbTraceRoutePoint, AnySourceComponent, PcbComponent, SchematicPort, SchematicComponent, PcbSilkscreenGraphic, RouteHintPoint, CircuitJson } from 'circuit-json';
3
3
  import * as _tscircuit_props from '@tscircuit/props';
4
- import { PlatformConfig, traceProps, netProps, AutorouterProp, AutoroutingPhaseProps, subcircuitGroupProps, AutorouterConfig, PcbSx, portProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, ammeterProps, resistorProps, constraintProps, drcCheckProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, silkscreenGraphicProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicSheetProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, spicemodelProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
4
+ import { PlatformConfig, traceProps, netProps, AutorouterProp, AutoroutingPhaseProps, subcircuitGroupProps, AutorouterConfig, PcbSx, portProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, ammeterProps, resistorProps, constraintProps, drcCheckProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, silkscreenGraphicProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, CrystalPinLabels, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicSheetProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, spicemodelProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
5
5
  export { kicadFootprintStrings } from '@tscircuit/props';
6
6
  import * as react from 'react';
7
7
  import react__default, { ReactElement } from 'react';
@@ -79191,7 +79191,7 @@ declare class NetLabel extends PrimitiveComponent<typeof netLabelProps> {
79191
79191
  schematic_net_label_id?: string;
79192
79192
  get config(): {
79193
79193
  componentName: string;
79194
- zodProps: zod.ZodObject<{
79194
+ zodProps: zod.ZodEffects<zod.ZodObject<{
79195
79195
  net: zod.ZodOptional<zod.ZodString>;
79196
79196
  connection: zod.ZodOptional<zod.ZodString>;
79197
79197
  connectsTo: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodArray<zod.ZodString, "many">]>>;
@@ -79215,6 +79215,22 @@ declare class NetLabel extends PrimitiveComponent<typeof netLabelProps> {
79215
79215
  net?: string | undefined;
79216
79216
  connection?: string | undefined;
79217
79217
  anchorSide?: "left" | "right" | "top" | "bottom" | undefined;
79218
+ }>, {
79219
+ schX?: number | undefined;
79220
+ schY?: number | undefined;
79221
+ schRotation?: number | undefined;
79222
+ connectsTo?: string | string[] | undefined;
79223
+ net?: string | undefined;
79224
+ connection?: string | undefined;
79225
+ anchorSide?: "left" | "right" | "top" | "bottom" | undefined;
79226
+ }, {
79227
+ schX?: string | number | undefined;
79228
+ schY?: string | number | undefined;
79229
+ schRotation?: string | number | undefined;
79230
+ connectsTo?: string | string[] | undefined;
79231
+ net?: string | undefined;
79232
+ connection?: string | undefined;
79233
+ anchorSide?: "left" | "right" | "top" | "bottom" | undefined;
79218
79234
  }>;
79219
79235
  };
79220
79236
  _getAnchorSide(): "top" | "bottom" | "left" | "right";
@@ -123395,7 +123411,8 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
123395
123411
  doInitialSourceRender(): void;
123396
123412
  }
123397
123413
 
123398
- declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPassivePorts> {
123414
+ type CrystalPorts = CrystalPinLabels;
123415
+ declare class Crystal extends NormalComponent<typeof crystalProps, CrystalPorts> {
123399
123416
  get config(): {
123400
123417
  schematicSymbolName: string;
123401
123418
  componentName: string;
@@ -126763,7 +126780,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
126763
126780
  mpn: zod.ZodOptional<zod.ZodString>;
126764
126781
  pinVariant: zod.ZodOptional<zod.ZodEnum<["two_pin", "four_pin"]>>;
126765
126782
  schOrientation: zod.ZodOptional<zod.ZodEnum<["vertical", "horizontal", "pos_top", "pos_bottom", "pos_left", "pos_right", "neg_top", "neg_bottom", "neg_left", "neg_right"]>>;
126766
- connections: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["pin1", "left", "pin2", "right"]>, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
126783
+ connections: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<["pin1", "left", "pin2", "right", "pin3", "pin4"]>, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
126767
126784
  }, "strip", zod.ZodTypeAny, {
126768
126785
  name: string;
126769
126786
  frequency: number;
@@ -127344,7 +127361,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
127344
127361
  manufacturerPartNumber?: string | undefined;
127345
127362
  schSectionName?: string | undefined;
127346
127363
  schSheetName?: string | undefined;
127347
- connections?: Partial<Record<"left" | "right" | "pin1" | "pin2", string | readonly string[] | string[]>> | undefined;
127364
+ connections?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "pin3" | "pin4", string | readonly string[] | string[]>> | undefined;
127348
127365
  schOrientation?: "vertical" | "horizontal" | "pos_top" | "pos_bottom" | "pos_left" | "pos_right" | "neg_top" | "neg_bottom" | "neg_left" | "neg_right" | undefined;
127349
127366
  pinVariant?: "two_pin" | "four_pin" | undefined;
127350
127367
  maxTraceLength?: number | undefined;
@@ -127931,7 +127948,7 @@ declare class Crystal extends NormalComponent<typeof crystalProps, PolarizedPass
127931
127948
  manufacturerPartNumber?: string | undefined;
127932
127949
  schSectionName?: string | undefined;
127933
127950
  schSheetName?: string | undefined;
127934
- connections?: Partial<Record<"left" | "right" | "pin1" | "pin2", string | readonly string[] | string[]>> | undefined;
127951
+ connections?: Partial<Record<"left" | "right" | "pin1" | "pin2" | "pin3" | "pin4", string | readonly string[] | string[]>> | undefined;
127935
127952
  schOrientation?: "vertical" | "horizontal" | "pos_top" | "pos_bottom" | "pos_left" | "pos_right" | "neg_top" | "neg_bottom" | "neg_left" | "neg_right" | undefined;
127936
127953
  pinVariant?: "two_pin" | "four_pin" | undefined;
127937
127954
  maxTraceLength?: string | number | undefined;
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.1438",
22567
+ version: "0.0.1440",
22561
22568
  types: "dist/index.d.ts",
22562
22569
  main: "dist/index.js",
22563
22570
  module: "dist/index.js",
@@ -22606,7 +22613,7 @@ var package_default = {
22606
22613
  "@tscircuit/math-utils": "^0.0.36",
22607
22614
  "@tscircuit/miniflex": "^0.0.4",
22608
22615
  "@tscircuit/ngspice-spice-engine": "^0.0.19",
22609
- "@tscircuit/props": "^0.0.574",
22616
+ "@tscircuit/props": "^0.0.577",
22610
22617
  "@tscircuit/schematic-match-adapt": "^0.0.18",
22611
22618
  "@tscircuit/schematic-trace-solver": "^0.0.96",
22612
22619
  "@tscircuit/solver-utils": "^0.0.16",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1439",
4
+ "version": "0.0.1441",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "@tscircuit/math-utils": "^0.0.36",
51
51
  "@tscircuit/miniflex": "^0.0.4",
52
52
  "@tscircuit/ngspice-spice-engine": "^0.0.19",
53
- "@tscircuit/props": "^0.0.574",
53
+ "@tscircuit/props": "^0.0.577",
54
54
  "@tscircuit/schematic-match-adapt": "^0.0.18",
55
55
  "@tscircuit/schematic-trace-solver": "^0.0.96",
56
56
  "@tscircuit/solver-utils": "^0.0.16",