@ox-content/vite-plugin 3.0.0-alpha.7 → 3.0.0-alpha.9

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.
package/dist/index.cjs CHANGED
@@ -2794,7 +2794,7 @@ function decodeHtmlEntities(value) {
2794
2794
  }).replace(/&/g, "&");
2795
2795
  }
2796
2796
  const TYPED_HOVER_STYLE = `<style data-ox-typed-hover-style>.ox-typed-hover-token{cursor:help;text-decoration:underline dotted}.ox-typed-hover-overlay{position:fixed;z-index:50;max-width:36rem;padding:.35rem .55rem;border:1px solid #444;border-radius:4px;background:#1e1e1e;color:#d4d4d4;font:12px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;pointer-events:none}</style>`;
2797
- const TYPED_HOVER_CLIENT = `<script data-ox-typed-hover-runtime>(function(){if(window.__oxTypedHover)return;window.__oxTypedHover=1;var tip=document.createElement("div");tip.className="ox-typed-hover-overlay";tip.setAttribute("role","tooltip");tip.hidden=true;document.body.appendChild(tip);function payload(token){var pre=token.closest(".ox-typed-hover");if(!pre)return null;var host=pre.closest(".ox-code")||pre;var data=host.nextElementSibling;if(!data||!data.classList.contains("ox-typed-hover-data"))return null;try{return JSON.parse(data.textContent||"")}catch(e){return null}}function show(token){var data=payload(token);var item=data&&data.hovers[Number(token.getAttribute("data-ox-typed-hover"))];if(!item)return;tip.textContent=item.type;tip.hidden=false;var box=token.getBoundingClientRect();tip.style.left=Math.max(8,box.left)+"px";tip.style.top=Math.max(8,box.top-tip.offsetHeight-8)+"px"}function hide(){tip.hidden=true}document.addEventListener("mouseover",function(e){var t=e.target.closest(".ox-typed-hover-token");if(t)show(t)});document.addEventListener("mouseout",function(e){var t=e.target.closest(".ox-typed-hover-token");if(t&&!t.contains(e.relatedTarget))hide()});document.addEventListener("focusin",function(e){var t=e.target.closest(".ox-typed-hover-token");if(t)show(t)});document.addEventListener("focusout",function(e){if(!e.relatedTarget||!e.relatedTarget.closest(".ox-typed-hover-token"))hide()});document.addEventListener("keydown",function(e){if(e.key==="Escape")hide()})})();<\/script>`;
2797
+ const TYPED_HOVER_CLIENT = `<script data-ox-typed-hover-runtime>(function(){if(window.__oxTypedHover)return;window.__oxTypedHover=1;var tip=document.createElement("div");tip.className="ox-typed-hover-overlay";tip.setAttribute("role","tooltip");tip.hidden=true;document.body.appendChild(tip);function closest(value,selector){return value instanceof Element?value.closest(selector):null}function nextData(host){var node=host.nextElementSibling;while(node&&node.tagName==="SCRIPT"&&!node.classList.contains("ox-typed-hover-data"))node=node.nextElementSibling;return node}function payload(token){var pre=token.closest(".ox-typed-hover");if(!pre)return null;var host=pre.closest(".ox-code")||pre;var data=nextData(host)||nextData(pre);if(!data||!data.classList.contains("ox-typed-hover-data"))return null;try{return JSON.parse(data.textContent||"")}catch(e){return null}}function show(token){var data=payload(token);var item=data&&data.hovers[Number(token.getAttribute("data-ox-typed-hover"))];if(!item)return;tip.textContent=item.type;tip.hidden=false;var box=token.getBoundingClientRect();tip.style.left=Math.max(8,box.left)+"px";tip.style.top=Math.max(8,box.top-tip.offsetHeight-8)+"px"}function hide(){tip.hidden=true}document.addEventListener("mouseover",function(e){var t=closest(e.target,".ox-typed-hover-token");if(t)show(t)});document.addEventListener("mouseout",function(e){var t=closest(e.target,".ox-typed-hover-token");if(t&&!t.contains(e.relatedTarget))hide()});document.addEventListener("focusin",function(e){var t=closest(e.target,".ox-typed-hover-token");if(t)show(t)});document.addEventListener("focusout",function(e){if(!closest(e.relatedTarget,".ox-typed-hover-token"))hide()});document.addEventListener("keydown",function(e){if(e.key==="Escape")hide()})})();<\/script>`;
2798
2798
  //#endregion
2799
2799
  //#region src/file-tree-options.ts
2800
2800
  const disabled = {
@@ -8670,6 +8670,7 @@ function hostedClientOptions(options) {
8670
8670
  enabled: options.enabled,
8671
8671
  limit: options.limit,
8672
8672
  prefix: options.prefix,
8673
+ fuzzy: options.fuzzy,
8673
8674
  placeholder: options.placeholder,
8674
8675
  hotkey: options.hotkey,
8675
8676
  provider: "hosted"
@@ -8755,6 +8756,7 @@ function toLocalSearchRuntimeOptions(options) {
8755
8756
  enabled: options.enabled,
8756
8757
  limit: options.limit,
8757
8758
  prefix: options.prefix,
8759
+ fuzzy: options.fuzzy,
8758
8760
  placeholder: options.placeholder,
8759
8761
  hotkey: options.hotkey
8760
8762
  };
@@ -8784,6 +8786,7 @@ function resolveSearchOptions(options) {
8784
8786
  enabled: false,
8785
8787
  limit: 10,
8786
8788
  prefix: true,
8789
+ fuzzy: false,
8787
8790
  placeholder: "Search documentation...",
8788
8791
  hotkey: "/",
8789
8792
  provider: "local"
@@ -8795,6 +8798,7 @@ function resolveSearchOptions(options) {
8795
8798
  enabled,
8796
8799
  limit: opts.limit ?? 10,
8797
8800
  prefix: opts.prefix ?? true,
8801
+ fuzzy: opts.fuzzy ?? false,
8798
8802
  placeholder: opts.placeholder ?? "Search documentation...",
8799
8803
  hotkey: opts.hotkey ?? "/",
8800
8804
  provider