@tscircuit/pcb-viewer 1.11.63 → 1.11.64
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 -30
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { LayerRef, AnyCircuitElement } from 'circuit-json';
|
|
3
|
+
import { EditPcbComponentLocationEvent, EditTraceHintEvent } from '@tscircuit/props';
|
|
3
4
|
import { GraphicsObject } from 'graphics-debug';
|
|
4
5
|
import { Matrix } from 'transformation-matrix';
|
|
5
6
|
|
|
@@ -28,36 +29,7 @@ type StateProps = {
|
|
|
28
29
|
[key in keyof State]: State[key] extends boolean ? boolean : never;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
type
|
|
32
|
-
edit_event_id: string;
|
|
33
|
-
pcb_edit_event_type: "edit_component_location";
|
|
34
|
-
pcb_component_id: string;
|
|
35
|
-
original_center: {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
};
|
|
39
|
-
new_center: {
|
|
40
|
-
x: number;
|
|
41
|
-
y: number;
|
|
42
|
-
};
|
|
43
|
-
in_progress?: boolean;
|
|
44
|
-
created_at: number;
|
|
45
|
-
};
|
|
46
|
-
type EditTraceHintEvent = {
|
|
47
|
-
edit_event_id: string;
|
|
48
|
-
pcb_edit_event_type: "edit_trace_hint";
|
|
49
|
-
pcb_port_id: string;
|
|
50
|
-
pcb_trace_hint_id?: string;
|
|
51
|
-
route: Array<{
|
|
52
|
-
x: number;
|
|
53
|
-
y: number;
|
|
54
|
-
via?: boolean;
|
|
55
|
-
to_layer?: LayerRef;
|
|
56
|
-
}>;
|
|
57
|
-
in_progress?: boolean;
|
|
58
|
-
created_at: number;
|
|
59
|
-
};
|
|
60
|
-
type EditEvent = EditComponentLocationEvent | EditTraceHintEvent;
|
|
32
|
+
type EditEvent = EditPcbComponentLocationEvent | EditTraceHintEvent;
|
|
61
33
|
|
|
62
34
|
type Props = {
|
|
63
35
|
children?: any;
|
package/dist/index.js
CHANGED
|
@@ -5888,7 +5888,7 @@ var applyTraceHintEditEvent = (soup, edit_event) => {
|
|
|
5888
5888
|
var applyEditEvents = (soup, edit_events) => {
|
|
5889
5889
|
soup = JSON.parse(JSON.stringify(soup));
|
|
5890
5890
|
for (const edit_event of edit_events) {
|
|
5891
|
-
if (edit_event.
|
|
5891
|
+
if (edit_event.edit_event_type === "edit_pcb_component_location") {
|
|
5892
5892
|
const mat = translate(
|
|
5893
5893
|
edit_event.new_center.x - edit_event.original_center.x,
|
|
5894
5894
|
edit_event.new_center.y - edit_event.original_center.y
|
|
@@ -5896,7 +5896,7 @@ var applyEditEvents = (soup, edit_events) => {
|
|
|
5896
5896
|
soup = soup.map(
|
|
5897
5897
|
(e) => e.pcb_component_id !== edit_event.pcb_component_id ? e : transformPCBElement(e, mat)
|
|
5898
5898
|
);
|
|
5899
|
-
} else if (edit_event.
|
|
5899
|
+
} else if (edit_event.edit_event_type === "edit_pcb_trace_hint") {
|
|
5900
5900
|
soup = applyTraceHintEditEvent(soup, edit_event);
|
|
5901
5901
|
}
|
|
5902
5902
|
}
|
|
@@ -8304,7 +8304,7 @@ import { css } from "@emotion/css";
|
|
|
8304
8304
|
// package.json
|
|
8305
8305
|
var package_default = {
|
|
8306
8306
|
name: "@tscircuit/pcb-viewer",
|
|
8307
|
-
version: "1.11.
|
|
8307
|
+
version: "1.11.63",
|
|
8308
8308
|
main: "dist/index.js",
|
|
8309
8309
|
type: "module",
|
|
8310
8310
|
repository: "tscircuit/pcb-viewer",
|
|
@@ -8968,6 +8968,7 @@ var EditPlacementOverlay = ({
|
|
|
8968
8968
|
});
|
|
8969
8969
|
onCreateEditEvent({
|
|
8970
8970
|
edit_event_id,
|
|
8971
|
+
edit_event_type: "edit_pcb_component_location",
|
|
8971
8972
|
pcb_edit_event_type: "edit_component_location",
|
|
8972
8973
|
pcb_component_id: e2.pcb_component_id,
|
|
8973
8974
|
original_center: e2.center,
|