@tscircuit/footprinter 0.0.202 → 0.0.203

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
@@ -1011,6 +1011,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1011
1011
  imperial: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
1012
1012
  w: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
1013
1013
  h: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
1014
+ textbottom: z.ZodOptional<z.ZodBoolean>;
1014
1015
  }, "strip", z.ZodTypeAny, {
1015
1016
  tht: boolean;
1016
1017
  w?: number | undefined;
@@ -1020,6 +1021,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1020
1021
  metric?: number | undefined;
1021
1022
  imperial?: number | undefined;
1022
1023
  h?: number | undefined;
1024
+ textbottom?: boolean | undefined;
1023
1025
  }, {
1024
1026
  tht: boolean;
1025
1027
  w?: string | number | undefined;
@@ -1029,6 +1031,7 @@ declare const any_footprinter_def: z.ZodUnion<[z.ZodObject<{
1029
1031
  metric?: string | number | undefined;
1030
1032
  imperial?: string | number | undefined;
1031
1033
  h?: string | number | undefined;
1034
+ textbottom?: boolean | undefined;
1032
1035
  }>, z.ZodObject<{
1033
1036
  w: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
1034
1037
  h: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
@@ -1141,7 +1144,7 @@ declare const footprintSizes: StandardSize[];
1141
1144
  type FootprinterParamsBuilder<K extends string> = {
1142
1145
  [P in K | "params" | "soup" | "circuitJson"]: P extends "params" | "soup" | "circuitJson" ? Footprinter[P] : (v?: number | string | boolean) => FootprinterParamsBuilder<K>;
1143
1146
  };
1144
- type CommonPassiveOptionKey = "metric" | "imperial" | "tht" | "p" | "pw" | "ph" | "w" | "h";
1147
+ type CommonPassiveOptionKey = "metric" | "imperial" | "tht" | "p" | "pw" | "ph" | "w" | "h" | "textbottom";
1145
1148
  type Footprinter = {
1146
1149
  dip: (num_pins?: number) => FootprinterParamsBuilder<"w" | "p" | "id" | "od" | "wide" | "narrow">;
1147
1150
  cap: () => FootprinterParamsBuilder<CommonPassiveOptionKey>;
package/dist/index.js CHANGED
@@ -386,10 +386,11 @@ var passive_def = z2.object({
386
386
  metric: distance.optional(),
387
387
  imperial: distance.optional(),
388
388
  w: length.optional(),
389
- h: length.optional()
389
+ h: length.optional(),
390
+ textbottom: z2.boolean().optional()
390
391
  });
391
392
  var passive = (params) => {
392
- let { tht, p, pw, ph, metric, imperial, w, h } = params;
393
+ let { tht, p, pw, ph, metric, imperial, w, h, textbottom } = params;
393
394
  if (typeof w === "string") w = mm2(w);
394
395
  if (typeof h === "string") h = mm2(h);
395
396
  if (typeof p === "string") p = mm2(p);
@@ -426,7 +427,8 @@ var passive = (params) => {
426
427
  stroke_width: 0.1,
427
428
  pcb_silkscreen_path_id: ""
428
429
  };
429
- const silkscreenRefText = silkscreenRef(0, ph / 2 + 0.9, 0.2);
430
+ const textY = textbottom ? -ph / 2 - 0.9 : ph / 2 + 0.9;
431
+ const silkscreenRefText = silkscreenRef(0, textY, 0.2);
430
432
  if (tht) {
431
433
  return [
432
434
  platedhole(1, -p / 2, 0, pw, pw * 1 / 0.8),
@@ -6973,7 +6975,7 @@ var string2 = (def) => {
6973
6975
  const m = s.match(/([a-z]+)([\(\d\.\+\?].*)?/);
6974
6976
  const [_, fn, v] = m ?? [];
6975
6977
  if (v?.includes("?")) return null;
6976
- return { fn: m?.[1], v: m?.[2] };
6978
+ return { fn, v: m?.[2] };
6977
6979
  }).filter(isNotNull);
6978
6980
  for (const { fn, v } of def_parts) {
6979
6981
  fp2 = fp2[fn](v);