@windward/games 0.0.4 → 0.0.6

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 (29) hide show
  1. package/components/content/DatableEditor.vue +0 -3
  2. package/components/content/blocks/crosswordPuzzle/Crossword.ts +231 -153
  3. package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +91 -0
  4. package/components/content/blocks/crosswordPuzzle/CrosswordElements.ts +8 -6
  5. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +502 -371
  6. package/components/content/blocks/matchingGame/MatchingGame.vue +12 -1
  7. package/components/content/blocks/multipleChoice/MultipleChoice.vue +187 -127
  8. package/components/content/blocks/multipleChoice/QuestionDialog.vue +37 -13
  9. package/components/content/blocks/sevenStrikes/SevenStikes.vue +368 -0
  10. package/components/content/blocks/sevenStrikes/keyboard.vue +71 -0
  11. package/components/content/blocks/wordJumble/Jumble.vue +2 -10
  12. package/components/settings/CrosswordPuzzleSettingsManager.vue +12 -15
  13. package/components/settings/MatchingGameManager.vue +1 -1
  14. package/components/settings/MultipleChoiceSettingsManager.vue +21 -7
  15. package/components/settings/SevenStrikesSettingsManager.vue +288 -0
  16. package/i18n/en-US/components/content/blocks/crossword.ts +18 -3
  17. package/i18n/en-US/components/content/blocks/index.ts +2 -0
  18. package/i18n/en-US/components/content/blocks/multiple_choice.ts +2 -4
  19. package/i18n/en-US/components/content/blocks/seven_strikes.ts +6 -0
  20. package/i18n/en-US/components/settings/crossword.ts +2 -1
  21. package/i18n/en-US/components/settings/index.ts +2 -0
  22. package/i18n/en-US/components/settings/multiple_choice.ts +1 -1
  23. package/i18n/en-US/components/settings/seven_strikes.ts +8 -0
  24. package/i18n/en-US/shared/content_blocks.ts +1 -0
  25. package/i18n/en-US/shared/settings.ts +1 -0
  26. package/package.json +2 -1
  27. package/plugin.js +21 -0
  28. package/test/blocks/sevenStrikes/sevenStrikes.spec.js +24 -0
  29. package/test/settings/SevenStrikesManager.spec.js +53 -0
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <v-row>
3
+ <v-col
4
+ cols="6"
5
+ v-if="down.length > 0"
6
+ :class="`crossword-clues__list crossword-clues__list--down`"
7
+ >
8
+ <h3 class="crossword-clues__list-title">
9
+ {{
10
+ $t(`plugin.games.components.content.blocks.crossword.down`)
11
+ }}
12
+ </h3>
13
+ <v-list dense>
14
+ <v-list-item-group v-model="selectedItem">
15
+ <v-list-item
16
+ class="crossword-clues__list-item"
17
+ v-for="word in down"
18
+ :key="word.index"
19
+ :value="word.index"
20
+ @click="onClick(word)"
21
+ >
22
+ {{ word.position }}.
23
+ {{ word.clue }}
24
+ </v-list-item>
25
+ </v-list-item-group>
26
+ </v-list>
27
+ </v-col>
28
+ <v-col
29
+ cols="6"
30
+ v-if="across.length > 0"
31
+ :class="`crossword-clues__list crossword-clues__list--across`"
32
+ >
33
+ <h3 class="crossword-clues__list-title">
34
+ {{
35
+ $t(
36
+ `plugin.games.components.content.blocks.crossword.across`
37
+ )
38
+ }}
39
+ </h3>
40
+ <v-list dense>
41
+ <v-list-item-group v-model="selectedItem">
42
+ <v-list-item
43
+ class="crossword-clues__list-item"
44
+ v-for="word in across"
45
+ :key="word.index"
46
+ :value="word.index"
47
+ @click="onClick(word)"
48
+ >
49
+ {{ word.position }}.
50
+ {{ word.clue }}
51
+ </v-list-item>
52
+ </v-list-item-group>
53
+ </v-list>
54
+ </v-col>
55
+ </v-row>
56
+ </template>
57
+
58
+ <script>
59
+ export default {
60
+ name: 'CrosswordClues',
61
+ components: {},
62
+ props: {
63
+ down: {
64
+ type: Array,
65
+ required: false,
66
+ default: () => [],
67
+ },
68
+ across: {
69
+ type: Array,
70
+ required: false,
71
+ default: () => [],
72
+ },
73
+ },
74
+ data() {
75
+ return {
76
+ selectedItem: null,
77
+ }
78
+ },
79
+ methods: {
80
+ onClick(word) {
81
+ this.$emit('click', word)
82
+ },
83
+ },
84
+ }
85
+ </script>
86
+
87
+ <style scoped>
88
+ .crossword-clues__list-item {
89
+ padding: 4px;
90
+ }
91
+ </style>
@@ -1,8 +1,8 @@
1
1
  class CrosswordCell {
2
- public char!: any
2
+ public char!: string
3
3
  public across!: any
4
4
  public down!: any
5
- constructor(letter) {
5
+ constructor(letter: string) {
6
6
  this.char = letter // the actual letter for the cell on the crossword
7
7
  // If a word hits this cell going in the "across" direction, this will be a CrosswordCellNode
8
8
  this.across = null
@@ -14,10 +14,12 @@ class CrosswordCell {
14
14
  // You can tell if the Node is the start of a word (which is needed if you want to number the cells)
15
15
  // and what word and clue it corresponds to (using the index)
16
16
  class CrosswordCellNode {
17
- public is_start_of_word!: any
17
+ public isStartOfWord!: any
18
18
  public index!: any
19
- constructor(is_start_of_word, index) {
20
- this.is_start_of_word = is_start_of_word
19
+ public position = -1
20
+
21
+ constructor(isStartOfWord: any, index: any) {
22
+ this.isStartOfWord = isStartOfWord
21
23
  this.index = index // use to map this node to its word or clue
22
24
  }
23
25
 
@@ -27,7 +29,7 @@ class CrosswordCellNode {
27
29
  class WordElement {
28
30
  public word!: any
29
31
  public index!: any
30
- constructor(word, index) {
32
+ constructor(word: any, index: any) {
31
33
  this.word = word // the actual word
32
34
  this.index = index // use to map this node to its word or clue
33
35
  }