efficient-shell 4.137.1 → 4.145.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.
Files changed (58) hide show
  1. package/README.md +77 -11
  2. package/dist/{Browser-ZX5OTOKK.js → Browser-24YNRTKT.js} +14 -14
  3. package/dist/Calculator-LER6KUQC.js +29 -0
  4. package/dist/{ConfirmDialog-NPKW2XHM.js → ConfirmDialog-GAYETRMG.js} +1 -1
  5. package/dist/{CurrencyConverter-2KOM7L6V.js → CurrencyConverter-Y35GFDFF.js} +6 -6
  6. package/dist/{Documents-IZTIQYPG.js → Documents-7FYX2CGT.js} +14 -14
  7. package/dist/{Files-B63KKXGZ.js → Files-RZOML2N6.js} +39 -39
  8. package/dist/{Notepad-WA77V45J.js → Notepad-VVDCBDUA.js} +13 -13
  9. package/dist/PdfViewer-CvLb2j_l.d.ts +40 -0
  10. package/dist/PdfViewer-ZCT3PYXU.js +1 -0
  11. package/dist/{PomodoroTimer-SDUBKXUS.js → PomodoroTimer-VAM3AJOX.js} +37 -37
  12. package/dist/{Preview-D4KOA4OI.js → Preview-HZ37D7QJ.js} +23 -23
  13. package/dist/{Sidebar-Y57LYXXI.js → Sidebar-CVF7C6BO.js} +3 -3
  14. package/dist/{Spreadsheet-JX5E6WH6.js → Spreadsheet-6WX3P6AB.js} +15 -15
  15. package/dist/{Stock-XAQ5WMUZ.js → Stock-AUWI3TUX.js} +3 -3
  16. package/dist/{Weather-HLAGJ5LV.js → Weather-HU75TH7T.js} +13 -13
  17. package/dist/{WorldClock-IRI4VCTA.js → WorldClock-T64MDRMJ.js} +5 -5
  18. package/dist/apps/index.d.ts +3 -23
  19. package/dist/apps/index.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/{chunk-UZAJ5BF6.js → chunk-2RHMSFZV.js} +7 -7
  22. package/dist/{chunk-466CM2TJ.js → chunk-4FS742BM.js} +1 -1
  23. package/dist/{chunk-JN4WXTWJ.js → chunk-7DAQ3WVP.js} +42 -42
  24. package/dist/chunk-CVTOZCM3.js +24 -0
  25. package/dist/{chunk-H562R4GX.js → chunk-GDSGXDET.js} +1 -1
  26. package/dist/{chunk-A2OQLLYK.js → chunk-I55UMU3R.js} +1 -1
  27. package/dist/chunk-KKOHUQPF.js +1 -0
  28. package/dist/{chunk-Y7BOLDRM.js → chunk-L7TEFXIS.js} +14 -14
  29. package/dist/chunk-LVFMK5OQ.js +29 -0
  30. package/dist/{chunk-5CRAF2AD.js → chunk-MU5H2CDL.js} +2 -2
  31. package/dist/{chunk-FQLMX3IE.js → chunk-NBBOFQPL.js} +441 -442
  32. package/dist/{chunk-TAWKWSPN.js → chunk-RJ4LACFH.js} +3 -3
  33. package/dist/{chunk-B43AGQET.js → chunk-SLCR26NK.js} +4 -4
  34. package/dist/{chunk-XO43FJRM.js → chunk-TFKB2WEB.js} +5 -5
  35. package/dist/chunk-TR6PLN7W.js +1 -0
  36. package/dist/chunk-TWV42Q3K.js +1 -0
  37. package/dist/{chunk-VVAGSKW7.js → chunk-UB22J6EF.js} +1 -1
  38. package/dist/{chunk-44UO7FYU.js → chunk-V453E4KU.js} +4 -4
  39. package/dist/file-intake/index.js +1 -1
  40. package/dist/{index-DVI9DMSu.d.ts → index-NhR7frRu.d.ts} +189 -17
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +235 -235
  43. package/dist/map/index.d.ts +266 -13
  44. package/dist/map/index.js +22 -20
  45. package/dist/page-tabs/index.js +13 -13
  46. package/dist/pdf/index.d.ts +9 -0
  47. package/dist/pdf/index.js +2 -0
  48. package/dist/ui/index.d.ts +1 -1
  49. package/dist/ui/index.js +1 -1
  50. package/dist/ui.css +7 -0
  51. package/package.json +6 -1
  52. package/dist/Calculator-4SQGOQFQ.js +0 -29
  53. package/dist/PdfViewer-RBRGEKWF.js +0 -1
  54. package/dist/chunk-3A46NCXK.js +0 -29
  55. package/dist/chunk-OQDWLHZI.js +0 -1
  56. package/dist/chunk-OWSAMA3I.js +0 -23
  57. package/dist/chunk-U4GTZPXP.js +0 -1
  58. package/dist/chunk-VEGMDXT4.js +0 -1
