efficient-shell 12.26.0 → 12.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-3CEYK5AG.js → Browser-PC45PVTN.js} +15 -15
- package/dist/{Calculator-LSDVIJVQ.js → Calculator-5TRNFPY4.js} +21 -21
- package/dist/{CurrencyConverter-G5IYUCN7.js → CurrencyConverter-BB4QWNER.js} +6 -6
- package/dist/Files-BKEREVQK.js +141 -0
- package/dist/{Notepad-H6NVBIDA.js → Notepad-BLUA2254.js} +9 -9
- package/dist/{PdfViewer-UY5SRC63.js → PdfViewer-4YLDY4JY.js} +1 -1
- package/dist/{PomodoroTimer-SFTPXEDV.js → PomodoroTimer-KIJKDHVO.js} +6 -6
- package/dist/{Preview-BHQH5CSY.js → Preview-JVL2N5GN.js} +29 -29
- package/dist/Sidebar-SAGLPIOC.js +44 -0
- package/dist/{Stock-YCPMLYPR.js → Stock-JQEJMIMG.js} +3 -3
- package/dist/{Weather-TLFNIPDG.js → Weather-FAQX55XL.js} +16 -16
- package/dist/{WorldClock-66IRFS2W.js → WorldClock-YSZNGEL2.js} +6 -6
- package/dist/ai/index.d.ts +170 -6
- package/dist/ai/index.js +134 -115
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/chunk-24Y5JHIR.js +4 -0
- package/dist/{chunk-34TQBJ7I.js → chunk-2OUAPOLK.js} +1 -1
- package/dist/chunk-2SGOKMUU.js +13 -0
- package/dist/{chunk-3CKYFCX4.js → chunk-34L5SRM7.js} +17 -17
- package/dist/chunk-3DSGJIC7.js +7 -0
- package/dist/{chunk-CALBDO7B.js → chunk-3FBXJO77.js} +1 -1
- package/dist/{chunk-DK5SXOXJ.js → chunk-47UH3D4B.js} +1 -1
- package/dist/{chunk-7LTU5TJD.js → chunk-4EFIUJ7X.js} +1 -1
- package/dist/{chunk-AQCUGTOR.js → chunk-56XCGOX5.js} +6 -6
- package/dist/{chunk-LBKKKZ4M.js → chunk-63IGYBCQ.js} +2 -2
- package/dist/chunk-64J7TYJ3.js +4 -0
- package/dist/{chunk-3JL4TCA7.js → chunk-6KOMF6WL.js} +1 -1
- package/dist/{chunk-RY7JCGLI.js → chunk-6Q7L32LL.js} +1 -1
- package/dist/{chunk-VLMBXPRM.js → chunk-7GJIIBJD.js} +1 -1
- package/dist/{chunk-DCCYUCBM.js → chunk-7NO4IENQ.js} +1 -1
- package/dist/{chunk-I7JU4IU3.js → chunk-7TNZ3DTT.js} +2 -2
- package/dist/{chunk-KP2JYXEU.js → chunk-AFWLCXQD.js} +9 -9
- package/dist/{chunk-34EBBZFK.js → chunk-AMIMNRYU.js} +1 -1
- package/dist/chunk-ASDYAASN.js +3 -0
- package/dist/{chunk-N3R6N7LG.js → chunk-ATZ262BR.js} +1 -1
- package/dist/{chunk-KZRZYLN7.js → chunk-BC4FE77W.js} +49 -49
- package/dist/chunk-BFRGDRFK.js +23 -0
- package/dist/{chunk-CCK2UWQ5.js → chunk-BKYRHQK2.js} +10 -10
- package/dist/{chunk-X34ZBXIU.js → chunk-BT2YPDQL.js} +3 -3
- package/dist/{chunk-YW3UKSON.js → chunk-CON5NRCO.js} +2 -2
- package/dist/{chunk-JUFCEWE3.js → chunk-DG2TGWXI.js} +5 -5
- package/dist/{chunk-4ZRGMK7Y.js → chunk-DIHHV6T6.js} +1 -1
- package/dist/{chunk-N32LNPPP.js → chunk-EATV7FMU.js} +8 -8
- package/dist/{chunk-VXDW6ZPG.js → chunk-EEB5XPWP.js} +2 -2
- package/dist/{chunk-JN5NUZ6D.js → chunk-EWVE5XG6.js} +1 -1
- package/dist/chunk-FFUTSMF5.js +28 -0
- package/dist/{chunk-RB7IU7ZK.js → chunk-FVKXDF2Q.js} +5 -5
- package/dist/{chunk-THLXDI76.js → chunk-GOAFMGUI.js} +10 -10
- package/dist/{chunk-MEN4B6NP.js → chunk-H2CPT6K3.js} +10 -10
- package/dist/{chunk-3J3FBYIZ.js → chunk-HLE4LTRU.js} +1 -1
- package/dist/{chunk-Y523KUQC.js → chunk-HNEI2RKX.js} +1 -1
- package/dist/{chunk-Z3CTYK3U.js → chunk-HSUTZCRT.js} +1 -1
- package/dist/{chunk-UR2ECNBB.js → chunk-HVYXJLAV.js} +1 -1
- package/dist/chunk-IATKDC52.js +9 -0
- package/dist/{chunk-G2Y5I5OR.js → chunk-IB3LLQZC.js} +1 -1
- package/dist/{chunk-XZXFUZIK.js → chunk-ISVODSRP.js} +6 -3
- package/dist/chunk-JJ2OXUK7.js +14 -0
- package/dist/{chunk-QMSINDXL.js → chunk-JLRF6FN7.js} +1 -1
- package/dist/{chunk-BZHP645G.js → chunk-K5PDLRYH.js} +8 -8
- package/dist/{chunk-GLRRX4AL.js → chunk-K5YT5PMJ.js} +1 -1
- package/dist/{chunk-SY66VJAI.js → chunk-KTO427N3.js} +1 -1
- package/dist/{chunk-6GWYFUME.js → chunk-LAO6GLBY.js} +6 -6
- package/dist/{chunk-RJF4A3LJ.js → chunk-LL4KF43W.js} +1 -1
- package/dist/{chunk-FQ4IRBMA.js → chunk-MKNDDB6U.js} +1 -1
- package/dist/{chunk-4ZLFAXOC.js → chunk-MTYEY7HT.js} +11 -11
- package/dist/{chunk-ILDPJ26Y.js → chunk-N2FX4O3H.js} +1 -1
- package/dist/{chunk-WBGJ4XB7.js → chunk-N5RV73CI.js} +4 -4
- package/dist/{chunk-CJHYOHMU.js → chunk-NN32QUCE.js} +1 -1
- package/dist/{chunk-B76GRJW5.js → chunk-NUPK6CUV.js} +1 -1
- package/dist/{chunk-KBI3T6UC.js → chunk-O4YKOS74.js} +1 -1
- package/dist/{chunk-VQ4X3OBR.js → chunk-OMFYTCBI.js} +1 -1
- package/dist/{chunk-YRY64DQV.js → chunk-OXRQIWRT.js} +1 -1
- package/dist/{chunk-6RK6R3RY.js → chunk-PT4GMPUB.js} +1 -1
- package/dist/{chunk-PLPMCE44.js → chunk-QB2GJNGB.js} +9 -9
- package/dist/{chunk-GEZM6ARD.js → chunk-QIPO4EVJ.js} +1 -1
- package/dist/{chunk-6FZ5JTBY.js → chunk-QMBMK6PP.js} +2 -2
- package/dist/{chunk-TOVEZAIM.js → chunk-QOYKBINM.js} +1 -1
- package/dist/{chunk-63TCQAGE.js → chunk-RVVQDBV7.js} +5 -5
- package/dist/{chunk-OM42AUMS.js → chunk-S6AN76R3.js} +1 -1
- package/dist/{chunk-B4GRHE44.js → chunk-SS3CROPR.js} +3 -3
- package/dist/{chunk-7MJYT6IW.js → chunk-TDXRG43I.js} +1 -1
- package/dist/{chunk-T2TZBTSM.js → chunk-TKIYZE7V.js} +1 -1
- package/dist/{chunk-WVMCKM5Z.js → chunk-UEFIUTOU.js} +1 -1
- package/dist/chunk-UFM4YBZ7.js +1 -0
- package/dist/{chunk-436PJFHC.js → chunk-UH5ZGWSA.js} +10 -10
- package/dist/{chunk-FTMCNC66.js → chunk-UZFFSZFI.js} +1 -1
- package/dist/{chunk-3E3LR2PM.js → chunk-V3XS6BTJ.js} +13 -13
- package/dist/{chunk-YIUWX2IU.js → chunk-VLBIM33E.js} +5 -5
- package/dist/{chunk-QZCLHKCI.js → chunk-VLKJN6HX.js} +10 -10
- package/dist/{chunk-OHSRZLRD.js → chunk-VP2GI3UP.js} +2 -2
- package/dist/{chunk-QG37GJP2.js → chunk-WBAWJIVM.js} +4 -4
- package/dist/{chunk-QPSJYSET.js → chunk-WKYNPGFB.js} +5 -5
- package/dist/{chunk-JGRDG7CB.js → chunk-WN3JHPJI.js} +6 -6
- package/dist/{chunk-XHZVUO6F.js → chunk-WX2Q76WC.js} +6 -6
- package/dist/{chunk-6DGUJ2OI.js → chunk-X5MUSNKH.js} +2 -2
- package/dist/{chunk-YI6SYUAK.js → chunk-XAEI36TW.js} +1 -1
- package/dist/{chunk-H6WXTJOT.js → chunk-XAF5ZI7H.js} +1 -1
- package/dist/{chunk-TM4CRQ3W.js → chunk-XMY2HKVD.js} +15 -15
- package/dist/{chunk-F37II2EH.js → chunk-XQWHKXLS.js} +13 -13
- package/dist/{chunk-SSNTJ3M4.js → chunk-XSVQ5V7L.js} +9 -9
- package/dist/chunk-Y4FWTYZS.js +6 -0
- package/dist/{chunk-HMT3MES3.js → chunk-YWNHK6Z5.js} +18 -18
- package/dist/{chunk-LPPJNZQ6.js → chunk-YYGJJ6EI.js} +1 -1
- package/dist/{chunk-R62JKPYY.js → chunk-Z2Z653OO.js} +1 -1
- package/dist/{chunk-L543DFHF.js → chunk-ZBJ7FTA5.js} +1 -1
- package/dist/{chunk-OLCRYT3N.js → chunk-ZGCCV4WE.js} +10 -10
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +665 -665
- package/dist/map/index.js +5 -5
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.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/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Files-T56P5JDC.js +0 -141
- package/dist/Sidebar-BKNCPUOE.js +0 -44
- package/dist/chunk-BM2QIV64.js +0 -23
- package/dist/chunk-D2WJAF62.js +0 -4
- package/dist/chunk-GJGR267P.js +0 -1
- package/dist/chunk-INADSWOF.js +0 -28
- package/dist/chunk-LCEQIFPK.js +0 -3
- package/dist/chunk-LDVDNAXP.js +0 -4
- package/dist/chunk-OQ6TECLX.js +0 -6
- package/dist/chunk-SFULX4E3.js +0 -7
- package/dist/chunk-TUPPFC74.js +0 -14
- package/dist/chunk-UP4HLGMZ.js +0 -9
- package/dist/chunk-ZQ24H5UO.js +0 -13
- /package/dist/{chunk-5WK56FA3.js → chunk-TGLUENXE.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-3DSGJIC7.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{inputClasses as n,PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
|
|
2
2
|
return o("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-1",children:e})}function d({action:e,size:r="md"}){/* @__PURE__ */
|
|
3
3
|
return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:n,size:t}){const{label:s,icon:l,onClick:c,menu:m}=n;/* @__PURE__ */
|
|
4
4
|
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(e,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:t})}):/* @__PURE__ */o(r,{"aria-label":s,size:t,onClick:c,children:l})})}var f=s(function({invalid:e,leftIcon:r,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",v=`${r?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),N=
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-
|
|
2
|
-
return v("div",{...
|
|
3
|
-
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-7GJIIBJD.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-V4XR4MOS.js";import{ColoredBadge as u}from"./chunk-NN32QUCE.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-JSHMIMAJ.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:T,onDragOutChange:C,dropType:K,onDropData:I,label:S,hint:A,error:O,required:F,className:M,accept:P="image/*",maxSizeBytes:z,maxFiles:E,fit:L="cover",thumbSize:$=96,placeholder:R,cta:H,acceptHint:B,showCover:J=!1,coverLabel:W,busy:Q=!1,busyLabel:q,progress:U,disabled:V=!1,readOnly:G=!1,selected:X,onItemClick:Y,onItemDoubleClick:Z,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=H??te.cta,ae=W??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=V||Q,de=!(!k&&!N||se||G),ce=!!w&&!se&&!G,ue=!!j&&!se&&!G,me=!!T&&!V&&!ue,pe=!(!K||!I||se||G),fe=t(se),he=R??r(P,te),ge=d({accept:P,maxSizeBytes:z,maxFiles:E,acceptHint:B,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(K),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(K);t&&I(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Te=null==X?null:new Set(X),Ce=!!Y,Ke=$<112,Ie=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,P),a=e.name??o(e.url),n=J&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Te?Te.has(e.id):void 0,onClick:Ce?t=>{t.target.closest?.("button")||Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:Z?()=>Z(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(T,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);C?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&C?t=>C("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Ce?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Te?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:L}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:L}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
|
|
3
|
+
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ke?
|
|
4
4
|
/* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
|
|
5
|
-
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},
|
|
5
|
+
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Se=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
|
|
6
6
|
/* @__PURE__ */x(a,{className:"h-5 w-5"}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),
|
|
7
|
+
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Ae=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:$+32},children:[
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
|
|
9
9
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
|
|
10
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:
|
|
11
|
-
return v(e,{label:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:Q?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:S,labelId:S?`${le}-label`:void 0,htmlFor:le,hint:A,error:O,required:F,className:M,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":S?`${le}-label`:void 0,"aria-describedby":O?`${le}-error`:A?`${le}-hint`:void 0,"aria-busy":Q||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Ae:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Te||void 0,"aria-label":"string"==typeof S?S:te.files,className:"contents",children:p.map(Ie)}):p.map(Ie),Se]}),Q&&/* @__PURE__ */x(l,{label:ne,progress:U})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
|
|
14
14
|
/* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Input_default as e}from"./chunk-
|
|
1
|
+
import{Input_default as e}from"./chunk-PT4GMPUB.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
|
|
2
2
|
return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-UZFFSZFI.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-GOAFMGUI.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),A=a(),[S,U]=d(null),j=s(w);j.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});U(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const F=s(null),C=s(!1);m(()=>(F.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||F.current?.focus?.({preventScroll:!0})}),[]),m(()=>{S&&!C.current&&D&&(C.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[S,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(j.current(),!0),()=>L.current),[]),m(()=>{const e=()=>j.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const T=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void j.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=S?{left:S.left,top:S.top,maxHeight:S.maxHeight,...S.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:T,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(j.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>j.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e,TRIGGER_CLASS as n}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e,TRIGGER_CLASS as n}from"./chunk-3DSGJIC7.js";import{Tooltip as a}from"./chunk-SOZCWT6I.js";import{jsx as i,jsxs as l}from"react/jsx-runtime";function t(e,n,a){if(n&&!(n.options.length<2))/* @__PURE__ */
|
|
2
2
|
return i(s,{value:e,options:n.options,onChange:n.onChange,label:n.label,disabled:a})}var r=`${n} -ml-1 h-6 px-1 text-xs`;function s({value:n,options:t,onChange:s,label:o,disabled:c}){
|
|
3
3
|
/* @__PURE__ */
|
|
4
4
|
return i(a,{content:o,describe:!1,children:/* @__PURE__ */i(e,{trigger:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return f(z.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:F,step:k=1,shiftStep:N,precision:L,inputMin:
|
|
3
|
-
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:F,step:k,value:de,disabled:
|
|
4
|
-
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-63IGYBCQ.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{createContext as o,useState as l,useMemo as a,useId as u,useRef as s,useEffect as c,useContext as d}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";var p=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e){const t=String(e),n=/e-(\d+)$/.exec(t);return n?Number(n[1]):t.split(".")[1]?.length??0}var x={sm:{left:10,plain:8,unit:40,text:"text-xs"},md:{left:14,plain:12,unit:40,text:"text-sm"}},v={"--rosh-slider-gap":"var(--space-12)","--rosh-slider-floor":"4rem"},b={position:"absolute",left:0,top:0,width:"max-content",height:0,overflow:"hidden",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre"},g={display:"block",width:"max-content"},y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function w(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(y.test(t)?2:1),0)))}function S(e,t,n,r){return Number(p(e,t,n).toFixed(r))}var z=o(null);function F({children:e}){const[t,n]=l({}),r=a(()=>(e,t)=>n(n=>{if(null===t){if(!(e in n))return n;const t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}}),[]),i=a(()=>{const e=Object.values(t);return{set:r,width:e.length?`max(${e.join(", ")})`:null}},[t,r]);/* @__PURE__ */
|
|
2
|
+
return f(z.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:F,step:k=1,shiftStep:N,precision:L,inputMin:C,inputMax:j,suffix:E,units:M,onCommit:R,showInput:$=!0,emptyLabel:B,placeholderValue:K,stepFrom:W,label:A,"aria-labelledby":O,valueText:D,id:H,disabled:I,size:q="md",boxSize:P="sm",className:T="",auto:V}){const J=i(),U=u(),G=s(o);r(()=>{G.current=o},[o]);const Q=s(o),Y=e=>{G.current=e,a(e)},Z=()=>{Q.current=G.current},X=()=>{R&&G.current!==Q.current&&(Q.current=G.current,R(G.current))},_=s(null),ee=s(X);ee.current=X;const te=Boolean(R);c(()=>{const e=_.current;if(!te||!e)return;const t=()=>ee.current();return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[te]);const ne=t(),re=V??ne,ie=u(),oe=H??U,le=L??h(k),ae=C??y,ue=j??F,se=void 0!==B||void 0!==K,ce=W??K,de=p(o??K??y,y,F),fe=[y.toFixed(le),F.toFixed(le),o?.toFixed(le),B,K?.toFixed(le)],me=null!=o?o.toFixed(le):B||(null!=K?K.toFixed(le):void 0),pe=s(null),he=s(null),[xe,ve]=l(null),be=s(null),ge=Boolean(E);r(()=>{if(!$)return;const e=()=>{const e=pe.current?.querySelector("input"),t=he.current;if(!e||!t)return;const n=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(r<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const i=Math.ceil(t.getBoundingClientRect().width);if(i<=0)return;const o=t.querySelector("[data-shown]"),l=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),a=!!o&&o.getBoundingClientRect().width>l+.5,u=be.current;if(be.current={box:u?.box??{frame:r,fontSize:n.fontSize,text:i,cut:a},room:l},u&&u.box.frame===r&&u.box.fontSize===n.fontSize&&u.box.text===i&&u.box.cut===a)return;const s={frame:r,fontSize:n.fontSize,text:i,cut:a};be.current={box:s,room:l},ve(s)};e(),window.addEventListener("resize",e);const t="undefined"!=typeof document?document.fonts:void 0;t?.addEventListener?.("loadingdone",e);let n=null;if("undefined"!=typeof ResizeObserver){n=new ResizeObserver(()=>e());const t=pe.current?.querySelector("input");t&&n.observe(t),he.current&&n.observe(he.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[ge,$,P]),r(()=>{const e=be.current;if(!e)return;const t=e.box.text<=e.room+.5?null:he.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const r={...e.box,cut:n};be.current={box:r,room:e.room},ve(r)},[me]);const ye=e=>D?D(e):"string"==typeof E?`${e.toFixed(le)} ${E}`:void 0,we=null==o?B??(null!=K?ye(K)??String(K):void 0):ye(o),Se=x[P],ze=fe.filter(e=>Boolean(e)),Fe=void 0===me?-1:ze.indexOf(me),ke=xe?`${xe.text+xe.frame+2}px`:`calc(${w(fe)}ch + ${Se.left+(ge?Se.unit:Se.plain)+2}px)`,Ne=d(z),Le=u(),Ce=Ne?.set;return r(()=>{Ce&&Ce(Le,$?ke:null)},[Ce,Le,ke,$]),c(()=>()=>Ce?.(Le,null),[Ce,Le]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${T}`.trim(),style:v,children:[
|
|
3
|
+
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:F,step:k,value:de,disabled:I,"aria-label":O?void 0:A,"aria-labelledby":O,"aria-valuetext":we,"aria-describedby":re?ie:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const n=e.shiftKey&&null!=N;if(!n&&!(null==o&&null!=ce))return;e.preventDefault();Y(S((o??ce??de)+t*(n?N??k:k),y,F,le)),X()},ref:_,onFocus:R&&Z,onPointerDown:R&&Z,onChange:e=>Y(S(Number(e.target.value),y,F,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===q?"h-1":"h-1.5")}),$&&
|
|
4
|
+
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:R&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&X()}),onFocus:R&&Z,className:`relative min-w-0 max-w-full shrink-0 ${Se.text}`,style:{position:"relative",width:Ne?.width??ke,...xe?{fontSize:xe.fontSize}:{}},children:[
|
|
5
5
|
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:ze.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===Fe?"":void 0,style:g,children:e},t))}),
|
|
6
|
-
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||
|
|
6
|
+
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||Y(e):se&&Y(null)},min:ae,max:ue,step:k,shiftStep:N,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:E,units:M,onBlur:R&&X,disabled:I,placeholder:B??(null!=K?K.toFixed(le):void 0),size:P,auto:re,"aria-label":A?J.slider.value(A):void 0,"aria-labelledby":A?void 0:O})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:J.settingView.auto})]})}export{k as Slider,F as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as a}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e,stepRounding as a}from"./chunk-63IGYBCQ.js";import{IconButton_default as t}from"./chunk-SV5RRBVA.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var s="h-3.5 w-3.5",l={padding:{top:/* @__PURE__ */n(r,{name:"padding-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(r,{name:"padding-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(r,{name:"padding-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(r,{name:"padding-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(r,{name:"padding-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(r,{name:"padding-left-right","aria-hidden":"true",className:s})},crop:{top:/* @__PURE__ */n(r,{name:"crop-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */n(r,{name:"crop-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */n(r,{name:"crop-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */n(r,{name:"crop-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */n(r,{name:"crop-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */n(r,{name:"crop-left-right","aria-hidden":"true",className:s})}},m=/* @__PURE__ */n(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var c=(e,a,t)=>null===e[t]?a[t]:String(e[t]);function h(e,a){const t=t=>c(e,a,t);return t("left")!==t("right")||t("top")!==t("bottom")}function p({label:t,value:r,onChange:i,each:s,placeholder:m,words:h,min:p=0,max:u=200,step:g=4,readOnly:f,glyphs:b="padding",units:N}){const v=l[b],x=(t,o,d)=>{const s=function(e,a){const t=a.map(a=>e[a]);return t.every(e=>e===t[0])?t[0]:"mixed"}(r,t),l=t.map(e=>c(r,m,e)),b="mixed"!==s&&l.every(e=>e===l[0])?l[0]:"–";/* @__PURE__ */
|
|
2
2
|
return n("div",{"data-side":t.join("-"),className:"min-w-0",children:/* @__PURE__ */n(e,{value:"mixed"===s?null:s,onChange:e=>((e,a)=>{const t={...r};for(const r of e)t[r]=a;i(t)})(t,e),min:p,max:u,step:g,snap:!0,...a(g),steppers:"compact",readOnly:f,placeholder:b,prefix:d,suffix:h.unit,units:N,"aria-label":o})})};/* @__PURE__ */
|
|
3
3
|
return n("div",{role:"group","aria-label":t,"data-sides":s?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,s?{children:[x(["left"],h.sides.left,v.left),x(["top"],h.sides.top,v.top),x(["right"],h.sides.right,v.right),x(["bottom"],h.sides.bottom,v.bottom)]}:{children:[x(["left","right"],h.horizontal,v.horizontal),x(["top","bottom"],h.vertical,v.vertical)]})})}function u({each:e,onChange:a,label:r,disabled:o}){/* @__PURE__ */
|
|
4
4
|
return n(i,{content:r,children:/* @__PURE__ */n(t,{size:"md","aria-label":r,"aria-pressed":e,disabled:o,onClick:()=>a(!e),children:m})})}export{u as SidesEachToggle,p as SidesInput,h as sidesStartEach};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-MWTCGJAI.js";import{Icon as l}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-MWTCGJAI.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),
|
|
3
|
+
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),I=c(null),C=c(l);C.current=l,s(()=>{if(j&&d)return j.report(S,()=>C.current,I.current)},[j,d,S]);const W=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
4
|
/* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
5
5
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
|
|
6
|
-
return m("button",1===k?{ref:
|
|
6
|
+
return m("button",1===k?{ref:I,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:W})}:{ref:I,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:W})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return h("div",{children:[
|
|
8
8
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-WN3JHPJI.js";import{Avatar as t}from"./chunk-24Y5JHIR.js";import{Input_default as a}from"./chunk-PT4GMPUB.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{jsxs as r,jsx as a}from"react/jsx-runtime";function n({title:n,message:s,description:d,hint:i,variant:m,frameless:c,icon:o,children:l}){const h=c?"none":m??"dashed",x="boolean"!=typeof o&&null!=o?o:null,p=!x&&(o??"card"!==h),u=t().emptyState,y=s??(n?void 0:u.message),f=d??i;/* @__PURE__ */
|
|
2
2
|
return r("div",{className:`flex flex-col items-center justify-center text-center ${"card"===h?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===h?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[x&&/* @__PURE__ */a("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:x}),p&&/* @__PURE__ */a(e,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),n&&/* @__PURE__ */a("h3",{className:"text-sm font-medium text-gray-900",children:n}),y&&/* @__PURE__ */a("p",{className:"text-sm text-gray-500 "+(n?"mt-2":""),children:y}),f&&/* @__PURE__ */a("p",{className:"text-xs text-gray-400 mt-1",children:f}),l&&/* @__PURE__ */a("div",{className:"mt-4",children:l})]})}export{n as EmptyState};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-WN3JHPJI.js";import{Avatar as t}from"./chunk-24Y5JHIR.js";import{ItemCount as r}from"./chunk-MWTCGJAI.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="12.28.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-7GJIIBJD.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{Z_LAYERS as m}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-JSHMIMAJ.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",D=e=>e.stopPropagation();function I({images:r,startIndex:y=0,onClose:I,onIndexChange:J,onOpenFile:U}){const $=h().lightbox,z=u(),A=p(null),F=p(null),[P,S]=x(y),W=r.length,Y=z&&W>0,G=b(e=>{if(W<2)return;const t=((P+e)%W+W)%W;S(t),J?.(t)},[P,W,J]);if(a(Y),l(A,Y,F),i(Y),k(()=>{if(Y)return f(()=>(I(),!0),()=>A.current)},[Y,I]),k(()=>{if(!Y)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Y,G]),!Y)return null;const L=r[Math.min(P,W-1)],M=j(L),O=L.caption||n(L.url);let Q;return Q="video"===M?/* @__PURE__ */v("video",{src:L.url,controls:!0,playsInline:!0,"aria-label":O,onClick:D,className:`${e} rounded-lg bg-black`}):"file"===M?/* @__PURE__ */w("div",{onClick:D,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
2
|
/* @__PURE__ */v(s,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:
|
|
4
|
-
/* @__PURE__ */w("div",{ref:
|
|
5
|
-
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:
|
|
6
|
-
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children
|
|
7
|
-
/* @__PURE__ */v("button",{ref:
|
|
8
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
9
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
10
|
-
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:
|
|
11
|
-
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:O}),U?/* @__PURE__ */v(c,{size:"sm",onClick:()=>U(L),children:$.openFile}):/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:d({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */v(t,{src:L.url,alt:O,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:A,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:I,children:[Q,
|
|
5
|
+
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:D,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:$.counter(P+1,W)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:F,type:"button",onClick:I,"aria-label":$.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(s,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),W>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(-1)},"aria-label":$.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(1)},"aria-label":$.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
+
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:D,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:O}),"file"!==M&&/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:$.openOriginal})]})]}),document.body)}export{I as ImageLightbox,j as lightboxKind};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as t,menuTextRowStyle as i,PopupSubmenu as l,itemLook as a,MenuCheckMark as n}from"./chunk-GOAFMGUI.js";import{jsx as r,jsxs as d}from"react/jsx-runtime";var s=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,o=(e,t)=>`${e}-status-${t}`;function c(e,t){return e.flatMap((e,i)=>"status"===e.type?[o(t,i)]:[]).join(" ")||void 0}var b={minHeight:"var(--space-32)",paddingTop:0,paddingBottom:0,paddingLeft:"var(--space-12)",paddingRight:"var(--space-12)"};function u(s,c){const{menuId:y,choose:m,toggle:p,followLink:h,rowProps:k=()=>({}),linkAs:f}=c,g=f??"a",v=(s,f)=>{if("divider"===s.type)/* @__PURE__ */
|
|
2
2
|
return r("div",{role:"separator",children:/* @__PURE__ */r(e,{})},s.key);if("label"===s.type)/* @__PURE__ */
|
|
3
3
|
return r("div",{id:`${y}-label-${f}`,children:/* @__PURE__ */r(t,{children:s.label})},s.key);if("status"===s.type)/* @__PURE__ */
|
|
4
4
|
return r("div",{id:o(y,f),className:"text-xs",style:i(),children:s.label},s.key);if("submenu"===s.type)/* @__PURE__ */
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-
|
|
1
|
+
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-G67CJAQ2.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-JSHMIMAJ.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,S]=c(!1),j=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:I,onDragOver:$,onDrop:A,onDragEnd:J,toggleColumn:P,resetColumns:R,draggedIdx:L,dropGap:T}=t(f,j),{hasAnyPerm:B}=r(),E=i().columns,[G,K]=c(!1),[M,O]=c(!1),[Q,U]=c(!1),W=m(null),Y=k.length>0&&B(k);e(W,h(()=>{G&&K(!1)},[G]));const F=C.reduce((e,t)=>e+t.width,0),H=C.map(e=>`${e.width}px`),V={tableLayout:"fixed",width:F,minWidth:"100%"},X=m(null),Z=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
|
|
2
2
|
return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
|
|
3
|
-
/* @__PURE__ */p("div",{ref:
|
|
4
|
-
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:
|
|
3
|
+
/* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
|
|
4
|
+
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:H[t]}},e.key))}),
|
|
5
5
|
/* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
|
|
6
|
-
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${
|
|
7
|
-
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),
|
|
8
|
-
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:
|
|
9
|
-
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:
|
|
10
|
-
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:
|
|
6
|
+
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${L===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>I(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>A(t,e),onDragEnd:a?void 0:J,style:a?void 0:{cursor:"grab"},children:[
|
|
7
|
+
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),T===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&T===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
|
|
8
|
+
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:Z,children:[
|
|
9
|
+
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
|
|
10
|
+
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:H[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
|
|
11
11
|
/* @__PURE__ */p("span",{children:b}),
|
|
12
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:
|
|
13
|
-
/* @__PURE__ */p("button",{onClick:
|
|
14
|
-
/* @__PURE__ */p("button",{onClick:()=>
|
|
15
|
-
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:
|
|
16
|
-
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>
|
|
12
|
+
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:W,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>S(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?E.hideSelection:E.showSelection,children:D?E.selectDone:E.select}),
|
|
13
|
+
/* @__PURE__ */p("button",{onClick:R,className:"text-2xs text-ink-faintest hover:text-gray-600",children:E.reset}),
|
|
14
|
+
/* @__PURE__ */p("button",{onClick:()=>K(!G),className:"text-gray-400 hover:text-gray-600",title:E.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),G&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
|
|
15
|
+
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:E.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
|
|
16
|
+
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>P(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),Y&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{O(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),U(!0),setTimeout(()=>U(!1),2e3)}catch{}O(!1)},disabled:M,className:"text-2xs w-full text-center py-1 rounded "+(Q?"text-green-600":"text-ink-faint hover:text-blue-600"),children:M?"...":Q?E.savedDefault:E.saveDefault})})]})]})]})]})}export{f as ResizableTable};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-K5YT5PMJ.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-JSHMIMAJ.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:M,id:D,className:L="",tone:J,tooltip:W,split:Y}){const[E,S]=m(!1),[$,G]=m(""),H=d(),I=h(null),T=h(null),B=h(null),F=s(I,E),A=e=>k.find(t=>t.value===e)?.label??e,K=p(()=>{const t=new Set(o),n=[],r=$.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,$]),P=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},Z=e=>{e&&!o.includes(e)?(y([...o,e]),G("")):G("")},z=e=>y(o.filter(t=>t!==e)),O=()=>{const e=$.trim();if(Y&&e)return P(e.split(Y)),void G("");j&&e?Z(e):G("")},U=h(()=>{});U.current=()=>{O(),S(!1)},f(()=>{if(!E)return;const e=e=>{const t=e.target;I.current?.contains(t)||B.current?.contains(t)||(O(),S(!1))};document.addEventListener("mousedown",e);const t=l(()=>U.current());return()=>{document.removeEventListener("mousedown",e),t()}});const q=k.length>0;/* @__PURE__ */
|
|
2
2
|
return g("div",{ref:I,className:"relative",children:[
|
|
3
|
-
/* @__PURE__ */g("div",{onMouseDown:e=>{
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:
|
|
5
|
-
/* @__PURE__ */x("input",{id:D,ref:
|
|
6
|
-
/* @__PURE__ */x("div",{ref:B,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:F?.left,right:F?.right,top:F?.top,bottom:F?.bottom,minWidth:F?.minWidth,maxWidth:F?.maxWidth??a,width:"max-content",visibility:F?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:F?.maxHeight??c},children:0===
|
|
3
|
+
/* @__PURE__ */g("div",{onMouseDown:e=>{M||e.target.closest("button")||(e.preventDefault(),T.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${M?"bg-gray-50 cursor-not-allowed":""} ${L}`}),children:[o.map(e=>{const t=J?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:A(e)}),!M&&/* @__PURE__ */x("button",{type:"button","aria-label":H.select.removeItem?.(A(e))??`${H.select.remove} ${A(e)}`,onClick:()=>z(e),className:n.remove,children:"×"})]},e),l=W?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
|
|
5
|
+
/* @__PURE__ */x("input",{id:D,ref:T,type:"text",autoComplete:"off",role:"combobox","aria-expanded":E&&q,"aria-invalid":C||void 0,disabled:M,value:$,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(Y){const t=e.split(Y);if(t.length>1)return P(t.slice(0,-1)),void G(t[t.length-1])}G(e)})(e.target.value),S(!0)},onFocus:()=>{!M&&q&&S(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=$.trim(),o=n?K.filter(t=>e(t,n.toLowerCase())):[];1===o.length?Z(o[0].value):O()}else"Backspace"===t.key&&""===$&&o.length>0?z(o[o.length-1]):"Escape"===t.key?(S(!1),G(""),T.current?.blur()):"Tab"===t.key&&(O(),S(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),E&&q&&v(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:B,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:F?.left,right:F?.right,top:F?.top,bottom:F?.bottom,minWidth:F?.minWidth,maxWidth:F?.maxWidth??a,width:"max-content",visibility:F?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:F?.maxHeight??c},children:0===K.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?H.select.allSelected:H.select.noMatches}):K.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),Z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
|
|
7
7
|
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
8
|
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{toast_default as n}from"./chunk-3YBXA72C.js";import{useShellStrings as r}from"./chunk-JSHMIMAJ.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
|
|
2
|
+
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[P,S]=s(0),[_,D]=s(1),[W,A]=s(!0),[L,$]=s(!0),O=i(x.loadFailed);O.current=x.loadFailed,l(()=>{let e=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(t=>{e||(j(t),S(t.numPages),$(!1))}).catch(()=>{e||(n.error(O.current),$(!1))}),()=>{e=!0}},[a,g,w]),l(()=>{if(!M||!W||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});D(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,W,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:_}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,_]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===d?x.fitPage:x.fitWidth,H="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */m(f,{children:[
|
|
5
5
|
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
|
-
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,
|
|
7
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(
|
|
6
|
+
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,P)}),
|
|
7
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(P,e+1)),disabled:E>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{A(!1),
|
|
10
|
-
/* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*
|
|
11
|
-
/* @__PURE__ */u("option",{value:"fit",children:
|
|
12
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{A(!1),
|
|
9
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{A(!1),D(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(A(!1),D(Number(t)/100)):A(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
|
|
11
|
+
/* @__PURE__ */u("option",{value:"fit",children:T}),!W&&!v.includes(Math.round(100*_))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*_),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{A(!1),D(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
13
|
/* @__PURE__ */u("button",{type:"button",onClick:()=>A(!0),"aria-pressed":W,className:H+(W?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
|
|
14
14
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const e=window.open("","_blank");if(!e)return void n.error(x.allowPopups);const t=[];for(let e=1;e<=
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const e=window.open("","_blank");if(!e)return void n.error(x.allowPopups);const t=[];for(let e=1;e<=P;e++)t.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(t).then(t=>{var n;e.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),e.document.write(t.map(e=>`<img src="${e}"/>`).join("")),e.document.write("</body></html>"),e.document.close(),setTimeout(()=>{e.print(),e.close()},300)})},className:H,children:[
|
|
16
16
|
/* @__PURE__ */u(e,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
|
|
17
17
|
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:H,children:[
|
|
18
18
|
/* @__PURE__ */u(e,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:H,children:[
|
|
19
19
|
/* @__PURE__ */u(e,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
|
|
20
|
-
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<
|
|
20
|
+
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<P?(e.preventDefault(),z(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<P&&(e.preventDefault(),z(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(P)))},children:L?/* @__PURE__ */u(t,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
21
|
/* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
|
|
22
22
|
/* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-JSHMIMAJ.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:M=280,innerRadius:k,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:F=!0,labels:S="none",labelMinShare:w=.04,className:A,emptyLabel:P}){const C=h().charts,W=c(),R=$??(e=>u(e,W)),z=I??C.other,E=P??C.nothingToBreakDown,T=d(),[V,_]=f(null),{highlighted:L}=a(),U=y(null),Y=r(U,Number.POSITIVE_INFINITY),B=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===B.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${A??""}`,children:E});const H=[...B].sort((e,t)=>t.value-e.value),J=H.slice(0,N),O=H.slice(N),Q=O.length>0?[...J,{key:"__other__",label:z,value:O.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:J,D=e=>i(e.slot,e.color,e.tone),Z=Q.reduce((e,t)=>e+t.value,0),q=Math.ceil(.62*Math.max(...Q.map(e=>String(e.label).length),4)*11)+24,X="outside"===S&&Y>=120+2*q,G=X?q:0,K=X?Math.max(120,Math.min(M,Y-2*G)):M,ee=K+2*G,te=G+K/2,le=K/2,ae=K/2-12,re=k??("ring"===v?.58*ae:0),ne=n(Q.length,b),oe=Math.max(...Q.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!X)return[];let e=-Math.PI/2;const t=Q.map((t,l)=>{const a="rose"===v?n(Q.length,b).step:t.value/Z*Math.PI*2,r="rose"===v?n(Q.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/Z,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=w),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==V?V!==e:null!==L&&L!==t,me=null!==V?Q[V]:void 0;/* @__PURE__ */
|
|
2
2
|
return g("div",{className:`relative ${A??""}`,ref:U,children:[
|
|
3
3
|
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":T,onMouseLeave:()=>_(null),children:[
|
|
4
4
|
/* @__PURE__ */p("title",{id:T,children:C.breakdown(R(Z),Q.length)}),Q.map((a,r)=>{const n=D(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/Z*Math.PI*2-b;"rose"!==v&&(ie+=a.value/Z*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
|
|
5
|
-
return p("path",{d:
|
|
5
|
+
return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:F?t.sweep:void 0,style:F?l(r,55):void 0,onMouseEnter:()=>_(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
|
|
6
6
|
return g("g",{children:[
|
|
7
7
|
/* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:s.grid,strokeWidth:1}),
|
|
8
8
|
/* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:s.label,textAnchor:e.right?"end":"start",children:e.label}),
|