@tscircuit/pcb-viewer 1.11.63 → 1.11.65

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 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 EditComponentLocationEvent = {
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.pcb_edit_event_type === "edit_component_location") {
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.pcb_edit_event_type === "edit_trace_hint") {
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.62",
8307
+ version: "1.11.64",
8308
8308
  main: "dist/index.js",
8309
8309
  type: "module",
8310
8310
  repository: "tscircuit/pcb-viewer",
@@ -8330,7 +8330,7 @@ var package_default = {
8330
8330
  "@storybook/nextjs": "^8.0.6",
8331
8331
  "@storybook/react": "^8.0.6",
8332
8332
  "@swc/core": "^1.4.12",
8333
- "@tscircuit/core": "0.0.345",
8333
+ "@tscircuit/core": "0.0.346",
8334
8334
  "@tscircuit/eagle-xml-converter": "^1.0.0",
8335
8335
  "@tscircuit/props": "^0.0.161",
8336
8336
  "@tscircuit/soup-util": "^0.0.41",
@@ -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,