@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 +15 -1
- package/dist/auto.cjs.map +1 -1
- package/dist/auto.js +15 -1
- package/dist/auto.js.map +1 -1
- package/dist/index.cjs +15 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/vizu.min.js +11 -11
- package/dist/vizu.min.js.map +1 -1
- package/package.json +1 -1
package/dist/auto.js
CHANGED
|
@@ -3271,11 +3271,25 @@ var Vizu = class {
|
|
|
3271
3271
|
this.user = user;
|
|
3272
3272
|
this.popover?.setUser(user);
|
|
3273
3273
|
this.pill?.setUser(user);
|
|
3274
|
+
if (this.pill) {
|
|
3275
|
+
if (this.shouldShowPill()) this.pill.show();
|
|
3276
|
+
else this.pill.hide();
|
|
3277
|
+
}
|
|
3274
3278
|
this.bus.emit("user:changed", { user });
|
|
3275
3279
|
}
|
|
3276
3280
|
getUser() {
|
|
3277
3281
|
return this.user;
|
|
3278
3282
|
}
|
|
3283
|
+
/**
|
|
3284
|
+
* Whether the pill belongs on-screen right now. Cloud-mode workspaces
|
|
3285
|
+
* keep it hidden until the user is signed in; non-cloud usage (local /
|
|
3286
|
+
* memory storage) has no auth and always shows it. Recomputed on every
|
|
3287
|
+
* setUser and on mount.
|
|
3288
|
+
*/
|
|
3289
|
+
shouldShowPill() {
|
|
3290
|
+
if (!(this.storage instanceof CloudStorageAdapter)) return true;
|
|
3291
|
+
return this.user !== null;
|
|
3292
|
+
}
|
|
3279
3293
|
/**
|
|
3280
3294
|
* Cloud-mode write gate. Every entry point that creates or modifies a
|
|
3281
3295
|
* comment first checks that we have a known user. Without one, the
|
|
@@ -3639,7 +3653,7 @@ var Vizu = class {
|
|
|
3639
3653
|
this.pill.setUser(this.user);
|
|
3640
3654
|
this.pill.setComments(this.comments);
|
|
3641
3655
|
this.pill.setMultiSelectState(this.multiSelectMode, this.pendingFingerprints.length);
|
|
3642
|
-
this.pill.show();
|
|
3656
|
+
if (this.shouldShowPill()) this.pill.show();
|
|
3643
3657
|
this.highlighter = new Highlighter(
|
|
3644
3658
|
this.root,
|
|
3645
3659
|
this.opts.ignoreSelectors ?? [],
|