efficient-shell 7.67.0 → 7.68.1
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/README.md +7 -2
- package/dist/{Browser-YKQMCWJN.js → Browser-K6G6ZGQV.js} +14 -14
- package/dist/Calculator-4QMTUBOI.js +29 -0
- package/dist/ConfirmDialog-YVFPLUQH.js +1 -0
- package/dist/{CurrencyConverter-OLQEV6VI.js → CurrencyConverter-XGJI3D6B.js} +8 -8
- package/dist/{Documents-M57PJORE.js → Documents-6W6ZCTXS.js} +17 -17
- package/dist/Files-6RZPHMGE.js +87 -0
- package/dist/{Notepad-T3SDT6Z6.js → Notepad-TQQI2KQ4.js} +9 -9
- package/dist/PdfViewer-YELEO346.js +1 -0
- package/dist/{PomodoroTimer-U7AMOHMF.js → PomodoroTimer-GFFJUTH5.js} +23 -23
- package/dist/{Preview-5Q3IKVGD.js → Preview-K5ORQBUY.js} +57 -57
- package/dist/Sidebar-MTO5BBBT.js +43 -0
- package/dist/{Spreadsheet-K73I3IA5.js → Spreadsheet-ZG5LJQ6F.js} +13 -13
- package/dist/{Stock-IJXUEGNO.js → Stock-JLHSJG4M.js} +3 -3
- package/dist/{Weather-W3PSYZMS.js → Weather-IYHZBAOX.js} +14 -14
- package/dist/{WorldClock-2HG7E4OT.js → WorldClock-FMQNCTFU.js} +6 -6
- package/dist/ai/index.js +21 -21
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/chunk-2EJRVQ3Y.js +1 -0
- package/dist/{chunk-FX3LDKDB.js → chunk-2XU3X3MR.js} +98 -98
- package/dist/{chunk-2RSTAB74.js → chunk-2ZRX3NRH.js} +8 -8
- package/dist/{chunk-YZSQ572K.js → chunk-3NYPZO4K.js} +17 -17
- package/dist/{chunk-GOWDMYY4.js → chunk-3X2EQ3UV.js} +4 -4
- package/dist/{chunk-XUV6NWQ2.js → chunk-5MCD5KGU.js} +16 -16
- package/dist/{chunk-ZZWMAATC.js → chunk-6DPQAV2O.js} +10 -10
- package/dist/{chunk-6NI3V3WV.js → chunk-6I4ZV67D.js} +2 -2
- package/dist/{chunk-5YUIRGPU.js → chunk-7B2YKMAZ.js} +5 -5
- package/dist/{chunk-64UADSI5.js → chunk-DAMBAXPA.js} +1 -1
- package/dist/chunk-DELNCIUK.js +2 -0
- package/dist/{chunk-BD54BNPH.js → chunk-DUCUZPU3.js} +10 -10
- package/dist/{chunk-Z5PBCZNS.js → chunk-DYVTVLUE.js} +1 -1
- package/dist/{chunk-RWNNFCSA.js → chunk-EU4BCXGA.js} +1 -1
- package/dist/{chunk-2KJSKZDK.js → chunk-FFRODO6G.js} +1 -1
- package/dist/{chunk-LJLP3HMD.js → chunk-FJ4FO4FV.js} +1 -1
- package/dist/{chunk-DKNO37NW.js → chunk-FT2Q7FVO.js} +25 -25
- package/dist/{chunk-QMQDQE3W.js → chunk-GN5J7DL6.js} +2 -2
- package/dist/{chunk-5SXGTGQE.js → chunk-HCUSNRV3.js} +1 -1
- package/dist/{chunk-M4RQIHBG.js → chunk-I74FRKHQ.js} +1 -1
- package/dist/{chunk-BE6F2GAI.js → chunk-I7JLCPEW.js} +2 -2
- package/dist/{chunk-SCXTNJBZ.js → chunk-L5X6V677.js} +1 -1
- package/dist/chunk-MUYLPPQP.js +1 -0
- package/dist/{chunk-QDQISPNZ.js → chunk-OKFO3XYS.js} +1 -1
- package/dist/{chunk-YWC7G2CN.js → chunk-R57S7SWU.js} +1 -1
- package/dist/{chunk-3E27HV76.js → chunk-RDLWLATO.js} +2 -2
- package/dist/{chunk-72FYG5AK.js → chunk-SLEWYXMY.js} +1 -1
- package/dist/chunk-TPDOOCFS.js +2 -0
- package/dist/{chunk-C3DPVSYL.js → chunk-W64JQLDI.js} +1 -1
- package/dist/{chunk-PPFMVR3U.js → chunk-WQCUNSQL.js} +19 -19
- package/dist/chunk-XWW3SP5W.js +22 -0
- package/dist/{chunk-YIC644QO.js → chunk-YJIG2KT3.js} +3 -3
- package/dist/{chunk-UYIPX3GN.js → chunk-YMIHGT3B.js} +329 -329
- package/dist/file-intake/index.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/{index-B6kl2VTe.d.ts → index-Dr5yL2I_.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +202 -199
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +8 -8
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/{strings-C_0nDRsv.d.ts → strings-Dh85JfDa.d.ts} +8 -0
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-LXSKGHZ5.js +0 -29
- package/dist/ConfirmDialog-CUGGS4GQ.js +0 -1
- package/dist/Files-WAYK4MSJ.js +0 -87
- package/dist/PdfViewer-CT6V2SKJ.js +0 -1
- package/dist/Sidebar-BFADXCPU.js +0 -43
- package/dist/chunk-G5GERM76.js +0 -2
- package/dist/chunk-GBP32PVK.js +0 -1
- package/dist/chunk-HDS3ISDZ.js +0 -21
- package/dist/chunk-HWH4UHIU.js +0 -2
- package/dist/chunk-VGNNRYAM.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as t,useContext as e}from"react";import{jsx as r}from"react/jsx-runtime";var n={},o=new Proxy(n,{get:(t,e)=>n[e],has:(t,e)=>e in n,ownKeys:()=>Object.keys(n),getOwnPropertyDescriptor(t,e){if(e in n)return{configurable:!0,enumerable:!0,value:n[e]}}});function a(t){for(const t of Object.keys(n))delete n[t];Object.assign(n,t)}var u={},i=[],c={erp:[],system:[],virtual:[],footer:[]},s=t({hasAnyPerm:()=>!0});function d({value:t,children:e}){/* @__PURE__ */
|
|
2
|
+
return r(s.Provider,{value:t,children:e})}function m(){return e(s)}var l=40,h=240,f=6,p=49,w=6,y=200,g=420,b="react-os-shell:work-area-changed";function v(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function x(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}function M({over:t,residual:e},r){return e<=1||t-e>=r-2}function P(t,e,r){let n=t;for(const o of r)M(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function k(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,i=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(i),w:Math.round(o)}}function V(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function j(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{f as RAIL_COLLAPSED_INSET,p as RAIL_COLLAPSED_W,g as RAIL_MAX_W,w as RAIL_MENU_GAP,y as RAIL_MIN_W,h as RAIL_W,d as ShellAuthProvider,l as TAB_STRIP_H,b as WORK_AREA_CHANGED_EVENT,x as boxFillsWorkArea,v as computeMaximizedBox,k as growBoxToWidth,V as isSidebarStripReserved,o as navIcons,i as navSections,j as readAlwaysMaximizedFlag,M as scrollerIsFluid,u as sectionIcons,a as setShellNavIcons,c as startMenuCategories,m as useShellAuth,P as widthToFit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-2XU3X3MR.js";import{keepsNativeMenu as a}from"./chunk-YJIG2KT3.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import{inputClasses as e}from"./chunk-CU3GY5Y2.js";import{isSafeLinkHref as t}from"./chunk-PJPK2ADX.js";import{
|
|
1
|
+
import{inputClasses as e}from"./chunk-CU3GY5Y2.js";import{isSafeLinkHref as t}from"./chunk-PJPK2ADX.js";import{Icon as r}from"./chunk-76DRQSJM.js";import{useShellStrings as n}from"./chunk-2EJRVQ3Y.js";import{SpinnerRing as a}from"./chunk-2J6F4EE7.js";import{forwardRef as s,useCallback as i,useState as l,useId as o}from"react";import{jsx as c,jsxs as d,Fragment as m}from"react/jsx-runtime";var u=s(function({invalid:t,autoGrow:r,className:n="",onInput:a,rows:s=3,size:l,readOnly:o,...d},m){const u=i(e=>{if(r){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[r,a]);/* @__PURE__ */
|
|
2
2
|
return c("textarea",{ref:m,"aria-invalid":t||void 0,rows:s,onInput:u,readOnly:o,className:e({invalid:t,size:l,readOnly:o,multiline:!0,className:`${r?"resize-none overflow-hidden":""} ${n}`.trim()}),...d})}),h={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},p={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function g({tone:e}){const t={className:"h-5 w-5","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
3
|
-
return c(
|
|
4
|
-
return c(
|
|
5
|
-
return c(
|
|
6
|
-
return c(
|
|
3
|
+
return c(r,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
4
|
+
return c(r,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
5
|
+
return c(r,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
6
|
+
return c(r,{name:"info",look:"mini",...t})}}function x({tone:e="info",emphasis:t="subtle",title:a,children:s,icon:i,action:l,onDismiss:o,sticky:u=!1,className:x=""}){const b=h[e],f="solid"===t,y=n().banner,v=f?p[e]:b.box,N=u?"sticky top-0 z-30":"",k=/* @__PURE__ */d(m,{children:[a&&/* @__PURE__ */c("div",{className:("font-semibold "+(f?"":"text-gray-900")).trim(),children:a}),s&&/* @__PURE__ */c("div",{className:`${f?"":"text-gray-700"} ${a?"mt-0.5":""}`.trim(),children:s})]});/* @__PURE__ */
|
|
7
7
|
return d("div",{role:"danger"===e?"alert":"status",className:`${N} flex items-start gap-3 rounded-lg border px-4 py-3 ${v} ${x}`.trim(),children:[
|
|
8
8
|
/* @__PURE__ */c("span",{className:`mt-0.5 shrink-0 ${f?"":b.icon}`.trim(),children:i??/* @__PURE__ */c(g,{tone:e})}),null==l?/* @__PURE__ */c("div",{className:"min-w-0 flex-1 text-sm",children:k}):
|
|
9
9
|
/* @__PURE__ */d("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
10
10
|
/* @__PURE__ */c("div",{className:"min-w-0 grow basis-48 text-sm",children:k}),
|
|
11
|
-
/* @__PURE__ */c("div",{className:"shrink-0 self-center",children:l})]}),o&&/* @__PURE__ */c("button",{type:"button",onClick:o,"aria-label":y.dismiss,className:"shrink-0 "+(f?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */c(
|
|
11
|
+
/* @__PURE__ */c("div",{className:"shrink-0 self-center",children:l})]}),o&&/* @__PURE__ */c("button",{type:"button",onClick:o,"aria-label":y.dismiss,className:"shrink-0 "+(f?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */c(r,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}function b({summary:e,busy:t=!1,open:n,onOpenChange:a,label:s="Steps",className:i="",children:m}){const[u,h]=l(null),p=o(),g=n??u??t;/* @__PURE__ */
|
|
12
12
|
return d("div",{className:`text-xs text-gray-500 ${i}`.trim(),children:[
|
|
13
13
|
/* @__PURE__ */d("button",{type:"button",onClick:()=>{h(!g),a?.(!g)},"aria-expanded":g,"aria-controls":g?p:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
|
|
14
|
-
/* @__PURE__ */c(
|
|
14
|
+
/* @__PURE__ */c(r,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(g?"rotate-90":"")}),
|
|
15
15
|
/* @__PURE__ */c("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:e})]}),g&&/* @__PURE__ */c("ol",{id:p,"aria-label":s,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:m})]})}var f={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},y={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function v({status:e}){switch(e){case"active":/* @__PURE__ */
|
|
16
|
-
return c(
|
|
17
|
-
return c(
|
|
18
|
-
return c(
|
|
19
|
-
return c(
|
|
20
|
-
return c(
|
|
21
|
-
return c(
|
|
16
|
+
return c(a,{className:"size-3 motion-reduce:animate-none"});case"complete":/* @__PURE__ */
|
|
17
|
+
return c(r,{name:"check-circle",size:14,tone:"success"});case"failed":/* @__PURE__ */
|
|
18
|
+
return c(r,{name:"close-circle",size:14,tone:"danger"});case"stopped":/* @__PURE__ */
|
|
19
|
+
return c(r,{name:"no-symbol",size:14,tone:"muted"});case"waiting":/* @__PURE__ */
|
|
20
|
+
return c(r,{name:"pause",size:14,tone:"warning"});case"skipped":/* @__PURE__ */
|
|
21
|
+
return c(r,{name:"remove",size:14,tone:"muted"});default:/* @__PURE__ */
|
|
22
22
|
return c("span",{className:"block size-3 rounded-full border border-gray-300"})}}function N({label:e,description:t,status:r="complete",statusWord:n,icon:a,children:s}){/* @__PURE__ */
|
|
23
23
|
return d("li",{className:`flex items-start gap-2 ${f[r]}`,"data-status":r,children:[
|
|
24
24
|
/* @__PURE__ */c("span",{"aria-hidden":"true",className:"mt-1 flex size-3.5 shrink-0 items-center justify-center",children:a??/* @__PURE__ */c(v,{status:r})}),
|
|
@@ -28,11 +28,11 @@ return d("li",{className:`flex items-start gap-2 ${f[r]}`,"data-status":r,childr
|
|
|
28
28
|
/* @__PURE__ */d("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
|
|
29
29
|
/* @__PURE__ */c("a",{href:w(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
|
|
30
30
|
/* @__PURE__ */c("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
|
|
31
|
-
/* @__PURE__ */c("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */c("em",{children:r[7]},a++)),n=k.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function z({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),
|
|
31
|
+
/* @__PURE__ */c("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */c("em",{children:r[7]},a++)),n=k.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function z({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),a=n().markdown;/* @__PURE__ */
|
|
32
32
|
return d("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-3 text-gray-500",children:[
|
|
33
|
-
/* @__PURE__ */c(
|
|
33
|
+
/* @__PURE__ */c(r,{name:"camera",look:"mini",className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),
|
|
34
34
|
/* @__PURE__ */d("span",{className:"text-xs",children:[
|
|
35
|
-
/* @__PURE__ */c("span",{className:"font-medium text-gray-600",children:`${
|
|
35
|
+
/* @__PURE__ */c("span",{className:"font-medium text-gray-600",children:`${a.screenshot} — `}),t]})]})}function j(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var I=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function C(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
|
|
36
36
|
return c(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:$(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
|
|
37
37
|
return c("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=I(e[0]),n=e.slice(2).map(I);/* @__PURE__ */
|
|
38
38
|
return c("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */d("table",{className:"w-full border-collapse text-sm",children:[
|
|
@@ -42,6 +42,6 @@ return c("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-
|
|
|
42
42
|
return c(z,{alt:s[1]},t);if(/^[-*]\s+/.test(n)){const e=j(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
43
43
|
return c("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */c("li",{children:$(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=j(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
44
44
|
return c("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */c("li",{className:"pl-1",children:$(e)},t))},t)}/* @__PURE__ */
|
|
45
|
-
return c("p",{children:$(r.join(" "))},t)}var
|
|
46
|
-
return c("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:
|
|
47
|
-
return c("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */c("code",{children:t})},r)}(e.fence,t):
|
|
45
|
+
return c("p",{children:$(r.join(" "))},t)}var D=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function E(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const s=D.exec(t[e]);if(!(null!==s&&!("`"===s[2][0]&&s[3].includes("`")))){n.push(t[e]);continue}a();const[,i,l,o]=s,c=[];for(e+=1;e<t.length;e+=1){const r=D.exec(t[e]);if(null!==r&&r[2][0]===l[0]&&r[2].length>=l.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:o.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function J({children:e,className:t}){/* @__PURE__ */
|
|
46
|
+
return c("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:E(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
|
|
47
|
+
return c("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */c("code",{children:t})},r)}(e.fence,t):C(e.text,t))})}export{x as Banner,J as Markdown,b as StepChain,N as StepChainItem,u as Textarea_default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{useCopyText as e,CopyGlyph as n}from"./chunk-OKFO3XYS.js";import{PopupMenu as t,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-YJIG2KT3.js";import{Icon as i}from"./chunk-76DRQSJM.js";import{useShellStrings as a}from"./chunk-2EJRVQ3Y.js";import{useState as o,useEffect as s,Fragment as c,useRef as d,useLayoutEffect as m}from"react";import{jsxs as u,jsx as p,Fragment as f}from"react/jsx-runtime";var h="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function y(){/* @__PURE__ */
|
|
2
|
+
return p(i,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function b({text:t,label:r,copiedLabel:l}){const{copied:i,copy:a}=e(t);/* @__PURE__ */
|
|
3
|
+
return p("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */p(n,{copied:i,className:"size-3.5"})})}function x({node:e}){const n=d(null);return m(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */p("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function g({tabs:e,activeKey:n,idFor:d,panelMounted:m,onActivate:g,onClose:k,onCloseMany:v,label:N,className:w,activeClassName:C,end:$,afterPinned:j,onIconMenu:z,menuItems:I,sizing:D="even"}){const M=a().pageTabs,[_,A]=o(null),E=e.length;s(()=>{if(!n)return;const e=document.getElementById(d(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[d,n,E]);const R=j?e.findIndex(e=>!e.pinned):-1,B=e.some(e=>e.key===n)?n:e[0]?.key,K=n=>{const t=e[(n+e.length)%e.length];t&&document.getElementById(d(t.key,"tab"))?.focus()},O=_?e.find(e=>e.key===_.key):void 0,T=O&&I?I(O.key):[],Y=O?e.indexOf(O):-1,F=e=>e.some(e=>!e.pinned),J=e=>()=>{A(null),e()};/* @__PURE__ */
|
|
4
|
+
return u("div",{className:w??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
5
|
+
/* @__PURE__ */p("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
6
|
+
/* @__PURE__ */u("div",{role:"tablist","aria-label":N,onKeyDown:n=>{const t=e.findIndex(e=>document.getElementById(d(e.key,"tab"))===n.target);if(!(t<0)){if("ArrowRight"===n.key)K(t+1);else if("ArrowLeft"===n.key)K(t-1);else if("Home"===n.key)K(0);else if("End"===n.key)K(e.length-1);else{if("Delete"!==n.key||e[t].pinned)return;k(e[t].key)}n.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[e.map((t,r)=>{const l=t.key===n,a=!!t.dirty,o=t.icon,s=l?C??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",f=r>0&&r!==R&&!l&&e[r-1].key!==n,v={type:"button",role:"tab",id:d(t.key,"tab"),"aria-selected":l,"aria-controls":m?.(t.key)?d(t.key,"panel"):void 0,tabIndex:t.key===B?0:-1,title:t.title,onClick:()=>g(t.key)},N={onContextMenu:e=>((e,n)=>{e.preventDefault(),A({x:e.clientX,y:e.clientY,key:n.key})})(e,t),onAuxClick:e=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),k(n.key))})(e,t),onMouseDown:e=>{1===e.button&&e.preventDefault()}},w=o&&
|
|
7
|
+
/* @__PURE__ */u("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[o,a&&!l&&!t.pinned&&
|
|
8
|
+
/* @__PURE__ */p("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),$=l&&!!z&&!!o;return t.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex h-8 flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${o?"w-10":""} ${s}`,...N,children:/* @__PURE__ */u("button",{...v,className:`flex h-full items-center justify-center rounded-t-md ${o?"w-full":"px-3"} ${h}`,children:[w,
|
|
9
|
+
/* @__PURE__ */p("span",{className:o?"sr-only":"whitespace-nowrap text-sm",children:t.title})]})},t.key):/* @__PURE__ */u(c,{children:[r===R&&j,f&&/* @__PURE__ */p("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
10
|
+
/* @__PURE__ */u("div",{role:"presentation",className:`group relative flex h-8 items-center rounded-t-md border border-b-0 text-sm transition-colors ${"active-full"===D&&l?"":"@container"} ${"active-full"===D?l?"flex-none min-w-[12rem] max-w-[40rem]":"flex-[0_1_8rem]":l&&(t.copy||$)?"flex-[0_1_20rem]":"flex-[0_1_15rem]"} ${l?"active-full"===D?"":"min-w-[4.25rem]":"min-w-[2.75rem]"} ${s}`,...N,children:[$&&
|
|
11
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":M.tabMenu,title:M.tabMenu,onClick:e=>{const n=e.currentTarget.getBoundingClientRect();z?.(t.key,n.left,n.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${h}`,children:w}),
|
|
12
|
+
/* @__PURE__ */u("button",{...v,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${$?"pl-2":"pl-3"} ${h} ${l?$?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2"}`,children:[!$&&w,
|
|
13
|
+
/* @__PURE__ */u("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===D&&l?"pr-4":""} ${o?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[t.title,t.favorite&&
|
|
14
|
+
/* @__PURE__ */p("span",{role:"img","aria-label":M.favorite,title:M.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */p(i,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),l&&t.actions&&/* @__PURE__ */p(x,{node:t.actions}),l&&t.copy&&/* @__PURE__ */p(b,{text:t.copy,label:M.copy(t.copy),copiedLabel:M.copied}),
|
|
15
|
+
/* @__PURE__ */u("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(l?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[a&&/* @__PURE__ */p("span",{role:"img","aria-label":M.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
16
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-label":M.closeTab?.(t.title)??`${M.close} ${t.title}`,onClick:()=>k(t.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(a?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */p(y,{})})]})]})]},t.key)}),j&&R<0&&j]}),$&&/* @__PURE__ */p("div",{className:"flex shrink-0 items-center gap-2 self-center",children:$}),_&&O&&/* @__PURE__ */u(t,{portal:!0,style:{left:_.x,top:_.y},onClose:()=>A(null),children:[T.length>0&&/* @__PURE__ */u(f,{children:[T.map((e,n)=>/* @__PURE__ */u(r,{onClick:J(e.onSelect),children:[e.icon,e.label]},n)),
|
|
17
|
+
/* @__PURE__ */p(l,{})]}),
|
|
18
|
+
/* @__PURE__ */p(r,{disabled:O.pinned,onClick:J(()=>k(O.key)),children:M.close}),
|
|
19
|
+
/* @__PURE__ */p(l,{}),
|
|
20
|
+
/* @__PURE__ */p(r,{disabled:!F(e.filter(e=>e.key!==O.key)),onClick:J(()=>v("others",O.key)),children:M.closeOthers}),
|
|
21
|
+
/* @__PURE__ */p(r,{disabled:!F(e.slice(Y+1)),onClick:J(()=>v("right",O.key)),children:M.closeRight}),
|
|
22
|
+
/* @__PURE__ */p(r,{disabled:!F(e),onClick:J(()=>v("all",null)),children:M.closeAll})]})]})}export{g as TabStrip};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{
|
|
1
|
+
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{useHydrated as n,useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{onOverlayOpen as o,registerModalEscapeInterceptor as i,Z_LAYERS as a}from"./chunk-FIEA5CGB.js";import{Icon as l}from"./chunk-76DRQSJM.js";import{createContext as c,forwardRef as u,useContext as s,useId as d,useRef as p,useState as m,useEffect as h,useMemo as f,useCallback as g}from"react";import{createPortal as y}from"react-dom";import{jsxs as b,jsx as x,Fragment as w}from"react/jsx-runtime";var v=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),k="data-native-context-menu";function N(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function C(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(N(t,`[${k}]`))return!0;if(N(t,"textarea"))return!0;if(N(t,"img, picture, canvas, video, audio"))return!0;const n=N(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(v.has(e))return!0}const r=N(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var T=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function $(e,t,n){const r=N(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return T.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function E(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return C(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function L(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function M(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function B(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function A(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function R(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,u=c>=a;return i&&u?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:u?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(e=!1){return`mt-0.5 block truncate ${e?"text-2xs leading-4":"text-xs leading-4"} font-normal text-gray-500`}function H(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var P=c(null),D=c(!1);function j({children:t,style:r,className:l="",onClose:c,minWidth:u=180,portal:s=!1}){const g=p(null),b=d(),[w,v]=m([]),k=p();h(()=>()=>clearTimeout(k.current),[]);const N=n(),T=f(()=>{const e=()=>clearTimeout(k.current);return{id:b,depth:0,path:w,open:(t,n)=>{e(),v(e=>L(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>M(e,t)),200)},closeBelow:t=>{e(),v(e=>M(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),c?.()},root:g}},[b,w,c]);h(()=>{if(!c)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||g.current&&!g.current.contains(e.target)&&c()},t=e=>{"Escape"===e.key&&c()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=o(c),r=i(()=>!1,()=>g.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),r()}},[c,b]),h(()=>{const e=g.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const $=H(),E=/(^|[\s:])!?z-/.test(l),B=/* @__PURE__ */x("div",{ref:g,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===$?"py-1":"large"===$?"py-2":"py-1"} ${l}`,onContextMenu:e=>{C(e.target)||e.preventDefault()},style:{...E?{}:{zIndex:a.menu},minWidth:u,animation:"popup-in 0.12s ease-out",...e(),...r},children:/* @__PURE__ */x(P.Provider,{value:T,children:t})});return s?N?y(B,document.body):null:B}function I(e,t,n,r=!1){const o=H(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 not-disabled:not-aria-disabled:hover:bg-blue-50 not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var S=/* @__PURE__ */x(l,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function F({kind:e,checked:t}){/* @__PURE__ */
|
|
2
2
|
return x("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&S}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&S})}var z=u(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:a,icon:l,description:c,tabIndex:u,id:p,onMouseEnter:m},h){const f=s(P),g=d(),y=null!=c&&!1!==c,v=`${p??g}-label`,k=`${p??g}-note`,N=s(D),C=I(r,o,n),T=void 0===a?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
|
|
3
3
|
return b("button",{ref:h,id:p,role:"radio"===T?"menuitemradio":"checkbox"===T?"menuitemcheckbox":i??(N?"menuitem":void 0),"aria-checked":T?a:void 0,"aria-labelledby":y?v:void 0,"aria-describedby":y?k:void 0,tabIndex:u,onClick:()=>{e?.(),f&&f.depth>0&&"checkbox"!==T&&f.closeTree()},onMouseEnter:()=>{f?.scheduleClose(f.depth),m?.()},disabled:o,className:C.className,style:C.style,children:[T&&/* @__PURE__ */x(F,{kind:T,checked:!!a}),y?
|
|
4
4
|
/* @__PURE__ */b("span",{className:"block min-w-0 flex-1 py-2",children:[
|
|
5
5
|
/* @__PURE__ */b("span",{className:"flex items-center gap-2",children:[null!=l&&/* @__PURE__ */x(q,{children:l}),
|
|
6
6
|
/* @__PURE__ */x("span",{id:v,className:"min-w-0",children:t})]}),
|
|
7
7
|
/* @__PURE__ */x("span",{id:k,"data-menu-note":"",className:W(),style:null!=l?{paddingLeft:"1.5rem"}:void 0,children:c})]}):/* @__PURE__ */b(w,{children:[null!=l&&/* @__PURE__ */x(q,{children:l}),t]})]})});function q({children:e}){/* @__PURE__ */
|
|
8
|
-
return x("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var U=/* @__PURE__ */x(l,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function K(e){let t=
|
|
8
|
+
return x("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var U=/* @__PURE__ */x(l,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function K(e){let t=a.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function J(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function Q({label:t,icon:n,children:o,disabled:a,className:l="",minWidth:c=180,maxHeight:u}){const m=s(P),v=d(),k=p(null),N=p(null),T=p(),$=p(!1),E=`${v}-menu`;h(()=>()=>clearTimeout(T.current),[]);const L=m?.depth??0,M=m?.path[L],B=!!M&&M.key===v&&!a,W=g(e=>{if(!m||a||!k.current)return;clearTimeout(T.current),$.current=e;const t=k.current.getBoundingClientRect(),n=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,o=L>0&&(m.path[L-1]?.flipped??!1),i=R(r.left,r.right,c,window.innerWidth,4,o);m.open(L,{key:v,y:t.top,...i})},[m,a,L,v,c]),D=e=>{m?.closeBelow(L),k.current?.focus()};h(()=>{if(B)return i(e=>"Escape"===e.key&&(!(m&&m.path.length>L+1)&&(D(),!0)),()=>N.current)}),r(()=>{if(!B||!M)return;const e=()=>{const e=N.current;if(!e||!k.current)return;const t=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??k.current.getBoundingClientRect(),r=L>0&&(m?.path[L-1]?.flipped??!1),o=e.offsetWidth||c,i=R(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=A(k.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),h(()=>{B&&$.current&&($.current=!1,J(N.current)[0]?.focus())},[B]);const j=f(()=>m&&{...m,depth:L+1},[m,L]);if(!m)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=I(!1,a,l,B),F=H();/* @__PURE__ */
|
|
9
9
|
return b(w,{children:[
|
|
10
|
-
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":B,"aria-controls":B?E:void 0,disabled:
|
|
10
|
+
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":B,"aria-controls":B?E:void 0,disabled:a,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;B?t&&J(N.current)[0]?.focus():W(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),W(!0))},onMouseEnter:()=>{a||(m.cancelClose(),B?m.closeBelow(L+1):(clearTimeout(T.current),T.current=setTimeout(()=>W(!1),120)))},onMouseLeave:()=>{clearTimeout(T.current),m.scheduleClose(L)},children:[n,
|
|
11
11
|
/* @__PURE__ */x("span",{className:"min-w-0 flex-1 truncate",children:t}),U]}),B&&y(
|
|
12
12
|
/* @__PURE__ */x("div",{ref:N,id:E,role:"menu","data-popup-menu-tree":m.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===F?"py-1":"large"===F?"py-2":"py-1"),style:{left:M.left,top:M.y,minWidth:c,maxHeight:void 0===u?"calc(100vh - 16px)":`min(${"number"==typeof u?`${u}px`:u}, calc(100vh - 16px))`,zIndex:K(m.root.current)+L+1,animation:(M.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...e()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=J(N.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),D())},onMouseEnter:()=>{m.cancelClose(),clearTimeout(T.current)},onMouseLeave:()=>m.scheduleClose(L+1),onContextMenu:e=>{C(e.target)||e.preventDefault()},children:/* @__PURE__ */x(P.Provider,{value:j,children:o})}),document.body)]})}function G(){const e=H();/* @__PURE__ */
|
|
13
13
|
return x("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function O(){const e=H(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function V({children:e}){/* @__PURE__ */
|