@unhingged/vizu-core 0.1.17 → 0.1.18
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 +17 -3
- package/dist/auto.cjs.map +1 -1
- package/dist/auto.js +17 -3
- package/dist/auto.js.map +1 -1
- package/dist/index.cjs +17 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +17 -3
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +17 -3
- package/dist/internal.js.map +1 -1
- package/dist/vizu.min.js +45 -42
- package/dist/vizu.min.js.map +1 -1
- package/package.json +1 -1
package/dist/internal.js
CHANGED
|
@@ -1297,11 +1297,22 @@ var Sidebar = class {
|
|
|
1297
1297
|
const conf = this.lastConfidence;
|
|
1298
1298
|
const orphans = comments.filter((c) => conf.get(c.id) === "orphaned");
|
|
1299
1299
|
const anchored = comments.filter((c) => conf.get(c.id) !== "orphaned");
|
|
1300
|
-
const
|
|
1301
|
-
const
|
|
1300
|
+
const statusOf = (c) => c.status ?? "open";
|
|
1301
|
+
const visible = this.filter === "open" ? anchored.filter((c) => statusOf(c) === "open") : this.filter === "resolved" ? anchored.filter((c) => statusOf(c) === "resolved") : anchored;
|
|
1302
|
+
const visibleOrphans = this.filter === "all" ? orphans : [];
|
|
1302
1303
|
const counts = countByStatus(comments);
|
|
1303
1304
|
if (visible.length === 0 && visibleOrphans.length === 0) {
|
|
1304
|
-
|
|
1305
|
+
let emptyCopy;
|
|
1306
|
+
if (comments.length === 0) {
|
|
1307
|
+
emptyCopy = "<strong>No comments yet</strong>Click any element on the page to leave one.";
|
|
1308
|
+
} else if (this.filter === "open") {
|
|
1309
|
+
const closed = counts.resolved + counts.wontfix;
|
|
1310
|
+
emptyCopy = `<strong>Nothing open.</strong>${closed} closed comment${closed === 1 ? "" : "s"} hidden. Switch to <em>All</em> to see them.`;
|
|
1311
|
+
} else if (this.filter === "resolved") {
|
|
1312
|
+
emptyCopy = `<strong>Nothing resolved.</strong>${counts.open} still open. Switch to <em>Open</em> or <em>All</em> to see more.`;
|
|
1313
|
+
} else {
|
|
1314
|
+
emptyCopy = "<strong>No comments yet</strong>Click any element on the page to leave one.";
|
|
1315
|
+
}
|
|
1305
1316
|
this.el.innerHTML = `
|
|
1306
1317
|
${this.headerHtml(comments.length, counts)}
|
|
1307
1318
|
<div class="vz-sidebar-body">
|
|
@@ -1397,6 +1408,9 @@ var Sidebar = class {
|
|
|
1397
1408
|
<button class="vz-sidebar-filter ${this.filter === "open" ? "is-active" : ""}" data-vz="filter" data-filter="open" role="tab" aria-selected="${this.filter === "open"}">
|
|
1398
1409
|
Open <span class="vz-sidebar-filter-count">${counts.open}</span>
|
|
1399
1410
|
</button>
|
|
1411
|
+
<button class="vz-sidebar-filter ${this.filter === "resolved" ? "is-active" : ""}" data-vz="filter" data-filter="resolved" role="tab" aria-selected="${this.filter === "resolved"}">
|
|
1412
|
+
Resolved <span class="vz-sidebar-filter-count">${counts.resolved}</span>
|
|
1413
|
+
</button>
|
|
1400
1414
|
<button class="vz-sidebar-filter ${this.filter === "all" ? "is-active" : ""}" data-vz="filter" data-filter="all" role="tab" aria-selected="${this.filter === "all"}">
|
|
1401
1415
|
All <span class="vz-sidebar-filter-count">${total}</span>
|
|
1402
1416
|
</button>
|