@vue-skuilder/common-ui 0.1.3 → 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.
Files changed (48) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/common-ui.es.js +39 -55
  3. package/dist/common-ui.es.js.map +1 -1
  4. package/dist/common-ui.umd.js +2 -7
  5. package/dist/common-ui.umd.js.map +1 -1
  6. package/dist/components/HeatMap.types.d.ts +1 -0
  7. package/dist/components/HeatMap.types.d.ts.map +1 -0
  8. package/dist/components/PaginatingToolbar.types.d.ts +1 -0
  9. package/dist/components/PaginatingToolbar.types.d.ts.map +1 -0
  10. package/dist/components/SkMouseTrap.types.d.ts +1 -0
  11. package/dist/components/SkMouseTrap.types.d.ts.map +1 -0
  12. package/dist/components/SkMouseTrapToolTip.types.d.ts +1 -0
  13. package/dist/components/SkMouseTrapToolTip.types.d.ts.map +1 -0
  14. package/dist/components/SnackbarService.d.ts +1 -0
  15. package/dist/components/SnackbarService.d.ts.map +1 -0
  16. package/dist/components/StudySession.types.d.ts +1 -0
  17. package/dist/components/StudySession.types.d.ts.map +1 -0
  18. package/dist/components/auth/index.d.ts +1 -0
  19. package/dist/components/auth/index.d.ts.map +1 -0
  20. package/dist/components/cardRendering/MarkdownRendererHelpers.d.ts +1 -0
  21. package/dist/components/cardRendering/MarkdownRendererHelpers.d.ts.map +1 -0
  22. package/dist/components/studentInputs/BaseUserInput.d.ts +1 -0
  23. package/dist/components/studentInputs/BaseUserInput.d.ts.map +1 -0
  24. package/dist/components/studentInputs/RadioMultipleChoice.types.d.ts +1 -0
  25. package/dist/components/studentInputs/RadioMultipleChoice.types.d.ts.map +1 -0
  26. package/dist/composables/CompositionViewable.d.ts +1 -0
  27. package/dist/composables/CompositionViewable.d.ts.map +1 -0
  28. package/dist/composables/Displayable.d.ts +1 -0
  29. package/dist/composables/Displayable.d.ts.map +1 -0
  30. package/dist/composables/index.d.ts +1 -0
  31. package/dist/composables/index.d.ts.map +1 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/plugins/pinia.d.ts +1 -0
  35. package/dist/plugins/pinia.d.ts.map +1 -0
  36. package/dist/stores/useAuthStore.d.ts +1 -0
  37. package/dist/stores/useAuthStore.d.ts.map +1 -0
  38. package/dist/stores/useCardPreviewModeStore.d.ts +1 -0
  39. package/dist/stores/useCardPreviewModeStore.d.ts.map +1 -0
  40. package/dist/stores/useConfigStore.d.ts +1 -0
  41. package/dist/stores/useConfigStore.d.ts.map +1 -0
  42. package/dist/utils/SkldrMouseTrap.d.ts +1 -0
  43. package/dist/utils/SkldrMouseTrap.d.ts.map +1 -0
  44. package/package.json +4 -3
  45. package/src/components/StudySession.vue +52 -23
  46. package/src/components/cardRendering/MarkdownRendererHelpers.ts +2 -2
  47. package/src/components/studentInputs/BaseUserInput.ts +0 -1
  48. package/src/plugins/pinia.ts +1 -1
