@bitcobblers/wod-wiki-ui 0.8.39 → 0.10.41

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.
@@ -3081,6 +3081,9 @@ function filterFragmentToClause(fragment, index) {
3081
3081
  const key = fragment.slice(0, colon2);
3082
3082
  const value = fragment.slice(colon2 + 1);
3083
3083
  if (!value.trim()) return null;
3084
+ if (key === "source") {
3085
+ return restoreClause(`c-source-${index}`, "source", value);
3086
+ }
3084
3087
  const builtin = FILTER_KEY_TO_CLAUSE_TYPE[key];
3085
3088
  if (builtin) {
3086
3089
  const restoredValue = builtin === "text" && value.length >= 2 && value.startsWith('"') && value.endsWith('"') ? value.slice(1, -1) : value;
@@ -3111,7 +3114,8 @@ function restoreFilters(rest) {
3111
3114
  function wqlToClauses(wql2) {
3112
3115
  const suffixes = parseWqlSuffixes(wql2.trim());
3113
3116
  if (suffixes.conflicts?.length) return null;
3114
- const { where, displayUnit, groupBy, rollup, last, scope, primaryText } = suffixes;
3117
+ const { where, displayUnit, groupBy, rollup, window: window2, legacyScope, primaryText } = suffixes;
3118
+ if (window2?.kind === "range") return null;
3115
3119
  const rowsMatch = /^rows(?:\:([a-zA-Z0-9_-]+))?\:?/.exec(primaryText);
3116
3120
  if (rowsMatch) {
3117
3121
  if (where || groupBy || rollup) return null;
@@ -3120,7 +3124,7 @@ function wqlToClauses(wql2) {
3120
3124
  if (!filterClauses2) return null;
3121
3125
  const clauses2 = [
3122
3126
  restoreClause("c-source", "source", "rows"),
3123
- restoreClause("c-time", "time", last ? `last ${last.size}${last.unit}` : "all"),
3127
+ restoreClause("c-time", "time", window2?.kind === "relative" ? `last ${window2.size}${window2.unit}` : "all"),
3124
3128
  ...rowsMatch[1] ? [restoreClause("c-output", "output", rowsMatch[1])] : [],
3125
3129
  ...filterClauses2
3126
3130
  ];
@@ -3134,17 +3138,21 @@ function wqlToClauses(wql2) {
3134
3138
  const rest2 = primaryText.slice(headMatch2[0].length).trim();
3135
3139
  const filterClauses2 = restoreFilters(rest2);
3136
3140
  if (!filterClauses2) return null;
3137
- const timeValue = last ? `last ${last.size}${last.unit}` : "all";
3138
- const scopeValue = scope;
3141
+ const timeValue = window2?.kind === "relative" ? `last ${window2.size}${window2.unit}` : "all";
3142
+ const sourceClauseIdx = filterClauses2.findIndex((c) => c.type === "source");
3143
+ const sourceFromFilter = sourceClauseIdx !== -1 ? filterClauses2[sourceClauseIdx].value : void 0;
3144
+ const scopeValue = legacyScope ?? sourceFromFilter;
3145
+ const remainingFilterClauses = sourceClauseIdx !== -1 ? filterClauses2.filter((_, idx) => idx !== sourceClauseIdx) : filterClauses2;
3139
3146
  const sourceValue = targetValue === "block" ? "blocks" : targetValue === "effort" ? "efforts" : !scopeValue || scopeValue === "all" ? "notes" : scopeValue;
3140
3147
  const clauses2 = [
3141
3148
  restoreClause("c-source", "source", sourceValue),
3142
3149
  restoreClause("c-time", "time", timeValue),
3143
- ...filterClauses2
3150
+ ...remainingFilterClauses
3144
3151
  ];
3145
3152
  if (where) clauses2.push(restoreClause("c-where", "where", where));
3146
3153
  return clauses2;
3147
3154
  }
3155
+ if (window2) return null;
3148
3156
  const headMatch = RESTORE_AGG_HEAD_RE.exec(primaryText);
3149
3157
  if (!headMatch) return null;
3150
3158
  const aggValue = headMatch[1];
@@ -3651,10 +3659,12 @@ function AddCalcDropdown({
3651
3659
  ] });
3652
3660
  }
3653
3661
  function summarizeFind(ast) {
3662
+ const sourceFilter = ast.filters.find((f) => f.key === "source");
3663
+ const scope = sourceFilter ? sourceFilter.values.map((v) => v.value).join(",") : "all";
3654
3664
  return {
3655
3665
  target: ast.target,
3656
- scope: ast.scope || "all",
3657
- timeWindow: ast.last ? `last ${ast.last.size}${ast.last.unit}` : void 0,
3666
+ scope,
3667
+ timeWindow: ast.window ? ast.window.kind === "relative" ? `last ${ast.window.size}${ast.window.unit}` : `from ${ast.window.start}${ast.window.end ? ` to ${ast.window.end}` : ""}` : void 0,
3658
3668
  hasJoin: Boolean(ast.join),
3659
3669
  filterCount: ast.filters.length
3660
3670
  };
@@ -10370,5 +10380,5 @@ function editorPreset(optionsOrDialect = "markdown") {
10370
10380
  }
10371
10381
 
10372
10382
  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 };
10373
- //# sourceMappingURL=chunk-5JJK5ONN.mjs.map
10374
- //# sourceMappingURL=chunk-5JJK5ONN.mjs.map
10383
+ //# sourceMappingURL=chunk-S77JRUQM.mjs.map
10384
+ //# sourceMappingURL=chunk-S77JRUQM.mjs.map