@windward/games 0.17.1 → 0.18.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 (26) hide show
  1. package/CHANGELOG.md +3 -13
  2. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +11 -2
  3. package/components/content/blocks/dragDrop/BucketGame.vue +7 -1
  4. package/components/content/blocks/dragDrop/SortingGame.vue +10 -1
  5. package/components/content/blocks/flashcards/CardFace.vue +15 -11
  6. package/components/content/blocks/flashcards/Flashcard.vue +0 -3
  7. package/components/content/blocks/flashcards/FlashcardSlides.vue +54 -6
  8. package/components/content/blocks/matchingGame/MatchingGame.vue +7 -1
  9. package/components/content/blocks/multipleChoice/MultipleChoice.vue +10 -1
  10. package/components/content/blocks/quizshowGame/QuizShow.vue +7 -0
  11. package/components/content/blocks/sevenStrikes/SevenStikes.vue +9 -1
  12. package/components/content/blocks/slideshow/SlideShow.vue +7 -2
  13. package/components/content/blocks/wordJumble/WordJumble.vue +9 -1
  14. package/components/settings/BucketGameSettingsManager.vue +8 -28
  15. package/components/settings/CrosswordPuzzleSettingsManager.vue +8 -29
  16. package/components/settings/FlashCardSlidesManager.vue +8 -27
  17. package/components/settings/MatchingGameManager.vue +12 -29
  18. package/components/settings/MultipleChoiceSettingsManager.vue +13 -28
  19. package/components/settings/QuizShowSettingsManager.vue +11 -28
  20. package/components/settings/SevenStrikesSettingsManager.vue +13 -29
  21. package/components/settings/SlideShowManager.vue +8 -26
  22. package/components/settings/SortingGameSettingsManager.vue +8 -29
  23. package/components/settings/WordJumbleSettingsManager.vue +8 -28
  24. package/package.json +1 -1
  25. package/test/blocks/crossword/CrosswordPuzzle.spec.js +0 -21
  26. package/test/blocks/dragDrop/SortingGame.spec.js +0 -21
package/CHANGELOG.md CHANGED
@@ -1,41 +1,31 @@
1
1
  # Changelog
2
2
 
3
- ### Hotfix [0.17.1] created - 2025-05-21
3
+ ### Release [0.18.0] created - 2025-05-20
4
4
 
5
+ ### Hotfix [0.17.1] created - 2025-05-21
5
6
 
6
7
  ### Release [0.17.0] created - 2025-05-13
7
8
 
8
-
9
9
  ### Release [0.16.0] created - 2025-04-29
10
10
 
11
-
12
11
  ### Release [0.15.0] created - 2025-04-09
13
12
 
14
-
15
13
  ### Release [0.14.0] created - 2025-03-25
16
14
 
17
-
18
15
  ### Release [0.13.0] created - 2025-03-11
19
16
 
20
-
21
17
  ### Hotfix [0.12.1] created - 2025-02-20
22
18
 
23
-
24
19
  ### Release [0.12.0] created - 2025-02-18
25
20
 
26
-
27
21
  ### Release [0.11.0] created - 2025-02-05
28
22
 
29
-
30
23
  ### Release [0.10.0] created - 2025-01-03
31
24
 
32
-
33
25
  ## Release [0.7.0] - 2024-08-29
34
26
 
35
- * Version bump to 0.7.0
36
-
27
+ - Version bump to 0.7.0
37
28
 
38
29
  ### Release [0.7.0] created - 2024-08-29
39
30
 
40
-
41
31
  ### Release [0.6.0] created - 2024-07-30
@@ -1,7 +1,13 @@
1
1
  <template>
2
2
  <v-container class="pa-0">
3
3
  <div>
4
- <h2 v-if="block.metadata.config.title" tabindex="0">
4
+ <h2
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
9
+ tabindex="0"
10
+ >
5
11
  {{ block.metadata.config.title }}
6
12
  </h2>
7
13
  <p
@@ -117,9 +123,9 @@
117
123
  </template>
118
124
 
119
125
  <script>
126
+ import _ from 'lodash'
120
127
  import { Crossword } from './Crossword'
121
128
  import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
122
- import _ from 'lodash'
123
129
  import Crypto from '~/helpers/Crypto'
124
130
  import CrosswordClues from './CrosswordClues.vue'
125
131
 
