@unhingged/vizu-core 0.1.9 → 0.1.10

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/index.cjs CHANGED
@@ -3307,11 +3307,25 @@ var Vizu = class {
3307
3307
  this.user = user;
3308
3308
  this.popover?.setUser(user);
3309
3309
  this.pill?.setUser(user);
3310
+ if (this.pill) {
3311
+ if (this.shouldShowPill()) this.pill.show();
3312
+ else this.pill.hide();
3313
+ }
3310
3314
  this.bus.emit("user:changed", { user });
3311
3315
  }
3312
3316
  getUser() {
3313
3317
  return this.user;
3314
3318
  }
3319
+ /**
3320
+ * Whether the pill belongs on-screen right now. Cloud-mode workspaces
3321
+ * keep it hidden until the user is signed in; non-cloud usage (local /
3322
+ * memory storage) has no auth and always shows it. Recomputed on every
3323
+ * setUser and on mount.
3324
+ */
3325
+ shouldShowPill() {
3326
+ if (!(this.storage instanceof CloudStorageAdapter)) return true;
3327
+ return this.user !== null;
3328
+ }
3315
3329
  /**
3316
3330
  * Cloud-mode write gate. Every entry point that creates or modifies a
3317
3331
  * comment first checks that we have a known user. Without one, the
@@ -3675,7 +3689,7 @@ var Vizu = class {
3675
3689
  this.pill.setUser(this.user);
3676
3690
  this.pill.setComments(this.comments);
3677
3691
  this.pill.setMultiSelectState(this.multiSelectMode, this.pendingFingerprints.length);
3678
- this.pill.show();
3692
+ if (this.shouldShowPill()) this.pill.show();
3679
3693
  this.highlighter = new Highlighter(
3680
3694
  this.root,
3681
3695
  this.opts.ignoreSelectors ?? [],