@tscircuit/pcb-viewer 1.11.283 → 1.11.284

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
@@ -12959,14 +12959,26 @@ var GroupAnchorOffsetOverlay = ({
12959
12959
  }
12960
12960
  return null;
12961
12961
  }).filter((id) => Boolean(id));
12962
+ const collectParentGroups = (groupId, collected) => {
12963
+ if (collected.has(groupId)) return;
12964
+ collected.add(groupId);
12965
+ const group = groups.find((g) => g.pcb_group_id === groupId);
12966
+ if (group?.position_mode === "relative_to_group_anchor" && group.positioned_relative_to_pcb_group_id) {
12967
+ collectParentGroups(group.positioned_relative_to_pcb_group_id, collected);
12968
+ }
12969
+ };
12962
12970
  const hoveredGroupIds = /* @__PURE__ */ new Set();
12963
12971
  hoveredComponentIds.forEach((componentId) => {
12964
12972
  const component = components.find((c) => c.pcb_component_id === componentId);
12965
- if (component?.pcb_group_id) {
12966
- hoveredGroupIds.add(component.pcb_group_id);
12973
+ if (!component) return;
12974
+ if (component.position_mode === "relative_to_group_anchor" && component.positioned_relative_to_pcb_group_id) {
12975
+ collectParentGroups(
12976
+ component.positioned_relative_to_pcb_group_id,
12977
+ hoveredGroupIds
12978
+ );
12967
12979
  }
12968
- if (component?.position_mode === "relative_to_group_anchor" && component.positioned_relative_to_pcb_group_id) {
12969
- hoveredGroupIds.add(component.positioned_relative_to_pcb_group_id);
12980
+ if (component.pcb_group_id) {
12981
+ collectParentGroups(component.pcb_group_id, hoveredGroupIds);
12970
12982
  }
12971
12983
  });
12972
12984
  const isShowingAnchorOffsets = useGlobalStore(
@@ -13815,7 +13827,7 @@ import { css as css3 } from "@emotion/css";
13815
13827
  // package.json
13816
13828
  var package_default = {
13817
13829
  name: "@tscircuit/pcb-viewer",
13818
- version: "1.11.282",
13830
+ version: "1.11.283",
13819
13831
  main: "dist/index.js",
13820
13832
  type: "module",
13821
13833
  repository: "tscircuit/pcb-viewer",