Skip to content

Commit f2ad759

Browse files
committed
Merge branch 'master' into exceptionsHTML
2 parents 270b3a8 + 6559298 commit f2ad759

File tree

9 files changed

+1492
-530
lines changed

9 files changed

+1492
-530
lines changed

package-lock.json

Lines changed: 1472 additions & 360 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"lodash.isequal": "^4.5.0",
2828
"lodash.throttle": "^4.1.1",
2929
"mousetrap": "^1.6.3",
30-
"node": "^14.4.0",
3130
"npm": "^6.14.5",
3231
"prismjs": "^1.16.0",
3332
"quasar": "^1.0.0",
@@ -50,7 +49,7 @@
5049
"babel-eslint": "^10.0.1",
5150
"devtron": "^1.4.0",
5251
"electron": "^5.0.6",
53-
"electron-builder": "^20.44.4",
52+
"electron-builder": "^22.7.0",
5453
"electron-debug": "^3.0.1",
5554
"electron-devtools-installer": "^2.2.4",
5655
"eslint": "^5.10.0",
@@ -60,7 +59,7 @@
6059
"vue-cli-plugin-electron-builder": "^1.3.6"
6160
},
6261
"engines": {
63-
"node": ">= 8.9.0",
62+
"node": ">= 10.0.0",
6463
"npm": ">= 5.6.0",
6564
"yarn": ">= 1.6.0"
6665
},

