@cloudvoyant/helical-ui 0.23.1 → 0.24.0

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 { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, F as CommandHighlightSegment, G as CommandLevelResolution, f as CommandMenuColumns, g as CommandMenuProps, H as CommandMenuResolution, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, I as announceCommandMessage, J as commandMenuDialogContentBase, L as commandMenuErrorBase, M as commandMenuInputVariants, N as commandMenuItemVariants, O as commandMenuListVariants, P as commandMenuPositionerBase, Q as commandMenuPrefixBase, R as commandMenuPromptBarVariants, r as commandMenuStyles, S as commandMenuVariants, T as commandPaletteBreadcrumbBase, U as commandPaletteDialogContentBase, V as commandPaletteFooterBase, W as commandPaletteHeaderBase, X as commandPaletteInputBase, Y as commandPaletteItemBase, Z as commandPaletteListBase, _ as commandPalettePositionerBase, s as commandPaletteStyles, $ as commandPaletteVariants, t as createCommandTree, a0 as formatCommandMenuCompletionInput, A as matchesCommandHotkey, a1 as resolveCommandLevel, a2 as resolveCommandMenuGridNavigation, a3 as resolveCommandMenuGridStyle, a4 as resolveCommandMenuState, a5 as shouldHandleCommandHotkey, a6 as splitHighlightSegments } from '../index-FoNHRG3R.cjs';
1
+ export { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, F as CommandHighlightSegment, G as CommandLevelResolution, f as CommandMenuColumns, g as CommandMenuProps, H as CommandMenuResolution, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, I as announceCommandMessage, J as commandMenuDialogContentBase, L as commandMenuErrorBase, M as commandMenuInputVariants, N as commandMenuItemVariants, O as commandMenuListVariants, P as commandMenuPositionerBase, Q as commandMenuPrefixBase, R as commandMenuPromptBarVariants, r as commandMenuStyles, S as commandMenuVariants, T as commandPaletteBreadcrumbBase, U as commandPaletteDialogContentBase, V as commandPaletteFooterBase, W as commandPaletteHeaderBase, X as commandPaletteInputBase, Y as commandPaletteItemBase, Z as commandPaletteListBase, _ as commandPalettePositionerBase, s as commandPaletteStyles, $ as commandPaletteVariants, t as createCommandTree, a0 as formatCommandMenuCompletionInput, A as matchesCommandHotkey, a1 as resolveCommandLevel, a2 as resolveCommandMenuGridNavigation, a3 as resolveCommandMenuGridStyle, a4 as resolveCommandMenuState, a5 as shouldHandleCommandHotkey, a6 as splitHighlightSegments } from '../index-C62JCLmF.cjs';
2
2
  import '@zag-js/collection';
3
3
  import 'class-variance-authority/types';
4
4
  import 'class-variance-authority';
@@ -1,4 +1,4 @@
1
- export { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, F as CommandHighlightSegment, G as CommandLevelResolution, f as CommandMenuColumns, g as CommandMenuProps, H as CommandMenuResolution, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, I as announceCommandMessage, J as commandMenuDialogContentBase, L as commandMenuErrorBase, M as commandMenuInputVariants, N as commandMenuItemVariants, O as commandMenuListVariants, P as commandMenuPositionerBase, Q as commandMenuPrefixBase, R as commandMenuPromptBarVariants, r as commandMenuStyles, S as commandMenuVariants, T as commandPaletteBreadcrumbBase, U as commandPaletteDialogContentBase, V as commandPaletteFooterBase, W as commandPaletteHeaderBase, X as commandPaletteInputBase, Y as commandPaletteItemBase, Z as commandPaletteListBase, _ as commandPalettePositionerBase, s as commandPaletteStyles, $ as commandPaletteVariants, t as createCommandTree, a0 as formatCommandMenuCompletionInput, A as matchesCommandHotkey, a1 as resolveCommandLevel, a2 as resolveCommandMenuGridNavigation, a3 as resolveCommandMenuGridStyle, a4 as resolveCommandMenuState, a5 as shouldHandleCommandHotkey, a6 as splitHighlightSegments } from '../index-FoNHRG3R.js';
1
+ export { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, F as CommandHighlightSegment, G as CommandLevelResolution, f as CommandMenuColumns, g as CommandMenuProps, H as CommandMenuResolution, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, I as announceCommandMessage, J as commandMenuDialogContentBase, L as commandMenuErrorBase, M as commandMenuInputVariants, N as commandMenuItemVariants, O as commandMenuListVariants, P as commandMenuPositionerBase, Q as commandMenuPrefixBase, R as commandMenuPromptBarVariants, r as commandMenuStyles, S as commandMenuVariants, T as commandPaletteBreadcrumbBase, U as commandPaletteDialogContentBase, V as commandPaletteFooterBase, W as commandPaletteHeaderBase, X as commandPaletteInputBase, Y as commandPaletteItemBase, Z as commandPaletteListBase, _ as commandPalettePositionerBase, s as commandPaletteStyles, $ as commandPaletteVariants, t as createCommandTree, a0 as formatCommandMenuCompletionInput, A as matchesCommandHotkey, a1 as resolveCommandLevel, a2 as resolveCommandMenuGridNavigation, a3 as resolveCommandMenuGridStyle, a4 as resolveCommandMenuState, a5 as shouldHandleCommandHotkey, a6 as splitHighlightSegments } from '../index-C62JCLmF.js';
2
2
  import '@zag-js/collection';
3
3
  import 'class-variance-authority/types';
4
4
  import 'class-variance-authority';
