efficient-shell 12.10.0 → 12.12.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 +7 -2
- package/dist/{Browser-G2HGYZVD.js → Browser-KPVR5Z6J.js} +16 -16
- package/dist/Calculator-RP4UPGG7.js +29 -0
- package/dist/{CurrencyConverter-KBY2OXQ2.js → CurrencyConverter-HZWRB62S.js} +11 -11
- package/dist/Files-4DVFS74H.js +141 -0
- package/dist/{Notepad-CRHG5FLI.js → Notepad-ZQF2NRZZ.js} +8 -8
- package/dist/{PdfViewer-L4FJS3M6.js → PdfViewer-BFP2WCMQ.js} +1 -1
- package/dist/PomodoroTimer-ME3BMHKR.js +91 -0
- package/dist/{Preview-BVTWP7RW.js → Preview-DBXNCPGO.js} +35 -35
- package/dist/{Sidebar-QOGK5LJ2.js → Sidebar-FU7TD5FQ.js} +32 -32
- package/dist/{Stock-O7AQ2WUN.js → Stock-WK45DFIC.js} +2 -2
- package/dist/{Weather-WHXA5TTP.js → Weather-BVKZQI4R.js} +15 -15
- package/dist/{WorldClock-CZCIVYKB.js → WorldClock-L3BQXXQX.js} +6 -6
- package/dist/ai/index.js +56 -56
- package/dist/apps/index.d.ts +60 -2
- 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-VWNHSLFY.js → chunk-3FNBUOZK.js} +1 -1
- package/dist/{chunk-TKFINWY6.js → chunk-3MMMN3U4.js} +2 -2
- package/dist/{chunk-MPTOEXED.js → chunk-3ZQT26GZ.js} +1 -1
- package/dist/{chunk-67BWG353.js → chunk-44VAZ2EL.js} +9 -9
- package/dist/{chunk-OSQ5NRV3.js → chunk-45HQXTA6.js} +1 -1
- package/dist/{chunk-INFL4YZF.js → chunk-4CKPY72R.js} +1 -1
- package/dist/{chunk-A2JYBUPB.js → chunk-4NLCXHWN.js} +6 -6
- package/dist/{chunk-2WNTDGOP.js → chunk-5EKNXSQG.js} +1 -1
- package/dist/{chunk-RLGPIJHB.js → chunk-5NCR64CE.js} +1 -1
- package/dist/chunk-5POLDDQW.js +14 -0
- package/dist/{chunk-LFWRHBTM.js → chunk-5T4WTFBC.js} +1 -1
- package/dist/{chunk-ZC6MXV4L.js → chunk-5ZQY42QX.js} +1 -1
- package/dist/{chunk-J4IT5C3A.js → chunk-654DGV5Q.js} +1 -1
- package/dist/{chunk-5YPCZLBW.js → chunk-6BNLDGST.js} +1 -1
- package/dist/{chunk-LFW3CQMF.js → chunk-6ET6JVNL.js} +4 -4
- package/dist/{chunk-HD7OBASH.js → chunk-6TIJH2M6.js} +1 -1
- package/dist/{chunk-457SK2XV.js → chunk-6VB4TBU6.js} +5 -5
- package/dist/{chunk-KRUI4LVW.js → chunk-73XILSFF.js} +1 -1
- package/dist/chunk-7ADTFFEM.js +5 -0
- package/dist/{chunk-QSK2OWT3.js → chunk-7ARBBWPQ.js} +2 -2
- package/dist/{chunk-RAQBZUU2.js → chunk-AG6Y62TP.js} +61 -61
- package/dist/{chunk-Y4YXZIES.js → chunk-AXFNOY2L.js} +9 -9
- package/dist/{chunk-J7BMSKOM.js → chunk-B7HTKDT3.js} +6 -6
- package/dist/{chunk-PHJFGLXB.js → chunk-BET6KEY2.js} +8 -8
- package/dist/{chunk-7Q4DE4CT.js → chunk-BFCIOWYI.js} +1 -1
- package/dist/{chunk-RGKSJBXJ.js → chunk-BGBSEPPH.js} +8 -8
- package/dist/{chunk-2X4U3VX2.js → chunk-BM5QI2L6.js} +5 -5
- package/dist/{chunk-AMSE4PMQ.js → chunk-C5SK5OYU.js} +4 -4
- package/dist/{chunk-HRDR56SK.js → chunk-CU3ZE25J.js} +1 -1
- package/dist/chunk-EAIHBASJ.js +28 -0
- package/dist/{chunk-2NZBQOA6.js → chunk-EAXPSAHZ.js} +9 -9
- package/dist/{chunk-KPHYWZXL.js → chunk-EO6MOQOZ.js} +9 -9
- package/dist/{chunk-C3E6XFIC.js → chunk-EQ2KTDOU.js} +3 -3
- package/dist/{chunk-5WCHUZ6O.js → chunk-FSZ3TNAR.js} +1 -1
- package/dist/{chunk-QIMMZVWV.js → chunk-GCVIUXKL.js} +1 -1
- package/dist/{chunk-LS6VU6F7.js → chunk-GOKJZKLV.js} +1 -1
- package/dist/{chunk-Z334LCCX.js → chunk-ICZUWLVU.js} +1 -1
- package/dist/chunk-ITGFHWYG.js +13 -0
- package/dist/chunk-J2YURAQY.js +13 -0
- package/dist/chunk-J7CHHY7O.js +6 -0
- package/dist/{chunk-T3NLFOLW.js → chunk-JOAKKXTL.js} +14 -6
- package/dist/{chunk-TVVSFXWY.js → chunk-JZKACEXW.js} +8 -8
- package/dist/chunk-KCAUYEYR.js +7 -0
- package/dist/{chunk-5MFWM6L4.js → chunk-L6LWO5NQ.js} +1 -1
- package/dist/{chunk-RHD4V6CE.js → chunk-LMUB2EAD.js} +9 -9
- package/dist/{chunk-4GTXRVDF.js → chunk-LO6TYB5E.js} +2 -2
- package/dist/{chunk-UMZJRZFN.js → chunk-LTN4AQYG.js} +1 -1
- package/dist/{chunk-6ITEA6SX.js → chunk-LTUVKDTO.js} +1 -1
- package/dist/{chunk-F7BXUVN4.js → chunk-LY55C5UI.js} +6 -6
- package/dist/chunk-LZKPV3XR.js +3 -0
- package/dist/{chunk-OW5LQWPU.js → chunk-MFZPTS7W.js} +2 -2
- package/dist/{chunk-6BK3KRT5.js → chunk-MXITMJCT.js} +16 -16
- package/dist/{chunk-PICRPJBL.js → chunk-NBUL37WB.js} +1 -1
- package/dist/{chunk-W5B7UNMJ.js → chunk-NGQZI7HP.js} +1 -1
- package/dist/{chunk-NAWIVFAN.js → chunk-NHIP2S4E.js} +8 -8
- package/dist/{chunk-RIF6BFEH.js → chunk-NOEAEXIZ.js} +1 -1
- package/dist/{chunk-NKZINXHG.js → chunk-OTXJ6VWX.js} +2 -2
- package/dist/{chunk-FOCQEWUH.js → chunk-P3GBQBDC.js} +1 -1
- package/dist/{chunk-TDMZFQRB.js → chunk-PDCCNHTP.js} +1 -1
- package/dist/{chunk-POOPWYJL.js → chunk-Q64F2EXW.js} +6 -6
- package/dist/{chunk-UD4NESX7.js → chunk-QCOXJXGZ.js} +1 -1
- package/dist/{chunk-ICNGLA5O.js → chunk-QGFAQVUO.js} +4 -4
- package/dist/{chunk-63J2MBXV.js → chunk-QQ5XCRZM.js} +10 -10
- package/dist/chunk-QULE4LAC.js +31 -0
- package/dist/chunk-QV4M7EOV.js +1 -0
- package/dist/{chunk-Q3RJMQYE.js → chunk-RAOM3WIQ.js} +1 -1
- package/dist/{chunk-3RDJFCIZ.js → chunk-SEMV4NCH.js} +1 -1
- package/dist/{chunk-5Z6XJPAX.js → chunk-SWB32OKH.js} +1 -1
- package/dist/{chunk-5QVCBAK2.js → chunk-SXHNZFUY.js} +1 -1
- package/dist/chunk-TCMAWDBL.js +19 -0
- package/dist/{chunk-NDAZPAQL.js → chunk-TJCJLKJB.js} +1 -1
- package/dist/chunk-U35TIWEP.js +23 -0
- package/dist/{chunk-22LU6FKN.js → chunk-UDYVA5DV.js} +10 -10
- package/dist/{chunk-JOD5ISTB.js → chunk-W7DYKTHE.js} +1 -1
- package/dist/{chunk-BJAJOIVY.js → chunk-WQV7VQ5Z.js} +1 -1
- package/dist/{chunk-VN3A43SA.js → chunk-XDJQWP5K.js} +1 -1
- package/dist/{chunk-NOCOLZ2W.js → chunk-XJW65EIG.js} +1 -1
- package/dist/{chunk-5G4CB3E6.js → chunk-Y23BITKG.js} +1 -1
- package/dist/{chunk-C7M7KYNY.js → chunk-YFDS6KF3.js} +1 -1
- package/dist/{chunk-WDAOTHX5.js → chunk-YMJOFWW6.js} +3 -3
- package/dist/{chunk-KZ7RR7EU.js → chunk-YPZXE67U.js} +1 -1
- package/dist/{chunk-CRRC72EE.js → chunk-ZICGXJUB.js} +7 -7
- package/dist/{chunk-IIMFLLYT.js → chunk-ZLFZJX6M.js} +9 -9
- package/dist/{chunk-OAFFHLJ4.js → chunk-ZV6WLVD3.js} +6 -6
- 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 +359 -359
- package/dist/map/index.js +3 -3
- 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/Calculator-ALPNISJT.js +0 -29
- package/dist/Files-OY5TSWUZ.js +0 -126
- package/dist/PomodoroTimer-NGQPYDI3.js +0 -91
- package/dist/chunk-5RT5XDHG.js +0 -6
- package/dist/chunk-6BQUSUNK.js +0 -14
- package/dist/chunk-7XGUX3TH.js +0 -3
- package/dist/chunk-BR7L5NE3.js +0 -13
- package/dist/chunk-EHVBJUQI.js +0 -28
- package/dist/chunk-HV4VQ5XV.js +0 -13
- package/dist/chunk-KVU5IQOZ.js +0 -7
- package/dist/chunk-OSNHRKX6.js +0 -5
- package/dist/chunk-PEIRPNXT.js +0 -23
- package/dist/chunk-PY7GHIYF.js +0 -19
- package/dist/chunk-Z6KW4WZ6.js +0 -31
- package/dist/chunk-ZPHUMLET.js +0 -1
- /package/dist/{chunk-MBXCXFQO.js → chunk-27ZJQUDS.js} +0 -0
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-
|
|
2
|
-
return m(t,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
3
|
-
return m(t,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
4
|
-
return d(f.Provider,{value:
|
|
5
|
-
/* @__PURE__ */m(e,{open:r,onClose:()=>
|
|
6
|
-
/* @__PURE__ */m("button",{ref:
|
|
7
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>
|
|
1
|
+
import{Dialog as e}from"./chunk-7ADTFFEM.js";import{Icon as t}from"./chunk-JOAKKXTL.js";import{buttonClasses as r}from"./chunk-UQYNPYF4.js";import{useShellStrings as n,splitAround as o}from"./chunk-TJSJVC6P.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:r({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:r({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:r({variant:"primary"})}},w=r({variant:"secondary"}),C=r({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function P(){/* @__PURE__ */
|
|
2
|
+
return m(t,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F(){/* @__PURE__ */
|
|
3
|
+
return m(t,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),j=a(null),T=a(0),E=a([]),K=a(null),$=a(null),D=c(e=>{j.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),J=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++T.current,options:t,resolve:e};null===j.current?D(r):E.current.push(r)})},[D]),[W,A]=s(!1),[V,Y]=s({message:""}),[M,O]=s(""),Q=a(),S=c(e=>(Y(e),O(""),A(!0),new Promise(e=>{Q.current=e})),[]),[U,X]=s(!1),[q,z]=s({}),[B,G]=s(""),H=a(),I=c(e=>{const t="string"==typeof e?{message:e}:e;return z(t),G(t.defaultValue??""),X(!0),new Promise(e=>{H.current=e})},[]);u(()=>{g=J,v=S,x=I},[J,S,I]);const R=(e,t)=>{if(j.current!==e)return;const r=N.current,n=E.current.shift();n?D(n):(j.current=null,N.current=void 0,l(!1)),r?.(t)},Z=e=>{A(!1),O(""),Q.current?.(e)},_=e=>{if(e){const e=B.trim();if(!e&&!q.allowEmpty)return X(!1),void H.current?.(null);X(!1),H.current?.(e)}else X(!1),H.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===V.variant?"warning":"danger"],ne=V.confirmWord,oe=null==ne||M===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
|
|
4
|
+
return d(f.Provider,{value:J,children:[t,
|
|
5
|
+
/* @__PURE__ */m(e,{open:r,onClose:()=>R(p,!1),initialFocus:K,footer:/* @__PURE__ */d(h,{children:[
|
|
6
|
+
/* @__PURE__ */m("button",{ref:K,type:"button",onClick:()=>R(p,!1),className:w,children:i.cancelLabel||le.cancel}),
|
|
7
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>R(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
8
8
|
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(P,{})}),
|
|
9
9
|
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
10
10
|
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
|
|
11
11
|
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
|
|
12
|
-
/* @__PURE__ */d(e,{open:
|
|
13
|
-
/* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>Z(!1),className:w,children:
|
|
14
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(
|
|
12
|
+
/* @__PURE__ */d(e,{open:W,onClose:()=>Z(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
|
|
13
|
+
/* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>Z(!1),className:w,children:V.cancelLabel||le.destructiveCancel}),
|
|
14
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??V.confirmLabel??le.destructiveConfirm})]}),children:[
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(F,{})}),
|
|
16
16
|
/* @__PURE__ */d("div",{className:"flex gap-4",children:[
|
|
17
17
|
/* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(P,{})}),
|
|
18
18
|
/* @__PURE__ */d("div",{className:"flex-1",children:[
|
|
19
|
-
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:
|
|
20
|
-
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:
|
|
19
|
+
/* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:V.title||le.destructiveTitle}),
|
|
20
|
+
/* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:V.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
|
|
21
21
|
/* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
22
22
|
/* @__PURE__ */m("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),se]}),
|
|
23
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:
|
|
23
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:M,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&M===ne&&Z(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
|
|
24
24
|
/* @__PURE__ */d(e,{open:U,onClose:()=>_(!1),title:q.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
|
|
25
25
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:q.cancelLabel||le.cancel}),
|
|
26
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!q.allowEmpty&&!
|
|
27
|
-
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:
|
|
26
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!q.allowEmpty&&!B.trim(),className:C,children:q.confirmLabel||le.ok})]}),children:[q.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:q.message}),
|
|
27
|
+
/* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:B,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:q.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{j as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-BYDSBDVS.js";import{Select_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-BYDSBDVS.js";import{Select_default as l}from"./chunk-TCMAWDBL.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-SEMV4NCH.js";import{Input_default as c}from"./chunk-CU3ZE25J.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
3
3
|
/* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
4
4
|
/* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-JOAKKXTL.js";import{useShellStrings as t}from"./chunk-TJSJVC6P.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -1,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),[j,M]=s(null),[E,z]=s(1),[P,_]=s(0),[
|
|
1
|
+
import{Icon as e}from"./chunk-JOAKKXTL.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{toast_default as n}from"./chunk-JTZVUO3I.js";import{useShellStrings as r}from"./chunk-TJSJVC6P.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),[j,M]=s(null),[E,z]=s(1),[P,_]=s(0),[T,D]=s(1),[L,S]=s(!0),[W,O]=s(!0),$=i(x.loadFailed);$.current=x.loadFailed,l(()=>{let e=!1;return O(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(t=>{e||(M(t),_(t.numPages),O(!1))}).catch(()=>{e||(n.error($.current),O(!1))}),()=>{e=!0}},[a,g,w]),l(()=>{if(!j||!L||!N.current)return;const e=()=>{const e=N.current;e&&j.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()},[j,E,L,d]),l(()=>{if(!j||!k.current)return;let e=!1,t=null,n=null;return j.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:T}),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()}},[j,E,T]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===d?x.fitPage:x.fitWidth,U="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
6
|
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,P)}),
|
|
7
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:()=>{
|
|
10
|
-
/* @__PURE__ */m("select",{value:
|
|
11
|
-
/* @__PURE__ */u("option",{value:"fit",children:A}),!
|
|
12
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{
|
|
13
|
-
/* @__PURE__ */u("button",{type:"button",onClick:()=>
|
|
9
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),D(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */m("select",{value:L?"fit":v.includes(Math.round(100*T))?Math.round(100*T):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(S(!1),D(Number(t)/100)):S(!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:A}),!L&&!v.includes(Math.round(100*T))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*T),"%"]}),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:()=>{S(!1),D(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:U,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":L,className:U+(L?" 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
15
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!j)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(j.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:U,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:U,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:U,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(!j)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(!j)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:
|
|
20
|
+
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!j)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(!j)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:W?/* @__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,4 +1,4 @@
|
|
|
1
|
-
import{TransferProgress as e}from"./chunk-JVNJCRHM.js";import{Icon as r}from"./chunk-
|
|
1
|
+
import{TransferProgress as e}from"./chunk-JVNJCRHM.js";import{Icon as r}from"./chunk-JOAKKXTL.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-TJSJVC6P.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
|
|
2
2
|
return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
|
|
3
3
|
return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
4
4
|
return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-AG6Y62TP.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-QV4M7EOV.js";import{Icon as s}from"./chunk-JOAKKXTL.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-TJSJVC6P.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,A]=a(b.partOf);/* @__PURE__ */
|
|
2
2
|
return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
|
|
3
3
|
/* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
|
|
4
4
|
/* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
|
|
@@ -6,4 +6,4 @@ return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
|
|
|
6
6
|
/* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
|
|
7
7
|
/* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
|
|
8
8
|
/* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
|
|
9
|
-
/* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),
|
|
9
|
+
/* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),A]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{v as AboutApp,x as BUILTIN_APP_INFO};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-QCOXJXGZ.js";import{Button_default as n}from"./chunk-EVYD6UFQ.js";import{useShellStrings as i}from"./chunk-TJSJVC6P.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-BYDSBDVS.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-BYDSBDVS.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-TCMAWDBL.js";import{FormField as n}from"./chunk-6KBDNYRW.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Input_default as c}from"./chunk-CU3ZE25J.js";import{Button_default as o}from"./chunk-EVYD6UFQ.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
3
3
|
/* @__PURE__ */d("div",{children:[
|
|
4
4
|
/* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-WM2BBRT6.js";import{ItemCount as n}from"./chunk-KWTK6TGH.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{MOVE_KEYS as e,MoveGrip as t,MoveHint as r,moveFromKey as a}from"./chunk-WM2BBRT6.js";import{ItemCount as n}from"./chunk-KWTK6TGH.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Icon as i}from"./chunk-JOAKKXTL.js";import{OneLineLabel as s}from"./chunk-G67CJAQ2.js";import{Tooltip as l}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{useShellStrings as d}from"./chunk-TJSJVC6P.js";import{useRef as u,useCallback as p,useId as m,isValidElement as f}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var b='[role="treeitem"]';function v(e){return[...e.querySelectorAll(b)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":t,children:r,className:a="",rootProps:n}){const o=u(null);c(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(b)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??v(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=p(e=>{n?.onKeyDown?.(e);const t=o.current,r=e.target.closest?.(b);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=v(t),i=a.indexOf(r),s=Number(r.getAttribute("aria-level")??"1"),l=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(b))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=a[i+1];t&&Number(t.getAttribute("aria-level")??"1")>s?l(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
|
|
2
2
|
return h("div",{...n,ref:o,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:r})}function x({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
3
3
|
return h("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var k=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),w=`${k} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function N(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!f(e)&&"label"in e}function A(e){if(null==e||!1===e||"number"==typeof e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(N)?e:N(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */h("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${k} ${o[e.tone]}`:w,children:e.label},t)):/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:e})}function j({children:e,count:t,countLabel:r,expanded:a,onToggle:o}){const i=void 0!==a,l=
|
|
4
4
|
/* @__PURE__ */h("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */h(s,{children:e})}),c="number"==typeof t?/* @__PURE__ */h(n,{count:t,label:r,showZero:!0}):null!=t&&!1!==t&&/* @__PURE__ */h("span",{"data-tree-count":"",className:w,children:t}),d="text-xs font-semibold uppercase tracking-wide text-ink-faint";return i?/* @__PURE__ */h("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */g("button",{type:"button","aria-expanded":a,onClick:o,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-ink-strongest","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",d].join(" "),children:[
|
|
5
5
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:$(!!a)}),l,c]})}):/* @__PURE__ */g("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${d}`,children:[
|
|
6
|
-
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var $=e=>/* @__PURE__ */h(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),C={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function D({label:o,level:i=1,icon:l,preview:c,selected:d=!1,tone:u,expanded:p,onToggle:f,onSelect:b,muted:v=!1,badge:y,count:x,countLabel:k,actions:w,actionsPinned:N=!1,actionsOverlay:j=!0,rename:D,drop:P,dragging:K=!1,draggable:T=!1,dragHint:I,onMove:
|
|
7
|
-
return g("div",{...
|
|
6
|
+
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,c]})}var $=e=>/* @__PURE__ */h(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),C={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function D({label:o,level:i=1,icon:l,preview:c,selected:d=!1,tone:u,expanded:p,onToggle:f,onSelect:b,muted:v=!1,badge:y,count:x,countLabel:k,actions:w,actionsPinned:N=!1,actionsOverlay:j=!0,rename:D,drop:P,dragging:K=!1,draggable:T=!1,dragHint:I,onMove:H,rowProps:J,className:S=""}){const W=void 0!==p,E=m(),L=x??("number"==typeof y?y:void 0),M=[J?.["aria-describedby"],H?E:void 0].filter(Boolean).join(" ")||void 0,B="shared"===u?"text-[color:var(--status-success-soft-ink)]":null,G=d?B?`bg-[var(--status-success-soft)] ${B}`:"bg-accent-tint text-blue-700":"into"===P?`bg-accent-tint ${B??"text-ink-strongest"}`:`${B??"text-ink"} hover:bg-gray-100`;/* @__PURE__ */
|
|
7
|
+
return g("div",{...J,role:"treeitem","aria-level":i,"aria-selected":d,"aria-expanded":W?p:void 0,"data-tone":u,tabIndex:d?0:-1,"aria-keyshortcuts":J?.["aria-keyshortcuts"]??(H?e:void 0),"aria-describedby":M,"data-drop":P,"data-draggable":T||void 0,onKeyDown:e=>{if(J?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=a(e);t&&H?(e.preventDefault(),H(t)):"Enter"!==e.key&&" "!==e.key||!b?("ArrowRight"===e.key&&W&&!p&&f||"ArrowLeft"===e.key&&W&&p&&f)&&(e.preventDefault(),f()):(e.preventDefault(),b())},onClick:e=>{J?.onClick?.(e),e.defaultPrevented||b?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",T?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",G,"into"===P?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",K?"opacity-40":"",S].filter(Boolean).join(" "),children:["before"===P&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===P&&/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),T&&
|
|
8
8
|
/* @__PURE__ */h(t,{marker:"tree",hint:I,dragging:K,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
9
|
-
/* @__PURE__ */h("span",
|
|
9
|
+
/* @__PURE__ */h("span",W?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),f?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:$(!!p)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=l&&/* @__PURE__ */h("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(v?"text-ink-faintest":""),children:l}),
|
|
10
10
|
/* @__PURE__ */g("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[D??
|
|
11
|
-
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=
|
|
11
|
+
/* @__PURE__ */h("span",{"data-tree-name":"",className:`flex min-w-0 ${d?"font-semibold":"font-medium"} ${v?"text-ink-faintest line-through":""}`,children:/* @__PURE__ */g(s,{children:[o,null!=c&&/* @__PURE__ */h("span",{className:"ml-2 font-normal text-ink-faint",children:c})]})}),A(y),null!=L&&/* @__PURE__ */h(n,{count:L,label:k,active:d,showZero:!0,className:"ml-auto"}),null!=w&&!j&&/* @__PURE__ */h("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:`${null!=L?"":"ml-auto "}flex shrink-0 items-center gap-0.5 transition-opacity ${N||v?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"}`,children:w})]}),null!=w&&j&&
|
|
12
12
|
/* @__PURE__ */g("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:C,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(N||v||d?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
|
|
13
13
|
/* @__PURE__ */h("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
14
14
|
/* @__PURE__ */h("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
15
|
-
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),
|
|
15
|
+
/* @__PURE__ */h("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:w})]}),H&&/* @__PURE__ */h(r,{id:E})]})}function P({onAdd:e,label:t,drop:r=!1,slotProps:a}){const n=d().tree,o=r?n.dropHere:t??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
|
|
16
16
|
return h("div",{...a,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */g("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
|
|
17
17
|
/* @__PURE__ */h("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */h("span",{className:i,children:o})})}function K({onInsert:e,label:t,drop:r=!1,seamProps:a}){const n=d().tree,o=t??n.insertHere,s=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
|
|
18
18
|
return g("div",{...a,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-JMGDGNM7.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-JMGDGNM7.js";import{Icon as i}from"./chunk-JOAKKXTL.js";import{OneLineLabel as r}from"./chunk-G67CJAQ2.js";import{useShellStrings as s}from"./chunk-TJSJVC6P.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{MediaUploadField as e}from"./chunk-
|
|
1
|
+
import{MediaUploadField as e}from"./chunk-6VB4TBU6.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useShellStrings as t}from"./chunk-TJSJVC6P.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[R,C]=l(""),[B,F]=l(""),[H,I]=l(!1),[A,E]=l(!1),O=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),P=t().brandAsset,S=R||d||g||"",V=L?null:d?o:h,G=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const J=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
|
|
2
2
|
return n("section",{"aria-label":P.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
4
|
-
/* @__PURE__ */c(e,{value:
|
|
4
|
+
/* @__PURE__ */c(e,{value:S,onChange:()=>{},onFile:e=>{if(k)return;J();const r=URL.createObjectURL(e);j.current=r,U(e),C(r),F("")},label:p,hint:B||P.usedFor(b),error:B||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:H||A,disabled:k}),
|
|
5
5
|
/* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
6
|
-
/* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!
|
|
6
|
+
/* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!H){I(!0),F("");try{await x(L),J(),U(null),C("")}catch(e){F(e instanceof Error?e.message:P.saveFailed(O,p))}finally{I(!1)}}},disabled:!L||k,loading:H,children:P.save(O,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!A){if(L)return J(),U(null),C(""),void F("");if(d){E(!0),F("");try{await f()}catch(e){F(e instanceof Error?e.message:P.removeFailed(O,p))}finally{E(!1)}}}},disabled:k,loading:A,children:L?P.discard:P.remove(O,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":P.previews(p),children:[
|
|
7
7
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:P.preview}),
|
|
8
|
-
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:
|
|
8
|
+
/* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:S,alt:P.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:V,isLight:G,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
9
9
|
return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
10
10
|
/* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
11
11
|
/* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
|
|
@@ -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-NOEAEXIZ.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-CDAJKLGL.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{Icon as s}from"./chunk-JOAKKXTL.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-TJSJVC6P.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)]",A=e=>e.stopPropagation();function J({images:r,startIndex:y=0,onClose:J,onIndexChange:L,onOpenFile:U}){const D=h().lightbox,$=u(),z=p(null),E=p(null),[F,I]=x(y),P=r.length,O=$&&P>0,Q=b(e=>{if(P<2)return;const t=((F+e)%P+P)%P;I(t),L?.(t)},[F,P,L]);if(a(O),l(z,O,E),i(O),k(()=>{if(O)return f(()=>(J(),!0),()=>z.current)},[O,J]),k(()=>{if(!O)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),Q("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[O,Q]),!O)return null;const T=r[Math.min(F,P-1)],V=j(T),W=T.caption||n(T.url);let Y;return Y="video"===V?/* @__PURE__ */v("video",{src:T.url,controls:!0,playsInline:!0,"aria-label":W,onClick:A,className:`${e} rounded-lg bg-black`}):"file"===V?/* @__PURE__ */w("div",{onClick:A,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:z,...o({role:"dialog",modal:!0,label:
|
|
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:W}),U?/* @__PURE__ */v(c,{size:"sm",onClick:()=>U(T),children:D.openFile}):/* @__PURE__ */v("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",className:d({size:"sm"}),children:D.openFile})]}):/* @__PURE__ */v(t,{src:T.url,alt:W,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:z,...o({role:"dialog",modal:!0,label:D.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:J,children:[Y,
|
|
5
|
+
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:A,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:D.counter(F+1,P)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:E,type:"button",onClick:J,"aria-label":D.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(s,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),P>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{A(e),Q(-1)},"aria-label":D.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=>{A(e),Q(1)},"aria-label":D.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:A,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:W}),"file"!==V&&/* @__PURE__ */v("a",{href:T.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:D.openOriginal})]})]}),document.body)}export{J as ImageLightbox,j as lightboxKind};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{useCopyText as e,CopyGlyph as n}from"./chunk-NGQZI7HP.js";import{ItemCount as t}from"./chunk-KWTK6TGH.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-ZICGXJUB.js";import{Icon as o}from"./chunk-JOAKKXTL.js";import{useShellStrings as a}from"./chunk-TJSJVC6P.js";import{useState as s,useMemo as d,useEffect as c,useRef as u,Fragment as m,useLayoutEffect as f}from"react";import{jsxs as p,jsx as y,Fragment as g}from"react/jsx-runtime";function h(e){const n=[];let t=0;for(;t<e.length;){const r=e[t].group;let i=t;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;n.push(i>t?{group:r,start:t,end:i}:{start:t,end:t}),t=i+1}return n}function k(e,n){return e.find(e=>n>=e.start&&n<=e.end)}function b(e,n,t,r){const i=e.findIndex(e=>e.key===n.key);let l=e.findIndex(e=>e.key===t);if(i<0||l<0)return null;const o=h(e),a=k(o,i),s="group"===n.kind&&void 0!==a.group?e.slice(a.start,a.end+1).map(e=>e.key):[n.key];if(s.includes(t))return null;const d=k(o,l);if("tab"===n.kind&&void 0!==a.group){if(d!==a)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function x(e,n,t,r){const i=b(e,n,t,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),o=l.indexOf(i.key)+("after"===i.side?1:0),a=[...l.slice(0,o),...i.moving,...l.slice(o)];return a.every((n,t)=>n===e[t].key)?null:a}var v="flex-[0_100_15rem] [contain-intrinsic-inline-size:15rem]",N=v,w="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500",C="pointer-events-none absolute bottom-0 size-2 [background:inherit]";function $(){/* @__PURE__ */
|
|
2
|
+
return p(g,{children:[
|
|
3
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -left-2 [mask-image:radial-gradient(circle_at_0_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`}),
|
|
4
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -right-2 [mask-image:radial-gradient(circle_at_100%_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`})]})}function I(){/* @__PURE__ */
|
|
5
|
+
return y(o,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function z({text:t,label:r,copiedLabel:i}){const{copied:l,copy:o}=e(t);/* @__PURE__ */
|
|
6
|
+
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:C,onClose:j,onCloseMany:D,label:T,className:A,activeClassName:K,end:M,afterPinned:B,onIconMenu:E,menuItems:G,sizing:O="even",tall:R=!1,onReorder:L,groupInfo:J}){const S=a().pageTabs,X=a().count,[H,P]=s(null),W=R?"h-[34px]":"h-8",F=d(()=>e.map(e=>({key:e.key,group:J?e.group:void 0})),[e,J]),V=d(()=>h(F),[F]),Z=d(()=>{const t=e.findIndex(e=>e.key===n);return V.find(e=>void 0!==e.group&&t>=e.start&&t<=e.end)?.group},[V,e,n]),[Q,U]=s(()=>Z??null),Y=t=>{const r=V.find(e=>e.group===t);if(!r)return;const i=e.findIndex(e=>e.key===n),l=i>=r.start&&i<=r.end;if(Q!==t)l||C(e[r.start].key),U(t);else{if(l){const n=e[r.end+1]??e[r.start-1];n&&C(n.key)}U(null)}};c(()=>{void 0!==Z&&U(Z)},[n]);const q=d(()=>{const n=[];for(const t of V)for(let r=t.start;r<=t.end;r++)void 0!==t.group&&t.group!==Q||n.push(e[r]);return n},[V,Q,e]),ee=u(null),[ne,te]=s(null),re=(n,t)=>L?{draggable:!0,onDragStart:t=>{ee.current=n,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.find(e=>e.key===n.key)?.title??"")},onDragOver:e=>{const r=ee.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=t!==n.key||"tab"===n.kind?e.clientX<i.left+i.width/2?"before":"after":"before",o=x(F,r,t,l)?b(F,r,t,l):null;if(!o)return void(ne&&te(null));e.preventDefault(),e.dataTransfer.dropEffect="move";const a=e=>F.find(n=>n.key===e)?.group,s="tab"===r.kind&&void 0!==a(r.key)&&a(r.key)===a(o.key);ne?.key===o.key&&ne.side===o.side&&ne.inGroup===s||te({key:o.key,side:o.side,inGroup:s})},onDrop:e=>{const n=ee.current;if(!n||!ne)return;e.preventDefault();const t=x(F,n,ne.key,ne.side);ee.current=null,te(null),t&&L(t)},onDragEnd:()=>{ee.current=null,te(null)}}:{},ie=d(()=>new Set(V.filter(e=>void 0!==e.group&&J).map(n=>e[n.start].key)),[V,e,J]),le=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),oe=e=>ne?.key===e&&!("before"===ne.side&&ie.has(e)&&!ne.inGroup)&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le(ne.side)}),ae=e.length;c(()=>{if(!n)return;const e=document.getElementById(f(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,n,ae]);const se=B?q.findIndex(e=>!e.pinned):-1,de=q.some(e=>e.key===n)?n:q[0]?.key,ce=e=>{const n=q[(e+q.length)%q.length];n&&document.getElementById(f(n.key,"tab"))?.focus()},ue=(e,n)=>{const t=q[e+n];if(!L||!t)return;const r=x(F,{kind:"tab",key:q[e].key},t.key,n<0?"before":"after");r&&(L(r),setTimeout(()=>document.getElementById(f(q[e].key,"tab"))?.focus(),0))},me=H?e.find(e=>e.key===H.key):void 0,fe=me&&G?G(me.key):[],pe=me?e.indexOf(me):-1,ye=e=>e.some(e=>!e.pinned),ge=e=>()=>{P(null),e()},he=(e,t)=>!!t&&e.key!==n&&t.key!==n,ke=(e,t)=>{const r=e.key===n,i=e.pinned?"auto":r?"active-full"===O?"15rem":e.copy||E&&e.icon?"minmax(4.25rem,20rem)":"minmax(4.25rem,15rem)":"minmax(4rem,15rem)";return he(e,t)?["auto",i]:[i]},be=(e,t)=>{const r=e.key===n,i=!!e.dirty,l=e.icon,a=r?K??"z-[1] border-transparent bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=he(e,t),d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":k?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===de?0:-1,title:e.title,onClick:()=>C(e.key)},c={onContextMenu:n=>((e,n)=>{e.preventDefault(),P({x:e.clientX,y:e.clientY,key:n.key})})(n,e),onAuxClick:n=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),j(n.key))})(n,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
|
|
7
|
+
/* @__PURE__ */p("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[l,i&&!r&&!e.pinned&&
|
|
8
|
+
/* @__PURE__ */y("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),g=r&&!!E&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-lg border border-b-0 transition-colors ${W} ${l?"w-10":""} ${a}`,...c,...re({kind:"tab",key:e.key},e.key),children:[oe(e.key),r&&/* @__PURE__ */y($,{}),
|
|
9
|
+
/* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-lg ${l?"w-full":"px-3"} ${w}`,children:[u,
|
|
10
|
+
/* @__PURE__ */y("span",{className:l?"sr-only":"whitespace-nowrap text-sm",children:e.title})]})]},e.key):/* @__PURE__ */p(m,{children:[s&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
11
|
+
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${W} ${"active-full"===O&&r?"":"@container"} ${"active-full"===O?r?"flex-[0_0_15rem] min-w-0":N:r&&(e.copy||g)?"flex-[0_100_20rem]":v} ${r?"active-full"===O?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${a}`,...c,...re({kind:"tab",key:e.key},e.key),children:[oe(e.key),r&&/* @__PURE__ */y($,{}),g&&
|
|
12
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":S.tabMenu,title:S.tabMenu,onClick:n=>{const t=n.currentTarget.getBoundingClientRect();E?.(e.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-2 ${w}`,children:u}),
|
|
13
|
+
/* @__PURE__ */p("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-lg pr-1 text-left ${g?"pl-2":"pl-3"} ${w} ${r?g?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2 @max-[4.5rem]:group-hover:pr-3"}`,children:[!g&&u,
|
|
14
|
+
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===O&&r?"pr-4":""} ${l?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
|
|
15
|
+
/* @__PURE__ */y("span",{role:"img","aria-label":S.favorite,title:S.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(o,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(_,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y(z,{text:e.copy,label:S.copy(e.copy),copiedLabel:S.copied}),
|
|
16
|
+
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":S.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
17
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":S.closeTab?.(e.title)??`${S.close} ${e.title}`,onClick:()=>j(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */y(I,{})})]})]})]},e.key)},xe=[];let ve,Ne=0,we=!B;for(const r of V){const i=q.filter(n=>{const t=e.indexOf(n);return t>=r.start&&t<=r.end});if(we||Ne!==se||(we=!0,xe.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),ve=void 0),Ne+=i.length,void 0===r.group||!J){for(const e of i)xe.push(be(e,ve)),ve=e;continue}ve=void 0;const l=r.group,a=J(l),s=r.end-r.start+1,d=Q===l,c=e[r.start].key,u=i.some(e=>e.key===n)?"shrink":"shrink-[100]",f=["auto",...i.flatMap((e,n)=>ke(e,n>0?i[n-1]:void 0))];xe.push(
|
|
18
|
+
/* @__PURE__ */p("div",{role:"group","aria-label":a.label,"data-tab-group":l,className:`relative mx-1 grid grid-flow-col items-end first:ml-0 ${u}`,style:{gridTemplateColumns:f.join(" ")},children:[
|
|
19
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:S.groupToggle(a.label,s),onClick:()=>Y(l),...re({kind:"group",key:c},c),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${w}`,children:[
|
|
20
|
+
/* @__PURE__ */y(o,{name:d?"chevron-right":"chevron-down","aria-hidden":"true",className:"size-3",strokeWidth:2}),a.icon&&/* @__PURE__ */y("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:a.icon}),
|
|
21
|
+
/* @__PURE__ */y("span",{className:d?"sr-only":"max-w-[12rem] truncate",children:a.label}),
|
|
22
|
+
/* @__PURE__ */y(t,{count:s,label:X.tabs(s),active:!0})]}),ne?.key===c&&"before"===ne.side&&!ne.inGroup&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le("before")}),i.map((e,n)=>be(e,n>0?i[n-1]:void 0)),
|
|
23
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return we||xe.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:A??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
24
|
+
/* @__PURE__ */y("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
25
|
+
/* @__PURE__ */y("div",{role:"tablist","aria-label":T,onKeyDown:e=>{const n=q.findIndex(n=>document.getElementById(f(n.key,"tab"))===e.target);if(n<0)return;const t=e.shiftKey&&(e.ctrlKey||e.metaKey);if(t&&"ArrowRight"===e.key)ue(n,1);else if(t&&"ArrowLeft"===e.key)ue(n,-1);else if("ArrowRight"===e.key)ce(n+1);else if("ArrowLeft"===e.key)ce(n-1);else if("Home"===e.key)ce(0);else if("End"===e.key)ce(q.length-1);else{if("Delete"!==e.key||q[n].pinned)return;j(q[n].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end -mx-2 px-2 scroll-px-2 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:xe}),M&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:M}),H&&me&&/* @__PURE__ */p(r,{portal:!0,style:{left:H.x,top:H.y},onClose:()=>P(null),children:[fe.length>0&&/* @__PURE__ */p(g,{children:[fe.map((e,n)=>/* @__PURE__ */p(i,{onClick:ge(e.onSelect),children:[e.icon,e.label]},n)),
|
|
26
|
+
/* @__PURE__ */y(l,{})]}),
|
|
27
|
+
/* @__PURE__ */y(i,{disabled:me.pinned,onClick:ge(()=>j(me.key)),children:S.close}),
|
|
28
|
+
/* @__PURE__ */y(l,{}),
|
|
29
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:ge(()=>D("others",me.key)),children:S.closeOthers}),
|
|
30
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:ge(()=>D("right",me.key)),children:S.closeRight}),
|
|
31
|
+
/* @__PURE__ */y(i,{disabled:!ye(e),onClick:ge(()=>D("all",null)),children:S.closeAll})]})]})}export{j as TabStrip};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="12.12.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as t}from"./chunk-
|
|
1
|
+
import{Icon as t}from"./chunk-JOAKKXTL.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
|
|
2
2
|
/* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
|
|
3
3
|
/* @__PURE__ */e("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
|
|
4
4
|
return e(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-JOAKKXTL.js";import{useShellStrings as r}from"./chunk-TJSJVC6P.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-JOAKKXTL.js";import{useShellStrings as i}from"./chunk-TJSJVC6P.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
|
|
2
2
|
return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
|
|
3
3
|
/* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
|
|
4
4
|
/* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-JOAKKXTL.js";import{useShellStrings as r}from"./chunk-TJSJVC6P.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";var s={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},c={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},a={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function i({tone:r}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"error",...t});default:/* @__PURE__ */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-RAOM3WIQ.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-JOAKKXTL.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-TJSJVC6P.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as S,useEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as O,Fragment as E}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,S=w(),H=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:i}),
|
|
2
|
+
/* @__PURE__ */O(A,{items:r})]});return j?/* @__PURE__ */C(E,{children:[H,
|
|
3
|
+
/* @__PURE__ */O("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function A({items:e}){const t=e=>/* @__PURE__ */O("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return O(E,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */O("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var K=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:K,className:R="",id:U,disabled:V,size:B,touchSize:P,title:W,multiple:J,renderOption:L,renderValue:M,valueText:Y,readOnly:F=!1,footer:G,changed:X=!1,auto:q,"aria-describedby":Q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!G?.length,me="sm"===B,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=U??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),Se=q??je,He=`${ke}-auto`,Te=[Q,X?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Oe=J?l:[],Ee=u,Ie=f(oe,re,{matchTriggerWidth:!0,...G?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Ae=J?Ce.findIndex(e=>Oe.includes(e.value)):Ce.findIndex(e=>e.value===l),Ke=J?Ce.filter(e=>Oe.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?Ce[Ae].label:void 0,Re=!J&&Ae>=0?Ce[Ae].lang:void 0,Ue=J?Ce.filter(e=>Oe.includes(e.value)):Ae>=0?[Ce[Ae]]:[],Ve=M&&Ue.length?M(Ue):void 0,Be=void 0!==Ve&&Y?Y(Ue):void 0,Pe=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),We=S(()=>{V||F||(ae(Ae>=0?Ae:e(Ce)),ie(!0))},[V,F,Ce,Ae]),Je=S(e=>{const t=Ce[e];if(t&&!t.disabled){if(J){const r=l;return Ee(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ee(t.value),Pe()}},[Ce,J,l,Ee,Pe]);H(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Pe(),!0),ue)},[re,Pe]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Pe(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Pe(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Pe]),H(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Le=S(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Ae,n=t(Ce,r.buffer,i);n<0||(re?ae(n):J?(ae(n),ie(!0)):Je(n))},[re,ne,Ae,Ce,Je,J]),Me=re?a(N,(e,t)=>{const r=(i=e.value,J?Oe.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
|
+
return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||L?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Je(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${J?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[J&&/* @__PURE__ */O(o,{selected:r}),L?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1 truncate",children:L(e,{selected:r,active:n})}):J?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
+
/* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
|
+
/* @__PURE__ */C(E,{children:[
|
|
8
|
+
/* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Ye=void 0!==Ve?
|
|
9
|
+
/* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
+
/* @__PURE__ */O("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ve}),
|
|
11
|
+
/* @__PURE__ */O("span",{lang:void 0===Be?Re:void 0,className:"sr-only",children:Be??Ke})]}):/* @__PURE__ */O("span",{lang:Re,className:`block truncate ${void 0===Ke?c:""}`,children:Ke??z??" "}),Fe={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...x()},Ge=/* @__PURE__ */O("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":J||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Fe,maxHeight:fe}:Fe,children:Me}),Xe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Fe,children:[Ge,
|
|
12
|
+
/* @__PURE__ */O("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:G.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Pe(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(G?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Pe());case"Escape":return e.preventDefault(),e.stopPropagation(),void Pe()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */O(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
|
+
/* @__PURE__ */O("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Ge;/* @__PURE__ */
|
|
14
|
+
return C("div",{ref:le,className:"relative",children:[
|
|
15
|
+
/* @__PURE__ */O("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":K||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:W,disabled:V,"aria-readonly":F||void 0,onClick:()=>re?Pe():We(),onKeyDown:t=>{if(!V&&!F)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):We());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):We());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),Je(ne)));case" ":return t.preventDefault(),void(re?Je(ne):We());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Pe()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Pe(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Le(t.key))}},className:s({invalid:K,size:B,readOnly:F,auto:Se,className:`${F?"":"pr-8 "}text-left ${R}`.trim()}),children:X?
|
|
16
|
+
/* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Ye,
|
|
17
|
+
/* @__PURE__ */O("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ye}),X&&/* @__PURE__ */O("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */O("span",{id:He,hidden:!0,children:ge.settingView.auto}),!F&&/* @__PURE__ */O(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
+
/* @__PURE__ */C("select",{ref:te,value:l,multiple:J||void 0,onChange:e=>Ee(J?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:V,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!J&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:z}),
|
|
19
|
+
/* @__PURE__ */O(A,{items:N})]}),re&&T(Xe,document.body)]})}),R=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */O(z,{ref:r,...t,size:n}):/* @__PURE__ */O(K,{ref:r,...t}):/* @__PURE__ */O(K,{ref:r,...t,size:n})});export{z as NativeSelect,R as Select_default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-
|
|
1
|
+
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-J2YURAQY.js";import{setPdfPreview as n}from"./chunk-ESL5TDNA.js";import{toast_default as i}from"./chunk-JTZVUO3I.js";var o="react-os-shell:preview-opened";async function a(a){const{filePath:r,filename:l,kind:c,onStaged:s,load:d}=a;try{const a=d?d():e().readShortcut?.(r)??null;let f;if(a)f=await a;else{const e=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(r)}`,{credentials:"include"});if(!e.ok)return i.error(`Download failed (${e.status})`),!1;f=await e.blob()}if("csv"===c){const e=await f.text();t({csv:e,filename:l}),s?.("/spreadsheet")}else{const e=URL.createObjectURL(f);n({url:e,filename:l,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(o,{detail:{filePath:r,filename:l,kind:c}})),!0}catch(e){return i.error(e?.message||"Open failed"),!1}}export{o as PREVIEW_OPENED_EVENT,a as openPreviewFile};
|