@tscircuit/3d-viewer 0.0.388 → 0.0.389

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -10
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -15075,10 +15075,10 @@ var size = z4.object({
15075
15075
  height: z4.number()
15076
15076
  });
15077
15077
  expectTypesMatch(true);
15078
- var randomId = (length4) => {
15078
+ var randomId = (length3) => {
15079
15079
  const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
15080
15080
  return Array.from(
15081
- { length: length4 },
15081
+ { length: length3 },
15082
15082
  () => chars[Math.floor(Math.random() * chars.length)]
15083
15083
  ).join("");
15084
15084
  };
@@ -15840,6 +15840,9 @@ var pcb_circular_hole_with_rect_pad = z65.object({
15840
15840
  hole_diameter: z65.number(),
15841
15841
  rect_pad_width: z65.number(),
15842
15842
  rect_pad_height: z65.number(),
15843
+ rect_border_radius: z65.number().optional(),
15844
+ hole_offset_x: distance.default(0),
15845
+ hole_offset_y: distance.default(0),
15843
15846
  x: distance,
15844
15847
  y: distance,
15845
15848
  layers: z65.array(layer_ref),
@@ -15859,6 +15862,7 @@ var pcb_pill_hole_with_rect_pad = z65.object({
15859
15862
  hole_height: z65.number(),
15860
15863
  rect_pad_width: z65.number(),
15861
15864
  rect_pad_height: z65.number(),
15865
+ rect_border_radius: z65.number().optional(),
15862
15866
  x: distance,
15863
15867
  y: distance,
15864
15868
  layers: z65.array(layer_ref),
@@ -15879,6 +15883,7 @@ var pcb_rotated_pill_hole_with_rect_pad = z65.object({
15879
15883
  hole_ccw_rotation: rotation,
15880
15884
  rect_pad_width: z65.number(),
15881
15885
  rect_pad_height: z65.number(),
15886
+ rect_border_radius: z65.number().optional(),
15882
15887
  rect_ccw_rotation: rotation,
15883
15888
  x: distance,
15884
15889
  y: distance,
@@ -15938,6 +15943,7 @@ var pcb_smtpad_rect = z67.object({
15938
15943
  y: distance,
15939
15944
  width: z67.number(),
15940
15945
  height: z67.number(),
15946
+ rect_border_radius: z67.number().optional(),
15941
15947
  layer: layer_ref,
15942
15948
  port_hints: z67.array(z67.string()).optional(),
15943
15949
  pcb_component_id: z67.string().optional(),
@@ -15953,6 +15959,7 @@ var pcb_smtpad_rotated_rect = z67.object({
15953
15959
  y: distance,
15954
15960
  width: z67.number(),
15955
15961
  height: z67.number(),
15962
+ rect_border_radius: z67.number().optional(),
15956
15963
  ccw_rotation: rotation,
15957
15964
  layer: layer_ref,
15958
15965
  port_hints: z67.array(z67.string()).optional(),
@@ -16289,6 +16296,18 @@ var pcb_silkscreen_text = z81.object({
16289
16296
  font_size: distance.default("0.2mm"),
16290
16297
  pcb_component_id: z81.string(),
16291
16298
  text: z81.string(),
16299
+ is_knockout: z81.boolean().default(false).optional(),
16300
+ knockout_padding: z81.object({
16301
+ left: length,
16302
+ top: length,
16303
+ bottom: length,
16304
+ right: length
16305
+ }).default({
16306
+ left: "0.2mm",
16307
+ top: "0.2mm",
16308
+ bottom: "0.2mm",
16309
+ right: "0.2mm"
16310
+ }).optional(),
16292
16311
  ccw_rotation: z81.number().optional(),
16293
16312
  layer: layer_ref,
16294
16313
  is_mirrored: z81.boolean().default(false).optional(),
@@ -25893,7 +25912,7 @@ var AnyCadComponent = ({
25893
25912
  })?.name;
25894
25913
  }, [circuitJson, cad_component2.source_component_id]);
25895
25914
  const url = cad_component2.model_obj_url ?? cad_component2.model_wrl_url ?? cad_component2.model_stl_url;
25896
- const gltfUrl = cad_component2.model_gltf_url;
25915
+ const gltfUrl = cad_component2.model_glb_url ?? cad_component2.model_gltf_url;
25897
25916
  const rotationOffset = cad_component2.rotation ? tuple(
25898
25917
  cad_component2.rotation.x * Math.PI / 180,
25899
25918
  cad_component2.rotation.y * Math.PI / 180,
@@ -26002,7 +26021,7 @@ import * as THREE11 from "three";
26002
26021
  // package.json
26003
26022
  var package_default = {
26004
26023
  name: "@tscircuit/3d-viewer",
26005
- version: "0.0.387",
26024
+ version: "0.0.388",
26006
26025
  main: "./dist/index.js",
26007
26026
  module: "./dist/index.js",
26008
26027
  type: "module",
@@ -26049,7 +26068,7 @@ var package_default = {
26049
26068
  "@storybook/blocks": "9.0.0-alpha.17",
26050
26069
  "@storybook/react-vite": "^9.1.5",
26051
26070
  "@tscircuit/circuit-json-util": "^0.0.67",
26052
- "@tscircuit/core": "^0.0.720",
26071
+ "@tscircuit/core": "^0.0.723",
26053
26072
  "@tscircuit/props": "^0.0.327",
26054
26073
  "@types/jsdom": "^21.1.7",
26055
26074
  "@types/react": "19",
@@ -26058,7 +26077,7 @@ var package_default = {
26058
26077
  "@vitejs/plugin-react": "^4.3.4",
26059
26078
  "bun-match-svg": "^0.0.9",
26060
26079
  "bun-types": "1.2.1",
26061
- "circuit-json": "0.0.249",
26080
+ "circuit-json": "0.0.252",
26062
26081
  "circuit-to-svg": "^0.0.179",
26063
26082
  debug: "^4.4.0",
26064
26083
  "jscad-electronics": "^0.0.38",
@@ -26068,7 +26087,7 @@ var package_default = {
26068
26087
  "react-use-gesture": "^9.1.3",
26069
26088
  semver: "^7.7.0",
26070
26089
  "strip-ansi": "^7.1.0",
26071
- tscircuit: "^0.0.630",
26090
+ tscircuit: "^0.0.642",
26072
26091
  tsup: "^8.3.6",
26073
26092
  typescript: "^5.7.3",
26074
26093
  vite: "^7.1.5",
@@ -26717,7 +26736,7 @@ var CadViewerContainer = forwardRef2(
26717
26736
  // src/hooks/use-convert-children-to-soup.ts
26718
26737
  import { Circuit } from "@tscircuit/core";
26719
26738
  import { useMemo as useMemo14 } from "react";
26720
- var useConvertChildrenToSoup = (children) => {
26739
+ var useConvertChildrenToCircuitJson = (children) => {
26721
26740
  return useMemo14(() => {
26722
26741
  if (!children) return [];
26723
26742
  const circuit = new Circuit();
@@ -28180,7 +28199,7 @@ var CadViewerJscad = forwardRef3(
28180
28199
  clickToInteractEnabled,
28181
28200
  onUserInteraction
28182
28201
  }, ref) => {
28183
- const childrenSoup = useConvertChildrenToSoup(children);
28202
+ const childrenSoup = useConvertChildrenToCircuitJson(children);
28184
28203
  const internalCircuitJson = useMemo17(() => {
28185
28204
  const cj = soup ?? circuitJson;
28186
28205
  return cj ?? childrenSoup;
@@ -29483,7 +29502,7 @@ var CadViewerManifold = ({
29483
29502
  onUserInteraction,
29484
29503
  children
29485
29504
  }) => {
29486
- const childrenCircuitJson = useConvertChildrenToSoup(children);
29505
+ const childrenCircuitJson = useConvertChildrenToCircuitJson(children);
29487
29506
  const circuitJson = useMemo19(() => {
29488
29507
  return circuitJsonProp ?? childrenCircuitJson;
29489
29508
  }, [circuitJsonProp, childrenCircuitJson]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.388",
3
+ "version": "0.0.389",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",
@@ -47,7 +47,7 @@
47
47
  "@storybook/blocks": "9.0.0-alpha.17",
48
48
  "@storybook/react-vite": "^9.1.5",
49
49
  "@tscircuit/circuit-json-util": "^0.0.67",
50
- "@tscircuit/core": "^0.0.720",
50
+ "@tscircuit/core": "^0.0.723",
51
51
  "@tscircuit/props": "^0.0.327",
52
52
  "@types/jsdom": "^21.1.7",
53
53
  "@types/react": "19",
@@ -56,7 +56,7 @@
56
56
  "@vitejs/plugin-react": "^4.3.4",
57
57
  "bun-match-svg": "^0.0.9",
58
58
  "bun-types": "1.2.1",
59
- "circuit-json": "0.0.249",
59
+ "circuit-json": "0.0.252",
60
60
  "circuit-to-svg": "^0.0.179",
61
61
  "debug": "^4.4.0",
62
62
  "jscad-electronics": "^0.0.38",
@@ -66,7 +66,7 @@
66
66
  "react-use-gesture": "^9.1.3",
67
67
  "semver": "^7.7.0",
68
68
  "strip-ansi": "^7.1.0",
69
- "tscircuit": "^0.0.630",
69
+ "tscircuit": "^0.0.642",
70
70
  "tsup": "^8.3.6",
71
71
  "typescript": "^5.7.3",
72
72
  "vite": "^7.1.5",