efficient-shell 4.180.0 → 4.181.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 (65) hide show
  1. package/README.md +12 -0
  2. package/dist/Browser-QYHW6I6J.js +43 -0
  3. package/dist/Calculator-4K53PFBL.js +29 -0
  4. package/dist/ConfirmDialog-X2DPOYWO.js +1 -0
  5. package/dist/{CurrencyConverter-AMXUOQR2.js → CurrencyConverter-QEG6RFAS.js} +9 -9
  6. package/dist/Documents-SFNMDRYU.js +52 -0
  7. package/dist/Files-OX2UBSQQ.js +87 -0
  8. package/dist/Notepad-CNZEWFCR.js +25 -0
  9. package/dist/PdfViewer-UZGDE4HD.js +1 -0
  10. package/dist/PomodoroTimer-T6YAQFIE.js +91 -0
  11. package/dist/Preview-OOVIIQQG.js +182 -0
  12. package/dist/Sidebar-3NZRIL7F.js +44 -0
  13. package/dist/Spreadsheet-7NUDGOSX.js +37 -0
  14. package/dist/{Stock-GWVG2INU.js → Stock-BZFC2ROU.js} +6 -6
  15. package/dist/{Weather-APBCG4TO.js → Weather-S3N5OWYF.js} +17 -17
  16. package/dist/{WorldClock-2LMZYKWR.js → WorldClock-ACC3S6OA.js} +4 -4
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/{chunk-FORN7LG7.js → chunk-2DX65GOO.js} +1 -1
  20. package/dist/{chunk-6CFBF543.js → chunk-5IWSOLLY.js} +2 -2
  21. package/dist/chunk-FOEVG7RT.js +21 -0
  22. package/dist/chunk-GMMTTWHB.js +3 -0
  23. package/dist/chunk-LMIQV3NB.js +13 -0
  24. package/dist/{chunk-SVO3ES2E.js → chunk-MIAJQGWE.js} +1 -1
  25. package/dist/chunk-MSIN5HKX.js +9 -0
  26. package/dist/chunk-OD5KLVU5.js +1 -0
  27. package/dist/{chunk-ILTSTULF.js → chunk-P4SGJTK3.js} +1 -1
  28. package/dist/chunk-PQLVWCUI.js +11 -0
  29. package/dist/chunk-QRV7RNQX.js +24 -0
  30. package/dist/chunk-R3PCJLQF.js +993 -0
  31. package/dist/chunk-SBDIHKLU.js +108 -0
  32. package/dist/chunk-VJP3R52B.js +6 -0
  33. package/dist/chunk-XUF7VW4U.js +136 -0
  34. package/dist/chunk-ZDF5AR5W.js +10 -0
  35. package/dist/chunk-ZZKIKW62.js +29 -0
  36. package/dist/index.js +639 -656
  37. package/dist/map/index.js +22 -22
  38. package/dist/markdown/index.js +6 -6
  39. package/dist/page-tabs/index.js +5 -5
  40. package/dist/pdf/index.js +1 -1
  41. package/dist/ui/index.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/Browser-RZFOKBSF.js +0 -43
  44. package/dist/Calculator-R5OEHQ67.js +0 -29
  45. package/dist/ConfirmDialog-CMNQZQA3.js +0 -1
  46. package/dist/Documents-VD32HWDQ.js +0 -52
  47. package/dist/Files-NAY3WK6O.js +0 -89
  48. package/dist/Notepad-AHRPMF57.js +0 -25
  49. package/dist/PdfViewer-3SC3LE4U.js +0 -1
  50. package/dist/PomodoroTimer-LE6J2KUU.js +0 -99
  51. package/dist/Preview-OKR5QRQP.js +0 -188
  52. package/dist/Sidebar-BQ4P5LBI.js +0 -44
  53. package/dist/Spreadsheet-RME4IQ43.js +0 -37
  54. package/dist/chunk-4VTHXNGZ.js +0 -1003
  55. package/dist/chunk-5ZDM6WIC.js +0 -24
  56. package/dist/chunk-7WZEFHPS.js +0 -6
  57. package/dist/chunk-AA4TMQOS.js +0 -10
  58. package/dist/chunk-BSJIBRWC.js +0 -1
  59. package/dist/chunk-C2A4PIGZ.js +0 -13
  60. package/dist/chunk-CIXQKCFA.js +0 -11
  61. package/dist/chunk-KVOFUFPP.js +0 -3
  62. package/dist/chunk-N6STBYXR.js +0 -112
  63. package/dist/chunk-RQOP5JAJ.js +0 -9
  64. package/dist/chunk-UAIVAA5X.js +0 -21
  65. package/dist/chunk-ZAE6ROV7.js +0 -29
