efficient-shell 15.2.0 → 15.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-42QAXKYW.js → Browser-QK2CCZTR.js} +19 -19
- package/dist/Calculator-DB4U2KXJ.js +29 -0
- package/dist/{CurrencyConverter-VFTDSYQ3.js → CurrencyConverter-D5MWU2M2.js} +9 -9
- package/dist/{Files-OAVWF6EW.js → Files-6WMIQAVD.js} +74 -74
- package/dist/{Notepad-LNNSVEFG.js → Notepad-FKSRP7R6.js} +9 -9
- package/dist/PdfViewer-AIAVQYZ6.js +1 -0
- package/dist/PomodoroTimer-U62N64F6.js +91 -0
- package/dist/{Preview-GDNUQKGN.js → Preview-2GS2CWRA.js} +43 -43
- package/dist/Sidebar-KAALEIIX.js +44 -0
- package/dist/{Stock-NNDDNQBJ.js → Stock-DUXAE4DY.js} +3 -3
- package/dist/{Weather-NGQALCXO.js → Weather-XXPZTLY7.js} +22 -22
- package/dist/{WorldClock-LX4BQPZJ.js → WorldClock-6ANSNTXU.js} +7 -7
- package/dist/ai/index.js +40 -40
- 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-JVITCC65.js → chunk-26ZOXLE6.js} +1 -1
- package/dist/chunk-2RLUG5ID.js +1 -0
- package/dist/{chunk-ZC2FZLYX.js → chunk-345FP3IX.js} +4 -4
- package/dist/chunk-35Q7ZMQD.js +8 -0
- package/dist/{chunk-ZYWLX5EK.js → chunk-3AVXNZY5.js} +1 -1
- package/dist/chunk-3FININUU.js +1 -0
- package/dist/chunk-3H476JWK.js +4 -0
- package/dist/chunk-422SFOQU.js +28 -0
- package/dist/{chunk-QQ6TGD7K.js → chunk-4KPOTWYF.js} +47 -47
- package/dist/{chunk-TWSROAS7.js → chunk-4MDSZSLC.js} +1 -1
- package/dist/{chunk-DXTRHNP4.js → chunk-4NTAZLT3.js} +2 -2
- package/dist/{chunk-TVMDDQJP.js → chunk-52RSW6TO.js} +1 -1
- package/dist/{chunk-26I3OTGP.js → chunk-5B7CLXHC.js} +1 -1
- package/dist/{chunk-SXNT73VT.js → chunk-5LB7LCEG.js} +19 -19
- package/dist/{chunk-CMC25URA.js → chunk-5LG6TOV6.js} +6 -6
- package/dist/{chunk-IIUFCTT6.js → chunk-5OXQ5M5S.js} +1 -1
- package/dist/{chunk-AVUH35GW.js → chunk-5QHNDAZ6.js} +1 -1
- package/dist/{chunk-52YTUQW3.js → chunk-5QRHQCRG.js} +1 -1
- package/dist/{chunk-T43ATI2N.js → chunk-5RCKE4X2.js} +6 -6
- package/dist/{chunk-LFGJUJRZ.js → chunk-5Y2JZL3I.js} +13 -13
- package/dist/{chunk-QIAJ3QNV.js → chunk-62UNBUTU.js} +1 -1
- package/dist/chunk-A4ROXNUF.js +2 -0
- package/dist/{chunk-PAD65HG7.js → chunk-ABIWAS5K.js} +1 -1
- package/dist/{chunk-3TVMQCYR.js → chunk-AKEED2BC.js} +1 -1
- package/dist/chunk-APFDZ2HG.js +1 -0
- package/dist/{chunk-S3F2TY7X.js → chunk-ASNRA3ZL.js} +1 -1
- package/dist/{chunk-QI2LJ7OL.js → chunk-B4Y5NGHR.js} +9 -9
- package/dist/{chunk-ZZKBCNK6.js → chunk-BTMZ5MUY.js} +11 -11
- package/dist/chunk-C4TG6XS4.js +19 -0
- package/dist/{chunk-NXPIX7NO.js → chunk-C75ICYHF.js} +1 -1
- package/dist/{chunk-JJ5W4BRW.js → chunk-CGX2IGQO.js} +1 -1
- package/dist/{chunk-2MUZFHZW.js → chunk-CIZAUBWA.js} +6 -6
- package/dist/{chunk-5JQCWXIQ.js → chunk-CMEPDSYB.js} +1 -1
- package/dist/{chunk-JHEHW5BE.js → chunk-D7MRZZVV.js} +3 -3
- package/dist/chunk-DEV3ZHPP.js +8 -0
- package/dist/chunk-DN6NGGP5.js +8 -0
- package/dist/{chunk-OEZC5N6J.js → chunk-E43VGO66.js} +1 -1
- package/dist/{chunk-7ZJ7VK2N.js → chunk-EJ5NIA42.js} +1 -1
- package/dist/{chunk-M5JEYZ3A.js → chunk-EJMCK7E3.js} +4 -4
- package/dist/{chunk-GBCLIWUQ.js → chunk-EULBBS5L.js} +1 -1
- package/dist/{chunk-7FYTL6SD.js → chunk-FAPZFMS3.js} +1 -1
- package/dist/chunk-FGP2IOFN.js +15 -0
- package/dist/{chunk-ABRCV7DQ.js → chunk-FHTL7ZZR.js} +1 -1
- package/dist/{chunk-KWBYE5MN.js → chunk-GGNQEZ2D.js} +8 -8
- package/dist/{chunk-NBV3XK3Q.js → chunk-GL3D5EOZ.js} +2 -2
- package/dist/{chunk-VQ3OSYTA.js → chunk-GUOAPXUY.js} +4 -4
- package/dist/{chunk-IJWRJPX6.js → chunk-HU5FTTW2.js} +7 -7
- package/dist/{chunk-SKPAIZSC.js → chunk-INQQUAIO.js} +4 -4
- package/dist/{chunk-HMTZP7NJ.js → chunk-JA4I5BEB.js} +1 -1
- package/dist/{chunk-ZQWKVLSY.js → chunk-JGN27L4Q.js} +12 -12
- package/dist/{chunk-BN37AISA.js → chunk-JIHDUZJZ.js} +3 -3
- package/dist/chunk-JRKD7SD3.js +24 -0
- package/dist/{chunk-FYHUCRLU.js → chunk-JWS77LQE.js} +1 -1
- package/dist/{chunk-6F3XQJR6.js → chunk-KERCZSIA.js} +1 -1
- package/dist/{chunk-ECZEJ6BE.js → chunk-KIIZNION.js} +6 -6
- package/dist/{chunk-L664TIIV.js → chunk-KJ4CHRRC.js} +7 -7
- package/dist/{chunk-VIBGF2HJ.js → chunk-L2WQOJ3T.js} +1 -1
- package/dist/{chunk-3CIJFWB4.js → chunk-LFUXWZV7.js} +1 -1
- package/dist/{chunk-OCKOZV46.js → chunk-LGVVXYW7.js} +1 -1
- package/dist/{chunk-ZS36DB4X.js → chunk-MF7OELXP.js} +2 -2
- package/dist/{chunk-OCITNQGF.js → chunk-MQNSKFZY.js} +10 -10
- package/dist/{chunk-M6ODRWTM.js → chunk-NJY4HPNB.js} +5 -5
- package/dist/{chunk-MDGM5NUO.js → chunk-NM7U42KL.js} +9 -9
- package/dist/{chunk-2QUACZ6O.js → chunk-NZNPU2GD.js} +1 -1
- package/dist/{chunk-QBR73AJX.js → chunk-OEWBWKKD.js} +11 -11
- package/dist/{chunk-LKNDLXL3.js → chunk-OHWP24DL.js} +1 -1
- package/dist/{chunk-VNKLIWNQ.js → chunk-OK2J6WSC.js} +1 -1
- package/dist/{chunk-3HPCQMYH.js → chunk-P56YLT73.js} +12 -12
- package/dist/{chunk-VTYALYW4.js → chunk-PCNFY6EK.js} +12 -12
- package/dist/{chunk-FM5ASDVN.js → chunk-PM6HY5BH.js} +1 -1
- package/dist/{chunk-ABAUJLI4.js → chunk-PO2KNVCC.js} +1 -1
- package/dist/chunk-PRN2QDX6.js +7 -0
- package/dist/{chunk-7M7GKYHS.js → chunk-QE2F4YQQ.js} +9 -9
- package/dist/{chunk-QJY52ZHG.js → chunk-QSFQTMWV.js} +1 -1
- package/dist/{chunk-YVI2XJCB.js → chunk-QSOBETAI.js} +5 -5
- package/dist/chunk-QXEZBS3H.js +6 -0
- package/dist/{chunk-32HTOZFT.js → chunk-QYOIS4BN.js} +3 -3
- package/dist/chunk-R6YVKP6D.js +3 -0
- package/dist/chunk-R72SBGYR.js +9 -0
- package/dist/{chunk-QMUW35QL.js → chunk-RIA6KKIB.js} +6 -6
- package/dist/{chunk-D3L2QCGF.js → chunk-RTZFWH5U.js} +1 -1
- package/dist/{chunk-HVWRF7N4.js → chunk-S6C7X6CR.js} +19 -19
- package/dist/{chunk-7T6NWAPG.js → chunk-SJUEGYT2.js} +1 -1
- package/dist/{chunk-JE4BGFDJ.js → chunk-TAB3K2WF.js} +1 -1
- package/dist/{chunk-4H4HJIWI.js → chunk-TAIH2VIW.js} +1 -1
- package/dist/{chunk-NTVACRKD.js → chunk-TALQMTCE.js} +3 -3
- package/dist/{chunk-KKZXGWSX.js → chunk-TEYG2W7A.js} +2 -2
- package/dist/{chunk-FZZBBZXZ.js → chunk-TMXMIRWG.js} +8 -8
- package/dist/{chunk-J43RRDEP.js → chunk-TSZPGDU3.js} +1 -1
- package/dist/{chunk-HKXP3JJ5.js → chunk-TTUUXGEW.js} +1 -1
- package/dist/{chunk-T65TAQLW.js → chunk-TXGVSWH6.js} +13 -13
- package/dist/{chunk-UA7SWROJ.js → chunk-U7PA4KNZ.js} +3 -3
- package/dist/{chunk-2M3KB4RH.js → chunk-UYM7562M.js} +2 -2
- package/dist/chunk-V4BA3FGC.js +14 -0
- package/dist/{chunk-JFTLFF52.js → chunk-V62FEHS4.js} +3 -3
- package/dist/{chunk-PYGXSGXC.js → chunk-VB4ZPIZF.js} +1 -1
- package/dist/{chunk-K3OLOLFT.js → chunk-VHBRVW5O.js} +3 -3
- package/dist/{chunk-5R25GNE2.js → chunk-WNHDYTTI.js} +2 -2
- package/dist/chunk-WR3SULZW.js +13 -0
- package/dist/{chunk-WHHHECBC.js → chunk-WSQ73CRR.js} +2 -2
- package/dist/{chunk-BMZL5BHA.js → chunk-XMBMI27I.js} +1 -1
- package/dist/{chunk-HBAATSUS.js → chunk-XSMVWJV3.js} +1 -1
- package/dist/{chunk-M4NT6HGJ.js → chunk-YEDAXZYO.js} +1 -1
- package/dist/{chunk-ILH7RDAD.js → chunk-YGNJIOOH.js} +10 -10
- package/dist/{chunk-C5Q4AKXO.js → chunk-YXMXATYP.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ListToolbar.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SearchInput.js +1 -1
- package/dist/forms/Segmented.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/index.js +359 -359
- package/dist/map/index.js +5 -5
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-C7APPCLE.js +0 -29
- package/dist/PdfViewer-ADPTYOAO.js +0 -1
- package/dist/PomodoroTimer-AGSHX2JO.js +0 -91
- package/dist/Sidebar-SWLVNJ6L.js +0 -44
- package/dist/chunk-7QFXUNFA.js +0 -8
- package/dist/chunk-7YJBWOQG.js +0 -2
- package/dist/chunk-CIT4YPEO.js +0 -8
- package/dist/chunk-DTZDOXK3.js +0 -19
- package/dist/chunk-EQDYCSUX.js +0 -13
- package/dist/chunk-IBPJJO4N.js +0 -28
- package/dist/chunk-M6T7N4SN.js +0 -14
- package/dist/chunk-MQERW3QR.js +0 -3
- package/dist/chunk-NJJG2VAW.js +0 -24
- package/dist/chunk-QVGASI5H.js +0 -9
- package/dist/chunk-QZYV4TDD.js +0 -1
- package/dist/chunk-S6IW2F4J.js +0 -8
- package/dist/chunk-TB7BO2XS.js +0 -6
- package/dist/chunk-UMLXFQVC.js +0 -1
- package/dist/chunk-XQMVECQM.js +0 -15
- package/dist/chunk-YX4QGW7Z.js +0 -4
- package/dist/chunk-Z2MP46QJ.js +0 -1
- package/dist/chunk-ZUQ72WER.js +0 -7
- /package/dist/{chunk-LPQQNPH5.js → chunk-TEQ5ZPAL.js} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-
|
|
1
|
+
import{Segmented as e}from"./chunk-TALQMTCE.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 S(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 X(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 Y(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function F(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 H=24;function Q({rows:a,groups:o=[],dependencies:j=[],scale:Q,onScaleChange:A,onRowClick:K,onRowChange:L,readOnly:E=!1,today:W,isLoading:G=!1,emptyState:J,labelHeader:O,labelWidth:V=240,className:Z=""}){const q=l().gantt,B=d(),_=t(B),ee=!!L&&!E,[te,ne]=c(null),re=u(!1),ae=u(null),oe=h(),ie=w(W)??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?F(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:S(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=X(n.shape),o=X(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:Y(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=F(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=F(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
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:H},children:/* @__PURE__ */f("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:
|
|
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:H},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:H,height:H},children:ke(e,"minor")},`m${e.startDay}`)),Me&&Ce&&"day"!==Q&&
|
|
9
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:H,height:H},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
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:
|
|
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
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":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":
|
|
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":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":
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-PO2KNVCC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-KEFNQEXZ.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),N=i().severity,v=y?n(y,N):void 0,j=e(),S=o(),
|
|
3
|
+
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),N=i().severity,v=y?n(y,N):void 0,j=e(),S=o(),C=c(null),I=c(l);I.current=l,s(()=>{if(j&&d)return j.report(S,()=>I.current,C.current)},[j,d,S]);const E=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
4
|
/* @__PURE__ */m("span",{"aria-hidden":"true",title:v,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
5
5
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:v}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
|
|
6
|
-
return m("button",1===k?{ref:
|
|
6
|
+
return m("button",1===k?{ref:C,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:E})}:{ref:C,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:E})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return h("div",{children:[
|
|
8
8
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{Dialog as e}from"./chunk-5RCKE4X2.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-NRHG4R2Q.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),P=t({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
|
|
2
|
+
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),E=a(null),F=a(0),T=a([]),$=a(null),R=a(null),D=u(e=>{E.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),K=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++F.current,options:r,resolve:e};null===E.current?D(n):T.current.push(n)})},[D]),[W,H]=c(!1),[Q,S]=c({message:""}),[V,Y]=c(""),Z=a(),B=u(e=>(S(e),Y(""),H(!0),new Promise(e=>{Z.current=e})),[]),[G,I]=c(!1),[J,O]=c({}),[U,X]=c(""),q=a(),z=u(e=>{const r="string"==typeof e?{message:e}:e;return O(r),X(r.defaultValue??""),I(!0),new Promise(e=>{q.current=e})},[]);d(()=>{b=K,y=B,N=z},[K,B,z]);const A=(e,r)=>{if(E.current!==e)return;const n=k.current,t=T.current.shift();t?D(t):(E.current=null,k.current=void 0,i(!1)),n?.(r)},M=e=>{H(!1),Y(""),Z.current?.(e)},_=e=>{if(e){const e=U.trim();if(!e&&!J.allowEmpty)return I(!1),void q.current?.(null);I(!1),q.current?.(e)}else I(!1),q.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===Q.variant?"warning":"danger"],te=Q.confirmWord,oe=null==te||V===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
|
|
3
|
+
return m(p.Provider,{value:K,children:[r,
|
|
4
|
+
/* @__PURE__ */h(e,{open:t,onClose:()=>A(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
|
|
5
|
+
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>A(v,!1),className:C,children:s.cancelLabel||le.cancel}),
|
|
6
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>A(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
7
|
+
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
8
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
9
|
+
/* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
|
|
10
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
|
|
11
|
+
/* @__PURE__ */h(e,{open:W,onClose:()=>M(!1),initialFocus:null!=te?void 0:R,footer:/* @__PURE__ */m(f,{children:[
|
|
12
|
+
/* @__PURE__ */h("button",{ref:R,type:"button",onClick:()=>M(!1),className:C,children:Q.cancelLabel||le.destructiveCancel}),
|
|
13
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>M(!0),disabled:!oe,className:ne.button,children:te??Q.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
14
|
+
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
15
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
16
|
+
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:Q.title||le.destructiveTitle}),
|
|
17
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:Q.message}),null!=te&&/* @__PURE__ */m(f,{children:[
|
|
18
|
+
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
19
|
+
/* @__PURE__ */h("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),se]}),
|
|
20
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:V,onChange:e=>Y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&V===te&&M(!0)},placeholder:te,className:`mt-2 ${L} focus:border-red-500`})]})]})]})}),
|
|
21
|
+
/* @__PURE__ */m(e,{open:G,onClose:()=>_(!1),title:J.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
|
|
22
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:J.cancelLabel||le.cancel}),
|
|
23
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!J.allowEmpty&&!U.trim(),className:P,children:J.confirmLabel||le.ok})]}),children:[J.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:J.message}),
|
|
24
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:U,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:J.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{E as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-TMXMIRWG.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{ItemCount as r}from"./chunk-PO2KNVCC.js";import{Button_default as a}from"./chunk-A4ROXNUF.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -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-A4ROXNUF.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,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
2
|
-
return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":
|
|
3
|
-
/* @__PURE__ */f("div",{ref:
|
|
4
|
-
/* @__PURE__ */m("div",{ref:
|
|
5
|
-
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),
|
|
6
|
-
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-TEYG2W7A.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-CIZAUBWA.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:R=""}){const j=a().widths,A=s(),z=p(Math.round(x)||1,1,n),B=e($,z),S=B??[...r[z]??[]],T=[...S,100-g(S)],D=P||M,K=c(null),O=c({onChange:k,shown:S,locked:D,n:z,stored:B});O.current={onChange:k,shown:S,locked:D,n:z,stored:B};const E=r=>{const{onChange:t,shown:n,locked:o,n:l}=O.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},G=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],E(l.slice(0,-1))&&(ne.current=null)},H=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=T[e]+T[e+1],l="ArrowRight"===r.key?T[e]+n:"ArrowLeft"===r.key?T[e]-n:"PageUp"===r.key?T[e]+10:"PageDown"===r.key?T[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),G(T,e,l))},I=c(null),[L,U]=u(null),W=()=>{I.current=null,U(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>W,[]);const V=e=>r=>{if(0!==r.button||D)return;r.preventDefault();const t=K.current?.getBoundingClientRect().width??0;t<=0||(I.current={i:e,x:r.clientX,width:t,from:T,moved:!1,pointer:r.pointerId},U(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},F=e=>{const r=I.current;if(!r)return;if(0===e.buttons)return void W();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}G(r.from,r.i,r.from[r.i]+t/r.width*100)},X=e=>{const r=I.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),W())},q=(e,r)=>{const{shown:n}=O.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return E(o.slice(0,-1))?o:null},[J,Q]=u(0);d(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>Q(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Y=c(null),[Z,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=O.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=T.join(",");d(()=>{const e=null===Z?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Y.current,Z);re(r=>v(r,e)?r:e)},[Z,le,J]);const ie=j.hint(z,t),ae=T.slice(0,-1).map((e,r)=>g(T.slice(0,r+1)));/* @__PURE__ */
|
|
2
|
+
return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?A:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${R}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */f("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
+
/* @__PURE__ */m("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:T.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
|
|
5
|
+
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&T.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Z===r,l=g(T.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>J>0&&J*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(z-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":j.column(r+1),"aria-describedby":A,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||q(r,e)},onRevert:e=>((e,r)=>{O.current.locked||null===r||oe(e,r)||q(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:O.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<z-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":T[r],"aria-valuemin":t,"aria-valuemax":T[r]+T[r+1]-t,"aria-valuetext":j.dividerValue(r+1,T[r],r+2,T[r+1]),"aria-disabled":D||void 0,onKeyDown:D?void 0:H(r),onPointerDown:V(r),onPointerMove:F,onPointerUp:X,onPointerCancel:X,onLostPointerCapture:()=>{I.current&&W()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(D?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(D?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${L===r?"w-1":y}`)})})})})]},r))]}),z>1&&/* @__PURE__ */m("span",{id:A,className:"sr-only",children:ie})]})}export{x as WidthsBar};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{ImageFocusPoint as e}from"./chunk-CUJ537IY.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{Segmented as a}from"./chunk-
|
|
1
|
+
import{ImageFocusPoint as e}from"./chunk-CUJ537IY.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{Segmented as a}from"./chunk-TALQMTCE.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-TAIH2VIW.js";import{TransferProgress as u}from"./chunk-TAB3K2WF.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-TNGIXSTM.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-NRHG4R2Q.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:$,hint:F,error:U,required:z,className:I,accept:P="image/*",maxSizeBytes:O,fit:T="cover",height:H,shape:S="rect",placeholder:q,cta:A,acceptHint:B,showFilename:W=!0,allowReplace:K=!0,allowRemove:V=!0,replaceLabel:D,removeLabel:G,busy:M=!1,busyLabel:Q,choosingLabel:Y,pickFailedLabel:_,progress:E,disabled:J=!1,kind:X,onKindChange:Z,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===S,oe=H??(re?96:112),ne=A??te.cta,se=X??(/video/.test(P)&&!/image/.test(P)?"video":"image"),le="string"==typeof G&&G?G:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=M||ce,be=ce&&!M?Y??te.choosing:Q??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=J||pe,Ne=!!w&&(t(w,P)||w===ke),we=q??r(P,te),Le=D??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:P,maxSizeBytes:O,acceptHint:B,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:$e}=Ce,Fe=()=>{je||(R?ge():Ce.open())},Ue=w?o(w):"",ze=!re&&!Ne&&!!ie,Ie=J||!K&&!V?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[K&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Fe(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
|
|
2
2
|
/* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
-
/* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:
|
|
4
|
-
/* @__PURE__ */x(e,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:
|
|
3
|
+
/* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),V&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${N}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...Ce.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",$e?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
|
|
4
|
+
/* @__PURE__ */x(e,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:T}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:T,objectPosition:ee||void 0}}),W&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Ie,pe&&/* @__PURE__ */x(s,{label:be,progress:E,rounded:re?"rounded-full":"rounded-md"})]}),Oe=/* @__PURE__ */k(j,{children:[
|
|
5
5
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
|
|
6
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),
|
|
6
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}),Te=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>Fe(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:F?`${ve}-hint`:void 0,...Ce.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",je?"cursor-not-allowed opacity-60":"cursor-pointer",c(je)].join(" "),children:[
|
|
7
7
|
/* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",$e?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
|
|
8
|
-
/* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:
|
|
9
|
-
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),
|
|
10
|
-
return k(i,{label:$,htmlFor:ve,hint:F,error:fe,required:z,className:I,children:[Z&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>Z(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:
|
|
8
|
+
/* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):Oe})]}),He=re?Te:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>Fe(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:F?`${ve}-hint`:void 0,...Ce.zoneProps,className:d($e,je,c(je)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):/* @__PURE__ */k(j,{children:[
|
|
9
|
+
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Oe]})});/* @__PURE__ */
|
|
10
|
+
return k(i,{label:$,htmlFor:ve,hint:F,error:fe,required:z,className:I,children:[Z&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>Z(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Pe:He,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
|
|
11
11
|
/* @__PURE__ */x(h,{rejections:Ce.rejections})]})}export{w as MediaUploadField};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-ABIWAS5K.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{OneLineLabel as r}from"./chunk-FAPZFMS3.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{layoutFlow as e}from"./chunk-FAERBT6Y.js";import{Button_default as t}from"./chunk-A4ROXNUF.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{CHART_INK as r,STATUS_VARS as o,SERIES_VARS as i}from"./chunk-TZFACUMR.js";import{useMemo as l,useRef as a,useId as c}from"react";import{jsxs as d,jsx as s}from"react/jsx-runtime";var h={downloadPng:"Download PNG",downloadSvg:"Download SVG",toPdf:"Add to the PDF"},m={label:"var(--ink-strong)",note:r.label,line:r.label},f={step:i[0],decision:o.warning,start:r.muted,end:r.muted};function u(e,t){return`${(e.title??"flowchart").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"flowchart"}.${t}`}function g(e){const t=new Map(e.nodes.map(e=>[e.id,e.label]));return e.edges.map(e=>`${t.get(e.from)} to ${t.get(e.to)}${e.label?` (${e.label})`:""}`).join("; ")}function w({node:e}){const t=f[e.kind],n=e.x+e.width/2,r=e.y+e.height/2,o=e.note?[...e.lines,e.note]:e.lines,i=r-15*(o.length-1)/2,l="decision"===e.kind?/* @__PURE__ */s("polygon",{points:`${n},${e.y} ${e.x+e.width},${r} ${n},${e.y+e.height} ${e.x},${r}`}):/* @__PURE__ */s("rect",{x:e.x,y:e.y,width:e.width,height:e.height,rx:"step"===e.kind?4:e.height/2});/* @__PURE__ */
|
|
2
2
|
return d("g",{fill:t,fillOpacity:.14,stroke:t,strokeWidth:1,children:[l,o.map((t,r)=>{const l=void 0!==e.note&&r===o.length-1;/* @__PURE__ */
|
|
3
3
|
return s("text",{x:n,y:i+15*r,textAnchor:"middle",dominantBaseline:"central",fontSize:l?11:12.5,fontWeight:l?400:600,fill:l?m.note:m.label,fillOpacity:1,stroke:"none",children:t},r)})]})}function p(e){const t=e.cloneNode(!0),n=[e,...Array.from(e.querySelectorAll("*"))],r=[t,...Array.from(t.querySelectorAll("*"))],o=e.ownerDocument.defaultView;n.forEach((e,t)=>{for(const n of["fill","stroke"]){const i=e.getAttribute(n);i&&i.includes("var(")&&o&&r[t].setAttribute(n,o.getComputedStyle(e).getPropertyValue(n)||i)}});const i=o?.getComputedStyle(e).getPropertyValue("--viz-surface").trim();if(i){const n=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("fill",i),t.insertBefore(n,t.firstChild)}return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("font-family","system-ui, -apple-system, Segoe UI, sans-serif"),(new XMLSerializer).serializeToString(t)}function b(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function y({spec:r,labels:o,onToPdf:i,bare:f=!1,className:y}){const k={...h,...o},v=l(()=>e(r),[r]),x=a(null),$=r.title??"Flowchart",A=`flow-arrow-${c().replace(/:/g,"")}`;/* @__PURE__ */
|
|
4
4
|
return d("figure",{className:`my-2 ${y??""}`,children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Button_default as e}from"./chunk-
|
|
1
|
+
import{Button_default as e}from"./chunk-A4ROXNUF.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
|
|
2
2
|
return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
3
3
|
/* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
4
4
|
/* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-PM6HY5BH.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-P56YLT73.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:L=!0}){const D=s(null),A=a(),[j,S]=d(null),U=s(w);U.current=w,c(()=>{const e=D.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),P=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!D.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!P.current&&L&&(P.current=!0,h(D.current)[0]?.focus({preventScroll:!0}))},[j,L]),m(()=>{if(L)return;const e=e=>{if(D.current?.contains(document.activeElement))return;const t=h(D.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[L]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>D.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const T=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(D.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:D,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:T,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as n,mediaFileName as r}from"./chunk-
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as n,mediaFileName as r}from"./chunk-TAIH2VIW.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as s}from"./chunk-A4ROXNUF.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{createShellPortal as m}from"./chunk-5QRHQCRG.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-KEFNQEXZ.js";import{buttonClasses as f}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-NRHG4R2Q.js";import{useRef as x,useState as k,useCallback as b,useEffect as g}from"react";import{jsx as v,jsxs as N,Fragment as w}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:n(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",R=e=>e.stopPropagation();function I({images:n,startIndex:y=0,onClose:I,onIndexChange:Q,onOpenFile:U}){const A=p().lightbox,D=d(),F=x(null),W=x(null),[$,z]=k(y),G=n.length,O=D&&G>0,Y=b(e=>{if(G<2)return;const t=(($+e)%G+G)%G;z(t),Q?.(t)},[$,G,Q]);if(a(O),l(F,O,W),i(O),g(()=>{if(O)return h(()=>(I(),!0),()=>F.current)},[O,I]),g(()=>{if(!O)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),Y("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[O,Y]),!O)return null;const E=n[Math.min($,G-1)],L=j(E),V=E.caption||r(E.url);let Z;return Z="video"===L?/* @__PURE__ */v("video",{src:E.url,controls:!0,playsInline:!0,"aria-label":V,onClick:R,className:`${e} rounded-lg bg-black`}):"file"===L?/* @__PURE__ */N("div",{onClick:R,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
2
|
/* @__PURE__ */v(c,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:
|
|
4
|
-
/* @__PURE__ */N("div",{ref
|
|
5
|
-
/* @__PURE__ */N("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:
|
|
6
|
-
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:
|
|
7
|
-
/* @__PURE__ */v("button",{ref:
|
|
8
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
9
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
10
|
-
/* @__PURE__ */N("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:
|
|
11
|
-
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:V}),U?/* @__PURE__ */v(s,{size:"sm",onClick:()=>U(E),children:A.openFile}):/* @__PURE__ */v("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:f({size:"sm"}),children:A.openFile})]}):/* @__PURE__ */v(t,{src:E.url,alt:V,className:`${e} object-contain`,frameClassName:"rounded-lg"}),m(
|
|
4
|
+
/* @__PURE__ */N("div",{ref:F,...o({role:"dialog",modal:!0,label:A.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:I,children:[Z,
|
|
5
|
+
/* @__PURE__ */N("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:R,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:A.counter($+1,G)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:W,type:"button",onClick:I,"aria-label":A.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(c,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),G>1&&/* @__PURE__ */N(w,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{R(e),Y(-1)},"aria-label":A.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(c,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{R(e),Y(1)},"aria-label":A.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(c,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
+
/* @__PURE__ */N("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:R,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:V}),"file"!==L&&/* @__PURE__ */v("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:A.openOriginal})]})]}),document.body)}export{I as ImageLightbox,j as lightboxKind};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-
|
|
2
|
-
return y("div",{ref:
|
|
3
|
-
/* @__PURE__ */x("button",{ref:
|
|
4
|
-
/* @__PURE__ */x(i,{portal:!0,className:
|
|
5
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-PM6HY5BH.js";import{useTabLayer as n,focusableIn as o}from"./chunk-DWGYC7OD.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-P56YLT73.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as p}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k="inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",w=/(^|[\s:])!?z-/,D={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function H({trigger:H,items:j,align:W="end",side:$="bottom","aria-label":A,className:C="",triggerClassName:E,menuClassName:L="",minWidth:K=180,linkAs:S,disabled:N,id:T,"aria-describedby":U,"aria-disabled":G=!1,onOpenChange:I,footer:M,footerLabel:P}){const[B,Y]=m(!1),[q,R]=m(-1),z=h(null),J=h(null),O=h(null),V=h(null),Q=h(null),Z=null!=M&&!1!==M,F=h({text:"",at:0}),X=g(),_=g(),ee=T??_,te=h(I);te.current=I;const re=h(B);re.current=B;const ne=v(e=>{Y(!1),re.current&&(re.current=!1,te.current?.(!1)),e&&J.current?.focus()},[]),oe=(t,r)=>{const n=j.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(j[i]))return i}return-1},ie=()=>O.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!B)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||ie()?.contains(t))return;const r=ie()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||ne(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ne(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[B,ne]);const ae=v(()=>{const e=ie(),t=J.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:W,side:$});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=W},[W,$]);p(()=>{B&&ae()}),b(()=>{if(B)return u(()=>J.current,ae)},[B,ae]),b(()=>{if(!B)return;const t=O.current,r=e(j[q])?t?.querySelector(`[data-dropdown-index="${q}"]`):null;(r??t)?.focus({preventScroll:!0})},[B,q]),b(()=>{if(B)return f(e=>"Escape"===e.key&&(ne(!0),!0),()=>V.current)},[B,ne]),n(V,B&&Z);const le=h(null),se=t=>{const r=j.findIndex(t=>"radio"===t.type&&"colour"===t.mark&&t.checked&&e(t));return r>=0?r:"first"===t?oe(0,1):oe(j.length-1,-1)},de=e=>{R(se(e)),Y(!0),re.current||(re.current=!0,le.current=e,I?.(!0))};p(()=>{const e=le.current;if(!B||!e)return;le.current=null;const t=se(e);t!==q&&R(t)});const ce=t(j,X),ue="function"==typeof M?M({close:()=>ne(!0)}):M,pe={...w.test(L)?{}:{zIndex:s.popup},minWidth:K};/* @__PURE__ */
|
|
2
|
+
return y("div",{ref:z,className:`relative inline-flex ${C}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */x("button",{ref:J,id:ee,type:"button","aria-haspopup":"menu","aria-expanded":B,"aria-controls":B?X:void 0,"aria-label":A,"aria-describedby":U,"aria-disabled":G||void 0,disabled:N,onClick:()=>{G||(B?ne(!1):de("first"))},onKeyDown:e=>{G||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),de("first")):"ArrowUp"===e.key&&(e.preventDefault(),de("last")))},className:E??`${k} ${A?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"}`,children:H}),B&&
|
|
4
|
+
/* @__PURE__ */x(i,{portal:!0,className:L,style:pe,children:/* @__PURE__ */y("div",{ref:V,children:[
|
|
5
|
+
/* @__PURE__ */x("div",{ref:O,id:X,role:"menu","aria-orientation":"vertical","aria-label":A,"aria-labelledby":A?void 0:ee,"aria-describedby":ce,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),R(oe(q+1,1));else if("ArrowUp"===t.key)t.preventDefault(),R(oe(q-1,-1));else if("Home"===t.key)t.preventDefault(),R(oe(0,1));else if("End"===t.key)t.preventDefault(),R(oe(j.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Q.current?o(Q.current)[0]:void 0;e?e.focus({preventScroll:!0}):ne(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-F.current.at<500?F.current.text+n:n;F.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?q+1:Math.max(q,0),s=O.current,d=j.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(j[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void R(n)}})(t)},children:r(j,{menuId:X,choose:e=>{e.disabled||(ne(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>ne(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===q?0:-1,onMouseEnter:()=>{t.disabled||Q.current?.contains(document.activeElement)||R(e)}}),linkAs:S})}),Z&&/* @__PURE__ */y("div",{ref:Q,role:"group","aria-label":P,"data-dropdown-footer":"",onKeyDown:e=>{const t=Q.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=O.current?.querySelector(`[data-dropdown-index="${q}"]`);return void(t??O.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),ne(!0))},children:[
|
|
6
6
|
/* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
|
|
7
7
|
/* @__PURE__ */x("div",{style:D,children:ue})]})]})})]})}export{H as DropdownMenu,k as TRIGGER_CLASS};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{ResizableTable as n}from"./chunk-
|
|
2
|
-
return x(a,{title:K,message:P,onRetry:A});if(0===R.length)/* @__PURE__ */return x(w,{children:N});const me=R.length>0&&ce.length===R.length,ue=ce.length>0&&!me,pe=
|
|
3
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{ResizableTable as n}from"./chunk-TXGVSWH6.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-U73K3ICC.js";import{ListLoadError as a}from"./chunk-LGVVXYW7.js";import{LoadingSpinner as c}from"./chunk-4PJFL26P.js";import{PopupMenu as s,PopupMenuLabel as d,PopupMenuItem as h,PopupMenuDivider as m}from"./chunk-P56YLT73.js";import{keepsNativeMenu as u}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import{shellHttp as f}from"./chunk-STKJA4PV.js";import{toast_default as g}from"./chunk-I2NVBDKH.js";import{useShellStrings as y}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:R,isLoading:L,emptyState:N,totalCount:T,isError:$,onRetry:A,errorTitle:K,errorMessage:P,tableId:E,columns:F,renderCell:M,getRowId:I=e=>e.id,sort:U,onSort:D,selected:H,setSelected:V,onRowClick:W,onRowHover:G,getRowClassName:J,footerLabel:B,footerExtra:O,footerExtraAfter:X,sentinelRef:Y,isFetchingNextPage:_,saveDefaultPerms:Q,exportEndpoint:Z,exportFilename:z="export.csv",contextActions:q}=S,[ee,te]=k(null),ne=b(null),re=y(),oe=re.entityList,le=e=>{V(t=>{const n=new Set(t),r=I(e);return n.has(r)?n.delete(r):n.add(r),n})},ie=()=>{V(e=>{const t=R.map(I),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ae=r(R,W,le,ie,(e,t)=>{V(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(I(R[n]));return r})},ne),ce=R.filter(e=>H.has(I(e))),se=()=>{const e=[...ne.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=R[Number(e.dataset.rowIdx)];return void 0!==t&&H.has(I(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(F.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{te(null);const{header:t,body:n}=se();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(oe.copiedRows(n.length),r,l)},he=async()=>{te(null);const e=ce.map(I);if(!e.length||!Z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(F.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${E}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return F.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=Z.includes("?")?"&":"?";try{const n=await f.get(`${Z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=z,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void g.notify(Number.isFinite(a)?oe.exportTruncated(a,e.length):oe.exportTruncatedUnknown(e.length));g.success(oe.exported(e.length))}catch{g.error(oe.exportFailed)}};if(L)/* @__PURE__ */return x(c,{});if($&&0===R.length)/* @__PURE__ */
|
|
2
|
+
return x(a,{title:K,message:P,onRetry:A});if(0===R.length)/* @__PURE__ */return x(w,{children:N});const me=R.length>0&&ce.length===R.length,ue=ce.length>0&&!me,pe=H.size-ce.length,fe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":re.table.selectAll,checked:me,indeterminate:ue,onChange:ie,style:{height:14,width:14}})},...F],ge=/* @__PURE__ */x(i,{selectedCount:ce.length,hiddenSelectedCount:pe,loadedCount:R.length,totalCount:T,label:B,isFetchingMore:_,extra:O,extraAfter:X}),ye=Y?/* @__PURE__ */C(w,{children:[
|
|
3
|
+
/* @__PURE__ */x("div",{ref:Y}),_&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0!==T&&T>R.length;ke=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
|
|
4
4
|
/* @__PURE__ */x(d,{children:pe>0?re.list.selectedNotShown(a,pe):re.list.selected(a)}),
|
|
5
|
-
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),
|
|
5
|
+
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),W(r)},children:oe.open}),
|
|
6
6
|
/* @__PURE__ */x(m,{}),o&&/* @__PURE__ */x(h,{onClick:()=>{c(),e(oe.copiedText,o.text,o.html)},children:oe.copy}),l&&/* @__PURE__ */x(h,{onClick:()=>(t=>{te(null);const{keys:n,body:r}=se(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:oe.copyColumn(l.label)}),
|
|
7
|
-
/* @__PURE__ */x(h,{disabled:0===a,onClick:de,children:oe.copyRows(a)}),
|
|
7
|
+
/* @__PURE__ */x(h,{disabled:0===a,onClick:de,children:oe.copyRows(a)}),Z&&/* @__PURE__ */x(h,{onClick:he,children:oe.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(m,{}),
|
|
8
8
|
/* @__PURE__ */x(h,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ce)},children:e.label})]},t)),
|
|
9
|
-
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),
|
|
10
|
-
/* @__PURE__ */x(h,{onClick:()=>{c(),
|
|
9
|
+
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),V(e=>/* @__PURE__ */new Set([...e,...R.map(I)]))},children:u?oe.selectAllLoaded(R.length):oe.selectAll}),
|
|
10
|
+
/* @__PURE__ */x(h,{onClick:()=>{c(),V(/* @__PURE__ */new Set)},children:oe.clearSelection}),A&&/* @__PURE__ */x(h,{onClick:()=>{c(),A()},children:oe.refresh})]})}
|
|
11
11
|
/* @__PURE__ */
|
|
12
12
|
return C("div",{className:"flex-1 flex flex-col bg-surface overflow-hidden",children:[
|
|
13
|
-
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:
|
|
14
|
-
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":
|
|
13
|
+
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:E,columns:fe,sort:U,onSort:D,footer:ge,afterBody:ye,saveDefaultPerms:Q,children:e=>/* @__PURE__ */x("tbody",{ref:ne,children:R.map((n,r)=>{const o=I(n);/* @__PURE__ */
|
|
14
|
+
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":H.has(o)?"bg-blue-50 hover:bg-blue-100":(r%2==1?"bg-row-stripe ":"")+"hover:bg-line"} ${J?.(n)??""}`,onClick:()=>W(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||u(e.target))return;e.preventDefault();const r=I(n);H.has(r)||V(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?F.find(e=>e.key===o)?.label:void 0;te({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:G?()=>G(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":re.table.selectRow,checked:H.has(o),onChange:()=>le(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):M(n,e.key)},e.key))},o)})})})}),ke]})}export{S as EntityList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-4KPOTWYF.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"}),
|