@bitcobblers/wod-wiki-ui 0.7.37 → 0.8.39

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.
@@ -4,7 +4,7 @@ import { tags, styleTags, Tag } from '@lezer/highlight';
4
4
  import { RangeSetBuilder, Facet, StateEffect, StateField, Prec, EditorState, EditorSelection, countColumn } from '@codemirror/state';
5
5
  import { linter, forEachDiagnostic } from '@codemirror/lint';
6
6
  import { whiteboardScriptLanguage, createParser, getAnalyticsFromLogs, whiteboardScript } from '@bitcobblers/wod-wiki-lang';
7
- import { WQL_SOURCES, WQL_AGGREGATORS, WQL_ROLLUP_PERIODS, WQL_VIRTUAL_DIMS, WQL_TAG_KEYS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_CALC_TARGETS, WQL_DISPLAY_UNITS, WQL_INTENSITY_TIERS, parseQueryWidgetSuffix, WQL_COMPARISON_OPS, parseQuery, isRowsQuery, isDashboardWidgetType, unknownWidgetTypeMessage, resolveWidgetType, PLANNED_WIDGET_TYPES, parseWqlSuffixes, isFindQuery, splitWidgetBody, substituteTokens, unknownTokensMessage, wql, wqlLanguage } from '@bitcobblers/wod-wiki-wql';
7
+ import { WQL_SOURCES, WQL_AGGREGATORS, WQL_ROLLUP_PERIODS, WQL_VIRTUAL_DIMS, WQL_TAG_KEYS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_CALC_TARGETS, WQL_DISPLAY_UNITS, WQL_INTENSITY_TIERS, parseQueryWidgetSuffix, WQL_COMPARISON_OPS, parseQuery, isRowsQuery, isDashboardWidgetType, unknownWidgetTypeMessage, resolveWidgetType, PLANNED_WIDGET_TYPES, parseWqlSuffixes, WQL_FIND_TARGETS, isFindQuery, isAggregateQuery, splitWidgetBody, substituteTokens, unknownTokensMessage, wql, wqlLanguage } from '@bitcobblers/wod-wiki-wql';
8
8
  import { clsx } from 'clsx';
9
9
  import { twMerge } from 'tailwind-merge';
10
10
  import { snippet, autocompletion, closeBrackets, closeBracketsKeymap, CompletionContext, ifNotIn, completeFromList, snippetCompletion } from '@codemirror/autocomplete';
