@tscircuit/core 0.0.379 → 0.0.381

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,5 +1,5 @@
1
1
  import * as _tscircuit_props from '@tscircuit/props';
2
- import { subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
2
+ import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
3
3
  import React, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
4
4
  export { createElement } from 'react';
5
5
  import * as zod from 'zod';
@@ -201,8 +201,11 @@ declare class RootCircuit {
201
201
  * as the display_name parameter for autorouting effects.
202
202
  */
203
203
  name?: string;
204
+ platform?: PlatformConfig;
204
205
  _hasRenderedAtleastOnce: boolean;
205
- constructor();
206
+ constructor({ platform }?: {
207
+ platform?: PlatformConfig;
208
+ });
206
209
  add(componentOrElm: PrimitiveComponent | ReactElement): void;
207
210
  /**
208
211
  * Get the main board for this Circuit.
package/dist/index.js CHANGED
@@ -746,6 +746,9 @@ var PrimitiveComponent2 = class extends Renderable {
746
746
  }
747
747
  current = current.parent;
748
748
  }
749
+ if (this.root?.platform && propertyName in this.root.platform) {
750
+ return this.root.platform[propertyName];
751
+ }
749
752
  return void 0;
750
753
  }
751
754
  get lowercaseComponentName() {
@@ -4899,7 +4902,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
4899
4902
  }
4900
4903
  }
4901
4904
  const manualPlacement = this.getSubcircuit()?._getSchematicManualPlacementForComponent(this);
4902
- if (this.schematic_component_id && this.props.schX !== void 0 && this.props.schY !== void 0 && manualPlacement) {
4905
+ if (this.schematic_component_id && (this.props.schX !== void 0 || this.props.schY !== void 0) && !!manualPlacement) {
4903
4906
  if (!this.schematic_component_id) {
4904
4907
  return;
4905
4908
  }
@@ -5031,7 +5034,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
5031
5034
  }
5032
5035
  this.pcb_component_id = pcb_component.pcb_component_id;
5033
5036
  const manualPlacement = this.getSubcircuit()._getPcbManualPlacementForComponent(this);
5034
- if (this.props.pcbX !== void 0 && this.props.pcbY !== void 0 && manualPlacement) {
5037
+ if ((this.props.pcbX !== void 0 || this.props.pcbY !== void 0) && !!manualPlacement) {
5035
5038
  const warning = pcb_manual_edit_conflict_warning.parse({
5036
5039
  type: "pcb_manual_edit_conflict_warning",
5037
5040
  pcb_manual_edit_conflict_warning_id: `pcb_manual_edit_conflict_${this.source_component_id}`,
@@ -7710,7 +7713,7 @@ import { identity as identity4 } from "transformation-matrix";
7710
7713
  var package_default = {
7711
7714
  name: "@tscircuit/core",
7712
7715
  type: "module",
7713
- version: "0.0.378",
7716
+ version: "0.0.380",
7714
7717
  types: "dist/index.d.ts",
7715
7718
  main: "dist/index.js",
7716
7719
  module: "dist/index.js",
@@ -7769,7 +7772,7 @@ var package_default = {
7769
7772
  "@tscircuit/math-utils": "^0.0.14",
7770
7773
  "@tscircuit/props": "^0.0.172",
7771
7774
  "@tscircuit/schematic-autolayout": "^0.0.6",
7772
- "circuit-json": "0.0.158",
7775
+ "circuit-json": "0.0.159",
7773
7776
  "circuit-json-to-connectivity-map": "^0.0.20",
7774
7777
  "css-select": "^5.1.0",
7775
7778
  "format-si-unit": "^0.0.3",
@@ -7799,11 +7802,13 @@ var RootCircuit = class {
7799
7802
  * as the display_name parameter for autorouting effects.
7800
7803
  */
7801
7804
  name;
7805
+ platform;
7802
7806
  _hasRenderedAtleastOnce = false;
7803
- constructor() {
7807
+ constructor({ platform } = {}) {
7804
7808
  this.children = [];
7805
7809
  this.db = su5([]);
7806
7810
  this.root = this;
7811
+ this.platform = platform;
7807
7812
  }
7808
7813
  add(componentOrElm) {
7809
7814
  let component;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.379",
4
+ "version": "0.0.381",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -60,7 +60,7 @@
60
60
  "@tscircuit/math-utils": "^0.0.14",
61
61
  "@tscircuit/props": "^0.0.172",
62
62
  "@tscircuit/schematic-autolayout": "^0.0.6",
63
- "circuit-json": "0.0.158",
63
+ "circuit-json": "0.0.159",
64
64
  "circuit-json-to-connectivity-map": "^0.0.20",
65
65
  "css-select": "^5.1.0",
66
66
  "format-si-unit": "^0.0.3",