@unhingged/vizu-core 0.1.18 → 0.1.20

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/internal.cjs CHANGED
@@ -1264,6 +1264,7 @@ var Sidebar = class {
1264
1264
  if (f && f !== this.filter) {
1265
1265
  this.filter = f;
1266
1266
  this.render(this.lastComments);
1267
+ this.callbacks.onFilterChange?.(f);
1267
1268
  }
1268
1269
  return;
1269
1270
  }
@@ -1328,7 +1329,7 @@ var Sidebar = class {
1328
1329
  const orphans = comments.filter((c) => conf.get(c.id) === "orphaned");
1329
1330
  const anchored = comments.filter((c) => conf.get(c.id) !== "orphaned");
1330
1331
  const statusOf = (c) => c.status ?? "open";
1331
- const visible = this.filter === "open" ? anchored.filter((c) => statusOf(c) === "open") : this.filter === "resolved" ? anchored.filter((c) => statusOf(c) === "resolved") : anchored;
1332
+ const visible = this.filter === "all" ? anchored : anchored.filter((c) => statusOf(c) === this.filter);
1332
1333
  const visibleOrphans = this.filter === "all" ? orphans : [];
1333
1334
  const counts = countByStatus(comments);
1334
1335
  if (visible.length === 0 && visibleOrphans.length === 0) {
@@ -1339,7 +1340,9 @@ var Sidebar = class {
1339
1340
  const closed = counts.resolved + counts.wontfix;
1340
1341
  emptyCopy = `<strong>Nothing open.</strong>${closed} closed comment${closed === 1 ? "" : "s"} hidden. Switch to <em>All</em> to see them.`;
1341
1342
  } else if (this.filter === "resolved") {
1342
- emptyCopy = `<strong>Nothing resolved.</strong>${counts.open} still open. Switch to <em>Open</em> or <em>All</em> to see more.`;
1343
+ emptyCopy = `<strong>Nothing resolved.</strong>Switch to <em>Open</em> or <em>All</em> to see more.`;
1344
+ } else if (this.filter === "wontfix") {
1345
+ emptyCopy = `<strong>Nothing marked won&apos;t&nbsp;fix.</strong>Switch to <em>Open</em> or <em>All</em> to see more.`;
1343
1346
  } else {
1344
1347
  emptyCopy = "<strong>No comments yet</strong>Click any element on the page to leave one.";
1345
1348
  }
@@ -1441,6 +1444,9 @@ var Sidebar = class {
1441
1444
  <button class="vz-sidebar-filter ${this.filter === "resolved" ? "is-active" : ""}" data-vz="filter" data-filter="resolved" role="tab" aria-selected="${this.filter === "resolved"}">
1442
1445
  Resolved <span class="vz-sidebar-filter-count">${counts.resolved}</span>
1443
1446
  </button>
1447
+ <button class="vz-sidebar-filter ${this.filter === "wontfix" ? "is-active" : ""}" data-vz="filter" data-filter="wontfix" role="tab" aria-selected="${this.filter === "wontfix"}">
1448
+ Won&apos;t fix <span class="vz-sidebar-filter-count">${counts.wontfix}</span>
1449
+ </button>
1444
1450
  <button class="vz-sidebar-filter ${this.filter === "all" ? "is-active" : ""}" data-vz="filter" data-filter="all" role="tab" aria-selected="${this.filter === "all"}">
1445
1451
  All <span class="vz-sidebar-filter-count">${total}</span>
1446
1452
  </button>