@@ -0,0 +1,29 @@
1
+ import{useDismissPopupsOnOpen as e}from"./chunk-AFYQTVZO.js";import{registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-X4FJ54PP.js";import{CloseFallbackB as r,WarningFallback as o,CloseFallback as l}from"./chunk-XUF7VW4U.js";import{useShellStrings as i,splitAround as a}from"./chunk-J3LIIIHJ.js";import{Icon as s}from"./chunk-YKZHOXI4.js";import{createContext as c,useEffect as d,useRef as u,useId as m,useContext as f,useState as b,useCallback as h}from"react";import{jsxs as g,jsx as p,Fragment as y}from"react/jsx-runtime";var x=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function v(e){return Array.from(e.querySelectorAll(x)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var w=[];function N(e){const t=w.findIndex(t=>t!==e&&e.contains(t));-1===t?w.push(e):w.splice(t,0,e)}function k(e){const t=w.lastIndexOf(e);-1!==t&&w.splice(t,1)}var C=/* @__PURE__ */new WeakSet;function L(e){return v(e)}function E(e,t){d(()=>{if(!t)return;const n=e.current;return n?(C.add(n),N(n),()=>{k(n),C.delete(n)}):void 0},[e,t])}function P(e,t){const n=w.lastIndexOf(t),r=n>0?w[n-1]:-1===n?w[w.length-1]??null:null,o=v(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),l=o.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return l||(r&&!C.has(r)?o[0]??null:null)}function j(e,t,n){d(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,l=n?.current??v(r)[0]??r;l!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),l.focus();const i=e=>{if("Tab"!==e.key)return;if(w[w.length-1]!==r)return;const t=v(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],l=document.activeElement;!e.shiftKey||l!==n&&r.contains(l)?e.shiftKey||l!==o&&r.contains(l)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return N(r),document.addEventListener("keydown",i,!0),()=>{k(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var I=0,F=null;function O(e){d(()=>{if(!e)return;const t=document.body;if(0===I){F={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return I+=1,()=>{0===(I-=1)&&F&&(t.style.overflow=F.overflow,t.style.paddingRight=F.paddingRight,F=null)}},[e])}var T={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function W({open:o,onClose:l,title:a,description:c,role:f="dialog",children:b,footer:h,blocking:y=!1,size:x="md",initialFocus:v,"aria-label":w,"aria-labelledby":N,"aria-describedby":k,className:C=""}){const L=u(null),E=m(),P=m(),I=!y&&!h,F=m(),W=i().dialog;return e(o),j(L,o,v),O(o),d(()=>{if(o)return t(()=>(y||l(),!0),()=>L.current)},[o,y,l]),o?/* @__PURE__ */g("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
2
+ /* @__PURE__ */p("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
+ /* @__PURE__ */p("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:y?void 0:e=>{e.target===e.currentTarget&&l()},children:/* @__PURE__ */g("div",{ref:L,role:f,"aria-modal":"true","aria-labelledby":a?F:N,"aria-label":a||N?void 0:w,"aria-describedby":k??(c?P:b?E:void 0),className:`relative max-h-full w-full ${T[x]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${C}`.trim(),children:[a&&/* @__PURE__ */p("h2",{id:F,className:(I?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:a}),c&&/* @__PURE__ */p("p",{id:P,className:((a?"mt-1":I?"pr-8":"")+" text-sm text-gray-500").trim(),children:c}),b&&/* @__PURE__ */p("div",{id:E,className:"mt-2 text-sm text-gray-600",children:b}),h&&/* @__PURE__ */p("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:h}),I&&/* @__PURE__ */p("button",{type:"button",onClick:l,"aria-label":W.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */p(s,{name:"close",fallback:r,className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}var D=c(()=>Promise.resolve(!1)),$=()=>f(D),A=()=>Promise.resolve(!1),K=e=>A(e),R=()=>Promise.resolve(!1),J=e=>R(e),S=()=>Promise.resolve(null),U=e=>S(e),V={danger:{icon:"text-red-600 bg-red-100",button:"bg-red-600 hover:bg-red-700 text-white"},warning:{icon:"text-yellow-600 bg-yellow-100",button:"bg-yellow-600 hover:bg-yellow-700 text-white"},info:{icon:"text-blue-600 bg-blue-100",button:"bg-blue-600 hover:bg-blue-700 text-white"}},X="bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50";function z(){/* @__PURE__ */
4
+ return p(s,{name:"warning",fallback:o,className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function H(){/* @__PURE__ */
5
+ return p(s,{name:"close",fallback:l,className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function Y({children:e}){const[t,n]=b(!1),[r,o]=b({message:""}),[l,s]=b(0),c=u(),m=u(null),f=u(0),x=u([]),v=u(null),w=u(null),N=h(e=>{m.current=e.id,c.current=e.resolve,s(e.id),o(e.options),n(!0)},[]),k=h(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++f.current,options:t,resolve:e};null===m.current?N(n):x.current.push(n)})},[N]),[C,L]=b(!1),[E,P]=b({message:""}),[j,I]=b(""),F=u(),O=h(e=>(P(e),I(""),L(!0),new Promise(e=>{F.current=e})),[]),[T,$]=b(!1),[K,J]=b({}),[U,Y]=b(""),Z=u(),_=h(e=>{const t="string"==typeof e?{message:e}:e;return J(t),Y(t.defaultValue??""),$(!0),new Promise(e=>{Z.current=e})},[]);d(()=>{A=k,R=O,S=_},[k,O,_]);const q=(e,t)=>{if(m.current!==e)return;const r=c.current,o=x.current.shift();o?N(o):(m.current=null,c.current=void 0,n(!1)),r?.(t)},G=e=>{L(!1),I(""),F.current?.(e)},M=e=>{if(e){const e=U.trim();if(!e&&!K.allowEmpty)return $(!1),void Z.current?.(null);$(!1),Z.current?.(e)}else $(!1),Z.current?.(null)},Q=r.variant||(r.confirmLabel?.toLowerCase().includes("delete")||r.message.toLowerCase().includes("delete")?"danger":"info"),B=V[Q],ee=V["warning"===E.variant?"warning":"danger"],te=E.confirmWord,ne=null==te||j===te,re=i().dialog,[oe,le]=a(re.typeToConfirm);/* @__PURE__ */
6
+ return g(D.Provider,{value:k,children:[e,
7
+ /* @__PURE__ */p(W,{open:t,onClose:()=>q(l,!1),initialFocus:v,footer:/* @__PURE__ */g(y,{children:[
8
+ /* @__PURE__ */p("button",{ref:v,type:"button",onClick:()=>q(l,!1),className:X,children:r.cancelLabel||re.cancel}),
9
+ /* @__PURE__ */p("button",{type:"button",onClick:()=>q(l,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${B.button}`,children:r.confirmLabel||re.ok})]}),children:/* @__PURE__ */g("div",{className:"flex gap-4",children:[
10
+ /* @__PURE__ */p("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${B.icon}`,children:/* @__PURE__ */p(z,{})}),
11
+ /* @__PURE__ */g("div",{className:"flex-1",children:[
12
+ /* @__PURE__ */p("h2",{className:"text-base font-semibold text-gray-900",children:r.title||re.confirmTitle}),
13
+ /* @__PURE__ */p("p",{className:"mt-2 text-sm text-gray-600",children:r.message})]})]})}),
14
+ /* @__PURE__ */g(W,{open:C,onClose:()=>G(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */g(y,{children:[
15
+ /* @__PURE__ */p("button",{ref:w,type:"button",onClick:()=>G(!1),className:X,children:E.cancelLabel||re.destructiveCancel}),
16
+ /* @__PURE__ */p("button",{type:"button",onClick:()=>G(!0),disabled:!ne,className:`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${ee.button}`,children:te??E.confirmLabel??re.destructiveConfirm})]}),children:[
17
+ /* @__PURE__ */p("button",{type:"button",onClick:()=>G(!1),"aria-label":re.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */p(H,{})}),
18
+ /* @__PURE__ */g("div",{className:"flex gap-4",children:[
19
+ /* @__PURE__ */p("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ee.icon}`,children:/* @__PURE__ */p(z,{})}),
20
+ /* @__PURE__ */g("div",{className:"flex-1",children:[
21
+ /* @__PURE__ */p("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:E.title||re.destructiveTitle}),
22
+ /* @__PURE__ */p("p",{className:"mt-2 text-sm text-gray-600",children:E.message}),null!=te&&/* @__PURE__ */g(y,{children:[
23
+ /* @__PURE__ */g("p",{className:"mt-3 text-sm text-gray-700",children:[oe,
24
+ /* @__PURE__ */p("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-1.5 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),le]}),
25
+ /* @__PURE__ */p("input",{autoFocus:!0,type:"text",value:j,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&G(!0)},placeholder:te,className:"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500"})]})]})]})]}),
26
+ /* @__PURE__ */g(W,{open:T,onClose:()=>M(!1),title:K.title||re.promptTitle,footer:/* @__PURE__ */g(y,{children:[
27
+ /* @__PURE__ */p("button",{type:"button",onClick:()=>M(!1),className:X,children:K.cancelLabel||re.cancel}),
28
+ /* @__PURE__ */p("button",{type:"button",onClick:()=>M(!0),disabled:!K.allowEmpty&&!U.trim(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40",children:K.confirmLabel||re.ok})]}),children:[K.message&&/* @__PURE__ */p("p",{className:"text-sm text-gray-600",children:K.message}),
29
+ /* @__PURE__ */p("input",{autoFocus:!0,type:"text",value:U,onChange:e=>Y(e.target.value),onKeyDown:e=>{"Enter"===e.key?M(!0):"Escape"===e.key&&M(!1)},onFocus:e=>e.target.select(),placeholder:K.placeholder,className:"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})]})}export{Y as ConfirmProvider,W as Dialog,K as confirm,J as confirmDestructive,L as focusableIn,U as prompt,P as stopAfter,$ as useConfirm,j as useFocusTrap,O as useScrollLock,E as useTabLayer};