efficient-shell 4.175.0 → 4.177.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.
- package/README.md +46 -1
- package/dist/{Browser-PZIVSYLM.js → Browser-MFFTBGEB.js} +14 -14
- package/dist/{Calculator-6BJVESFN.js → Calculator-AGQQYMMZ.js} +18 -18
- package/dist/{CurrencyConverter-4RZZ5STO.js → CurrencyConverter-KZPE7ZCC.js} +4 -4
- package/dist/{Documents-ERSFDOCV.js → Documents-ZD227WZC.js} +11 -11
- package/dist/{Files-3J2DW6ET.js → Files-BLGT4RLF.js} +27 -27
- package/dist/{Notepad-MVMFJE2F.js → Notepad-LUK2IFHD.js} +9 -9
- package/dist/{PomodoroTimer-D6VQJICB.js → PomodoroTimer-LHPV6QXG.js} +25 -25
- package/dist/{Preview-VIHMVC7B.js → Preview-5CALO6PW.js} +12 -12
- package/dist/{Sidebar-2BZJ2MEI.js → Sidebar-4GIZSTD5.js} +25 -25
- package/dist/{Spreadsheet-KTB6JLBV.js → Spreadsheet-F3VBCPHF.js} +14 -14
- package/dist/{Stock-KRPM6NSB.js → Stock-XSDFN7U2.js} +1 -1
- package/dist/{Weather-HRH4JHTF.js → Weather-7YDUDMCO.js} +11 -11
- package/dist/{WorldClock-OUSV52XM.js → WorldClock-Q2JHBKLS.js} +4 -4
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-VRLHUZSC.js → chunk-4PCIZFDR.js} +1 -1
- package/dist/chunk-7H6Q5TNN.js +27 -0
- package/dist/{chunk-PGVUO7GB.js → chunk-AA4TMQOS.js} +3 -3
- package/dist/{chunk-TMQEH7WA.js → chunk-AI6HQ55O.js} +1 -1
- package/dist/{chunk-6BZCJQCT.js → chunk-AZO5NPB4.js} +125 -125
- package/dist/chunk-MFXG5BWL.js +1 -0
- package/dist/{chunk-D3UQLWIZ.js → chunk-N6BJG6AL.js} +8 -8
- package/dist/{chunk-EXXHI5DO.js → chunk-OGXU7QFW.js} +2 -2
- package/dist/{chunk-JOOXVX4A.js → chunk-PE6MTNFO.js} +1 -1
- package/dist/{chunk-KG4NRNFS.js → chunk-Q7UGGJ5X.js} +1 -1
- package/dist/{chunk-GCO3A63X.js → chunk-TZ2BPFCT.js} +52 -52
- package/dist/i18n/index.d.ts +78 -0
- package/dist/i18n/index.js +2 -0
- package/dist/{index-DIaav9a1.d.ts → index-BS_HzJCc.d.ts} +27 -927
- package/dist/index.d.ts +3 -2
- package/dist/index.js +89 -89
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/strings-C3kt6WTH.d.ts +924 -0
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +1 -1
- package/package.json +16 -1
- package/dist/chunk-7LAPNAKS.js +0 -1
- package/dist/chunk-FEK5ELXS.js +0 -27
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-HZZNJHRH.js";import{
|
|
1
|
+
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-HZZNJHRH.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-X4FJ54PP.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as l,forwardRef as u,useContext as c,useRef as s,useId as d,useState as p,useEffect as m,useMemo as h,useCallback as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as y,jsx as x,Fragment as w}from"react/jsx-runtime";var b=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),v="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,`[${v}]`))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(b.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 T(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 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 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 $(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 P(e,t,n,r,o,i=!1,a=8){const l=t+o,u=e-o-n,c=u>=a;return i&&c?{left:u,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:c?{left:u,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function R(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var W=l(null),A=l(!1);function H({children:t,style:a,className:l="",onClose:u,minWidth:c=180,portal:f=!1}){const y=s(null),w=d(),[b,v]=p([]),k=s();m(()=>()=>clearTimeout(k.current),[]);const N=i(),L=h(()=>{const e=()=>clearTimeout(k.current);return{id:w,depth:0,path:b,open:(t,n)=>{e(),v(e=>M(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>E(e,t)),200)},closeBelow:t=>{e(),v(e=>E(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),u?.()},root:y}},[w,b,u]);m(()=>{if(!u)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${w}"]`)||y.current&&!y.current.contains(e.target)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const o=n(u),i=r(()=>!1,()=>y.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),o(),i()}},[u,w]),m(()=>{const e=y.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 T=R(),B=/(^|[\s:])!?z-/.test(l),$=/* @__PURE__ */x("div",{ref:y,"data-popup-menu-tree":w,className:`fixed rounded-(--radius-popup) ${"tight"===T?"py-1":"large"===T?"py-2":"py-1.5"} ${l}`,onContextMenu:e=>{C(e.target)||e.preventDefault()},style:{...B?{}:{zIndex:o.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...a},children:/* @__PURE__ */x(W.Provider,{value:L,children:t})});return f?N?g($,document.body):null:$}function j(e,t,n,r=!1){const o=R(),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 D=/* @__PURE__ */x("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});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&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var S=u(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:a,tabIndex:l,id:u,onMouseEnter:s},d){const p=c(W),m=c(A),h=j(r,o,n),f=void 0===a?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
-
return y("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),s?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */x(F,{kind:f,checked:!!a}),t]})}),I=/* @__PURE__ */x("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__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function z(e){let t=
|
|
3
|
+
return y("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),s?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */x(F,{kind:f,checked:!!a}),t]})}),I=/* @__PURE__ */x("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__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function z(e){let t=o.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 q(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function U({label:t,icon:n,children:o,disabled:i,className:l="",minWidth:u=180,maxHeight:p}){const b=c(W),v=d(),k=s(null),N=s(null),L=s(),T=s(!1),M=`${v}-menu`;m(()=>()=>clearTimeout(L.current),[]);const E=b?.depth??0,B=b?.path[E],A=!!B&&B.key===v&&!i,H=f(e=>{if(!b||i||!k.current)return;clearTimeout(L.current),T.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=E>0&&(b.path[E-1]?.flipped??!1),a=P(r.left,r.right,u,window.innerWidth,4,o);b.open(E,{key:v,y:t.top,...a})},[b,i,E,v,u]),D=e=>{b?.closeBelow(E),k.current?.focus()};m(()=>{if(A)return r(e=>"Escape"===e.key&&(!(b&&b.path.length>E+1)&&(D(),!0)),()=>N.current)}),a(()=>{if(!A||!B)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=E>0&&(b?.path[E-1]?.flipped??!1),o=e.offsetWidth||u,i=P(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=$(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)}}),m(()=>{A&&T.current&&(T.current=!1,q(N.current)[0]?.focus())},[A]);const F=h(()=>b&&{...b,depth:E+1},[b,E]);if(!b)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=j(!1,i,l,A),U=R();/* @__PURE__ */
|
|
4
4
|
return y(w,{children:[
|
|
5
|
-
/* @__PURE__ */y("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":A,"aria-controls":A?M:void 0,disabled:
|
|
5
|
+
/* @__PURE__ */y("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":A,"aria-controls":A?M:void 0,disabled:i,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;A?t&&q(N.current)[0]?.focus():H(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),H(!0))},onMouseEnter:()=>{i||(b.cancelClose(),A?b.closeBelow(E+1):(clearTimeout(L.current),L.current=setTimeout(()=>H(!1),120)))},onMouseLeave:()=>{clearTimeout(L.current),b.scheduleClose(E)},children:[n,
|
|
6
6
|
/* @__PURE__ */x("span",{className:"min-w-0 flex-1 truncate",children:t}),I]}),A&&g(
|
|
7
7
|
/* @__PURE__ */x("div",{ref:N,id:M,role:"menu","data-popup-menu-tree":b.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===U?"py-1":"large"===U?"py-2":"py-1.5"),style:{left:B.left,top:B.y,minWidth:u,maxHeight:void 0===p?"calc(100vh - 16px)":`min(${"number"==typeof p?`${p}px`:p}, calc(100vh - 16px))`,zIndex:z(b.root.current)+E+1,animation:(B.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=q(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:()=>{b.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>b.scheduleClose(E+1),onContextMenu:e=>{C(e.target)||e.preventDefault()},children:/* @__PURE__ */x(W.Provider,{value:F,children:o})}),document.body)]})}function J(){const e=R();/* @__PURE__ */
|
|
8
8
|
return x("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function K({children:e}){const t=R(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-TZ2BPFCT.js";import{keepsNativeMenu as a}from"./chunk-AA4TMQOS.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"}),
|