@tscircuit/pcb-viewer 1.11.242 → 1.11.244
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 +36 -5
- 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
|
@@ -6276,7 +6276,8 @@ import { useContext } from "react";
|
|
|
6276
6276
|
import { useCallback } from "react";
|
|
6277
6277
|
var STORAGE_KEYS = {
|
|
6278
6278
|
IS_SHOWING_PCB_GROUPS: "pcb_viewer_is_showing_pcb_groups",
|
|
6279
|
-
PCB_GROUP_VIEW_MODE: "pcb_viewer_group_view_mode"
|
|
6279
|
+
PCB_GROUP_VIEW_MODE: "pcb_viewer_group_view_mode",
|
|
6280
|
+
IS_SHOWING_COPPER_POURS: "pcb_viewer_is_showing_copper_pours"
|
|
6280
6281
|
};
|
|
6281
6282
|
var getStoredBoolean = (key, defaultValue) => {
|
|
6282
6283
|
if (typeof window === "undefined") return defaultValue;
|
|
@@ -6327,6 +6328,10 @@ var createStore = (initialState = {}, disablePcbGroups = false) => createZustand
|
|
|
6327
6328
|
is_showing_rats_nest: false,
|
|
6328
6329
|
is_showing_autorouting: true,
|
|
6329
6330
|
is_showing_drc_errors: true,
|
|
6331
|
+
is_showing_copper_pours: getStoredBoolean(
|
|
6332
|
+
STORAGE_KEYS.IS_SHOWING_COPPER_POURS,
|
|
6333
|
+
true
|
|
6334
|
+
),
|
|
6330
6335
|
is_showing_pcb_groups: disablePcbGroups ? false : getStoredBoolean(STORAGE_KEYS.IS_SHOWING_PCB_GROUPS, true),
|
|
6331
6336
|
pcb_group_view_mode: disablePcbGroups ? "all" : getStoredString(
|
|
6332
6337
|
STORAGE_KEYS.PCB_GROUP_VIEW_MODE,
|
|
@@ -6349,6 +6354,10 @@ var createStore = (initialState = {}, disablePcbGroups = false) => createZustand
|
|
|
6349
6354
|
setIsShowingMultipleTracesLength: (is_showing) => set({ is_showing_multiple_traces_length: is_showing }),
|
|
6350
6355
|
setIsShowingAutorouting: (is_showing) => set({ is_showing_autorouting: is_showing }),
|
|
6351
6356
|
setIsShowingDrcErrors: (is_showing) => set({ is_showing_drc_errors: is_showing }),
|
|
6357
|
+
setIsShowingCopperPours: (is_showing) => {
|
|
6358
|
+
setStoredBoolean(STORAGE_KEYS.IS_SHOWING_COPPER_POURS, is_showing);
|
|
6359
|
+
set({ is_showing_copper_pours: is_showing });
|
|
6360
|
+
},
|
|
6352
6361
|
setIsShowingPcbGroups: (is_showing) => {
|
|
6353
6362
|
if (disablePcbGroups) return;
|
|
6354
6363
|
setStoredBoolean(STORAGE_KEYS.IS_SHOWING_PCB_GROUPS, is_showing);
|
|
@@ -12318,7 +12327,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
12318
12327
|
// package.json
|
|
12319
12328
|
var package_default = {
|
|
12320
12329
|
name: "@tscircuit/pcb-viewer",
|
|
12321
|
-
version: "1.11.
|
|
12330
|
+
version: "1.11.243",
|
|
12322
12331
|
main: "dist/index.js",
|
|
12323
12332
|
type: "module",
|
|
12324
12333
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -12582,6 +12591,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12582
12591
|
setIsShowingMultipleTracesLength,
|
|
12583
12592
|
setIsShowingAutorouting,
|
|
12584
12593
|
setIsShowingDrcErrors,
|
|
12594
|
+
setIsShowingCopperPours,
|
|
12585
12595
|
setIsShowingPcbGroups,
|
|
12586
12596
|
setPcbGroupViewMode,
|
|
12587
12597
|
setHoveredErrorId
|
|
@@ -12599,6 +12609,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12599
12609
|
is_showing_multiple_traces_length: s.is_showing_multiple_traces_length,
|
|
12600
12610
|
is_showing_autorouting: s.is_showing_autorouting,
|
|
12601
12611
|
is_showing_drc_errors: s.is_showing_drc_errors,
|
|
12612
|
+
is_showing_copper_pours: s.is_showing_copper_pours,
|
|
12602
12613
|
is_showing_pcb_groups: s.is_showing_pcb_groups,
|
|
12603
12614
|
pcb_group_view_mode: s.pcb_group_view_mode
|
|
12604
12615
|
},
|
|
@@ -12607,6 +12618,7 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
12607
12618
|
setIsShowingMultipleTracesLength: s.setIsShowingMultipleTracesLength,
|
|
12608
12619
|
setIsShowingAutorouting: s.setIsShowingAutorouting,
|
|
12609
12620
|
setIsShowingDrcErrors: s.setIsShowingDrcErrors,
|
|
12621
|
+
setIsShowingCopperPours: s.setIsShowingCopperPours,
|
|
12610
12622
|
setIsShowingPcbGroups: s.setIsShowingPcbGroups,
|
|
12611
12623
|
setPcbGroupViewMode: s.setPcbGroupViewMode,
|
|
12612
12624
|
setHoveredErrorId: s.setHoveredErrorId
|
|
@@ -13085,6 +13097,18 @@ var ToolbarOverlay = ({ children, elements }) => {
|
|
|
13085
13097
|
}
|
|
13086
13098
|
}
|
|
13087
13099
|
),
|
|
13100
|
+
/* @__PURE__ */ jsx15(
|
|
13101
|
+
CheckboxMenuItem,
|
|
13102
|
+
{
|
|
13103
|
+
label: "Show Copper Pours",
|
|
13104
|
+
checked: viewSettings.is_showing_copper_pours,
|
|
13105
|
+
onClick: () => {
|
|
13106
|
+
setIsShowingCopperPours(
|
|
13107
|
+
!viewSettings.is_showing_copper_pours
|
|
13108
|
+
);
|
|
13109
|
+
}
|
|
13110
|
+
}
|
|
13111
|
+
),
|
|
13088
13112
|
/* @__PURE__ */ jsx15(
|
|
13089
13113
|
CheckboxMenuItem,
|
|
13090
13114
|
{
|
|
@@ -13134,15 +13158,22 @@ import { jsx as jsx16 } from "react/jsx-runtime";
|
|
|
13134
13158
|
var CanvasElementsRenderer = (props) => {
|
|
13135
13159
|
const { transform, elements } = props;
|
|
13136
13160
|
const hoveredErrorId = useGlobalStore((state) => state.hovered_error_id);
|
|
13161
|
+
const isShowingCopperPours = useGlobalStore(
|
|
13162
|
+
(state) => state.is_showing_copper_pours
|
|
13163
|
+
);
|
|
13164
|
+
const elementsToRender = useMemo6(
|
|
13165
|
+
() => isShowingCopperPours ? elements : elements.filter((elm) => elm.type !== "pcb_copper_pour"),
|
|
13166
|
+
[elements, isShowingCopperPours]
|
|
13167
|
+
);
|
|
13137
13168
|
const [primitivesWithoutInteractionMetadata, connectivityMap] = useMemo6(() => {
|
|
13138
|
-
const primitivesWithoutInteractionMetadata2 =
|
|
13169
|
+
const primitivesWithoutInteractionMetadata2 = elementsToRender.flatMap(
|
|
13139
13170
|
(elm) => convertElementToPrimitives(elm, props.elements)
|
|
13140
13171
|
);
|
|
13141
13172
|
const connectivityMap2 = getFullConnectivityMapFromCircuitJson(
|
|
13142
13173
|
props.elements
|
|
13143
13174
|
);
|
|
13144
13175
|
return [primitivesWithoutInteractionMetadata2, connectivityMap2];
|
|
13145
|
-
}, [props.elements]);
|
|
13176
|
+
}, [elementsToRender, props.elements]);
|
|
13146
13177
|
const [hoverState, setHoverState] = useState10({
|
|
13147
13178
|
drawingObjectIdsWithMouseOver: /* @__PURE__ */ new Set(),
|
|
13148
13179
|
primitiveIdsInMousedOverNet: []
|
|
@@ -13203,7 +13234,7 @@ var CanvasElementsRenderer = (props) => {
|
|
|
13203
13234
|
return /* @__PURE__ */ jsx16(
|
|
13204
13235
|
MouseElementTracker,
|
|
13205
13236
|
{
|
|
13206
|
-
elements,
|
|
13237
|
+
elements: elementsToRender,
|
|
13207
13238
|
transform,
|
|
13208
13239
|
primitives: primitivesWithoutInteractionMetadata,
|
|
13209
13240
|
onMouseHoverOverPrimitives: onMouseOverPrimitives,
|