@windward/games 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  <v-card
4
4
  @click="toggleCard"
5
5
  v-show="value"
6
- class="animated flipInY flashcard"
6
+ :class="cardClass"
7
7
  max-height="900"
8
8
  min-height="460"
9
9
  >
@@ -12,7 +12,7 @@
12
12
  <v-card
13
13
  @click="toggleCard"
14
14
  v-show="!value"
15
- class="animated flipInY flashcard"
15
+ :class="cardClass"
16
16
  max-height="900"
17
17
  min-height="460"
18
18
  >
@@ -27,6 +27,7 @@ export default {
27
27
  data() {
28
28
  return {
29
29
  settings: {},
30
+ cardClass: 'animated flashcard',
30
31
  }
31
32
  },
32
33
  props: {
@@ -71,6 +72,8 @@ export default {
71
72
  },
72
73
  methods: {
73
74
  toggleCard() {
75
+ //only flip card when user click
76
+ this.cardClass = 'animated flipInY flashcard'
74
77
  this.$emit('input', !this.value)
75
78
  },
76
79
  },
@@ -168,6 +168,7 @@ export default {
168
168
  body: '',
169
169
  hint: '',
170
170
  answer_description: '',
171
+ id: Crypto.id(),
171
172
  }
172
173
  }
173
174
  if (newValue && newValue.body === '') {
@@ -310,9 +310,9 @@ export default {
310
310
  // rehides the displayed correct letters
311
311
  this.block.metadata.config.words[
312
312
  this.onSlide
313
- ].splitWord.forEach((word) => {
314
- if (word.show) {
315
- word.show = false
313
+ ].splitWord.forEach((letter) => {
314
+ if (letter.letter && letter.letter !== ' ') {
315
+ letter.show = false
316
316
  }
317
317
  })
318
318
  }
@@ -36,7 +36,7 @@
36
36
  v-for="(item, index) in block.metadata.config
37
37
  .cards"
38
38
  :key="'card_' + index"
39
- class="pa-2 flex-fill"
39
+ class="pa-2 flex-fill cursorGrab"
40
40
  elevation="0"
41
41
  outlined
42
42
  tile
@@ -140,7 +140,11 @@
140
140
  index
141
141
  ].title
142
142
  "
143
- label="Title"
143
+ :label="
144
+ $t(
145
+ 'plugin.games.components.settings.flashcard.form.label'
146
+ )
147
+ "
144
148
  ></v-text-field>
145
149
  <br />
146
150
  <v-textarea
@@ -156,7 +160,11 @@
156
160
  index
157
161
  ].front.header
158
162
  "
159
- label="Header"
163
+ :label="
164
+ $t(
165
+ 'plugin.games.components.settings.flashcard.form.header'
166
+ )
167
+ "
160
168
  />
161
169
  <v-textarea
162
170
  v-if="
@@ -172,41 +180,71 @@
172
180
  ].back.header
173
181
  "
174
182
  :counter="255"
175
- label="Header"
183
+ :label="
184
+ $t(
185
+ 'plugin.games.components.settings.flashcard.form.header'
186
+ )
187
+ "
176
188
  required
177
189
  />
178
- <textEditor
190
+ <v-card
191
+ outlined
179
192
  v-show="
180
193
  block.metadata.config.cards[
181
194
  index
182
195
  ].side
183
196
  "
197
+ >
198
+ <v-card-text>
199
+ {{
200
+ $t(
201
+ 'plugin.games.components.settings.flashcard.form.card_content'
202
+ )
203
+ }}
204
+ </v-card-text>
205
+ <textEditor
206
+ outlined
207
+ auto-grow
208
+ v-model="
209
+ block.metadata.config.cards[
210
+ index
211
+ ].front.text
212
+ "
213
+ :label="
214
+ $t(
215
+ 'plugin.games.components.settings.flashcard.form.text'
216
+ )
217
+ "
218
+ required
219
+ />
220
+ </v-card>
221
+ <v-card
184
222
  outlined
185
- auto-grow
186
- v-model="
187
- block.metadata.config.cards[
188
- index
189
- ].front.text
190
- "
191
- label="Text"
192
- required
193
- />
194
- <textEditor
195
223
  v-show="
196
224
  !block.metadata.config.cards[
197
225
  index
198
226
  ].side
199
227
  "
200
- outlined
201
- auto-grow
202
- v-model="
203
- block.metadata.config.cards[
204
- index
205
- ].back.text
206
- "
207
- label="Text"
208
- required
209
- />
228
+ >
229
+ <v-card-text>
230
+ {{
231
+ $t(
232
+ 'plugin.games.components.settings.flashcard.form.card_content'
233
+ )
234
+ }}
235
+ </v-card-text>
236
+ <textEditor
237
+ outlined
238
+ auto-grow
239
+ v-model="
240
+ block.metadata.config.cards[
241
+ index
242
+ ].back.text
243
+ "
244
+ label="Text"
245
+ required
246
+ />
247
+ </v-card>
210
248
  <br />
211
249
  <ContentBlockAsset
212
250
  v-show="
@@ -486,4 +524,7 @@ export default {
486
524
  .changePointer {
487
525
  cursor: pointer !important;
488
526
  }
527
+ .cursorGrab {
528
+ cursor: grab;
529
+ }
489
530
  </style>
@@ -254,6 +254,7 @@ export default {
254
254
  body: '',
255
255
  hint: '',
256
256
  answer_description: '',
257
+ id: Crypto.id(),
257
258
  })
258
259
  this.editingIndex = this.block.metadata.config.questions.length - 1
259
260
  },
@@ -195,9 +195,16 @@ export default {
195
195
  element.splitWord = element.value.split('')
196
196
  element.splitWord.forEach((letter) => {
197
197
  const letterIndex = element.splitWord.indexOf(letter)
198
- element.splitWord[letterIndex] = {
199
- letter: letter,
200
- show: false,
198
+ if (letter !== ' ') {
199
+ element.splitWord[letterIndex] = {
200
+ letter: letter,
201
+ show: false,
202
+ }
203
+ } else {
204
+ element.splitWord[letterIndex] = {
205
+ letter: letter,
206
+ show: true,
207
+ }
201
208
  }
202
209
  })
203
210
  })
@@ -1,10 +1,12 @@
1
1
  export default {
2
2
  form: {
3
3
  card: 'Card',
4
+ label: 'Card Label',
5
+ card_content: 'Card Content',
4
6
  front: 'Front',
5
7
  back: 'Back',
6
8
  header: 'Header',
7
- Text: 'Text',
9
+ text: 'Text',
8
10
  image: {
9
11
  title: 'Flash Card Image File',
10
12
  configure_blurb:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/games",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Windward UI Plugin Games",
5
5
  "main": "plugin.js",
6
6
  "scripts": {