@tscircuit/3d-viewer 0.0.615 → 0.0.616

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +224 -141
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18979,7 +18979,7 @@ var useHiddenCadComponents = (circuitKey) => {
18979
18979
  };
18980
18980
 
18981
18981
  // src/CadViewer.tsx
18982
- import { useCallback as useCallback24, useContext as useContext10, useEffect as useEffect50, useRef as useRef29, useState as useState42 } from "react";
18982
+ import { useCallback as useCallback24, useContext as useContext11, useEffect as useEffect50, useRef as useRef29, useState as useState42 } from "react";
18983
18983
  import * as THREE54 from "three";
18984
18984
 
18985
18985
  // src/hooks/use-convert-children-to-soup.ts
@@ -45485,7 +45485,7 @@ import * as THREE25 from "three";
45485
45485
  // package.json
45486
45486
  var package_default = {
45487
45487
  name: "@tscircuit/3d-viewer",
45488
- version: "0.0.614",
45488
+ version: "0.0.615",
45489
45489
  repository: {
45490
45490
  type: "git",
45491
45491
  url: "https://github.com/tscircuit/3d-viewer"
@@ -54551,6 +54551,8 @@ function mergeProps(slotProps, childProps) {
54551
54551
  overrideProps[propName] = { ...slotPropValue, ...childPropValue };
54552
54552
  } else if (propName === "className") {
54553
54553
  overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
54554
+ } else if (propName === "aria-describedby") {
54555
+ overrideProps[propName] = concatAriaDescribedby(childPropValue, slotPropValue);
54554
54556
  }
54555
54557
  }
54556
54558
  return { ...slotProps, ...overrideProps };
@@ -54583,6 +54585,17 @@ function isPromiseLike(value) {
54583
54585
  return typeof value === "object" && value !== null && "then" in value;
54584
54586
  }
54585
54587
  __name6(isPromiseLike, "isPromiseLike");
54588
+ function concatAriaDescribedby(...values) {
54589
+ const ids = /* @__PURE__ */ new Set();
54590
+ for (const value of values) {
54591
+ if (typeof value !== "string") continue;
54592
+ for (const id of String(value).trim().split(/\s+/)) {
54593
+ if (id) ids.add(id);
54594
+ }
54595
+ }
54596
+ return ids.size > 0 ? Array.from(ids).join(" ") : void 0;
54597
+ }
54598
+ __name6(concatAriaDescribedby, "concatAriaDescribedby");
54586
54599
  var createSlotError = /* @__PURE__ */ __name6((ownerName) => {
54587
54600
  return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
54588
54601
  }, "createSlotError");
@@ -55186,10 +55199,14 @@ import * as React19 from "react";
55186
55199
  import { jsx as jsx25 } from "react/jsx-runtime";
55187
55200
  var __defProp11 = Object.defineProperty;
55188
55201
  var __name9 = (target, value) => __defProp11(target, "name", { value, configurable: true });
55202
+ var Direction = {
55203
+ LTR: "ltr",
55204
+ RTL: "rtl"
55205
+ };
55189
55206
  var DirectionContext = React19.createContext(void 0);
55190
55207
  function useDirection(localDir) {
55191
55208
  const globalDir = React19.useContext(DirectionContext);
55192
- return localDir || globalDir || "ltr";
55209
+ return localDir || globalDir || Direction.LTR;
55193
55210
  }
55194
55211
  __name9(useDirection, "useDirection");
55195
55212
 
@@ -55602,6 +55619,7 @@ var FocusScope = /* @__PURE__ */ React25.forwardRef(
55602
55619
  const {
55603
55620
  loop = false,
55604
55621
  trapped = false,
55622
+ branches,
55605
55623
  onMountAutoFocus: onMountAutoFocusProp,
55606
55624
  onUnmountAutoFocus: onUnmountAutoFocusProp,
55607
55625
  ...scopeProps
@@ -55611,6 +55629,18 @@ var FocusScope = /* @__PURE__ */ React25.forwardRef(
55611
55629
  const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
55612
55630
  const lastFocusedElementRef = React25.useRef(null);
55613
55631
  const composedRefs = useComposedRefs(forwardedRef, setContainer);
55632
+ const branchesRef = React25.useRef(branches);
55633
+ React25.useEffect(() => {
55634
+ branchesRef.current = branches;
55635
+ });
55636
+ const isTargetInScope = React25.useCallback(
55637
+ (target) => {
55638
+ if (!target) return false;
55639
+ if (container?.contains(target)) return true;
55640
+ return Boolean(branchesRef.current?.some((branch) => branch.contains(target)));
55641
+ },
55642
+ [container]
55643
+ );
55614
55644
  const focusScope = React25.useRef({
55615
55645
  paused: false,
55616
55646
  pause() {
@@ -55625,7 +55655,7 @@ var FocusScope = /* @__PURE__ */ React25.forwardRef(
55625
55655
  let handleFocusIn2 = function(event) {
55626
55656
  if (focusScope.paused || !container) return;
55627
55657
  const target = event.target;
55628
- if (container.contains(target)) {
55658
+ if (isTargetInScope(target)) {
55629
55659
  lastFocusedElementRef.current = target;
55630
55660
  } else {
55631
55661
  focus(lastFocusedElementRef.current, { select: true });
@@ -55634,7 +55664,7 @@ var FocusScope = /* @__PURE__ */ React25.forwardRef(
55634
55664
  if (focusScope.paused || !container) return;
55635
55665
  const relatedTarget = event.relatedTarget;
55636
55666
  if (relatedTarget === null) return;
55637
- if (!container.contains(relatedTarget)) {
55667
+ if (!isTargetInScope(relatedTarget)) {
55638
55668
  focus(lastFocusedElementRef.current, { select: true });
55639
55669
  }
55640
55670
  }, handleMutations2 = function(mutations) {
@@ -55658,7 +55688,7 @@ var FocusScope = /* @__PURE__ */ React25.forwardRef(
55658
55688
  mutationObserver.disconnect();
55659
55689
  };
55660
55690
  }
55661
- }, [trapped, container, focusScope.paused]);
55691
+ }, [trapped, container, focusScope.paused, isTargetInScope]);
55662
55692
  React25.useEffect(() => {
55663
55693
  if (container) {
55664
55694
  focusScopesStack.add(focusScope);
@@ -55718,6 +55748,35 @@ var FocusScope = /* @__PURE__ */ React25.forwardRef(
55718
55748
  return /* @__PURE__ */ jsx27(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
55719
55749
  }, "FocusScope")
55720
55750
  );
55751
+ var FocusScopeBranchContext = React25.createContext(null);
55752
+ function FocusScopeBranchProvider({ registry, children }) {
55753
+ if (!registry) {
55754
+ return children;
55755
+ }
55756
+ return /* @__PURE__ */ jsx27(FocusScopeBranchContext.Provider, { value: registry, children });
55757
+ }
55758
+ __name13(FocusScopeBranchProvider, "FocusScopeBranchProvider");
55759
+ function useFocusScopeBranchRegistry() {
55760
+ const [nodes, setNodes] = React25.useState([]);
55761
+ const registry = React25.useMemo(
55762
+ () => ({
55763
+ add: /* @__PURE__ */ __name13((node) => setNodes((prev) => prev.includes(node) ? prev : [...prev, node]), "add"),
55764
+ remove: /* @__PURE__ */ __name13((node) => setNodes((prev) => prev.filter((current) => current !== node)), "remove")
55765
+ }),
55766
+ []
55767
+ );
55768
+ return { nodes, registry };
55769
+ }
55770
+ __name13(useFocusScopeBranchRegistry, "useFocusScopeBranchRegistry");
55771
+ function useFocusScopeBranch(node) {
55772
+ const registry = React25.useContext(FocusScopeBranchContext);
55773
+ React25.useEffect(() => {
55774
+ if (!node || !registry) return;
55775
+ registry.add(node);
55776
+ return () => registry.remove(node);
55777
+ }, [node, registry]);
55778
+ }
55779
+ __name13(useFocusScopeBranch, "useFocusScopeBranch");
55721
55780
  function focusFirst(candidates, { select = false } = {}) {
55722
55781
  const previouslyFocusedElement = document.activeElement;
55723
55782
  for (const candidate of candidates) {
@@ -57742,6 +57801,7 @@ function useSize(element) {
57742
57801
  useLayoutEffect2(() => {
57743
57802
  if (element) {
57744
57803
  setSize({ width: element.offsetWidth, height: element.offsetHeight });
57804
+ let rAF = 0;
57745
57805
  const resizeObserver = new ResizeObserver((entries) => {
57746
57806
  if (!Array.isArray(entries)) {
57747
57807
  return;
@@ -57750,21 +57810,27 @@ function useSize(element) {
57750
57810
  return;
57751
57811
  }
57752
57812
  const entry = entries[0];
57753
- let width10;
57754
- let height10;
57755
- if ("borderBoxSize" in entry) {
57756
- const borderSizeEntry = entry["borderBoxSize"];
57757
- const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
57758
- width10 = borderSize["inlineSize"];
57759
- height10 = borderSize["blockSize"];
57760
- } else {
57761
- width10 = element.offsetWidth;
57762
- height10 = element.offsetHeight;
57763
- }
57764
- setSize({ width: width10, height: height10 });
57813
+ window.cancelAnimationFrame(rAF);
57814
+ rAF = window.requestAnimationFrame(() => {
57815
+ let width10;
57816
+ let height10;
57817
+ if ("borderBoxSize" in entry) {
57818
+ const borderSizeEntry = entry["borderBoxSize"];
57819
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
57820
+ width10 = borderSize["inlineSize"];
57821
+ height10 = borderSize["blockSize"];
57822
+ } else {
57823
+ width10 = element.offsetWidth;
57824
+ height10 = element.offsetHeight;
57825
+ }
57826
+ setSize({ width: width10, height: height10 });
57827
+ });
57765
57828
  });
57766
57829
  resizeObserver.observe(element, { box: "border-box" });
57767
- return () => resizeObserver.unobserve(element);
57830
+ return () => {
57831
+ window.cancelAnimationFrame(rAF);
57832
+ resizeObserver.unobserve(element);
57833
+ };
57768
57834
  } else {
57769
57835
  setSize(void 0);
57770
57836
  }
@@ -57777,6 +57843,14 @@ __name15(useSize, "useSize");
57777
57843
  import { jsx as jsx28 } from "react/jsx-runtime";
57778
57844
  var __defProp18 = Object.defineProperty;
57779
57845
  var __name16 = (target, value) => __defProp18(target, "name", { value, configurable: true });
57846
+ var Sticky = {
57847
+ Partial: "partial",
57848
+ Always: "always"
57849
+ };
57850
+ var UpdatePositionStrategy = {
57851
+ Optimized: "optimized",
57852
+ Always: "always"
57853
+ };
57780
57854
  var POPPER_NAME = "Popper";
57781
57855
  var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
57782
57856
  var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
@@ -57852,9 +57926,9 @@ var PopperContent = /* @__PURE__ */ React29.forwardRef(
57852
57926
  avoidCollisions = true,
57853
57927
  collisionBoundary = [],
57854
57928
  collisionPadding: collisionPaddingProp = 0,
57855
- sticky = "partial",
57929
+ sticky = Sticky.Partial,
57856
57930
  hideWhenDetached = false,
57857
- updatePositionStrategy = "optimized",
57931
+ updatePositionStrategy = UpdatePositionStrategy.Optimized,
57858
57932
  onPlaced,
57859
57933
  ...contentProps
57860
57934
  } = props;
@@ -57881,7 +57955,7 @@ var PopperContent = /* @__PURE__ */ React29.forwardRef(
57881
57955
  placement: desiredPlacement,
57882
57956
  whileElementsMounted: /* @__PURE__ */ __name16((...args) => {
57883
57957
  const cleanup = autoUpdate(...args, {
57884
- animationFrame: updatePositionStrategy === "always"
57958
+ animationFrame: updatePositionStrategy === UpdatePositionStrategy.Always
57885
57959
  });
57886
57960
  return cleanup;
57887
57961
  }, "whileElementsMounted"),
@@ -57893,7 +57967,7 @@ var PopperContent = /* @__PURE__ */ React29.forwardRef(
57893
57967
  avoidCollisions && shift3({
57894
57968
  mainAxis: true,
57895
57969
  crossAxis: false,
57896
- limiter: sticky === "partial" ? limitShift3() : void 0,
57970
+ limiter: sticky === Sticky.Partial ? limitShift3() : void 0,
57897
57971
  ...detectOverflowOptions
57898
57972
  }),
57899
57973
  avoidCollisions && flip3({ ...detectOverflowOptions }),
@@ -58041,9 +58115,6 @@ function getSideAndAlignFromPlacement(placement) {
58041
58115
  return [side, align];
58042
58116
  }
58043
58117
  __name16(getSideAndAlignFromPlacement, "getSideAndAlignFromPlacement");
58044
- var Root2 = Popper;
58045
- var Anchor = PopperAnchor;
58046
- var Content = PopperContent;
58047
58118
 
58048
58119
  // node_modules/@radix-ui/react-portal/dist/index.mjs
58049
58120
  import * as React30 from "react";
@@ -58288,6 +58359,14 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
58288
58359
  GROUP_NAME,
58289
58360
  [createCollectionScope]
58290
58361
  );
58362
+ var Orientation = {
58363
+ Vertical: "vertical",
58364
+ Horizontal: "horizontal"
58365
+ };
58366
+ var Direction2 = {
58367
+ LTR: "ltr",
58368
+ RTL: "rtl"
58369
+ };
58291
58370
  var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
58292
58371
  var RovingFocusGroup = /* @__PURE__ */ React33.forwardRef(
58293
58372
  // blank line to reduce diff noise
@@ -58476,14 +58555,18 @@ var MAP_KEY_TO_FOCUS_INTENT = {
58476
58555
  End: "last"
58477
58556
  };
58478
58557
  function getDirectionAwareKey(key, dir) {
58479
- if (dir !== "rtl") return key;
58558
+ if (dir !== Direction2.RTL) return key;
58480
58559
  return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
58481
58560
  }
58482
58561
  __name20(getDirectionAwareKey, "getDirectionAwareKey");
58483
58562
  function getFocusIntent(event, orientation2, dir) {
58484
58563
  const key = getDirectionAwareKey(event.key, dir);
58485
- if (orientation2 === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
58486
- if (orientation2 === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
58564
+ if (orientation2 === Orientation.Vertical && ["ArrowLeft", "ArrowRight"].includes(key)) {
58565
+ return void 0;
58566
+ }
58567
+ if (orientation2 === Orientation.Horizontal && ["ArrowUp", "ArrowDown"].includes(key)) {
58568
+ return void 0;
58569
+ }
58487
58570
  return MAP_KEY_TO_FOCUS_INTENT[key];
58488
58571
  }
58489
58572
  __name20(getFocusIntent, "getFocusIntent");
@@ -58500,8 +58583,6 @@ function wrapArray(array, startIndex) {
58500
58583
  return array.map((_, index2) => array[(startIndex + index2) % array.length]);
58501
58584
  }
58502
58585
  __name20(wrapArray, "wrapArray");
58503
- var Root = RovingFocusGroup;
58504
- var Item = RovingFocusGroupItem;
58505
58586
 
58506
58587
  // node_modules/aria-hidden/dist/es2015/index.js
58507
58588
  var getDefaultParent = function(originalTarget) {
@@ -59348,6 +59429,10 @@ var Combination_default = ReactRemoveScroll;
59348
59429
  import { jsx as jsx31 } from "react/jsx-runtime";
59349
59430
  var __defProp23 = Object.defineProperty;
59350
59431
  var __name21 = (target, value) => __defProp23(target, "name", { value, configurable: true });
59432
+ var Direction3 = {
59433
+ LTR: "ltr",
59434
+ RTL: "rtl"
59435
+ };
59351
59436
  var SELECTION_KEYS = ["Enter", " "];
59352
59437
  var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
59353
59438
  var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
@@ -59400,7 +59485,7 @@ var Menu = /* @__PURE__ */ __name21((props) => {
59400
59485
  window.addEventListener("blur", handleBlur);
59401
59486
  return () => window.removeEventListener("blur", handleBlur);
59402
59487
  }, [open, handleOpenChange]);
59403
- return /* @__PURE__ */ jsx31(Root2, { ...popperScope, children: /* @__PURE__ */ jsx31(
59488
+ return /* @__PURE__ */ jsx31(Popper, { ...popperScope, children: /* @__PURE__ */ jsx31(
59404
59489
  MenuProvider,
59405
59490
  {
59406
59491
  scope: __scopeMenu,
@@ -59426,7 +59511,7 @@ var MenuAnchor = /* @__PURE__ */ React41.forwardRef(
59426
59511
  /* @__PURE__ */ __name21(function MenuAnchor2(props, forwardedRef) {
59427
59512
  const { __scopeMenu, ...anchorProps } = props;
59428
59513
  const popperScope = usePopperScope(__scopeMenu);
59429
- return /* @__PURE__ */ jsx31(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
59514
+ return /* @__PURE__ */ jsx31(PopperAnchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
59430
59515
  }, "MenuAnchor")
59431
59516
  );
59432
59517
  var PORTAL_NAME = "MenuPortal";
@@ -59518,15 +59603,32 @@ var MenuContentImpl = /* @__PURE__ */ React41.forwardRef(
59518
59603
  const getItems = useCollection2(__scopeMenu);
59519
59604
  const [currentItemId, setCurrentItemId] = React41.useState(null);
59520
59605
  const contentRef = React41.useRef(null);
59521
- const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
59606
+ const [branchNode, setBranchNode] = React41.useState(null);
59607
+ useFocusScopeBranch(branchNode);
59608
+ const { nodes: branchNodes, registry: branchRegistry } = useFocusScopeBranchRegistry();
59609
+ const isModal = Boolean(trapFocus || disableOutsideScroll);
59610
+ const composedRefs = useComposedRefs(
59611
+ forwardedRef,
59612
+ contentRef,
59613
+ context.onContentChange,
59614
+ setBranchNode
59615
+ );
59522
59616
  const timerRef = React41.useRef(0);
59523
59617
  const searchRef = React41.useRef("");
59524
59618
  const pointerGraceTimerRef = React41.useRef(0);
59525
59619
  const pointerGraceIntentRef = React41.useRef(null);
59526
59620
  const pointerDirRef = React41.useRef("right");
59527
59621
  const lastPointerXRef = React41.useRef(0);
59622
+ const shards = React41.useMemo(
59623
+ () => disableOutsideScroll ? [contentRef, ...branchNodes.map((node) => ({ current: node }))] : [],
59624
+ [contentRef, branchNodes, disableOutsideScroll]
59625
+ );
59528
59626
  const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React41.Fragment;
59529
- const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;
59627
+ const scrollLockWrapperProps = disableOutsideScroll ? {
59628
+ as: Slot,
59629
+ allowPinchZoom: true,
59630
+ shards
59631
+ } : void 0;
59530
59632
  const handleTypeaheadSearch = /* @__PURE__ */ __name21((key) => {
59531
59633
  const search = searchRef.current + key;
59532
59634
  const items = getItems().filter((item) => !item.disabled);
@@ -59581,11 +59683,12 @@ var MenuContentImpl = /* @__PURE__ */ React41.forwardRef(
59581
59683
  onPointerGraceIntentChange: React41.useCallback((intent) => {
59582
59684
  pointerGraceIntentRef.current = intent;
59583
59685
  }, []),
59584
- children: /* @__PURE__ */ jsx31(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx31(
59686
+ children: /* @__PURE__ */ jsx31(FocusScopeBranchProvider, { registry: isModal ? branchRegistry : null, children: /* @__PURE__ */ jsx31(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx31(
59585
59687
  FocusScope,
59586
59688
  {
59587
59689
  asChild: true,
59588
59690
  trapped: trapFocus,
59691
+ branches: branchNodes,
59589
59692
  onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
59590
59693
  event.preventDefault();
59591
59694
  contentRef.current?.focus({ preventScroll: true });
@@ -59602,7 +59705,7 @@ var MenuContentImpl = /* @__PURE__ */ React41.forwardRef(
59602
59705
  onInteractOutside,
59603
59706
  onDismiss,
59604
59707
  children: /* @__PURE__ */ jsx31(
59605
- Root,
59708
+ RovingFocusGroup,
59606
59709
  {
59607
59710
  asChild: true,
59608
59711
  ...rovingFocusGroupScope,
@@ -59616,7 +59719,7 @@ var MenuContentImpl = /* @__PURE__ */ React41.forwardRef(
59616
59719
  }),
59617
59720
  preventScrollOnEntryFocus: true,
59618
59721
  children: /* @__PURE__ */ jsx31(
59619
- Content,
59722
+ PopperContent,
59620
59723
  {
59621
59724
  role: "menu",
59622
59725
  "aria-orientation": "vertical",
@@ -59670,7 +59773,7 @@ var MenuContentImpl = /* @__PURE__ */ React41.forwardRef(
59670
59773
  }
59671
59774
  )
59672
59775
  }
59673
- ) })
59776
+ ) }) })
59674
59777
  }
59675
59778
  );
59676
59779
  }, "MenuContentImpl")
@@ -59751,7 +59854,7 @@ var MenuItemImpl = /* @__PURE__ */ React41.forwardRef(
59751
59854
  scope: __scopeMenu,
59752
59855
  disabled,
59753
59856
  textValue: textValue ?? textContent,
59754
- children: /* @__PURE__ */ jsx31(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx31(
59857
+ children: /* @__PURE__ */ jsx31(RovingFocusGroupItem, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx31(
59755
59858
  Primitive.div,
59756
59859
  {
59757
59860
  role: "menuitem",
@@ -59845,7 +59948,7 @@ var MenuSub = /* @__PURE__ */ __name21((props) => {
59845
59948
  if (parentMenuContext.open === false) handleOpenChange(false);
59846
59949
  return () => handleOpenChange(false);
59847
59950
  }, [parentMenuContext.open, handleOpenChange]);
59848
- return /* @__PURE__ */ jsx31(Root2, { ...popperScope, children: /* @__PURE__ */ jsx31(
59951
+ return /* @__PURE__ */ jsx31(Popper, { ...popperScope, children: /* @__PURE__ */ jsx31(
59849
59952
  MenuProvider,
59850
59953
  {
59851
59954
  scope: __scopeMenu,
@@ -59991,7 +60094,7 @@ var MenuSubContent = /* @__PURE__ */ React41.forwardRef(
59991
60094
  ...subContentProps,
59992
60095
  ref: composedRefs,
59993
60096
  align,
59994
- side: rootContext.dir === "rtl" ? "left" : "right",
60097
+ side: rootContext.dir === Direction3.RTL ? "left" : "right",
59995
60098
  disableOutsidePointerEvents: false,
59996
60099
  disableOutsideScroll: false,
59997
60100
  trapFocus: false,
@@ -60084,16 +60187,6 @@ function whenMouse(handler) {
60084
60187
  return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
60085
60188
  }
60086
60189
  __name21(whenMouse, "whenMouse");
60087
- var Root3 = Menu;
60088
- var Anchor2 = MenuAnchor;
60089
- var Portal3 = MenuPortal;
60090
- var Content2 = MenuContent;
60091
- var Item2 = MenuItem;
60092
- var CheckboxItem = MenuCheckboxItem;
60093
- var Separator = MenuSeparator;
60094
- var Sub = MenuSub;
60095
- var SubTrigger = MenuSubTrigger;
60096
- var SubContent = MenuSubContent;
60097
60190
 
60098
60191
  // node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs
60099
60192
  import { jsx as jsx32 } from "react/jsx-runtime";
@@ -60135,7 +60228,7 @@ var DropdownMenu = /* @__PURE__ */ __name22((props) => {
60135
60228
  onOpenChange: setOpen,
60136
60229
  onOpenToggle: React42.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
60137
60230
  modal,
60138
- children: /* @__PURE__ */ jsx32(Root3, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
60231
+ children: /* @__PURE__ */ jsx32(Menu, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
60139
60232
  }
60140
60233
  );
60141
60234
  }, "DropdownMenu");
@@ -60147,7 +60240,7 @@ var DropdownMenuTrigger = /* @__PURE__ */ React42.forwardRef(
60147
60240
  const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
60148
60241
  const menuScope = useMenuScope(__scopeDropdownMenu);
60149
60242
  const composedRefs = useComposedRefs(forwardedRef, context.triggerRef);
60150
- return /* @__PURE__ */ jsx32(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx32(
60243
+ return /* @__PURE__ */ jsx32(MenuAnchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx32(
60151
60244
  Primitive.button,
60152
60245
  {
60153
60246
  type: "button",
@@ -60179,7 +60272,7 @@ var DropdownMenuTrigger = /* @__PURE__ */ React42.forwardRef(
60179
60272
  var DropdownMenuPortal = /* @__PURE__ */ __name22((props) => {
60180
60273
  const { __scopeDropdownMenu, ...portalProps } = props;
60181
60274
  const menuScope = useMenuScope(__scopeDropdownMenu);
60182
- return /* @__PURE__ */ jsx32(Portal3, { ...menuScope, ...portalProps });
60275
+ return /* @__PURE__ */ jsx32(MenuPortal, { ...menuScope, ...portalProps });
60183
60276
  }, "DropdownMenuPortal");
60184
60277
  var CONTENT_NAME3 = "DropdownMenuContent";
60185
60278
  var DropdownMenuContent = /* @__PURE__ */ React42.forwardRef(
@@ -60190,7 +60283,7 @@ var DropdownMenuContent = /* @__PURE__ */ React42.forwardRef(
60190
60283
  const menuScope = useMenuScope(__scopeDropdownMenu);
60191
60284
  const hasInteractedOutsideRef = React42.useRef(false);
60192
60285
  return /* @__PURE__ */ jsx32(
60193
- Content2,
60286
+ MenuContent,
60194
60287
  {
60195
60288
  id: context.contentId,
60196
60289
  "aria-labelledby": context.triggerId,
@@ -60228,18 +60321,18 @@ var DropdownMenuItem = /* @__PURE__ */ React42.forwardRef(
60228
60321
  /* @__PURE__ */ __name22(function DropdownMenuItem2(props, forwardedRef) {
60229
60322
  const { __scopeDropdownMenu, ...itemProps } = props;
60230
60323
  const menuScope = useMenuScope(__scopeDropdownMenu);
60231
- return /* @__PURE__ */ jsx32(Item2, { ...menuScope, ...itemProps, ref: forwardedRef });
60324
+ return /* @__PURE__ */ jsx32(MenuItem, { ...menuScope, ...itemProps, ref: forwardedRef });
60232
60325
  }, "DropdownMenuItem")
60233
60326
  );
60234
60327
  var DropdownMenuCheckboxItem = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuCheckboxItem2(props, forwardedRef) {
60235
60328
  const { __scopeDropdownMenu, ...checkboxItemProps } = props;
60236
60329
  const menuScope = useMenuScope(__scopeDropdownMenu);
60237
- return /* @__PURE__ */ jsx32(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
60330
+ return /* @__PURE__ */ jsx32(MenuCheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
60238
60331
  }, "DropdownMenuCheckboxItem"));
60239
60332
  var DropdownMenuSeparator = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSeparator2(props, forwardedRef) {
60240
60333
  const { __scopeDropdownMenu, ...separatorProps } = props;
60241
60334
  const menuScope = useMenuScope(__scopeDropdownMenu);
60242
- return /* @__PURE__ */ jsx32(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
60335
+ return /* @__PURE__ */ jsx32(MenuSeparator, { ...menuScope, ...separatorProps, ref: forwardedRef });
60243
60336
  }, "DropdownMenuSeparator"));
60244
60337
  var DropdownMenuSub = /* @__PURE__ */ __name22((props) => {
60245
60338
  const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
@@ -60250,18 +60343,18 @@ var DropdownMenuSub = /* @__PURE__ */ __name22((props) => {
60250
60343
  onChange: onOpenChange,
60251
60344
  caller: "DropdownMenuSub"
60252
60345
  });
60253
- return /* @__PURE__ */ jsx32(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
60346
+ return /* @__PURE__ */ jsx32(MenuSub, { ...menuScope, open, onOpenChange: setOpen, children });
60254
60347
  }, "DropdownMenuSub");
60255
60348
  var DropdownMenuSubTrigger = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSubTrigger2(props, forwardedRef) {
60256
60349
  const { __scopeDropdownMenu, ...subTriggerProps } = props;
60257
60350
  const menuScope = useMenuScope(__scopeDropdownMenu);
60258
- return /* @__PURE__ */ jsx32(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
60351
+ return /* @__PURE__ */ jsx32(MenuSubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
60259
60352
  }, "DropdownMenuSubTrigger"));
60260
60353
  var DropdownMenuSubContent = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSubContent2(props, forwardedRef) {
60261
60354
  const { __scopeDropdownMenu, ...subContentProps } = props;
60262
60355
  const menuScope = useMenuScope(__scopeDropdownMenu);
60263
60356
  return /* @__PURE__ */ jsx32(
60264
- SubContent,
60357
+ MenuSubContent,
60265
60358
  {
60266
60359
  ...menuScope,
60267
60360
  ...subContentProps,
@@ -60280,16 +60373,6 @@ var DropdownMenuSubContent = /* @__PURE__ */ React42.forwardRef(/* @__PURE__ */
60280
60373
  }
60281
60374
  );
60282
60375
  }, "DropdownMenuSubContent"));
60283
- var Root22 = DropdownMenu;
60284
- var Trigger = DropdownMenuTrigger;
60285
- var Portal22 = DropdownMenuPortal;
60286
- var Content22 = DropdownMenuContent;
60287
- var Item22 = DropdownMenuItem;
60288
- var CheckboxItem2 = DropdownMenuCheckboxItem;
60289
- var Separator2 = DropdownMenuSeparator;
60290
- var Sub2 = DropdownMenuSub;
60291
- var SubTrigger2 = DropdownMenuSubTrigger;
60292
- var SubContent2 = DropdownMenuSubContent;
60293
60376
 
60294
60377
  // src/components/ViewportSubContent.tsx
60295
60378
  import { useLayoutEffect as useLayoutEffect5, useState as useState36 } from "react";
@@ -60325,7 +60408,7 @@ var ViewportSubContent = (props) => {
60325
60408
  };
60326
60409
  }, [content]);
60327
60410
  return /* @__PURE__ */ jsx33(
60328
- SubContent2,
60411
+ DropdownMenuSubContent,
60329
60412
  {
60330
60413
  ...props,
60331
60414
  ref: setContent,
@@ -60484,10 +60567,10 @@ var AppearanceMenu = () => {
60484
60567
  const [appearanceSubOpen, setAppearanceSubOpen] = useState37(false);
60485
60568
  const [hoveredItem, setHoveredItem] = useState37(null);
60486
60569
  return /* @__PURE__ */ jsxs7(Fragment10, { children: [
60487
- /* @__PURE__ */ jsx35(Separator2, { style: separatorStyles }),
60488
- /* @__PURE__ */ jsxs7(Sub2, { onOpenChange: setAppearanceSubOpen, children: [
60570
+ /* @__PURE__ */ jsx35(DropdownMenuSeparator, { style: separatorStyles }),
60571
+ /* @__PURE__ */ jsxs7(DropdownMenuSub, { onOpenChange: setAppearanceSubOpen, children: [
60489
60572
  /* @__PURE__ */ jsxs7(
60490
- SubTrigger2,
60573
+ DropdownMenuSubTrigger,
60491
60574
  {
60492
60575
  style: {
60493
60576
  ...itemStyles,
@@ -60514,7 +60597,7 @@ var AppearanceMenu = () => {
60514
60597
  ]
60515
60598
  }
60516
60599
  ),
60517
- /* @__PURE__ */ jsx35(Portal22, { children: /* @__PURE__ */ jsxs7(
60600
+ /* @__PURE__ */ jsx35(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs7(
60518
60601
  ViewportSubContent,
60519
60602
  {
60520
60603
  style: { ...contentStyles, marginLeft: -2 },
@@ -60522,7 +60605,7 @@ var AppearanceMenu = () => {
60522
60605
  avoidCollisions: true,
60523
60606
  children: [
60524
60607
  /* @__PURE__ */ jsxs7(
60525
- Item22,
60608
+ DropdownMenuItem,
60526
60609
  {
60527
60610
  style: {
60528
60611
  ...itemStyles,
@@ -60543,7 +60626,7 @@ var AppearanceMenu = () => {
60543
60626
  }
60544
60627
  ),
60545
60628
  /* @__PURE__ */ jsxs7(
60546
- Item22,
60629
+ DropdownMenuItem,
60547
60630
  {
60548
60631
  style: {
60549
60632
  ...itemStyles,
@@ -60563,9 +60646,9 @@ var AppearanceMenu = () => {
60563
60646
  ]
60564
60647
  }
60565
60648
  ),
60566
- /* @__PURE__ */ jsx35(Separator2, { style: separatorStyles }),
60649
+ /* @__PURE__ */ jsx35(DropdownMenuSeparator, { style: separatorStyles }),
60567
60650
  /* @__PURE__ */ jsxs7(
60568
- Item22,
60651
+ DropdownMenuItem,
60569
60652
  {
60570
60653
  style: {
60571
60654
  ...itemStyles,
@@ -60586,7 +60669,7 @@ var AppearanceMenu = () => {
60586
60669
  }
60587
60670
  ),
60588
60671
  /* @__PURE__ */ jsxs7(
60589
- Item22,
60672
+ DropdownMenuItem,
60590
60673
  {
60591
60674
  style: {
60592
60675
  ...itemStyles,
@@ -60607,7 +60690,7 @@ var AppearanceMenu = () => {
60607
60690
  }
60608
60691
  ),
60609
60692
  /* @__PURE__ */ jsxs7(
60610
- Item22,
60693
+ DropdownMenuItem,
60611
60694
  {
60612
60695
  style: {
60613
60696
  ...itemStyles,
@@ -60628,7 +60711,7 @@ var AppearanceMenu = () => {
60628
60711
  }
60629
60712
  ),
60630
60713
  /* @__PURE__ */ jsxs7(
60631
- Item22,
60714
+ DropdownMenuItem,
60632
60715
  {
60633
60716
  style: {
60634
60717
  ...itemStyles,
@@ -60649,7 +60732,7 @@ var AppearanceMenu = () => {
60649
60732
  }
60650
60733
  ),
60651
60734
  /* @__PURE__ */ jsxs7(
60652
- Item22,
60735
+ DropdownMenuItem,
60653
60736
  {
60654
60737
  style: {
60655
60738
  ...itemStyles,
@@ -60670,7 +60753,7 @@ var AppearanceMenu = () => {
60670
60753
  }
60671
60754
  ),
60672
60755
  /* @__PURE__ */ jsxs7(
60673
- Item22,
60756
+ DropdownMenuItem,
60674
60757
  {
60675
60758
  style: {
60676
60759
  ...itemStyles,
@@ -60694,7 +60777,7 @@ var AppearanceMenu = () => {
60694
60777
  }
60695
60778
  ),
60696
60779
  /* @__PURE__ */ jsxs7(
60697
- Item22,
60780
+ DropdownMenuItem,
60698
60781
  {
60699
60782
  style: {
60700
60783
  ...itemStyles,
@@ -60715,7 +60798,7 @@ var AppearanceMenu = () => {
60715
60798
  }
60716
60799
  ),
60717
60800
  /* @__PURE__ */ jsxs7(
60718
- Item22,
60801
+ DropdownMenuItem,
60719
60802
  {
60720
60803
  style: {
60721
60804
  ...itemStyles,
@@ -60736,7 +60819,7 @@ var AppearanceMenu = () => {
60736
60819
  }
60737
60820
  ),
60738
60821
  /* @__PURE__ */ jsxs7(
60739
- Item22,
60822
+ DropdownMenuItem,
60740
60823
  {
60741
60824
  style: {
60742
60825
  ...itemStyles,
@@ -60757,7 +60840,7 @@ var AppearanceMenu = () => {
60757
60840
  }
60758
60841
  ),
60759
60842
  /* @__PURE__ */ jsxs7(
60760
- Item22,
60843
+ DropdownMenuItem,
60761
60844
  {
60762
60845
  style: {
60763
60846
  ...itemStyles,
@@ -60778,7 +60861,7 @@ var AppearanceMenu = () => {
60778
60861
  }
60779
60862
  ),
60780
60863
  /* @__PURE__ */ jsxs7(
60781
- Item22,
60864
+ DropdownMenuItem,
60782
60865
  {
60783
60866
  style: {
60784
60867
  ...itemStyles,
@@ -60801,9 +60884,9 @@ var AppearanceMenu = () => {
60801
60884
  ]
60802
60885
  }
60803
60886
  ),
60804
- /* @__PURE__ */ jsx35(Separator2, { style: separatorStyles }),
60887
+ /* @__PURE__ */ jsx35(DropdownMenuSeparator, { style: separatorStyles }),
60805
60888
  /* @__PURE__ */ jsxs7(
60806
- Item22,
60889
+ DropdownMenuItem,
60807
60890
  {
60808
60891
  style: {
60809
60892
  ...itemStyles,
@@ -60945,10 +61028,10 @@ var ContextMenu = ({
60945
61028
  width: 0,
60946
61029
  height: 0
60947
61030
  },
60948
- children: /* @__PURE__ */ jsxs8(Root22, { open: true, modal: false, children: [
60949
- /* @__PURE__ */ jsx36(Trigger, { asChild: true, children: /* @__PURE__ */ jsx36("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
60950
- /* @__PURE__ */ jsx36(Portal22, { children: /* @__PURE__ */ jsxs8(
60951
- Content22,
61031
+ children: /* @__PURE__ */ jsxs8(DropdownMenu, { open: true, modal: false, children: [
61032
+ /* @__PURE__ */ jsx36(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx36("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
61033
+ /* @__PURE__ */ jsx36(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs8(
61034
+ DropdownMenuContent,
60952
61035
  {
60953
61036
  style: contentStyles2,
60954
61037
  collisionPadding: 10,
@@ -60956,36 +61039,36 @@ var ContextMenu = ({
60956
61039
  sideOffset: 0,
60957
61040
  align: "start",
60958
61041
  children: [
60959
- onViewSchematicComponent && /* @__PURE__ */ jsx36(Fragment11, { children: /* @__PURE__ */ jsx36(
60960
- Item22,
61042
+ onHideComponent && /* @__PURE__ */ jsx36(
61043
+ DropdownMenuItem,
60961
61044
  {
60962
61045
  style: {
60963
61046
  ...itemStyles2,
60964
61047
  ...itemPaddingStyles2,
60965
- backgroundColor: hoveredItem === "schematic" ? "#404040" : "transparent"
61048
+ backgroundColor: hoveredItem === "hide" ? "#404040" : "transparent"
60966
61049
  },
60967
- onSelect: onViewSchematicComponent,
60968
- onMouseEnter: () => setHoveredItem("schematic"),
61050
+ onSelect: onHideComponent,
61051
+ onMouseEnter: () => setHoveredItem("hide"),
60969
61052
  onMouseLeave: () => setHoveredItem(null),
60970
- children: "Show on schematic"
61053
+ children: `Hide "${componentName}"`
60971
61054
  }
60972
- ) }),
60973
- onHideComponent && /* @__PURE__ */ jsx36(
60974
- Item22,
61055
+ ),
61056
+ onViewSchematicComponent && /* @__PURE__ */ jsx36(Fragment11, { children: /* @__PURE__ */ jsx36(
61057
+ DropdownMenuItem,
60975
61058
  {
60976
61059
  style: {
60977
61060
  ...itemStyles2,
60978
61061
  ...itemPaddingStyles2,
60979
- backgroundColor: hoveredItem === "hide" ? "#404040" : "transparent"
61062
+ backgroundColor: hoveredItem === "schematic" ? "#404040" : "transparent"
60980
61063
  },
60981
- onSelect: onHideComponent,
60982
- onMouseEnter: () => setHoveredItem("hide"),
61064
+ onSelect: onViewSchematicComponent,
61065
+ onMouseEnter: () => setHoveredItem("schematic"),
60983
61066
  onMouseLeave: () => setHoveredItem(null),
60984
- children: `Hide "${componentName}"`
61067
+ children: "Show on schematic"
60985
61068
  }
60986
- ),
61069
+ ) }),
60987
61070
  onUnhideAllComponents && /* @__PURE__ */ jsx36(
60988
- Item22,
61071
+ DropdownMenuItem,
60989
61072
  {
60990
61073
  style: {
60991
61074
  ...itemStyles2,
@@ -60998,10 +61081,10 @@ var ContextMenu = ({
60998
61081
  children: "Unhide All Components"
60999
61082
  }
61000
61083
  ),
61001
- (onViewSchematicComponent || onHideComponent || onUnhideAllComponents) && /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
61002
- /* @__PURE__ */ jsxs8(Sub2, { onOpenChange: setCameraSubOpen, children: [
61084
+ (onViewSchematicComponent || onHideComponent || onUnhideAllComponents) && /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
61085
+ /* @__PURE__ */ jsxs8(DropdownMenuSub, { onOpenChange: setCameraSubOpen, children: [
61003
61086
  /* @__PURE__ */ jsxs8(
61004
- SubTrigger2,
61087
+ DropdownMenuSubTrigger,
61005
61088
  {
61006
61089
  style: {
61007
61090
  ...itemStyles2,
@@ -61037,7 +61120,7 @@ var ContextMenu = ({
61037
61120
  ]
61038
61121
  }
61039
61122
  ),
61040
- /* @__PURE__ */ jsx36(Portal22, { children: /* @__PURE__ */ jsxs8(
61123
+ /* @__PURE__ */ jsx36(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs8(
61041
61124
  ViewportSubContent,
61042
61125
  {
61043
61126
  style: { ...contentStyles2, marginLeft: -2 },
@@ -61045,7 +61128,7 @@ var ContextMenu = ({
61045
61128
  avoidCollisions: true,
61046
61129
  children: [
61047
61130
  cameraOptions.map((option) => /* @__PURE__ */ jsxs8(
61048
- Item22,
61131
+ DropdownMenuItem,
61049
61132
  {
61050
61133
  style: {
61051
61134
  ...itemStyles2,
@@ -61062,9 +61145,9 @@ var ContextMenu = ({
61062
61145
  },
61063
61146
  option
61064
61147
  )),
61065
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
61148
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
61066
61149
  /* @__PURE__ */ jsxs8(
61067
- Item22,
61150
+ DropdownMenuItem,
61068
61151
  {
61069
61152
  style: {
61070
61153
  ...itemStyles2,
@@ -61081,7 +61164,7 @@ var ContextMenu = ({
61081
61164
  }
61082
61165
  ),
61083
61166
  /* @__PURE__ */ jsxs8(
61084
- Item22,
61167
+ DropdownMenuItem,
61085
61168
  {
61086
61169
  style: {
61087
61170
  ...itemStyles2,
@@ -61106,9 +61189,9 @@ var ContextMenu = ({
61106
61189
  }
61107
61190
  ) })
61108
61191
  ] }),
61109
- /* @__PURE__ */ jsxs8(Sub2, { onOpenChange: setReferenceObjectSubOpen, children: [
61192
+ /* @__PURE__ */ jsxs8(DropdownMenuSub, { onOpenChange: setReferenceObjectSubOpen, children: [
61110
61193
  /* @__PURE__ */ jsxs8(
61111
- SubTrigger2,
61194
+ DropdownMenuSubTrigger,
61112
61195
  {
61113
61196
  style: {
61114
61197
  ...itemStyles2,
@@ -61141,7 +61224,7 @@ var ContextMenu = ({
61141
61224
  ]
61142
61225
  }
61143
61226
  ),
61144
- /* @__PURE__ */ jsx36(Portal22, { children: /* @__PURE__ */ jsx36(
61227
+ /* @__PURE__ */ jsx36(DropdownMenuPortal, { children: /* @__PURE__ */ jsx36(
61145
61228
  ViewportSubContent,
61146
61229
  {
61147
61230
  style: { ...contentStyles2, marginLeft: -2 },
@@ -61150,7 +61233,7 @@ var ContextMenu = ({
61150
61233
  children: REFERENCE_OBJECT_MENU_OPTIONS.map((option) => {
61151
61234
  const optionKey = option.type ?? "none";
61152
61235
  return /* @__PURE__ */ jsxs8(
61153
- Item22,
61236
+ DropdownMenuItem,
61154
61237
  {
61155
61238
  style: {
61156
61239
  ...itemStyles2,
@@ -61176,7 +61259,7 @@ var ContextMenu = ({
61176
61259
  ) })
61177
61260
  ] }),
61178
61261
  onFoldPcbsToggle && /* @__PURE__ */ jsxs8(
61179
- CheckboxItem2,
61262
+ DropdownMenuCheckboxItem,
61180
61263
  {
61181
61264
  checked: foldPcbs,
61182
61265
  onCheckedChange: onFoldPcbsToggle,
@@ -61193,7 +61276,7 @@ var ContextMenu = ({
61193
61276
  }
61194
61277
  ),
61195
61278
  /* @__PURE__ */ jsxs8(
61196
- Item22,
61279
+ DropdownMenuItem,
61197
61280
  {
61198
61281
  style: {
61199
61282
  ...itemStyles2,
@@ -61214,9 +61297,9 @@ var ContextMenu = ({
61214
61297
  }
61215
61298
  ),
61216
61299
  /* @__PURE__ */ jsx36(AppearanceMenu, {}),
61217
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
61300
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
61218
61301
  /* @__PURE__ */ jsx36(
61219
- Item22,
61302
+ DropdownMenuItem,
61220
61303
  {
61221
61304
  style: {
61222
61305
  ...itemStyles2,
@@ -61230,9 +61313,9 @@ var ContextMenu = ({
61230
61313
  children: /* @__PURE__ */ jsx36("span", { style: { display: "flex", alignItems: "center" }, children: "Download GLTF" })
61231
61314
  }
61232
61315
  ),
61233
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
61316
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
61234
61317
  !flexScene && /* @__PURE__ */ jsxs8(
61235
- Item22,
61318
+ DropdownMenuItem,
61236
61319
  {
61237
61320
  style: {
61238
61321
  ...itemStyles2,
@@ -61273,9 +61356,9 @@ var ContextMenu = ({
61273
61356
  ]
61274
61357
  }
61275
61358
  ),
61276
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
61359
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
61277
61360
  /* @__PURE__ */ jsxs8(
61278
- Item22,
61361
+ DropdownMenuItem,
61279
61362
  {
61280
61363
  style: {
61281
61364
  ...itemStyles2,
@@ -61302,7 +61385,7 @@ var ContextMenu = ({
61302
61385
  ]
61303
61386
  }
61304
61387
  ),
61305
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
61388
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
61306
61389
  /* @__PURE__ */ jsx36(
61307
61390
  "div",
61308
61391
  {
@@ -61341,10 +61424,10 @@ var ContextMenu = ({
61341
61424
  };
61342
61425
 
61343
61426
  // src/components/KeyboardShortcutsDialog.tsx
61344
- import { useEffect as useEffect48, useMemo as useMemo33, useRef as useRef27, useState as useState40 } from "react";
61427
+ import { useEffect as useEffect48, useMemo as useMemo35, useRef as useRef27, useState as useState40 } from "react";
61345
61428
 
61346
61429
  // src/hooks/useRegisteredHotkey.ts
61347
- import { useEffect as useEffect47, useMemo as useMemo32, useRef as useRef26, useState as useState39 } from "react";
61430
+ import { useEffect as useEffect47, useMemo as useMemo34, useRef as useRef26, useState as useState39 } from "react";
61348
61431
  var hotkeyRegistry = /* @__PURE__ */ new Map();
61349
61432
  var subscribers = /* @__PURE__ */ new Set();
61350
61433
  var isListenerAttached = false;
@@ -61468,7 +61551,7 @@ var subscribeToRegistry = (subscriber) => {
61468
61551
  var useRegisteredHotkey = (id, handler, metadata) => {
61469
61552
  const handlerRef = useRef26(handler);
61470
61553
  handlerRef.current = handler;
61471
- const normalizedMetadata = useMemo32(
61554
+ const normalizedMetadata = useMemo34(
61472
61555
  () => ({
61473
61556
  shortcut: metadata.shortcut,
61474
61557
  description: metadata.description
@@ -61526,7 +61609,7 @@ var KeyboardShortcutsDialog = ({
61526
61609
  }, 0);
61527
61610
  }
61528
61611
  }, [open]);
61529
- const filteredHotkeys = useMemo33(() => {
61612
+ const filteredHotkeys = useMemo35(() => {
61530
61613
  const normalizedQuery = query.trim().toLowerCase();
61531
61614
  if (!normalizedQuery) {
61532
61615
  return hotkeys;
@@ -61977,7 +62060,7 @@ var CadViewerInner = (props) => {
61977
62060
  const { showToast } = useToast();
61978
62061
  const cameraControllerRef = useRef29(null);
61979
62062
  const externalCameraControllerReady = props.onCameraControllerReady;
61980
- const sceneRef = useContext10(SchematicNavigationContext);
62063
+ const sceneRef = useContext11(SchematicNavigationContext);
61981
62064
  const [selectedComponent, setSelectedComponent] = useState42();
61982
62065
  const [selectedCadComponent, setSelectedCadComponent] = useState42();
61983
62066
  const handleMenuOpen = useCallback24(
@@ -62541,10 +62624,10 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
62541
62624
 
62542
62625
  // src/hooks/exporter/gltf.ts
62543
62626
  import { GLTFExporter as GLTFExporter3 } from "three-stdlib";
62544
- import { useEffect as useEffect51, useState as useState43, useMemo as useMemo34, useCallback as useCallback25 } from "react";
62627
+ import { useEffect as useEffect51, useState as useState43, useMemo as useMemo36, useCallback as useCallback25 } from "react";
62545
62628
  function useSaveGltfAs(options = {}) {
62546
62629
  const parse2 = useParser(options);
62547
- const link = useMemo34(() => document.createElement("a"), []);
62630
+ const link = useMemo36(() => document.createElement("a"), []);
62548
62631
  const saveAs = async (filename) => {
62549
62632
  const name = filename ?? options.filename ?? "";
62550
62633
  if (options.binary == null) options.binary = name.endsWith(".glb");
@@ -62579,7 +62662,7 @@ function useExportGltfUrl(options = {}) {
62579
62662
  return [ref, url, error];
62580
62663
  }
62581
62664
  function useParser(options = {}) {
62582
- const exporter = useMemo34(() => new GLTFExporter3(), []);
62665
+ const exporter = useMemo36(() => new GLTFExporter3(), []);
62583
62666
  return (instance) => {
62584
62667
  const { promise, resolve: resolve2, reject } = Promise.withResolvers();
62585
62668
  exporter.parse(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.615",
3
+ "version": "0.0.616",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/tscircuit/3d-viewer"