@@ -144,6 +150,9 @@ export default {
144
150
  'windward.games.components.content.blocks.crossword.crossword'
145
151
  )
146
152
  }
153
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
154
+ this.$set(this.block.metadata.config, 'display_title', true)
155
+ }
147
156
  if (_.isEmpty(this.block.metadata.config.instructions)) {
148
157
  this.block.metadata.config.instructions = ''
149
158
  }
@@ -2,7 +2,10 @@
2
2
  <div>
3
3
  <div>
4
4
  <h2
5
- v-if="block.metadata.config.title"
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
6
9
  :aria-label="
7
10
  $t(
8
11
  'windward.games.components.content.blocks.bucket_game.aria_title'
@@ -339,6 +342,9 @@ export default {
339
342
  'windward.games.components.content.blocks.bucket_game.game_title'
340
343
  )
341
344
  }
345
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
346
+ this.$set(this.block.metadata.config, 'display_title', true)
347
+ }
342
348
  if (_.isEmpty(this.block.metadata.config.instructions)) {
343
349
  this.block.metadata.config.instructions = ''
344
350
  }
@@ -1,6 +1,12 @@
1
1
  <template>
2
2
  <div>
3
- <h2 v-if="block.metadata.config.title" tabindex="0">
3
+ <h2
4
+ v-if="
5
+ block.metadata.config.title &&
6
+ block.metadata.config.display_title
7
+ "
8
+ tabindex="0"
9
+ >
4
10
  {{ block.metadata.config.title }}
5
11
  </h2>
6
12
  <p v-if="block.metadata.config.instructions" tabindex="0" class="pt-3">
@@ -149,6 +155,9 @@ export default {
149
155
  'windward.games.components.settings.sorting_game.sortable_game'
150
156
  )
151
157
  }
158
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
159
+ this.$set(this.block.metadata.config, 'display_title', true)
160
+ }
152
161
  if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
