@bitcobblers/wod-wiki-ui 0.44.2156 → 0.44.2159

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,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, frontmatterReferenceIndex, frontmatterSuggestions, frontmatterVisibility, getCursorFocusState, getOverlayActions, gutterHighlightsField, gutterUnified, handleFenceAutoWrap, inlineButtonDecoration, lineIdsExtension, linkOpen, linkPreview, markdownSyntaxHiding, markdownTablePreview, navigationFacet, previewDecorations, queryBlockPreview, referenceIndexReload, registerCustomCompletionSource, registeredSectionWidgets, removeRuntimePanel, runtimePanelField, saveBlockQuerySource, sectionAtPos, sectionField, sectionGeometry, sectionIdentity, sectionIdentityHistory, sectionMove, sectionRestore, sectionSaved, sessionQueryInsert, sessionQueryWql, setGutterHighlights, smartIncrement, toggleWidgetEdit, unregisterCustomCompletionSource, urlAtPos, widgetBlockPreview, wodAutoWrap, wodAutocompletion, wodEditorKeymap, wodLinter, wodOverlayPanel, workoutLintSource, wrapInTimeFence } from '../chunk-NQMMGF3R.mjs';
1
+ export { DefaultFrontmatterWidget, activeCursorSection, addRuntimePanel, blockContentId, configureOverlayActions, cursorFocusExtension, dispatchAddRuntimePanel, dispatchExpandRuntimePanel, dispatchGutterHighlights, dispatchRemoveRuntimePanel, editingWidgetsField, editorPreset, editorTheme, embedPreviewDecorations, expandRuntimePanel, fenceCompletion, findQueryBlockSection, findWorkoutErrors, forceSectionParse, frontmatterPreview, frontmatterPreviewField, frontmatterReferenceIndex, frontmatterSuggestions, frontmatterVisibility, getCursorFocusState, getOverlayActions, gutterHighlightsField, gutterUnified, handleFenceAutoWrap, inlineButtonDecoration, lineIdsExtension, linkOpen, linkPreview, markdownSyntaxHiding, markdownTablePreview, navigationFacet, previewDecorations, queryBlockPreview, referenceIndexReload, registerCustomCompletionSource, registeredSectionWidgets, removeRuntimePanel, runtimePanelField, saveBlockQuerySource, sectionAtPos, sectionField, sectionGeometry, sectionIdentity, sectionIdentityHistory, sectionMove, sectionRestore, sectionSaved, sessionQueryInsert, sessionQueryWql, setGutterHighlights, smartIncrement, toggleWidgetEdit, unregisterCustomCompletionSource, urlAtPos, widgetBlockPreview, wodAutoWrap, wodAutocompletion, wodEditorKeymap, wodLinter, wodOverlayPanel, workoutLintSource, wrapInTimeFence } from '../chunk-7OSBFQY7.mjs';
2
2
  //# sourceMappingURL=index.mjs.map
3
3
  //# sourceMappingURL=index.mjs.map