@@ -1,9 +1,9 @@
1
- import{onOverlayOpen as e,Z_LAYERS as t,registerModalEscapeInterceptor as n}from"./chunk-3A46NCXK.js";import{glassStyle as r,GLASS_DIVIDER as o}from"./chunk-57MIENLJ.js";import{useHydrated as i,useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{createContext as a,forwardRef as u,useContext as s,useRef as c,useId as d,useState as p,useEffect as m,useMemo as f,useCallback as h}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs 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"]),b="data-native-context-menu";function k(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(k(t,`[${b}]`))return!0;if(k(t,"textarea"))return!0;if(k(t,"img, picture, canvas, video, audio"))return!0;const n=k(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(v.has(e))return!0}const r=k(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var N=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function L(e,t,n){const r=k(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 N.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,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 T(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 $(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),l=e-i/2;return l<n?n:l+i>r?Math.max(n,r-i):l}function A(e,t,n,r,o,i=!1,l=8){const a=t+o,u=e-o-n,s=u>=l;return i&&s?{left:u,flipped:!0}:a+n<=r-l?{left:a,flipped:!1}:s?{left:u,flipped:!0}:i?{left:l,flipped:!0}:{left:Math.max(l,r-l-n),flipped:!1}}function B(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var R=a(null);function W({children:n,style:o,className:l="",onClose:a,minWidth:u=180,portal:s=!1}){const h=c(null),x=d(),[w,v]=p([]),b=c();m(()=>()=>clearTimeout(b.current),[]);const k=i(),N=f(()=>{const e=()=>clearTimeout(b.current);return{id:x,depth:0,path:w,open:(t,n)=>{e(),v(e=>E(e,t,n))},scheduleClose:t=>{e(),b.current=setTimeout(()=>v(e=>M(e,t)),200)},closeBelow:t=>{e(),v(e=>M(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),a?.()},root:h}},[x,w,a]);m(()=>{if(!a)return;const t=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${x}"]`)||h.current&&!h.current.contains(e.target)&&a()},n=e=>{"Escape"===e.key&&a()};window.addEventListener("pointerdown",t),window.addEventListener("keydown",n);const r=e(a);return()=>{window.removeEventListener("pointerdown",t),window.removeEventListener("keydown",n),r()}},[a,x]),m(()=>{const e=h.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 L=B(),T=/(^|[\s:])!?z-/.test(l),$=/* @__PURE__ */y("div",{ref:h,"data-popup-menu-tree":x,className:`fixed rounded-2xl ${"tight"===L?"py-1":"large"===L?"py-2":"py-1.5"} ${l}`,onContextMenu:e=>{C(e.target)||e.preventDefault()},style:{...T?{}:{zIndex:t.menu},minWidth:u,animation:"popup-in 0.12s ease-out",...r(),...o},children:/* @__PURE__ */y(R.Provider,{value:N,children:n})});return s?k?g($,document.body):null:$}function D(e,t,n,r=!1){const o=B(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 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}}}var H=u(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,tabIndex:l,id:a,onMouseEnter:u},c){const d=s(R),p=D(r,o,n);/* @__PURE__ */
2
- return y("button",{ref:c,id:a,role:i,tabIndex:l,onClick:()=>{e?.(),d&&d.depth>0&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),u?.()},disabled:o,className:p.className,style:p.style,children:t})}),I=/* @__PURE__ */y("svg",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function P(e){let n=t.menu;for(let t=e;t&&t!==document.body;t=t.parentElement){const e=parseInt(getComputedStyle(t).zIndex,10);Number.isNaN(e)||(n=e)}return n}function S(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function F({label:e,icon:t,children:o,disabled:i,className:a="",minWidth:u=180,maxHeight:p}){const v=s(R),b=d(),k=c(null),N=c(null),L=c(),E=c(!1),M=`${b}-menu`;m(()=>()=>clearTimeout(L.current),[]);const T=v?.depth??0,W=v?.path[T],H=!!W&&W.key===b&&!i,F=h(e=>{if(!v||i||!k.current)return;clearTimeout(L.current),E.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=T>0&&(v.path[T-1]?.flipped??!1),l=A(r.left,r.right,u,window.innerWidth,4,o);v.open(T,{key:b,y:t.top,...l})},[v,i,T,b,u]),j=e=>{v?.closeBelow(T),k.current?.focus()};m(()=>{if(H)return n(e=>"Escape"===e.key&&(!(v&&v.path.length>T+1)&&(j(),!0)))}),l(()=>{if(!H||!W)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=T>0&&(v?.path[T-1]?.flipped??!1),o=e.offsetWidth||u,i=A(n.left,n.right,o,window.innerWidth,4,r,8),l=e.offsetHeight,a=$(k.current.getBoundingClientRect().top+l/2,l,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${a}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),m(()=>{H&&E.current&&(E.current=!1,S(N.current)[0]?.focus())},[H]);const z=f(()=>v&&{...v,depth:T+1},[v,T]);if(!v)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=D(!1,i,a,H),U=B();/* @__PURE__ */
1
+ import{onOverlayOpen as e,Z_LAYERS as t,registerModalEscapeInterceptor as n}from"./chunk-LVFMK5OQ.js";import{glassStyle as r,GLASS_DIVIDER as o}from"./chunk-57MIENLJ.js";import{useHydrated as i,useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{createContext as a,forwardRef as u,useContext as s,useRef as c,useId as d,useState as p,useEffect as m,useMemo as f,useCallback as h}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs 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"]),b="data-native-context-menu";function k(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(k(t,`[${b}]`))return!0;if(k(t,"textarea"))return!0;if(k(t,"img, picture, canvas, video, audio"))return!0;const n=k(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(v.has(e))return!0}const r=k(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var N=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function L(e,t,n){const r=k(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 N.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 M(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function E(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function T(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 $(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),l=e-i/2;return l<n?n:l+i>r?Math.max(n,r-i):l}function B(e,t,n,r,o,i=!1,l=8){const a=t+o,u=e-o-n,s=u>=l;return i&&s?{left:u,flipped:!0}:a+n<=r-l?{left:a,flipped:!1}:s?{left:u,flipped:!0}:i?{left:l,flipped:!0}:{left:Math.max(l,r-l-n),flipped:!1}}function A(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var R=a(null);function W({children:n,style:o,className:l="",onClose:a,minWidth:u=180,portal:s=!1}){const h=c(null),x=d(),[w,v]=p([]),b=c();m(()=>()=>clearTimeout(b.current),[]);const k=i(),N=f(()=>{const e=()=>clearTimeout(b.current);return{id:x,depth:0,path:w,open:(t,n)=>{e(),v(e=>M(e,t,n))},scheduleClose:t=>{e(),b.current=setTimeout(()=>v(e=>E(e,t)),200)},closeBelow:t=>{e(),v(e=>E(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),a?.()},root:h}},[x,w,a]);m(()=>{if(!a)return;const t=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${x}"]`)||h.current&&!h.current.contains(e.target)&&a()},n=e=>{"Escape"===e.key&&a()};window.addEventListener("pointerdown",t),window.addEventListener("keydown",n);const r=e(a);return()=>{window.removeEventListener("pointerdown",t),window.removeEventListener("keydown",n),r()}},[a,x]),m(()=>{const e=h.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 L=A(),T=/(^|[\s:])!?z-/.test(l),$=/* @__PURE__ */y("div",{ref:h,"data-popup-menu-tree":x,className:`fixed rounded-2xl ${"tight"===L?"py-1":"large"===L?"py-2":"py-1.5"} ${l}`,onContextMenu:e=>{C(e.target)||e.preventDefault()},style:{...T?{}:{zIndex:t.menu},minWidth:u,animation:"popup-in 0.12s ease-out",...r(),...o},children:/* @__PURE__ */y(R.Provider,{value:N,children:n})});return s?k?g($,document.body):null:$}function D(e,t,n,r=!1){const o=A(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 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}}}var H=u(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,tabIndex:l,id:a,onMouseEnter:u},c){const d=s(R),p=D(r,o,n);/* @__PURE__ */
2
+ return y("button",{ref:c,id:a,role:i,tabIndex:l,onClick:()=>{e?.(),d&&d.depth>0&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),u?.()},disabled:o,className:p.className,style:p.style,children:t})}),F=/* @__PURE__ */y("svg",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function I(e){let n=t.menu;for(let t=e;t&&t!==document.body;t=t.parentElement){const e=parseInt(getComputedStyle(t).zIndex,10);Number.isNaN(e)||(n=e)}return n}function P(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function S({label:e,icon:t,children:o,disabled:i,className:a="",minWidth:u=180,maxHeight:p}){const v=s(R),b=d(),k=c(null),N=c(null),L=c(),M=c(!1),E=`${b}-menu`;m(()=>()=>clearTimeout(L.current),[]);const T=v?.depth??0,W=v?.path[T],H=!!W&&W.key===b&&!i,S=h(e=>{if(!v||i||!k.current)return;clearTimeout(L.current),M.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=T>0&&(v.path[T-1]?.flipped??!1),l=B(r.left,r.right,u,window.innerWidth,4,o);v.open(T,{key:b,y:t.top,...l})},[v,i,T,b,u]),j=e=>{v?.closeBelow(T),k.current?.focus()};m(()=>{if(H)return n(e=>"Escape"===e.key&&(!(v&&v.path.length>T+1)&&(j(),!0)))}),l(()=>{if(!H||!W)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=T>0&&(v?.path[T-1]?.flipped??!1),o=e.offsetWidth||u,i=B(n.left,n.right,o,window.innerWidth,4,r,8),l=e.offsetHeight,a=$(k.current.getBoundingClientRect().top+l/2,l,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${a}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),m(()=>{H&&M.current&&(M.current=!1,P(N.current)[0]?.focus())},[H]);const z=f(()=>v&&{...v,depth:T+1},[v,T]);if(!v)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=D(!1,i,a,H),U=A();/* @__PURE__ */
3
3
  return x(w,{children:[
4
- /* @__PURE__ */x("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":H,"aria-controls":H?M:void 0,disabled:i,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;H?t&&S(N.current)[0]?.focus():F(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),F(!0))},onMouseEnter:()=>{i||(v.cancelClose(),H?v.closeBelow(T+1):(clearTimeout(L.current),L.current=setTimeout(()=>F(!1),120)))},onMouseLeave:()=>{clearTimeout(L.current),v.scheduleClose(T)},children:[t,
5
- /* @__PURE__ */y("span",{className:"min-w-0 flex-1 truncate",children:e}),I]}),H&&g(
6
- /* @__PURE__ */y("div",{ref:N,id:M,role:"menu","data-popup-menu-tree":v.id,"data-popup-submenu-panel":!0,className:"fixed rounded-2xl overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===U?"py-1":"large"===U?"py-2":"py-1.5"),style:{left:W.left,top:W.y,minWidth:u,maxHeight:void 0===p?"calc(100vh - 16px)":`min(${"number"==typeof p?`${p}px`:p}, calc(100vh - 16px))`,zIndex:P(v.root.current)+T+1,animation:(W.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...r()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=S(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(),j())},onMouseEnter:()=>{v.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>v.scheduleClose(T+1),onContextMenu:e=>{C(e.target)||e.preventDefault()},children:/* @__PURE__ */y(R.Provider,{value:z,children:o})}),document.body)]})}function j(){const e=B();/* @__PURE__ */
7
- return y("div",{className:`border-t ${o} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function z({children:e}){const t=B(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
4
+ /* @__PURE__ */x("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":H,"aria-controls":H?E:void 0,disabled:i,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;H?t&&P(N.current)[0]?.focus():S(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),S(!0))},onMouseEnter:()=>{i||(v.cancelClose(),H?v.closeBelow(T+1):(clearTimeout(L.current),L.current=setTimeout(()=>S(!1),120)))},onMouseLeave:()=>{clearTimeout(L.current),v.scheduleClose(T)},children:[t,
5
+ /* @__PURE__ */y("span",{className:"min-w-0 flex-1 truncate",children:e}),F]}),H&&g(
6
+ /* @__PURE__ */y("div",{ref:N,id:E,role:"menu","data-popup-menu-tree":v.id,"data-popup-submenu-panel":!0,className:"fixed rounded-2xl overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===U?"py-1":"large"===U?"py-2":"py-1.5"),style:{left:W.left,top:W.y,minWidth:u,maxHeight:void 0===p?"calc(100vh - 16px)":`min(${"number"==typeof p?`${p}px`:p}, calc(100vh - 16px))`,zIndex:I(v.root.current)+T+1,animation:(W.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...r()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=P(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(),j())},onMouseEnter:()=>{v.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>v.scheduleClose(T+1),onContextMenu:e=>{C(e.target)||e.preventDefault()},children:/* @__PURE__ */y(R.Provider,{value:z,children:o})}),document.body)]})}function j(){const e=A();/* @__PURE__ */
7
+ return y("div",{className:`border-t ${o} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function z({children:e}){const t=A(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
8
8
  return y("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function q({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
9
- return y("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{q as MenuIcon,b as NATIVE_MENU_ATTR,W as PopupMenu,j as PopupMenuDivider,H as PopupMenuItem,z as PopupMenuLabel,F as PopupSubmenu,$ as clampMenuTop,M as closeMenuBelow,L as describeContextTarget,D as itemLook,C as keepsNativeMenu,A as menuPanelLeft,E as openMenuLevel,T as resolveMenuLevels};
9
+ return y("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{q as MenuIcon,b as NATIVE_MENU_ATTR,W as PopupMenu,j as PopupMenuDivider,H as PopupMenuItem,z as PopupMenuLabel,S as PopupSubmenu,$ as clampMenuTop,E as closeMenuBelow,L as describeContextTarget,D as itemLook,C as keepsNativeMenu,B as menuPanelLeft,M as openMenuLevel,T as resolveMenuLevels};
@@ -1 +1 @@
1
- import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-VEGMDXT4.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
1
+ import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{toast_default as t}from"./chunk-KKOHUQPF.js";import{setSpreadsheetPreview as n}from"./chunk-VTVSMRFX.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return t.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();n({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return t.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};