8
8
NodeEvents ,
9
9
NodeTree ,
10
10
SerializedNodes ,
11
- } from " ../interfaces" ;
11
+ } from ' ../interfaces' ;
12
12
import {
13
13
deprecationWarning ,
14
14
ERROR_INVALID_NODEID ,
@@ -17,12 +17,12 @@ import {
17
17
QueryCallbacksFor ,
18
18
ERROR_NOPARENT ,
19
19
ERROR_DELETE_TOP_LEVEL_NODE ,
20
- } from " @craftjs/utils" ;
21
- import { QueryMethods } from " ./query" ;
22
- import { fromEntries } from " ../utils/fromEntries" ;
23
- import { updateEventsNode } from " ../utils/updateEventsNode" ;
24
- import invariant from " tiny-invariant" ;
25
- import { editorInitialState } from " ./store" ;
20
+ } from ' @craftjs/utils' ;
21
+ import { QueryMethods } from ' ./query' ;
22
+ import { fromEntries } from ' ../utils/fromEntries' ;
23
+ import { updateEventsNode } from ' ../utils/updateEventsNode' ;
24
+ import invariant from ' tiny-invariant' ;
25
+ import { editorInitialState } from ' ./store' ;
26
26
27
27
export const Actions = (
28
28
state : EditorState ,
@@ -41,7 +41,7 @@ export const Actions = (
41
41
}
42
42
43
43
if ( parent . data . props . children ) {
44
- delete parent . data . props [ " children" ] ;
44
+ delete parent . data . props [ ' children' ] ;
45
45
}
46
46
47
47
if ( index != null ) {
@@ -122,8 +122,8 @@ export const Actions = (
122
122
// TODO: Deprecate adding array of Nodes to keep implementation simpler
123
123
let nodes = [ nodeToAdd ] ;
124
124
if ( Array . isArray ( nodeToAdd ) ) {
125
- deprecationWarning ( " actions.add(node: Node[])" , {
126
- suggest : " actions.add(node: Node)" ,
125
+ deprecationWarning ( ' actions.add(node: Node[])' , {
126
+ suggest : ' actions.add(node: Node)' ,
127
127
} ) ;
128
128
nodes = nodeToAdd ;
129
129
}
@@ -145,7 +145,7 @@ export const Actions = (
145
145
if ( ! parentId ) {
146
146
invariant (
147
147
tree . rootNodeId === ROOT_NODE ,
148
- " Cannot add non-root Node without a parent"
148
+ ' Cannot add non-root Node without a parent'
149
149
) ;
150
150
state . nodes [ tree . rootNodeId ] = node ;
151
151
}
@@ -176,7 +176,7 @@ export const Actions = (
176
176
177
177
deserialize ( input : SerializedNodes | string ) {
178
178
const dehydratedNodes =
179
- typeof input == " string" ? JSON . parse ( input ) : input ;
179
+ typeof input == ' string' ? JSON . parse ( input ) : input ;
180
180
181
181
const nodePairs = Object . keys ( dehydratedNodes ) . map ( ( id ) => {
182
182
let nodeId = id ;
@@ -212,7 +212,7 @@ export const Actions = (
212
212
const currentParent = state . nodes [ currentParentId ] ,
213
213
currentParentNodes = currentParent . data . nodes ! ;
214
214
215
- currentParentNodes [ currentParentNodes . indexOf ( targetId ) ] = " marked" ;
215
+ currentParentNodes [ currentParentNodes . indexOf ( targetId ) ] = ' marked' ;
216
216
217
217
if ( newParentNodes ) {
218
218
newParentNodes . splice ( index , 0 , targetId ) ;
@@ -222,7 +222,7 @@ export const Actions = (
222
222
223
223
state . nodes [ targetId ] . data . parent = newParentId ;
224
224
state . nodes [ targetId ] . data . index = index ;
225
- currentParentNodes . splice ( currentParentNodes . indexOf ( " marked" ) , 1 ) ;
225
+ currentParentNodes . splice ( currentParentNodes . indexOf ( ' marked' ) , 1 ) ;
226
226
} ,
227
227
228
228
replaceNodes ( nodes : Nodes ) {
@@ -272,7 +272,7 @@ export const Actions = (
272
272
*/
273
273
setCustom < T extends NodeId > (
274
274
id : T ,
275
- cb : ( data : EditorState [ " nodes" ] [ T ] [ " data" ] [ " custom" ] ) => void
275
+ cb : ( data : EditorState [ ' nodes' ] [ T ] [ ' data' ] [ ' custom' ] ) => void
276
276
) {
277
277
cb ( state . nodes [ id ] . data . custom ) ;
278
278
} ,
0 commit comments