efficient-shell 12.27.0 → 12.28.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-6YRO47YI.js → Browser-PC45PVTN.js} +16 -16
- package/dist/{Calculator-LSDVIJVQ.js → Calculator-5TRNFPY4.js} +21 -21
- package/dist/{CurrencyConverter-G5IYUCN7.js → CurrencyConverter-BB4QWNER.js} +6 -6
- package/dist/Files-BKEREVQK.js +141 -0
- package/dist/{Notepad-EHISTRGJ.js → Notepad-BLUA2254.js} +8 -8
- package/dist/{PdfViewer-UY5SRC63.js → PdfViewer-4YLDY4JY.js} +1 -1
- package/dist/{PomodoroTimer-SFTPXEDV.js → PomodoroTimer-KIJKDHVO.js} +6 -6
- package/dist/{Preview-L4RT7TBC.js → Preview-JVL2N5GN.js} +13 -13
- package/dist/Sidebar-SAGLPIOC.js +44 -0
- package/dist/{Stock-YCPMLYPR.js → Stock-JQEJMIMG.js} +3 -3
- package/dist/{Weather-TLFNIPDG.js → Weather-FAQX55XL.js} +16 -16
- package/dist/{WorldClock-66IRFS2W.js → WorldClock-YSZNGEL2.js} +6 -6
- package/dist/ai/index.d.ts +155 -6
- package/dist/ai/index.js +116 -98
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/{chunk-34TQBJ7I.js → chunk-2OUAPOLK.js} +1 -1
- package/dist/chunk-2SGOKMUU.js +13 -0
- package/dist/{chunk-3CKYFCX4.js → chunk-34L5SRM7.js} +17 -17
- package/dist/chunk-3DSGJIC7.js +7 -0
- package/dist/{chunk-CALBDO7B.js → chunk-3FBXJO77.js} +1 -1
- package/dist/{chunk-DK5SXOXJ.js → chunk-47UH3D4B.js} +1 -1
- package/dist/{chunk-7LTU5TJD.js → chunk-4EFIUJ7X.js} +1 -1
- package/dist/{chunk-AQCUGTOR.js → chunk-56XCGOX5.js} +6 -6
- package/dist/{chunk-LBKKKZ4M.js → chunk-63IGYBCQ.js} +2 -2
- package/dist/chunk-64J7TYJ3.js +4 -0
- package/dist/{chunk-3JL4TCA7.js → chunk-6KOMF6WL.js} +1 -1
- package/dist/{chunk-RY7JCGLI.js → chunk-6Q7L32LL.js} +1 -1
- package/dist/{chunk-VLMBXPRM.js → chunk-7GJIIBJD.js} +1 -1
- package/dist/{chunk-DCCYUCBM.js → chunk-7NO4IENQ.js} +1 -1
- package/dist/{chunk-I7JU4IU3.js → chunk-7TNZ3DTT.js} +2 -2
- package/dist/{chunk-KP2JYXEU.js → chunk-AFWLCXQD.js} +9 -9
- package/dist/{chunk-34EBBZFK.js → chunk-AMIMNRYU.js} +1 -1
- package/dist/chunk-ASDYAASN.js +3 -0
- package/dist/{chunk-N3R6N7LG.js → chunk-ATZ262BR.js} +1 -1
- package/dist/{chunk-KZRZYLN7.js → chunk-BC4FE77W.js} +49 -49
- package/dist/chunk-BFRGDRFK.js +23 -0
- package/dist/{chunk-CCK2UWQ5.js → chunk-BKYRHQK2.js} +10 -10
- package/dist/{chunk-X34ZBXIU.js → chunk-BT2YPDQL.js} +3 -3
- package/dist/{chunk-YW3UKSON.js → chunk-CON5NRCO.js} +2 -2
- package/dist/{chunk-4ZRGMK7Y.js → chunk-DIHHV6T6.js} +1 -1
- package/dist/{chunk-N32LNPPP.js → chunk-EATV7FMU.js} +8 -8
- package/dist/{chunk-JN5NUZ6D.js → chunk-EWVE5XG6.js} +1 -1
- package/dist/chunk-FFUTSMF5.js +28 -0
- package/dist/{chunk-THLXDI76.js → chunk-GOAFMGUI.js} +10 -10
- package/dist/{chunk-MEN4B6NP.js → chunk-H2CPT6K3.js} +10 -10
- package/dist/{chunk-3J3FBYIZ.js → chunk-HLE4LTRU.js} +1 -1
- package/dist/{chunk-Y523KUQC.js → chunk-HNEI2RKX.js} +1 -1
- package/dist/{chunk-Z3CTYK3U.js → chunk-HSUTZCRT.js} +1 -1
- package/dist/{chunk-UR2ECNBB.js → chunk-HVYXJLAV.js} +1 -1
- package/dist/chunk-IATKDC52.js +9 -0
- package/dist/{chunk-G2Y5I5OR.js → chunk-IB3LLQZC.js} +1 -1
- package/dist/{chunk-XZXFUZIK.js → chunk-ISVODSRP.js} +6 -3
- package/dist/chunk-JJ2OXUK7.js +14 -0
- package/dist/{chunk-QMSINDXL.js → chunk-JLRF6FN7.js} +1 -1
- package/dist/{chunk-BZHP645G.js → chunk-K5PDLRYH.js} +8 -8
- package/dist/{chunk-GLRRX4AL.js → chunk-K5YT5PMJ.js} +1 -1
- package/dist/{chunk-SY66VJAI.js → chunk-KTO427N3.js} +1 -1
- package/dist/{chunk-6GWYFUME.js → chunk-LAO6GLBY.js} +6 -6
- package/dist/{chunk-KZHVKSNF.js → chunk-LL4KF43W.js} +1 -1
- package/dist/{chunk-FQ4IRBMA.js → chunk-MKNDDB6U.js} +1 -1
- package/dist/{chunk-4ZLFAXOC.js → chunk-MTYEY7HT.js} +11 -11
- package/dist/{chunk-ILDPJ26Y.js → chunk-N2FX4O3H.js} +1 -1
- package/dist/{chunk-WBGJ4XB7.js → chunk-N5RV73CI.js} +4 -4
- package/dist/{chunk-CJHYOHMU.js → chunk-NN32QUCE.js} +1 -1
- package/dist/{chunk-KBI3T6UC.js → chunk-O4YKOS74.js} +1 -1
- package/dist/{chunk-VQ4X3OBR.js → chunk-OMFYTCBI.js} +1 -1
- package/dist/{chunk-YRY64DQV.js → chunk-OXRQIWRT.js} +1 -1
- package/dist/{chunk-6RK6R3RY.js → chunk-PT4GMPUB.js} +1 -1
- package/dist/{chunk-PLPMCE44.js → chunk-QB2GJNGB.js} +9 -9
- package/dist/{chunk-GEZM6ARD.js → chunk-QIPO4EVJ.js} +1 -1
- package/dist/{chunk-6FZ5JTBY.js → chunk-QMBMK6PP.js} +2 -2
- package/dist/{chunk-TOVEZAIM.js → chunk-QOYKBINM.js} +1 -1
- package/dist/{chunk-63TCQAGE.js → chunk-RVVQDBV7.js} +5 -5
- package/dist/{chunk-OM42AUMS.js → chunk-S6AN76R3.js} +1 -1
- package/dist/{chunk-B4GRHE44.js → chunk-SS3CROPR.js} +3 -3
- package/dist/{chunk-676TKVDM.js → chunk-TDXRG43I.js} +1 -1
- package/dist/{chunk-T2TZBTSM.js → chunk-TKIYZE7V.js} +1 -1
- package/dist/{chunk-FD6DJRD4.js → chunk-UEFIUTOU.js} +1 -1
- package/dist/chunk-UFM4YBZ7.js +1 -0
- package/dist/{chunk-436PJFHC.js → chunk-UH5ZGWSA.js} +10 -10
- package/dist/{chunk-FTMCNC66.js → chunk-UZFFSZFI.js} +1 -1
- package/dist/{chunk-3E3LR2PM.js → chunk-V3XS6BTJ.js} +13 -13
- package/dist/{chunk-YIUWX2IU.js → chunk-VLBIM33E.js} +5 -5
- package/dist/{chunk-QZCLHKCI.js → chunk-VLKJN6HX.js} +10 -10
- package/dist/{chunk-QG37GJP2.js → chunk-WBAWJIVM.js} +4 -4
- package/dist/{chunk-QPSJYSET.js → chunk-WKYNPGFB.js} +5 -5
- package/dist/{chunk-JGRDG7CB.js → chunk-WN3JHPJI.js} +6 -6
- package/dist/{chunk-XHZVUO6F.js → chunk-WX2Q76WC.js} +6 -6
- package/dist/{chunk-DMEP2SCP.js → chunk-X5MUSNKH.js} +3 -3
- package/dist/{chunk-YI6SYUAK.js → chunk-XAEI36TW.js} +1 -1
- package/dist/{chunk-H6WXTJOT.js → chunk-XAF5ZI7H.js} +1 -1
- package/dist/{chunk-TM4CRQ3W.js → chunk-XMY2HKVD.js} +15 -15
- package/dist/{chunk-SSNTJ3M4.js → chunk-XSVQ5V7L.js} +9 -9
- package/dist/chunk-Y4FWTYZS.js +6 -0
- package/dist/{chunk-HMT3MES3.js → chunk-YWNHK6Z5.js} +18 -18
- package/dist/{chunk-LPPJNZQ6.js → chunk-YYGJJ6EI.js} +1 -1
- package/dist/{chunk-R62JKPYY.js → chunk-Z2Z653OO.js} +1 -1
- package/dist/{chunk-L543DFHF.js → chunk-ZBJ7FTA5.js} +1 -1
- package/dist/{chunk-OLCRYT3N.js → chunk-ZGCCV4WE.js} +10 -10
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +494 -494
- package/dist/map/index.js +5 -5
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Files-K7H7WHRS.js +0 -141
- package/dist/Sidebar-BKNCPUOE.js +0 -44
- package/dist/chunk-BM2QIV64.js +0 -23
- package/dist/chunk-D2WJAF62.js +0 -4
- package/dist/chunk-INADSWOF.js +0 -28
- package/dist/chunk-LCEQIFPK.js +0 -3
- package/dist/chunk-OQ6TECLX.js +0 -6
- package/dist/chunk-SFULX4E3.js +0 -7
- package/dist/chunk-TUPPFC74.js +0 -14
- package/dist/chunk-UP4HLGMZ.js +0 -9
- package/dist/chunk-VABHQDN5.js +0 -1
- package/dist/chunk-ZQ24H5UO.js +0 -13
- /package/dist/{chunk-5WK56FA3.js → chunk-TGLUENXE.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-UZFFSZFI.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-GOAFMGUI.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),A=a(),[S,U]=d(null),j=s(w);j.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});U(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const F=s(null),C=s(!1);m(()=>(F.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||F.current?.focus?.({preventScroll:!0})}),[]),m(()=>{S&&!C.current&&D&&(C.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[S,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(j.current(),!0),()=>L.current),[]),m(()=>{const e=()=>j.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const T=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void j.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=S?{left:S.left,top:S.top,maxHeight:S.maxHeight,...S.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:T,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(j.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>j.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e,TRIGGER_CLASS as n}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e,TRIGGER_CLASS as n}from"./chunk-3DSGJIC7.js";import{Tooltip as a}from"./chunk-SOZCWT6I.js";import{jsx as i,jsxs as l}from"react/jsx-runtime";function t(e,n,a){if(n&&!(n.options.length<2))/* @__PURE__ */
|
|
2
2
|
return i(s,{value:e,options:n.options,onChange:n.onChange,label:n.label,disabled:a})}var r=`${n} -ml-1 h-6 px-1 text-xs`;function s({value:n,options:t,onChange:s,label:o,disabled:c}){
|
|
3
3
|
/* @__PURE__ */
|
|
4
4
|
return i(a,{content:o,describe:!1,children:/* @__PURE__ */i(e,{trigger:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return f(z.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:F,step:k=1,shiftStep:N,precision:L,inputMin:
|
|
3
|
-
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:F,step:k,value:de,disabled:
|
|
4
|
-
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-63IGYBCQ.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{createContext as o,useState as l,useMemo as a,useId as u,useRef as s,useEffect as c,useContext as d}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";var p=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e){const t=String(e),n=/e-(\d+)$/.exec(t);return n?Number(n[1]):t.split(".")[1]?.length??0}var x={sm:{left:10,plain:8,unit:40,text:"text-xs"},md:{left:14,plain:12,unit:40,text:"text-sm"}},v={"--rosh-slider-gap":"var(--space-12)","--rosh-slider-floor":"4rem"},b={position:"absolute",left:0,top:0,width:"max-content",height:0,overflow:"hidden",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre"},g={display:"block",width:"max-content"},y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function w(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(y.test(t)?2:1),0)))}function S(e,t,n,r){return Number(p(e,t,n).toFixed(r))}var z=o(null);function F({children:e}){const[t,n]=l({}),r=a(()=>(e,t)=>n(n=>{if(null===t){if(!(e in n))return n;const t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}}),[]),i=a(()=>{const e=Object.values(t);return{set:r,width:e.length?`max(${e.join(", ")})`:null}},[t,r]);/* @__PURE__ */
|
|
2
|
+
return f(z.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:F,step:k=1,shiftStep:N,precision:L,inputMin:C,inputMax:j,suffix:E,units:M,onCommit:R,showInput:$=!0,emptyLabel:B,placeholderValue:K,stepFrom:W,label:A,"aria-labelledby":O,valueText:D,id:H,disabled:I,size:q="md",boxSize:P="sm",className:T="",auto:V}){const J=i(),U=u(),G=s(o);r(()=>{G.current=o},[o]);const Q=s(o),Y=e=>{G.current=e,a(e)},Z=()=>{Q.current=G.current},X=()=>{R&&G.current!==Q.current&&(Q.current=G.current,R(G.current))},_=s(null),ee=s(X);ee.current=X;const te=Boolean(R);c(()=>{const e=_.current;if(!te||!e)return;const t=()=>ee.current();return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[te]);const ne=t(),re=V??ne,ie=u(),oe=H??U,le=L??h(k),ae=C??y,ue=j??F,se=void 0!==B||void 0!==K,ce=W??K,de=p(o??K??y,y,F),fe=[y.toFixed(le),F.toFixed(le),o?.toFixed(le),B,K?.toFixed(le)],me=null!=o?o.toFixed(le):B||(null!=K?K.toFixed(le):void 0),pe=s(null),he=s(null),[xe,ve]=l(null),be=s(null),ge=Boolean(E);r(()=>{if(!$)return;const e=()=>{const e=pe.current?.querySelector("input"),t=he.current;if(!e||!t)return;const n=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(r<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const i=Math.ceil(t.getBoundingClientRect().width);if(i<=0)return;const o=t.querySelector("[data-shown]"),l=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),a=!!o&&o.getBoundingClientRect().width>l+.5,u=be.current;if(be.current={box:u?.box??{frame:r,fontSize:n.fontSize,text:i,cut:a},room:l},u&&u.box.frame===r&&u.box.fontSize===n.fontSize&&u.box.text===i&&u.box.cut===a)return;const s={frame:r,fontSize:n.fontSize,text:i,cut:a};be.current={box:s,room:l},ve(s)};e(),window.addEventListener("resize",e);const t="undefined"!=typeof document?document.fonts:void 0;t?.addEventListener?.("loadingdone",e);let n=null;if("undefined"!=typeof ResizeObserver){n=new ResizeObserver(()=>e());const t=pe.current?.querySelector("input");t&&n.observe(t),he.current&&n.observe(he.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[ge,$,P]),r(()=>{const e=be.current;if(!e)return;const t=e.box.text<=e.room+.5?null:he.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const r={...e.box,cut:n};be.current={box:r,room:e.room},ve(r)},[me]);const ye=e=>D?D(e):"string"==typeof E?`${e.toFixed(le)} ${E}`:void 0,we=null==o?B??(null!=K?ye(K)??String(K):void 0):ye(o),Se=x[P],ze=fe.filter(e=>Boolean(e)),Fe=void 0===me?-1:ze.indexOf(me),ke=xe?`${xe.text+xe.frame+2}px`:`calc(${w(fe)}ch + ${Se.left+(ge?Se.unit:Se.plain)+2}px)`,Ne=d(z),Le=u(),Ce=Ne?.set;return r(()=>{Ce&&Ce(Le,$?ke:null)},[Ce,Le,ke,$]),c(()=>()=>Ce?.(Le,null),[Ce,Le]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${T}`.trim(),style:v,children:[
|
|
3
|
+
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:F,step:k,value:de,disabled:I,"aria-label":O?void 0:A,"aria-labelledby":O,"aria-valuetext":we,"aria-describedby":re?ie:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const n=e.shiftKey&&null!=N;if(!n&&!(null==o&&null!=ce))return;e.preventDefault();Y(S((o??ce??de)+t*(n?N??k:k),y,F,le)),X()},ref:_,onFocus:R&&Z,onPointerDown:R&&Z,onChange:e=>Y(S(Number(e.target.value),y,F,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===q?"h-1":"h-1.5")}),$&&
|
|
4
|
+
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:R&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&X()}),onFocus:R&&Z,className:`relative min-w-0 max-w-full shrink-0 ${Se.text}`,style:{position:"relative",width:Ne?.width??ke,...xe?{fontSize:xe.fontSize}:{}},children:[
|
|
5
5
|
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:ze.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===Fe?"":void 0,style:g,children:e},t))}),
|
|
6
|
-
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||
|
|
6
|
+
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||Y(e):se&&Y(null)},min:ae,max:ue,step:k,shiftStep:N,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:E,units:M,onBlur:R&&X,disabled:I,placeholder:B??(null!=K?K.toFixed(le):void 0),size:P,auto:re,"aria-label":A?J.slider.value(A):void 0,"aria-labelledby":A?void 0:O})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:J.settingView.auto})]})}export{k as Slider,F as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as a}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e,stepRounding as a}from"./chunk-63IGYBCQ.js";import{IconButton_default as t}from"./chunk-SV5RRBVA.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var s="h-3.5 w-3.5",l={padding:{top:/* @__PURE__ */n(r,{name:"padding-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(r,{name:"padding-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(r,{name:"padding-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(r,{name:"padding-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(r,{name:"padding-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(r,{name:"padding-left-right","aria-hidden":"true",className:s})},crop:{top:/* @__PURE__ */n(r,{name:"crop-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(r,{name:"crop-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(r,{name:"crop-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(r,{name:"crop-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(r,{name:"crop-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(r,{name:"crop-left-right","aria-hidden":"true",className:s})}},m=/* @__PURE__ */n(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var c=(e,a,t)=>null===e[t]?a[t]:String(e[t]);function h(e,a){const t=t=>c(e,a,t);return t("left")!==t("right")||t("top")!==t("bottom")}function p({label:t,value:r,onChange:i,each:s,placeholder:m,words:h,min:p=0,max:u=200,step:g=4,readOnly:f,glyphs:b="padding",units:N}){const v=l[b],x=(t,o,d)=>{const s=function(e,a){const t=a.map(a=>e[a]);return t.every(e=>e===t[0])?t[0]:"mixed"}(r,t),l=t.map(e=>c(r,m,e)),b="mixed"!==s&&l.every(e=>e===l[0])?l[0]:"–";/* @__PURE__ */
|
|
2
2
|
return n("div",{"data-side":t.join("-"),className:"min-w-0",children:/* @__PURE__ */n(e,{value:"mixed"===s?null:s,onChange:e=>((e,a)=>{const t={...r};for(const r of e)t[r]=a;i(t)})(t,e),min:p,max:u,step:g,snap:!0,...a(g),steppers:"compact",readOnly:f,placeholder:b,prefix:d,suffix:h.unit,units:N,"aria-label":o})})};/* @__PURE__ */
|
|
3
3
|
return n("div",{role:"group","aria-label":t,"data-sides":s?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,s?{children:[x(["left"],h.sides.left,v.left),x(["top"],h.sides.top,v.top),x(["right"],h.sides.right,v.right),x(["bottom"],h.sides.bottom,v.bottom)]}:{children:[x(["left","right"],h.horizontal,v.horizontal),x(["top","bottom"],h.vertical,v.vertical)]})})}function u({each:e,onChange:a,label:r,disabled:o}){/* @__PURE__ */
|
|
4
4
|
return n(i,{content:r,children:/* @__PURE__ */n(t,{size:"md","aria-label":r,"aria-pressed":e,disabled:o,onClick:()=>a(!e),children:m})})}export{u as SidesEachToggle,p as SidesInput,h as sidesStartEach};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-MWTCGJAI.js";import{Icon as l}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-MWTCGJAI.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),
|
|
3
|
+
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),I=c(null),C=c(l);C.current=l,s(()=>{if(j&&d)return j.report(S,()=>C.current,I.current)},[j,d,S]);const W=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
4
|
/* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
5
5
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
|
|
6
|
-
return m("button",1===k?{ref:
|
|
6
|
+
return m("button",1===k?{ref:I,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:W})}:{ref:I,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:W})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return h("div",{children:[
|
|
8
8
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-WN3JHPJI.js";import{Avatar as t}from"./chunk-24Y5JHIR.js";import{Input_default as a}from"./chunk-PT4GMPUB.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{jsxs as r,jsx as a}from"react/jsx-runtime";function n({title:n,message:s,description:d,hint:i,variant:m,frameless:c,icon:o,children:l}){const h=c?"none":m??"dashed",x="boolean"!=typeof o&&null!=o?o:null,p=!x&&(o??"card"!==h),u=t().emptyState,y=s??(n?void 0:u.message),f=d??i;/* @__PURE__ */
|
|
2
2
|
return r("div",{className:`flex flex-col items-center justify-center text-center ${"card"===h?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===h?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[x&&/* @__PURE__ */a("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:x}),p&&/* @__PURE__ */a(e,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),n&&/* @__PURE__ */a("h3",{className:"text-sm font-medium text-gray-900",children:n}),y&&/* @__PURE__ */a("p",{className:"text-sm text-gray-500 "+(n?"mt-2":""),children:y}),f&&/* @__PURE__ */a("p",{className:"text-xs text-gray-400 mt-1",children:f}),l&&/* @__PURE__ */a("div",{className:"mt-4",children:l})]})}export{n as EmptyState};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-WN3JHPJI.js";import{Avatar as t}from"./chunk-24Y5JHIR.js";import{ItemCount as r}from"./chunk-MWTCGJAI.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="12.28.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-7GJIIBJD.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{Z_LAYERS as m}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-JSHMIMAJ.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",D=e=>e.stopPropagation();function I({images:r,startIndex:y=0,onClose:I,onIndexChange:J,onOpenFile:U}){const $=h().lightbox,z=u(),A=p(null),F=p(null),[P,S]=x(y),W=r.length,Y=z&&W>0,G=b(e=>{if(W<2)return;const t=((P+e)%W+W)%W;S(t),J?.(t)},[P,W,J]);if(a(Y),l(A,Y,F),i(Y),k(()=>{if(Y)return f(()=>(I(),!0),()=>A.current)},[Y,I]),k(()=>{if(!Y)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Y,G]),!Y)return null;const L=r[Math.min(P,W-1)],M=j(L),O=L.caption||n(L.url);let Q;return Q="video"===M?/* @__PURE__ */v("video",{src:L.url,controls:!0,playsInline:!0,"aria-label":O,onClick:D,className:`${e} rounded-lg bg-black`}):"file"===M?/* @__PURE__ */w("div",{onClick:D,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
2
|
/* @__PURE__ */v(s,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:
|
|
4
|
-
/* @__PURE__ */w("div",{ref:
|
|
5
|
-
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:
|
|
6
|
-
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children
|
|
7
|
-
/* @__PURE__ */v("button",{ref:
|
|
8
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
9
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
10
|
-
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:
|
|
11
|
-
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:O}),U?/* @__PURE__ */v(c,{size:"sm",onClick:()=>U(L),children:$.openFile}):/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:d({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */v(t,{src:L.url,alt:O,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:A,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:I,children:[Q,
|
|
5
|
+
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:D,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:$.counter(P+1,W)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:F,type:"button",onClick:I,"aria-label":$.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(s,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),W>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(-1)},"aria-label":$.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(1)},"aria-label":$.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
+
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:D,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:O}),"file"!==M&&/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:$.openOriginal})]})]}),document.body)}export{I as ImageLightbox,j as lightboxKind};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-GOAFMGUI.js";import{jsx as r,jsxs as d}from"react/jsx-runtime";var s=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,o=(e,t)=>`${e}-status-${t}`;function c(e,t){return e.flatMap((e,i)=>"status"===e.type?[o(t,i)]:[]).join(" ")||void 0}var b={minHeight:"var(--space-32)",paddingTop:0,paddingBottom:0,paddingLeft:"var(--space-12)",paddingRight:"var(--space-12)"};function u(s,c){const{menuId:y,choose:m,toggle:p,followLink:h,rowProps:k=()=>({}),linkAs:f}=c,g=f??"a",v=(s,f)=>{if("divider"===s.type)/* @__PURE__ */
|
|
2
2
|
return r("div",{role:"separator",children:/* @__PURE__ */r(e,{})},s.key);if("label"===s.type)/* @__PURE__ */
|
|
3
3
|
return r("div",{id:`${y}-label-${f}`,children:/* @__PURE__ */r(t,{children:s.label})},s.key);if("status"===s.type)/* @__PURE__ */
|
|
4
4
|
return r("div",{id:o(y,f),className:"text-xs",style:i(),children:s.label},s.key);if("submenu"===s.type)/* @__PURE__ */
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-
|
|
1
|
+
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-G67CJAQ2.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,S]=c(!1),j=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:I,onDragOver:$,onDrop:A,onDragEnd:J,toggleColumn:P,resetColumns:R,draggedIdx:L,dropGap:T}=t(f,j),{hasAnyPerm:B}=r(),E=i().columns,[G,K]=c(!1),[M,O]=c(!1),[Q,U]=c(!1),W=m(null),Y=k.length>0&&B(k);e(W,h(()=>{G&&K(!1)},[G]));const F=C.reduce((e,t)=>e+t.width,0),H=C.map(e=>`${e.width}px`),V={tableLayout:"fixed",width:F,minWidth:"100%"},X=m(null),Z=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
|
|
2
2
|
return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
|
|
3
|
-
/* @__PURE__ */p("div",{ref:
|
|
4
|
-
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:
|
|
3
|
+
/* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
|
|
4
|
+
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:H[t]}},e.key))}),
|
|
5
5
|
/* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
|
|
6
|
-
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${
|
|
7
|
-
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),
|
|
8
|
-
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:
|
|
9
|
-
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:
|
|
10
|
-
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:
|
|
6
|
+
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${L===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>I(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>A(t,e),onDragEnd:a?void 0:J,style:a?void 0:{cursor:"grab"},children:[
|
|
7
|
+
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),T===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&T===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
|
|
8
|
+
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:Z,children:[
|
|
9
|
+
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
|
|
10
|
+
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:H[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
|
|
11
11
|
/* @__PURE__ */p("span",{children:b}),
|
|
12
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:
|
|
13
|
-
/* @__PURE__ */p("button",{onClick:
|
|
14
|
-
/* @__PURE__ */p("button",{onClick:()=>
|
|
15
|
-
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:
|
|
16
|
-
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>
|
|
12
|
+
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:W,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>S(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?E.hideSelection:E.showSelection,children:D?E.selectDone:E.select}),
|
|
13
|
+
/* @__PURE__ */p("button",{onClick:R,className:"text-2xs text-ink-faintest hover:text-gray-600",children:E.reset}),
|
|
14
|
+
/* @__PURE__ */p("button",{onClick:()=>K(!G),className:"text-gray-400 hover:text-gray-600",title:E.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),G&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
|
|
15
|
+
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:E.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
|
|
16
|
+
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>P(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),Y&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{O(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),U(!0),setTimeout(()=>U(!1),2e3)}catch{}O(!1)},disabled:M,className:"text-2xs w-full text-center py-1 rounded "+(Q?"text-green-600":"text-ink-faint hover:text-blue-600"),children:M?"...":Q?E.savedDefault:E.saveDefault})})]})]})]})]})}export{f as ResizableTable};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-K5YT5PMJ.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-JSHMIMAJ.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:M,id:D,className:L="",tone:J,tooltip:W,split:Y}){const[E,S]=m(!1),[$,G]=m(""),H=d(),I=h(null),T=h(null),B=h(null),F=s(I,E),A=e=>k.find(t=>t.value===e)?.label??e,K=p(()=>{const t=new Set(o),n=[],r=$.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,$]),P=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},Z=e=>{e&&!o.includes(e)?(y([...o,e]),G("")):G("")},z=e=>y(o.filter(t=>t!==e)),O=()=>{const e=$.trim();if(Y&&e)return P(e.split(Y)),void G("");j&&e?Z(e):G("")},U=h(()=>{});U.current=()=>{O(),S(!1)},f(()=>{if(!E)return;const e=e=>{const t=e.target;I.current?.contains(t)||B.current?.contains(t)||(O(),S(!1))};document.addEventListener("mousedown",e);const t=l(()=>U.current());return()=>{document.removeEventListener("mousedown",e),t()}});const q=k.length>0;/* @__PURE__ */
|
|
2
2
|
return g("div",{ref:I,className:"relative",children:[
|
|
3
|
-
/* @__PURE__ */g("div",{onMouseDown:e=>{
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:
|
|
5
|
-
/* @__PURE__ */x("input",{id:D,ref:
|
|
6
|
-
/* @__PURE__ */x("div",{ref:B,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:F?.left,right:F?.right,top:F?.top,bottom:F?.bottom,minWidth:F?.minWidth,maxWidth:F?.maxWidth??a,width:"max-content",visibility:F?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:F?.maxHeight??c},children:0===
|
|
3
|
+
/* @__PURE__ */g("div",{onMouseDown:e=>{M||e.target.closest("button")||(e.preventDefault(),T.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${M?"bg-gray-50 cursor-not-allowed":""} ${L}`}),children:[o.map(e=>{const t=J?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:A(e)}),!M&&/* @__PURE__ */x("button",{type:"button","aria-label":H.select.removeItem?.(A(e))??`${H.select.remove} ${A(e)}`,onClick:()=>z(e),className:n.remove,children:"×"})]},e),l=W?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
|
|
5
|
+
/* @__PURE__ */x("input",{id:D,ref:T,type:"text",autoComplete:"off",role:"combobox","aria-expanded":E&&q,"aria-invalid":C||void 0,disabled:M,value:$,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(Y){const t=e.split(Y);if(t.length>1)return P(t.slice(0,-1)),void G(t[t.length-1])}G(e)})(e.target.value),S(!0)},onFocus:()=>{!M&&q&&S(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=$.trim(),o=n?K.filter(t=>e(t,n.toLowerCase())):[];1===o.length?Z(o[0].value):O()}else"Backspace"===t.key&&""===$&&o.length>0?z(o[o.length-1]):"Escape"===t.key?(S(!1),G(""),T.current?.blur()):"Tab"===t.key&&(O(),S(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),E&&q&&v(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:B,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:F?.left,right:F?.right,top:F?.top,bottom:F?.bottom,minWidth:F?.minWidth,maxWidth:F?.maxWidth??a,width:"max-content",visibility:F?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:F?.maxHeight??c},children:0===K.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?H.select.allSelected:H.select.noMatches}):K.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),Z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
|
|
7
7
|
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
8
|
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{toast_default as n}from"./chunk-3YBXA72C.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
|
|
2
|
+
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[P,S]=s(0),[_,D]=s(1),[W,A]=s(!0),[L,$]=s(!0),O=i(x.loadFailed);O.current=x.loadFailed,l(()=>{let e=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(t=>{e||(j(t),S(t.numPages),$(!1))}).catch(()=>{e||(n.error(O.current),$(!1))}),()=>{e=!0}},[a,g,w]),l(()=>{if(!M||!W||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});D(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,W,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:_}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,_]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===d?x.fitPage:x.fitWidth,H="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */m(f,{children:[
|
|
5
5
|
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
|
-
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,
|
|
7
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(
|
|
6
|
+
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,P)}),
|
|
7
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(P,e+1)),disabled:E>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{A(!1),
|
|
10
|
-
/* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*
|
|
11
|
-
/* @__PURE__ */u("option",{value:"fit",children:
|
|
12
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{A(!1),
|
|
9
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{A(!1),D(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(A(!1),D(Number(t)/100)):A(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
|
|
11
|
+
/* @__PURE__ */u("option",{value:"fit",children:T}),!W&&!v.includes(Math.round(100*_))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*_),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{A(!1),D(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
13
|
/* @__PURE__ */u("button",{type:"button",onClick:()=>A(!0),"aria-pressed":W,className:H+(W?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
|
|
14
14
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const e=window.open("","_blank");if(!e)return void n.error(x.allowPopups);const t=[];for(let e=1;e<=
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const e=window.open("","_blank");if(!e)return void n.error(x.allowPopups);const t=[];for(let e=1;e<=P;e++)t.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(t).then(t=>{var n;e.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),e.document.write(t.map(e=>`<img src="${e}"/>`).join("")),e.document.write("</body></html>"),e.document.close(),setTimeout(()=>{e.print(),e.close()},300)})},className:H,children:[
|
|
16
16
|
/* @__PURE__ */u(e,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
|
|
17
17
|
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:H,children:[
|
|
18
18
|
/* @__PURE__ */u(e,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:H,children:[
|
|
19
19
|
/* @__PURE__ */u(e,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
|
|
20
|
-
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<
|
|
20
|
+
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<P?(e.preventDefault(),z(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<P&&(e.preventDefault(),z(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(P)))},children:L?/* @__PURE__ */u(t,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
21
|
/* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
|
|
22
22
|
/* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-
|
|
2
|
-
return o(t,{name:"folder",look:"solid",className:e})}function T(t,n){return n&&e[n]||(t?e[t]:void 0)}var I=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function
|
|
1
|
+
import{navIcons as e}from"./chunk-4LXCCZDM.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{isValidElement as n,cloneElement as r}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var a="react-os-shell:spreadsheet-preview-update",s=null,l=0;function d(e){const t=++l,n={token:t,data:e};return s=n,{update(e){s===n&&(n.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(a,{detail:{token:t,data:e}}))}}}function c(){return s}function p(e){s===e&&(s=null)}var u={document:".docx",spreadsheet:".sheet",deck:".slides"},f=class extends Error{limit;used;attempted;constructor(e,t,n){super("Not enough space"),this.name="FilesQuotaError",this.limit=e,this.used=t,this.attempted=n}};function h(e,t){return e&&"/"!==e?e.replace(/\/$/,"")+"/"+t:"/"+t}async function m(e,t){const n=await e.json().catch(()=>({}));return new Error(n.error||`${t} failed (${e.status})`)}function w(e){const t=()=>(e??(("undefined"!=typeof window?window.__REACT_OS_SHELL_FILE_SERVER__:void 0)||"http://localhost:4000").replace(/\/$/,"")).replace(/\/$/,""),n=(e,n={})=>fetch(`${t()}${e}`,{...n,credentials:"include"}),r=e=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{async quota(){const e=await n("/api/quota");if(!e.ok)throw await m(e,"Quota");const t=await e.json();return{used:t.used,limit:t.limit}},async list(e){const t=e??"/",r=await n(`/api/files?path=${encodeURIComponent(t)}`);if(!r.ok)throw await m(r,"Listing");const o=await r.json(),i=o.path||t,a=i.split("/").filter(Boolean);return{folder:{id:"/"===i?null:i,name:a[a.length-1]??"",role:"owner",path:[{id:null,name:""},...a.map((e,t)=>({id:"/"+a.slice(0,t+1).join("/"),name:e}))]},entries:(o.entries||[]).map(e=>({id:h(i,e.name),name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modifiedAt}))}},async upload(e,t){const r=new FormData;r.append("file",t);const o=await n(`/api/upload?path=${encodeURIComponent(e??"/")}`,{method:"POST",body:r});if(413===o.status){const e=await o.json().catch(()=>({}));throw new f(e.limit||0,e.used||0,e.attempted||t.size)}if(!o.ok)throw await m(o,"Upload")},async createFolder(e,t){const o=await n("/api/folder",r({path:h(e,t)}));if(!o.ok)throw await m(o,"Create folder")},async rename(e,t){const o=e.replace(/\/[^/]*$/,"")||"/",i=await n("/api/rename",r({from:e,to:h(o,t)}));if(!i.ok)throw await m(i,"Rename")},async remove(e){const t=await n(`/api/files?path=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async read(e){const t=await n(`/api/file?path=${encodeURIComponent(e)}`);if(!t.ok)throw await m(t,"Download");return t.blob()},async trash(){const e=await n("/api/trash");if(!e.ok)throw await m(e,"Listing trash");return(await e.json()).entries||[]},async restore(e){const t=await n("/api/trash/restore",r({id:e}));if(!t.ok)throw await m(t,"Restore")},async purge(e){const t=await n(`/api/trash/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await m(t,"Delete")},async emptyTrash(){const e=await n("/api/trash",{method:"DELETE"});if(!e.ok)throw await m(e,"Empty trash")}}}var y=null;function g(e){y=e}function x(){return y??w()}function b(){return null!==y}var v=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function _(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n);return v[Math.abs(t)%v.length]}var k={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},E={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},C={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},N={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function j({className:e}){/* @__PURE__ */
|
|
2
|
+
return o(t,{name:"folder",look:"solid",className:e})}function T(t,n){return n&&e[n]||(t?e[t]:void 0)}var I=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function S({entityType:e,isSelected:t,entityId:a,label:s,fileKind:l}){const d="preview-file"===e&&l,c=d?N[l]:null,p=d?C[l]:null;if("folder"===e)/* @__PURE__ */
|
|
3
3
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(j,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=T(a,s),i=_(a||s||"page");/* @__PURE__ */
|
|
4
4
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&n(e)?r(e,{className:"h-7 w-7 text-white"}):I})})}/* @__PURE__ */
|
|
5
5
|
return i("div",{className:"w-12 h-12 relative flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
|
|
@@ -7,7 +7,7 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
|
|
|
7
7
|
/* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
|
|
8
8
|
/* @__PURE__ */o("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
|
|
9
9
|
/* @__PURE__ */o("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
|
|
10
|
-
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??k[e]??"text-gray-600"}`,children:p??E[e]??e.slice(0,3).toUpperCase()})]})}function
|
|
10
|
+
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${c??k[e]??"text-gray-600"}`,children:p??E[e]??e.slice(0,3).toUpperCase()})]})}function L({item:e}){if("folder"===e.entityType)/* @__PURE__ */
|
|
11
11
|
return o(j,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=T(e.entityId,e.label);/* @__PURE__ */
|
|
12
12
|
return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${_(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&n(t)?r(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?N[e.fileKind]:k[e.entityType])??"text-gray-400";/* @__PURE__ */
|
|
13
|
-
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function
|
|
13
|
+
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function $(e){return"preview-file"===e.entityType&&e.fileKind?C[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":E[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var R=null,D=/* @__PURE__ */new Set;function P(e){R=e,D.forEach(e=>e())}function V(e){return D.add(e),()=>{D.delete(e)}}function F(){return R}var O="__REACT_OS_SHELL_FILES_VIEW__",A="react-os-shell:files-show-trash",M="react-os-shell:files-open-desktop-folder";function U(){"undefined"!=typeof window&&(window[O]="trash",window.dispatchEvent(new CustomEvent(A)))}function z(e){"undefined"!=typeof window&&(window[O]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(M,{detail:{folderId:e}})))}function W(){if("undefined"==typeof window)return null;const e=window[O];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function H(){const e=W();return"undefined"!=typeof window&&(window[O]=null),e}export{L as DesktopItemMiniIcon,u as FILES_OFFICE_EXTENSIONS,M as FILES_OPEN_DESKTOP_FOLDER_EVENT,A as FILES_SHOW_TRASH_EVENT,S as FileIconTile,f as FilesQuotaError,j as FolderGlyph,a as SPREADSHEET_PREVIEW_UPDATE_EVENT,p as claimSpreadsheetPreviewStage,H as consumeFilesViewRequest,w as createFileServerStore,$ as desktopItemTypeLabel,F as getDesktopFoldersSnapshot,x as getFilesStore,b as hasHostFilesStore,W as peekFilesViewRequest,c as peekSpreadsheetPreviewStage,P as publishDesktopFolders,z as requestFilesDesktopFolderView,U as requestFilesTrashView,g as setFilesStore,d as setSpreadsheetPreview,V as subscribeDesktopFolders};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-Y7KDCC6E.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-
|
|
1
|
+
import{writeClipboard as e}from"./chunk-Y7KDCC6E.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-3YBXA72C.js";import{useShellStrings as a}from"./chunk-JSHMIMAJ.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
2
|
return s(t,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":C,className:B=""}){const[A
|
|
4
|
-
return m("div",{id:
|
|
3
|
+
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":C,className:B=""}){const[S,A]=i(!1),R=o(null),T=a().copy;c(()=>()=>{R.current&&clearTimeout(R.current)},[]);const V=l(async()=>{await e(t)?(A(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{A(!1),R.current=null},2e3),w?.(t)):n.error(T.failed)},[t,w,T]),{box:D,button:I}=p[g],J=!v;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:J?void 0:j,"aria-describedby":J?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[k],D,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
5
|
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:t,children:y??t}),!v&&/* @__PURE__ */m(d,{children:[
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?T.copyLabel(x):T.copy,"aria-describedby":C,onClick:V,className:`${I} text-gray-400`,children:/* @__PURE__ */s(S?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:S?T.copied:""})]})]})}export{y as Snippet};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-OOWPLQD5.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-
|
|
2
|
-
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */p(t,{side:m,width:
|
|
4
|
-
return f("div",
|
|
5
|
-
/* @__PURE__ */p(g,{phone:
|
|
6
|
-
/* @__PURE__ */p(v,{phone:
|
|
1
|
+
import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-OOWPLQD5.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:O=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:D="bg-white"}){const P="right"===m,W=i().sidebar,j=a(),z=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[C,I]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),S=null!=l||null!=n,M=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:C},children:[
|
|
2
|
+
/* @__PURE__ */f("div",{className:`flex h-full flex-col ${S?"overflow-hidden":"overflow-y-auto"} ${O}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),S?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
|
|
3
|
+
/* @__PURE__ */p(t,{side:m,width:C,onResize:I,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:W.resize})]}),R=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${D}`,children:u});/* @__PURE__ */
|
|
4
|
+
return f("div",j?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
|
|
5
|
+
/* @__PURE__ */p(g,{phone:z,top:l,fallback:W.sections}),R,
|
|
6
|
+
/* @__PURE__ */p(v,{phone:z,bottom:n,label:W.sections,closeLabel:W.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[P?null:M,R,P?M:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
|
|
7
7
|
return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
8
8
|
/* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
9
9
|
/* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
|