@@ -8,25 +8,20 @@ import {
8
8
CHANGE_FOCUS_COMPONENT ,
9
9
CHANGE_FOCUS_CHILD ,
10
10
CHANGE_COMPONENT_FOCUS_CHILD ,
11
- UPDATE_CHILDREN ,
12
- REASSIGN_PARENT ,
13
- SET_SELECTABLE_PARENTS ,
14
11
EXPORT_FILES ,
15
12
CREATE_APPLICATION ,
16
13
EXPORT_FILES_SUCCESS ,
17
14
EXPORT_FILES_ERROR ,
18
15
CREATE_APPLICATION_ERROR ,
19
16
HANDLE_CLOSE ,
20
17
HANDLE_TRANSFORM ,
21
- MOVE_TO_BOTTOM ,
22
- MOVE_TO_TOP ,
23
18
OPEN_EXPANSION_PANEL ,
24
19
DELETE_ALL_DATA ,
25
20
CHANGE_IMAGE_PATH ,
26
21
ADD_PROP ,
27
22
DELETE_PROP ,
28
- UPDATE_HTML_ATTR
29
- } from " ../actionTypes" ;
23
+ UPDATE_HTML_ATTR ,
24
+ } from ' ../actionTypes' ;
30
25
31
26
import {
32
27
addComponent ,
@@ -37,45 +32,24 @@ import {
37
32
changeFocusComponent ,
38
33
changeComponentFocusChild ,
39
34
changeFocusChild ,
40
- updateChildren ,
41
- reassignParent ,
42
- setSelectableP ,
43
35
exportFilesSuccess ,
44
36
exportFilesError ,
45
37
handleClose ,
46
38
handleTransform ,
47
- moveToBottom ,
48
- moveToTop ,
49
39
openExpansionPanel ,
50
40
changeImagePath ,
51
41
addProp ,
52
42
deleteProp ,
53
- updateHtmlAttr
54
- } from "../utils/componentReducer.util.ts" ;
55
- import cloneDeep from "../utils/cloneDeep.ts" ;
56
-
57
- // import { updateHtmlAttr } from "../actions/components";
58
-
59
- interface Child {
60
- childId : number ;
61
- componentRef : number ; // references the component this child instance belongs to
62
- position : object ;
63
- }
64
-
65
- interface Component {
66
- componentId : number ;
67
- title : string ;
68
- childrenArray : Child [ ] ;
69
- nextChildId : number ;
70
- focusChild : Component ;
71
- }
43
+ updateHtmlAttr ,
44
+ } from '../utils/componentReducer.util.ts' ;
45
+ import cloneDeep from '../utils/cloneDeep.ts' ;
72
46
73
47
const appComponent = {
74
48
id : 1 ,
75
49
stateful : false ,
76
- title : " App" ,
50
+ title : ' App' ,
77
51
parentIds : [ ] ,
78
- color : " #FF6D00" ,
52
+ color : ' #FF6D00' ,
79
53
draggable : true ,
80
54
childrenIds : [ ] ,
81
55
selectableParents : [ ] ,
@@ -85,12 +59,12 @@ const appComponent = {
85
59
x : 25 ,
86
60
y : 25 ,
87
61
width : 600 ,
88
- height : 400
62
+ height : 400 ,
89
63
} ,
90
64
91
65
childrenArray : [ ] ,
92
66
nextChildId : 1 ,
93
- focusChildId : 0
67
+ focusChildId : 0 ,
94
68
} ;
95
69
96
70
const initialApplicationFocusChild = {
@@ -100,10 +74,10 @@ const initialApplicationFocusChild = {
100
74
x : 25 ,
101
75
y : 25 ,
102
76
width : 600 ,
103
- height : 400
77
+ height : 400 ,
104
78
} ,
105
79
draggable : true ,
106
- childType : null
80
+ childType : null ,
107
81
} ;
108
82
109
83
const initialApplicationState = {
@@ -117,9 +91,9 @@ const initialApplicationState = {
117
91
initialApplicationFocusChild,
118
92
focusChild : cloneDeep ( initialApplicationFocusChild ) ,
119
93
components : [ appComponent ] ,
120
- appDir : "" ,
94
+ appDir : '' ,
121
95
loading : false ,
122
- componentTree : { name : " App" , attributes : { } , children : { } }
96
+ componentTree : { name : ' App' , attributes : { } , children : { } } ,
123
97
} ;
124
98
125
99
const componentReducer = ( state = initialApplicationState , action ) => {
@@ -129,9 +103,9 @@ const componentReducer = (state = initialApplicationState, action) => {
129
103
...state ,
130
104
...action . payload . data ,
131
105
loading : false ,
132
- appDir : "" ,
106
+ appDir : '' ,
133
107
successOpen : false ,
134
- errorOpen : false
108
+ errorOpen : false ,
135
109
} ;
136
110
case ADD_COMPONENT :
137
111
return addComponent ( state , action . payload ) ;
@@ -149,12 +123,6 @@ const componentReducer = (state = initialApplicationState, action) => {
149
123
return changeFocusChild ( state , action . payload ) ;
150
124
case CHANGE_COMPONENT_FOCUS_CHILD :
151
125
return changeComponentFocusChild ( state , action . payload ) ;
152
- // case UPDATE_CHILDREN:
153
- // return updateChildren(state, action.payload);
154
- // case REASSIGN_PARENT:
155
- // return reassignParent(state, action.payload);
156
- // case SET_SELECTABLE_PARENTS:
157
- // return setSelectableP(state);
158
126
case CREATE_APPLICATION :
159
127
case EXPORT_FILES :
160
128
return { ...state , loading : true } ;
@@ -167,11 +135,6 @@ const componentReducer = (state = initialApplicationState, action) => {
167
135
return handleClose ( state , action . payload ) ;
168
136
case HANDLE_TRANSFORM :
169
137
return handleTransform ( state , action . payload ) ;
170
-
171
- // case MOVE_TO_BOTTOM:
172
- // return moveToBottom(state, action.payload);
173
- // case MOVE_TO_TOP:
174
- // return moveToTop(state, action.payload);
175
138
case OPEN_EXPANSION_PANEL :
176
139
return openExpansionPanel ( state , action . payload ) ;
177
140
case DELETE_ALL_DATA :
0 commit comments