From da8b4b662ccc61100581be47d9c73dc11420bbd2 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 11 Feb 2018 18:36:20 -0500 Subject: [PATCH] feat: vuetify integration + editor-code actions --- .babelrc | 8 ++- client/index.js | 1 + client/js/app.js | 10 ++++ client/js/components/editor-code.vue | 17 +++++- client/svg/icons.svg | 4 ++ dev/webpack/webpack.common.js | 22 ++++++- package.json | 4 ++ server/views/main/editor.pug | 3 +- server/views/master.pug | 1 + yarn.lock | 85 +++++++++++++++++++++++++--- 10 files changed, 143 insertions(+), 12 deletions(-) diff --git a/.babelrc b/.babelrc index cb993f7a..81d681c3 100644 --- a/.babelrc +++ b/.babelrc @@ -2,7 +2,13 @@ "comments": true, "plugins": [ "lodash", - "graphql-tag" + "graphql-tag", + ["transform-imports", { + "vuetify": { + "transform": "vuetify/es5/components/${member}", + "preventFullImport": true + } + }] ], "presets": [ ["env"], diff --git a/client/index.js b/client/index.js index 2db5f239..c8a56832 100644 --- a/client/index.js +++ b/client/index.js @@ -1,5 +1,6 @@ 'use strict' +require('vuetify/src/stylus/app.styl') require('./scss/app.scss') require('./js/compatibility.js') require('offline-plugin/runtime').install() diff --git a/client/js/app.js b/client/js/app.js index e43e4c64..852b8df5 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -12,6 +12,7 @@ import { ApolloLink } from 'apollo-link' import { createApolloFetch } from 'apollo-fetch' import { BatchHttpLink } from 'apollo-link-batch-http' import { InMemoryCache } from 'apollo-cache-inmemory' +import { Vuetify, VApp, VBtn, VIcon, VSpeedDial, VTooltip } from 'vuetify' import Hammer from 'hammerjs' import store from './store' @@ -90,6 +91,15 @@ Vue.use(VeeValidate, { dirty: 'is-dirty' // control has been interacted with } }) +Vue.use(Vuetify, { + components: { + VApp, + VBtn, + VIcon, + VSpeedDial, + VTooltip + } +}) // ==================================== // Register Vue Components diff --git a/client/js/components/editor-code.vue b/client/js/components/editor-code.vue index 6f2f7ff4..0051263f 100644 --- a/client/js/components/editor-code.vue +++ b/client/js/components/editor-code.vue @@ -33,12 +33,26 @@ svg.icons.is-18(role='img') title Link use(xlink:href='#fa-link') + .editor-code-toolbar-group + .editor-code-toolbar-item + svg.icons.is-18(role='img') + title Horizontal Bar + use(xlink:href='#fa-minus') .editor-code-main .editor-code-editor .editor-code-editor-title Editor codemirror(ref='cm', v-model='code', :options='cmOptions', @ready="onCmReady") .editor-code-preview .editor-code-preview-title Preview + v-speed-dial(:hover='true', direction='left', transition='slide-y-reverse-transition', :fixed='true', :right='true', :bottom='true') + v-btn(color='green', fab, dark, slot='activator') + v-icon save + v-icon close + v-btn(color='red', fab, dark, small): v-icon not_interested + v-btn(color='orange', fab, dark, small): v-icon vpn_lock + v-btn(color='indigo', fab, dark, small): v-icon restore + v-btn(color='brown', fab, dark, small): v-icon archive +