@bitcobblers/wod-wiki-lang 0.56.2208 → 0.57.2213

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/react.cjs CHANGED
@@ -822,7 +822,10 @@ function buildTooltip(metric) {
822
822
  if (metric.value !== void 0) parts.push(`Value: ${metric.value}`);
823
823
  if (metric.origin) parts.push(`Origin: ${metric.origin}`);
824
824
  if (metric.sourceBlockKey) parts.push(`Block: ${metric.sourceBlockKey}`);
825
- if (metric.timestamp) parts.push(`Time: ${metric.timestamp.toISOString()}`);
825
+ if (metric.timestamp) {
826
+ const ts = metric.timestamp instanceof Date ? metric.timestamp : new Date(metric.timestamp);
827
+ if (!Number.isNaN(ts.getTime())) parts.push(`Time: ${ts.toISOString()}`);
828
+ }
826
829
  return parts.join("\n");
827
830
  }
828
831
  var COLUMN_LABEL_MAP = {
@@ -857,12 +860,37 @@ var COLUMN_LABEL_MAP = {
857
860
  "session-load": "Session Load",
858
861
  "met-score": "MET Score",
859
862
  tis: "TIS",
860
- sound: "Sound"
863
+ sound: "Sound",
864
+ // Derived / analytics columns (keys are lowercased in computeColumnLabel).
865
+ "calc.metminutes": "MET Minutes",
866
+ metminutes: "MET Minutes",
867
+ metminutesestimated: "MET Minutes Est.",
868
+ sessionload: "Session Load",
869
+ totalvolume: "Total Volume",
870
+ totalreps: "Total Reps",
871
+ totaldistance: "Total Distance",
872
+ "calc.acwr": "ACWR",
873
+ "calc.monotony": "Monotony",
874
+ "calc.strain": "Strain",
875
+ "calc.readiness": "Readiness",
876
+ "calc.hrv": "HRV",
877
+ "calc.sleep": "Sleep",
878
+ "calc.soreness": "Soreness"
879
+ };
880
+ var METRIC_KEY_ACRONYMS = {
881
+ met: "MET",
882
+ hrv: "HRV",
883
+ rpe: "RPE",
884
+ tis: "TIS",
885
+ acwr: "ACWR",
886
+ vo2max: "VO2max"
861
887
  };
862
888
  function humanizeMetricKey(value) {
863
- const spaced = value.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").trim();
889
+ const spaced = value.replace(/^calc\./i, "").replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").trim();
864
890
  if (spaced.length === 0) return "";
865
891
  return spaced.split(/\s+/).map((word) => {
892
+ const acronym = METRIC_KEY_ACRONYMS[word.toLowerCase()];
893
+ if (acronym) return acronym;
866
894
  if (word === word.toUpperCase()) return word;
867
895
  if (/^[A-Z]{2,}$/.test(word)) return word;
868
896
  return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
@@ -1219,9 +1247,10 @@ function projectSessionClock(runtime, options = {}) {
1219
1247
  if (!subLabels) subLabels = subLabel ? [subLabel] : void 0;
1220
1248
  const activeDirection = active?.timer.direction ?? "up";
1221
1249
  const activeDurationMs = active?.timer.durationMs;
1222
- const activeSpans = active ? serializeSpans(active.timer.spans) : [];
1250
+ const isWaitingToStart = blocks[0]?.blockType === "WaitingToStart";
1251
+ const activeSpans = active && !isWaitingToStart ? serializeSpans(active.timer.spans) : [];
1223
1252
  let displayMs = 0;
1224
- if (active) {
1253
+ if (active && !isWaitingToStart) {
1225
1254
  const elapsed = calculateDuration(active.timer.spans, nowMs);
1226
1255
  displayMs = activeDirection === "down" && activeDurationMs !== void 0 ? Math.max(0, activeDurationMs - elapsed) : elapsed;
1227
1256
  }
@@ -1233,8 +1262,8 @@ function projectSessionClock(runtime, options = {}) {
1233
1262
  (best, cur) => cur.elapsed > (best?.elapsed ?? -1) ? cur : best,
1234
1263
  withElapsed[withElapsed.length - 1]
1235
1264
  );
1236
- const sessionElapsedMs = sessionHolder?.elapsed ?? 0;
1237
- const sessionSpans = sessionHolder ? serializeSpans(sessionHolder.entry.timer.spans) : [];
1265
+ const sessionElapsedMs = isWaitingToStart ? 0 : sessionHolder?.elapsed ?? 0;
1266
+ const sessionSpans = sessionHolder && !isWaitingToStart ? serializeSpans(sessionHolder.entry.timer.spans) : [];
1238
1267
  const activeKey = active?.block.key.toString();
1239
1268
  const sessionKey = sessionHolder?.entry.block.key.toString();
1240
1269
  const secondaryTimers = allTimers.filter((t) => {