@windward/games 0.5.1 → 0.7.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 (56) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/bitbucket-pipelines.yml +14 -0
  3. package/components/content/blocks/dragDrop/BucketGame.vue +24 -8
  4. package/components/content/blocks/flashcards/CardFace.vue +3 -3
  5. package/components/content/blocks/matchingGame/MatchingGame.vue +30 -38
  6. package/components/content/blocks/sevenStrikes/SevenStikes.vue +2 -6
  7. package/components/content/blocks/wordJumble/WordJumble.vue +9 -8
  8. package/components/settings/BucketGameSettingsManager.vue +253 -243
  9. package/components/settings/CrosswordPuzzleSettingsManager.vue +164 -111
  10. package/components/settings/FlashCardSlidesManager.vue +337 -336
  11. package/components/settings/MatchingGameManager.vue +347 -323
  12. package/components/settings/MultipleChoiceSettingsManager.vue +100 -69
  13. package/components/settings/QuizShowSettingsManager.vue +223 -203
  14. package/components/settings/SevenStrikesSettingsManager.vue +173 -133
  15. package/components/settings/SlideShowManager.vue +174 -134
  16. package/components/settings/SortingGameSettingsManager.vue +157 -108
  17. package/components/settings/WordJumbleSettingsManager.vue +171 -135
  18. package/i18n/en-US/components/content/blocks/bucket_game.ts +1 -0
  19. package/i18n/en-US/components/content/blocks/flashcard.ts +2 -2
  20. package/i18n/en-US/components/content/blocks/quizshow_game.ts +1 -1
  21. package/i18n/en-US/components/settings/bucket_game.ts +2 -1
  22. package/i18n/en-US/components/settings/crossword.ts +1 -0
  23. package/i18n/en-US/components/settings/flashcard.ts +2 -1
  24. package/i18n/en-US/components/settings/matching_game.ts +1 -0
  25. package/i18n/en-US/components/settings/multiple_choice.ts +1 -0
  26. package/i18n/en-US/components/settings/quizshow_game.ts +1 -1
  27. package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
  28. package/i18n/en-US/components/settings/slideshow.ts +3 -2
  29. package/i18n/en-US/components/settings/sorting_game.ts +1 -0
  30. package/i18n/en-US/components/settings/word_jumble.ts +1 -0
  31. package/i18n/en-US/shared/settings.ts +3 -0
  32. package/i18n/es-ES/components/content/blocks/bucket_game.ts +1 -0
  33. package/i18n/es-ES/components/settings/bucket_game.ts +3 -1
  34. package/i18n/es-ES/components/settings/crossword.ts +2 -0
  35. package/i18n/es-ES/components/settings/flashcard.ts +1 -0
  36. package/i18n/es-ES/components/settings/matching_game.ts +1 -0
  37. package/i18n/es-ES/components/settings/multiple_choice.ts +2 -0
  38. package/i18n/es-ES/components/settings/quizshow_game.ts +1 -1
  39. package/i18n/es-ES/components/settings/slideshow.ts +1 -0
  40. package/i18n/es-ES/components/settings/sorting_game.ts +1 -0
  41. package/i18n/es-ES/components/settings/word_jumble.ts +1 -0
  42. package/i18n/es-ES/shared/settings.ts +3 -0
  43. package/i18n/sv-SE/components/content/blocks/bucket_game.ts +1 -0
  44. package/i18n/sv-SE/components/content/blocks/quizshow_game.ts +1 -1
  45. package/i18n/sv-SE/components/settings/bucket_game.ts +2 -0
  46. package/i18n/sv-SE/components/settings/crossword.ts +1 -0
  47. package/i18n/sv-SE/components/settings/flashcard.ts +1 -0
  48. package/i18n/sv-SE/components/settings/matching_game.ts +1 -0
  49. package/i18n/sv-SE/components/settings/multiple_choice.ts +1 -0
  50. package/i18n/sv-SE/components/settings/quizshow_game.ts +1 -1
  51. package/i18n/sv-SE/components/settings/slideshow.ts +1 -0
  52. package/i18n/sv-SE/components/settings/sorting_game.ts +1 -0
  53. package/i18n/sv-SE/components/settings/word_jumble.ts +2 -1
  54. package/i18n/sv-SE/shared/content_blocks.ts +5 -5
  55. package/i18n/sv-SE/shared/settings.ts +8 -5
  56. package/package.json +1 -1
@@ -1,122 +1,118 @@
1
1
  <template>
2
2
  <div>
