@bitcobblers/wod-wiki-ui 0.4.24 → 0.5.28

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.
@@ -0,0 +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-BZqjX-eA.cjs';
2
+ import '@codemirror/state';
3
+ import '@codemirror/view';
4
+ import '@codemirror/lint';
5
+ import '@codemirror/autocomplete';
6
+ import '@bitcobblers/wod-wiki-core';
7
+ import '@bitcobblers/wod-wiki-wql';
8
+ import 'react';
@@ -0,0 +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-BZqjX-eA.js';
2
+ import '@codemirror/state';
3
+ import '@codemirror/view';
4
+ import '@codemirror/lint';
5
+ import '@codemirror/autocomplete';
6
+ import '@bitcobblers/wod-wiki-core';
7
+ import '@bitcobblers/wod-wiki-wql';
8
+ import 'react';
@@ -0,0 +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-HRROD36H.mjs';
2
+ //# sourceMappingURL=index.mjs.map
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
@@ -0,0 +1,235 @@
1
+ import * as _codemirror_state from '@codemirror/state';
2
+ import { Extension, Facet, EditorState, StateField } from '@codemirror/state';
3
+ import { ViewPlugin, DecorationSet, ViewUpdate, EditorView, Decoration, WidgetType } from '@codemirror/view';
4
+ import { Diagnostic } from '@codemirror/lint';
5
+ import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
6
+ import { ScriptBlock, ICodeStatement, IMetric } from '@bitcobblers/wod-wiki-core';
7
+ import { QueryOptions, QueryResult, ParsedFindQuery, FindOptions, FindQueryResult, ParsedRowsQuery, RowsQueryResult, ParsedQuery } from '@bitcobblers/wod-wiki-wql';
8
+ import * as react from 'react';
9
+
10
+ declare function editorTheme(isDark: boolean): Extension;
11
+
12
+ /**
13
+ * Extension that adds ID attributes to line elements in the editor.
14
+ */
15
+ declare const lineIdsExtension: ViewPlugin<{
16
+ decorations: DecorationSet;
17
+ update(update: ViewUpdate): void;
18
+ getDecorations(view: EditorView): _codemirror_state.RangeSet<Decoration>;
19
+ }, undefined>;
20
+
21
+ type NavigationHook = (url: string, view: EditorView) => void;
22
+ declare const navigationFacet: Facet<NavigationHook, NavigationHook | null>;
23
+ declare function urlAtPos(view: EditorView, pos: number): string | null;
24
+ declare const linkOpen: Extension;
25
+
26
+ declare function findWorkoutErrors(content: string, offsetInDoc: number): Diagnostic[];
27
+ declare function workoutLintSource(view: EditorView): Diagnostic[];
28
+ declare const wodLinter: _codemirror_state.Extension;
29
+
30
+ declare function fenceCompletion(context: CompletionContext): CompletionResult | null;
31
+ declare function wrapInTimeFence(view: EditorView): boolean;
32
+ declare function handleFenceAutoWrap(event: InputEvent, view: EditorView): boolean;
33
+ declare const wodAutoWrap: Extension;
34
+ declare const wodEditorKeymap: Extension;
35
+ declare const wodAutocompletion: Extension;
36
+
37
+ type EditorDialect = "time" | "log";
38
+ type EditorSectionType = "markdown" | "time" | "log" | "frontmatter" | "code" | "widget" | "embed" | "query";
39
+ type EditorSectionSubtype = "heading" | "paragraph" | "list" | "blockquote" | "table" | "unknown";
40
+ type EmbedType = "image" | "link" | "youtube";
41
+ interface EditorSection {
42
+ id: string;
43
+ type: EditorSectionType;
44
+ subtype?: EditorSectionSubtype;
45
+ from: number;
46
+ to: number;
47
+ startLine: number;
48
+ endLine: number;
49
+ contentFrom?: number;
50
+ contentTo?: number;
51
+ sport?: string;
52
+ widgetName?: string;
53
+ contentId?: string;
54
+ queryType?: string;
55
+ queryError?: string;
56
+ embed?: {
57
+ type: EmbedType;
58
+ url: string;
59
+ label: string;
60
+ videoId?: string;
61
+ height?: number;
62
+ };
63
+ }
64
+ interface SectionState {
65
+ sections: EditorSection[];
66
+ }
67
+ declare const forceSectionParse: _codemirror_state.StateEffectType<null>;
68
+ declare function blockContentId(content: string): string;
69
+ declare const sectionField: StateField<SectionState>;
70
+ declare function sectionAtPos(state: EditorState, pos: number): EditorSection | null;
71
+ declare function activeCursorSection(state: EditorState): EditorSection | null;
72
+
73
+ interface SectionRect {
74
+ sectionId: string;
75
+ top: number;
76
+ height: number;
77
+ type: EditorSection["type"];
78
+ subtype?: EditorSection["subtype"];
79
+ widgetName?: string;
80
+ }
81
+ type GeometryListener = (rects: SectionRect[], docVersion: number) => void;
82
+ declare class SectionGeometryPlugin {
83
+ private view;
84
+ rects: SectionRect[];
85
+ docVersion: number;
86
+ private listeners;
87
+ constructor(view: EditorView);
88
+ update(update: ViewUpdate): void;
89
+ addListener(fn: GeometryListener): () => void;
90
+ private measure;
91
+ private notify;
92
+ destroy(): void;
93
+ }
94
+ declare const sectionGeometry: ViewPlugin<SectionGeometryPlugin, undefined>;
95
+
96
+ declare const previewDecorations: Extension;
97
+
98
+ declare const embedPreviewDecorations: Extension;
99
+
100
+ declare class DefaultFrontmatterWidget extends WidgetType {
101
+ readonly props: Record<string, string>;
102
+ constructor(props: Record<string, string>);
103
+ eq(other: DefaultFrontmatterWidget): boolean;
104
+ toDOM(): HTMLElement;
105
+ }
106
+ declare const frontmatterPreviewField: StateField<DecorationSet>;
107
+ declare const frontmatterPreview: Extension;
108
+
109
+ declare function markdownSyntaxHiding(): Extension;
110
+
111
+ declare const markdownTablePreview: Extension;
112
+
113
+ declare const setGutterHighlights: _codemirror_state.StateEffectType<Set<number>>;
114
+ declare const gutterHighlightsField: StateField<Set<number>>;
115
+ declare const gutterUnified: (_codemirror_state.Extension | StateField<Set<number>>)[];
116
+ declare function dispatchGutterHighlights(view: EditorView, lineNumbers: number[]): void;
117
+
118
+ type ButtonAction = (action: string, params: Record<string, string>) => void;
119
+ declare function inlineButtonDecoration(onAction: ButtonAction): Extension;
120
+
121
+ interface RuntimePanelEntry {
122
+ sectionId: string;
123
+ block: ScriptBlock;
124
+ afterPos: number;
125
+ expanded?: boolean;
126
+ }
127
+ declare const addRuntimePanel: _codemirror_state.StateEffectType<RuntimePanelEntry>;
128
+ declare const removeRuntimePanel: _codemirror_state.StateEffectType<{
129
+ sectionId: string;
130
+ }>;
131
+ declare const expandRuntimePanel: _codemirror_state.StateEffectType<{
132
+ sectionId: string;
133
+ expanded: boolean;
134
+ }>;
135
+ declare const runtimePanelField: StateField<Map<string, RuntimePanelEntry>>;
136
+ declare function dispatchAddRuntimePanel(view: EditorView, sectionId: string, block: ScriptBlock, afterPos: number, expanded?: boolean): void;
137
+ declare function dispatchRemoveRuntimePanel(view: EditorView, sectionId: string): void;
138
+ declare function dispatchExpandRuntimePanel(view: EditorView, sectionId: string, expanded: boolean): void;
139
+
140
+ declare function sessionQueryWql(resultId: string): string;
141
+ declare function sessionQueryInsert(state: EditorState, blockId: string, resultId: string, runBlock?: {
142
+ id?: string;
143
+ contentId?: string;
144
+ }): {
145
+ from: number;
146
+ insert: string;
147
+ } | null;
148
+
149
+ declare const smartIncrement: Extension;
150
+
151
+ interface OverlayAction {
152
+ label: string;
153
+ icon: string;
154
+ action: (view: EditorView, section: EditorSection) => void;
155
+ }
156
+ declare function configureOverlayActions(actions: OverlayAction[]): void;
157
+ declare function getOverlayActions(): OverlayAction[];
158
+ declare const wodOverlayPanel: Extension;
159
+
160
+ interface CursorFocusState {
161
+ sectionId: string;
162
+ section: EditorSection;
163
+ lineFrom: number;
164
+ docLine: number;
165
+ statementIndex: number;
166
+ statement: ICodeStatement;
167
+ focusedMetric: IMetric | null;
168
+ focusedMetricIndex: number;
169
+ allStatements: ICodeStatement[];
170
+ }
171
+ declare function getCursorFocusState(state: EditorState): CursorFocusState | null;
172
+ declare const cursorFocusExtension: Extension;
173
+
174
+ interface QueryExecutor {
175
+ runQuery(query: string, options?: QueryOptions): Promise<QueryResult>;
176
+ runFind(parsed: ParsedFindQuery, options?: FindOptions): Promise<FindQueryResult>;
177
+ runRows(parsed: ParsedRowsQuery, options?: {
178
+ anchorNow?: number;
179
+ }): Promise<RowsQueryResult>;
180
+ run?(parsed: ParsedQuery, options?: QueryOptions): Promise<QueryResult>;
181
+ }
182
+
183
+ interface QueryBlockPreviewOptions {
184
+ executor?: QueryExecutor;
185
+ onResultSaved?: (callback: () => void) => (() => void) | void;
186
+ readOnly?: boolean;
187
+ onSaveQuery?: (sectionId: string, nextQuery: string) => void;
188
+ }
189
+ declare function saveBlockQuerySource(view: EditorView, sectionId: string, newQuery: string, queryIndex?: number): {
190
+ ok: boolean;
191
+ patchedContent?: string;
192
+ message?: string;
193
+ };
194
+ declare function findQueryBlockSection(view: EditorView, sectionId: string): EditorSection | null;
195
+ declare function queryBlockPreview(options?: QueryBlockPreviewOptions): Extension;
196
+
197
+ /** Parsed JSON object passed into a widget component. */
198
+ type WidgetConfig = Record<string, unknown>;
199
+ /** Props passed to every registered widget component. */
200
+ interface WidgetProps {
201
+ /** Parsed JSON object from the fenced widget body. */
202
+ config: WidgetConfig;
203
+ /** Exact source text between the opening and closing fences. */
204
+ rawContent: string;
205
+ /** Stable section identifier generated by section-state.ts. */
206
+ sectionId: string;
207
+ }
208
+ /** Registry of widget names to React components. */
209
+ type WidgetRegistry = Map<string, react.ComponentType<WidgetProps>>;
210
+ /** Effect to toggle edit mode for a specific widget block */
211
+ declare const toggleWidgetEdit: _codemirror_state.StateEffectType<{
212
+ sectionId: string;
213
+ editing: boolean;
214
+ }>;
215
+ /** StateField to track which widgets are currently being edited as raw text */
216
+ declare const editingWidgetsField: StateField<Set<string>>;
217
+ /**
218
+ * Create a CM6 Extension that replaces widget fenced blocks with React components.
219
+ * Block decorations MUST come from a StateField (not a ViewPlugin) per CM6 constraints.
220
+ */
221
+ declare function widgetBlockPreview(registry: WidgetRegistry): Extension;
222
+
223
+ interface EditorPresetOptions {
224
+ dialect?: 'wod' | 'whiteboard' | 'wql' | 'markdown' | string;
225
+ isDark?: boolean;
226
+ readOnly?: boolean;
227
+ lineNumbers?: boolean;
228
+ lineWrapping?: boolean;
229
+ executor?: QueryExecutor;
230
+ onResultSaved?: (callback: () => void) => (() => void) | void;
231
+ extensions?: Extension[];
232
+ }
233
+ declare function editorPreset(optionsOrDialect?: string | EditorPresetOptions): Extension[];
234
+
235
+ 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 };
@@ -0,0 +1,235 @@
1
+ import * as _codemirror_state from '@codemirror/state';
2
+ import { Extension, Facet, EditorState, StateField } from '@codemirror/state';
3
+ import { ViewPlugin, DecorationSet, ViewUpdate, EditorView, Decoration, WidgetType } from '@codemirror/view';
4
+ import { Diagnostic } from '@codemirror/lint';
5
+ import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
6
+ import { ScriptBlock, ICodeStatement, IMetric } from '@bitcobblers/wod-wiki-core';
7
+ import { QueryOptions, QueryResult, ParsedFindQuery, FindOptions, FindQueryResult, ParsedRowsQuery, RowsQueryResult, ParsedQuery } from '@bitcobblers/wod-wiki-wql';
8
+ import * as react from 'react';
9
+
10
+ declare function editorTheme(isDark: boolean): Extension;
11
+
12
+ /**
13
+ * Extension that adds ID attributes to line elements in the editor.
14
+ */
15
+ declare const lineIdsExtension: ViewPlugin<{
16
+ decorations: DecorationSet;
17
+ update(update: ViewUpdate): void;
18
+ getDecorations(view: EditorView): _codemirror_state.RangeSet<Decoration>;
19
+ }, undefined>;
20
+
21
+ type NavigationHook = (url: string, view: EditorView) => void;
22
+ declare const navigationFacet: Facet<NavigationHook, NavigationHook | null>;
23
+ declare function urlAtPos(view: EditorView, pos: number): string | null;
24
+ declare const linkOpen: Extension;
25
+
26
+ declare function findWorkoutErrors(content: string, offsetInDoc: number): Diagnostic[];
27
+ declare function workoutLintSource(view: EditorView): Diagnostic[];
28
+ declare const wodLinter: _codemirror_state.Extension;
29
+
30
+ declare function fenceCompletion(context: CompletionContext): CompletionResult | null;
31
+ declare function wrapInTimeFence(view: EditorView): boolean;
32
+ declare function handleFenceAutoWrap(event: InputEvent, view: EditorView): boolean;
33
+ declare const wodAutoWrap: Extension;
34
+ declare const wodEditorKeymap: Extension;
35
+ declare const wodAutocompletion: Extension;
36
+
37
+ type EditorDialect = "time" | "log";
38
+ type EditorSectionType = "markdown" | "time" | "log" | "frontmatter" | "code" | "widget" | "embed" | "query";
39
+ type EditorSectionSubtype = "heading" | "paragraph" | "list" | "blockquote" | "table" | "unknown";
40
+ type EmbedType = "image" | "link" | "youtube";
41
+ interface EditorSection {
42
+ id: string;
43
+ type: EditorSectionType;
44
+ subtype?: EditorSectionSubtype;
45
+ from: number;
46
+ to: number;
47
+ startLine: number;
48
+ endLine: number;
49
+ contentFrom?: number;
50
+ contentTo?: number;
51
+ sport?: string;
52
+ widgetName?: string;
53
+ contentId?: string;
54
+ queryType?: string;
55
+ queryError?: string;
56
+ embed?: {
57
+ type: EmbedType;
58
+ url: string;
59
+ label: string;
60
+ videoId?: string;
61
+ height?: number;
62
+ };
63
+ }
64
+ interface SectionState {
65
+ sections: EditorSection[];
66
+ }
67
+ declare const forceSectionParse: _codemirror_state.StateEffectType<null>;
68
+ declare function blockContentId(content: string): string;
69
+ declare const sectionField: StateField<SectionState>;
70
+ declare function sectionAtPos(state: EditorState, pos: number): EditorSection | null;
71
+ declare function activeCursorSection(state: EditorState): EditorSection | null;
72
+
73
+ interface SectionRect {
74
+ sectionId: string;
75
+ top: number;
76
+ height: number;
77
+ type: EditorSection["type"];
78
+ subtype?: EditorSection["subtype"];
79
+ widgetName?: string;
80
+ }
81
+ type GeometryListener = (rects: SectionRect[], docVersion: number) => void;
82
+ declare class SectionGeometryPlugin {
83
+ private view;
84
+ rects: SectionRect[];
85
+ docVersion: number;
86
+ private listeners;
87
+ constructor(view: EditorView);
88
+ update(update: ViewUpdate): void;
89
+ addListener(fn: GeometryListener): () => void;
90
+ private measure;
91
+ private notify;
92
+ destroy(): void;
93
+ }
94
+ declare const sectionGeometry: ViewPlugin<SectionGeometryPlugin, undefined>;
95
+
96
+ declare const previewDecorations: Extension;
97
+
98
+ declare const embedPreviewDecorations: Extension;
99
+
100
+ declare class DefaultFrontmatterWidget extends WidgetType {
101
+ readonly props: Record<string, string>;
102
+ constructor(props: Record<string, string>);
103
+ eq(other: DefaultFrontmatterWidget): boolean;
104
+ toDOM(): HTMLElement;
105
+ }
106
+ declare const frontmatterPreviewField: StateField<DecorationSet>;
107
+ declare const frontmatterPreview: Extension;
108
+
109
+ declare function markdownSyntaxHiding(): Extension;
110
+
111
+ declare const markdownTablePreview: Extension;
112
+
113
+ declare const setGutterHighlights: _codemirror_state.StateEffectType<Set<number>>;
114
+ declare const gutterHighlightsField: StateField<Set<number>>;
115
+ declare const gutterUnified: (_codemirror_state.Extension | StateField<Set<number>>)[];
116
+ declare function dispatchGutterHighlights(view: EditorView, lineNumbers: number[]): void;
117
+
118
+ type ButtonAction = (action: string, params: Record<string, string>) => void;
119
+ declare function inlineButtonDecoration(onAction: ButtonAction): Extension;
120
+
121
+ interface RuntimePanelEntry {
122
+ sectionId: string;
123
+ block: ScriptBlock;
124
+ afterPos: number;
125
+ expanded?: boolean;
126
+ }
127
+ declare const addRuntimePanel: _codemirror_state.StateEffectType<RuntimePanelEntry>;
128
+ declare const removeRuntimePanel: _codemirror_state.StateEffectType<{
129
+ sectionId: string;
130
+ }>;
131
+ declare const expandRuntimePanel: _codemirror_state.StateEffectType<{
132
+ sectionId: string;
133
+ expanded: boolean;
134
+ }>;
135
+ declare const runtimePanelField: StateField<Map<string, RuntimePanelEntry>>;
136
+ declare function dispatchAddRuntimePanel(view: EditorView, sectionId: string, block: ScriptBlock, afterPos: number, expanded?: boolean): void;
137
+ declare function dispatchRemoveRuntimePanel(view: EditorView, sectionId: string): void;
138
+ declare function dispatchExpandRuntimePanel(view: EditorView, sectionId: string, expanded: boolean): void;
139
+
140
+ declare function sessionQueryWql(resultId: string): string;
141
+ declare function sessionQueryInsert(state: EditorState, blockId: string, resultId: string, runBlock?: {
142
+ id?: string;
143
+ contentId?: string;
144
+ }): {
145
+ from: number;
146
+ insert: string;
147
+ } | null;
148
+
149
+ declare const smartIncrement: Extension;
150
+
151
+ interface OverlayAction {
152
+ label: string;
153
+ icon: string;
154
+ action: (view: EditorView, section: EditorSection) => void;
155
+ }
156
+ declare function configureOverlayActions(actions: OverlayAction[]): void;
157
+ declare function getOverlayActions(): OverlayAction[];
158
+ declare const wodOverlayPanel: Extension;
159
+
160
+ interface CursorFocusState {
161
+ sectionId: string;
162
+ section: EditorSection;
163
+ lineFrom: number;
164
+ docLine: number;
165
+ statementIndex: number;
166
+ statement: ICodeStatement;
167
+ focusedMetric: IMetric | null;
168
+ focusedMetricIndex: number;
169
+ allStatements: ICodeStatement[];
170
+ }
171
+ declare function getCursorFocusState(state: EditorState): CursorFocusState | null;
172
+ declare const cursorFocusExtension: Extension;
173
+
174
+ interface QueryExecutor {
175
+ runQuery(query: string, options?: QueryOptions): Promise<QueryResult>;
176
+ runFind(parsed: ParsedFindQuery, options?: FindOptions): Promise<FindQueryResult>;
177
+ runRows(parsed: ParsedRowsQuery, options?: {
178
+ anchorNow?: number;
179
+ }): Promise<RowsQueryResult>;
180
+ run?(parsed: ParsedQuery, options?: QueryOptions): Promise<QueryResult>;
181
+ }
182
+
183
+ interface QueryBlockPreviewOptions {
184
+ executor?: QueryExecutor;
185
+ onResultSaved?: (callback: () => void) => (() => void) | void;
186
+ readOnly?: boolean;
187
+ onSaveQuery?: (sectionId: string, nextQuery: string) => void;
188
+ }
189
+ declare function saveBlockQuerySource(view: EditorView, sectionId: string, newQuery: string, queryIndex?: number): {
190
+ ok: boolean;
191
+ patchedContent?: string;
192
+ message?: string;
193
+ };
194
+ declare function findQueryBlockSection(view: EditorView, sectionId: string): EditorSection | null;
195
+ declare function queryBlockPreview(options?: QueryBlockPreviewOptions): Extension;
196
+
197
+ /** Parsed JSON object passed into a widget component. */
198
+ type WidgetConfig = Record<string, unknown>;
199
+ /** Props passed to every registered widget component. */
200
+ interface WidgetProps {
201
+ /** Parsed JSON object from the fenced widget body. */
202
+ config: WidgetConfig;
203
+ /** Exact source text between the opening and closing fences. */
204
+ rawContent: string;
205
+ /** Stable section identifier generated by section-state.ts. */
206
+ sectionId: string;
207
+ }
208
+ /** Registry of widget names to React components. */
209
+ type WidgetRegistry = Map<string, react.ComponentType<WidgetProps>>;
210
+ /** Effect to toggle edit mode for a specific widget block */
211
+ declare const toggleWidgetEdit: _codemirror_state.StateEffectType<{
212
+ sectionId: string;
213
+ editing: boolean;
214
+ }>;
215
+ /** StateField to track which widgets are currently being edited as raw text */
216
+ declare const editingWidgetsField: StateField<Set<string>>;
217
+ /**
218
+ * Create a CM6 Extension that replaces widget fenced blocks with React components.
219
+ * Block decorations MUST come from a StateField (not a ViewPlugin) per CM6 constraints.
220
+ */
221
+ declare function widgetBlockPreview(registry: WidgetRegistry): Extension;
222
+
223
+ interface EditorPresetOptions {
224
+ dialect?: 'wod' | 'whiteboard' | 'wql' | 'markdown' | string;
225
+ isDark?: boolean;
226
+ readOnly?: boolean;
227
+ lineNumbers?: boolean;
228
+ lineWrapping?: boolean;
229
+ executor?: QueryExecutor;
230
+ onResultSaved?: (callback: () => void) => (() => void) | void;
231
+ extensions?: Extension[];
232
+ }
233
+ declare function editorPreset(optionsOrDialect?: string | EditorPresetOptions): Extension[];
234
+
235
+ 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 };
package/dist/index.cjs CHANGED
@@ -10771,13 +10771,13 @@ function editorPreset(optionsOrDialect = "markdown") {
10771
10771
  }
10772
10772
 
10773
10773
  // src/version.ts
10774
- var VERSION = "0.4.24";
10775
- var GIT_SHA = "90d86de";
10776
- var BUILD_TIME = "2026-08-18T20:19:27.340Z";
10774
+ var VERSION = "0.5.28";
10775
+ var GIT_SHA = "8aaaba1";
10776
+ var BUILD_TIME = "2026-08-18T20:49:38.789Z";
10777
10777
  var SEMVER = {
10778
- version: "0.4.24",
10779
- gitSha: "90d86de",
10780
- buildTime: "2026-08-18T20:19:27.340Z"
10778
+ version: "0.5.28",
10779
+ gitSha: "8aaaba1",
10780
+ buildTime: "2026-08-18T20:49:38.789Z"
10781
10781
  };
10782
10782
 
10783
10783
  exports.AGG_OPTIONS = AGG_OPTIONS;