@tscircuit/pcb-viewer 1.11.241 → 1.11.243
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.d.ts +2 -0
- package/dist/index.js +35 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ interface State {
|
|
|
17
17
|
is_showing_drc_errors: boolean;
|
|
18
18
|
is_showing_multiple_traces_length: boolean;
|
|
19
19
|
is_showing_rats_nest: boolean;
|
|
20
|
+
is_showing_copper_pours: boolean;
|
|
20
21
|
is_showing_pcb_groups: boolean;
|
|
21
22
|
pcb_group_view_mode: "all" | "named_only";
|
|
22
23
|
hovered_error_id: string | null;
|
|
@@ -29,6 +30,7 @@ interface State {
|
|
|
29
30
|
setIsShowingAutorouting: (is_showing: boolean) => void;
|
|
30
31
|
setIsShowingMultipleTracesLength: (is_showing: boolean) => void;
|
|
31
32
|
setIsShowingDrcErrors: (is_showing: boolean) => void;
|
|
33
|
+
setIsShowingCopperPours: (is_showing: boolean) => void;
|
|
32
34
|
setIsShowingPcbGroups: (is_showing: boolean) => void;
|
|
33
35
|
setPcbGroupViewMode: (mode: "all" | "named_only") => void;
|
|
34
36
|
setHoveredErrorId: (errorId: string | null) => void;
|
package/dist/index.js
CHANGED
|
@@ -6327,6 +6327,7 @@ var createStore = (initialState = {}, disablePcbGroups = false) => createZustand
|
|
|
6327
6327
|
is_showing_rats_nest: false,
|
|
6328
6328
|
is_showing_autorouting: true,
|
|
6329
6329
|
is_showing_drc_errors: true,
|
|
6330
|
+
is_showing_copper_pours: true,
|
|
6330
6331
|
is_showing_pcb_groups: disablePcbGroups ? false : getStoredBoolean(STORAGE_KEYS.IS_SHOWING_PCB_GROUPS, true),
|
|
6331
6332
|
pcb_group_view_mode: disablePcbGroups ? "all" : getStoredString(
|
|
6332
6333
|
STORAGE_KEYS.PCB_GROUP_VIEW_MODE,
|
|
@@ -6349,6 +6350,7 @@ var createStore = (initialState = {}, disablePcbGroups = false) => createZustand
|
|
|
6349
6350
|
setIsShowingMultipleTracesLength: (is_showing) => set({ is_showing_multiple_traces_length: is_showing }),
|
|
6350
6351
|
setIsShowingAutorouting: (is_showing) => set({ is_showing_autorouting: is_showing }),
|
|
6351
6352
|
setIsShowingDrcErrors: (is_showing) => set({ is_showing_drc_errors: is_showing }),
|
|
6353
|
+
setIsShowingCopperPours: (is_showing) => set({ is_showing_copper_pours: is_showing }),
|
|
6352
6354
|
setIsShowingPcbGroups: (is_showing) => {
|
|
6353
6355
|
if (disablePcbGroups) return;
|
|
6354
6356
|
setStoredBoolean(STORAGE_KEYS.IS_SHOWING_PCB_GROUPS, is_showing);
|
|
@@ -9012,11 +9014,15 @@ var convertTextToLines = (text) => {
|
|
|
9012
9014
|
import color from "color";
|
|
9013
9015
|
function getColor(primitive) {
|
|
9014
9016
|
const explicitColor = primitive.color;
|
|
9015
|
-
const
|
|
9017
|
+
const baseColorString = explicitColor ?? LAYER_NAME_TO_COLOR[primitive.layer];
|
|
9018
|
+
let c = color(baseColorString);
|
|
9019
|
+
if (primitive._element?.type === "pcb_copper_pour") {
|
|
9020
|
+
c = c.alpha(0.7);
|
|
9021
|
+
}
|
|
9016
9022
|
if (primitive.is_mouse_over || primitive.is_in_highlighted_net) {
|
|
9017
|
-
return
|
|
9023
|
+
return c.lighten(0.5).rgb().toString();
|
|
9018
9024
|
}
|
|
9019
|
-
return
|
|
9025
|
+
return c.rgb().toString();
|
|
9020
9026
|
}
|
|
9021
9027
|
var drawLine = (drawer, line) => {
|
|
9022
9028
|
drawer.equip({
|
|
@@ -12314,7 +12320,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
12314
12320
|
// package.json
|
|
12315
12321
|
var package_default = {
|
|
12316
12322
|
name: "@tscircuit/pcb-viewer",
|
|
12317
|
-
version: "1.11.
|
|
12323
|
+
version: "1.11.242",
|
|
12318
12324
|
main: "dist/index.js",
|
|
12319
12325
|
type: "module",
|
|
12320
12326
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -12578,6 +12584,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12578
12584
|
setIsShowingMultipleTracesLength,
|
|
12579
12585
|
setIsShowingAutorouting,
|
|
12580
12586
|
setIsShowingDrcErrors,
|
|
12587
|
+
setIsShowingCopperPours,
|
|
12581
12588
|
setIsShowingPcbGroups,
|
|
12582
12589
|
setPcbGroupViewMode,
|
|
12583
12590
|
setHoveredErrorId
|
|
@@ -12595,6 +12602,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12595
12602
|
is_showing_multiple_traces_length: s.is_showing_multiple_traces_length,
|
|
12596
12603
|
is_showing_autorouting: s.is_showing_autorouting,
|
|
12597
12604
|
is_showing_drc_errors: s.is_showing_drc_errors,
|
|
12605
|
+
is_showing_copper_pours: s.is_showing_copper_pours,
|
|
12598
12606
|
is_showing_pcb_groups: s.is_showing_pcb_groups,
|
|
12599
12607
|
pcb_group_view_mode: s.pcb_group_view_mode
|
|
12600
12608
|
},
|
|
@@ -12603,6 +12611,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12603
12611
|
setIsShowingMultipleTracesLength: s.setIsShowingMultipleTracesLength,
|
|
12604
12612
|
setIsShowingAutorouting: s.setIsShowingAutorouting,
|
|
12605
12613
|
setIsShowingDrcErrors: s.setIsShowingDrcErrors,
|
|
12614
|
+
setIsShowingCopperPours: s.setIsShowingCopperPours,
|
|
12606
12615
|
setIsShowingPcbGroups: s.setIsShowingPcbGroups,
|
|
12607
12616
|
setPcbGroupViewMode: s.setPcbGroupViewMode,
|
|
12608
12617
|
setHoveredErrorId: s.setHoveredErrorId
|
|
@@ -13081,6 +13090,18 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
13081
13090
|
}
|
|
13082
13091
|
}
|
|
13083
13092
|
),
|
|
13093
|
+
/* @__PURE__ */ jsx15(
|
|
13094
|
+
CheckboxMenuItem,
|
|
13095
|
+
{
|
|
13096
|
+
label: "Show Copper Pours",
|
|
13097
|
+
checked: viewSettings.is_showing_copper_pours,
|
|
13098
|
+
onClick: () => {
|
|
13099
|
+
setIsShowingCopperPours(
|
|
13100
|
+
!viewSettings.is_showing_copper_pours
|
|
13101
|
+
);
|
|
13102
|
+
}
|
|
13103
|
+
}
|
|
13104
|
+
),
|
|
13084
13105
|
/* @__PURE__ */ jsx15(
|
|
13085
13106
|
CheckboxMenuItem,
|
|
13086
13107
|
{
|
|
@@ -13130,15 +13151,22 @@ import { jsx as jsx16 } from "react/jsx-runtime";
|
|
|
13130
13151
|
var CanvasElementsRenderer = (props) => {
|
|
13131
13152
|
const { transform, elements } = props;
|
|
13132
13153
|
const hoveredErrorId = useGlobalStore((state) => state.hovered_error_id);
|
|
13154
|
+
const isShowingCopperPours = useGlobalStore(
|
|
13155
|
+
(state) => state.is_showing_copper_pours
|
|
13156
|
+
);
|
|
13157
|
+
const elementsToRender = useMemo6(
|
|
13158
|
+
() => isShowingCopperPours ? elements : elements.filter((elm) => elm.type !== "pcb_copper_pour"),
|
|
13159
|
+
[elements, isShowingCopperPours]
|
|
13160
|
+
);
|
|
13133
13161
|
const [primitivesWithoutInteractionMetadata, connectivityMap] = useMemo6(() => {
|
|
13134
|
-
const primitivesWithoutInteractionMetadata2 =
|
|
13162
|
+
const primitivesWithoutInteractionMetadata2 = elementsToRender.flatMap(
|
|
13135
13163
|
(elm) => convertElementToPrimitives(elm, props.elements)
|
|
13136
13164
|
);
|
|
13137
13165
|
const connectivityMap2 = getFullConnectivityMapFromCircuitJson(
|
|
13138
13166
|
props.elements
|
|
13139
13167
|
);
|
|
13140
13168
|
return [primitivesWithoutInteractionMetadata2, connectivityMap2];
|
|
13141
|
-
}, [props.elements]);
|
|
13169
|
+
}, [elementsToRender, props.elements]);
|
|
13142
13170
|
const [hoverState, setHoverState] = useState10({
|
|
13143
13171
|
drawingObjectIdsWithMouseOver: /* @__PURE__ */ new Set(),
|
|
13144
13172
|
primitiveIdsInMousedOverNet: []
|
|
@@ -13199,7 +13227,7 @@ var CanvasElementsRenderer = (props) => {
|
|
|
13199
13227
|
return /* @__PURE__ */ jsx16(
|
|
13200
13228
|
MouseElementTracker,
|
|
13201
13229
|
{
|
|
13202
|
-
elements,
|
|
13230
|
+
elements: elementsToRender,
|
|
13203
13231
|
transform,
|
|
13204
13232
|
primitives: primitivesWithoutInteractionMetadata,
|
|
13205
13233
|
onMouseHoverOverPrimitives: onMouseOverPrimitives,
|