@bitcobblers/wod-wiki-ui 0.61.2259 → 0.62.2260

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/index.cjs CHANGED
@@ -8,8 +8,8 @@ var React2 = require('react');
8
8
  var wodWikiWql = require('@bitcobblers/wod-wiki-wql');
9
9
  var recharts = require('recharts');
10
10
  var wodWikiCore = require('@bitcobblers/wod-wiki-core');
11
- var dialog = require('@ui-sdk/react/dialog');
12
11
  var wodWikiLang = require('@bitcobblers/wod-wiki-lang');
12
+ var dialog = require('@ui-sdk/react/dialog');
13
13
  var input = require('@ui-sdk/react/input');
14
14
  var segmentedControl = require('@ui-sdk/react/segmented-control');
15
15
  var button = require('@ui-sdk/react/button');
@@ -171,13 +171,13 @@ function useChartShape(result) {
171
171
  return { kind: hasTimeAxis ? "timeseries" : "bars" };
172
172
  }, [result]);
173
173
  }
174
- function WqlEmptyState({ result, className, actions }) {
174
+ function WqlEmptyState({ result, className, actions, fallbackMessage }) {
175
175
  const message = React2.useMemo(() => {
176
176
  if (!result) return "Loading\u2026";
177
177
  if (result.parsed.error) return `Query error: ${result.parsed.error}`;
178
178
  if (result.series.length === 0) return "No data for this range.";
179
- return null;
180
- }, [result]);
179
+ return fallbackMessage ?? null;
180
+ }, [result, fallbackMessage]);
181
181
  if (message === null && !actions) return null;
