@tscircuit/props 0.0.604 → 0.0.606

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/README.md CHANGED
@@ -393,6 +393,8 @@ export interface BoardProps extends Omit<
393
393
  bottomSilkscreenColor?: BoardColor;
394
394
  /** Whether the board should be assembled on both sides */
395
395
  doubleSidedAssembly?: boolean;
396
+ /** Whether vias may be placed inside PCB pads */
397
+ isViaInPadAllowed?: boolean;
396
398
  /** Whether this board should be omitted from the schematic view */
397
399
  schematicDisabled?: boolean;
398
400
  }
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
3
  import * as react from 'react';
4
4
  import { ReactElement, ReactNode } from 'react';
5
- import { LayerRef, AnyCircuitElement, LayerRefInput, SourceNet, PcbPort, SourcePort, PcbComponent, SourceComponentBase, CircuitJsonError, Point as Point$1, RouteHintPoint, PcbTrace, AnySourceComponent, VisibleLayer, RouteHintPointInput } from 'circuit-json';
5
+ import { LayerRef, AnyCircuitElement, LayerRefInput, SourceNet, PcbPort, SourcePort, PcbComponent, SourceComponentBase, CircuitJsonError, Point as Point$1, RouteHintPoint, PcbTrace, AnySourceComponent, InsertionDirectionInput, VisibleLayer, RouteHintPointInput } from 'circuit-json';
6
6
 
7
7
  declare const direction: z.ZodEnum<["up", "down", "left", "right"]>;
8
8
  type Direction = "up" | "down" | "left" | "right";
@@ -24705,6 +24705,8 @@ interface BoardProps extends Omit<SubcircuitGroupProps, "subcircuit" | "connecti
24705
24705
  bottomSilkscreenColor?: BoardColor;
24706
24706
  /** Whether the board should be assembled on both sides */
24707
24707
  doubleSidedAssembly?: boolean;
24708
+ /** Whether vias may be placed inside PCB pads */
24709
+ isViaInPadAllowed?: boolean;
24708
24710
  /** Whether this board should be omitted from the schematic view */
24709
24711
  schematicDisabled?: boolean;
24710
24712
  }
