@afeefa/vue-app 0.0.55 → 0.0.56

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.55
1
+ 0.0.56
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -132,6 +132,8 @@ export default class ADialog extends Mixins(UsesPositionServiceMixin) {
132
132
  if (!Array.isArray(anchor)) {
133
133
  if (typeof anchor === 'string') {
134
134
  anchor = [document.documentElement, anchor]
135
+ } else if (typeof anchor === 'object') { // dom element or vue ref
136
+ anchor = [anchor]
135
137
  } else {
136
138
  anchor = [document.documentElement]
137
139
  }
@@ -1,28 +1,88 @@
1
1
  <template>
2
2
  <div :class="['a-rich-text-editor a-text-input', {'a-text-input-focused': focus}]">
3
- <div v-if="editor">
4
- <button
5
- type="button"
6
- :class="{ 'is-active': editor.isActive('bold') }"
3
+ <div
4
+ v-if="editor"
5
+ class="menu-bar"
6
+ >
7
+ <v-btn
8
+ small
9
+ :class="['menu-button', {'is-active': focus && editor.isActive('bold')}]"
7
10
  @click="editor.chain().focus().toggleBold().run()"
8
11
  >
9
- bold
10
- <a-mdi-icon />
11
- </button>
12
- <button
13
- type="button"
14
- :class="{ 'is-active': editor.isActive('italic') }"
12
+ <v-icon>{{ boldIcon }}</v-icon>
13
+ </v-btn>
14
+
15
+ <v-btn
16
+ small
17
+ :class="['menu-button', {'is-active': focus && editor.isActive('italic')}]"
15
18
  @click="editor.chain().focus().toggleItalic().run()"
16
19
  >
17
- italic
18
- </button>
19
- <button
20
- type="button"
21
- :class="{ 'is-active': editor.isActive('strike') }"
20
+ <v-icon>{{ italicIcon }}</v-icon>
21
+ </v-btn>
22
+
23
+ <v-btn
24
+ small
25
+ :class="['menu-button', 'strike', {'is-active': focus && editor.isActive('strike')}]"
22
26
  @click="editor.chain().focus().toggleStrike().run()"
23
27
  >
24
- strike
25
- </button>
28
+ <v-icon>{{ strikeIcon }}</v-icon>
29
+ </v-btn>
30
+
31
+ <v-btn
32
+ small
33
+ :class="['menu-button', {'is-active': focus && editor.isActive('heading', {level: 1})}]"
34
+ @click="editor.chain().focus().toggleHeading({level: 1}).run()"
35
+ >
36
+ <v-icon>{{ h1Icon }}</v-icon>
37
+ </v-btn>
38
+
39
+ <v-btn
40
+ small
41
+ :class="['menu-button', {'is-active': focus && editor.isActive('heading', {level: 2})}]"
42
+ @click="editor.chain().focus().toggleHeading({level: 2}).run()"
43
+ >
44
+ <v-icon>{{ h2Icon }}</v-icon>
45
+ </v-btn>
46
+
47
+ <v-btn
48
+ small
49
+ :class="['menu-button', {'is-active': focus && editor.isActive('bulletList')}]"
50
+ @click="editor.chain().focus().toggleBulletList().run()"
51
+ >
52
+ <v-icon>{{ ulIcon }}</v-icon>
53
+ </v-btn>
54
+
55
+ <v-btn
56
+ small
57
+ :class="['menu-button', {'is-active': focus && editor.isActive('orderedList')}]"
58
+ @click="editor.chain().focus().toggleOrderedList().run()"
59
+ >
60
+ <v-icon>{{ olIcon }}</v-icon>
61
+ </v-btn>
62
+
63
+ <v-btn
64
+ small
65
+ :class="['menu-button', {'is-active': focus && editor.isActive('blockquote')}]"
66
+ @click="editor.chain().focus().toggleBlockquote().run()"
67
+ >
68
+ <v-icon>{{ commentIcon }}</v-icon>
69
+ </v-btn>
70
+
71
+ <v-btn
72
+ small
73
+ class="menu-button"
74
+ @click="editor.chain().focus().undo().run()"
75
+ >
76
+ <v-icon>{{ undoIcon }}</v-icon>
77
+ </v-btn>
78
+
79
+ <v-btn
80
+ small
81
+ class="menu-button"
82
+ @click="editor.chain().focus().redo().run()"
83
+ >
84
+ <v-icon>{{ redoIcon }}</v-icon>
85
+ </v-btn>
26
86
  </div>
27
87
 
28
88
  <editor-content
@@ -37,6 +97,18 @@
37
97
  import { Component, Vue, Watch } from '@a-vue'
38
98
  import { Editor, EditorContent } from '@tiptap/vue-2'
39
99
  import StarterKit from '@tiptap/starter-kit'
100
+ import {
101
+ mdiFormatBold,
102
+ mdiFormatItalic,
103
+ mdiFormatStrikethroughVariant,
104
+ mdiFormatHeader1,
105
+ mdiFormatHeader2,
106
+ mdiFormatListBulleted,
107
+ mdiFormatListNumbered,
108
+ mdiFormatQuoteClose,
109
+ mdiRotateLeft,
110
+ mdiRotateRight
111
+ } from '@mdi/js'
40
112
 
41
113
  @Component({
42
114
  props: ['value', 'validator'],
@@ -49,6 +121,17 @@ export default class ARichTextArea extends Vue {
49
121
  internalValue = null
50
122
  focus = false
51
123
 
124
+ boldIcon = mdiFormatBold
125
+ italicIcon = mdiFormatItalic
126
+ strikeIcon = mdiFormatStrikethroughVariant
127
+ h1Icon = mdiFormatHeader1
128
+ h2Icon = mdiFormatHeader2
129
+ ulIcon = mdiFormatListBulleted
130
+ olIcon = mdiFormatListNumbered
131
+ commentIcon = mdiFormatQuoteClose
132
+ undoIcon = mdiRotateLeft
133
+ redoIcon = mdiRotateRight
134
+
52
135
  created () {
53
136
  this.internalValue = this.value
54
137
  }
@@ -59,7 +142,7 @@ export default class ARichTextArea extends Vue {
59
142
  }
60
143
 
61
144
  this.editor = new Editor({
62
- content: '<p>I’m running Tiptap with Vue.js. 🎉</p>',
145
+ content: this.internalValue,
63
146
  extensions: [
64
147
  StarterKit
65
148
  ],
@@ -118,4 +201,57 @@ export default class ARichTextArea extends Vue {
118
201
  }
119
202
  }
120
203
  }
204
+
205
+ .menu-bar {
206
+ margin: -.2rem 0 .5rem -.2rem;
207
+ }
208
+
209
+ .menu-button {
210
+ padding: 0 !important;
211
+ width: 30px !important;
212
+ height: 32px !important;
213
+ min-width: unset !important;
214
+ text-align: center;
215
+ font-size: 1rem;
216
+ background: white !important;
217
+ border: none;
218
+ box-shadow: none;
219
+ border-radius: 0;
220
+
221
+ ::v-deep .v-icon {
222
+ font-size: 20px;
223
+ width: 20px;
224
+ height: 20px;
225
+ }
226
+
227
+ &.strike {
228
+ ::v-deep .v-icon {
229
+ width: 15px;
230
+ }
231
+ }
232
+
233
+ svg {
234
+ width: unset;
235
+ }
236
+
237
+ &.is-active {
238
+ background: #ECECEC !important;
239
+ }
240
+ }
241
+
242
+ ::v-deep .ProseMirror {
243
+ min-height: 200px;
244
+
245
+ > :last-child {
246
+ margin: 0;
247
+ }
248
+
249
+ li p {
250
+ margin: 0;
251
+ }
252
+
253
+ ul {
254
+ margin: 16px 0;
255
+ }
256
+ }
121
257
  </style>
@@ -21,7 +21,7 @@
21
21
 
22
22
  <template #default="{changed, valid}">
23
23
  <a-row
24
- class="mt-8 mb-2 gap-4"
24
+ class="mt-8 mb-1 pb-1 gap-4"
25
25
  right
26
26
  >
27
27
  <v-btn
@@ -31,23 +31,25 @@
31
31
  Schließen
32
32
  </v-btn>
33
33
 
34
- <v-btn
35
- small
36
- :disabled="!changed || !valid"
37
- color="green white--text"
38
- @click="save"
39
- >
40
- Speichern
41
- </v-btn>
34
+ <a-row gap="2">
35
+ <v-btn
36
+ small
37
+ :disabled="!changed || !valid"
38
+ color="green white--text"
39
+ @click="save"
40
+ >
41
+ Speichern
42
+ </v-btn>
42
43
 
43
- <v-btn
44
- v-if="changed"
45
- small
46
- text
47
- @click="reset"
48
- >
49
- Zurücksetzen
50
- </v-btn>
44
+ <v-icon
45
+ v-if="changed"
46
+ small
47
+ text
48
+ @click="reset"
49
+ >
50
+ {{ undoIcon }}
51
+ </v-icon>
52
+ </a-row>
51
53
  </a-row>
52
54
  </template>
53
55
  </edit-form>
@@ -57,6 +59,7 @@
57
59
 
58
60
  <script>
59
61
  import { Component, Vue, Watch } from '@a-vue'
62
+ import { mdiRotateLeft} from '@mdi/js'
60
63
 
61
64
  @Component({
62
65
  props: ['model', 'title', 'show']
@@ -64,6 +67,8 @@ import { Component, Vue, Watch } from '@a-vue'
64
67
  export default class EditModal extends Vue {
65
68
  show_ = false
66
69
 
70
+ undoIcon = mdiRotateLeft
71
+
67
72
  /**
68
73
  * visiblility changes from outside
69
74
  * this will trigger the show_ watcher,
@@ -1,11 +1,15 @@
1
1
  <template>
2
- <div>ICON</div>
2
+ <div>TEST</div>
3
3
  </template>
4
4
 
5
5
 
6
6
  <script>
7
- export default {
7
+ import { Component, Vue } from '@a-vue'
8
8
 
9
+ @Component({
10
+ props: ['name']
11
+ })
12
+ export default class Splash extends Vue {
9
13
  }
10
14
  </script>
11
15