mnfst 0.5.137 → 0.5.138

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.
@@ -586,12 +586,15 @@ function initializeAuthStore() {
586
586
 
587
587
  // Load teams if enabled and user is authenticated. Guests (anonymous)
588
588
  // only seed default teams when auth.teams.guests is enabled.
589
- if (this.isAuthenticated && appwriteConfig?.teams && this.listTeams
589
+ // Note: do NOT gate on this.listTeams here — _loadTeamsAndSeed waits
590
+ // for the teams module to attach (it can lose the startup race to init).
591
+ if (this.isAuthenticated && appwriteConfig?.teams
590
592
  && (!this.isAnonymous || appwriteConfig.guestTeams)) {
591
593
  try {
592
594
  await this._loadTeamsAndSeed(appwriteConfig);
593
595
  } catch (teamsError) {
594
- // Don't fail initialization if teams fail to load
596
+ // Don't fail initialization if teams fail to load, but surface why
597
+ console.warn('[Manifest Appwrite Auth] Failed to load/seed teams on restore:', teamsError);
595
598
  }
596
599
  }
597
600
  } catch (error) {
@@ -666,11 +669,25 @@ function initializeAuthStore() {
666
669
  // teams. Shared by the guest, magic-link, OAuth, and init/restore paths.
667
670
  async _loadTeamsAndSeed(appwriteConfig) {
668
671
  const cfg = appwriteConfig || await config.getAppwriteConfig();
669
- if (!cfg?.teams || !this.listTeams) {
672
+ if (!cfg?.teams) {
673
+ return;
674
+ }
675
+ // Startup race: init() (and an early requestGuest) can reach here before
676
+ // teams.core.js / teams.defaults.js have finished wiring listTeams +
677
+ // ensureDefaultTeams onto the store. Wait briefly for them rather than
678
+ // silently skipping (which left guests with no teams on reload).
679
+ const needsSeed = !!(cfg.permanentTeams || cfg.templateTeams);
680
+ const ready = () => typeof this.listTeams === 'function'
681
+ && (!needsSeed || typeof window.ManifestAppwriteAuthTeamsDefaults?.ensureDefaultTeams === 'function');
682
+ for (let i = 0; i < 40 && !ready(); i++) {
683
+ await new Promise(r => setTimeout(r, 50));
684
+ }
685
+ if (typeof this.listTeams !== 'function') {
686
+ console.warn('[Manifest Appwrite Auth] Teams module never became ready; skipping team load/seed.');
670
687
  return;
671
688
  }
672
689
  await this.listTeams();
673
- if ((cfg.permanentTeams || cfg.templateTeams) && window.ManifestAppwriteAuthTeamsDefaults?.ensureDefaultTeams) {
690
+ if (needsSeed && window.ManifestAppwriteAuthTeamsDefaults?.ensureDefaultTeams) {
674
691
  await window.ManifestAppwriteAuthTeamsDefaults.ensureDefaultTeams(this);
675
692
  }
676
693
  },
@@ -2700,9 +2717,11 @@ async function ensureDefaultTeams(store) {
2700
2717
 
2701
2718
  if (result.success) {
2702
2719
  createdTeams.push(result.team);
2720
+ } else {
2721
+ console.warn(`[Manifest Appwrite Auth] Could not seed permanent team "${teamName}":`, result.error);
2703
2722
  }
2704
2723
  } catch (error) {
2705
- // Error creating permanent team
2724
+ console.warn(`[Manifest Appwrite Auth] Error seeding permanent team "${teamName}":`, error);
2706
2725
  }
2707
2726
  }
2708
2727
  }
@@ -2742,9 +2761,11 @@ async function ensureDefaultTeams(store) {
2742
2761
 
2743
2762
  if (result.success) {
2744
2763
  createdTeams.push(result.team);
2764
+ } else {
2765
+ console.warn(`[Manifest Appwrite Auth] Could not seed template team "${teamName}":`, result.error);
2745
2766
  }
2746
2767
  } catch (error) {
2747
- // Error creating template team
2768
+ console.warn(`[Manifest Appwrite Auth] Error seeding template team "${teamName}":`, error);
2748
2769
  }
2749
2770
  }
2750
2771
  }
@@ -5619,7 +5640,8 @@ function initializeAnonymous() {
5619
5640
  try {
5620
5641
  await this._loadTeamsAndSeed(appwriteConfig);
5621
5642
  } catch (teamsError) {
5622
- // Don't fail guest creation if teams fail to load
5643
+ // Don't fail guest creation if teams fail to load, but surface why
5644
+ console.warn('[Manifest Appwrite Auth] Failed to seed guest teams:', teamsError);
5623
5645
  }
5624
5646
  }
5625
5647
 
@@ -644,7 +644,7 @@
644
644
  const cell = svg('rect', { class: 'heat-cell', x: x(String(c)), y: yy, width: cw, height: ch, style: `--heat:${t}%` }, cellsG);
645
645
  applyTip(cell, (r.name ? r.name + ' · ' : '') + c + ': ' + v, cfg);
646
646
  animate(cell, [{ opacity: 0 }, { opacity: 1 }], { duration: 300, delay: (ri + ci) * 20 });
647
- if (cfg.dataLabels) dataLabel(plot, v, x(String(c)) + x.bandwidth() / 2, yy + yb.bandwidth() / 2, 'middle', 'central');
647
+ if (cfg.dataLabels) dataLabel(plot, v, x(String(c)) + x.bandwidth() / 2, yy + yb.bandwidth() / 2, 'middle', 'central', 'inverse');
648
648
  });
649
649
  });
650
650
 
@@ -1,8 +1,8 @@
1
1
  {
2
- "manifest.appwrite.auth.js": "sha384-GfgLEKmLGCXJHOyHYl2wZaGs2qfyJ6IybQTPVZNymy1u1GiuN8BjeY2Ky4im7PjZ",
2
+ "manifest.appwrite.auth.js": "sha384-sR016g/eiENLtsdZJWW+D2nM9Lp/Oeeu8JF8L9gXGjc8IQiGqqgiU8MEOUfE0hbJ",
3
3
  "manifest.appwrite.data.js": "sha384-00ulLT+GAIuPHA/rRT9p98vYlsyDzkyKXtg86BDQ6FGQa5vVVN+W6kuforniBAsz",
4
4
  "manifest.appwrite.presence.js": "sha384-uxRpx9/Jj0kGtklH5QmUlAzD3zdSvFRfK6bcJQqxl+Bsf5tOo4zgwqJTQgtZoHQP",
5
- "manifest.charts.js": "sha384-vuSg+n40PNgYBCUuhx/EUUU3Ln6xmkcmyjZUuPbHKIqrFjfbx99D+0Pmr5llaXif",
5
+ "manifest.charts.js": "sha384-RuV7gWXt3s+JegxWgDieR/P5U99sbOYWiYHdJGe2uCJjDFU1cPp0mJ1QT55ec9uz",
6
6
  "manifest.code.js": "sha384-nP6DncLx/UuJtloyVKMCOXwIBAq32DshTb/Lc0vVRBWX7kSbxiBnY5aEyqqvK8Kg",
7
7
  "manifest.color.js": "sha384-6Rv3LxyTcZNjrhtayQfqRdCx0uSZ4BiEbgEI98I62eTvp8Aw7LBIoNJ0Je1oktwL",
8
8
  "manifest.colorpicker.js": "sha384-Wqz0ZIbeIi7KarqqqSLsQk+7E/fMaKhb32hrq5/eWzX1yjqMrpPZKH8y+jZ3mfg+",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst",
3
- "version": "0.5.137",
3
+ "version": "0.5.138",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",