efficient-shell 13.25.0 → 14.1.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 +31 -4
- package/dist/{Browser-W2WVSAEN.js → Browser-L2NP7DLM.js} +14 -14
- package/dist/Calculator-7CY2CRGB.js +29 -0
- package/dist/{CurrencyConverter-VH4UVYLO.js → CurrencyConverter-FXWM3DBQ.js} +9 -9
- package/dist/{Files-6QZFFGSH.js → Files-5S6UFGST.js} +82 -82
- package/dist/{Notepad-YU4HIJD2.js → Notepad-HC46LWV5.js} +8 -8
- package/dist/PomodoroTimer-RPGWT26T.js +91 -0
- package/dist/{Preview-H7N2MMAI.js → Preview-L6FJXBAE.js} +37 -37
- package/dist/Sidebar-2TYZENQL.js +44 -0
- package/dist/{Stock-YL732PKW.js → Stock-TUPZORQN.js} +4 -4
- package/dist/{Weather-3CBRXNNM.js → Weather-URCO6JML.js} +23 -23
- package/dist/{WorldClock-LONNWCRG.js → WorldClock-EBBUWG5L.js} +6 -6
- package/dist/ai/index.js +92 -92
- 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/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-XVMCSUAV.js → chunk-22SVN2ZM.js} +1 -1
- package/dist/{chunk-ZDFMYAQB.js → chunk-24BF22NF.js} +1 -1
- package/dist/{chunk-JIJZBM25.js → chunk-2RLWGWOU.js} +13 -13
- package/dist/{chunk-VP2IQJUD.js → chunk-2SOGTOUQ.js} +4 -4
- package/dist/{chunk-4VFEPP2W.js → chunk-2XDO7FZC.js} +13 -13
- package/dist/{chunk-SLEA47VA.js → chunk-3L7BEEBW.js} +1 -1
- package/dist/{chunk-GZRNOIEE.js → chunk-3ZJAQSFS.js} +3 -3
- package/dist/{chunk-BQQEQCSK.js → chunk-47BGAQWD.js} +1 -1
- package/dist/{chunk-7AVPMO4F.js → chunk-4BRVZAIW.js} +1 -1
- package/dist/chunk-4DNPUG3T.js +7 -0
- package/dist/chunk-5F3HPOBH.js +1 -0
- package/dist/{chunk-VKZC3NPM.js → chunk-5O4HMXPQ.js} +2 -2
- package/dist/{chunk-JLSXDYS4.js → chunk-5SQHRDFC.js} +2 -2
- package/dist/{chunk-LQIHBIXG.js → chunk-6AYAB5FN.js} +5 -5
- package/dist/{chunk-VGUB7LPF.js → chunk-6IP4Q3AT.js} +52 -52
- package/dist/{chunk-527WMFTR.js → chunk-6RU2PGQK.js} +1 -1
- package/dist/{chunk-UVPDEGIA.js → chunk-6X32SWQI.js} +1 -1
- package/dist/{chunk-A5FC4LR7.js → chunk-7D2QZ6JA.js} +1 -1
- package/dist/{chunk-2YHS5E27.js → chunk-7OVMWXFM.js} +1 -1
- package/dist/{chunk-LC2UF3AA.js → chunk-7WF6LFOJ.js} +1 -1
- package/dist/{chunk-IJG4UEKF.js → chunk-A3VLZZHJ.js} +8 -8
- package/dist/{chunk-LG6NDTHZ.js → chunk-AH5MLH54.js} +1 -1
- package/dist/chunk-AJPQJ7TC.js +6 -0
- package/dist/{chunk-TNALBYLY.js → chunk-ALZHFQRX.js} +1 -1
- package/dist/{chunk-S5MTTJ3F.js → chunk-AZZ4NO2D.js} +12 -12
- package/dist/{chunk-P4VOUPRF.js → chunk-CHDGSJLV.js} +6 -6
- package/dist/{chunk-VY6OQRZA.js → chunk-CJ4OEY3T.js} +1 -1
- package/dist/{chunk-Q36KB5RQ.js → chunk-CXEELIRW.js} +11 -11
- package/dist/{chunk-MZ3JADHG.js → chunk-DBBOD5QW.js} +1 -1
- package/dist/chunk-DBQNYJZ6.js +1 -0
- package/dist/{chunk-65BW43PF.js → chunk-DNPAYNNU.js} +1 -1
- package/dist/{chunk-TTRLYWP4.js → chunk-DO6P6LYU.js} +1 -1
- package/dist/chunk-DOJSWVBX.js +6 -0
- package/dist/chunk-DTFX624I.js +8 -0
- package/dist/chunk-E57C7NBA.js +2 -0
- package/dist/{chunk-D5PXRJHA.js → chunk-EBODRYXS.js} +14 -14
- package/dist/{chunk-YDJ5IZOU.js → chunk-EDRELF6L.js} +1 -1
- package/dist/{chunk-M3HTP2N6.js → chunk-EHNW3UNC.js} +6 -6
- package/dist/{chunk-AH2NEKEN.js → chunk-EHSK43WG.js} +8 -8
- package/dist/{chunk-VMAIZU5S.js → chunk-EN3GYSCE.js} +1 -1
- package/dist/{chunk-TTYTOLVV.js → chunk-EOYKUV2U.js} +1 -1
- package/dist/chunk-FFPIT2LB.js +3 -0
- package/dist/{chunk-TD3ZQD5R.js → chunk-G3TC2GIA.js} +1 -1
- package/dist/{chunk-AAJSE5HA.js → chunk-GTBOJ5Q5.js} +1 -1
- package/dist/{chunk-UQV4TSWB.js → chunk-GTZML3V3.js} +1 -1
- package/dist/{chunk-JYR4V4AG.js → chunk-GUUBFQ6L.js} +2 -2
- package/dist/{chunk-K42FXX7J.js → chunk-GVAVIYE6.js} +1 -1
- package/dist/{chunk-2Y4AH7NC.js → chunk-GY7MJTIZ.js} +1 -1
- package/dist/{chunk-XYXCZIJY.js → chunk-HAEZUUDT.js} +3 -3
- package/dist/{chunk-J5W63XNR.js → chunk-HTBACICQ.js} +6 -6
- package/dist/{chunk-5URXJCNC.js → chunk-HX5QSQ2C.js} +1 -1
- package/dist/{chunk-VLBLDSA6.js → chunk-I7WAOKU2.js} +2 -2
- package/dist/{chunk-LLDGRPLF.js → chunk-ION3XGLN.js} +1 -1
- package/dist/{chunk-EXDSYFHB.js → chunk-ISWTJBOA.js} +1 -1
- package/dist/{chunk-BUFAJJDZ.js → chunk-IVEM2BPC.js} +1 -1
- package/dist/{chunk-D4432YRW.js → chunk-IZ6D4KGR.js} +1 -1
- package/dist/{chunk-KC2EQCBE.js → chunk-JPVD3VS7.js} +6 -6
- package/dist/{chunk-C7Z3ZMJH.js → chunk-KE7P74XM.js} +13 -13
- package/dist/chunk-KEFNQEXZ.js +1 -0
- package/dist/{chunk-DUEEAP4Y.js → chunk-LPL7BWGG.js} +1 -1
- package/dist/{chunk-JVENCUUG.js → chunk-LRMDLZMM.js} +4 -4
- package/dist/chunk-M5IZ7QLQ.js +7 -0
- package/dist/{chunk-MCLVTQSF.js → chunk-MEDOESQD.js} +8 -8
- package/dist/chunk-MEP6CZJ3.js +2 -0
- package/dist/{chunk-ZYKY4Z7R.js → chunk-MKHOXO5O.js} +1 -1
- package/dist/chunk-MNZAAQLH.js +15 -0
- package/dist/{chunk-DTRJLQWO.js → chunk-MPC3CHAO.js} +1 -1
- package/dist/{chunk-7PAZO65L.js → chunk-MXRF5YVN.js} +5 -5
- package/dist/{chunk-NWS5G7FE.js → chunk-MYH5H43C.js} +1 -1
- package/dist/{chunk-5OHFBS2B.js → chunk-NC5FIFAY.js} +1 -1
- package/dist/chunk-NDCS4COQ.js +11 -0
- package/dist/{chunk-IJ4JX6WP.js → chunk-NHALP3MW.js} +4 -4
- package/dist/{chunk-R5WBDXI2.js → chunk-OYQWBJ37.js} +1 -1
- package/dist/{chunk-77N3REYY.js → chunk-P2HZ2V3U.js} +2 -2
- package/dist/{chunk-UU42O5ON.js → chunk-P3XXFQG5.js} +1 -1
- package/dist/{chunk-YBE66FBR.js → chunk-P5J7G7OV.js} +1 -1
- package/dist/{chunk-4L5YRMJ4.js → chunk-PEA5Y6DD.js} +9 -9
- package/dist/{chunk-DPFEQQQU.js → chunk-POBVGDZP.js} +1 -1
- package/dist/{chunk-RFWBNKKB.js → chunk-PPHGBEJA.js} +10 -10
- package/dist/{chunk-IMH5H47S.js → chunk-PTLVNC3V.js} +6 -6
- package/dist/chunk-PU2GJVMG.js +1 -0
- package/dist/{chunk-TJG76Y7I.js → chunk-PWERFHOU.js} +9 -9
- package/dist/{chunk-ZFWCTHR4.js → chunk-PWON7O3N.js} +6 -6
- package/dist/{chunk-6MFKKTCE.js → chunk-Q7FPGOUY.js} +24 -24
- package/dist/{chunk-M4REKOGO.js → chunk-QCLKRFL4.js} +5 -5
- package/dist/{chunk-N4LMFGRI.js → chunk-R36VZ35L.js} +6 -6
- package/dist/{chunk-CCZHSISF.js → chunk-REFPTKRD.js} +2 -2
- package/dist/{chunk-THAPVKEJ.js → chunk-RTK77DMP.js} +11 -11
- package/dist/{chunk-PWOVSR7N.js → chunk-RXCBSQA2.js} +2 -2
- package/dist/{chunk-JDLJ7DHV.js → chunk-S4RFJTGR.js} +1 -1
- package/dist/{chunk-D5HFWOW7.js → chunk-SP4S4HUJ.js} +16 -16
- package/dist/{chunk-P73ZJ6QR.js → chunk-T46I4YOI.js} +1 -1
- package/dist/{chunk-VY3UA6AR.js → chunk-TAHHZGRH.js} +1 -1
- package/dist/{chunk-FBZUEZK7.js → chunk-TTD2M6RF.js} +1 -1
- package/dist/{chunk-RB3BMRNA.js → chunk-U75MSD4F.js} +1 -1
- package/dist/{chunk-XC2GUCTG.js → chunk-UGA5NGW4.js} +1 -1
- package/dist/chunk-VUBDHFG5.js +4 -0
- package/dist/{chunk-K4KUGKWP.js → chunk-W4IH3BE3.js} +21 -21
- package/dist/{chunk-B5KX7PDG.js → chunk-W6REY3SV.js} +3 -3
- package/dist/{chunk-WZWSFYXJ.js → chunk-WBUAO7T7.js} +1 -1
- package/dist/{chunk-P6H2B635.js → chunk-WNFZYTWW.js} +9 -9
- package/dist/{chunk-HPKQYUQT.js → chunk-WYAKASF3.js} +1 -1
- package/dist/{chunk-C5OPAULN.js → chunk-XGEN76DG.js} +1 -1
- package/dist/{chunk-ZKILZFUI.js → chunk-XIX72C7K.js} +1 -1
- package/dist/{chunk-3AUN7JSM.js → chunk-XJK6VNXV.js} +1 -1
- package/dist/{chunk-26KHYLJN.js → chunk-XLPUIGMO.js} +1 -1
- package/dist/{chunk-VQBKRBBR.js → chunk-XNKNX5L3.js} +1 -1
- package/dist/chunk-Y2M5PP2C.js +28 -0
- package/dist/{chunk-66NJCU4W.js → chunk-Y5RTVKMB.js} +8 -8
- package/dist/{chunk-JXJNQHPY.js → chunk-Y5YVKUM4.js} +19 -19
- package/dist/{chunk-5CHJA4RL.js → chunk-Y6FULJWJ.js} +7 -7
- package/dist/chunk-Y7D2CZ4H.js +13 -0
- package/dist/chunk-YTLUSBDY.js +14 -0
- package/dist/{chunk-2YUAR2EH.js → chunk-YX3JD6PA.js} +5 -5
- package/dist/{chunk-3WUVYXCF.js → chunk-ZA6ANC2D.js} +5 -5
- package/dist/{chunk-5ZOYYL46.js → chunk-ZEGCKIAL.js} +3 -3
- package/dist/chunk-ZSVU44OB.js +6 -0
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/data/useColumnConfig.js +1 -1
- package/dist/data/useSort.js +1 -1
- package/dist/format/index.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/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/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/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/forms/dropdownPosition.js +1 -1
- package/dist/hooks/index.d.ts +15 -14
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +43 -2
- package/dist/index.js +125 -125
- package/dist/map/index.js +5 -5
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/routine-index.json +1 -0
- 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.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/Kbd.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.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/SettingRow.js +1 -1
- package/dist/shell/ShellPrefs.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/TimelineTrack.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.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/tokens/colour.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/dist/value-index.json +1 -0
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/dist/Calculator-PKAM5ERT.js +0 -29
- package/dist/PomodoroTimer-PBSAKRX5.js +0 -91
- package/dist/Sidebar-HAIHWIJD.js +0 -44
- package/dist/chunk-2AEYVQ2R.js +0 -2
- package/dist/chunk-3GJVTK4H.js +0 -11
- package/dist/chunk-3TD3GH53.js +0 -7
- package/dist/chunk-44ERJYNW.js +0 -6
- package/dist/chunk-AAFPAQXH.js +0 -13
- package/dist/chunk-EX3DARI3.js +0 -7
- package/dist/chunk-F2RAIGCG.js +0 -6
- package/dist/chunk-FLQXMCB3.js +0 -8
- package/dist/chunk-N6PMH6DU.js +0 -6
- package/dist/chunk-O5ZBRG2G.js +0 -1
- package/dist/chunk-PP3WUT2G.js +0 -15
- package/dist/chunk-PWX64YBI.js +0 -28
- package/dist/chunk-RJVIKGHJ.js +0 -4
- package/dist/chunk-SRI2D23Y.js +0 -14
- package/dist/chunk-UTISUEO4.js +0 -2
- package/dist/chunk-UVHXVSB2.js +0 -1
- package/dist/chunk-WCCS4VFE.js +0 -1
- package/dist/chunk-ZDXRSY2Y.js +0 -1
- package/dist/chunk-ZISKHQZY.js +0 -3
- /package/dist/{chunk-4BYJABCX.js → chunk-5YTZBYG4.js} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-
|
|
2
|
-
return b("div",{className:`flex min-h-0 flex-col ${
|
|
1
|
+
import{Segmented as e}from"./chunk-ALZHFQRX.js";import{calendarNames as t,formatDate as n}from"./chunk-NHKT5IH6.js";import{toDateKey as r,fromDateKey as a,DAY_MS as o}from"./chunk-JRQMX4PK.js";import{LoadingSpinner as i}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as s}from"./chunk-PU2GJVMG.js";import{useShellStrings as l,useShellLocale as d}from"./chunk-NRHG4R2Q.js";import{useState as c,useRef as u,useId as h,useMemo as m}from"react";import{jsx as f,Fragment as p,jsxs as b}from"react/jsx-runtime";var g={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?a(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/o):null}function x(e){return new Date(e*o).toISOString().slice(0,10)}function v(e){return new Date(e*o)}function k(e){return((e+3)%7+7)%7}function N(e){return e-k(e)}function D(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/o)}function M(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/o)}function C(e){return Math.round(Date.UTC(v(e).getUTCFullYear(),0,1)/o)}function $(e){return Math.round(Date.UTC(v(e).getUTCFullYear()+1,0,1)/o)}var T={day:3,week:7,month:14},U={day:28,week:84,month:182};function j(e,t,n){return(e-t.startDay)*g[n]}function P(e,t,n){return j(e,t,n)+g[n]/2}function R(e,t,n,r){const a=[];let o=e.startDay;if(n(o)!==o){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}for(;o<e.endDay;){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}return a}function X(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:j(t,n,r)+g[r]/2};const a=null===t?e:Math.min(e,t),o=null===t?e:Math.max(e,t);return{kind:"bar",startDay:a,endDay:o,x:j(a,n,r),width:(o-a+1)*g[r]}}function S(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function I(e,t,n,r,a=44,o=10){let i;if(n-e>=2*o){const a=e+o;i=[[e,t],[a,t],[a,r],[n,r]]}else{const s=t+(r>=t?1:-1)*a/2,l=e+o,d=n-o;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function z(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function F(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function H(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const a=n+r;return{start:t,end:null===t?a:Math.max(a,t)}}var Y=24;function Q({rows:a,groups:o=[],dependencies:j=[],scale:Q,onScaleChange:A,onRowClick:K,onRowChange:L,readOnly:W=!1,today:E,isLoading:G=!1,emptyState:J,labelHeader:O,labelWidth:V=240,className:Z=""}){const q=l().gantt,B=d(),_=t(B),ee=!!L&&!W,[te,ne]=c(null),re=u(!1),ae=u(null),oe=h(),ie=w(E)??w(r(/* @__PURE__ */new Date)),se=m(()=>{const e=/* @__PURE__ */new Map;for(const t of a){const n=w(t.start),r=w(t.end);e.set(t.id,te&&te.id===t.id?H(te.mode,te.start,te.end,te.delta):{start:n,end:r})}return e},[a,te]),le=m(()=>{const e=[ie];for(const t of a){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,a=n.length?Math.max(...n):0;let o=r-T[t],i=a+1+T[t];const s=U[t]-(i-o);return s>0&&(o-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(o=N(o),i=N(i-1)+7):"month"===t&&(o=D(o),i=M(i-1)),{startDay:o,endDay:i}}(e,Q)},[a,Q,ie]),de=m(()=>function(e,t){return"day"===t?{major:R(e,t,D,M),minor:R(e,t,e=>e,e=>e+1)}:"week"===t?{major:R(e,t,D,M),minor:R(e,t,N,e=>N(e)+7)}:{major:R(e,t,C,$),minor:R(e,t,D,M)}}(le,Q),[le,Q]),ce=function(e,t){return(e.endDay-e.startDay)*g[t]}(le,Q),ue=m(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,a=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else a.push(t);const o=a.map(e=>({kind:"row",row:e}));for(const e of t){o.push({kind:"group",group:e});for(const t of r.get(e.id)??[])o.push({kind:"row",row:t})}return o}(a,o),[a,o]),he=m(()=>{const e=/* @__PURE__ */new Map;return ue.forEach((t,n)=>{if("row"!==t.kind)return;const r=se.get(t.row.id);e.set(t.row.id,{shape:X(r.start,r.end,le,Q),line:n})}),e},[ue,se,le,Q]),me=m(()=>{const e=[];for(const t of j){const n=he.get(t.from),r=he.get(t.to);if(!n||!r)continue;const a=S(n.shape),o=S(r.shape);if(!a||!o)continue;const i=n.line*y+22,s=r.line*y+22,l=I(a.outX,i,o.inX,s);e.push({key:`${t.from}>${t.to}`,d:z(l),head:F(o.inX,s)})}return e},[j,he]),fe=!G&&(a.length>0||o.length>0);s(()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-V;e.scrollLeft=Math.max(0,P(ie,le,Q)-t/4)},[Q,fe]);if(G)/* @__PURE__ */return f(i,{size:"sm",padding:"p-4",label:q.loading});if(!fe)/* @__PURE__ */return f(p,{children:J??/* @__PURE__ */f("div",{className:"text-sm text-ink-faint p-4",children:q.empty})});const pe=(e,t,n)=>{L?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},be=(e,t,n)=>{if(re.current=!1,ee&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}ne({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},ge=e=>{if(!te)return;const t=function(e,t){const n=Math.round(e/g[t]);return 0===n?0:n}(e.clientX-te.originX,Q);t!==te.delta&&ne({...te,delta:t})},ye=e=>{if(te){if(0!==te.delta){const t=H(te.mode,te.start,te.end,te.delta);re.current=!0,pe(e,t.start,t.end)}ne(null)}},we=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void K?.(t);if(!ee||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=H(e.shiftKey?"end":"move",w(t.start),w(t.end),n);pe(t,r.start,r.end)},xe=e=>{re.current?re.current=!1:K?.(e)},ve=e=>n(x(e),{locale:B}),ke=(e,t)=>{const n=v(e.startDay),r=n.getUTCFullYear(),a=n.getUTCMonth();return"major"===t?"month"===Q?String(r):"week"===Q?_.shortMonthYear(r,a):_.monthYear(r,a):"month"===Q?_.monthsShort[a]:String(n.getUTCDate())},Ne=ue.length*y,De=P(ie,le,Q),Me=De>=0&&De<=ce,Ce=de.minor.find(e=>e.startDay<=ie&&ie<e.endDay),$e=Ce?De-Ce.x:0,Te=!!Ce&&$e<=Ce.width/2;/* @__PURE__ */
|
|
2
|
+
return b("div",{className:`flex min-h-0 flex-col ${Z}`,children:[
|
|
3
3
|
/* @__PURE__ */b("div",{className:"flex items-center justify-end gap-2 pb-2",children:[
|
|
4
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-
|
|
5
|
-
/* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:
|
|
4
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-V;e.scrollTo?.({left:Math.max(0,P(ie,le,Q)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:q.today}),A&&/* @__PURE__ */f(e,{size:"sm",label:q.scale,value:Q,onChange:A,options:[{value:"day",label:q.day},{value:"week",label:q.week},{value:"month",label:q.month}]})]}),
|
|
5
|
+
/* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:V+ce,minHeight:48+Ne},children:[
|
|
6
6
|
/* @__PURE__ */b("div",{className:"sticky top-0 z-20 flex border-b border-line bg-surface",style:{height:48},children:[
|
|
7
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:
|
|
8
|
-
/* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:
|
|
9
|
-
/* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:
|
|
7
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:V},children:O??q.task}),
|
|
8
|
+
/* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:Y},children:/* @__PURE__ */f("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:V},children:ke(e,"major")})},`M${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{"data-gantt-tick":"minor",className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===Q?"text-center":"px-1"} ${e.startDay===ie&&"day"===Q?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:Y,height:Y},children:ke(e,"minor")},`m${e.startDay}`)),Me&&Ce&&"day"!==Q&&
|
|
9
|
+
/* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:Y,height:Y},children:[Te&&/* @__PURE__ */f("span",{className:"invisible shrink-0 whitespace-nowrap px-1",children:ke(Ce,"minor")}),
|
|
10
10
|
/* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),
|
|
11
|
-
/* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:
|
|
11
|
+
/* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:q.today}),
|
|
12
12
|
/* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),Te&&/* @__PURE__ */f("span",{className:"invisible min-w-0 shrink overflow-hidden",children:/* @__PURE__ */f("span",{className:"inline-block whitespace-nowrap px-1",children:ke(Ce,"minor")})})]})]})]}),
|
|
13
|
-
/* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:
|
|
13
|
+
/* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:V,top:48,width:ce,height:Ne},"aria-hidden":!0,children:["day"===Q&&de.minor.filter(e=>k(e.startDay)>=5).map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
|
|
14
14
|
/* @__PURE__ */f("div",{role:"list",children:ue.map(e=>{if("group"===e.kind)/* @__PURE__ */
|
|
15
15
|
return b("div",{role:"listitem",className:"flex",style:{height:y},children:[
|
|
16
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:
|
|
17
|
-
/* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${
|
|
16
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:V},children:/* @__PURE__ */f("span",{className:"truncate",children:e.group.label})}),
|
|
17
|
+
/* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${q.done}`:"";/* @__PURE__ */
|
|
18
18
|
return b("div",{role:"listitem",className:"flex",style:{height:y},"data-gantt-row":t.id,children:[
|
|
19
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:
|
|
19
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:V},children:/* @__PURE__ */f("button",{type:"button",tabIndex:"none"===n.kind&&K?0:-1,onClick:()=>K?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${K?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */f("span",{className:"truncate",children:t.label})})}),
|
|
20
20
|
/* @__PURE__ */b("div",{className:"relative shrink-0 border-b border-line-subtle",style:{width:ce},children:["bar"===n.kind&&/* @__PURE__ */b(p,{children:[
|
|
21
|
-
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":
|
|
21
|
+
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":q.barName(t.label,ve(n.startDay),ve(n.endDay))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""} ${a?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:ee?"none":void 0},children:ee&&/* @__PURE__ */b(p,{children:[
|
|
22
22
|
/* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"start",className:"absolute inset-y-0 left-0 w-2 cursor-ew-resize rounded-l-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"start")}),
|
|
23
23
|
/* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"end",className:"absolute inset-y-0 right-0 w-2 cursor-ew-resize rounded-r-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"end")})]})}),
|
|
24
24
|
/* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.x+n.width+16,top:16},children:t.label})]}),"milestone"===n.kind&&/* @__PURE__ */b(p,{children:[
|
|
25
|
-
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":
|
|
25
|
+
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":q.milestoneName(t.label,ve(n.day))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":K?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:ee?"none":void 0}}),
|
|
26
26
|
/* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.cx+9+16,top:16},children:t.label})]})]})]},t.id)})}),
|
|
27
|
-
/* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:
|
|
27
|
+
/* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:V,top:48,width:ce,height:Ne},width:ce,height:Ne,"aria-hidden":!0,children:me.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
|
|
28
28
|
/* @__PURE__ */f("path",{d:e.d,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"}),
|
|
29
|
-
/* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:
|
|
29
|
+
/* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:V+De,top:48,height:Ne},"aria-hidden":!0}),ee&&/* @__PURE__ */f("span",{id:oe,hidden:!0,children:q.moveHint})]})})]})}export{Q as Gantt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-
|
|
1
|
+
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-MEP6CZJ3.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
|
|
2
2
|
return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
|
|
3
3
|
/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useBrowserLayoutEffect as t}from"./chunk-
|
|
1
|
+
import{useBrowserLayoutEffect as t}from"./chunk-PU2GJVMG.js";import{useState as e}from"react";var o=448,i=240,n=8,h=()=>{const t="object"==typeof window.visualViewport?window.visualViewport:null;return t&&t.width>0&&t.height>0?{left:t.offsetLeft,right:t.offsetLeft+t.width,top:t.offsetTop,bottom:t.offsetTop+t.height}:{left:0,right:window.innerWidth,top:0,bottom:window.innerHeight}};function r(t){const e=h(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var a=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);function m(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=h(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let n=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==n;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===n&&"static"===t.position)continue;n=t.position;const o=a.has(t.overflowX),h=a.has(t.overflowY);if(!o&&!h)continue;const r=e.getBoundingClientRect();r.width<=0&&r.height<=0||(o&&(i.left=Math.max(i.left,r.left),i.right=Math.min(i.right,r.right)),h&&(i.top=Math.max(i.top,r.top),i.bottom=Math.min(i.bottom,r.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}var l={top:"bottom",bottom:"top",left:"right",right:"left"},f={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function g(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var d=(t,e,o)=>Math.max(e,Math.min(t,o));function s(t,e,o,i,n){const h=g(t,i,n),r=t=>h[t]-("top"===t||"bottom"===t?e.height:e.width),a=[o,l[o],...f[o]],m=a.find(t=>r(t)>=0)??a.reduce((t,e)=>r(e)>r(t)?e:t),s=(t.left+t.right)/2,c=(t.top+t.bottom)/2;let u,p;switch(m){case"top":u=s-e.width/2,p=t.top-n-e.height;break;case"bottom":u=s-e.width/2,p=t.bottom+n;break;case"left":u=t.left-n-e.width,p=c-e.height/2;break;case"right":u=t.right+n,p=c-e.height/2}return{side:m,left:d(u,i.left+8,i.right-8-e.width),top:d(p,i.top+8,i.bottom-8-e.height)}}function c(t,e,o,i,n){const{side:h,left:r,top:a}=e,m=r+o.width,l=a+o.height;if({top:t.top-l,bottom:a-t.bottom,left:t.left-m,right:r-t.right}[h]<n)return null;const f=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),g=(t.left+t.right)/2,d=(t.top+t.bottom)/2;switch(h){case"top":return{side:h,x:f(g,r,o.width),y:l};case"bottom":return{side:h,x:f(g,r,o.width),y:a};case"left":return{side:h,x:m,y:f(d,a,o.height)};case"right":return{side:h,x:r,y:f(d,a,o.height)}}}function u(t,e,o){return p(()=>t()?.getBoundingClientRect(),e,o)}function p(t,e,o){let i=NaN,n=NaN,h=NaN,r=NaN,a=NaN;const m=()=>{const e=t();if(!e)return!1;const m=o?o():NaN,l=e.left!==i||e.top!==n||e.right!==h||e.bottom!==r||m!==a&&!(Number.isNaN(m)&&Number.isNaN(a));return i=e.left,n=e.top,h=e.right,r=e.bottom,a=m,l};m();const l=()=>{m(),e()};let f=requestAnimationFrame(function t(){m()&&e(),f=requestAnimationFrame(t)});return window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{cancelAnimationFrame(f),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}}function b({trigger:t,menu:e,bounds:o,align:i,side:n}){const h=g(t,o,4),r="bottom"===n?"top":"bottom",a=e.height>h[n]&&(e.height<=h[r]||h[r]>h[n])?r:n,m=Math.max(Math.min(e.height,96),h[a]),l=Math.min(e.height,m),f=d("bottom"===a?t.bottom+4:t.top-4-l,o.top+8,o.bottom-8-l),s=Math.max(0,o.right-o.left-16),c=Math.min(e.width,s);return{left:d("start"===i?t.left:t.right-c,o.left+8,o.right-8-c),top:f,side:a,maxHeight:m,maxWidth:s}}function w(n,h,a={}){const{matchTriggerWidth:m=!1,preferredMaxWidth:l=o,preferredMaxHeight:f=i,popupRef:g}=a,[d,s]=e(null);return t(()=>{if(!h)return void s(null);const t=()=>{const t=n.current,e=t?.getBoundingClientRect();if(!e)return;const o=r(t),i=o.bottom-e.bottom-4-8,h=e.top-o.top-4-8,a=i<Math.min(f,160)&&h>i,d=Math.max(96,Math.min(f,a?h:i)),c=Math.max(0,o.right-o.left-16),u={minWidth:e.width,maxWidth:Math.min(l,c),maxHeight:d};if(m){const t=Math.min(e.width,c);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(o.left+8,e.left),o.right-8-t)}else if(g&&o.right-8-e.left<u.maxWidth&&Math.min(e.right,o.right-8)-o.left-8<u.maxWidth){const t=g.current?.offsetWidth??0,i=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(o.left+8,Math.min(e.left,o.right-8-i))}else if(o.right-8-e.left<u.maxWidth){const t=Math.min(e.right,o.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-o.left-8))}else u.left=Math.max(o.left+8,e.left);a?u.bottom=window.innerHeight-e.top+4:u.top=e.bottom+4,s(u)};return t(),u(()=>n.current,t,g?()=>g.current?.offsetWidth??NaN:void 0)},[h,n,m,l,f,g]),d}function x({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},n=o.right-8-t.x,h=t.x-(o.left+8);return b({trigger:i,menu:e,bounds:o,align:e.width<=n||n>=h?"start":"end",side:"bottom"})}export{i as MENU_MAX_HEIGHT,o as POPUP_MAX_WIDTH,n as VIEWPORT_MARGIN,u as followAnchor,p as followRect,c as placeArrow,x as placeAtPoint,s as placeBeside,b as placeMenu,r as popupBounds,m as showingBox,w as useDropdownPosition};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useHydrated as e}from"./chunk-
|
|
1
|
+
import{useHydrated as e}from"./chunk-KEFNQEXZ.js";import{jsx as t}from"react/jsx-runtime";var r="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),n={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},i=r?0:1,o=n.MOD[i],a=n.ALT[i],l="⇧",_="⏎",d=n.CMD_ENTER[i],f=n.CMD_S[i],m=n.CMD_K[i],s=n.CMD_DOT[i],u=n.CMD_A[i],C=n.CMD_Z[i],D=n.CMD_SHIFT_Z[i],T=n.ALT_SHIFT_D[i],c=n.ALT_SHIFT_E[i],M=n.ALT_SHIFT_N[i],A=new Map(r?Object.values(n).map(([e,t])=>[e,t]):[]);function S(t){return e()?t:A.get(t)??t}var b={neutral:"inline-flex items-center justify-center rounded border border-line bg-surface-sunken font-medium text-ink-faint",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},p={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function x({keys:e,size:r="md",tone:n="neutral",className:i=""}){const o=S(e);/* @__PURE__ */
|
|
2
2
|
return t("kbd",{className:[b[n],p[r],i].filter(Boolean).join(" "),children:o})}export{a as ALT,T as ALT_SHIFT_D,c as ALT_SHIFT_E,M as ALT_SHIFT_N,u as CMD_A,s as CMD_DOT,d as CMD_ENTER,m as CMD_K,f as CMD_S,D as CMD_SHIFT_Z,C as CMD_Z,_ as ENTER,x as Kbd,o as MOD,l as SHIFT,r as isMac,S as useShortcutLabel};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-6X32SWQI.js";import{Button_default as n}from"./chunk-MEP6CZJ3.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-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-EBODRYXS.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-W6REY3SV.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-EDRELF6L.js";import{Button_default as l}from"./chunk-MEP6CZJ3.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-G3TC2GIA.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"}),
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-DWGYC7OD.js";import{DESCRIPTION_TEXT as n}from"./chunk-BWJZTHZ6.js";import{onOverlayOpen as i}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{popupBounds as a,VIEWPORT_MARGIN as c,placeMenu as s,followAnchor as l}from"./chunk-TAHHZGRH.js";import{useHydrated as u}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as d}from"./chunk-PU2GJVMG.js";import{buttonClasses as m}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as p}from"./chunk-TWVUQUUD.js";import{useState as f,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as y}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/;function N({trigger:N,children:C,title:E,description:j,"aria-label":D,align:H="start",side:T="bottom",open:O,defaultOpen:$=!1,onOpenChange:P,matchTriggerWidth:W=!1,maxHeight:L,initialFocus:M,id:G,triggerLabel:K,"aria-describedby":S,disabled:U,className:z="",triggerClassName:F,panelClassName:R=""}){const[Y,Z]=f($),B=(O??Y)&&!U,J=u(),Q=h(null),I=h(null),V=h(null),A=h(null),X=g(),q=G??X,_=g(),ee=g(),te=g(),re=h(null),ne=h(!1),ie=h({openProp:O,onOpenChange:P});ie.current={openProp:O,onOpenChange:P};const oe=v(e=>{void 0===ie.current.openProp&&Z(e),ie.current.onOpenChange?.(e)},[]),ae=v((e=!1)=>{ne.current=e,oe(!1)},[oe]),ce=e=>{re.current=e.nativeEvent},se=v(()=>{const e=V.current,t=I.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=a(t),i=Math.max(0,n.right-n.left-2*c),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${i}px`,o.maxHeight="none",o.width=W?`${Math.min(r.width,i)}px`:"";const l={width:e.offsetWidth,height:e.offsetHeight},u=L??1/0,d=s({trigger:r,menu:{width:l.width,height:Math.min(l.height,u)},bounds:n,align:H,side:T}),m=Math.min(d.maxHeight,u);o.left=`${d.left}px`,o.top=`${d.top}px`,o.maxHeight=`${m}px`,o.overflowY=l.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=H},[H,T,W,L]);d(()=>{B&&J&&se()}),b(()=>{if(!B||!J)return;const e=l(()=>I.current,se),t=A.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>se());return r.observe(t),()=>{e(),r.disconnect()}},[B,J,se]),b(()=>{if(!B)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(re.current===e)return!1;const t=e.target;return!(t&&(Q.current?.contains(t)||V.current?.contains(t)))})(e)&&ae(!0))},i=e=>{t=e,r=window.setTimeout(()=>n(e),0)},o=e=>n(e);return document.addEventListener(e,i,!0),window.addEventListener(e,o),()=>{window.clearTimeout(r),document.removeEventListener(e,i,!0),window.removeEventListener(e,o)}},t=e("pointerdown"),r=e("focusin"),n=i(()=>ae()),o=p(e=>"Escape"===e.key&&(ae(),I.current?.focus(),!0),()=>V.current);return()=>{t(),r(),n(),o()}},[B,ae]),e(V,B&&J),d(()=>{if(!B||!J)return;const e=V.current;return()=>{if(ne.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||I.current?.focus({preventScroll:!0})}},[B,J]),b(()=>{if(!B||!J)return;const e=V.current;e&&(ne.current=!1,(M?.current??t(e)[0]??e).focus({preventScroll:!0}))},[B,J]);const le="function"==typeof C?C({close:()=>ae()}):C,ue=E?{"aria-labelledby":ee}:D?{"aria-label":D}:{"aria-labelledby":q};/* @__PURE__ */
|
|
2
|
+
return x("div",{ref:Q,className:`relative inline-flex ${z}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */y("button",{ref:I,id:q,type:"button","aria-haspopup":"dialog","aria-expanded":B,"aria-controls":B&&J?_:void 0,"aria-label":K,"aria-describedby":S,disabled:U,onClick:()=>B?ae():oe(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!B)return;const r=(()=>{const e=V.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:F??m({variant:"secondary"}),children:N}),B&&J&&w(
|
|
4
|
+
/* @__PURE__ */y("div",{ref:V,id:_,role:"dialog",...ue,"aria-describedby":j?te:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:ce,onFocusCapture:ce,onKeyDown:e=>{const n=V.current,i=I.current;if("Tab"!==e.key||!n||!i||!n.contains(e.target))return;const o=t(n),a=document.activeElement;if(e.shiftKey){if(o.length>0&&a!==o[0]&&a!==n)return;return e.preventDefault(),void i.focus({preventScroll:!0})}if(o.length>0&&a!==o[o.length-1])return;e.preventDefault();const c=r(i,n);ae(!!c),(c??i).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${R}`.trim(),style:k.test(R)?void 0:{zIndex:o.popup},children:/* @__PURE__ */x("div",{ref:A,children:[E&&/* @__PURE__ */y("h2",{id:ee,className:"text-sm font-semibold text-gray-900",children:E}),j&&/* @__PURE__ */y("p",{id:te,className:`mt-1 ${n}`,children:j}),E||j?/* @__PURE__ */y("div",{className:"mt-3",children:le}):le]})}),document.body)]})}export{N as Popover};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:
|
|
3
|
-
/* @__PURE__ */Y(e,{mode:"range",min:U,max:q,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),
|
|
4
|
-
return W("div",{className:"relative"+(
|
|
5
|
-
/* @__PURE__ */W("div",{className:`relative ${
|
|
6
|
-
/* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{Q||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):
|
|
1
|
+
import{Calendar as e}from"./chunk-PPHGBEJA.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-W6REY3SV.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as x}from"./chunk-PU2GJVMG.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as w,useShellLocale as N}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as C,useId as M,useEffect as j}from"react";import{createPortal as D}from"react-dom";import{jsxs as W,Fragment as $,jsx as Y}from"react/jsx-runtime";var H=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],F=d;function R(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function S(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function G(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var O=/* @__PURE__ */new Map;function P({from:d,to:u,onChange:h,formatDisplay:F,clearable:P,required:E=!1,name:T,id:V,"aria-labelledby":A,"aria-label":I,weekStartsOn:L,placeholder:B,fullWidth:J=!1,min:U,max:q,disabled:Q=!1,allowOpenEnd:Z=!1}){const K=w().dateRange,z=N(),X=F??(z?function(e){let t=O.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),O.set(e,t));const r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(z):G),_=B??K.placeholder,ee=P??!E,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=M(),fe=M(),ge=M(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),we=C(null),[Ne,ke]=k(!0);x(()=>{const e=we.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==Ne&&ke(o)});const Ce=C(null);x(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[Me,je]=k(!1);x(()=>{const e=!!V&&(ue.current?.labels?.length??0)>0;e!==Me&&je(e)});const De=!!I||!!A||Me,We=m(s())??/* @__PURE__ */new Date(0),[$e,Ye]=k(()=>d?d.slice(0,7):S(We,U,q)),He=H.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(R(e,We),U,q)),Fe=e=>e?X(e):"";j(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),j(()=>{Q&&re(!1)},[Q]);const Re=()=>{h("",""),re(!1)},Se=ee&&!Q&&Boolean(d||u),Ge=d&&u?`${Fe(d)} — ${Fe(u)}`:d?K.fromOnly(Fe(d)):u?K.toOnly(Fe(u)):"",Oe=c(z),Pe=e=>{const t=m(e);return t?Oe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ee=d&&u?K.range(Pe(d),Pe(u)):d?K.fromOnly(Pe(d)):u?K.toOnly(Pe(u)):_,Te=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ve=/* @__PURE__ */W($,{children:[He.map(e=>/* @__PURE__ */Y("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=R(e,We);ae(t.from),ie(t.to),se(e),Ye(t.from.slice(0,7))})(e),className:Te(e),"aria-label":be?K[e]:void 0,children:be?Ne?K[e]:K[`${e}Short`]:K[e]},e)),
|
|
2
|
+
/* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:Te("Custom"),children:K.custom})]}),Ae=(e,t)=>Z?/* @__PURE__ */Y("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Y("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ie=e=>Z&&ce===e?" ring-1 ring-blue-400":"",Le=
|
|
3
|
+
/* @__PURE__ */Y(e,{mode:"range",min:U,max:q,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),Z?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:L,"aria-label":K.dialog});/* @__PURE__ */
|
|
4
|
+
return W("div",{className:"relative"+(J?" w-full":""),ref:me,children:[
|
|
5
|
+
/* @__PURE__ */W("div",{className:`relative ${J?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${Q?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{Q||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):S(We,U,q)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:V,disabled:Q||void 0,"aria-label":I,"aria-labelledby":A,"aria-describedby":[De?fe:void 0,E?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(J?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */Y(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */Y("span",{className:"truncate",children:
|
|
9
|
-
/* @__PURE__ */Y("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */Y("input",{type:"hidden",name:
|
|
11
|
-
/* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":
|
|
12
|
-
/* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
13
|
-
/* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:
|
|
14
|
-
/* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
15
|
-
/* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:
|
|
16
|
-
/* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
17
|
-
/* @__PURE__ */W("div",{ref:
|
|
18
|
-
/* @__PURE__ */Y("div",{className:"w-full",children:
|
|
8
|
+
/* @__PURE__ */Y("span",{className:"truncate",children:Ge||_})]}),Se&&/* @__PURE__ */Y(n,{children:/* @__PURE__ */Y(a,{action:{label:K.clearRange,icon:/* @__PURE__ */Y(p,{name:"close"}),onClick:Re}})})]}),De&&/* @__PURE__ */Y("span",{id:fe,className:"sr-only",children:Ee}),E&&/* @__PURE__ */Y("span",{id:ge,className:"sr-only",children:K.required}),T&&/* @__PURE__ */W($,{children:[
|
|
9
|
+
/* @__PURE__ */Y("input",{type:"hidden",name:T.from,value:d,disabled:Q||void 0}),
|
|
10
|
+
/* @__PURE__ */Y("input",{type:"hidden",name:T.to,value:u,disabled:Q||void 0})]}),te&&D(
|
|
11
|
+
/* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":K.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:g.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...y()},children:[
|
|
12
|
+
/* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ae("from",/* @__PURE__ */W($,{children:[
|
|
13
|
+
/* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:K.from}),
|
|
14
|
+
/* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ie("from")}`,children:ne?Fe(ne):K.start})]})),!be&&/* @__PURE__ */Y("span",{className:"text-gray-300",children:"—"}),Ae("to",/* @__PURE__ */W($,{children:[
|
|
15
|
+
/* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:K.to}),
|
|
16
|
+
/* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ie("to")}`,children:oe?Fe(oe):K.end})]}))]}),be?/* @__PURE__ */W($,{children:[He.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!Ne&&/* @__PURE__ */Y("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:K.lastHeading}),
|
|
17
|
+
/* @__PURE__ */W("div",{ref:we,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ve,He.map(e=>/* @__PURE__ */Y("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:K[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */Y("div",{className:"w-full",children:Le})]}):
|
|
19
19
|
/* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */Y("div",{className:"w-64",children:
|
|
21
|
-
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */Y("button",{type:"button",onClick:
|
|
22
|
-
/* @__PURE__ */Y("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:
|
|
23
|
-
/* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:
|
|
20
|
+
/* @__PURE__ */Y("div",{className:"w-64",children:Le}),He.length>0&&/* @__PURE__ */Y("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ve})]}),
|
|
21
|
+
/* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */Y("button",{type:"button",onClick:Re,className:v({variant:"ghost"}),children:K.clear}),
|
|
22
|
+
/* @__PURE__ */Y("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:K.cancel}),
|
|
23
|
+
/* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:Z?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:K.apply})]})]}),document.body)]})}export{P as DateRangePicker,R as presetRange,F as toISODate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{inputClasses as e,PLACEHOLDER_INK as r}from"./chunk-AYZY3YNC.js";import{DropdownMenu as n}from"./chunk-
|
|
1
|
+
import{inputClasses as e,PLACEHOLDER_INK as r}from"./chunk-AYZY3YNC.js";import{DropdownMenu as n}from"./chunk-M5IZ7QLQ.js";import{IconButton_default as t}from"./chunk-MYH5H43C.js";import{Tooltip as i}from"./chunk-AJPQJ7TC.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:e,size:r}){const{label:s,icon:l,onClick:c,menu:m}=e;/* @__PURE__ */
|
|
4
|
-
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(n,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:r})}):/* @__PURE__ */o(t,{"aria-label":s,size:r,onClick:c,children:l})})}var f=s(function({invalid:n,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",
|
|
5
|
-
/* @__PURE__ */o("input",{ref:f,"aria-invalid":n||void 0,readOnly:u,className:e({invalid:n,size:s,readOnly:u,className:[
|
|
4
|
+
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(n,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:r})}):/* @__PURE__ */o(t,{"aria-label":s,size:r,onClick:c,children:l})})}var f=s(function({invalid:n,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",v=`${t?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),N=
|
|
5
|
+
/* @__PURE__ */o("input",{ref:f,"aria-invalid":n||void 0,readOnly:u,className:e({invalid:n,size:s,readOnly:u,className:[v,c].filter(Boolean).join(" ")}),...h});return t||i||a?/* @__PURE__ */l("div",{className:"relative",children:[t&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${r}`,children:t}),N,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:g})}):i&&/* @__PURE__ */o("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:i})]}):N});export{u as END_ACTIONS_PAD,c as INPUT_END_ACTION_SIZE,d as InputEndActionButton,p as InputEndActionSlot,f as Input_default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TYPE_SCALE as t,FONT_WEIGHTS as o}from"./chunk-LH7IKIGE.js";import{textWidth as n}from"./chunk-UVCMV2TL.js";import{SPACING_ROLES as e,SPACING_SCALE as m}from"./chunk-AW7TOB6N.js";import{statusLabel as r}from"./chunk-
|
|
1
|
+
import{TYPE_SCALE as t,FONT_WEIGHTS as o}from"./chunk-LH7IKIGE.js";import{textWidth as n}from"./chunk-UVCMV2TL.js";import{SPACING_ROLES as e,SPACING_SCALE as m}from"./chunk-AW7TOB6N.js";import{statusLabel as r}from"./chunk-EDRELF6L.js";var c=e.controlX,u=m[4],i=t[2],d=o.control,f=.625*i,h=m[1];function p(t){const o="undefined"!=typeof document&&document.body?getComputedStyle(document.body).fontFamily:"";return o?n(t,`${d} ${i}px ${o}`)??t.length*f:t.length*f}function a(t){const o=Object.entries(t).map(([t,o])=>!0===o?r(t):o),n=Math.max(0,...o.map(p)),e=Math.ceil((n+2*c+2*u)/h)*h;return{defaultWidth:e,minWidth:e}}export{c as BADGE_X,u as CELL_X,a as statusColumn};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useColumnConfig as e}from"./chunk-XGEN76DG.js";import{useClickOutside as t}from"./chunk-SI26KESU.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-G3TC2GIA.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.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,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:G,onDragOver:R,onDrop:I,onDragEnd:$,toggleColumn:P,resetColumns:T,draggedIdx:A,dropGap:E}=e(f,S),{hasAnyPerm:L}=r(),O=i().columns,[W,Y]=c(!1),[B,F]=c(!1),[H,J]=c(!1),K=m(null),Q=k.length>0&&L(k);t(K,h(()=>{W&&Y(!1)},[W]));const U=C.reduce((e,t)=>e+t.width,0),V=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:U,minWidth:"100%"},X=m(null),q=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),Z=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:
|
|
3
|
+
/* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
4
4
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[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 ${A===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>
|
|
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=>
|
|
6
|
+
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${A===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>G(t),onDragOver:a?void 0:e=>R(t,e),onDrop:a?void 0:e=>I(t,e),onDragEnd:a?void 0:$,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"})}),E===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&&E===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
8
|
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:q,children:[
|
|
9
9
|
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
10
10
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[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:T,className:"text-2xs text-ink-faintest hover:text-gray-600",children:
|
|
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:K,children:[w&&Z&&/* @__PURE__ */p("button",{onClick:()=>j(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?O.hideSelection:O.showSelection,children:D?O.selectDone:O.select}),
|
|
13
|
+
/* @__PURE__ */p("button",{onClick:T,className:"text-2xs text-ink-faintest hover:text-gray-600",children:O.reset}),
|
|
14
|
+
/* @__PURE__ */p("button",{onClick:()=>Y(!W),className:"text-gray-400 hover:text-gray-600",title:O.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),W&&/* @__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:O.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)),Q&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{F(!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})),J(!0),setTimeout(()=>J(!1),2e3)}catch{}F(!1)},disabled:B,className:"text-2xs w-full text-center py-1 rounded "+(H?"text-green-600":"text-ink-faint hover:text-blue-600"),children:B?"...":H?O.savedDefault:O.saveDefault})})]})]})]})]})}export{f as ResizableTable};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Input_default as e}from"./chunk-
|
|
1
|
+
import{Input_default as e}from"./chunk-W6REY3SV.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 +1 @@
|
|
|
1
|
-
import{useDefaultColumnConfig as e}from"./chunk-ULJQYXHB.js";import{useShellPrefs as t}from"./chunk-
|
|
1
|
+
import{useDefaultColumnConfig as e}from"./chunk-ULJQYXHB.js";import{useShellPrefs as t}from"./chunk-POBVGDZP.js";import{useState as n,useRef as r,useCallback as i,useEffect as d}from"react";function l(e,t){return e.length===t.length&&e.every((e,n)=>e.key===t[n].key&&e.width===t[n].width&&!!e.hidden==!!t[n].hidden)}function o(e){const t=e.findIndex(e=>"_select"===e.key);if(t>=0){const[n]=e.splice(t,1);n.hidden=!1,e.unshift(n)}return e}function u(u,c){const{prefs:s,save:a}=t(),f=`columns_${u}`,y=s[f],{defaultConfig:h}=e(u),[k,m]=n(()=>{const e="undefined"==typeof window?null:localStorage.getItem(`col-config-${u}`);if(e)try{const t=JSON.parse(e),n=new Set(t.map(e=>e.key));return o([...t.filter(e=>c.some(t=>t.key===e.key)),...c.filter(e=>!n.has(e.key)).map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden}))])}catch{}return o(c.map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden})))}),[p,g]=n(null),[w,v]=n(null),S=r(null),x=r(!1),I=r(y);I.current=y;const W=r(null),D=r(a);D.current=a;const O=i(e=>{x.current=!0,localStorage.setItem(`col-config-${u}`,JSON.stringify(e)),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{D.current({[f]:e})},1e3)},[u,f]);d(()=>{if(x.current||!Array.isArray(y))return;const e=new Set(y.map(e=>e.key)),t=o([...y.filter(e=>c.some(t=>t.key===e.key)).map(e=>({...e})),...c.filter(t=>!e.has(t.key)).map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden}))]);m(e=>l(e,t)?e:t),localStorage.setItem(`col-config-${u}`,JSON.stringify(t))},[u,y]),d(()=>{if(x.current||Array.isArray(I.current))return;const e=h?.visible_columns;if(!Array.isArray(e)||0===e.length)return;const t=new Set(e),n=o(c.map(e=>({key:e.key,width:e.defaultWidth||150,hidden:!t.has(e.key)})));m(e=>l(e,n)?e:n),localStorage.setItem(`col-config-${u}`,JSON.stringify(n))},[u,h]);const A=r(/* @__PURE__ */new Map);d(()=>{m(e=>function(e,t,n){const r=new Set(t.map(e=>e.key)),i=new Set(e.map(e=>e.key)),d=t.filter(e=>!i.has(e.key)),l=e.filter(e=>"_select"===e.key||r.has(e.key));if(!d.length&&l.length===e.length)return e;for(const t of e)"_select"===t.key||r.has(t.key)||n.set(t.key,t);const u=[...l];for(const e of d){let r=-1;for(let n=t.indexOf(e)-1;n>=0;n-=1){const e=u.findIndex(e=>e.key===t[n].key);if(e>=0){r=e;break}}u.splice(r+1,0,n.get(e.key)??{key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden}),n.delete(e.key)}return o(u)}(e,c,A.current))},[c]);const C=k.filter(e=>!e.hidden),H=i((e,t)=>{t.preventDefault(),t.stopPropagation();const n=C[e],r=k.findIndex(e=>e.key===n.key),i=c.find(e=>e.key===k[r].key)?.minWidth??0;S.current={idx:r,startX:t.clientX,startWidth:Math.max(k[r].width,i)};const d=e=>{if(!S.current)return;const{idx:t,startX:n,startWidth:r}=S.current,i=c.find(e=>e.key===k[t].key)?.minWidth||30,d=Math.max(i,r+e.clientX-n);m(e=>{const n=[...e];return n[t]={...n[t],width:d},n})},l=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",l),S.current=null,m(e=>(O(e),e))};document.addEventListener("mousemove",d),document.addEventListener("mouseup",l)},[k,C,c,O]),X=i(e=>{g(e)},[]),_=i((e,t)=>{if(t.preventDefault(),null===p)return;const n=t.currentTarget.getBoundingClientRect();let r=t.clientX<n.left+n.width/2?e:e+1;const i=k.filter(e=>!e.hidden);"_select"===i[0]?.key&&0===r&&(r=1),v(r)},[p,k]),E=i((e,t)=>(t.preventDefault(),null===p||null===w||w===p||w===p+1?(g(null),void v(null)):(m(e=>{const t=e.filter(e=>!e.hidden),n=t[p];if(!n)return e;const r=e.findIndex(e=>e.key===n.key);let i;i=w<t.length?e.findIndex(e=>e.key===t[w].key):e.findIndex(e=>e.key===t[t.length-1].key)+1;const d=[...e],[l]=d.splice(r,1);return d.splice(i>r?i-1:i,0,l),O(d),d}),g(null),void v(null))),[p,w,O]),J=i(()=>{g(null),v(null)},[]),L=i(e=>{m(t=>{const n=t.map(t=>t.key===e?{...t,hidden:!t.hidden}:t);return 0===n.filter(e=>!e.hidden).length?t:(O(n),n)})},[O]),$=i(()=>{const e=o(c.map(e=>({key:e.key,width:e.defaultWidth||150,hidden:e.defaultHidden})));m(e),O(e)},[c,O]);return{orderedColumns:C.map(e=>{const t=c.find(t=>t.key===e.key);return{...t,width:Math.max(e.width,t?.minWidth??0)}}).filter(Boolean),allColumns:k.map(e=>{const t=c.find(t=>t.key===e.key);return{key:e.key,label:t?.label||e.key,hidden:!!e.hidden}}),onResizeStart:H,onDragStart:X,onDragOver:_,onDrop:E,onDragEnd:J,toggleColumn:L,resetColumns:$,draggedIdx:p,dropGap:w}}export{u as useColumnConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-PFOTEDSQ.js";import{Tooltip as n}from"./chunk-
|
|
1
|
+
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-PFOTEDSQ.js";import{Tooltip as n}from"./chunk-AJPQJ7TC.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{createContext as o,useRef as a,useState as i,useEffect as l,useContext as s}from"react";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";var h=o({labels:"none",shown:"none"}),f="button[data-icon-rail-button]:not([disabled])";function b(e,t,n){const r=getComputedStyle(e),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a="horizontal"===t?(parseFloat(r.columnGap)||0)*Math.max(0,n-1):0,i=e.parentElement;let l=1/0;if(i){const e=getComputedStyle(i);l=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:o+a,room:l}}function m({"aria-label":t,orientation:n="vertical",children:o,className:s="",labels:d="none",labelsFit:u=!1,onLabelsShown:m}){const p=a(null),g="none"!==d&&u,[v,y]=i(null),w="none"===d?"none":g?v??"none":"all",x=a(()=>{});x.current=()=>{const t=p.current;if(!t||!g)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=parseFloat(n.minWidth)||0,a=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(o,r+a),worded:"below"===t?Math.max(o,r+Math.max(a,i)):Math.max(o,r+a+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(t,d);y(e({buttons:r,orientation:n,...b(t,n,r.length)}))},r(()=>{x.current()}),l(()=>{const e=p.current?.parentElement;if(!g||!e)return;let t=!0;const n=()=>{t&&x.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[g]);const F=a(null),k=a(m);k.current=m,l(()=>{g&&null!==v&&F.current!==v&&(F.current=v,k.current?.(v))},[g,v]),r(()=>{const e=p.current;if(!e)return;const t=[...e.querySelectorAll(f)];if(0===t.length)return;const n=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===n?0:-1});/* @__PURE__ */
|
|
2
2
|
return c("div",{ref:p,role:"toolbar","aria-label":t,"aria-orientation":n,"data-orientation":n,onKeyDown:e=>{const t=p.current;if(!t)return;const r=[...t.querySelectorAll(f)],o=r.indexOf(e.target);if(o<0)return;const a="vertical"===n?"ArrowUp":"ArrowLeft",i="vertical"===n?"ArrowDown":"ArrowRight",l=e.key===i?(o+1)%r.length:e.key===a?(o-1+r.length)%r.length:"Home"===e.key?0:"End"===e.key?r.length-1:-1;if(!(l<0)){e.preventDefault();for(const e of r)e.tabIndex=e===r[l]?0:-1;r[l].focus()}},"data-labels":"none"===d?void 0:d,"data-labels-shown":"none"===d?void 0:w,className:`flex gap-2 ${"vertical"===n?"flex-col items-center":"flex-row items-center"} ${s}`.trim(),children:/* @__PURE__ */c(h.Provider,{value:{labels:d,shown:w},children:o})})}function p({label:e,icon:r,active:o,disabled:a,onClick:i,badge:l,tooltipSide:f="right",className:b=""}){const m=!0===o,{labels:p,shown:g}=s(h),v=void 0===l||!1===l||0===l?r:/* @__PURE__ */c(t,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:r}),y="none"!==p,w=y&&("all"===g||"chosen"===g&&m),x=/* @__PURE__ */c("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof o?o:void 0,disabled:a,onClick:a?void 0:i,className:[`relative inline-flex ${y?"beside"===p?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",m?"bg-accent-tint text-blue-700":"text-gray-600 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest",b].filter(Boolean).join(" "),children:y?/* @__PURE__ */d(u,{children:[
|
|
3
3
|
/* @__PURE__ */c("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:v}),
|
|
4
4
|
/* @__PURE__ */c("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",w?"beside"===p?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):v});/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-6NXPOZ6X.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-6NXPOZ6X.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-MEP6CZJ3.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-6IP4Q3AT.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -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-RTK77DMP.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__ */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-CXEELIRW.js";import{MarqueeBox as r}from"./chunk-IC72MGON.js";import{EmptyState as a}from"./chunk-W3454ZES.js";import{ImageLightbox as i}from"./chunk-NDCS4COQ.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-DTFX624I.js";import{Breadcrumbs as d}from"./chunk-WREUA43Q.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-UFJR63AO.js";import{useMediaMoveItems as u}from"./chunk-GRAFJD3L.js";import{MediaUsedInList as m}from"./chunk-U75MSD4F.js";import{RenameField as p}from"./chunk-WYAKASF3.js";import{NativeSelect as h}from"./chunk-EBODRYXS.js";import{MediaUploadGrid as f}from"./chunk-Y5RTVKMB.js";import{useGridSelection as g}from"./chunk-VLKDWKVR.js";import{useMarquee as v}from"./chunk-OLFYNMTD.js";import{copyToClipboard as k}from"./chunk-XYVFJLAU.js";import{Segmented as y}from"./chunk-ALZHFQRX.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-5O4HMXPQ.js";import{Banner as C}from"./chunk-OSMRYND3.js";import{Input_default as N}from"./chunk-W6REY3SV.js";import{useFileIntake as I,FileIntakeAlert as D}from"./chunk-TNGIXSTM.js";import{setModalDragAside as S,modalIdHolding as j}from"./chunk-EIFNESXS.js";import{ColoredBadge as z}from"./chunk-6X32SWQI.js";import{DropdownMenu as F}from"./chunk-M5IZ7QLQ.js";import{IconButton_default as L}from"./chunk-MYH5H43C.js";import{Button_default as T}from"./chunk-MEP6CZJ3.js";import{Icon as E}from"./chunk-ISVODSRP.js";import{Tooltip as O}from"./chunk-AJPQJ7TC.js";import{buttonClasses as A}from"./chunk-UQYNPYF4.js";import{usePlotWidth as M}from"./chunk-MAFUXCPZ.js";import{useShellStrings as P}from"./chunk-NRHG4R2Q.js";import{useRef as R,useMemo as U,useCallback as K,useState as Q,useEffect as B}from"react";import{jsxs as J,Fragment as W,jsx as X}from"react/jsx-runtime";var Y="application/x-efficient-media-files",H="application/x-efficient-media-folder",V="application/x-efficient-media-file";function G(e){if(!e||!Array.from(e.types).includes(V))return null;try{const n=JSON.parse(e.getData(V));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var $={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */X(E,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */X(E,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */X(E,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */X(E,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */X(E,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */X(E,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */X(E,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */X(E,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */X(E,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */X(E,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */X(E,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */X(E,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */X(E,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */X(E,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */X(E,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */X(E,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},q={link:/* @__PURE__ */X(E,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */X(E,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */X(E,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */X(E,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(E){const{mode:G="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:re,allFilesCount:ae,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=$,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:xe,onNewFolder:Ce,onRename:Ne,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:je,onDeleteForever:ze,onEmptyTrash:Fe,onReplace:Le,onCropEdit:Te,onOpenInDesign:Ee,onChoose:Oe,onCancel:Ae,pickNote:Me,onDragOut:Pe,className:Re=""}=E,Ue=P().mediaLibrary,Ke=P().media,Qe="pick"===G,Be=!Qe,Je=R(null),We=M(Je,"phone"===_?343:1200),Xe="phone"===_||"auto"===_&&We<640,Ye=U(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,r)=>{for(const a of e){const e=[...r,a];n.set(a.id,{node:a,path:e}),a.children&&l(a.children,e)}};return l(e,[]),n}(re),[re]),He=U(()=>new Map(le.map(e=>[e.id,e])),[le]),Ve=U(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&He.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,He]),Ge=K(e=>{const n=[];for(let l=e?He.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?He.get(l.parentId):void 0);return n},[He,le.length]),$e=K((e,n)=>Ge(e).some(e=>e.id===n),[Ge]),[Ze,qe]=Q(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>qe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=K(e=>{qe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;B(()=>{if("files"===ee.place)en(["@files",...Ge(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const rn="products"===ee.place,an="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=rn&&ee.nodeId?Ye.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Ue.readOnly} ${Ue.editedAtHq(e.sharedFrom)}`:Ue.readOnly,cn=U(()=>te.map(e=>e.id),[te]),un=U(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=g(cn),pn=U(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=R(!0);B(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");B(()=>{he&&mn.setSelection(he)},[gn]);const vn=R(gn??""),kn=pn.join("\0");B(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Qe?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=Q(null),xn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?He.get(n.id)?.name:un.get(n.id)?.name)&&Ne?.(n,e)},Cn=async e=>{if(!Ce)return;const n=await Ce(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Nn=K(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Ue.alreadyHere:void 0;const l=He.get(e.id);return n===e.id||n&&$e(n,e.id)?Ue.notIntoItself:(l?.parentId??null)===n?Ue.folderAlreadyHere:void 0};n.push({key:s,label:Ue.allFiles,disabledReason:l(null)});const r=(e,a)=>{for(const i of Ve.get(e)??[])n.push({key:i.id,label:i.name,depth:a,disabledReason:l(i.id)}),r(i.id,a+1)};return r(null,1),n},[Ve,He,tn,$e,on,Ue]),In=K(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=Q(null),jn={words:Ue,media:Ke,denied:ve,moveTargets:Nn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:Ce&&Be?e=>{Cn(e)}:void 0,rename:Ne&&Be?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&Be?Ie:void 0,trash:De&&Be?De:void 0,deleteFolder:Se&&Be?Se:void 0,folderNotEmpty:e=>!!He.get(e)?.notEmpty,replace:Le&&Be?Le:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&k(Ue.urlLabel,n)},openInDesign:Ee,restore:je,deleteForever:ze},zn=e=>c(e,jn),Fn=w(),Ln=(e,n)=>{Qe||(mn.isSelected(e)||mn.select(e),Fn.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return rn?{kind:"render",id:e}:an?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Tn,En]=Q(null),[On,An]=Q(null),[Mn,Pn]=Q(null);B(()=>{if(!On&&!Tn)return;const e=()=>{An(null),En(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,Tn]);const Rn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Un=(e,n)=>!(!Ie||ve.move||Qe)&&(!!Rn(e,Y)||!(!Rn(e,H)||!Mn)&&(n!==Mn&&!(n&&$e(n,Mn)))),Kn=(e,n)=>({onDragEnter:l=>{Un(l,n)&&(l.preventDefault(),En(e))},onDragOver:l=>{Un(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Tn!==e&&En(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||En(n=>n===e?null:n)},onDrop:e=>{if(Un(e,n))if(e.preventDefault(),En(null),Rn(e,Y)){let l;try{l=JSON.parse(e.dataTransfer.getData(Y))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else Mn&&(Ie({kind:"folder",id:Mn},n),Pn(null))}}),Qn=e=>{const n=e=>Rn(e,Y)||Rn(e,H)||Rn(e,"Files");return{onDragEnter:l=>{n(l)&&An(e)},onDragOver:l=>{n(l)&&On!==e&&An(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||An(n=>n===e?null:n)}}},Bn=(e,n,l)=>/* @__PURE__ */X(O,{side:"right",content:On===e?Ue.noDropProducts:sn(l),open:On===e||!On&&void 0,children:/* @__PURE__ */X("span",{children:n})}),Jn=e=>({onContextMenu:n=>{Fn.open(n,e)}}),Wn=(e,r,a)=>e.map(e=>{const i=`p:${e.id}`,t=a??e,o=Ze.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return J("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */X(n,{label:Bn(i,e.name,t),level:r,icon:d&&o?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:rn&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Qn(i),...Be?Jn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */X(l,{children:Wn(d,r+1,t)})]},e.id)}),Xn=(e,r)=>(Ve.get(e)??[]).map(e=>{const a=Ve.get(e.id),i=Ze.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=zn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return J("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */X(n,{label:e.name,level:r,icon:a&&i?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:a?i:void 0,onToggle:a?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:Tn===e.id?"into":void 0,dragging:Mn===e.id,draggable:Be&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */X(p,{value:e.name,label:Ue.folderName,onDone:xn}):void 0,actions:Be&&o.length?/* @__PURE__ */X(F,{align:"end","aria-label":Ue.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Kn(e.id,e.id),...Be?Jn({kind:"folder",id:e.id}):{},...Be&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(H,e.id),Pn(e.id)},onDragEnd:()=>{Pn(null),En(null)}}:{}}}),a&&i&&/* @__PURE__ */X(l,{children:Xn(e.id,r+1)})]},e.id)}),Yn=Ze.has("@files"),Hn=Ze.has("@products"),Vn=/* @__PURE__ */J(e,{"aria-label":Ue.folders,children:[re&&/* @__PURE__ */J(W,{children:[
|
|
6
|
+
/* @__PURE__ */X(n,{label:Bn("@products",Ue.products),level:1,icon:Z.lock,badge:{label:Ue.readOnlyBadge,tone:"neutral"},expanded:re.length?Hn:void 0,onToggle:()=>_e("@products"),selected:rn&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Qn("@products")}}),Hn&&re.length>0&&/* @__PURE__ */X(l,{children:Wn(re,2)})]}),
|
|
7
|
+
/* @__PURE__ */X(n,{label:Ue.allFiles,level:1,icon:Yn?Z.folderOpen:Z.folder,count:ae,countLabel:null!=ae?Ue.fileCount(ae):void 0,expanded:Ve.get(null)?.length?Yn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===Tn?"into":void 0,rowProps:{"data-media-row":"@files",...Kn("@files",null)}}),Yn&&(Ve.get(null)?.length??0)>0&&/* @__PURE__ */X(l,{children:Xn(null,2)}),Be&&/* @__PURE__ */X(n,{label:Ue.trash,level:1,icon:Z.trash,count:ie,countLabel:null!=ie?Ue.fileCount(ie):void 0,selected:an,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Gn=(()=>{if(an)return[{label:Ue.trash}];if(rn){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];return[{label:Ue.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=Ge(on);return[{label:Ue.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),$n=rn?Ue.readOnly:ve.upload,Zn=!!xe&&!an&&!$n,qn=I({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!Zn,onAccept:e=>xe?.(e,on)}),_n=rn?Ue.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */J("div",{className:"flex flex-wrap items-center gap-2",children:[Be&&Ce&&!an&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{Cn(on)},...el(_n),children:Ue.newFolder}),xe&&!an&&/* @__PURE__ */X(T,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>qn.open(),...el($n),children:Ue.upload}),Be&&an&&Fe&&te.length>0&&/* @__PURE__ */X(T,{variant:"danger",size:"sm",onClick:Fe,...el(ve.deleteForever),children:Ue.emptyTrash})]}),ll=(e,n,l,r,a)=>/* @__PURE__ */X("div",{style:{width:Xe?void 0:a,flex:Xe?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */X(h,{size:"sm","aria-label":e,value:n,onChange:r,options:l})},e),rl=e=>n=>ce?.({...se,[e]:n}),al=/* @__PURE__ */J("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */X("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */X(N,{size:"sm",type:"search",leftIcon:Z.search,placeholder:rn?Ue.searchProducts:Ue.search,"aria-label":rn?Ue.searchProducts:Ue.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Ue.mediaType,se.type,[{value:"all",label:Ue.allTypes},{value:"image",label:Ue.images},{value:"video",label:Ue.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],rl("type"),130),ce&&!rn&&!an&&ll(Ue.use,se.use,[{value:"any",label:Ue.anyUse},{value:"email",label:Ue.emailOnly},{value:"website",label:Ue.websiteOnly},{value:"unused",label:Ue.notUsed}],rl("use"),130),ce&&Be&&ll(Ue.sort,se.sort,[{value:"newest",label:Ue.newest},{value:"name",label:Ue.byName},{value:"size",label:Ue.bySize}],rl("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */X(y,{size:"sm",label:Ue.view,value:me,onChange:pe,options:[{value:"grid",label:Ue.grid,icon:Z.grid},{value:"list",label:Ue.list,icon:Z.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ue.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:q.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ue.used(e.usedCount),count:e.usedCount,icon:q.link,tone:"active"}),e.email&&n.push({key:"e",label:Ue.email,icon:q.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ue.private,icon:q.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */X(z,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=Be&&tn&&!!Ie&&!ve.move,dl=!!Pe&&!an,sl=R(""),cl=R(null),ul=()=>cl.current?.dropped?"dropped":"cancelled",ml=R(Pe);ml.current=Pe;const pl=K(e=>{const n=cl.current;n&&(cl.current=null,n.stop(),S(sl.current,!1),e&&ml.current?.(e))},[]),hl=K(e=>{pl(ul());const n=Je.current?.ownerDocument;if(!n)return;sl.current=j(Je.current);const l=Je.current?.closest("[data-modal-panel]"),r=e=>{sl.current&&!l?.contains(e.target)&&S(sl.current,!0)},a=()=>!!e&&!e.isConnected,i=()=>{const e=cl.current;if(e){if(a())return pl("dropped");e.dropped=!0,S(sl.current,!1)}},t=e=>{const n=e.dataTransfer?.dropEffect;pl(n&&"none"!==n?"dropped":a()?ul():"cancelled")},o=()=>{a()&&pl(ul())},d=["pointermove","pointerdown","mousemove","mousedown"];n.addEventListener("dragover",r,!0),n.addEventListener("drop",i,!0),n.addEventListener("dragend",t,!0);for(const e of d)n.addEventListener(e,o,!0);cl.current={dropped:!1,stop:()=>{n.removeEventListener("dragover",r,!0),n.removeEventListener("drop",i,!0),n.removeEventListener("dragend",t,!0);for(const e of d)n.removeEventListener(e,o,!0)}}},[pl]);B(()=>()=>pl(ul()),[pl]);const fl=(e,n,l)=>{if("start"!==e)return;const r=un.get(n);r&&gl(r)&&(hl(l??null),Pe(e))},gl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),vl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):gl(e),...ol&&gl(e)?{dragAlso:{[V]:gl(e)}}:{}})),kl=Xe?Math.max(72,Math.floor((We-24-16-1)/3)):112,yl=R(null),bl=v({containerRef:yl,enabled:Be&&!Xe&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),wl=e=>{if(Qe){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},xl=te.length?null:oe?/* @__PURE__ */X(a,{variant:"dashed",title:Ue.noMatches}):rn?/* @__PURE__ */X(a,{variant:"dashed",title:Ue.emptyProducts,description:sn(dn)}):an?/* @__PURE__ */X(a,{variant:"dashed",title:Ue.trashEmpty}):!Zn||Qe?/* @__PURE__ */X(a,{variant:"dashed",title:Ue.emptyFolder}):null,Cl="list"===me&&te.length>0,Nl=xl??(Cl?/* @__PURE__ */X("ul",{role:"listbox","aria-multiselectable":Be||void 0,"aria-label":Ue.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */J("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>wl(e.id),onContextMenu:n=>Ln(e.id,n),draggable:!!gl(e)||void 0,onDragStart:gl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(V,gl(e)),fl("start",e.id,n.currentTarget)}:void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
8
|
+
/* @__PURE__ */X("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */X("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */X("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */X("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */X(f,{items:vl,readOnly:!Zn||Qe,onFiles:Zn&&!Qe?e=>xe(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:kl,dragType:ol?Y:dl?V:void 0,onDragOutChange:dl?(e,n,l)=>fl(e,n,l):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:wl,onItemContextMenu:Be?Ln:void 0,menuOnMedia:Be})),Il=u({count:pn.length,kind:In(pn),targets:Nn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===s?null:e.key)}),Dl=A({variant:"secondary",size:"sm"}),Sl=/* @__PURE__ */X(F,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */J(W,{children:[Z.folder,Ue.moveTo]}),items:Il,disabled:!!ve.move}),jl=Be&&pn.length>1&&!rn?/* @__PURE__ */J("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
11
|
+
/* @__PURE__ */X(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Ue.selected(pn.length)}),/* @__PURE__ */J(W,an?{children:[je&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>je(pn),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */X(T,{variant:"secondary-danger",size:"sm",onClick:()=>ze(pn),...el(ve.deleteForever),children:Ue.deleteForever})]}:{children:[Ie&&Sl,Ne&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Ue.rename}),De&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Ue.moveFilesToTrash(pn.length)})]}),
|
|
12
|
+
/* @__PURE__ */X(T,{variant:"ghost",size:"sm",onClick:mn.clear,children:Ue.clearSelection})]}):null,zl=e=>{const n=[],l=(e,l,r)=>{null!=r&&""!==r&&n.push({key:e,label:l,value:r})},r="file"===bn?.kind&&bn.id===e.id;l("name",Ue.name,r?/* @__PURE__ */X(p,{value:e.name,label:Ue.fileName,onDone:xn}):e.name),l("type",Ue.type,e.typeLabel),l("size",Ue.size,e.sizeLabel),l("resolution",Ue.resolution,e.resolution),rn?(l("design",Ue.design,e.design),l("finish",Ue.finish,e.finish),l("angle",Ue.angleLug,e.angleLug),l("owner",Ue.owner,e.owner)):(l("added",Ue.addedBy,e.addedBy),l("folder",Ue.folder,e.folderPath)),l("used",Ue.usedIn,null!=e.usedCount?Ue.places(e.usedCount):void 0);const a=c({kind:"files",ids:[e.id]},jn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return J("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */X("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),rn&&/* @__PURE__ */X(C,{tone:"neutral",title:Ue.readOnlyBadge,children:sn(dn)}),
|
|
15
|
+
/* @__PURE__ */X(t,{size:"sm",columns:1,items:n}),!an&&/* @__PURE__ */J("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */X("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */X(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ue.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>jn.copyUrl(e.id),children:Ue.copyUrl})]}),tn&&Be&&/* @__PURE__ */J("div",{className:"flex flex-wrap gap-2",children:[Le&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>Le(e.id),...el(ve.replace),children:Ue.replace}),Te&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>Te(e.id),children:Ue.cropEdit}),Ie&&"submenu"===a?.type&&/* @__PURE__ */X(F,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */J(W,{children:[Z.folder,Ue.moveTo]}),items:a.items,disabled:!!ve.move}),Ne&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Ue.rename}),De&&/* @__PURE__ */X(L,{"aria-label":Ue.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:Z.trash})]}),an&&Be&&/* @__PURE__ */J("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */X(T,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>je([e.id]),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */X(T,{variant:"danger",size:"sm",onClick:()=>ze([e.id]),...el(ve.deleteForever),children:Ue.deleteForever})]}),rn&&Ee&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>Ee({kind:"render",id:e.id}),children:Ue.openInDesign}),ge&&/* @__PURE__ */X(m,{items:ge})]})},Fl=hn?hn.private?Ue.privateNoPick:hn.pickDisabledReason:void 0,Ll=Qe?/* @__PURE__ */J("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
18
|
+
/* @__PURE__ */X("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Ue.oneChosen(hn.name):Ue.noneChosen}),
|
|
19
|
+
/* @__PURE__ */J("div",{className:"flex gap-2",children:[Ae&&/* @__PURE__ */X(T,{variant:"secondary",size:"sm",onClick:Ae,children:Ue.cancel}),
|
|
20
|
+
/* @__PURE__ */X(T,{variant:"primary",size:"sm",disabled:!hn,...el(Fl),onClick:()=>{hn&&!Fl&&Oe?.(hn)},children:Ue.chooseImage})]})]}):null,Tl=Be&&!!hn,El=/* @__PURE__ */J("div",{className:"flex min-w-0 flex-col gap-3",children:[Me&&/* @__PURE__ */X(C,{tone:"neutral",children:Me}),
|
|
21
|
+
/* @__PURE__ */J("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */X(d,{items:Gn}),nl]}),al,jl,
|
|
23
|
+
/* @__PURE__ */J("div",{ref:yl,className:"relative",onPointerDown:bl.onPointerDown,onKeyDown:e=>{Be&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Nl,
|
|
24
|
+
/* @__PURE__ */X(r,{rect:bl.rect})]}),Zn&&/* @__PURE__ */X("input",{...qn.inputProps}),
|
|
25
|
+
/* @__PURE__ */X(D,{rejections:qn.rejections})]});/* @__PURE__ */
|
|
26
|
+
return J("div",{ref:Je,"data-media-library":"","data-layout":Xe?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Re}`.trim(),children:[/* @__PURE__ */J("div",Xe?{className:"flex flex-col gap-3 p-3",children:[Vn,El]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */X("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Vn}),
|
|
28
|
+
/* @__PURE__ */X("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:El}),Tl&&/* @__PURE__ */X("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:zl(hn)})]}),Ll,Xe&&/* @__PURE__ */X(o,{open:Tl,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&zl(hn)}),Fn.state&&/* @__PURE__ */X(x,{...Fn.props,items:zn(Fn.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */X(i,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{Y as MEDIA_FILES_DRAG_TYPE,V as MEDIA_FILE_DRAG_TYPE,H as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,G as readMediaFileDrag};
|