@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/auto.cjs CHANGED
@@ -3297,11 +3297,25 @@ var Vizu = class {
3297
3297
  this.user = user;
3298
3298
  this.popover?.setUser(user);
3299
3299
  this.pill?.setUser(user);
3300
+ if (this.pill) {
3301
+ if (this.shouldShowPill()) this.pill.show();
3302
+ else this.pill.hide();
3303
+ }
3300
3304
  this.bus.emit("user:changed", { user });
3301
3305
  }
3302
3306
  getUser() {
3303
3307
  return this.user;
3304
3308
  }
3309
+ /**
3310
+ * Whether the pill belongs on-screen right now. Cloud-mode workspaces
3311
+ * keep it hidden until the user is signed in; non-cloud usage (local /
3312
+ * memory storage) has no auth and always shows it. Recomputed on every
3313
+ * setUser and on mount.
3314
+ */
3315
+ shouldShowPill() {
3316
+ if (!(this.storage instanceof CloudStorageAdapter)) return true;
3317
+ return this.user !== null;
3318
+ }
3305
3319
  /**
3306
3320
  * Cloud-mode write gate. Every entry point that creates or modifies a
3307
3321
  * comment first checks that we have a known user. Without one, the
@@ -3665,7 +3679,7 @@ var Vizu = class {
3665
3679
  this.pill.setUser(this.user);
3666
3680
  this.pill.setComments(this.comments);
3667
3681
  this.pill.setMultiSelectState(this.multiSelectMode, this.pendingFingerprints.length);
3668
- this.pill.show();
3682
+ if (this.shouldShowPill()) this.pill.show();
3669
3683
  this.highlighter = new Highlighter(
3670
3684
  this.root,
3671
3685
  this.opts.ignoreSelectors ?? [],