@windward/games 0.3.0 → 0.4.0

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.
Files changed (36) hide show
  1. package/components/content/CrudTable.vue +8 -4
  2. package/components/content/DatableEditor.vue +1 -0
  3. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +2 -1
  4. package/components/content/blocks/dragDrop/BucketGame.vue +4 -3
  5. package/components/content/blocks/dragDrop/SortingGame.vue +2 -1
  6. package/components/content/blocks/flashcards/CardFace.vue +48 -9
  7. package/components/content/blocks/flashcards/Flashcard.vue +26 -17
  8. package/components/content/blocks/flashcards/FlashcardSlides.vue +10 -5
  9. package/components/content/blocks/matchingGame/MatchingGame.vue +76 -50
  10. package/components/content/blocks/multipleChoice/MultipleChoice.vue +5 -1
  11. package/components/content/blocks/multipleChoice/QuestionDialog.vue +2 -0
  12. package/components/content/blocks/quizshowGame/AnswerPanel.vue +1 -0
  13. package/components/content/blocks/quizshowGame/Gridview.vue +1 -0
  14. package/components/content/blocks/quizshowGame/QuizShow.vue +5 -2
  15. package/components/content/blocks/sevenStrikes/SevenStikes.vue +8 -2
  16. package/components/content/blocks/slideshow/SlideShow.vue +31 -22
  17. package/components/content/blocks/wordJumble/WordJumble.vue +7 -2
  18. package/components/settings/BucketGameSettingsManager.vue +5 -1
  19. package/components/settings/CrosswordPuzzleSettingsManager.vue +1 -0
  20. package/components/settings/FlashCardSlidesManager.vue +165 -107
  21. package/components/settings/MatchingGameManager.vue +31 -0
  22. package/components/settings/MultipleChoiceSettingsManager.vue +1 -0
  23. package/components/settings/QuizShowSettingsManager.vue +3 -0
  24. package/components/settings/SevenStrikesSettingsManager.vue +1 -0
  25. package/components/settings/SlideShowManager.vue +32 -12
  26. package/components/settings/SortingGameSettingsManager.vue +1 -0
  27. package/components/settings/WordJumbleSettingsManager.vue +1 -0
  28. package/i18n/en-US/components/content/blocks/slideshow.ts +1 -3
  29. package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
  30. package/i18n/es-ES/components/content/blocks/slideshow.ts +0 -2
  31. package/i18n/es-ES/components/settings/seven_strikes.ts +1 -1
  32. package/i18n/sv-SE/components/content/blocks/slideshow.ts +0 -2
  33. package/i18n/sv-SE/components/settings/seven_strikes.ts +1 -1
  34. package/package.json +1 -1
  35. package/test/blocks/flashcards/CardFace.spec.js +2 -0
  36. package/test/blocks/flashcards/Flashcard.spec.js +1 -0
@@ -12,7 +12,7 @@
12
12
  ></v-switch>
13
13
  <div v-if="!tableMode">
14
14
  <div>
15
- <h3
15
+ <h2
16
16
  :aria-label="
17
17
  $t(
18
18
  'windward.games.components.content.blocks.quizshow_game.title'
@@ -21,7 +21,7 @@
21
21
  tabindex="0"
22
22
  >
23
23
  {{ title }}
24
- </h3>
24
+ </h2>
25
25
 
26
26
  <p tabindex="0">
27
27
  <TextViewer v-model="block.metadata.config.instructions" />
@@ -67,6 +67,7 @@
67
67
  <v-row align="center" justify="center">
68
68
  <v-btn
69
69
  outlined
70
+ elevation="0"
70
71
  :color="
71
72
  getButtonColor(cat_index, point_index)
72
73
  "
@@ -143,6 +144,7 @@
143
144
  <v-btn
144
145
  class="text-capitalize"
145
146
  color="primary"
147
+ elevation="0"
146
148
  @click="show = !show"
147
149
  outlined
148
150
  >
@@ -162,6 +164,7 @@
162
164
  >
163
165
  <v-btn
164
166
  outlined
167
+ elevation="0"
165
168
  class="text-capitalize"
166
169
  color="primary"
167
170
  @click="resetGame"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-col class="pa-0">
4
- <h3>
4
+ <h2>
5
5
  {{
6
6
  block.metadata.config.title
7
7
  ? block.metadata.config.title
@@ -9,7 +9,7 @@
9
9
  'windward.games.components.content.blocks.seven_strikes.title'
10
10
  )
11
11
  }}