src/components/ComponentDisplay.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ Description:
2929
<div class="component-title">
3030
<p>{{ componentData.componentName }}</p>
3131
</div>
32-
<ul class="component-children">
33-
</ul>
3432
<q-menu context-menu>
3533
<q-list color='black' class="menu">
3634
<q-item clickable v-ripple v-close-popup @click="handleAddChild">
@@ -152,6 +150,7 @@ export default {
152150
153151
userImage () {
154152
const imgSrc = `file://` + this.imagePath[this.activeRoute]
153+
// console.log('imgSrc is: ', imgSrc)
155154
return imgSrc
156155
},
157156

src/components/HomeQueue.vue

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,6 @@ import { mapState, mapActions } from 'vuex'
3737
import { setSelectedElementList, deleteSelectedElement, deleteFromComponentHtmlList } from '../store/types'
3838
import { breadthFirstSearch } from '../utils/search.util'
3939
40-
// const breadthFirstSearch = (array, id) => {
41-
// let queue = [...array.filter(el => typeof el === 'object')]
42-
// while (queue.length) {
43-
// let evaluated = queue.shift()
44-
// if (evaluated.id === id) {
45-
// return evaluated
46-
// } else {
47-
// if (evaluated.children.length) {
48-
// queue.push(...evaluated.children)
49-
// }
50-
// }
51-
// }
52-
// // console.log("We shouldn't be ever getting here, how did you even search an id that didn't exist?")
53-
// }
54-
5540
export default {
5641
name: 'HomeQueue',
5742
props: {

src/components/Icons.vue

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,7 @@ Description:
2424
<script>
2525
import { mapState } from 'vuex'
2626
import { breadthFirstSearch } from '../utils/search.util'
27-
// const breadthFirstSearch = (array, id) => {
28-
// let queue = [...array.filter(el => typeof el === 'object')]
29-
// while (queue.length) {
30-
// let evaluated = queue.shift()
31-
// if (evaluated.id === id) {
32-
// return evaluated
33-
// } else {
34-
// if (evaluated.children.length) {
35-
// queue.push(...evaluated.children)
36-
// }
37-
// }
38-
// }
39-
// // console.log("We shouldn't be ever getting here, how did you even search an id that didn't exist?")
40-
// }
27+
4128
export default {
4229
data () {
4330
return {

src/components/OpenProjectComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export default {
1818
name: 'OpenProjectComponent',
1919
methods: {
2020
...mapActions(['openProject']),
21+
// opens project
2122
openJSONFile (data) {
2223
const jsonFile = JSON.parse(fs.readFileSync(data[0], 'utf8'))
2324
// console.log('json file', jsonFile)
24-
// opens project
2525
this.openProject(jsonFile)
2626
},
2727
showOpenJSONDialog () {

src/components/RouteDisplay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default {
5151
this.newRoute = ''
5252
})
5353
54-
.catch(err => err)
54+
// .catch(err => console.log(err))
5555
},
5656
resetActiveComponent () {
5757
if (this.activeComponent !== '') {

src/store/mutations.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,9 @@
11
import * as types from './types'
2-
// import icons from './state/icons.js'
3-
// import htmlElementMap from './state/htmlElementMap.js'
42
const cloneDeep = require('lodash.clonedeep')
5-
// import VuexStore from './index'
6-
// import { getDefault, defaultState } from './state/index.js'
73
import { breadthFirstSearch, breadthFirstSearchParent } from '../utils/search.util'
84

95
import localforage from 'localforage'
106

11-
// we have to do a search because undo/redo saves payloads as deep clones so passing a memory ref would be detrimental
12-
// This will find you the actual object by ID
13-
// const breadthFirstSearch = (array, id) => {
14-
// let queue = [...array.filter(el => typeof el === 'object')]
15-
// while (queue.length) {
16-
// let evaluated = queue.shift()
17-
// if (evaluated.id === id) {
18-
// return evaluated
19-
// } else {
20-
// if (evaluated.children.length) {
21-
// queue.push(...evaluated.children)
22-
// }
23-
// }
24-
// }
25-
// // console.log("We shouldn't be ever getting here, how did you even search an id that didn't exist?")
26-
// }
27-
28-
// // this would find you the parent of a given id
29-
// const breadthFirstSearchParent = (array, id) => {
30-
// let queue = [...array.filter(el => typeof el === 'object')]
31-
// while (queue.length) {
32-
// let evaluated = queue.shift()
33-
// for (let i = 0; i < evaluated.children.length; i++) {
34-
// if (evaluated.children[i].id === id) {
35-
// return {
36-
// evaluated: evaluated,
37-
// index: i
38-
// }
39-
// }
40-
// if (evaluated.children.length) {
41-
// queue.push(...evaluated.children)
42-
// }
43-
// }
44-
// // console.log("We shouldn't be ever getting here, how did you even search an id that didn't exist?")
45-
// }
46-
// }
477
const mutations = {
488
// invoked on undo, resetsstate to a cdeep clone of the initial state
499
[types.EMPTY_STATE]: (state, payload) => {

src/store/state/index.js

Lines changed: 14 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,10 @@ import icons from './icons'
22
import htmlElementMap from './htmlElementMap'
33
const cloneDeep = require('lodash.clonedeep')
44

5-
// let hardA = {
6-
// componentName: "a",
7-
// x: 0,
8-
// y: 20,
9-
// z: 0,
10-
// w: 200,
11-
// h: 200,
12-
// htmlList: [{
13-
// children:[{
14-
// children:[{
15-
// text: 'button',
16-
// children:[],
17-
// id:0
18-
// }],
19-
// text:'form',
20-
// id:2
21-
// }],
22-
// text: "div",
23-
// id:1
24-
// }],
25-
// children: [],
26-
// parent: {},
27-
// isActive: false
28-
// }
29-
305
const newState = {
316
icons,
327
htmlElementMap,
33-
// every single time we create a component
34-
// sent to export project component
8+
// state below is what is used when exporting a project
359
componentMap: {
3610
App: {
3711
componentName: 'App',
@@ -40,53 +14,46 @@ const newState = {
4014
},
4115
HomeView: {
4216
componentName: 'HomeView',
43-
// children: ['a'],
4417
children: [],
4518
htmlList: []
4619
}
47-
// NewView: {}
48-
// a: hardA
4920
},
5021
routes: {
51-
// HomeView: [hardA]
5222
HomeView: []
53-
// NewView: []
5423
},
5524
userActions: [],
5625
userState: {},
57-
/**
58-
*
59-
*/
26+
imagePath: {
27+
HomeView: ''
28+
},
29+
// state below is not used when exporting a project
6030
componentNameInputValue: '',
6131
projects: [{ filename: 'Untitled-1', lastSavedLocation: '' }],
6232

6333
activeRoute: 'HomeView',
6434
activeComponent: '',
6535
activeHTML: '',
6636
activeLayer: {
67-
id:'',
68-
lineage:[]
37+
id: '',
38+
lineage: []
6939
},
7040

7141
selectedElementList: [],
7242
projectNumber: 2,
7343
activeTab: 0,
7444
componentChildrenMultiselectValue: [],
7545
modalOpen: false,
76-
parentSelected: false,
77-
imagePath: {
78-
HomeView: ''
79-
}
46+
parentSelected: false
8047
}
8148

82-
//closured method to ensure we only ever write the default state ONCE
49+
// closured method to ensure we only ever write the default state ONCE
8350
const writeTheDefault = () => {
8451
let initial = {}
85-
let needsToRun = true;
86-
function onced(payload){
87-
if(needsToRun){
52+
let needsToRun = true
53+
function onced (payload) {
54+
if (needsToRun) {
8855
initial = cloneDeep(payload)
89-
needsToRun = false;
56+
needsToRun = false
9057
}
9158
return initial
9259
}
@@ -95,52 +62,5 @@ const writeTheDefault = () => {
9562

9663
const defaultState = writeTheDefault()
9764

98-
// const defaultState =
99-
// {
100-
// icons,
101-
// htmlElementMap,
102-
// // every single time we create a component
103-
// // sent to export project component
104-
// componentMap: {
105-
// App: {
106-
// componentName: 'App',
107-
// children: ['HomeView'],
108-
// htmlList: []
109-
// },
110-
// HomeView: {
111-
// componentName: 'HomeView',
112-
// children: [],
113-
// htmlList: []
114-
// }
115-
// // NewView: {}
116-
// },
117-
// routes: {
118-
// HomeView: []
119-
// // NewView: []
120-
// },
121-
// userActions: [],
122-
// userState: {},
123-
// /**
124-
// *
125-
// */
126-
// componentNameInputValue: '',
127-
// projects: [{ filename: 'Untitled-1', lastSavedLocation: '' }],
128-
// activeRoute: 'HomeView',
129-
// activeComponent: '',
130-
// selectedElementList: [],
131-
// projectNumber: 2,
132-
// activeTab: 0,
133-
// componentChildrenMultiselectValue: [],
134-
// modalOpen: false,
135-
// parentSelected: false,
136-
// imagePath: ''
137-
// }
138-
139-
// const getDefault = ()=>{
140-
// return {...defaultState}
141-
// }
142-
143-
144-
14565
export default newState
146-
export {defaultState}
66+
export { defaultState }

0 commit comments

Comments
 (0)