@bitcobblers/wod-wiki-ui 0.10.42 → 0.35.2115

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.
@@ -1,8 +1,8 @@
1
- export { B as ButtonAction, C as CursorFocusState, D as DefaultFrontmatterWidget, E as EditorDialect, a as EditorPresetOptions, b as EditorSection, c as EditorSectionSubtype, d as EditorSectionType, e as EmbedType, G as GeometryListener, N as NavigationHook, O as OverlayAction, f as QueryBlockPreviewOptions, R as RuntimePanelEntry, S as SectionRect, g as SectionState, W as WidgetConfig, h as WidgetProps, i as WidgetRegistry, j as activeCursorSection, k as addRuntimePanel, l as blockContentId, m as configureOverlayActions, n as cursorFocusExtension, o as dispatchAddRuntimePanel, p as dispatchExpandRuntimePanel, q as dispatchGutterHighlights, r as dispatchRemoveRuntimePanel, s as editingWidgetsField, t as editorPreset, u as editorTheme, v as embedPreviewDecorations, w as expandRuntimePanel, x as fenceCompletion, y as findQueryBlockSection, z as findWorkoutErrors, A as forceSectionParse, F as frontmatterPreview, H as frontmatterPreviewField, I as getCursorFocusState, J as getOverlayActions, K as gutterHighlightsField, L as gutterUnified, M as handleFenceAutoWrap, P as inlineButtonDecoration, T as lineIdsExtension, U as linkOpen, V as markdownSyntaxHiding, X as markdownTablePreview, Y as navigationFacet, Z as previewDecorations, _ as queryBlockPreview, $ as removeRuntimePanel, a0 as runtimePanelField, a1 as saveBlockQuerySource, a2 as sectionAtPos, a3 as sectionField, a4 as sectionGeometry, a5 as sessionQueryInsert, a6 as sessionQueryWql, a7 as setGutterHighlights, a8 as smartIncrement, a9 as toggleWidgetEdit, aa as urlAtPos, ab as widgetBlockPreview, ac as wodAutoWrap, ad as wodAutocompletion, ae as wodEditorKeymap, af as wodLinter, ag as wodOverlayPanel, ah as workoutLintSource, ai as wrapInTimeFence } from '../index-CTQ7Hrsa.cjs';
1
+ export { B as ButtonAction, C as CursorFocusState, a as CustomCompletionSource, D as DefaultFrontmatterWidget, E as EditorDialect, b as EditorPresetOptions, c as EditorSection, d as EditorSectionSubtype, e as EditorSectionType, f as EmbedType, F as FrontmatterSuggestionCatalog, G as GeometryListener, N as NavigationHook, O as OverlayAction, g as QueryBlockPreviewOptions, R as RuntimePanelEntry, S as SectionRect, h as SectionState, W as WidgetConfig, i as WidgetProps, j as WidgetRegistry, k as activeCursorSection, l as addRuntimePanel, m as configureOverlayActions, n as cursorFocusExtension, o as dispatchAddRuntimePanel, p as dispatchExpandRuntimePanel, q as dispatchGutterHighlights, r as dispatchRemoveRuntimePanel, s as editingWidgetsField, t as editorPreset, u as editorTheme, v as embedPreviewDecorations, w as expandRuntimePanel, x as fenceCompletion, y as findQueryBlockSection, z as findWorkoutErrors, A as forceSectionParse, H as frontmatterPreview, I as frontmatterPreviewField, J as frontmatterSuggestions, K as frontmatterVisibility, L as getCursorFocusState, M as getOverlayActions, P as gutterHighlightsField, T as gutterUnified, U as handleFenceAutoWrap, V as inlineButtonDecoration, X as lineIdsExtension, Y as linkOpen, Z as linkPreview, _ as markdownSyntaxHiding, $ as markdownTablePreview, a0 as navigationFacet, a1 as previewDecorations, a2 as queryBlockPreview, a3 as registerCustomCompletionSource, a4 as removeRuntimePanel, a5 as runtimePanelField, a6 as saveBlockQuerySource, a7 as sectionAtPos, a8 as sectionField, a9 as sectionGeometry, aa as sessionQueryInsert, ab as sessionQueryWql, ac as setGutterHighlights, ad as smartIncrement, ae as toggleWidgetEdit, af as unregisterCustomCompletionSource, ag as urlAtPos, ah as widgetBlockPreview, ai as wodAutoWrap, aj as wodAutocompletion, ak as wodEditorKeymap, al as wodLinter, am as wodOverlayPanel, an as workoutLintSource, ao as wrapInTimeFence } from '../index-DMTXLSJ0.cjs';
2
+ export { blockContentId } from '@bitcobblers/wod-wiki-core';
2
3
  import '@codemirror/state';
