@windward/games 0.7.0 → 0.8.1

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 (28) hide show
  1. package/babel.config.js +1 -1
  2. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +10 -2
  3. package/components/content/blocks/dragDrop/BucketGame.vue +6 -1
  4. package/components/content/blocks/dragDrop/SortingGame.vue +4 -2
  5. package/components/content/blocks/flashcards/FlashcardSlides.vue +2 -2
  6. package/components/content/blocks/matchingGame/MatchingGame.vue +34 -10
  7. package/components/content/blocks/multipleChoice/MultipleChoice.vue +10 -2
  8. package/components/content/blocks/multipleChoice/QuestionDialog.vue +4 -7
  9. package/components/content/blocks/quizshowGame/QuizShow.vue +0 -7
  10. package/components/content/blocks/slideshow/SlideShow.vue +6 -1
  11. package/components/settings/BucketGameSettingsManager.vue +6 -30
  12. package/components/settings/CrosswordPuzzleSettingsManager.vue +6 -28
  13. package/components/settings/FlashCardSlidesManager.vue +12 -34
  14. package/components/settings/MatchingGameManager.vue +30 -50
  15. package/components/settings/MultipleChoiceSettingsManager.vue +6 -30
  16. package/components/settings/QuizShowSettingsManager.vue +12 -62
  17. package/components/settings/SevenStrikesSettingsManager.vue +12 -47
  18. package/components/settings/SlideShowManager.vue +20 -47
  19. package/components/settings/SortingGameSettingsManager.vue +8 -44
  20. package/components/settings/WordJumbleSettingsManager.vue +10 -46
  21. package/i18n/en-US/shared/content_blocks.ts +1 -1
  22. package/i18n/en-US/shared/settings.ts +3 -0
  23. package/i18n/es-ES/shared/settings.ts +3 -0
  24. package/i18n/sv-SE/shared/settings.ts +4 -1
  25. package/package.json +4 -4
  26. package/test/mocks.js +10 -2
  27. package/test/settings/BucketGameManager.spec.js +0 -1
  28. package/test/settings/FlashCardSlidesManager.spec.js +2 -2
@@ -3,9 +3,10 @@
3
3
  <v-container class="pa-0">
4
4
  <v-text-field
5
5
  ref="title"
6
+ id="block-settings-title"
6
7
  v-model="block.metadata.config.title"
7
- :counter="50"
8
- :rules="validation.shortInputRules"
8
+ :rules="$Validation.getRule('block.title')"
9
+ :counter="$Validation.getLimit('block.title')"
9
10
  outlined
10
11
  :autofocus="true"
11
12
  :label="
@@ -16,9 +17,10 @@
16
17
  :disabled="render"
17
18
  ></v-text-field>
18
19
  <v-textarea
20
+ id="block-settings-instructions"
19
21
  v-model="block.metadata.config.instructions"
20
- :rules="validation.instructionRule"
21
- :counter="255"
22
+ :rules="$Validation.getRule('block.instructions')"
23
+ :counter="$Validation.getLimit('block.instructions')"
22
24
  outlined
23
25
  auto-grow
24
26
  :label="
@@ -67,8 +69,8 @@
67
69
  v-model="
68
70
  block.metadata.config.words[index].value
69
71
  "
70
- :rules="validation.shortInputRules"
71
- :counter="50"
72
+ :rules="$Validation.getRule('shortInput')"
73
+ :counter="$Validation.getLimit('shortInput')"
72
74
  outlined
73
75
  :disabled="render"
74
76
  ></v-text-field>
@@ -85,8 +87,8 @@
85
87
  v-model="
86
88
  block.metadata.config.words[index].hint
87
89
  "
88
- :rules="validation.hintRule"
89
- :counter="155"
90
+ :rules="$Validation.getRule('mediumInput')"
91
+ :counter="$Validation.getLimit('mediumInput')"
90
92
  outlined
91
93
  :disabled="render"
92
94
  ></v-textarea>
@@ -191,44 +193,6 @@ export default {
191
193
  return {
192
194
  valid: true,
193
195
  loading: false,
194
- validation: {
195
- shortInputRules: [
196
- (v) => {
197
- if (v && v.length >= 50) {
198
- return this.$t(
199
- 'windward.games.shared.settings.errors.input_limitations',
200
- [50]
201
- )
202
- } else {
203
- return true
204
- }
205
- },
206
- ],
207
- instructionRule: [
208
- (v) => {
209
- if (v && v.length >= 255) {
210
- return this.$t(
211
- 'windward.games.shared.settings.errors.input_limitations',
212
- [255]
213
- )
214
- } else {
215
- return true
216
- }
217
- },
218
- ],
219
- hintRule: [
220
- (v) => {
221
- if (v && v.length >= 155) {
222
- return this.$t(
223
- 'windward.games.shared.settings.errors.input_limitations',
224
- [155]
225
- )
226
- } else {
227
- return true
228
- }
229
- },
230
- ],
231
- },
232
196
  }
233
197
  },