@@ -189,6 +189,8 @@ interface CommandMenuProps {
189
189
  noCommandsText?: string;
190
190
  /** Number of completion columns above the prompt bar. @default 'auto' */
191
191
  columns?: CommandMenuColumns;
192
+ /** Whether to display command aliases in the trailing slot of completion items. @default false */
193
+ showAliases?: boolean;
192
194
  /** Whether to display keyboard shortcut badges next to completion items. @default false */
193
195
  showShortcuts?: boolean;
194
196
  /** Compactness variant for the completion grid and prompt bar. @default 'md' */
@@ -189,6 +189,8 @@ interface CommandMenuProps {
189
189
  noCommandsText?: string;
190
190
  /** Number of completion columns above the prompt bar. @default 'auto' */
191
191
  columns?: CommandMenuColumns;
192
+ /** Whether to display command aliases in the trailing slot of completion items. @default false */
193
+ showAliases?: boolean;
192
194
  /** Whether to display keyboard shortcut badges next to completion items. @default false */
193
195
  showShortcuts?: boolean;
194
196
  /** Compactness variant for the completion grid and prompt bar. @default 'md' */
package/dist/index.cjs CHANGED
@@ -84,6 +84,7 @@ __export(index_exports, {
84
84
  codeBlockSpinnerBase: () => codeBlockSpinnerBase,
85
85
  codeBlockTitleBase: () => codeBlockTitleBase,
86
86
  colBase: () => colBase,
87
+ collectVisitedProxies: () => collectVisitedProxies,
87
88
  comboboxClearTriggerBase: () => comboboxClearTriggerBase,
88
89
  comboboxContentBase: () => comboboxContentBase,
89
90
  comboboxControlBase: () => comboboxControlBase,
@@ -2334,6 +2335,7 @@ __export(which_key_exports, {
2334
2335
  DEFAULT_JUMP_ALPHABET: () => DEFAULT_JUMP_ALPHABET,
2335
2336
  Jumplist: () => Jumplist,
2336
2337
  buildWhichKeyTree: () => buildWhichKeyTree,
2338
+ collectVisitedProxies: () => collectVisitedProxies,
2337
2339
  createHelixPreset: () => createHelixPreset,
2338
2340
  createJumplist: () => createJumplist,
2339
2341
  createKakounePreset: () => createKakounePreset,
@@ -2401,10 +2403,10 @@ function normalizeNodeModes(node) {
2401
2403
  }
2402
2404
  function getNodeChildren(node, rootTrie, visitedProxies = /* @__PURE__ */ new Set()) {
2403
2405
  let proxyChildren = {};
2406
+ const nextVisited = new Set(visitedProxies);
2404
2407
  if (node.proxy && node.proxy.length > 0) {
2405
2408
  const proxyKey = node.proxy.join(">");
2406
2409
  if (!visitedProxies.has(proxyKey)) {
2407
- const nextVisited = new Set(visitedProxies);
2408
2410
  nextVisited.add(proxyKey);
2409
2411
  const target = resolveNodeInternal(rootTrie, node.proxy, void 0, nextVisited, rootTrie);
2410
2412
  if (target) {
@@ -2413,25 +2415,60 @@ function getNodeChildren(node, rootTrie, visitedProxies = /* @__PURE__ */ new Se
2413
2415
  }
2414
2416
  }
2415
2417
  const expandedChildren = node.expand ? node.expand() : {};
2416
- return {
2418
+ const combined = {
2417
2419
  ...proxyChildren,
2418
2420
  ...expandedChildren,
2419
2421
  ...node.children ?? {}
2420
2422
  };
2423
+ if (nextVisited.size > 0) {
2424
+ for (const [childKey, childNode] of Object.entries(combined)) {
2425
+ if (childNode.proxy && childNode.proxy.length > 0 && nextVisited.has(childNode.proxy.join(">")) && !childNode.action && !childNode.commandId && !childNode.children && !childNode.expand) {
2426
+ delete combined[childKey];
2427
+ }
2428
+ }
2429
+ }
2430
+ return combined;
2431
+ }
2432
+ function collectVisitedProxies(rootTrie, path, proxyRootTrie = rootTrie) {
2433
+ const visited = /* @__PURE__ */ new Set();
2434
+ let currentMap = rootTrie;
2435
+ for (let i = 0; i < path.length; i += 1) {
2436
+ const step = path[i];
2437
+ if (!step) break;
2438
+ const stepPathKey = path.slice(0, i + 1).join(">");
2439
+ visited.add(stepPathKey);
2440
+ const candidate = currentMap[step];
2441
+ if (!candidate) break;
2442
+ if (i < path.length - 1) {
2443
+ currentMap = getNodeChildren(candidate, proxyRootTrie, visited);
2444
+ if (candidate.proxy && candidate.proxy.length > 0) {
2445
+ visited.add(candidate.proxy.join(">"));
2446
+ }
2447
+ }
2448
+ }
2449
+ return visited;
2421
2450
  }
2422
2451
  function resolveNodeInternal(rootTrie, path, mode, visitedProxies, proxyRootTrie = rootTrie) {
2423
2452
  if (path.length === 0) return null;
2424
2453
  let currentMap = rootTrie;
2425
2454
  let currentNode = null;
2455
+ const pathVisited = new Set(visitedProxies);
2426
2456
  for (let i = 0; i < path.length; i += 1) {
2427
2457
  const step = path[i];
2428
2458
  if (!step) return null;
2429
2459
  const candidate = currentMap[step];
2430
2460
  if (!candidate) return null;
2431
2461
  if (mode && !nodeMatchesMode(candidate, mode)) return null;
2462
+ if (candidate.proxy && candidate.proxy.length > 0 && pathVisited.has(candidate.proxy.join(">")) && !candidate.action && !candidate.commandId && !candidate.children && !candidate.expand) {
2463
+ return null;
2464
+ }
2432
2465
  currentNode = candidate;
2433
2466
  if (i < path.length - 1) {
2434
- currentMap = getNodeChildren(candidate, proxyRootTrie, visitedProxies);
2467
+ pathVisited.add(path.slice(0, i + 1).join(">"));
2468
+ currentMap = getNodeChildren(candidate, proxyRootTrie, pathVisited);
2469
+ if (candidate.proxy && candidate.proxy.length > 0) {
2470
+ pathVisited.add(candidate.proxy.join(">"));
2471
+ }
2435
2472
  }
2436
2473
  }
2437
2474
  return currentNode;
@@ -2439,8 +2476,8 @@ function resolveNodeInternal(rootTrie, path, mode, visitedProxies, proxyRootTrie
2439
2476
  function resolveNode(rootTrie, path, mode, proxyRootTrie = rootTrie) {
2440
2477
  return resolveNodeInternal(rootTrie, path, mode, /* @__PURE__ */ new Set(), proxyRootTrie);
2441
2478
  }
2442
- function isGroupNode(node, rootTrie) {
2443
- const children = getNodeChildren(node, rootTrie);
2479
+ function isGroupNode(node, rootTrie, visitedProxies = /* @__PURE__ */ new Set()) {
2480
+ const children = getNodeChildren(node, rootTrie, visitedProxies);
2444
2481
  return Object.keys(children).length > 0;
2445
2482
  }
2446
2483
  function formatWhichKeyLabel(label) {
@@ -2472,7 +2509,8 @@ function buildWhichKeyTree(rootTrie, activePath, mode) {
2472
2509
  sticky: false
2473
2510
  };
2474
2511
  }
2475
- const childrenMap = getNodeChildren(node, rootTrie);
2512
+ const visitedProxies = collectVisitedProxies(rootTrie, activePath);
2513
+ const childrenMap = getNodeChildren(node, rootTrie, visitedProxies);
2476
2514
  const items = Object.values(childrenMap).filter((item) => !item.hidden && nodeMatchesMode(item, mode));
2477
2515
  let sticky = Boolean(node.sticky || node.loop);
2478
2516
  if (!sticky && node.proxy && node.proxy.length > 0) {
@@ -2871,16 +2909,6 @@ function createWindowMenu() {
2871
2909
  description: "Cycle focus to the previous registered pane",
2872
2910
  category: "Window / Pane",
2873
2911
  commandId: "pane.prev"
2874
- },
2875
- s: {
2876
- key: "s",
2877
- label: "Sticky Window",
2878
- group: "Sticky Window Mode",
2879
- description: "Keep Window menu open until Escape",
2880
- category: "Window / Pane",
2881
- sticky: true,
2882
- loop: true,
2883
- proxy: ["Control+w"]
2884
2912
  }
2885
2913
  }
2886
2914
  };
@@ -4428,6 +4456,7 @@ function createWhichKeyController(options = {}) {
4428
4456
  let rawJumpTargets = [];
4429
4457
  let statusMessage = "";
4430
4458
  let programmaticFocusDepth = 0;
4459
+ let lastEnterActivatedButton = null;
4431
4460
  let liveRegion = null;
4432
4461
  let detachCleanups = [];
4433
4462
  function resolveDoc() {
@@ -4508,9 +4537,10 @@ function createWhichKeyController(options = {}) {
4508
4537
  return trie;
4509
4538
  }
4510
4539
  function syncPaneActiveAttributes() {
4540
+ const hasMultiplePanes = getOrderedPanes().length > 1;
4511
4541
  for (const pane of panes.values()) {
4512
4542
  if (pane.element && typeof pane.element.setAttribute === "function") {
4513
- pane.element.setAttribute("data-pane-active", pane.id === activePaneId ? "true" : "false");
4543
+ pane.element.setAttribute("data-pane-active", hasMultiplePanes && pane.id === activePaneId ? "true" : "false");
4514
4544
  }
4515
4545
  }
4516
4546
  }
@@ -5237,41 +5267,78 @@ function createWhichKeyController(options = {}) {
5237
5267
  return true;
5238
5268
  }
5239
5269
  function stepSection(delta) {
5240
- const container = getActiveContainer();
5270
+ const doc = resolveDoc();
5271
+ const ownScope = options.getScopeElement?.() ?? null;
5272
+ const container = !ownScope && panes.has("docs-main") && panes.get("docs-main")?.element ? panes.get("docs-main").element : getActiveContainer();
5241
5273
  if (!container) return false;
5242
- const sections = Array.from(
5243
- container.querySelectorAll(
5244
- '[data-page-section], [data-slot="page-section"], section[id], .docs-prose :is(h2, h3)'
5274
+ const selector = ownScope ? '[data-page-section], [data-slot="page-section"], section[id], .docs-prose :is(h1, h2, h3)' : 'h1:not([data-demo] *), [data-page-section]:not([data-demo] *), [data-slot="page-section"]:not([data-demo] *), section[id]:not([data-demo] *), .docs-prose :is(h1, h2, h3):not([data-demo] *)';
5275
+ const rawSections = Array.from(container.querySelectorAll(selector));
5276
+ const sections = rawSections.filter(
5277
+ (el) => !rawSections.some(
5278
+ (other) => other !== el && (other.hasAttribute?.("data-page-section") || other.getAttribute?.("data-slot") === "page-section" || other.tagName === "SECTION") && other.contains(el)
5245
5279
  )
5246
5280
  );
5247
5281
  if (sections.length === 0) {
5248
- return stepFocusInPane(delta);
5282
+ if (ownScope && doc) {
5283
+ const rootCtrl = rootControllerByDoc.get(doc);
5284
+ if (rootCtrl && rootCtrl !== controllerApi) {
5285
+ return rootCtrl.executeCommand(delta >= 0 ? "motion.paragraphForward" : "motion.paragraphBackward", {
5286
+ count: Math.abs(delta)
5287
+ });
5288
+ }
5289
+ }
5290
+ return false;
5249
5291
  }
5250
- const doc = resolveDoc();
5251
5292
  const activeEl = doc?.activeElement;
5252
- const currentIdx = activeEl ? sections.findIndex((s) => s === activeEl || s.contains(activeEl)) : -1;
5293
+ let currentIdx = activeEl ? sections.findIndex((s) => s === activeEl || s.contains(activeEl)) : -1;
5294
+ if (currentIdx === -1 && activeEl && activeEl !== doc?.body && activeEl !== doc?.documentElement && container.contains(activeEl)) {
5295
+ for (let i = sections.length - 1; i >= 0; i -= 1) {
5296
+ const sec = sections[i];
5297
+ if (typeof sec.compareDocumentPosition === "function" && Boolean(sec.compareDocumentPosition(activeEl) & 4)) {
5298
+ currentIdx = i;
5299
+ break;
5300
+ }
5301
+ }
5302
+ }
5303
+ if (currentIdx === -1 && typeof sections[0]?.getBoundingClientRect === "function") {
5304
+ const firstRect = sections[0].getBoundingClientRect();
5305
+ const lastRect = sections[sections.length - 1].getBoundingClientRect();
5306
+ if (firstRect.height > 0 || lastRect.top !== firstRect.top) {
5307
+ const viewportAnchor = 140;
5308
+ for (let i = sections.length - 1; i >= 0; i -= 1) {
5309
+ if (sections[i].getBoundingClientRect().top <= viewportAnchor) {
5310
+ currentIdx = i;
5311
+ break;
5312
+ }
5313
+ }
5314
+ }
5315
+ }
5253
5316
  const nextIdx = currentIdx === -1 ? delta >= 0 ? 0 : sections.length - 1 : Math.max(0, Math.min(sections.length - 1, currentIdx + delta));
5254
5317
  const targetSection = sections[nextIdx];
5255
5318
  if (!targetSection) return false;
5256
5319
  recordCurrentLocation();
5257
- if (typeof targetSection.scrollIntoView === "function") {
5320
+ if (!ownScope && doc) {
5321
+ lastInteractedScopeByDoc.set(doc, null);
5322
+ }
5323
+ if (nextIdx === 0 && delta < 0 && !ownScope && doc?.defaultView && !isScrollableContainer(container, doc)) {
5324
+ try {
5325
+ doc.defaultView.scrollTo({ top: 0, behavior: "instant" });
5326
+ } catch {
5327
+ doc.defaultView.scrollTo(0, 0);
5328
+ }
5329
+ } else if (typeof targetSection.scrollIntoView === "function") {
5258
5330
  try {
5259
5331
  targetSection.scrollIntoView({ block: "start", behavior: "instant" });
5260
5332
  } catch {
5261
5333
  }
5262
5334
  }
5263
- const innerFocusable = getPaneFocusableItems(targetSection, options.getScopeElement?.())[0] ?? (0, import_dom_query.getFirstFocusable)(targetSection, { includeContainer: false });
5264
- if (innerFocusable instanceof HTMLElement) {
5265
- focusElementInActivePane(innerFocusable);
5266
- } else {
5267
- runProgrammaticFocus(() => {
5268
- if (targetSection.tabIndex < 0) {
5269
- targetSection.tabIndex = -1;
5270
- }
5271
- targetSection.style.outline = "none";
5272
- targetSection.focus({ preventScroll: true });
5273
- });
5274
- }
5335
+ runProgrammaticFocus(() => {
5336
+ if (targetSection.tabIndex < 0) {
5337
+ targetSection.tabIndex = -1;
5338
+ }
5339
+ targetSection.style.outline = "none";
5340
+ targetSection.focus({ preventScroll: true });
5341
+ });
5275
5342
  recordCurrentLocation();
5276
5343
  emit();
5277
5344
  return true;
@@ -5716,18 +5783,23 @@ function createWhichKeyController(options = {}) {
5716
5783
  function evaluateLayersInPrefix(chordCandidates, event) {
5717
5784
  const layers = getOrderedActiveLayers(event, true);
5718
5785
  const mergedTrie = buildMergedTrie();
5786
+ const visitedProxies = collectVisitedProxies(mergedTrie, activePath);
5719
5787
  let matchedAnyNode = false;
5720
5788
  for (const layer of layers) {
5721
5789
  const parentNode = resolveNode(layer.nodes, activePath, mode, mergedTrie);
5722
5790
  if (!parentNode) continue;
5723
- const children = getNodeChildren(parentNode, mergedTrie);
5791
+ const children = getNodeChildren(parentNode, mergedTrie, visitedProxies);
5792
+ const childVisitedProxies = new Set(visitedProxies);
5793
+ if (parentNode.proxy && parentNode.proxy.length > 0) {
5794
+ childVisitedProxies.add(parentNode.proxy.join(">"));
5795
+ }
5724
5796
  for (const candidate of chordCandidates) {
5725
5797
  const child = children[candidate];
5726
5798
  if (!child || !nodeMatchesMode(child, mode)) continue;
5727
5799
  matchedAnyNode = true;
5728
5800
  const ctx = createCommandContext(event);
5729
5801
  if (child.when && !child.when(ctx)) continue;
5730
- if (!child.action && !child.commandId && isGroupNode(child, mergedTrie)) {
5802
+ if (!child.action && !child.commandId && isGroupNode(child, mergedTrie, childVisitedProxies)) {
5731
5803
  activePath = [...activePath, candidate];
5732
5804
  if (child.sticky || child.loop) {
5733
5805
  sticky = true;
@@ -5971,6 +6043,7 @@ function createWhichKeyController(options = {}) {
5971
6043
  return handleJumpKeyDown(event);
5972
6044
  }
5973
6045
  if (activePath.length > 0) {
6046
+ lastEnterActivatedButton = null;
5974
6047
  if (event.key === "Escape") {
5975
6048
  event.preventDefault();
5976
6049
  event.stopPropagation();
@@ -5991,9 +6064,15 @@ function createWhichKeyController(options = {}) {
5991
6064
  if (handled) {
5992
6065
  return true;
5993
6066
  }
6067
+ const wasSilentPrefix = leaderOnly && activePath[0] !== leaderKey;
5994
6068
  if (!sticky) {
5995
6069
  closePrefix();
5996
6070
  }
6071
+ if (wasSilentPrefix && chordCandidates2.includes(leaderKey)) {
6072
+ if (evaluateLayersAtRoot(chordCandidates2, event, { insertModeOnly: false, includePreset: true })) {
6073
+ return true;
6074
+ }
6075
+ }
5997
6076
  if (!matchedAnyNode) {
5998
6077
  event.preventDefault();
5999
6078
  event.stopPropagation();
@@ -6003,20 +6082,27 @@ function createWhichKeyController(options = {}) {
6003
6082
  }
6004
6083
  const chordCandidates = eventToChordKeys(event);
6005
6084
  if (event.key === " " && !event.ctrlKey && !event.metaKey && !event.altKey && targetEl) {
6006
- const role = targetEl.getAttribute("role");
6007
- const isToggleControl = targetEl instanceof HTMLInputElement && (targetEl.type === "checkbox" || targetEl.type === "radio") || role === "checkbox" || role === "switch" || role === "radio";
6085
+ const role = targetEl.getAttribute?.("role") ?? null;
6086
+ const isToggleControl = typeof HTMLInputElement !== "undefined" && targetEl instanceof HTMLInputElement && (targetEl.type === "checkbox" || targetEl.type === "radio") || role === "checkbox" || role === "switch";
6008
6087
  if (isToggleControl) {
6088
+ lastEnterActivatedButton = null;
6009
6089
  return false;
6010
6090
  }
6011
6091
  const isButtonControl = targetEl.tagName === "BUTTON" || role === "button";
6012
- if (isButtonControl) {
6013
- const previewAncestor = targetEl.closest("[data-example-preview]");
6092
+ if (isButtonControl && lastEnterActivatedButton === targetEl) {
6093
+ lastEnterActivatedButton = null;
6094
+ const previewAncestor = targetEl.closest?.("[data-example-preview]") ?? null;
6014
6095
  const ownScope = options.getScopeElement?.() ?? null;
6015
6096
  if (previewAncestor && (!ownScope || !previewAncestor.contains(ownScope))) {
6016
6097
  return false;
6017
6098
  }
6018
6099
  }
6019
6100
  }
6101
+ if (event.key === "Enter" && !event.ctrlKey && !event.metaKey && !event.altKey && targetEl && (targetEl.tagName === "BUTTON" || targetEl.getAttribute?.("role") === "button") && targetEl.getAttribute?.("data-part") !== "trigger" && !targetEl.hasAttribute?.("aria-haspopup") && targetEl.closest?.("[data-example-preview]")) {
6102
+ lastEnterActivatedButton = targetEl;
6103
+ } else {
6104
+ lastEnterActivatedButton = null;
6105
+ }
6020
6106
  if (chordCandidates.length > 0) {
6021
6107
  const rootTrie = buildMergedTrie();
6022
6108
  for (const candidate of chordCandidates) {
@@ -6062,7 +6148,7 @@ function createWhichKeyController(options = {}) {
6062
6148
  }
6063
6149
  return true;
6064
6150
  }
6065
- const parentExample = targetEl instanceof HTMLElement && !targetEl.hasAttribute("data-example") ? targetEl.closest("[data-example]") : null;
6151
+ const parentExample = isHTMLElementLike(targetEl) && !targetEl.hasAttribute?.("data-example") ? targetEl.closest?.("[data-example]") : null;
6066
6152
  const hasOpenFloatingSurface = Boolean(
6067
6153
  doc?.querySelector(
6068
6154
  '[data-scope="popover"][data-state="open"], [data-scope="menu"][data-state="open"], [data-scope="select"][data-state="open"], [data-scope="combobox"][data-state="open"], [role="dialog"]:not([hidden]):not([data-state="closed"]), [role="listbox"]:not([hidden]):not([data-state="closed"]), [aria-expanded="true"]'
@@ -6081,7 +6167,7 @@ function createWhichKeyController(options = {}) {
6081
6167
  }
6082
6168
  return false;
6083
6169
  }
6084
- if (event.key === "Enter" && !event.ctrlKey && !event.metaKey && !event.altKey && targetEl instanceof HTMLElement && targetEl.hasAttribute("data-example")) {
6170
+ if (event.key === "Enter" && !event.ctrlKey && !event.metaKey && !event.altKey && isHTMLElementLike(targetEl) && targetEl.hasAttribute?.("data-example")) {
6085
6171
  event.preventDefault();
6086
6172
  event.stopPropagation();
6087
6173
  return enterExampleContainer(targetEl);
@@ -6191,15 +6277,22 @@ function createWhichKeyController(options = {}) {
6191
6277
  emit();
6192
6278
  const onPointerDown = (e) => {
6193
6279
  if (!isControllerEnabled()) return;
6280
+ lastEnterActivatedButton = null;
6194
6281
  const targetNode = e.target instanceof Element ? e.target : null;
6195
6282
  if (!targetNode) return;
6196
- if (!targetNode.closest(
6197
- '[data-which-key-root], [data-which-key-explorer], [data-which-key-jump-overlay], [data-scope="dialog"]'
6198
- )) {
6283
+ const isInsideOverlay = Boolean(
6284
+ targetNode.closest(
6285
+ '[data-which-key-root], [data-which-key-explorer], [data-which-key-jump-overlay], [data-scope="dialog"]'
6286
+ )
6287
+ );
6288
+ if (!isInsideOverlay) {
6199
6289
  const clickedScope = targetNode.closest("[data-which-key-scope]") ?? null;
6200
6290
  if (!clickedScope || isScopeElementActive(clickedScope, doc)) {
6201
6291
  lastInteractedScopeByDoc.set(doc, clickedScope);
6202
6292
  }
6293
+ if (activePath.length > 0 || countBuffer.length > 0) {
6294
+ closePrefix();
6295
+ }
6203
6296
  }
6204
6297
  if (!shouldEntryHandleEvent(entry, doc)) return;
6205
6298
  for (const pane of panes.values()) {
@@ -6215,10 +6308,15 @@ function createWhichKeyController(options = {}) {
6215
6308
  "[data-which-key-explorer], [data-command-palette], [data-command-menu], [data-colon-command]"
6216
6309
  ) && (mode === "normal" || mode === "select")) {
6217
6310
  setMode("insert");
6311
+ } else if (mode === "insert" && !isInsideOverlay && !isTextEntryElement(targetNode) && !getModalEditor(targetNode) && !targetNode.closest(
6312
+ '[data-scope="editor"], [data-editor-toolbar], .ProseMirror, [data-editor-overlay], [data-slash-menu-surface], [data-mention-menu-surface], [data-editor-slash-menu], [data-editor-mention-menu], [data-scope="select"], [data-scope="menu"], [data-scope="popover"], [data-scope="combobox"]'
6313
+ )) {
6314
+ setMode("normal");
6218
6315
  }
6219
6316
  };
6220
6317
  const onFocusIn = (e) => {
6221
6318
  if (!isControllerEnabled()) return;
6319
+ lastEnterActivatedButton = null;
6222
6320
  const targetNode = e.target instanceof HTMLElement ? e.target : null;
6223
6321
  if (!targetNode) return;
6224
6322
  if (programmaticFocusDepth === 0 && !targetNode.closest(
@@ -7071,8 +7169,6 @@ function createModalTargetForEditor(editor, options) {
7071
7169
  }
7072
7170
  } else if (targetBlock.isAtom && import_state2.NodeSelection.isSelectable(targetBlock.node)) {
7073
7171
  tr = tr.setSelection(import_state2.NodeSelection.create(doc, targetBlock.pos));
7074
- } else if (isSelectionFirst) {
7075
- tr = tr.setSelection(import_state2.TextSelection.create(doc, targetBlock.start, targetBlock.end));
7076
7172
  } else {
7077
7173
  tr = tr.setSelection(import_state2.TextSelection.create(doc, targetBlock.start));
7078
7174
  }
@@ -8786,6 +8882,7 @@ function lockEditorOverlayScroll(editorElement, overlayElement) {
8786
8882
  codeBlockSpinnerBase,
8787
8883
  codeBlockTitleBase,
8788
8884
  colBase,
8885
+ collectVisitedProxies,
8789
8886
  comboboxClearTriggerBase,
8790
8887
  comboboxContentBase,
8791
8888
  comboboxControlBase,
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
3
3
  import { ClassValue } from 'clsx';
4
4
  import * as ManimWeb from 'manim-web';
5
5
  import { DomChartDefinition } from '@tanstack/charts';
6
- export { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, f as CommandMenuColumns, g as CommandMenuProps, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, K as KbdChord, n as KbdHotkey, o as KbdProps, p as KbdStepResult, q as KbdVariants, r as commandMenuStyles, s as commandPaletteStyles, t as createCommandTree, u as formatKeyChord, v as formatKeySequence, w as inferPlatform, x as isChordCommandString, y as kbdGroupBase, z as kbdVariants, A as matchesCommandHotkey, B as resolveKbdSteps, D as validateKbdChord, E as validateKbdHotkey } from './index-FoNHRG3R.cjs';
6
+ export { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, f as CommandMenuColumns, g as CommandMenuProps, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, K as KbdChord, n as KbdHotkey, o as KbdProps, p as KbdStepResult, q as KbdVariants, r as commandMenuStyles, s as commandPaletteStyles, t as createCommandTree, u as formatKeyChord, v as formatKeySequence, w as inferPlatform, x as isChordCommandString, y as kbdGroupBase, z as kbdVariants, A as matchesCommandHotkey, B as resolveKbdSteps, D as validateKbdChord, E as validateKbdHotkey } from './index-C62JCLmF.cjs';
7
7
  export * from '@tanstack/hotkeys';
8
8
  import * as _tiptap_core from '@tiptap/core';
9
9
  import { Editor, Range, Extensions, Extension, Node } from '@tiptap/core';
@@ -159,8 +159,9 @@ declare function nodeMatchesMode(node: WhichKeyNode, mode?: KeymapMode): boolean
159
159
  declare function nodeExplicitlyIncludesMode(node: WhichKeyNode, mode: KeymapMode): boolean;
160
160
  declare function normalizeNodeModes(node: WhichKeyNode): KeymapMode[];
161
161
  declare function getNodeChildren(node: WhichKeyNode, rootTrie: Record<string, WhichKeyNode>, visitedProxies?: Set<string>): Record<string, WhichKeyNode>;
162
+ declare function collectVisitedProxies(rootTrie: Record<string, WhichKeyNode>, path: string[], proxyRootTrie?: Record<string, WhichKeyNode>): Set<string>;
162
163
  declare function resolveNode(rootTrie: Record<string, WhichKeyNode>, path: string[], mode?: KeymapMode, proxyRootTrie?: Record<string, WhichKeyNode>): WhichKeyNode | null;
163
- declare function isGroupNode(node: WhichKeyNode, rootTrie: Record<string, WhichKeyNode>): boolean;
164
+ declare function isGroupNode(node: WhichKeyNode, rootTrie: Record<string, WhichKeyNode>, visitedProxies?: Set<string>): boolean;
164
165
  declare function formatWhichKeyLabel(label: string): string;
165
166
  declare function buildWhichKeyTree(rootTrie: Record<string, WhichKeyNode>, activePath: string[], mode?: KeymapMode): WhichKeyTreeResult;
166
167
  declare function flattenKeymapEntries(rootTrie: Record<string, WhichKeyNode>, mode?: KeymapMode): KeymapExplorerEntry[];
@@ -1492,4 +1493,4 @@ declare function getEditorModalTarget(editor: Editor): ModalEditorTarget | undef
1492
1493
  declare function serializeModalSliceText(doc: Node$1, from: number, to: number): string;
1493
1494
  declare const ModalKeymap: Extension<ModalKeymapOptions, ModalKeymapStorage>;
1494
1495
 
1495
- export { type BadgeProps, type BadgeVariants, type BuildExtensionsOptions, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type ChartProps, type ChartSeries, type CheckboxProps, type CheckboxVariants, type CodeBlockProps, type ComboboxItemVariants, type ComboboxProps, DEFAULT_JUMP_ALPHABET, DEFAULT_THEME, type EditorCounts, EditorHeading, type EditorNodeViews, type EditorSeams, ExitHeading, type FigureProps, type FileEntry, HeadingWithId, type ImageUploadResult, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type JumpAction, type JumpTarget, Jumplist, type JumplistEntry, type KeybindingPreset, type KeymapCommandContext, type KeymapExplorerEntry, type KeymapHandler, type KeymapMode, type KeymapNodesInput, type KeymapPriority, type LaTeXProps, type LanguageTab, type LightSwitchBaseProps, type LightSwitchButtonVariants, type LinkPreviewAttributes, type LinkPreviewFetcher, type ListboxItemData, type ManimModule, type ManimProps, type ManimRecordingScene, type MentionItem, type MentionListElement, type MermaidProps, type ModalEditorTarget, ModalKeymap, type ModalKeymapOptions, type ModalKeymapPluginState, type ModalKeymapStorage, type ModalMotion, type ModalOperator, type ModalSelectionTransform, type ModalTextObjectSpec, type MultipleChoiceQuestionData, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NodeViewFactory, type NoticeAttributes, type NoticeProps, type NoticeVariant, type NoticeVariants, type NumberInputProps, type NumericQuestionData, type OverlayPlacementOptions, type OverlayPosition, type PageGutterContentVariants, type PageGutterVariants, type PagePaneRegistrationProps, type PageVariants, type PaneDirection, type PaneProps, type PaneRect, type PaneRegistration, type PaneRegistrationProps, type PrevNextProps, type ProseProps, type ProseVariants, type Question, type RegisterKeymapOptions, type RevealProps, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDGET_DEFAULT_SNAP_POINT, SIDEBAR_WIDGET_SNAP_POINTS, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SecondaryCursorRange, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SidebarPaneRegistrationProps, type SingleChoiceQuestionData, type SlashCommandItem, type SplitterPanelPaneRegistrationProps, type SwitchProps, type SwitchVariants, THEMES, THEME_CLASS_PREFIX, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeController, type ThemeMeta, type ThemeMode, type ThemeName, type ThemeSelectorBaseProps, type ThemeSelectorSwatchVariants, type ThemeServiceOptions, TitleHeading, type ToastActionOptions, type ToastPlacement, type ToastType, type ToastVariants, type ToggleButtonProps, type ToggleButtonVariants, type ToggleGroupProps, type ToggleGroupRootVariants, type UrlMentionAttributes, type UseThemeOptions, type WhichKeyController, type WhichKeyControllerOptions, type WhichKeyExplorerProps, type WhichKeyModeBadgeVariants, type WhichKeyModeProps, type WhichKeyNode, type WhichKeyProps, type WhichKeyState, type WhichKeyTreeResult, type WhichKeyVariant, type WhichKeyVariants, type WindowPaneRegistrationProps, type YouTubeChapter, type YouTubeProps, badgeVariants, buildChartDefinition, buildExtensions, buildWhichKeyTree, buttonVariants, captureDialogFocusTarget, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, chartPlaceholderBase, chartPlaceholderLabelBase, chartRootBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, clipboardTriggerBase, cn, codeBlockBodyBase, codeBlockBodyScrollableBase, codeBlockContentBase, codeBlockCopyFloatBase, codeBlockHeaderBase, codeBlockHeaderInfoBase, codeBlockHighlightBase, codeBlockLineNumbersBase, codeBlockLoadingBase, codeBlockRootBase, codeBlockSpinnerBase, codeBlockTitleBase, colBase, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, createCodeBlockCustom, createHelixPreset, createImageNode, createInternalMention, createJumplist, createKakounePreset, createLinkPreview, createNoticeNode, createUrlMention, createVimPreset, createWhichKeyController, cycleThemeModeValue, defaultChartColor, defaultListboxFilter, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogStyles, dialogTitleBase, eventToChordKeys, extractYouTubeId, feedbackCorrectBase, feedbackExplanationBase, feedbackIncorrectBase, fetchYouTubeMetadata, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, figureCaptionBase, figureImageBase, figureRootBase, findDirectionalPane, findEditorScrollContainer, flattenKeymapEntries, formatTime, formatWhichKeyLabel, generateJumpLabels, getDocumentWhichKeyController, getEditorModalTarget, getModalEditor, getNodeChildren, getPresetKeymap, hasThemeCss, hstackBase, injectCodeBlockStyles, inputVariants, insertPastedUrlAsLink, isEditorInInsertMode, isGroupNode, itemVariants, jumpBadgeMatchedPrefixBase, jumpBadgeVariants, jumpOverlayRootBase, latexDisplayBase, latexErrorBase, latexInlineBase, latexRootBase, lightSwitchButtonVariants, listboxContentBase, listboxEmptyBase, listboxInputBase, listboxItemBase, listboxItemGroupBase, listboxItemGroupLabelBase, listboxItemIndicatorBase, listboxItemTextBase, listboxLabelBase, listboxRootBase, lockEditorOverlayScroll, manimCaptionBase, manimContainerBase, manimErrorBase, manimPlaceholderBase, manimPlaceholderLabelBase, manimRootBase, mergeThemePresets, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, modalKeymapPluginKey, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, nodeExplicitlyIncludesMode, nodeMatchesMode, normalizeNodeModes, noticeDescriptionBase, noticeTitleBase, noticeVariants, notifyAllModalEditors, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, paneVariants, parseYouTubeChapters, placeEditorOverlay, placeEditorOverlayAt, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, prevNextDirectionBase, prevNextLinkBase, prevNextLinkNextBase, prevNextRootBase, prevNextSpacerBase, prevNextTitleBase, proseVariants, questionCardBase, questionCheckButtonBase, questionGroupBase, questionInputBase, questionOptionBase, questionOptionCorrectBase, questionOptionIncorrectBase, questionPromptBase, questionUnitBase, quizHeaderBase, quizResetButtonBase, quizResultBase, quizResultTextBase, quizResultTitleBase, quizRootBase, quizScoreBase, quizSubmitButtonBase, quizTitleBase, radioGroupItemControlBase, radioGroupItemTextBase, radioGroupRootBase, readDocumentDarkMode, readDocumentTheme, readSystemDarkMode, registerCustomThemes, registerImageInsertCallback, registerModalEditor, registerYouTubeInsertCallback, renderChartSvgString, renderCodeToHtml, renderMermaidSource, resolveMermaidThemeVariables, resolveNode, restoreDialogFocusTarget, revealChevronBase, revealContentBase, revealRootBase, revealTriggerBase, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, serializeModalSliceText, sidebarMenuButtonVariants, sidebarStyles, slashCommands, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, subscribeDocumentTheme, subscribeDocumentWhichKeyController, subscribeSystemDarkMode, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, syncDocumentDarkMode, syncDocumentTheme, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, themeSelectorStyles, toLaTeX, toastActionTriggerBase, toastCloseTriggerBase, toastDescriptionBase, toastIconBase, toastTitleBase, toastVariants, toasterBase, toggleButtonVariants, toggleGroupRootVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, unregisterImageInsertCallback, unregisterYouTubeInsertCallback, vstackBase, whichKeyBodyVariants, whichKeyBreadcrumbBase, whichKeyExplorerContentBase, whichKeyExplorerHeaderBase, whichKeyExplorerHighlightMarkBase, whichKeyExplorerInputBase, whichKeyExplorerItemBase, whichKeyExplorerListContentBase, whichKeyExplorerListboxBase, whichKeyFooterBase, whichKeyHeaderBase, whichKeyItemBase, whichKeyItemLabelBase, whichKeyModeBadgeVariants, whichKeyTitleBase, whichKeyVariants, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase, youtubeChapterButtonBase, youtubeChapterLabelBase, youtubeChapterTimeBase, youtubeChaptersBase, youtubeChaptersChevronBase, youtubeChaptersListBase, youtubeChaptersSummaryBase, youtubeDescriptionBase, youtubeFacadeBase, youtubePlayButtonBase, youtubePlayButtonInnerBase, youtubeRootBase, youtubeTitleBase };
1496
+ export { type BadgeProps, type BadgeVariants, type BuildExtensionsOptions, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type ChartProps, type ChartSeries, type CheckboxProps, type CheckboxVariants, type CodeBlockProps, type ComboboxItemVariants, type ComboboxProps, DEFAULT_JUMP_ALPHABET, DEFAULT_THEME, type EditorCounts, EditorHeading, type EditorNodeViews, type EditorSeams, ExitHeading, type FigureProps, type FileEntry, HeadingWithId, type ImageUploadResult, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type JumpAction, type JumpTarget, Jumplist, type JumplistEntry, type KeybindingPreset, type KeymapCommandContext, type KeymapExplorerEntry, type KeymapHandler, type KeymapMode, type KeymapNodesInput, type KeymapPriority, type LaTeXProps, type LanguageTab, type LightSwitchBaseProps, type LightSwitchButtonVariants, type LinkPreviewAttributes, type LinkPreviewFetcher, type ListboxItemData, type ManimModule, type ManimProps, type ManimRecordingScene, type MentionItem, type MentionListElement, type MermaidProps, type ModalEditorTarget, ModalKeymap, type ModalKeymapOptions, type ModalKeymapPluginState, type ModalKeymapStorage, type ModalMotion, type ModalOperator, type ModalSelectionTransform, type ModalTextObjectSpec, type MultipleChoiceQuestionData, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NodeViewFactory, type NoticeAttributes, type NoticeProps, type NoticeVariant, type NoticeVariants, type NumberInputProps, type NumericQuestionData, type OverlayPlacementOptions, type OverlayPosition, type PageGutterContentVariants, type PageGutterVariants, type PagePaneRegistrationProps, type PageVariants, type PaneDirection, type PaneProps, type PaneRect, type PaneRegistration, type PaneRegistrationProps, type PrevNextProps, type ProseProps, type ProseVariants, type Question, type RegisterKeymapOptions, type RevealProps, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDGET_DEFAULT_SNAP_POINT, SIDEBAR_WIDGET_SNAP_POINTS, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SecondaryCursorRange, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SidebarPaneRegistrationProps, type SingleChoiceQuestionData, type SlashCommandItem, type SplitterPanelPaneRegistrationProps, type SwitchProps, type SwitchVariants, THEMES, THEME_CLASS_PREFIX, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeController, type ThemeMeta, type ThemeMode, type ThemeName, type ThemeSelectorBaseProps, type ThemeSelectorSwatchVariants, type ThemeServiceOptions, TitleHeading, type ToastActionOptions, type ToastPlacement, type ToastType, type ToastVariants, type ToggleButtonProps, type ToggleButtonVariants, type ToggleGroupProps, type ToggleGroupRootVariants, type UrlMentionAttributes, type UseThemeOptions, type WhichKeyController, type WhichKeyControllerOptions, type WhichKeyExplorerProps, type WhichKeyModeBadgeVariants, type WhichKeyModeProps, type WhichKeyNode, type WhichKeyProps, type WhichKeyState, type WhichKeyTreeResult, type WhichKeyVariant, type WhichKeyVariants, type WindowPaneRegistrationProps, type YouTubeChapter, type YouTubeProps, badgeVariants, buildChartDefinition, buildExtensions, buildWhichKeyTree, buttonVariants, captureDialogFocusTarget, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, chartPlaceholderBase, chartPlaceholderLabelBase, chartRootBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, clipboardTriggerBase, cn, codeBlockBodyBase, codeBlockBodyScrollableBase, codeBlockContentBase, codeBlockCopyFloatBase, codeBlockHeaderBase, codeBlockHeaderInfoBase, codeBlockHighlightBase, codeBlockLineNumbersBase, codeBlockLoadingBase, codeBlockRootBase, codeBlockSpinnerBase, codeBlockTitleBase, colBase, collectVisitedProxies, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, createCodeBlockCustom, createHelixPreset, createImageNode, createInternalMention, createJumplist, createKakounePreset, createLinkPreview, createNoticeNode, createUrlMention, createVimPreset, createWhichKeyController, cycleThemeModeValue, defaultChartColor, defaultListboxFilter, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogStyles, dialogTitleBase, eventToChordKeys, extractYouTubeId, feedbackCorrectBase, feedbackExplanationBase, feedbackIncorrectBase, fetchYouTubeMetadata, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, figureCaptionBase, figureImageBase, figureRootBase, findDirectionalPane, findEditorScrollContainer, flattenKeymapEntries, formatTime, formatWhichKeyLabel, generateJumpLabels, getDocumentWhichKeyController, getEditorModalTarget, getModalEditor, getNodeChildren, getPresetKeymap, hasThemeCss, hstackBase, injectCodeBlockStyles, inputVariants, insertPastedUrlAsLink, isEditorInInsertMode, isGroupNode, itemVariants, jumpBadgeMatchedPrefixBase, jumpBadgeVariants, jumpOverlayRootBase, latexDisplayBase, latexErrorBase, latexInlineBase, latexRootBase, lightSwitchButtonVariants, listboxContentBase, listboxEmptyBase, listboxInputBase, listboxItemBase, listboxItemGroupBase, listboxItemGroupLabelBase, listboxItemIndicatorBase, listboxItemTextBase, listboxLabelBase, listboxRootBase, lockEditorOverlayScroll, manimCaptionBase, manimContainerBase, manimErrorBase, manimPlaceholderBase, manimPlaceholderLabelBase, manimRootBase, mergeThemePresets, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, modalKeymapPluginKey, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, nodeExplicitlyIncludesMode, nodeMatchesMode, normalizeNodeModes, noticeDescriptionBase, noticeTitleBase, noticeVariants, notifyAllModalEditors, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, paneVariants, parseYouTubeChapters, placeEditorOverlay, placeEditorOverlayAt, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, prevNextDirectionBase, prevNextLinkBase, prevNextLinkNextBase, prevNextRootBase, prevNextSpacerBase, prevNextTitleBase, proseVariants, questionCardBase, questionCheckButtonBase, questionGroupBase, questionInputBase, questionOptionBase, questionOptionCorrectBase, questionOptionIncorrectBase, questionPromptBase, questionUnitBase, quizHeaderBase, quizResetButtonBase, quizResultBase, quizResultTextBase, quizResultTitleBase, quizRootBase, quizScoreBase, quizSubmitButtonBase, quizTitleBase, radioGroupItemControlBase, radioGroupItemTextBase, radioGroupRootBase, readDocumentDarkMode, readDocumentTheme, readSystemDarkMode, registerCustomThemes, registerImageInsertCallback, registerModalEditor, registerYouTubeInsertCallback, renderChartSvgString, renderCodeToHtml, renderMermaidSource, resolveMermaidThemeVariables, resolveNode, restoreDialogFocusTarget, revealChevronBase, revealContentBase, revealRootBase, revealTriggerBase, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, serializeModalSliceText, sidebarMenuButtonVariants, sidebarStyles, slashCommands, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, subscribeDocumentTheme, subscribeDocumentWhichKeyController, subscribeSystemDarkMode, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, syncDocumentDarkMode, syncDocumentTheme, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, themeSelectorStyles, toLaTeX, toastActionTriggerBase, toastCloseTriggerBase, toastDescriptionBase, toastIconBase, toastTitleBase, toastVariants, toasterBase, toggleButtonVariants, toggleGroupRootVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, unregisterImageInsertCallback, unregisterYouTubeInsertCallback, vstackBase, whichKeyBodyVariants, whichKeyBreadcrumbBase, whichKeyExplorerContentBase, whichKeyExplorerHeaderBase, whichKeyExplorerHighlightMarkBase, whichKeyExplorerInputBase, whichKeyExplorerItemBase, whichKeyExplorerListContentBase, whichKeyExplorerListboxBase, whichKeyFooterBase, whichKeyHeaderBase, whichKeyItemBase, whichKeyItemLabelBase, whichKeyModeBadgeVariants, whichKeyTitleBase, whichKeyVariants, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase, youtubeChapterButtonBase, youtubeChapterLabelBase, youtubeChapterTimeBase, youtubeChaptersBase, youtubeChaptersChevronBase, youtubeChaptersListBase, youtubeChaptersSummaryBase, youtubeDescriptionBase, youtubeFacadeBase, youtubePlayButtonBase, youtubePlayButtonInnerBase, youtubeRootBase, youtubeTitleBase };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
3
3
  import { ClassValue } from 'clsx';
4
4
  import * as ManimWeb from 'manim-web';
5
5
  import { DomChartDefinition } from '@tanstack/charts';
6
- export { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, f as CommandMenuColumns, g as CommandMenuProps, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, K as KbdChord, n as KbdHotkey, o as KbdProps, p as KbdStepResult, q as KbdVariants, r as commandMenuStyles, s as commandPaletteStyles, t as createCommandTree, u as formatKeyChord, v as formatKeySequence, w as inferPlatform, x as isChordCommandString, y as kbdGroupBase, z as kbdVariants, A as matchesCommandHotkey, B as resolveKbdSteps, D as validateKbdChord, E as validateKbdHotkey } from './index-FoNHRG3R.js';
6
+ export { C as ColonCommandColumns, a as ColonCommandProps, b as CommandBreadcrumb, c as CommandContextProps, d as CommandContextValue, e as CommandFlatItem, f as CommandMenuColumns, g as CommandMenuProps, h as CommandMenuVariants, i as CommandNode, j as CommandPaletteProps, k as CommandPaletteVariants, l as CommandSelectContext, m as CommandStyle, K as KbdChord, n as KbdHotkey, o as KbdProps, p as KbdStepResult, q as KbdVariants, r as commandMenuStyles, s as commandPaletteStyles, t as createCommandTree, u as formatKeyChord, v as formatKeySequence, w as inferPlatform, x as isChordCommandString, y as kbdGroupBase, z as kbdVariants, A as matchesCommandHotkey, B as resolveKbdSteps, D as validateKbdChord, E as validateKbdHotkey } from './index-C62JCLmF.js';
7
7
  export * from '@tanstack/hotkeys';
8
8
  import * as _tiptap_core from '@tiptap/core';
9
9
  import { Editor, Range, Extensions, Extension, Node } from '@tiptap/core';
@@ -159,8 +159,9 @@ declare function nodeMatchesMode(node: WhichKeyNode, mode?: KeymapMode): boolean
159
159
  declare function nodeExplicitlyIncludesMode(node: WhichKeyNode, mode: KeymapMode): boolean;
160
160
  declare function normalizeNodeModes(node: WhichKeyNode): KeymapMode[];
161
161
  declare function getNodeChildren(node: WhichKeyNode, rootTrie: Record<string, WhichKeyNode>, visitedProxies?: Set<string>): Record<string, WhichKeyNode>;
162
+ declare function collectVisitedProxies(rootTrie: Record<string, WhichKeyNode>, path: string[], proxyRootTrie?: Record<string, WhichKeyNode>): Set<string>;
162
163
  declare function resolveNode(rootTrie: Record<string, WhichKeyNode>, path: string[], mode?: KeymapMode, proxyRootTrie?: Record<string, WhichKeyNode>): WhichKeyNode | null;
163
- declare function isGroupNode(node: WhichKeyNode, rootTrie: Record<string, WhichKeyNode>): boolean;
164
+ declare function isGroupNode(node: WhichKeyNode, rootTrie: Record<string, WhichKeyNode>, visitedProxies?: Set<string>): boolean;
164
165
  declare function formatWhichKeyLabel(label: string): string;
165
166
  declare function buildWhichKeyTree(rootTrie: Record<string, WhichKeyNode>, activePath: string[], mode?: KeymapMode): WhichKeyTreeResult;
166
167
  declare function flattenKeymapEntries(rootTrie: Record<string, WhichKeyNode>, mode?: KeymapMode): KeymapExplorerEntry[];
@@ -1492,4 +1493,4 @@ declare function getEditorModalTarget(editor: Editor): ModalEditorTarget | undef
1492
1493
  declare function serializeModalSliceText(doc: Node$1, from: number, to: number): string;
1493
1494
  declare const ModalKeymap: Extension<ModalKeymapOptions, ModalKeymapStorage>;
1494
1495
 
1495
- export { type BadgeProps, type BadgeVariants, type BuildExtensionsOptions, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type ChartProps, type ChartSeries, type CheckboxProps, type CheckboxVariants, type CodeBlockProps, type ComboboxItemVariants, type ComboboxProps, DEFAULT_JUMP_ALPHABET, DEFAULT_THEME, type EditorCounts, EditorHeading, type EditorNodeViews, type EditorSeams, ExitHeading, type FigureProps, type FileEntry, HeadingWithId, type ImageUploadResult, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type JumpAction, type JumpTarget, Jumplist, type JumplistEntry, type KeybindingPreset, type KeymapCommandContext, type KeymapExplorerEntry, type KeymapHandler, type KeymapMode, type KeymapNodesInput, type KeymapPriority, type LaTeXProps, type LanguageTab, type LightSwitchBaseProps, type LightSwitchButtonVariants, type LinkPreviewAttributes, type LinkPreviewFetcher, type ListboxItemData, type ManimModule, type ManimProps, type ManimRecordingScene, type MentionItem, type MentionListElement, type MermaidProps, type ModalEditorTarget, ModalKeymap, type ModalKeymapOptions, type ModalKeymapPluginState, type ModalKeymapStorage, type ModalMotion, type ModalOperator, type ModalSelectionTransform, type ModalTextObjectSpec, type MultipleChoiceQuestionData, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NodeViewFactory, type NoticeAttributes, type NoticeProps, type NoticeVariant, type NoticeVariants, type NumberInputProps, type NumericQuestionData, type OverlayPlacementOptions, type OverlayPosition, type PageGutterContentVariants, type PageGutterVariants, type PagePaneRegistrationProps, type PageVariants, type PaneDirection, type PaneProps, type PaneRect, type PaneRegistration, type PaneRegistrationProps, type PrevNextProps, type ProseProps, type ProseVariants, type Question, type RegisterKeymapOptions, type RevealProps, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDGET_DEFAULT_SNAP_POINT, SIDEBAR_WIDGET_SNAP_POINTS, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SecondaryCursorRange, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SidebarPaneRegistrationProps, type SingleChoiceQuestionData, type SlashCommandItem, type SplitterPanelPaneRegistrationProps, type SwitchProps, type SwitchVariants, THEMES, THEME_CLASS_PREFIX, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeController, type ThemeMeta, type ThemeMode, type ThemeName, type ThemeSelectorBaseProps, type ThemeSelectorSwatchVariants, type ThemeServiceOptions, TitleHeading, type ToastActionOptions, type ToastPlacement, type ToastType, type ToastVariants, type ToggleButtonProps, type ToggleButtonVariants, type ToggleGroupProps, type ToggleGroupRootVariants, type UrlMentionAttributes, type UseThemeOptions, type WhichKeyController, type WhichKeyControllerOptions, type WhichKeyExplorerProps, type WhichKeyModeBadgeVariants, type WhichKeyModeProps, type WhichKeyNode, type WhichKeyProps, type WhichKeyState, type WhichKeyTreeResult, type WhichKeyVariant, type WhichKeyVariants, type WindowPaneRegistrationProps, type YouTubeChapter, type YouTubeProps, badgeVariants, buildChartDefinition, buildExtensions, buildWhichKeyTree, buttonVariants, captureDialogFocusTarget, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, chartPlaceholderBase, chartPlaceholderLabelBase, chartRootBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, clipboardTriggerBase, cn, codeBlockBodyBase, codeBlockBodyScrollableBase, codeBlockContentBase, codeBlockCopyFloatBase, codeBlockHeaderBase, codeBlockHeaderInfoBase, codeBlockHighlightBase, codeBlockLineNumbersBase, codeBlockLoadingBase, codeBlockRootBase, codeBlockSpinnerBase, codeBlockTitleBase, colBase, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, createCodeBlockCustom, createHelixPreset, createImageNode, createInternalMention, createJumplist, createKakounePreset, createLinkPreview, createNoticeNode, createUrlMention, createVimPreset, createWhichKeyController, cycleThemeModeValue, defaultChartColor, defaultListboxFilter, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogStyles, dialogTitleBase, eventToChordKeys, extractYouTubeId, feedbackCorrectBase, feedbackExplanationBase, feedbackIncorrectBase, fetchYouTubeMetadata, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, figureCaptionBase, figureImageBase, figureRootBase, findDirectionalPane, findEditorScrollContainer, flattenKeymapEntries, formatTime, formatWhichKeyLabel, generateJumpLabels, getDocumentWhichKeyController, getEditorModalTarget, getModalEditor, getNodeChildren, getPresetKeymap, hasThemeCss, hstackBase, injectCodeBlockStyles, inputVariants, insertPastedUrlAsLink, isEditorInInsertMode, isGroupNode, itemVariants, jumpBadgeMatchedPrefixBase, jumpBadgeVariants, jumpOverlayRootBase, latexDisplayBase, latexErrorBase, latexInlineBase, latexRootBase, lightSwitchButtonVariants, listboxContentBase, listboxEmptyBase, listboxInputBase, listboxItemBase, listboxItemGroupBase, listboxItemGroupLabelBase, listboxItemIndicatorBase, listboxItemTextBase, listboxLabelBase, listboxRootBase, lockEditorOverlayScroll, manimCaptionBase, manimContainerBase, manimErrorBase, manimPlaceholderBase, manimPlaceholderLabelBase, manimRootBase, mergeThemePresets, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, modalKeymapPluginKey, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, nodeExplicitlyIncludesMode, nodeMatchesMode, normalizeNodeModes, noticeDescriptionBase, noticeTitleBase, noticeVariants, notifyAllModalEditors, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, paneVariants, parseYouTubeChapters, placeEditorOverlay, placeEditorOverlayAt, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, prevNextDirectionBase, prevNextLinkBase, prevNextLinkNextBase, prevNextRootBase, prevNextSpacerBase, prevNextTitleBase, proseVariants, questionCardBase, questionCheckButtonBase, questionGroupBase, questionInputBase, questionOptionBase, questionOptionCorrectBase, questionOptionIncorrectBase, questionPromptBase, questionUnitBase, quizHeaderBase, quizResetButtonBase, quizResultBase, quizResultTextBase, quizResultTitleBase, quizRootBase, quizScoreBase, quizSubmitButtonBase, quizTitleBase, radioGroupItemControlBase, radioGroupItemTextBase, radioGroupRootBase, readDocumentDarkMode, readDocumentTheme, readSystemDarkMode, registerCustomThemes, registerImageInsertCallback, registerModalEditor, registerYouTubeInsertCallback, renderChartSvgString, renderCodeToHtml, renderMermaidSource, resolveMermaidThemeVariables, resolveNode, restoreDialogFocusTarget, revealChevronBase, revealContentBase, revealRootBase, revealTriggerBase, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, serializeModalSliceText, sidebarMenuButtonVariants, sidebarStyles, slashCommands, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, subscribeDocumentTheme, subscribeDocumentWhichKeyController, subscribeSystemDarkMode, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, syncDocumentDarkMode, syncDocumentTheme, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, themeSelectorStyles, toLaTeX, toastActionTriggerBase, toastCloseTriggerBase, toastDescriptionBase, toastIconBase, toastTitleBase, toastVariants, toasterBase, toggleButtonVariants, toggleGroupRootVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, unregisterImageInsertCallback, unregisterYouTubeInsertCallback, vstackBase, whichKeyBodyVariants, whichKeyBreadcrumbBase, whichKeyExplorerContentBase, whichKeyExplorerHeaderBase, whichKeyExplorerHighlightMarkBase, whichKeyExplorerInputBase, whichKeyExplorerItemBase, whichKeyExplorerListContentBase, whichKeyExplorerListboxBase, whichKeyFooterBase, whichKeyHeaderBase, whichKeyItemBase, whichKeyItemLabelBase, whichKeyModeBadgeVariants, whichKeyTitleBase, whichKeyVariants, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase, youtubeChapterButtonBase, youtubeChapterLabelBase, youtubeChapterTimeBase, youtubeChaptersBase, youtubeChaptersChevronBase, youtubeChaptersListBase, youtubeChaptersSummaryBase, youtubeDescriptionBase, youtubeFacadeBase, youtubePlayButtonBase, youtubePlayButtonInnerBase, youtubeRootBase, youtubeTitleBase };
1496
+ export { type BadgeProps, type BadgeVariants, type BuildExtensionsOptions, type ButtonProps, type ButtonVariants, type CardCoverProps, type CardProps, type CardVariants, type ChartProps, type ChartSeries, type CheckboxProps, type CheckboxVariants, type CodeBlockProps, type ComboboxItemVariants, type ComboboxProps, DEFAULT_JUMP_ALPHABET, DEFAULT_THEME, type EditorCounts, EditorHeading, type EditorNodeViews, type EditorSeams, ExitHeading, type FigureProps, type FileEntry, HeadingWithId, type ImageUploadResult, type InputProps, type InputVariants, type ItemProps, type ItemVariants, type JumpAction, type JumpTarget, Jumplist, type JumplistEntry, type KeybindingPreset, type KeymapCommandContext, type KeymapExplorerEntry, type KeymapHandler, type KeymapMode, type KeymapNodesInput, type KeymapPriority, type LaTeXProps, type LanguageTab, type LightSwitchBaseProps, type LightSwitchButtonVariants, type LinkPreviewAttributes, type LinkPreviewFetcher, type ListboxItemData, type ManimModule, type ManimProps, type ManimRecordingScene, type MentionItem, type MentionListElement, type MermaidProps, type ModalEditorTarget, ModalKeymap, type ModalKeymapOptions, type ModalKeymapPluginState, type ModalKeymapStorage, type ModalMotion, type ModalOperator, type ModalSelectionTransform, type ModalTextObjectSpec, type MultipleChoiceQuestionData, type NativeSelectVariants, type NavbarDensity, type NavbarMenuDensity, type NavbarMenuVariant, type NavbarVariant, type NodeViewFactory, type NoticeAttributes, type NoticeProps, type NoticeVariant, type NoticeVariants, type NumberInputProps, type NumericQuestionData, type OverlayPlacementOptions, type OverlayPosition, type PageGutterContentVariants, type PageGutterVariants, type PagePaneRegistrationProps, type PageVariants, type PaneDirection, type PaneProps, type PaneRect, type PaneRegistration, type PaneRegistrationProps, type PrevNextProps, type ProseProps, type ProseVariants, type Question, type RegisterKeymapOptions, type RevealProps, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDGET_DEFAULT_SNAP_POINT, SIDEBAR_WIDGET_SNAP_POINTS, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON, SIDEBAR_WIDTH_MOBILE, type SecondaryCursorRange, type SelectItemData, type SelectProps, type SidebarContextProps, type SidebarMenuButtonVariants, type SidebarPaneRegistrationProps, type SingleChoiceQuestionData, type SlashCommandItem, type SplitterPanelPaneRegistrationProps, type SwitchProps, type SwitchVariants, THEMES, THEME_CLASS_PREFIX, THEME_NAMES, type TabsIndicatorVariants, type TabsListVariants, type TagsInputProps, type TextareaProps, type ThemeController, type ThemeMeta, type ThemeMode, type ThemeName, type ThemeSelectorBaseProps, type ThemeSelectorSwatchVariants, type ThemeServiceOptions, TitleHeading, type ToastActionOptions, type ToastPlacement, type ToastType, type ToastVariants, type ToggleButtonProps, type ToggleButtonVariants, type ToggleGroupProps, type ToggleGroupRootVariants, type UrlMentionAttributes, type UseThemeOptions, type WhichKeyController, type WhichKeyControllerOptions, type WhichKeyExplorerProps, type WhichKeyModeBadgeVariants, type WhichKeyModeProps, type WhichKeyNode, type WhichKeyProps, type WhichKeyState, type WhichKeyTreeResult, type WhichKeyVariant, type WhichKeyVariants, type WindowPaneRegistrationProps, type YouTubeChapter, type YouTubeProps, badgeVariants, buildChartDefinition, buildExtensions, buildWhichKeyTree, buttonVariants, captureDialogFocusTarget, cardBodyBase, cardCoverVariants, cardDescriptionBase, cardFooterBase, cardHeaderBase, cardTitleBase, cardVariants, centerBase, chartPlaceholderBase, chartPlaceholderLabelBase, chartRootBase, checkboxGroupBase, checkboxIndicatorBase, checkboxLabelBase, checkboxVariants, clipboardTriggerBase, cn, codeBlockBodyBase, codeBlockBodyScrollableBase, codeBlockContentBase, codeBlockCopyFloatBase, codeBlockHeaderBase, codeBlockHeaderInfoBase, codeBlockHighlightBase, codeBlockLineNumbersBase, codeBlockLoadingBase, codeBlockRootBase, codeBlockSpinnerBase, codeBlockTitleBase, colBase, collectVisitedProxies, comboboxClearTriggerBase, comboboxContentBase, comboboxControlBase, comboboxEmptyBase, comboboxInputBase, comboboxItemGroupLabelBase, comboboxItemIndicatorBase, comboboxItemVariants, comboboxListBase, comboboxPositionerBase, comboboxTriggerBase, containerBase, createCodeBlockCustom, createHelixPreset, createImageNode, createInternalMention, createJumplist, createKakounePreset, createLinkPreview, createNoticeNode, createUrlMention, createVimPreset, createWhichKeyController, cycleThemeModeValue, defaultChartColor, defaultListboxFilter, dialogBackdropBase, dialogCloseTriggerBase, dialogContentBase, dialogDescriptionBase, dialogFooterBase, dialogFooterStickyBase, dialogFullscreenContentBase, dialogHeaderBase, dialogHeaderStickyBase, dialogPositionerBase, dialogStyles, dialogTitleBase, eventToChordKeys, extractYouTubeId, feedbackCorrectBase, feedbackExplanationBase, feedbackIncorrectBase, fetchYouTubeMetadata, fieldErrorBase, fieldHelperBase, fieldLabelBase, fieldRequiredIndicatorBase, fieldRootBase, fieldsetErrorBase, fieldsetHelperBase, fieldsetLegendBase, fieldsetRootBase, figureCaptionBase, figureImageBase, figureRootBase, findDirectionalPane, findEditorScrollContainer, flattenKeymapEntries, formatTime, formatWhichKeyLabel, generateJumpLabels, getDocumentWhichKeyController, getEditorModalTarget, getModalEditor, getNodeChildren, getPresetKeymap, hasThemeCss, hstackBase, injectCodeBlockStyles, inputVariants, insertPastedUrlAsLink, isEditorInInsertMode, isGroupNode, itemVariants, jumpBadgeMatchedPrefixBase, jumpBadgeVariants, jumpOverlayRootBase, latexDisplayBase, latexErrorBase, latexInlineBase, latexRootBase, lightSwitchButtonVariants, listboxContentBase, listboxEmptyBase, listboxInputBase, listboxItemBase, listboxItemGroupBase, listboxItemGroupLabelBase, listboxItemIndicatorBase, listboxItemTextBase, listboxLabelBase, listboxRootBase, lockEditorOverlayScroll, manimCaptionBase, manimContainerBase, manimErrorBase, manimPlaceholderBase, manimPlaceholderLabelBase, manimRootBase, mergeThemePresets, mermaidLoadingBase, mermaidRootBase, mermaidSourceBase, mermaidSvgAspectRatio, mermaidSvgBase, modalKeymapPluginKey, nativeSelectIconBase, nativeSelectVariants, nativeSelectWrapperBase, navbarActionsBase, navbarActivationAreaBase, navbarBrandBase, navbarContainerBase, navbarDensityVariants, navbarMenuBase, navbarMenuContentBase, navbarMenuIndicatorBase, navbarMenuItemBase, navbarMenuLinkBase, navbarMenuListBase, navbarMenuPlacementVariants, navbarMenuRootBase, navbarMenuTriggerStyle, navbarMenuViewportBase, navbarMenuViewportPositionerBase, navbarMobileActionsBase, navbarMobileBase, navbarMobileContentBase, navbarMobileHeaderBase, navbarMobileMenuBase, navbarMobileMenuContentBase, navbarMobileMenuTriggerBase, navbarShrunkBase, navbarTriggerVariants, navbarVariants, nodeExplicitlyIncludesMode, nodeMatchesMode, normalizeNodeModes, noticeDescriptionBase, noticeTitleBase, noticeVariants, notifyAllModalEditors, numberInputControlBase, numberInputInputBase, numberInputRootBase, numberInputTriggerBase, pageContentBase, pageFooterBase, pageGutterAreaBase, pageGutterContentVariants, pageGutterVariants, pageSectionBase, pageVariants, paginationEllipsisBase, paginationItemBase, paginationRootBase, paginationTriggerBase, paneVariants, parseYouTubeChapters, placeEditorOverlay, placeEditorOverlayAt, popoverArrowBase, popoverCloseTriggerBase, popoverContentBase, popoverDescriptionBase, popoverIndicatorBase, popoverPositionerBase, popoverTitleBase, prevNextDirectionBase, prevNextLinkBase, prevNextLinkNextBase, prevNextRootBase, prevNextSpacerBase, prevNextTitleBase, proseVariants, questionCardBase, questionCheckButtonBase, questionGroupBase, questionInputBase, questionOptionBase, questionOptionCorrectBase, questionOptionIncorrectBase, questionPromptBase, questionUnitBase, quizHeaderBase, quizResetButtonBase, quizResultBase, quizResultTextBase, quizResultTitleBase, quizRootBase, quizScoreBase, quizSubmitButtonBase, quizTitleBase, radioGroupItemControlBase, radioGroupItemTextBase, radioGroupRootBase, readDocumentDarkMode, readDocumentTheme, readSystemDarkMode, registerCustomThemes, registerImageInsertCallback, registerModalEditor, registerYouTubeInsertCallback, renderChartSvgString, renderCodeToHtml, renderMermaidSource, resolveMermaidThemeVariables, resolveNode, restoreDialogFocusTarget, revealChevronBase, revealContentBase, revealRootBase, revealTriggerBase, rowBase, scrollContentBase, scrollCornerBase, scrollRootBase, scrollScrollbarBase, scrollThumbBase, scrollViewportBase, selectClearTriggerBase, selectContentBase, selectIndicatorBase, selectItemBase, selectItemGroupLabelBase, selectItemIndicatorBase, selectItemTextBase, selectPositionerBase, selectTriggerBase, selectValueBase, serializeModalSliceText, sidebarMenuButtonVariants, sidebarStyles, slashCommands, splitterPanelBase, splitterResizeTriggerBase, splitterResizeTriggerIndicatorBase, splitterResizeTriggerSeparatorBase, splitterRootBase, stackBase, subscribeDocumentTheme, subscribeDocumentWhichKeyController, subscribeSystemDarkMode, switchControlBase, switchLabelBase, switchThumbBase, switchVariants, syncDocumentDarkMode, syncDocumentTheme, tabsContentBase, tabsIndicatorBase, tabsIndicatorVariants, tabsListBase, tabsListVariants, tabsRootBase, tabsTriggerBase, tagsInputClearTriggerBase, tagsInputControlBase, tagsInputInputBase, tagsInputItemBase, tagsInputItemDeleteTriggerBase, tagsInputItemInputBase, tagsInputItemTextBase, tagsInputRootBase, textareaBase, themeSelectorStyles, toLaTeX, toastActionTriggerBase, toastCloseTriggerBase, toastDescriptionBase, toastIconBase, toastTitleBase, toastVariants, toasterBase, toggleButtonVariants, toggleGroupRootVariants, tooltipArrowBase, tooltipContentBase, tooltipPositionerBase, unregisterImageInsertCallback, unregisterYouTubeInsertCallback, vstackBase, whichKeyBodyVariants, whichKeyBreadcrumbBase, whichKeyExplorerContentBase, whichKeyExplorerHeaderBase, whichKeyExplorerHighlightMarkBase, whichKeyExplorerInputBase, whichKeyExplorerItemBase, whichKeyExplorerListContentBase, whichKeyExplorerListboxBase, whichKeyFooterBase, whichKeyHeaderBase, whichKeyItemBase, whichKeyItemLabelBase, whichKeyModeBadgeVariants, whichKeyTitleBase, whichKeyVariants, windowBodyBase, windowCloseTriggerBase, windowContentBase, windowControlBase, windowDragTriggerBase, windowHeaderBase, windowPositionerBase, windowResizeTriggerBase, windowStageTriggerBase, windowTitleBase, youtubeChapterButtonBase, youtubeChapterLabelBase, youtubeChapterTimeBase, youtubeChaptersBase, youtubeChaptersChevronBase, youtubeChaptersListBase, youtubeChaptersSummaryBase, youtubeDescriptionBase, youtubeFacadeBase, youtubePlayButtonBase, youtubePlayButtonInnerBase, youtubeRootBase, youtubeTitleBase };
package/dist/index.js CHANGED
@@ -63,6 +63,7 @@ __export(index_exports, {
63
63
  codeBlockSpinnerBase: () => codeBlockSpinnerBase,
64
64
  codeBlockTitleBase: () => codeBlockTitleBase,
65
65
  colBase: () => colBase,
66
+ collectVisitedProxies: () => collectVisitedProxies,
66
67
  comboboxClearTriggerBase: () => comboboxClearTriggerBase,
67
68
  comboboxContentBase: () => comboboxContentBase,
68
69
  comboboxControlBase: () => comboboxControlBase,
@@ -2140,6 +2141,7 @@ __export(which_key_exports, {
2140
2141
  DEFAULT_JUMP_ALPHABET: () => DEFAULT_JUMP_ALPHABET,
2141
2142
  Jumplist: () => Jumplist,
2142
2143
  buildWhichKeyTree: () => buildWhichKeyTree,
2144
+ collectVisitedProxies: () => collectVisitedProxies,
2143
2145
  createHelixPreset: () => createHelixPreset,
2144
2146
  createJumplist: () => createJumplist,
2145
2147
  createKakounePreset: () => createKakounePreset,
@@ -2208,10 +2210,10 @@ function normalizeNodeModes(node) {
2208
2210
  }
2209
2211
  function getNodeChildren(node, rootTrie, visitedProxies = /* @__PURE__ */ new Set()) {
2210
2212
  let proxyChildren = {};
2213
+ const nextVisited = new Set(visitedProxies);
2211
2214
  if (node.proxy && node.proxy.length > 0) {
2212
2215
  const proxyKey = node.proxy.join(">");
2213
2216
  if (!visitedProxies.has(proxyKey)) {
2214
- const nextVisited = new Set(visitedProxies);
2215
2217
  nextVisited.add(proxyKey);
2216
2218
  const target = resolveNodeInternal(rootTrie, node.proxy, void 0, nextVisited, rootTrie);
2217
2219
  if (target) {
@@ -2220,25 +2222,60 @@ function getNodeChildren(node, rootTrie, visitedProxies = /* @__PURE__ */ new Se
2220
2222
  }
2221
2223
  }
2222
2224
  const expandedChildren = node.expand ? node.expand() : {};
2223
- return {
2225
+ const combined = {
2224
2226
  ...proxyChildren,
2225
2227
  ...expandedChildren,
2226
2228
  ...node.children ?? {}
2227
2229
  };
2230
+ if (nextVisited.size > 0) {
2231
+ for (const [childKey, childNode] of Object.entries(combined)) {
2232
+ if (childNode.proxy && childNode.proxy.length > 0 && nextVisited.has(childNode.proxy.join(">")) && !childNode.action && !childNode.commandId && !childNode.children && !childNode.expand) {
2233
+ delete combined[childKey];
2234
+ }
2235
+ }
2236
+ }
2237
+ return combined;
2238
+ }
2239
+ function collectVisitedProxies(rootTrie, path, proxyRootTrie = rootTrie) {
2240
+ const visited = /* @__PURE__ */ new Set();
2241
+ let currentMap = rootTrie;
2242
+ for (let i = 0; i < path.length; i += 1) {
2243
+ const step = path[i];
2244
+ if (!step) break;
2245
+ const stepPathKey = path.slice(0, i + 1).join(">");
2246
+ visited.add(stepPathKey);
2247
+ const candidate = currentMap[step];
2248
+ if (!candidate) break;
2249
+ if (i < path.length - 1) {
2250
+ currentMap = getNodeChildren(candidate, proxyRootTrie, visited);
2251
+ if (candidate.proxy && candidate.proxy.length > 0) {
2252
+ visited.add(candidate.proxy.join(">"));
2253
+ }
2254
+ }
2255
+ }
2256
+ return visited;
2228
2257
  }
2229
2258
  function resolveNodeInternal(rootTrie, path, mode, visitedProxies, proxyRootTrie = rootTrie) {
2230
2259
  if (path.length === 0) return null;
2231
2260
  let currentMap = rootTrie;
2232
2261
  let currentNode = null;
2262
+ const pathVisited = new Set(visitedProxies);
2233
2263
  for (let i = 0; i < path.length; i += 1) {
2234
2264
  const step = path[i];
2235
2265
  if (!step) return null;
2236
2266
  const candidate = currentMap[step];
2237
2267
  if (!candidate) return null;
2238
2268
  if (mode && !nodeMatchesMode(candidate, mode)) return null;
2269
+ if (candidate.proxy && candidate.proxy.length > 0 && pathVisited.has(candidate.proxy.join(">")) && !candidate.action && !candidate.commandId && !candidate.children && !candidate.expand) {
2270
+ return null;
2271
+ }
2239
2272
  currentNode = candidate;
2240
2273
  if (i < path.length - 1) {
2241
- currentMap = getNodeChildren(candidate, proxyRootTrie, visitedProxies);
2274
+ pathVisited.add(path.slice(0, i + 1).join(">"));
2275
+ currentMap = getNodeChildren(candidate, proxyRootTrie, pathVisited);
2276
+ if (candidate.proxy && candidate.proxy.length > 0) {
2277
+ pathVisited.add(candidate.proxy.join(">"));
2278
+ }
2242
2279
  }
2243
2280
  }
2244
2281
  return currentNode;
@@ -2246,8 +2283,8 @@ function resolveNodeInternal(rootTrie, path, mode, visitedProxies, proxyRootTrie
2246
2283
  function resolveNode(rootTrie, path, mode, proxyRootTrie = rootTrie) {
2247
2284
  return resolveNodeInternal(rootTrie, path, mode, /* @__PURE__ */ new Set(), proxyRootTrie);
2248
2285
  }
2249
- function isGroupNode(node, rootTrie) {
2250
- const children = getNodeChildren(node, rootTrie);
2286
+ function isGroupNode(node, rootTrie, visitedProxies = /* @__PURE__ */ new Set()) {
2287
+ const children = getNodeChildren(node, rootTrie, visitedProxies);
2251
2288
  return Object.keys(children).length > 0;
2252
2289
  }
2253
2290
  function formatWhichKeyLabel(label) {
@@ -2279,7 +2316,8 @@ function buildWhichKeyTree(rootTrie, activePath, mode) {
2279
2316
  sticky: false
2280
2317
  };
2281
2318
  }
2282
- const childrenMap = getNodeChildren(node, rootTrie);
2319
+ const visitedProxies = collectVisitedProxies(rootTrie, activePath);
2320
+ const childrenMap = getNodeChildren(node, rootTrie, visitedProxies);
2283
2321
  const items = Object.values(childrenMap).filter((item) => !item.hidden && nodeMatchesMode(item, mode));
2284
2322
  let sticky = Boolean(node.sticky || node.loop);
2285
2323
  if (!sticky && node.proxy && node.proxy.length > 0) {
@@ -2678,16 +2716,6 @@ function createWindowMenu() {
2678
2716
  description: "Cycle focus to the previous registered pane",
2679
2717
  category: "Window / Pane",
2680
2718
  commandId: "pane.prev"
2681
- },
2682
- s: {
2683
- key: "s",
2684
- label: "Sticky Window",
2685
- group: "Sticky Window Mode",
2686
- description: "Keep Window menu open until Escape",
2687
- category: "Window / Pane",
2688
- sticky: true,
2689
- loop: true,
2690
- proxy: ["Control+w"]
2691
2719
  }
2692
2720
  }
2693
2721
  };
@@ -3635,7 +3663,7 @@ function getPresetKeymap(preset, leaderKey = "Space") {
3635
3663
  // src/which-key/controller.ts
3636
3664
  import { isModifierKey as isModifierKey2, normalizeKeyName as normalizeKeyName2, parseKeyboardEvent } from "@tanstack/hotkeys";
3637
3665
  import { trackDismissableBranch } from "@zag-js/dismissable";
3638
- import { getFirstFocusable, getFocusables, isEditableElement, isInView } from "@zag-js/dom-query";
3666
+ import { getFocusables, isEditableElement, isInView } from "@zag-js/dom-query";
3639
3667
  import { setInteractionModality, trackInteractionModality } from "@zag-js/focus-visible";
3640
3668
  import { createLiveRegion } from "@zag-js/live-region";
3641
3669
  var PRIORITY_WEIGHT = {
@@ -4235,6 +4263,7 @@ function createWhichKeyController(options = {}) {
4235
4263
  let rawJumpTargets = [];
4236
4264
  let statusMessage = "";
4237
4265
  let programmaticFocusDepth = 0;
4266
+ let lastEnterActivatedButton = null;
4238
4267
  let liveRegion = null;
4239
4268
  let detachCleanups = [];
4240
4269
  function resolveDoc() {
@@ -4315,9 +4344,10 @@ function createWhichKeyController(options = {}) {
4315
4344
  return trie;
4316
4345
  }
4317
4346
  function syncPaneActiveAttributes() {
4347
+ const hasMultiplePanes = getOrderedPanes().length > 1;
4318
4348
  for (const pane of panes.values()) {
4319
4349
  if (pane.element && typeof pane.element.setAttribute === "function") {
4320
- pane.element.setAttribute("data-pane-active", pane.id === activePaneId ? "true" : "false");
4350
+ pane.element.setAttribute("data-pane-active", hasMultiplePanes && pane.id === activePaneId ? "true" : "false");
4321
4351
  }
4322
4352
  }
4323
4353
  }
@@ -5044,41 +5074,78 @@ function createWhichKeyController(options = {}) {
5044
5074
  return true;
5045
5075
  }
5046
5076
  function stepSection(delta) {
5047
- const container = getActiveContainer();
5077
+ const doc = resolveDoc();
5078
+ const ownScope = options.getScopeElement?.() ?? null;
5079
+ const container = !ownScope && panes.has("docs-main") && panes.get("docs-main")?.element ? panes.get("docs-main").element : getActiveContainer();
5048
5080
  if (!container) return false;
5049
- const sections = Array.from(
5050
- container.querySelectorAll(
5051
- '[data-page-section], [data-slot="page-section"], section[id], .docs-prose :is(h2, h3)'
5081
+ const selector = ownScope ? '[data-page-section], [data-slot="page-section"], section[id], .docs-prose :is(h1, h2, h3)' : 'h1:not([data-demo] *), [data-page-section]:not([data-demo] *), [data-slot="page-section"]:not([data-demo] *), section[id]:not([data-demo] *), .docs-prose :is(h1, h2, h3):not([data-demo] *)';
5082
+ const rawSections = Array.from(container.querySelectorAll(selector));
5083
+ const sections = rawSections.filter(
5084
+ (el) => !rawSections.some(
5085
+ (other) => other !== el && (other.hasAttribute?.("data-page-section") || other.getAttribute?.("data-slot") === "page-section" || other.tagName === "SECTION") && other.contains(el)
5052
5086
  )
5053
5087
  );
5054
5088
  if (sections.length === 0) {
5055
- return stepFocusInPane(delta);
5089
+ if (ownScope && doc) {
5090
+ const rootCtrl = rootControllerByDoc.get(doc);
5091
+ if (rootCtrl && rootCtrl !== controllerApi) {
5092
+ return rootCtrl.executeCommand(delta >= 0 ? "motion.paragraphForward" : "motion.paragraphBackward", {
5093
+ count: Math.abs(delta)
5094
+ });
5095
+ }
5096
+ }
5097
+ return false;
5056
5098
  }
5057
- const doc = resolveDoc();
5058
5099
  const activeEl = doc?.activeElement;
5059
- const currentIdx = activeEl ? sections.findIndex((s) => s === activeEl || s.contains(activeEl)) : -1;
5100
+ let currentIdx = activeEl ? sections.findIndex((s) => s === activeEl || s.contains(activeEl)) : -1;
5101
+ if (currentIdx === -1 && activeEl && activeEl !== doc?.body && activeEl !== doc?.documentElement && container.contains(activeEl)) {
5102
+ for (let i = sections.length - 1; i >= 0; i -= 1) {
5103
+ const sec = sections[i];
5104
+ if (typeof sec.compareDocumentPosition === "function" && Boolean(sec.compareDocumentPosition(activeEl) & 4)) {
5105
+ currentIdx = i;
5106
+ break;
5107
+ }
5108
+ }
5109
+ }
5110
+ if (currentIdx === -1 && typeof sections[0]?.getBoundingClientRect === "function") {
5111
+ const firstRect = sections[0].getBoundingClientRect();
5112
+ const lastRect = sections[sections.length - 1].getBoundingClientRect();
5113
+ if (firstRect.height > 0 || lastRect.top !== firstRect.top) {
5114
+ const viewportAnchor = 140;
5115
+ for (let i = sections.length - 1; i >= 0; i -= 1) {
5116
+ if (sections[i].getBoundingClientRect().top <= viewportAnchor) {
5117
+ currentIdx = i;
5118
+ break;
5119
+ }
5120
+ }
5121
+ }
5122
+ }
5060
5123
  const nextIdx = currentIdx === -1 ? delta >= 0 ? 0 : sections.length - 1 : Math.max(0, Math.min(sections.length - 1, currentIdx + delta));
5061
5124
  const targetSection = sections[nextIdx];
5062
5125
  if (!targetSection) return false;
5063
5126
  recordCurrentLocation();
5064
- if (typeof targetSection.scrollIntoView === "function") {
5127
+ if (!ownScope && doc) {
5128
+ lastInteractedScopeByDoc.set(doc, null);
5129
+ }
5130
+ if (nextIdx === 0 && delta < 0 && !ownScope && doc?.defaultView && !isScrollableContainer(container, doc)) {
5131
+ try {
5132
+ doc.defaultView.scrollTo({ top: 0, behavior: "instant" });
5133
+ } catch {
5134
+ doc.defaultView.scrollTo(0, 0);
5135
+ }
5136
+ } else if (typeof targetSection.scrollIntoView === "function") {
5065
5137
  try {
5066
5138
  targetSection.scrollIntoView({ block: "start", behavior: "instant" });
5067
5139
  } catch {
5068
5140
  }
5069
5141
  }
5070
- const innerFocusable = getPaneFocusableItems(targetSection, options.getScopeElement?.())[0] ?? getFirstFocusable(targetSection, { includeContainer: false });
5071
- if (innerFocusable instanceof HTMLElement) {
5072
- focusElementInActivePane(innerFocusable);
5073
- } else {
5074
- runProgrammaticFocus(() => {
5075
- if (targetSection.tabIndex < 0) {
5076
- targetSection.tabIndex = -1;
5077
- }
5078
- targetSection.style.outline = "none";
5079
- targetSection.focus({ preventScroll: true });
5080
- });
5081
- }
5142
+ runProgrammaticFocus(() => {
5143
+ if (targetSection.tabIndex < 0) {
5144
+ targetSection.tabIndex = -1;
5145
+ }
5146
+ targetSection.style.outline = "none";
5147
+ targetSection.focus({ preventScroll: true });
5148
+ });
5082
5149
  recordCurrentLocation();
5083
5150
  emit();
5084
5151
  return true;
@@ -5523,18 +5590,23 @@ function createWhichKeyController(options = {}) {
5523
5590
  function evaluateLayersInPrefix(chordCandidates, event) {
5524
5591
  const layers = getOrderedActiveLayers(event, true);
5525
5592
  const mergedTrie = buildMergedTrie();
5593
+ const visitedProxies = collectVisitedProxies(mergedTrie, activePath);
5526
5594
  let matchedAnyNode = false;
5527
5595
  for (const layer of layers) {
5528
5596
  const parentNode = resolveNode(layer.nodes, activePath, mode, mergedTrie);
5529
5597
  if (!parentNode) continue;
5530
- const children = getNodeChildren(parentNode, mergedTrie);
5598
+ const children = getNodeChildren(parentNode, mergedTrie, visitedProxies);
5599
+ const childVisitedProxies = new Set(visitedProxies);
5600
+ if (parentNode.proxy && parentNode.proxy.length > 0) {
5601
+ childVisitedProxies.add(parentNode.proxy.join(">"));
5602
+ }
5531
5603
  for (const candidate of chordCandidates) {
5532
5604
  const child = children[candidate];
5533
5605
  if (!child || !nodeMatchesMode(child, mode)) continue;
5534
5606
  matchedAnyNode = true;
5535
5607
  const ctx = createCommandContext(event);
5536
5608
  if (child.when && !child.when(ctx)) continue;
5537
- if (!child.action && !child.commandId && isGroupNode(child, mergedTrie)) {
5609
+ if (!child.action && !child.commandId && isGroupNode(child, mergedTrie, childVisitedProxies)) {
5538
5610
  activePath = [...activePath, candidate];
5539
5611
  if (child.sticky || child.loop) {
5540
5612
  sticky = true;
@@ -5778,6 +5850,7 @@ function createWhichKeyController(options = {}) {
5778
5850
  return handleJumpKeyDown(event);
5779
5851
  }
5780
5852
  if (activePath.length > 0) {
5853
+ lastEnterActivatedButton = null;
5781
5854
  if (event.key === "Escape") {
5782
5855
  event.preventDefault();
5783
5856
  event.stopPropagation();
@@ -5798,9 +5871,15 @@ function createWhichKeyController(options = {}) {
5798
5871
  if (handled) {
5799
5872
  return true;
5800
5873
  }
5874
+ const wasSilentPrefix = leaderOnly && activePath[0] !== leaderKey;
5801
5875
  if (!sticky) {
5802
5876
  closePrefix();
5803
5877
  }
5878
+ if (wasSilentPrefix && chordCandidates2.includes(leaderKey)) {
5879
+ if (evaluateLayersAtRoot(chordCandidates2, event, { insertModeOnly: false, includePreset: true })) {
5880
+ return true;
5881
+ }
5882
+ }
5804
5883
  if (!matchedAnyNode) {
5805
5884
  event.preventDefault();
5806
5885
  event.stopPropagation();
@@ -5810,20 +5889,27 @@ function createWhichKeyController(options = {}) {
5810
5889
  }
5811
5890
  const chordCandidates = eventToChordKeys(event);
5812
5891
  if (event.key === " " && !event.ctrlKey && !event.metaKey && !event.altKey && targetEl) {
5813
- const role = targetEl.getAttribute("role");
5814
- const isToggleControl = targetEl instanceof HTMLInputElement && (targetEl.type === "checkbox" || targetEl.type === "radio") || role === "checkbox" || role === "switch" || role === "radio";
5892
+ const role = targetEl.getAttribute?.("role") ?? null;
5893
+ const isToggleControl = typeof HTMLInputElement !== "undefined" && targetEl instanceof HTMLInputElement && (targetEl.type === "checkbox" || targetEl.type === "radio") || role === "checkbox" || role === "switch";
5815
5894
  if (isToggleControl) {
5895
+ lastEnterActivatedButton = null;
5816
5896
  return false;
5817
5897
  }
5818
5898
  const isButtonControl = targetEl.tagName === "BUTTON" || role === "button";
5819
- if (isButtonControl) {
5820
- const previewAncestor = targetEl.closest("[data-example-preview]");
5899
+ if (isButtonControl && lastEnterActivatedButton === targetEl) {
5900
+ lastEnterActivatedButton = null;
5901
+ const previewAncestor = targetEl.closest?.("[data-example-preview]") ?? null;
5821
5902
  const ownScope = options.getScopeElement?.() ?? null;
5822
5903
  if (previewAncestor && (!ownScope || !previewAncestor.contains(ownScope))) {
5823
5904
  return false;
5824
5905
  }
5825
5906
  }
5826
5907
  }
5908
+ if (event.key === "Enter" && !event.ctrlKey && !event.metaKey && !event.altKey && targetEl && (targetEl.tagName === "BUTTON" || targetEl.getAttribute?.("role") === "button") && targetEl.getAttribute?.("data-part") !== "trigger" && !targetEl.hasAttribute?.("aria-haspopup") && targetEl.closest?.("[data-example-preview]")) {
5909
+ lastEnterActivatedButton = targetEl;
5910
+ } else {
5911
+ lastEnterActivatedButton = null;
5912
+ }
5827
5913
  if (chordCandidates.length > 0) {
5828
5914
  const rootTrie = buildMergedTrie();
5829
5915
  for (const candidate of chordCandidates) {
@@ -5869,7 +5955,7 @@ function createWhichKeyController(options = {}) {
5869
5955
  }
5870
5956
  return true;
5871
5957
  }
5872
- const parentExample = targetEl instanceof HTMLElement && !targetEl.hasAttribute("data-example") ? targetEl.closest("[data-example]") : null;
5958
+ const parentExample = isHTMLElementLike(targetEl) && !targetEl.hasAttribute?.("data-example") ? targetEl.closest?.("[data-example]") : null;
5873
5959
  const hasOpenFloatingSurface = Boolean(
5874
5960
  doc?.querySelector(
5875
5961
  '[data-scope="popover"][data-state="open"], [data-scope="menu"][data-state="open"], [data-scope="select"][data-state="open"], [data-scope="combobox"][data-state="open"], [role="dialog"]:not([hidden]):not([data-state="closed"]), [role="listbox"]:not([hidden]):not([data-state="closed"]), [aria-expanded="true"]'
@@ -5888,7 +5974,7 @@ function createWhichKeyController(options = {}) {
5888
5974
  }
5889
5975
  return false;
5890
5976
  }
5891
- if (event.key === "Enter" && !event.ctrlKey && !event.metaKey && !event.altKey && targetEl instanceof HTMLElement && targetEl.hasAttribute("data-example")) {
5977
+ if (event.key === "Enter" && !event.ctrlKey && !event.metaKey && !event.altKey && isHTMLElementLike(targetEl) && targetEl.hasAttribute?.("data-example")) {
5892
5978
  event.preventDefault();
5893
5979
  event.stopPropagation();
5894
5980
  return enterExampleContainer(targetEl);
@@ -5998,15 +6084,22 @@ function createWhichKeyController(options = {}) {
5998
6084
  emit();
5999
6085
  const onPointerDown = (e) => {
6000
6086
  if (!isControllerEnabled()) return;
6087
+ lastEnterActivatedButton = null;
6001
6088
  const targetNode = e.target instanceof Element ? e.target : null;
6002
6089
  if (!targetNode) return;
6003
- if (!targetNode.closest(
6004
- '[data-which-key-root], [data-which-key-explorer], [data-which-key-jump-overlay], [data-scope="dialog"]'
6005
- )) {
6090
+ const isInsideOverlay = Boolean(
6091
+ targetNode.closest(
6092
+ '[data-which-key-root], [data-which-key-explorer], [data-which-key-jump-overlay], [data-scope="dialog"]'
6093
+ )
6094
+ );
6095
+ if (!isInsideOverlay) {
6006
6096
  const clickedScope = targetNode.closest("[data-which-key-scope]") ?? null;
6007
6097
  if (!clickedScope || isScopeElementActive(clickedScope, doc)) {
6008
6098
  lastInteractedScopeByDoc.set(doc, clickedScope);
6009
6099
  }
6100
+ if (activePath.length > 0 || countBuffer.length > 0) {
6101
+ closePrefix();
6102
+ }
6010
6103
  }
6011
6104
  if (!shouldEntryHandleEvent(entry, doc)) return;
6012
6105
  for (const pane of panes.values()) {
@@ -6022,10 +6115,15 @@ function createWhichKeyController(options = {}) {
6022
6115
  "[data-which-key-explorer], [data-command-palette], [data-command-menu], [data-colon-command]"
6023
6116
  ) && (mode === "normal" || mode === "select")) {
6024
6117
  setMode("insert");
6118
+ } else if (mode === "insert" && !isInsideOverlay && !isTextEntryElement(targetNode) && !getModalEditor(targetNode) && !targetNode.closest(
6119
+ '[data-scope="editor"], [data-editor-toolbar], .ProseMirror, [data-editor-overlay], [data-slash-menu-surface], [data-mention-menu-surface], [data-editor-slash-menu], [data-editor-mention-menu], [data-scope="select"], [data-scope="menu"], [data-scope="popover"], [data-scope="combobox"]'
6120
+ )) {
6121
+ setMode("normal");
6025
6122
  }
6026
6123
  };
6027
6124
  const onFocusIn = (e) => {
6028
6125
  if (!isControllerEnabled()) return;
6126
+ lastEnterActivatedButton = null;
6029
6127
  const targetNode = e.target instanceof HTMLElement ? e.target : null;
6030
6128
  if (!targetNode) return;
6031
6129
  if (programmaticFocusDepth === 0 && !targetNode.closest(
@@ -6878,8 +6976,6 @@ function createModalTargetForEditor(editor, options) {
6878
6976
  }
6879
6977
  } else if (targetBlock.isAtom && NodeSelection.isSelectable(targetBlock.node)) {
6880
6978
  tr = tr.setSelection(NodeSelection.create(doc, targetBlock.pos));
6881
- } else if (isSelectionFirst) {
6882
- tr = tr.setSelection(TextSelection.create(doc, targetBlock.start, targetBlock.end));
6883
6979
  } else {
6884
6980
  tr = tr.setSelection(TextSelection.create(doc, targetBlock.start));
6885
6981
  }
@@ -8592,6 +8688,7 @@ export {
8592
8688
  codeBlockSpinnerBase,
8593
8689
  codeBlockTitleBase,
8594
8690
  colBase,
8691
+ collectVisitedProxies,
8595
8692
  comboboxClearTriggerBase,
8596
8693
  comboboxContentBase,
8597
8694
  comboboxControlBase,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudvoyant/helical-ui",
3
- "version": "0.23.1",
3
+ "version": "0.24.0",
4
4
  "description": "helical-ui shared component interfaces, cva variants, and theme",
5
5
  "license": "MIT",
6
6
  "type": "module",