182
182
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `h-full flex flex-col items-center justify-center text-sm text-muted-foreground px-4 text-center ${className ?? ""}`, children: [
183
183
  message && /* @__PURE__ */ jsxRuntime.jsx("div", { children: message }),
@@ -206,6 +206,7 @@ var INTRINSIC_METRIC_UNITS = {
206
206
  "calc.strain": "AU",
207
207
  "calc.readiness": "",
208
208
  "calc.sends": "",
209
+ "calc.sleep": "h",
209
210
  sleep: "h"
210
211
  };
211
212
  var INTRINSIC_MASS_METRICS = /* @__PURE__ */ new Set([
@@ -383,6 +384,7 @@ function mergeSeries(series) {
383
384
  const map = /* @__PURE__ */ new Map();
384
385
  for (const s of series) {
385
386
  for (const p of s.points) {
387
+ if (p.missing) continue;
386
388
  if (!map.has(p.ts)) map.set(p.ts, { ts: p.ts });
387
389
  map.get(p.ts)[s.label] = p.value;
388
390
  }
@@ -396,6 +398,7 @@ function buildOrdinalChartData(series) {
396
398
  const map = /* @__PURE__ */ new Map();
397
399
  for (const s of series) {
398
400
  s.points.forEach((p, idx) => {
401
+ if (p.missing) return;
399
402
  const xVal = p.x ?? idx;
400
403
  const key = String(xVal);
401
404
  if (!map.has(key)) {
@@ -439,7 +442,7 @@ function formatWithUnit(formattedNumber, unit) {
439
442
  const cleanUnit = unit?.trim();
440
443
  return cleanUnit ? `${formattedNumber} ${cleanUnit}` : formattedNumber;
441
444
  }
442
- function formatTimeseriesTick(value, unit) {
445
+ function formatAxisTick(value, unit) {
443
446
  const numeric = Number(value);
444
447
  if (!Number.isFinite(numeric)) {
445
448
  return formatWithUnit(String(value), unit);
@@ -448,7 +451,7 @@ function formatTimeseriesTick(value, unit) {
448
451
  const formatted = new Intl.NumberFormat(void 0, { maximumFractionDigits }).format(numeric);
449
452
  return formatWithUnit(formatted, unit);
450
453
  }
451
- function formatTimeseriesTooltipValue(value, unit) {
454
+ function formatMetricValue(value, unit) {
452
455
  const numeric = Number(value);
453
456
  if (!Number.isFinite(numeric)) {
454
457
  return formatWithUnit(String(value), unit);
@@ -456,9 +459,62 @@ function formatTimeseriesTooltipValue(value, unit) {
456
459
  const formatted = new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(numeric);
457
460
  return formatWithUnit(formatted, unit);
458
461
  }
462
+ function formatCompactMetricValue(value, unit) {
463
+ const numeric = Number(value);
464
+ if (!Number.isFinite(numeric)) {
465
+ return formatWithUnit(String(value), unit);
466
+ }
467
+ const abs = Math.abs(numeric);
468
+ let compact;
469
+ if (abs >= 1e6) {
470
+ compact = `${Number((numeric / 1e6).toFixed(1))}M`;
471
+ } else if (abs >= 1e3) {
472
+ compact = `${Number((numeric / 1e3).toFixed(1))}k`;
473
+ } else {
474
+ compact = new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(numeric);
475
+ }
476
+ return formatWithUnit(compact, unit);
477
+ }
478
+ function computeYAxisWidth(values2, unit, minWidth = 56, maxWidth = 104) {
479
+ let maxLen = formatAxisTick(0, unit).length;
480
+ for (const v of values2) {
481
+ if (!Number.isFinite(v)) continue;
482
+ const len = formatAxisTick(v, unit).length;
483
+ if (len > maxLen) maxLen = len;
484
+ }
485
+ const estimated = Math.ceil(maxLen * 6.5 + 14);
486
+ return Math.max(minWidth, Math.min(maxWidth, estimated));
487
+ }
488
+ function SingleLineYAxisTick({
489
+ x = 0,
490
+ y = 0,
491
+ payload,
492
+ unit
493
+ }) {
494
+ const raw = payload?.value ?? "";
495
+ const text = formatAxisTick(raw, unit);
496
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${x},${y})`, className: "recharts-layer recharts-cartesian-axis-tick", children: /* @__PURE__ */ jsxRuntime.jsx(
497
+ "text",
498
+ {
499
+ x: 0,
500
+ y: 0,
501
+ dy: 4,
502
+ textAnchor: "end",
503
+ fill: "hsl(var(--muted-foreground))",
504
+ fontSize: 10,
505
+ className: "recharts-text recharts-cartesian-axis-tick-value",
506
+ style: { whiteSpace: "nowrap" },
507
+ children: text
508
+ }
509
+ ) });
510
+ }
511
+ var formatTimeseriesTick = formatAxisTick;
512
+ var formatTimeseriesTooltipValue = formatMetricValue;
459
513
  var INTRINSIC_METRIC_UNITS2 = {
460
514
  "calc.hrv": "ms",
461
- hrv: "ms"
515
+ hrv: "ms",
516
+ "calc.sleep": "h",
517
+ sleep: "h"
462
518
  };
463
519
  function resolveTimeseriesUnit(result, unitProp) {
464
520
  const seriesUnit = result.series[0]?.unit;
@@ -486,10 +542,17 @@ function WqlTimeseries({ result, unit: unitProp }) {
486
542
  [isOrdinal, result]
487
543
  );
488
544
  const unit = resolveTimeseriesUnit(result, unitProp);
545
+ const yAxisWidth = React2.useMemo(
546
+ () => computeYAxisWidth(
547
+ result.series.flatMap((s) => s.points.map((p) => p.value)),
548
+ unit
549
+ ),
550
+ [result.series, unit]
551
+ );
489
552
  if (shape.kind !== "timeseries" && shape.kind !== "scalar") {
490
553
  return /* @__PURE__ */ jsxRuntime.jsx(WqlEmptyState, { result });
491
554
  }
492
- return /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.LineChart, { data: data2, margin: { top: 4, right: 8, bottom: 0, left: -12 }, children: [
555
+ return /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.LineChart, { data: data2, margin: { top: 4, right: 8, bottom: 0, left: 8 }, children: [
493
556
  /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { stroke: "hsl(var(--border))", vertical: false }),
494
557
  /* @__PURE__ */ jsxRuntime.jsx(
495
558
  recharts.XAxis,
@@ -507,10 +570,9 @@ function WqlTimeseries({ result, unit: unitProp }) {
507
570
  {
508
571
  tickLine: false,
509
572
  axisLine: false,
510
- width: 64,
573
+ width: yAxisWidth,
511
574
  stroke: "hsl(var(--muted-foreground))",
512
- tick: { fill: "hsl(var(--muted-foreground))", fontSize: 10 },
513
- tickFormatter: (v) => formatTimeseriesTick(v, unit)
575
+ tick: /* @__PURE__ */ jsxRuntime.jsx(SingleLineYAxisTick, { unit })
514
576
  }
515
577
  ),
516
578
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -543,7 +605,9 @@ function WqlTimeseries({ result, unit: unitProp }) {
543
605
  }
544
606
  function WqlBars({ result, unit: unitProp }) {
545
607
  const shape = useChartShape(result);
546
- const data2 = React2.useMemo(
608
+ const isOrdinal = React2.useMemo(() => isOrdinalSeriesSet(result.series), [result.series]);
609
+ const isTimeOrOrdinal = shape.kind === "timeseries" || isOrdinal;
610
+ const categoryData = React2.useMemo(
547
611
  () => result.series.map((s, i) => ({
548
612
  name: s.label,
549
613
  value: s.points[0]?.value ?? 0,
@@ -551,11 +615,75 @@ function WqlBars({ result, unit: unitProp }) {
551
615
  })),
552
616
  [result]
553
617
  );
618
+ const seriesData = React2.useMemo(
619
+ () => isOrdinal ? buildOrdinalChartData(result.series) : mergeSeries(result.series),
620
+ [isOrdinal, result]
621
+ );
554
622
  const unit = resolveWidgetDisplayUnit(result, unitProp);
623
+ const yAxisWidth = React2.useMemo(
624
+ () => computeYAxisWidth(
625
+ result.series.flatMap((s) => s.points.map((p) => p.value)),
626
+ unit
627
+ ),
628
+ [result.series, unit]
629
+ );
630
+ if (shape.kind === "error" || shape.kind === "empty") {
631
+ return /* @__PURE__ */ jsxRuntime.jsx(WqlEmptyState, { result, fallbackMessage: "No bar data available for this query." });
632
+ }
633
+ if (isTimeOrOrdinal) {
634
+ return /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.BarChart, { data: seriesData, margin: { top: 4, right: 8, bottom: 0, left: 8 }, children: [
635
+ /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { stroke: "hsl(var(--border))", vertical: false }),
636
+ /* @__PURE__ */ jsxRuntime.jsx(
637
+ recharts.XAxis,
638
+ {
639
+ dataKey: isOrdinal ? "label" : "ts",
640
+ tickFormatter: isOrdinal ? (v) => String(v) : formatTimestamp,
641
+ tickLine: false,
642
+ axisLine: { stroke: "hsl(var(--border))" },
643
+ stroke: "hsl(var(--muted-foreground))",
644
+ tick: { fill: "hsl(var(--muted-foreground))", fontSize: 10 }
645
+ }
646
+ ),
647
+ /* @__PURE__ */ jsxRuntime.jsx(
648
+ recharts.YAxis,
649
+ {
650
+ tickLine: false,
651
+ axisLine: false,
652
+ width: yAxisWidth,
653
+ stroke: "hsl(var(--muted-foreground))",
654
+ tick: /* @__PURE__ */ jsxRuntime.jsx(SingleLineYAxisTick, { unit })
655
+ }
656
+ ),
657
+ /* @__PURE__ */ jsxRuntime.jsx(
658
+ recharts.Tooltip,
659
+ {
660
+ contentStyle: {
661
+ backgroundColor: "hsl(var(--popover))",
662
+ borderColor: "hsl(var(--border))",
663
+ fontSize: "12px",
664
+ color: "hsl(var(--popover-foreground))"
665
+ },
666
+ labelFormatter: isOrdinal ? (v) => String(v) : (v) => tooltipTimestamp(v),
667
+ formatter: (v, name) => [formatMetricValue(v, unit), String(name ?? "")]
668
+ }
669
+ ),
670
+ result.series.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, { wrapperStyle: { fontSize: 11 } }),
671
+ result.series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
672
+ recharts.Bar,
673
+ {
674
+ dataKey: s.label,
675
+ name: s.label,
676
+ fill: SERIES_COLORS[i % SERIES_COLORS.length],
677
+ radius: [4, 4, 0, 0]
678
+ },
679
+ s.key
680
+ ))
681
+ ] }) });
682
+ }
555
683
  if (shape.kind !== "bars" && shape.kind !== "scalar") {
556
- return /* @__PURE__ */ jsxRuntime.jsx(WqlEmptyState, { result });
684
+ return /* @__PURE__ */ jsxRuntime.jsx(WqlEmptyState, { result, fallbackMessage: "No bar data available for this query." });
557
685
  }
558
- return /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.BarChart, { data: data2, margin: { top: 4, right: 8, bottom: 0, left: 48 }, children: [
686
+ return /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.BarChart, { data: categoryData, margin: { top: 4, right: 8, bottom: 0, left: 8 }, children: [
559
687
  /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { stroke: "hsl(var(--border))", vertical: false }),
560
688
  /* @__PURE__ */ jsxRuntime.jsx(
561
689
  recharts.XAxis,
@@ -572,10 +700,9 @@ function WqlBars({ result, unit: unitProp }) {
572
700
  {
573
701
  tickLine: false,
574
702
  axisLine: false,
575
- width: 64,
576
- tickFormatter: (v) => formatTimeseriesTick(v, unit),
703
+ width: yAxisWidth,
577
704
  stroke: "hsl(var(--muted-foreground))",
578
- tick: { fill: "hsl(var(--muted-foreground))", fontSize: 10 }
705
+ tick: /* @__PURE__ */ jsxRuntime.jsx(SingleLineYAxisTick, { unit })
579
706
  }
580
707
  ),
581
708
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -589,11 +716,11 @@ function WqlBars({ result, unit: unitProp }) {
589
716
  },
590
717
  formatter: (v, _n, p) => {
591
718
  const label = typeof p?.payload?.name === "string" ? p.payload.name : "";
592
- return [`${Number(v).toLocaleString()} ${unit ?? ""}`.trim(), label];
719
+ return [formatMetricValue(v, unit), label];
593
720
  }
594
721
  }
595
722
  ),
596
- /* @__PURE__ */ jsxRuntime.jsx(recharts.Bar, { dataKey: "value", radius: [4, 4, 0, 0], children: data2.map((d) => (
723
+ /* @__PURE__ */ jsxRuntime.jsx(recharts.Bar, { dataKey: "value", radius: [4, 4, 0, 0], children: categoryData.map((d) => (
597
724
  // eslint-disable-next-line @typescript-eslint/no-deprecated -- Recharts Bar per-bar fill still uses Cell
598
725
  /* @__PURE__ */ jsxRuntime.jsx(recharts.Cell, { fill: d.fill }, d.name)
599
726
  )) })
@@ -731,11 +858,7 @@ function TopList({ result, unit: unitProp, limit = 8 }) {
731
858
  }
732
859
  }
733
860
  ) }),
734
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs tabular-nums text-muted-foreground w-20 text-right", children: [
735
- r.value.toLocaleString(),
736
- " ",
737
- unit
738
- ] })
861
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground w-24 text-right whitespace-nowrap", children: formatMetricValue(r.value, unit) })
739
862
  ] }, r.name)) });
740
863
  }
741
864
  var INTENSITY_ORDER = ["low", "moderate", "high"];
@@ -743,6 +866,13 @@ function StackedBar({ result, unit: unitProp }) {
743
866
  const shape = useChartShape(result);
744
867
  const data2 = React2.useMemo(() => mergeSeries(result.series), [result]);
745
868
  const unit = resolveWidgetDisplayUnit(result, unitProp);
869
+ const yAxisWidth = React2.useMemo(
870
+ () => computeYAxisWidth(
871
+ result.series.flatMap((s) => s.points.map((p) => p.value)),
872
+ unit
873
+ ),
874
+ [result.series, unit]
875
+ );
746
876
  const keys = React2.useMemo(() => {
747
877
  const labels = result.series.map((s) => s.label);
748
878
  return labels.sort((a, b) => {
@@ -757,7 +887,7 @@ function StackedBar({ result, unit: unitProp }) {
757
887
  if (shape.kind !== "timeseries" && shape.kind !== "bars") {
758
888
  return /* @__PURE__ */ jsxRuntime.jsx(WqlEmptyState, { result });
759
889
  }
760
- return /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.BarChart, { data: data2, margin: { top: 4, right: 8, bottom: 0, left: 48 }, children: [
890
+ return /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.BarChart, { data: data2, margin: { top: 4, right: 8, bottom: 0, left: 8 }, children: [
761
891
  /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { stroke: "hsl(var(--border))", vertical: false }),
762
892
  /* @__PURE__ */ jsxRuntime.jsx(
763
893
  recharts.XAxis,
@@ -775,11 +905,9 @@ function StackedBar({ result, unit: unitProp }) {
775
905
  {
776
906
  tickLine: false,
777
907
  axisLine: false,
778
- width: 48,
779
- tickFormatter: compactNumber,
908
+ width: yAxisWidth,
780
909
  stroke: "hsl(var(--muted-foreground))",
781
- tick: { fill: "hsl(var(--muted-foreground))", fontSize: 10 },
782
- unit: unit ? ` ${unit}` : ""
910
+ tick: /* @__PURE__ */ jsxRuntime.jsx(SingleLineYAxisTick, { unit })
783
911
  }
784
912
  ),
785
913
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -792,9 +920,9 @@ function StackedBar({ result, unit: unitProp }) {
792
920
  color: "hsl(var(--popover-foreground))"
793
921
  },
794
922
  labelFormatter: (v) => tooltipTimestamp(v),
795
- formatter: (v, _n, p) => {
796
- const label = typeof p?.payload?.name === "string" ? p.payload.name : "";
797
- return [`${Number(v).toLocaleString()} ${unit ?? ""}`.trim(), label];
923
+ formatter: (v, name, p) => {
924
+ const label = typeof p?.payload?.name === "string" && p.payload.name ? p.payload.name : String(name ?? "");
925
+ return [formatMetricValue(v, unit), label];
798
926
  }
799
927
  }
800
928
  ),
@@ -853,8 +981,8 @@ function GoalRingItem({
853
981
  pct,
854
982
  unit
855
983
  }) {
856
- const formattedCurrent = current.toLocaleString();
857
- const formattedTarget = target ? target.toLocaleString() : void 0;
984
+ const formattedCurrent = formatMetricValue(current);
985
+ const formattedTarget = target !== void 0 ? formatMetricValue(target) : void 0;
858
986
  const radius = 38;
859
987
  const circumference = 2 * Math.PI * radius;
860
988
  const clampedPct = pct !== void 0 ? Math.min(Math.max(pct, 0), 100) : 0;
@@ -1203,14 +1331,15 @@ function rpeChipClass(rpe, selected) {
1203
1331
  }
1204
1332
  function formatSummaryDurationMMSS(ms) {
1205
1333
  if (!Number.isFinite(ms) || ms <= 0) return "\u2014";
1206
- const totalSec = Math.round(ms / 1e3);
1207
- const hours = Math.floor(totalSec / 3600);
1208
- const mins = Math.floor(totalSec % 3600 / 60);
1209
- const secs = totalSec % 60;
1210
- if (hours > 0) {
1211
- return `${hours}:${String(mins).padStart(2, "0")}:${String(secs).padStart(2, "0")}`;
1212
- }
1213
- return `${mins}:${String(secs).padStart(2, "0")}`;
1334
+ const formatted = wodWikiCore.formatDurationMMSS(ms);
1335
+ return formatted.startsWith("0") && formatted.length === 5 && ms < 6e5 ? formatted.slice(1) : formatted;
1336
+ }
1337
+ function formatAnalyticsFloat(value) {
1338
+ if (!Number.isFinite(value)) return "0.0";
1339
+ return (Math.round(value * 10) / 10).toLocaleString("en-US", {
1340
+ minimumFractionDigits: 1,
1341
+ maximumFractionDigits: 1
1342
+ });
1214
1343
  }
1215
1344
  function formatCompactNum(value) {
1216
1345
  if (!Number.isFinite(value)) return "0";
@@ -1398,8 +1527,8 @@ function SessionSummaryCard({
1398
1527
  const effortList = summary.efforts ?? [];
1399
1528
  const primaryWorkSub = hasVolume && hasDistance ? `${formatCompactNum(summary.totalDistance)} ${summary.distanceUnit ?? "m"} distance` : effortList.length > 0 ? `${effortList.length} movement${effortList.length === 1 ? "" : "s"}` : void 0;
1400
1529
  const intensityLabel = summary.tis !== void 0 ? "Intensity (TIS)" : summary.sessionLoad !== void 0 ? "Session Load" : "Movements";
1401
- const intensityValue = summary.tis !== void 0 ? `${formatCompactNum(summary.tis)} pts` : summary.sessionLoad !== void 0 ? `${formatCompactNum(summary.sessionLoad)} AU` : effortList.length > 0 ? String(effortList.length) : "\u2014";
1402
- const intensitySub = summary.tis !== void 0 && summary.sessionLoad !== void 0 ? `${formatCompactNum(summary.sessionLoad)} AU load` : summary.rpe !== void 0 ? `RPE ${summary.rpe}/10 logged` : void 0;
1530
+ const intensityValue = summary.tis !== void 0 ? `${formatAnalyticsFloat(summary.tis)} pts` : summary.sessionLoad !== void 0 ? `${formatAnalyticsFloat(summary.sessionLoad)} AU` : effortList.length > 0 ? String(effortList.length) : "\u2014";
1531
+ const intensitySub = summary.tis !== void 0 && summary.sessionLoad !== void 0 ? `${formatAnalyticsFloat(summary.sessionLoad)} AU load` : summary.rpe !== void 0 ? `RPE ${summary.rpe}/10 logged` : void 0;
1403
1532
  const rollups = summary.movementRollup ?? [];
1404
1533
  const visibleRollups = rollupExpanded ? rollups : rollups.slice(0, compactMobile ? 2 : 3);
1405
1534
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1614,14 +1743,24 @@ var TONE_CLASS = {
1614
1743
  };
1615
1744
  function MetricBadge({ token }) {
1616
1745
  if (!token.visible || !token.label) return null;
1746
+ const accessibleLabel = token.columnLabel ? `${token.columnLabel}: ${token.label}` : token.label;
1617
1747
  if (token.renderKind === "comment") {
1618
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] italic text-muted-foreground", title: token.tooltip, children: token.label });
1748
+ return /* @__PURE__ */ jsxRuntime.jsx(
1749
+ "span",
1750
+ {
1751
+ className: "text-[10px] italic text-muted-foreground",
1752
+ title: token.tooltip,
1753
+ "aria-label": accessibleLabel,
1754
+ children: token.label
1755
+ }
1756
+ );
1619
1757
  }
1620
1758
  return /* @__PURE__ */ jsxRuntime.jsx(
1621
1759
  "span",
1622
1760
  {
1623
1761
  className: `rounded-md border px-1.5 py-0.5 text-[10px] font-medium leading-tight select-none ${TONE_CLASS[token.tone] ?? TONE_CLASS.unknown}`,
1624
1762
  title: token.tooltip,
1763
+ "aria-label": accessibleLabel,
1625
1764
  children: token.label
1626
1765
  }
1627
1766
  );
@@ -2041,7 +2180,7 @@ function StatementCards({
2041
2180
  /* @__PURE__ */ jsxRuntime.jsx(
2042
2181
  "span",
2043
2182
  {
2044
- className: `inline-block shrink-0 rounded px-1.5 py-0.2 text-[9px] font-bold uppercase tracking-wider ${OUTPUT_TYPE_CLASS[typeKey] ?? OUTPUT_TYPE_CLASS.system}`,
2183
+ className: `inline-block shrink-0 rounded px-1.5 py-0.2 text-[9px] font-bold tracking-wider ${OUTPUT_TYPE_CLASS[typeKey] ?? OUTPUT_TYPE_CLASS.system}`,
2045
2184
  children: typeLabel
2046
2185
  }
2047
2186
  ),
@@ -2322,7 +2461,7 @@ function OutputStatementsTable({
2322
2461
  return /* @__PURE__ */ jsxRuntime.jsx("td", { className: "p-2 text-center whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsx(
2323
2462
  "span",
2324
2463
  {
2325
- className: `inline-block rounded px-1.5 py-0.2 text-[9px] font-bold uppercase tracking-wider ${OUTPUT_TYPE_CLASS[String(out.outputType)] ?? OUTPUT_TYPE_CLASS.system}`,
2464
+ className: `inline-block rounded px-1.5 py-0.2 text-[9px] font-bold tracking-wider ${OUTPUT_TYPE_CLASS[String(out.outputType)] ?? OUTPUT_TYPE_CLASS.system}`,
2326
2465
  title: rowTitle,
2327
2466
  children: typeLabel
2328
2467
  }
@@ -2518,9 +2657,25 @@ function extractVisibleMetrics(row) {
2518
2657
  }
2519
2658
  function buildSpreadsheetRows(run, prHighlights) {
2520
2659
  const prMap = normalizePrLookup(prHighlights);
2521
- const segmentEvents = (run.events ?? []).filter(
2522
- (e) => e.outputType === "segment" && !String(e.sourceBlockKey ?? "").toLowerCase().startsWith("waiting-to-start")
2523
- );
2660
+ const rawSegments = (run.events ?? []).filter((e) => {
2661
+ if (e.outputType !== "segment") return false;
2662
+ const key = String(e.sourceBlockKey ?? "").toLowerCase();
2663
+ return !key.startsWith("waiting-to-start") && key !== "session-root" && key !== "root";
2664
+ });
2665
+ const maxStackLevel = rawSegments.reduce((max, e) => Math.max(max, e.stackLevel ?? 0), 0);
2666
+ const hasEffortLeaves = rawSegments.some((e) => {
2667
+ const metrics = extractVisibleMetrics(e);
2668
+ return Boolean(e.effortSlug) || metrics.some((m) => String(m.type ?? "").toLowerCase() === "effort");
2669
+ });
2670
+ const segmentEvents = hasEffortLeaves ? rawSegments.filter((e) => {
2671
+ if ((e.stackLevel ?? 0) >= maxStackLevel) return true;
2672
+ const metrics = extractVisibleMetrics(e);
2673
+ const hasMovement = Boolean(e.effortSlug) || metrics.some((m) => {
2674
+ const t = String(m.type ?? "").toLowerCase();
2675
+ return t === "effort" || t === "rep" || t === "reps" || t === "distance";
2676
+ });
2677
+ return hasMovement;
2678
+ }) : rawSegments;
2524
2679
  const sessionStart = segmentEvents.reduce(
2525
2680
  (min, e) => e.timeSpan?.started !== void 0 ? Math.min(min, e.timeSpan.started) : min,
2526
2681
  run.timestamp
@@ -2538,6 +2693,7 @@ function buildSpreadsheetRows(run, prHighlights) {
2538
2693
  let loadType = "resistance";
2539
2694
  let loadModified = false;
2540
2695
  let splitSec = null;
2696
+ let splitFromElapsed = false;
2541
2697
  let splitModified = false;
2542
2698
  let distance = null;
2543
2699
  let distanceUnit = "m";
@@ -2579,10 +2735,17 @@ function buildSpreadsheetRows(run, prHighlights) {
2579
2735
  loadType = mType || "resistance";
2580
2736
  loadModified = isUser;
2581
2737
  }
2582
- } else if (canon === "elapsed" || canon === "duration" || lower === "duration") {
2583
- const sec = m.unit === "ms" ? m.value / 1e3 : m.unit === "min" ? m.value * 60 : m.value;
2584
- if (splitSec === null || isUser) {
2585
- splitSec = sec;
2738
+ } else if (canon === "elapsed" || lower === "elapsed") {
2739
+ const ms = wodWikiCore.metricToMs(m);
2740
+ if (ms !== void 0 && (!splitModified || isUser)) {
2741
+ splitSec = ms / 1e3;
2742
+ splitFromElapsed = true;
2743
+ splitModified = isUser;
2744
+ }
2745
+ } else if (canon === "duration" || lower === "duration") {
2746
+ const ms = wodWikiCore.metricToMs(m);
2747
+ if (ms !== void 0 && (splitSec === null && !splitFromElapsed || isUser)) {
2748
+ splitSec = ms / 1e3;
2586
2749
  splitModified = isUser;
2587
2750
  }
2588
2751
  } else if (canon === "distance" || canon === "totaldistance" || lower === "distance") {
@@ -2853,7 +3016,8 @@ function formatCellDisplay(row, colId) {
2853
3016
  default: {
2854
3017
  const custom = row.custom[colId];
2855
3018
  if (!custom) return "\u2014";
2856
- return `${formatNum(custom.value, 2)}${custom.unit ? ` ${custom.unit}` : ""}`;
3019
+ const displayVal = Number.isInteger(custom.value) ? formatNum(custom.value, 0) : formatAnalyticsFloat(custom.value);
3020
+ return `${displayVal}${custom.unit ? ` ${custom.unit}` : ""}`;
2857
3021
  }
2858
3022
  }
2859
3023
  }
@@ -3126,18 +3290,22 @@ function ResultsSpreadsheetGrid({
3126
3290
  if (!showCustomSummariesStrip) return [];
3127
3291
  const seen = /* @__PURE__ */ new Set();
3128
3292
  const items = [];
3293
+ const hasGrainSummary = (run.events ?? []).some((e) => e.grain === "summary");
3129
3294
  for (const ev of run.events ?? []) {
3130
3295
  if (ev.outputType !== "analytics" && ev.grain !== "summary") continue;
3296
+ if (hasGrainSummary && ev.grain !== "summary") continue;
3131
3297
  for (const m of extractVisibleMetrics(ev)) {
3132
3298
  const mType = String(m.type ?? "");
3133
3299
  if (!mType || mType === "label" || mType === "hint" || mType === "diagnostic") continue;
3134
3300
  if (typeof m.value !== "number" || !Number.isFinite(m.value)) continue;
3135
- if (seen.has(mType)) continue;
3136
- seen.add(mType);
3301
+ const canonKey = String(m.metadata?.canonicalKey ?? mType);
3302
+ if (seen.has(canonKey)) continue;
3303
+ seen.add(canonKey);
3304
+ const formatted = Number.isInteger(m.value) && (m.unit === "reps" || m.unit === "rounds") ? formatNum(m.value, 0) : formatAnalyticsFloat(m.value);
3137
3305
  items.push({
3138
- key: mType,
3139
- label: mType,
3140
- value: `${formatNum(m.value, 1)}${m.unit ? ` ${m.unit}` : ""}`,
3306
+ key: canonKey,
3307
+ label: wodWikiLang.computeColumnLabel(canonKey),
3308
+ value: `${formatted}${m.unit ? ` ${m.unit}` : ""}`,
3141
3309
  origin: m.origin
3142
3310
  });
3143
3311
  }
@@ -3745,7 +3913,7 @@ function ResultsSpreadsheetGrid({
3745
3913
  ] }),
3746
3914
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2.5 text-right font-mono tabular-nums", children: s.totalVolume > 0 ? `${formatNum(s.totalVolume, 0)} ${s.volumeUnit ?? ""}` : s.totalDistance > 0 ? `${formatNum(s.totalDistance, 0)} ${s.distanceUnit ?? ""}` : "\u2014" }),
3747
3915
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2.5 text-right font-mono tabular-nums", children: s.totalReps > 0 ? formatNum(s.totalReps, 0) : "\u2014" }),
3748
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2.5 text-right font-mono tabular-nums", children: s.tis !== void 0 ? `${formatNum(s.tis, 0)} pts` : "\u2014" }),
3916
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2.5 text-right font-mono tabular-nums", children: s.tis !== void 0 ? `${formatAnalyticsFloat(s.tis)} pts` : "\u2014" }),
3749
3917
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2.5 text-right font-mono tabular-nums", children: s.rpe !== void 0 ? `${s.rpe}/10` : "\u2014" })
3750
3918
  ]
3751
3919
  },
@@ -3767,6 +3935,7 @@ function ResultsSpreadsheetGrid({
3767
3935
  {
3768
3936
  outputs: run.events,
3769
3937
  filter: rawFilter,
3938
+ timeOrigin: run.timestamp,
3770
3939
  onClearFilter: () => setRawFilter(""),
3771
3940
  onEditMetric: onEditMetric ? (p) => onEditMetric(run.resultId, p) : void 0,
3772
3941
  prHighlights
@@ -4842,6 +5011,8 @@ function RpeChip({
4842
5011
  }
4843
5012
  function useSessionPrHighlights(sessionRun, blockContentId2, executor, enabled, retainHistory = false) {
4844
5013
  const [wideResult, setWideResult] = React2.useState(void 0);
5014
+ const sessionRunId = sessionRun?.resultId;
5015
+ const sessionEventCount = sessionRun?.events.length ?? 0;
4845
5016
  React2.useEffect(() => {
4846
5017
  if (!enabled || !blockContentId2 || !executor) {
4847
5018
  if (!retainHistory) setWideResult(void 0);
@@ -4856,12 +5027,12 @@ function useSessionPrHighlights(sessionRun, blockContentId2, executor, enabled,
4856
5027
  void promise.then((res) => {
4857
5028
  if (!cancelled && res && Array.isArray(res.runs)) setWideResult(res);
4858
5029
  }).catch(() => {
4859
- if (!cancelled) setWideResult(void 0);
5030
+ if (!cancelled && !retainHistory) setWideResult(void 0);
4860
5031
  });
4861
5032
  return () => {
4862
5033
  cancelled = true;
4863
5034
  };
4864
- }, [enabled, retainHistory, blockContentId2, executor, sessionRun?.events]);
5035
+ }, [enabled, retainHistory, blockContentId2, executor, sessionRunId, sessionEventCount]);
4865
5036
  const prHighlights = React2.useMemo(
4866
5037
  () => enabled ? computeSessionPrHighlights(sessionRun, wideResult?.runs) : void 0,
4867
5038
  [enabled, sessionRun, wideResult?.runs]
@@ -5136,14 +5307,14 @@ var CLAUSE_ICON_MAP = {
5136
5307
  tag: lucideReact.Tag,
5137
5308
  tags: lucideReact.Tag,
5138
5309
  contributes: lucideReact.Sparkles,
5139
- effort: lucideReact.Dumbbell,
5310
+ effort: lucideReact.Flame,
5140
5311
  domain: lucideReact.Globe,
5141
5312
  format: lucideReact.Clock,
5142
- equipment: lucideReact.Wrench,
5313
+ equipment: lucideReact.Dumbbell,
5143
5314
  quality: lucideReact.Zap,
5144
5315
  intent: lucideReact.Gauge,
5145
5316
  discipline: lucideReact.SlidersHorizontal,
5146
- intensity: lucideReact.Flame,
5317
+ intensity: lucideReact.Activity,
5147
5318
  origin: lucideReact.Bookmark,
5148
5319
  type: lucideReact.Box,
5149
5320
  time: lucideReact.CalendarRange,
@@ -9737,9 +9908,19 @@ function QueryBlockView({
9737
9908
  const parsed = React2.useMemo(() => wodWikiWql.parseQuery(effectiveQuery), [effectiveQuery]);
9738
9909
  const effectiveWidgetError = widgetError ?? yamlObject?.error;
9739
9910
  const syntaxError = isMultiLineDoc ? docParse.diagnostics[0] : parsed.error;
9911
+ const missingKey = missing.join("\0");
9912
+ const resolvedAttributesKey = React2.useMemo(() => JSON.stringify(resolvedAttributes), [resolvedAttributes]);
9913
+ const parsedRef = React2.useRef(parsed);
9914
+ parsedRef.current = parsed;
9915
+ const resolvedAttributesRef = React2.useRef(resolvedAttributes);
9916
+ resolvedAttributesRef.current = resolvedAttributes;
9740
9917
  const unknownType = effectiveWidgetType != null && effectiveWidgetType !== "" && !wodWikiWql.isDashboardWidgetType(effectiveWidgetType);
9741
9918
  const [runResult, setRunResult] = React2.useState(void 0);
9742
9919
  const [runError, setRunError] = React2.useState(void 0);
9920
+ const [isRecalculating, setIsRecalculating] = React2.useState(false);
9921
+ const [lockedMinHeight, setLockedMinHeight] = React2.useState(void 0);
9922
+ const bodyContainerRef = React2.useRef(null);
9923
+ const settledHeightRef = React2.useRef(0);
9743
9924
  const [rowsRefreshKey, setRowsRefreshKey] = React2.useState(0);
9744
9925
  React2.useEffect(() => {
9745
9926
  if (onResultSaved) {
@@ -9751,13 +9932,46 @@ function QueryBlockView({
9751
9932
  };
9752
9933
  }
9753
9934
  }, [onResultSaved]);
9935
+ React2.useEffect(() => {
9936
+ const el = bodyContainerRef.current;
9937
+ if (!el || isRecalculating) return;
9938
+ const measure = () => {
9939
+ const h = el.getBoundingClientRect().height;
9940
+ if (h > 0) settledHeightRef.current = h;
9941
+ };
9942
+ measure();
9943
+ if (typeof ResizeObserver === "undefined") return;
9944
+ const ro = new ResizeObserver(measure);
9945
+ ro.observe(el);
9946
+ return () => ro.disconnect();
9947
+ }, [isRecalculating, runResult, runError, syntaxError, effectiveWidgetError, unknownType, missingKey]);
9948
+ React2.useEffect(() => {
9949
+ if (isRecalculating || lockedMinHeight === void 0) return;
9950
+ if (typeof requestAnimationFrame !== "function") {
9951
+ setLockedMinHeight(void 0);
9952
+ return;
9953
+ }
9954
+ const rafId = requestAnimationFrame(() => {
9955
+ setLockedMinHeight(void 0);
9956
+ });
9957
+ return () => cancelAnimationFrame(rafId);
9958
+ }, [isRecalculating, lockedMinHeight]);
9754
9959
  React2.useEffect(() => {
9755
9960
  let cancelled = false;
9756
9961
  let retryTimer;
9757
- setRunError(void 0);
9758
- setRunResult(void 0);
9759
- if (syntaxError || effectiveWidgetError || unknownType || missing.length > 0 || !executor) return;
9760
- const isSessionFind = !isMultiLineDoc && wodWikiWql.isFindQuery(parsed) && parsed.target === "session";
9962
+ if (syntaxError || effectiveWidgetError || unknownType || missingKey.length > 0 || !executor) {
9963
+ setRunError(void 0);
9964
+ setIsRecalculating(false);
9965
+ setLockedMinHeight(void 0);
9966
+ return;
9967
+ }
9968
+ const currentParsed = parsedRef.current;
9969
+ const currentAttributes = resolvedAttributesRef.current;
9970
+ if (settledHeightRef.current > 0) {
9971
+ setLockedMinHeight(Math.ceil(settledHeightRef.current));
9972
+ }
9973
+ setIsRecalculating(true);
9974
+ const isSessionFind = !isMultiLineDoc && wodWikiWql.isFindQuery(currentParsed) && currentParsed.target === "session";
9761
9975
  const host = createExecutorDocumentHost(executor);
9762
9976
  const executeRun = (attemptCount) => {
9763
9977
  const runner = new wodWikiWql.SharedQueryDocumentRunner(host, pageSources ? { pageSources } : void 0);
@@ -9766,15 +9980,21 @@ function QueryBlockView({
9766
9980
  const error = res.outputs.find((o) => o.error !== void 0)?.error ?? res.diagnostics[0];
9767
9981
  if (!res.outputs.length && res.diagnostics.length) {
9768
9982
  setRunError(res.diagnostics[0]);
9983
+ setRunResult(void 0);
9984
+ setIsRecalculating(false);
9769
9985
  return;
9770
9986
  }
9771
9987
  if (error) {
9772
9988
  setRunError(error);
9989
+ setRunResult(void 0);
9990
+ setIsRecalculating(false);
9773
9991
  return;
9774
9992
  }
9775
- const effectiveParsed = isMultiLineDoc ? { family: "aggregate", raw: effectiveQuery, agg: "sum", metric: res.outputs[0]?.name ?? "value", filters: [], groupBy: [] } : parsed;
9776
- const shaped = outputsToRunResult(effectiveParsed, res, resolvedAttributes);
9993
+ const effectiveParsed = isMultiLineDoc ? { family: "aggregate", raw: effectiveQuery, agg: "sum", metric: res.outputs[0]?.name ?? "value", filters: [], groupBy: [] } : currentParsed;
9994
+ const shaped = outputsToRunResult(effectiveParsed, res, currentAttributes);
9995
+ setRunError(void 0);
9777
9996
  setRunResult(shaped);
9997
+ setIsRecalculating(false);
9778
9998
  if (isSessionFind && (shaped.runs ?? []).length === 0 && attemptCount < 4) {
9779
9999
  const delays = [50, 150, 350, 750];
9780
10000
  retryTimer = setTimeout(() => {
@@ -9782,7 +10002,11 @@ function QueryBlockView({
9782
10002
  }, delays[attemptCount] ?? 500);
9783
10003
  }
9784
10004
  }).catch((err) => {
9785
- if (!cancelled) setRunError(err instanceof Error ? err.message : String(err));
10005
+ if (!cancelled) {
10006
+ setRunError(err instanceof Error ? err.message : String(err));
10007
+ setRunResult(void 0);
10008
+ setIsRecalculating(false);
10009
+ }
9786
10010
  });
9787
10011
  };
9788
10012
  executeRun(0);
@@ -9790,7 +10014,7 @@ function QueryBlockView({
9790
10014
  cancelled = true;
9791
10015
  clearTimeout(retryTimer);
9792
10016
  };
9793
- }, [effectiveQuery, parsed, isMultiLineDoc, syntaxError, effectiveWidgetError, unknownType, missing, executor, rowsRefreshKey, resolvedAttributes, pageSources]);
10017
+ }, [effectiveQuery, isMultiLineDoc, syntaxError, effectiveWidgetError, unknownType, missingKey, executor, rowsRefreshKey, resolvedAttributesKey, pageSources]);
9794
10018
  const canEdit = onSaveQuery !== void 0 && !readOnly;
9795
10019
  const onEdit = canEdit ? () => setIsModalOpen(true) : void 0;
9796
10020
  const effectiveEditSource = !readOnly ? onEditSource : void 0;
@@ -9822,29 +10046,39 @@ function QueryBlockView({
9822
10046
  onAddToDashboard,
9823
10047
  hideActions: effectiveWidgetType === "summary" && Boolean(runResult?.runs?.length),
9824
10048
  children: /* @__PURE__ */ jsxRuntime.jsx(
9825
- QueryBlockBody,
10049
+ "div",
9826
10050
  {
9827
- parsed,
9828
- result: runResult,
9829
- resultId,
9830
- widgetType: effectiveWidgetType,
9831
- isMultiLineDoc,
9832
- yamlColumns: yamlObject?.columns,
9833
- yamlSort: yamlObject?.sort,
9834
- yamlLimit: yamlObject?.limit,
9835
- yamlComparePr: yamlObject?.comparePr,
9836
- attributes: resolvedAttributes,
9837
- fallbackLabel,
9838
- executor,
9839
- onCaptureRpe,
9840
- onEditMetric: readOnly ? void 0 : onEditMetric,
9841
- onCaptured: () => setRowsRefreshKey((k) => k + 1),
9842
- onOpenNote,
9843
- noteHref,
9844
- onOpenResults,
9845
- onAddToDashboard,
9846
- onEditSource: effectiveEditSource,
9847
- readOnly
10051
+ ref: bodyContainerRef,
10052
+ "aria-busy": isRecalculating || void 0,
10053
+ "data-recalculating": isRecalculating ? "true" : void 0,
10054
+ style: lockedMinHeight ? { minHeight: `${lockedMinHeight}px` } : void 0,
10055
+ className: isRecalculating && runResult ? "opacity-70 transition-opacity duration-150" : "transition-opacity duration-150",
10056
+ children: /* @__PURE__ */ jsxRuntime.jsx(
10057
+ QueryBlockBody,
10058
+ {
10059
+ parsed,
10060
+ result: runResult,
10061
+ resultId,
10062
+ widgetType: effectiveWidgetType,
10063
+ isMultiLineDoc,
10064
+ yamlColumns: yamlObject?.columns,
10065
+ yamlSort: yamlObject?.sort,
10066
+ yamlLimit: yamlObject?.limit,
10067
+ yamlComparePr: yamlObject?.comparePr,
10068
+ attributes: resolvedAttributes,
10069
+ fallbackLabel,
10070
+ executor,
10071
+ onCaptureRpe,
10072
+ onEditMetric: readOnly ? void 0 : onEditMetric,
10073
+ onCaptured: () => setRowsRefreshKey((k) => k + 1),
10074
+ onOpenNote,
10075
+ noteHref,
10076
+ onOpenResults,
10077
+ onAddToDashboard,
10078
+ onEditSource: effectiveEditSource,
10079
+ readOnly
10080
+ }
10081
+ )
9848
10082
  }
9849
10083
  )
9850
10084
  }
@@ -9896,7 +10130,9 @@ function QueryBlockBody({
9896
10130
  Boolean(effectiveType === "summary" && yamlComparePr !== false && summaryBlockContentId && executor)
9897
10131
  );
9898
10132
  if (!result) {
9899
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground py-2", children: wodWikiWql.isFindQuery(parsed) ? "Loading rows\u2026" : "Loading\u2026" });
10133
+ const expectsChart = wodWikiWql.isPipelineQuery(parsed) || Boolean(isMultiLineDoc) || ["timeseries", "bar", "line", "pie", "area", "chart"].includes(effectiveType);
10134
+ const placeholderMinH = effectiveType === "value" ? "min-h-[64px]" : expectsChart ? "min-h-[220px]" : "min-h-[120px]";
10135
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex items-center text-xs text-muted-foreground py-2 ${placeholderMinH}`, children: wodWikiWql.isFindQuery(parsed) ? "Loading rows\u2026" : "Loading\u2026" });
9900
10136
  }
9901
10137
  if (result.table && (widgetType == null || widgetType === "" || widgetType === "table")) {
9902
10138
  return /* @__PURE__ */ jsxRuntime.jsx(WidgetChart, { type: "table", result });
@@ -10234,7 +10470,11 @@ function editorTheme(isDark, dialect = "markdown") {
10234
10470
  boxSizing: "border-box",
10235
10471
  fontSize: "14px",
10236
10472
  textAlign: "left",
10237
- color: "hsl(var(--foreground))"
10473
+ color: "hsl(var(--foreground))",
10474
+ backgroundColor: "transparent"
10475
+ },
10476
+ "&.cm-editor": {
10477
+ backgroundColor: "transparent"
10238
10478
  },
10239
10479
  "&.cm-focused": {
10240
10480
  outline: "none"
@@ -10738,6 +10978,16 @@ function activeCursorSection(state) {
10738
10978
  }
10739
10979
 
10740
10980
  // src/extensions/whiteboard-linter.ts
10981
+ var BLOCK_HEADER_LINE_RE = /^[ \t]*(?:\d+:\d+(?::\d+)?\s+)?(?:AMRAP|EMOM|TABATA|FOR TIME)\b|^[ \t]*\(\s*\d+(?:\s*-\s*\d+)*\s*(?:rounds?|rds?)?\s*\)/i;
10982
+ function leadingIndentWidth(line) {
10983
+ let w = 0;
10984
+ for (let i = 0; i < line.length; i++) {
10985
+ if (line[i] === " ") w += 1;
10986
+ else if (line[i] === " ") w += 2;
10987
+ else break;
10988
+ }
10989
+ return w;
10990
+ }
10741
10991
  function findWorkoutErrors(content, offsetInDoc) {
10742
10992
  if (!content.trim()) return [];
10743
10993
  const doc = content.endsWith("\n") ? content : content + "\n";
@@ -10761,6 +11011,54 @@ function findWorkoutErrors(content, offsetInDoc) {
10761
11011
  }
10762
11012
  }
10763
11013
  });
11014
+ const lines = content.split("\n");
11015
+ const lineOffsets = [];
11016
+ let cursor2 = 0;
11017
+ for (const line of lines) {
11018
+ lineOffsets.push(cursor2);
11019
+ cursor2 += line.length + 1;
11020
+ }
11021
+ for (let i = 0; i < lines.length; i++) {
11022
+ const header = lines[i];
11023
+ if (!header.trim() || !BLOCK_HEADER_LINE_RE.test(header)) continue;
11024
+ const headerIndent2 = leadingIndentWidth(header);
11025
+ const bodyLineStarts = [];
11026
+ let firstFrom = -1;
11027
+ let lastTo = -1;
11028
+ for (let j = i + 1; j < lines.length; j++) {
11029
+ const nextLine = lines[j];
11030
+ if (!nextLine.trim()) break;
11031
+ if (leadingIndentWidth(nextLine) > headerIndent2) {
11032
+ bodyLineStarts.length = 0;
11033
+ break;
11034
+ }
11035
+ if (BLOCK_HEADER_LINE_RE.test(nextLine)) break;
11036
+ const absStart = offsetInDoc + lineOffsets[j];
11037
+ bodyLineStarts.push(absStart);
11038
+ if (firstFrom < 0) firstFrom = absStart;
11039
+ lastTo = absStart + nextLine.length;
11040
+ }
11041
+ if (bodyLineStarts.length > 0 && firstFrom >= 0) {
11042
+ diagnostics.push({
11043
+ from: firstFrom,
11044
+ to: Math.max(firstFrom + 1, lastTo),
11045
+ severity: "warning",
11046
+ message: "Indent lines below header so they run inside the block",
11047
+ actions: [
11048
+ {
11049
+ name: "Indent workout body",
11050
+ apply(view) {
11051
+ const docLen = view.state.doc.length;
11052
+ const changes = bodyLineStarts.filter((pos) => pos >= 0 && pos <= docLen).map((pos) => ({ from: pos, to: pos, insert: " " }));
11053
+ if (changes.length > 0) {
11054
+ view.dispatch({ changes });
11055
+ }
11056
+ }
11057
+ }
11058
+ ]
11059
+ });
11060
+ }
11061
+ }
10764
11062
  return diagnostics;
10765
11063
  }
10766
11064
  function workoutLintSource(view) {
@@ -10872,7 +11170,7 @@ var ReactQueryBlock = class extends view.WidgetType {
10872
11170
  root = null;
10873
11171
  container = null;
10874
11172
  eq(other) {
10875
- return this.queryText === other.queryText && this.sectionId === other.sectionId && this.sectionFrom === other.sectionFrom && this.widgetType === other.widgetType && this.widgetError === other.widgetError && JSON.stringify(this.attributes ?? {}) === JSON.stringify(other.attributes ?? {}) && JSON.stringify(this.tokenValues ?? {}) === JSON.stringify(other.tokenValues ?? {}) && this.options?.readOnly === other.options?.readOnly && this.options?.executor === other.options?.executor && this.options?.onOpenNote === other.options?.onOpenNote && this.options?.noteHref === other.options?.noteHref && this.options?.onOpenResults === other.options?.onOpenResults && this.options?.onAddToDashboard === other.options?.onAddToDashboard && this.options?.pageSources === other.options?.pageSources;
11173
+ return this.queryText === other.queryText && this.sectionId === other.sectionId && this.widgetType === other.widgetType && this.widgetError === other.widgetError && JSON.stringify(this.attributes ?? {}) === JSON.stringify(other.attributes ?? {}) && JSON.stringify(this.tokenValues ?? {}) === JSON.stringify(other.tokenValues ?? {}) && this.options?.readOnly === other.options?.readOnly && this.options?.executor === other.options?.executor && this.options?.onOpenNote === other.options?.onOpenNote && this.options?.noteHref === other.options?.noteHref && this.options?.onOpenResults === other.options?.onOpenResults && this.options?.onAddToDashboard === other.options?.onAddToDashboard && this.options?.pageSources === other.options?.pageSources;
10876
11174
  }
10877
11175
  resolveSection(view) {
10878
11176
  const byId = findQueryBlockSection(view, this.sectionId);
@@ -10966,6 +11264,9 @@ var ReactQueryBlock = class extends view.WidgetType {
10966
11264
  ignoreEvent() {
10967
11265
  return true;
10968
11266
  }
11267
+ get estimatedHeight() {
11268
+ return this.widgetType === "value" ? 96 : 220;
11269
+ }
10969
11270
  get block() {
10970
11271
  return true;
10971
11272
  }
@@ -10979,7 +11280,7 @@ var QueryPreviewToggleWidget = class extends view.WidgetType {
10979
11280
  sectionId;
10980
11281
  exitPos;
10981
11282
  eq(other) {
10982
- return this.sectionId === other.sectionId && this.exitPos === other.exitPos;
11283
+ return this.sectionId === other.sectionId;
10983
11284
  }
10984
11285
  toDOM(view) {
10985
11286
  const btn = document.createElement("button");
@@ -10995,7 +11296,8 @@ var QueryPreviewToggleWidget = class extends view.WidgetType {
10995
11296
  btn.addEventListener("click", (e) => {
10996
11297
  e.preventDefault();
10997
11298
  e.stopPropagation();
10998
- const targetPos = Math.min(this.exitPos, view.state.doc.length);
11299
+ const liveExitPos = findQueryBlockSection(view, this.sectionId)?.to ?? this.exitPos;
11300
+ const targetPos = Math.min(liveExitPos, view.state.doc.length);
10999
11301
  view.dispatch({
11000
11302
  selection: { anchor: targetPos },
11001
11303
  effects: setQuerySourceEditing.of({
@@ -11097,21 +11399,102 @@ var queryBlockPreviewTheme = view.EditorView.baseTheme({
11097
11399
  backgroundColor: "hsl(var(--muted))"
11098
11400
  }
11099
11401
  });
11402
+ var queryBlockOptionsFacet = state.Facet.define({
11403
+ combine: (values2) => values2[values2.length - 1]
11404
+ });
11405
+ var queryBlockDecoField = state.StateField.define({
11406
+ create(state) {
11407
+ return buildQueryBlockDecos(state, state.facet(queryBlockOptionsFacet));
11408
+ },
11409
+ update(deco, tr) {
11410
+ if (tr.docChanged || tr.selection || tr.startState.field(sectionField) !== tr.state.field(sectionField) || tr.startState.facet(queryBlockOptionsFacet) !== tr.state.facet(queryBlockOptionsFacet) || tr.effects.some((e) => e.is(setQuerySourceEditing) || e.is(setEditorFocused))) {
11411
+ return buildQueryBlockDecos(tr.state, tr.state.facet(queryBlockOptionsFacet));
11412
+ }
11413
+ return deco;
11414
+ },
11415
+ provide: (f) => view.EditorView.decorations.from(f)
11416
+ });
11100
11417
  function queryBlockPreview(options) {
11101
- const decoField = state.StateField.define({
11102
- create(state) {
11103
- return buildQueryBlockDecos(state, options);
11104
- },
11105
- update(deco, tr) {
11106
- if (tr.docChanged || tr.selection || tr.startState.field(sectionField) !== tr.state.field(sectionField) || tr.effects.some((e) => e.is(setQuerySourceEditing) || e.is(setEditorFocused))) {
11107
- return buildQueryBlockDecos(tr.state, options);
11108
- }
11109
- return deco;
11110
- },
11111
- provide: (f) => view.EditorView.decorations.from(f)
11418
+ return [
11419
+ queryBlockOptionsFacet.of(options),
11420
+ editingQuerySectionsField,
11421
+ queryBlockDecoField,
11422
+ queryBlockPreviewTheme
11423
+ ];
11424
+ }
11425
+ function isWhiteboardScriptBody(state, pos) {
11426
+ const sections = state.field(sectionField, false);
11427
+ if (sections) {
11428
+ const section = sectionAtPos(state, pos);
11429
+ if (!section || section.type !== "time" && section.type !== "log") {
11430
+ return false;
11431
+ }
11432
+ const line = state.doc.lineAt(pos);
11433
+ if (line.number <= section.startLine) return false;
11434
+ if (line.number === section.endLine && /^\s*`{3,}\s*$/.test(line.text)) return false;
11435
+ return line.number <= section.endLine;
11436
+ }
11437
+ return wodWikiLang.whiteboardScriptLanguage.isActiveAt(state, pos, -1) || wodWikiLang.whiteboardScriptLanguage.isActiveAt(state, pos, 1);
11438
+ }
11439
+ function insertWhiteboardNewline(view) {
11440
+ if (view.state.readOnly) return false;
11441
+ const { state: state$1 } = view;
11442
+ const inWhiteboard = state$1.selection.ranges.every(
11443
+ (range) => isWhiteboardScriptBody(state$1, range.from) && isWhiteboardScriptBody(state$1, range.to)
11444
+ );
11445
+ if (!inWhiteboard) return false;
11446
+ const unit = state$1.facet(language.indentUnit);
11447
+ const transaction = state$1.changeByRange((range) => {
11448
+ const startLine = state$1.doc.lineAt(range.from);
11449
+ const endLine = state$1.doc.lineAt(range.to);
11450
+ if (startLine.number === endLine.number) {
11451
+ const action2 = wodWikiLang.computeWhiteboardEnterAction(
11452
+ startLine.text,
11453
+ range.from - startLine.from,
11454
+ range.to - startLine.from,
11455
+ unit
11456
+ );
11457
+ const replaceFrom2 = startLine.from + action2.replaceFromCol;
11458
+ return {
11459
+ changes: {
11460
+ from: replaceFrom2,
11461
+ to: startLine.from + action2.replaceToCol,
11462
+ insert: action2.insert
11463
+ },
11464
+ range: state.EditorSelection.cursor(replaceFrom2 + action2.cursorOffset)
11465
+ };
11466
+ }
11467
+ const beforeOnStart = startLine.text.slice(0, range.from - startLine.from);
11468
+ const action = wodWikiLang.computeWhiteboardEnterAction(
11469
+ beforeOnStart,
11470
+ beforeOnStart.length,
11471
+ beforeOnStart.length,
11472
+ unit
11473
+ );
11474
+ const afterOnEnd = endLine.text.slice(range.to - endLine.from);
11475
+ const leadingAfter = /^[ \t]+/.exec(afterOnEnd)?.[0].length ?? 0;
11476
+ const replaceFrom = startLine.from + action.replaceFromCol;
11477
+ return {
11478
+ changes: {
11479
+ from: replaceFrom,
11480
+ to: range.to + leadingAfter,
11481
+ insert: action.insert
11482
+ },
11483
+ range: state.EditorSelection.cursor(replaceFrom + action.cursorOffset)
11484
+ };
11112
11485
  });
11113
- return [editingQuerySectionsField, decoField, queryBlockPreviewTheme];
11486
+ view.dispatch(state$1.update(transaction, { scrollIntoView: true, userEvent: "input" }));
11487
+ return true;
11114
11488
  }
11489
+ var wodIndentKeymap = state.Prec.high(
11490
+ view.keymap.of([
11491
+ {
11492
+ key: "Enter",
11493
+ run: insertWhiteboardNewline,
11494
+ shift: insertWhiteboardNewline
11495
+ }
11496
+ ])
11497
+ );
11115
11498
 
11116
11499
  // src/extensions/whiteboard-autocomplete.ts
11117
11500
  var WORKOUT_SECTION = { name: "Workout & Data", rank: 1 };
@@ -11574,18 +11957,62 @@ var wodCompletionKeymap = state.Prec.highest(
11574
11957
  }
11575
11958
  ])
11576
11959
  );
11577
- var wodAutocompletion = autocomplete.autocompletion({
11578
- selectOnOpen: false,
11579
- interactionDelay: 0,
11580
- icons: false,
11581
- addToOptions: [wodCompletionIconOption],
11582
- tooltipClass: (state) => state.facet(mobileDockedCompletionFacet) ? "cm-wod-tooltip cm-wod-tooltip-docked-hidden" : "cm-wod-tooltip",
11583
- activateOnCompletion: (completion) => completion.type === "property" && typeof completion.apply === "string" && completion.apply.endsWith(":\n - "),
11584
- override: [
11585
- // Explicit provider order — see wodCompletionSource.
11586
- wodCompletionSource
11587
- ]
11960
+ function shouldTriggerBackspaceCompletion(update) {
11961
+ if (!update.docChanged || update.state.readOnly) return false;
11962
+ if (autocomplete.completionStatus(update.state) !== null) return false;
11963
+ if (!update.state.selection.main.empty) return false;
11964
+ const backspaces = update.transactions.filter((tr) => tr.isUserEvent("delete.backward"));
11965
+ if (backspaces.length === 0) return false;
11966
+ for (const tr of backspaces) {
11967
+ let deletedNewline = false;
11968
+ tr.changes.iterChanges((fromA, toA) => {
11969
+ if (tr.startState.doc.sliceString(fromA, toA).includes("\n")) {
11970
+ deletedNewline = true;
11971
+ }
11972
+ });
11973
+ if (deletedNewline) return false;
11974
+ }
11975
+ const head = update.state.selection.main.head;
11976
+ const line = update.state.doc.lineAt(head);
11977
+ const before = line.text.slice(0, head - line.from);
11978
+ if (isWhiteboardScriptBody(update.state, head)) {
11979
+ const trimmedBefore = before.trim();
11980
+ if (!trimmedBefore) return false;
11981
+ if (/\/\//.test(before)) return false;
11982
+ if (/^#(?![A-Za-z0-9])/.test(trimmedBefore)) return false;
11983
+ if (/(?:^|\s)[*^]?\d*:\d*$/.test(before)) return false;
11984
+ return true;
11985
+ }
11986
+ const section = activeCursorSection(update.state);
11987
+ if (!section || section.type === "markdown") {
11988
+ if (/^\s*#{1,6}(?:\s|$)/.test(before)) return false;
11989
+ if (/(?:^#[a-zA-Z][a-zA-Z0-9-]*|(?<=\s)#[a-zA-Z0-9-]*)$/.test(before)) return true;
11990
+ if (/\[\[[^\]]*$/.test(before)) return true;
11991
+ }
11992
+ return false;
11993
+ }
11994
+ var wodBackspaceCompletion = view.EditorView.updateListener.of((update) => {
11995
+ if (shouldTriggerBackspaceCompletion(update)) {
11996
+ queueMicrotask(() => {
11997
+ if (update.view.state === update.state) autocomplete.startCompletion(update.view);
11998
+ });
11999
+ }
11588
12000
  });
12001
+ var wodAutocompletion = [
12002
+ autocomplete.autocompletion({
12003
+ selectOnOpen: false,
12004
+ interactionDelay: 0,
12005
+ icons: false,
12006
+ addToOptions: [wodCompletionIconOption],
12007
+ tooltipClass: (state) => state.facet(mobileDockedCompletionFacet) ? "cm-wod-tooltip cm-wod-tooltip-docked-hidden" : "cm-wod-tooltip",
12008
+ activateOnCompletion: (completion) => completion.type === "property" && typeof completion.apply === "string" && completion.apply.endsWith(":\n - "),
12009
+ override: [
12010
+ // Explicit provider order — see wodCompletionSource.
12011
+ wodCompletionSource
12012
+ ]
12013
+ }),
12014
+ wodBackspaceCompletion
12015
+ ];
11589
12016
  var SectionGeometryPlugin = class {
11590
12017
  constructor(view) {
11591
12018
  this.view = view;
@@ -11678,15 +12105,15 @@ var SectionGeometryPlugin = class {
11678
12105
  }
11679
12106
  };
11680
12107
  var sectionGeometry = view.ViewPlugin.fromClass(SectionGeometryPlugin);
11681
- var fenceOpenDeco = view.Decoration.line({
11682
- attributes: { class: "cm-wod-fence cm-wod-fence-open" }
11683
- });
11684
- var fenceCloseDeco = view.Decoration.line({
11685
- attributes: { class: "cm-wod-fence cm-wod-fence-close" }
11686
- });
11687
- var workoutInnerDeco = view.Decoration.line({
11688
- attributes: { class: "cm-wod-inner" }
11689
- });
12108
+ var lineDecoCache = /* @__PURE__ */ new Map();
12109
+ function lineDeco(className) {
12110
+ let cached = lineDecoCache.get(className);
12111
+ if (!cached) {
12112
+ cached = view.Decoration.line({ attributes: { class: className } });
12113
+ lineDecoCache.set(className, cached);
12114
+ }
12115
+ return cached;
12116
+ }
11690
12117
  var DialectBadgeWidget = class extends view.WidgetType {
11691
12118
  constructor(dialect, lineFrom, lineTo, readOnly) {
11692
12119
  super();
@@ -11700,7 +12127,7 @@ var DialectBadgeWidget = class extends view.WidgetType {
11700
12127
  lineTo;
11701
12128
  readOnly;
11702
12129
  eq(other) {
11703
- return this.dialect === other.dialect && this.lineFrom === other.lineFrom && this.lineTo === other.lineTo && this.readOnly === other.readOnly;
12130
+ return this.dialect === other.dialect && this.readOnly === other.readOnly;
11704
12131
  }
11705
12132
  toDOM(view) {
11706
12133
  const badge = document.createElement("button");
@@ -11723,7 +12150,14 @@ var DialectBadgeWidget = class extends view.WidgetType {
11723
12150
  e.preventDefault();
11724
12151
  e.stopPropagation();
11725
12152
  if (view.state.readOnly) return;
11726
- const currentLine = view.state.doc.lineAt(this.lineFrom);
12153
+ let targetPos = Math.max(0, Math.min(this.lineFrom, view.state.doc.length));
12154
+ try {
12155
+ if (view.dom.contains(badge)) {
12156
+ targetPos = Math.max(0, Math.min(view.posAtDOM(badge), view.state.doc.length));
12157
+ }
12158
+ } catch {
12159
+ }
12160
+ const currentLine = view.state.doc.lineAt(targetPos);
11727
12161
  const match = currentLine.text.match(/^(\s*`{3,})(time|log|wod|whiteboard)(.*)$/i);
11728
12162
  if (!match) return;
11729
12163
  const nextTag = isTime ? "log" : "time";
@@ -11752,8 +12186,8 @@ var AppendLineAfterFenceWidget = class extends view.WidgetType {
11752
12186
  this.closeLineTo = closeLineTo;
11753
12187
  }
11754
12188
  closeLineTo;
11755
- eq(other) {
11756
- return this.closeLineTo === other.closeLineTo;
12189
+ eq() {
12190
+ return true;
11757
12191
  }
11758
12192
  toDOM(view) {
11759
12193
  const btn = document.createElement("button");
@@ -11770,7 +12204,14 @@ var AppendLineAfterFenceWidget = class extends view.WidgetType {
11770
12204
  e.preventDefault();
11771
12205
  e.stopPropagation();
11772
12206
  if (view.state.readOnly) return;
11773
- const pos = Math.min(this.closeLineTo, view.state.doc.length);
12207
+ let pos = Math.min(this.closeLineTo, view.state.doc.length);
12208
+ try {
12209
+ if (view.dom.contains(btn)) {
12210
+ const domPos = Math.max(0, Math.min(view.posAtDOM(btn), view.state.doc.length));
12211
+ pos = view.state.doc.lineAt(domPos).to;
12212
+ }
12213
+ } catch {
12214
+ }
11774
12215
  const hasTrailingNewline = pos < view.state.doc.length && view.state.doc.sliceString(pos, pos + 1) === "\n";
11775
12216
  if (hasTrailingNewline) {
11776
12217
  const nextLine = view.state.doc.lineAt(pos + 1);
@@ -11803,11 +12244,23 @@ function buildWorkoutDecorations(state$1) {
11803
12244
  if (section.type !== "time" && section.type !== "log") continue;
11804
12245
  const startLine = state$1.doc.line(section.startLine);
11805
12246
  const endLine = state$1.doc.line(section.endLine);
12247
+ const dialectClass = `cm-wod-block-${section.type}`;
12248
+ const isActive = !state$1.readOnly && focused && cursor2 >= section.from && cursor2 <= section.to;
12249
+ const activeClass = isActive ? " cm-wod-block-active" : "";
11806
12250
  if (section.endLine <= section.startLine) {
11807
- decos.push(fenceOpenDeco.range(startLine.from));
12251
+ decos.push(
12252
+ lineDeco(`cm-wod-fence cm-wod-fence-open ${dialectClass}${activeClass}`).range(
12253
+ startLine.from
12254
+ )
12255
+ );
11808
12256
  continue;
11809
12257
  }
11810
- decos.push(fenceOpenDeco.range(startLine.from));
12258
+ const isEmptyBody = section.endLine === section.startLine + 1;
12259
+ decos.push(
12260
+ lineDeco(`cm-wod-fence cm-wod-fence-open ${dialectClass}${activeClass}`).range(
12261
+ startLine.from
12262
+ )
12263
+ );
11811
12264
  decos.push(
11812
12265
  view.Decoration.widget({
11813
12266
  widget: new DialectBadgeWidget(
@@ -11816,16 +12269,26 @@ function buildWorkoutDecorations(state$1) {
11816
12269
  startLine.to,
11817
12270
  state$1.readOnly
11818
12271
  ),
11819
- side: 1
11820
- }).range(startLine.to)
12272
+ side: -1
12273
+ }).range(startLine.from)
11821
12274
  );
11822
12275
  for (let l = section.startLine + 1; l < section.endLine; l++) {
11823
12276
  const line = state$1.doc.line(l);
11824
- decos.push(workoutInnerDeco.range(line.from));
12277
+ const isFirst = l === section.startLine + 1 ? " cm-wod-inner-first" : "";
12278
+ const isLast = l === section.endLine - 1 ? " cm-wod-inner-last" : "";
12279
+ decos.push(
12280
+ lineDeco(`cm-wod-inner ${dialectClass}${activeClass}${isFirst}${isLast}`).range(
12281
+ line.from
12282
+ )
12283
+ );
11825
12284
  }
11826
- decos.push(fenceCloseDeco.range(endLine.from));
11827
- const cursorInsideSection = !state$1.readOnly && focused && cursor2 >= section.from && cursor2 <= section.to;
11828
- if (cursorInsideSection) {
12285
+ const emptyCloseClass = isEmptyBody ? " cm-wod-fence-close-empty" : "";
12286
+ decos.push(
12287
+ lineDeco(
12288
+ `cm-wod-fence cm-wod-fence-close ${dialectClass}${activeClass}${emptyCloseClass}`
12289
+ ).range(endLine.from)
12290
+ );
12291
+ if (isActive) {
11829
12292
  decos.push(
11830
12293
  view.Decoration.widget({
11831
12294
  widget: new AppendLineAfterFenceWidget(endLine.to),
@@ -11858,55 +12321,152 @@ var scriptBlockBaseTheme = view.EditorView.baseTheme({
11858
12321
  fontFamily: 'var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, monospace)',
11859
12322
  fontSize: "11.5px",
11860
12323
  color: "hsl(var(--muted-foreground))",
11861
- paddingLeft: "7px",
11862
- paddingRight: "8px",
11863
- backgroundColor: "hsl(var(--card))",
11864
- borderLeft: "1px solid hsl(var(--border))",
11865
- borderRight: "1px solid hsl(var(--border))",
12324
+ paddingLeft: "14px",
12325
+ paddingRight: "14px",
12326
+ backgroundColor: "color-mix(in srgb, hsl(var(--muted)) 48%, hsl(var(--card)) 52%)",
12327
+ borderLeft: "1px solid hsl(var(--border) / 0.9)",
12328
+ borderRight: "1px solid hsl(var(--border) / 0.9)",
11866
12329
  boxSizing: "border-box"
11867
12330
  },
12331
+ "&dark .cm-wod-fence": {
12332
+ backgroundColor: "hsl(var(--muted) / 0.92)"
12333
+ },
12334
+ ".cm-wod-block-time": {
12335
+ borderLeftColor: "color-mix(in srgb, hsl(var(--metric-time)) 24%, hsl(var(--border)))",
12336
+ borderRightColor: "color-mix(in srgb, hsl(var(--metric-time)) 24%, hsl(var(--border)))"
12337
+ },
12338
+ ".cm-wod-block-log": {
12339
+ borderLeftColor: "color-mix(in srgb, hsl(var(--metric-effort)) 24%, hsl(var(--border)))",
12340
+ borderRightColor: "color-mix(in srgb, hsl(var(--metric-effort)) 24%, hsl(var(--border)))"
12341
+ },
11868
12342
  ".cm-wod-fence-open": {
11869
- borderTop: "1px solid hsl(var(--border))",
11870
- borderRadius: "8px 8px 0 0",
11871
- // Reserve header clearance so dialect badge & InlineCommandBar controls
11872
- // stay crisp and never collide with preceding prose or the first workout line.
11873
- paddingTop: "32px",
11874
- paddingRight: "112px",
11875
- backgroundColor: "transparent",
11876
- backgroundImage: "linear-gradient(to bottom, transparent 30px, hsl(var(--border)) 30px, hsl(var(--border)) 31px, hsl(var(--card)) 31px)"
12343
+ borderTop: "1px solid hsl(var(--border) / 0.9)",
12344
+ borderBottom: "1px solid hsl(var(--border) / 0.75)",
12345
+ borderRadius: "10px 10px 0 0",
12346
+ paddingTop: "7px",
12347
+ paddingBottom: "7px",
12348
+ paddingLeft: "12px",
12349
+ // Reserve right clearance for InlineCommandBar controls inside the unified header bar.
12350
+ paddingRight: "228px",
12351
+ lineHeight: "24px"
12352
+ },
12353
+ ".cm-wod-fence-open.cm-wod-block-time": {
12354
+ borderTopColor: "color-mix(in srgb, hsl(var(--metric-time)) 24%, hsl(var(--border)))",
12355
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-time)) 5%, color-mix(in srgb, hsl(var(--muted)) 80%, hsl(var(--card)) 20%))"
12356
+ },
12357
+ ".cm-wod-fence-open.cm-wod-block-log": {
12358
+ borderTopColor: "color-mix(in srgb, hsl(var(--metric-effort)) 24%, hsl(var(--border)))",
12359
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-effort)) 5%, color-mix(in srgb, hsl(var(--muted)) 80%, hsl(var(--card)) 20%))"
12360
+ },
12361
+ "&dark .cm-wod-fence-open.cm-wod-block-time": {
12362
+ borderTopColor: "color-mix(in srgb, hsl(var(--metric-time)) 28%, hsl(var(--border)))",
12363
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-time)) 10%, hsl(var(--muted)))"
12364
+ },
12365
+ "&dark .cm-wod-fence-open.cm-wod-block-log": {
12366
+ borderTopColor: "color-mix(in srgb, hsl(var(--metric-effort)) 28%, hsl(var(--border)))",
12367
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-effort)) 10%, hsl(var(--muted)))"
11877
12368
  },
11878
12369
  ".cm-wod-fence-close": {
11879
- borderBottom: "1px solid hsl(var(--border))",
11880
- borderRadius: "0 0 8px 8px"
12370
+ fontSize: "11px",
12371
+ color: "hsl(var(--muted-foreground) / 0.55)",
12372
+ paddingTop: "3px",
12373
+ paddingBottom: "7px",
12374
+ borderBottom: "1px solid hsl(var(--border) / 0.9)",
12375
+ borderRadius: "0 0 10px 10px"
12376
+ },
12377
+ ".cm-wod-fence-close.cm-wod-block-time": {
12378
+ borderBottomColor: "color-mix(in srgb, hsl(var(--metric-time)) 24%, hsl(var(--border)))"
12379
+ },
12380
+ ".cm-wod-fence-close.cm-wod-block-log": {
12381
+ borderBottomColor: "color-mix(in srgb, hsl(var(--metric-effort)) 24%, hsl(var(--border)))"
12382
+ },
12383
+ ".cm-wod-fence-close.cm-wod-fence-close-empty": {
12384
+ paddingTop: "8px",
12385
+ paddingBottom: "8px"
11881
12386
  },
11882
12387
  ".cm-wod-inner": {
11883
12388
  fontFamily: 'var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, monospace)',
12389
+ fontSize: "13.5px",
12390
+ lineHeight: "24px",
11884
12391
  fontVariantNumeric: "tabular-nums",
11885
- paddingLeft: "7px",
11886
- paddingRight: "8px",
11887
- backgroundColor: "hsl(var(--card))",
11888
- borderLeft: "1px solid hsl(var(--border))",
11889
- borderRight: "1px solid hsl(var(--border))",
12392
+ paddingLeft: "14px",
12393
+ paddingRight: "14px",
12394
+ backgroundColor: "color-mix(in srgb, hsl(var(--muted)) 48%, hsl(var(--card)) 52%)",
12395
+ borderLeft: "1px solid hsl(var(--border) / 0.9)",
12396
+ borderRight: "1px solid hsl(var(--border) / 0.9)",
11890
12397
  boxSizing: "border-box"
11891
12398
  },
12399
+ "&dark .cm-wod-inner": {
12400
+ backgroundColor: "hsl(var(--muted) / 0.92)"
12401
+ },
12402
+ ".cm-wod-inner.cm-wod-block-time": {
12403
+ borderLeftColor: "color-mix(in srgb, hsl(var(--metric-time)) 24%, hsl(var(--border)))",
12404
+ borderRightColor: "color-mix(in srgb, hsl(var(--metric-time)) 24%, hsl(var(--border)))"
12405
+ },
12406
+ ".cm-wod-inner.cm-wod-block-log": {
12407
+ borderLeftColor: "color-mix(in srgb, hsl(var(--metric-effort)) 24%, hsl(var(--border)))",
12408
+ borderRightColor: "color-mix(in srgb, hsl(var(--metric-effort)) 24%, hsl(var(--border)))"
12409
+ },
12410
+ ".cm-wod-inner-first": {
12411
+ paddingTop: "8px"
12412
+ },
12413
+ ".cm-wod-inner-last": {
12414
+ paddingBottom: "4px"
12415
+ },
12416
+ ".cm-wod-block-active.cm-wod-block-time": {
12417
+ borderLeftColor: "hsl(var(--metric-time) / 0.58)",
12418
+ borderRightColor: "hsl(var(--metric-time) / 0.58)"
12419
+ },
12420
+ ".cm-wod-fence-open.cm-wod-block-active.cm-wod-block-time": {
12421
+ borderTopColor: "hsl(var(--metric-time) / 0.58)"
12422
+ },
12423
+ ".cm-wod-fence-close.cm-wod-block-active.cm-wod-block-time": {
12424
+ borderBottomColor: "hsl(var(--metric-time) / 0.58)"
12425
+ },
12426
+ ".cm-wod-block-active.cm-wod-block-log": {
12427
+ borderLeftColor: "hsl(var(--metric-effort) / 0.58)",
12428
+ borderRightColor: "hsl(var(--metric-effort) / 0.58)"
12429
+ },
12430
+ ".cm-wod-fence-open.cm-wod-block-active.cm-wod-block-log": {
12431
+ borderTopColor: "hsl(var(--metric-effort) / 0.58)"
12432
+ },
12433
+ ".cm-wod-fence-close.cm-wod-block-active.cm-wod-block-log": {
12434
+ borderBottomColor: "hsl(var(--metric-effort) / 0.58)"
12435
+ },
11892
12436
  ".cm-wod-dialect-badge": {
11893
12437
  display: "inline-flex",
11894
12438
  alignItems: "center",
11895
- minHeight: "22px",
12439
+ gap: "5px",
12440
+ height: "22px",
11896
12441
  padding: "0 8px",
11897
- marginLeft: "8px",
12442
+ marginRight: "8px",
11898
12443
  borderRadius: "9999px",
11899
- fontSize: "11.5px",
12444
+ fontSize: "11px",
11900
12445
  fontWeight: "700",
11901
- letterSpacing: "0.04em",
12446
+ letterSpacing: "0.05em",
12447
+ lineHeight: "1",
11902
12448
  fontFamily: 'var(--font-sans, "Geist Sans", system-ui, sans-serif)',
11903
12449
  border: "1px solid transparent",
11904
12450
  cursor: "pointer",
11905
- verticalAlign: "middle"
12451
+ verticalAlign: "middle",
12452
+ transition: "background-color 150ms ease, border-color 150ms ease"
12453
+ },
12454
+ ".cm-wod-dialect-badge::before": {
12455
+ content: '""',
12456
+ width: "6px",
12457
+ height: "6px",
12458
+ borderRadius: "9999px",
12459
+ backgroundColor: "currentColor",
12460
+ opacity: "0.85",
12461
+ flexShrink: "0"
12462
+ },
12463
+ ".cm-wod-dialect-badge:focus-visible": {
12464
+ outline: "2px solid hsl(var(--ring))",
12465
+ outlineOffset: "1px"
11906
12466
  },
11907
12467
  "@media (pointer: coarse)": {
11908
12468
  ".cm-wod-dialect-badge": {
11909
- minHeight: "34px",
12469
+ minHeight: "32px",
11910
12470
  padding: "0 10px"
11911
12471
  }
11912
12472
  },
@@ -11914,44 +12474,66 @@ var scriptBlockBaseTheme = view.EditorView.baseTheme({
11914
12474
  cursor: "default"
11915
12475
  },
11916
12476
  ".cm-wod-dialect-time": {
11917
- backgroundColor: "#E1F3FE",
11918
- color: "#1F6C9F",
11919
- borderColor: "rgba(31, 108, 159, 0.2)"
12477
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-time)) 12%, hsl(var(--card)))",
12478
+ color: "hsl(var(--secondary-foreground))",
12479
+ borderColor: "hsl(var(--metric-time) / 0.28)"
12480
+ },
12481
+ ".cm-wod-dialect-time:hover:not(:disabled)": {
12482
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-time)) 18%, hsl(var(--card)))",
12483
+ borderColor: "hsl(var(--metric-time) / 0.45)"
11920
12484
  },
11921
12485
  "&dark .cm-wod-dialect-time": {
11922
12486
  backgroundColor: "hsl(var(--metric-time) / 0.16)",
11923
- color: "hsl(var(--metric-time))",
11924
- borderColor: "hsl(var(--metric-time) / 0.3)"
12487
+ color: "color-mix(in srgb, hsl(var(--metric-time)) 78%, hsl(var(--foreground)))",
12488
+ borderColor: "hsl(var(--metric-time) / 0.34)"
12489
+ },
12490
+ "&dark .cm-wod-dialect-time:hover:not(:disabled)": {
12491
+ backgroundColor: "hsl(var(--metric-time) / 0.24)",
12492
+ borderColor: "hsl(var(--metric-time) / 0.52)"
11925
12493
  },
11926
12494
  ".cm-wod-dialect-log": {
11927
- backgroundColor: "#EDF3EC",
11928
- color: "#346538",
11929
- borderColor: "rgba(52, 101, 56, 0.2)"
12495
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-effort)) 11%, hsl(var(--card)))",
12496
+ color: "color-mix(in srgb, hsl(var(--metric-effort)) 78%, hsl(var(--foreground)))",
12497
+ borderColor: "hsl(var(--metric-effort) / 0.28)"
12498
+ },
12499
+ ".cm-wod-dialect-log:hover:not(:disabled)": {
12500
+ backgroundColor: "color-mix(in srgb, hsl(var(--metric-effort)) 17%, hsl(var(--card)))",
12501
+ borderColor: "hsl(var(--metric-effort) / 0.45)"
11930
12502
  },
11931
12503
  "&dark .cm-wod-dialect-log": {
11932
12504
  backgroundColor: "hsl(var(--metric-effort) / 0.16)",
11933
- color: "hsl(var(--metric-effort))",
11934
- borderColor: "hsl(var(--metric-effort) / 0.3)"
12505
+ color: "color-mix(in srgb, hsl(var(--metric-effort)) 78%, hsl(var(--foreground)))",
12506
+ borderColor: "hsl(var(--metric-effort) / 0.34)"
12507
+ },
12508
+ "&dark .cm-wod-dialect-log:hover:not(:disabled)": {
12509
+ backgroundColor: "hsl(var(--metric-effort) / 0.24)",
12510
+ borderColor: "hsl(var(--metric-effort) / 0.52)"
11935
12511
  },
11936
12512
  ".cm-wod-exit-block-btn": {
11937
12513
  marginLeft: "10px",
11938
12514
  display: "inline-flex",
11939
12515
  alignItems: "center",
11940
- height: "18px",
11941
- padding: "0 6px",
11942
- borderRadius: "4px",
11943
- fontSize: "10px",
12516
+ height: "20px",
12517
+ padding: "0 7px",
12518
+ borderRadius: "5px",
12519
+ fontSize: "11px",
11944
12520
  fontFamily: 'var(--font-sans, "Geist Sans", system-ui, sans-serif)',
11945
12521
  fontWeight: "500",
11946
12522
  color: "hsl(var(--muted-foreground))",
11947
- backgroundColor: "hsl(var(--muted) / 0.6)",
11948
- border: "1px solid hsl(var(--border))",
12523
+ backgroundColor: "transparent",
12524
+ border: "1px dashed hsl(var(--border))",
11949
12525
  cursor: "pointer",
11950
- verticalAlign: "middle"
12526
+ verticalAlign: "middle",
12527
+ transition: "background-color 150ms ease, color 150ms ease, border-color 150ms ease"
11951
12528
  },
11952
12529
  ".cm-wod-exit-block-btn:hover": {
11953
12530
  color: "hsl(var(--foreground))",
11954
- backgroundColor: "hsl(var(--muted))"
12531
+ backgroundColor: "hsl(var(--card))",
12532
+ borderStyle: "solid"
12533
+ },
12534
+ ".cm-wod-exit-block-btn:focus-visible": {
12535
+ outline: "2px solid hsl(var(--ring))",
12536
+ outlineOffset: "1px"
11955
12537
  }
11956
12538
  });
11957
12539
  var previewDecorations = [
@@ -12011,21 +12593,32 @@ var InlineImageWidget = class extends view.WidgetType {
12011
12593
  img.alt = this.alt || "Embedded image";
12012
12594
  img.loading = "lazy";
12013
12595
  img.className = "cm-image-embed-img";
12596
+ if (this.standalone) {
12597
+ card.classList.add("cm-image-embed-loading");
12598
+ const clearLoading = () => card.classList.remove("cm-image-embed-loading");
12599
+ img.addEventListener("load", clearLoading);
12600
+ img.addEventListener("error", clearLoading);
12601
+ }
12014
12602
  const resolver = view.state.facet(attachmentUrlFacet);
12015
12603
  if (isDirectImageUrl(this.target)) {
12016
12604
  img.src = this.target;
12605
+ if (img.complete) card.classList.remove("cm-image-embed-loading");
12017
12606
  } else if (resolver) {
12018
12607
  Promise.resolve(resolver(this.target)).then((resolved) => {
12019
12608
  if (resolved) {
12020
12609
  img.src = resolved;
12610
+ if (img.complete) card.classList.remove("cm-image-embed-loading");
12021
12611
  } else {
12612
+ card.classList.remove("cm-image-embed-loading");
12022
12613
  card.classList.add("cm-image-embed-missing");
12023
12614
  }
12024
12615
  }).catch(() => {
12616
+ card.classList.remove("cm-image-embed-loading");
12025
12617
  card.classList.add("cm-image-embed-missing");
12026
12618
  });
12027
12619
  } else {
12028
12620
  img.src = this.target;
12621
+ if (img.complete) card.classList.remove("cm-image-embed-loading");
12029
12622
  }
12030
12623
  card.appendChild(img);
12031
12624
  if (this.alt) {
@@ -12132,6 +12725,9 @@ var embedPreviewTheme = view.EditorView.baseTheme({
12132
12725
  backgroundColor: "hsl(var(--card))",
12133
12726
  overflow: "hidden"
12134
12727
  },
12728
+ ".cm-image-embed-block .cm-image-embed-card.cm-image-embed-loading": {
12729
+ minHeight: "160px"
12730
+ },
12135
12731
  ".cm-image-embed-img": {
12136
12732
  display: "block",
12137
12733
  maxWidth: "100%",
@@ -12396,15 +12992,29 @@ function triggerAddOrEditProperty(view, root, _sectionId) {
12396
12992
  patchPropertyInView(view, fm.id, ["property"], "", true);
12397
12993
  }
12398
12994
  var widgetCleanup = /* @__PURE__ */ new WeakMap();
12995
+ var pendingFrontmatterCommit = /* @__PURE__ */ new WeakMap();
12399
12996
  var helperId = 0;
12997
+ function registerFrontmatterCommit(input, commit) {
12998
+ pendingFrontmatterCommit.set(input, commit);
12999
+ }
13000
+ function attachExternalCommitFlush(root) {
13001
+ const onPointerDown = (e) => {
13002
+ const active = document.activeElement;
13003
+ if (!(active instanceof HTMLInputElement) || !root.contains(active)) return;
13004
+ const target = e.target;
13005
+ if (target && (root.contains(target) || target.closest('[role="listbox"]'))) return;
13006
+ const commit = pendingFrontmatterCommit.get(active);
13007
+ if (commit) commit();
13008
+ };
13009
+ document.addEventListener("pointerdown", onPointerDown, true);
13010
+ widgetCleanup.get(root)?.push(() => document.removeEventListener("pointerdown", onPointerDown, true));
13011
+ }
12400
13012
  var TAG_CATEGORY_SUMMARY_KEYS = {
12401
13013
  tag: true,
12402
13014
  tags: true,
12403
13015
  category: true,
12404
13016
  domain: true,
12405
13017
  format: true,
12406
- equipment: true,
12407
- effort: true,
12408
13018
  quality: true,
12409
13019
  intent: true,
12410
13020
  discipline: true,
@@ -12638,6 +13248,9 @@ function createTagDraftRow(view, root, key, onCommit) {
12638
13248
  const commit = () => settle(true);
12639
13249
  const discard = () => settle(false);
12640
13250
  attachSuggestions(input, view, root, "value", key, [], commit);
13251
+ registerFrontmatterCommit(input, () => {
13252
+ if (input.isConnected && input.value.trim()) commit();
13253
+ });
12641
13254
  input.addEventListener("keydown", (e) => {
12642
13255
  if (e.isComposing || e.keyCode === 229) return;
12643
13256
  if (e.key === "Escape") {
@@ -13021,38 +13634,91 @@ function createFrontmatterSummary(entries, onShowDetails, docKind, referenceProv
13021
13634
  const summary = document.createElement("div");
13022
13635
  summary.dataset.frontmatterSummary = "true";
13023
13636
  summary.className = "divide-y divide-border/60";
13024
- const groups = [
13025
- { label: "Tags", entries: entries.filter(([key]) => TAG_CATEGORY_SUMMARY_KEYS[key.trim().toLowerCase()]), hash: true },
13026
- { label: "Aliases", entries: entries.filter(([key]) => isAliasProperty(key)), hash: false }
13027
- ];
13028
- for (const group of groups) {
13029
- const seen = /* @__PURE__ */ new Set();
13030
- const values2 = group.entries.flatMap(([, value]) => parseTagList(value)).filter((val) => {
13031
- const lower = val.toLowerCase();
13032
- if (seen.has(lower)) return false;
13033
- seen.add(lower);
13034
- return true;
13035
- });
13036
- if (values2.length === 0) continue;
13637
+ const appendSummaryGroupRow = (labelText, items) => {
13638
+ if (items.length === 0) return;
13037
13639
  const row = document.createElement("div");
13038
13640
  row.className = "flex flex-wrap items-center gap-1.5 px-3 py-2";
13039
13641
  const label = document.createElement("span");
13040
- label.className = "mr-1 w-14 shrink-0 text-[11px] font-medium text-muted-foreground";
13041
- label.textContent = group.label;
13642
+ label.className = "mr-1 w-16 shrink-0 text-[11px] font-medium text-muted-foreground";
13643
+ label.textContent = labelText;
13042
13644
  row.appendChild(label);
13043
- for (const value of values2) {
13645
+ for (const item of items) {
13646
+ row.appendChild(createSummaryPill(item.text, item.hash, item.href));
13647
+ }
13648
+ summary.appendChild(row);
13649
+ };
13650
+ const seenTags = /* @__PURE__ */ new Set();
13651
+ const tagItems = [];
13652
+ for (const [key, value] of entries) {
13653
+ const normKey = key.trim().toLowerCase();
13654
+ if (!TAG_CATEGORY_SUMMARY_KEYS[normKey]) continue;
13655
+ for (const val of parseTagList(value)) {
13656
+ const lower = val.toLowerCase();
13657
+ if (seenTags.has(lower)) continue;
13658
+ seenTags.add(lower);
13659
+ tagItems.push({
13660
+ text: val,
13661
+ hash: true,
13662
+ href: referenceProvider?.openHref("tag", val, normKey)
13663
+ });
13664
+ }
13665
+ }
13666
+ appendSummaryGroupRow("Tags", tagItems);
13667
+ const seenEquip = /* @__PURE__ */ new Set();
13668
+ const equipItems = [];
13669
+ for (const [key, value] of entries) {
13670
+ if (key.trim().toLowerCase() !== "equipment") continue;
13671
+ for (const val of parseTagList(value)) {
13672
+ const lower = val.toLowerCase();
13673
+ if (seenEquip.has(lower)) continue;
13674
+ seenEquip.add(lower);
13675
+ const match = referenceProvider?.resolveEquipment(val) ?? null;
13676
+ equipItems.push({
13677
+ text: match ? match.label : val,
13678
+ hash: false,
13679
+ href: match && referenceProvider ? referenceProvider.openHref("equipment", match.slug) : void 0
13680
+ });
13681
+ }
13682
+ }
13683
+ appendSummaryGroupRow("Equipment", equipItems);
13684
+ const seenEffort = /* @__PURE__ */ new Set();
13685
+ const effortItems = [];
13686
+ for (const [key, value] of entries) {
13687
+ if (key.trim().toLowerCase() !== "effort") continue;
13688
+ for (const val of parseTagList(value)) {
13689
+ const lower = val.toLowerCase();
13690
+ if (seenEffort.has(lower)) continue;
13691
+ seenEffort.add(lower);
13692
+ const match = referenceProvider?.resolveEffort(val) ?? null;
13693
+ effortItems.push({
13694
+ text: match ? match.label : val,
13695
+ hash: false,
13696
+ href: match && referenceProvider ? referenceProvider.openHref("effort", match.slug) : void 0
13697
+ });
13698
+ }
13699
+ }
13700
+ appendSummaryGroupRow("Effort", effortItems);
13701
+ const seenAliases = /* @__PURE__ */ new Set();
13702
+ const aliasItems = [];
13703
+ for (const [key, value] of entries) {
13704
+ if (!isAliasProperty(key)) continue;
13705
+ for (const val of parseTagList(value)) {
13706
+ const lower = val.toLowerCase();
13707
+ if (seenAliases.has(lower)) continue;
13708
+ seenAliases.add(lower);
13044
13709
  let href;
13045
- if (group.label === "Aliases" && referenceProvider && (docKind === "effort" || docKind === "equipment")) {
13046
- const match = docKind === "effort" ? referenceProvider.resolveEffort(value) : referenceProvider.resolveEquipment(value);
13047
- if (match) {
13048
- href = referenceProvider.openHref(docKind, match.slug);
13049
- }
13710
+ if (referenceProvider && (docKind === "effort" || docKind === "equipment")) {
13711
+ const match = docKind === "effort" ? referenceProvider.resolveEffort(val) : referenceProvider.resolveEquipment(val);
13712
+ if (match) href = referenceProvider.openHref(docKind, match.slug);
13050
13713
  }
13051
- row.appendChild(createSummaryPill(value, group.hash, href));
13714
+ aliasItems.push({ text: val, hash: false, href });
13052
13715
  }
13053
- summary.appendChild(row);
13054
13716
  }
13055
- const hidden = entries.filter(([key]) => !TAG_CATEGORY_SUMMARY_KEYS[key.trim().toLowerCase()] && !isAliasProperty(key));
13717
+ appendSummaryGroupRow("Aliases", aliasItems);
13718
+ const hidden = entries.filter(([key]) => {
13719
+ const k = key.trim().toLowerCase();
13720
+ return !TAG_CATEGORY_SUMMARY_KEYS[k] && k !== "equipment" && k !== "effort" && !isAliasProperty(key);
13721
+ });
13056
13722
  const metricCount = hidden.filter(([key]) => {
13057
13723
  const k = key.trim().toLowerCase();
13058
13724
  return k.startsWith("metrics.") || k === "metrics";
@@ -13111,7 +13777,31 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
13111
13777
  toDOM(view) {
13112
13778
  const root = document.createElement("div");
13113
13779
  widgetCleanup.set(root, []);
13780
+ attachExternalCommitFlush(root);
13114
13781
  root.className = "cm-frontmatter-preview py-2 font-sans select-none";
13782
+ if (!this.readOnly) {
13783
+ root.addEventListener("click", (event) => {
13784
+ const target = event.target;
13785
+ if (target?.closest(
13786
+ 'button, input, textarea, select, a, label, [role="button"], [role="combobox"], [role="option"], [contenteditable="true"]'
13787
+ )) {
13788
+ return;
13789
+ }
13790
+ view.dispatch({ selection: { anchor: view.state.doc.length } });
13791
+ view.focus();
13792
+ });
13793
+ root.addEventListener("keydown", (event) => {
13794
+ if ((event.ctrlKey || event.metaKey) && (event.key === "End" || event.key === "ArrowDown")) {
13795
+ event.preventDefault();
13796
+ event.stopPropagation();
13797
+ view.dispatch({
13798
+ selection: { anchor: view.state.doc.length },
13799
+ scrollIntoView: true
13800
+ });
13801
+ view.focus();
13802
+ }
13803
+ });
13804
+ }
13115
13805
  const heading = document.createElement("div");
13116
13806
  heading.className = "mb-1.5 flex items-center px-0.5 text-xs font-medium text-muted-foreground";
13117
13807
  const headingLabel = document.createElement("span");
@@ -13127,6 +13817,7 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
13127
13817
  summaryButton.addEventListener("click", () => {
13128
13818
  persistedDetailed.set(view.dom, false);
13129
13819
  view.dispatch({ effects: setFrontmatterDetailed.of(false) });
13820
+ view.dom.querySelector('[aria-label="Show property details"]')?.focus();
13130
13821
  });
13131
13822
  heading.appendChild(summaryButton);
13132
13823
  }
@@ -13145,6 +13836,7 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
13145
13836
  box.appendChild(createFrontmatterSummary(entries, () => {
13146
13837
  persistedDetailed.set(view.dom, true);
13147
13838
  view.dispatch({ effects: setFrontmatterDetailed.of(true) });
13839
+ view.dom.querySelector('[aria-label="Show property summary"]')?.focus();
13148
13840
  }, docKind, referenceProvider));
13149
13841
  } else {
13150
13842
  box.appendChild(createColumnHeader());
@@ -13218,6 +13910,9 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
13218
13910
  keyInput.addEventListener("change", commitKeyIfAttached);
13219
13911
  keyCol.appendChild(keyInput);
13220
13912
  attachSuggestions(keyInput, view, root, "key", key, entries.map(([name]) => name), commitKey);
13913
+ registerFrontmatterCommit(keyInput, () => {
13914
+ if (keyInput.isConnected) commitKey();
13915
+ });
13221
13916
  keyInput.addEventListener("blur", commitKeyIfAttached);
13222
13917
  keyInput.addEventListener("keydown", (e) => {
13223
13918
  if ((e.metaKey || e.ctrlKey) && e.key === ";") {
@@ -13358,6 +14053,9 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
13358
14053
  };
13359
14054
  valCol.appendChild(chipInput);
13360
14055
  attachSuggestions(chipInput, view, root, "value", key, chips, commitNewChip, valueKind);
14056
+ registerFrontmatterCommit(chipInput, () => {
14057
+ if (chipInput.isConnected && chipInput.value.trim()) commitNewChip();
14058
+ });
13361
14059
  chipInput.addEventListener("keydown", (e) => {
13362
14060
  if ((e.metaKey || e.ctrlKey) && e.key === ";") {
13363
14061
  e.preventDefault();
@@ -13519,6 +14217,9 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
13519
14217
  commitVal,
13520
14218
  key.trim().toLowerCase() === "metrics.effort" ? "effort" : "tags"
13521
14219
  );
14220
+ registerFrontmatterCommit(valInput, () => {
14221
+ if (valInput.isConnected) commitVal();
14222
+ });
13522
14223
  valInput.addEventListener("blur", commitValIfAttached);
13523
14224
  valInput.addEventListener("keydown", (e) => {
13524
14225
  if ((e.metaKey || e.ctrlKey) && e.key === ";") {
@@ -13850,6 +14551,27 @@ var EmptyFrontmatterWidget = class extends view.WidgetType {
13850
14551
  toDOM(view) {
13851
14552
  const root = document.createElement("div");
13852
14553
  root.className = "cm-frontmatter-preview py-2 font-sans select-none";
14554
+ root.addEventListener("click", (event) => {
14555
+ const target = event.target;
14556
+ if (target?.closest(
14557
+ 'button, input, textarea, select, a, label, [role="button"], [role="combobox"], [role="option"], [contenteditable="true"]'
14558
+ )) {
14559
+ return;
14560
+ }
14561
+ view.dispatch({ selection: { anchor: view.state.doc.length } });
14562
+ view.focus();
14563
+ });
14564
+ root.addEventListener("keydown", (event) => {
14565
+ if ((event.ctrlKey || event.metaKey) && (event.key === "End" || event.key === "ArrowDown")) {
14566
+ event.preventDefault();
14567
+ event.stopPropagation();
14568
+ view.dispatch({
14569
+ selection: { anchor: view.state.doc.length },
14570
+ scrollIntoView: true
14571
+ });
14572
+ view.focus();
14573
+ }
14574
+ });
13853
14575
  const heading = document.createElement("div");
13854
14576
  heading.className = "text-xs font-medium text-muted-foreground mb-1.5 px-0.5";
13855
14577
  heading.textContent = "Properties";
@@ -14022,7 +14744,18 @@ var frontmatterPreviewField = state.StateField.define({
14022
14744
  return buildFrontmatterDecos(state);
14023
14745
  },
14024
14746
  update(deco, tr) {
14025
- if (tr.docChanged || tr.reconfigured || tr.selection || tr.effects.some((e) => e.is(referenceIndexReload) || e.is(setFrontmatterDetailed) || e.is(setFrontmatterSource))) {
14747
+ if (tr.reconfigured || tr.effects.some((e) => e.is(referenceIndexReload) || e.is(setFrontmatterDetailed) || e.is(setFrontmatterSource)) || tr.startState.field(frontmatterDetailed, false) !== tr.state.field(frontmatterDetailed, false) || tr.startState.field(frontmatterSource, false) !== tr.state.field(frontmatterSource, false) || tr.startState.readOnly !== tr.state.readOnly || tr.startState.facet(frontmatterVisibility) !== tr.state.facet(frontmatterVisibility) || tr.startState.facet(frontmatterDebugMode) !== tr.state.facet(frontmatterDebugMode)) {
14748
+ return buildFrontmatterDecos(tr.state);
14749
+ }
14750
+ if (tr.docChanged) {
14751
+ const prevFm = tr.startState.field(sectionField, false)?.sections.find((s) => s.type === "frontmatter");
14752
+ const nextFm = tr.state.field(sectionField, false)?.sections.find((s) => s.type === "frontmatter");
14753
+ if (prevFm && nextFm && prevFm.id === nextFm.id && prevFm.from === nextFm.from && prevFm.to === nextFm.to && !tr.changes.touchesRange(0, prevFm.to)) {
14754
+ return deco;
14755
+ }
14756
+ if (!prevFm && !nextFm && !tr.changes.touchesRange(0, 0)) {
14757
+ return deco;
14758
+ }
14026
14759
  return buildFrontmatterDecos(tr.state);
14027
14760
  }
14028
14761
  return deco;
@@ -14148,7 +14881,7 @@ var TaskCheckboxWidget = class extends view.WidgetType {
14148
14881
  checked;
14149
14882
  bracketPos;
14150
14883
  eq(other) {
14151
- return this.checked === other.checked && this.bracketPos === other.bracketPos;
14884
+ return this.checked === other.checked;
14152
14885
  }
14153
14886
  toDOM(view) {
14154
14887
  const btn = document.createElement("button");
@@ -14176,13 +14909,29 @@ var TaskCheckboxWidget = class extends view.WidgetType {
14176
14909
  event.preventDefault();
14177
14910
  event.stopPropagation();
14178
14911
  if (view.state.readOnly) return;
14179
- const charAtPos = view.state.doc.sliceString(this.bracketPos + 1, this.bracketPos + 2);
14912
+ let bracketPos = this.bracketPos;
14913
+ try {
14914
+ if (view.dom.contains(btn)) {
14915
+ const domPos = Math.max(0, Math.min(view.posAtDOM(btn), view.state.doc.length));
14916
+ const line = view.state.doc.lineAt(domPos);
14917
+ const match = TASK_RE.exec(line.text);
14918
+ if (match) {
14919
+ const bracketIdx = line.text.indexOf("[", match[1].length + match[2].length);
14920
+ if (bracketIdx >= 0) {
14921
+ bracketPos = line.from + bracketIdx;
14922
+ }
14923
+ }
14924
+ }
14925
+ } catch {
14926
+ }
14927
+ if (bracketPos < 0 || bracketPos + 2 > view.state.doc.length) return;
14928
+ const charAtPos = view.state.doc.sliceString(bracketPos + 1, bracketPos + 2);
14180
14929
  if (charAtPos !== " " && charAtPos !== "x" && charAtPos !== "X") return;
14181
14930
  const nextChar = this.checked ? " " : "x";
14182
14931
  view.dispatch({
14183
14932
  changes: {
14184
- from: this.bracketPos + 1,
14185
- to: this.bracketPos + 2,
14933
+ from: bracketPos + 1,
14934
+ to: bracketPos + 2,
14186
14935
  insert: nextChar
14187
14936
  },
14188
14937
  userEvent: "input.toggle"
@@ -14576,7 +15325,7 @@ function appendFormattedCellContent(container, rawText, view) {
14576
15325
  container.appendChild(document.createTextNode(rawText.slice(lastIndex)));
14577
15326
  }
14578
15327
  }
14579
- var MarkdownTableWidget = class extends view.WidgetType {
15328
+ var MarkdownTableWidget = class _MarkdownTableWidget extends view.WidgetType {
14580
15329
  constructor(head, rows, from, to, readOnly) {
14581
15330
  super();
14582
15331
  this.head = head;
@@ -14591,7 +15340,7 @@ var MarkdownTableWidget = class extends view.WidgetType {
14591
15340
  to;
14592
15341
  readOnly;
14593
15342
  eq(other) {
14594
- if (this.readOnly !== other.readOnly || this.from !== other.from || this.to !== other.to || this.head.length !== other.head.length || this.rows.length !== other.rows.length) {
15343
+ if (this.readOnly !== other.readOnly || this.head.length !== other.head.length || this.rows.length !== other.rows.length) {
14595
15344
  return false;
14596
15345
  }
14597
15346
  if (!this.head.every((h, i) => h === other.head[i])) return false;
@@ -14613,21 +15362,50 @@ var MarkdownTableWidget = class extends view.WidgetType {
14613
15362
  const mutableRows = this.rows.map(
14614
15363
  (row) => Array.from({ length: colCount }, (_, i) => row[i] ?? "")
14615
15364
  );
15365
+ const resolveLiveRange = () => {
15366
+ const field = view.state.field(tablePreviewField, false);
15367
+ if (field && view.dom.contains(outer)) {
15368
+ try {
15369
+ const domPos = view.posAtDOM(outer);
15370
+ const searchFrom = Math.max(0, domPos - 1);
15371
+ const searchTo = Math.min(view.state.doc.length, domPos + 1);
15372
+ let found = null;
15373
+ field.between(searchFrom, searchTo, (from, to, value) => {
15374
+ const widget = value.spec?.widget;
15375
+ if (widget instanceof _MarkdownTableWidget) {
15376
+ found = { from, to };
15377
+ return false;
15378
+ }
15379
+ });
15380
+ if (found) return found;
15381
+ } catch {
15382
+ }
15383
+ }
15384
+ return {
15385
+ from: Math.max(0, Math.min(this.from, view.state.doc.length)),
15386
+ to: Math.max(0, Math.min(this.to, view.state.doc.length))
15387
+ };
15388
+ };
14616
15389
  const commitTable = (nextHead, nextRows, focusAfter) => {
14617
15390
  if (view.state.readOnly) return;
15391
+ const { from: liveFrom, to: liveTo } = resolveLiveRange();
14618
15392
  const serialized = serializeMarkdownTable(nextHead, nextRows);
14619
- const safeSelection = this.to < view.state.doc.length ? Math.min(view.state.doc.length, this.from + serialized.length + 1) : Math.max(0, this.from - 1);
15393
+ const safeSelection = liveTo < view.state.doc.length ? Math.min(view.state.doc.length, liveFrom + serialized.length + 1) : Math.max(0, liveFrom - 1);
14620
15394
  const currentCursor = view.state.selection.main.head;
14621
- const nextCursor = currentCursor >= this.from && currentCursor <= this.to ? safeSelection : currentCursor > this.to ? currentCursor + (serialized.length - (this.to - this.from)) : currentCursor;
15395
+ const nextCursor = currentCursor >= liveFrom && currentCursor <= liveTo ? safeSelection : currentCursor > liveTo ? currentCursor + (serialized.length - (liveTo - liveFrom)) : currentCursor;
15396
+ wrap.dataset.tableFrom = String(liveFrom);
14622
15397
  view.dispatch({
14623
- changes: { from: this.from, to: this.to, insert: serialized },
14624
- selection: { anchor: Math.max(0, Math.min(nextCursor, view.state.doc.length + serialized.length - (this.to - this.from))) },
15398
+ changes: { from: liveFrom, to: liveTo, insert: serialized },
15399
+ selection: { anchor: Math.max(0, Math.min(nextCursor, view.state.doc.length + serialized.length - (liveTo - liveFrom))) },
14625
15400
  userEvent: "input.table"
14626
15401
  });
14627
15402
  if (focusAfter) {
14628
15403
  requestAnimationFrame(() => {
14629
- const targetCell = view.dom.querySelector(
14630
- `[data-table-from="${this.from}"] [data-cell-coord="${focusAfter.row}:${focusAfter.col}"]`
15404
+ const rootScope = outer.isConnected ? outer : view.dom;
15405
+ const targetCell = outer.isConnected ? rootScope.querySelector(
15406
+ `[data-cell-coord="${focusAfter.row}:${focusAfter.col}"]`
15407
+ ) : rootScope.querySelector(
15408
+ `[data-table-from="${liveFrom}"] [data-cell-coord="${focusAfter.row}:${focusAfter.col}"]`
14631
15409
  );
14632
15410
  targetCell?.click();
14633
15411
  });
@@ -14817,7 +15595,8 @@ var MarkdownTableWidget = class extends view.WidgetType {
14817
15595
  })
14818
15596
  );
14819
15597
  const sourceBtn = makeBtn("Source", "Edit raw Markdown table", () => {
14820
- view.dispatch({ selection: { anchor: this.from } });
15598
+ const { from: liveFrom } = resolveLiveRange();
15599
+ view.dispatch({ selection: { anchor: liveFrom } });
14821
15600
  view.focus();
14822
15601
  });
14823
15602
  sourceBtn.style.marginLeft = "auto";
@@ -15100,7 +15879,7 @@ function openLinkEditPopover(anchorEl, view, match) {
15100
15879
  labelInput.focus();
15101
15880
  labelInput.select();
15102
15881
  }
15103
- var LinkPillWidget = class extends view.WidgetType {
15882
+ var LinkPillWidget = class _LinkPillWidget extends view.WidgetType {
15104
15883
  constructor(label, url, from, to, readOnly, affiliateTag) {
15105
15884
  super();
15106
15885
  this.label = label;
@@ -15117,7 +15896,31 @@ var LinkPillWidget = class extends view.WidgetType {
15117
15896
  readOnly;
15118
15897
  affiliateTag;
15119
15898
  eq(other) {
15120
- return this.label === other.label && this.url === other.url && this.from === other.from && this.to === other.to && this.readOnly === other.readOnly && this.affiliateTag === other.affiliateTag;
15899
+ return this.label === other.label && this.url === other.url && this.readOnly === other.readOnly && this.affiliateTag === other.affiliateTag;
15900
+ }
15901
+ resolveLiveRange(pill, view) {
15902
+ const field = view.state.field(linkPreviewField, false);
15903
+ if (field && view.dom.contains(pill)) {
15904
+ try {
15905
+ const domPos = view.posAtDOM(pill);
15906
+ const searchFrom = Math.max(0, domPos - 1);
15907
+ const searchTo = Math.min(view.state.doc.length, domPos + 1);
15908
+ let found = null;
15909
+ field.between(searchFrom, searchTo, (from, to, value) => {
15910
+ const widget = value.spec?.widget;
15911
+ if (widget instanceof _LinkPillWidget && widget.label === this.label && widget.url === this.url) {
15912
+ found = { from, to };
15913
+ return false;
15914
+ }
15915
+ });
15916
+ if (found) return found;
15917
+ } catch {
15918
+ }
15919
+ }
15920
+ return {
15921
+ from: Math.max(0, Math.min(this.from, view.state.doc.length)),
15922
+ to: Math.max(0, Math.min(this.to, view.state.doc.length))
15923
+ };
15121
15924
  }
15122
15925
  toDOM(view) {
15123
15926
  const isExternal = isExternalHttpUrl(this.url);
@@ -15135,9 +15938,10 @@ var LinkPillWidget = class extends view.WidgetType {
15135
15938
  label.addEventListener("click", (e) => {
15136
15939
  e.preventDefault();
15137
15940
  e.stopPropagation();
15941
+ const range = this.resolveLiveRange(pill, view);
15138
15942
  openLinkEditPopover(pill, view, {
15139
- from: this.from,
15140
- to: this.to,
15943
+ from: range.from,
15944
+ to: range.to,
15141
15945
  label: this.label,
15142
15946
  url: this.url
15143
15947
  });
@@ -16495,6 +17299,21 @@ var ReactWidgetBlock = class extends view.WidgetType {
16495
17299
  );
16496
17300
  return wrapper;
16497
17301
  }
17302
+ updateDOM(dom, view) {
17303
+ const root = getOrCreateRoot2(dom);
17304
+ this.container = dom;
17305
+ this.root = root;
17306
+ root.render(
17307
+ React2__namespace.createElement(WidgetBlockPreviewWrapper, {
17308
+ widgetName: this.widgetName,
17309
+ rawContent: this.rawContent,
17310
+ sectionId: this.sectionId,
17311
+ registry: this.registry,
17312
+ view
17313
+ })
17314
+ );
17315
+ return true;
17316
+ }
16498
17317
  destroy(dom) {
16499
17318
  const targetDom = dom ?? this.container;
16500
17319
  const r = this.root;
@@ -16605,22 +17424,31 @@ var widgetNavKeymap = state.Prec.high(view.keymap.of([
16605
17424
  { key: "ArrowDown", run: skipWidgetDown },
16606
17425
  { key: "ArrowUp", run: skipWidgetUp }
16607
17426
  ]));
17427
+ var widgetRegistryFacet = state.Facet.define({
17428
+ combine: (values2) => values2[values2.length - 1] ?? /* @__PURE__ */ new Map()
17429
+ });
17430
+ var widgetPreviewField = state.StateField.define({
17431
+ create(state) {
17432
+ return buildWidgetDecos(state, state.facet(widgetRegistryFacet));
17433
+ },
17434
+ update(value, tr) {
17435
+ const hasToggle = tr.effects.some((e) => e.is(toggleWidgetEdit));
17436
+ const selectionChanged = !tr.startState.selection.eq(tr.newSelection);
17437
+ const registryChanged = tr.startState.facet(widgetRegistryFacet) !== tr.state.facet(widgetRegistryFacet);
17438
+ if (tr.docChanged || hasToggle || selectionChanged || registryChanged) {
17439
+ return buildWidgetDecos(tr.state, tr.state.facet(widgetRegistryFacet));
17440
+ }
17441
+ return value;
17442
+ },
17443
+ provide: (f) => view.EditorView.decorations.from(f)
17444
+ });
16608
17445
  function widgetBlockPreview(registry) {
16609
- const widgetPreviewField = state.StateField.define({
16610
- create(state) {
16611
- return buildWidgetDecos(state, registry);
16612
- },
16613
- update(value, tr) {
16614
- const hasToggle = tr.effects.some((e) => e.is(toggleWidgetEdit));
16615
- const selectionChanged = !tr.startState.selection.eq(tr.newSelection);
16616
- if (tr.docChanged || hasToggle || selectionChanged) {
16617
- return buildWidgetDecos(tr.state, registry);
16618
- }
16619
- return value;
16620
- },
16621
- provide: (f) => view.EditorView.decorations.from(f)
16622
- });
16623
- return [widgetPreviewField, editingWidgetsField, widgetNavKeymap];
17446
+ return [
17447
+ widgetRegistryFacet.of(registry),
17448
+ widgetPreviewField,
17449
+ editingWidgetsField,
17450
+ widgetNavKeymap
17451
+ ];
16624
17452
  }
16625
17453
  var CompositeBlock = class _CompositeBlock {
16626
17454
  static create(type, value, from, parentHash, end) {
@@ -20144,7 +20972,7 @@ var operatorToken = new lr.ExternalTokenizer((input, stack) => {
20144
20972
  function identifierChar(ch, start) {
20145
20973
  return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch == 95 || ch >= 192 || !start && ch >= 48 && ch <= 57;
20146
20974
  }
20147
- var jsx37 = new lr.ExternalTokenizer((input, stack) => {
20975
+ var jsx38 = new lr.ExternalTokenizer((input, stack) => {
20148
20976
  if (input.next != lt || !stack.dialectEnabled(Dialect_jsx)) return;
20149
20977
  input.advance();
20150
20978
  if (input.next == slash2) return;
@@ -20256,7 +21084,7 @@ var parser4 = lr.LRParser.deserialize({
20256
21084
  skippedNodes: [0, 5, 6, 278],
20257
21085
  repeatNodeCount: 37,
20258
21086
  tokenData: "$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p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20259
- tokenizers: [noSemicolon, noSemicolonType, operatorToken, jsx37, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, insertSemicolon, new lr.LocalTokenGroup("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~", 141, 340), new lr.LocalTokenGroup("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~", 25, 323)],
21087
+ tokenizers: [noSemicolon, noSemicolonType, operatorToken, jsx38, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, insertSemicolon, new lr.LocalTokenGroup("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~", 141, 340), new lr.LocalTokenGroup("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~", 25, 323)],
20260
21088
  topRules: { "Script": [0, 7], "SingleExpression": [1, 276], "SingleClassItem": [2, 277] },
20261
21089
  dialects: { jsx: 0, ts: 15175 },
20262
21090
  dynamicPrecedences: { "80": 1, "82": 1, "94": 1, "169": 1, "199": 1 },
@@ -21785,6 +22613,8 @@ function editorPreset(optionsOrDialect = "markdown") {
21785
22613
  addToOptions: [wodCompletionIconOption]
21786
22614
  }),
21787
22615
  wodCompletionKeymap,
22616
+ wodIndentKeymap,
22617
+ wodBackspaceCompletion,
21788
22618
  wodLinter
21789
22619
  );
21790
22620
  } else {
@@ -21797,6 +22627,7 @@ function editorPreset(optionsOrDialect = "markdown") {
21797
22627
  ...whiteboardScriptCompletion ? { whiteboardScript: whiteboardScriptCompletion } : {}
21798
22628
  };
21799
22629
  extensions.push(
22630
+ wodIndentKeymap,
21800
22631
  markdown({ codeLanguages: resolveCodeLanguage }),
21801
22632
  editorFocusTracker,
21802
22633
  sectionField,
@@ -21823,13 +22654,13 @@ function editorPreset(optionsOrDialect = "markdown") {
21823
22654
  }
21824
22655
 
21825
22656
  // src/version.ts
21826
- var VERSION = "0.61.2259";
21827
- var GIT_SHA = "e65814e";
21828
- var BUILD_TIME = "2026-11-21T02:31:54.391Z";
22657
+ var VERSION = "0.62.2260";
22658
+ var GIT_SHA = "d3581b3";
22659
+ var BUILD_TIME = "2026-11-23T01:01:07.332Z";
21829
22660
  var SEMVER = {
21830
- version: "0.61.2259",
21831
- gitSha: "e65814e",
21832
- buildTime: "2026-11-21T02:31:54.391Z"
22661
+ version: "0.62.2260",
22662
+ gitSha: "d3581b3",
22663
+ buildTime: "2026-11-23T01:01:07.332Z"
21833
22664
  };
21834
22665
 
21835
22666
  Object.defineProperty(exports, "CONTENT_GROUPING_DIMENSIONS", {
@@ -21886,6 +22717,7 @@ exports.SERIES_COLORS = SERIES_COLORS;
21886
22717
  exports.SOURCE_OPTIONS = SOURCE_OPTIONS;
21887
22718
  exports.SUGGESTION_BINDINGS = SUGGESTION_BINDINGS;
21888
22719
  exports.SessionSummaryCard = SessionSummaryCard;
22720
+ exports.SingleLineYAxisTick = SingleLineYAxisTick;
21889
22721
  exports.StackedBar = StackedBar;
21890
22722
  exports.TARGET_OPTIONS = TARGET_OPTIONS;
21891
22723
  exports.TIME_OPTIONS = TIME_OPTIONS;
@@ -21930,6 +22762,7 @@ exports.cn = cn;
21930
22762
  exports.compactNumber = compactNumber;
21931
22763
  exports.composerRegistry = composerRegistry;
21932
22764
  exports.computeSessionPrHighlights = computeSessionPrHighlights;
22765
+ exports.computeYAxisWidth = computeYAxisWidth;
21933
22766
  exports.configureOverlayActions = configureOverlayActions;
21934
22767
  exports.createExecutorDocumentHost = createExecutorDocumentHost;
21935
22768
  exports.cursorFocusExtension = cursorFocusExtension;
@@ -21955,9 +22788,13 @@ exports.fenceCompletion = fenceCompletion;
21955
22788
  exports.findQueryBlockSection = findQueryBlockSection;
21956
22789
  exports.findWorkoutErrors = findWorkoutErrors;
21957
22790
  exports.forceSectionParse = forceSectionParse;
22791
+ exports.formatAnalyticsFloat = formatAnalyticsFloat;
22792
+ exports.formatAxisTick = formatAxisTick;
21958
22793
  exports.formatClockTime = formatClockTime;
22794
+ exports.formatCompactMetricValue = formatCompactMetricValue;
21959
22795
  exports.formatHumanQuerySummary = formatHumanQuerySummary;
21960
22796
  exports.formatMMSS = formatMMSS;
22797
+ exports.formatMetricValue = formatMetricValue;
21961
22798
  exports.formatSummaryDurationMMSS = formatSummaryDurationMMSS;
21962
22799
  exports.formatTimeseriesTick = formatTimeseriesTick;
21963
22800
  exports.formatTimeseriesTooltipValue = formatTimeseriesTooltipValue;
@@ -21986,11 +22823,13 @@ exports.handleSmartUrlPaste = handleSmartUrlPaste;
21986
22823
  exports.hashCode = hashCode;
21987
22824
  exports.inlineButtonDecoration = inlineButtonDecoration;
21988
22825
  exports.insertMarkdownLinkCommand = insertMarkdownLinkCommand;
22826
+ exports.insertWhiteboardNewline = insertWhiteboardNewline;
21989
22827
  exports.invalidateSuggestions = invalidateSuggestions;
21990
22828
  exports.isAmazonRetailHost = isAmazonRetailHost;
21991
22829
  exports.isEditorFocused = isEditorFocused;
21992
22830
  exports.isInternalFrontmatterKey = isInternalFrontmatterKey;
21993
22831
  exports.isNavigableUrl = isNavigableUrl;
22832
+ exports.isWhiteboardScriptBody = isWhiteboardScriptBody;
21994
22833
  exports.lineIdsExtension = lineIdsExtension;
21995
22834
  exports.linkOpen = linkOpen;
21996
22835
  exports.linkPreview = linkPreview;
@@ -22045,6 +22884,7 @@ exports.setGutterHighlights = setGutterHighlights;
22045
22884
  exports.setPrimaryQueryOnObject = setPrimaryQueryOnObject;
22046
22885
  exports.setQuerySourceEditing = setQuerySourceEditing;
22047
22886
  exports.setSuggestionBinding = setSuggestionBinding;
22887
+ exports.shouldTriggerBackspaceCompletion = shouldTriggerBackspaceCompletion;
22048
22888
  exports.slashBlockCompletion = slashBlockCompletion;
22049
22889
  exports.smartIncrement = smartIncrement;
22050
22890
  exports.summarizeAggregate = summarizeAggregate;
@@ -22069,10 +22909,12 @@ exports.useWqlStageCounts = useWqlStageCounts;
22069
22909
  exports.widgetBlockPreview = widgetBlockPreview;
22070
22910
  exports.wodAutoWrap = wodAutoWrap;
22071
22911
  exports.wodAutocompletion = wodAutocompletion;
22912
+ exports.wodBackspaceCompletion = wodBackspaceCompletion;
22072
22913
  exports.wodCompletionIconOption = wodCompletionIconOption;
22073
22914
  exports.wodCompletionKeymap = wodCompletionKeymap;
22074
22915
  exports.wodCompletionSource = wodCompletionSource;
22075
22916
  exports.wodEditorKeymap = wodEditorKeymap;
22917
+ exports.wodIndentKeymap = wodIndentKeymap;
22076
22918
  exports.wodLinter = wodLinter;
22077
22919
  exports.wodOverlayPanel = wodOverlayPanel;
22078
22920
  exports.workoutLintSource = workoutLintSource;