153
162
  this.block.metadata.config.feedback_correct = this.$t(
154
163
  'windward.games.components.settings.sorting_game.default_feedback_correct'
@@ -2,8 +2,10 @@
2
2
  <v-container
3
3
  class="fill-height d-flex flex-column align-center justify-center"
4
4
  >
5
- <div class="card-content">
6
- <v-row class="justify-center">
5
+ <div class="card-content d-flex align-center">
6
+ <v-row
7
+ class="d-flex align-center justify-center content-scroll-wrapper"
8
+ >
7
9
  <content-viewer :class="textClass" v-model="settings.text" />
8
10
  </v-row>
9
11
  <v-row
@@ -22,7 +24,7 @@
22
24
  </v-col>
23
25
  </v-row>
24
26
  </div>
25
- <v-row class="card-footer pt-4" align="center" justify="center">
27
+ <v-row class="card-footer mt-2">
26
28
  {{ settings.footer }}&nbsp;
27
29
  <v-icon color="primary">mdi-orbit-variant</v-icon>
28
30
  </v-row>
@@ -95,6 +97,9 @@ export default {
95
97
  color: var(--v-primary-base);
96
98
  font-size: 1rem;
97
99
  max-height: 100%;
100
+ min-height: 300px;
101
+ min-width: 100%;
102
+ flex-direction: column;
98
103
  }
99
104
  .card-content--bold {
100
105
  font-weight: bold;
@@ -106,6 +111,8 @@ p.card-content {
106
111
  }
107
112
  .card-footer {
108
113
  font-weight: bold;
114
+ position: absolute;
115
+ top: 90%;
109
116
  color: var(--v-primary-base);
110
117
  }
111
118
  .centered {
@@ -115,15 +122,12 @@ p.card-content {
115
122
  left: 50%;
116
123
  transform: translate(-50%, -50%);
117
124
  }
118
- .card-footer {
119
- margin: 0;
120
- position: absolute;
121
- top: 90%;
122
- left: 50%;
123
- transform: translate(-50%, -50%);
124
- color: var(--v-primary-base);
125
- }
126
125
  .paragraph {
127
126
  margin: 5%;
128
127
  }
128
+ .content-scroll-wrapper {
129
+ max-height: 100%;
130
+ overflow-y: auto;
131
+ width: 100%;
132
+ }
129
133
  </style>
@@ -65,7 +65,6 @@ export default {
65
65
  slide: { type: Number, required: true, default: 0 },
66
66
  assets: { type: Array, required: true },
67
67
  },
68
-
69
68
  computed: {
70
69
  cardClass() {
71
70
  let result = 'animated flashcard'
@@ -117,7 +116,6 @@ export default {
117
116
  toggleCard() {
118
117
  //only flip card when user click
119
118
  this.flip = true
120
- //this.cardClass = 'animated flipInY flashcard flashcard--size-md'
121
119
  this.$emit('input', !this.side)
122
120
  this.side = !this.side
123
121
  // update container with correct side
@@ -214,7 +212,6 @@ export default {
214
212
 
215
213
  .flashcard:hover {
216
214
  box-shadow: 0 0px 12px rgba(0, 0, 0, 0.8);
217
- background-color: var(--v-background-darken1);
218
215
  }
219
216
 
220
217
  .animated {
@@ -1,6 +1,12 @@
1
1
  <template>
2
2
  <div>
3
- <h2 v-if="block.metadata.config.title" tabindex="0">
3
+ <h2
4
+ v-if="
5
+ block.metadata.config.title &&
6
+ block.metadata.config.display_title
7
+ "
8
+ tabindex="0"
9
+ >
4
10
  {{ block.metadata.config.title }}
5
11
  </h2>
6
12
 
@@ -12,7 +18,7 @@
12
18
  <template #prev="{ on, attrs }">
13
19
  <v-btn
14
20
  variant="elevated"
15
- color="primary"
21
+ :color="styleForText"
16
22
  elevation="0"
17
23
  outlined
18
24
  fab
@@ -25,7 +31,7 @@
25
31
  <template #next="{ on, attrs }">
26
32
  <v-btn
27
33
  variant="elevated"
28
- color="primary"
34
+ :color="styleForText"
29
35
  elevation="0"
30
36
  outlined
31
37
  fab
@@ -39,7 +45,11 @@
39
45
  v-for="(card, index) in block.metadata.config.cards"
40
46
  :key="index"
41
47
  >
42
- <v-sheet height="90%" tile>
48
+ <v-sheet
49
+ height="90%"
50
+ tile
51
+ :style="setBackgroundInCaseHighlight()"
52
+ >
43
53
  <Flashcard
44
54
  :options="card"
45
55
  :slide="currentSlide"
@@ -47,14 +57,17 @@
47
57
  :assets="block.assets"
48
58
  />
49
59
  </v-sheet>
50
- <div class="d-flex justify-end">
60
+ <v-container
61
+ class="d-flex justify-end"
62
+ :style="setTextColorInCaseHighlight()"
63
+ >
51
64
  {{
52
65
  $t('windward.games.shared.content_blocks.out_of', [
53
66
  index + 1,
54
67
  block.metadata.config.cards.length,
55
68
  ])
56
69
  }}
57
- </div>
70
+ </v-container>
58
71
  </v-carousel-item>
59
72
  </v-carousel>
60
73
  </div>
@@ -94,6 +107,9 @@ export default {
94
107
  )
95
108
  this.block.metadata.config.instructions = ''
96
109
  }
110
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
111
+ this.$set(this.block.metadata.config, 'display_title', true)
112
+ }
97
113
  if (_.isEmpty(this.block.assets)) {
98
114
  this.block.assets = []
99
115
  }
@@ -109,11 +125,43 @@ export default {
109
125
  }
110
126
  return 0
111
127
  },
128
+ styleForText() {
129
+ // if highlight is set, use black instead of primary
130
+ if (
131
+ this.block.metadata.display.setHighlight &&
132
+ this.block.metadata.display.highlight
133
+ ) {
134
+ return 'black'
135
+ } else {
136
+ return 'primary'
137
+ }
138
+ },
112
139
  },
113
140
  methods: {
114
141
  onActionPanelEdit() {
115
142
  this.render = !this.render
116
143
  },
144
+ setBackgroundInCaseHighlight() {
145
+ let style = ''
146
+ if (
147
+ !_.isEmpty(this.block.metadata.display) &&
148
+ !_.isEmpty(this.block.metadata.display.highlight)
149
+ ) {
150
+ style =
151
+ 'background-color: ' + this.block.metadata.display.highlight
152
+ }
153
+ return style
154
+ },
155
+ setTextColorInCaseHighlight() {
156
+ let style = ''
157
+ if (
158
+ !_.isEmpty(this.block.metadata.display) &&
159
+ !_.isEmpty(this.block.metadata.display.highlight)
160
+ ) {
161
+ style = 'color: black'
162
+ }
163
+ return style
164
+ },
117
165
  },
118
166
  }
119
167
  </script>
@@ -2,7 +2,10 @@
2
2
  <div>
3
3
  <div>
4
4
  <h2
5
- v-if="block.metadata.config.title"
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
6
9
  :aria-label="
7
10
  $t(
8
11
  'windward.games.components.content.blocks.matching_game.match_game_title'
@@ -332,6 +335,9 @@ export default {
332
335
  'windward.games.components.settings.matching_game.form.title'
333
336
  )
334
337
  }
338
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
339
+ this.$set(this.block.metadata.config, 'display_title', true)
340
+ }
335
341
  if (_.isEmpty(this.block.metadata.config.instructions)) {
336
342
  this.block.metadata.config.instructions = ''
337
343
  }
@@ -2,7 +2,13 @@
2
2
  <v-container class="pa-0">
3
3
  <v-row>
4
4
  <v-col>
5
- <h2 v-if="block.metadata.config.title" tabindex="0">
5
+ <h2
6
+ v-if="
7
+ block.metadata.config.title &&
8
+ block.metadata.config.display_title
9
+ "
10
+ tabindex="0"
11
+ >
6
12
  {{ block.metadata.config.title }}
7
13
  </h2>
8
14
  <p
@@ -255,6 +261,9 @@ export default {
255
261
  'windward.games.components.content.blocks.multiple_choice.game_title'
256
262
  )
257
263
  }
264
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
265
+ this.$set(this.block.metadata.config, 'display_title', true)
266
+ }
258
267
  if (_.isEmpty(this.block.metadata.config.instructions)) {
259
268
  this.block.metadata.config.instructions = ''
260
269
  }
@@ -13,6 +13,10 @@
13
13
  <div v-if="!tableMode">
14
14
  <div>
15
15
  <h2
16
+ v-if="
17
+ block.metadata.config.title &&
18
+ block.metadata.config.display_title
19
+ "
16
20
  :aria-label="
17
21
  $t(
18
22
  'windward.games.components.content.blocks.quizshow_game.title'
@@ -231,6 +235,9 @@ export default {
231
235
  if (this.answerStates.length === 0) {
232
236
  this.initAnswersStates()
233
237
  }
238
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
239
+ this.$set(this.block.metadata.config, 'display_title', true)
240
+ }
234
241
  },
235
242
  mounted() {},
236
243
  updated() {},
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-col class="pa-0">
4
- <h2>
4
+ <h2
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
9
+ >
5
10
  {{
6
11
  block.metadata.config.title
7
12
  ? block.metadata.config.title
@@ -253,6 +258,9 @@ export default {
253
258
  'windward.games.components.settings.seven_strikes.title'
254
259
  )
255
260
  }
261
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
262
+ this.$set(this.block.metadata.config, 'display_title', true)
263
+ }
256
264
  if (_.isEmpty(this.block.metadata.config.instructions)) {
257
265
  this.block.metadata.config.instructions = this.$t(
258
266
  'windward.games.components.settings.seven_strikes.instructions'
@@ -2,7 +2,10 @@
2
2
  <div>
3
3
  <div>
4
4
  <h2
5
- v-if="block.metadata.config.title"
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
6
9
  :aria-label="
7
10
  $t(
8
11
  'windward.games.components.content.blocks.slideshow.slideshow_title'
@@ -128,7 +131,9 @@ export default {
128
131
  'windward.games.components.settings.slideshow.form.slideshow_title'
129
132
  )
130
133
  }
131
-
134
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
135
+ this.$set(this.block.metadata.config, 'display_title', true)
136
+ }
132
137
  if (_.isEmpty(this.block.metadata.config.instructions)) {
133
138
  this.block.metadata.config.instructions = ''
134
139
  }
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <v-container class="pa-0">
3
3
  <v-col class="pa-0">
4
- <h2>
4
+ <h2
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
9
+ >
5
10
  {{
6
11
  block.metadata.config.title
7
12
  ? block.metadata.config.title
@@ -211,6 +216,9 @@ export default {
211
216
  'windward.games.components.settings.word_jumble.title'
212
217
  )
213
218
  }
219
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
220
+ this.$set(this.block.metadata.config, 'display_title', true)
221
+ }
214
222
  if (
215
223
  _.isEmpty(this.block.metadata.config.instructions) &&
216
224
  this.block.id &&
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :autofocus="true"
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.bucket_game.form.title'
15
- )
16
- "
17
- :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- outlined
23
- auto-grow
24
- :rules="$Validation.getRule('block.instructions')"
25
- :counter="$Validation.getLimit('block.instructions')"
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.bucket_game.form.instructions'
29
- )
30
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
31
6
  :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -230,6 +205,7 @@ import {
230
205
  } from '@windward/core/utils'
231
206
  import colors from 'vuetify/lib/util/colors'
232
207
  import TextEditor from '~/components/Text/TextEditor'
208
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
233
209
  import Crypto from '~/helpers/Crypto'
234
210
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
235
211
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
@@ -243,6 +219,7 @@ export default {
243
219
  MathLiveWrapper,
244
220
  ContentViewer,
245
221
  SortableExpansionPanel,
222
+ BaseContentBlockSettings,
246
223
  TextEditor,
247
224
  },
248
225
  beforeMount() {
@@ -264,6 +241,9 @@ export default {
264
241
  'windward.games.components.content.blocks.bucket_game.game_title'
265
242
  )
266
243
  }
244
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
245
+ this.$set(this.block.metadata.config, 'display_title', true)
246
+ }
267
247
  if (
268
248
  _.isEmpty(this.block.metadata.config.instructions) &&
269
249
  this.block.id &&
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :autofocus="true"
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.bucket_game.form.title'
15
- )
16
- "
17
- :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- outlined
22
- auto-grow
23
- v-model="block.metadata.config.instructions"
24
- :rules="$Validation.getRule('block.instructions')"
25
- :counter="$Validation.getLimit('block.instructions')"
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.bucket_game.form.instructions'
29
- )
30
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
31
6
  :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -128,6 +103,7 @@
