@tscircuit/pcb-viewer 1.11.292 → 1.11.293

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.js CHANGED
@@ -12373,7 +12373,7 @@ function ifSetsMatchExactly(set1, set2) {
12373
12373
 
12374
12374
  // src/components/MouseElementTracker.tsx
12375
12375
  import { useState as useState7, useMemo as useMemo5 } from "react";
12376
- import { applyToPoint as applyToPoint15, inverse as inverse5 } from "transformation-matrix";
12376
+ import { applyToPoint as applyToPoint16, inverse as inverse5 } from "transformation-matrix";
12377
12377
 
12378
12378
  // src/components/ElementOverlayBox.tsx
12379
12379
  import { useEffect as useEffect11, useState as useState6 } from "react";
@@ -13258,9 +13258,262 @@ var GroupAnchorOffsetOverlay = ({
13258
13258
  );
13259
13259
  };
13260
13260
 
13261
- // src/components/AnchorOffsetOverlay/Panel/index.tsx
13261
+ // src/components/AnchorOffsetOverlay/ComponentBoundingBox/index.tsx
13262
13262
  import { applyToPoint as applyToPoint14 } from "transformation-matrix";
13263
- import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
13263
+ import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
13264
+ var calculateComponentBoundingBox = (component, elements) => {
13265
+ const componentId = component.pcb_component_id;
13266
+ const padsAndHoles = elements.filter(
13267
+ (el) => (el.type === "pcb_smtpad" || el.type === "pcb_plated_hole") && el.pcb_component_id === componentId || el.type === "pcb_hole" && el.pcb_component_id === componentId
13268
+ );
13269
+ if (padsAndHoles.length === 0) {
13270
+ return getBoundsOfPcbElements([component]);
13271
+ }
13272
+ return getBoundsOfPcbElements(padsAndHoles);
13273
+ };
13274
+ var ComponentBoundingBoxOverlay = ({
13275
+ elements,
13276
+ highlightedPrimitives,
13277
+ transform,
13278
+ containerWidth,
13279
+ containerHeight
13280
+ }) => {
13281
+ const hoveredComponents = /* @__PURE__ */ new Map();
13282
+ for (const primitive of highlightedPrimitives) {
13283
+ if (isPcbComponent(primitive._parent_pcb_component)) {
13284
+ hoveredComponents.set(
13285
+ primitive._parent_pcb_component.pcb_component_id,
13286
+ primitive._parent_pcb_component
13287
+ );
13288
+ }
13289
+ if (isPcbComponent(primitive._element)) {
13290
+ hoveredComponents.set(
13291
+ primitive._element.pcb_component_id,
13292
+ primitive._element
13293
+ );
13294
+ }
13295
+ }
13296
+ if (hoveredComponents.size === 0) return null;
13297
+ const renderData = [];
13298
+ for (const component of hoveredComponents.values()) {
13299
+ const bbox = calculateComponentBoundingBox(component, elements);
13300
+ if (!bbox) continue;
13301
+ const groupId = component.positioned_relative_to_pcb_group_id ?? component.pcb_group_id;
13302
+ const group = groupId ? su(elements).pcb_group.get(groupId) : null;
13303
+ renderData.push({ component, bbox, group });
13304
+ }
13305
+ if (renderData.length === 0) return null;
13306
+ return /* @__PURE__ */ jsx14(
13307
+ "div",
13308
+ {
13309
+ style: {
13310
+ position: "absolute",
13311
+ left: 0,
13312
+ top: 0,
13313
+ width: containerWidth,
13314
+ height: containerHeight,
13315
+ overflow: "hidden",
13316
+ pointerEvents: "none",
13317
+ zIndex: zIndexMap.dimensionOverlay
13318
+ },
13319
+ children: /* @__PURE__ */ jsx14(
13320
+ "svg",
13321
+ {
13322
+ style: { position: "absolute", left: 0, top: 0, pointerEvents: "none" },
13323
+ width: containerWidth,
13324
+ height: containerHeight,
13325
+ children: renderData.map(({ component, bbox, group }) => {
13326
+ const topLeft = applyToPoint14(transform, {
13327
+ x: bbox.minX,
13328
+ y: bbox.maxY
13329
+ });
13330
+ const bottomRight = applyToPoint14(transform, {
13331
+ x: bbox.maxX,
13332
+ y: bbox.minY
13333
+ });
13334
+ const screenBbox = {
13335
+ x: Math.min(topLeft.x, bottomRight.x),
13336
+ y: Math.min(topLeft.y, bottomRight.y),
13337
+ width: Math.abs(bottomRight.x - topLeft.x),
13338
+ height: Math.abs(bottomRight.y - topLeft.y)
13339
+ };
13340
+ const componentCenter = component.center ?? {
13341
+ x: (bbox.minX + bbox.maxX) / 2,
13342
+ y: (bbox.minY + bbox.maxY) / 2
13343
+ };
13344
+ const componentCenterScreen = applyToPoint14(transform, componentCenter);
13345
+ const groupAnchor = group?.anchor_position;
13346
+ const groupAnchorScreen = groupAnchor ? applyToPoint14(transform, groupAnchor) : null;
13347
+ const hasGroupOffset = group && groupAnchorScreen && (component.position_mode === "relative_to_group_anchor" || component.pcb_group_id);
13348
+ let displayOffsetX = component.display_offset_x;
13349
+ let displayOffsetY = component.display_offset_y;
13350
+ if (!displayOffsetX && groupAnchor) {
13351
+ const dx = componentCenter.x - groupAnchor.x;
13352
+ displayOffsetX = `\u0394x: ${dx.toFixed(2)}mm`;
13353
+ }
13354
+ if (!displayOffsetY && groupAnchor) {
13355
+ const dy = componentCenter.y - groupAnchor.y;
13356
+ displayOffsetY = `\u0394y: ${dy.toFixed(2)}mm`;
13357
+ }
13358
+ const xLineLength = groupAnchorScreen ? Math.abs(componentCenterScreen.x - groupAnchorScreen.x) : 0;
13359
+ const yLineLength = groupAnchorScreen ? Math.abs(componentCenterScreen.y - groupAnchorScreen.y) : 0;
13360
+ const isTargetAboveAnchor = groupAnchorScreen ? componentCenterScreen.y < groupAnchorScreen.y : false;
13361
+ const isTargetRightOfAnchor = groupAnchorScreen ? componentCenterScreen.x > groupAnchorScreen.x : false;
13362
+ const xLabelOffset = isTargetAboveAnchor ? VISUAL_CONFIG.LABEL_OFFSET_ABOVE : VISUAL_CONFIG.LABEL_OFFSET_BELOW;
13363
+ const yLabelOffset = isTargetRightOfAnchor ? VISUAL_CONFIG.LABEL_OFFSET_RIGHT : VISUAL_CONFIG.LABEL_OFFSET_LEFT;
13364
+ const shouldShowXLabel = xLineLength > VISUAL_CONFIG.MIN_LINE_LENGTH_FOR_LABEL;
13365
+ const shouldShowYLabel = yLineLength > VISUAL_CONFIG.MIN_LINE_LENGTH_FOR_LABEL;
13366
+ const labelStyle = {
13367
+ color: COLORS.LABEL_TEXT,
13368
+ mixBlendMode: "difference",
13369
+ pointerEvents: "none",
13370
+ fontSize: VISUAL_CONFIG.LABEL_FONT_SIZE,
13371
+ fontFamily: "monospace",
13372
+ fontWeight: "bold"
13373
+ };
13374
+ return /* @__PURE__ */ jsxs11("g", { children: [
13375
+ /* @__PURE__ */ jsx14(
13376
+ "rect",
13377
+ {
13378
+ x: screenBbox.x,
13379
+ y: screenBbox.y,
13380
+ width: screenBbox.width,
13381
+ height: screenBbox.height,
13382
+ fill: "none",
13383
+ stroke: "white",
13384
+ strokeWidth: 1.5,
13385
+ strokeDasharray: "4,4"
13386
+ }
13387
+ ),
13388
+ /* @__PURE__ */ jsx14(
13389
+ "line",
13390
+ {
13391
+ x1: componentCenterScreen.x - 6,
13392
+ y1: componentCenterScreen.y,
13393
+ x2: componentCenterScreen.x + 6,
13394
+ y2: componentCenterScreen.y,
13395
+ stroke: COLORS.COMPONENT_MARKER_STROKE,
13396
+ strokeWidth: 1.5
13397
+ }
13398
+ ),
13399
+ /* @__PURE__ */ jsx14(
13400
+ "line",
13401
+ {
13402
+ x1: componentCenterScreen.x,
13403
+ y1: componentCenterScreen.y - 6,
13404
+ x2: componentCenterScreen.x,
13405
+ y2: componentCenterScreen.y + 6,
13406
+ stroke: COLORS.COMPONENT_MARKER_STROKE,
13407
+ strokeWidth: 1.5
13408
+ }
13409
+ ),
13410
+ /* @__PURE__ */ jsx14(
13411
+ "circle",
13412
+ {
13413
+ cx: componentCenterScreen.x,
13414
+ cy: componentCenterScreen.y,
13415
+ r: VISUAL_CONFIG.COMPONENT_MARKER_RADIUS,
13416
+ fill: COLORS.COMPONENT_MARKER_FILL,
13417
+ stroke: COLORS.COMPONENT_MARKER_STROKE,
13418
+ strokeWidth: 1
13419
+ }
13420
+ ),
13421
+ hasGroupOffset && groupAnchorScreen && /* @__PURE__ */ jsxs11(Fragment7, { children: [
13422
+ /* @__PURE__ */ jsx14(
13423
+ "line",
13424
+ {
13425
+ x1: groupAnchorScreen.x,
13426
+ y1: groupAnchorScreen.y,
13427
+ x2: componentCenterScreen.x,
13428
+ y2: groupAnchorScreen.y,
13429
+ stroke: COLORS.OFFSET_LINE,
13430
+ strokeWidth: VISUAL_CONFIG.LINE_STROKE_WIDTH,
13431
+ strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
13432
+ }
13433
+ ),
13434
+ /* @__PURE__ */ jsx14(
13435
+ "line",
13436
+ {
13437
+ x1: componentCenterScreen.x,
13438
+ y1: groupAnchorScreen.y,
13439
+ x2: componentCenterScreen.x,
13440
+ y2: componentCenterScreen.y,
13441
+ stroke: COLORS.OFFSET_LINE,
13442
+ strokeWidth: VISUAL_CONFIG.LINE_STROKE_WIDTH,
13443
+ strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
13444
+ }
13445
+ ),
13446
+ /* @__PURE__ */ jsx14(
13447
+ "line",
13448
+ {
13449
+ x1: groupAnchorScreen.x - VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
13450
+ y1: groupAnchorScreen.y,
13451
+ x2: groupAnchorScreen.x + VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
13452
+ y2: groupAnchorScreen.y,
13453
+ stroke: COLORS.OFFSET_LINE,
13454
+ strokeWidth: VISUAL_CONFIG.ANCHOR_MARKER_STROKE_WIDTH
13455
+ }
13456
+ ),
13457
+ /* @__PURE__ */ jsx14(
13458
+ "line",
13459
+ {
13460
+ x1: groupAnchorScreen.x,
13461
+ y1: groupAnchorScreen.y - VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
13462
+ x2: groupAnchorScreen.x,
13463
+ y2: groupAnchorScreen.y + VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
13464
+ stroke: COLORS.OFFSET_LINE,
13465
+ strokeWidth: VISUAL_CONFIG.ANCHOR_MARKER_STROKE_WIDTH
13466
+ }
13467
+ ),
13468
+ shouldShowXLabel && /* @__PURE__ */ jsx14(
13469
+ "foreignObject",
13470
+ {
13471
+ x: Math.min(groupAnchorScreen.x, componentCenterScreen.x),
13472
+ y: groupAnchorScreen.y + xLabelOffset,
13473
+ width: Math.abs(
13474
+ componentCenterScreen.x - groupAnchorScreen.x
13475
+ ),
13476
+ height: 20,
13477
+ style: { overflow: "visible" },
13478
+ children: /* @__PURE__ */ jsx14("div", { style: { ...labelStyle, textAlign: "center" }, children: displayOffsetX })
13479
+ }
13480
+ ),
13481
+ shouldShowYLabel && /* @__PURE__ */ jsx14(
13482
+ "foreignObject",
13483
+ {
13484
+ x: componentCenterScreen.x + yLabelOffset,
13485
+ y: Math.min(groupAnchorScreen.y, componentCenterScreen.y),
13486
+ width: 20,
13487
+ height: Math.abs(
13488
+ componentCenterScreen.y - groupAnchorScreen.y
13489
+ ),
13490
+ style: { overflow: "visible" },
13491
+ children: /* @__PURE__ */ jsx14(
13492
+ "div",
13493
+ {
13494
+ style: {
13495
+ ...labelStyle,
13496
+ display: "flex",
13497
+ alignItems: "center",
13498
+ height: "100%"
13499
+ },
13500
+ children: displayOffsetY
13501
+ }
13502
+ )
13503
+ }
13504
+ )
13505
+ ] })
13506
+ ] }, component.pcb_component_id);
13507
+ })
13508
+ }
13509
+ )
13510
+ }
13511
+ );
13512
+ };
13513
+
13514
+ // src/components/AnchorOffsetOverlay/Panel/index.tsx
13515
+ import { applyToPoint as applyToPoint15 } from "transformation-matrix";
13516
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
13264
13517
  var PanelAnchorOffsetOverlay = ({
13265
13518
  elements,
13266
13519
  highlightedPrimitives,
@@ -13306,7 +13559,7 @@ var PanelAnchorOffsetOverlay = ({
13306
13559
  });
13307
13560
  if (targetEntries.length === 0) return null;
13308
13561
  const panelAnchorScreens = /* @__PURE__ */ new Map();
13309
- return /* @__PURE__ */ jsx14(
13562
+ return /* @__PURE__ */ jsx15(
13310
13563
  "div",
13311
13564
  {
13312
13565
  style: {
@@ -13319,7 +13572,7 @@ var PanelAnchorOffsetOverlay = ({
13319
13572
  pointerEvents: "none",
13320
13573
  zIndex: zIndexMap.dimensionOverlay
13321
13574
  },
13322
- children: /* @__PURE__ */ jsxs11(
13575
+ children: /* @__PURE__ */ jsxs12(
13323
13576
  "svg",
13324
13577
  {
13325
13578
  style: {
@@ -13343,11 +13596,11 @@ var PanelAnchorOffsetOverlay = ({
13343
13596
  displayOffsetX = target.board.display_offset_x;
13344
13597
  displayOffsetY = target.board.display_offset_y;
13345
13598
  if (!panelAnchorScreens.has(anchorKey)) {
13346
- const screenPoint = applyToPoint14(transform, anchorPosition);
13599
+ const screenPoint = applyToPoint15(transform, anchorPosition);
13347
13600
  panelAnchorScreens.set(anchorKey, screenPoint);
13348
13601
  }
13349
13602
  const anchorMarkerScreen = panelAnchorScreens.get(anchorKey);
13350
- const targetScreen = applyToPoint14(transform, targetCenter);
13603
+ const targetScreen = applyToPoint15(transform, targetCenter);
13351
13604
  const offsetX = targetCenter.x - anchorPosition.x;
13352
13605
  const offsetY = targetCenter.y - anchorPosition.y;
13353
13606
  const xLineLength = Math.abs(targetScreen.x - anchorMarkerScreen.x);
@@ -13360,8 +13613,8 @@ var PanelAnchorOffsetOverlay = ({
13360
13613
  const shouldShowYLabel = yLineLength > VISUAL_CONFIG.MIN_LINE_LENGTH_FOR_LABEL;
13361
13614
  const xLabelText = `${displayOffsetX ?? offsetX.toFixed(2)}mm`;
13362
13615
  const yLabelText = `${displayOffsetY ?? offsetY.toFixed(2)}mm`;
13363
- return /* @__PURE__ */ jsxs11("g", { children: [
13364
- /* @__PURE__ */ jsx14(
13616
+ return /* @__PURE__ */ jsxs12("g", { children: [
13617
+ /* @__PURE__ */ jsx15(
13365
13618
  "line",
13366
13619
  {
13367
13620
  x1: anchorMarkerScreen.x,
@@ -13373,7 +13626,7 @@ var PanelAnchorOffsetOverlay = ({
13373
13626
  strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
13374
13627
  }
13375
13628
  ),
13376
- /* @__PURE__ */ jsx14(
13629
+ /* @__PURE__ */ jsx15(
13377
13630
  "line",
13378
13631
  {
13379
13632
  x1: targetScreen.x,
@@ -13385,7 +13638,7 @@ var PanelAnchorOffsetOverlay = ({
13385
13638
  strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
13386
13639
  }
13387
13640
  ),
13388
- /* @__PURE__ */ jsx14(
13641
+ /* @__PURE__ */ jsx15(
13389
13642
  "circle",
13390
13643
  {
13391
13644
  cx: targetScreen.x,
@@ -13396,7 +13649,7 @@ var PanelAnchorOffsetOverlay = ({
13396
13649
  strokeWidth: 1
13397
13650
  }
13398
13651
  ),
13399
- shouldShowXLabel && /* @__PURE__ */ jsx14(
13652
+ shouldShowXLabel && /* @__PURE__ */ jsx15(
13400
13653
  "foreignObject",
13401
13654
  {
13402
13655
  x: Math.min(anchorMarkerScreen.x, targetScreen.x),
@@ -13404,10 +13657,10 @@ var PanelAnchorOffsetOverlay = ({
13404
13657
  width: Math.abs(targetScreen.x - anchorMarkerScreen.x),
13405
13658
  height: 20,
13406
13659
  style: { overflow: "visible" },
13407
- children: /* @__PURE__ */ jsx14("div", { style: { ...labelStyle, textAlign: "center" }, children: xLabelText })
13660
+ children: /* @__PURE__ */ jsx15("div", { style: { ...labelStyle, textAlign: "center" }, children: xLabelText })
13408
13661
  }
13409
13662
  ),
13410
- shouldShowYLabel && /* @__PURE__ */ jsx14(
13663
+ shouldShowYLabel && /* @__PURE__ */ jsx15(
13411
13664
  "foreignObject",
13412
13665
  {
13413
13666
  x: targetScreen.x + yLabelOffset,
@@ -13415,7 +13668,7 @@ var PanelAnchorOffsetOverlay = ({
13415
13668
  width: VISUAL_CONFIG.Y_LABEL_MIN_WIDTH,
13416
13669
  height: Math.abs(targetScreen.y - anchorMarkerScreen.y),
13417
13670
  style: { overflow: "visible" },
13418
- children: /* @__PURE__ */ jsx14(
13671
+ children: /* @__PURE__ */ jsx15(
13419
13672
  "div",
13420
13673
  {
13421
13674
  style: {
@@ -13435,8 +13688,8 @@ var PanelAnchorOffsetOverlay = ({
13435
13688
  ] }, `${target.panel.pcb_panel_id}-${targetId}-${target.type}`);
13436
13689
  }),
13437
13690
  Array.from(panelAnchorScreens.entries()).map(
13438
- ([panelId, anchorScreen]) => /* @__PURE__ */ jsxs11("g", { children: [
13439
- /* @__PURE__ */ jsx14(
13691
+ ([panelId, anchorScreen]) => /* @__PURE__ */ jsxs12("g", { children: [
13692
+ /* @__PURE__ */ jsx15(
13440
13693
  "line",
13441
13694
  {
13442
13695
  x1: anchorScreen.x - VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
@@ -13447,7 +13700,7 @@ var PanelAnchorOffsetOverlay = ({
13447
13700
  strokeWidth: VISUAL_CONFIG.ANCHOR_MARKER_STROKE_WIDTH
13448
13701
  }
13449
13702
  ),
13450
- /* @__PURE__ */ jsx14(
13703
+ /* @__PURE__ */ jsx15(
13451
13704
  "line",
13452
13705
  {
13453
13706
  x1: anchorScreen.x,
@@ -13468,7 +13721,7 @@ var PanelAnchorOffsetOverlay = ({
13468
13721
  };
13469
13722
 
13470
13723
  // src/components/MouseElementTracker.tsx
13471
- import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
13724
+ import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
13472
13725
  var getPolygonBoundingBox = (points) => {
13473
13726
  if (points.length === 0) return null;
13474
13727
  let minX = points[0].x;
@@ -13614,7 +13867,7 @@ var MouseElementTracker = ({
13614
13867
  h = "h" in primitive ? primitive.h : "r" in primitive ? primitive.r * 2 : "rX" in primitive && "rY" in primitive ? primitive.rY * 2 : 0;
13615
13868
  }
13616
13869
  if (!basePoint) continue;
13617
- const screenPos = applyToPoint15(transform, basePoint);
13870
+ const screenPos = applyToPoint16(transform, basePoint);
13618
13871
  const screenSize = {
13619
13872
  w: w * transform.a,
13620
13873
  h: h * transform.a
@@ -13639,7 +13892,7 @@ var MouseElementTracker = ({
13639
13892
  }, [mousedPrimitives, transform]);
13640
13893
  const handleInteraction = (x, y, transform2, primitives2) => {
13641
13894
  setMousePos({ x, y });
13642
- const rwPoint = applyToPoint15(inverse5(transform2), { x, y });
13895
+ const rwPoint = applyToPoint16(inverse5(transform2), { x, y });
13643
13896
  const newMousedPrimitives = getPrimitivesUnderPoint(
13644
13897
  primitives2,
13645
13898
  rwPoint,
@@ -13654,7 +13907,7 @@ var MouseElementTracker = ({
13654
13907
  setMousedPrimitives(newMousedPrimitives);
13655
13908
  onMouseHoverOverPrimitives(newMousedPrimitives);
13656
13909
  };
13657
- return /* @__PURE__ */ jsxs12(
13910
+ return /* @__PURE__ */ jsxs13(
13658
13911
  "div",
13659
13912
  {
13660
13913
  ref: containerRef,
@@ -13678,7 +13931,7 @@ var MouseElementTracker = ({
13678
13931
  },
13679
13932
  children: [
13680
13933
  children,
13681
- /* @__PURE__ */ jsx15(
13934
+ /* @__PURE__ */ jsx16(
13682
13935
  ElementOverlayBox,
13683
13936
  {
13684
13937
  elements,
@@ -13686,8 +13939,8 @@ var MouseElementTracker = ({
13686
13939
  highlightedPrimitives
13687
13940
  }
13688
13941
  ),
13689
- transform && /* @__PURE__ */ jsxs12(Fragment7, { children: [
13690
- /* @__PURE__ */ jsx15(
13942
+ transform && /* @__PURE__ */ jsxs13(Fragment8, { children: [
13943
+ /* @__PURE__ */ jsx16(
13691
13944
  BoardAnchorOffsetOverlay,
13692
13945
  {
13693
13946
  elements,
@@ -13697,7 +13950,7 @@ var MouseElementTracker = ({
13697
13950
  containerHeight: height
13698
13951
  }
13699
13952
  ),
13700
- /* @__PURE__ */ jsx15(
13953
+ /* @__PURE__ */ jsx16(
13701
13954
  GroupAnchorOffsetOverlay,
13702
13955
  {
13703
13956
  elements,
@@ -13707,7 +13960,17 @@ var MouseElementTracker = ({
13707
13960
  containerHeight: height
13708
13961
  }
13709
13962
  ),
13710
- /* @__PURE__ */ jsx15(
13963
+ /* @__PURE__ */ jsx16(
13964
+ ComponentBoundingBoxOverlay,
13965
+ {
13966
+ elements,
13967
+ highlightedPrimitives,
13968
+ transform,
13969
+ containerWidth: width,
13970
+ containerHeight: height
13971
+ }
13972
+ ),
13973
+ /* @__PURE__ */ jsx16(
13711
13974
  PanelAnchorOffsetOverlay,
13712
13975
  {
13713
13976
  elements,
@@ -13724,10 +13987,10 @@ var MouseElementTracker = ({
13724
13987
  };
13725
13988
 
13726
13989
  // src/components/PcbGroupOverlay.tsx
13727
- import { applyToPoint as applyToPoint16 } from "transformation-matrix";
13990
+ import { applyToPoint as applyToPoint17 } from "transformation-matrix";
13728
13991
  import { identity as identity8 } from "transformation-matrix";
13729
13992
  import { useRef as useRef9, useEffect as useEffect12 } from "react";
13730
- import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
13993
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
13731
13994
  var GROUP_COLORS = [
13732
13995
  "rgb(255, 100, 100)",
13733
13996
  "rgb(100, 255, 100)",
@@ -13882,10 +14145,10 @@ var PcbGroupOverlay = ({
13882
14145
  minY -= totalPadding;
13883
14146
  maxY += totalPadding;
13884
14147
  }
13885
- const topLeft = applyToPoint16(transform, { x: minX, y: maxY });
13886
- const topRight = applyToPoint16(transform, { x: maxX, y: maxY });
13887
- const bottomLeft = applyToPoint16(transform, { x: minX, y: minY });
13888
- const bottomRight = applyToPoint16(transform, { x: maxX, y: minY });
14148
+ const topLeft = applyToPoint17(transform, { x: minX, y: maxY });
14149
+ const topRight = applyToPoint17(transform, { x: maxX, y: maxY });
14150
+ const bottomLeft = applyToPoint17(transform, { x: minX, y: minY });
14151
+ const bottomRight = applyToPoint17(transform, { x: maxX, y: minY });
13889
14152
  const groupColor = GROUP_COLORS[groupIndex % GROUP_COLORS.length];
13890
14153
  ctx.strokeStyle = groupColor;
13891
14154
  ctx.lineWidth = 2;
@@ -13935,7 +14198,7 @@ var PcbGroupOverlay = ({
13935
14198
  x: group.anchor_position[0] ?? 0,
13936
14199
  y: group.anchor_position[1] ?? 0
13937
14200
  } : { x: group.anchor_position.x, y: group.anchor_position.y };
13938
- const anchorScreenPos = applyToPoint16(transform, anchorPositionValue);
14201
+ const anchorScreenPos = applyToPoint17(transform, anchorPositionValue);
13939
14202
  ctx.strokeStyle = "white";
13940
14203
  ctx.lineWidth = 1.5;
13941
14204
  ctx.setLineDash([]);
@@ -13960,14 +14223,14 @@ var PcbGroupOverlay = ({
13960
14223
  is_showing_group_anchor_offsets,
13961
14224
  hoveredComponentIds
13962
14225
  ]);
13963
- return /* @__PURE__ */ jsxs13(
14226
+ return /* @__PURE__ */ jsxs14(
13964
14227
  "div",
13965
14228
  {
13966
14229
  ref: containerRef,
13967
14230
  style: { position: "relative", width: "100%", height: "100%" },
13968
14231
  children: [
13969
14232
  children,
13970
- /* @__PURE__ */ jsx16(
14233
+ /* @__PURE__ */ jsx17(
13971
14234
  "canvas",
13972
14235
  {
13973
14236
  ref: canvasRef,
@@ -13987,9 +14250,9 @@ var PcbGroupOverlay = ({
13987
14250
  };
13988
14251
 
13989
14252
  // src/components/RatsNestOverlay.tsx
13990
- import { applyToPoint as applyToPoint17, identity as identity9 } from "transformation-matrix";
14253
+ import { applyToPoint as applyToPoint18, identity as identity9 } from "transformation-matrix";
13991
14254
  import { useMemo as useMemo6 } from "react";
13992
- import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
14255
+ import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
13993
14256
  var RatsNestOverlay = ({ transform, soup, children }) => {
13994
14257
  const isShowingRatsNest = useGlobalStore((s) => s.is_showing_rats_nest);
13995
14258
  const { netMap, idToNetMap } = useMemo6(
@@ -14052,9 +14315,9 @@ var RatsNestOverlay = ({ transform, soup, children }) => {
14052
14315
  }, [soup, netMap, idToNetMap, isShowingRatsNest]);
14053
14316
  if (!soup || !isShowingRatsNest) return children;
14054
14317
  if (!transform) transform = identity9();
14055
- return /* @__PURE__ */ jsxs14("div", { style: { position: "relative" }, children: [
14318
+ return /* @__PURE__ */ jsxs15("div", { style: { position: "relative" }, children: [
14056
14319
  children,
14057
- /* @__PURE__ */ jsx17(
14320
+ /* @__PURE__ */ jsx18(
14058
14321
  "svg",
14059
14322
  {
14060
14323
  style: {
@@ -14068,9 +14331,9 @@ var RatsNestOverlay = ({ transform, soup, children }) => {
14068
14331
  zIndex: zIndexMap.ratsNestOverlay
14069
14332
  },
14070
14333
  children: ratsNestLines.map(({ key, startPoint, endPoint, isInNet }) => {
14071
- const transformedStart = applyToPoint17(transform, startPoint);
14072
- const transformedEnd = applyToPoint17(transform, endPoint);
14073
- return /* @__PURE__ */ jsx17(
14334
+ const transformedStart = applyToPoint18(transform, startPoint);
14335
+ const transformedEnd = applyToPoint18(transform, endPoint);
14336
+ return /* @__PURE__ */ jsx18(
14074
14337
  "line",
14075
14338
  {
14076
14339
  x1: transformedStart.x,
@@ -14096,7 +14359,7 @@ import { css as css3 } from "@emotion/css";
14096
14359
  // package.json
14097
14360
  var package_default = {
14098
14361
  name: "@tscircuit/pcb-viewer",
14099
- version: "1.11.291",
14362
+ version: "1.11.292",
14100
14363
  main: "dist/index.js",
14101
14364
  type: "module",
14102
14365
  repository: "tscircuit/pcb-viewer",
@@ -14202,9 +14465,9 @@ var useIsSmallScreen = () => {
14202
14465
  };
14203
14466
 
14204
14467
  // src/components/ToolbarOverlay.tsx
14205
- import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
14468
+ import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
14206
14469
  var LayerButton = ({ name, selected, onClick }) => {
14207
- return /* @__PURE__ */ jsxs15(
14470
+ return /* @__PURE__ */ jsxs16(
14208
14471
  "div",
14209
14472
  {
14210
14473
  className: css3`
@@ -14220,8 +14483,8 @@ var LayerButton = ({ name, selected, onClick }) => {
14220
14483
  `,
14221
14484
  onClick,
14222
14485
  children: [
14223
- /* @__PURE__ */ jsx18("span", { style: { marginRight: 2, opacity: selected ? 1 : 0 }, children: "\u2022" }),
14224
- /* @__PURE__ */ jsx18(
14486
+ /* @__PURE__ */ jsx19("span", { style: { marginRight: 2, opacity: selected ? 1 : 0 }, children: "\u2022" }),
14487
+ /* @__PURE__ */ jsx19(
14225
14488
  "span",
14226
14489
  {
14227
14490
  style: {
@@ -14241,7 +14504,7 @@ var ToolbarButton = ({
14241
14504
  isSmallScreen,
14242
14505
  onClick,
14243
14506
  ...props
14244
- }) => /* @__PURE__ */ jsx18(
14507
+ }) => /* @__PURE__ */ jsx19(
14245
14508
  "div",
14246
14509
  {
14247
14510
  ...props,
@@ -14278,7 +14541,7 @@ var CheckboxMenuItem = ({
14278
14541
  checked,
14279
14542
  onClick
14280
14543
  }) => {
14281
- return /* @__PURE__ */ jsxs15(
14544
+ return /* @__PURE__ */ jsxs16(
14282
14545
  "div",
14283
14546
  {
14284
14547
  className: css3`
@@ -14305,15 +14568,15 @@ var CheckboxMenuItem = ({
14305
14568
  onClick();
14306
14569
  },
14307
14570
  children: [
14308
- /* @__PURE__ */ jsx18("input", { type: "checkbox", checked, onChange: () => {
14571
+ /* @__PURE__ */ jsx19("input", { type: "checkbox", checked, onChange: () => {
14309
14572
  }, readOnly: true }),
14310
- /* @__PURE__ */ jsx18("span", { style: { color: "#eee" }, children: label })
14573
+ /* @__PURE__ */ jsx19("span", { style: { color: "#eee" }, children: label })
14311
14574
  ]
14312
14575
  }
14313
14576
  );
14314
14577
  };
14315
14578
  var RadioMenuItem = ({ label, checked, onClick }) => {
14316
- return /* @__PURE__ */ jsxs15(
14579
+ return /* @__PURE__ */ jsxs16(
14317
14580
  "div",
14318
14581
  {
14319
14582
  className: css3`
@@ -14340,9 +14603,9 @@ var RadioMenuItem = ({ label, checked, onClick }) => {
14340
14603
  onClick();
14341
14604
  },
14342
14605
  children: [
14343
- /* @__PURE__ */ jsx18("input", { type: "radio", checked, onChange: () => {
14606
+ /* @__PURE__ */ jsx19("input", { type: "radio", checked, onChange: () => {
14344
14607
  }, readOnly: true }),
14345
- /* @__PURE__ */ jsx18("span", { style: { color: "#eee" }, children: label })
14608
+ /* @__PURE__ */ jsx19("span", { style: { color: "#eee" }, children: label })
14346
14609
  ]
14347
14610
  }
14348
14611
  );
@@ -14494,7 +14757,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14494
14757
  setErrorsOpen(false);
14495
14758
  }
14496
14759
  }, [isViewMenuOpen]);
14497
- return /* @__PURE__ */ jsxs15(
14760
+ return /* @__PURE__ */ jsxs16(
14498
14761
  "div",
14499
14762
  {
14500
14763
  style: { position: "relative", zIndex: "999 !important" },
@@ -14502,7 +14765,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14502
14765
  onMouseLeave: handleMouseLeave,
14503
14766
  children: [
14504
14767
  children,
14505
- /* @__PURE__ */ jsxs15(
14768
+ /* @__PURE__ */ jsxs16(
14506
14769
  "div",
14507
14770
  {
14508
14771
  style: {
@@ -14523,7 +14786,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14523
14786
  ]
14524
14787
  }
14525
14788
  ),
14526
- /* @__PURE__ */ jsxs15(
14789
+ /* @__PURE__ */ jsxs16(
14527
14790
  "div",
14528
14791
  {
14529
14792
  "data-toolbar-overlay": true,
@@ -14546,7 +14809,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14546
14809
  fontFamily: "sans-serif"
14547
14810
  },
14548
14811
  children: [
14549
- /* @__PURE__ */ jsxs15(
14812
+ /* @__PURE__ */ jsxs16(
14550
14813
  ToolbarButton,
14551
14814
  {
14552
14815
  isSmallScreen,
@@ -14557,10 +14820,10 @@ var ToolbarOverlay = ({ children, elements }) => {
14557
14820
  }
14558
14821
  },
14559
14822
  children: [
14560
- /* @__PURE__ */ jsxs15("div", { children: [
14823
+ /* @__PURE__ */ jsxs16("div", { children: [
14561
14824
  "layer:",
14562
14825
  " ",
14563
- /* @__PURE__ */ jsx18(
14826
+ /* @__PURE__ */ jsx19(
14564
14827
  "span",
14565
14828
  {
14566
14829
  style: {
@@ -14572,7 +14835,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14572
14835
  }
14573
14836
  )
14574
14837
  ] }),
14575
- isLayerMenuOpen && /* @__PURE__ */ jsx18("div", { style: { marginTop: 4, minWidth: 120 }, children: processedLayers.map((layer) => /* @__PURE__ */ jsx18(
14838
+ isLayerMenuOpen && /* @__PURE__ */ jsx19("div", { style: { marginTop: 4, minWidth: 120 }, children: processedLayers.map((layer) => /* @__PURE__ */ jsx19(
14576
14839
  LayerButton,
14577
14840
  {
14578
14841
  name: layer,
@@ -14586,7 +14849,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14586
14849
  ]
14587
14850
  }
14588
14851
  ),
14589
- /* @__PURE__ */ jsx18(
14852
+ /* @__PURE__ */ jsx19(
14590
14853
  ToolbarButton,
14591
14854
  {
14592
14855
  isSmallScreen,
@@ -14595,13 +14858,13 @@ var ToolbarOverlay = ({ children, elements }) => {
14595
14858
  ...errorCount > 0 ? { color: "red" } : {}
14596
14859
  },
14597
14860
  onClick: handleErrorsToggle,
14598
- children: /* @__PURE__ */ jsxs15("div", { children: [
14861
+ children: /* @__PURE__ */ jsxs16("div", { children: [
14599
14862
  errorCount,
14600
14863
  " errors"
14601
14864
  ] })
14602
14865
  }
14603
14866
  ),
14604
- isErrorsOpen && errorCount > 0 && /* @__PURE__ */ jsx18(
14867
+ isErrorsOpen && errorCount > 0 && /* @__PURE__ */ jsx19(
14605
14868
  "div",
14606
14869
  {
14607
14870
  style: {
@@ -14621,14 +14884,14 @@ var ToolbarOverlay = ({ children, elements }) => {
14621
14884
  },
14622
14885
  children: errorElements.map((e, i) => {
14623
14886
  const errorId = e.pcb_trace_error_id || `error_${i}_${e.error_type}_${e.message?.slice(0, 20)}`;
14624
- return /* @__PURE__ */ jsxs15(
14887
+ return /* @__PURE__ */ jsxs16(
14625
14888
  "div",
14626
14889
  {
14627
14890
  style: {
14628
14891
  borderBottom: i < errorElements.length - 1 ? "1px solid #444" : "none"
14629
14892
  },
14630
14893
  children: [
14631
- /* @__PURE__ */ jsxs15(
14894
+ /* @__PURE__ */ jsxs16(
14632
14895
  "div",
14633
14896
  {
14634
14897
  style: {
@@ -14679,7 +14942,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14679
14942
  }
14680
14943
  },
14681
14944
  children: [
14682
- /* @__PURE__ */ jsx18(
14945
+ /* @__PURE__ */ jsx19(
14683
14946
  "div",
14684
14947
  {
14685
14948
  style: {
@@ -14693,7 +14956,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14693
14956
  children: e.error_type
14694
14957
  }
14695
14958
  ),
14696
- /* @__PURE__ */ jsx18(
14959
+ /* @__PURE__ */ jsx19(
14697
14960
  "div",
14698
14961
  {
14699
14962
  style: {
@@ -14708,7 +14971,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14708
14971
  children: e.message
14709
14972
  }
14710
14973
  ),
14711
- /* @__PURE__ */ jsx18(
14974
+ /* @__PURE__ */ jsx19(
14712
14975
  "div",
14713
14976
  {
14714
14977
  ref: (el) => {
@@ -14728,7 +14991,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14728
14991
  ]
14729
14992
  }
14730
14993
  ),
14731
- /* @__PURE__ */ jsx18(
14994
+ /* @__PURE__ */ jsx19(
14732
14995
  "div",
14733
14996
  {
14734
14997
  ref: (el) => {
@@ -14741,7 +15004,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14741
15004
  backgroundColor: "#1a1a1a",
14742
15005
  borderTop: "1px solid #444"
14743
15006
  },
14744
- children: /* @__PURE__ */ jsx18(
15007
+ children: /* @__PURE__ */ jsx19(
14745
15008
  "div",
14746
15009
  {
14747
15010
  style: {
@@ -14764,58 +15027,58 @@ var ToolbarOverlay = ({ children, elements }) => {
14764
15027
  })
14765
15028
  }
14766
15029
  ),
14767
- /* @__PURE__ */ jsx18(
15030
+ /* @__PURE__ */ jsx19(
14768
15031
  ToolbarButton,
14769
15032
  {
14770
15033
  isSmallScreen,
14771
15034
  style: {},
14772
15035
  onClick: handleEditTraceToggle,
14773
- children: /* @__PURE__ */ jsxs15("div", { children: [
15036
+ children: /* @__PURE__ */ jsxs16("div", { children: [
14774
15037
  editModes.in_draw_trace_mode ? "\u2716 " : "",
14775
15038
  "Edit Traces"
14776
15039
  ] })
14777
15040
  }
14778
15041
  ),
14779
- /* @__PURE__ */ jsx18(
15042
+ /* @__PURE__ */ jsx19(
14780
15043
  ToolbarButton,
14781
15044
  {
14782
15045
  isSmallScreen,
14783
15046
  style: {},
14784
15047
  onClick: handleMoveComponentToggle,
14785
- children: /* @__PURE__ */ jsxs15("div", { children: [
15048
+ children: /* @__PURE__ */ jsxs16("div", { children: [
14786
15049
  editModes.in_move_footprint_mode ? "\u2716 " : "",
14787
15050
  "Move Components"
14788
15051
  ] })
14789
15052
  }
14790
15053
  ),
14791
- /* @__PURE__ */ jsx18(
15054
+ /* @__PURE__ */ jsx19(
14792
15055
  ToolbarButton,
14793
15056
  {
14794
15057
  isSmallScreen,
14795
15058
  style: {},
14796
15059
  onClick: handleRatsNestToggle,
14797
- children: /* @__PURE__ */ jsxs15("div", { children: [
15060
+ children: /* @__PURE__ */ jsxs16("div", { children: [
14798
15061
  viewSettings.is_showing_rats_nest ? "\u2716 " : "",
14799
15062
  "Rats Nest"
14800
15063
  ] })
14801
15064
  }
14802
15065
  ),
14803
- /* @__PURE__ */ jsx18(
15066
+ /* @__PURE__ */ jsx19(
14804
15067
  ToolbarButton,
14805
15068
  {
14806
15069
  isSmallScreen,
14807
15070
  style: measureToolArmed ? { backgroundColor: "#444" } : {},
14808
15071
  onClick: handleMeasureToolClick,
14809
- children: /* @__PURE__ */ jsx18("div", { children: "\u{1F4CF}" })
15072
+ children: /* @__PURE__ */ jsx19("div", { children: "\u{1F4CF}" })
14810
15073
  }
14811
15074
  ),
14812
- /* @__PURE__ */ jsx18(
15075
+ /* @__PURE__ */ jsx19(
14813
15076
  ToolbarButton,
14814
15077
  {
14815
15078
  isSmallScreen,
14816
15079
  onClick: handleViewMenuToggle,
14817
- children: /* @__PURE__ */ jsxs15("div", { children: [
14818
- /* @__PURE__ */ jsxs15(
15080
+ children: /* @__PURE__ */ jsxs16("div", { children: [
15081
+ /* @__PURE__ */ jsxs16(
14819
15082
  "div",
14820
15083
  {
14821
15084
  style: {
@@ -14825,7 +15088,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14825
15088
  },
14826
15089
  children: [
14827
15090
  "View",
14828
- /* @__PURE__ */ jsx18(
15091
+ /* @__PURE__ */ jsx19(
14829
15092
  "span",
14830
15093
  {
14831
15094
  style: {
@@ -14840,8 +15103,8 @@ var ToolbarOverlay = ({ children, elements }) => {
14840
15103
  ]
14841
15104
  }
14842
15105
  ),
14843
- isViewMenuOpen && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 4, minWidth: 120 }, children: [
14844
- /* @__PURE__ */ jsx18(
15106
+ isViewMenuOpen && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 4, minWidth: 120 }, children: [
15107
+ /* @__PURE__ */ jsx19(
14845
15108
  CheckboxMenuItem,
14846
15109
  {
14847
15110
  label: "Show All Trace Lengths",
@@ -14853,7 +15116,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14853
15116
  }
14854
15117
  }
14855
15118
  ),
14856
- /* @__PURE__ */ jsx18(
15119
+ /* @__PURE__ */ jsx19(
14857
15120
  CheckboxMenuItem,
14858
15121
  {
14859
15122
  label: "Show Autorouting Animation",
@@ -14865,7 +15128,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14865
15128
  }
14866
15129
  }
14867
15130
  ),
14868
- /* @__PURE__ */ jsx18(
15131
+ /* @__PURE__ */ jsx19(
14869
15132
  CheckboxMenuItem,
14870
15133
  {
14871
15134
  label: "Show DRC Errors",
@@ -14875,7 +15138,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14875
15138
  }
14876
15139
  }
14877
15140
  ),
14878
- /* @__PURE__ */ jsx18(
15141
+ /* @__PURE__ */ jsx19(
14879
15142
  CheckboxMenuItem,
14880
15143
  {
14881
15144
  label: "Show Copper Pours",
@@ -14887,7 +15150,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14887
15150
  }
14888
15151
  }
14889
15152
  ),
14890
- /* @__PURE__ */ jsx18(
15153
+ /* @__PURE__ */ jsx19(
14891
15154
  CheckboxMenuItem,
14892
15155
  {
14893
15156
  label: "Show Solder Mask",
@@ -14897,7 +15160,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14897
15160
  }
14898
15161
  }
14899
15162
  ),
14900
- /* @__PURE__ */ jsx18(
15163
+ /* @__PURE__ */ jsx19(
14901
15164
  CheckboxMenuItem,
14902
15165
  {
14903
15166
  label: "Show Group Anchor Offsets",
@@ -14909,7 +15172,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14909
15172
  }
14910
15173
  }
14911
15174
  ),
14912
- /* @__PURE__ */ jsx18(
15175
+ /* @__PURE__ */ jsx19(
14913
15176
  CheckboxMenuItem,
14914
15177
  {
14915
15178
  label: "Show PCB Groups",
@@ -14919,8 +15182,8 @@ var ToolbarOverlay = ({ children, elements }) => {
14919
15182
  }
14920
15183
  }
14921
15184
  ),
14922
- viewSettings.is_showing_pcb_groups && /* @__PURE__ */ jsxs15("div", { style: { marginLeft: 16 }, children: [
14923
- /* @__PURE__ */ jsx18(
15185
+ viewSettings.is_showing_pcb_groups && /* @__PURE__ */ jsxs16("div", { style: { marginLeft: 16 }, children: [
15186
+ /* @__PURE__ */ jsx19(
14924
15187
  RadioMenuItem,
14925
15188
  {
14926
15189
  label: "Show All Groups",
@@ -14930,7 +15193,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14930
15193
  }
14931
15194
  }
14932
15195
  ),
14933
- /* @__PURE__ */ jsx18(
15196
+ /* @__PURE__ */ jsx19(
14934
15197
  RadioMenuItem,
14935
15198
  {
14936
15199
  label: "Show Named Groups",
@@ -14954,7 +15217,7 @@ var ToolbarOverlay = ({ children, elements }) => {
14954
15217
  };
14955
15218
 
14956
15219
  // src/components/CanvasElementsRenderer.tsx
14957
- import { jsx as jsx19 } from "react/jsx-runtime";
15220
+ import { jsx as jsx20 } from "react/jsx-runtime";
14958
15221
  var CanvasElementsRenderer = (props) => {
14959
15222
  const { transform, elements } = props;
14960
15223
  const hoveredErrorId = useGlobalStore((state) => state.hovered_error_id);
@@ -15042,14 +15305,14 @@ var CanvasElementsRenderer = (props) => {
15042
15305
  },
15043
15306
  [connectivityMap]
15044
15307
  );
15045
- return /* @__PURE__ */ jsx19(
15308
+ return /* @__PURE__ */ jsx20(
15046
15309
  MouseElementTracker,
15047
15310
  {
15048
15311
  elements: elementsToRender,
15049
15312
  transform,
15050
15313
  primitives: primitivesWithoutInteractionMetadata,
15051
15314
  onMouseHoverOverPrimitives: onMouseOverPrimitives,
15052
- children: /* @__PURE__ */ jsx19(
15315
+ children: /* @__PURE__ */ jsx20(
15053
15316
  EditPlacementOverlay,
15054
15317
  {
15055
15318
  disabled: !props.allowEditing,
@@ -15058,7 +15321,7 @@ var CanvasElementsRenderer = (props) => {
15058
15321
  cancelPanDrag: props.cancelPanDrag,
15059
15322
  onCreateEditEvent: props.onCreateEditEvent,
15060
15323
  onModifyEditEvent: props.onModifyEditEvent,
15061
- children: /* @__PURE__ */ jsx19(
15324
+ children: /* @__PURE__ */ jsx20(
15062
15325
  EditTraceHintOverlay,
15063
15326
  {
15064
15327
  disabled: !props.allowEditing,
@@ -15067,29 +15330,29 @@ var CanvasElementsRenderer = (props) => {
15067
15330
  cancelPanDrag: props.cancelPanDrag,
15068
15331
  onCreateEditEvent: props.onCreateEditEvent,
15069
15332
  onModifyEditEvent: props.onModifyEditEvent,
15070
- children: /* @__PURE__ */ jsx19(
15333
+ children: /* @__PURE__ */ jsx20(
15071
15334
  DimensionOverlay,
15072
15335
  {
15073
15336
  transform,
15074
15337
  focusOnHover: props.focusOnHover,
15075
15338
  primitives: primitivesWithoutInteractionMetadata,
15076
- children: /* @__PURE__ */ jsx19(ToolbarOverlay, { elements, children: /* @__PURE__ */ jsx19(ErrorOverlay, { transform, elements, children: /* @__PURE__ */ jsx19(RatsNestOverlay, { transform, soup: elements, children: /* @__PURE__ */ jsx19(
15339
+ children: /* @__PURE__ */ jsx20(ToolbarOverlay, { elements, children: /* @__PURE__ */ jsx20(ErrorOverlay, { transform, elements, children: /* @__PURE__ */ jsx20(RatsNestOverlay, { transform, soup: elements, children: /* @__PURE__ */ jsx20(
15077
15340
  PcbGroupOverlay,
15078
15341
  {
15079
15342
  transform,
15080
15343
  elements,
15081
15344
  hoveredComponentIds,
15082
- children: /* @__PURE__ */ jsx19(
15345
+ children: /* @__PURE__ */ jsx20(
15083
15346
  DebugGraphicsOverlay,
15084
15347
  {
15085
15348
  transform,
15086
15349
  debugGraphics: props.debugGraphics,
15087
- children: /* @__PURE__ */ jsx19(
15350
+ children: /* @__PURE__ */ jsx20(
15088
15351
  WarningGraphicsOverlay,
15089
15352
  {
15090
15353
  transform,
15091
15354
  elements,
15092
- children: /* @__PURE__ */ jsx19(
15355
+ children: /* @__PURE__ */ jsx20(
15093
15356
  CanvasPrimitiveRenderer,
15094
15357
  {
15095
15358
  transform,
@@ -15158,7 +15421,7 @@ var calculateCircuitJsonKey = (circuitJson) => {
15158
15421
  };
15159
15422
 
15160
15423
  // src/PCBViewer.tsx
15161
- import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
15424
+ import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
15162
15425
  var defaultTransform = compose7(translate11(400, 300), scale5(40, -40));
15163
15426
  var PCBViewer = ({
15164
15427
  circuitJson,
@@ -15252,20 +15515,20 @@ var PCBViewer = ({
15252
15515
  }),
15253
15516
  [initialState, disablePcbGroups]
15254
15517
  );
15255
- return /* @__PURE__ */ jsxs16(
15518
+ return /* @__PURE__ */ jsxs17(
15256
15519
  "div",
15257
15520
  {
15258
15521
  ref: transformRef,
15259
15522
  style: { position: "relative" },
15260
15523
  onContextMenu: (event) => event.preventDefault(),
15261
15524
  children: [
15262
- /* @__PURE__ */ jsx20("div", { ref, children: /* @__PURE__ */ jsxs16(
15525
+ /* @__PURE__ */ jsx21("div", { ref, children: /* @__PURE__ */ jsxs17(
15263
15526
  ContextProviders,
15264
15527
  {
15265
15528
  initialState: mergedInitialState,
15266
15529
  disablePcbGroups,
15267
15530
  children: [
15268
- /* @__PURE__ */ jsx20(
15531
+ /* @__PURE__ */ jsx21(
15269
15532
  CanvasElementsRenderer,
15270
15533
  {
15271
15534
  transform,
@@ -15290,11 +15553,11 @@ var PCBViewer = ({
15290
15553
  },
15291
15554
  refDimensions.width
15292
15555
  ),
15293
- /* @__PURE__ */ jsx20(ToastContainer, {})
15556
+ /* @__PURE__ */ jsx21(ToastContainer, {})
15294
15557
  ]
15295
15558
  }
15296
15559
  ) }),
15297
- clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx20(
15560
+ clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx21(
15298
15561
  "div",
15299
15562
  {
15300
15563
  onClick: () => {
@@ -15331,7 +15594,7 @@ var PCBViewer = ({
15331
15594
  justifyContent: "center",
15332
15595
  touchAction: "pan-x pan-y pinch-zoom"
15333
15596
  },
15334
- children: /* @__PURE__ */ jsx20(
15597
+ children: /* @__PURE__ */ jsx21(
15335
15598
  "div",
15336
15599
  {
15337
15600
  style: {