@inkindcards/semantic-layer 2.1.0 → 2.2.1

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.
@@ -61,8 +61,9 @@ interface InspectableProps {
61
61
  }
62
62
  /**
63
63
  * Wraps a data-bound component and registers it with the DataInspector overlay.
64
- * When no DataInspector/InspectableRegistry ancestor exists, renders as a plain div
65
- * with no overhead.
64
+ * When inspect mode is off or no DataInspector ancestor exists, renders children
65
+ * with zero layout impact (no wrapper div). Only adds a positioned wrapper
66
+ * with a click-capture overlay when inspect mode is active.
66
67
  */
67
68
  declare function Inspectable({ label, currentSource, data, columns, children, }: InspectableProps): react_jsx_runtime.JSX.Element;
68
69
 
@@ -61,8 +61,9 @@ interface InspectableProps {
61
61
  }
62
62
  /**
63
63
  * Wraps a data-bound component and registers it with the DataInspector overlay.
64
- * When no DataInspector/InspectableRegistry ancestor exists, renders as a plain div
65
- * with no overhead.
64
+ * When inspect mode is off or no DataInspector ancestor exists, renders children
65
+ * with zero layout impact (no wrapper div). Only adds a positioned wrapper
66
+ * with a click-capture overlay when inspect mode is active.
66
67
  */
67
68
  declare function Inspectable({ label, currentSource, data, columns, children, }: InspectableProps): react_jsx_runtime.JSX.Element;
68
69
 
@@ -862,48 +862,59 @@ function Inspectable({
862
862
  return /* @__PURE__ */ jsx(Fragment, { children });
863
863
  }
864
864
  const isSelected = registry.selectedId === id;
865
- const showOutline = registry.inspectActive;
865
+ const inspecting = registry.inspectActive;
866
866
  const handleClick = (e) => {
867
- if (!registry.inspectActive) return;
868
867
  e.stopPropagation();
868
+ e.preventDefault();
869
869
  registry.setSelectedId(isSelected ? null : id);
870
870
  };
871
+ if (!inspecting) {
872
+ return /* @__PURE__ */ jsx("div", { ref, children });
873
+ }
871
874
  return /* @__PURE__ */ jsxs(
872
875
  "div",
873
876
  {
874
877
  ref,
875
- onClick: handleClick,
876
- style: {
877
- position: "relative",
878
- outline: showOutline ? isSelected ? "2px solid #3b82f6" : "2px dashed #93c5fd" : "none",
879
- outlineOffset: 2,
880
- borderRadius: 4,
881
- cursor: showOutline ? "pointer" : "inherit",
882
- transition: "outline 0.15s ease"
883
- },
878
+ style: { position: "relative" },
884
879
  children: [
885
- showOutline && /* @__PURE__ */ jsx(
880
+ children,
881
+ /* @__PURE__ */ jsx(
886
882
  "div",
887
883
  {
884
+ onClick: handleClick,
888
885
  style: {
889
886
  position: "absolute",
890
- top: -10,
891
- left: 4,
892
- fontSize: 10,
893
- fontWeight: 600,
894
- fontFamily: "system-ui, -apple-system, sans-serif",
895
- color: "#fff",
896
- backgroundColor: isSelected ? "#3b82f6" : "#93c5fd",
897
- padding: "1px 6px",
898
- borderRadius: 3,
899
- zIndex: 1e4,
900
- pointerEvents: "none",
901
- whiteSpace: "nowrap"
887
+ inset: 0,
888
+ zIndex: 9999,
889
+ cursor: "pointer",
890
+ outline: isSelected ? "2px solid #3b82f6" : "2px dashed #93c5fd",
891
+ outlineOffset: 2,
892
+ borderRadius: 4,
893
+ transition: "outline 0.15s ease",
894
+ background: isSelected ? "rgba(59,130,246,0.05)" : "transparent"
902
895
  },
903
- children: label
896
+ children: /* @__PURE__ */ jsx(
897
+ "div",
898
+ {
899
+ style: {
900
+ position: "absolute",
901
+ top: -10,
902
+ left: 4,
903
+ fontSize: 10,
904
+ fontWeight: 600,
905
+ fontFamily: "system-ui, -apple-system, sans-serif",
906
+ color: "#fff",
907
+ backgroundColor: isSelected ? "#3b82f6" : "#93c5fd",
908
+ padding: "1px 6px",
909
+ borderRadius: 3,
910
+ pointerEvents: "none",
911
+ whiteSpace: "nowrap"
912
+ },
913
+ children: label
914
+ }
915
+ )
904
916
  }
905
- ),
906
- children
917
+ )
907
918
  ]
908
919
  }
909
920
  );