@tscircuit/pcb-viewer 1.11.440 → 1.11.441
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 +79 -60
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17447,21 +17447,33 @@ var FocusedPcbComponentOverlay = ({
|
|
|
17447
17447
|
return /* @__PURE__ */ jsx10(
|
|
17448
17448
|
"div",
|
|
17449
17449
|
{
|
|
17450
|
-
"data-
|
|
17450
|
+
"data-pcb-focus-viewport": true,
|
|
17451
17451
|
style: {
|
|
17452
17452
|
position: "absolute",
|
|
17453
|
-
|
|
17454
|
-
|
|
17455
|
-
width,
|
|
17456
|
-
height,
|
|
17457
|
-
transform: `rotate(${rotation}rad)`,
|
|
17458
|
-
transformOrigin: "center",
|
|
17459
|
-
border: "2px solid #3399ff",
|
|
17460
|
-
borderRadius: 4,
|
|
17461
|
-
boxSizing: "border-box",
|
|
17453
|
+
inset: 0,
|
|
17454
|
+
overflow: "clip",
|
|
17462
17455
|
pointerEvents: "none",
|
|
17463
17456
|
zIndex: zIndexMap.elementOverlay
|
|
17464
|
-
}
|
|
17457
|
+
},
|
|
17458
|
+
children: /* @__PURE__ */ jsx10(
|
|
17459
|
+
"div",
|
|
17460
|
+
{
|
|
17461
|
+
"data-focused-pcb-component-id": componentId,
|
|
17462
|
+
style: {
|
|
17463
|
+
position: "absolute",
|
|
17464
|
+
left: center.x - width / 2,
|
|
17465
|
+
top: center.y - height / 2,
|
|
17466
|
+
width,
|
|
17467
|
+
height,
|
|
17468
|
+
transform: `rotate(${rotation}rad)`,
|
|
17469
|
+
transformOrigin: "center",
|
|
17470
|
+
border: "2px solid #3399ff",
|
|
17471
|
+
borderRadius: 4,
|
|
17472
|
+
boxSizing: "border-box",
|
|
17473
|
+
pointerEvents: "none"
|
|
17474
|
+
}
|
|
17475
|
+
}
|
|
17476
|
+
)
|
|
17465
17477
|
}
|
|
17466
17478
|
);
|
|
17467
17479
|
};
|
|
@@ -19199,7 +19211,7 @@ import {
|
|
|
19199
19211
|
// package.json
|
|
19200
19212
|
var package_default = {
|
|
19201
19213
|
name: "@tscircuit/pcb-viewer",
|
|
19202
|
-
version: "1.11.
|
|
19214
|
+
version: "1.11.440",
|
|
19203
19215
|
main: "dist/index.js",
|
|
19204
19216
|
type: "module",
|
|
19205
19217
|
repository: {
|
|
@@ -19284,7 +19296,48 @@ var package_default = {
|
|
|
19284
19296
|
// src/components/ComponentSearch.tsx
|
|
19285
19297
|
import { css as css2 } from "@emotion/css";
|
|
19286
19298
|
import { useEffect as useEffect15, useId, useMemo as useMemo11, useRef as useRef11, useState as useState9 } from "react";
|
|
19287
|
-
|
|
19299
|
+
|
|
19300
|
+
// src/components/ToolbarButton.tsx
|
|
19301
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
19302
|
+
var getToolbarButtonStyle = (isSmallScreen) => ({
|
|
19303
|
+
backgroundColor: "#1F1F1F",
|
|
19304
|
+
border: "1px solid #666",
|
|
19305
|
+
margin: 0,
|
|
19306
|
+
padding: 4,
|
|
19307
|
+
paddingLeft: isSmallScreen ? 8 : 6,
|
|
19308
|
+
paddingRight: isSmallScreen ? 8 : 6,
|
|
19309
|
+
borderRadius: 2,
|
|
19310
|
+
color: "#eee",
|
|
19311
|
+
cursor: "pointer",
|
|
19312
|
+
fontSize: 12,
|
|
19313
|
+
height: "fit-content",
|
|
19314
|
+
userSelect: "none",
|
|
19315
|
+
whiteSpace: "nowrap"
|
|
19316
|
+
});
|
|
19317
|
+
var ToolbarButton = ({
|
|
19318
|
+
children,
|
|
19319
|
+
isSmallScreen,
|
|
19320
|
+
onClick,
|
|
19321
|
+
...props
|
|
19322
|
+
}) => {
|
|
19323
|
+
const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
|
|
19324
|
+
return /* @__PURE__ */ jsx20(
|
|
19325
|
+
"div",
|
|
19326
|
+
{
|
|
19327
|
+
...props,
|
|
19328
|
+
...touchHandlers,
|
|
19329
|
+
style: {
|
|
19330
|
+
...getToolbarButtonStyle(isSmallScreen),
|
|
19331
|
+
...touchStyle,
|
|
19332
|
+
...props.style
|
|
19333
|
+
},
|
|
19334
|
+
children
|
|
19335
|
+
}
|
|
19336
|
+
);
|
|
19337
|
+
};
|
|
19338
|
+
|
|
19339
|
+
// src/components/ComponentSearch.tsx
|
|
19340
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
19288
19341
|
var buttonClass = css2`
|
|
19289
19342
|
background: #1f1f1f;
|
|
19290
19343
|
border: 1px solid #666;
|
|
@@ -19299,6 +19352,7 @@ var ComponentSearch = ({
|
|
|
19299
19352
|
elements,
|
|
19300
19353
|
onSelect
|
|
19301
19354
|
}) => {
|
|
19355
|
+
const isSmallScreen = useIsSmallScreen();
|
|
19302
19356
|
const [open, setOpen] = useState9(false);
|
|
19303
19357
|
const [query, setQuery] = useState9("");
|
|
19304
19358
|
const [activeComponentId, setActiveComponentId] = useState9(
|
|
@@ -19371,7 +19425,7 @@ var ComponentSearch = ({
|
|
|
19371
19425
|
}
|
|
19372
19426
|
},
|
|
19373
19427
|
children: [
|
|
19374
|
-
/* @__PURE__ */
|
|
19428
|
+
/* @__PURE__ */ jsx21(
|
|
19375
19429
|
"button",
|
|
19376
19430
|
{
|
|
19377
19431
|
ref: toggle,
|
|
@@ -19379,15 +19433,16 @@ var ComponentSearch = ({
|
|
|
19379
19433
|
className: buttonClass,
|
|
19380
19434
|
"aria-label": "Search components",
|
|
19381
19435
|
title: "Search components",
|
|
19382
|
-
style:
|
|
19436
|
+
style: getToolbarButtonStyle(isSmallScreen),
|
|
19383
19437
|
"aria-expanded": open,
|
|
19384
19438
|
"aria-controls": panelId,
|
|
19385
19439
|
onClick: () => setOpen(!open),
|
|
19386
19440
|
children: /* @__PURE__ */ jsxs14(
|
|
19387
19441
|
"svg",
|
|
19388
19442
|
{
|
|
19389
|
-
width: "
|
|
19390
|
-
height: "
|
|
19443
|
+
width: "1em",
|
|
19444
|
+
height: "1em",
|
|
19445
|
+
style: { verticalAlign: "middle" },
|
|
19391
19446
|
viewBox: "0 0 24 24",
|
|
19392
19447
|
fill: "none",
|
|
19393
19448
|
stroke: "currentColor",
|
|
@@ -19395,8 +19450,8 @@ var ComponentSearch = ({
|
|
|
19395
19450
|
strokeLinecap: "round",
|
|
19396
19451
|
"aria-hidden": "true",
|
|
19397
19452
|
children: [
|
|
19398
|
-
/* @__PURE__ */
|
|
19399
|
-
/* @__PURE__ */
|
|
19453
|
+
/* @__PURE__ */ jsx21("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
|
|
19454
|
+
/* @__PURE__ */ jsx21("path", { d: "m16 16 5 5" })
|
|
19400
19455
|
]
|
|
19401
19456
|
}
|
|
19402
19457
|
)
|
|
@@ -19420,7 +19475,7 @@ var ComponentSearch = ({
|
|
|
19420
19475
|
boxSizing: "border-box"
|
|
19421
19476
|
},
|
|
19422
19477
|
children: [
|
|
19423
|
-
/* @__PURE__ */
|
|
19478
|
+
/* @__PURE__ */ jsx21(
|
|
19424
19479
|
"input",
|
|
19425
19480
|
{
|
|
19426
19481
|
ref: input,
|
|
@@ -19453,7 +19508,7 @@ var ComponentSearch = ({
|
|
|
19453
19508
|
}
|
|
19454
19509
|
}
|
|
19455
19510
|
),
|
|
19456
|
-
!normalizedQuery ? /* @__PURE__ */
|
|
19511
|
+
!normalizedQuery ? /* @__PURE__ */ jsx21("output", { style: { display: "block", marginTop: 8 }, children: "Type a component name." }) : matches.length === 0 ? /* @__PURE__ */ jsx21("output", { style: { display: "block", marginTop: 8 }, children: "No matching components." }) : /* @__PURE__ */ jsx21(
|
|
19457
19512
|
"div",
|
|
19458
19513
|
{
|
|
19459
19514
|
id: `${panelId}-results`,
|
|
@@ -19469,7 +19524,7 @@ var ComponentSearch = ({
|
|
|
19469
19524
|
maxHeight: 220,
|
|
19470
19525
|
overflowY: "auto"
|
|
19471
19526
|
},
|
|
19472
|
-
children: matches.map((component, index) => /* @__PURE__ */
|
|
19527
|
+
children: matches.map((component, index) => /* @__PURE__ */ jsx21("div", { role: "presentation", children: /* @__PURE__ */ jsxs14(
|
|
19473
19528
|
"button",
|
|
19474
19529
|
{
|
|
19475
19530
|
type: "button",
|
|
@@ -19491,8 +19546,8 @@ var ComponentSearch = ({
|
|
|
19491
19546
|
},
|
|
19492
19547
|
onClick: () => select(component.id),
|
|
19493
19548
|
children: [
|
|
19494
|
-
/* @__PURE__ */
|
|
19495
|
-
/* @__PURE__ */
|
|
19549
|
+
/* @__PURE__ */ jsx21("span", { children: component.name }),
|
|
19550
|
+
/* @__PURE__ */ jsx21("span", { style: { color: "#aaa" }, children: component.layer })
|
|
19496
19551
|
]
|
|
19497
19552
|
}
|
|
19498
19553
|
) }, component.id))
|
|
@@ -19506,42 +19561,6 @@ var ComponentSearch = ({
|
|
|
19506
19561
|
);
|
|
19507
19562
|
};
|
|
19508
19563
|
|
|
19509
|
-
// src/components/ToolbarButton.tsx
|
|
19510
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
19511
|
-
var ToolbarButton = ({
|
|
19512
|
-
children,
|
|
19513
|
-
isSmallScreen,
|
|
19514
|
-
onClick,
|
|
19515
|
-
...props
|
|
19516
|
-
}) => {
|
|
19517
|
-
const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
|
|
19518
|
-
return /* @__PURE__ */ jsx21(
|
|
19519
|
-
"div",
|
|
19520
|
-
{
|
|
19521
|
-
...props,
|
|
19522
|
-
...touchHandlers,
|
|
19523
|
-
style: {
|
|
19524
|
-
backgroundColor: "#1F1F1F",
|
|
19525
|
-
border: "1px solid #666",
|
|
19526
|
-
margin: 0,
|
|
19527
|
-
padding: 4,
|
|
19528
|
-
paddingLeft: isSmallScreen ? 8 : 6,
|
|
19529
|
-
paddingRight: isSmallScreen ? 8 : 6,
|
|
19530
|
-
borderRadius: 2,
|
|
19531
|
-
color: "#eee",
|
|
19532
|
-
cursor: "pointer",
|
|
19533
|
-
fontSize: 12,
|
|
19534
|
-
height: "fit-content",
|
|
19535
|
-
userSelect: "none",
|
|
19536
|
-
whiteSpace: "nowrap",
|
|
19537
|
-
...touchStyle,
|
|
19538
|
-
...props.style
|
|
19539
|
-
},
|
|
19540
|
-
children
|
|
19541
|
-
}
|
|
19542
|
-
);
|
|
19543
|
-
};
|
|
19544
|
-
|
|
19545
19564
|
// src/components/ToolbarErrorDropdown.tsx
|
|
19546
19565
|
import { useCallback as useCallback9, useMemo as useMemo12, useState as useState10 } from "react";
|
|
19547
19566
|
|