12
- </h3>
12
+ </h2>
13
13
  <p>{{ block.metadata.config.instructions }}</p>
14
14
  </v-col>
15
15
  <v-col class="pa-0">
@@ -22,6 +22,7 @@
22
22
  <v-btn
23
23
  variant="elevated"
24
24
  color="primary"
25
+ elevation="0"
25
26
  outlined
26
27
  fab
27
28
  small
@@ -34,6 +35,7 @@
34
35
  <v-btn
35
36
  variant="elevated"
36
37
  color="primary"
38
+ elevation="0"
37
39
  outlined
38
40
  fab
39
41
  small
@@ -76,6 +78,7 @@
76
78
  "
77
79
  class="mr-5"
78
80
  color="success"
81
+ elevation="0"
79
82
  @click="onChangeSlide(index + 1)"
80
83
  >{{ $t('shared.forms.continue') }}
81
84
  </v-btn>
@@ -155,6 +158,7 @@
155
158
  color="primary"
156
159
  class="ml-4"
157
160
  outlined
161
+ elevation="0"
158
162
  @click="onRevealAnswer"
159
163
  >{{
160
164
  $t(
@@ -166,6 +170,7 @@
166
170
  color="primary"
167
171
  class="ml-4"
168
172
  outlined
173
+ elevation="0"
169
174
  @click="onSlideChanged(index)"
170
175
  >{{
171
176
  $t(
@@ -176,6 +181,7 @@
176
181
  <v-btn
177
182
  @click="onChangeSlide(index + 1)"
178
183
  color="primary ml-4"
184
+ elevation="0"
179
185
  >{{
180
186
  $t(
181
187
  'windward.games.components.content.blocks.seven_strikes.next'
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <div class="header-description">
4
- <h3
3
+ <div class="header-description pa-0">
4
+ <h2
5
5
  :aria-label="
6
6
  $t(
7
7
  'windward.games.components.content.blocks.slideshow.slideshow_title'
@@ -10,18 +10,11 @@
10
10
  tabindex="0"
11
11
  >
12
12
  {{ block.metadata.config.title }}
13
- </h3>
13
+ </h2>
14
14
 
15
15
  <p tabindex="0" class="pt-3">
16
16
  {{ block.metadata.config.instructions }}
17
17
  </p>
18
- <p tabindex="0">
19
- {{
20
- $t(
21
- 'windward.games.components.content.blocks.slideshow.basic_instructions'
22
- )
23
- }}
24
- </p>
25
18
  </div>
26
19
  <div>
27
20
  <template v-if="block.metadata.config.slides.length !== 0">
@@ -30,6 +23,7 @@
30
23
  <v-btn
31
24
  variant="elevated"
32
25
  color="primary"
26
+ elevation="0"
33
27
  outlined
34
28
  fab
35
29
  small
@@ -42,6 +36,7 @@
42
36
  <v-btn
43
37
  variant="elevated"
44
38
  color="primary"
39
+ elevation="0"
45
40
  outlined
46
41
  fab
47
42
  small
@@ -57,23 +52,24 @@
57
52
  >
58
53
  <v-carousel-item>
59
54
  <div class="fill-height d-flex flex-column">
60
- <div>
61
- <h3 class="header-description">
62
- {{ slide['header'] }} :
63
- </h3>
55
+ <div class="pa-0 ma-0">
56
+ <h4 class="header-description">
57
+ {{ slide['header'] }}
58
+ </h4>
64
59
  <p class="header-description">
65
60
  {{ slide['description'] }}
66
61
  </p>
67
62
  </div>
68
- <div style="overflow: auto">
63
+ <div style="overflow: auto" class="pl-15 pr-15">
69
64
  <v-img
70
- v-if="slide['image']"
71
- :src="
72
- slide['image']['asset'][
73
- 'public_url'
74
- ]
65
+ v-if="slide['imageAsset']"
66
+ :src="getImageUrl(slide['imageAsset'])"
67
+ :alt="
68
+ getImageAlt(
69
+ slide['imageAsset'],
70
+ slide['imageAlt']
71
+ )
75
72
  "
76
- :alt="slide['image_alt']"
77
73
  height="100%"
78
74
  contain
79
75
  />
@@ -129,7 +125,20 @@ export default {
129
125
  this.block.metadata.config.currentSlide = 0
130
126
  },
131
127
  },
132
- methods: {},
128
+ methods: {
129
+ getImageUrl(file) {
130
+ file = this.resolveAsset(file)
131
+ return _.get(file, 'asset.public_url', '')
132
+ },
133
+ getImageAlt(file, defaultText = '') {
134
+ // If a default / override was defined
135
+ if (defaultText) {
136
+ return defaultText
137
+ }
138
+ file = this.resolveAsset(file)
139
+ return _.get(file, 'asset.metadata.props.alt', '')
140
+ },
141
+ },
133
142
  }
134
143
  </script>
135
144
  <style scoped>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-container>
3
3
  <v-col class="pa-0">
4
- <h3>
4
+ <h2>
5
5
  {{
6
6
  block.metadata.config.title
7
7
  ? block.metadata.config.title
@@ -9,7 +9,7 @@
9
9
  'windward.games.components.content.blocks.word_jumble.title'
10
10
  )
11
11
  }}
12
- </h3>
12
+ </h2>
13
13
  <p>{{ block.metadata.config.instructions }}</p>
14
14
  </v-col>
15
15
  <v-col class="pa-0">
@@ -22,6 +22,7 @@
22
22
  <v-btn
23
23
  variant="elevated"
24
24
  color="primary"
25
+ elevation="0"
25
26
  outlined
26
27
  fab
27
28
  small
@@ -34,6 +35,7 @@
34
35
  <v-btn
35
36
  variant="elevated"
36
37
  color="primary"
38
+ elevation="0"
37
39
  outlined
38
40
  fab
39
41
  small
@@ -90,6 +92,7 @@
90
92
  'container-feedback-success'
91
93
  "
92
94
  class="mr-5"
95
+ elevation="0"
93
96
  color="success"
94
97
  @click="onSlideChanged(true)"
95
98
  >{{ $t('shared.forms.continue') }}
@@ -125,6 +128,7 @@
125
128
  <v-btn
126
129
  :disabled="disableButtons"
127
130
  color="primary"
131
+ elevation="0"
128
132
  @click="onCheckAnswer(word)"
129
133
  >{{
130
134
  $t(
@@ -137,6 +141,7 @@
137
141
  <v-btn
138
142
  :disabled="disableButtons"
139
143
  color="primary"
144
+ elevation="0"
140
145
  outlined
141
146
  @click="onRevealAnswer"
142
147
  >{{
@@ -188,6 +188,7 @@
188
188
  <v-row justify="center" class="my-4">
189
189
  <v-btn
190
190
  color="primary"
191
+ elevation="0"
191
192
  :disabled="render"
192
193
  @click="onAddBucketAnswer(index)"
193
194
  >
@@ -206,6 +207,7 @@
206
207
  <v-row justify="center" class="my-4">
207
208
  <v-btn
208
209
  color="primary"
210
+ elevation="0"
209
211
  :disabled="render"
210
212
  @click="onAddBucket"
211
213
  >
@@ -450,7 +452,9 @@ export default {
450
452
  })
451
453
  },
452
454
  stripHtml(htmlString) {
453
- return htmlString.replace(/(<([^>]+)>)/gi, '')
455
+ if (htmlString) {
456
+ return htmlString.replace(/(<([^>]+)>)/gi, '')
457
+ }
454
458
  },
455
459
  },
456
460
  }
@@ -102,6 +102,7 @@
102
102
  <v-row justify="center" class="my-4">
103
103
  <v-btn
104
104
  color="primary"
105
+ elevation="0"
105
106
  :disabled="render"
106
107
  @click="onAddElement"
107
108
  >