Skip to content

Commit 20f2fd2

Browse files
committed
feat: add editor selection + code editor + grapejs POC
1 parent 578ea57 commit 20f2fd2

File tree

10 files changed

+886
-265
lines changed

10 files changed

+886
-265
lines changed

client/app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ let bootstrap = () => {
156156
// Load Icons
157157
// ====================================
158158

159-
import(/* webpackChunkName: "icons" */ './svg/icons.svg').then(icons => {
160-
document.body.insertAdjacentHTML('beforeend', icons.default)
161-
})
159+
// import(/* webpackChunkName: "icons" */ './svg/icons.svg').then(icons => {
160+
// document.body.insertAdjacentHTML('beforeend', icons.default)
161+
// })
162162
}
163163

164164
window.boot.onDOMReady(bootstrap)

client/components/editor.vue

+49-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha
2727
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('editor:page') }}
2828
v-content
29-
editor-code
29+
component(:is='currentEditor')
3030
component(:is='currentModal')
3131
v-dialog(v-model='dialogProgress', persistent, max-width='350')
3232
v-card(color='blue darken-3', dark)
@@ -38,6 +38,39 @@
3838
)
3939
.subheading {{ $t('editor:save.processing') }}
4040
.caption.blue--text.text--lighten-3 {{ $t('editor:save.pleaseWait') }}
41+
v-dialog(v-model='dialogEditorSelector', persistent, max-width='550')
42+
v-card(color='blue darken-3', dark)
43+
v-card-text.text-xs-center.py-4
44+
.subheading Which editor do you want to use?
45+
v-container(grid-list-lg, fluid)
46+
v-layout(row, wrap, justify-center)
47+
v-flex(xs4)
48+
v-card(
49+
hover
50+
light
51+
ripple
52+
)
53+
v-card-text.text-xs-center(@click='selectEditor("code")')
54+
v-icon(large, color='primary') code
55+
.body-2.mt-2 Code
56+
v-flex(xs4)
57+
v-card(
58+
hover
59+
light
60+
ripple
61+
)
62+
v-card-text.text-xs-center(@click='selectEditor("markdown")')
63+
v-icon(large, color='primary') list_alt
64+
.body-2.mt-2 Markdown
65+
v-flex(xs4)
66+
v-card.grey(
67+
hover
68+
light
69+
ripple
70+
)
71+
v-card-text.text-xs-center(@click='selectEditor("wysiwyg")')
72+
v-icon(large, color='grey darken-1') web
73+
.body-2.mt-2.grey--text.text--darken-2 Visual Builder
4174

4275
v-snackbar(
4376
:color='notification.style'
@@ -69,12 +102,16 @@ export default {
69102
components: {
70103
AtomSpinner,
71104
editorCode: () => import(/* webpackChunkName: "editor-code" */ './editor/editor-code.vue'),
105+
editorMarkdown: () => import(/* webpackChunkName: "editor-markdown" */ './editor/editor-markdown.vue'),
106+
editorWysiwyg: () => import(/* webpackChunkName: "editor-wysiwyg" */ './editor/editor-wysiwyg.vue'),
72107
editorModalProperties: () => import(/* webpackChunkName: "editor" */ './editor/editor-modal-properties.vue')
73108
},
74109
data() {
75110
return {
76111
currentModal: '',
77-
dialogProgress: false
112+
currentEditor: '',
113+
dialogProgress: false,
114+
dialogEditorSelector: false
78115
}
79116
},
80117
computed: {
@@ -85,11 +122,20 @@ export default {
85122
mounted() {
86123
if (this.mode === 'create') {
87124
_.delay(() => {
88-
this.openModal('properties')
125+
this.dialogEditorSelector = true
89126
}, 500)
90127
}
91128
},
92129
methods: {
130+
selectEditor(name) {
131+
this.currentEditor = `editor${_.startCase(name)}`
132+
this.dialogEditorSelector = false
133+
if (this.mode === 'create') {
134+
_.delay(() => {
135+
this.openModal('properties')
136+
}, 500)
137+
}
138+
},
93139
openModal(name) {
94140
this.currentModal = `editorModal${_.startCase(name)}`
95141
},

0 commit comments

Comments
 (0)