3
4
  import '@codemirror/view';
4
5
  import '@codemirror/lint';
5
6
  import '@codemirror/autocomplete';
6
- import '@bitcobblers/wod-wiki-core';
7
7
  import '@bitcobblers/wod-wiki-wql';
8
8
  import 'react';
@@ -1,8 +1,8 @@
1
- export { B as ButtonAction, C as CursorFocusState, D as DefaultFrontmatterWidget, E as EditorDialect, a as EditorPresetOptions, b as EditorSection, c as EditorSectionSubtype, d as EditorSectionType, e as EmbedType, G as GeometryListener, N as NavigationHook, O as OverlayAction, f as QueryBlockPreviewOptions, R as RuntimePanelEntry, S as SectionRect, g as SectionState, W as WidgetConfig, h as WidgetProps, i as WidgetRegistry, j as activeCursorSection, k as addRuntimePanel, l as blockContentId, m as configureOverlayActions, n as cursorFocusExtension, o as dispatchAddRuntimePanel, p as dispatchExpandRuntimePanel, q as dispatchGutterHighlights, r as dispatchRemoveRuntimePanel, s as editingWidgetsField, t as editorPreset, u as editorTheme, v as embedPreviewDecorations, w as expandRuntimePanel, x as fenceCompletion, y as findQueryBlockSection, z as findWorkoutErrors, A as forceSectionParse, F as frontmatterPreview, H as frontmatterPreviewField, I as getCursorFocusState, J as getOverlayActions, K as gutterHighlightsField, L as gutterUnified, M as handleFenceAutoWrap, P as inlineButtonDecoration, T as lineIdsExtension, U as linkOpen, V as markdownSyntaxHiding, X as markdownTablePreview, Y as navigationFacet, Z as previewDecorations, _ as queryBlockPreview, $ as removeRuntimePanel, a0 as runtimePanelField, a1 as saveBlockQuerySource, a2 as sectionAtPos, a3 as sectionField, a4 as sectionGeometry, a5 as sessionQueryInsert, a6 as sessionQueryWql, a7 as setGutterHighlights, a8 as smartIncrement, a9 as toggleWidgetEdit, aa as urlAtPos, ab as widgetBlockPreview, ac as wodAutoWrap, ad as wodAutocompletion, ae as wodEditorKeymap, af as wodLinter, ag as wodOverlayPanel, ah as workoutLintSource, ai as wrapInTimeFence } from '../index-CTQ7Hrsa.js';
1
+ export { B as ButtonAction, C as CursorFocusState, a as CustomCompletionSource, D as DefaultFrontmatterWidget, E as EditorDialect, b as EditorPresetOptions, c as EditorSection, d as EditorSectionSubtype, e as EditorSectionType, f as EmbedType, F as FrontmatterSuggestionCatalog, G as GeometryListener, N as NavigationHook, O as OverlayAction, g as QueryBlockPreviewOptions, R as RuntimePanelEntry, S as SectionRect, h as SectionState, W as WidgetConfig, i as WidgetProps, j as WidgetRegistry, k as activeCursorSection, l as addRuntimePanel, m as configureOverlayActions, n as cursorFocusExtension, o as dispatchAddRuntimePanel, p as dispatchExpandRuntimePanel, q as dispatchGutterHighlights, r as dispatchRemoveRuntimePanel, s as editingWidgetsField, t as editorPreset, u as editorTheme, v as embedPreviewDecorations, w as expandRuntimePanel, x as fenceCompletion, y as findQueryBlockSection, z as findWorkoutErrors, A as forceSectionParse, H as frontmatterPreview, I as frontmatterPreviewField, J as frontmatterSuggestions, K as frontmatterVisibility, L as getCursorFocusState, M as getOverlayActions, P as gutterHighlightsField, T as gutterUnified, U as handleFenceAutoWrap, V as inlineButtonDecoration, X as lineIdsExtension, Y as linkOpen, Z as linkPreview, _ as markdownSyntaxHiding, $ as markdownTablePreview, a0 as navigationFacet, a1 as previewDecorations, a2 as queryBlockPreview, a3 as registerCustomCompletionSource, a4 as removeRuntimePanel, a5 as runtimePanelField, a6 as saveBlockQuerySource, a7 as sectionAtPos, a8 as sectionField, a9 as sectionGeometry, aa as sessionQueryInsert, ab as sessionQueryWql, ac as setGutterHighlights, ad as smartIncrement, ae as toggleWidgetEdit, af as unregisterCustomCompletionSource, ag as urlAtPos, ah as widgetBlockPreview, ai as wodAutoWrap, aj as wodAutocompletion, ak as wodEditorKeymap, al as wodLinter, am as wodOverlayPanel, an as workoutLintSource, ao as wrapInTimeFence } from '../index-DMTXLSJ0.js';
2
+ export { blockContentId } from '@bitcobblers/wod-wiki-core';
2
3
  import '@codemirror/state';
