@visulima/ono 2.0.0-alpha.8 → 2.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/CHANGELOG.md +16 -0
- package/dist/error-inspector/page/create-request-context.js +45 -45
- package/dist/index.js +145 -116
- package/dist/packem_chunks/min-dark.js +1 -0
- package/dist/packem_chunks/min-light.js +1 -0
- package/dist/packem_shared/clipboard-jWc8JBuB.js +1 -0
- package/dist/packem_shared/process-BO_aZsiL.js +1 -0
- package/dist/server/open-in-editor.js +1 -1
- package/package.json +164 -165
- package/dist/packem_chunks/github-dark-default.js +0 -1
- package/dist/packem_chunks/github-light.js +0 -1
- package/dist/packem_shared/clipboard-CzFaiOZC.js +0 -1
- package/dist/packem_shared/process-B37didfB.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## @visulima/ono [2.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.8...@visulima/ono@2.0.0-alpha.9) (2026-04-08)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **ono:** properly fix eslint errors in code ([ca1d1a2](https://github.com/visulima/visulima/commit/ca1d1a2aa4d4db69f2f38d2b85d8df5e32b906fb))
|
|
6
|
+
* **ono:** remove remaining eslint suppressions with proper code fixes ([ab20811](https://github.com/visulima/visulima/commit/ab20811c01df07a836303c4b4a478de79d1d338c))
|
|
7
|
+
* **ono:** resolve eslint errors ([4d8e045](https://github.com/visulima/visulima/commit/4d8e0455f2420bef082e3aa3f00e76461e8c17c8))
|
|
8
|
+
* **ono:** use min-dark/min-light shiki themes for code highlighting ([793a345](https://github.com/visulima/visulima/commit/793a345bbb9dc6520ce8d37a3488a83b1cbe8ce2))
|
|
9
|
+
* remove deprecated baseUrl and downlevelIteration from tsconfigs ([a708366](https://github.com/visulima/visulima/commit/a708366b5c3bc73cfde480a712ed397bd921fb93))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* **@visulima/error:** upgraded to 6.0.0-alpha.8
|
|
15
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.8
|
|
16
|
+
|
|
1
17
|
## @visulima/ono [2.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.7...@visulima/ono@2.0.0-alpha.8) (2026-03-26)
|
|
2
18
|
|
|
3
19
|
### Features
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var ie=Object.defineProperty;var T=(e,
|
|
1
|
+
var ie=Object.defineProperty;var T=(e,r)=>ie(e,"name",{value:r,configurable:!0});import{a as G,s as P,n as X,e as W,d as de,g as le,c as ce}from"../../packem_shared/clipboard-jWc8JBuB.js";const q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",S="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M6%2022a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h8a2.4%202.4%200%200%201%201.704.706l3.588%203.588A2.4%202.4%200%200%201%2020%208v12a2%202%200%200%201-2%202z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v5a1%201%200%200%200%201%201h5%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",J="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",R="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ve=Object.defineProperty,ue=T((e,r)=>ve(e,"name",{value:r,configurable:!0}),"s$2");const O=ue(({label:e="Copy",successText:r="Copied!",targetId:o})=>{const c=G(o),m=G(e),x=P(e),l=P(r);return{html:`
|
|
2
2
|
<button
|
|
3
3
|
type="button"
|
|
4
|
-
aria-label="${
|
|
4
|
+
aria-label="${m}"
|
|
5
5
|
title="${x}"
|
|
6
6
|
class="ono-copy-btn relative inline-flex justify-center items-center size-8 rounded-[var(--ono-radius-md)] shadow-[var(--ono-elevation-1)] bg-[var(--ono-surface)] text-[var(--ono-text)] hover:bg-[var(--ono-hover-overlay)] focus:outline-hidden focus:bg-[var(--ono-hover-overlay)] disabled:opacity-50 disabled:pointer-events-none cursor-pointer"
|
|
7
7
|
data-target="#${c}"
|
|
@@ -11,50 +11,50 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
|
|
|
11
11
|
<span class="ono-copy-success dui hidden size-4 text-[var(--ono-red-orange)]" style="-webkit-mask-image: url('${W}'); mask-image: url('${W}')"></span>
|
|
12
12
|
<span class="sr-only">${x}</span>
|
|
13
13
|
</button>
|
|
14
|
-
`}},"copyButton");var pe=Object.defineProperty,j=T((e,
|
|
15
|
-
… [truncated]`);return}
|
|
16
|
-
`)}`),v
|
|
17
|
-
<div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(
|
|
18
|
-
<div class="text-sm break-words whitespace-pre-wrap text-[var(--ono-text)]">${f(
|
|
19
|
-
</div>`}).join("")}</div>`,"renderKeyValueTable"),te=
|
|
14
|
+
`}},"copyButton");var pe=Object.defineProperty,j=T((e,r)=>pe(e,"name",{value:r,configurable:!0}),"s$1");const me=typeof globalThis<"u"&&"Request"in globalThis,Z=j((e,r)=>r in e,"hasProperty"),V=j((e,r)=>Z(e,r)&&typeof e[r]=="function","hasMethod"),ee=j((e,r)=>Z(e,r)&&typeof e[r]=="string","hasStringProperty"),xe=j(e=>me&&V(e,"clone"),"isNativeRequest"),be=j(e=>V(e,"on")&&ee(e,"method"),"isIncomingMessage");j(e=>!xe(e)&&!be(e)&&ee(e,"method"),"isExpressRequest");const L=j(e=>typeof e=="object"&&e!==null&&V(e,"forEach")&&V(e,"get"),"isHeadersObject");var ge=Object.defineProperty,a=T((e,r)=>ge(e,"name",{value:r,configurable:!0}),"s");const he=[/authorization/i,/cookie/i,/set-cookie/i,/x-api-key/i,/api-key/i,/x-auth/i,/token/i,/secret/i],H=a((e,r)=>{if(typeof e=="object"&&e!==null&&r in e)return e[r]},"safeGetProperty"),p=a((e,r)=>{const o=H(e,r);return typeof o=="function"?o:void 0},"safeGetMethod"),A=a((e,r)=>{const o=H(e,r);return typeof o=="string"?o:void 0},"safeGetString"),fe=a((e,r)=>r?.some(o=>o.toLowerCase()===e.toLowerCase())?!0:he.some(o=>o.test(e)),"isSensitiveHeader"),ye=a(e=>{if(!e)return[];if(L(e)){const r=p(e,"entries");if(r){const o=r();return Array.from(o,([c,m])=>[c,m])}}return Object.entries(e)},"normalizeHeadersToEntries"),$e=a((e,r)=>!r||r.length===0?!0:r.some(o=>o.toLowerCase()===e.toLowerCase()),"shouldIncludeHeader"),we=a((e,r)=>!e||!r?e:Array.isArray(e)?e.map(()=>r):r,"maskHeaderValue"),ke=a((e,r,o,c="[masked]")=>{const m=ye(e);if(m.length===0)return;const x={};return m.forEach(([l,n])=>{if(!$e(l,r)||n===void 0)return;const b=fe(l.toLowerCase(),o)?c:void 0;x[l]=we(n,b)}),x},"filterHeaders"),Y=a(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},"safeJsonStringify"),De=a(e=>{if(!e)return{};const r={};return e.split(";").map(o=>o.trim()).filter(Boolean).forEach(o=>{const c=o.indexOf("=");if(c===-1)return;const m=o.slice(0,c).trim(),x=o.slice(c+1).trim();r[m]=x}),r},"parseCookieString"),Ce=a(async(e,r)=>{try{const o=(A(e,"method")??"GET").toUpperCase();if(o==="GET"||o==="HEAD")return;const c=H(e,"headers"),m=L(c)?p(c,"get")?.("content-type")??"":String(c["content-type"]??""),x=p(e,"clone"),l=x?x():e;if(p(l,"json")&&m.includes("application/json"))try{const n=p(l,"json");return n?await n():void 0}catch{try{const n=p(l,"text");return n?await n()??"":void 0}catch{return}}if(p(l,"text"))try{const n=p(l,"text");return n?await n():void 0}catch{return}return p(e,"on")?await new Promise(n=>{try{let b="",B=!1;const D=p(e,"setEncoding");D&&D("utf8");const C=a(y=>{if(B)return;const M=typeof y=="string"?y:String(y);if(b.length+M.length>r){const k=Math.max(0,r-b.length);b+=M.slice(0,k),B=!0,h(),n(`${b}
|
|
15
|
+
… [truncated]`);return}b+=M},"onData"),E=a(()=>{h(),n(b||void 0)},"onEnd"),N=a(()=>{h(),n(void 0)},"onError"),h=a(()=>{const y=p(e,"off");y?.("data",C),y?.("end",E),y?.("error",N)},"cleanup"),F=p(e,"on");F?.("data",C),F?.("end",E),F?.("error",N)}catch{n(void 0)}}):void 0}catch{return}},"readRequestBody"),Fe=a(async(e,r)=>{const o=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`,{headerAllowlist:c,headerDenylist:m,maskValue:x="[masked]"}=r,l=ke(H(e,"headers"),c,m,x),n=a(t=>{if(t!==void 0)return Array.isArray(t)?t.join(", "):t},"toSingle"),b=a(t=>`'${t.replaceAll("'",String.raw`'\''`)}'`,"shellQuote"),B=a(t=>{if(!t)return;const s=[];return Object.entries(t).forEach(([i,d])=>{const g=n(d)??"";s.push(`${i}=${g}`)}),s.length>0?s.join("; "):void 0},"buildCookieHeader");let D;const C=H(e,"headers");if(L(C)){const t=p(C,"get")?.("cookie");D=typeof t=="string"?t:void 0}else if(C!==void 0){const t=C;if(Array.isArray(t.cookie))D=t.cookie[0];else{const s=t.cookie;D=typeof s=="string"?s:void 0}}const E=De(D),N=Math.max(0,r.previewBytes??64e3),h=await Ce(e,N),F=a(()=>{const t=(A(e,"method")??"GET").toUpperCase(),s=A(e,"url")??"",i=[],d={};l&&Object.entries(l).forEach(([$,w])=>{const Q=n(w);Q!==void 0&&(d[$]=Q)});const g=B(E);g&&!d.cookie&&(d.Cookie=g),Object.entries(d).forEach(([$,w])=>{i.push(`-H ${b(`${$}: ${w}`)}`)});let u="";if(h!=null&&t!=="GET"){const $=typeof h=="string"?h:Y(h);u=`--data ${b($)}`}const v=["curl","-X",t];return i.length>0&&v.push("\\",` ${i.join(` \\
|
|
16
|
+
`)}`),u&&v.push("\\",` ${u}`),v.push("\\",` ${b(s)}`),v.join(" ")},"buildCurl")(),y=(await de(["bash"])).codeToHtml(F,{lang:"bash",themes:{dark:"min-dark",light:"min-light"}}),M=le(y),k=a(t=>G(t),"attributeEscape"),f=a(t=>P(t),"escapeHtml"),U=a(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([s,i])=>{const d=Array.isArray(i)?i.join(", "):i;return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
|
|
17
|
+
<div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(s)}</div>
|
|
18
|
+
<div class="text-sm break-words whitespace-pre-wrap text-[var(--ono-text)]">${f(d)}</div>
|
|
19
|
+
</div>`}).join("")}</div>`,"renderKeyValueTable"),te=a(t=>`<span class="text-[var(--ono-red-orange)]">${typeof t=="string"?`"${f(t)}"`:String(t)}</span>`,"renderPrimitiveValue"),re=a(t=>`<span class="italic text-[var(--ono-text-muted)]">${t===null?"null":"undefined"}</span>`,"renderNullishValue"),oe=a((t,s)=>{if(Object.keys(t).length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty object)</span>';if(s>=3)return`<span class="italic text-[var(--ono-text-muted)]">{Object with ${String(Object.keys(t).length)} keys}</span>`;const i=Object.entries(t).slice(0,10).map(([g,u])=>{const v=z(u,s+1);return`
|
|
20
20
|
<div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
|
|
21
|
-
<span class="font-medium text-[var(--ono-text)]">${f(g)}:</span> ${
|
|
22
|
-
</div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${Object.keys(t).length-10} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=
|
|
21
|
+
<span class="font-medium text-[var(--ono-text)]">${f(g)}:</span> ${v}
|
|
22
|
+
</div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${String(Object.keys(t).length-10)} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=a((t,s=0)=>{if(t==null)return re(t);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return te(t);if(Array.isArray(t)){if(t.length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty array)</span>';if(s>=3)return`<span class="italic text-[var(--ono-text-muted)]">[Array with ${String(t.length)} items]</span>`;const i=t.slice(0,10).map((g,u)=>{const v=z(g,s+1);return`
|
|
23
23
|
<div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
|
|
24
|
-
<span class="text-xs text-[var(--ono-text-muted)]">[${
|
|
25
|
-
</div>`}).join(""),d=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${t.length-10} more items</div>`:"";return`<div class="space-y-1">${i}${d}</div>`}return typeof t=="object"?
|
|
26
|
-
<div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(
|
|
24
|
+
<span class="text-xs text-[var(--ono-text-muted)]">[${String(u)}]:</span> ${v}
|
|
25
|
+
</div>`}).join(""),d=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${String(t.length-10)} more items</div>`:"";return`<div class="space-y-1">${i}${d}</div>`}return typeof t=="object"?oe(t,s):`<span class="text-[var(--ono-text)]">${f(typeof t=="symbol"?t.toString():String(t))}</span>`},"renderValue"),_=a(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([s,i])=>{const d=z(i);return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
|
|
26
|
+
<div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(s)}</div>
|
|
27
27
|
<div class="text-sm break-words text-[var(--ono-text)]">${d}</div>
|
|
28
|
-
</div>`}).join("")}</div>`,"renderObjectTable"),
|
|
28
|
+
</div>`}).join("")}</div>`,"renderObjectTable"),ae=a(t=>t==null?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(no body)</div>':typeof t=="string"?t.trim()===""?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty string)</div>':`<div class="px-4 pb-4">
|
|
29
29
|
<div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(t)}</div>
|
|
30
30
|
</div>`:typeof t=="object"?Array.isArray(t)?t.length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty array)</div>':`<div class="px-4 pb-4">
|
|
31
31
|
<div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
|
|
32
32
|
</div>`:Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty object)</div>':`<div class="px-4 pb-4">
|
|
33
33
|
<div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
|
|
34
34
|
</div>`:`<div class="px-4 pb-4">
|
|
35
|
-
<div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(String(t))}</div>
|
|
36
|
-
</div>`,"renderBodyContent"),K=
|
|
35
|
+
<div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(typeof t=="symbol"?t.toString():String(t))}</div>
|
|
36
|
+
</div>`,"renderBodyContent"),K=a(t=>{if(!t)return{content:"",sidebar:""};const s=new Set(["request"]),i=Object.keys(t).filter(u=>!s.has(u));if(i.length===0)return{content:"",sidebar:""};let d="",g="";return i.forEach(u=>{const v=t[u];if(v&&typeof v=="object"&&(Array.isArray(v)||Object.keys(v).length>0)){const $=u.charAt(0).toUpperCase()+u.slice(1),w=`context-${u}`;d+=`
|
|
37
37
|
<div>
|
|
38
|
-
<div class="text-[11px] uppercase tracking-wide mb-2 text-[var(--ono-text-muted)]">${
|
|
38
|
+
<div class="text-[11px] uppercase tracking-wide mb-2 text-[var(--ono-text-muted)]">${$}</div>
|
|
39
39
|
<ul class="space-y-1 text-sm">
|
|
40
40
|
<li>
|
|
41
|
-
<a href="#${
|
|
41
|
+
<a href="#${w}" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)] ono-scrollspy-active:bg-[var(--ono-surface-muted)] ono-scrollspy-active:font-semibold">
|
|
42
42
|
<span class="dui size-3" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
|
|
43
|
-
<span>${
|
|
43
|
+
<span>${$}</span>
|
|
44
44
|
</a>
|
|
45
45
|
</li>
|
|
46
46
|
</ul>
|
|
47
47
|
</div>`,g+=`
|
|
48
|
-
<input type="hidden" id="clipboard-${
|
|
49
|
-
<section id="${
|
|
48
|
+
<input type="hidden" id="clipboard-${w}-${o}" value="${k(JSON.stringify(v))}">
|
|
49
|
+
<section id="${w}" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
|
|
50
50
|
<div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
|
|
51
|
-
<h3 class="text-sm font-semibold text-[var(--ono-text)]">${
|
|
51
|
+
<h3 class="text-sm font-semibold text-[var(--ono-text)]">${$}</h3>
|
|
52
52
|
<div class="grow"></div>
|
|
53
|
-
<a href="#${
|
|
54
|
-
${O({label:"Copy JSON",targetId:`clipboard-${
|
|
53
|
+
<a href="#${w}" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
|
|
54
|
+
${O({label:"Copy JSON",targetId:`clipboard-${w}-${o}`}).html}
|
|
55
55
|
</div>
|
|
56
|
-
<div class="max-w-full overflow-auto mt-2">${_(
|
|
57
|
-
</section>`}}),{content:g,sidebar:d}},"generateContextSections")(
|
|
56
|
+
<div class="max-w-full overflow-auto mt-2">${_(v)}</div>
|
|
57
|
+
</section>`}}),{content:g,sidebar:d}},"generateContextSections")(r.context),se=`
|
|
58
58
|
<aside class="shrink-0 w-64 sticky top-4 self-start">
|
|
59
59
|
<nav aria-label="Context sections" class="p-3 rounded-[var(--ono-radius-md)] shadow-[var(--ono-elevation-1)] space-y-4 overflow-auto bg-[var(--ono-surface)] border border-[var(--ono-border)] max-h-[calc(100dvh-2rem)]">
|
|
60
60
|
<div>
|
|
@@ -62,7 +62,7 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
|
|
|
62
62
|
<ul class="space-y-1 text-sm">
|
|
63
63
|
<li>
|
|
64
64
|
<a href="#context-request" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
|
|
65
|
-
<span class="dui size-3" style="-webkit-mask-image:url('${
|
|
65
|
+
<span class="dui size-3" style="-webkit-mask-image:url('${J}'); mask-image:url('${J}')"></span>
|
|
66
66
|
<span>Overview</span>
|
|
67
67
|
</a>
|
|
68
68
|
</li>
|
|
@@ -86,7 +86,7 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
|
|
|
86
86
|
</li>
|
|
87
87
|
<li>
|
|
88
88
|
<a href="#context-cookies" class="flex items-center gap-2 px-2 py-1 rounded text-[var(--ono-text)] hover:bg-[var(--ono-surface-muted)]">
|
|
89
|
-
<span class="dui size-3" style="-webkit-mask-image:url('${
|
|
89
|
+
<span class="dui size-3" style="-webkit-mask-image:url('${I}'); mask-image:url('${I}')"></span>
|
|
90
90
|
<span>Cookies</span>
|
|
91
91
|
</a>
|
|
92
92
|
</li>
|
|
@@ -95,69 +95,69 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
|
|
|
95
95
|
</nav>
|
|
96
96
|
</aside>`,ne=`
|
|
97
97
|
<div class="grow min-w-0">
|
|
98
|
-
<input type="hidden" id="clipboard-curl-${
|
|
98
|
+
<input type="hidden" id="clipboard-curl-${o}" value="${k(F)}">
|
|
99
99
|
<section id="context-request" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
|
|
100
100
|
<div class="px-4 py-2 flex items-center gap-3 min-w-0 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
|
|
101
|
-
<span class="dui size-4" style="-webkit-mask-image:url('${
|
|
101
|
+
<span class="dui size-4" style="-webkit-mask-image:url('${J}'); mask-image:url('${J}')"></span>
|
|
102
102
|
<h2 class="text-sm font-semibold text-[var(--ono-text)]">Request</h2>
|
|
103
|
-
<a class="text-sm truncate text-[var(--ono-red-orange)]" href="${ce(A(e,"url")
|
|
104
|
-
<span class="inline-block text-[10px] px-2 py-0.5 rounded-full bg-[var(--ono-chip-bg)] text-[var(--ono-chip-text)]">${f(
|
|
103
|
+
<a class="text-sm truncate text-[var(--ono-red-orange)]" href="${ce(A(e,"url")??"#")}">${f(A(e,"url")??"")}</a>
|
|
104
|
+
<span class="inline-block text-[10px] px-2 py-0.5 rounded-full bg-[var(--ono-chip-bg)] text-[var(--ono-chip-text)]">${f(A(e,"method")??"GET")}</span>
|
|
105
105
|
<div class="grow"></div>
|
|
106
|
-
${O({label:"Copy cURL",targetId:`clipboard-curl-${
|
|
106
|
+
${O({label:"Copy cURL",targetId:`clipboard-curl-${o}`}).html}
|
|
107
107
|
</div>
|
|
108
108
|
<div class="px-4 pb-4 overflow-auto mt-2">${M}</div>
|
|
109
109
|
</section>
|
|
110
110
|
|
|
111
|
-
<input type="hidden" id="clipboard-headers-${
|
|
111
|
+
<input type="hidden" id="clipboard-headers-${o}" value="${k(JSON.stringify(l??{}))}">
|
|
112
112
|
<section id="context-headers" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
|
|
113
113
|
<div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
|
|
114
114
|
<span class="dui size-4" style="-webkit-mask-image:url('${S}'); mask-image:url('${S}')"></span>
|
|
115
115
|
<h3 class="text-sm font-semibold text-[var(--ono-text)]">Headers</h3>
|
|
116
116
|
<div class="grow"></div>
|
|
117
117
|
<a href="#context-headers" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
|
|
118
|
-
${O({label:"Copy JSON",targetId:`clipboard-headers-${
|
|
118
|
+
${O({label:"Copy JSON",targetId:`clipboard-headers-${o}`}).html}
|
|
119
119
|
</div>
|
|
120
120
|
<div class="max-w-full overflow-auto mt-2">${U(l)}</div>
|
|
121
121
|
</section>
|
|
122
122
|
|
|
123
|
-
<input type="hidden" id="clipboard-body-${
|
|
123
|
+
<input type="hidden" id="clipboard-body-${o}" value="${k(Y(h??{}))}">
|
|
124
124
|
<section id="context-body" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
|
|
125
125
|
<div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
|
|
126
126
|
<span class="dui size-4" style="-webkit-mask-image:url('${q}'); mask-image:url('${q}')"></span>
|
|
127
127
|
<h3 class="text-sm font-semibold text-[var(--ono-text)]">Body</h3>
|
|
128
128
|
<div class="grow"></div>
|
|
129
129
|
<a href="#context-body" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
|
|
130
|
-
${O({label:"Copy JSON",targetId:`clipboard-body-${
|
|
130
|
+
${O({label:"Copy JSON",targetId:`clipboard-body-${o}`}).html}
|
|
131
131
|
</div>
|
|
132
|
-
<div class="max-w-full overflow-auto mt-2">${
|
|
132
|
+
<div class="max-w-full overflow-auto mt-2">${ae(h)}</div>
|
|
133
133
|
</section>
|
|
134
134
|
|
|
135
|
-
<input type="hidden" id="clipboard-session-${
|
|
135
|
+
<input type="hidden" id="clipboard-session-${o}" value="${k(JSON.stringify(e.session??{}))}">
|
|
136
136
|
<section id="context-session" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
|
|
137
137
|
<div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
|
|
138
138
|
<span class="dui size-4" style="-webkit-mask-image:url('${R}'); mask-image:url('${R}')"></span>
|
|
139
139
|
<h3 class="text-sm font-semibold text-[var(--ono-text)]">Session</h3>
|
|
140
140
|
<div class="grow"></div>
|
|
141
141
|
<a href="#context-session" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
|
|
142
|
-
${O({label:"Copy JSON",targetId:`clipboard-session-${
|
|
142
|
+
${O({label:"Copy JSON",targetId:`clipboard-session-${o}`}).html}
|
|
143
143
|
</div>
|
|
144
|
-
<div class="max-w-full overflow-auto mt-2">${_(e
|
|
144
|
+
<div class="max-w-full overflow-auto mt-2">${_(e.session)}</div>
|
|
145
145
|
</section>
|
|
146
146
|
|
|
147
|
-
<input type="hidden" id="clipboard-cookies-${
|
|
147
|
+
<input type="hidden" id="clipboard-cookies-${o}" value="${k(JSON.stringify(E))}">
|
|
148
148
|
<section id="context-cookies" class="mb-4 rounded-[var(--ono-radius-lg)] shadow-[var(--ono-elevation-1)] overflow-hidden bg-[var(--ono-surface)] border border-[var(--ono-border)]">
|
|
149
149
|
<div class="px-4 py-2 flex items-center gap-2 bg-[var(--ono-surface-muted)] border-b border-[var(--ono-border)]">
|
|
150
|
-
<span class="dui size-4" style="-webkit-mask-image:url('${
|
|
150
|
+
<span class="dui size-4" style="-webkit-mask-image:url('${I}'); mask-image:url('${I}')"></span>
|
|
151
151
|
<h3 class="text-sm font-semibold text-[var(--ono-text)]">Cookies</h3>
|
|
152
152
|
<div class="grow"></div>
|
|
153
153
|
<a href="#context-cookies" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
|
|
154
|
-
${O({label:"Copy JSON",targetId:`clipboard-cookies-${
|
|
154
|
+
${O({label:"Copy JSON",targetId:`clipboard-cookies-${o}`}).html}
|
|
155
155
|
</div>
|
|
156
156
|
<div class="max-w-full overflow-auto mt-2">${U(E)}
|
|
157
157
|
</div>
|
|
158
158
|
</section>${K.content}
|
|
159
159
|
</div>`;return{code:{html:`
|
|
160
160
|
<div class="w-full flex gap-4 relative">
|
|
161
|
-
${
|
|
161
|
+
${se}
|
|
162
162
|
${ne}
|
|
163
163
|
</div>`,script:""},id:"context",name:"Context"}},"createRequestContext");export{Fe as default};
|