Skip to content

Commit 6f094ac

Browse files
author
Emma Genesen
committed
merged with Michael/getname
2 parents 8e74a0f + 1cebfef commit 6f094ac

20 files changed

+26428
-134
lines changed

package-lock.json

Lines changed: 26031 additions & 6 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
@@ -28,6 +28,8 @@
2828
"@quasar/cli": "^1.3.2",
2929
"@quasar/extras": "^1.12.5",
3030
"@ssthouse/vue3-tree-chart": "^0.2.3",
31+
"bootstrap": "^5.2.0",
32+
"bootstrap-vue": "^2.22.0",
3133
"core-js": "^3.21.1",
3234
"dotenv": "^16.0.0",
3335
"electron-deeplink": "^1.0.10",

src/components/Canvas.vue

Lines changed: 81 additions & 56 deletions
Large diffs are not rendered by default.

src/components/composables/useCreateComponent.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ export function useCreateComponent(importObj) {
3232
// boilerplate properties for each component upon creation
3333
const component = {
3434
x: 0,
35-
y: 20,
35+
y: 0,
3636
z: 0,
37-
w: 200,
38-
h: 200,
37+
// !Chris: disabling this temporarily to see if we can have create component dynamically fit into grid- less snapping bugs
38+
// w: 200,
39+
// h: 200,
3940
htmlList: this.selectedElementList,
4041
noteList: [],
4142
children: [],
@@ -50,7 +51,7 @@ export function useCreateComponent(importObj) {
5051
htmlAttributes: {
5152
class: "",
5253
id: ""
53-
}
54+
},
5455
};
5556

5657
if (imported === true) {

src/components/composables/useExportComponent.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export function useExportComponent() {
2-
// OVERVUE 6.0: export active component
2+
// OVERVUE 6.0: export active component
33
/**
44
* @description: makes files, directories and boilerplate when exporting a single Vue component
5-
*
5+
*
66
* @param: none -- uses this.activeComponent from state to create file
77
* @return: none -- outputs file to fs
8-
*
8+
*
99
*/
10-
10+
1111
const showExportComponentDialog = () => {
1212
ipcRenderer
1313
.invoke("exportComponent", {
@@ -18,12 +18,12 @@ export function useExportComponent() {
1818
.then((result) => exportComponentFile(result.filePath))
1919
.catch((err) => console.log(err));
2020
}
21-
21+
2222
/**
2323
* @description: creates component code <template>, <script>, <style>
2424
* invokes writeTemplate, writeScript, writeStyle
2525
*/
26-
26+
2727
const createComponentCode = (componentLocation, componentName, children) => {
2828
fs.writeFileSync(
2929
componentLocation + ".vue",
@@ -57,6 +57,7 @@ export function useExportComponent() {
5757
h4: ["<h4", "</h4>"],
5858
h5: ["<h5", "</h5>"],
5959
h6: ["<h6", "</h6>"],
60+
element:["<el-button", "</el-button>"]
6061
};
6162
// function to loop through nested elements
6263
const writeNested = (childrenArray, indent) => {
@@ -65,7 +66,7 @@ export function useExportComponent() {
6566
}
6667
let indented = indent + " ";
6768
let nestedString = "";
68-
69+
6970
childrenArray.forEach((child) => {
7071
nestedString += indented;
7172
if (!child.text) {
@@ -81,7 +82,7 @@ export function useExportComponent() {
8182
if (child.text === "img" || child.text === "input" || child.text === "link") {
8283
nestedString += "/>";
8384
} else { nestedString += ">"; }
84-
85+
8586
if (child.children.length) {
8687
nestedString += "\n";
8788
nestedString += writeNested(child.children, indented);
@@ -206,7 +207,7 @@ export function useExportComponent() {
206207
data += "\n";
207208
data += " }\n";
208209
data += " },\n";
209-
210+
210211
// if true add computed section and populate with state
211212
let computed = "";
212213
if (currentComponent.state.length) {
@@ -270,10 +271,10 @@ height: ${element.h}px;
270271
z-index: ${element.z};
271272
}\n`
272273
}
273-
})
274-
275-
276-
274+
})
275+
276+
277+
277278

278279

279280
for (const html of htmlArray) {
@@ -304,4 +305,4 @@ z-index: ${html.z};
304305
);
305306
}
306307
showExportComponentDialog();
307-
}
308+
}

src/components/left-sidebar/ComponentTab/CreateMenu.vue

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ Description:
77

88
<template>
99
<div class="create-component-div drawer-menu">
10+
11+
12+
1013
<q-expansion-item group="accordion" label="Import Component">
14+
<!-- !THIS IS THE IMPORT COMPONENT TAB WE NEED TO WORK ON -->
1115
<ImportComponent v-if="activeComponent === ''" @imported="createComponent" title="Import Component (coming soon)" class="sidebar-btn" :disable = "true"/>
1216
</q-expansion-item>
13-
<q-expansion-item group="accordion" label="Create Component">
17+
<q-expansion-item group="accordion" label="Create Component" >
18+
<ImportLibraryButton></ImportLibraryButton>
19+
<LibComponents></LibComponents>
20+
1421
<form class="create-component-form" v-on:submit.prevent="createComponent">
1522
<!-- will render if creating new component -->
1623
<q-input
@@ -32,7 +39,8 @@ Description:
3239
</form>
3340

3441
<ParentMultiselect v-if="activeComponent === ''"></ParentMultiselect>
35-
<div class="subsection">HTML Elements</div>
42+
43+
<div class="subsection">Elements/Components</div>
3644
<div class="icon-container">
3745
<Icons
3846
class="icons"
@@ -41,10 +49,12 @@ Description:
4149
@activeHTML="addNestedHTML"
4250
@activeLayer="addNestedNoActive"
4351
/>
52+
4453
</div>
4554
<button class="componentHTML">
4655
<CreateMenuHTMLQueue></CreateMenuHTMLQueue>
4756
</button>
57+
4858
<br />
4959

5060
<q-btn
@@ -56,6 +66,7 @@ Description:
5666
@click="createComponent"
5767
:disabled="!componentNameInputValue.trim() || Object.keys(this.componentMap).includes(componentNameInputValue.trim())"
5868
/>
69+
5970
</q-expansion-item>
6071
</div>
6172
</template>
@@ -67,13 +78,21 @@ import ParentMultiselect from "./ParentMultiselect.vue";
6778
import ImportComponent from "./ImportComponent.vue"
6879
import CreateMenuHTMLQueue from "./CreateMenuHTMLQueue.vue";
6980
import { mapState, mapActions } from "vuex";
81+
import ImportLibraryButton from "./ImportLibraryButton.vue";
82+
import LibComponents from "./LibComponents.vue";
83+
84+
7085
export default {
7186
name: "CreateMenu",
7287
components: {
7388
Icons,
7489
ParentMultiselect,
7590
ImportComponent,
76-
CreateMenuHTMLQueue
91+
CreateMenuHTMLQueue,
92+
ImportLibraryButton,
93+
ImportLibraryButton,
94+
LibComponents,
95+
7796
},
7897
computed: {
7998
...mapState([

src/components/left-sidebar/ComponentTab/ImportComponent.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export default {
134134
h4:["<h4>", "</h4>"],
135135
h5:["<h5>", "</h5>"],
136136
h6:["<h6>", "</h6>"],
137+
element:["<el-button ", "</el-button>"]
137138
};
138139
139140
@@ -181,9 +182,9 @@ export default {
181182
182183
/**
183184
* @name: buildList
184-
* @desc: takes incoming substrings and pushes the appropriate
185+
* @desc: takes incoming substrings and pushes the appropriate
185186
* elements fromt he htmlElementMap defined by Overvue
186-
*
187+
*
187188
* @param: substrings from htmlParser function
188189
* @return: nothing -- pushes into htmlList array which is defined outside scope of buildList
189190
*/
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
<template>
3+
<div class="q-pa-md">
4+
<q-btn-dropdown color="purple" label="Choose Library">
5+
<q-list>
6+
<q-item clickable v-close-popup @click="pickLibrary('element')">
7+
<q-item-section>
8+
<q-item-label>Element+</q-item-label>
9+
</q-item-section>
10+
</q-item>
11+
12+
<q-item clickable v-close-popup @click="pickLibrary('bootstrap')">
13+
<q-item-section>
14+
<q-item-label>Bootstrap</q-item-label>
15+
</q-item-section>
16+
</q-item>
17+
18+
<q-item clickable v-close-popup @click="pickLibrary('vuetify')">
19+
<q-item-section>
20+
<q-item-label>Vuetify</q-item-label>
21+
</q-item-section>
22+
</q-item>
23+
</q-list>
24+
</q-btn-dropdown>
25+
</div>
26+
</template>
27+
28+
29+
30+
31+
<script>
32+
import { mapState, mapActions } from "vuex";
33+
export default {
34+
name: "ImportLibraryButton",
35+
components: {
36+
37+
},
38+
methods:{
39+
...mapActions([
40+
41+
42+
"changeLib",
43+
'addLibComponents',
44+
'changeLibComponentDisplay'
45+
46+
47+
]),
48+
pickLibrary(libName){
49+
let payload = {
50+
libName:libName,
51+
displaylibComponent:true
52+
53+
}
54+
this.changeLibComponentDisplay(payload);
55+
this.changeLib(payload);
56+
// console.log(this.$store.state.importLibraries.includes('element'));
57+
},
58+
59+
60+
61+
62+
},
63+
computed: {
64+
...mapState([
65+
'importLibraries'
66+
]),
67+
}
68+
}
69+
</script>
70+
<style></style>

src/components/left-sidebar/ComponentTab/InputHTMLMenu.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="AttributeBox">
55
<div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
66
:key="element.id + Date.now()">
7-
<p v-if="element.id === this.activeHTML" class="title">Your class {{ element.class.length !== 0 ? 'is ' + element.class : 'has not been stated yet' }}</p>
7+
<p v-if="element.id === this.activeHTML" class="title">Your class {{ element.class.length !== 0 ? 'is ' + element.class : 'has not been stated yet' }}</p>
88
</div>
99
<q-form autofocus v-on:submit.prevent="submitClass">
1010
<q-input label="Add/Change your class name" filled dark autofocus true hide-bottom-space v-model="classText"
@@ -21,7 +21,7 @@
2121
:disable="bindingText.length > 0 ? false : true" @click.self="addBinding(bindingText, this.activeHTML)">
2222
</i>
2323
</q-input>
24-
</q-form>
24+
</q-form>
2525
<div class="AttributeContainer" v-for="element in this.componentMap[this.activeComponent].htmlList"
2626
:key="element.id + Date.now()">
2727
<div v-if="exceptions.includes(element.text) && element.id === this.activeHTML">
@@ -32,7 +32,7 @@
3232
</i>
3333
</q-input>
3434
</q-form>
35-
<p class="title">Adjust Height and Elevation:</p>
35+
<p class="title">Adjust Height and Elevation:</p>
3636
<q-form autofocus v-on:submit.prevent="submitHeight">
3737
<q-slider
3838
v-model="heightText"
@@ -46,7 +46,7 @@
4646
color="secondary"
4747
@change="submitHeight(heightText, this.activeHTML)"
4848
@update:model-value="submitHeight(heightText, this.activeHTML)"
49-
style="float: left; margin-left: 5% "
49+
style="float: left; margin-left: 5% "
5050
/>
5151
</q-form>
5252
<q-form autofocus v-on:submit.prevent="submitTop">
@@ -157,7 +157,7 @@ import { mapState, mapActions } from 'vuex'
157157
export default {
158158
data () {
159159
return {
160-
exceptions: ['div','button','form','img','list','paragraph','list-ol','list-ul','input','h1','h2','h3','h4','h5','h6'],
160+
exceptions: ['div','button','form','img','list','paragraph','list-ol','list-ul','input','h1','h2','h3','h4','h5','h6','element'],
161161
attributeModal : "false",
162162
classText: '',
163163
heightText: '',
@@ -187,11 +187,11 @@ export default {
187187
computed: {
188188
...mapState([
189189
'activeComponent',
190-
'selectedElementList',
191-
'componentMap',
192-
'activeComponent',
193-
'activeHTML',
194-
'activeLayer',
190+
'selectedElementList',
191+
'componentMap',
192+
'activeComponent',
193+
'activeHTML',
194+
'activeLayer',
195195
'attributeModalOpen',
196196
'activeRoute',
197197
'routes',
@@ -206,7 +206,7 @@ export default {
206206
...mapActions([
207207
'setActiveHTML',
208208
'setActiveLayer',
209-
'openAttributeModal',
209+
'openAttributeModal',
210210
'addActiveComponentClass',
211211
'addActiveComponentElementNote',
212212
'addActiveComponentHeight',
@@ -360,7 +360,7 @@ export default {
360360
margin-top: 2em;
361361
margin-bottom: 2em;
362362
width: 100%;
363-
}
363+
}
364364
365365
.minorAction {
366366
margin-right:5px;
@@ -373,4 +373,4 @@ export default {
373373
padding-top:5px;
374374
}
375375
376-
</style>
376+
</style>

0 commit comments

Comments
 (0)