@windward/games 0.0.7 → 0.0.8
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.
- package/components/content/blocks/dragDrop/BucketGame.vue +18 -6
- package/components/content/blocks/dragDrop/SortingGame.vue +127 -55
- package/components/content/blocks/wordJumble/WordJumble.vue +11 -5
- package/components/settings/BucketGameSettingsManager.vue +306 -369
- package/components/settings/SortingGameSettingsManager.vue +181 -152
- package/components/settings/WordJumbleSettingsManager.vue +145 -137
- package/i18n/en-US/components/content/blocks/word_jumble.ts +1 -1
- package/i18n/en-US/components/settings/bucket_game.ts +5 -2
- package/i18n/en-US/components/settings/sorting_game.ts +2 -0
- package/i18n/en-US/components/settings/word_jumble.ts +1 -1
- package/package.json +1 -1
|
@@ -1,144 +1,146 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<br />
|
|
4
3
|
<v-form ref="form" v-model="valid" v-if="!loading">
|
|
5
|
-
<v-
|
|
6
|
-
v-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
4
|
+
<v-container class="pa-0">
|
|
5
|
+
<v-text-field
|
|
6
|
+
v-model="block.metadata.config.title"
|
|
7
|
+
outlined
|
|
8
|
+
:autofocus="true"
|
|
9
|
+
:counter="50"
|
|
10
|
+
:label="
|
|
11
|
+
$t(
|
|
12
|
+
'plugin.games.components.settings.bucket_game.form.title'
|
|
13
|
+
)
|
|
14
|
+
"
|
|
15
|
+
ref="title"
|
|
16
|
+
></v-text-field>
|
|
17
|
+
<v-textarea
|
|
18
|
+
outlined
|
|
19
|
+
auto-grow
|
|
20
|
+
v-model="block.metadata.config.instructions"
|
|
21
|
+
:counter="255"
|
|
22
|
+
:label="
|
|
23
|
+
$t(
|
|
24
|
+
'plugin.games.components.settings.bucket_game.form.instructions'
|
|
25
|
+
)
|
|
26
|
+
"
|
|
27
|
+
></v-textarea>
|
|
28
|
+
</v-container>
|
|
29
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
30
|
+
<v-container class="pa-0">
|
|
31
|
+
<p>
|
|
32
|
+
{{
|
|
33
|
+
$t(
|
|
34
|
+
'plugin.games.components.settings.sorting_game.sortable_items'
|
|
35
|
+
)
|
|
36
|
+
}}
|
|
37
|
+
</p>
|
|
38
|
+
<draggable
|
|
39
|
+
v-model="block.metadata.config.answer"
|
|
40
|
+
group="cards"
|
|
41
|
+
@change="onDragged"
|
|
42
|
+
>
|
|
43
|
+
<v-container
|
|
44
|
+
v-for="(item, index) in block.metadata.config.answer"
|
|
45
|
+
:key="'bucket_' + index"
|
|
46
|
+
class="container-card-outline"
|
|
47
|
+
elevation="0"
|
|
48
|
+
outlined
|
|
49
|
+
tile
|
|
37
50
|
>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
<v-layout row wrap outlined>
|
|
52
|
+
<v-flex xs10 :class="bottomBorder(index)">
|
|
53
|
+
<p
|
|
54
|
+
class="text-truncate mb-0 p-header"
|
|
55
|
+
@click="onOpenEditor(index)"
|
|
56
|
+
v-on:keyup.enter="onOpenEditor(index)"
|
|
57
|
+
@mouseover="onHover"
|
|
58
|
+
@mouseleave="onHoverLeave"
|
|
59
|
+
:class="cursor"
|
|
60
|
+
tabindex="0"
|
|
61
|
+
>
|
|
62
|
+
<v-icon>mdi-drag-vertical</v-icon>
|
|
63
|
+
<span class="span-text-ellipsis">
|
|
64
|
+
{{
|
|
65
|
+
item.value
|
|
66
|
+
? block.metadata.config.answer[
|
|
67
|
+
index
|
|
68
|
+
].value
|
|
69
|
+
: $t(
|
|
70
|
+
'plugin.games.components.settings.bucket_game.form.enter_text'
|
|
71
|
+
)
|
|
72
|
+
}}
|
|
73
|
+
</span>
|
|
74
|
+
</p>
|
|
75
|
+
</v-flex>
|
|
76
|
+
<v-flex
|
|
77
|
+
xs2
|
|
78
|
+
class="btn-header-delete d-flex justify-center"
|
|
79
|
+
:class="bottomBorder(index)"
|
|
45
80
|
>
|
|
46
|
-
<v-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class="pa-2 flex-fill cardOutline"
|
|
51
|
-
elevation="0"
|
|
52
|
-
outlined
|
|
53
|
-
tile
|
|
81
|
+
<v-icon
|
|
82
|
+
class="btn-delete-icon"
|
|
83
|
+
@click="onDelete(index)"
|
|
84
|
+
>mdi-delete-outline</v-icon
|
|
54
85
|
>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
tabindex="0"
|
|
66
|
-
>
|
|
67
|
-
<v-icon class="pl-2"
|
|
68
|
-
>mdi-gesture-tap-hold</v-icon
|
|
69
|
-
>
|
|
70
|
-
{{
|
|
71
|
-
item.value
|
|
72
|
-
? block.metadata.config
|
|
73
|
-
.answer[index].value
|
|
74
|
-
: $t(
|
|
75
|
-
'plugin.games.components.settings.bucket_game.form.enter_text'
|
|
76
|
-
)
|
|
77
|
-
}}
|
|
78
|
-
</p>
|
|
79
|
-
<v-icon
|
|
80
|
-
class="twenty"
|
|
81
|
-
@click="onDelete(index)"
|
|
82
|
-
>mdi-delete-outline</v-icon
|
|
83
|
-
>
|
|
84
|
-
</v-row>
|
|
86
|
+
</v-flex>
|
|
87
|
+
<v-container v-if="item.expand">
|
|
88
|
+
<v-flex xs12>
|
|
89
|
+
<p class="p-label">
|
|
90
|
+
{{
|
|
91
|
+
$t(
|
|
92
|
+
'plugin.games.components.settings.sorting_game.word'
|
|
93
|
+
)
|
|
94
|
+
}}
|
|
95
|
+
</p>
|
|
85
96
|
<v-textarea
|
|
86
|
-
v-if="item.expand"
|
|
87
97
|
outlined
|
|
88
|
-
:autofocus="true"
|
|
89
|
-
class="pt-4"
|
|
90
98
|
v-model="
|
|
91
99
|
block.metadata.config.answer[index]
|
|
92
100
|
.value
|
|
93
101
|
"
|
|
102
|
+
:autofocus="true"
|
|
94
103
|
></v-textarea>
|
|
95
|
-
</v-
|
|
96
|
-
</
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
v-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
:counter="255"
|
|
136
|
-
:label="
|
|
137
|
-
$t(
|
|
138
|
-
'plugin.games.components.settings.bucket_game.form.feedback.incorrect'
|
|
139
|
-
)
|
|
140
|
-
"
|
|
141
|
-
></v-textarea>
|
|
104
|
+
</v-flex>
|
|
105
|
+
</v-container>
|
|
106
|
+
</v-layout>
|
|
107
|
+
</v-container>
|
|
108
|
+
</draggable>
|
|
109
|
+
</v-container>
|
|
110
|
+
<v-container class="pa-0">
|
|
111
|
+
<v-row justify="center" class="my-4">
|
|
112
|
+
<v-btn color="primary" @click="onAddElement">
|
|
113
|
+
<v-icon>mdi-plus</v-icon>
|
|
114
|
+
{{
|
|
115
|
+
$t(
|
|
116
|
+
'plugin.games.components.settings.bucket_game.form.add_answer'
|
|
117
|
+
)
|
|
118
|
+
}}
|
|
119
|
+
</v-btn>
|
|
120
|
+
</v-row>
|
|
121
|
+
<v-textarea
|
|
122
|
+
outlined
|
|
123
|
+
auto-grow
|
|
124
|
+
v-model="block.metadata.config.feedback_correct"
|
|
125
|
+
:counter="255"
|
|
126
|
+
:label="
|
|
127
|
+
$t(
|
|
128
|
+
'plugin.games.components.settings.bucket_game.form.feedback.correct'
|
|
129
|
+
)
|
|
130
|
+
"
|
|
131
|
+
></v-textarea>
|
|
132
|
+
<v-textarea
|
|
133
|
+
outlined
|
|
134
|
+
auto-grow
|
|
135
|
+
v-model="block.metadata.config.feedback_incorrect"
|
|
136
|
+
:counter="255"
|
|
137
|
+
:label="
|
|
138
|
+
$t(
|
|
139
|
+
'plugin.games.components.settings.bucket_game.form.feedback.incorrect'
|
|
140
|
+
)
|
|
141
|
+
"
|
|
142
|
+
></v-textarea>
|
|
143
|
+
</v-container>
|
|
142
144
|
</v-form>
|
|
143
145
|
<div v-if="loading" class="text-center">
|
|
144
146
|
<v-progress-circular
|
|
@@ -170,12 +172,27 @@ export default {
|
|
|
170
172
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
171
173
|
this.block.metadata.config = {}
|
|
172
174
|
}
|
|
175
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
176
|
+
this.block.metadata.config.title = this.$t(
|
|
177
|
+
'plugin.games.components.settings.sorting_game.sortable_game'
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
181
|
+
this.block.metadata.config.feedback_correct = this.$t(
|
|
182
|
+
'plugin.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
186
|
+
this.block.metadata.config.feedback_incorrect = this.$t(
|
|
187
|
+
'plugin.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
188
|
+
)
|
|
189
|
+
}
|
|
173
190
|
if (_.isEmpty(this.block.metadata.config.answer)) {
|
|
174
191
|
this.block.metadata.config.answer = []
|
|
175
192
|
const default_object = {
|
|
176
193
|
id: this.block.metadata.config.answer.length + 1,
|
|
177
194
|
value: '',
|
|
178
|
-
expand:
|
|
195
|
+
expand: true,
|
|
179
196
|
}
|
|
180
197
|
this.block.metadata.config.answer.push(default_object)
|
|
181
198
|
}
|
|
@@ -197,6 +214,13 @@ export default {
|
|
|
197
214
|
}
|
|
198
215
|
},
|
|
199
216
|
methods: {
|
|
217
|
+
bottomBorder(index) {
|
|
218
|
+
if (this.block.metadata.config.answer[index].expand === true) {
|
|
219
|
+
return 'container-header-border'
|
|
220
|
+
} else {
|
|
221
|
+
return null
|
|
222
|
+
}
|
|
223
|
+
},
|
|
200
224
|
onAddElement() {
|
|
201
225
|
this.block.metadata.config.answer.forEach((element) => {
|
|
202
226
|
element.expand = false
|
|
@@ -226,7 +250,7 @@ export default {
|
|
|
226
250
|
})
|
|
227
251
|
},
|
|
228
252
|
onHover(index) {
|
|
229
|
-
this.cursor = '
|
|
253
|
+
this.cursor = 'change-pointer'
|
|
230
254
|
},
|
|
231
255
|
onHoverLeave() {
|
|
232
256
|
this.cursor = ''
|
|
@@ -246,10 +270,14 @@ export default {
|
|
|
246
270
|
.v-progress-circular {
|
|
247
271
|
margin: 1rem;
|
|
248
272
|
}
|
|
249
|
-
.
|
|
250
|
-
border:
|
|
273
|
+
.container-card-outline {
|
|
274
|
+
border: solid 1px var(--v-primary-base);
|
|
275
|
+
border-radius: 3px !important;
|
|
251
276
|
margin-bottom: 8px;
|
|
252
277
|
}
|
|
278
|
+
.container-header-border {
|
|
279
|
+
border-bottom: 1px solid var(--v-primary-base);
|
|
280
|
+
}
|
|
253
281
|
.fullWidth {
|
|
254
282
|
display: flex;
|
|
255
283
|
justify-content: center;
|
|
@@ -257,35 +285,36 @@ export default {
|
|
|
257
285
|
font-weight: bold;
|
|
258
286
|
font-size: 16px;
|
|
259
287
|
}
|
|
260
|
-
.
|
|
261
|
-
display: flex;
|
|
262
|
-
align-content: center;
|
|
263
|
-
justify-content: space-between;
|
|
264
|
-
height: 60px;
|
|
265
|
-
}
|
|
266
|
-
.changePointer {
|
|
288
|
+
.change-pointer {
|
|
267
289
|
cursor: pointer !important;
|
|
268
290
|
}
|
|
269
|
-
.
|
|
270
|
-
|
|
271
|
-
height: 100%;
|
|
291
|
+
.p-header {
|
|
292
|
+
height: 45px;
|
|
272
293
|
display: flex;
|
|
273
294
|
align-items: center;
|
|
274
295
|
}
|
|
275
|
-
.
|
|
276
|
-
|
|
277
|
-
height: 90%;
|
|
278
|
-
margin-top: 3px;
|
|
279
|
-
border-left: 2px solid var(--v-primary-base);
|
|
296
|
+
.p-header:hover {
|
|
297
|
+
background-color: rgb(243, 243, 243);
|
|
280
298
|
}
|
|
281
|
-
.
|
|
282
|
-
|
|
283
|
-
|
|
299
|
+
.span-text-ellipsis {
|
|
300
|
+
white-space: nowrap;
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
text-overflow: ellipsis;
|
|
303
|
+
}
|
|
304
|
+
.btn-header-delete {
|
|
305
|
+
border-left: 1px solid var(--v-primary-base);
|
|
306
|
+
}
|
|
307
|
+
.btn-header-delete:hover {
|
|
308
|
+
background-color: rgb(243, 243, 243);
|
|
309
|
+
}
|
|
310
|
+
.btn-delete-icon {
|
|
311
|
+
color: var(--v-primary-base);
|
|
284
312
|
}
|
|
285
313
|
.addIcon {
|
|
286
314
|
margin-right: 5px;
|
|
287
315
|
}
|
|
288
|
-
.
|
|
289
|
-
|
|
316
|
+
.p-label {
|
|
317
|
+
font-size: 16px;
|
|
318
|
+
font-weight: 500;
|
|
290
319
|
}
|
|
291
320
|
</style>
|