128
103
 
129
104
  <script>
130
105
  import _ from 'lodash'
106
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
131
107
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
132
108
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
133
109
  import Uuid from '~/helpers/Uuid'
@@ -135,7 +111,7 @@ import Uuid from '~/helpers/Uuid'
135
111
  export default {
136
112
  name: 'CrosswordPuzzleSettingsManager',
137
113
  extends: BaseContentSettings,
138
- components: { SortableExpansionPanel },
114
+ components: { SortableExpansionPanel, BaseContentBlockSettings },
139
115
  beforeMount() {
140
116
  if (_.isEmpty(this.block)) {
141
117
  this.block = {}
@@ -151,6 +127,9 @@ export default {
151
127
  'windward.games.components.content.blocks.crossword.crossword'
152
128
  )
153
129
  }
130
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
131
+ this.$set(this.block.metadata.config, 'display_title', true)
132
+ }
154
133
  if (
155
134
  _.isEmpty(this.block.metadata.config.instructions) &&
156
135
  this.block.id &&
@@ -1,34 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
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
- id="block-settings-instructions"
20
- v-model="block.metadata.config.instructions"
21
- :rules="$Validation.getRule('block.instructions')"
22
- :counter="$Validation.getLimit('block.instructions')"
23
- outlined
24
- auto-grow
25
- :label="
26
- $t(
27
- 'windward.games.components.settings.bucket_game.form.instructions'
28
- )
29
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
30
6
  :disabled="render"
31
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
32
8
  </v-container>
33
9
  <v-divider class="my-4 primary"></v-divider>
34
10
  <v-container class="pa-0">
@@ -308,6 +284,7 @@ import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
308
284
  import TextEditor from '~/components/Text/TextEditor.vue'
309
285
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
310
286
  import Uuid from '~/helpers/Uuid'
287
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
311
288
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
312
289
 
313
290
  export default {
@@ -320,6 +297,7 @@ export default {
320
297
  ContentBlockAsset,
321
298
  TextEditor,
322
299
  SortableExpansionPanel,
300
+ BaseContentBlockSettings,
323
301
  ImageAssetSettings,
324
302
  GenerateAIQuestionButton,
325
303
  },
@@ -345,6 +323,9 @@ export default {
345
323
  'windward.games.components.content.blocks.flashcard.title'
346
324
  )
347
325
  }
326
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
327
+ this.$set(this.block.metadata.config, 'display_title', true)
328
+ }
348
329
  if (
349
330
  _.isEmpty(this.block.metadata.config.instructions) &&
350
331
  this.block.id &&
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- :autofocus="true"
11
- outlined
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.matching_game.form.title'
15
- )
16
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
17
6
  :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- outlined
25
- auto-grow
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.matching_game.form.instructions'
29
- )
30
- "
31
- :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -279,6 +254,7 @@
279
254
  <script>
