@bitcobblers/wod-wiki-ui 0.5.29 → 0.6.31

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,4 +1,4 @@
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';
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-B8_9uGBX.cjs';
2
2
  import '@codemirror/state';
3
3
  import '@codemirror/view';
4
4
  import '@codemirror/lint';
@@ -1,4 +1,4 @@
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';
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-B8_9uGBX.js';
2
2
  import '@codemirror/state';
3
3
  import '@codemirror/view';
4
4
  import '@codemirror/lint';
@@ -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-HRROD36H.mjs';
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-V2JNLN54.mjs';
2
2
  //# sourceMappingURL=index.mjs.map
3
3
  //# sourceMappingURL=index.mjs.map
@@ -84,6 +84,7 @@ declare class SectionGeometryPlugin {
84
84
  rects: SectionRect[];
85
85
  docVersion: number;
86
86
  private listeners;
87
+ private pendingNotify;
87
88
  constructor(view: EditorView);
88
89
  update(update: ViewUpdate): void;
89
90
  addListener(fn: GeometryListener): () => void;
@@ -84,6 +84,7 @@ declare class SectionGeometryPlugin {
84
84
  rects: SectionRect[];
85
85
  docVersion: number;
86
86
  private listeners;
87
+ private pendingNotify;
87
88
  constructor(view: EditorView);
88
89
  update(update: ViewUpdate): void;
89
90
  addListener(fn: GeometryListener): () => void;
package/dist/index.cjs CHANGED
@@ -3959,11 +3959,12 @@ var SectionGeometryPlugin = class {
3959
3959
  rects = [];
3960
3960
  docVersion = 0;
3961
3961
  listeners = /* @__PURE__ */ new Set();
3962
+ pendingNotify = null;
3962
3963
  update(update) {
3963
3964
  if (update.docChanged) {
3964
3965
  this.docVersion++;
3965
3966
  }
3966
- if (update.docChanged || update.viewportChanged || update.geometryChanged) {
3967
+ if (update.docChanged || update.geometryChanged) {
3967
3968
  this.measure();
3968
3969
  }
3969
3970
  }
@@ -3978,18 +3979,19 @@ var SectionGeometryPlugin = class {
3978
3979
  try {
3979
3980
  const sectionState = this.view.state.field(sectionField, false);
3980
3981
  const sections = sectionState?.sections ?? [];
3981
- const scrollRect = this.view.scrollDOM?.getBoundingClientRect ? this.view.scrollDOM.getBoundingClientRect() : { top: 0, left: 0, bottom: 0, right: 0 };
3982
- const scrollTop = this.view.scrollDOM?.scrollTop ?? 0;
3982
+ const docLength = this.view.state.doc.length;
3983
3983
  this.rects = sections.map((sec) => {
3984
- let fromCoords = null;
3985
- let toCoords = null;
3984
+ const from = Math.max(0, Math.min(sec.from, docLength));
3985
+ const to = Math.max(0, Math.min(sec.to, docLength));
3986
+ let top = 0;
3987
+ let bottom = 20;
3986
3988
  try {
3987
- fromCoords = this.view.coordsAtPos ? this.view.coordsAtPos(sec.from) : null;
3988
- toCoords = this.view.coordsAtPos ? this.view.coordsAtPos(sec.to) : null;
3989
+ const topBlock = this.view.lineBlockAt(from);
3990
+ const bottomBlock = this.view.lineBlockAt(to);
3991
+ top = topBlock.top;
3992
+ bottom = bottomBlock.top + bottomBlock.height;
3989
3993
  } catch {
3990
3994
  }
3991
- const top = fromCoords ? fromCoords.top - (scrollRect?.top ?? 0) + scrollTop : 0;
3992
- const bottom = toCoords ? toCoords.bottom - (scrollRect?.top ?? 0) + scrollTop : top;
3993
3995
  const height = Math.max(bottom - top, 20);
3994
3996
  return {
3995
3997
  sectionId: sec.id,
@@ -4005,11 +4007,24 @@ var SectionGeometryPlugin = class {
4005
4007
  }
4006
4008
  }
4007
4009
  notify() {
4008
- for (const listener of this.listeners) {
4009
- listener(this.rects, this.docVersion);
4010
+ if (typeof requestAnimationFrame === "function") {
4011
+ if (this.pendingNotify !== null) return;
4012
+ this.pendingNotify = requestAnimationFrame(() => {
4013
+ this.pendingNotify = null;
4014
+ for (const listener of this.listeners) {
4015
+ listener(this.rects, this.docVersion);
4016
+ }
4017
+ });
4018
+ } else {
4019
+ for (const listener of this.listeners) {
4020
+ listener(this.rects, this.docVersion);
4021
+ }
4010
4022
  }
4011
4023
  }
4012
4024
  destroy() {
4025
+ if (this.pendingNotify !== null && typeof cancelAnimationFrame === "function") {
4026
+ cancelAnimationFrame(this.pendingNotify);
4027
+ }
4013
4028
  this.listeners.clear();
4014
4029
  }
4015
4030
  };
@@ -10771,13 +10786,13 @@ function editorPreset(optionsOrDialect = "markdown") {
10771
10786
  }
10772
10787
 
10773
10788
  // src/version.ts
10774
- var VERSION = "0.5.29";
10775
- var GIT_SHA = "d808ea1";
10776
- var BUILD_TIME = "2026-08-18T21:04:09.158Z";
10789
+ var VERSION = "0.6.31";
10790
+ var GIT_SHA = "d53a937";
10791
+ var BUILD_TIME = "2026-08-21T14:17:13.519Z";
10777
10792
  var SEMVER = {
10778
- version: "0.5.29",
10779
- gitSha: "d808ea1",
10780
- buildTime: "2026-08-18T21:04:09.158Z"
10793
+ version: "0.6.31",
10794
+ gitSha: "d53a937",
10795
+ buildTime: "2026-08-21T14:17:13.519Z"
10781
10796
  };
10782
10797
 
10783
10798
  exports.AGG_OPTIONS = AGG_OPTIONS;