efficient-shell 14.7.0 → 15.2.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 +3 -2
- package/dist/Browser-42QAXKYW.js +44 -0
- package/dist/Calculator-C7APPCLE.js +29 -0
- package/dist/CurrencyConverter-VFTDSYQ3.js +21 -0
- package/dist/{Files-EQBPHAUH.js → Files-OAVWF6EW.js} +68 -68
- package/dist/Notepad-LNNSVEFG.js +24 -0
- package/dist/PdfViewer-ADPTYOAO.js +1 -0
- package/dist/PomodoroTimer-AGSHX2JO.js +91 -0
- package/dist/{Preview-ZHZ4CEWF.js → Preview-GDNUQKGN.js} +40 -40
- package/dist/Sidebar-SWLVNJ6L.js +44 -0
- package/dist/{Stock-S3LKKT3K.js → Stock-NNDDNQBJ.js} +5 -5
- package/dist/{Weather-KEOJ3BBV.js → Weather-NGQALCXO.js} +19 -19
- package/dist/{WorldClock-GKMDG2KU.js → WorldClock-LX4BQPZJ.js} +7 -7
- package/dist/ai/index.js +118 -118
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.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/ChordChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/{chunk-P5J7G7OV.js → chunk-26I3OTGP.js} +1 -1
- package/dist/{chunk-RXCBSQA2.js → chunk-2M3KB4RH.js} +1 -1
- package/dist/chunk-2MUZFHZW.js +6 -0
- package/dist/{chunk-727NHWCZ.js → chunk-2QUACZ6O.js} +1 -1
- package/dist/{chunk-3ZJAQSFS.js → chunk-32HTOZFT.js} +3 -3
- package/dist/{chunk-OYQWBJ37.js → chunk-3CIJFWB4.js} +1 -1
- package/dist/chunk-3HPCQMYH.js +15 -0
- package/dist/{chunk-TBDILJ6G.js → chunk-3TVMQCYR.js} +1 -1
- package/dist/{chunk-MPC3CHAO.js → chunk-4H4HJIWI.js} +1 -1
- package/dist/chunk-52YTUQW3.js +2 -0
- package/dist/{chunk-DNPAYNNU.js → chunk-5JQCWXIQ.js} +1 -1
- package/dist/{chunk-5SQHRDFC.js → chunk-5R25GNE2.js} +2 -2
- package/dist/{chunk-T46I4YOI.js → chunk-6F3XQJR6.js} +1 -1
- package/dist/{chunk-G3TC2GIA.js → chunk-7FYTL6SD.js} +1 -1
- package/dist/{chunk-YX3JD6PA.js → chunk-7M7GKYHS.js} +5 -5
- package/dist/{chunk-HTBACICQ.js → chunk-7QFXUNFA.js} +6 -6
- package/dist/{chunk-XIX72C7K.js → chunk-7T6NWAPG.js} +1 -1
- package/dist/chunk-7YJBWOQG.js +2 -0
- package/dist/{chunk-WBUAO7T7.js → chunk-7ZJ7VK2N.js} +1 -1
- package/dist/{chunk-7WF6LFOJ.js → chunk-ABAUJLI4.js} +1 -1
- package/dist/{chunk-DBBOD5QW.js → chunk-ABRCV7DQ.js} +1 -1
- package/dist/{chunk-AH5MLH54.js → chunk-AVUH35GW.js} +1 -1
- package/dist/{chunk-GY7MJTIZ.js → chunk-BMZL5BHA.js} +1 -1
- package/dist/{chunk-QCLKRFL4.js → chunk-BN37AISA.js} +1 -1
- package/dist/{chunk-47BGAQWD.js → chunk-C5Q4AKXO.js} +1 -1
- package/dist/chunk-CIT4YPEO.js +8 -0
- package/dist/{chunk-JPVD3VS7.js → chunk-CMC25URA.js} +6 -6
- package/dist/{chunk-24BF22NF.js → chunk-D3L2QCGF.js} +1 -1
- package/dist/chunk-DTZDOXK3.js +19 -0
- package/dist/{chunk-UYUNREAL.js → chunk-DXTRHNP4.js} +3 -3
- package/dist/{chunk-ZA6ANC2D.js → chunk-ECZEJ6BE.js} +6 -6
- package/dist/chunk-EQDYCSUX.js +13 -0
- package/dist/{chunk-XNKNX5L3.js → chunk-FM5ASDVN.js} +1 -1
- package/dist/{chunk-RA5G4K3N.js → chunk-FYHUCRLU.js} +1 -1
- package/dist/{chunk-JU722M5V.js → chunk-FZZBBZXZ.js} +6 -6
- package/dist/{chunk-U75MSD4F.js → chunk-GBCLIWUQ.js} +1 -1
- package/dist/{chunk-NRX6JQV5.js → chunk-HBAATSUS.js} +1 -1
- package/dist/{chunk-EOYKUV2U.js → chunk-HKXP3JJ5.js} +1 -1
- package/dist/{chunk-6RU2PGQK.js → chunk-HMTZP7NJ.js} +1 -1
- package/dist/chunk-HVWRF7N4.js +23 -0
- package/dist/chunk-IBPJJO4N.js +28 -0
- package/dist/{chunk-7D2QZ6JA.js → chunk-IIUFCTT6.js} +1 -1
- package/dist/{chunk-EHNW3UNC.js → chunk-IJWRJPX6.js} +6 -6
- package/dist/{chunk-TFQC67XR.js → chunk-ILH7RDAD.js} +9 -9
- package/dist/{chunk-IVEM2BPC.js → chunk-J43RRDEP.js} +1 -1
- package/dist/{chunk-ION3XGLN.js → chunk-JE4BGFDJ.js} +1 -1
- package/dist/{chunk-P3XXFQG5.js → chunk-JFTLFF52.js} +3 -3
- package/dist/chunk-JHEHW5BE.js +5 -0
- package/dist/{chunk-EHPY3BFC.js → chunk-JJ5W4BRW.js} +1 -1
- package/dist/{chunk-U5OSLUDU.js → chunk-JVITCC65.js} +1 -1
- package/dist/{chunk-PTLVNC3V.js → chunk-K3OLOLFT.js} +6 -6
- package/dist/{chunk-I7WAOKU2.js → chunk-KKZXGWSX.js} +2 -2
- package/dist/chunk-KWBYE5MN.js +9 -0
- package/dist/{chunk-Y6FULJWJ.js → chunk-L664TIIV.js} +6 -6
- package/dist/{chunk-2RLWGWOU.js → chunk-LFGJUJRZ.js} +13 -13
- package/dist/{chunk-3L7BEEBW.js → chunk-LKNDLXL3.js} +1 -1
- package/dist/{chunk-EN3GYSCE.js → chunk-M4NT6HGJ.js} +1 -1
- package/dist/{chunk-NHALP3MW.js → chunk-M5JEYZ3A.js} +4 -4
- package/dist/chunk-M6ODRWTM.js +7 -0
- package/dist/chunk-M6T7N4SN.js +14 -0
- package/dist/{chunk-2TNG32QT.js → chunk-MDGM5NUO.js} +8 -8
- package/dist/chunk-MQERW3QR.js +3 -0
- package/dist/{chunk-LJS7UF3M.js → chunk-NBV3XK3Q.js} +2 -2
- package/dist/{chunk-2XDO7FZC.js → chunk-NJJG2VAW.js} +12 -12
- package/dist/chunk-NTVACRKD.js +4 -0
- package/dist/chunk-NXPIX7NO.js +2 -0
- package/dist/chunk-OCITNQGF.js +11 -0
- package/dist/{chunk-7OVMWXFM.js → chunk-OCKOZV46.js} +1 -1
- package/dist/{chunk-UGA5NGW4.js → chunk-OEZC5N6J.js} +1 -1
- package/dist/{chunk-EDRELF6L.js → chunk-PAD65HG7.js} +1 -1
- package/dist/{chunk-MKHOXO5O.js → chunk-PYGXSGXC.js} +1 -1
- package/dist/{chunk-BUUAALHH.js → chunk-QBR73AJX.js} +20 -20
- package/dist/{chunk-Y5RTVKMB.js → chunk-QI2LJ7OL.js} +9 -9
- package/dist/{chunk-DO6P6LYU.js → chunk-QIAJ3QNV.js} +1 -1
- package/dist/{chunk-4BRVZAIW.js → chunk-QJY52ZHG.js} +1 -1
- package/dist/{chunk-R36VZ35L.js → chunk-QMUW35QL.js} +6 -6
- package/dist/chunk-QQ6TGD7K.js +92 -0
- package/dist/chunk-QVGASI5H.js +9 -0
- package/dist/chunk-QZYV4TDD.js +1 -0
- package/dist/{chunk-XJK6VNXV.js → chunk-S3F2TY7X.js} +1 -1
- package/dist/chunk-S6IW2F4J.js +8 -0
- package/dist/chunk-SH7PJC4P.js +1 -0
- package/dist/{chunk-HAEZUUDT.js → chunk-SKPAIZSC.js} +3 -3
- package/dist/{chunk-Y5YVKUM4.js → chunk-SXNT73VT.js} +19 -19
- package/dist/chunk-T43ATI2N.js +6 -0
- package/dist/{chunk-4SFWQPOB.js → chunk-T65TAQLW.js} +7 -7
- package/dist/{chunk-DOJSWVBX.js → chunk-TB7BO2XS.js} +6 -6
- package/dist/{chunk-NC5FIFAY.js → chunk-TVMDDQJP.js} +1 -1
- package/dist/{chunk-GVAVIYE6.js → chunk-TWSROAS7.js} +1 -1
- package/dist/{chunk-EHSK43WG.js → chunk-UA7SWROJ.js} +8 -8
- package/dist/chunk-UMLXFQVC.js +1 -0
- package/dist/{chunk-6X32SWQI.js → chunk-VIBGF2HJ.js} +1 -1
- package/dist/{chunk-WYAKASF3.js → chunk-VNKLIWNQ.js} +1 -1
- package/dist/{chunk-2SOGTOUQ.js → chunk-VQ3OSYTA.js} +4 -4
- package/dist/{chunk-EEAOFYW5.js → chunk-VTYALYW4.js} +12 -12
- package/dist/chunk-WHHHECBC.js +2 -0
- package/dist/chunk-XQMVECQM.js +15 -0
- package/dist/{chunk-6AYAB5FN.js → chunk-YVI2XJCB.js} +5 -5
- package/dist/{chunk-ZEGCKIAL.js → chunk-YX4QGW7Z.js} +3 -3
- package/dist/chunk-Z2MP46QJ.js +1 -0
- package/dist/chunk-ZC2FZLYX.js +4 -0
- package/dist/{chunk-SP4S4HUJ.js → chunk-ZQWKVLSY.js} +13 -13
- package/dist/{chunk-5O4HMXPQ.js → chunk-ZS36DB4X.js} +2 -2
- package/dist/chunk-ZUQ72WER.js +7 -0
- package/dist/{chunk-IZ6D4KGR.js → chunk-ZYWLX5EK.js} +3 -3
- package/dist/{chunk-CXEELIRW.js → chunk-ZZKBCNK6.js} +9 -9
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ListToolbar.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.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/IconButton.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/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SearchInput.js +1 -1
- package/dist/forms/Segmented.d.ts +1 -1
- package/dist/forms/Segmented.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/icons/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +662 -662
- package/dist/map/index.js +10 -10
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/AppUpdateBanner.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.d.ts +4 -5
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.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/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.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/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/tokens/spacing.d.ts +4 -3
- package/dist/tokens/spacing.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +6 -4
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-HX3QY73A.js +0 -44
- package/dist/Calculator-TJDZOTG7.js +0 -29
- package/dist/CurrencyConverter-JL5JIVJG.js +0 -21
- package/dist/Notepad-5BQUYQNJ.js +0 -24
- package/dist/PdfViewer-FWGHFO4N.js +0 -1
- package/dist/PomodoroTimer-7W5ZHKUL.js +0 -91
- package/dist/Sidebar-2TYZENQL.js +0 -44
- package/dist/chunk-4DNPUG3T.js +0 -7
- package/dist/chunk-5IXCLPVZ.js +0 -1
- package/dist/chunk-A3VLZZHJ.js +0 -9
- package/dist/chunk-AJPQJ7TC.js +0 -6
- package/dist/chunk-ALZHFQRX.js +0 -4
- package/dist/chunk-AW7TOB6N.js +0 -1
- package/dist/chunk-CHDGSJLV.js +0 -8
- package/dist/chunk-DTFX624I.js +0 -8
- package/dist/chunk-EBODRYXS.js +0 -19
- package/dist/chunk-ERI63O4A.js +0 -28
- package/dist/chunk-FFPIT2LB.js +0 -3
- package/dist/chunk-GRZPIV2G.js +0 -14
- package/dist/chunk-HOPHOF2C.js +0 -2
- package/dist/chunk-HX5QSQ2C.js +0 -2
- package/dist/chunk-M5IZ7QLQ.js +0 -7
- package/dist/chunk-MEP6CZJ3.js +0 -2
- package/dist/chunk-MNZAAQLH.js +0 -15
- package/dist/chunk-MYH5H43C.js +0 -1
- package/dist/chunk-NDCS4COQ.js +0 -11
- package/dist/chunk-PWON7O3N.js +0 -9
- package/dist/chunk-RTK77DMP.js +0 -15
- package/dist/chunk-UZATF4OZ.js +0 -92
- package/dist/chunk-VUBDHFG5.js +0 -4
- package/dist/chunk-W4IH3BE3.js +0 -23
- package/dist/chunk-W6REY3SV.js +0 -5
- package/dist/chunk-Y7D2CZ4H.js +0 -13
- package/dist/chunk-ZSVU44OB.js +0 -6
- /package/dist/{chunk-5YTZBYG4.js → chunk-LPQQNPH5.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-EQDYCSUX.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-DTZDOXK3.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-JHEHW5BE.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-7YJBWOQG.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-NRHG4R2Q.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:O,className:j="",tidyAddress:F,addressAddon:E}=t,D=void 0!==t.onApply,$=u().link,T=y.isSafe??k,z=d(),A=c(null),Y=c(null),[Q,R]=p({url:n}),S=D?Q.url:n,[U,W]=p(!1),[B,H]=p(null),[K,P]=p(null),[G,M]=p(!1),X=c(null),Z=c(()=>{});Z.current=D?t.onCancel:()=>{},m(()=>{if(D)return s(e=>{const a=A.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(Z.current(),!0)},()=>A.current)},[D]),m(()=>{if(!D)return;const e=Y.current;e?(e.focus(),e.select()):A.current?.querySelector("button, input")?.focus()},[]);const J=o??[{value:b,label:$.address,target:{type:"text"}}],L=B&&B.against===S?B.kind:y.kindOf(S),V=J.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===L),q=V.find(e=>"text"===e.target.type),I=V.find(e=>e.value===L)??q??V[0];if(!I)return null;const _="text"!==I.target.type,ee=_?y.targetOf(S):S,ae=h(I.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:$.unavailable(e)}),re="select"===I.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(S):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=K&&K.against===S?K.text:S,se=_?S:F?F(oe.trim()).trim():oe.trim(),ue=D&&F?se:oe,de=!_&&""!==ue.trim()&&!T(ue),ce=de&&(!D||U);_&&G&&M(!1);const pe=(e,a)=>{D?R({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{H(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{W(!1);const a=e.trim();a?T(e)?(P({text:e,against:a}),me(a)):P({text:e,against:S}):(P({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===Y.current||X.current?.contains(a)))return;if(M(!1),D||!F||C)return;const l=F(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!D||!se)return;if(!_&&de)return void W(!0);const e=_&&Q.url===se?Q.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
+
return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
+
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===I.target.type)ke=/* @__PURE__ */f(r,{ref:Y,id:`${z}-address`,size:"sm",type:"text",invalid:ce,"aria-label":$.address,"aria-describedby":ce?`${z}-why`:void 0,placeholder:O??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>M(!0),onBlur:ge,onKeyDown:F&&!D?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===I.target.type?I.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):I.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:I.target.placeholder},...be(e,ee)];ke=xe(I.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe($.linkType,I.value,V.map(e=>({value:e.value,label:e.label})),e=>{P(null),W(!1);const a=V.find(a=>a.value===e);if(!a||"text"===a.target.type)return void H({kind:e,against:S});const l=h(a.target)[0];H({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&G&&!C&&"text"===I.target.type&&/* @__PURE__ */f("div",{ref:X,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe($.filter,ne?.param??"",[{value:"",label:$.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe($.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${z}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),I.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:I.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!D)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:A,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:A,role:"dialog","aria-label":N??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${z}-address`,className:a({inline:!0}),children:$.title}),ye,
|
|
6
|
+
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:$.remove}):null,
|
|
7
|
+
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>Z.current(),children:$.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),O=d(),j=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
|
+
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
+
/* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
|
+
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?O:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
|
+
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
|
|
14
|
+
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:O,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{y as LinkPicker,w as TextLinkField};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{ResizableTable as n}from"./chunk-
|
|
2
|
-
return x(a,{title:
|
|
3
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{ResizableTable as n}from"./chunk-T65TAQLW.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-U73K3ICC.js";import{ListLoadError as a}from"./chunk-OCKOZV46.js";import{LoadingSpinner as c}from"./chunk-4PJFL26P.js";import{PopupMenu as s,PopupMenuLabel as d,PopupMenuItem as h,PopupMenuDivider as m}from"./chunk-3HPCQMYH.js";import{keepsNativeMenu as u}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import{shellHttp as f}from"./chunk-STKJA4PV.js";import{toast_default as g}from"./chunk-I2NVBDKH.js";import{useShellStrings as y}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:R,isLoading:L,emptyState:N,totalCount:T,isError:$,onRetry:A,errorTitle:K,errorMessage:P,tableId:M,columns:E,renderCell:F,getRowId:H=e=>e.id,sort:I,onSort:U,selected:D,setSelected:O,onRowClick:J,onRowHover:Q,getRowClassName:V,footerLabel:W,footerExtra:B,footerExtraAfter:Z,sentinelRef:_,isFetchingNextPage:G,saveDefaultPerms:Y,exportEndpoint:z,exportFilename:X="export.csv",contextActions:q}=S,[ee,te]=k(null),ne=b(null),re=y(),oe=re.entityList,le=e=>{O(t=>{const n=new Set(t),r=H(e);return n.has(r)?n.delete(r):n.add(r),n})},ie=()=>{O(e=>{const t=R.map(H),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ae=r(R,J,le,ie,(e,t)=>{O(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(H(R[n]));return r})},ne),ce=R.filter(e=>D.has(H(e))),se=()=>{const e=[...ne.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=R[Number(e.dataset.rowIdx)];return void 0!==t&&D.has(H(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(E.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{te(null);const{header:t,body:n}=se();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(oe.copiedRows(n.length),r,l)},he=async()=>{te(null);const e=ce.map(H);if(!e.length||!z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(E.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${M}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return E.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=z.includes("?")?"&":"?";try{const n=await f.get(`${z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=X,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void g.notify(Number.isFinite(a)?oe.exportTruncated(a,e.length):oe.exportTruncatedUnknown(e.length));g.success(oe.exported(e.length))}catch{g.error(oe.exportFailed)}};if(L)/* @__PURE__ */return x(c,{});if($&&0===R.length)/* @__PURE__ */
|
|
2
|
+
return x(a,{title:K,message:P,onRetry:A});if(0===R.length)/* @__PURE__ */return x(w,{children:N});const me=R.length>0&&ce.length===R.length,ue=ce.length>0&&!me,pe=D.size-ce.length,fe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":re.table.selectAll,checked:me,indeterminate:ue,onChange:ie,style:{height:14,width:14}})},...E],ge=/* @__PURE__ */x(i,{selectedCount:ce.length,hiddenSelectedCount:pe,loadedCount:R.length,totalCount:T,label:W,isFetchingMore:G,extra:B,extraAfter:Z}),ye=_?/* @__PURE__ */C(w,{children:[
|
|
3
|
+
/* @__PURE__ */x("div",{ref:_}),G&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0!==T&&T>R.length;ke=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
|
|
4
4
|
/* @__PURE__ */x(d,{children:pe>0?re.list.selectedNotShown(a,pe):re.list.selected(a)}),
|
|
5
|
-
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),
|
|
5
|
+
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),J(r)},children:oe.open}),
|
|
6
6
|
/* @__PURE__ */x(m,{}),o&&/* @__PURE__ */x(h,{onClick:()=>{c(),e(oe.copiedText,o.text,o.html)},children:oe.copy}),l&&/* @__PURE__ */x(h,{onClick:()=>(t=>{te(null);const{keys:n,body:r}=se(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:oe.copyColumn(l.label)}),
|
|
7
7
|
/* @__PURE__ */x(h,{disabled:0===a,onClick:de,children:oe.copyRows(a)}),z&&/* @__PURE__ */x(h,{onClick:he,children:oe.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(m,{}),
|
|
8
8
|
/* @__PURE__ */x(h,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ce)},children:e.label})]},t)),
|
|
9
|
-
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),O(e=>/* @__PURE__ */new Set([...e,...R.map(
|
|
10
|
-
/* @__PURE__ */x(h,{onClick:()=>{c(),O(/* @__PURE__ */new Set)},children:oe.clearSelection}),
|
|
9
|
+
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),O(e=>/* @__PURE__ */new Set([...e,...R.map(H)]))},children:u?oe.selectAllLoaded(R.length):oe.selectAll}),
|
|
10
|
+
/* @__PURE__ */x(h,{onClick:()=>{c(),O(/* @__PURE__ */new Set)},children:oe.clearSelection}),A&&/* @__PURE__ */x(h,{onClick:()=>{c(),A()},children:oe.refresh})]})}
|
|
11
11
|
/* @__PURE__ */
|
|
12
12
|
return C("div",{className:"flex-1 flex flex-col bg-surface overflow-hidden",children:[
|
|
13
|
-
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:
|
|
14
|
-
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":
|
|
13
|
+
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:M,columns:fe,sort:I,onSort:U,footer:ge,afterBody:ye,saveDefaultPerms:Y,children:e=>/* @__PURE__ */x("tbody",{ref:ne,children:R.map((n,r)=>{const o=H(n);/* @__PURE__ */
|
|
14
|
+
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":(r%2==1?"bg-row-stripe ":"")+"hover:bg-line"} ${V?.(n)??""}`,onClick:()=>J(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||u(e.target))return;e.preventDefault();const r=H(n);D.has(r)||O(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?E.find(e=>e.key===o)?.label:void 0;te({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:Q?()=>Q(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":re.table.selectRow,checked:D.has(o),onChange:()=>le(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):F(n,e.key)},e.key))},o)})})})}),ke]})}export{S as EntityList};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-M6ODRWTM.js";import{Button_default as i}from"./chunk-7YJBWOQG.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as r}from"./chunk-2MUZFHZW.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:W,menuFooterLabel:C,align:M="end",side:O="bottom",menuMinWidth:R,linkAs:z,block:D=!1,className:F=""},I){const L=g&&(null!=N&&""!==N&&!1!==N)&&!v,Y=x&&null!=j&&""!==j&&!1!==j,$=o(),A=/* @__PURE__ */t(i,{ref:I,type:b,variant:f,size:p,loading:v,leftIcon:k,block:D,disabled:g&&!L,"aria-disabled":!!L||void 0,disabledReason:L?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),B=D?"relative flex min-w-0 flex-1":"relative inline-flex",P=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[D?"flex w-full":"inline-flex","items-stretch",F].filter(Boolean).join(" "),children:[null==w||""===w||L?A:/* @__PURE__ */t(r,{content:w,className:B,children:A}),
|
|
3
|
+
/* @__PURE__ */t(r,{content:Y?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":Y?$:void 0,items:h,align:M,side:O,minWidth:R,linkAs:z,disabled:x&&!Y,"aria-disabled":Y,onOpenChange:y,footer:W,footerLabel:C,triggerClassName:a({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(n,{name:"chevron-down",className:P,strokeWidth:2,"aria-hidden":"true"})})}),Y&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useWindowMenuItem as e,Modal as t}from"./chunk-
|
|
1
|
+
import{useWindowMenuItem as e,Modal as t}from"./chunk-QQ6TGD7K.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-Z2MP46QJ.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-NRHG4R2Q.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.5.1",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.1",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,Q]=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"}),Q]}),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,6 +1,6 @@
|
|
|
1
|
-
import{Dialog as e}from"./chunk-
|
|
2
|
-
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function
|
|
3
|
-
return m(p.Provider,{value:
|
|
1
|
+
import{Dialog as e}from"./chunk-T43ATI2N.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-NRHG4R2Q.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),P=t({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
|
|
2
|
+
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function T({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),T=a(null),F=a(0),E=a([]),$=a(null),D=a(null),R=u(e=>{T.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),W=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++F.current,options:r,resolve:e};null===T.current?R(n):E.current.push(n)})},[R]),[H,I]=c(!1),[K,Q]=c({message:""}),[S,V]=c(""),Y=a(),Z=u(e=>(Q(e),V(""),I(!0),new Promise(e=>{Y.current=e})),[]),[A,B]=c(!1),[G,J]=c({}),[O,U]=c(""),q=a(),z=u(e=>{const r="string"==typeof e?{message:e}:e;return J(r),U(r.defaultValue??""),B(!0),new Promise(e=>{q.current=e})},[]);d(()=>{b=W,y=Z,N=z},[W,Z,z]);const M=(e,r)=>{if(T.current!==e)return;const n=k.current,t=E.current.shift();t?R(t):(T.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{I(!1),V(""),Y.current?.(e)},_=e=>{if(e){const e=O.trim();if(!e&&!G.allowEmpty)return B(!1),void q.current?.(null);B(!1),q.current?.(e)}else B(!1),q.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===K.variant?"warning":"danger"],te=K.confirmWord,oe=null==te||S===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
|
|
3
|
+
return m(p.Provider,{value:W,children:[r,
|
|
4
4
|
/* @__PURE__ */h(e,{open:t,onClose:()=>M(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
|
|
5
5
|
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>M(v,!1),className:C,children:s.cancelLabel||le.cancel}),
|
|
6
6
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>M(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
@@ -8,17 +8,17 @@ return m(p.Provider,{value:S,children:[r,
|
|
|
8
8
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
9
9
|
/* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
|
|
10
10
|
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
|
|
11
|
-
/* @__PURE__ */h(e,{open:
|
|
12
|
-
/* @__PURE__ */h("button",{ref:D,type:"button",onClick:()=>X(!1),className:C,children:
|
|
13
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??
|
|
11
|
+
/* @__PURE__ */h(e,{open:H,onClose:()=>X(!1),initialFocus:null!=te?void 0:D,footer:/* @__PURE__ */m(f,{children:[
|
|
12
|
+
/* @__PURE__ */h("button",{ref:D,type:"button",onClick:()=>X(!1),className:C,children:K.cancelLabel||le.destructiveCancel}),
|
|
13
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??K.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
14
14
|
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
15
15
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
16
|
-
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:
|
|
17
|
-
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:
|
|
16
|
+
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:K.title||le.destructiveTitle}),
|
|
17
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:K.message}),null!=te&&/* @__PURE__ */m(f,{children:[
|
|
18
18
|
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
19
19
|
/* @__PURE__ */h("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:te}),se]}),
|
|
20
|
-
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:
|
|
21
|
-
/* @__PURE__ */m(e,{open:
|
|
20
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:S,onChange:e=>V(e.target.value),onKeyDown:e=>{"Enter"===e.key&&S===te&&X(!0)},placeholder:te,className:`mt-2 ${L} focus:border-red-500`})]})]})]})}),
|
|
21
|
+
/* @__PURE__ */m(e,{open:A,onClose:()=>_(!1),title:G.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
|
|
22
22
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:G.cancelLabel||le.cancel}),
|
|
23
|
-
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!G.allowEmpty&&!
|
|
24
|
-
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:
|
|
23
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!G.allowEmpty&&!O.trim(),className:P,children:G.confirmLabel||le.ok})]}),children:[G.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:G.message}),
|
|
24
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:O,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:G.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{T as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-EFKJLUYP.js";import{Tooltip as r}from"./chunk-2MUZFHZW.js";import{useRowControlSize as s}from"./chunk-UMLXFQVC.js";import{useId as o}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function c({value:c,onChange:d,options:b,name:u,size:m="md",block:h=!1,label:p,className:v="","aria-labelledby":f,"aria-describedby":g}){const N=s(m)??"md",k={"aria-label":f?void 0:p,"aria-labelledby":f,"aria-describedby":g},y=o(),j=e(h,v),C=l(h);/* @__PURE__ */
|
|
2
|
+
return n("div",u?{role:"radiogroup",...k,className:j,children:b.map(e=>{const l=`${y}-${e.value}`,s=e.value===c,o=/* @__PURE__ */t("label",{htmlFor:l,className:i({size:N,selected:s,disabled:e.disabled,block:h}),children:[
|
|
3
|
+
/* @__PURE__ */n("input",{id:l,type:"radio",name:u,value:e.value,checked:s,disabled:e.disabled,"aria-describedby":e.title?`${l}-note`:void 0,onChange:()=>d(e.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
|
|
4
|
+
/* @__PURE__ */n(a,{icon:e.icon,label:e.label}),e.title&&/* @__PURE__ */n("span",{id:`${l}-note`,className:"sr-only",children:e.title})]},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:C,children:o},e.value):o})}:{role:"group",...k,className:j,children:b.map(e=>{const l=e.value===c,s=/* @__PURE__ */n("button",{type:"button","aria-pressed":l,disabled:e.disabled,onClick:()=>d(e.value),className:i({size:N,selected:l,disabled:e.disabled,block:h}),children:/* @__PURE__ */n(a,{icon:e.icon,label:e.label})},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:C,children:s},e.value):s})})}export{c as Segmented};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{RowControlSizeContext as r}from"./chunk-UMLXFQVC.js";import{jsx as e}from"react/jsx-runtime";function i({children:i,className:t=""}){/* @__PURE__ */
|
|
2
|
+
return e("div",{"data-list-toolbar":"",className:`flex min-h-(--row-height-window-bar) shrink-0 flex-wrap items-center gap-2 border-b border-line px-3 py-2 ${t}`.trim(),children:/* @__PURE__ */e(r.Provider,{value:"md",children:i})})}export{i as ListToolbar};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as n,mediaFileName as r}from"./chunk-4H4HJIWI.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as s}from"./chunk-7YJBWOQG.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{createShellPortal as m}from"./chunk-52YTUQW3.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-KEFNQEXZ.js";import{buttonClasses as f}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-NRHG4R2Q.js";import{useRef as x,useState as k,useCallback as b,useEffect as g}from"react";import{jsx as v,jsxs as N,Fragment as w}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:n(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)]",W=e=>e.stopPropagation();function I({images:n,startIndex:y=0,onClose:I,onIndexChange:Q,onOpenFile:U}){const Y=p().lightbox,D=d(),$=x(null),z=x(null),[F,G]=k(y),J=n.length,O=D&&J>0,R=b(e=>{if(J<2)return;const t=((F+e)%J+J)%J;G(t),Q?.(t)},[F,J,Q]);if(a(O),l($,O,z),i(O),g(()=>{if(O)return h(()=>(I(),!0),()=>$.current)},[O,I]),g(()=>{if(!O)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),R("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[O,R]),!O)return null;const A=n[Math.min(F,J-1)],E=j(A),L=A.caption||r(A.url);let Z;return Z="video"===E?/* @__PURE__ */v("video",{src:A.url,controls:!0,playsInline:!0,"aria-label":L,onClick:W,className:`${e} rounded-lg bg-black`}):"file"===E?/* @__PURE__ */N("div",{onClick:W,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
|
+
/* @__PURE__ */v(c,{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:L}),U?/* @__PURE__ */v(s,{size:"sm",onClick:()=>U(A),children:Y.openFile}):/* @__PURE__ */v("a",{href:A.url,target:"_blank",rel:"noopener noreferrer",className:f({size:"sm"}),children:Y.openFile})]}):/* @__PURE__ */v(t,{src:A.url,alt:L,className:`${e} object-contain`,frameClassName:"rounded-lg"}),m(
|
|
4
|
+
/* @__PURE__ */N("div",{ref:$,...o({role:"dialog",modal:!0,label:Y.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:I,children:[Z,
|
|
5
|
+
/* @__PURE__ */N("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:W,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:Y.counter(F+1,J)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:z,type:"button",onClick:I,"aria-label":Y.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(c,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),J>1&&/* @__PURE__ */N(w,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{W(e),R(-1)},"aria-label":Y.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(c,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{W(e),R(1)},"aria-label":Y.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(c,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
+
/* @__PURE__ */N("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:W,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:L}),"file"!==E&&/* @__PURE__ */v("a",{href:A.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:Y.openOriginal})]})]}),document.body)}export{I as ImageLightbox,j as lightboxKind};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Button_default as e}from"./chunk-
|
|
1
|
+
import{Button_default as e}from"./chunk-7YJBWOQG.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
|
|
2
2
|
return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
3
3
|
/* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
4
4
|
/* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-DTZDOXK3.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-JHEHW5BE.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-PAD65HG7.js";import{Button_default as l}from"./chunk-7YJBWOQG.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-7FYTL6SD.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
|
|
2
2
|
return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
3
3
|
/* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{OneLineLabel as t}from"./chunk-
|
|
1
|
+
import{OneLineLabel as t}from"./chunk-7FYTL6SD.js";import{createContext as s,useContext as a,useCallback as r}from"react";import{jsx as o}from"react/jsx-runtime";var e="inline-flex max-w-full items-center whitespace-nowrap rounded-full",n={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},u={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function i(t,s="subtle"){return"solid"===s?u[t]:n[t]}var l=s({}),c=s(void 0);function d(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function v({groups:t,labelFor:s,children:a}){/* @__PURE__ */
|
|
2
2
|
return o(l.Provider,{value:t,children:/* @__PURE__ */o(c.Provider,{value:s,children:a})})}function f(){const t=a(c);return r(s=>t?.(s)??d(s),[t])}function g({status:s,label:r,emphasis:n="subtle"}){const u=i(a(l)[s]??"neutral",n),v=a(c),f=r??v?.(s)??d(s);/* @__PURE__ */
|
|
3
3
|
return o("span",{className:`${e} px-3 py-0.5 text-xs font-medium ${u}`,children:/* @__PURE__ */o(t,{children:f})})}export{e as BADGE_PILL,n as GROUP_COLORS,u as GROUP_COLORS_SOLID,g as StatusBadge,v as StatusBadgeProvider,i as groupColors,d as statusLabel,f as useStatusLabel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-
|
|
1
|
+
import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-J43RRDEP.js";import{Tooltip as o}from"./chunk-2MUZFHZW.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
|
|
2
2
|
return t("div",{id:f,role:"radiogroup","aria-label":s,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-line bg-gray-200 ${g}`.trim(),children:c.map((a,n)=>{const s=d===a.value,f=b||!0===a.disabled,g=f&&(!0===a.disabled&&a.title||(b?v:void 0))||void 0,p=`${h}-${n}`,x=/* @__PURE__ */t("button",{type:"button",role:"radio","aria-checked":s,"aria-label":a.label,"aria-disabled":f||void 0,"aria-describedby":r(void 0,g?p:void 0),ref:e=>{m.current[n]=e},tabIndex:n===w?0:-1,onKeyDown:e=>((e,r)=>{const i=l[r.key];if(!i)return;r.preventDefault();const o=Math.floor(e/3)+i[0],a=e%3+i[1];if(o<0||a<0||a>=3)return;const n=3*o+a;if(n>=c.length)return;m.current[n]?.focus();const t=c[n];b||!0===t.disabled||t.value===d||u(t.value)})(n,e),onClick:f?e:()=>u(a.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(s?"bg-accent-tint hover:bg-blue-100":"bg-surface hover:bg-row-hover"),children:a.icon?/* @__PURE__ */t("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(s?"text-blue-700":"text-ink-faint group-hover:text-gray-700"),children:a.icon}):/* @__PURE__ */t("span",{"data-dot":"","aria-hidden":"true",className:s?"size-3 rounded-sm bg-accent-fill":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},a.value);return g?/* @__PURE__ */t(i,{reason:g,id:p,block:!0,children:x},a.value):/* @__PURE__ */t(o,{content:a.title??a.label,className:"relative flex",children:x},a.value)})})}export{s as AlignmentGrid};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{fitBoxScale as
|
|
2
|
-
/* @__PURE__ */
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{createShellPortal as n}from"./chunk-52YTUQW3.js";import{fitBoxScale as r,fitScale as a}from"./chunk-M6UKCZHT.js";import{toast_default as o}from"./chunk-I2NVBDKH.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{createContext as s,useContext as l,useRef as c,useState as d,useEffect as u}from"react";import*as h from"pdfjs-dist";import{jsx as m,jsxs as p}from"react/jsx-runtime";function f(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 g=s(null);function w({children:e}){const t=l(g);return t?n(e,t):
|
|
2
|
+
/* @__PURE__ */m("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||h.GlobalWorkerOptions.workerSrc||(h.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${h.version}/build/pdf.worker.min.mjs`);var y={"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},v=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=y[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 f(n,t,a);return a}};function b(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:v}}var x=[50,75,100,125,150,200,300,400];function k(e,t,n){const o={width:t.width-40,height:t.height-40};if(o.width<=0||"page"===e&&o.height<=0)return.3;const i="page"===e?r(o,n):a(o.width,n.width);return Math.min(Math.max(i,.3),4)}function C({url:n,filename:r,fit:a="width",onDownload:s,onEmail:l,workerSrc:f,wasmUrl:g}){const y=i().pdf,v=c(null),C=c(null),N=c(null),[j,M]=d(null),[E,P]=d(1),[z,D]=d(0),[_,S]=d(1),[W,T]=d(!0),[L,$]=d(!0),O=c(y.loadFailed);O.current=y.loadFailed,u(()=>{let e=!1;return $(!0),P(1),f&&(h.GlobalWorkerOptions.workerSrc=f),h.getDocument({url:n,...b(g)}).promise.then(t=>{e||(M(t),D(t.numPages),$(!1))}).catch(()=>{e||(o.error(O.current),$(!1))}),()=>{e=!0}},[n,f,g]),u(()=>{if(!j||!W||!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=k(a,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});S(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[j,E,W,a]),u(()=>{if(!j||!v.current)return;let e=!1,t=null,n=null;return j.getPage(E).then(r=>{if(e||!v.current)return;const a=r.getViewport({scale:_}),o=v.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 h.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,_]),u(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===a?y.fitPage:y.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 p("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */p(w,{children:[
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */p("select",{value:W?"fit":x.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */p("button",{type:"button",onClick:()=>{if(!j)return;const e=window.open("","_blank");if(!e)return void
|
|
16
|
-
/* @__PURE__ */
|
|
5
|
+
/* @__PURE__ */m("button",{type:"button","aria-label":y.previousPage,onClick:()=>P(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__ */m(e,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
|
+
/* @__PURE__ */m("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(E,z)}),
|
|
7
|
+
/* @__PURE__ */m("button",{type:"button","aria-label":y.nextPage,onClick:()=>P(e=>Math.min(z,e+1)),disabled:E>=z,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */m(e,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */m("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
|
+
/* @__PURE__ */m("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{T(!1),S(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */m("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */p("select",{value:W?"fit":x.includes(Math.round(100*_))?Math.round(100*_):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(T(!1),S(Number(t)/100)):T(!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":y.zoom,title:y.zoom,children:[
|
|
11
|
+
/* @__PURE__ */m("option",{value:"fit",children:A}),!W&&!x.includes(Math.round(100*_))&&/* @__PURE__ */p("option",{value:"custom",children:[Math.round(100*_),"%"]}),x.map(e=>/* @__PURE__ */p("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
|
+
/* @__PURE__ */m("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{T(!1),S(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */m("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>T(!0),"aria-pressed":W,className:H+(W?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
|
|
14
|
+
/* @__PURE__ */m("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
|
+
/* @__PURE__ */p("button",{type:"button",onClick:()=>{if(!j)return;const e=window.open("","_blank");if(!e)return void o.error(y.allowPopups);const t=[];for(let e=1;e<=z;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=r,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
|
+
/* @__PURE__ */m(e,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),y.print]}),
|
|
17
17
|
/* @__PURE__ */p("button",{type:"button",onClick:s??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:H,children:[
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */m(e,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),y.download]}),l&&/* @__PURE__ */p("button",{type:"button",onClick:l,className:H,children:[
|
|
19
|
+
/* @__PURE__ */m(e,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),y.email]})]}),
|
|
20
|
+
/* @__PURE__ */m("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<z?(e.preventDefault(),P(e=>Math.min(z,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!j)return;if(e.defaultPrevented)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<z&&(e.preventDefault(),P(e=>Math.min(z,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),P(1)):"End"===e.key&&(e.preventDefault(),P(z)))},children:L?/* @__PURE__ */m(t,{size:"sm",padding:"",className:"h-full",label:y.loading}):/* @__PURE__ */p("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
|
+
/* @__PURE__ */m("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__ */p("div",{className:"relative shadow-lg rounded",children:[
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */m("canvas",{ref:v,className:"block rounded"}),
|
|
24
|
+
/* @__PURE__ */m("div",{ref:C,className:"preview-pdf-textlayer",onPointerDown:e=>e.currentTarget.classList.add("selecting")})]})]})})]})}export{w as PanelActions,C as PdfViewer,g as ToolbarSlotContext,k as pageFitScale,b as pdfWasmParams};
|
|
@@ -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-4H4HJIWI.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-TNGIXSTM.js";import{ColoredBadge as u}from"./chunk-VIBGF2HJ.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-2MUZFHZW.js";import{useShellStrings as h}from"./chunk-NRHG4R2Q.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:K,dropType:I,onDropData:C,label:A,hint:F,error:S,required:H,className:O,accept:P="image/*",maxSizeBytes:z,maxFiles:L,fit:M="cover",thumbSize:R=96,placeholder:$,cta:E,acceptHint:W,showCover:B=!1,coverLabel:G,busy:Q=!1,busyLabel:q,progress:J,disabled:U=!1,readOnly:V=!1,selected:Z,onItemClick:X,onItemDoubleClick:Y,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=E??te.cta,ae=G??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=U||Q,de=!(!k&&!N||se||V),ce=!!w&&!se&&!V,ue=!!j&&!se&&!V,me=!!T&&!U&&!ue,pe=!(!I||!C||se||V),fe=t(se),he=$??r(P,te),ge=d({accept:P,maxSizeBytes:z,maxFiles:L,acceptHint:W,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(I),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(I);t&&C(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:R,height:R},Te=null==Z?null:new Set(Z),Ke=!!X,Ie=R<112,Ce=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,P),a=e.name??o(e.url),n=B&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Ke?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Te?Te.has(e.id):void 0,onClick:Ke?t=>{t.target.closest?.("button")||X(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:Y?()=>Y(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);K?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&K?t=>K("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||Ke?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Ke?a:void 0,onKeyDown:Ke&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),X(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":"",Ke?"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:M}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:M}}),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:Ie?
|
|
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)},Ae=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})]}),Fe=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:R+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}),
|
|
11
|
-
return v(e,{label:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Te||void 0,"aria-label":"string"==typeof
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),W&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:W})]}):/* @__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:R+32},children:/* @__PURE__ */x("span",{className:Q?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:A,labelId:A?`${le}-label`:void 0,htmlFor:le,hint:F,error:S,required:H,className:O,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":A?`${le}-label`:void 0,"aria-describedby":S?`${le}-error`:F?`${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?Fe:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ke?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Te||void 0,"aria-label":"string"==typeof A?A:te.files,className:"contents",children:p.map(Ce)}):p.map(Ce),Ae]}),Q&&/* @__PURE__ */x(l,{label:ne,progress:J})]}),!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,4 +1,4 @@
|
|
|
1
|
-
import{StatCard as e,Card as a}from"./chunk-RKSCB5BJ.js";import{Sparkline as t}from"./chunk-CKCDGSTC.js";import{PieChart as r}from"./chunk-6EGZ4PV4.js";import{Avatar as s}from"./chunk-SCNQK5NF.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-
|
|
1
|
+
import{StatCard as e,Card as a}from"./chunk-RKSCB5BJ.js";import{Sparkline as t}from"./chunk-CKCDGSTC.js";import{PieChart as r}from"./chunk-6EGZ4PV4.js";import{Avatar as s}from"./chunk-SCNQK5NF.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-PAD65HG7.js";import{Button_default as c}from"./chunk-7YJBWOQG.js";import{TH_ONE_LINE as n}from"./chunk-7FYTL6SD.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
|
|
2
2
|
return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */m("div",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-OSMRYND3.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-OSMRYND3.js";import{Button_default as t}from"./chunk-7YJBWOQG.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return f(
|
|
3
|
-
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:
|
|
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
|
|
5
|
-
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:
|
|
6
|
-
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-KKZXGWSX.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-2MUZFHZW.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.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 F=o(null);function z({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(F.Provider,{value:i,children:e})}function k({value:o,onChange:a,min:y,max:z,step:k=1,shiftStep:N,precision:L,inputMin:R,inputMax:j,suffix:E,units:K,onCommit:M,showInput:$=!0,emptyLabel:C,placeholderValue:W,stepFrom:B,label:A,"aria-labelledby":H,valueText:O,id:P,disabled:U,size:V="md",boxSize:q="sm",className:D="",auto:G}){const Z=i(),I=u(),T=s(o);r(()=>{T.current=o},[o]);const X=s(o),J=e=>{T.current=e,a(e)},Q=()=>{X.current=T.current},Y=()=>{M&&T.current!==X.current&&(X.current=T.current,M(T.current))},_=s(null),ee=s(Y);ee.current=Y;const te=Boolean(M);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=G??ne,ie=u(),oe=P??I,le=L??h(k),ae=R??y,ue=j??z,se=void 0!==C||void 0!==W,ce=B??W,de=p(o??W??y,y,z),fe=[y.toFixed(le),z.toFixed(le),o?.toFixed(le),C,W?.toFixed(le)],me=null!=o?o.toFixed(le):C||(null!=W?W.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,$,q]),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=>O?O(e):"string"==typeof E?`${e.toFixed(le)} ${E}`:void 0,we=null==o?C??(null!=W?ye(W)??String(W):void 0):ye(o),Se=x[q],Fe=fe.filter(e=>Boolean(e)),ze=void 0===me?-1:Fe.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(F),Le=u(),Re=Ne?.set;return r(()=>{Re&&Re(Le,$?ke:null)},[Re,Le,ke,$]),c(()=>()=>Re?.(Le,null),[Re,Le]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${D}`.trim(),style:v,children:[
|
|
3
|
+
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:k,value:de,disabled:U,"aria-label":H?void 0:A,"aria-labelledby":H,"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();J(S((o??ce??de)+t*(n?N??k:k),y,z,le)),Y()},ref:_,onFocus:M&&Q,onPointerDown:M&&Q,onChange:e=>J(S(Number(e.target.value),y,z,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===V?"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:M&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&Y()}),onFocus:M&&Q,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
|
+
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:Fe.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===ze?"":void 0,style:g,children:e},t))}),
|
|
6
|
+
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||J(e):se&&J(null)},min:ae,max:ue,step:k,shiftStep:N,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:E,units:K,onBlur:M&&Y,disabled:U,placeholder:C??(null!=W?W.toFixed(le):void 0),size:q,auto:re,"aria-label":A?Z.slider.value(A):void 0,"aria-labelledby":A?void 0:H})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:Z.settingView.auto})]})}export{k as Slider,z as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
|