@bitcobblers/wod-wiki-ui 0.59.2236 → 0.59.2240

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.
@@ -793,14 +793,14 @@ var FENCE_TAGS = [
793
793
  var SLASH_COMMANDS = [
794
794
  {
795
795
  label: "/time",
796
- detail: "Timer workout block",
796
+ detail: "Timer block (```time fence)",
797
797
  type: "keyword",
798
798
  apply: autocomplete.snippet("```time\n${10:00 Run}\n```"),
799
799
  boost: 95
800
800
  },
801
801
  {
802
802
  label: "/wod",
803
- detail: "Timer workout block",
803
+ detail: "Alias for /time (```time fence)",
804
804
  type: "keyword",
805
805
  apply: autocomplete.snippet("```time\n${10:00 Run}\n```"),
806
806
  boost: 94
@@ -11849,13 +11849,27 @@ function saveWidgetSource(view, sectionId, markdown2) {
11849
11849
  message: "Unable to locate widget source in the editor."
11850
11850
  };
11851
11851
  }
11852
- view.dispatch({
11853
- changes: {
11854
- from: section.contentFrom,
11855
- to: section.contentTo,
11856
- insert: normalizeWidgetMarkdown(markdown2)
11852
+ const dispatchChange = () => {
11853
+ if (view.state.readOnly) return;
11854
+ const latest = findWidgetSection(view, sectionId);
11855
+ if (!latest || latest.contentFrom == null || latest.contentTo == null) return;
11856
+ view.dispatch({
11857
+ changes: {
11858
+ from: latest.contentFrom,
11859
+ to: latest.contentTo,
11860
+ insert: normalizeWidgetMarkdown(markdown2)
11861
+ }
11862
+ });
11863
+ };
11864
+ try {
11865
+ dispatchChange();
11866
+ } catch (err) {
11867
+ if (err instanceof Error && /update.*in progress/i.test(err.message)) {
11868
+ queueMicrotask(dispatchChange);
11869
+ } else {
11870
+ throw err;
11857
11871
  }
11858
- });
11872
+ }
11859
11873
  return parsed;
11860
11874
  }
11861
11875
  function renderMissingWidget(widgetName) {