@tscircuit/core 0.0.963 → 0.0.965

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
@@ -462,6 +462,10 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
462
462
  * like Symbol in the hierarchy.
463
463
  */
464
464
  getParentNormalComponent(): any | null;
465
+ /**
466
+ * Emit a warning when coveredWithSolderMask is true but solderMaskMargin is also set
467
+ */
468
+ emitSolderMaskMarginWarning(isCoveredWithSolderMask: boolean, solderMaskMargin: number | undefined): void;
465
469
  /**
466
470
  * Compute the PCB bounds of this component the circuit json elements
467
471
  * associated with it.
package/dist/index.js CHANGED
@@ -1054,6 +1054,22 @@ var PrimitiveComponent2 = class extends Renderable {
1054
1054
  }
1055
1055
  return null;
1056
1056
  }
1057
+ /**
1058
+ * Emit a warning when coveredWithSolderMask is true but solderMaskMargin is also set
1059
+ */
1060
+ emitSolderMaskMarginWarning(isCoveredWithSolderMask, solderMaskMargin) {
1061
+ if (isCoveredWithSolderMask && solderMaskMargin !== void 0) {
1062
+ const parentNormalComponent = this.getParentNormalComponent();
1063
+ if (parentNormalComponent?.source_component_id) {
1064
+ this.root.db.source_property_ignored_warning.insert({
1065
+ source_component_id: parentNormalComponent.source_component_id,
1066
+ property_name: "solderMaskMargin",
1067
+ message: `solderMaskMargin is set but coveredWithSolderMask is true. When a component is fully covered with solder mask, a margin doesn't apply.`,
1068
+ error_type: "source_property_ignored_warning"
1069
+ });
1070
+ }
1071
+ }
1072
+ }
1057
1073
  /**
1058
1074
  * Compute the PCB bounds of this component the circuit json elements
1059
1075
  * associated with it.
@@ -2186,6 +2202,7 @@ var SmtPad = class extends PrimitiveComponent2 {
2186
2202
  const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
2187
2203
  const shouldCreateSolderPaste = !isCoveredWithSolderMask;
2188
2204
  const soldermaskMargin = props.solderMaskMargin;
2205
+ this.emitSolderMaskMarginWarning(isCoveredWithSolderMask, soldermaskMargin);
2189
2206
  const subcircuit = this.getSubcircuit();
2190
2207
  const position = this._getGlobalPcbPositionBeforeLayout();
2191
2208
  const globalTransform = this._computePcbGlobalTransformBeforeLayout();
@@ -2802,6 +2819,7 @@ var PlatedHole = class extends PrimitiveComponent2 {
2802
2819
  const subcircuit = this.getSubcircuit();
2803
2820
  const soldermaskMargin = props.solderMaskMargin;
2804
2821
  const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
2822
+ this.emitSolderMaskMarginWarning(isCoveredWithSolderMask, soldermaskMargin);
2805
2823
  if (props.shape === "circle") {
2806
2824
  const pcb_plated_hole = db.pcb_plated_hole.insert({
2807
2825
  pcb_component_id,
@@ -3109,6 +3127,7 @@ var Hole = class extends PrimitiveComponent2 {
3109
3127
  const soldermaskMargin = props.solderMaskMargin;
3110
3128
  const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
3111
3129
  const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
3130
+ this.emitSolderMaskMarginWarning(isCoveredWithSolderMask, soldermaskMargin);
3112
3131
  if (props.shape === "pill") {
3113
3132
  if (props.pcbRotation && props.pcbRotation !== 0) {
3114
3133
  const inserted_hole = db.pcb_hole.insert({
@@ -20773,7 +20792,7 @@ import { identity as identity5 } from "transformation-matrix";
20773
20792
  var package_default = {
20774
20793
  name: "@tscircuit/core",
20775
20794
  type: "module",
20776
- version: "0.0.962",
20795
+ version: "0.0.964",
20777
20796
  types: "dist/index.d.ts",
20778
20797
  main: "dist/index.js",
20779
20798
  module: "dist/index.js",
@@ -20835,7 +20854,7 @@ var package_default = {
20835
20854
  "circuit-json-to-gltf": "^0.0.31",
20836
20855
  "circuit-json-to-simple-3d": "^0.0.9",
20837
20856
  "circuit-json-to-spice": "^0.0.33",
20838
- "circuit-to-svg": "^0.0.307",
20857
+ "circuit-to-svg": "^0.0.313",
20839
20858
  concurrently: "^9.1.2",
20840
20859
  "connectivity-map": "^1.0.0",
20841
20860
  debug: "^4.3.6",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.963",
4
+ "version": "0.0.965",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -63,7 +63,7 @@
63
63
  "circuit-json-to-gltf": "^0.0.31",
64
64
  "circuit-json-to-simple-3d": "^0.0.9",
65
65
  "circuit-json-to-spice": "^0.0.33",
66
- "circuit-to-svg": "^0.0.307",
66
+ "circuit-to-svg": "^0.0.313",
67
67
  "concurrently": "^9.1.2",
68
68
  "connectivity-map": "^1.0.0",
69
69
  "debug": "^4.3.6",