@@ -1460,7 +1460,7 @@ function dispatchExpandRuntimePanel(view, sectionId, expanded) {
1460
1460
 
1461
1461
  // src/extensions/sessionQueryBlock.ts
1462
1462
  function sessionQueryWql(resultId) {
1463
- return `rows:{result:${resultId}}`;
1463
+ return `rows:all{result:${resultId}}`;
1464
1464
  }
1465
1465
  function sessionQueryInsert(state, blockId, resultId, runBlock) {
1466
1466
  const sections = state.field(sectionField).sections;
@@ -1809,7 +1809,7 @@ function RowsResultsChrome({
1809
1809
  return;
1810
1810
  }
1811
1811
  let cancelled = false;
1812
- const wideQuery = parseQuery(`rows:{block:${blockContentId2}}`);
1812
+ const wideQuery = parseQuery(`rows:all{block:${blockContentId2}}`);
1813
1813
  if (!isRowsQuery(wideQuery)) return;
1814
1814
  void executor.runRows(wideQuery).then((res) => {
1815
1815
  if (!cancelled) setWideResult(res);
@@ -3004,7 +3004,7 @@ function clausesToWql(clauses) {
3004
3004
  const filterBraces = filterParts.length > 0 ? `{${filterParts.join(", ")}}` : "";
3005
3005
  const source = clauseValue(clauses, "source", "notes");
3006
3006
  if (source === "rows") {
3007
- const output = clauseValue(clauses, "output", "");
3007
+ const output = clauseValue(clauses, "output", "") || "all";
3008
3008
  const timeClause2 = clauses.find((c) => c.type === "time");
3009
3009
  let timeStr2 = "";
3010
3010
  if (timeClause2 && timeClause2.value && timeClause2.value !== "all") {
@@ -3130,6 +3130,7 @@ function wqlToClauses(wql2) {
3130
3130
  const headMatch2 = RESTORE_FIND_HEAD_RE.exec(primaryText);
3131
3131
  if (!headMatch2) return null;
3132
3132
  const targetValue = headMatch2[1];
3133
+ if (!WQL_FIND_TARGETS.includes(targetValue)) return null;
3133
3134
  const rest2 = primaryText.slice(headMatch2[0].length).trim();
3134
3135
  const filterClauses2 = restoreFilters(rest2);
3135
3136
  if (!filterClauses2) return null;
@@ -3685,7 +3686,7 @@ function diagnoseClauses(clauses) {
3685
3686
  return {
3686
3687
  valid: false,
3687
3688
  wql: clausesToWql(clauses),
3688
- ast: { raw: "", error },
3689
+ ast: { family: "aggregate", raw: "", agg: "sum", metric: "", filters: [], groupBy: [], error },
3689
3690
  error,
3690
3691
  offendingClauseId: clause.id
3691
3692
  };
@@ -3755,7 +3756,7 @@ function WqlDiagnosticsStrip({
3755
3756
  summary.hasJoin && /* @__PURE__ */ jsx("span", { "data-testid": "diag-summary-join", className: "text-primary font-semibold", children: "+join" })
3756
3757
  ] });
3757
3758
  })() }),
3758
- valid && !isFindQuery(ast) && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-x-3 text-[11px] opacity-80 border-l border-border/50 pl-3", children: (() => {
3759
+ valid && isAggregateQuery(ast) && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-x-3 text-[11px] opacity-80 border-l border-border/50 pl-3", children: (() => {
3759
3760
  const summary = summarizeAggregate(ast);
3760
3761
  return /* @__PURE__ */ jsxs(Fragment, { children: [
3761
3762
  /* @__PURE__ */ jsx(SummaryChip, { label: "agg", value: summary.agg, testId: "diag-summary-agg" }),
@@ -10369,5 +10370,5 @@ function editorPreset(optionsOrDialect = "markdown") {
10369
10370
  }
10370
10371
 
10371
10372
  export { AGG_OPTIONS, AddCalcDropdown, AddFilterDropdown, CLAUSE_META, CONTENT_SOURCES, ClausePopover, ComposerRegistry, CustomSlotPopover, DEFAULT_DIAGNOSTICS_DEBOUNCE_MS, DefaultFrontmatterWidget, GROUPBY_OPTIONS, GoalRings, METRIC_OPTIONS, MULTI_VALUE_TYPES, ProposedMetricBadge, QueryBlockView, QueryValue, ROLLUP_OPTIONS, RowsResultsChrome, RowsTable, SERIES_COLORS, SOURCE_OPTIONS, SUGGESTION_BINDINGS, StackedBar, TIME_OPTIONS, TokenSlotPill, TopList, UNIT_OPTIONS, WHERE_AGGREGATORS, WHERE_METRICS, WHERE_OPERATORS, WidgetChart, WidgetProblemBadge, WqlBars, WqlComposer, WqlDiagnosticsStrip, WqlEmptyState, WqlQueryInspectorModal, WqlTable, WqlTimeseries, ZoneDistribution, activeCursorSection, addRuntimePanel, blockContentId, blockTypesFromBlocks, catalogIdsFromBlocks, clauseToWql, clauseValue, clausesToWql, cn, compactNumber, composerRegistry, configureOverlayActions, cursorFocusExtension, dateRangeSlot, defaultClauses, defaultMetricsClauses, diagnoseClauses, dispatchAddRuntimePanel, dispatchExpandRuntimePanel, dispatchGutterHighlights, dispatchRemoveRuntimePanel, editingWidgetsField, editorPreset, editorTheme, embedPreviewDecorations, expandRuntimePanel, extractBlockQueries, fenceCompletion, findQueryBlockSection, findWorkoutErrors, forceSectionParse, formatTimestamp, frontmatterPreview, frontmatterPreviewField, getClauseMeta, getCursorFocusState, getOverlayActions, getSuggestionBinding, gutterHighlightsField, gutterUnified, handleFenceAutoWrap, hashCode, inlineButtonDecoration, invalidateSuggestions, lineIdsExtension, linkOpen, loadSuggestions, markdownSyntaxHiding, markdownTablePreview, mergeSeries, mergeTagSuggestions, navigationFacet, patchBlockQuery, pivotClauses, previewDecorations, queryBlockPreview, readSessionRpe, removeRuntimePanel, runtimePanelField, saveBlockQuerySource, sectionAtPos, sectionField, sectionGeometry, sessionQueryInsert, sessionQueryWql, setGutterHighlights, setMetricClause, setSuggestionBinding, smartIncrement, sourcePlane, summarizeAggregate, summarizeFind, tagsFromStaticBlocks, toggleWidgetEdit, tooltipTimestamp, urlAtPos, useChartShape, useComposerSlots, useSuggestions, useWqlStageCounts, widgetBlockPreview, wodAutoWrap, wodAutocompletion, wodEditorKeymap, wodLinter, wodOverlayPanel, workoutLintSource, wqlToClauses, wrapInTimeFence };
10372
- //# sourceMappingURL=chunk-3SOUSOM5.mjs.map
10373
- //# sourceMappingURL=chunk-3SOUSOM5.mjs.map
10373
+ //# sourceMappingURL=chunk-5JJK5ONN.mjs.map
10374
+ //# sourceMappingURL=chunk-5JJK5ONN.mjs.map