@vue-skuilder/common-ui 0.1.4 → 0.1.5
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/assets/index.css +1 -1
- package/dist/common-ui.es.js +38 -21
- package/dist/common-ui.es.js.map +1 -1
- package/dist/common-ui.umd.js +2 -2
- package/dist/common-ui.umd.js.map +1 -1
- package/dist/components/HeatMap.types.d.ts +1 -0
- package/dist/components/HeatMap.types.d.ts.map +1 -0
- package/dist/components/PaginatingToolbar.types.d.ts +1 -0
- package/dist/components/PaginatingToolbar.types.d.ts.map +1 -0
- package/dist/components/SkMouseTrap.types.d.ts +1 -0
- package/dist/components/SkMouseTrap.types.d.ts.map +1 -0
- package/dist/components/SkMouseTrapToolTip.types.d.ts +1 -0
- package/dist/components/SkMouseTrapToolTip.types.d.ts.map +1 -0
- package/dist/components/SnackbarService.d.ts +1 -0
- package/dist/components/SnackbarService.d.ts.map +1 -0
- package/dist/components/StudySession.types.d.ts +1 -0
- package/dist/components/StudySession.types.d.ts.map +1 -0
- package/dist/components/auth/index.d.ts +1 -0
- package/dist/components/auth/index.d.ts.map +1 -0
- package/dist/components/cardRendering/MarkdownRendererHelpers.d.ts +1 -0
- package/dist/components/cardRendering/MarkdownRendererHelpers.d.ts.map +1 -0
- package/dist/components/studentInputs/BaseUserInput.d.ts +1 -0
- package/dist/components/studentInputs/BaseUserInput.d.ts.map +1 -0
- package/dist/components/studentInputs/RadioMultipleChoice.types.d.ts +1 -0
- package/dist/components/studentInputs/RadioMultipleChoice.types.d.ts.map +1 -0
- package/dist/composables/CompositionViewable.d.ts +1 -0
- package/dist/composables/CompositionViewable.d.ts.map +1 -0
- package/dist/composables/Displayable.d.ts +1 -0
- package/dist/composables/Displayable.d.ts.map +1 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/plugins/pinia.d.ts +1 -0
- package/dist/plugins/pinia.d.ts.map +1 -0
- package/dist/stores/useAuthStore.d.ts +1 -0
- package/dist/stores/useAuthStore.d.ts.map +1 -0
- package/dist/stores/useCardPreviewModeStore.d.ts +1 -0
- package/dist/stores/useCardPreviewModeStore.d.ts.map +1 -0
- package/dist/stores/useConfigStore.d.ts +1 -0
- package/dist/stores/useConfigStore.d.ts.map +1 -0
- package/dist/utils/SkldrMouseTrap.d.ts +1 -0
- package/dist/utils/SkldrMouseTrap.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/StudySession.vue +52 -23
- package/src/components/cardRendering/MarkdownRendererHelpers.ts +2 -2
- package/src/components/studentInputs/BaseUserInput.ts +0 -1
- package/src/plugins/pinia.ts +1 -1
package/dist/assets/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.tooltip[data-v-ca46239a]{background-color:#000c;color:#fff;padding:5px;border-radius:3px;font-size:12px}.sk-mousetrap-tooltip-wrapper[data-v-5d6fb09c]{display:inline-block;position:relative}.sk-mousetrap-tooltip[data-v-5d6fb09c]{position:absolute;background-color:#000c;color:#fff;padding:2px 6px;border-radius:4px;font-size:12px;white-space:nowrap;pointer-events:none;z-index:9999}.sk-mt-tooltip-top[data-v-5d6fb09c]{bottom:100%;margin-bottom:5px;left:50%;transform:translate(-50%)}.sk-mt-tooltip-bottom[data-v-5d6fb09c]{top:100%;margin-top:5px;left:50%;transform:translate(-50%)}.sk-mt-tooltip-left[data-v-5d6fb09c]{right:100%;margin-right:5px;top:50%;transform:translateY(-50%)}.sk-mt-tooltip-right[data-v-5d6fb09c]{left:100%;margin-left:5px;top:50%;transform:translateY(-50%)}.sk-mousetrap-highlight-glow[data-v-5d6fb09c]{box-shadow:0 0 8px 2px #1976d299;transition:box-shadow .25s ease}.sk-mousetrap-highlight-scale[data-v-5d6fb09c]{transform:scale(1.03);transition:transform .25s ease}.sk-mousetrap-highlight-border[data-v-5d6fb09c]{outline:2px solid rgba(25,118,210,.8);outline-offset:2px;border-radius:4px;transition:outline .25s ease,outline-offset .25s ease}.fade-enter-active[data-v-5d6fb09c],.fade-leave-active[data-v-5d6fb09c]{transition:opacity .25s ease}.fade-enter-from[data-v-5d6fb09c],.fade-leave-to[data-v-5d6fb09c]{opacity:0}.pageSelect[data-v-39413af8]{max-width:60px}.timer-container[data-v-5960940a]{display:inline-flex;cursor:pointer}.cardView[data-v-a180fe1c]{padding:15px;border-radius:8px}.component-fade-enter-active[data-v-a180fe1c],.component-fade-leave-active[data-v-a180fe1c]{transition:opacity .3s ease}.component-fade-enter[data-v-a180fe1c],.component-fade-leave-to[data-v-a180fe1c]{opacity:0}.footer-controls[data-v-
|
|
1
|
+
.tooltip[data-v-ca46239a]{background-color:#000c;color:#fff;padding:5px;border-radius:3px;font-size:12px}.sk-mousetrap-tooltip-wrapper[data-v-5d6fb09c]{display:inline-block;position:relative}.sk-mousetrap-tooltip[data-v-5d6fb09c]{position:absolute;background-color:#000c;color:#fff;padding:2px 6px;border-radius:4px;font-size:12px;white-space:nowrap;pointer-events:none;z-index:9999}.sk-mt-tooltip-top[data-v-5d6fb09c]{bottom:100%;margin-bottom:5px;left:50%;transform:translate(-50%)}.sk-mt-tooltip-bottom[data-v-5d6fb09c]{top:100%;margin-top:5px;left:50%;transform:translate(-50%)}.sk-mt-tooltip-left[data-v-5d6fb09c]{right:100%;margin-right:5px;top:50%;transform:translateY(-50%)}.sk-mt-tooltip-right[data-v-5d6fb09c]{left:100%;margin-left:5px;top:50%;transform:translateY(-50%)}.sk-mousetrap-highlight-glow[data-v-5d6fb09c]{box-shadow:0 0 8px 2px #1976d299;transition:box-shadow .25s ease}.sk-mousetrap-highlight-scale[data-v-5d6fb09c]{transform:scale(1.03);transition:transform .25s ease}.sk-mousetrap-highlight-border[data-v-5d6fb09c]{outline:2px solid rgba(25,118,210,.8);outline-offset:2px;border-radius:4px;transition:outline .25s ease,outline-offset .25s ease}.fade-enter-active[data-v-5d6fb09c],.fade-leave-active[data-v-5d6fb09c]{transition:opacity .25s ease}.fade-enter-from[data-v-5d6fb09c],.fade-leave-to[data-v-5d6fb09c]{opacity:0}.pageSelect[data-v-39413af8]{max-width:60px}.timer-container[data-v-5960940a]{display:inline-flex;cursor:pointer}.cardView[data-v-a180fe1c]{padding:15px;border-radius:8px}.component-fade-enter-active[data-v-a180fe1c],.component-fade-leave-active[data-v-a180fe1c]{transition:opacity .3s ease}.component-fade-enter[data-v-a180fe1c],.component-fade-leave-to[data-v-a180fe1c]{opacity:0}.footer-controls[data-v-37cad857]{position:fixed;bottom:0;background-color:var(--v-background);z-index:100}.footer-right[data-v-37cad857]{position:fixed;bottom:0;right:0;background-color:var(--v-background);z-index:100}.correct[data-v-37cad857]{animation:varFade-37cad857 1.25s ease-out}.incorrect[data-v-37cad857]{animation:purpleFade-37cad857 1.25s ease-out}a[data-v-37cad857]{text-decoration:underline}@keyframes varFade-37cad857{0%{box-shadow:rgba(var(--r),var(--g),0,.25) 0 7px 8px -4px,rgba(var(--r),var(--g),0,.25) 0 12px 17px 2px,rgba(var(--r),var(--g),0,.25) 0 5px 22px 4px}to{box-shadow:#00960000 0 0}}@keyframes greenFade-37cad857{0%{box-shadow:#00960040 0 7px 8px -4px,#00960040 0 12px 17px 2px,#00960040 0 5px 22px 4px}to{box-shadow:#00960000 0 0}}@keyframes purpleFade-37cad857{0%{box-shadow:#73004b40 0 7px 8px -4px,#73004b40 0 12px 17px 2px,#73004b40 0 5px 22px 4px}to{box-shadow:#73004b00 0 0}}.choice[data-v-96de7172]{text-align:center;display:inline-block;border-radius:4px;padding:5px 15px;margin:10px;min-width:75px;transition:all .2s ease-in-out}.selected[data-v-96de7172]{transform:translateY(-10px) scale(1.15);z-index:1}.not-selected[data-v-96de7172]{z-index:0}.userInput[data-v-a56dcd1c]{border:none;text-align:center;border-bottom:1px black}.user-input-container[data-v-aa14961f]{display:inline-block;min-width:6em;vertical-align:baseline}.user-input-string[data-v-aa14961f]{display:inline-block;background:transparent;border:none;border-bottom:1px solid currentColor;color:currentColor;font-family:inherit;font-size:inherit;line-height:inherit;padding:0;margin:0;text-align:center;width:100%;outline:none}.user-input-string[data-v-aa14961f]:focus{border-bottom:2px solid currentColor}#input[data-v-486ac035]{display:inline-block;min-width:4em;text-align:center}.underline[data-v-486ac035]{text-decoration:underline;text-decoration-style:solid 14px}.cardView[data-v-9ca53bc4]{padding:15px;border-radius:8px}.component-fade-enter-active[data-v-9ca53bc4],.component-fade-leave-active[data-v-9ca53bc4]{transition:opacity .3s ease}.component-fade-enter[data-v-9ca53bc4],.component-fade-leave-to[data-v-9ca53bc4]{opacity:0}.playing[data-v-e1a0f62c]{animation:.85s ease-in-out infinite alternate pulse-e1a0f62c;z-index:1}@keyframes pulse-e1a0f62c{0%{transform:scale(1)}to{transform:scale(1.15)}}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
2
|
Theme: GitHub
|
|
3
3
|
Description: Light theme as seen on github.com
|
|
4
4
|
Author: github.com
|
package/dist/common-ui.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { defineComponent, createElementBlock, openBlock, createCommentVNode, Fragment, renderList, normalizeStyle, toDisplayString, resolveComponent, createBlock, withCtx, createVNode, createTextVNode, createElementVNode, mergeProps, ref, computed, watch, onMounted, onBeforeUnmount, normalizeClass, renderSlot, Transition, resolveDynamicComponent, defineAsyncComponent, withKeys, withDirectives, vModelText, getCurrentInstance, h,
|
|
4
|
+
import { defineComponent, createElementBlock, openBlock, createCommentVNode, Fragment, renderList, normalizeStyle, toDisplayString, resolveComponent, createBlock, withCtx, createVNode, createTextVNode, createElementVNode, mergeProps, ref, computed, watch, onMounted, onBeforeUnmount, normalizeClass, renderSlot, Transition, resolveDynamicComponent, markRaw, defineAsyncComponent, withKeys, withDirectives, vModelText, getCurrentInstance, h, withModifiers } from "vue";
|
|
5
5
|
import { Status, FieldType, isCourseElo, toCourseElo, displayableDataToViewData, adjustCourseScores, log } from "@vue-skuilder/common";
|
|
6
6
|
import { docIsDeleted, isReview, newInterval, isQuestionRecord, getStudySource, SessionController, getDataLayer, GuestUsername } from "@vue-skuilder/db";
|
|
7
7
|
import { defineStore, setActivePinia } from "pinia";
|
|
@@ -6582,23 +6582,25 @@ const _sfc_main$f = defineComponent({
|
|
|
6582
6582
|
try {
|
|
6583
6583
|
console.log(`[StudySession] starting study session w/ sources: ${JSON.stringify(this.contentSources)}`);
|
|
6584
6584
|
console.log("[StudySession] Beginning preparation process");
|
|
6585
|
-
this.sessionContentSources = (
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6585
|
+
this.sessionContentSources = markRaw(
|
|
6586
|
+
(await Promise.all(
|
|
6587
|
+
this.contentSources.map(async (s) => {
|
|
6588
|
+
try {
|
|
6589
|
+
return await getStudySource(s, this.user);
|
|
6590
|
+
} catch (e) {
|
|
6591
|
+
console.error(`Failed to load study source: ${s.type}/${s.id}`, e);
|
|
6592
|
+
return null;
|
|
6593
|
+
}
|
|
6594
|
+
})
|
|
6595
|
+
)).filter((s) => s !== null)
|
|
6596
|
+
);
|
|
6595
6597
|
this.timeRemaining = this.sessionTimeLimit * 60;
|
|
6596
6598
|
sessionClassroomDBs = await Promise.all(
|
|
6597
6599
|
this.contentSources.filter((s) => s.type === "classroom").map(async (c) => await this.dataLayer.getClassroomDB(c.id, "student"))
|
|
6598
6600
|
);
|
|
6599
|
-
sessionClassroomDBs.forEach((
|
|
6601
|
+
sessionClassroomDBs.forEach((_db) => {
|
|
6600
6602
|
});
|
|
6601
|
-
this.sessionController = new SessionController(this.sessionContentSources, 60 * this.sessionTimeLimit);
|
|
6603
|
+
this.sessionController = markRaw(new SessionController(this.sessionContentSources, 60 * this.sessionTimeLimit));
|
|
6602
6604
|
this.sessionController.sessionRecord = this.sessionRecord;
|
|
6603
6605
|
await this.sessionController.prepareSession();
|
|
6604
6606
|
this.intervalHandler = setInterval(this.tick, 1e3);
|
|
@@ -6728,12 +6730,15 @@ const _sfc_main$f = defineComponent({
|
|
|
6728
6730
|
if (cardElo && userElo) {
|
|
6729
6731
|
const eloUpdate = adjustCourseScores(userElo, cardElo, userScore);
|
|
6730
6732
|
this.userCourseRegDoc.courses.find((c) => c.courseID === course_id).elo = eloUpdate.userElo;
|
|
6731
|
-
Promise.
|
|
6733
|
+
const results = await Promise.allSettled([
|
|
6732
6734
|
this.user.updateUserElo(course_id, eloUpdate.userElo),
|
|
6733
6735
|
courseDB.updateCardElo(card_id, eloUpdate.cardElo)
|
|
6734
|
-
])
|
|
6735
|
-
|
|
6736
|
-
|
|
6736
|
+
]);
|
|
6737
|
+
const userEloStatus = results[0].status === "fulfilled";
|
|
6738
|
+
const cardEloStatus = results[1].status === "fulfilled";
|
|
6739
|
+
if (userEloStatus && cardEloStatus) {
|
|
6740
|
+
const user = results[0].value;
|
|
6741
|
+
const card = results[1].value;
|
|
6737
6742
|
if (user.ok && card && card.ok) {
|
|
6738
6743
|
console.log(
|
|
6739
6744
|
`[StudySession] Updated ELOS:
|
|
@@ -6742,7 +6747,19 @@ const _sfc_main$f = defineComponent({
|
|
|
6742
6747
|
`
|
|
6743
6748
|
);
|
|
6744
6749
|
}
|
|
6745
|
-
}
|
|
6750
|
+
} else {
|
|
6751
|
+
console.log(
|
|
6752
|
+
`[StudySession] Partial ELO update:
|
|
6753
|
+
User ELO update: ${userEloStatus ? "SUCCESS" : "FAILED"}
|
|
6754
|
+
Card ELO update: ${cardEloStatus ? "SUCCESS" : "FAILED"}`
|
|
6755
|
+
);
|
|
6756
|
+
if (!userEloStatus && results[0].status === "rejected") {
|
|
6757
|
+
console.error("[StudySession] User ELO update error:", results[0].reason);
|
|
6758
|
+
}
|
|
6759
|
+
if (!cardEloStatus && results[1].status === "rejected") {
|
|
6760
|
+
console.error("[StudySession] Card ELO update error:", results[1].reason);
|
|
6761
|
+
}
|
|
6762
|
+
}
|
|
6746
6763
|
}
|
|
6747
6764
|
},
|
|
6748
6765
|
clearFeedbackShadow() {
|
|
@@ -6970,7 +6987,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6970
6987
|
})
|
|
6971
6988
|
])) : createCommentVNode("", true);
|
|
6972
6989
|
}
|
|
6973
|
-
const StudySession = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$a], ["__scopeId", "data-v-
|
|
6990
|
+
const StudySession = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$a], ["__scopeId", "data-v-37cad857"]]);
|
|
6974
6991
|
let _pinia = null;
|
|
6975
6992
|
const setPinia = (pinia) => {
|
|
6976
6993
|
_pinia = pinia;
|
|
@@ -6979,7 +6996,7 @@ const getPinia = () => {
|
|
|
6979
6996
|
return _pinia;
|
|
6980
6997
|
};
|
|
6981
6998
|
const piniaPlugin = {
|
|
6982
|
-
install(
|
|
6999
|
+
install(_app, options) {
|
|
6983
7000
|
const pinia = options?.pinia;
|
|
6984
7001
|
if (pinia) {
|
|
6985
7002
|
setPinia(pinia);
|
|
@@ -9732,7 +9749,7 @@ function splitTextToken(token2) {
|
|
|
9732
9749
|
const textChunks = splitByDelimiters(token2.text, "{{", "}}");
|
|
9733
9750
|
const rawChunks = splitByDelimiters(token2.raw, "{{", "}}");
|
|
9734
9751
|
if (textChunks.length === rawChunks.length) {
|
|
9735
|
-
return textChunks.map((
|
|
9752
|
+
return textChunks.map((_c, i) => {
|
|
9736
9753
|
return {
|
|
9737
9754
|
type: "text",
|
|
9738
9755
|
text: textChunks[i],
|