@tscircuit/pcb-viewer 1.11.275 → 1.11.276

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
@@ -13305,7 +13305,7 @@ import { css as css3 } from "@emotion/css";
13305
13305
  // package.json
13306
13306
  var package_default = {
13307
13307
  name: "@tscircuit/pcb-viewer",
13308
- version: "1.11.274",
13308
+ version: "1.11.275",
13309
13309
  main: "dist/index.js",
13310
13310
  type: "module",
13311
13311
  repository: "tscircuit/pcb-viewer",
@@ -14442,96 +14442,104 @@ var PCBViewer = ({
14442
14442
  }),
14443
14443
  [initialState, disablePcbGroups]
14444
14444
  );
14445
- return /* @__PURE__ */ jsxs14("div", { ref: transformRef, style: { position: "relative" }, children: [
14446
- /* @__PURE__ */ jsx18("div", { ref, children: /* @__PURE__ */ jsxs14(
14447
- ContextProviders,
14448
- {
14449
- initialState: mergedInitialState,
14450
- disablePcbGroups,
14451
- children: [
14452
- /* @__PURE__ */ jsx18(
14453
- CanvasElementsRenderer,
14454
- {
14455
- transform,
14456
- height,
14457
- width: refDimensions.width,
14458
- allowEditing,
14459
- focusOnHover,
14460
- cancelPanDrag,
14461
- onCreateEditEvent,
14462
- onModifyEditEvent,
14463
- grid: {
14464
- spacing: 1,
14465
- view_window: {
14466
- left: 0,
14467
- right: refDimensions.width || 500,
14468
- top: height,
14469
- bottom: 0
14470
- }
14471
- },
14472
- elements,
14473
- debugGraphics
14474
- },
14475
- refDimensions.width
14476
- ),
14477
- /* @__PURE__ */ jsx18(ToastContainer, {})
14478
- ]
14479
- }
14480
- ) }),
14481
- clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx18(
14482
- "div",
14483
- {
14484
- onClick: () => {
14485
- setIsInteractionEnabled(true);
14486
- resetTransform();
14487
- },
14488
- onTouchStart: (e) => {
14489
- const touch = e.touches[0];
14490
- touchStartRef.current = {
14491
- x: touch.clientX,
14492
- y: touch.clientY
14493
- };
14494
- },
14495
- onTouchEnd: (e) => {
14496
- const touch = e.changedTouches[0];
14497
- const start = touchStartRef.current;
14498
- if (!start) return;
14499
- const deltaX = Math.abs(touch.clientX - start.x);
14500
- const deltaY = Math.abs(touch.clientY - start.y);
14501
- if (deltaX < 10 && deltaY < 10) {
14502
- e.preventDefault();
14503
- setIsInteractionEnabled(true);
14504
- resetTransform();
14505
- }
14506
- touchStartRef.current = null;
14507
- },
14508
- style: {
14509
- position: "absolute",
14510
- inset: 0,
14511
- cursor: "pointer",
14512
- zIndex: zIndexMap.clickToInteractOverlay,
14513
- display: "flex",
14514
- alignItems: "center",
14515
- justifyContent: "center",
14516
- touchAction: "pan-x pan-y pinch-zoom"
14517
- },
14518
- children: /* @__PURE__ */ jsx18(
14445
+ return /* @__PURE__ */ jsxs14(
14446
+ "div",
14447
+ {
14448
+ ref: transformRef,
14449
+ style: { position: "relative" },
14450
+ onContextMenu: (event) => event.preventDefault(),
14451
+ children: [
14452
+ /* @__PURE__ */ jsx18("div", { ref, children: /* @__PURE__ */ jsxs14(
14453
+ ContextProviders,
14454
+ {
14455
+ initialState: mergedInitialState,
14456
+ disablePcbGroups,
14457
+ children: [
14458
+ /* @__PURE__ */ jsx18(
14459
+ CanvasElementsRenderer,
14460
+ {
14461
+ transform,
14462
+ height,
14463
+ width: refDimensions.width,
14464
+ allowEditing,
14465
+ focusOnHover,
14466
+ cancelPanDrag,
14467
+ onCreateEditEvent,
14468
+ onModifyEditEvent,
14469
+ grid: {
14470
+ spacing: 1,
14471
+ view_window: {
14472
+ left: 0,
14473
+ right: refDimensions.width || 500,
14474
+ top: height,
14475
+ bottom: 0
14476
+ }
14477
+ },
14478
+ elements,
14479
+ debugGraphics
14480
+ },
14481
+ refDimensions.width
14482
+ ),
14483
+ /* @__PURE__ */ jsx18(ToastContainer, {})
14484
+ ]
14485
+ }
14486
+ ) }),
14487
+ clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx18(
14519
14488
  "div",
14520
14489
  {
14490
+ onClick: () => {
14491
+ setIsInteractionEnabled(true);
14492
+ resetTransform();
14493
+ },
14494
+ onTouchStart: (e) => {
14495
+ const touch = e.touches[0];
14496
+ touchStartRef.current = {
14497
+ x: touch.clientX,
14498
+ y: touch.clientY
14499
+ };
14500
+ },
14501
+ onTouchEnd: (e) => {
14502
+ const touch = e.changedTouches[0];
14503
+ const start = touchStartRef.current;
14504
+ if (!start) return;
14505
+ const deltaX = Math.abs(touch.clientX - start.x);
14506
+ const deltaY = Math.abs(touch.clientY - start.y);
14507
+ if (deltaX < 10 && deltaY < 10) {
14508
+ e.preventDefault();
14509
+ setIsInteractionEnabled(true);
14510
+ resetTransform();
14511
+ }
14512
+ touchStartRef.current = null;
14513
+ },
14521
14514
  style: {
14522
- backgroundColor: "rgba(0, 0, 0, 0.8)",
14523
- color: "white",
14524
- padding: "12px 24px",
14525
- borderRadius: "8px",
14526
- fontSize: "16px",
14527
- pointerEvents: "none"
14515
+ position: "absolute",
14516
+ inset: 0,
14517
+ cursor: "pointer",
14518
+ zIndex: zIndexMap.clickToInteractOverlay,
14519
+ display: "flex",
14520
+ alignItems: "center",
14521
+ justifyContent: "center",
14522
+ touchAction: "pan-x pan-y pinch-zoom"
14528
14523
  },
14529
- children: typeof window !== "undefined" && ("ontouchstart" in window || navigator.maxTouchPoints > 0) ? "Touch to Interact" : "Click to Interact"
14524
+ children: /* @__PURE__ */ jsx18(
14525
+ "div",
14526
+ {
14527
+ style: {
14528
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
14529
+ color: "white",
14530
+ padding: "12px 24px",
14531
+ borderRadius: "8px",
14532
+ fontSize: "16px",
14533
+ pointerEvents: "none"
14534
+ },
14535
+ children: typeof window !== "undefined" && ("ontouchstart" in window || navigator.maxTouchPoints > 0) ? "Touch to Interact" : "Click to Interact"
14536
+ }
14537
+ )
14530
14538
  }
14531
14539
  )
14532
- }
14533
- )
14534
- ] });
14540
+ ]
14541
+ }
14542
+ );
14535
14543
  };
14536
14544
  export {
14537
14545
  CanvasElementsRenderer,