@ai-ecoverse/slicc-spectrum 1.89.2 → 1.90.0

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/slicc-ui.js CHANGED
@@ -34906,7 +34906,17 @@ function requiresText(item2, all2) {
34906
34906
  ].filter(Boolean);
34907
34907
  return parts2.length ? parts2.join("; ") : null;
34908
34908
  }
34909
- var phased = ({ phase, done: done2, total }) => Math.round(((phase === "link" ? 1 : 0) + (total ? Math.min(done2 / total, 1) : 0)) * 50);
34909
+ var fetched = (progress) => progress.phase === "download" && (progress.bytes?.total ?? 0) > 0 ? progress.bytes : null;
34910
+ var phased = (progress) => {
34911
+ const { done: done2, total } = fetched(progress) ?? progress;
34912
+ const half = progress.phase === "link" ? 1 : 0;
34913
+ return Math.round((half + (total ? Math.min(done2 / total, 1) : 0)) * 50);
34914
+ };
34915
+ var counted = (progress, unit = "") => {
34916
+ const bytes = fetched(progress);
34917
+ if (bytes) return `${size3(bytes.done)} of ${size3(bytes.total)}`;
34918
+ return `${progress.done} of ${progress.total}${unit}`;
34919
+ };
34910
34920
  var itemBusy = (item2) => running.has(item2.state) || item2.state === "starting" || item2.progress !== null;
34911
34921
  var packageBusy = (item2) => packageRunning.has(item2.state) || item2.progress !== null;
34912
34922
  var snapshot = (items) => new Map(items.map(({ id, state: state2, error }) => [id, { state: state2, error }]));
@@ -35311,7 +35321,7 @@ var SliccUpdates = class extends ModelElement {
35311
35321
  `item:${item2.id}`,
35312
35322
  itemBusy(item2),
35313
35323
  progress,
35314
- progress ? `${progress.done} of ${progress.total}` : "",
35324
+ progress ? counted(progress) : "",
35315
35325
  `${item2.label}: ${phase ?? states[item2.state][1].toLowerCase()}`
35316
35326
  );
35317
35327
  }
@@ -35383,7 +35393,7 @@ var SliccUpdates = class extends ModelElement {
35383
35393
  `package:${item2.id}`,
35384
35394
  packageBusy(item2),
35385
35395
  progress,
35386
- progress ? `${progress.done} of ${progress.total} packages` : "",
35396
+ progress ? counted(progress, " packages") : "",
35387
35397
  `${item2.label}: ${phase ?? packageLight(item2)?.[1].toLowerCase()}`
35388
35398
  );
35389
35399
  }