3
4
  import '@codemirror/view';
4
5
  import '@codemirror/lint';
5
6
  import '@codemirror/autocomplete';
6
- import '@bitcobblers/wod-wiki-core';
7
7
  import '@bitcobblers/wod-wiki-wql';
8
8
  import 'react';
@@ -1,3 +1,3 @@
1
- export { DefaultFrontmatterWidget, activeCursorSection, addRuntimePanel, blockContentId, configureOverlayActions, cursorFocusExtension, dispatchAddRuntimePanel, dispatchExpandRuntimePanel, dispatchGutterHighlights, dispatchRemoveRuntimePanel, editingWidgetsField, editorPreset, editorTheme, embedPreviewDecorations, expandRuntimePanel, fenceCompletion, findQueryBlockSection, findWorkoutErrors, forceSectionParse, frontmatterPreview, frontmatterPreviewField, getCursorFocusState, getOverlayActions, gutterHighlightsField, gutterUnified, handleFenceAutoWrap, inlineButtonDecoration, lineIdsExtension, linkOpen, markdownSyntaxHiding, markdownTablePreview, navigationFacet, previewDecorations, queryBlockPreview, removeRuntimePanel, runtimePanelField, saveBlockQuerySource, sectionAtPos, sectionField, sectionGeometry, sessionQueryInsert, sessionQueryWql, setGutterHighlights, smartIncrement, toggleWidgetEdit, urlAtPos, widgetBlockPreview, wodAutoWrap, wodAutocompletion, wodEditorKeymap, wodLinter, wodOverlayPanel, workoutLintSource, wrapInTimeFence } from '../chunk-S77JRUQM.mjs';
1
+ export { DefaultFrontmatterWidget, activeCursorSection, addRuntimePanel, blockContentId, configureOverlayActions, cursorFocusExtension, dispatchAddRuntimePanel, dispatchExpandRuntimePanel, dispatchGutterHighlights, dispatchRemoveRuntimePanel, editingWidgetsField, editorPreset, editorTheme, embedPreviewDecorations, expandRuntimePanel, fenceCompletion, findQueryBlockSection, findWorkoutErrors, forceSectionParse, frontmatterPreview, frontmatterPreviewField, frontmatterSuggestions, frontmatterVisibility, getCursorFocusState, getOverlayActions, gutterHighlightsField, gutterUnified, handleFenceAutoWrap, inlineButtonDecoration, lineIdsExtension, linkOpen, linkPreview, markdownSyntaxHiding, markdownTablePreview, navigationFacet, previewDecorations, queryBlockPreview, registerCustomCompletionSource, removeRuntimePanel, runtimePanelField, saveBlockQuerySource, sectionAtPos, sectionField, sectionGeometry, sessionQueryInsert, sessionQueryWql, setGutterHighlights, smartIncrement, toggleWidgetEdit, unregisterCustomCompletionSource, urlAtPos, widgetBlockPreview, wodAutoWrap, wodAutocompletion, wodEditorKeymap, wodLinter, wodOverlayPanel, workoutLintSource, wrapInTimeFence } from '../chunk-GUN6PZNI.mjs';
2
2
  //# sourceMappingURL=index.mjs.map
3
3
  //# sourceMappingURL=index.mjs.map