234
198
  methods: {
@@ -4,7 +4,7 @@ export default {
4
4
  bucket: 'Bucket',
5
5
  sort: 'Sorting',
6
6
  matching_game: 'Matching',
7
- quizshow: 'Quizshow',
7
+ quizshow: 'Quiz Show',
8
8
  slideshow: 'Slideshow',
9
9
  multiple_choice: 'Multiple Choice',
10
10
  word_jumble: 'Word Jumble',
@@ -14,4 +14,7 @@ export default {
14
14
  errors: {
15
15
  input_limitations: 'Must be less than {0} characters.'
16
16
  },
17
+ file_picker: {
18
+ image: 'Place Image'
19
+ }
17
20
  }
@@ -14,4 +14,7 @@ export default {
14
14
  errors: {
15
15
  input_limitations: 'Måste vara mindre än {0} tecken.',
16
16
  },
17
+ file_picker: {
18
+ image: 'Colocar imagen'
19
+ }
17
20
  }
@@ -12,6 +12,9 @@ export default {
12
12
  crossword_puzzle_manager: 'Korsordshanterare',
13
13
  },
14
14
  errors: {
15
- input_limitations: 'Måste vara mindre än {0} tecken.'
15
+ input_limitations: 'Måste vara mindre än {0} tecken.',
16
+ },
17
+ file_picker: {
18
+ image: 'Placera bild',
16
19
  },
17
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/games",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Windward UI Plugin Games",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git+ssh://git@bitbucket.org/mindedge/windward-osmt-ui-plugin.git"
13
+ "url": "git+ssh://git@bitbucket.org/mindedge/windward-ui-plugin-games.git"
14
14
  },
15
15
  "author": "Ted Celestin <tcelestin@mindedge.com>",
16
16
  "contributors": [
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "homepage": "https://bitbucket.org/mindedge/windward-ui-plugin-games#readme",
23
23
  "dependencies": {
24
- "@windward/core": "^0.3.0",
24
+ "@windward/core": "^0.8.0",
25
25
  "eslint": "^8.11.0",
26
26
  "lodash": "^4.17.21",
27
27
  "prettier": "^2.6.0",
@@ -49,7 +49,7 @@
49
49
  "vuetify": "^2.6.4"
50
50
  },
51
51
  "bugs": {
52
- "url": "https://bitbucket.org/mindedge/windward-osmt-ui-plugin/issues"
52
+ "url": "https://bitbucket.org/mindedge/windward-ui-plugin-games/issues"
53
53
  },
54
54
  "directories": {
55
55
  "test": "test"
package/test/mocks.js CHANGED
@@ -1,8 +1,16 @@
1
- import { defaultMocks as coreMocks } from '@windward/core/test/mocks'
1
+ import { defaultMocks as mocks } from '@windward/core/test/mocks'
2
+
3
+ jest.mock('@windward/core/utils', () => ({
4
+ __esModule: true, // this property makes it work
5
+ default: 'mockedDefaultExport',
6
+ MathExpressionEditor: jest.fn(),
7
+ MathLiveWrapper: jest.fn(),
8
+ ContentViewer: jest.fn(),
9
+ }))
2
10
 
3
11
  require('./__mocks__/fileMock')
4
12
  require('./__mocks__/styleMock')
5
13
  require('./__mocks__/modelMock')
6
14
  require('./__mocks__/componentsMock')
7
15
 
8
- export const defaultMocks = coreMocks
16
+ export const defaultMocks = mocks
@@ -73,7 +73,6 @@ describe('Bucket game manager', () => {
73
73
  {
74
74
  bucket_index: 0,
75
75
  display: '',
76
- display_value: '',
77
76
  feedback: '',
78
77
  expand: true,
79
78
  id: 2,
@@ -13,8 +13,8 @@ describe('FLashcard slides manager', () => {
13
13
  test('is a Vue instance', () => {
14
14
  const wrapper = shallowMount(FlashCardSlidesManager, {
15
15
  propsData: {
16
- settings: settings,
17
- context: context,
16
+ settings,
17
+ context,
18
18
  data: {},
19
19
  },
20
20
  mocks: defaultMocks,