@@ -25498,6 +25500,7 @@ declare const boardProps: z.ZodObject<Omit<{
25498
25500
  topSilkscreenColor: z.ZodOptional<z.ZodType<BoardColor, z.ZodTypeDef, BoardColor>>;
25499
25501
  bottomSilkscreenColor: z.ZodOptional<z.ZodType<BoardColor, z.ZodTypeDef, BoardColor>>;
25500
25502
  doubleSidedAssembly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
25503
+ isViaInPadAllowed: z.ZodOptional<z.ZodBoolean>;
25501
25504
  schematicDisabled: z.ZodOptional<z.ZodBoolean>;
25502
25505
  }, "strip", z.ZodTypeAny, {
25503
25506
  layers: 1 | 2 | 4 | 6 | 8 | 10;
@@ -25834,6 +25837,7 @@ declare const boardProps: z.ZodObject<Omit<{
25834
25837
  silkscreenColor?: BoardColor | undefined;
25835
25838
  topSilkscreenColor?: BoardColor | undefined;
25836
25839
  bottomSilkscreenColor?: BoardColor | undefined;
25840
+ isViaInPadAllowed?: boolean | undefined;
25837
25841
  schematicDisabled?: boolean | undefined;
25838
25842
  }, {
25839
25843
  symbol?: SymbolProp | undefined;
@@ -26174,6 +26178,7 @@ declare const boardProps: z.ZodObject<Omit<{
26174
26178
  topSilkscreenColor?: BoardColor | undefined;
26175
26179
  bottomSilkscreenColor?: BoardColor | undefined;
26176
26180
  doubleSidedAssembly?: boolean | undefined;
26181
+ isViaInPadAllowed?: boolean | undefined;
26177
26182
  schematicDisabled?: boolean | undefined;
26178
26183
  }>;
26179
26184
 
@@ -90143,6 +90148,7 @@ declare const stampboardProps: z.ZodObject<Omit<{
90143
90148
  topSilkscreenColor: z.ZodOptional<z.ZodType<BoardColor, z.ZodTypeDef, BoardColor>>;
90144
90149
  bottomSilkscreenColor: z.ZodOptional<z.ZodType<BoardColor, z.ZodTypeDef, BoardColor>>;
90145
90150
  doubleSidedAssembly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
90151
+ isViaInPadAllowed: z.ZodOptional<z.ZodBoolean>;
90146
90152
  schematicDisabled: z.ZodOptional<z.ZodBoolean>;
90147
90153
  } & {
90148
90154
  leftPinCount: z.ZodOptional<z.ZodNumber>;
@@ -90494,6 +90500,7 @@ declare const stampboardProps: z.ZodObject<Omit<{
90494
90500
  silkscreenColor?: BoardColor | undefined;
90495
90501
  topSilkscreenColor?: BoardColor | undefined;
90496
90502
  bottomSilkscreenColor?: BoardColor | undefined;
90503
+ isViaInPadAllowed?: boolean | undefined;
90497
90504
  schematicDisabled?: boolean | undefined;
90498
90505
  leftPins?: string[] | undefined;
90499
90506
  rightPins?: string[] | undefined;
@@ -90844,6 +90851,7 @@ declare const stampboardProps: z.ZodObject<Omit<{
90844
90851
  topSilkscreenColor?: BoardColor | undefined;
90845
90852
  bottomSilkscreenColor?: BoardColor | undefined;
90846
90853
  doubleSidedAssembly?: boolean | undefined;
90854
+ isViaInPadAllowed?: boolean | undefined;
90847
90855
  schematicDisabled?: boolean | undefined;
90848
90856
  leftPins?: string[] | undefined;
90849
90857
  rightPins?: string[] | undefined;
@@ -104982,8 +104990,18 @@ declare const differentialPairProps: z.ZodObject<{
104982
104990
  maxLengthSkew?: number | undefined;
104983
104991
  }>;
104984
104992
 
104985
- type FootprintInsertionDirection = "from_above" | "from_left" | "from_right" | "from_front" | "from_back";
104986
- declare const footprintInsertionDirection: z.ZodEnum<["from_above", "from_left", "from_right", "from_front", "from_back"]>;
104993
+ /**
104994
+ * Direction a cable or mating part is attached from, named for the side of the
104995
+ * footprint it approaches from.
104996
+ *
104997
+ * Aliased to Circuit JSON's input union so the two cannot drift apart. Both the
104998
+ * named spellings and their Cartesian equivalents are accepted here, as are the
104999
+ * deprecated `from_front` (now `from_top`) and `from_back` (now `from_bottom`).
105000
+ * Core normalizes them to the six named values before writing
105001
+ * `pcb_component.insertion_direction`.
105002
+ */
105003
+ type FootprintInsertionDirection = InsertionDirectionInput;
105004
+ declare const footprintInsertionDirection: z.ZodEnum<["from_left", "from_right", "from_top", "from_bottom", "from_above", "from_below", "from_x_neg", "from_x_pos", "from_y_pos", "from_y_neg", "from_z_pos", "from_z_neg", "from_front", "from_back"]>;
104987
105005
  interface FootprintProps {
104988
105006
  children?: any;
104989
105007
  name?: string;
@@ -105007,8 +105025,21 @@ interface FootprintProps {
105007
105025
  */
105008
105026
  src?: FootprintProp;
105009
105027
  /**
105010
- * Direction a cable or mating part is inserted into this footprint in its
105011
- * unrotated orientation.
105028
+ * Direction a cable or mating part is attached from, in the footprint's own
105029
+ * frame -- the same frame its pads are drawn in. Directions are named for the
105030
+ * footprint as drawn in the 2D PCB view: `from_top` is +Y, `from_bottom` -Y,
105031
+ * `from_left` -X, `from_right` +X, `from_above` +Z and `from_below` -Z.
105032
+ * Cartesian spellings such as `from_y_pos` are also accepted.
105033
+ *
105034
+ * This names a side, not a motion. A receptacle on the +Y edge is `from_top`
105035
+ * because that is the side the plug comes from, even though the plug itself
105036
+ * moves in -Y as it seats.
105037
+ *
105038
+ * This is a property of the part, so it is authored without regard to where
105039
+ * the part is placed. Rotating or flipping the component rotates this with it,
105040
+ * and `pcb_component.insertion_direction` reports the result in board
105041
+ * coordinates. The two frames coincide for an unrotated top-layer part, which
105042
+ * makes the distinction easy to miss.
105012
105043
  */
105013
105044
  insertionDirection?: FootprintInsertionDirection;
105014
105045
  }
@@ -105026,14 +105057,14 @@ declare const footprintProps: z.ZodObject<{
105026
105057
  }>>>;
105027
105058
  circuitJson: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
105028
105059
  src: z.ZodOptional<z.ZodType<FootprintProp, z.ZodTypeDef, FootprintProp>>;
105029
- insertionDirection: z.ZodOptional<z.ZodEnum<["from_above", "from_left", "from_right", "from_front", "from_back"]>>;
105060
+ insertionDirection: z.ZodOptional<z.ZodEnum<["from_left", "from_right", "from_top", "from_bottom", "from_above", "from_below", "from_x_neg", "from_x_pos", "from_y_pos", "from_y_neg", "from_z_pos", "from_z_neg", "from_front", "from_back"]>>;
105030
105061
  }, "strip", z.ZodTypeAny, {
105031
105062
  name?: string | undefined;
105032
105063
  children?: any;
105033
105064
  circuitJson?: any[] | undefined;
105034
105065
  originalLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8" | undefined;
105035
105066
  src?: FootprintProp | undefined;
105036
- insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
105067
+ insertionDirection?: "from_left" | "from_right" | "from_top" | "from_bottom" | "from_above" | "from_below" | "from_x_neg" | "from_x_pos" | "from_y_pos" | "from_y_neg" | "from_z_pos" | "from_z_neg" | "from_front" | "from_back" | undefined;
105037
105068
  }, {
105038
105069
  name?: string | undefined;
105039
105070
  children?: any;
@@ -105042,7 +105073,7 @@ declare const footprintProps: z.ZodObject<{
105042
105073
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | "inner7" | "inner8";
105043
105074
  } | undefined;
105044
105075
  src?: FootprintProp | undefined;
105045
- insertionDirection?: "from_above" | "from_left" | "from_right" | "from_front" | "from_back" | undefined;
105076
+ insertionDirection?: "from_left" | "from_right" | "from_top" | "from_bottom" | "from_above" | "from_below" | "from_x_neg" | "from_x_pos" | "from_y_pos" | "from_y_neg" | "from_z_pos" | "from_z_neg" | "from_front" | "from_back" | undefined;
105046
105077
  }>;
105047
105078
  type FootprintPropsInput = z.input<typeof footprintProps>;
105048
105079
 
package/dist/index.js CHANGED
@@ -16565,6 +16565,9 @@ var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
16565
16565
  topSilkscreenColor: boardColor.optional(),
16566
16566
  bottomSilkscreenColor: boardColor.optional(),
16567
16567
  doubleSidedAssembly: z42.boolean().optional().default(false),
16568
+ isViaInPadAllowed: z42.boolean().optional().describe(
16569
+ "Allows intentional via-in-pad designs to pass DRC. Omitted or false keeps via-in-pad disallowed."
16570
+ ),
16568
16571
  schematicDisabled: z42.boolean().optional()
16569
16572
  });
16570
16573
  expectTypesMatch(true);
@@ -17402,12 +17405,24 @@ var differentialPairProps = z72.object({
17402
17405
  expectTypesMatch(true);
17403
17406
 
17404
17407
  // lib/components/footprint.ts
17405
- import { layer_ref as layer_ref6 } from "circuit-json";
17408
+ import {
17409
+ layer_ref as layer_ref6
17410
+ } from "circuit-json";
17406
17411
  import { z as z73 } from "zod";
17407
17412
  var footprintInsertionDirection = z73.enum([
17408
- "from_above",
17409
17413
  "from_left",
17410
17414
  "from_right",
17415
+ "from_top",
17416
+ "from_bottom",
17417
+ "from_above",
17418
+ "from_below",
17419
+ "from_x_neg",
17420
+ "from_x_pos",
17421
+ "from_y_pos",
17422
+ "from_y_neg",
17423
+ "from_z_pos",
17424
+ "from_z_neg",
17425
+ // Deprecated, accepted so existing sources keep type-checking.
17411
17426
  "from_front",
17412
17427
  "from_back"
17413
17428
  ]);
@@ -17419,7 +17434,7 @@ var footprintProps = z73.object({
17419
17434
  circuitJson: z73.array(z73.any()).optional(),
17420
17435
  src: footprintProp.describe("Can be a footprint or kicad string").optional(),
17421
17436
  insertionDirection: footprintInsertionDirection.optional().describe(
17422
- "Direction a cable or mating part is inserted into this footprint in its unrotated orientation."
17437
+ "Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."
17423
17438
  )
17424
17439
  });
17425
17440
  expectTypesMatch(true);