@tscircuit/pcb-viewer 1.11.383 → 1.11.385

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
@@ -14018,22 +14018,17 @@ function getTraceOverlayInfo({
14018
14018
  primitiveElement,
14019
14019
  elements
14020
14020
  }) {
14021
- let text = primitiveElement.trace_length ? `${primitiveElement.trace_length.toFixed(3)}` : "";
14022
14021
  const trace = su(elements).source_trace.get(
14023
14022
  primitiveElement?.source_trace_id
14024
14023
  );
14025
- const name = getAssociatedTraceName({ primitiveElement, elements });
14026
- if (trace?.display_name) {
14027
- if (trace?.max_length) {
14028
- text += ` / ${trace.max_length}mm `;
14029
- } else {
14030
- text += " mm ";
14031
- }
14032
- text += `(${trace.display_name})`;
14033
- }
14024
+ const traceLength = primitiveElement.trace_length;
14025
+ const hasTraceLength = typeof traceLength === "number";
14026
+ const maxLength = trace?.max_length;
14027
+ const text = hasTraceLength ? `${traceLength.toFixed(3)}${typeof maxLength === "number" ? ` / ${maxLength}` : ""} mm` : "";
14028
+ const name = getAssociatedTraceName({ primitiveElement, elements }) ?? getNonEmptyName(trace?.display_name);
14034
14029
  if (!text && !name) return null;
14035
14030
  const isOverLength = Boolean(
14036
- primitiveElement.trace_length && trace?.max_length && primitiveElement.trace_length > trace.max_length
14031
+ hasTraceLength && typeof maxLength === "number" && traceLength > maxLength
14037
14032
  );
14038
14033
  return {
14039
14034
  text,
@@ -14166,18 +14161,16 @@ var HighlightedPrimitiveBoxWithText = ({
14166
14161
  const traceTextContext = { primitiveElement, elements };
14167
14162
  const overlayInfo = getTraceOverlayInfo(traceTextContext);
14168
14163
  if (!overlayInfo) return null;
14169
- const yOffset = mousePos.y - 35;
14170
14164
  return /* @__PURE__ */ jsx16(
14171
14165
  "div",
14172
14166
  {
14173
14167
  style: {
14174
14168
  zIndex: zIndexMap.elementOverlay,
14175
14169
  position: "absolute",
14176
- left: mousePos.x,
14177
- top: yOffset,
14170
+ left: mousePos.x + 12,
14171
+ top: mousePos.y + 12,
14178
14172
  color: color7,
14179
- pointerEvents: "none",
14180
- transform: "translateX(-50%)"
14173
+ pointerEvents: "none"
14181
14174
  },
14182
14175
  children: /* @__PURE__ */ jsxs11(
14183
14176
  "div",
@@ -14188,11 +14181,11 @@ var HighlightedPrimitiveBoxWithText = ({
14188
14181
  textShadow: "none",
14189
14182
  WebkitFontSmoothing: "antialiased",
14190
14183
  MozOsxFontSmoothing: "grayscale",
14191
- padding: "6px 6px",
14192
- borderRadius: "6px",
14193
- fontSize: "14px",
14194
- minWidth: "45px",
14195
- textAlign: "center",
14184
+ padding: "4px 6px",
14185
+ borderRadius: "4px",
14186
+ fontSize: "11px",
14187
+ lineHeight: 1.2,
14188
+ textAlign: "left",
14196
14189
  whiteSpace: "nowrap"
14197
14190
  },
14198
14191
  children: [
@@ -14201,8 +14194,6 @@ var HighlightedPrimitiveBoxWithText = ({
14201
14194
  "div",
14202
14195
  {
14203
14196
  style: {
14204
- fontSize: "11px",
14205
- lineHeight: 1.2,
14206
14197
  marginTop: overlayInfo.text ? "2px" : 0
14207
14198
  },
14208
14199
  children: overlayInfo.name
@@ -14972,7 +14963,7 @@ import { css as css3 } from "@emotion/css";
14972
14963
  // package.json
14973
14964
  var package_default = {
14974
14965
  name: "@tscircuit/pcb-viewer",
14975
- version: "1.11.382",
14966
+ version: "1.11.384",
14976
14967
  main: "dist/index.js",
14977
14968
  type: "module",
14978
14969
  repository: "tscircuit/pcb-viewer",
@@ -15027,7 +15018,7 @@ var package_default = {
15027
15018
  "@tscircuit/math-utils": "^0.0.36",
15028
15019
  "@vitejs/plugin-react": "^5.0.2",
15029
15020
  "circuit-json": "^0.0.450",
15030
- "circuit-to-canvas": "^0.0.118",
15021
+ "circuit-to-canvas": "^0.0.120",
15031
15022
  color: "^4.2.3",
15032
15023
  "react-supergrid": "^1.0.10",
15033
15024
  "react-toastify": "^10.0.5",