Skip to content

Commit 4eac7e6

Browse files
committed
committing full edit functionality for component name, state, actions, and props
2 parents fb6ea7e + e3d9a0d commit 4eac7e6

32 files changed

+7002
-5648
lines changed

package-lock.json

Lines changed: 6155 additions & 5197 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"vue-drag-resize": "^1.3.2",
4040
"vue-draggable-nested-tree": "^2.2.17",
4141
"vue-draggable-resizable": "^2.0.0-rc2",
42+
"vue-js-toggle-button": "^1.3.3",
4243
"vue-loader": "^15.7.0",
4344
"vue-multiselect": "^2.1.6",
4445
"vue-prism-editor": "^0.2.1",
@@ -50,6 +51,7 @@
5051
"@quasar/app": "^1.0.0",
5152
"@quasar/quasar-app-extension-testing": "^1.0.0",
5253
"@quasar/quasar-app-extension-testing-unit-jest": "^1.0.0",
54+
"@vue/devtools": "^5.3.4",
5355
"@vue/eslint-config-standard": "^4.0.0",
5456
"babel-eslint": "^10.0.1",
5557
"devtron": "^1.4.0",

src/App.vue

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ let redoMixin = {
4040
// console.log("Are these equal to each other?", action == this.undoneAction[this.undoneAction.length-1])
4141
if (!this.isTimetraveling) {
4242
if (this.undoneAction[this.undoneAction.length - 1]) {
43-
if (action.type === this.undoneAction[this.undoneAction.length - 1].type &&
44-
deepEqual(action.payload, this.undoneAction[this.undoneAction.length - 1].payload)) {
43+
if (
44+
action.type ===
45+
this.undoneAction[this.undoneAction.length - 1].type &&
46+
deepEqual(
47+
action.payload,
48+
this.undoneAction[this.undoneAction.length - 1].payload
49+
)
50+
) {
4551
this.undoneAction.pop()
4652
} else {
4753
this.undoneAction = []
@@ -50,19 +56,21 @@ let redoMixin = {
5056
}
5157
})
5258
},
53-
59+
// undo + redo function calling
60+
// metaKey accounts for Command Key on Mac
5461
mounted () {
5562
const throttledUndo = throttle(this.undo, 300)
5663
const throttledRedo = throttle(this.redo, 300)
57-
64+
// undo function calling
5865
window.addEventListener('keydown', event => {
59-
if (event.ctrlKey && event.key === 'z') {
66+
if ((event.ctrlKey || event.metaKey) && event.key === 'z') {
6067
event.preventDefault()
6168
throttledUndo()
6269
}
6370
})
71+
// redo function calling
6472
window.addEventListener('keydown', event => {
65-
if (event.ctrlKey && event.key === 'y') {
73+
if ((event.ctrlKey || event.metaKey) && event.key === 'y') {
6674
event.preventDefault()
6775
throttledRedo()
6876
}
@@ -90,8 +98,10 @@ let redoMixin = {
9098
this.undoneAction.push(undone)
9199
if (ignoredActions.has(undone.type)) {
92100
// console.log('We undid an ignored action!')
93-
while (this.doneAction[this.doneAction.length - 1] &&
94-
ignoredActions.has(this.doneAction[this.doneAction.length - 1].type)) {
101+
while (
102+
this.doneAction[this.doneAction.length - 1] &&
103+
ignoredActions.has(this.doneAction[this.doneAction.length - 1].type)
104+
) {
95105
this.undoneAction.push(this.doneAction.pop())
96106
}
97107
/* if we get here, that means we have undone all "useless" actions
@@ -130,7 +140,6 @@ let redoMixin = {
130140
this.redo()
131141
}
132142
}
133-
134143
}
135144
}
136145
@@ -140,5 +149,4 @@ export default {
140149
}
141150
</script>
142151

143-
<style>
144-
</style>
152+
<style></style>

src/components/ComponentDisplay.vue

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,17 @@ Description:
3333
<div class="component-title">
3434
<p>{{ componentData.componentName }}</p>
3535
</div>
36-
<!-- <p> Elements in Component: </p>
37-
<p
38-
v-for="htmlElement in componentMap[componentData.componentName]
39-
.htmlList"
40-
:key="htmlElement"
41-
>
42-
{{ htmlElement.text }}
43-
</p> -->
36+
<!-- <div class="component-html-info"> -->
37+
<!-- <p>Elements in Component:</p> -->
38+
<!-- <p
39+
class="component-html-info"
40+
v-for="htmlElement in componentMap[componentData.componentName]
41+
.htmlList"
42+
:key="htmlElement"
43+
>
44+
{{ htmlElement.text }}
45+
</p> -->
46+
<!-- </div> -->
4447
<q-menu context-menu>
4548
<q-list color="black" class="menu">
4649
<q-item clickable v-ripple v-close-popup @click="handleAddChild">
@@ -339,7 +342,7 @@ export default {
339342
},
340343
341344
// deactivated is emitted before activated
342-
onDeactivated (componentData) {
345+
onDeactivated () {
343346
if (this.activeComponent !== '') {
344347
this.activeComponentData.isActive = false
345348
}
@@ -379,7 +382,11 @@ export default {
379382
},
380383
watch: {
381384
activeComponent: function () {
382-
this.onActivated(this.activeComponentObj)
385+
if (this.activeComponent) {
386+
this.onActivated(this.activeComponentObj)
387+
} else {
388+
this.onDeactivated()
389+
}
383390
}
384391
}
385392
}
@@ -397,6 +404,19 @@ export default {
397404
line-height: 1.2;
398405
z-index: -1;
399406
}
407+
408+
.component-html-info {
409+
display: flex;
410+
font-size: 14px;
411+
/* flex-basis: auto; */
412+
flex-direction: column;
413+
/* flex-wrap: wrap; */
414+
/* justify-content: center; */
415+
/* flex-flow: column wrap; */
416+
/* align-content: stretch; */
417+
/* align-items: flex-start; */
418+
font-weight: 800;
419+
}
400420
.component-children {
401421
position: relative;
402422
top: 0rem;

src/components/Tree.vue

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)