@pocketprep/ui-kit 3.0.38 → 3.1.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.
- package/dist/@pocketprep/ui-kit.js +5639 -5655
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +7 -7
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/EmptyStates/EmptyState.vue +19 -2
- package/lib/components/Quiz/Question.vue +28 -40
- package/package.json +2 -2
|
@@ -160,13 +160,30 @@ export default class EmptyState extends Vue {
|
|
|
160
160
|
position: relative;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
&__icon {
|
|
164
|
+
width: 22px;
|
|
165
|
+
height: 22px;
|
|
166
|
+
|
|
167
|
+
@include breakpoint(black-bear) {
|
|
168
|
+
width: 30px;
|
|
169
|
+
height: 30px;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
163
173
|
&__blob {
|
|
164
174
|
position: absolute;
|
|
165
175
|
top: 3.5px;
|
|
166
|
-
left:
|
|
167
|
-
width:
|
|
176
|
+
left: 2px;
|
|
177
|
+
width: 37px;
|
|
168
178
|
height: 33px;
|
|
169
179
|
z-index: -1;
|
|
180
|
+
|
|
181
|
+
@include breakpoint(black-bear) {
|
|
182
|
+
width: 48px;
|
|
183
|
+
height: 43px;
|
|
184
|
+
top: auto;
|
|
185
|
+
left: auto;
|
|
186
|
+
}
|
|
170
187
|
}
|
|
171
188
|
}
|
|
172
189
|
</style>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
:class="{
|
|
103
103
|
'uikit-question__prompt--passage-and-image': question.passage || passageImageUrl,
|
|
104
104
|
}"
|
|
105
|
-
v-html="question.
|
|
105
|
+
v-html="question.prompt"
|
|
106
106
|
/>
|
|
107
107
|
<PocketButton
|
|
108
108
|
v-if="question.passage || passageImageUrl"
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
'uikit-question__toggle-dropdown-explanation-img-description--open':
|
|
462
462
|
showExplanationImageLongAlt,
|
|
463
463
|
'uikit-question__toggle-dropdown-explanation-img-description--no-reference':
|
|
464
|
-
!
|
|
464
|
+
!reference || hideReferences,
|
|
465
465
|
}"
|
|
466
466
|
:is-dark-mode="isDarkMode"
|
|
467
467
|
:aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
|
|
@@ -490,12 +490,12 @@
|
|
|
490
490
|
v-html="explanationImageLongAlt"
|
|
491
491
|
/>
|
|
492
492
|
<div
|
|
493
|
-
v-if="
|
|
493
|
+
v-if="reference && !hideReferences"
|
|
494
494
|
v-dark="isDarkMode"
|
|
495
495
|
class="uikit-question__dropdown-reference"
|
|
496
496
|
>
|
|
497
497
|
<span class="uikit-question__dropdown-reference-label">Reference: </span>
|
|
498
|
-
<div v-html="
|
|
498
|
+
<div v-html="reference" />
|
|
499
499
|
</div>
|
|
500
500
|
</div>
|
|
501
501
|
</div>
|
|
@@ -661,7 +661,7 @@
|
|
|
661
661
|
'uikit-question__toggle-summary-dropdown-explanation-img-description--open':
|
|
662
662
|
showExplanationImageLongAlt,
|
|
663
663
|
'uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference':
|
|
664
|
-
!
|
|
664
|
+
!reference || hideReferences,
|
|
665
665
|
}"
|
|
666
666
|
:is-dark-mode="isDarkMode"
|
|
667
667
|
:aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
|
|
@@ -690,12 +690,12 @@
|
|
|
690
690
|
v-html="explanationImageLongAlt"
|
|
691
691
|
/>
|
|
692
692
|
<div
|
|
693
|
-
v-if="
|
|
693
|
+
v-if="reference && !hideReferences"
|
|
694
694
|
v-dark="isDarkMode"
|
|
695
695
|
class="uikit-question__summary-dropdown-reference"
|
|
696
696
|
>
|
|
697
697
|
<span class="uikit-question__summary-dropdown-reference-label">Reference: </span>
|
|
698
|
-
<div v-html="
|
|
698
|
+
<div v-html="reference" />
|
|
699
699
|
</div>
|
|
700
700
|
</div>
|
|
701
701
|
<Icon
|
|
@@ -924,12 +924,12 @@
|
|
|
924
924
|
v-html="explanationImageLongAlt"
|
|
925
925
|
/>
|
|
926
926
|
<div
|
|
927
|
-
v-if="
|
|
927
|
+
v-if="reference && !hideReferences"
|
|
928
928
|
v-dark="isDarkMode"
|
|
929
929
|
class="uikit-question__reference"
|
|
930
930
|
>
|
|
931
931
|
<span class="uikit-question__reference-label">Reference: </span>
|
|
932
|
-
<div v-html="
|
|
932
|
+
<div v-html="reference" />
|
|
933
933
|
</div>
|
|
934
934
|
<div
|
|
935
935
|
v-if="!reviewMode"
|
|
@@ -1001,7 +1001,7 @@ type TViewNames = {
|
|
|
1001
1001
|
},
|
|
1002
1002
|
})
|
|
1003
1003
|
export default class Question extends Vue {
|
|
1004
|
-
@Prop() question!: Study.Class.
|
|
1004
|
+
@Prop() question!: Study.Class.QuestionJSON
|
|
1005
1005
|
@Prop() questionNumber!: number
|
|
1006
1006
|
@Prop() quizLength!: number
|
|
1007
1007
|
@Prop({ default: '' }) imageUrlPrefix!: string
|
|
@@ -1094,33 +1094,31 @@ export default class Question extends Vue {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
1096
|
get passageImageUrl () {
|
|
1097
|
-
const imageUrl = this.question.
|
|
1098
|
-
|| this.question.images?.Question // Legacy support - TODO: remove when `Question` is deprecated
|
|
1097
|
+
const imageUrl = this.question.passageImage?.url
|
|
1099
1098
|
|
|
1100
1099
|
return imageUrl ? `${this.imageUrlPrefix}${imageUrl}` : null
|
|
1101
1100
|
}
|
|
1102
1101
|
|
|
1103
1102
|
get passageImageAlt () {
|
|
1104
|
-
return this.question.
|
|
1103
|
+
return this.question.passageImage?.altText
|
|
1105
1104
|
}
|
|
1106
1105
|
|
|
1107
1106
|
get passageImageLongAlt () {
|
|
1108
|
-
return this.question.
|
|
1107
|
+
return this.question.passageImage?.longAltText
|
|
1109
1108
|
}
|
|
1110
1109
|
|
|
1111
1110
|
get explanationImageUrl () {
|
|
1112
|
-
const imageUrl = this.question.
|
|
1113
|
-
|| this.question.images?.Explanation // Legacy support - TODO: remove when `Explanation` is deprecated
|
|
1111
|
+
const imageUrl = this.question.explanationImage?.url
|
|
1114
1112
|
|
|
1115
1113
|
return imageUrl ? `${this.imageUrlPrefix}${imageUrl}` : null
|
|
1116
1114
|
}
|
|
1117
1115
|
|
|
1118
1116
|
get explanationImageAlt () {
|
|
1119
|
-
return this.question.
|
|
1117
|
+
return this.question.explanationImage?.altText
|
|
1120
1118
|
}
|
|
1121
1119
|
|
|
1122
1120
|
get explanationImageLongAlt () {
|
|
1123
|
-
return this.question.
|
|
1121
|
+
return this.question.explanationImage?.longAltText
|
|
1124
1122
|
}
|
|
1125
1123
|
|
|
1126
1124
|
get showPassageAndImage () {
|
|
@@ -1137,18 +1135,15 @@ export default class Question extends Vue {
|
|
|
1137
1135
|
}
|
|
1138
1136
|
}
|
|
1139
1137
|
|
|
1138
|
+
get reference () {
|
|
1139
|
+
return this.question.references?.length ? this.question.references.join('') : undefined
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1140
1142
|
get answers (): TChoice[] {
|
|
1141
|
-
const answers =
|
|
1142
|
-
|
|
1143
|
-
{
|
|
1144
|
-
|
|
1145
|
-
{ text: this.question.answer4, key: 'a4' },
|
|
1146
|
-
{ text: this.question.answer5, key: 'a5' },
|
|
1147
|
-
{ text: this.question.answer6, key: 'a6' },
|
|
1148
|
-
{ text: this.question.answer7, key: 'a7' },
|
|
1149
|
-
{ text: this.question.answer8, key: 'a8' },
|
|
1150
|
-
{ text: this.question.answer9, key: 'a9' },
|
|
1151
|
-
] as const
|
|
1143
|
+
const answers = this.question.choices.filter(choice => choice.isCorrect).map((choice, index) => ({
|
|
1144
|
+
text: choice.text,
|
|
1145
|
+
key: `a${index + 1}` as `a${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
|
|
1146
|
+
}))
|
|
1152
1147
|
|
|
1153
1148
|
return answers.filter(choice => !!choice.text)
|
|
1154
1149
|
}
|
|
@@ -1158,17 +1153,10 @@ export default class Question extends Vue {
|
|
|
1158
1153
|
}
|
|
1159
1154
|
|
|
1160
1155
|
get distractors (): TChoice[] {
|
|
1161
|
-
const distractors =
|
|
1162
|
-
|
|
1163
|
-
{
|
|
1164
|
-
|
|
1165
|
-
{ text: this.question.distractor4, key: 'd4' },
|
|
1166
|
-
{ text: this.question.distractor5, key: 'd5' },
|
|
1167
|
-
{ text: this.question.distractor6, key: 'd6' },
|
|
1168
|
-
{ text: this.question.distractor7, key: 'd7' },
|
|
1169
|
-
{ text: this.question.distractor8, key: 'd8' },
|
|
1170
|
-
{ text: this.question.distractor9, key: 'd9' },
|
|
1171
|
-
] as const
|
|
1156
|
+
const distractors = this.question.choices.filter(choice => !choice.isCorrect).map((choice, index) => ({
|
|
1157
|
+
text: choice.text,
|
|
1158
|
+
key: `d${index + 1}` as `d${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
|
|
1159
|
+
}))
|
|
1172
1160
|
|
|
1173
1161
|
return distractors.filter(choice => !!choice.text)
|
|
1174
1162
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pocketprep/ui-kit",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Pocket Prep UI Kit",
|
|
5
5
|
"author": "pocketprep",
|
|
6
6
|
"scripts": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"vue-facing-decorator": "2.1.20"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@pocketprep/types": "1.
|
|
80
|
+
"@pocketprep/types": "1.11.1",
|
|
81
81
|
"@tsconfig/node16": "1.0.3",
|
|
82
82
|
"@types/node": "16.18.25",
|
|
83
83
|
"@vitejs/plugin-vue": "4.2.1",
|