efficient-shell 7.40.0 → 7.43.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/dist/{Browser-WFF3V5XN.js → Browser-XNIEIZS2.js} +13 -13
- package/dist/Calculator-Q3TNKTCG.js +29 -0
- package/dist/ConfirmDialog-QT4KJAP7.js +1 -0
- package/dist/{CurrencyConverter-5LXIRNZG.js → CurrencyConverter-QIH4GI3K.js} +12 -12
- package/dist/{Documents-73VBBEBF.js → Documents-7AYPEXL2.js} +4 -4
- package/dist/{Files-FFNF3QZ7.js → Files-GKEGMDUL.js} +43 -43
- package/dist/{Notepad-XIG4KJA5.js → Notepad-W4FJYXO4.js} +10 -10
- package/dist/PdfViewer-LGD633HY.js +1 -0
- package/dist/PomodoroTimer-LMLEPMFD.js +91 -0
- package/dist/{Preview-C2ZC2SM3.js → Preview-DI7VDRQR.js} +24 -24
- package/dist/Sidebar-HT7BIMTD.js +44 -0
- package/dist/{Spreadsheet-FZV4FL6H.js → Spreadsheet-NTLSJ37V.js} +13 -13
- package/dist/{Stock-PWDOGWFR.js → Stock-VUGVYNNI.js} +7 -7
- package/dist/{Weather-WRNKDPM2.js → Weather-TAJQCYIV.js} +18 -18
- package/dist/{WorldClock-L43LQEXI.js → WorldClock-ZQ2VI2NB.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-KNGFJOQD.js → chunk-22EP5XS2.js} +1 -1
- package/dist/{chunk-4755JEGD.js → chunk-3G5TA3IF.js} +34 -7
- package/dist/{chunk-3K5JZXDC.js → chunk-6K5EFHDQ.js} +8 -8
- package/dist/{chunk-UQVSH226.js → chunk-7RI5F5VX.js} +1 -1
- package/dist/chunk-7TD4XKYF.js +1 -0
- package/dist/{chunk-TRNQNGYE.js → chunk-BY3KWWWU.js} +14 -14
- package/dist/{chunk-UONWRDS7.js → chunk-COUELSZF.js} +4 -4
- package/dist/{chunk-KEZYLOFK.js → chunk-DENNF2LM.js} +2 -2
- package/dist/chunk-FWEGDHFT.js +1 -0
- package/dist/{chunk-Y6V2JPN3.js → chunk-JK4PTQFV.js} +1 -1
- package/dist/{chunk-F7OP5E6L.js → chunk-NT4SZH5L.js} +1 -1
- package/dist/{chunk-E4FJNJ2I.js → chunk-OMOQC57R.js} +97 -97
- package/dist/{chunk-IL4TXZ2Z.js → chunk-PMDHTWBR.js} +471 -465
- package/dist/{chunk-OTFHGJSO.js → chunk-QDCMVFK5.js} +5 -5
- package/dist/{chunk-XKANXONN.js → chunk-TFYZB4NY.js} +2 -2
- package/dist/{chunk-VHHZHNJC.js → chunk-UNA3BQJI.js} +7 -7
- package/dist/{chunk-F5BQTXGY.js → chunk-YD4DPX4H.js} +1 -1
- package/dist/{chunk-CXF2BVXH.js → chunk-YRLOXHKG.js} +1 -1
- package/dist/{chunk-E3JFDVQ5.js → chunk-ZN6W2KOC.js} +11 -11
- package/dist/icons/efficient-looks.js +102 -86
- package/dist/icons/efficient.d.ts +23 -7
- package/dist/icons/efficient.js +325 -303
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/{index-CFyMUpku.d.ts → index-p7sSFfAC.d.ts} +287 -188
- package/dist/index.d.ts +2 -2
- package/dist/index.js +682 -682
- package/dist/map/index.js +2 -2
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-L6726KWL.js +0 -29
- package/dist/ConfirmDialog-V7JRHNK7.js +0 -1
- package/dist/PdfViewer-BS5UDROT.js +0 -1
- package/dist/PomodoroTimer-LHHDM6ML.js +0 -91
- package/dist/Sidebar-XMH2FKCU.js +0 -44
- package/dist/chunk-ENMILDMH.js +0 -1
- package/dist/chunk-IZWMK4LP.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{Icon as r}from"./chunk-
|
|
1
|
+
import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{Icon as r}from"./chunk-3G5TA3IF.js";import{useShellStrings as n}from"./chunk-LVCRH3K6.js";import{createContext as o,useSyncExternalStore as i,useCallback as a,useContext as s,useMemo as c}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)",f="(max-width: 767px)";function m(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}var h=()=>m(d),w=()=>m(f);function g(){return!1}var p=e=>y(d,e),v=e=>y(f,e);function y(e,t){if("undefined"==typeof window||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?(r.addEventListener("change",t),()=>r.removeEventListener("change",t)):(r.addListener(t),()=>r.removeListener(t))}function x(){return i(p,h,g)}function b(){return i(v,w,g)}var _={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},C={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},S={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function D({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
2
2
|
return u(r,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
3
|
return u(r,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
4
|
return u(r,{name:"error",...t});default:/* @__PURE__ */
|
|
5
|
-
return u(r,{name:"info",...t})}}function
|
|
5
|
+
return u(r,{name:"info",...t})}}function E({status:e="info",title:t,subTitle:r,extra:o,icon:i,children:a,className:s=""}){const c=_[e],d=n().errors;/* @__PURE__ */
|
|
6
6
|
return l("div",{role:"error"===c?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
|
|
7
|
-
/* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${C[c]}`,children:i??/* @__PURE__ */u(
|
|
8
|
-
/* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??
|
|
7
|
+
/* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${C[c]}`,children:i??/* @__PURE__ */u(D,{tone:c})}),
|
|
8
|
+
/* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??S[e]?.(d)??""}),r&&/* @__PURE__ */u("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:r}),a&&/* @__PURE__ */u("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}var L="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),M={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},T=L?0:1,N=M.MOD[T],A=M.ALT[T],k="⇧",I="⏎",H=M.CMD_ENTER[T],j=M.CMD_S[T],F=M.CMD_K[T],Z=M.CMD_DOT[T],O=M.CMD_A[T],P=M.CMD_Z[T],K=M.CMD_SHIFT_Z[T],R=M.ALT_SHIFT_D[T],z=M.ALT_SHIFT_E[T],J=M.ALT_SHIFT_N[T],U=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function W(t){return e()?t:U.get(t)??t}var $={neutral:"inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},B={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function G({keys:e,size:t="md",tone:r="neutral",className:n=""}){const o=W(e);/* @__PURE__ */
|
|
9
9
|
return u("kbd",{className:[$[r],B[t],n].filter(Boolean).join(" "),children:o})}var V=o(null);function q({value:e,children:t}){/* @__PURE__ */
|
|
10
|
-
return u(V.Provider,{value:e,children:t})}function Q(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var X={prefs:{},save:()=>{}};function Y(){return s(V)??X}function ee(){const{prefs:e,save:t}=Y(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var te="react-os-shell:stale-chunk-reload-at",re=3e4,ne="vite:preloadError",oe="/_next/static/",ie=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ae(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return ie.test(t)}function se(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(te),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?oe:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(te),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(te,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ae(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||l||u.has(t)||(u.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(ne,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(ne,s),d&&window.removeEventListener("error",d,!0)}}export{A as ALT,R as ALT_SHIFT_D,
|
|
10
|
+
return u(V.Provider,{value:e,children:t})}function Q(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var X={prefs:{},save:()=>{}};function Y(){return s(V)??X}function ee(){const{prefs:e,save:t}=Y(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var te="react-os-shell:stale-chunk-reload-at",re=3e4,ne="vite:preloadError",oe="/_next/static/",ie=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ae(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return ie.test(t)}function se(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(te),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?oe:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(te),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(te,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ae(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||l||u.has(t)||(u.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(ne,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(ne,s),d&&window.removeEventListener("error",d,!0)}}export{A as ALT,R as ALT_SHIFT_D,z as ALT_SHIFT_E,J as ALT_SHIFT_N,O as CMD_A,Z as CMD_DOT,H as CMD_ENTER,F as CMD_K,j as CMD_S,K as CMD_SHIFT_Z,P as CMD_Z,I as ENTER,G as Kbd,N as MOD,oe as NEXT_CHUNK_PATH_PREFIX,E as Result,k as SHIFT,re as STALE_CHUNK_RELOAD_COOLDOWN_MS,te as STALE_CHUNK_RELOAD_KEY,q as ShellPrefsProvider,ne as VITE_PRELOAD_ERROR_EVENT,se as installStaleChunkReload,L as isMac,ae as isStaleChunkError,x as useIsMobile,b as useIsPhone,Q as useLocalStoragePrefs,ee as useShellPrefs,Y as useShellPrefsAdapter,W as useShortcutLabel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{toast_default as t}from"./chunk-WSRZRWN7.js";import{useShellPrefs as e}from"./chunk-
|
|
2
|
-
return(new Date).toISOString()}var
|
|
1
|
+
import{toast_default as t}from"./chunk-WSRZRWN7.js";import{useShellPrefs as e}from"./chunk-QDCMVFK5.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),O()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&O())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,R={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function _(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function O(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=_(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*R[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function V(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=_(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*R[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var W="pomodoro_tasks",G="pomodoro_tasks_migrated";function j(){return Math.random().toString(36).slice(2,11)}function q(){/* @__PURE__ */
|
|
2
|
+
return(new Date).toISOString()}var E=null,J=[],K=!1,L=null,Q=/* @__PURE__ */new Set;function Z(){for(const t of Q)t()}function $(t){J=t,Z()}function z(){const t=E;return t?L=t.list().then(e=>{E===t&&(J=e,K=!0,Z())}).catch(()=>{E===t&&(K=!0,Z())}).finally(()=>{L=null}):(J=[],K=!0,Z(),Promise.resolve())}function H(t){E=t,J=[],K=!1,t?z():Z()}function U(t){return Q.add(t),!E||K||L||z(),()=>{Q.delete(t)}}function X(){return J}function Y(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=j(),n=q(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:q()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,X,X),i=o(e=>{const n=E;if(!n)return t.addTask(e);const o="tmp-"+j(),a=q(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...J,r]),n.create({...e,name:e.name.trim()}).then(t=>$(J.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(J.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=E;if(!o)return t.updateTask(e,n);$(J.map(t=>t.id===e?{...t,...n,id:e,updatedAt:q()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=E;if(!n)return t.removeTask(e);const o=J;$(J.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!E)return t.toggleDone(e);const n=J.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{E||t.setAllTasks(e)},[t]);return null===E?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(G))return;const n=localStorage.getItem(W);if(!n)return void localStorage.setItem(G,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(W),void localStorage.setItem(G,"1");const a=q(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||j(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(W),localStorage.setItem(G,"1")}catch{try{localStorage.setItem(G,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,V as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Y as useTodoTasks};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-FIEA5CGB.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{Icon as l}from"./chunk-
|
|
2
|
-
return w("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&&
|
|
3
|
-
return b("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),c?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */w(
|
|
1
|
+
import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-7IQ3B77H.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-FIEA5CGB.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{Icon as l}from"./chunk-3G5TA3IF.js";import{createContext as u,forwardRef as c,useContext as s,useRef as d,useId 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 w,Fragment as x}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 C(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function N(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(C(t,`[${k}]`))return!0;if(C(t,"textarea"))return!0;if(C(t,"img, picture, canvas, video, audio"))return!0;const n=C(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(v.has(e))return!0}const r=C(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(e,t,n){const r=C(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 L(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return N(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function A(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function B(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function M(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 W(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 H=u(null),P=u(!1);function I({children:t,style:a,className:l="",onClose:u,minWidth:c=180,portal:s=!1}){const g=d(null),b=p(),[x,v]=m([]),k=d();h(()=>()=>clearTimeout(k.current),[]);const C=i(),T=f(()=>{const e=()=>clearTimeout(k.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>A(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>B(e,t)),200)},closeBelow:t=>{e(),v(e=>B(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),u?.()},root:g}},[b,x,u]);h(()=>{if(!u)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)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const o=n(u),i=r(()=>!1,()=>g.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),o(),i()}},[u,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 E=R(),L=/(^|[\s:])!?z-/.test(l),M=/* @__PURE__ */w("div",{ref:g,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===E?"py-1":"large"===E?"py-2":"py-1"} ${l}`,onContextMenu:e=>{N(e.target)||e.preventDefault()},style:{...L?{}:{zIndex:o.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...a},children:/* @__PURE__ */w(H.Provider,{value:T,children:t})});return s?C?y(M,document.body):null:M}function D(e,t,n,r=!1){const o=R(),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 F=/* @__PURE__ */w(l,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function j({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return w("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&&F}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&F})}var S=c(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:a,tabIndex:l,id:u,onMouseEnter:c},d){const p=s(H),m=s(P),h=D(r,o,n),f=void 0===a?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return b("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),c?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */w(j,{kind:f,checked:!!a}),t]})}),z=/* @__PURE__ */w(l,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function q(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 U(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function K({label:t,icon:n,children:o,disabled:i,className:l="",minWidth:u=180,maxHeight:c}){const m=s(H),v=p(),k=d(null),C=d(null),T=d(),E=d(!1),L=`${v}-menu`;h(()=>()=>clearTimeout(T.current),[]);const A=m?.depth??0,B=m?.path[A],M=!!B&&B.key===v&&!i,P=g(e=>{if(!m||i||!k.current)return;clearTimeout(T.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=A>0&&(m.path[A-1]?.flipped??!1),a=W(r.left,r.right,u,window.innerWidth,4,o);m.open(A,{key:v,y:t.top,...a})},[m,i,A,v,u]),I=e=>{m?.closeBelow(A),k.current?.focus()};h(()=>{if(M)return r(e=>"Escape"===e.key&&(!(m&&m.path.length>A+1)&&(I(),!0)),()=>C.current)}),a(()=>{if(!M||!B)return;const e=()=>{const e=C.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=A>0&&(m?.path[A-1]?.flipped??!1),o=e.offsetWidth||u,i=W(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)}}),h(()=>{M&&E.current&&(E.current=!1,U(C.current)[0]?.focus())},[M]);const F=f(()=>m&&{...m,depth:A+1},[m,A]);if(!m)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const j=D(!1,i,l,M),S=R();/* @__PURE__ */
|
|
4
4
|
return b(x,{children:[
|
|
5
|
-
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded"
|
|
6
|
-
/* @__PURE__ */w("span",{className:"min-w-0 flex-1 truncate",children:t}),z]})
|
|
7
|
-
/* @__PURE__ */w("div",{ref:C,id:L,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"===S?"py-1":"large"===S?"py-2":"py-1"),style:{left:
|
|
5
|
+
/* @__PURE__ */b("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":M,"aria-controls":M?L:void 0,disabled:i,"data-popup-submenu-row":!0,className:j.className,style:j.style,onClick:e=>{const t=0===e.detail;M?t&&U(C.current)[0]?.focus():P(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),P(!0))},onMouseEnter:()=>{i||(m.cancelClose(),M?m.closeBelow(A+1):(clearTimeout(T.current),T.current=setTimeout(()=>P(!1),120)))},onMouseLeave:()=>{clearTimeout(T.current),m.scheduleClose(A)},children:[n,
|
|
6
|
+
/* @__PURE__ */w("span",{className:"min-w-0 flex-1 truncate",children:t}),z]}),M&&y(
|
|
7
|
+
/* @__PURE__ */w("div",{ref:C,id:L,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"===S?"py-1":"large"===S?"py-2":"py-1"),style:{left:B.left,top:B.y,minWidth:u,maxHeight:void 0===c?"calc(100vh - 16px)":`min(${"number"==typeof c?`${c}px`:c}, calc(100vh - 16px))`,zIndex:q(m.root.current)+A+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=U(C.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(),I())},onMouseEnter:()=>{m.cancelClose(),clearTimeout(T.current)},onMouseLeave:()=>m.scheduleClose(A+1),onContextMenu:e=>{N(e.target)||e.preventDefault()},children:/* @__PURE__ */w(H.Provider,{value:F,children:o})}),document.body)]})}function G(){const e=R();/* @__PURE__ */
|
|
8
8
|
return w("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function J(){const e=R(),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 O({children:e}){/* @__PURE__ */
|
|
9
9
|
return w("div",{className:"text-xs font-medium uppercase tracking-wide",style:J(),children:e})}function Q({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
|
|
10
|
-
return w("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{
|
|
10
|
+
return w("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{j as MenuCheckMark,Q as MenuIcon,P as MenuSemanticsContext,k as NATIVE_MENU_ATTR,I as PopupMenu,G as PopupMenuDivider,S as PopupMenuItem,O as PopupMenuLabel,K as PopupSubmenu,$ as clampMenuTop,B as closeMenuBelow,E as describeContextTarget,D as itemLook,N as keepsNativeMenu,L as leavesContextMenuAlone,W as menuPanelLeft,J as menuTextRowStyle,A as openMenuLevel,M as resolveMenuLevels};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-3G5TA3IF.js";import{useShellStrings as t}from"./chunk-LVCRH3K6.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requestFilesTrashView as n}from"./chunk-
|
|
1
|
+
import{requestFilesTrashView as n}from"./chunk-DENNF2LM.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as t}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as t}from"./chunk-YD4DPX4H.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-UNA3BQJI.js";import{Icon as i}from"./chunk-3G5TA3IF.js";import{useShellStrings as a}from"./chunk-LVCRH3K6.js";import{useState as o,useEffect as s,Fragment as c}from"react";import{jsxs as d,jsx as m,Fragment as u}from"react/jsx-runtime";var y="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function p(){/* @__PURE__ */
|
|
2
2
|
return m(i,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function h({text:n,label:r,copiedLabel:l}){const{copied:i,copy:a}=e(n);/* @__PURE__ */
|
|
3
|
-
return m("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__ */m(t,{copied:i,className:"size-3.5"})})}function b({tabs:e,activeKey:t,idFor:i,panelMounted:b,onActivate:f,onClose:g,onCloseMany:x,label:k,className:v,activeClassName:N,end:w,onIconMenu:C,menuItems:j}){const
|
|
3
|
+
return m("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__ */m(t,{copied:i,className:"size-3.5"})})}function b({tabs:e,activeKey:t,idFor:i,panelMounted:b,onActivate:f,onClose:g,onCloseMany:x,label:k,className:v,activeClassName:N,end:w,onIconMenu:C,menuItems:j}){const I=a().pageTabs,[$,z]=o(null),D=e.length;s(()=>{if(!t)return;const e=document.getElementById(i(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[i,t,D]);const A=e.some(e=>e.key===t)?t:e[0]?.key,M=t=>{const n=e[(t+e.length)%e.length];n&&document.getElementById(i(n.key,"tab"))?.focus()},_=$?e.find(e=>e.key===$.key):void 0,B=_&&j?j(_.key):[],E=_?e.indexOf(_):-1,L=e=>e.some(e=>!e.pinned),R=e=>()=>{z(null),e()};/* @__PURE__ */
|
|
4
4
|
return d("div",{className:v??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
5
5
|
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
6
|
-
/* @__PURE__ */m("div",{role:"tablist","aria-label":k,onKeyDown:t=>{const n=e.findIndex(e=>document.getElementById(i(e.key,"tab"))===t.target);if(!(n<0)){if("ArrowRight"===t.key)
|
|
6
|
+
/* @__PURE__ */m("div",{role:"tablist","aria-label":k,onKeyDown:t=>{const n=e.findIndex(e=>document.getElementById(i(e.key,"tab"))===t.target);if(!(n<0)){if("ArrowRight"===t.key)M(n+1);else if("ArrowLeft"===t.key)M(n-1);else if("Home"===t.key)M(0);else if("End"===t.key)M(e.length-1);else{if("Delete"!==t.key||e[n].pinned)return;g(e[n].key)}t.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((n,r)=>{const l=n.key===t,a=!!n.dirty,o=n.icon,s=l?N??"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",u=r>0&&!l&&e[r-1].key!==t,x={type:"button",role:"tab",id:i(n.key,"tab"),"aria-selected":l,"aria-controls":b?.(n.key)?i(n.key,"panel"):void 0,tabIndex:n.key===A?0:-1,title:n.title,onClick:()=>f(n.key)},k={onContextMenu:e=>((e,t)=>{e.preventDefault(),z({x:e.clientX,y:e.clientY,key:t.key})})(e,n),onAuxClick:e=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),g(t.key))})(e,n),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=o&&
|
|
7
7
|
/* @__PURE__ */d("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&&!n.pinned&&
|
|
8
8
|
/* @__PURE__ */m("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"})]}),w=l&&!!C&&!!o;return n.pinned?/* @__PURE__ */m("div",{role:"presentation",className:`group relative flex h-9 flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${o?"w-10":""} ${s}`,...k,children:/* @__PURE__ */d("button",{...x,className:`flex h-full items-center justify-center rounded-t-md ${o?"w-full":"px-3"} ${y}`,children:[v,
|
|
9
9
|
/* @__PURE__ */m("span",{className:o?"sr-only":"whitespace-nowrap text-sm",children:n.title})]})},n.key):/* @__PURE__ */d(c,{children:[u&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
10
10
|
/* @__PURE__ */d("div",{role:"presentation",className:`group @container relative flex h-9 items-center rounded-t-md border border-b-0 text-sm transition-colors ${l&&(n.copy||w)?"flex-[0_1_20rem]":"flex-[0_1_15rem]"} ${l?"min-w-[4.25rem]":"min-w-[2.75rem]"} ${s}`,...k,children:[w&&
|
|
11
|
-
/* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label"
|
|
11
|
+
/* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":I.tabMenu,title:I.tabMenu,onClick:e=>{const t=e.currentTarget.getBoundingClientRect();C?.(n.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${y}`,children:v}),
|
|
12
12
|
/* @__PURE__ */d("button",{...x,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${w?"pl-2":"pl-3"} ${y} ${l?w?"":"@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&&v,
|
|
13
|
-
/* @__PURE__ */m("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(o?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:n.title})]}),l&&n.copy&&/* @__PURE__ */m(h,{text:n.copy,label
|
|
14
|
-
/* @__PURE__ */d("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__ */m("span",{role:"img","aria-label"
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-label"
|
|
13
|
+
/* @__PURE__ */m("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(o?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:n.title})]}),l&&n.copy&&/* @__PURE__ */m(h,{text:n.copy,label:I.copy(n.copy),copiedLabel:I.copied}),
|
|
14
|
+
/* @__PURE__ */d("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__ */m("span",{role:"img","aria-label":I.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-label":I.closeTab?.(n.title)??`${I.close} ${n.title}`,onClick:()=>g(n.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__ */m(p,{})})]})]})]},n.key)})}),w&&/* @__PURE__ */m("div",{className:"flex shrink-0 items-center gap-2 self-center",children:w}),$&&_&&/* @__PURE__ */d(n,{portal:!0,style:{left:$.x,top:$.y},onClose:()=>z(null),children:[B.length>0&&/* @__PURE__ */d(u,{children:[B.map((e,t)=>/* @__PURE__ */d(r,{onClick:R(e.onSelect),children:[e.icon,e.label]},t)),
|
|
16
16
|
/* @__PURE__ */m(l,{})]}),
|
|
17
|
-
/* @__PURE__ */m(r,{disabled:
|
|
17
|
+
/* @__PURE__ */m(r,{disabled:_.pinned,onClick:R(()=>g(_.key)),children:I.close}),
|
|
18
18
|
/* @__PURE__ */m(l,{}),
|
|
19
|
-
/* @__PURE__ */m(r,{disabled:!
|
|
20
|
-
/* @__PURE__ */m(r,{disabled:!
|
|
21
|
-
/* @__PURE__ */m(r,{disabled:!
|
|
19
|
+
/* @__PURE__ */m(r,{disabled:!L(e.filter(e=>e.key!==_.key)),onClick:R(()=>x("others",_.key)),children:I.closeOthers}),
|
|
20
|
+
/* @__PURE__ */m(r,{disabled:!L(e.slice(E+1)),onClick:R(()=>x("right",_.key)),children:I.closeRight}),
|
|
21
|
+
/* @__PURE__ */m(r,{disabled:!L(e),onClick:R(()=>x("all",null)),children:I.closeAll})]})]})}export{b as TabStrip};
|