@tscircuit/pcb-viewer 1.11.242 → 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 +28 -4
- 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);
|
|
@@ -12318,7 +12320,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
12318
12320
|
// package.json
|
|
12319
12321
|
var package_default = {
|
|
12320
12322
|
name: "@tscircuit/pcb-viewer",
|
|
12321
|
-
version: "1.11.
|
|
12323
|
+
version: "1.11.242",
|
|
12322
12324
|
main: "dist/index.js",
|
|
12323
12325
|
type: "module",
|
|
12324
12326
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -12582,6 +12584,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12582
12584
|
setIsShowingMultipleTracesLength,
|
|
12583
12585
|
setIsShowingAutorouting,
|
|
12584
12586
|
setIsShowingDrcErrors,
|
|
12587
|
+
setIsShowingCopperPours,
|
|
12585
12588
|
setIsShowingPcbGroups,
|
|
12586
12589
|
setPcbGroupViewMode,
|
|
12587
12590
|
setHoveredErrorId
|
|
@@ -12599,6 +12602,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12599
12602
|
is_showing_multiple_traces_length: s.is_showing_multiple_traces_length,
|
|
12600
12603
|
is_showing_autorouting: s.is_showing_autorouting,
|
|
12601
12604
|
is_showing_drc_errors: s.is_showing_drc_errors,
|
|
12605
|
+
is_showing_copper_pours: s.is_showing_copper_pours,
|
|
12602
12606
|
is_showing_pcb_groups: s.is_showing_pcb_groups,
|
|
12603
12607
|
pcb_group_view_mode: s.pcb_group_view_mode
|
|
12604
12608
|
},
|
|
@@ -12607,6 +12611,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12607
12611
|
setIsShowingMultipleTracesLength: s.setIsShowingMultipleTracesLength,
|
|
12608
12612
|
setIsShowingAutorouting: s.setIsShowingAutorouting,
|
|
12609
12613
|
setIsShowingDrcErrors: s.setIsShowingDrcErrors,
|
|
12614
|
+
setIsShowingCopperPours: s.setIsShowingCopperPours,
|
|
12610
12615
|
setIsShowingPcbGroups: s.setIsShowingPcbGroups,
|
|
12611
12616
|
setPcbGroupViewMode: s.setPcbGroupViewMode,
|
|
12612
12617
|
setHoveredErrorId: s.setHoveredErrorId
|
|
@@ -13085,6 +13090,18 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
13085
13090
|
}
|
|
13086
13091
|
}
|
|
13087
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
|
+
),
|
|
13088
13105
|
/* @__PURE__ */ jsx15(
|
|
13089
13106
|
CheckboxMenuItem,
|
|
13090
13107
|
{
|
|
@@ -13134,15 +13151,22 @@ import { jsx as jsx16 } from "react/jsx-runtime";
|
|
|
13134
13151
|
var CanvasElementsRenderer = (props) => {
|
|
13135
13152
|
const { transform, elements } = props;
|
|
13136
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
|
+
);
|
|
13137
13161
|
const [primitivesWithoutInteractionMetadata, connectivityMap] = useMemo6(() => {
|
|
13138
|
-
const primitivesWithoutInteractionMetadata2 =
|
|
13162
|
+
const primitivesWithoutInteractionMetadata2 = elementsToRender.flatMap(
|
|
13139
13163
|
(elm) => convertElementToPrimitives(elm, props.elements)
|
|
13140
13164
|
);
|
|
13141
13165
|
const connectivityMap2 = getFullConnectivityMapFromCircuitJson(
|
|
13142
13166
|
props.elements
|
|
13143
13167
|
);
|
|
13144
13168
|
return [primitivesWithoutInteractionMetadata2, connectivityMap2];
|
|
13145
|
-
}, [props.elements]);
|
|
13169
|
+
}, [elementsToRender, props.elements]);
|
|
13146
13170
|
const [hoverState, setHoverState] = useState10({
|
|
13147
13171
|
drawingObjectIdsWithMouseOver: /* @__PURE__ */ new Set(),
|
|
13148
13172
|
primitiveIdsInMousedOverNet: []
|
|
@@ -13203,7 +13227,7 @@ var CanvasElementsRenderer = (props) => {
|
|
|
13203
13227
|
return /* @__PURE__ */ jsx16(
|
|
13204
13228
|
MouseElementTracker,
|
|
13205
13229
|
{
|
|
13206
|
-
elements,
|
|
13230
|
+
elements: elementsToRender,
|
|
13207
13231
|
transform,
|
|
13208
13232
|
primitives: primitivesWithoutInteractionMetadata,
|
|
13209
13233
|
onMouseHoverOverPrimitives: onMouseOverPrimitives,
|