@vue-skuilder/standalone-ui 0.2.25 → 0.2.26

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.
@@ -29749,6 +29749,26 @@ ${t.stack}` : JSON.stringify(t);
29749
29749
  };
29750
29750
  }
29751
29751
  }
29752
+ async adoptSession(t) {
29753
+ let c;
29754
+ try {
29755
+ c = await getLoggedInUsername();
29756
+ } catch {
29757
+ return {
29758
+ ok: !1,
29759
+ error: "No session to adopt"
29760
+ };
29761
+ }
29762
+ if (t?.startsWith(GuestUsername)) {
29763
+ logger.info(`Migrating data from funnel account ${t} to ${c}`);
29764
+ let u = await this.migrateFunnelData(t, c);
29765
+ u.success || logger.warn(`Migration failed: ${u.error}`);
29766
+ }
29767
+ return {
29768
+ ok: !0,
29769
+ username: c
29770
+ };
29771
+ }
29752
29772
  async logout() {
29753
29773
  try {
29754
29774
  let t = await this.getRemoteCouchRootDB().logOut();
@@ -31278,15 +31298,15 @@ ${t.stack}` : JSON.stringify(t);
31278
31298
  c || this._applyHintsToSources();
31279
31299
  let g = [];
31280
31300
  for (let t = 0; t < this.sources.length; t++) {
31281
- let c = this.sources[t];
31301
+ let u = this.sources[t];
31282
31302
  try {
31283
- let u = (await c.getWeightedCards(m)).cards;
31303
+ let c = (await u.getWeightedCards(m)).cards;
31284
31304
  g.push({
31285
31305
  sourceIndex: t,
31286
- weighted: u
31306
+ weighted: c
31287
31307
  });
31288
- } catch (c) {
31289
- if (this.error(`Failed to get content from source ${t}:`, c), this.sources.length === 1) throw Error(`Cannot start session: failed to load content from source ${t}`);
31308
+ } catch (u) {
31309
+ if (this.error(`Failed to get content from source ${t}:`, u), this.sources.length === 1 && !c) throw Error(`Cannot start session: failed to load content from source ${t}`);
31290
31310
  }
31291
31311
  }
31292
31312
  if (g.length === 0) {
@@ -31644,6 +31664,23 @@ Currently logged-in as ${this._username}.`);
31644
31664
  }
31645
31665
  return u;
31646
31666
  }
31667
+ async adoptSession(t) {
31668
+ if (!this.syncStrategy.canAuthenticate() || !this.syncStrategy.adoptSession) throw Error("Session adoption not supported by current sync strategy");
31669
+ let c = this._username.startsWith(GuestUsername) ? this._username : void 0;
31670
+ if (!c) throw Error(`Cannot adopt a session while logged in.
31671
+ Log out of account ${this.getUsername()} first.`);
31672
+ let u = await this.syncStrategy.adoptSession(t.migrateGuestData ? c : void 0);
31673
+ if (u.ok && u.username) {
31674
+ log4(`Adopted session for ${u.username}`), this._username = u.username;
31675
+ try {
31676
+ localStorage.removeItem("sk-guest-uuid");
31677
+ } catch (t) {
31678
+ logger.warn("localStorage not available (Node.js environment):", t);
31679
+ }
31680
+ await this.init();
31681
+ }
31682
+ return u;
31683
+ }
31647
31684
  async resetUserData() {
31648
31685
  if (this.syncStrategy.canAuthenticate()) return {
31649
31686
  status: Status.error,
@@ -43982,6 +44019,7 @@ var Ee$1, De$1, Oe$1, ke$1, Ae$1, je$1, Me$1, Ne$1, Pe$1, Fe$1, Ie$1, Le$1, Z$2,
43982
44019
  message: "Failed to prepare study session",
43983
44020
  error: t
43984
44021
  });
44022
+ return;
43985
44023
  }
43986
44024
  try {
43987
44025
  this.contentSources.filter((t) => t.type === "course").forEach(async (t) => this.courseNames[t.id] = (await this.dataLayer.getCoursesDB().getCourseConfig(t.id)).name), console.log(`[StudySession] Session created:
@@ -44096,7 +44134,7 @@ var Ee$1, De$1, Oe$1, ke$1, Ae$1, je$1, Me$1, Ne$1, Pe$1, Fe$1, Ie$1, Le$1, Z$2,
44096
44134
  key: 4,
44097
44135
  ref: "shadowWrapper",
44098
44136
  class: "card-transition-container"
44099
- }, Xt = { key: 0 }, __name(_sfc_render$15, "_sfc_render"), Zt = /* @__PURE__ */ F$3(Ut, [["render", _sfc_render$15], ["__scopeId", "data-v-c765534b"]]), Qt = /* @__PURE__ */ defineComponent({
44137
+ }, Xt = { key: 0 }, __name(_sfc_render$15, "_sfc_render"), Zt = /* @__PURE__ */ F$3(Ut, [["render", _sfc_render$15], ["__scopeId", "data-v-ad5e0df0"]]), Qt = /* @__PURE__ */ defineComponent({
44100
44138
  name: "MultipleChoiceOption",
44101
44139
  components: { MarkdownRenderer: /* @__PURE__ */ defineAsyncComponent(() => Promise.resolve().then(() => (init_MarkdownRenderer_kStoDRNE(), MarkdownRenderer_kStoDRNE_exports)).then((t) => t.n)) },
44102
44140
  props: {