3
- <v-form ref="form" v-model="valid" v-if="!loading">
4
- <v-container class="pa-0">
5
- <v-text-field
6
- ref="title"
7
- v-model="block.metadata.config.title"
8
- :counter="50"
9
- outlined
10
- :autofocus="true"
11
- :label="
12
- $t(
13
- 'windward.games.components.settings.bucket_game.form.title'
14
- )
15
- "
16
- :disabled="render"
17
- ></v-text-field>
18
- <v-textarea
19
- outlined
20
- auto-grow
21
- v-model="block.metadata.config.instructions"
22
- :counter="255"
23
- :label="
24
- $t(
25
- 'windward.games.components.settings.bucket_game.form.instructions'
26
- )
27
- "
28
- :disabled="render"
29
- ></v-textarea>
30
- </v-container>
31
- <v-divider class="my-4 primary"></v-divider>
32
- <v-container class="pa-0">
33
- <p class="mb-0">
34
- {{
35
- $t(
36
- 'windward.games.components.settings.crossword.crossword_items'
37
- )
38
- }}
39
- </p>
40
- <p class="p-label-crosswords">
3
+ <v-container class="pa-0">
4
+ <v-text-field
5
+ ref="title"
6
+ v-model="block.metadata.config.title"
7
+ :counter="50"
8
+ :rules="validation.titleRule"
9
+ outlined
10
+ :autofocus="true"
11
+ :label="
12
+ $t(
13
+ 'windward.games.components.settings.bucket_game.form.title'
14
+ )
15
+ "
16
+ :disabled="render"
17
+ ></v-text-field>
18
+ <v-textarea
19
+ outlined
20
+ auto-grow
21
+ v-model="block.metadata.config.instructions"
22
+ :rules="validation.instructionRule"
23
+ :counter="255"
24
+ :label="
25
+ $t(
26
+ 'windward.games.components.settings.bucket_game.form.instructions'
27
+ )
28
+ "
29
+ :disabled="render"
30
+ ></v-textarea>
31
+ </v-container>
32
+ <v-divider class="my-4 primary"></v-divider>
33
+ <v-container class="pa-0">
34
+ <p class="mb-0">
35
+ {{
36
+ $t(
37
+ 'windward.games.components.settings.crossword.crossword_items'
38
+ )
39
+ }}
40
+ </p>
41
+ <p class="p-label-crosswords">
42
+ {{
43
+ $t(
44
+ 'windward.games.components.settings.crossword.min_length'
45
+ )
46
+ }}
47
+ </p>
48
+ <SortableExpansionPanel
49
+ v-model="block.metadata.config.words"
50
+ :disabled="render"
51
+ @click:close="onDelete($event)"
52
+ >
53
+ <template #header="{ item, index }">
41
54
  {{
42
- $t(
43
- 'windward.games.components.settings.crossword.min_length'
44
- )
55
+ item.word !== ''
56
+ ? item.word
57
+ : $t(
58
+ 'windward.games.components.settings.bucket_game.form.enter_text'
59
+ )
45
60
  }}
46
- </p>
47
- <SortableExpansionPanel
48
- v-model="block.metadata.config.words"
49
- :disabled="render"
50
- @click:close="onDelete($event)"
51
- >
52
- <template #header="{ item, index }">
53
- {{
54
- item.word !== ''
55
- ? item.word
56
- : $t(
57
- 'windward.games.components.settings.bucket_game.form.enter_text'
58
- )
59
- }}
60
- </template>
61
- <template #body="{ item, index }">
62
- <v-container>
63
- <p class="p-label mb-0">
64
- {{
65
- $t(
66
- 'windward.games.components.settings.crossword.word'
67
- )
68
- }}
69
- </p>
70
- <v-textarea
71
- v-model="
72
- block.metadata.config.words[index].word
73
- "
74
- outlined
75
- :counter="20"
76
- maxlength="20"
77
- :autofocus="true"
78
- class="pt-4"
79
- :disabled="render"
80
- ></v-textarea>
81
- <p class="p-label mb-0">
82
- {{
83
- $t(
84
- 'windward.games.components.settings.crossword.clue'
85
- )
86
- }}
87
- </p>
88
- <v-textarea
89
- v-model="
90
- block.metadata.config.words[index].clue
91
- "
92
- outlined
93
- :counter="155"
94
- maxlength="155"
95
- class="pt-4"
96
- :disabled="render"
97
- ></v-textarea>
98
- </v-container>
99
- </template>
100
- </SortableExpansionPanel>
101
- <v-container class="pa-0">
102
- <v-row justify="center" class="my-4">
103
- <v-btn
104
- color="primary"
105
- elevation="0"
61
+ </template>
62
+ <template #body="{ item, index }">
63
+ <v-container>
64
+ <p class="p-label mb-0">
65
+ {{
66
+ $t(
67
+ 'windward.games.components.settings.crossword.word'
68
+ )
69
+ }}
70
+ </p>
71
+ <v-text-field
72
+ v-model="block.metadata.config.words[index].word"
73
+ outlined
74
+ :counter="20"
75
+ :rules="validation.wordRule"
76
+ :autofocus="true"
77
+ class="pt-4"
106
78
  :disabled="render"
