efficient-shell 4.166.0 → 4.168.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 +134 -1
- package/dist/{Browser-2MBG34IR.js → Browser-PZPREN6H.js} +14 -14
- package/dist/{Calculator-R3WJTNZ6.js → Calculator-NXMUEH5D.js} +22 -22
- package/dist/{CurrencyConverter-PEXSQQUK.js → CurrencyConverter-3BTIZ2LT.js} +6 -6
- package/dist/{Documents-YL4RIOZO.js → Documents-YAOM3L47.js} +10 -10
- package/dist/{Files-3ZRUTRSB.js → Files-2UHYDMLL.js} +30 -30
- package/dist/{Notepad-3ZM2FR6C.js → Notepad-OWL75AYX.js} +9 -9
- package/dist/{PomodoroTimer-5QHA5UOY.js → PomodoroTimer-SCPEOG6W.js} +27 -27
- package/dist/{Preview-32F4DTCK.js → Preview-5R3QZSJU.js} +16 -16
- package/dist/{Sidebar-QQSRLMJG.js → Sidebar-C5RXL72L.js} +17 -17
- package/dist/{Spreadsheet-GOZI7I4L.js → Spreadsheet-XT4HF7MQ.js} +14 -14
- package/dist/{Stock-XJFITZZA.js → Stock-UGDIALNB.js} +4 -4
- package/dist/{Weather-BDC633GV.js → Weather-CR2MN5XF.js} +15 -15
- package/dist/{WorldClock-ROOVRRCJ.js → WorldClock-JBNJ7C7J.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +2 -0
- package/dist/brand.css +1 -1
- package/dist/{chunk-HGG5M5AB.js → chunk-6MBERZOS.js} +1 -1
- package/dist/chunk-7U3F53IG.js +1 -0
- package/dist/{chunk-CRI4UFBU.js → chunk-A7Q4BCPI.js} +5 -5
- package/dist/{chunk-7TQ7NMT3.js → chunk-CUX4XGLS.js} +1 -1
- package/dist/{chunk-G5J6YSN5.js → chunk-FVXBJGY5.js} +3 -3
- package/dist/{chunk-JKVDTKBE.js → chunk-GVZLCY3B.js} +290 -284
- package/dist/{chunk-QASZIYLG.js → chunk-JLPJBO7K.js} +1 -1
- package/dist/{chunk-BKDE67DB.js → chunk-JYLI2WXW.js} +2 -2
- package/dist/{chunk-VXBJNMAA.js → chunk-LW27IM3S.js} +98 -98
- package/dist/{chunk-UVZIPXIA.js → chunk-N3ZXQE4M.js} +3 -3
- package/dist/{chunk-7YFAFXQG.js → chunk-PLX2N4N6.js} +2 -2
- package/dist/{chunk-DTRXR6JQ.js → chunk-XKHAP6N2.js} +11 -11
- package/dist/{chunk-HA2WG27U.js → chunk-YWXYBJ5Y.js} +2 -2
- package/dist/{index-DcLqfJX3.d.ts → index-CbLbd__n.d.ts} +61 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +56 -56
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +12 -0
- package/package.json +9 -2
- package/dist/chunk-VRHUY4P4.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{VERSION as e}from"./chunk-
|
|
1
|
+
import{VERSION as e}from"./chunk-7U3F53IG.js";import{useWindowMenuItem as t,Modal as r}from"./chunk-LW27IM3S.js";import{navIcons as o}from"./chunk-DSSLOQDW.js";import{useState as n,useCallback as s,isValidElement as i,cloneElement as a}from"react";import{jsx as l,jsxs as d}from"react/jsx-runtime";var c={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:"Multi-sheet spreadsheet editor with CSV / TSV import and export."},notepad:{name:"Notepad",version:"1.0.1",route:"/notepad",description:"Color-coded notes with checklists, desktop stickies and entity autolinking."},documents:{name:"Documents",version:"1.1.0",route:"/documents",description:"Letter-page editor for Word documents and plain-text files — images, lists, alignment."},preview:{name:"Preview",version:"1.4.1",route:"/preview",description:"Viewer for PDF documents, images, DXF drawings and 3D models — CAD-style measuring with object snap and an AutoCAD-like command bar."},files:{name:"Files",version:"1.1.1",route:"/files",description:"Personal file manager with folders, uploads, quota, trash and desktop shortcut folders."},browser:{name:"Browser",version:"1.0.1",route:"/browser",description:"Minimal web browser with bookmarks, history and navigation bar."}},m=/* @__PURE__ */l("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})}),p=/* @__PURE__ */l("svg",{className:"h-9 w-9",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75A2.25 2.25 0 016 4.5h12a2.25 2.25 0 012.25 2.25v10.5A2.25 2.25 0 0118 19.5H6a2.25 2.25 0 01-2.25-2.25V6.75z M3.75 9h16.5"})});function h({app:h}){const u=c[h],[x,f]=n(!1),g=s(()=>f(!0),[]);if(t(`About ${u.name}`,g,m),!x)return null;const v=o[u.route],w=i(v)?a(v,{className:"h-9 w-9"}):p;/* @__PURE__ */
|
|
2
2
|
return l(r,{open:!0,onClose:()=>f(!1),title:`About ${u.name}`,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */d("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */l("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:w}),
|
|
4
4
|
/* @__PURE__ */l("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:u.name}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="4.168.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useShellStrings as e}from"./chunk-NCQLGQYR.js";import{useHydrated as t,useBrowserState as r}from"./chunk-D65T4H6J.js";import{createContext as n,useSyncExternalStore as o,useCallback as i,useContext as a,useMemo as s}from"react";import{jsxs as l,jsx as c}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function u(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function f(){return!1}function m(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function h(){return o(m,u,f)}var w={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},p={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"},g={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
2
2
|
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});case"error":/* @__PURE__ */
|
|
3
3
|
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});case"warning":/* @__PURE__ */
|
|
4
4
|
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})});default:/* @__PURE__ */
|
|
5
|
-
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})})}}function y({status:
|
|
5
|
+
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})})}}function y({status:t="info",title:r,subTitle:n,extra:o,icon:i,children:a,className:s=""}){const d=w[t],u=e().errors;/* @__PURE__ */
|
|
6
6
|
return l("div",{role:"error"===d?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
|
|
7
7
|
/* @__PURE__ */c("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${p[d]}`,children:i??/* @__PURE__ */c(v,{tone:d})}),
|
|
8
|
-
/* @__PURE__ */c("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:
|
|
9
|
-
/* @__PURE__ */c("p",{className:"text-sm text-gray-500",children:r})]})}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"]},_=L?0:1,C=M.MOD[_],N=M.ALT[_],b="⇧",S="⏎",D=M.CMD_ENTER[_],E=M.CMD_S[_],T=M.CMD_K[_],k=M.CMD_DOT[_],A=M.CMD_A[_],j=M.CMD_Z[_],H=M.CMD_SHIFT_Z[_],I=M.ALT_SHIFT_D[_],F=M.ALT_SHIFT_E[_],z=M.ALT_SHIFT_N[_],Z=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function O(
|
|
8
|
+
/* @__PURE__ */c("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:r??g[t]?.(u)??""}),n&&/* @__PURE__ */c("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:n}),a&&/* @__PURE__ */c("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */c("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}function x({size:e="md",padding:t="py-12",label:r,className:n=""}){const o=/* @__PURE__ */c("div",{className:`${"sm"===e?"h-5 w-5":"lg"===e?"h-12 w-12":"h-8 w-8"} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600`});return null==r?/* @__PURE__ */c("div",{className:`flex items-center justify-center ${t} ${n}`,children:o}):/* @__PURE__ */l("div",{role:"status",className:`flex flex-col items-center justify-center gap-3 ${t} ${n}`,children:[o,
|
|
9
|
+
/* @__PURE__ */c("p",{className:"text-sm text-gray-500",children:r})]})}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"]},_=L?0:1,C=M.MOD[_],N=M.ALT[_],b="⇧",S="⏎",D=M.CMD_ENTER[_],E=M.CMD_S[_],T=M.CMD_K[_],k=M.CMD_DOT[_],A=M.CMD_A[_],j=M.CMD_Z[_],H=M.CMD_SHIFT_Z[_],I=M.ALT_SHIFT_D[_],F=M.ALT_SHIFT_E[_],z=M.ALT_SHIFT_N[_],Z=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function O(e){return t()?e:Z.get(e)??e}var P="inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",$={sm:"px-1 py-0.5 text-[10px]",md:"px-1.5 py-0.5 text-[11px]"};function R({keys:e,size:t="md",className:r=""}){const n=O(e);/* @__PURE__ */
|
|
10
10
|
return c("kbd",{className:[P,$[t],r].filter(Boolean).join(" "),children:n})}var K=n(null);function J({value:e,children:t}){/* @__PURE__ */
|
|
11
|
-
return c(K.Provider,{value:e,children:t})}function U(e="react-os-shell:prefs",
|
|
11
|
+
return c(K.Provider,{value:e,children:t})}function U(e="react-os-shell:prefs",t){const[n,o]=r(()=>{try{const r=JSON.parse(localStorage.getItem(e)||"{}");return{...t??{},...r}}catch{return{...t??{}}}},{...t??{}});return{prefs:n,save:i(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var B={prefs:{},save:()=>{}};function Q(){return a(K)??B}function W(){const{prefs:e,save:t}=Q(),r=i(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return s(()=>({prefs:e,save:r}),[e,r])}var G="react-os-shell:stale-chunk-reload-at",V=3e4,Y="vite:preloadError",q="/_next/static/",X=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ee(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return X.test(t)}function te(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(G),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?q:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(G),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(G,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;ee(t)&&a(t)&&(e.preventDefault(),r())};let l=!0,c=!1;const d=/* @__PURE__ */new Set,u=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||c||d.has(t)||(d.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=>{d.delete(t),e&&l&&!c&&a(t)&&(c=!0,r())}))};return window.addEventListener(Y,s),u&&window.addEventListener("error",u,!0),()=>{l=!1,window.removeEventListener(Y,s),u&&window.removeEventListener("error",u,!0)}}export{N as ALT,I as ALT_SHIFT_D,F as ALT_SHIFT_E,z as ALT_SHIFT_N,A as CMD_A,k as CMD_DOT,D as CMD_ENTER,T as CMD_K,E as CMD_S,H as CMD_SHIFT_Z,j as CMD_Z,S as ENTER,R as Kbd,x as LoadingSpinner,C as MOD,q as NEXT_CHUNK_PATH_PREFIX,y as Result,b as SHIFT,V as STALE_CHUNK_RELOAD_COOLDOWN_MS,G as STALE_CHUNK_RELOAD_KEY,J as ShellPrefsProvider,Y as VITE_PRELOAD_ERROR_EVENT,te as installStaleChunkReload,L as isMac,ee as isStaleChunkError,h as useIsMobile,U as useLocalStoragePrefs,W as useShellPrefs,Q as useShellPrefsAdapter,O as useShortcutLabel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-LW27IM3S.js";var e=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),t="uploaded:wallpaper";function r(a,e){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===t?e||"":a}var p=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=e=>{const t=new FormData;return t.append("wallpaper",e),a.post("/auth/me/wallpaper/",t).then(a=>a.data)},l=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function s(a){const e=a?.response?.status,t=a?.response?.data,r=Array.isArray(t?.wallpaper)?t.wallpaper[0]:void 0;return r||(413===e?"That picture is too large to use as a wallpaper.":415===e?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{t as WALLPAPER_PREF_TOKEN,l as deleteWallpaper,e as getNumberingConfigs,p as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,s as wallpaperUploadError};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-
|
|
2
|
-
return a(e,{content:y??N.hint,side:"left"===c?"right":"left",delay:600,className:`absolute inset-y-0 ${M} z-10 flex w-2 ${w}`.trim(),children:/* @__PURE__ */a("div",{role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":p??N.label,"aria-valuenow":Math.round(
|
|
3
|
-
/* @__PURE__ */s("div",{className:`flex h-full flex-col ${k?"overflow-hidden":"overflow-y-auto"} ${p}`,children:[null!=
|
|
1
|
+
import{Tooltip as e}from"./chunk-JYLI2WXW.js";import{useShellStrings as r}from"./chunk-NCQLGQYR.js";import{useBrowserLayoutEffect as t,useBrowserState as n}from"./chunk-D65T4H6J.js";import{useRef as o,useEffect as i,useCallback as l}from"react";import{jsx as a,jsxs as s,Fragment as c}from"react/jsx-runtime";var u=(e,r,t)=>Math.min(t,Math.max(r,e));function d(e,r,t,n,o){return Math.round(u("left"===t?e+r:e-r,n,o))}function h(e,r,t){let n=null;try{n=window.localStorage.getItem(e)}catch{return null}const o=n?parseInt(n,10):NaN;return Number.isNaN(o)?null:u(o,r,t)}function m({width:n,onResize:s,side:c,min:m,max:f,defaultWidth:v=m,step:b=16,storageKey:g,label:p,hint:y,controls:x,className:w=""}){const N=r().resizeHandle,z=o(null),k=o({onResize:s,min:m,max:f,side:c});k.current={onResize:s,min:m,max:f,side:c},t(()=>{if(!g)return;const e=h(g,m,f);null!==e&&e!==n&&s(e)},[g]),i(()=>{if(!g)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(g,String(Math.round(n)))}catch{}},200);return()=>window.clearTimeout(e)},[n,g]);const P=l(()=>{z.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);i(()=>P,[P]);const C=e=>{z.current&&(e.currentTarget.hasPointerCapture?.(z.current.pointer)&&e.currentTarget.releasePointerCapture(z.current.pointer),P())},M="left"===c?"right-0":"left-0";/* @__PURE__ */
|
|
2
|
+
return a(e,{content:y??N.hint,side:"left"===c?"right":"left",delay:600,className:`absolute inset-y-0 ${M} z-10 flex w-2 ${w}`.trim(),children:/* @__PURE__ */a("div",{role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":p??N.label,"aria-valuenow":Math.round(n),"aria-valuemin":m,"aria-valuemax":f,"aria-controls":x,"data-resize-handle":c,onPointerDown:e=>{0===e.button&&(e.preventDefault(),z.current={x:e.clientX,width:n,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=z.current;if(!r)return;if(0===e.buttons)return void P();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:n,min:o,max:i,side:l}=k.current;n(d(r.width,t,l,o,i))},onPointerUp:C,onPointerCancel:C,onLostPointerCapture:()=>{z.current&&P()},onDoubleClick:()=>s(u(v,m,f)),onKeyDown:e=>{const r="ArrowRight"===e.key?b:"ArrowLeft"===e.key?-b:null,t=null!==r?d(n,r,c,m,f):"Home"===e.key?m:"End"===e.key?f:"Enter"===e.key?u(v,m,f):null;null!==t&&(e.preventDefault(),t!==n&&s(t))},className:"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */a("div",{"aria-hidden":"true",className:`absolute inset-y-0 ${M} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}var f=(e,r,t)=>Math.min(Math.max(e,r),t);function v({sidebar:e,sidebarTop:t,sidebarBottom:o,children:i,side:l="left",storageKey:u,defaultWidth:d=256,minWidth:v=180,maxWidth:b=480,className:g="",sidebarClassName:p=("right"===l?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:y="bg-white"}){const x="right"===l,w=r().sidebar,[N,z]=n(()=>(u?h(u,v,b):null)??f(d,v,b),f(d,v,b)),k=null!=t||null!=o,P=/* @__PURE__ */s("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:N},children:[
|
|
3
|
+
/* @__PURE__ */s("div",{className:`flex h-full flex-col ${k?"overflow-hidden":"overflow-y-auto"} ${p}`,children:[null!=t&&/* @__PURE__ */a("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:t}),k?/* @__PURE__ */a("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=o&&/* @__PURE__ */a("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:o})]}),
|
|
4
4
|
/* @__PURE__ */a(m,{side:l,width:N,onResize:z,min:v,max:b,defaultWidth:f(d,v,b),storageKey:u,hint:w.resize})]}),C=/* @__PURE__ */a("div",{className:`flex min-w-0 flex-1 flex-col ${y}`,children:i});/* @__PURE__ */
|
|
5
5
|
return a("div",{className:`flex h-full w-full overflow-hidden ${g}`,children:/* @__PURE__ */s(c,x?{children:[C,P]}:{children:[P,C]})})}export{m as ResizeHandle,v as SidebarLayout};
|