@@ -4,7 +4,7 @@ import { ViewPlugin, DecorationSet, ViewUpdate, EditorView, Decoration, WidgetTy
4
4
  import { Diagnostic } from '@codemirror/lint';
5
5
  import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
6
6
  import { ScriptBlock, ICodeStatement, IMetric } from '@bitcobblers/wod-wiki-core';
7
- import { QueryOptions, QueryResult, ParsedFindQuery, FindOptions, FindQueryResult, ParsedRowsQuery, RowsQueryResult, ParsedAggregateQuery } from '@bitcobblers/wod-wiki-wql';
7
+ import { QueryOptions, QueryResult, ParsedFindQuery, FindOptions, FindQueryResult, ParsedRowsQuery, RowsQueryResult, ParsedAggregateQuery, PipelineResult, IFieldCatalog } from '@bitcobblers/wod-wiki-wql';
8
8
  import * as react from 'react';
9
9
 
10
10
  declare function editorTheme(isDark: boolean): Extension;
@@ -32,6 +32,9 @@ declare function wrapInTimeFence(view: EditorView): boolean;
32
32
  declare function handleFenceAutoWrap(event: InputEvent, view: EditorView): boolean;
33
33
  declare const wodAutoWrap: Extension;
34
34
  declare const wodEditorKeymap: Extension;
35
+ type CustomCompletionSource = (context: CompletionContext) => CompletionResult | Promise<CompletionResult | null> | null;
36
+ declare function registerCustomCompletionSource(source: CustomCompletionSource): void;
37
+ declare function unregisterCustomCompletionSource(source: CustomCompletionSource): void;
35
38
  declare const wodAutocompletion: Extension;
36
39
 
37
40
  type EditorDialect = "time" | "log";
@@ -65,7 +68,7 @@ interface SectionState {
65
68
  sections: EditorSection[];
66
69
  }
67
70
  declare const forceSectionParse: _codemirror_state.StateEffectType<null>;
68
- declare function blockContentId(content: string): string;
71
+
69
72
  declare const sectionField: StateField<SectionState>;
70
73
  declare function sectionAtPos(state: EditorState, pos: number): EditorSection | null;
71
74
  declare function activeCursorSection(state: EditorState): EditorSection | null;
@@ -74,6 +77,8 @@ interface SectionRect {
74
77
  sectionId: string;
75
78
  top: number;
76
79
  height: number;
80
+ /** Rendered height of the section's opening (fence) line — hosts the inline command bar. */
81
+ firstLineHeight?: number;
77
82
  type: EditorSection["type"];
78
83
  subtype?: EditorSection["subtype"];
79
84
  widgetName?: string;
@@ -98,11 +103,25 @@ declare const previewDecorations: Extension;
98
103
 
99
104
  declare const embedPreviewDecorations: Extension;
100
105
 
106
+ type FrontmatterSuggestionCatalog = {
107
+ types: readonly string[];
108
+ tags: readonly {
109
+ label: string;
110
+ type?: string;
111
+ }[];
112
+ };
113
+ declare const frontmatterSuggestions: Facet<() => Promise<FrontmatterSuggestionCatalog>, (() => Promise<FrontmatterSuggestionCatalog>) | null>;
114
+ declare const frontmatterVisibility: Facet<boolean, boolean>;
101
115
  declare class DefaultFrontmatterWidget extends WidgetType {
102
- readonly props: Record<string, string>;
103
- constructor(props: Record<string, string>);
116
+ readonly sectionId: string;
117
+ readonly rawContent: string;
118
+ readonly readOnly: boolean;
119
+ constructor(sectionIdOrProps: string | Record<string, string>, rawContent?: string, readOnly?: boolean);
120
+ get props(): Record<string, string>;
104
121
  eq(other: DefaultFrontmatterWidget): boolean;
105
- toDOM(): HTMLElement;
122
+ ignoreEvent(): boolean;
123
+ toDOM(view: EditorView): HTMLElement;
124
+ destroy(dom: HTMLElement): void;
106
125
  }
107
126
  declare const frontmatterPreviewField: StateField<DecorationSet>;
108
127
  declare const frontmatterPreview: Extension;
@@ -111,6 +130,22 @@ declare function markdownSyntaxHiding(): Extension;
111
130
 
112
131
  declare const markdownTablePreview: Extension;
113
132
 
133
+ /**
134
+ * Link Preview
135
+ *
136
+ * Replaces URLs in markdown note text with a visual link pill (outline +
137
+ * external-open button):
138
+ * - markdown links `[label](https://…)`
139
+ * - bare URLs `https://…`
140
+ *
141
+ * Standalone `[label](url)` lines, bare-URL lines, and list items holding only
142
+ * a link get the same pill treatment; a YouTube URL on such a line renders as
143
+ * an inline player whenever the cursor is elsewhere, reverting to raw text
144
+ * when the cursor moves onto the line.
145
+ */
146
+
147
+ declare const linkPreview: Extension;
148
+
114
149
  declare const setGutterHighlights: _codemirror_state.StateEffectType<Set<number>>;
115
150
  declare const gutterHighlightsField: StateField<Set<number>>;
116
151
  declare const gutterUnified: (_codemirror_state.Extension | StateField<Set<number>>)[];
@@ -179,13 +214,26 @@ interface QueryExecutor {
179
214
  anchorNow?: number;
180
215
  }): Promise<RowsQueryResult>;
181
216
  run?(parsed: ParsedAggregateQuery, options?: QueryOptions): Promise<QueryResult>;
217
+ /** Pipeline queries (`:source | :fn | :chart`, `@dataset | …`) — the
218
+ * QueryService.runPipeline seam; the sink rides `PipelineResult.chart`. */
219
+ runPipeline?(query: string, options?: QueryOptions): Promise<PipelineResult>;
182
220
  }