107
- @click="onAddElement"
108
- >
109
- <v-icon>mdi-plus</v-icon>
79
+ ></v-text-field>
80
+ <p class="p-label mb-0">
110
81
  {{
111
82
  $t(
112
- 'windward.games.components.settings.bucket_game.form.add_answer'
83
+ 'windward.games.components.settings.crossword.clue'
113
84
  )
114
85
  }}
115
- </v-btn>
116
- </v-row>
117
- </v-container>
86
+ </p>
87
+ <v-textarea
88
+ v-model="block.metadata.config.words[index].clue"
89
+ outlined
90
+ :counter="155"
91
+ :rules="validation.clueRule"
92
+ class="pt-4"
93
+ :disabled="render"
94
+ ></v-textarea>
95
+ </v-container>
96
+ </template>
97
+ </SortableExpansionPanel>
98
+ <v-container class="pa-0">
99
+ <v-row justify="center" class="my-4">
100
+ <v-btn
101
+ color="primary"
102
+ elevation="0"
103
+ :disabled="render"
104
+ @click="onAddElement"
105
+ >
106
+ <v-icon>mdi-plus</v-icon>
107
+ {{
108
+ $t(
109
+ 'windward.games.components.settings.bucket_game.form.add_answer'
110
+ )
111
+ }}
112
+ </v-btn>
113
+ </v-row>
118
114
  </v-container>
119
- </v-form>
115
+ </v-container>
120
116
  <div v-if="loading" class="text-center">
121
117
  <v-progress-circular
122
118
  :size="70"
@@ -132,6 +128,7 @@
132
128
  import _ from 'lodash'
133
129
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
134
130
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
131
+ import Uuid from '~/helpers/Uuid'
135
132
 
136
133
  export default {
137
134
  name: 'CrosswordPuzzleSettingsManager',
@@ -152,8 +149,14 @@ export default {
152
149
  'windward.games.components.content.blocks.crossword.crossword'
153
150
  )
154
151
  }
155
- if (_.isEmpty(this.block.metadata.config.instructions)) {
156
- this.block.metadata.config.instructions = ''
152
+ if (
153
+ _.isEmpty(this.block.metadata.config.instructions) &&
154
+ this.block.id &&
155
+ !Uuid.test(this.block.id)
156
+ ) {
157
+ this.block.metadata.config.instructions = this.$t(
158
+ 'windward.games.components.settings.crossword.instructions'
159
+ )
157
160
  }
158
161
  if (_.isEmpty(this.block.metadata.config.words)) {
159
162
  this.block.metadata.config.words = []
@@ -174,6 +177,56 @@ export default {
174
177
  return {
175
178
  valid: true,
176
179
  loading: false,
180
+ validation: {
181
+ titleRule: [
182
+ (v) => {
183
+ if (v && v.length >= 50) {
184
+ return this.$t(
185
+ 'windward.games.shared.settings.errors.input_limitations',
186
+ [50]
187
+ )
188
+ } else {
189
+ return true
190
+ }
191
+ },
192
+ ],
193
+ instructionRule: [
194
+ (v) => {
195
+ if (v && v.length >= 255) {
196
+ return this.$t(
197
+ 'windward.games.shared.settings.errors.input_limitations',
198
+ [255]
199
+ )
200
+ } else {
201
+ return true
202
+ }
203
+ },
204
+ ],
205
+ wordRule: [
206
+ (v) => {
207
+ if (v && v.length >= 20) {
208
+ return this.$t(
209
+ 'windward.games.shared.settings.errors.input_limitations',
210
+ [20]
211
+ )
212
+ } else {
213
+ return true
214
+ }
215
+ },
216
+ ],
217
+ clueRule: [
218
+ (v) => {
219
+ if (v && v.length >= 155) {
220
+ return this.$t(
221
+ 'windward.games.shared.settings.errors.input_limitations',
222
+ [155]
223
+ )
224
+ } else {
225
+ return true
226
+ }
227
+ },
228
+ ],
229
+ },
177
230
  }
178
231
  },
179
232
  methods: {