efficient-shell 10.23.0 → 11.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 +32 -5
- package/dist/Browser-PTDZDMCG.js +44 -0
- package/dist/Calculator-KP57FK7Y.js +29 -0
- package/dist/CurrencyConverter-W66ZDA6I.js +21 -0
- package/dist/{Documents-MTCJXTXY.js → Documents-EASK3J36.js} +3 -3
- package/dist/{Files-XMZ3XBP4.js → Files-YT4Z4J36.js} +28 -28
- package/dist/Notepad-T6NV4BSM.js +24 -0
- package/dist/{PomodoroTimer-5ELVNJEU.js → PomodoroTimer-6B2MNLWD.js} +31 -31
- package/dist/{Preview-QCA6XUDU.js → Preview-KHCQHAWG.js} +17 -17
- package/dist/Sidebar-BCTWRG7P.js +44 -0
- package/dist/{Spreadsheet-EKYP6XIX.js → Spreadsheet-IQZECLJW.js} +11 -11
- package/dist/{Stock-TRG6CAZJ.js → Stock-GCCTYXAG.js} +3 -3
- package/dist/{Weather-YGTT7UWR.js → Weather-DL4IZELD.js} +17 -17
- package/dist/{WorldClock-UCX5LCJB.js → WorldClock-ZVN5O77W.js} +6 -6
- package/dist/ai/index.js +91 -91
- package/dist/api/shellHttp.d.ts +52 -0
- package/dist/api/shellHttp.js +1 -0
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/chunk-2QY5BJLA.js +2 -0
- package/dist/chunk-3XZFWR6T.js +13 -0
- package/dist/{chunk-CIHR5ZKF.js → chunk-4DDL6NXB.js} +1 -1
- package/dist/chunk-4LXCCZDM.js +1 -0
- package/dist/{chunk-U2RFKQVA.js → chunk-5H4SWQGM.js} +1 -1
- package/dist/{chunk-USWA6YNZ.js → chunk-5PDHKH2A.js} +3 -3
- package/dist/{chunk-GCZU4XFA.js → chunk-5WY5DQI7.js} +1 -1
- package/dist/{chunk-75UD5ZMP.js → chunk-6IOFNPR6.js} +3 -3
- package/dist/{chunk-OTITQ3IH.js → chunk-6KGIHI6X.js} +7 -7
- package/dist/{chunk-5RQJRD2E.js → chunk-7DQ3PM5Z.js} +1 -1
- package/dist/{chunk-YOZGW2RB.js → chunk-7FW2BQTV.js} +1 -1
- package/dist/chunk-AIJ3G6BD.js +1 -0
- package/dist/{chunk-DRUQH4ZE.js → chunk-AIJ6OR6X.js} +2 -2
- package/dist/{chunk-RV2FGSGH.js → chunk-ALTBTO3Z.js} +2 -2
- package/dist/{chunk-VCCGS6Q2.js → chunk-AM6HSHT5.js} +19 -19
- package/dist/chunk-ATMJ5ZPK.js +1 -0
- package/dist/{chunk-CQEVJG43.js → chunk-AWGJIDBR.js} +1 -1
- package/dist/{chunk-XJPKDTQN.js → chunk-BUO7XCYR.js} +12 -12
- package/dist/{chunk-USVL5SLG.js → chunk-D5HGRACW.js} +1 -1
- package/dist/{chunk-JET2TKEQ.js → chunk-DOF56HTO.js} +5 -5
- package/dist/chunk-E6FDUFPH.js +1 -0
- package/dist/chunk-ETJRGQNG.js +1 -0
- package/dist/chunk-F3ZOO23R.js +1 -0
- package/dist/chunk-HNUKXGYP.js +5 -0
- package/dist/chunk-HNVSVTNC.js +16 -0
- package/dist/{chunk-GOXQJCXG.js → chunk-HUU4XMWE.js} +17 -17
- package/dist/{chunk-Z3SLQKE6.js → chunk-ILY4DU3D.js} +1 -1
- package/dist/chunk-IQZD6QQF.js +99 -0
- package/dist/{chunk-E5QPXEKN.js → chunk-JFBL4PR3.js} +1 -1
- package/dist/{chunk-E6LQY6TB.js → chunk-KIXTJNHQ.js} +2 -2
- package/dist/{chunk-DGWS4GTI.js → chunk-KXU4ORKE.js} +1 -1
- package/dist/chunk-KYBXJL6A.js +23 -0
- package/dist/chunk-LH7IKIGE.js +1 -0
- package/dist/{chunk-JPOYR5AO.js → chunk-NZISMTQE.js} +5 -5
- package/dist/chunk-O3MBPAWZ.js +2 -0
- package/dist/{chunk-QWCEKHAP.js → chunk-OEPYQUXZ.js} +9 -9
- package/dist/{chunk-HUA3TGMM.js → chunk-P2C33RHT.js} +1 -1
- package/dist/{chunk-CX4XR4HO.js → chunk-PLC656AN.js} +1 -1
- package/dist/chunk-Q5Z3KHT2.js +1 -0
- package/dist/{chunk-RZQGPWSN.js → chunk-QOI4GQVH.js} +1 -1
- package/dist/{chunk-G7BBSHDF.js → chunk-QRU55BUS.js} +1 -1
- package/dist/{chunk-O52BQ5DP.js → chunk-QYXZC37J.js} +1 -1
- package/dist/{chunk-DBL7MFCB.js → chunk-RBZKV3ED.js} +5 -5
- package/dist/chunk-STKJA4PV.js +1 -0
- package/dist/chunk-SX3SG522.js +13 -0
- package/dist/{chunk-GC3DA6D6.js → chunk-T6BGS26U.js} +1 -1
- package/dist/{chunk-ZTV2BA3P.js → chunk-U6LKNGC6.js} +1 -1
- package/dist/chunk-UKBXQXDZ.js +1 -0
- package/dist/chunk-ULJQYXHB.js +1 -0
- package/dist/{chunk-I4DLYOPO.js → chunk-V2J2AHDW.js} +4 -4
- package/dist/chunk-WBJ6KNUF.js +1 -0
- package/dist/{chunk-Z46MSUTP.js → chunk-WLYYC3AP.js} +1 -1
- package/dist/{chunk-OGU5JE52.js → chunk-WOAMPTZI.js} +6 -6
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.d.ts +125 -0
- package/dist/data/EntityList.js +2 -0
- package/dist/data/ResizableTable.d.ts +31 -0
- package/dist/data/ResizableTable.js +2 -0
- package/dist/data/useColumnConfig.d.ts +68 -0
- package/dist/data/useColumnConfig.js +2 -0
- package/dist/data/useSort.d.ts +55 -0
- package/dist/data/useSort.js +2 -0
- package/dist/data/useTableNav.d.ts +28 -0
- package/dist/data/useTableNav.js +2 -0
- package/dist/format/index.d.ts +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/Input.d.ts +50 -2
- 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/MediaUploadGrid.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/linkHref.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +2 -2
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +15 -318
- package/dist/index.js +666 -694
- package/dist/markup/index.d.ts +55 -11
- package/dist/markup/index.js +1 -1
- package/dist/motion/values.d.ts +75 -0
- package/dist/motion/values.js +1 -0
- package/dist/motion.css +26 -0
- package/dist/page-tabs/index.js +4 -4
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/SearchableSelect.d.ts +11 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/tokens/type.d.ts +3 -31
- package/dist/tokens/type.js +1 -1
- package/dist/ui/index.d.ts +8 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/dist/Browser-GTQKXJQ6.js +0 -43
- package/dist/Calculator-PM4TYWTE.js +0 -29
- package/dist/CurrencyConverter-4I2ENTSX.js +0 -21
- package/dist/Notepad-QIJN7VDZ.js +0 -24
- package/dist/Sidebar-7LN3ZEF4.js +0 -44
- package/dist/chunk-7IY47EKR.js +0 -1
- package/dist/chunk-7RP7QTRF.js +0 -12
- package/dist/chunk-CY5N5OA3.js +0 -2
- package/dist/chunk-DHKRXHJN.js +0 -1
- package/dist/chunk-H475WZPF.js +0 -23
- package/dist/chunk-I3XM2PSQ.js +0 -100
- package/dist/chunk-MAMWQCJ6.js +0 -2
- package/dist/chunk-OFCHJWM2.js +0 -1
- package/dist/chunk-PJPK2ADX.js +0 -1
- /package/dist/{chunk-CSA6CGXS.js → chunk-2F5SLLBJ.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as r,useContext as e}from"react";import{jsx as n}from"react/jsx-runtime";var t=r({hasAnyPerm:()=>!0});function i({value:r,children:e}){/* @__PURE__ */
|
|
2
|
+
return n(t.Provider,{value:r,children:e})}function o(){return e(t)}export{i as ShellAuthProvider,o as useShellAuth};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-LJN77RG6.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-HNUKXGYP.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-EOVXFXVV.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-NJN5IKWO.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as v,MENU_MAX_HEIGHT as w}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as y}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as x,glassStyle as k}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as N}from"./chunk-TWVUQUUD.js";import{useShellStrings as j}from"./chunk-GDQJBQ5B.js";import{useState as $,useId as D,useRef as C,useMemo as S,useEffect as W}from"react";import{createPortal as R}from"react-dom";import{jsxs as E,jsx as F}from"react/jsx-runtime";function M(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var L=["right-2","right-8","right-16"],O=[8,32,64];function z(z){const{options:T,placeholder:A,emptyOptionLabel:B,className:U="",disabled:H,id:J,filter:Y=!1,allowFreeText:G=!1,freeTextOption:I,onSearchChange:V,loading:X=!1,error:K,onRetry:Q,rightAdornment:P,endAction:Z,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=z,re=!0===z.multiple,le=z.multiple?z.value:z.value?[z.value]:[],oe=z.multiple?"":z.value,ie=e=>{z.multiple?z.onChange(e):z.onChange(e[0]??"")},ae=le.length>0,se=Y&&ae&&!H,ce=re||Y,ue=null!=I,de=G||ue,[he,pe]=$(!1),[me,fe]=$(-1),be=D(),ge=J??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=$(""),ke=j(),Ne=B??ke.select.none,je=e=>{xe(e),fe(-1),V?.(e)},$e=C(null),De=C(null),Ce=C(null),Se=C(null),We=C(he);We.current=he;const Re=C(!1),Ee=e=>{We.current&&(We.current=!1,e&&G&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),je(""))},Fe=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?je(""):fe(t));ie([e.value]),Ee(!1)}},[Me,Le]=$(null);y(()=>{if(!P||he)return void Le(null);const e=Se.current?.offsetWidth??0;Le(e?e+O[He]+6:null)});const Oe=v(De,he,ce?{popupRef:Ce}:{matchTriggerWidth:!0}),ze=S(()=>t(T),[T]),Te=le.join("\0"),Ae=S(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of ze)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[ze,Te,de]),Be=Ae.join(", "),Ue=_&&ae&&!H,He=(Ue?1:0)+(Z?1:0),[Je,Ye]=$(null),Ge=C(null),Ie=C(""),Ve=C(()=>{});Ve.current=()=>{const e=De.current,t=Ge.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Ae.join("\0")}`;if(o===Ie.current)return;Ie.current=o;let i=null;r>0&&Ae.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=M(Ae,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Ye(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},y(()=>{Ve.current()}),W(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ve.current());return t.observe(e),()=>t.disconnect()},[re]);const Xe=Ae.length,Ke=!re||!Je||Je.shown>=Xe?Be:0===Je.shown?ke.select.selectedCount(Xe):`${Ae.slice(0,Je.shown).join(", ")} +${Xe-Je.shown}`,Qe=re&&null!==Je&&(Je.shown<Xe||Je.cut),Pe=he&&ae&&ce;W(()=>{if(!he)return;const e=e=>{const t=e.target;$e.current?.contains(t)||Ce.current?.contains(t)||Ee(!0)};document.addEventListener("mousedown",e);const t=b(()=>Ee(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,G,ye,Te,z.onChange]),W(()=>{if(he)return N(e=>!("Escape"!==e.key||!We.current)&&(Ee(!1),De.current?.blur(),!0),()=>Ce.current)},[he]);const Ze=S(()=>{const e=/* @__PURE__ */new Set;return n(T,t=>!e.has(t.value)&&(e.add(t.value),!0))},[T]),qe=S(()=>{if(V)return Ze;const e=ye.trim().toLowerCase();return e?n(Ze,t=>r(t,e)):Ze},[Ze,ye,V]),_e=S(()=>t(qe),[qe]),et=ye.trim(),tt=S(()=>ue&&et?ze.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,ze,Te]),nt=S(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
|
|
2
|
+
return E("div",{ref:$e,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&($e.current?.contains(t)||Ce.current?.contains(t))||Re.current||document.activeElement!==De.current&&Ee(!0)},children:[(rt=/* @__PURE__ */F("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Ke,onChange:e=>{je(e.target.value),pe(!0)},onFocus:()=>{H||(je(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(H)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Fe(nt[me],me):1!==_e.length||_e[0].disabled?G&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),je("")):(ie([et]),Ee(!1),De.current?.blur())):Fe(_e[0],0)):"Escape"===t.key?(Ee(!1),De.current?.blur()):"Tab"===t.key&&Ee(!0)},placeholder:Pe?Ke:A||Ne,className:`${se?u:d} ${U} ${a[He]}${H?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Pe?" rosh-field-shows-choice":""}`,style:Me?{paddingRight:Me}:void 0,disabled:H}),re?/* @__PURE__ */F(f,{content:!he&&Qe?Be:null,className:"block",children:rt}):rt),re&&
|
|
3
|
+
/* @__PURE__ */F("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */F("span",{ref:Ge,className:"whitespace-pre"})}),He>0&&
|
|
4
|
+
/* @__PURE__ */E(s,{children:[Ue&&
|
|
5
|
+
/* @__PURE__ */F("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */F(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */F(p,{name:"close"}),onClick:()=>{ie([]),Ee(!1)}}})}),Z&&/* @__PURE__ */F("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */F(c,{action:Z})})]}),P&&!he&&/* @__PURE__ */F("div",{ref:Se,className:`absolute top-1/2 -translate-y-1/2 ${L[He]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:P}),he&&R(
|
|
6
|
+
/* @__PURE__ */E("div",{ref:Ce,onMouseDownCapture:()=>{Re.current=!0,setTimeout(()=>{Re.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:g.popup,left:Oe?.left,right:Oe?.right,top:Oe?.top,bottom:Oe?.bottom,minWidth:Oe?.minWidth,width:Oe?.width,...ce&&{maxWidth:Oe?.maxWidth},visibility:Oe?void 0:"hidden",...k()},children:[re&&ae&&_&&!H&&
|
|
7
|
+
/* @__PURE__ */F("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${x}`,children:ke.select.clearAll}),X?
|
|
8
|
+
/* @__PURE__ */F(m,{size:"sm",padding:"py-2",label:ke.search.searching}):K?/* @__PURE__ */E("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
9
|
+
/* @__PURE__ */F("span",{className:"min-w-0 flex-1",children:K}),Q&&/* @__PURE__ */F(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:Q,className:"shrink-0",children:ke.list.retry})]}):null,
|
|
10
|
+
/* @__PURE__ */E("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:Oe?.maxHeight??w},children:[0===nt.length?X||K?null:/* @__PURE__ */F("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
|
|
11
|
+
return E("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Fe(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */F(o,{selected:n}),
|
|
12
|
+
/* @__PURE__ */F("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */F(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&I&&
|
|
13
|
+
/* @__PURE__ */F("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Fe(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${x}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */F("span",{className:"min-w-0 flex-1 truncate",children:I(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{z as SearchableSelect,M as fitChoice};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-6KGIHI6X.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
|
|
2
2
|
return n("div",{role:"separator",children:/* @__PURE__ */n(e,{})},d.key);if("label"===d.type)/* @__PURE__ */
|
|
3
3
|
return n("div",{id:`${y}-label-${k}`,children:/* @__PURE__ */n(l,{children:d.label})},d.key);if("status"===d.type)/* @__PURE__ */
|
|
4
4
|
return n("div",{id:c(y,k),className:"text-xs",style:t(),children:d.label},d.key);if("submenu"===d.type)/* @__PURE__ */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={},e=new Proxy(t,{get:(e,r)=>t[r],has:(e,r)=>r in t,ownKeys:()=>Object.keys(t),getOwnPropertyDescriptor(e,r){if(r in t)return{configurable:!0,enumerable:!0,value:t[r]}}});function r(e){for(const e of Object.keys(t))delete t[e];Object.assign(t,e)}var n={},o=[],a={erp:[],system:[],virtual:[],footer:[]},u=42,i=240,s=6,c=49,d=6,l=200,h=420,m="react-os-shell:work-area-changed";function w(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function p(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}function f({over:t,residual:e},r){return e<=1||t-e>=r-2}function y(t,e,r){let n=t;for(const o of r)f(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function g(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,i=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(i),w:Math.round(o)}}function b(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function M(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{s as RAIL_COLLAPSED_INSET,c as RAIL_COLLAPSED_W,h as RAIL_MAX_W,d as RAIL_MENU_GAP,l as RAIL_MIN_W,i as RAIL_W,u as TAB_STRIP_H,m as WORK_AREA_CHANGED_EVENT,p as boxFillsWorkArea,w as computeMaximizedBox,g as growBoxToWidth,b as isSidebarStripReserved,e as navIcons,o as navSections,M as readAlwaysMaximizedFlag,f as scrollerIsFluid,n as sectionIcons,r as setShellNavIcons,a as startMenuCategories,y as widthToFit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requestFilesTrashView as n}from"./chunk-
|
|
1
|
+
import{requestFilesTrashView as n}from"./chunk-JFBL4PR3.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
2
|
-
return s("div",{className:[
|
|
3
|
-
/* @__PURE__ */t(a,{content:X?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":X
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-NZISMTQE.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{iconButtonClasses as n}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{Tooltip as a}from"./chunk-NJN5IKWO.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:N=!1,disabledReason:g,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:O,align:W="end",side:z="bottom",menuMinWidth:F,linkAs:I,block:L=!1,className:M=""},R){const V=N&&(null!=g&&""!==g&&!1!==g)&&!v,X=x&&null!=j&&""!==j&&!1!==j,$=o(),A=/* @__PURE__ */t(i,{ref:R,type:b,variant:f,size:p,loading:v,leftIcon:k,block:L,disabled:N&&!V,"aria-disabled":!!V||void 0,disabledReason:V?g:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),B=L?"relative flex min-w-0 flex-1":"relative inline-flex",D=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[L?"flex w-full":"inline-flex","items-stretch",M].filter(Boolean).join(" "),children:[null==w||""===w||V?A:/* @__PURE__ */t(a,{content:w,className:B,children:A}),
|
|
3
|
+
/* @__PURE__ */t(a,{content:X?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":X?$:void 0,items:h,align:W,side:z,minWidth:F,linkAs:I,disabled:x&&!X,"aria-disabled":X,onOpenChange:y,footer:C,footerLabel:O,triggerClassName:n({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(r,{name:"chevron-down",className:D,strokeWidth:2,"aria-hidden":"true"})})}),X&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-IQZD6QQF.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-QRU55BUS.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{Icon as a}from"./chunk-2UO47XB4.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{useState as l,useRef as o}from"react";import{jsxs as t,jsx as s}from"react/jsx-runtime";var d={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function u({label:u,value:m,corners:f,onChange:p,radius:h=null,onRadiusChange:v,radiusLabel:b,radiusMin:k=0,radiusMax:g,radiusStep:x=1,radiusPlaceholder:w,disabled:y=!1,disabledReason:j,id:A,className:N=""}){const R=n(),B=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(f),[K,L]=l(0),C=o(null);/* @__PURE__ */
|
|
2
2
|
return t("div",{id:A,role:"group","aria-label":u,className:`flex min-w-0 flex-wrap items-center gap-2 ${N}`.trim(),children:[v&&
|
|
3
|
-
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:
|
|
4
|
-
/* @__PURE__ */s("div",{ref:
|
|
3
|
+
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:R.corners.radiusMark}),suffix:R.corners.unit,steppers:"compact",disabled:y,"aria-label":b??R.corners.radius})}),
|
|
4
|
+
/* @__PURE__ */s("div",{ref:C,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(C.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:B.map((e,n)=>{const l=m.includes(e.value),o=y||!0===e.disabled,t=o&&(!0===e.disabled&&e.title||(y?j:void 0))||void 0,c=/* @__PURE__ */s(r,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":o||void 0,disabledReason:t,"data-corner":e.value,size:"sm",tabIndex:n===K?0:-1,onFocus:()=>L(n),onClick:()=>{o||p(l?m.filter(r=>r!==e.value):[...m,e.value])},children:/* @__PURE__ */s(a,{name:"corner",strokeWidth:2,className:["h-4 w-4",d[e.value]??""].filter(Boolean).join(" ")})},e.value);return t?c:/* @__PURE__ */s(i,{content:e.title??e.label,children:c},e.value)})})]})}export{u as CornersInput};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var P=u(function({onClick:
|
|
3
|
-
return x("button",{ref:f,id:u,role:"radio"===T?"menuitemradio":"checkbox"===T?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":T?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:d,onClick:()=>{
|
|
1
|
+
import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{glassStyle as l,GLASS_DIVIDER as c}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{createContext as d,forwardRef as u,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function E(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function T(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function M(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var $=d(null),B=d(!1);function L({children:e,style:n,className:a="",onClose:c,minWidth:d=180,portal:u=!1}){const p=h(null),b=m(),[x,v]=f([]),E=h();g(()=>()=>clearTimeout(E.current),[]);const T=i(),M=y(()=>{const e=()=>clearTimeout(E.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),E.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),c?.()},root:p}},[b,x,c]);g(()=>{if(!c)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&c()},t=e=>{"Escape"===e.key&&c()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(c),o=s(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[c,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const B=W(),L=/(^|[\s:])!?z-/.test(a),j=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===B?"py-1":"large"===B?"py-2":"py-1"} ${a}`,onContextMenu:e=>{t(e.target)||e.preventDefault()},style:{...L?{}:{zIndex:o.menu},minWidth:d,animation:"popup-in 0.12s ease-out",...l(),...n},children:/* @__PURE__ */k($.Provider,{value:M,children:e})});return u?T?w(j,document.body):null:j}function j(e,t,n,r=!1){const o=W(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-accent-tint text-blue-700":"text-ink not-disabled:not-aria-disabled:hover:bg-accent-tint not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var D=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function H({kind:e,checked:t}){/* @__PURE__ */
|
|
2
|
+
return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var P=u(function({onClick:t,children:n,className:r="",danger:o,disabled:i,role:a,checked:l,icon:c,description:s,tabIndex:d,id:u,onMouseEnter:h},f){const g=p($),y=m(),b=null!=s&&!1!==s,w=`${u??y}-label`,N=`${u??y}-note`,C=p(B),E=j(o,i,r),T=void 0===l?null:"menuitemradio"===a?"radio":"checkbox";/* @__PURE__ */
|
|
3
|
+
return x("button",{ref:f,id:u,role:"radio"===T?"menuitemradio":"checkbox"===T?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":T?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:d,onClick:()=>{t?.(),g&&g.depth>0&&"checkbox"!==T&&g.closeTree()},onMouseEnter:()=>{g?.scheduleClose(g.depth),h?.()},disabled:i,className:E.className,style:E.style,children:[T&&/* @__PURE__ */k(H,{kind:T,checked:!!l}),b?
|
|
4
4
|
/* @__PURE__ */x("span",{className:"block min-w-0 flex-1 py-2",children:[
|
|
5
5
|
/* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(R,{children:c}),
|
|
6
6
|
/* @__PURE__ */k("span",{id:w,className:"min-w-0",children:n})]}),
|
|
7
|
-
/* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:
|
|
8
|
-
return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var A=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function F(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function z(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function I({label:
|
|
7
|
+
/* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:e(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(R,{children:c}),n]})]})});function R({children:e}){/* @__PURE__ */
|
|
8
|
+
return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var A=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function F(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function z(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function I({label:e,icon:n,children:r,disabled:o,className:i="",minWidth:c=180,maxHeight:d,rowProps:u}){const f=p($),N=m(),C=h(null),E=h(null),B=h(),L=h(!1),D=`${N}-menu`;g(()=>()=>clearTimeout(B.current),[]);const H=f?.depth??0,P=f?.path[H],R=!!P&&P.key===N&&!o,I=b(e=>{if(!f||o||!C.current)return;clearTimeout(B.current),L.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=H>0&&(f.path[H-1]?.flipped??!1),a=M(r.left,r.right,c,window.innerWidth,4,i);f.open(H,{key:N,y:t.top,...a})},[f,o,H,N,c]),S=e=>{f?.closeBelow(H),C.current?.focus()};g(()=>{if(R)return s(e=>"Escape"===e.key&&(!(f&&f.path.length>H+1)&&(S(),!0)),()=>E.current)}),a(()=>{if(!R||!P)return;const e=()=>{const e=E.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=H>0&&(f?.path[H-1]?.flipped??!1),o=e.offsetWidth||c,i=M(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=T(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{R&&L.current&&(L.current=!1,z(E.current)[0]?.focus())},[R]);const U=y(()=>f&&{...f,depth:H+1},[f,H]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=j(!1,o,i,R),Q=W();/* @__PURE__ */
|
|
9
9
|
return x(v,{children:[
|
|
10
10
|
/* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":R,"aria-controls":R?D:void 0,disabled:o,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;R?t&&z(E.current)[0]?.focus():I(t)},...u,onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),I(!0))},onMouseEnter:()=>{u?.onMouseEnter?.(),o||(f.cancelClose(),R?f.closeBelow(H+1):(clearTimeout(B.current),B.current=setTimeout(()=>I(!1),120)))},onMouseLeave:()=>{clearTimeout(B.current),f.scheduleClose(H)},children:[n,
|
|
11
|
-
/* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:
|
|
12
|
-
/* @__PURE__ */k("div",{ref:E,id:D,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===Q?"py-1":"large"===Q?"py-2":"py-1"),style:{left:P.left,top:P.y,minWidth:c,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:F(f.root.current)+H+1,animation:(P.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...l()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=z(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),S())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(B.current)},onMouseLeave:()=>f.scheduleClose(H+1),onContextMenu:
|
|
11
|
+
/* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:e}),A]}),R&&w(
|
|
12
|
+
/* @__PURE__ */k("div",{ref:E,id:D,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===Q?"py-1":"large"===Q?"py-2":"py-1"),style:{left:P.left,top:P.y,minWidth:c,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:F(f.root.current)+H+1,animation:(P.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...l()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=z(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),S())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(B.current)},onMouseLeave:()=>f.scheduleClose(H+1),onContextMenu:e=>{t(e.target)||e.preventDefault()},children:/* @__PURE__ */k($.Provider,{value:U,children:r})}),document.body)]})}function S(){const e=W();/* @__PURE__ */
|
|
13
13
|
return k("div",{className:`border-t ${c} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function U(){const e=W(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function q({children:e}){/* @__PURE__ */
|
|
14
14
|
return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:U(),children:e})}function Q({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
|
|
15
15
|
return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{H as MenuCheckMark,Q as MenuIcon,B as MenuSemanticsContext,L as PopupMenu,S as PopupMenuDivider,P as PopupMenuItem,q as PopupMenuLabel,I as PopupSubmenu,T as clampMenuTop,C as closeMenuBelow,j as itemLook,M as menuPanelLeft,U as menuTextRowStyle,N as openMenuLevel,E as resolveMenuLevels};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-IQZD6QQF.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{InputNumber_default as e}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-QRU55BUS.js";import{IconButton_default as a}from"./chunk-LE5LWALR.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";var d="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */t(r,{name:"padding-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"padding-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"padding-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"padding-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"padding-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"padding-left-right","aria-hidden":"true",className:d})},crop:{top:/* @__PURE__ */t(r,{name:"crop-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"crop-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"crop-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"crop-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"crop-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"crop-left-right","aria-hidden":"true",className:d})}},l=/* @__PURE__ */t(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var m=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function c(e,a){const r=r=>m(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function h({label:a,value:r,onChange:i,each:d,placeholder:l,words:c,min:h=0,max:p=200,step:u=4,readOnly:g,glyphs:f="padding"}){const N=s[f],b=(a,n,o)=>{const d=function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(r,a),s=a.map(e=>m(r,l,e)),f="mixed"!==d&&s.every(e=>e===s[0])?s[0]:"–";/* @__PURE__ */
|
|
2
2
|
return t("div",{"data-side":a.join("-"),className:"min-w-0",children:/* @__PURE__ */t(e,{value:"mixed"===d?null:d,onChange:e=>((e,a)=>{const t={...r};for(const r of e)t[r]=a;i(t)})(a,e),min:h,max:p,step:u,snap:!0,precision:0,steppers:"compact",readOnly:g,placeholder:f,prefix:o,suffix:c.unit,"aria-label":n})})};/* @__PURE__ */
|
|
3
3
|
return t("div",{role:"group","aria-label":a,"data-sides":d?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */n(o,d?{children:[b(["left"],c.sides.left,N.left),b(["top"],c.sides.top,N.top),b(["right"],c.sides.right,N.right),b(["bottom"],c.sides.bottom,N.bottom)]}:{children:[b(["left","right"],c.horizontal,N.horizontal),b(["top","bottom"],c.vertical,N.vertical)]})})}function p({each:e,onChange:r,label:n,disabled:o}){/* @__PURE__ */
|
|
4
4
|
return t(i,{content:n,children:/* @__PURE__ */t(a,{size:"md","aria-label":n,"aria-pressed":e,disabled:o,onClick:()=>r(!e),children:l})})}export{p as SidesEachToggle,h as SidesInput,c as sidesStartEach};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=["entrance","hover","scroll","loop","click","mouse","webgl","countUp"],t=(e,t,o,r)=>({default:e,min:t,max:o,step:r}),o={entrance:{duration:t(.6,0,4,.1),delay:t(0,0,4,.1)},hover:{duration:t(.7,0,2,.1),delay:t(0,0,2,.1)},loop:{duration:t(50,1,120,1),delay:t(0,0,10,.1)},click:{duration:t(.3,0,2,.1),delay:t(0,0,2,.1)},countUp:{duration:t(1.4,0,4,.1),delay:t(0,0,4,.1)}},r=/^\s*-?\d+(\.\d+)?\s*$/;function a(e,t,a){const n=o[e][t],i="number"==typeof a?a:"string"==typeof a&&r.test(a)?Number(a):Number.NaN;if(Number.isNaN(i))return n.default;const u=Math.min(n.max,Math.max(n.min,i)),l=Math.round(Number((u/n.step).toFixed(6)));return Number((l*n.step).toFixed(3))}var n={arrive:"cubic-bezier(0.22, 1, 0.36, 1)",loop:"linear",media:"cubic-bezier(0.2, 0.6, 0.2, 1)"},i={zoom:1.04,liftPx:3,rotateFallbackDeg:72};function u(e){return"number"==typeof e&&Number.isInteger(e)&&e>=2?Number((360/e).toFixed(3)):i.rotateFallbackDeg}function l(){const e={};for(const t of Object.keys(o)){const r=t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);e[`--page-motion-${r}-duration`]=`${o[t].duration.default}s`,e[`--page-motion-${r}-delay`]=`${o[t].delay.default}s`}for(const[t,o]of Object.entries(n))e[`--page-ease-${t}`]=o;return e["--page-hover-zoom"]=String(i.zoom),e["--page-hover-lift"]=`${i.liftPx}px`,e["--page-hover-rotate"]=`${i.rotateFallbackDeg}deg`,e}export{i as HOVER_MOTION,n as MOTION_EASING,e as MOTION_GROUPS,o as MOTION_TIMING,l as motionCustomProperties,a as motionSeconds,u as rotateDegrees};
|
|
@@ -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-4DDL6NXB.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-6KGIHI6X.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:D="",autoFocus:H=!0}){const L=s(null),j=a(),[A,S]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});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),T=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!T.current&&H&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[A,H]),m(()=>{if(H)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.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 W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),B=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:B,onClose:w,className:D,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:j,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,4 +1,4 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-S4FPYCUU.js";import{ColorPicker as t}from"./chunk-
|
|
2
|
-
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[k("left",b.sides.left,h.left,z("left"),String(u.sides.left),e=>j("left",e)),k("top",b.sides.top,h.top,z("top"),String(u.sides.top),e=>j("top",e)),k("right",b.sides.right,h.right,z("right"),String(u.sides.right),e=>j("right",e)),k("bottom",b.sides.bottom,h.bottom,z("bottom"),String(u.sides.bottom),e=>j("bottom",e))]}):k("all",b.width,h.all,O
|
|
1
|
+
import{Segmented as e}from"./chunk-S4FPYCUU.js";import{ColorPicker as t}from"./chunk-BUO7XCYR.js";import{InputNumber_default as l}from"./chunk-QRU55BUS.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{jsxs as a,Fragment as o,jsx as i}from"react/jsx-runtime";var s=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */i(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */i(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */i(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */i(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */i(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */i(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */i(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */i(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const S=e=>"number"==typeof d[e]?d[e]:null,j=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===S(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},k=(e,t,r,a,o,s)=>/* @__PURE__ */i("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */i(l,{value:a,onChange:s,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":t})}),C=n.map(S),U="number"==typeof d.width?d.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,O=null===U&&C.some(e=>null!==e),B=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",z=e=>S(e)??("number"==typeof d.width?d.width:null),R=d.style??u.style;/* @__PURE__ */
|
|
2
|
+
return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[k("left",b.sides.left,h.left,z("left"),String(u.sides.left),e=>j("left",e)),k("top",b.sides.top,h.top,z("top"),String(u.sides.top),e=>j("top",e)),k("right",b.sides.right,h.right,z("right"),String(u.sides.right),e=>j("right",e)),k("bottom",b.sides.bottom,h.bottom,z("bottom"),String(u.sides.bottom),e=>j("bottom",e))]}):k("all",b.width,h.all,U,O?"–":B,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */i("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */i(e,{block:!0,size:"sm",label:b.style,value:R,onChange:e=>{x||m({...d,style:e})},options:s.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
|
|
3
3
|
/* @__PURE__ */i("span",{className:"sr-only",children:b.styles[e]})]}),title:b.styles[e]}))})}),
|
|
4
4
|
/* @__PURE__ */i("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */i(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"md",disabled:x})})]})}export{s as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-NRALUW6P.js";import{
|
|
2
|
-
return V(
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-NRALUW6P.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-QVZKRROQ.js";import{ImageLightbox as r}from"./chunk-P7H2DXJB.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-V6Y4OC6K.js";import{Breadcrumbs as d}from"./chunk-XYECIBVX.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-MS5APD3V.js";import{useMediaMoveItems as u}from"./chunk-OPN4I565.js";import{MediaUploadGrid as m}from"./chunk-E3EJWNNK.js";import{MediaUsedInList as p}from"./chunk-NZ34BQKH.js";import{NativeSelect as h}from"./chunk-XFH64VIG.js";import{useGridSelection as f}from"./chunk-VLKDWKVR.js";import{useMarquee as g}from"./chunk-OLFYNMTD.js";import{Segmented as v}from"./chunk-S4FPYCUU.js";import{copyToClipboard as k}from"./chunk-TMMNCXQT.js";import{Checkbox_default as y}from"./chunk-CGZBDI6C.js";import{useContextMenu as b,ContextMenu as w}from"./chunk-AIJ6OR6X.js";import{Banner as N}from"./chunk-ZGOHRLXG.js";import{Input_default as x}from"./chunk-HNUKXGYP.js";import{DropdownMenu as C}from"./chunk-NZISMTQE.js";import{IconButton_default as I}from"./chunk-LE5LWALR.js";import{useFileIntake as D,FileIntakeAlert as S}from"./chunk-JTMEFXRL.js";import{ColoredBadge as j}from"./chunk-OKHKY3ZZ.js";import{Button_default as z}from"./chunk-EOVXFXVV.js";import{buttonClasses as O}from"./chunk-UQYNPYF4.js";import{Icon as F}from"./chunk-2UO47XB4.js";import{Tooltip as T}from"./chunk-NJN5IKWO.js";import{usePlotWidth as L}from"./chunk-MAFUXCPZ.js";import{useShellStrings as P}from"./chunk-GDQJBQ5B.js";import{useRef as E,useMemo as A,useCallback as M,useState as R,useEffect as K}from"react";import{jsxs as U,Fragment as B,jsx as V}from"react/jsx-runtime";var X="application/x-efficient-media-files",H="application/x-efficient-media-folder",J="application/x-efficient-media-file";function G(e){if(!e||!Array.from(e.types).includes(J))return null;try{const n=JSON.parse(e.getData(J));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 Q={type:"all",use:"any",sort:"newest"},W={lock:/* @__PURE__ */V(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */V(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */V(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */V(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */V(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */V(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */V(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */V(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */V(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */V(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */V(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */V(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */V(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */V(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */V(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */V(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},Y={link:/* @__PURE__ */V(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */V(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */V(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */V(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function Z({value:e,label:n,onDone:l}){const[a,i]=R(e),r=E(!1),t=e=>{r.current||(r.current=!0,l(e))};/* @__PURE__ */
|
|
2
|
+
return V(x,{size:"sm",autoFocus:!0,"aria-label":n,value:a,onChange:e=>i(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:n=>{n.stopPropagation(),"Enter"===n.key?(n.preventDefault(),t(a.trim()||e)):"Escape"===n.key&&(n.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function $(F){const{mode:G="manage",layout:$="auto",location:q,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=Q,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:pe,usedIn:he,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:Ne,onMove:xe,onTrash:Ce,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Oe,onOpenInDesign:Fe,onChoose:Te,onCancel:Le,pickNote:Pe,onDragOut:Ee,className:Ae=""}=F,Me=P().mediaLibrary,Re=P().media,Ke="pick"===G,Ue=!Ke,Be=E(null),Ve=L(Be,"phone"===$?343:1200),Xe="phone"===$||"auto"===$&&Ve<640,He=A(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),Je=A(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Ge=A(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Je.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Je]),Qe=M(e=>{const n=[];for(let l=e?Je.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Je.get(l.parentId):void 0);return n},[Je,ee.length]),We=M((e,n)=>Qe(e).some(e=>e.id===n),[Qe]),[Ye,Ze]=R(()=>/* @__PURE__ */new Set(["@files"])),$e=e=>Ze(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),qe=M(e=>{Ze(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=q).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;K(()=>{if("files"===q.place)qe(["@files",...Qe(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?He.get(q.nodeId)?.path??[]:[];qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===q.place,ln="trash"===q.place,an="files"===q.place,rn=an?q.folderId:null,tn=nn&&q.nodeId?He.get(q.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Me.readOnly} ${Me.editedAtHq(e.sharedFrom)}`:Me.readOnly,dn=A(()=>ie.map(e=>e.id),[ie]),sn=A(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=f(dn),un=A(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,pn=E(!0);K(()=>{pn.current?pn.current=!1:cn.clear()},[_e]);const hn=me?.join("\0");K(()=>{me&&cn.setSelection(me)},[hn]);const fn=E(hn??""),gn=un.join("\0");K(()=>{fn.current!==gn&&(fn.current=gn,pe?.(un))},[gn]);const vn=(e,n={})=>{Ke?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=R(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?Je.get(n.id)?.name:sn.get(n.id)?.name)&&Ne?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);qe(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},Nn=M(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Me.alreadyHere:void 0;const l=Je.get(e.id);return n===e.id||n&&We(n,e.id)?Me.notIntoItself:(l?.parentId??null)===n?Me.folderAlreadyHere:void 0};n.push({key:s,label:Me.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Ge.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[Ge,Je,an,We,rn,Me]),xn=M(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Cn,In]=R(null),Dn={words:Me,media:Re,denied:fe,moveTargets:Nn,kindOf:xn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Ue?e=>{wn(e)}:void 0,rename:Ne&&Ue?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:xe&&Ue?xe:void 0,trash:Ce&&Ue?Ce:void 0,deleteFolder:Ie&&Ue?Ie:void 0,folderNotEmpty:e=>!!Je.get(e)?.notEmpty,replace:ze&&Ue?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&k(Me.urlLabel,n)},openInDesign:Fe,restore:De,deleteForever:Se},Sn=e=>c(e,Dn),jn=b(),zn=(e,n)=>{Ke||(cn.isSelected(e)||cn.select(e),jn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[On,Fn]=R(null),[Tn,Ln]=R(null),[Pn,En]=R(null);K(()=>{if(!Tn&&!On)return;const e=()=>{Ln(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[Tn,On]);const An=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Mn=(e,n)=>!(!xe||fe.move||Ke)&&(!!An(e,X)||!(!An(e,H)||!Pn)&&(n!==Pn&&!(n&&We(n,Pn)))),Rn=(e,n)=>({onDragEnter:l=>{Mn(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{Mn(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",On!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(Mn(e,n))if(e.preventDefault(),Fn(null),An(e,X)){let l;try{l=JSON.parse(e.dataTransfer.getData(X))}catch{l=null}Array.isArray(l)&&l.length&&xe({kind:"files",ids:l.map(String)},n)}else Pn&&(xe({kind:"folder",id:Pn},n),En(null))}}),Kn=e=>{const n=e=>An(e,X)||An(e,H)||An(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&Tn!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Un=(e,n,l)=>/* @__PURE__ */V(T,{side:"right",content:Tn===e?Me.noDropProducts:on(l),open:Tn===e||!Tn&&void 0,children:/* @__PURE__ */V("span",{children:n})}),Bn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Vn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=Ye.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
3
|
return U("div",{role:"none",className:"contents",children:[
|
|
4
|
-
/* @__PURE__ */V(n,{label:Un(r,e.name,t),level:a,icon:d&&o?
|
|
4
|
+
/* @__PURE__ */V(n,{label:Un(r,e.name,t),level:a,icon:d&&o?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Me.fileCount(e.count):void 0,selected:nn&&q.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>$e(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Kn(r),...Ue?Bn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */V(l,{children:Vn(d,a+1,t)})]},e.id)}),Xn=(e,a)=>(Ge.get(e)??[]).map(e=>{const i=Ge.get(e.id),r=Ye.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
5
|
return U("div",{role:"none",className:"contents",children:[
|
|
6
|
-
/* @__PURE__ */V(n,{label:e.name,level:a,icon:i&&r?
|
|
7
|
-
/* @__PURE__ */V(n,{label:Un("@products",Me.products),level:1,icon:
|
|
8
|
-
/* @__PURE__ */V(n,{label:Me.allFiles,level:1,icon:
|
|
6
|
+
/* @__PURE__ */V(n,{label:e.name,level:a,icon:i&&r?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Me.fileCount(e.count):void 0,selected:t||an&&q.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>$e(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:On===e.id?"into":void 0,dragging:Pn===e.id,draggable:Ue&&!!xe&&!fe.move,rename:t?/* @__PURE__ */V(Z,{value:e.name,label:Me.folderName,onDone:bn}):void 0,actions:Ue&&o.length?/* @__PURE__ */V(C,{align:"end","aria-label":Me.folderActions,trigger:W.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Rn(e.id,e.id),...Ue?Bn({kind:"folder",id:e.id}):{},...Ue&&xe&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(H,e.id),En(e.id)},onDragEnd:()=>{En(null),Fn(null)}}:{}}}),i&&r&&/* @__PURE__ */V(l,{children:Xn(e.id,a+1)})]},e.id)}),Hn=Ye.has("@files"),Jn=Ye.has("@products"),Gn=/* @__PURE__ */U(e,{"aria-label":Me.folders,children:[ne&&/* @__PURE__ */U(B,{children:[
|
|
7
|
+
/* @__PURE__ */V(n,{label:Un("@products",Me.products),level:1,icon:W.lock,badge:{label:Me.readOnlyBadge,tone:"neutral"},expanded:ne.length?Jn:void 0,onToggle:()=>$e("@products"),selected:nn&&null==q.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Kn("@products")}}),Jn&&ne.length>0&&/* @__PURE__ */V(l,{children:Vn(ne,2)})]}),
|
|
8
|
+
/* @__PURE__ */V(n,{label:Me.allFiles,level:1,icon:Hn?W.folderOpen:W.folder,count:le,countLabel:null!=le?Me.fileCount(le):void 0,expanded:Ge.get(null)?.length?Hn:void 0,onToggle:()=>$e("@files"),selected:an&&null==q.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===On?"into":void 0,rowProps:{"data-media-row":"@files",...Rn("@files",null)}}),Hn&&(Ge.get(null)?.length??0)>0&&/* @__PURE__ */V(l,{children:Xn(null,2)}),Ue&&/* @__PURE__ */V(n,{label:Me.trash,level:1,icon:W.trash,count:ae,countLabel:null!=ae?Me.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Qn=(()=>{if(ln)return[{label:Me.trash}];if(nn){const e=q.nodeId?He.get(q.nodeId)?.path??[]:[];return[{label:Me.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=Qe(rn);return[{label:Me.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Wn=nn?Me.readOnly:fe.upload,Yn=!!be&&!ln&&!Wn,Zn=D({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Yn,onAccept:e=>be?.(e,rn)}),$n=nn?Me.noProductFolder:fe.newFolder,qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[Ue&&we&&!ln&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.folderPlus,onClick:()=>{wn(rn)},...qn($n),children:Me.newFolder}),be&&!ln&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:W.upload,onClick:()=>Zn.open(),...qn(Wn),children:Me.upload}),Ue&&ln&&je&&ie.length>0&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:je,...qn(fe.deleteForever),children:Me.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */V("div",{style:{width:Xe?void 0:i,flex:Xe?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */V(h,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */V("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */V(x,{size:"sm",type:"search",leftIcon:W.search,placeholder:nn?Me.searchProducts:Me.search,"aria-label":nn?Me.searchProducts:Me.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Me.mediaType,oe.type,[{value:"all",label:Me.allTypes},{value:"image",label:Me.images},{value:"video",label:Me.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Me.use,oe.use,[{value:"any",label:Me.anyUse},{value:"email",label:Me.emailOnly},{value:"website",label:Me.websiteOnly},{value:"unused",label:Me.notUsed}],nl("use"),130),de&&Ue&&el(Me.sort,oe.sort,[{value:"newest",label:Me.newest},{value:"name",label:Me.byName},{value:"size",label:Me.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */V(v,{size:"sm",label:Me.view,value:ce,onChange:ue,options:[{value:"grid",label:Me.grid,icon:W.grid},{value:"list",label:Me.list,icon:W.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Me.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:Y.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Me.used(e.usedCount),count:e.usedCount,icon:Y.link,tone:"active"}),e.email&&n.push({key:"e",label:Me.email,icon:Y.email,tone:"queued"}),e.private&&n.push({key:"p",label:Me.private,icon:Y.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */V(j,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Ue&&an&&!!xe&&!fe.move,tl=!!Ee&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[J]:ol(e)}}:{}})),sl=Xe?Math.max(72,Math.floor((Ve-24-16-1)/3)):112,cl=E(null),ul=g({containerRef:cl,enabled:Ue&&!Xe&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Ke){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Te?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},pl=ie.length?null:re?/* @__PURE__ */V(i,{variant:"dashed",title:Me.noMatches}):nn?/* @__PURE__ */V(i,{variant:"dashed",title:Me.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */V(i,{variant:"dashed",title:Me.trashEmpty}):!Yn||Ke?/* @__PURE__ */V(i,{variant:"dashed",title:Me.emptyFolder}):null,hl="list"===ce&&ie.length>0,fl=pl??(hl?/* @__PURE__ */V("ul",{role:"listbox","aria-multiselectable":Ue||void 0,"aria-label":Me.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */U("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(J,ol(e)),Ee("start")}:void 0,onDragEnd:ol(e)?e=>Ee("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(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)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */V("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
10
|
/* @__PURE__ */V("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
-
/* @__PURE__ */V("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */V("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */V(
|
|
12
|
-
/* @__PURE__ */V(
|
|
13
|
-
/* @__PURE__ */V(
|
|
11
|
+
/* @__PURE__ */V("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */V("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */V(m,{items:dl,readOnly:!Yn||Ke,onFiles:Yn&&!Ke?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?X:tl?J:void 0,onDragOutChange:tl?e=>Ee(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Ue?zn:void 0,menuOnMedia:Ue})),gl=u({count:un.length,kind:xn(un),targets:Nn({kind:"files",ids:un}),onPick:e=>xe?.({kind:"files",ids:un},e.key===s?null:e.key)}),vl=O({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */V(C,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */U(B,{children:[W.folder,Me.moveTo]}),items:gl,disabled:!!fe.move}),yl=Ue&&un.length>1&&!nn?/* @__PURE__ */U("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
12
|
+
/* @__PURE__ */V(y,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Me.selected(un.length)}),/* @__PURE__ */U(B,ln?{children:[De&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.undo,onClick:()=>De(un),...qn(fe.restore),children:Me.restore}),Se&&/* @__PURE__ */V(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...qn(fe.deleteForever),children:Me.deleteForever})]}:{children:[xe&&kl,Ne&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.edit,disabled:!0,children:Me.rename}),Ce&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.trash,onClick:()=>Ce({kind:"files",ids:un}),...qn(fe.trash),children:Me.moveFilesToTrash(un.length)})]}),
|
|
13
|
+
/* @__PURE__ */V(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Me.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Me.name,a?/* @__PURE__ */V(Z,{value:e.name,label:Me.fileName,onDone:bn}):e.name),l("type",Me.type,e.typeLabel),l("size",Me.size,e.sizeLabel),l("resolution",Me.resolution,e.resolution),nn?(l("design",Me.design,e.design),l("finish",Me.finish,e.finish),l("angle",Me.angleLug,e.angleLug),l("owner",Me.owner,e.owner)):(l("added",Me.addedBy,e.addedBy),l("folder",Me.folder,e.folderPath)),l("used",Me.usedIn,null!=e.usedCount?Me.places(e.usedCount):void 0);const i=c({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
14
|
return U("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
15
|
/* @__PURE__ */V("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */V(N,{tone:"neutral",title:Me.readOnlyBadge,children:on(tn)}),
|
|
16
16
|
/* @__PURE__ */V(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */U("div",{className:"flex gap-2",children:[
|
|
17
|
-
/* @__PURE__ */V("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */V(
|
|
18
|
-
/* @__PURE__ */V(
|
|
17
|
+
/* @__PURE__ */V("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */V(x,{size:"sm",readOnly:!0,value:e.url,"aria-label":Me.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
+
/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.copy,onClick:()=>Dn.copyUrl(e.id),children:Me.copyUrl})]}),an&&Ue&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.swap,onClick:()=>ze(e.id),...qn(fe.replace),children:Me.replace}),Oe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.crop,onClick:()=>Oe(e.id),children:Me.cropEdit}),xe&&"submenu"===i?.type&&/* @__PURE__ */V(C,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */U(B,{children:[W.folder,Me.moveTo]}),items:i.items,disabled:!!fe.move}),Ne&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.edit,onClick:()=>yn({kind:"file",id:e.id}),...qn(fe.rename),children:Me.rename}),Ce&&/* @__PURE__ */V(I,{"aria-label":Me.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:W.trash})]}),ln&&Ue&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:W.undo,onClick:()=>De([e.id]),...qn(fe.restore),children:Me.restore}),Se&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...qn(fe.deleteForever),children:Me.deleteForever})]}),nn&&Fe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:W.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Me.openInDesign}),he&&/* @__PURE__ */V(p,{items:he})]})},wl=mn?mn.private?Me.privateNoPick:mn.pickDisabledReason:void 0,Nl=Ke?/* @__PURE__ */U("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
19
19
|
/* @__PURE__ */V("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Me.oneChosen(mn.name):Me.noneChosen}),
|
|
20
|
-
/* @__PURE__ */U("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */V(
|
|
21
|
-
/* @__PURE__ */V(
|
|
20
|
+
/* @__PURE__ */U("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",onClick:Le,children:Me.cancel}),
|
|
21
|
+
/* @__PURE__ */V(z,{variant:"primary",size:"sm",disabled:!mn,...qn(wl),onClick:()=>{mn&&!wl&&Te?.(mn)},children:Me.chooseImage})]})]}):null,xl=Ue&&!!mn,Cl=/* @__PURE__ */U("div",{className:"flex min-w-0 flex-col gap-3",children:[Pe&&/* @__PURE__ */V(N,{tone:"neutral",children:Pe}),
|
|
22
22
|
/* @__PURE__ */U("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
-
/* @__PURE__ */V(d,{items:
|
|
23
|
+
/* @__PURE__ */V(d,{items:Qn}),_n]}),ll,yl,
|
|
24
24
|
/* @__PURE__ */U("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Ue&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
25
|
-
/* @__PURE__ */V(
|
|
26
|
-
/* @__PURE__ */V(
|
|
27
|
-
return U("div",{ref:Be,"data-media-library":"","data-layout":
|
|
28
|
-
/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:
|
|
29
|
-
/* @__PURE__ */V("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Cl}),
|
|
25
|
+
/* @__PURE__ */V(a,{rect:ul.rect})]}),Yn&&/* @__PURE__ */V("input",{...Zn.inputProps}),
|
|
26
|
+
/* @__PURE__ */V(S,{rejections:Zn.rejections})]});/* @__PURE__ */
|
|
27
|
+
return U("div",{ref:Be,"data-media-library":"","data-layout":Xe?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ae}`.trim(),children:[/* @__PURE__ */U("div",Xe?{className:"flex flex-col gap-3 p-3",children:[Gn,Cl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
+
/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Gn}),
|
|
29
|
+
/* @__PURE__ */V("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Cl}),xl&&/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),Nl,Xe&&/* @__PURE__ */V(o,{open:xl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */V(w,{...jn.props,items:Sn(jn.state.data)}),null!=Cn&&ie.length>0&&/* @__PURE__ */V(r,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Cn,ie.length-1),onClose:()=>In(null)})]})}export{X as MEDIA_FILES_DRAG_TYPE,J as MEDIA_FILE_DRAG_TYPE,H as MEDIA_FOLDER_DRAG_TYPE,$ as MediaLibrary,G as readMediaFileDrag};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useModalActive as e,KEY_ACTIVATED_SELECTOR as r}from"./chunk-F3ZOO23R.js";import{useState as t,useRef as n,useEffect as c}from"react";function u(u,o,i,a,s,l){const[d,m]=t(-1),f=n(u),v=n(o),y=n(i),k=n(a),w=n(s),h=n(d),E=n(-1),g=e(),p=n(g),K=n(l),L=n(null);f.current=u,v.current=o,y.current=i,k.current=a,w.current=s,h.current=d,p.current=g,K.current=l;const x=n(void 0),N=e=>{clearTimeout(x.current),x.current=setTimeout(()=>m(e),0)};c(()=>()=>clearTimeout(x.current),[]);const T=n(u.length);return c(()=>{u.length!==T.current&&(clearTimeout(x.current),m(-1),E.current=-1,T.current=u.length)},[u.length]),c(()=>{let e=!1;const r=()=>{e=document.activeElement===L.current},t=r=>{const t=e&&r.target===L.current;e=!1,t||(L.current=null)},n=e=>{L.current?.contains(e.target)&&(L.current=null)};return window.addEventListener("blur",r),document.addEventListener("focusin",t,!0),document.addEventListener("mousedown",n,!0),()=>{window.removeEventListener("blur",r),document.removeEventListener("focusin",t,!0),document.removeEventListener("mousedown",n,!0)}},[]),c(()=>{const e=e=>{if(!p.current)return;if(e.shiftKey)return;const r=e.target,t=r?.closest?.("[data-row-idx]");if(!t)return;if("INPUT"!==r.tagName||"checkbox"!==r.type)return;const n=parseInt(t.getAttribute("data-row-idx"),10);isNaN(n)||(E.current=n,N(n))};return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)},[]),c(()=>{const e=e=>{if(!p.current)return;const t=e.target?.tagName;if("INPUT"===t||"TEXTAREA"===t||"SELECT"===t)return;if(e.target?.isContentEditable)return;if((e.metaKey||e.ctrlKey)&&"a"===e.key)return e.preventDefault(),void k.current?.();if(e.metaKey||e.ctrlKey||e.altKey)return;const n=f.current.length;if(0===n)return;const c="KeyJ"===e.code||"j"===e.key||"J"===e.key||"ArrowDown"===e.key,u="KeyK"===e.code||"k"===e.key||"K"===e.key||"ArrowUp"===e.key,o=e.target?.closest?.(r)??null;if("Enter"!==e.key&&" "!==e.key||!o||o===L.current)if(c||u){L.current=o?.closest('[aria-modal="true"], [role="menu"]')||e.defaultPrevented&&e.key.startsWith("Arrow")?null:o,e.preventDefault();const r=h.current,t=c?Math.min(r+1,n-1):Math.max(r-1,0);t!==r&&(m(t),function(e,r){requestAnimationFrame(()=>{const t=r?r.current:document,n=t?.querySelector(`[data-row-idx="${e}"]`);n?.scrollIntoView({block:"nearest"})})}(t,K.current),e.shiftKey&&y.current&&(y.current(f.current[t]),E.current=t))}else if("Enter"===e.key&&h.current>=0&&h.current<n)e.preventDefault(),v.current(f.current[h.current]);else if(" "===e.key&&h.current>=0&&h.current<n){if(e.preventDefault(),e.shiftKey&&E.current>=0&&w.current){const e=Math.min(E.current,h.current),r=Math.max(E.current,h.current);w.current(e,r)}else y.current?.(f.current[h.current]);E.current=h.current}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),c(()=>{const e=e=>{if(!p.current)return;if(!e.shiftKey)return;const r=e.target,t=r?.closest?.("[data-row-idx]");if(!t)return;const n=parseInt(t.getAttribute("data-row-idx"),10);if(isNaN(n))return;const c="INPUT"===r.tagName&&"checkbox"===r.type?r:null,u=E.current;if(u<0){if(c)return E.current=n,void N(n);y.current?.(f.current[n])}else{const e=Math.min(u,n),r=Math.max(u,n);if(w.current)w.current(e,r),c&&(c.checked=!0);else if(y.current)for(let t=e;t<=r;t++)y.current(f.current[t])}c||e.preventDefault(),e.stopPropagation(),E.current=n,m(n)};return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)},[]),d}export{u as useTableNav};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-AFG34RBV.js";import{Avatar as t}from"./chunk-AFYLVV74.js";import{Input_default as a}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-AFG34RBV.js";import{Avatar as t}from"./chunk-AFYLVV74.js";import{Input_default as a}from"./chunk-HNUKXGYP.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|