183
221
 
184
222
  interface QueryBlockPreviewOptions {
185
223
  executor?: QueryExecutor;
186
224
  onResultSaved?: (callback: () => void) => (() => void) | void;
187
225
  readOnly?: boolean;
188
- onSaveQuery?: (sectionId: string, nextQuery: string) => void;
226
+ onSaveQuery?: (sectionId: string, nextQuery: string) => void | Promise<void>;
227
+ onOpenNote?: (item: {
228
+ id: string;
229
+ title?: string;
230
+ blockContentId?: string;
231
+ }) => void;
232
+ noteHref?: (item: {
233
+ id: string;
234
+ title?: string;
235
+ blockContentId?: string;
236
+ }) => string;
189
237
  }
190
238
  declare function saveBlockQuerySource(view: EditorView, sectionId: string, newQuery: string, queryIndex?: number): {
191
239
  ok: boolean;
@@ -229,8 +277,14 @@ interface EditorPresetOptions {
229
277
  lineWrapping?: boolean;
230
278
  executor?: QueryExecutor;
231
279
  onResultSaved?: (callback: () => void) => (() => void) | void;
280
+ /** Injected field catalog (ticket 15) — catalog-backed typeahead for wql
281
+ * editors. The app supplies it; this package never opens storage. */
282
+ catalog?: IFieldCatalog;
283
+ /** Dynamic typed-tag filter values (`domain:`/`format:`/`equipment:`/
284
+ * `quality:`/`intent:`) for wql editors — host reads its tags store. */
285
+ tagTypeValues?: (key: string) => Promise<readonly string[]> | readonly string[];
232
286
  extensions?: Extension[];
233
287
  }
234
288
  declare function editorPreset(optionsOrDialect?: string | EditorPresetOptions): Extension[];
235
289
 
236
- export { removeRuntimePanel as $, forceSectionParse as A, type ButtonAction as B, type CursorFocusState as C, DefaultFrontmatterWidget as D, type EditorDialect as E, frontmatterPreview as F, type GeometryListener as G, frontmatterPreviewField as H, getCursorFocusState as I, getOverlayActions as J, gutterHighlightsField as K, gutterUnified as L, handleFenceAutoWrap as M, type NavigationHook as N, type OverlayAction as O, inlineButtonDecoration as P, type QueryExecutor as Q, type RuntimePanelEntry as R, type SectionRect as S, lineIdsExtension as T, linkOpen as U, markdownSyntaxHiding as V, type WidgetConfig as W, markdownTablePreview as X, navigationFacet as Y, previewDecorations as Z, queryBlockPreview as _, type EditorPresetOptions as a, runtimePanelField as a0, saveBlockQuerySource as a1, sectionAtPos as a2, sectionField as a3, sectionGeometry as a4, sessionQueryInsert as a5, sessionQueryWql as a6, setGutterHighlights as a7, smartIncrement as a8, toggleWidgetEdit as a9, urlAtPos as aa, widgetBlockPreview as ab, wodAutoWrap as ac, wodAutocompletion as ad, wodEditorKeymap as ae, wodLinter as af, wodOverlayPanel as ag, workoutLintSource as ah, wrapInTimeFence as ai, type EditorSection as b, type EditorSectionSubtype as c, type EditorSectionType as d, type EmbedType as e, type QueryBlockPreviewOptions as f, type SectionState as g, type WidgetProps as h, type WidgetRegistry as i, activeCursorSection as j, addRuntimePanel as k, blockContentId as l, configureOverlayActions as m, cursorFocusExtension as n, dispatchAddRuntimePanel as o, dispatchExpandRuntimePanel as p, dispatchGutterHighlights as q, dispatchRemoveRuntimePanel as r, editingWidgetsField as s, editorPreset as t, editorTheme as u, embedPreviewDecorations as v, expandRuntimePanel as w, fenceCompletion as x, findQueryBlockSection as y, findWorkoutErrors as z };
290
+ export { markdownTablePreview as $, forceSectionParse as A, type ButtonAction as B, type CursorFocusState as C, DefaultFrontmatterWidget as D, type EditorDialect as E, type FrontmatterSuggestionCatalog as F, type GeometryListener as G, frontmatterPreview as H, frontmatterPreviewField as I, frontmatterSuggestions as J, frontmatterVisibility as K, getCursorFocusState as L, getOverlayActions as M, type NavigationHook as N, type OverlayAction as O, gutterHighlightsField as P, type QueryExecutor as Q, type RuntimePanelEntry as R, type SectionRect as S, gutterUnified as T, handleFenceAutoWrap as U, inlineButtonDecoration as V, type WidgetConfig as W, lineIdsExtension as X, linkOpen as Y, linkPreview as Z, markdownSyntaxHiding as _, type CustomCompletionSource as a, navigationFacet as a0, previewDecorations as a1, queryBlockPreview as a2, registerCustomCompletionSource as a3, removeRuntimePanel as a4, runtimePanelField as a5, saveBlockQuerySource as a6, sectionAtPos as a7, sectionField as a8, sectionGeometry as a9, sessionQueryInsert as aa, sessionQueryWql as ab, setGutterHighlights as ac, smartIncrement as ad, toggleWidgetEdit as ae, unregisterCustomCompletionSource as af, urlAtPos as ag, widgetBlockPreview as ah, wodAutoWrap as ai, wodAutocompletion as aj, wodEditorKeymap as ak, wodLinter as al, wodOverlayPanel as am, workoutLintSource as an, wrapInTimeFence as ao, type EditorPresetOptions as b, type EditorSection as c, type EditorSectionSubtype as d, type EditorSectionType as e, type EmbedType as f, type QueryBlockPreviewOptions as g, type SectionState as h, type WidgetProps as i, type WidgetRegistry as j, activeCursorSection as k, addRuntimePanel as l, configureOverlayActions as m, cursorFocusExtension as n, dispatchAddRuntimePanel as o, dispatchExpandRuntimePanel as p, dispatchGutterHighlights as q, dispatchRemoveRuntimePanel as r, editingWidgetsField as s, editorPreset as t, editorTheme as u, embedPreviewDecorations as v, expandRuntimePanel as w, fenceCompletion as x, findQueryBlockSection as y, findWorkoutErrors as z };
@@ -4,7 +4,7 @@ import { ViewPlugin, DecorationSet, ViewUpdate, EditorView, Decoration, WidgetTy
4
4
  import { Diagnostic } from '@codemirror/lint';
5
5
  import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
6
6
  import { ScriptBlock, ICodeStatement, IMetric } from '@bitcobblers/wod-wiki-core';
7
- import { QueryOptions, QueryResult, ParsedFindQuery, FindOptions, FindQueryResult, ParsedRowsQuery, RowsQueryResult, ParsedAggregateQuery } from '@bitcobblers/wod-wiki-wql';
7
+ import { QueryOptions, QueryResult, ParsedFindQuery, FindOptions, FindQueryResult, ParsedRowsQuery, RowsQueryResult, ParsedAggregateQuery, PipelineResult, IFieldCatalog } from '@bitcobblers/wod-wiki-wql';
8
8
  import * as react from 'react';
9
9
 
10
10
  declare function editorTheme(isDark: boolean): Extension;
@@ -32,6 +32,9 @@ declare function wrapInTimeFence(view: EditorView): boolean;
32
32
  declare function handleFenceAutoWrap(event: InputEvent, view: EditorView): boolean;
33
33
  declare const wodAutoWrap: Extension;
34
34
  declare const wodEditorKeymap: Extension;
35
+ type CustomCompletionSource = (context: CompletionContext) => CompletionResult | Promise<CompletionResult | null> | null;
36
+ declare function registerCustomCompletionSource(source: CustomCompletionSource): void;
37
+ declare function unregisterCustomCompletionSource(source: CustomCompletionSource): void;
35
38
  declare const wodAutocompletion: Extension;
36
39
 
37
40
  type EditorDialect = "time" | "log";
@@ -65,7 +68,7 @@ interface SectionState {
65
68
  sections: EditorSection[];
66
69
  }
67
70
  declare const forceSectionParse: _codemirror_state.StateEffectType<null>;
68
- declare function blockContentId(content: string): string;
71
+
69
72
  declare const sectionField: StateField<SectionState>;
70
73
  declare function sectionAtPos(state: EditorState, pos: number): EditorSection | null;
71
74
  declare function activeCursorSection(state: EditorState): EditorSection | null;
@@ -74,6 +77,8 @@ interface SectionRect {
74
77
  sectionId: string;
75
78
  top: number;
76
79
  height: number;
80
+ /** Rendered height of the section's opening (fence) line — hosts the inline command bar. */
81
+ firstLineHeight?: number;
77
82
  type: EditorSection["type"];
78
83
  subtype?: EditorSection["subtype"];
79
84
  widgetName?: string;
@@ -98,11 +103,25 @@ declare const previewDecorations: Extension;
98
103
 
99
104
  declare const embedPreviewDecorations: Extension;
100
105
 
106
+ type FrontmatterSuggestionCatalog = {
107
+ types: readonly string[];
108
+ tags: readonly {
109
+ label: string;
110
+ type?: string;
111
+ }[];
112
+ };
113
+ declare const frontmatterSuggestions: Facet<() => Promise<FrontmatterSuggestionCatalog>, (() => Promise<FrontmatterSuggestionCatalog>) | null>;
114
+ declare const frontmatterVisibility: Facet<boolean, boolean>;
101
115
  declare class DefaultFrontmatterWidget extends WidgetType {
102
- readonly props: Record<string, string>;
103
- constructor(props: Record<string, string>);
116
+ readonly sectionId: string;
117
+ readonly rawContent: string;
118
+ readonly readOnly: boolean;
119
+ constructor(sectionIdOrProps: string | Record<string, string>, rawContent?: string, readOnly?: boolean);
120
+ get props(): Record<string, string>;
104
121
  eq(other: DefaultFrontmatterWidget): boolean;
105
- toDOM(): HTMLElement;
122
+ ignoreEvent(): boolean;
123
+ toDOM(view: EditorView): HTMLElement;
124
+ destroy(dom: HTMLElement): void;
106
125
  }
107
126
  declare const frontmatterPreviewField: StateField<DecorationSet>;
108
127
  declare const frontmatterPreview: Extension;
@@ -111,6 +130,22 @@ declare function markdownSyntaxHiding(): Extension;
111
130
 
112
131
  declare const markdownTablePreview: Extension;
113
132
 
133
+ /**
134
+ * Link Preview
135
+ *
136
+ * Replaces URLs in markdown note text with a visual link pill (outline +
137
+ * external-open button):
138
+ * - markdown links `[label](https://…)`
139
+ * - bare URLs `https://…`
140
+ *
141
+ * Standalone `[label](url)` lines, bare-URL lines, and list items holding only
142
+ * a link get the same pill treatment; a YouTube URL on such a line renders as
143
+ * an inline player whenever the cursor is elsewhere, reverting to raw text
144
+ * when the cursor moves onto the line.
145
+ */
146
+
147
+ declare const linkPreview: Extension;
148
+
114
149
  declare const setGutterHighlights: _codemirror_state.StateEffectType<Set<number>>;
115
150
  declare const gutterHighlightsField: StateField<Set<number>>;
116
151
  declare const gutterUnified: (_codemirror_state.Extension | StateField<Set<number>>)[];
@@ -179,13 +214,26 @@ interface QueryExecutor {
179
214
  anchorNow?: number;
180
215
  }): Promise<RowsQueryResult>;
181
216
  run?(parsed: ParsedAggregateQuery, options?: QueryOptions): Promise<QueryResult>;
217
+ /** Pipeline queries (`:source | :fn | :chart`, `@dataset | …`) — the
218
+ * QueryService.runPipeline seam; the sink rides `PipelineResult.chart`. */
219
+ runPipeline?(query: string, options?: QueryOptions): Promise<PipelineResult>;
182
220
  }
183
221
 
184
222
  interface QueryBlockPreviewOptions {
185
223
  executor?: QueryExecutor;
186
224
  onResultSaved?: (callback: () => void) => (() => void) | void;
187
225
  readOnly?: boolean;
188
- onSaveQuery?: (sectionId: string, nextQuery: string) => void;
226
+ onSaveQuery?: (sectionId: string, nextQuery: string) => void | Promise<void>;
227
+ onOpenNote?: (item: {
228
+ id: string;
229
+ title?: string;
230
+ blockContentId?: string;
231
+ }) => void;
232
+ noteHref?: (item: {
233
+ id: string;
234
+ title?: string;
235
+ blockContentId?: string;
236
+ }) => string;
189
237
  }
190
238
  declare function saveBlockQuerySource(view: EditorView, sectionId: string, newQuery: string, queryIndex?: number): {
191
239
  ok: boolean;
@@ -229,8 +277,14 @@ interface EditorPresetOptions {
229
277
  lineWrapping?: boolean;
230
278
  executor?: QueryExecutor;
231
279
  onResultSaved?: (callback: () => void) => (() => void) | void;
280
+ /** Injected field catalog (ticket 15) — catalog-backed typeahead for wql
281
+ * editors. The app supplies it; this package never opens storage. */
282
+ catalog?: IFieldCatalog;
283
+ /** Dynamic typed-tag filter values (`domain:`/`format:`/`equipment:`/
284
+ * `quality:`/`intent:`) for wql editors — host reads its tags store. */
285
+ tagTypeValues?: (key: string) => Promise<readonly string[]> | readonly string[];
232
286
  extensions?: Extension[];
233
287
  }
234
288
  declare function editorPreset(optionsOrDialect?: string | EditorPresetOptions): Extension[];
235
289
 
236
- export { removeRuntimePanel as $, forceSectionParse as A, type ButtonAction as B, type CursorFocusState as C, DefaultFrontmatterWidget as D, type EditorDialect as E, frontmatterPreview as F, type GeometryListener as G, frontmatterPreviewField as H, getCursorFocusState as I, getOverlayActions as J, gutterHighlightsField as K, gutterUnified as L, handleFenceAutoWrap as M, type NavigationHook as N, type OverlayAction as O, inlineButtonDecoration as P, type QueryExecutor as Q, type RuntimePanelEntry as R, type SectionRect as S, lineIdsExtension as T, linkOpen as U, markdownSyntaxHiding as V, type WidgetConfig as W, markdownTablePreview as X, navigationFacet as Y, previewDecorations as Z, queryBlockPreview as _, type EditorPresetOptions as a, runtimePanelField as a0, saveBlockQuerySource as a1, sectionAtPos as a2, sectionField as a3, sectionGeometry as a4, sessionQueryInsert as a5, sessionQueryWql as a6, setGutterHighlights as a7, smartIncrement as a8, toggleWidgetEdit as a9, urlAtPos as aa, widgetBlockPreview as ab, wodAutoWrap as ac, wodAutocompletion as ad, wodEditorKeymap as ae, wodLinter as af, wodOverlayPanel as ag, workoutLintSource as ah, wrapInTimeFence as ai, type EditorSection as b, type EditorSectionSubtype as c, type EditorSectionType as d, type EmbedType as e, type QueryBlockPreviewOptions as f, type SectionState as g, type WidgetProps as h, type WidgetRegistry as i, activeCursorSection as j, addRuntimePanel as k, blockContentId as l, configureOverlayActions as m, cursorFocusExtension as n, dispatchAddRuntimePanel as o, dispatchExpandRuntimePanel as p, dispatchGutterHighlights as q, dispatchRemoveRuntimePanel as r, editingWidgetsField as s, editorPreset as t, editorTheme as u, embedPreviewDecorations as v, expandRuntimePanel as w, fenceCompletion as x, findQueryBlockSection as y, findWorkoutErrors as z };
290
+ export { markdownTablePreview as $, forceSectionParse as A, type ButtonAction as B, type CursorFocusState as C, DefaultFrontmatterWidget as D, type EditorDialect as E, type FrontmatterSuggestionCatalog as F, type GeometryListener as G, frontmatterPreview as H, frontmatterPreviewField as I, frontmatterSuggestions as J, frontmatterVisibility as K, getCursorFocusState as L, getOverlayActions as M, type NavigationHook as N, type OverlayAction as O, gutterHighlightsField as P, type QueryExecutor as Q, type RuntimePanelEntry as R, type SectionRect as S, gutterUnified as T, handleFenceAutoWrap as U, inlineButtonDecoration as V, type WidgetConfig as W, lineIdsExtension as X, linkOpen as Y, linkPreview as Z, markdownSyntaxHiding as _, type CustomCompletionSource as a, navigationFacet as a0, previewDecorations as a1, queryBlockPreview as a2, registerCustomCompletionSource as a3, removeRuntimePanel as a4, runtimePanelField as a5, saveBlockQuerySource as a6, sectionAtPos as a7, sectionField as a8, sectionGeometry as a9, sessionQueryInsert as aa, sessionQueryWql as ab, setGutterHighlights as ac, smartIncrement as ad, toggleWidgetEdit as ae, unregisterCustomCompletionSource as af, urlAtPos as ag, widgetBlockPreview as ah, wodAutoWrap as ai, wodAutocompletion as aj, wodEditorKeymap as ak, wodLinter as al, wodOverlayPanel as am, workoutLintSource as an, wrapInTimeFence as ao, type EditorPresetOptions as b, type EditorSection as c, type EditorSectionSubtype as d, type EditorSectionType as e, type EmbedType as f, type QueryBlockPreviewOptions as g, type SectionState as h, type WidgetProps as i, type WidgetRegistry as j, activeCursorSection as k, addRuntimePanel as l, configureOverlayActions as m, cursorFocusExtension as n, dispatchAddRuntimePanel as o, dispatchExpandRuntimePanel as p, dispatchGutterHighlights as q, dispatchRemoveRuntimePanel as r, editingWidgetsField as s, editorPreset as t, editorTheme as u, embedPreviewDecorations as v, expandRuntimePanel as w, fenceCompletion as x, findQueryBlockSection as y, findWorkoutErrors as z };