@tscircuit/schematic-viewer 2.0.109 → 2.0.110

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
@@ -201,6 +201,7 @@ var zIndexMap = {
201
201
  viewMenuIcon: 48,
202
202
  clickToInteractOverlay: 100,
203
203
  schematicComponentDetailsTooltip: 105,
204
+ schematicElementHighlight: 46,
204
205
  schematicComponentHoverOutline: 47,
205
206
  schematicPortHoverOutline: 48,
206
207
  schematicSearch: 101
@@ -1283,7 +1284,7 @@ var enableDebug = () => {
1283
1284
  };
1284
1285
 
1285
1286
  // lib/components/SchematicViewer.tsx
1286
- import { useCallback as useCallback7, useEffect as useEffect13, useMemo as useMemo6, useRef as useRef9, useState as useState10 } from "react";
1287
+ import { useCallback as useCallback8, useEffect as useEffect14, useMemo as useMemo6, useRef as useRef8, useState as useState9 } from "react";
1287
1288
  import { toString as transformToString } from "transformation-matrix";
1288
1289
  import { useMouseMatrixTransform } from "use-mouse-matrix-transform";
1289
1290
 
@@ -2192,7 +2193,7 @@ var SchematicComponentDetailsTooltip = ({
2192
2193
  };
2193
2194
 
2194
2195
  // lib/components/SchematicComponentMouseTarget.tsx
2195
- import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef6, useState as useState6 } from "react";
2196
+ import { useCallback as useCallback6, useEffect as useEffect11 } from "react";
2196
2197
 
2197
2198
  // lib/hooks/useMouseEventsOverBoundingBox.ts
2198
2199
  import {
@@ -2251,23 +2252,23 @@ var useMouseEventsOverBoundingBox = (options) => {
2251
2252
  return { hovering };
2252
2253
  };
2253
2254
 
2254
- // lib/components/SchematicComponentMouseTarget.tsx
2255
- import { jsx as jsx5 } from "react/jsx-runtime";
2255
+ // lib/hooks/useSvgElementMeasurement.ts
2256
+ import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef6, useState as useState6 } from "react";
2256
2257
  var areMeasurementsEqual = (a, b) => {
2257
2258
  if (!a && !b) return true;
2258
2259
  if (!a || !b) return false;
2259
2260
  return Math.abs(a.bounds.minX - b.bounds.minX) < 0.5 && Math.abs(a.bounds.maxX - b.bounds.maxX) < 0.5 && Math.abs(a.bounds.minY - b.bounds.minY) < 0.5 && Math.abs(a.bounds.maxY - b.bounds.maxY) < 0.5 && Math.abs(a.rect.left - b.rect.left) < 0.5 && Math.abs(a.rect.top - b.rect.top) < 0.5 && Math.abs(a.rect.width - b.rect.width) < 0.5 && Math.abs(a.rect.height - b.rect.height) < 0.5;
2260
2261
  };
2261
- var SchematicComponentMouseTarget = ({
2262
- componentId,
2262
+ var useSvgElementMeasurement = ({
2263
+ selector,
2263
2264
  svgDivRef,
2264
2265
  containerRef,
2265
- onComponentClick,
2266
- onHoverChange,
2267
- showOutline,
2268
- circuitJsonKey
2266
+ circuitJsonKey,
2267
+ padding = 0
2269
2268
  }) => {
2270
- const [measurement, setMeasurement] = useState6(null);
2269
+ const [measurement, setMeasurement] = useState6(
2270
+ null
2271
+ );
2271
2272
  const frameRef = useRef6(null);
2272
2273
  const measure = useCallback5(() => {
2273
2274
  frameRef.current = null;
@@ -2278,7 +2279,7 @@ var SchematicComponentMouseTarget = ({
2278
2279
  return;
2279
2280
  }
2280
2281
  const element = svgDiv.querySelector(
2281
- `[data-schematic-component-id="${componentId}"]`
2282
+ selector
2282
2283
  );
2283
2284
  if (!element) {
2284
2285
  setMeasurement((prev) => prev ? null : prev);
@@ -2288,22 +2289,22 @@ var SchematicComponentMouseTarget = ({
2288
2289
  const containerRect = container.getBoundingClientRect();
2289
2290
  const nextMeasurement = {
2290
2291
  bounds: {
2291
- minX: elementRect.left,
2292
- maxX: elementRect.right,
2293
- minY: elementRect.top,
2294
- maxY: elementRect.bottom
2292
+ minX: elementRect.left - padding,
2293
+ maxX: elementRect.right + padding,
2294
+ minY: elementRect.top - padding,
2295
+ maxY: elementRect.bottom + padding
2295
2296
  },
2296
2297
  rect: {
2297
- left: elementRect.left - containerRect.left,
2298
- top: elementRect.top - containerRect.top,
2299
- width: elementRect.width,
2300
- height: elementRect.height
2298
+ left: elementRect.left - containerRect.left - padding,
2299
+ top: elementRect.top - containerRect.top - padding,
2300
+ width: elementRect.width + padding * 2,
2301
+ height: elementRect.height + padding * 2
2301
2302
  }
2302
2303
  };
2303
2304
  setMeasurement(
2304
2305
  (prev) => areMeasurementsEqual(prev, nextMeasurement) ? prev : nextMeasurement
2305
2306
  );
2306
- }, [componentId, containerRef, svgDivRef]);
2307
+ }, [selector, padding, containerRef, svgDivRef]);
2307
2308
  const scheduleMeasure = useCallback5(() => {
2308
2309
  if (frameRef.current !== null) return;
2309
2310
  frameRef.current = window.requestAnimationFrame(measure);
@@ -2343,7 +2344,27 @@ var SchematicComponentMouseTarget = ({
2343
2344
  }
2344
2345
  };
2345
2346
  }, [scheduleMeasure, svgDivRef, containerRef]);
2346
- const handleClick = useCallback5(
2347
+ return measurement;
2348
+ };
2349
+
2350
+ // lib/components/SchematicComponentMouseTarget.tsx
2351
+ import { jsx as jsx5 } from "react/jsx-runtime";
2352
+ var SchematicComponentMouseTarget = ({
2353
+ componentId,
2354
+ svgDivRef,
2355
+ containerRef,
2356
+ onComponentClick,
2357
+ onHoverChange,
2358
+ showOutline,
2359
+ circuitJsonKey
2360
+ }) => {
2361
+ const measurement = useSvgElementMeasurement({
2362
+ selector: `[data-schematic-component-id="${componentId}"]`,
2363
+ svgDivRef,
2364
+ containerRef,
2365
+ circuitJsonKey
2366
+ });
2367
+ const handleClick = useCallback6(
2347
2368
  (event) => {
2348
2369
  if (onComponentClick) {
2349
2370
  onComponentClick(componentId, event);
@@ -2356,7 +2377,7 @@ var SchematicComponentMouseTarget = ({
2356
2377
  bounds,
2357
2378
  onClick: onComponentClick ? handleClick : void 0
2358
2379
  });
2359
- useEffect10(() => {
2380
+ useEffect11(() => {
2360
2381
  if (onHoverChange) {
2361
2382
  onHoverChange(componentId, hovering);
2362
2383
  }
@@ -2382,14 +2403,44 @@ var SchematicComponentMouseTarget = ({
2382
2403
  );
2383
2404
  };
2384
2405
 
2385
- // lib/components/SchematicPortMouseTarget.tsx
2386
- import { useCallback as useCallback6, useEffect as useEffect11, useRef as useRef7, useState as useState7 } from "react";
2387
- import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
2388
- var areMeasurementsEqual2 = (a, b) => {
2389
- if (!a && !b) return true;
2390
- if (!a || !b) return false;
2391
- return Math.abs(a.bounds.minX - b.bounds.minX) < 0.5 && Math.abs(a.bounds.maxX - b.bounds.maxX) < 0.5 && Math.abs(a.bounds.minY - b.bounds.minY) < 0.5 && Math.abs(a.bounds.maxY - b.bounds.maxY) < 0.5 && Math.abs(a.rect.left - b.rect.left) < 0.5 && Math.abs(a.rect.top - b.rect.top) < 0.5 && Math.abs(a.rect.width - b.rect.width) < 0.5 && Math.abs(a.rect.height - b.rect.height) < 0.5;
2406
+ // lib/components/SchematicElementHighlight.tsx
2407
+ import { jsx as jsx6 } from "react/jsx-runtime";
2408
+ var SchematicElementHighlight = ({
2409
+ selector,
2410
+ svgDivRef,
2411
+ containerRef,
2412
+ circuitJsonKey
2413
+ }) => {
2414
+ const measurement = useSvgElementMeasurement({
2415
+ selector,
2416
+ svgDivRef,
2417
+ containerRef,
2418
+ circuitJsonKey,
2419
+ padding: 4
2420
+ });
2421
+ if (!measurement) return null;
2422
+ return /* @__PURE__ */ jsx6(
2423
+ "div",
2424
+ {
2425
+ "data-schematic-element-highlight": true,
2426
+ style: {
2427
+ position: "absolute",
2428
+ left: measurement.rect.left,
2429
+ top: measurement.rect.top,
2430
+ width: measurement.rect.width,
2431
+ height: measurement.rect.height,
2432
+ border: "1.5px dashed #3b82f6",
2433
+ boxSizing: "border-box",
2434
+ pointerEvents: "none",
2435
+ zIndex: zIndexMap.schematicElementHighlight
2436
+ }
2437
+ }
2438
+ );
2392
2439
  };
2440
+
2441
+ // lib/components/SchematicPortMouseTarget.tsx
2442
+ import { useCallback as useCallback7, useEffect as useEffect12 } from "react";
2443
+ import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
2393
2444
  var SchematicPortMouseTarget = ({
2394
2445
  portId,
2395
2446
  portLabel,
@@ -2400,84 +2451,15 @@ var SchematicPortMouseTarget = ({
2400
2451
  showOutline,
2401
2452
  circuitJsonKey
2402
2453
  }) => {
2403
- const [measurement, setMeasurement] = useState7(null);
2404
- const frameRef = useRef7(null);
2405
- const measure = useCallback6(() => {
2406
- frameRef.current = null;
2407
- const svgDiv = svgDivRef.current;
2408
- const container = containerRef.current;
2409
- if (!svgDiv || !container) {
2410
- setMeasurement((prev) => prev ? null : prev);
2411
- return;
2412
- }
2413
- const element = svgDiv.querySelector(
2414
- `[data-schematic-port-id="${portId}"]`
2415
- );
2416
- if (!element) {
2417
- setMeasurement((prev) => prev ? null : prev);
2418
- return;
2419
- }
2420
- const elementRect = element.getBoundingClientRect();
2421
- const containerRect = container.getBoundingClientRect();
2422
- const padding = 4;
2423
- const nextMeasurement = {
2424
- bounds: {
2425
- minX: elementRect.left - padding,
2426
- maxX: elementRect.right + padding,
2427
- minY: elementRect.top - padding,
2428
- maxY: elementRect.bottom + padding
2429
- },
2430
- rect: {
2431
- left: elementRect.left - containerRect.left - padding,
2432
- top: elementRect.top - containerRect.top - padding,
2433
- width: elementRect.width + padding * 2,
2434
- height: elementRect.height + padding * 2
2435
- }
2436
- };
2437
- setMeasurement(
2438
- (prev) => areMeasurementsEqual2(prev, nextMeasurement) ? prev : nextMeasurement
2439
- );
2440
- }, [portId, containerRef, svgDivRef]);
2441
- const scheduleMeasure = useCallback6(() => {
2442
- if (frameRef.current !== null) return;
2443
- frameRef.current = window.requestAnimationFrame(measure);
2444
- }, [measure]);
2445
- useEffect11(() => {
2446
- scheduleMeasure();
2447
- }, [scheduleMeasure, circuitJsonKey]);
2448
- useEffect11(() => {
2449
- scheduleMeasure();
2450
- const svgDiv = svgDivRef.current;
2451
- const container = containerRef.current;
2452
- if (!svgDiv || !container) return;
2453
- const resizeObserver = typeof ResizeObserver !== "undefined" ? new ResizeObserver(() => {
2454
- scheduleMeasure();
2455
- }) : null;
2456
- resizeObserver?.observe(container);
2457
- resizeObserver?.observe(svgDiv);
2458
- const mutationObserver = typeof MutationObserver !== "undefined" ? new MutationObserver(() => {
2459
- scheduleMeasure();
2460
- }) : null;
2461
- mutationObserver?.observe(svgDiv, {
2462
- attributes: true,
2463
- attributeFilter: ["style", "transform"],
2464
- subtree: true,
2465
- childList: true
2466
- });
2467
- window.addEventListener("scroll", scheduleMeasure, true);
2468
- window.addEventListener("resize", scheduleMeasure);
2469
- return () => {
2470
- resizeObserver?.disconnect();
2471
- mutationObserver?.disconnect();
2472
- window.removeEventListener("scroll", scheduleMeasure, true);
2473
- window.removeEventListener("resize", scheduleMeasure);
2474
- if (frameRef.current !== null) {
2475
- cancelAnimationFrame(frameRef.current);
2476
- frameRef.current = null;
2477
- }
2478
- };
2479
- }, [scheduleMeasure, svgDivRef, containerRef]);
2480
- const handleClick = useCallback6(
2454
+ const measurement = useSvgElementMeasurement({
2455
+ selector: `[data-schematic-port-id="${portId}"]`,
2456
+ svgDivRef,
2457
+ containerRef,
2458
+ circuitJsonKey,
2459
+ // Add some padding around the port for easier interaction
2460
+ padding: 4
2461
+ });
2462
+ const handleClick = useCallback7(
2481
2463
  (event) => {
2482
2464
  if (onPortClick) {
2483
2465
  onPortClick(portId, event);
@@ -2490,7 +2472,7 @@ var SchematicPortMouseTarget = ({
2490
2472
  bounds,
2491
2473
  onClick: onPortClick ? handleClick : void 0
2492
2474
  });
2493
- useEffect11(() => {
2475
+ useEffect12(() => {
2494
2476
  if (onHoverChange) {
2495
2477
  onHoverChange(portId, hovering);
2496
2478
  }
@@ -2500,7 +2482,7 @@ var SchematicPortMouseTarget = ({
2500
2482
  }
2501
2483
  const rect = measurement.rect;
2502
2484
  return /* @__PURE__ */ jsxs4(Fragment4, { children: [
2503
- /* @__PURE__ */ jsx6(
2485
+ /* @__PURE__ */ jsx7(
2504
2486
  "div",
2505
2487
  {
2506
2488
  style: {
@@ -2518,7 +2500,7 @@ var SchematicPortMouseTarget = ({
2518
2500
  }
2519
2501
  }
2520
2502
  ),
2521
- hovering && portLabel && /* @__PURE__ */ jsx6(
2503
+ hovering && portLabel && /* @__PURE__ */ jsx7(
2522
2504
  "div",
2523
2505
  {
2524
2506
  style: {
@@ -2543,15 +2525,15 @@ var SchematicPortMouseTarget = ({
2543
2525
  };
2544
2526
 
2545
2527
  // lib/components/SchematicSearch.tsx
2546
- import { useEffect as useEffect12, useRef as useRef8, useState as useState8 } from "react";
2528
+ import { useEffect as useEffect13, useRef as useRef7, useState as useState7 } from "react";
2547
2529
 
2548
2530
  // lib/components/SchematicSearchIcons.tsx
2549
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2531
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
2550
2532
  var Icon = ({
2551
2533
  children,
2552
2534
  size,
2553
2535
  strokeWidth
2554
- }) => /* @__PURE__ */ jsx7(
2536
+ }) => /* @__PURE__ */ jsx8(
2555
2537
  "svg",
2556
2538
  {
2557
2539
  width: size,
@@ -2567,30 +2549,30 @@ var Icon = ({
2567
2549
  }
2568
2550
  );
2569
2551
  var SearchIcon = (props) => /* @__PURE__ */ jsxs5(Icon, { ...props, children: [
2570
- /* @__PURE__ */ jsx7("circle", { cx: "11", cy: "11", r: "8" }),
2571
- /* @__PURE__ */ jsx7("path", { d: "m21 21-4.34-4.34" })
2552
+ /* @__PURE__ */ jsx8("circle", { cx: "11", cy: "11", r: "8" }),
2553
+ /* @__PURE__ */ jsx8("path", { d: "m21 21-4.34-4.34" })
2572
2554
  ] });
2573
2555
  var CloseIcon = (props) => /* @__PURE__ */ jsxs5(Icon, { ...props, children: [
2574
- /* @__PURE__ */ jsx7("path", { d: "M18 6 6 18" }),
2575
- /* @__PURE__ */ jsx7("path", { d: "m6 6 12 12" })
2556
+ /* @__PURE__ */ jsx8("path", { d: "M18 6 6 18" }),
2557
+ /* @__PURE__ */ jsx8("path", { d: "m6 6 12 12" })
2576
2558
  ] });
2577
2559
  var ComponentIcon = (props) => /* @__PURE__ */ jsxs5(Icon, { ...props, children: [
2578
- /* @__PURE__ */ jsx7("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2" }),
2579
- /* @__PURE__ */ jsx7("rect", { x: "8", y: "8", width: "8", height: "8", rx: "1" }),
2580
- /* @__PURE__ */ jsx7("path", { d: "M7 2v2M12 2v2M17 2v2M7 20v2M12 20v2M17 20v2M2 7h2M2 12h2M2 17h2M20 7h2M20 12h2M20 17h2" })
2560
+ /* @__PURE__ */ jsx8("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2" }),
2561
+ /* @__PURE__ */ jsx8("rect", { x: "8", y: "8", width: "8", height: "8", rx: "1" }),
2562
+ /* @__PURE__ */ jsx8("path", { d: "M7 2v2M12 2v2M17 2v2M7 20v2M12 20v2M17 20v2M2 7h2M2 12h2M2 17h2M20 7h2M20 12h2M20 17h2" })
2581
2563
  ] });
2582
2564
  var NetIcon = (props) => /* @__PURE__ */ jsxs5(Icon, { ...props, children: [
2583
- /* @__PURE__ */ jsx7("path", { d: "M15 6a9 9 0 0 0-9 9V3" }),
2584
- /* @__PURE__ */ jsx7("circle", { cx: "18", cy: "6", r: "3" }),
2585
- /* @__PURE__ */ jsx7("circle", { cx: "6", cy: "18", r: "3" })
2565
+ /* @__PURE__ */ jsx8("path", { d: "M15 6a9 9 0 0 0-9 9V3" }),
2566
+ /* @__PURE__ */ jsx8("circle", { cx: "18", cy: "6", r: "3" }),
2567
+ /* @__PURE__ */ jsx8("circle", { cx: "6", cy: "18", r: "3" })
2586
2568
  ] });
2587
2569
  var EnterIcon = (props) => /* @__PURE__ */ jsxs5(Icon, { ...props, children: [
2588
- /* @__PURE__ */ jsx7("path", { d: "M20 4v7a4 4 0 0 1-4 4H4" }),
2589
- /* @__PURE__ */ jsx7("path", { d: "m9 10-5 5 5 5" })
2570
+ /* @__PURE__ */ jsx8("path", { d: "M20 4v7a4 4 0 0 1-4 4H4" }),
2571
+ /* @__PURE__ */ jsx8("path", { d: "m9 10-5 5 5 5" })
2590
2572
  ] });
2591
2573
 
2592
2574
  // lib/components/SchematicSearch.tsx
2593
- import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2575
+ import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
2594
2576
  var HighlightedSearchText = ({
2595
2577
  text,
2596
2578
  query
@@ -2606,7 +2588,7 @@ var HighlightedSearchText = ({
2606
2588
  parts.push(text.slice(cursor, matchIndex));
2607
2589
  }
2608
2590
  parts.push(
2609
- /* @__PURE__ */ jsx8("strong", { style: { fontWeight: 700 }, children: text.slice(matchIndex, matchIndex + normalizedQuery.length) }, `${matchIndex}-${cursor}`)
2591
+ /* @__PURE__ */ jsx9("strong", { style: { fontWeight: 700 }, children: text.slice(matchIndex, matchIndex + normalizedQuery.length) }, `${matchIndex}-${cursor}`)
2610
2592
  );
2611
2593
  cursor = matchIndex + normalizedQuery.length;
2612
2594
  matchIndex = normalizedText.indexOf(normalizedQuery, cursor);
@@ -2628,13 +2610,13 @@ var SchematicSearch = ({
2628
2610
  onSelect,
2629
2611
  viewerContainerRef
2630
2612
  }) => {
2631
- const [isOpen, setIsOpen] = useState8(false);
2632
- const [activeResultId, setActiveResultId] = useState8(null);
2633
- const [hoveredResultId, setHoveredResultId] = useState8(null);
2634
- const inputRef = useRef8(null);
2635
- const resultsListRef = useRef8(null);
2613
+ const [isOpen, setIsOpen] = useState7(false);
2614
+ const [activeResultId, setActiveResultId] = useState7(null);
2615
+ const [hoveredResultId, setHoveredResultId] = useState7(null);
2616
+ const inputRef = useRef7(null);
2617
+ const resultsListRef = useRef7(null);
2636
2618
  const shortcutLabel = getShortcutLabel();
2637
- useEffect12(() => {
2619
+ useEffect13(() => {
2638
2620
  setActiveResultId((currentId) => {
2639
2621
  if (results.some((result) => result.target.id === currentId)) {
2640
2622
  return currentId;
@@ -2642,11 +2624,11 @@ var SchematicSearch = ({
2642
2624
  return results.find((result) => result.kind === "component")?.target.id ?? results[0]?.target.id ?? null;
2643
2625
  });
2644
2626
  }, [results]);
2645
- useEffect12(() => {
2627
+ useEffect13(() => {
2646
2628
  if (!activeResultId) return;
2647
2629
  resultsListRef.current?.querySelector(`[data-search-result-id="${activeResultId}"]`)?.scrollIntoView({ behavior: "smooth", block: "nearest" });
2648
2630
  }, [activeResultId]);
2649
- useEffect12(() => {
2631
+ useEffect13(() => {
2650
2632
  const handleSearchShortcut = (event) => {
2651
2633
  if (event.key === "Escape" && isOpen) {
2652
2634
  event.preventDefault();
@@ -2748,7 +2730,7 @@ var SchematicSearch = ({
2748
2730
  const renderResultSection = (title, sectionResults) => {
2749
2731
  if (sectionResults.length === 0) return null;
2750
2732
  return /* @__PURE__ */ jsxs6("section", { children: [
2751
- /* @__PURE__ */ jsx8(
2733
+ /* @__PURE__ */ jsx9(
2752
2734
  "div",
2753
2735
  {
2754
2736
  style: {
@@ -2768,9 +2750,9 @@ var SchematicSearch = ({
2768
2750
  const hovering = result.target.id === hoveredResultId;
2769
2751
  let resultBackground = "#ffffff";
2770
2752
  if (hovering || active) resultBackground = "#f1f3f5";
2771
- let resultIcon = /* @__PURE__ */ jsx8(NetIcon, { size: 15, strokeWidth: 1.8 });
2753
+ let resultIcon = /* @__PURE__ */ jsx9(NetIcon, { size: 15, strokeWidth: 1.8 });
2772
2754
  if (result.kind === "component") {
2773
- resultIcon = /* @__PURE__ */ jsx8(ComponentIcon, { size: 15, strokeWidth: 1.8 });
2755
+ resultIcon = /* @__PURE__ */ jsx9(ComponentIcon, { size: 15, strokeWidth: 1.8 });
2774
2756
  }
2775
2757
  const selectResult = () => {
2776
2758
  inputRef.current?.blur();
@@ -2803,7 +2785,7 @@ var SchematicSearch = ({
2803
2785
  textAlign: "left"
2804
2786
  },
2805
2787
  children: [
2806
- /* @__PURE__ */ jsx8(
2788
+ /* @__PURE__ */ jsx9(
2807
2789
  "span",
2808
2790
  {
2809
2791
  style: {
@@ -2821,7 +2803,7 @@ var SchematicSearch = ({
2821
2803
  }
2822
2804
  ),
2823
2805
  /* @__PURE__ */ jsxs6("span", { style: { minWidth: 0, flex: 1 }, children: [
2824
- /* @__PURE__ */ jsx8(
2806
+ /* @__PURE__ */ jsx9(
2825
2807
  "span",
2826
2808
  {
2827
2809
  style: {
@@ -2833,10 +2815,10 @@ var SchematicSearch = ({
2833
2815
  textOverflow: "ellipsis",
2834
2816
  whiteSpace: "nowrap"
2835
2817
  },
2836
- children: /* @__PURE__ */ jsx8(HighlightedSearchText, { text: result.label, query })
2818
+ children: /* @__PURE__ */ jsx9(HighlightedSearchText, { text: result.label, query })
2837
2819
  }
2838
2820
  ),
2839
- result.detail && /* @__PURE__ */ jsx8(
2821
+ result.detail && /* @__PURE__ */ jsx9(
2840
2822
  "span",
2841
2823
  {
2842
2824
  style: {
@@ -2872,7 +2854,7 @@ var SchematicSearch = ({
2872
2854
  }
2873
2855
  )
2874
2856
  ] }),
2875
- active && /* @__PURE__ */ jsx8(
2857
+ active && /* @__PURE__ */ jsx9(
2876
2858
  "span",
2877
2859
  {
2878
2860
  title: "Press Enter to open",
@@ -2882,7 +2864,7 @@ var SchematicSearch = ({
2882
2864
  fontSize: "17px",
2883
2865
  lineHeight: 1
2884
2866
  },
2885
- children: /* @__PURE__ */ jsx8(EnterIcon, { size: 14, strokeWidth: 1.8 })
2867
+ children: /* @__PURE__ */ jsx9(EnterIcon, { size: 14, strokeWidth: 1.8 })
2886
2868
  }
2887
2869
  )
2888
2870
  ]
@@ -2892,7 +2874,7 @@ var SchematicSearch = ({
2892
2874
  })
2893
2875
  ] });
2894
2876
  };
2895
- return /* @__PURE__ */ jsx8(
2877
+ return /* @__PURE__ */ jsx9(
2896
2878
  "div",
2897
2879
  {
2898
2880
  "data-schematic-search": true,
@@ -2905,7 +2887,7 @@ var SchematicSearch = ({
2905
2887
  zIndex: zIndexMap.schematicSearch,
2906
2888
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
2907
2889
  },
2908
- children: !isOpen ? /* @__PURE__ */ jsx8(
2890
+ children: !isOpen ? /* @__PURE__ */ jsx9(
2909
2891
  "button",
2910
2892
  {
2911
2893
  type: "button",
@@ -2936,7 +2918,7 @@ var SchematicSearch = ({
2936
2918
  cursor: "pointer",
2937
2919
  boxShadow: "0 2px 4px rgba(0,0,0,0.1)"
2938
2920
  },
2939
- children: /* @__PURE__ */ jsx8(SearchIcon, { size: 16, strokeWidth: 2 })
2921
+ children: /* @__PURE__ */ jsx9(SearchIcon, { size: 16, strokeWidth: 2 })
2940
2922
  }
2941
2923
  ) : /* @__PURE__ */ jsxs6(
2942
2924
  "div",
@@ -2964,8 +2946,8 @@ var SchematicSearch = ({
2964
2946
  borderBottom: searchHeaderBorder
2965
2947
  },
2966
2948
  children: [
2967
- /* @__PURE__ */ jsx8(SearchIcon, { size: 15, strokeWidth: 2 }),
2968
- /* @__PURE__ */ jsx8(
2949
+ /* @__PURE__ */ jsx9(SearchIcon, { size: 15, strokeWidth: 2 }),
2950
+ /* @__PURE__ */ jsx9(
2969
2951
  "input",
2970
2952
  {
2971
2953
  ref: inputRef,
@@ -2985,7 +2967,7 @@ var SchematicSearch = ({
2985
2967
  }
2986
2968
  }
2987
2969
  ),
2988
- query && results.length > 0 ? /* @__PURE__ */ jsx8(
2970
+ query && results.length > 0 ? /* @__PURE__ */ jsx9(
2989
2971
  "span",
2990
2972
  {
2991
2973
  style: {
@@ -2996,7 +2978,7 @@ var SchematicSearch = ({
2996
2978
  },
2997
2979
  children: resultCountLabel
2998
2980
  }
2999
- ) : /* @__PURE__ */ jsx8(
2981
+ ) : /* @__PURE__ */ jsx9(
3000
2982
  "kbd",
3001
2983
  {
3002
2984
  style: {
@@ -3013,7 +2995,7 @@ var SchematicSearch = ({
3013
2995
  children: shortcutLabel
3014
2996
  }
3015
2997
  ),
3016
- isOpen && /* @__PURE__ */ jsx8(
2998
+ isOpen && /* @__PURE__ */ jsx9(
3017
2999
  "button",
3018
3000
  {
3019
3001
  type: "button",
@@ -3036,13 +3018,13 @@ var SchematicSearch = ({
3036
3018
  padding: 0,
3037
3019
  lineHeight: 1
3038
3020
  },
3039
- children: /* @__PURE__ */ jsx8(CloseIcon, { size: 16, strokeWidth: 2 })
3021
+ children: /* @__PURE__ */ jsx9(CloseIcon, { size: 16, strokeWidth: 2 })
3040
3022
  }
3041
3023
  )
3042
3024
  ]
3043
3025
  }
3044
3026
  ),
3045
- query && /* @__PURE__ */ jsx8(
3027
+ query && /* @__PURE__ */ jsx9(
3046
3028
  "div",
3047
3029
  {
3048
3030
  ref: resultsListRef,
@@ -3057,7 +3039,7 @@ var SchematicSearch = ({
3057
3039
  },
3058
3040
  onWheel: (event) => event.stopPropagation(),
3059
3041
  onTouchMove: (event) => event.stopPropagation(),
3060
- children: results.length === 0 ? /* @__PURE__ */ jsx8(
3042
+ children: results.length === 0 ? /* @__PURE__ */ jsx9(
3061
3043
  "div",
3062
3044
  {
3063
3045
  style: {
@@ -3081,9 +3063,9 @@ var SchematicSearch = ({
3081
3063
  };
3082
3064
 
3083
3065
  // lib/components/SchematicSheetSelector.tsx
3084
- import { useState as useState9 } from "react";
3066
+ import { useState as useState8 } from "react";
3085
3067
  import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
3086
- import { Fragment as Fragment6, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
3068
+ import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
3087
3069
  var FONT_FAMILY = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
3088
3070
  var contentStyles = {
3089
3071
  backgroundColor: "#ffffff",
@@ -3133,7 +3115,7 @@ var MENU_CSS = `
3133
3115
  .sv-sheet-chevron { transition: transform 0.2s ease; }
3134
3116
  [data-state="open"] > .sv-sheet-chevron { transform: rotate(180deg); }
3135
3117
  `;
3136
- var CheckIcon = () => /* @__PURE__ */ jsx9(
3118
+ var CheckIcon = () => /* @__PURE__ */ jsx10(
3137
3119
  "svg",
3138
3120
  {
3139
3121
  width: "14",
@@ -3145,10 +3127,10 @@ var CheckIcon = () => /* @__PURE__ */ jsx9(
3145
3127
  strokeLinecap: "round",
3146
3128
  strokeLinejoin: "round",
3147
3129
  "aria-hidden": "true",
3148
- children: /* @__PURE__ */ jsx9("path", { d: "M20 6 9 17l-5-5" })
3130
+ children: /* @__PURE__ */ jsx10("path", { d: "M20 6 9 17l-5-5" })
3149
3131
  }
3150
3132
  );
3151
- var ChevronDownIcon = ({ className }) => /* @__PURE__ */ jsx9(
3133
+ var ChevronDownIcon = ({ className }) => /* @__PURE__ */ jsx10(
3152
3134
  "svg",
3153
3135
  {
3154
3136
  className,
@@ -3162,7 +3144,7 @@ var ChevronDownIcon = ({ className }) => /* @__PURE__ */ jsx9(
3162
3144
  strokeLinejoin: "round",
3163
3145
  style: { opacity: 0.6, flexShrink: 0 },
3164
3146
  "aria-hidden": "true",
3165
- children: /* @__PURE__ */ jsx9("path", { d: "m6 9 6 6 6-6" })
3147
+ children: /* @__PURE__ */ jsx10("path", { d: "m6 9 6 6 6-6" })
3166
3148
  }
3167
3149
  );
3168
3150
  var SchematicSheetSelector = ({
@@ -3170,16 +3152,16 @@ var SchematicSheetSelector = ({
3170
3152
  selectedSheetId,
3171
3153
  onSelectSheet
3172
3154
  }) => {
3173
- const [open, setOpen] = useState9(false);
3155
+ const [open, setOpen] = useState8(false);
3174
3156
  if (sheets.length <= 1) return null;
3175
3157
  const selectedSheet = sheets.find(
3176
3158
  (s) => s.schematic_sheet_id === selectedSheetId
3177
3159
  );
3178
3160
  const selectedLabel = selectedSheet?.name ?? "Select sheet";
3179
3161
  return /* @__PURE__ */ jsxs7(Fragment6, { children: [
3180
- /* @__PURE__ */ jsx9("style", { children: MENU_CSS }),
3162
+ /* @__PURE__ */ jsx10("style", { children: MENU_CSS }),
3181
3163
  /* @__PURE__ */ jsxs7(DropdownMenu.Root, { open, onOpenChange: setOpen, modal: false, children: [
3182
- /* @__PURE__ */ jsx9(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
3164
+ /* @__PURE__ */ jsx10(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
3183
3165
  "button",
3184
3166
  {
3185
3167
  type: "button",
@@ -3204,13 +3186,13 @@ var SchematicSheetSelector = ({
3204
3186
  fontFamily: FONT_FAMILY
3205
3187
  },
3206
3188
  children: [
3207
- /* @__PURE__ */ jsx9("span", { style: { color: "#888888", flexShrink: 0 }, children: "Sheet:" }),
3208
- /* @__PURE__ */ jsx9("span", { style: { ...ellipsisStyles, minWidth: 0 }, children: selectedLabel }),
3209
- /* @__PURE__ */ jsx9(ChevronDownIcon, { className: "sv-sheet-chevron" })
3189
+ /* @__PURE__ */ jsx10("span", { style: { color: "#888888", flexShrink: 0 }, children: "Sheet:" }),
3190
+ /* @__PURE__ */ jsx10("span", { style: { ...ellipsisStyles, minWidth: 0 }, children: selectedLabel }),
3191
+ /* @__PURE__ */ jsx10(ChevronDownIcon, { className: "sv-sheet-chevron" })
3210
3192
  ]
3211
3193
  }
3212
3194
  ) }),
3213
- /* @__PURE__ */ jsx9(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx9(
3195
+ /* @__PURE__ */ jsx10(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx10(
3214
3196
  DropdownMenu.Content,
3215
3197
  {
3216
3198
  style: contentStyles,
@@ -3232,8 +3214,8 @@ var SchematicSheetSelector = ({
3232
3214
  setOpen(false);
3233
3215
  },
3234
3216
  children: [
3235
- /* @__PURE__ */ jsx9("span", { style: iconSlotStyles, children: selected && /* @__PURE__ */ jsx9(CheckIcon, {}) }),
3236
- /* @__PURE__ */ jsx9("span", { style: { ...ellipsisStyles, minWidth: 0 }, children: sheet.name })
3217
+ /* @__PURE__ */ jsx10("span", { style: iconSlotStyles, children: selected && /* @__PURE__ */ jsx10(CheckIcon, {}) }),
3218
+ /* @__PURE__ */ jsx10("span", { style: { ...ellipsisStyles, minWidth: 0 }, children: sheet.name })
3237
3219
  ]
3238
3220
  },
3239
3221
  sheet.schematic_sheet_id
@@ -3246,7 +3228,7 @@ var SchematicSheetSelector = ({
3246
3228
  };
3247
3229
 
3248
3230
  // lib/components/SchematicWarningsButton.tsx
3249
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
3231
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
3250
3232
  var SchematicWarningsButton = ({
3251
3233
  count,
3252
3234
  showWarnings,
@@ -3296,12 +3278,12 @@ var SchematicWarningsButton = ({
3296
3278
  strokeLinejoin: "round",
3297
3279
  "aria-hidden": "true",
3298
3280
  children: [
3299
- /* @__PURE__ */ jsx10("path", { d: "M10.3 3.9 1.8 18.1A2 2 0 0 0 3.5 21h17a2 2 0 0 0 1.7-2.9L13.7 3.9a2 2 0 0 0-3.4 0Z" }),
3300
- /* @__PURE__ */ jsx10("path", { d: "M12 9v4m0 4h.01" })
3281
+ /* @__PURE__ */ jsx11("path", { d: "M10.3 3.9 1.8 18.1A2 2 0 0 0 3.5 21h17a2 2 0 0 0 1.7-2.9L13.7 3.9a2 2 0 0 0-3.4 0Z" }),
3282
+ /* @__PURE__ */ jsx11("path", { d: "M12 9v4m0 4h.01" })
3301
3283
  ]
3302
3284
  }
3303
3285
  ),
3304
- /* @__PURE__ */ jsx10("span", { children: count })
3286
+ /* @__PURE__ */ jsx11("span", { children: count })
3305
3287
  ]
3306
3288
  }
3307
3289
  );
@@ -3315,7 +3297,7 @@ import { useMemo as useMemo5 } from "react";
3315
3297
  // package.json
3316
3298
  var package_default = {
3317
3299
  name: "@tscircuit/schematic-viewer",
3318
- version: "2.0.108",
3300
+ version: "2.0.109",
3319
3301
  repository: {
3320
3302
  type: "git",
3321
3303
  url: "https://github.com/tscircuit/schematic-viewer"
@@ -3381,7 +3363,7 @@ var package_default = {
3381
3363
  };
3382
3364
 
3383
3365
  // lib/components/ViewMenu.tsx
3384
- import { Fragment as Fragment7, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
3366
+ import { Fragment as Fragment7, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
3385
3367
  var FONT_FAMILY2 = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
3386
3368
  var contentStyles2 = {
3387
3369
  backgroundColor: "#262626",
@@ -3430,7 +3412,7 @@ var HIGHLIGHT_CSS = `
3430
3412
  .sv-vm-item:hover:not([data-disabled]) { background-color: #404040; }
3431
3413
  .sv-vm-item[data-disabled] { opacity: 0.45; cursor: not-allowed; }
3432
3414
  `;
3433
- var CheckIcon2 = () => /* @__PURE__ */ jsx11(
3415
+ var CheckIcon2 = () => /* @__PURE__ */ jsx12(
3434
3416
  "svg",
3435
3417
  {
3436
3418
  width: "14",
@@ -3442,7 +3424,7 @@ var CheckIcon2 = () => /* @__PURE__ */ jsx11(
3442
3424
  strokeLinecap: "round",
3443
3425
  strokeLinejoin: "round",
3444
3426
  "aria-hidden": "true",
3445
- children: /* @__PURE__ */ jsx11("path", { d: "M20 6 9 17l-5-5" })
3427
+ children: /* @__PURE__ */ jsx12("path", { d: "M20 6 9 17l-5-5" })
3446
3428
  }
3447
3429
  );
3448
3430
  var ViewMenu = ({
@@ -3500,7 +3482,7 @@ var ViewMenu = ({
3500
3482
  }
3501
3483
  }, [circuitJsonKey]);
3502
3484
  if (isComponentMenu && (!pcbComponent || !onViewPcbComponent)) return null;
3503
- return /* @__PURE__ */ jsx11(
3485
+ return /* @__PURE__ */ jsx12(
3504
3486
  "div",
3505
3487
  {
3506
3488
  ref: menuRef,
@@ -3512,8 +3494,8 @@ var ViewMenu = ({
3512
3494
  height: 0
3513
3495
  },
3514
3496
  children: /* @__PURE__ */ jsxs9(DropdownMenu2.Root, { open: true, onOpenChange, modal: false, children: [
3515
- /* @__PURE__ */ jsx11(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx11("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
3516
- /* @__PURE__ */ jsx11(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsxs9(
3497
+ /* @__PURE__ */ jsx12(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx12("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
3498
+ /* @__PURE__ */ jsx12(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsxs9(
3517
3499
  DropdownMenu2.Content,
3518
3500
  {
3519
3501
  style: contentStyles2,
@@ -3522,8 +3504,8 @@ var ViewMenu = ({
3522
3504
  collisionPadding: 10,
3523
3505
  avoidCollisions: true,
3524
3506
  children: [
3525
- /* @__PURE__ */ jsx11("style", { children: HIGHLIGHT_CSS }),
3526
- pcbComponent && onViewPcbComponent && /* @__PURE__ */ jsx11(Fragment7, { children: /* @__PURE__ */ jsxs9(
3507
+ /* @__PURE__ */ jsx12("style", { children: HIGHLIGHT_CSS }),
3508
+ pcbComponent && onViewPcbComponent && /* @__PURE__ */ jsx12(Fragment7, { children: /* @__PURE__ */ jsxs9(
3527
3509
  DropdownMenu2.Item,
3528
3510
  {
3529
3511
  className: "sv-vm-item",
@@ -3533,8 +3515,8 @@ var ViewMenu = ({
3533
3515
  onViewPcbComponent(pcbComponent);
3534
3516
  },
3535
3517
  children: [
3536
- /* @__PURE__ */ jsx11("span", { style: iconSlotStyles2, children: "\u2197" }),
3537
- /* @__PURE__ */ jsx11("span", { children: "Show on PCB" })
3518
+ /* @__PURE__ */ jsx12("span", { style: iconSlotStyles2, children: "\u2197" }),
3519
+ /* @__PURE__ */ jsx12("span", { children: "Show on PCB" })
3538
3520
  ]
3539
3521
  }
3540
3522
  ) }),
@@ -3546,11 +3528,11 @@ var ViewMenu = ({
3546
3528
  style: itemStyles2,
3547
3529
  children: [
3548
3530
  "Net Locations ",
3549
- /* @__PURE__ */ jsx11("span", { style: { marginLeft: "auto" }, children: "\u203A" })
3531
+ /* @__PURE__ */ jsx12("span", { style: { marginLeft: "auto" }, children: "\u203A" })
3550
3532
  ]
3551
3533
  }
3552
3534
  ),
3553
- /* @__PURE__ */ jsx11(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsx11(
3535
+ /* @__PURE__ */ jsx12(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsx12(
3554
3536
  DropdownMenu2.SubContent,
3555
3537
  {
3556
3538
  style: {
@@ -3559,7 +3541,7 @@ var ViewMenu = ({
3559
3541
  overflowY: "auto"
3560
3542
  },
3561
3543
  collisionPadding: 10,
3562
- children: netLocations.map((location, index) => /* @__PURE__ */ jsx11(
3544
+ children: netLocations.map((location, index) => /* @__PURE__ */ jsx12(
3563
3545
  DropdownMenu2.Item,
3564
3546
  {
3565
3547
  className: "sv-vm-item",
@@ -3586,8 +3568,8 @@ var ViewMenu = ({
3586
3568
  if (hasPorts) onTogglePorts(!showPorts);
3587
3569
  },
3588
3570
  children: [
3589
- /* @__PURE__ */ jsx11("span", { style: iconSlotStyles2, children: showPorts && /* @__PURE__ */ jsx11(CheckIcon2, {}) }),
3590
- /* @__PURE__ */ jsx11("span", { children: "Show Schematic Ports" })
3571
+ /* @__PURE__ */ jsx12("span", { style: iconSlotStyles2, children: showPorts && /* @__PURE__ */ jsx12(CheckIcon2, {}) }),
3572
+ /* @__PURE__ */ jsx12("span", { children: "Show Schematic Ports" })
3591
3573
  ]
3592
3574
  }
3593
3575
  ),
@@ -3604,8 +3586,8 @@ var ViewMenu = ({
3604
3586
  if (hasGroups) onToggleGroups(!showGroups);
3605
3587
  },
3606
3588
  children: [
3607
- /* @__PURE__ */ jsx11("span", { style: iconSlotStyles2, children: showGroups && /* @__PURE__ */ jsx11(CheckIcon2, {}) }),
3608
- /* @__PURE__ */ jsx11("span", { children: "View Schematic Groups" })
3589
+ /* @__PURE__ */ jsx12("span", { style: iconSlotStyles2, children: showGroups && /* @__PURE__ */ jsx12(CheckIcon2, {}) }),
3590
+ /* @__PURE__ */ jsx12("span", { children: "View Schematic Groups" })
3609
3591
  ]
3610
3592
  }
3611
3593
  ),
@@ -3620,8 +3602,8 @@ var ViewMenu = ({
3620
3602
  onToggleGrid(!showGrid);
3621
3603
  },
3622
3604
  children: [
3623
- /* @__PURE__ */ jsx11("span", { style: iconSlotStyles2, children: showGrid && /* @__PURE__ */ jsx11(CheckIcon2, {}) }),
3624
- /* @__PURE__ */ jsx11("span", { children: "Show Grid" })
3605
+ /* @__PURE__ */ jsx12("span", { style: iconSlotStyles2, children: showGrid && /* @__PURE__ */ jsx12(CheckIcon2, {}) }),
3606
+ /* @__PURE__ */ jsx12("span", { children: "Show Grid" })
3625
3607
  ]
3626
3608
  }
3627
3609
  ),
@@ -3634,12 +3616,12 @@ var ViewMenu = ({
3634
3616
  onCheckedChange: onToggleWarnings,
3635
3617
  onSelect: (event) => event.preventDefault(),
3636
3618
  children: [
3637
- /* @__PURE__ */ jsx11("span", { style: iconSlotStyles2, children: /* @__PURE__ */ jsx11(DropdownMenu2.ItemIndicator, { children: /* @__PURE__ */ jsx11(CheckIcon2, {}) }) }),
3638
- /* @__PURE__ */ jsx11("span", { children: "Show Warnings" })
3619
+ /* @__PURE__ */ jsx12("span", { style: iconSlotStyles2, children: /* @__PURE__ */ jsx12(DropdownMenu2.ItemIndicator, { children: /* @__PURE__ */ jsx12(CheckIcon2, {}) }) }),
3620
+ /* @__PURE__ */ jsx12("span", { children: "Show Warnings" })
3639
3621
  ]
3640
3622
  }
3641
3623
  ),
3642
- /* @__PURE__ */ jsx11(DropdownMenu2.Separator, { style: separatorStyles }),
3624
+ /* @__PURE__ */ jsx12(DropdownMenu2.Separator, { style: separatorStyles }),
3643
3625
  /* @__PURE__ */ jsxs9(
3644
3626
  DropdownMenu2.Item,
3645
3627
  {
@@ -3647,12 +3629,12 @@ var ViewMenu = ({
3647
3629
  style: itemStyles2,
3648
3630
  onSelect: onRunStyleAnalysis,
3649
3631
  children: [
3650
- /* @__PURE__ */ jsx11("span", { style: iconSlotStyles2 }),
3651
- /* @__PURE__ */ jsx11("span", { children: "Run Style Analysis" })
3632
+ /* @__PURE__ */ jsx12("span", { style: iconSlotStyles2 }),
3633
+ /* @__PURE__ */ jsx12("span", { children: "Run Style Analysis" })
3652
3634
  ]
3653
3635
  }
3654
3636
  ),
3655
- /* @__PURE__ */ jsx11(DropdownMenu2.Separator, { style: separatorStyles }),
3637
+ /* @__PURE__ */ jsx12(DropdownMenu2.Separator, { style: separatorStyles }),
3656
3638
  /* @__PURE__ */ jsxs9(
3657
3639
  "div",
3658
3640
  {
@@ -3680,7 +3662,7 @@ var ViewMenu = ({
3680
3662
  };
3681
3663
 
3682
3664
  // lib/components/SchematicViewer.tsx
3683
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3665
+ import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
3684
3666
  var SchematicViewer = ({
3685
3667
  circuitJson,
3686
3668
  platformConfig,
@@ -3698,6 +3680,8 @@ var SchematicViewer = ({
3698
3680
  searchEnabled = true,
3699
3681
  controller,
3700
3682
  onViewPcbComponent,
3683
+ highlightedSchematicComponentIds,
3684
+ highlightedSchematicTextIds,
3701
3685
  css,
3702
3686
  className
3703
3687
  }) => {
@@ -3721,7 +3705,7 @@ var SchematicViewer = ({
3721
3705
  }, [circuitJsonKey]);
3722
3706
  const hasMultipleSheets = schematicSheets.length > 1;
3723
3707
  const defaultSheetId = schematicSheets[0]?.schematic_sheet_id;
3724
- const [selectedSheetId, setSelectedSheetId] = useState10(
3708
+ const [selectedSheetId, setSelectedSheetId] = useState9(
3725
3709
  () => {
3726
3710
  const stored = getStoredString(STORAGE_KEYS.SELECTED_SCHEMATIC_SHEET);
3727
3711
  if (stored && schematicSheets.some((s) => s.schematic_sheet_id === stored)) {
@@ -3730,14 +3714,14 @@ var SchematicViewer = ({
3730
3714
  return defaultSheetId;
3731
3715
  }
3732
3716
  );
3733
- useEffect13(() => {
3717
+ useEffect14(() => {
3734
3718
  const stillExists = selectedSheetId !== void 0 && schematicSheets.some((s) => s.schematic_sheet_id === selectedSheetId);
3735
3719
  if (!stillExists) {
3736
3720
  setSelectedSheetId(defaultSheetId);
3737
3721
  }
3738
3722
  }, [circuitJsonKey]);
3739
3723
  const activeSheetId = hasMultipleSheets ? selectedSheetId ?? defaultSheetId : void 0;
3740
- const handleSelectSheet = useCallback7(
3724
+ const handleSelectSheet = useCallback8(
3741
3725
  (sheetId) => {
3742
3726
  setSelectedSheetId(sheetId);
3743
3727
  setStoredString(STORAGE_KEYS.SELECTED_SCHEMATIC_SHEET, sheetId);
@@ -3745,32 +3729,32 @@ var SchematicViewer = ({
3745
3729
  },
3746
3730
  [onSchematicSheetChange]
3747
3731
  );
3748
- const [showGridInternal, setShowGridInternal] = useState10(false);
3749
- const [analysisCircuitJson, setAnalysisCircuitJson] = useState10(null);
3750
- const [showWarnings, setShowWarnings] = useState10(false);
3732
+ const [showGridInternal, setShowGridInternal] = useState9(false);
3733
+ const [analysisCircuitJson, setAnalysisCircuitJson] = useState9(null);
3734
+ const [showWarnings, setShowWarnings] = useState9(false);
3751
3735
  const warningCount = circuitJson.filter(
3752
3736
  (element) => element.type.startsWith("schematic_") && element.type.endsWith("_warning")
3753
3737
  ).length;
3754
3738
  const showGrid = debugGrid || showGridInternal;
3755
- const [isInteractionEnabled, setIsInteractionEnabled] = useState10(
3739
+ const [isInteractionEnabled, setIsInteractionEnabled] = useState9(
3756
3740
  !clickToInteractEnabled
3757
3741
  );
3758
- const [showSchematicGroups, setShowSchematicGroups] = useState10(() => {
3742
+ const [showSchematicGroups, setShowSchematicGroups] = useState9(() => {
3759
3743
  if (disableGroups) return false;
3760
3744
  return getStoredBoolean(STORAGE_KEYS.IS_SHOWING_SCHEMATIC_GROUPS, false);
3761
3745
  });
3762
- const [showSchematicPortsInternal, setShowSchematicPortsInternal] = useState10(
3746
+ const [showSchematicPortsInternal, setShowSchematicPortsInternal] = useState9(
3763
3747
  () => showSchematicPorts ?? getStoredBoolean(STORAGE_KEYS.IS_SHOWING_SCHEMATIC_PORTS, false)
3764
3748
  );
3765
- useEffect13(() => {
3749
+ useEffect14(() => {
3766
3750
  if (showSchematicPorts !== void 0) {
3767
3751
  setShowSchematicPortsInternal(showSchematicPorts);
3768
3752
  }
3769
3753
  }, [showSchematicPorts]);
3770
- const [isHoveringClickableComponent, setIsHoveringClickableComponent] = useState10(false);
3771
- const hoveringComponentsRef = useRef9(/* @__PURE__ */ new Set());
3772
- const [selectedSchematicComponent, setSelectedSchematicComponent] = useState10(null);
3773
- const handleComponentHoverChange = useCallback7(
3754
+ const [isHoveringClickableComponent, setIsHoveringClickableComponent] = useState9(false);
3755
+ const hoveringComponentsRef = useRef8(/* @__PURE__ */ new Set());
3756
+ const [selectedSchematicComponent, setSelectedSchematicComponent] = useState9(null);
3757
+ const handleComponentHoverChange = useCallback8(
3774
3758
  (componentId, isHovering) => {
3775
3759
  if (isHovering) {
3776
3760
  hoveringComponentsRef.current.add(componentId);
@@ -3781,9 +3765,9 @@ var SchematicViewer = ({
3781
3765
  },
3782
3766
  []
3783
3767
  );
3784
- const [isHoveringClickablePort, setIsHoveringClickablePort] = useState10(false);
3785
- const hoveringPortsRef = useRef9(/* @__PURE__ */ new Set());
3786
- const handlePortHoverChange = useCallback7(
3768
+ const [isHoveringClickablePort, setIsHoveringClickablePort] = useState9(false);
3769
+ const hoveringPortsRef = useRef8(/* @__PURE__ */ new Set());
3770
+ const handlePortHoverChange = useCallback8(
3787
3771
  (portId, isHovering) => {
3788
3772
  if (isHovering) {
3789
3773
  hoveringPortsRef.current.add(portId);
@@ -3794,9 +3778,9 @@ var SchematicViewer = ({
3794
3778
  },
3795
3779
  []
3796
3780
  );
3797
- const svgDivRef = useRef9(null);
3798
- const touchStartRef = useRef9(null);
3799
- const zoomScaleRef = useRef9({ x: 1, y: 1 });
3781
+ const svgDivRef = useRef8(null);
3782
+ const touchStartRef = useRef8(null);
3783
+ const zoomScaleRef = useRef8({ x: 1, y: 1 });
3800
3784
  const schematicComponentIds = useMemo6(() => {
3801
3785
  try {
3802
3786
  const components = su4(circuitJson).schematic_component?.list() ?? [];
@@ -3848,7 +3832,7 @@ var SchematicViewer = ({
3848
3832
  }
3849
3833
  touchStartRef.current = null;
3850
3834
  };
3851
- const shouldPanSchematic = useCallback7(
3835
+ const shouldPanSchematic = useCallback8(
3852
3836
  (event) => {
3853
3837
  if (event.target instanceof Element && event.target.closest(
3854
3838
  "[data-schematic-search], [data-schematic-warnings], .schematic-warning, [data-schematic-component-details-tooltip]"
@@ -3915,7 +3899,7 @@ var SchematicViewer = ({
3915
3899
  );
3916
3900
  return { left, top, width, maxHeight };
3917
3901
  }, [selectedSchematicComponent, containerWidth, containerHeight]);
3918
- const handleSchematicComponentClick = useCallback7(
3902
+ const handleSchematicComponentClick = useCallback8(
3919
3903
  (schematicComponentId, event) => {
3920
3904
  if (event.target instanceof Element && event.target.closest("[data-schematic-component-details-tooltip]")) {
3921
3905
  return;
@@ -3934,10 +3918,10 @@ var SchematicViewer = ({
3934
3918
  },
3935
3919
  [containerRef, onSchematicComponentClicked]
3936
3920
  );
3937
- useEffect13(() => {
3921
+ useEffect14(() => {
3938
3922
  setSelectedSchematicComponent(null);
3939
3923
  }, [circuitJsonKey, activeSheetId]);
3940
- useEffect13(() => {
3924
+ useEffect14(() => {
3941
3925
  if (!selectedSchematicComponent) return;
3942
3926
  const handleKeyDown = (event) => {
3943
3927
  if (event.key === "Escape") {
@@ -4021,7 +4005,7 @@ var SchematicViewer = ({
4021
4005
  enabled: netHoverHighlightEnabled
4022
4006
  });
4023
4007
  const svgDiv = useMemo6(
4024
- () => /* @__PURE__ */ jsx12(
4008
+ () => /* @__PURE__ */ jsx13(
4025
4009
  "div",
4026
4010
  {
4027
4011
  ref: svgDivRef,
@@ -4037,9 +4021,9 @@ var SchematicViewer = ({
4037
4021
  );
4038
4022
  useSchematicWarnings({ svgDivRef, svgContent: svgDiv, circuitJsonKey });
4039
4023
  return /* @__PURE__ */ jsxs10(MouseTracker, { children: [
4040
- netHoverHighlightEnabled && /* @__PURE__ */ jsx12("style", { children: `.sch-net-faded { opacity: 0.35; }
4024
+ netHoverHighlightEnabled && /* @__PURE__ */ jsx13("style", { children: `.sch-net-faded { opacity: 0.35; }
4041
4025
  svg :is(g.trace, g.trace-overlays, g[data-schematic-component-id], [data-schematic-net-label-id]) { transition: opacity 0.12s ease-in-out; }` }),
4042
- searchEnabled && /* @__PURE__ */ jsx12("style", { children: `.schematic-search-match text,
4026
+ searchEnabled && /* @__PURE__ */ jsx13("style", { children: `.schematic-search-match text,
4043
4027
  text.schematic-search-match {
4044
4028
  fill: #ff00d4 !important;
4045
4029
  }
@@ -4055,11 +4039,11 @@ var SchematicViewer = ({
4055
4039
  flex-direction: column;
4056
4040
  }
4057
4041
  }` }),
4058
- /* @__PURE__ */ jsx12("style", { children: `
4042
+ /* @__PURE__ */ jsx13("style", { children: `
4059
4043
  .schematic-component-clickable > svg { overflow: visible; }
4060
4044
  .schematic-component-clickable [data-schematic-component-id]:hover { cursor: pointer !important; }
4061
4045
  ` }),
4062
- onSchematicPortClicked && /* @__PURE__ */ jsx12("style", { children: "[data-schematic-port-id]:hover { cursor: pointer !important; }" }),
4046
+ onSchematicPortClicked && /* @__PURE__ */ jsx13("style", { children: "[data-schematic-port-id]:hover { cursor: pointer !important; }" }),
4063
4047
  /* @__PURE__ */ jsxs10(
4064
4048
  "div",
4065
4049
  {
@@ -4095,7 +4079,7 @@ var SchematicViewer = ({
4095
4079
  },
4096
4080
  onTouchCancel: contextMenuEventHandlers.onTouchCancel,
4097
4081
  children: [
4098
- !isInteractionEnabled && clickToInteractEnabled && /* @__PURE__ */ jsx12(
4082
+ !isInteractionEnabled && clickToInteractEnabled && /* @__PURE__ */ jsx13(
4099
4083
  "div",
4100
4084
  {
4101
4085
  onClick: (e) => {
@@ -4114,7 +4098,7 @@ var SchematicViewer = ({
4114
4098
  pointerEvents: "all",
4115
4099
  touchAction: "pan-x pan-y pinch-zoom"
4116
4100
  },
4117
- children: /* @__PURE__ */ jsx12(
4101
+ children: /* @__PURE__ */ jsx13(
4118
4102
  "div",
4119
4103
  {
4120
4104
  style: {
@@ -4131,14 +4115,14 @@ var SchematicViewer = ({
4131
4115
  )
4132
4116
  }
4133
4117
  ),
4134
- analysisCircuitJson && /* @__PURE__ */ jsx12(
4118
+ analysisCircuitJson && /* @__PURE__ */ jsx13(
4135
4119
  StyleAnalysisDialog,
4136
4120
  {
4137
4121
  circuitJson: analysisCircuitJson,
4138
4122
  onClose: () => setAnalysisCircuitJson(null)
4139
4123
  }
4140
4124
  ),
4141
- menuVisible && /* @__PURE__ */ jsx12(
4125
+ menuVisible && /* @__PURE__ */ jsx13(
4142
4126
  ViewMenu,
4143
4127
  {
4144
4128
  isComponentMenu: !!getSchematicComponentAtElement(menuTarget, circuitJson),
@@ -4196,7 +4180,7 @@ var SchematicViewer = ({
4196
4180
  zIndex: zIndexMap.schematicSearch
4197
4181
  },
4198
4182
  children: [
4199
- /* @__PURE__ */ jsx12(
4183
+ /* @__PURE__ */ jsx13(
4200
4184
  SchematicSheetSelector,
4201
4185
  {
4202
4186
  sheets: schematicSheets,
@@ -4204,7 +4188,7 @@ var SchematicViewer = ({
4204
4188
  onSelectSheet: handleSelectSheet
4205
4189
  }
4206
4190
  ),
4207
- searchEnabled && /* @__PURE__ */ jsx12(
4191
+ searchEnabled && /* @__PURE__ */ jsx13(
4208
4192
  SchematicSearch,
4209
4193
  {
4210
4194
  query: searchQuery,
@@ -4215,7 +4199,7 @@ var SchematicViewer = ({
4215
4199
  viewerContainerRef: containerRef
4216
4200
  }
4217
4201
  ),
4218
- warningCount > 0 && /* @__PURE__ */ jsx12(
4202
+ warningCount > 0 && /* @__PURE__ */ jsx13(
4219
4203
  SchematicWarningsButton,
4220
4204
  {
4221
4205
  count: warningCount,
@@ -4226,7 +4210,7 @@ var SchematicViewer = ({
4226
4210
  ]
4227
4211
  }
4228
4212
  ),
4229
- schematicComponentIds.map((componentId) => /* @__PURE__ */ jsx12(
4213
+ schematicComponentIds.map((componentId) => /* @__PURE__ */ jsx13(
4230
4214
  SchematicComponentMouseTarget,
4231
4215
  {
4232
4216
  componentId,
@@ -4239,8 +4223,28 @@ var SchematicViewer = ({
4239
4223
  },
4240
4224
  componentId
4241
4225
  )),
4226
+ highlightedSchematicComponentIds?.map((componentId) => /* @__PURE__ */ jsx13(
4227
+ SchematicElementHighlight,
4228
+ {
4229
+ selector: `[data-schematic-component-id="${componentId}"]`,
4230
+ svgDivRef,
4231
+ containerRef,
4232
+ circuitJsonKey
4233
+ },
4234
+ `component-${componentId}`
4235
+ )),
4236
+ highlightedSchematicTextIds?.map((textId) => /* @__PURE__ */ jsx13(
4237
+ SchematicElementHighlight,
4238
+ {
4239
+ selector: `[data-schematic-text-id="${textId}"]`,
4240
+ svgDivRef,
4241
+ containerRef,
4242
+ circuitJsonKey
4243
+ },
4244
+ `text-${textId}`
4245
+ )),
4242
4246
  svgDiv,
4243
- selectedComponentDetails && componentTooltipLayout && /* @__PURE__ */ jsx12(
4247
+ selectedComponentDetails && componentTooltipLayout && /* @__PURE__ */ jsx13(
4244
4248
  SchematicComponentDetailsTooltip,
4245
4249
  {
4246
4250
  platformConfig,
@@ -4252,7 +4256,7 @@ var SchematicViewer = ({
4252
4256
  ...componentTooltipLayout
4253
4257
  }
4254
4258
  ),
4255
- showSchematicPortsInternal && schematicPortsInfo.map(({ portId, label }) => /* @__PURE__ */ jsx12(
4259
+ showSchematicPortsInternal && schematicPortsInfo.map(({ portId, label }) => /* @__PURE__ */ jsx13(
4256
4260
  SchematicPortMouseTarget,
4257
4261
  {
4258
4262
  portId,
@@ -4282,7 +4286,7 @@ import {
4282
4286
  convertCircuitJsonToSchematicSimulationSvg,
4283
4287
  convertCircuitJsonToSimulationGraphSvg
4284
4288
  } from "circuit-to-svg";
4285
- import { useEffect as useEffect14, useMemo as useMemo7, useRef as useRef10, useState as useState12 } from "react";
4289
+ import { useEffect as useEffect15, useMemo as useMemo7, useRef as useRef9, useState as useState11 } from "react";
4286
4290
  import { toString as transformToString2 } from "transformation-matrix";
4287
4291
  import { useMouseMatrixTransform as useMouseMatrixTransform2 } from "use-mouse-matrix-transform";
4288
4292
 
@@ -4300,8 +4304,8 @@ var getAnalogSimulationBackgroundColor = (simulationSvg, colorOverrides) => getR
4300
4304
 
4301
4305
  // lib/components/AnalogSimulationSelector.tsx
4302
4306
  import * as DropdownMenu3 from "@radix-ui/react-dropdown-menu";
4303
- import { useState as useState11 } from "react";
4304
- import { Fragment as Fragment8, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
4307
+ import { useState as useState10 } from "react";
4308
+ import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
4305
4309
  var FONT_FAMILY3 = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
4306
4310
  var contentStyles3 = {
4307
4311
  backgroundColor: "#ffffff",
@@ -4351,7 +4355,7 @@ var MENU_CSS2 = `
4351
4355
  .sv-simulation-chevron { transition: transform 0.2s ease; }
4352
4356
  [data-state="open"] > .sv-simulation-chevron { transform: rotate(180deg); }
4353
4357
  `;
4354
- var CheckIcon3 = () => /* @__PURE__ */ jsx13(
4358
+ var CheckIcon3 = () => /* @__PURE__ */ jsx14(
4355
4359
  "svg",
4356
4360
  {
4357
4361
  width: "14",
@@ -4363,10 +4367,10 @@ var CheckIcon3 = () => /* @__PURE__ */ jsx13(
4363
4367
  strokeLinecap: "round",
4364
4368
  strokeLinejoin: "round",
4365
4369
  "aria-hidden": "true",
4366
- children: /* @__PURE__ */ jsx13("path", { d: "M20 6 9 17l-5-5" })
4370
+ children: /* @__PURE__ */ jsx14("path", { d: "M20 6 9 17l-5-5" })
4367
4371
  }
4368
4372
  );
4369
- var ChevronDownIcon2 = ({ className }) => /* @__PURE__ */ jsx13(
4373
+ var ChevronDownIcon2 = ({ className }) => /* @__PURE__ */ jsx14(
4370
4374
  "svg",
4371
4375
  {
4372
4376
  className,
@@ -4380,7 +4384,7 @@ var ChevronDownIcon2 = ({ className }) => /* @__PURE__ */ jsx13(
4380
4384
  strokeLinejoin: "round",
4381
4385
  style: { opacity: 0.6, flexShrink: 0 },
4382
4386
  "aria-hidden": "true",
4383
- children: /* @__PURE__ */ jsx13("path", { d: "m6 9 6 6 6-6" })
4387
+ children: /* @__PURE__ */ jsx14("path", { d: "m6 9 6 6 6-6" })
4384
4388
  }
4385
4389
  );
4386
4390
  var getSimulationLabels = (simulations) => {
@@ -4399,7 +4403,7 @@ var AnalogSimulationSelector = ({
4399
4403
  selectedSimulationExperimentId,
4400
4404
  onSelectSimulation
4401
4405
  }) => {
4402
- const [open, setOpen] = useState11(false);
4406
+ const [open, setOpen] = useState10(false);
4403
4407
  if (simulations.length <= 1) return null;
4404
4408
  const simulationLabels = getSimulationLabels(simulations);
4405
4409
  const selectedSimulation = simulationLabels.find(
@@ -4407,9 +4411,9 @@ var AnalogSimulationSelector = ({
4407
4411
  );
4408
4412
  const selectedLabel = selectedSimulation?.label ?? "Select simulation";
4409
4413
  return /* @__PURE__ */ jsxs11(Fragment8, { children: [
4410
- /* @__PURE__ */ jsx13("style", { children: MENU_CSS2 }),
4414
+ /* @__PURE__ */ jsx14("style", { children: MENU_CSS2 }),
4411
4415
  /* @__PURE__ */ jsxs11(DropdownMenu3.Root, { open, onOpenChange: setOpen, modal: false, children: [
4412
- /* @__PURE__ */ jsx13(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs11(
4416
+ /* @__PURE__ */ jsx14(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs11(
4413
4417
  "button",
4414
4418
  {
4415
4419
  type: "button",
@@ -4436,13 +4440,13 @@ var AnalogSimulationSelector = ({
4436
4440
  zIndex: zIndexMap.viewMenuIcon
4437
4441
  },
4438
4442
  children: [
4439
- /* @__PURE__ */ jsx13("span", { style: { color: "#888888", flexShrink: 0 }, children: "Simulation:" }),
4440
- /* @__PURE__ */ jsx13("span", { style: { ...ellipsisStyles2, minWidth: 0 }, children: selectedLabel }),
4441
- /* @__PURE__ */ jsx13(ChevronDownIcon2, { className: "sv-simulation-chevron" })
4443
+ /* @__PURE__ */ jsx14("span", { style: { color: "#888888", flexShrink: 0 }, children: "Simulation:" }),
4444
+ /* @__PURE__ */ jsx14("span", { style: { ...ellipsisStyles2, minWidth: 0 }, children: selectedLabel }),
4445
+ /* @__PURE__ */ jsx14(ChevronDownIcon2, { className: "sv-simulation-chevron" })
4442
4446
  ]
4443
4447
  }
4444
4448
  ) }),
4445
- /* @__PURE__ */ jsx13(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx13(
4449
+ /* @__PURE__ */ jsx14(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx14(
4446
4450
  DropdownMenu3.Content,
4447
4451
  {
4448
4452
  style: contentStyles3,
@@ -4464,8 +4468,8 @@ var AnalogSimulationSelector = ({
4464
4468
  setOpen(false);
4465
4469
  },
4466
4470
  children: [
4467
- /* @__PURE__ */ jsx13("span", { style: iconSlotStyles3, children: selected && /* @__PURE__ */ jsx13(CheckIcon3, {}) }),
4468
- /* @__PURE__ */ jsx13("span", { style: { ...ellipsisStyles2, minWidth: 0 }, children: label })
4471
+ /* @__PURE__ */ jsx14("span", { style: iconSlotStyles3, children: selected && /* @__PURE__ */ jsx14(CheckIcon3, {}) }),
4472
+ /* @__PURE__ */ jsx14("span", { style: { ...ellipsisStyles2, minWidth: 0 }, children: label })
4469
4473
  ]
4470
4474
  },
4471
4475
  simulation.simulation_experiment_id
@@ -4478,7 +4482,7 @@ var AnalogSimulationSelector = ({
4478
4482
  };
4479
4483
 
4480
4484
  // lib/components/AnalogSimulationViewer.tsx
4481
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
4485
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
4482
4486
  var DEFAULT_RENDER_WIDTH = 1200;
4483
4487
  var DEFAULT_COMBINED_RENDER_ASPECT_RATIO = 1;
4484
4488
  var DEFAULT_GRAPH_ONLY_RENDER_ASPECT_RATIO = 2;
@@ -4493,16 +4497,16 @@ var AnalogSimulationViewer = ({
4493
4497
  onSimulationChange,
4494
4498
  acSweepView = "magnitude"
4495
4499
  }) => {
4496
- const [circuitJson, setCircuitJson] = useState12(null);
4497
- const [isLoading, setIsLoading] = useState12(true);
4498
- const [error, setError] = useState12(null);
4499
- const [svgObjectUrl, setSvgObjectUrl] = useState12(null);
4500
- const containerRef = useRef10(null);
4501
- const imgRef = useRef10(null);
4500
+ const [circuitJson, setCircuitJson] = useState11(null);
4501
+ const [isLoading, setIsLoading] = useState11(true);
4502
+ const [error, setError] = useState11(null);
4503
+ const [svgObjectUrl, setSvgObjectUrl] = useState11(null);
4504
+ const containerRef = useRef9(null);
4505
+ const imgRef = useRef9(null);
4502
4506
  const { containerWidth } = useResizeHandling(
4503
4507
  containerRef
4504
4508
  );
4505
- const [isDragging, setIsDragging] = useState12(false);
4509
+ const [isDragging, setIsDragging] = useState11(false);
4506
4510
  const {
4507
4511
  ref: transformRef,
4508
4512
  cancelDrag: _cancelDrag,
@@ -4518,7 +4522,7 @@ var AnalogSimulationViewer = ({
4518
4522
  const renderAspectRatio = width && height ? width / height : defaultRenderAspectRatio;
4519
4523
  const effectiveWidth = width || (height ? height * renderAspectRatio : containerWidth) || DEFAULT_RENDER_WIDTH;
4520
4524
  const effectiveHeight = height || effectiveWidth / renderAspectRatio;
4521
- useEffect14(() => {
4525
+ useEffect15(() => {
4522
4526
  setIsLoading(true);
4523
4527
  setError(null);
4524
4528
  setCircuitJson(inputCircuitJson);
@@ -4530,11 +4534,11 @@ var AnalogSimulationViewer = ({
4530
4534
  (element) => element.type === "simulation_experiment"
4531
4535
  );
4532
4536
  }, [circuitJson]);
4533
- const [selectedSimulationExperimentId, setSelectedSimulationExperimentId] = useState12(null);
4537
+ const [selectedSimulationExperimentId, setSelectedSimulationExperimentId] = useState11(null);
4534
4538
  const simulationExperimentId = (selectedSimulationExperimentId && simulationExperiments.some(
4535
4539
  (simulation) => simulation.simulation_experiment_id === selectedSimulationExperimentId
4536
4540
  ) ? selectedSimulationExperimentId : simulationExperiments[0]?.simulation_experiment_id) ?? null;
4537
- useEffect14(() => {
4541
+ useEffect15(() => {
4538
4542
  if (simulationExperimentId !== selectedSimulationExperimentId) {
4539
4543
  setSelectedSimulationExperimentId(simulationExperimentId);
4540
4544
  }
@@ -4571,7 +4575,7 @@ var AnalogSimulationViewer = ({
4571
4575
  simulationExperimentId,
4572
4576
  acSweepView
4573
4577
  ]);
4574
- useEffect14(() => {
4578
+ useEffect15(() => {
4575
4579
  if (!simulationSvg) {
4576
4580
  setSvgObjectUrl(null);
4577
4581
  return;
@@ -4597,7 +4601,7 @@ var AnalogSimulationViewer = ({
4597
4601
  const handleTouchStart = (_e) => {
4598
4602
  setIsDragging(true);
4599
4603
  };
4600
- useEffect14(() => {
4604
+ useEffect15(() => {
4601
4605
  const handleMouseUp = () => {
4602
4606
  setIsDragging(false);
4603
4607
  };
@@ -4612,7 +4616,7 @@ var AnalogSimulationViewer = ({
4612
4616
  };
4613
4617
  }, []);
4614
4618
  if (isLoading) {
4615
- return /* @__PURE__ */ jsx14(
4619
+ return /* @__PURE__ */ jsx15(
4616
4620
  "div",
4617
4621
  {
4618
4622
  style: {
@@ -4632,7 +4636,7 @@ var AnalogSimulationViewer = ({
4632
4636
  );
4633
4637
  }
4634
4638
  if (error) {
4635
- return /* @__PURE__ */ jsx14(
4639
+ return /* @__PURE__ */ jsx15(
4636
4640
  "div",
4637
4641
  {
4638
4642
  style: {
@@ -4648,8 +4652,8 @@ var AnalogSimulationViewer = ({
4648
4652
  },
4649
4653
  className,
4650
4654
  children: /* @__PURE__ */ jsxs12("div", { style: { textAlign: "center", padding: "20px" }, children: [
4651
- /* @__PURE__ */ jsx14("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "Circuit Conversion Error" }),
4652
- /* @__PURE__ */ jsx14("div", { style: { fontSize: "14px" }, children: error })
4655
+ /* @__PURE__ */ jsx15("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "Circuit Conversion Error" }),
4656
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: "14px" }, children: error })
4653
4657
  ] })
4654
4658
  }
4655
4659
  );
@@ -4671,11 +4675,11 @@ var AnalogSimulationViewer = ({
4671
4675
  },
4672
4676
  className,
4673
4677
  children: [
4674
- /* @__PURE__ */ jsx14("div", { style: { fontSize: "16px", color: "#475569", fontWeight: 500 }, children: "No Simulation Found" }),
4678
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: "16px", color: "#475569", fontWeight: 500 }, children: "No Simulation Found" }),
4675
4679
  /* @__PURE__ */ jsxs12("div", { style: { fontSize: "14px", color: "#64748b" }, children: [
4676
4680
  "Use",
4677
4681
  " ",
4678
- /* @__PURE__ */ jsx14(
4682
+ /* @__PURE__ */ jsx15(
4679
4683
  "code",
4680
4684
  {
4681
4685
  style: {
@@ -4714,7 +4718,7 @@ var AnalogSimulationViewer = ({
4714
4718
  onMouseDown: handleMouseDown,
4715
4719
  onTouchStart: handleTouchStart,
4716
4720
  children: [
4717
- /* @__PURE__ */ jsx14(
4721
+ /* @__PURE__ */ jsx15(
4718
4722
  AnalogSimulationSelector,
4719
4723
  {
4720
4724
  simulations: simulationExperiments,
@@ -4722,7 +4726,7 @@ var AnalogSimulationViewer = ({
4722
4726
  onSelectSimulation: handleSelectSimulation
4723
4727
  }
4724
4728
  ),
4725
- svgObjectUrl ? /* @__PURE__ */ jsx14(
4729
+ svgObjectUrl ? /* @__PURE__ */ jsx15(
4726
4730
  "img",
4727
4731
  {
4728
4732
  ref: imgRef,
@@ -4736,7 +4740,7 @@ var AnalogSimulationViewer = ({
4736
4740
  objectFit: "contain"
4737
4741
  }
4738
4742
  }
4739
- ) : /* @__PURE__ */ jsx14(
4743
+ ) : /* @__PURE__ */ jsx15(
4740
4744
  "div",
4741
4745
  {
4742
4746
  style: {
@@ -4757,16 +4761,16 @@ var AnalogSimulationViewer = ({
4757
4761
  };
4758
4762
 
4759
4763
  // lib/hooks/useSchematicViewerController.ts
4760
- import { useCallback as useCallback8, useMemo as useMemo8, useState as useState13 } from "react";
4764
+ import { useCallback as useCallback9, useMemo as useMemo8, useState as useState12 } from "react";
4761
4765
  var useSchematicViewerController = () => {
4762
- const [focusRequest, setFocusRequest] = useState13(null);
4763
- const focusSchematicComponent = useCallback8(
4766
+ const [focusRequest, setFocusRequest] = useState12(null);
4767
+ const focusSchematicComponent = useCallback9(
4764
4768
  (schematicComponentId) => {
4765
4769
  setFocusRequest({ schematicComponentId });
4766
4770
  },
4767
4771
  []
4768
4772
  );
4769
- const onFocusRequestHandled = useCallback8(
4773
+ const onFocusRequestHandled = useCallback9(
4770
4774
  (request) => {
4771
4775
  setFocusRequest((current) => current === request ? null : current);
4772
4776
  },