package/dist/index.cjs CHANGED
@@ -5489,15 +5489,22 @@ var embedPreviewDecorations = [
5489
5489
  var POPOVER_MIN_WIDTH = 192;
5490
5490
  var POPOVER_MAX_WIDTH = 320;
5491
5491
  var POPOVER_MAX_HEIGHT = 256;
5492
- function computeInlinePanelBox(field, host, viewportHeight) {
5493
- const offsetLeft = Math.max(0, Math.min(field.left - host.left, Math.max(0, host.width - POPOVER_MIN_WIDTH)));
5494
- const room = Math.max(host.width - offsetLeft, POPOVER_MIN_WIDTH);
5495
- const width = Math.min(Math.max(field.width, POPOVER_MIN_WIDTH), POPOVER_MAX_WIDTH, room);
5496
- const belowField = Math.max(0, viewportHeight - field.top - 64);
5492
+ var POPOVER_GAP = 8;
5493
+ function computeFloatingPlacement(field, viewport, panelHeight, avoid, gap = POPOVER_GAP) {
5494
+ const width = Math.min(Math.max(field.width, POPOVER_MIN_WIDTH), POPOVER_MAX_WIDTH);
5495
+ const height = Math.min(Math.max(panelHeight, 0), POPOVER_MAX_HEIGHT);
5496
+ const below = { top: field.bottom + gap, bottom: field.bottom + gap + height };
5497
+ const above = { top: field.top - gap - height};
5498
+ const fitsBelow = below.bottom <= viewport.height;
5499
+ const fitsAbove = above.top >= 0;
5500
+ const coversActions = avoid ? below.bottom > avoid.top && below.top < avoid.bottom : false;
5501
+ const placement = (coversActions || !fitsBelow) && fitsAbove ? "above" : "below";
5502
+ const chosen = placement === "below" ? below : above;
5497
5503
  return {
5504
+ left: Math.min(Math.max(gap, field.left), Math.max(gap, viewport.width - width - gap)),
5505
+ top: Math.min(Math.max(gap, chosen.top), Math.max(gap, viewport.height - height - gap)),
5498
5506
  width,
5499
- offsetLeft,
5500
- maxHeight: Math.max(96, Math.min(POPOVER_MAX_HEIGHT, belowField))
5507
+ placement
5501
5508
  };
5502
5509
  }
5503
5510
  var panelId = 0;
@@ -5505,8 +5512,7 @@ var SuggestionPanel = class {
5505
5512
  element;
5506
5513
  inputElement;
5507
5514
  onPick;
5508
- view;
5509
- host;
5515
+ avoid;
5510
5516
  listId;
5511
5517
  currentChoices = [];
5512
5518
  currentIndex = -1;
@@ -5514,18 +5520,17 @@ var SuggestionPanel = class {
5514
5520
  constructor(input, options) {
5515
5521
  this.inputElement = input;
5516
5522
  this.onPick = options.onPick;
5517
- this.view = options.view;
5518
- this.host = options.host;
5523
+ this.avoid = options.avoid;
5519
5524
  this.listId = `frontmatter-suggestions-${++panelId}`;
5520
5525
  const list = document.createElement("div");
5521
5526
  list.id = this.listId;
5522
5527
  list.setAttribute("role", "listbox");
5523
5528
  list.setAttribute("aria-label", options.label);
5524
5529
  list.tabIndex = -1;
5525
- list.className = "mt-1 overflow-auto rounded-md border border-border bg-popover text-popover-foreground shadow-md text-xs";
5530
+ list.className = "fixed z-[60] max-h-64 overflow-auto rounded-md border border-border bg-popover text-popover-foreground shadow-md text-xs";
5526
5531
  list.hidden = true;
5527
5532
  this.element = list;
5528
- this.attach();
5533
+ document.body.appendChild(list);
5529
5534
  input.setAttribute("role", "combobox");
5530
5535
  input.setAttribute("aria-haspopup", "listbox");
5531
5536
  input.setAttribute("aria-autocomplete", "list");
@@ -5559,10 +5564,10 @@ var SuggestionPanel = class {
5559
5564
  if (this.isOpen) return;
5560
5565
  this.isOpen = true;
5561
5566
  this.element.hidden = false;
5562
- this.attach();
5563
5567
  this.position();
5564
5568
  this.inputElement.setAttribute("aria-expanded", "true");
5565
- this.view.requestMeasure();
5569
+ window.addEventListener("scroll", this.handleViewportChange, true);
5570
+ window.addEventListener("resize", this.handleViewportChange);
5566
5571
  }
5567
5572
  close() {
5568
5573
  if (!this.isOpen) return;
@@ -5571,10 +5576,12 @@ var SuggestionPanel = class {
5571
5576
  this.currentIndex = -1;
5572
5577
  this.inputElement.setAttribute("aria-expanded", "false");
5573
5578
  this.inputElement.removeAttribute("aria-activedescendant");
5574
- this.view.requestMeasure();
5579
+ window.removeEventListener("scroll", this.handleViewportChange, true);
5580
+ window.removeEventListener("resize", this.handleViewportChange);
5575
5581
  }
5576
5582
  destroy() {
5577
5583
  this.close();
5584
+ this.element.remove();
5578
5585
  }
5579
5586
  activate(index) {
5580
5587
  this.currentIndex = index;
@@ -5602,21 +5609,31 @@ var SuggestionPanel = class {
5602
5609
  this.close();
5603
5610
  this.onPick(choice);
5604
5611
  }
5605
- /** Join the DOM under its host row (idempotent). */
5606
- attach() {
5607
- if (this.element.parentElement) return;
5608
- this.host.after(this.element);
5609
- }
5610
- /** Anchor the panel to the field inside its row. */
5612
+ handleViewportChange = () => {
5613
+ if (this.isOpen) this.position();
5614
+ };
5615
+ /** Anchor the panel to the field, flipped away from the metadata actions. */
5611
5616
  position() {
5612
- const box = computeInlinePanelBox(
5613
- this.inputElement.getBoundingClientRect(),
5614
- this.host.getBoundingClientRect(),
5615
- window.innerHeight
5617
+ const field = this.inputElement.getBoundingClientRect();
5618
+ const avoidElement = this.avoid?.() ?? null;
5619
+ const avoidRect = avoidElement?.getBoundingClientRect();
5620
+ const height = Math.min(this.element.scrollHeight, POPOVER_MAX_HEIGHT);
5621
+ const placement = computeFloatingPlacement(
5622
+ { top: field.top, bottom: field.bottom, left: field.left, width: field.width },
5623
+ { width: window.innerWidth, height: window.innerHeight },
5624
+ height,
5625
+ avoidRect ? {
5626
+ top: avoidRect.top,
5627
+ bottom: avoidRect.bottom,
5628
+ left: avoidRect.left,
5629
+ right: avoidRect.right
5630
+ } : void 0
5616
5631
  );
5617
- this.element.style.width = `${box.width}px`;
5618
- this.element.style.marginLeft = `${box.offsetLeft}px`;
5619
- this.element.style.maxHeight = `${box.maxHeight}px`;
5632
+ this.element.style.width = `${placement.width}px`;
5633
+ this.element.style.maxHeight = `${height}px`;
5634
+ this.element.style.left = `${placement.left}px`;
5635
+ this.element.style.top = `${placement.top}px`;
5636
+ this.element.dataset.placement = placement.placement;
5620
5637
  }
5621
5638
  };
5622
5639
 
@@ -5664,12 +5681,12 @@ function ensureColumnHeader(box, before) {
5664
5681
  function attachSuggestions(input, view, root, kind, key, excluded, commit, valueKind = "tags") {
5665
5682
  const provider = view.state.facet(frontmatterSuggestions);
5666
5683
  if (!provider || !input.parentElement) return;
5667
- const host = input.closest("[data-frontmatter-row]") ?? input.parentElement;
5668
5684
  const panel = new SuggestionPanel(input, {
5669
5685
  label: kind === "key" ? "Suggested properties" : suggestionListLabel(valueKind),
5670
5686
  onPick: () => commit(),
5671
- view,
5672
- host
5687
+ // The popup floats over the properties panel; it must never cover the
5688
+ // metadata actions below it.
5689
+ avoid: () => root.querySelector("[data-frontmatter-actions]")
5673
5690
  });
5674
5691
  let generation = 0;
5675
5692
  const close = () => {
@@ -6444,9 +6461,10 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
6444
6461
  box.appendChild(this.buildDefinitionRows(view, base));
6445
6462
  }
6446
6463
  if (!this.readOnly) {
6447
- const existingTagKey = entries.find(([key]) => isTagProperty(key))?.[0];
6464
+ const existingTagKey = entries.find(([key]) => key.trim().toLowerCase() === "tags")?.[0] ?? entries.find(([key]) => isTagProperty(key))?.[0];
6448
6465
  const actionsRow = document.createElement("div");
6449
6466
  actionsRow.className = "mt-2 flex items-center gap-3";
6467
+ actionsRow.dataset.frontmatterActions = "true";
6450
6468
  const addBtn = document.createElement("button");
6451
6469
  addBtn.type = "button";
6452
6470
  addBtn.setAttribute("aria-label", "Add property");
@@ -6519,9 +6537,9 @@ var DefaultFrontmatterWidget = class extends view.WidgetType {
6519
6537
  existingDraft.focus();
6520
6538
  return;
6521
6539
  }
6522
- const draftRow = createTagDraftRow(view, root, "tags", (val) => {
6523
- pendingFocus.set(view, { kind: "tag", key: "tags" });
6524
- patchPropertyInView(view, this.sectionId, ["tags"], [val]);
6540
+ const draftRow = createTagDraftRow(view, root, "category", (val) => {
6541
+ pendingFocus.set(view, { kind: "tag", key: "category" });
6542
+ patchPropertyInView(view, this.sectionId, ["category"], [val]);
6525
6543
  });
6526
6544
  box.appendChild(draftRow);
6527
6545
  draftRow.querySelector("input")?.focus();
@@ -6650,6 +6668,7 @@ var EmptyFrontmatterWidget = class extends view.WidgetType {
6650
6668
  root.appendChild(heading);
6651
6669
  const actionsRow = document.createElement("div");
6652
6670
  actionsRow.className = "flex items-center gap-3";
6671
+ actionsRow.dataset.frontmatterActions = "true";
6653
6672
  const addBtn = document.createElement("button");
6654
6673
  addBtn.type = "button";
6655
6674
  addBtn.setAttribute("aria-label", "Add property");
@@ -6681,9 +6700,9 @@ var EmptyFrontmatterWidget = class extends view.WidgetType {
6681
6700
  existingDraft.focus();
6682
6701
  return;
6683
6702
  }
6684
- const draftRow = createTagDraftRow(view, root, "tags", (val) => {
6685
- pendingFocus.set(view, { kind: "tag", key: "tags" });
6686
- patchPropertyInView(view, "new", ["tags"], [val]);
6703
+ const draftRow = createTagDraftRow(view, root, "category", (val) => {
6704
+ pendingFocus.set(view, { kind: "tag", key: "category" });
6705
+ patchPropertyInView(view, "new", ["category"], [val]);
6687
6706
  });
6688
6707
  root.appendChild(draftRow);
6689
6708
  ensureColumnHeader(root, draftRow);
@@ -13529,13 +13548,13 @@ function editorPreset(optionsOrDialect = "markdown") {
13529
13548
  }
13530
13549
 
13531
13550
  // src/version.ts
13532
- var VERSION = "0.44.2156";
13533
- var GIT_SHA = "35e3c00";
13534
- var BUILD_TIME = "2026-10-24T21:01:52.101Z";
13551
+ var VERSION = "0.44.2159";
13552
+ var GIT_SHA = "30e43c7";
13553
+ var BUILD_TIME = "2026-10-24T23:07:22.311Z";
13535
13554
  var SEMVER = {
13536
- version: "0.44.2156",
13537
- gitSha: "35e3c00",
13538
- buildTime: "2026-10-24T21:01:52.101Z"
13555
+ version: "0.44.2159",
13556
+ gitSha: "30e43c7",
13557
+ buildTime: "2026-10-24T23:07:22.311Z"
13539
13558
  };
13540
13559
 
13541
13560
  Object.defineProperty(exports, "CONTENT_GROUPING_DIMENSIONS", {