280
255
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
281
256
  import _ from 'lodash'
257
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
282
258
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
283
259
  import Uuid from '~/helpers/Uuid'
284
260
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
@@ -286,7 +262,11 @@ import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings
286
262
  export default {
287
263
  name: 'MatchingGameManager',
288
264
  extends: BaseContentSettings,
289
- components: { SortableExpansionPanel, ImageAssetSettings },
265
+ components: {
266
+ SortableExpansionPanel,
267
+ ImageAssetSettings,
268
+ BaseContentBlockSettings,
269
+ },
290
270
  beforeMount() {
291
271
  if (_.isEmpty(this.block)) {
292
272
  this.block = {}
@@ -307,6 +287,9 @@ export default {
307
287
  'windward.games.components.settings.matching_game.form.title'
308
288
  )
309
289
  }
290
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
291
+ this.$set(this.block.metadata.config, 'display_title', true)
292
+ }
310
293
  if (
311
294
  _.isEmpty(this.block.metadata.config.instructions) &&
312
295
  this.block.id &&
@@ -1,34 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- id="block-settings-title"
6
- v-model="block.metadata.config.title"
7
- outlined
8
- :autofocus="true"
9
- :rules="$Validation.getRule('block.title')"
10
- :counter="$Validation.getLimit('block.title')"
11
- :label="
12
- $t(
13
- 'windward.games.components.settings.multiple_choice.title_placeholder'
14
- )
15
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
16
6
  :disabled="render"
17
- ></v-text-field>
18
- <v-textarea
19
- id="block-settings-instructions"
20
- v-model="block.metadata.config.instructions"
21
- outlined
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- auto-grow
25
- :label="
26
- $t(
27
- 'windward.games.components.settings.multiple_choice.instructions'
28
- )
29
- "
30
- :disabled="render"
31
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
32
8
  </v-container>
33
9
  <v-divider class="my-4 primary"></v-divider>
34
10
  <v-container class="pa-0">
@@ -116,12 +92,18 @@ import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue
116
92
  import DialogBox from '~/components/Core/DialogBox.vue'
117
93
  import QuestionDialog from '../content/blocks/multipleChoice/QuestionDialog.vue'
118
94
  import Crypto from '~/helpers/Crypto'
95
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
119
96
  import Uuid from '~/helpers/Uuid'
120
97
 
121
98
  export default {
122
99
  name: 'MultipleChoiceSettingsManager',
123
100
  extends: BaseContentSettings,
124
- components: { SortableExpansionPanel, QuestionDialog, DialogBox },
101
+ components: {
102
+ SortableExpansionPanel,
103
+ QuestionDialog,
104
+ DialogBox,
105
+ BaseContentBlockSettings,
106
+ },
125
107
  beforeMount() {
126
108
  if (_.isEmpty(this.block)) {
127
109
  this.block = {}
@@ -137,6 +119,9 @@ export default {
137
119
  'windward.games.components.content.blocks.multiple_choice.game_title'
138
120
  )
139
121
  }
122
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
123
+ this.$set(this.block.metadata.config, 'display_title', true)
124
+ }
140
125
  if (
141
126
  _.isEmpty(this.block.metadata.config.instructions) &&
142
127
  this.block.id &&
@@ -1,18 +1,11 @@
1
1
  <template>
2
2
  <div>
3
- <v-text-field
4
- id="block-settings-title"
5
- v-model="block.metadata.config.title"
6
- :rules="$Validation.getRule('block.title')"
7
- :counter="$Validation.getLimit('block.title')"
8
- outlined
9
- :label="
10
- $t(
11
- 'windward.games.components.settings.quizshow_game.form.title'
12
- )
13
- "
14
- :disabled="render"
15
- ></v-text-field>
3
+ <v-container class="pa-0">
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
6
+ :disabled="render"
7
+ ></BaseContentBlockSettings>
8
+ </v-container>
16
9
  <br />
17
10
  <v-checkbox
18
11
  v-model="block.metadata.config.responsive"
@@ -24,21 +17,6 @@
24
17
  :disabled="render"
25
18
  ></v-checkbox>
26
19
  <br />
27
- <v-textarea
28
- id="block-settings-instructions"
29
- outlined
30
- auto-grow
31
- v-model="block.metadata.config.instructions"
32
- :rules="$Validation.getRule('block.instructions')"
33
- :counter="$Validation.getLimit('block.instructions')"
34
- :label="
35
- $t(
36
- 'windward.games.components.settings.multiple_choice.instructions'
37
- )
38
- "
39
- :disabled="render"
40
- ></v-textarea>
41
- <br />
42
20
  <v-expansion-panels outlined tile flat>
43
21
  <v-divider class="cardOutline primary"></v-divider>
44
22
  <v-expansion-panel>
@@ -221,6 +199,7 @@
221
199
  </template>
222
200
 
223
201
  <script>
202
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
224
203
  import TextEditor from '~/components/Text/TextEditor.vue'
225
204
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
226
205
  export default {
@@ -228,6 +207,7 @@ export default {
228
207
  extends: BaseContentSettings,
229
208
  components: {
230
209
  TextEditor,
210
+ BaseContentBlockSettings,
231
211
  },
232
212
  watch: {
233
213
  'block.metadata.config.maxCategories'(newValue, oldValue) {
@@ -290,6 +270,9 @@ export default {
290
270
  if (_.isEmpty(this.block.metadata.config)) {
291
271
  this.block.metadata.config = _.cloneDeep(this.quizShowSettings)
292
272
  }
273
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
274
+ this.$set(this.block.metadata.config, 'display_title', true)
275
+ }
293
276
  },
294
277
  methods: {
295
278
  changeMaxCategories() {
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :autofocus="true"
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.bucket_game.form.title'
15
- )
16
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
17
6
  :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- outlined
25
- auto-grow
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.bucket_game.form.instructions'
29
- )
30
- "
31
- :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -146,12 +121,18 @@ import draggable from 'vuedraggable'
146
121
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
147
122
  import CrudTable from '../content/CrudTable.vue'
148
123
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
124
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
149
125
  import Uuid from '~/helpers/Uuid'
150
126
 
151
127
  export default {
152
128
  name: 'SevenStrikesSettingsManager',
153
129
  extends: BaseContentSettings,
154
- components: { CrudTable, draggable, SortableExpansionPanel },
130
+ components: {
131
+ CrudTable,
132
+ draggable,
133
+ SortableExpansionPanel,
134
+ BaseContentBlockSettings,
135
+ },
155
136
  beforeMount() {
156
137
  if (_.isEmpty(this.block)) {
157
138
  this.block = {}
@@ -170,6 +151,9 @@ export default {
170
151
  'windward.games.components.settings.seven_strikes.title'
171
152
  )
172
153
  }
154
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
155
+ this.$set(this.block.metadata.config, 'display_title', true)
156
+ }
173
157
  if (
174
158
  _.isEmpty(this.block.metadata.config.instructions) &&
175
159
  this.block.id &&
@@ -1,33 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- id="block-settings-title"
6
- v-model="block.metadata.config.title"
7
- outlined
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- :label="
11
- $t(
12
- 'windward.games.components.settings.slideshow.form.title'
13
- )
14
- "
15
- :disabled="render"
16
- ></v-text-field>
17
- <v-textarea
18
- id="block-settings-instructions"
19
- v-model="block.metadata.config.instructions"
20
- outlined
21
- auto-grow
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- :label="
25
- $t(
26
- 'windward.games.components.settings.slideshow.form.instructions'
27
- )
28
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
29
6
  :disabled="render"
30
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
31
8
  </v-container>
32
9
  <v-divider class="my-4 primary"></v-divider>
33
10
  <v-container class="pa-0">
@@ -128,6 +105,7 @@
128
105
  <script>
129
106
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
130
107
  import _ from 'lodash'
108
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
131
109
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
132
110
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
133
111
  import Uuid from '~/helpers/Uuid'
@@ -138,6 +116,7 @@ export default {
138
116
  components: {
139
117
  ImageAssetSettings,
140
118
  SortableExpansionPanel,
119
+ BaseContentBlockSettings,
141
120
  },
142
121
  beforeMount() {
143
122
  if (_.isEmpty(this.block)) {
@@ -152,6 +131,9 @@ export default {
152
131
  if (_.isEmpty(this.block.metadata.config)) {
153
132
  this.block.metadata.config = {}
154
133
  }
134
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
135
+ this.$set(this.block.metadata.config, 'display_title', true)
136
+ }
155
137
  if (_.isEmpty(this.block.metadata.config.currentSlide)) {
156
138
  this.block.metadata.config.currentSlide = 0
157
139
  }
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- outlined
9
- :autofocus="true"
10
- :rules="$Validation.getRule('block.title')"
11
- :counter="$Validation.getLimit('block.title')"
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.bucket_game.form.title'
15
- )
16
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
17
6
  :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- outlined
23
- auto-grow
24
- :rules="$Validation.getRule('block.instructions')"
25
- :counter="$Validation.getLimit('block.instructions')"
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.bucket_game.form.instructions'
29
- )
30
- "
31
- :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -118,13 +93,14 @@
118
93
  <script>
119
94
  import _ from 'lodash'
120
95
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
96
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
121
97
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
122
98
  import Uuid from '~/helpers/Uuid'
123
99
 
124
100
  export default {
125
101
  name: 'SortingGameSettingsManager',
126
102
  extends: BaseContentSettings,
127
- components: { SortableExpansionPanel },
103
+ components: { SortableExpansionPanel, BaseContentBlockSettings },
128
104
  beforeMount() {
129
105
  if (_.isEmpty(this.block)) {
130
106
  this.block = {}
@@ -140,6 +116,9 @@ export default {
140
116
  'windward.games.components.settings.sorting_game.sortable_game'
141
117
  )
142
118
  }
119
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
120
+ this.$set(this.block.metadata.config, 'display_title', true)
121
+ }
143
122
  if (
144
123
  _.isEmpty(this.block.metadata.config.instructions) &&
145
124
  this.block.id &&
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :autofocus="true"
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.word_jumble.title_input'
15
- )
16
- "
17
- :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- outlined
25
- auto-grow
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.word_jumble.instructions'
29
- )
30
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
31
6
  :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -150,12 +125,14 @@
150
125
  import _ from 'lodash'
151
126
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
152
127
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
128
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
153
129
 
154
130
  export default {
155
131
  name: 'WordJumbleSettings',
156
132
  extends: BaseContentSettings,
157
133
  components: {
158
134
  SortableExpansionPanel,
135
+ BaseContentBlockSettings,
159
136
  },
160
137
  beforeMount() {
161
138
  if (_.isEmpty(this.block)) {
@@ -175,6 +152,9 @@ export default {
175
152
  'windward.games.components.settings.word_jumble.title'
176
153
  )
177
154
  }
155
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
156
+ this.$set(this.block.metadata.config, 'display_title', true)
157
+ }
178
158
  if (_.isEmpty(this.block.metadata.config.instructions)) {
179
159
  this.block.metadata.config.instructions = ''
180
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/games",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "Windward UI Plugin Games",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -6,27 +6,6 @@ import Vuetify from 'vuetify'
6
6
  import Vue from 'vue'
7
7
  Vue.use(Vuetify)
8
8
 
9
- //override default mock
10
- jest.mock(
11
- 'lodash',
12
- () => {
13
- return {
14
- cloneDeep: () => {
15
- return []
16
- },
17
- isEmpty: () => {
18
- return jest.fn()
19
- },
20
- flatten: () => {
21
- return jest.fn()
22
- },
23
- get: () => {
24
- return jest.fn()
25
- },
26
- }
27
- },
28
- { virtual: true }
29
- )
30
9
  describe('CrosswordPuzzle', () => {
31
10
  test('is a Vue instance', () => {
32
11
  const wrapper = shallowMount(CrosswordPuzzle, {
@@ -6,27 +6,6 @@ import Vuetify from 'vuetify'
6
6
  import Vue from 'vue'
7
7
  Vue.use(Vuetify)
8
8
 
9
- //override default mock
10
- jest.mock(
11
- 'lodash',
12
- () => {
13
- return {
14
- cloneDeep: () => {
15
- return []
16
- },
17
- isEmpty: () => {
18
- return jest.fn()
19
- },
20
- flatten: () => {
21
- return jest.fn()
22
- },
23
- get: () => {
24
- return jest.fn()
25
- },
26
- }
27
- },
28
- { virtual: true }
29
- )
30
9
  describe('SortingGame', () => {
31
10
  test('is a Vue instance', () => {
32
11
  const wrapper = shallowMount(SortingGame, {