@webwriter/quiz 1.0.10 → 1.1.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.
- package/LICENSE +6 -6
- package/custom.d.ts +175 -175
- package/dist/widgets/webwriter-choice-item.js +10 -7
- package/dist/widgets/webwriter-choice.js +39 -6
- package/dist/widgets/webwriter-order-item.js +14 -11
- package/dist/widgets/webwriter-order.js +30 -4
- package/dist/widgets/webwriter-quiz.js +2 -1
- package/dist/widgets/webwriter-text.js +26 -9
- package/lit-localize.json +14 -14
- package/localization/bg.xlf +69 -69
- package/localization/cs.xlf +69 -69
- package/localization/da.xlf +69 -69
- package/localization/de.xlf +74 -74
- package/localization/el.xlf +69 -69
- package/localization/es.xlf +69 -69
- package/localization/et.xlf +69 -69
- package/localization/fi.xlf +69 -69
- package/localization/fr.xlf +69 -69
- package/localization/generated/bg.ts +29 -29
- package/localization/generated/cs.ts +29 -29
- package/localization/generated/da.ts +29 -29
- package/localization/generated/de.ts +29 -29
- package/localization/generated/el.ts +29 -29
- package/localization/generated/es.ts +29 -29
- package/localization/generated/et.ts +29 -29
- package/localization/generated/fi.ts +29 -29
- package/localization/generated/fr.ts +29 -29
- package/localization/generated/hu.ts +29 -29
- package/localization/generated/id.ts +29 -29
- package/localization/generated/index.js +2 -2
- package/localization/generated/it.ts +29 -29
- package/localization/generated/ja.ts +29 -29
- package/localization/generated/ko.ts +29 -29
- package/localization/generated/locale-codes.js +79 -79
- package/localization/generated/lt.ts +29 -29
- package/localization/generated/lv.ts +29 -29
- package/localization/generated/nb.ts +29 -29
- package/localization/generated/nl.ts +29 -29
- package/localization/generated/pl.ts +29 -29
- package/localization/generated/pt-BR.ts +29 -29
- package/localization/generated/pt-PT.ts +29 -29
- package/localization/generated/ro.ts +29 -29
- package/localization/generated/ru.ts +29 -29
- package/localization/generated/sk.ts +29 -29
- package/localization/generated/sl.ts +29 -29
- package/localization/generated/sv.ts +29 -29
- package/localization/generated/tr.ts +29 -29
- package/localization/generated/uk.ts +29 -29
- package/localization/generated/zh-hans.ts +29 -29
- package/localization/hu.xlf +69 -69
- package/localization/id.xlf +69 -69
- package/localization/it.xlf +69 -69
- package/localization/ja.xlf +69 -69
- package/localization/ko.xlf +69 -69
- package/localization/lt.xlf +69 -69
- package/localization/lv.xlf +69 -69
- package/localization/nb.xlf +69 -69
- package/localization/nl.xlf +69 -69
- package/localization/pl.xlf +69 -69
- package/localization/pt-BR.xlf +69 -69
- package/localization/pt-PT.xlf +69 -69
- package/localization/ro.xlf +69 -69
- package/localization/ru.xlf +69 -69
- package/localization/sk.xlf +69 -69
- package/localization/sl.xlf +69 -69
- package/localization/sv.xlf +69 -69
- package/localization/tr.xlf +69 -69
- package/localization/uk.xlf +69 -69
- package/localization/zh-hans.xlf +69 -69
- package/package.json +7 -2
- package/src/lib/combobox.ts +455 -455
- package/src/lib/highlighter-fill.svg +5 -5
- package/src/snippets/Beispiel-Choice.html +57 -57
- package/src/snippets/Beispiel-Mark.html +13 -13
- package/src/snippets/Beispiel-Order.html +52 -52
- package/src/snippets/Beispiel-Text.html +20 -20
- package/src/snippets/blank.html +1 -0
- package/src/snippets/choice.html +7 -7
- package/src/snippets/cloze.html +3 -3
- package/src/snippets/mark.html +3 -3
- package/src/snippets/order.html +7 -7
- package/src/snippets/pairing.html +9 -9
- package/src/snippets/speech.html +3 -3
- package/src/snippets/text.html +3 -3
- package/src/snippets/wordsearch.html +3 -3
- package/src/widgets/webwriter-choice-item.ts +253 -250
- package/src/widgets/webwriter-choice.ts +339 -314
- package/src/widgets/webwriter-cloze-gap.ts +215 -215
- package/src/widgets/webwriter-cloze.ts +135 -135
- package/src/widgets/webwriter-mark.ts +431 -431
- package/src/widgets/webwriter-order-item.ts +440 -437
- package/src/widgets/webwriter-order.ts +311 -284
- package/src/widgets/webwriter-pairing-item.ts +160 -160
- package/src/widgets/webwriter-pairing.ts +192 -192
- package/src/widgets/webwriter-quiz.ts +282 -281
- package/src/widgets/webwriter-speech.ts +272 -272
- package/src/widgets/webwriter-task-explainer.ts +42 -42
- package/src/widgets/webwriter-task-hint.ts +22 -22
- package/src/widgets/webwriter-task-prompt.ts +23 -23
- package/src/widgets/webwriter-task.ts +546 -546
- package/src/widgets/webwriter-text.ts +155 -135
- package/tsconfig.json +6 -6
- package/.env +0 -1
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Copyright 2024 Frederic Salmen <frederic@fsalmen.de>
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
-
|
|
5
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
-
|
|
1
|
+
Copyright 2024 Frederic Salmen <frederic@fsalmen.de>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
7
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/custom.d.ts
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
declare module '*.apng' {
|
|
2
|
-
const content: string;
|
|
3
|
-
export default content;
|
|
4
|
-
}
|
|
5
|
-
declare module '*.jpg' {
|
|
6
|
-
const content: string;
|
|
7
|
-
export default content;
|
|
8
|
-
}
|
|
9
|
-
declare module '*.jpeg' {
|
|
10
|
-
const content: string;
|
|
11
|
-
export default content;
|
|
12
|
-
}
|
|
13
|
-
declare module '*.jfif' {
|
|
14
|
-
const content: string;
|
|
15
|
-
export default content;
|
|
16
|
-
}
|
|
17
|
-
declare module '*.pjpeg' {
|
|
18
|
-
const content: string;
|
|
19
|
-
export default content;
|
|
20
|
-
}
|
|
21
|
-
declare module '*.pjp' {
|
|
22
|
-
const content: string;
|
|
23
|
-
export default content;
|
|
24
|
-
}
|
|
25
|
-
declare module '*.png' {
|
|
26
|
-
const content: string;
|
|
27
|
-
export default content;
|
|
28
|
-
}
|
|
29
|
-
declare module '*.svg' {
|
|
30
|
-
const content: string;
|
|
31
|
-
export default content;
|
|
32
|
-
}
|
|
33
|
-
declare module '*.webp' {
|
|
34
|
-
const content: string;
|
|
35
|
-
export default content;
|
|
36
|
-
}
|
|
37
|
-
declare module '*.bmp' {
|
|
38
|
-
const content: string;
|
|
39
|
-
export default content;
|
|
40
|
-
}
|
|
41
|
-
declare module '*.ico' {
|
|
42
|
-
const content: string;
|
|
43
|
-
export default content;
|
|
44
|
-
}
|
|
45
|
-
declare module '*.cur' {
|
|
46
|
-
const content: string;
|
|
47
|
-
export default content;
|
|
48
|
-
}
|
|
49
|
-
declare module '*.tif' {
|
|
50
|
-
const content: string;
|
|
51
|
-
export default content;
|
|
52
|
-
}
|
|
53
|
-
declare module '*.tiff' {
|
|
54
|
-
const content: string;
|
|
55
|
-
export default content;
|
|
56
|
-
}
|
|
57
|
-
declare module '*.wav' {
|
|
58
|
-
const content: string;
|
|
59
|
-
export default content;
|
|
60
|
-
}
|
|
61
|
-
declare module '*.wave' {
|
|
62
|
-
const content: string;
|
|
63
|
-
export default content;
|
|
64
|
-
}
|
|
65
|
-
declare module '*.mp3' {
|
|
66
|
-
const content: string;
|
|
67
|
-
export default content;
|
|
68
|
-
}
|
|
69
|
-
declare module '*.aac' {
|
|
70
|
-
const content: string;
|
|
71
|
-
export default content;
|
|
72
|
-
}
|
|
73
|
-
declare module '*.aacp' {
|
|
74
|
-
const content: string;
|
|
75
|
-
export default content;
|
|
76
|
-
}
|
|
77
|
-
declare module '*.oga' {
|
|
78
|
-
const content: string;
|
|
79
|
-
export default content;
|
|
80
|
-
}
|
|
81
|
-
declare module '*.flac' {
|
|
82
|
-
const content: string;
|
|
83
|
-
export default content;
|
|
84
|
-
}
|
|
85
|
-
declare module '*.weba' {
|
|
86
|
-
const content: string;
|
|
87
|
-
export default content;
|
|
88
|
-
}
|
|
89
|
-
declare module '*.mp4' {
|
|
90
|
-
const content: string;
|
|
91
|
-
export default content;
|
|
92
|
-
}
|
|
93
|
-
declare module '*.webm' {
|
|
94
|
-
const content: string;
|
|
95
|
-
export default content;
|
|
96
|
-
}
|
|
97
|
-
declare module '*.avif' {
|
|
98
|
-
const content: string;
|
|
99
|
-
export default content;
|
|
100
|
-
}
|
|
101
|
-
declare module '*.gif' {
|
|
102
|
-
const content: string;
|
|
103
|
-
export default content;
|
|
104
|
-
}
|
|
105
|
-
declare module '*.mov' {
|
|
106
|
-
const content: string;
|
|
107
|
-
export default content;
|
|
108
|
-
}
|
|
109
|
-
declare module '*.avi' {
|
|
110
|
-
const content: string;
|
|
111
|
-
export default content;
|
|
112
|
-
}
|
|
113
|
-
declare module '*.ogv' {
|
|
114
|
-
const content: string;
|
|
115
|
-
export default content;
|
|
116
|
-
}
|
|
117
|
-
declare module '*.mkv' {
|
|
118
|
-
const content: string;
|
|
119
|
-
export default content;
|
|
120
|
-
}
|
|
121
|
-
declare module '*.opus' {
|
|
122
|
-
const content: string;
|
|
123
|
-
export default content;
|
|
124
|
-
}
|
|
125
|
-
declare module '*.mpeg' {
|
|
126
|
-
const content: string;
|
|
127
|
-
export default content;
|
|
128
|
-
}
|
|
129
|
-
declare module '*.woff' {
|
|
130
|
-
const content: string;
|
|
131
|
-
export default content;
|
|
132
|
-
}
|
|
133
|
-
declare module '*.woff2' {
|
|
134
|
-
const content: string;
|
|
135
|
-
export default content;
|
|
136
|
-
}
|
|
137
|
-
declare module '*.ttf' {
|
|
138
|
-
const content: string;
|
|
139
|
-
export default content;
|
|
140
|
-
}
|
|
141
|
-
declare module '*.otf' {
|
|
142
|
-
const content: string;
|
|
143
|
-
export default content;
|
|
144
|
-
}
|
|
145
|
-
declare module '*.pdf' {
|
|
146
|
-
const content: string;
|
|
147
|
-
export default content;
|
|
148
|
-
}
|
|
149
|
-
declare module '*.json' {
|
|
150
|
-
const content: {[key: string]: any};
|
|
151
|
-
export default content;
|
|
152
|
-
}
|
|
153
|
-
declare module '*.jsonld' {
|
|
154
|
-
const content: {[key: string]: any};
|
|
155
|
-
export default content;
|
|
156
|
-
}
|
|
157
|
-
declare module '*.txt' {
|
|
158
|
-
const content: string;
|
|
159
|
-
export default content;
|
|
160
|
-
}
|
|
161
|
-
declare module '*.csv' {
|
|
162
|
-
const content: string;
|
|
163
|
-
export default content;
|
|
164
|
-
}
|
|
165
|
-
declare module '*.htm' {
|
|
166
|
-
const content: string;
|
|
167
|
-
export default content;
|
|
168
|
-
}
|
|
169
|
-
declare module '*.html' {
|
|
170
|
-
const content: string;
|
|
171
|
-
export default content;
|
|
172
|
-
}
|
|
173
|
-
declare module '*.xml' {
|
|
174
|
-
const content: string;
|
|
175
|
-
export default content;
|
|
1
|
+
declare module '*.apng' {
|
|
2
|
+
const content: string;
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.jpg' {
|
|
6
|
+
const content: string;
|
|
7
|
+
export default content;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.jpeg' {
|
|
10
|
+
const content: string;
|
|
11
|
+
export default content;
|
|
12
|
+
}
|
|
13
|
+
declare module '*.jfif' {
|
|
14
|
+
const content: string;
|
|
15
|
+
export default content;
|
|
16
|
+
}
|
|
17
|
+
declare module '*.pjpeg' {
|
|
18
|
+
const content: string;
|
|
19
|
+
export default content;
|
|
20
|
+
}
|
|
21
|
+
declare module '*.pjp' {
|
|
22
|
+
const content: string;
|
|
23
|
+
export default content;
|
|
24
|
+
}
|
|
25
|
+
declare module '*.png' {
|
|
26
|
+
const content: string;
|
|
27
|
+
export default content;
|
|
28
|
+
}
|
|
29
|
+
declare module '*.svg' {
|
|
30
|
+
const content: string;
|
|
31
|
+
export default content;
|
|
32
|
+
}
|
|
33
|
+
declare module '*.webp' {
|
|
34
|
+
const content: string;
|
|
35
|
+
export default content;
|
|
36
|
+
}
|
|
37
|
+
declare module '*.bmp' {
|
|
38
|
+
const content: string;
|
|
39
|
+
export default content;
|
|
40
|
+
}
|
|
41
|
+
declare module '*.ico' {
|
|
42
|
+
const content: string;
|
|
43
|
+
export default content;
|
|
44
|
+
}
|
|
45
|
+
declare module '*.cur' {
|
|
46
|
+
const content: string;
|
|
47
|
+
export default content;
|
|
48
|
+
}
|
|
49
|
+
declare module '*.tif' {
|
|
50
|
+
const content: string;
|
|
51
|
+
export default content;
|
|
52
|
+
}
|
|
53
|
+
declare module '*.tiff' {
|
|
54
|
+
const content: string;
|
|
55
|
+
export default content;
|
|
56
|
+
}
|
|
57
|
+
declare module '*.wav' {
|
|
58
|
+
const content: string;
|
|
59
|
+
export default content;
|
|
60
|
+
}
|
|
61
|
+
declare module '*.wave' {
|
|
62
|
+
const content: string;
|
|
63
|
+
export default content;
|
|
64
|
+
}
|
|
65
|
+
declare module '*.mp3' {
|
|
66
|
+
const content: string;
|
|
67
|
+
export default content;
|
|
68
|
+
}
|
|
69
|
+
declare module '*.aac' {
|
|
70
|
+
const content: string;
|
|
71
|
+
export default content;
|
|
72
|
+
}
|
|
73
|
+
declare module '*.aacp' {
|
|
74
|
+
const content: string;
|
|
75
|
+
export default content;
|
|
76
|
+
}
|
|
77
|
+
declare module '*.oga' {
|
|
78
|
+
const content: string;
|
|
79
|
+
export default content;
|
|
80
|
+
}
|
|
81
|
+
declare module '*.flac' {
|
|
82
|
+
const content: string;
|
|
83
|
+
export default content;
|
|
84
|
+
}
|
|
85
|
+
declare module '*.weba' {
|
|
86
|
+
const content: string;
|
|
87
|
+
export default content;
|
|
88
|
+
}
|
|
89
|
+
declare module '*.mp4' {
|
|
90
|
+
const content: string;
|
|
91
|
+
export default content;
|
|
92
|
+
}
|
|
93
|
+
declare module '*.webm' {
|
|
94
|
+
const content: string;
|
|
95
|
+
export default content;
|
|
96
|
+
}
|
|
97
|
+
declare module '*.avif' {
|
|
98
|
+
const content: string;
|
|
99
|
+
export default content;
|
|
100
|
+
}
|
|
101
|
+
declare module '*.gif' {
|
|
102
|
+
const content: string;
|
|
103
|
+
export default content;
|
|
104
|
+
}
|
|
105
|
+
declare module '*.mov' {
|
|
106
|
+
const content: string;
|
|
107
|
+
export default content;
|
|
108
|
+
}
|
|
109
|
+
declare module '*.avi' {
|
|
110
|
+
const content: string;
|
|
111
|
+
export default content;
|
|
112
|
+
}
|
|
113
|
+
declare module '*.ogv' {
|
|
114
|
+
const content: string;
|
|
115
|
+
export default content;
|
|
116
|
+
}
|
|
117
|
+
declare module '*.mkv' {
|
|
118
|
+
const content: string;
|
|
119
|
+
export default content;
|
|
120
|
+
}
|
|
121
|
+
declare module '*.opus' {
|
|
122
|
+
const content: string;
|
|
123
|
+
export default content;
|
|
124
|
+
}
|
|
125
|
+
declare module '*.mpeg' {
|
|
126
|
+
const content: string;
|
|
127
|
+
export default content;
|
|
128
|
+
}
|
|
129
|
+
declare module '*.woff' {
|
|
130
|
+
const content: string;
|
|
131
|
+
export default content;
|
|
132
|
+
}
|
|
133
|
+
declare module '*.woff2' {
|
|
134
|
+
const content: string;
|
|
135
|
+
export default content;
|
|
136
|
+
}
|
|
137
|
+
declare module '*.ttf' {
|
|
138
|
+
const content: string;
|
|
139
|
+
export default content;
|
|
140
|
+
}
|
|
141
|
+
declare module '*.otf' {
|
|
142
|
+
const content: string;
|
|
143
|
+
export default content;
|
|
144
|
+
}
|
|
145
|
+
declare module '*.pdf' {
|
|
146
|
+
const content: string;
|
|
147
|
+
export default content;
|
|
148
|
+
}
|
|
149
|
+
declare module '*.json' {
|
|
150
|
+
const content: {[key: string]: any};
|
|
151
|
+
export default content;
|
|
152
|
+
}
|
|
153
|
+
declare module '*.jsonld' {
|
|
154
|
+
const content: {[key: string]: any};
|
|
155
|
+
export default content;
|
|
156
|
+
}
|
|
157
|
+
declare module '*.txt' {
|
|
158
|
+
const content: string;
|
|
159
|
+
export default content;
|
|
160
|
+
}
|
|
161
|
+
declare module '*.csv' {
|
|
162
|
+
const content: string;
|
|
163
|
+
export default content;
|
|
164
|
+
}
|
|
165
|
+
declare module '*.htm' {
|
|
166
|
+
const content: string;
|
|
167
|
+
export default content;
|
|
168
|
+
}
|
|
169
|
+
declare module '*.html' {
|
|
170
|
+
const content: string;
|
|
171
|
+
export default content;
|
|
172
|
+
}
|
|
173
|
+
declare module '*.xml' {
|
|
174
|
+
const content: string;
|
|
175
|
+
export default content;
|
|
176
176
|
}
|
|
@@ -4139,15 +4139,16 @@ var globImport_ts = __glob({
|
|
|
4139
4139
|
var generated_default = configureLocalization({ sourceLocale, targetLocales, loadLocale: (locale) => globImport_ts(`./${locale}.ts`) });
|
|
4140
4140
|
|
|
4141
4141
|
// src/widgets/webwriter-choice-item.ts
|
|
4142
|
-
var _checkbox_dec, _layout_dec, _valid_dec, _active_dec, _a2, _WebwriterChoiceItem_decorators, _init2, _active, _valid, _layout, _checkbox;
|
|
4142
|
+
var _checkbox_dec, _layout_dec, _valid_dec, _active_dec, _showSolution_dec, _a2, _WebwriterChoiceItem_decorators, _init2, _showSolution, _active, _valid, _layout, _checkbox;
|
|
4143
4143
|
_WebwriterChoiceItem_decorators = [t5("webwriter-choice-item")];
|
|
4144
|
-
var WebwriterChoiceItem = class extends (_a2 = LitElementWw, _active_dec = [n6({ type: Boolean, attribute: false })], _valid_dec = [n6({ type: Boolean, attribute: false })], _layout_dec = [n6({ type: String, attribute: true, reflect: true })], _checkbox_dec = [e8("sl-checkbox")], _a2) {
|
|
4144
|
+
var WebwriterChoiceItem = class extends (_a2 = LitElementWw, _showSolution_dec = [n6({ type: Boolean, attribute: false })], _active_dec = [n6({ type: Boolean, attribute: false })], _valid_dec = [n6({ type: Boolean, attribute: false })], _layout_dec = [n6({ type: String, attribute: true, reflect: true })], _checkbox_dec = [e8("sl-checkbox")], _a2) {
|
|
4145
4145
|
constructor() {
|
|
4146
4146
|
super(...arguments);
|
|
4147
4147
|
__publicField(this, "localize", generated_default);
|
|
4148
|
-
__privateAdd(this,
|
|
4149
|
-
__privateAdd(this,
|
|
4150
|
-
__privateAdd(this,
|
|
4148
|
+
__privateAdd(this, _showSolution, __runInitializers(_init2, 8, this, true)), __runInitializers(_init2, 11, this);
|
|
4149
|
+
__privateAdd(this, _active, __runInitializers(_init2, 12, this, false)), __runInitializers(_init2, 15, this);
|
|
4150
|
+
__privateAdd(this, _valid, __runInitializers(_init2, 16, this)), __runInitializers(_init2, 19, this);
|
|
4151
|
+
__privateAdd(this, _layout, __runInitializers(_init2, 20, this, "list")), __runInitializers(_init2, 23, this);
|
|
4151
4152
|
__publicField(this, "handleClick", (e10) => {
|
|
4152
4153
|
const checkboxClicked = e10.composedPath().some((v3) => v3?.classList?.contains("checkbox__control"));
|
|
4153
4154
|
const editable = this.isContentEditable;
|
|
@@ -4164,7 +4165,7 @@ var WebwriterChoiceItem = class extends (_a2 = LitElementWw, _active_dec = [n6({
|
|
|
4164
4165
|
this.active = !this.active;
|
|
4165
4166
|
}
|
|
4166
4167
|
});
|
|
4167
|
-
__privateAdd(this, _checkbox, __runInitializers(_init2,
|
|
4168
|
+
__privateAdd(this, _checkbox, __runInitializers(_init2, 24, this)), __runInitializers(_init2, 27, this);
|
|
4168
4169
|
__publicField(this, "observer");
|
|
4169
4170
|
}
|
|
4170
4171
|
async updated(_changedProperties) {
|
|
@@ -4195,7 +4196,7 @@ var WebwriterChoiceItem = class extends (_a2 = LitElementWw, _active_dec = [n6({
|
|
|
4195
4196
|
}
|
|
4196
4197
|
render() {
|
|
4197
4198
|
return i7(this.layout, x`
|
|
4198
|
-
${this.valid !== void 0 && (this.active || !this.active && this.valid) ? x`<sl-icon class="solution user-only" ?data-valid=${this.valid} src=${this.valid ? check_default : x_default}></sl-icon>` : null}
|
|
4199
|
+
${this.showSolution && this.valid !== void 0 && (this.active || !this.active && this.valid) ? x`<sl-icon class="solution user-only" ?data-valid=${this.valid} src=${this.valid ? check_default : x_default}></sl-icon>` : null}
|
|
4199
4200
|
<sl-checkbox class=${e5({ valid: this.valid, active: this.active })} exportparts="base, control, label" @click=${this.handleClick} @sl-change=${this.handleChange} ?checked=${this.isContentEditable ? this.valid : this.active}>
|
|
4200
4201
|
<slot part="slot" style=${o4({ "--ww-placeholder": `"${msg("Option")}"` })}></slot>
|
|
4201
4202
|
</sl-checkbox>
|
|
@@ -4203,10 +4204,12 @@ var WebwriterChoiceItem = class extends (_a2 = LitElementWw, _active_dec = [n6({
|
|
|
4203
4204
|
}
|
|
4204
4205
|
};
|
|
4205
4206
|
_init2 = __decoratorStart(_a2);
|
|
4207
|
+
_showSolution = new WeakMap();
|
|
4206
4208
|
_active = new WeakMap();
|
|
4207
4209
|
_valid = new WeakMap();
|
|
4208
4210
|
_layout = new WeakMap();
|
|
4209
4211
|
_checkbox = new WeakMap();
|
|
4212
|
+
__decorateElement(_init2, 4, "showSolution", _showSolution_dec, WebwriterChoiceItem, _showSolution);
|
|
4210
4213
|
__decorateElement(_init2, 4, "active", _active_dec, WebwriterChoiceItem, _active);
|
|
4211
4214
|
__decorateElement(_init2, 4, "valid", _valid_dec, WebwriterChoiceItem, _valid);
|
|
4212
4215
|
__decorateElement(_init2, 4, "layout", _layout_dec, WebwriterChoiceItem, _layout);
|
|
@@ -5827,7 +5827,7 @@ function shuffle(a5) {
|
|
|
5827
5827
|
}
|
|
5828
5828
|
return a5;
|
|
5829
5829
|
}
|
|
5830
|
-
var _itemsSlotEl_dec, _value_dec, _items_dec, _addItem_dec, _slotEl_dec, _randomOrder_dec, _layout_dec, _mode_dec, _a2, _WebwriterChoice_decorators, _init2, _mode, _randomOrder, _slotEl, _items, _value, _itemsSlotEl;
|
|
5830
|
+
var _itemsSlotEl_dec, _value_dec, _items_dec, _addItem_dec, _slotEl_dec, _showSolution_dec, _randomOrder_dec, _layout_dec, _mode_dec, _a2, _WebwriterChoice_decorators, _init2, _mode, _randomOrder, _showSolution, _slotEl, _items, _value, _itemsSlotEl;
|
|
5831
5831
|
_WebwriterChoice_decorators = [t4("webwriter-choice")];
|
|
5832
5832
|
var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type: String, attribute: true, reflect: true }), option({
|
|
5833
5833
|
type: "select",
|
|
@@ -5844,7 +5844,10 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
|
|
|
5844
5844
|
]
|
|
5845
5845
|
})], _randomOrder_dec = [n5({ type: Boolean, attribute: true, reflect: true }), option({
|
|
5846
5846
|
type: Boolean,
|
|
5847
|
-
label: { "en": "Random Choice Order" }
|
|
5847
|
+
label: { "en": "Random Choice Order", "de": "Zuf\xE4llige Reihenfolge" }
|
|
5848
|
+
})], _showSolution_dec = [n5({ type: Boolean, attribute: true, reflect: true }), option({
|
|
5849
|
+
type: Boolean,
|
|
5850
|
+
label: { "en": "show Solution", "de": "L\xF6sung anzeigen" }
|
|
5848
5851
|
})], _slotEl_dec = [e6("slot")], _addItem_dec = [action()], _items_dec = [o6()], _value_dec = [n5({ type: Array, attribute: false })], _itemsSlotEl_dec = [e6("#items-slot")], _a2) {
|
|
5849
5852
|
constructor() {
|
|
5850
5853
|
super(...arguments);
|
|
@@ -5852,8 +5855,9 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
|
|
|
5852
5855
|
__publicField(this, "localize", generated_default);
|
|
5853
5856
|
__privateAdd(this, _mode, __runInitializers(_init2, 8, this, "single")), __runInitializers(_init2, 11, this);
|
|
5854
5857
|
__privateAdd(this, _randomOrder, __runInitializers(_init2, 12, this, false)), __runInitializers(_init2, 15, this);
|
|
5855
|
-
__privateAdd(this,
|
|
5856
|
-
__privateAdd(this,
|
|
5858
|
+
__privateAdd(this, _showSolution, __runInitializers(_init2, 16, this, false)), __runInitializers(_init2, 19, this);
|
|
5859
|
+
__privateAdd(this, _slotEl, __runInitializers(_init2, 20, this)), __runInitializers(_init2, 23, this);
|
|
5860
|
+
__privateAdd(this, _items, __runInitializers(_init2, 24, this)), __runInitializers(_init2, 27, this);
|
|
5857
5861
|
__privateAdd(this, _value, []);
|
|
5858
5862
|
__publicField(this, "handleControlChange", (e10) => {
|
|
5859
5863
|
if (this.mode === "single") {
|
|
@@ -5868,7 +5872,7 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
|
|
|
5868
5872
|
composed: true
|
|
5869
5873
|
}));
|
|
5870
5874
|
});
|
|
5871
|
-
__privateAdd(this, _itemsSlotEl, __runInitializers(_init2,
|
|
5875
|
+
__privateAdd(this, _itemsSlotEl, __runInitializers(_init2, 28, this)), __runInitializers(_init2, 31, this);
|
|
5872
5876
|
}
|
|
5873
5877
|
get layout() {
|
|
5874
5878
|
return this.children?.item(0)?.getAttribute("layout") ?? "list";
|
|
@@ -5885,16 +5889,43 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
|
|
|
5885
5889
|
this.items.forEach((item) => value.includes(item.id) ? item.valid = true : null);
|
|
5886
5890
|
}
|
|
5887
5891
|
reportSolution() {
|
|
5892
|
+
let itemActive = false;
|
|
5893
|
+
this.items.forEach((item) => {
|
|
5894
|
+
itemActive = itemActive || item.active;
|
|
5895
|
+
});
|
|
5896
|
+
console.log(itemActive);
|
|
5897
|
+
if (!itemActive) {
|
|
5898
|
+
this.items.forEach((item) => {
|
|
5899
|
+
item.valid = void 0;
|
|
5900
|
+
item.active = false;
|
|
5901
|
+
item.style.pointerEvents = "auto";
|
|
5902
|
+
});
|
|
5903
|
+
return;
|
|
5904
|
+
}
|
|
5905
|
+
console.warn("h");
|
|
5888
5906
|
if (!this.solution) {
|
|
5889
5907
|
this.items.forEach((item) => item.valid = true);
|
|
5890
5908
|
return;
|
|
5891
5909
|
}
|
|
5892
|
-
this.items.forEach(
|
|
5910
|
+
this.items.forEach(
|
|
5911
|
+
(item) => {
|
|
5912
|
+
item.valid = (this.solution ?? []).includes(item.id);
|
|
5913
|
+
console.log(this.solution, item.active, item.valid);
|
|
5914
|
+
if (item.active != item.valid && !this.showSolution) {
|
|
5915
|
+
this.items.forEach((item2) => {
|
|
5916
|
+
item2.showSolution = false;
|
|
5917
|
+
});
|
|
5918
|
+
}
|
|
5919
|
+
item.style.pointerEvents = "none";
|
|
5920
|
+
}
|
|
5921
|
+
);
|
|
5893
5922
|
}
|
|
5894
5923
|
reset() {
|
|
5895
5924
|
this.items.forEach((item) => {
|
|
5896
5925
|
item.valid = void 0;
|
|
5897
5926
|
item.active = false;
|
|
5927
|
+
item.showSolution = true;
|
|
5928
|
+
item.style.pointerEvents = "auto";
|
|
5898
5929
|
});
|
|
5899
5930
|
this.shuffleItems();
|
|
5900
5931
|
}
|
|
@@ -5968,6 +5999,7 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
|
|
|
5968
5999
|
_init2 = __decoratorStart(_a2);
|
|
5969
6000
|
_mode = new WeakMap();
|
|
5970
6001
|
_randomOrder = new WeakMap();
|
|
6002
|
+
_showSolution = new WeakMap();
|
|
5971
6003
|
_slotEl = new WeakMap();
|
|
5972
6004
|
_items = new WeakMap();
|
|
5973
6005
|
_value = new WeakMap();
|
|
@@ -5975,6 +6007,7 @@ _itemsSlotEl = new WeakMap();
|
|
|
5975
6007
|
__decorateElement(_init2, 4, "mode", _mode_dec, WebwriterChoice, _mode);
|
|
5976
6008
|
__decorateElement(_init2, 3, "layout", _layout_dec, WebwriterChoice);
|
|
5977
6009
|
__decorateElement(_init2, 4, "randomOrder", _randomOrder_dec, WebwriterChoice, _randomOrder);
|
|
6010
|
+
__decorateElement(_init2, 4, "showSolution", _showSolution_dec, WebwriterChoice, _showSolution);
|
|
5978
6011
|
__decorateElement(_init2, 4, "slotEl", _slotEl_dec, WebwriterChoice, _slotEl);
|
|
5979
6012
|
__decorateElement(_init2, 1, "addItem", _addItem_dec, WebwriterChoice);
|
|
5980
6013
|
__decorateElement(_init2, 4, "items", _items_dec, WebwriterChoice, _items);
|
|
@@ -3324,20 +3324,21 @@ var globImport_ts = __glob({
|
|
|
3324
3324
|
var generated_default = configureLocalization({ sourceLocale, targetLocales, loadLocale: (locale) => globImport_ts(`./${locale}.ts`) });
|
|
3325
3325
|
|
|
3326
3326
|
// src/widgets/webwriter-order-item.ts
|
|
3327
|
-
var _contentSlotEl_dec, _baseEl_dec, _hideOrderButtons_dec, _validOrder_dec, _layout_dec, _dropPreview_dec, _draggable_dec, _a2, _WebwriterOrderItem_decorators, _init2, _draggable, _dropPreview, _layout, _validOrder, _hideOrderButtons, _baseEl, _contentSlotEl;
|
|
3327
|
+
var _contentSlotEl_dec, _baseEl_dec, _hideOrderButtons_dec, _validOrder_dec, _layout_dec, _dropPreview_dec, _draggable_dec, _showSolution_dec, _a2, _WebwriterOrderItem_decorators, _init2, _showSolution, _draggable, _dropPreview, _layout, _validOrder, _hideOrderButtons, _baseEl, _contentSlotEl;
|
|
3328
3328
|
_WebwriterOrderItem_decorators = [t5("webwriter-order-item")];
|
|
3329
|
-
var WebwriterOrderItem = class extends (_a2 = LitElementWw, _draggable_dec = [n6({ attribute: true, reflect: true, converter: { toAttribute: (v3) => v3 ? "true" : "false", fromAttribute: (attr) => attr === "true" } })], _dropPreview_dec = [n6({ type: String, attribute: true, reflect: true })], _layout_dec = [n6({ type: String, attribute: true, reflect: true })], _validOrder_dec = [n6({ type: Number, attribute: false })], _hideOrderButtons_dec = [n6({ type: Boolean, attribute: true, reflect: true })], _baseEl_dec = [e7("[part=base]")], _contentSlotEl_dec = [e7("#content")], _a2) {
|
|
3329
|
+
var WebwriterOrderItem = class extends (_a2 = LitElementWw, _showSolution_dec = [n6({ attribute: false, type: Boolean })], _draggable_dec = [n6({ attribute: true, reflect: true, converter: { toAttribute: (v3) => v3 ? "true" : "false", fromAttribute: (attr) => attr === "true" } })], _dropPreview_dec = [n6({ type: String, attribute: true, reflect: true })], _layout_dec = [n6({ type: String, attribute: true, reflect: true })], _validOrder_dec = [n6({ type: Number, attribute: false })], _hideOrderButtons_dec = [n6({ type: Boolean, attribute: true, reflect: true })], _baseEl_dec = [e7("[part=base]")], _contentSlotEl_dec = [e7("#content")], _a2) {
|
|
3330
3330
|
constructor() {
|
|
3331
3331
|
super(...arguments);
|
|
3332
3332
|
__publicField(this, "localize", generated_default);
|
|
3333
|
-
__privateAdd(this,
|
|
3333
|
+
__privateAdd(this, _showSolution, __runInitializers(_init2, 8, this, true)), __runInitializers(_init2, 11, this);
|
|
3334
|
+
__privateAdd(this, _draggable, __runInitializers(_init2, 12, this, true)), __runInitializers(_init2, 15, this);
|
|
3334
3335
|
__publicField(this, "emitClearDropPreview", () => {
|
|
3335
3336
|
this.dispatchEvent(new CustomEvent("webwriter-clear-drop-preview", { bubbles: true }));
|
|
3336
3337
|
});
|
|
3337
|
-
__privateAdd(this, _dropPreview, __runInitializers(_init2,
|
|
3338
|
-
__privateAdd(this, _layout, __runInitializers(_init2,
|
|
3339
|
-
__privateAdd(this, _validOrder, __runInitializers(_init2,
|
|
3340
|
-
__privateAdd(this, _hideOrderButtons, __runInitializers(_init2,
|
|
3338
|
+
__privateAdd(this, _dropPreview, __runInitializers(_init2, 16, this)), __runInitializers(_init2, 19, this);
|
|
3339
|
+
__privateAdd(this, _layout, __runInitializers(_init2, 20, this, "list")), __runInitializers(_init2, 23, this);
|
|
3340
|
+
__privateAdd(this, _validOrder, __runInitializers(_init2, 24, this)), __runInitializers(_init2, 27, this);
|
|
3341
|
+
__privateAdd(this, _hideOrderButtons, __runInitializers(_init2, 28, this, false)), __runInitializers(_init2, 31, this);
|
|
3341
3342
|
__publicField(this, "handleClick", (e10, up = false) => {
|
|
3342
3343
|
if (e10.target.id === "up") {
|
|
3343
3344
|
this.dispatchEvent(new CustomEvent("ww-moveup", { bubbles: true }));
|
|
@@ -3346,8 +3347,8 @@ var WebwriterOrderItem = class extends (_a2 = LitElementWw, _draggable_dec = [n6
|
|
|
3346
3347
|
}
|
|
3347
3348
|
e10.stopPropagation();
|
|
3348
3349
|
});
|
|
3349
|
-
__privateAdd(this, _baseEl, __runInitializers(_init2,
|
|
3350
|
-
__privateAdd(this, _contentSlotEl, __runInitializers(_init2,
|
|
3350
|
+
__privateAdd(this, _baseEl, __runInitializers(_init2, 32, this)), __runInitializers(_init2, 35, this);
|
|
3351
|
+
__privateAdd(this, _contentSlotEl, __runInitializers(_init2, 36, this)), __runInitializers(_init2, 39, this);
|
|
3351
3352
|
__publicField(this, "observer");
|
|
3352
3353
|
}
|
|
3353
3354
|
get elementIndex() {
|
|
@@ -3439,7 +3440,7 @@ var WebwriterOrderItem = class extends (_a2 = LitElementWw, _draggable_dec = [n6
|
|
|
3439
3440
|
render() {
|
|
3440
3441
|
const solution = this.validOrder !== void 0 ? x`<span class="solution" ?data-valid=${this.elementIndex === this.validOrder}>${this.validOrder + 1}</span>` : null;
|
|
3441
3442
|
return x`<ol part="base" start=${this.elementIndex + 1}>
|
|
3442
|
-
${this.layout === "list" ? solution : null}
|
|
3443
|
+
${this.layout === "list" && this.showSolution ? solution : null}
|
|
3443
3444
|
<li id="main-li">
|
|
3444
3445
|
<slot id="content" style=${o4({ "--ww-placeholder": `"${msg("Option")}"`, "--offset": `${this.contentSlotEl?.offsetLeft + 1}px` })}></slot>
|
|
3445
3446
|
</li>
|
|
@@ -3450,12 +3451,13 @@ var WebwriterOrderItem = class extends (_a2 = LitElementWw, _draggable_dec = [n6
|
|
|
3450
3451
|
</ol>
|
|
3451
3452
|
<ol id="count" start=${this.elementIndex + 1}>
|
|
3452
3453
|
<li ?data-two-digit=${this.elementIndex + 1 >= 10}></li>
|
|
3453
|
-
${this.layout === "tiles" ? solution : null}
|
|
3454
|
+
${this.layout === "tiles" && this.showSolution ? solution : null}
|
|
3454
3455
|
</ol>
|
|
3455
3456
|
<div id="handle"></div>`;
|
|
3456
3457
|
}
|
|
3457
3458
|
};
|
|
3458
3459
|
_init2 = __decoratorStart(_a2);
|
|
3460
|
+
_showSolution = new WeakMap();
|
|
3459
3461
|
_draggable = new WeakMap();
|
|
3460
3462
|
_dropPreview = new WeakMap();
|
|
3461
3463
|
_layout = new WeakMap();
|
|
@@ -3463,6 +3465,7 @@ _validOrder = new WeakMap();
|
|
|
3463
3465
|
_hideOrderButtons = new WeakMap();
|
|
3464
3466
|
_baseEl = new WeakMap();
|
|
3465
3467
|
_contentSlotEl = new WeakMap();
|
|
3468
|
+
__decorateElement(_init2, 4, "showSolution", _showSolution_dec, WebwriterOrderItem, _showSolution);
|
|
3466
3469
|
__decorateElement(_init2, 4, "draggable", _draggable_dec, WebwriterOrderItem, _draggable);
|
|
3467
3470
|
__decorateElement(_init2, 4, "dropPreview", _dropPreview_dec, WebwriterOrderItem, _dropPreview);
|
|
3468
3471
|
__decorateElement(_init2, 4, "layout", _layout_dec, WebwriterOrderItem, _layout);
|