@inkindcards/semantic-layer 2.2.2 → 2.2.3

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.
@@ -861,22 +861,27 @@ function Inspectable({
861
861
  const id = useId();
862
862
  const wrapperRef = useRef(null);
863
863
  const [rect, setRect] = useState(null);
864
+ const registryRef = useRef(registry);
865
+ registryRef.current = registry;
864
866
  const inferredColumns = columns ?? (data?.[0] ? Object.keys(data[0]) : []);
865
867
  const sampleValues = data?.slice(0, 3) ?? [];
868
+ const columnsKey = inferredColumns.join(",");
866
869
  useEffect(() => {
867
- if (!registry) return;
868
- registry.register({
870
+ const reg = registryRef.current;
871
+ if (!reg) return;
872
+ reg.register({
869
873
  id,
870
874
  label,
871
875
  currentSource,
872
- columns: inferredColumns,
876
+ columns: columnsKey.split(",").filter(Boolean),
873
877
  sampleValues,
874
878
  element: wrapperRef.current
875
879
  });
876
- return () => registry.unregister(id);
877
- }, [id, label, currentSource, inferredColumns.join(","), registry]);
880
+ return () => reg.unregister(id);
881
+ }, [id, label, currentSource, columnsKey]);
882
+ const inspectActive = registry?.inspectActive ?? false;
878
883
  useEffect(() => {
879
- if (!registry?.inspectActive || !wrapperRef.current) {
884
+ if (!inspectActive || !wrapperRef.current) {
880
885
  setRect(null);
881
886
  return;
882
887
  }
@@ -894,7 +899,7 @@ function Inspectable({
894
899
  window.removeEventListener("resize", measure);
895
900
  clearInterval(interval);
896
901
  };
897
- }, [registry?.inspectActive]);
902
+ }, [inspectActive]);
898
903
  if (!registry) {
899
904
  return /* @__PURE__ */ jsx(Fragment, { children });
900
905
  }