|
1 |
| -import icons from './icons'; |
2 |
| -import htmlElementMap from './htmlElementMap'; |
3 |
| -import styleClassmap from './styleClassMap'; |
4 |
| -import * as types from '../../../types'; |
| 1 | +import icons from "./icons"; |
| 2 | +import htmlElementMap from "./htmlElementMap"; |
| 3 | +import styleClassmap from "./styleClassMap"; |
| 4 | +import * as types from "../../../types"; |
5 | 5 |
|
6 |
| -const cloneDeep = require('lodash.clonedeep'); |
| 6 | +const cloneDeep = require("lodash.clonedeep"); |
7 | 7 |
|
8 |
| -const newState :types.State = { |
9 |
| - clicked:false, |
| 8 | +const newState: types.State = { |
| 9 | + clicked: false, |
10 | 10 | icons,
|
11 | 11 | htmlElementMap,
|
12 | 12 | componentMap: {
|
13 | 13 | App: {
|
14 |
| - componentName: 'App', |
15 |
| - children: ['HomeView'], |
16 |
| - htmlList: [] |
| 14 | + componentName: "App", |
| 15 | + children: ["HomeView"], |
| 16 | + htmlList: [], |
17 | 17 | },
|
18 | 18 | HomeView: {
|
19 |
| - componentName: 'HomeView', |
| 19 | + componentName: "HomeView", |
20 | 20 | children: [],
|
21 | 21 | htmlList: [],
|
22 |
| - } |
| 22 | + }, |
23 | 23 | },
|
24 | 24 | routes: {
|
25 |
| - HomeView: [] |
| 25 | + HomeView: [], |
26 | 26 | },
|
27 | 27 | userActions: [],
|
28 | 28 | userProps: [],
|
29 | 29 | userState: [],
|
30 | 30 | imagePath: {
|
31 |
| - HomeView: '' |
| 31 | + HomeView: "", |
32 | 32 | },
|
33 |
| - componentNameInputValue: '', |
34 |
| - projects: [{ filename: 'Untitled-1', lastSavedLocation: '' }], |
| 33 | + componentNameInputValue: "", |
| 34 | + projects: [{ filename: "Untitled-1", lastSavedLocation: "" }], |
35 | 35 |
|
36 |
| - activeRoute: 'HomeView', |
| 36 | + activeRoute: "HomeView", |
37 | 37 | // need to change to activeComponentName
|
38 |
| - activeComponent: '', |
| 38 | + activeComponent: "", |
39 | 39 | activeComponentObj: null,
|
40 |
| - activeHTML: '', |
| 40 | + activeHTML: "", |
41 | 41 | activeLayer: {
|
42 |
| - id: '', |
43 |
| - lineage: [] |
| 42 | + id: "", |
| 43 | + lineage: [], |
44 | 44 | },
|
45 | 45 |
|
46 | 46 | selectedProps: [],
|
47 | 47 | selectedState: [],
|
48 | 48 | selectedActions: [],
|
49 | 49 | selectedElementList: [],
|
50 |
| - selectedIdDrag: '', |
51 |
| - selectedIdDrop: '', |
| 50 | + selectedIdDrag: "", |
| 51 | + selectedIdDrop: "", |
52 | 52 | projectNumber: 2,
|
53 | 53 | activeTab: 0,
|
54 |
| - componentChildrenMultiselectValue: [], |
| 54 | + // componentChildrenMultiselectValue: [], |
55 | 55 | modalOpen: false,
|
56 | 56 | attributeModalOpen: false,
|
57 | 57 | noteModalOpen: false,
|
58 | 58 | //test
|
59 | 59 | noteAttributeOpen: false,
|
60 | 60 | colorModalOpen: false,
|
61 |
| - parentSelected: false, |
| 61 | + parentSelected: "", |
62 | 62 | // for storing copied component
|
63 | 63 | copiedComponent: {},
|
64 | 64 | copyNumber: 0,
|
65 | 65 | pastedComponent: {},
|
66 |
| - exportAsTypescript: 'off', |
67 |
| - exportOauth: 'off', |
68 |
| - exportOauthGithub: 'off', |
| 66 | + exportAsTypescript: "off", |
| 67 | + exportOauth: "off", |
| 68 | + exportOauthGithub: "off", |
69 | 69 | showTutorial: true,
|
70 | 70 | tutorialFirstOpen: true,
|
71 | 71 | pasteTimer: 0,
|
72 | 72 | gridLayout: [15, 15], // [Width Ratio, Height Ratio] this will be used to have containerH / gridLayout[0] and have fr
|
73 | 73 | containerH: 720, // in px
|
74 | 74 | containerW: 1280, // in px
|
75 |
| - importLibraries:[], |
76 |
| - displaylibComponent:false, |
77 |
| - importTest:'off' |
| 75 | + importLibraries: [], |
| 76 | + displaylibComponent: false, |
| 77 | + importTest: "off", |
78 | 78 | //push libraries string to the array
|
79 | 79 | };
|
80 | 80 |
|
81 | 81 | // closured method to ensure we only ever write the default state ONCE
|
82 |
| -const writeTheDefault = ():any => { |
83 |
| - let initial:object = {}; |
84 |
| - let needsToRun:boolean = true; |
85 |
| - function onced(payload:any) { |
| 82 | +const writeTheDefault = (): any => { |
| 83 | + let initial: object = {}; |
| 84 | + let needsToRun: boolean = true; |
| 85 | + function onced(payload: any) { |
86 | 86 | if (needsToRun) {
|
87 | 87 | initial = cloneDeep(payload);
|
88 | 88 | needsToRun = false;
|
89 | 89 | }
|
90 | 90 | return initial;
|
91 | 91 | }
|
92 | 92 | return onced;
|
93 |
| -} |
| 93 | +}; |
94 | 94 |
|
95 | 95 | const defaultState = writeTheDefault();
|
96 | 96 |
|
|
0 commit comments