@@ -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-70e29902]{position:fixed;bottom:0;background-color:var(--v-background);z-index:100}.footer-right[data-v-70e29902]{position:fixed;bottom:0;right:0;background-color:var(--v-background);z-index:100}.correct[data-v-70e29902]{animation:varFade-70e29902 1.25s ease-out}.incorrect[data-v-70e29902]{animation:purpleFade-70e29902 1.25s ease-out}a[data-v-70e29902]{text-decoration:underline}@keyframes varFade-70e29902{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-70e29902{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-70e29902{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}/*!
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
@@ -1,10 +1,11 @@
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, markRaw, inject, withModifiers } from "vue";
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";
8
+ import { useRouter, useRoute } from "vue-router";
8
9
  //! moment.js
9
10
  //! version : 2.30.1
10
11
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
@@ -6581,23 +6582,25 @@ const _sfc_main$f = defineComponent({
6581
6582
  try {
6582
6583
  console.log(`[StudySession] starting study session w/ sources: ${JSON.stringify(this.contentSources)}`);
6583
6584
  console.log("[StudySession] Beginning preparation process");
6584
- this.sessionContentSources = (await Promise.all(
6585
- this.contentSources.map(async (s) => {
6586
- try {
6587
- return await getStudySource(s, this.user);
6588
- } catch (e) {
6589
- console.error(`Failed to load study source: ${s.type}/${s.id}`, e);
6590
- return null;
6591
- }
6592
- })
6593
- )).filter((s) => s !== null);
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
+ );
6594
6597
  this.timeRemaining = this.sessionTimeLimit * 60;
6595
6598
  sessionClassroomDBs = await Promise.all(
6596
6599
  this.contentSources.filter((s) => s.type === "classroom").map(async (c) => await this.dataLayer.getClassroomDB(c.id, "student"))
6597
6600
  );
6598
- sessionClassroomDBs.forEach((db) => {
6601
+ sessionClassroomDBs.forEach((_db) => {
6599
6602
  });
6600
- this.sessionController = new SessionController(this.sessionContentSources, 60 * this.sessionTimeLimit);
6603
+ this.sessionController = markRaw(new SessionController(this.sessionContentSources, 60 * this.sessionTimeLimit));
6601
6604
  this.sessionController.sessionRecord = this.sessionRecord;
6602
6605
  await this.sessionController.prepareSession();
6603
6606
  this.intervalHandler = setInterval(this.tick, 1e3);
@@ -6727,12 +6730,15 @@ const _sfc_main$f = defineComponent({
6727
6730
  if (cardElo && userElo) {
6728
6731
  const eloUpdate = adjustCourseScores(userElo, cardElo, userScore);
6729
6732
  this.userCourseRegDoc.courses.find((c) => c.courseID === course_id).elo = eloUpdate.userElo;
6730
- Promise.all([
6733
+ const results = await Promise.allSettled([
6731
6734
  this.user.updateUserElo(course_id, eloUpdate.userElo),
6732
6735
  courseDB.updateCardElo(card_id, eloUpdate.cardElo)
6733
- ]).then((results) => {
6734
- const user = results[0];
6735
- const card = results[1];
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;
6736
6742
  if (user.ok && card && card.ok) {
6737
6743
  console.log(
6738
6744
  `[StudySession] Updated ELOS:
@@ -6741,7 +6747,19 @@ const _sfc_main$f = defineComponent({
6741
6747
  `
6742
6748
  );
6743
6749
  }
6744
- });
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
+ }
6745
6763
  }
6746
6764
  },
6747
6765
  clearFeedbackShadow() {
@@ -6969,7 +6987,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
6969
6987
  })
6970
6988
  ])) : createCommentVNode("", true);
6971
6989
  }
6972
- const StudySession = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$a], ["__scopeId", "data-v-70e29902"]]);
6990
+ const StudySession = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$a], ["__scopeId", "data-v-37cad857"]]);
6973
6991
  let _pinia = null;
6974
6992
  const setPinia = (pinia) => {
6975
6993
  _pinia = pinia;
@@ -6978,7 +6996,7 @@ const getPinia = () => {
6978
6996
  return _pinia;
6979
6997
  };
6980
6998
  const piniaPlugin = {
6981
- install(app, options) {
6999
+ install(_app, options) {
6982
7000
  const pinia = options?.pinia;
6983
7001
  if (pinia) {
6984
7002
  setPinia(pinia);
@@ -9731,7 +9749,7 @@ function splitTextToken(token2) {
9731
9749
  const textChunks = splitByDelimiters(token2.text, "{{", "}}");
9732
9750
  const rawChunks = splitByDelimiters(token2.raw, "{{", "}}");
9733
9751
  if (textChunks.length === rawChunks.length) {
9734
- return textChunks.map((c, i) => {
9752
+ return textChunks.map((_c, i) => {
9735
9753
  return {
9736
9754
  type: "text",
9737
9755
  text: textChunks[i],
@@ -15798,40 +15816,6 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
15798
15816
  }, 8, ["content", "model-value"]);
15799
15817
  }
15800
15818
  const UserChip = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$1]]);
15801
- /*!
15802
- * vue-router v4.5.0
15803
- * (c) 2024 Eduardo San Martin Morote
15804
- * @license MIT
15805
- */
15806
- var NavigationType;
15807
- (function(NavigationType2) {
15808
- NavigationType2["pop"] = "pop";
15809
- NavigationType2["push"] = "push";
15810
- })(NavigationType || (NavigationType = {}));
15811
- var NavigationDirection;
15812
- (function(NavigationDirection2) {
15813
- NavigationDirection2["back"] = "back";
15814
- NavigationDirection2["forward"] = "forward";
15815
- NavigationDirection2["unknown"] = "";
15816
- })(NavigationDirection || (NavigationDirection = {}));
15817
- Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
15818
- var NavigationFailureType;
15819
- (function(NavigationFailureType2) {
15820
- NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
15821
- NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
15822
- NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
15823
- })(NavigationFailureType || (NavigationFailureType = {}));
15824
- Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
15825
- Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
15826
- const routerKey = Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
15827
- const routeLocationKey = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
15828
- Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
15829
- function useRouter() {
15830
- return inject(routerKey);
15831
- }
15832
- function useRoute(_name) {
15833
- return inject(routeLocationKey);
15834
- }
15835
15819
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
15836
15820
  __name: "UserLogin",
15837
15821
  emits: ["toggle"],