11import { ElementType } from "@/components/workspace/elements" ;
2- import { dataAttributes , selectors } from "@/constants" ;
2+ import { dataAttributes } from "@/constants" ;
33import { store } from "@/store" ;
44import { ISTKData , ISeat } from "@/types" ;
55import { rgbToHex } from "." ;
66import { default as d3Extended } from "./d3" ;
77
8- export const domSeatsToJSON = ( seats : ISeat [ ] ) => {
8+ const domSeatsToJSON = ( seats : ISeat [ ] ) => {
99 return d3Extended . selectAll ( `[${ dataAttributes . elementType } ="${ ElementType . Seat } "]` ) . map ( ( seat ) => {
1010 const id = seat . attr ( "id" ) ;
1111 const square = ( seat . node ( ) as any ) ?. nodeName === "rect" ;
@@ -23,7 +23,7 @@ export const domSeatsToJSON = (seats: ISeat[]) => {
2323 } ) ;
2424} ;
2525
26- export const domTextToJSON = ( ) => {
26+ const domTextToJSON = ( ) => {
2727 return d3Extended . selectAll ( `[${ dataAttributes . elementType } ="${ ElementType . Text } "]` ) . map ( ( text ) => {
2828 return {
2929 id : text . attr ( "id" ) ,
@@ -40,7 +40,7 @@ export const domTextToJSON = () => {
4040 } ) ;
4141} ;
4242
43- export const domShapesToJSON = ( ) => {
43+ const domShapesToJSON = ( ) => {
4444 return d3Extended . selectAll ( `[${ dataAttributes . elementType } ="${ ElementType . Shape } "]` ) . map ( ( shape ) => {
4545 return {
4646 id : shape . attr ( "id" ) ,
@@ -57,7 +57,7 @@ export const domShapesToJSON = () => {
5757 } ) ;
5858} ;
5959
60- export const domPolylineToJSON = ( ) => {
60+ const domPolylineToJSON = ( ) => {
6161 return d3Extended
6262 . selectAll ( `[${ dataAttributes . elementType } ="${ ElementType . Polyline } "]` )
6363 . map ( ( polyline ) => {
@@ -79,7 +79,7 @@ export const domPolylineToJSON = () => {
7979 . filter ( ( polyline ) => polyline . points . length > 1 ) ;
8080} ;
8181
82- export const domImagesToJSON = ( ) => {
82+ const domImagesToJSON = ( ) => {
8383 return d3Extended . selectAll ( `[${ dataAttributes . elementType } ="${ ElementType . Image } "]` ) . map ( ( image ) => {
8484 return {
8585 id : image . attr ( "id" ) ,
@@ -94,10 +94,6 @@ export const domImagesToJSON = () => {
9494 } ) ;
9595} ;
9696
97- export const domTransform = ( ) => {
98- return d3Extended . zoomTransform ( document . querySelector ( selectors . workspaceGroup ) ) ;
99- } ;
100-
10197export const stateToJSON = ( ) : ISTKData => {
10298 const state = store . getState ( ) . editor ;
10399 return {
0 commit comments