efficient-shell 12.14.0 → 12.17.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 +53 -2
- package/dist/{Browser-V35ERC75.js → Browser-OAMMQWCR.js} +14 -14
- package/dist/{Calculator-FY7CWH3U.js → Calculator-4VBPCGRP.js} +23 -23
- package/dist/{CurrencyConverter-X2ZMKSB6.js → CurrencyConverter-34AMD4W7.js} +5 -5
- package/dist/{Files-5QCSSGZO.js → Files-6ZCDCTDZ.js} +82 -82
- package/dist/{Notepad-2AXGNMRM.js → Notepad-QJFTXGMP.js} +9 -9
- package/dist/{PomodoroTimer-LQM4OSNO.js → PomodoroTimer-6WR3UOOM.js} +69 -69
- package/dist/{Preview-NI7HTAAW.js → Preview-2FQMXNSY.js} +29 -29
- package/dist/{Stock-ENUIGK4M.js → Stock-UAGSFAKY.js} +2 -2
- package/dist/{Weather-QRQVA3LE.js → Weather-G2VGEQX2.js} +19 -19
- package/dist/{WorldClock-QJOV3TND.js → WorldClock-43KK7OTT.js} +6 -6
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +19 -19
- 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-3HZS3BAZ.js → chunk-25QDSYH5.js} +13 -13
- package/dist/chunk-27RPYRRI.js +2 -0
- package/dist/{chunk-XU3YOWEG.js → chunk-2DQHXJPM.js} +1 -1
- package/dist/{chunk-R7QEGRKE.js → chunk-35MQCHVD.js} +1 -1
- package/dist/chunk-3UKNOOSL.js +4 -0
- package/dist/{chunk-2ZPNA7L7.js → chunk-5DQE6RQJ.js} +1 -1
- package/dist/chunk-5HLLCX6X.js +2 -0
- package/dist/{chunk-QU23OGAX.js → chunk-5QYKF7NK.js} +17 -17
- package/dist/chunk-5XCASBGK.js +5 -0
- package/dist/chunk-5ZT3FJ2W.js +2 -0
- package/dist/{chunk-LFYZ7NQ4.js → chunk-64RHGJXK.js} +4 -4
- package/dist/chunk-6RHKNP2Q.js +2 -0
- package/dist/chunk-6V3BNCDT.js +2 -0
- package/dist/chunk-ABQWWMTO.js +2 -0
- package/dist/chunk-ASPLTZBH.js +2 -0
- package/dist/chunk-BAWT5QBA.js +2 -0
- package/dist/chunk-CDGK3TOO.js +2 -0
- package/dist/chunk-CYU454QR.js +2 -0
- package/dist/chunk-DLOTU5XU.js +5 -0
- package/dist/chunk-DRMIQ3YE.js +1 -0
- package/dist/chunk-DRSPB4ZE.js +2 -0
- package/dist/chunk-DSOV33XA.js +1 -0
- package/dist/{chunk-UEEELXEN.js → chunk-DVYBJOD3.js} +10 -10
- package/dist/chunk-DWGYC7OD.js +1 -0
- package/dist/chunk-ECJSGHFD.js +2 -0
- package/dist/chunk-EJRRJXDG.js +2 -0
- package/dist/chunk-FIW2BUK2.js +2 -0
- package/dist/{chunk-KX53AB74.js → chunk-H4ABSQS6.js} +1 -1
- package/dist/chunk-H7RDZRJ4.js +2 -0
- package/dist/chunk-HBDNQ3ER.js +4 -0
- package/dist/chunk-HNBMBC77.js +1 -0
- package/dist/{chunk-FUTLZ6BC.js → chunk-HYPYNVQQ.js} +1 -1
- package/dist/chunk-J3Z4U2CT.js +2 -0
- package/dist/{chunk-CJ3MI2NH.js → chunk-JQWZ36JD.js} +1 -1
- package/dist/chunk-KELGQ7WI.js +2 -0
- package/dist/{chunk-LTUVKDTO.js → chunk-LNZMA4PB.js} +1 -1
- package/dist/chunk-LSADTBPH.js +4 -0
- package/dist/chunk-LSF43AEU.js +1 -0
- package/dist/{chunk-XDJQWP5K.js → chunk-MBCUICY3.js} +1 -1
- package/dist/chunk-MEF5E2JA.js +2 -0
- package/dist/{chunk-IIC76MWQ.js → chunk-MFJHLC5M.js} +1 -1
- package/dist/{chunk-DJYZ2EF4.js → chunk-MJVFIH3J.js} +11 -11
- package/dist/chunk-MUNG4VXE.js +2 -0
- package/dist/chunk-N3THYDNV.js +2 -0
- package/dist/{chunk-5WZ53AS5.js → chunk-OFYNPYY2.js} +1 -1
- package/dist/{chunk-5VGIIMON.js → chunk-OGL2GV37.js} +1 -1
- package/dist/chunk-OYJAXZFU.js +2 -0
- package/dist/{chunk-BWYOTLJL.js → chunk-PDA77NNC.js} +3 -3
- package/dist/{chunk-SDL4VWFU.js → chunk-PJE75B66.js} +1 -1
- package/dist/chunk-PMBCQWJW.js +4 -0
- package/dist/chunk-PTJIGNKA.js +4 -0
- package/dist/{chunk-KCAUYEYR.js → chunk-QBWMWK2W.js} +6 -6
- package/dist/chunk-QIFGQE6V.js +2 -0
- package/dist/chunk-RIG5FEVS.js +1 -0
- package/dist/chunk-RMKC5POE.js +3 -0
- package/dist/chunk-S3OCHYGE.js +14 -0
- package/dist/chunk-SRR4MAA6.js +4 -0
- package/dist/chunk-SZ6J44ZK.js +2 -0
- package/dist/chunk-THRSU75M.js +2 -0
- package/dist/{chunk-G6LSBF3P.js → chunk-TKPUYQ3Q.js} +29 -29
- package/dist/chunk-TO6CUG4Y.js +4 -0
- package/dist/chunk-TUA2VQO7.js +4 -0
- package/dist/{chunk-QJGZOD6X.js → chunk-TW7SWDKZ.js} +7 -4
- package/dist/chunk-U77527G3.js +2 -0
- package/dist/chunk-US6NOIGO.js +6 -0
- package/dist/chunk-VIWM4GD7.js +2 -0
- package/dist/chunk-VL6SOWP5.js +2 -0
- package/dist/chunk-VPXAOSVH.js +28 -0
- package/dist/chunk-WBLA7EHW.js +2 -0
- package/dist/{chunk-OCI3PZDU.js → chunk-WCCGKDG6.js} +2 -2
- package/dist/chunk-WPT5DUCQ.js +2 -0
- package/dist/chunk-WWABT3IW.js +5 -0
- package/dist/chunk-WX5KKB3X.js +4 -0
- package/dist/chunk-X7BRR6UW.js +5 -0
- package/dist/chunk-XAC2GAOD.js +4 -0
- package/dist/chunk-XL4QM2D3.js +5 -0
- package/dist/chunk-XLWPIUZB.js +2 -0
- package/dist/chunk-XN3KM6YE.js +4 -0
- package/dist/chunk-XW336CNF.js +2 -0
- package/dist/chunk-YFUY3VDW.js +9 -0
- package/dist/{chunk-EGCHJHRR.js → chunk-YK64FFLW.js} +8 -8
- package/dist/{chunk-AELSVMXH.js → chunk-YTZFWV2W.js} +1 -1
- package/dist/{chunk-ICZUWLVU.js → chunk-YVHEKEHJ.js} +1 -1
- package/dist/chunk-Z5TE3MEG.js +1 -0
- package/dist/{chunk-LIX6KTZJ.js → chunk-Z62RBVEJ.js} +1 -1
- package/dist/{chunk-EZ6O5TQ3.js → chunk-ZE7OVMDM.js} +16 -16
- package/dist/chunk-ZILBCVKS.js +2 -0
- package/dist/{chunk-CU3ZE25J.js → chunk-ZKGUBIBT.js} +1 -1
- package/dist/{chunk-6KITIRNZ.js → chunk-ZQT3GNRU.js} +2 -2
- package/dist/format/index.d.ts +152 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.d.ts +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TextToolbar.d.ts +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/linkHref.js +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +16 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +32 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +16 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +16 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/EntranceBounceIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceBounceIcon.js +1 -0
- package/dist/icons/glyphs/EntranceFadeIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceFadeIcon.js +1 -0
- package/dist/icons/glyphs/EntranceFlipIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceFlipIcon.js +1 -0
- package/dist/icons/glyphs/EntranceGlideIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceGlideIcon.js +1 -0
- package/dist/icons/glyphs/EntranceRevealIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceRevealIcon.js +1 -0
- package/dist/icons/glyphs/EntranceRiseIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceRiseIcon.js +1 -0
- package/dist/icons/glyphs/EntranceScaleIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceScaleIcon.js +1 -0
- package/dist/icons/glyphs/EntranceSpinIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceSpinIcon.js +1 -0
- package/dist/icons/glyphs/LoopMarqueeIcon.d.ts +8 -0
- package/dist/icons/glyphs/LoopMarqueeIcon.js +1 -0
- package/dist/icons/glyphs/ScrollFadeInIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollFadeInIcon.js +1 -0
- package/dist/icons/glyphs/ScrollFadeOutIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollFadeOutIcon.js +1 -0
- package/dist/icons/glyphs/ScrollMoveDownIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollMoveDownIcon.js +1 -0
- package/dist/icons/glyphs/ScrollMoveUpIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollMoveUpIcon.js +1 -0
- package/dist/icons/glyphs/ScrollParallaxIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollParallaxIcon.js +1 -0
- package/dist/icons/glyphs/ScrollZoomInIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollZoomInIcon.js +1 -0
- package/dist/icons/glyphs/ScrollZoomOutIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollZoomOutIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/EntranceBounceMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceBounceMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceBounceSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceBounceSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceFadeMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFadeMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceFadeSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFadeSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceFlipMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFlipMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceFlipSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFlipSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceGlideMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceGlideMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceGlideSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceGlideSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceRevealMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRevealMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceRevealSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRevealSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceRiseMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRiseMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceRiseSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRiseSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceScaleMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceScaleMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceScaleSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceScaleSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceSpinMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceSpinMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceSpinSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceSpinSolidIcon.js +1 -0
- package/dist/icons/looks/LoopMarqueeMiniIcon.d.ts +8 -0
- package/dist/icons/looks/LoopMarqueeMiniIcon.js +1 -0
- package/dist/icons/looks/LoopMarqueeSolidIcon.d.ts +8 -0
- package/dist/icons/looks/LoopMarqueeSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeInMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeInMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeInSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeInSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeOutMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeOutMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeOutSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeOutSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveDownMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveDownMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveDownSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveDownSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveUpMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveUpMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveUpSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveUpSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollParallaxMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollParallaxMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollParallaxSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollParallaxSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomInMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomInMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomInSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomInSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomOutMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomOutMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomOutSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomOutSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +511 -511
- package/dist/markup/index.d.ts +22 -2
- package/dist/markup/index.js +1 -1
- package/dist/motion.css +130 -1
- package/dist/{names-Cj_F68_V.d.ts → names-BNKpHeTy.d.ts} +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/ConfirmDialog.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/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/Tabs.d.ts +9 -0
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/focusTrap.d.ts +6 -1
- package/dist/shell/focusTrap.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/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3DVNXNTF.js +0 -1
- package/dist/chunk-AQZUTW7N.js +0 -9
- package/dist/chunk-CDAJKLGL.js +0 -1
- package/dist/chunk-FYNPQAFI.js +0 -1
- package/dist/chunk-LZKPV3XR.js +0 -3
- package/dist/chunk-MLPXTFDS.js +0 -1
- package/dist/chunk-NBNYKV3D.js +0 -14
- package/dist/chunk-PCZSE6CC.js +0 -5
- package/dist/chunk-Q5Z3KHT2.js +0 -1
- package/dist/chunk-SNLGA2PZ.js +0 -1
- package/dist/chunk-YHB6MJYD.js +0 -28
- package/dist/chunk-YYW4VNWL.js +0 -1
- /package/dist/{chunk-3N5OI6VM.js → chunk-2VFSYSDS.js} +0 -0
- /package/dist/{chunk-NQJXHV4K.js → chunk-VT7QZPIO.js} +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-JDQGHQ2C.js";import{Tooltip as l}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{useRef as i,useState as c,useEffect as d}from"react";import{jsx as s,jsxs as u,Fragment as m}from"react/jsx-runtime";var b=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function
|
|
2
|
-
return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=
|
|
3
|
-
return s("div",{ref
|
|
1
|
+
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-JDQGHQ2C.js";import{Tooltip as l}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{useRef as i,useState as c,useEffect as d}from"react";import{jsx as s,jsxs as u,Fragment as m}from"react/jsx-runtime";var b=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function f(e,t,n="default"){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":`border-transparent ${"warning"===n?"text-amber-700":"text-gray-900"} hover:border-gray-300`}`}function h(e){if(!e||!e.startsWith("#")||e.length<2)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch{return null}}function p(e,t){const n=e.filter(e=>!e.disabled).map(e=>({id:e.id,section:h(e.href)})).filter(e=>null!=e.section);if(0===n.length)return null;const r=function(e){for(let t=e.parentElement;t;t=t.parentElement){const e=getComputedStyle(t).overflowY;if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}(n[0].section);if(r.scrollTop>0&&r.scrollTop+r.clientHeight>=r.scrollHeight-1)return n[n.length-1].id;const o=Math.max(0,t.getBoundingClientRect().bottom)+8;let l=n[0].id;for(const e of n)e.section.getBoundingClientRect().top<=o&&(l=e.id);return l}function g({items:e,value:n,onChange:o,block:c=!1,className:u="","aria-label":m,"aria-labelledby":g}){const v=i(null),y=function(e,t,n,r){const o=i(0),l=i({items:t,value:n,onChange:r});l.current={items:t,value:n,onChange:r};const c=i(()=>{});return c.current=()=>{const t=e.current;if(!t||Date.now()<o.current)return;const n=p(l.current.items,t);null!=n&&n!==l.current.value&&l.current.onChange(n)},a(()=>{c.current()},[t]),d(()=>{let e=0;const t=()=>{e||(e=requestAnimationFrame(()=>{e=0,c.current()}))};return document.addEventListener("scroll",t,{capture:!0,passive:!0}),window.addEventListener("resize",t),()=>{document.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("resize",t),e&&cancelAnimationFrame(e)}},[]),e=>{o.current=Date.now()+800,e!==l.current.value&&l.current.onChange(e),window.setTimeout(()=>c.current(),850)}}(v,e,n,o);/* @__PURE__ */
|
|
2
|
+
return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=h(t.href);n&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&(e.preventDefault(),y(t.id),n.scrollIntoView({block:"start",behavior:"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))})(t,e),className:`${f(o,c,"warning"===e.tone?"warning":"default")}${e.disabled?" cursor-not-allowed opacity-50":""}`,children:/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */s(l,{content:e.tooltip,className:c?r(c):void 0,children:a},e.id):a})})}var v=(e,t)=>`${e}-tab-${t}`,y=(e,t)=>`${e}-panel-${t}`;function w(e,t){const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=(parseFloat(n.columnGap)||0)*Math.max(0,t-1),l=e.parentElement;let a=1/0;if(l){const e=getComputedStyle(l);a=l.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:r+o,room:a}}function x(e){return e.items.some(e=>null!=e.href)?/* @__PURE__ */s(g,{...e}):/* @__PURE__ */s(k,{...e})}function k({items:h,value:p,onChange:g,variant:x="underline",block:k=!1,idPrefix:F,className:E="","aria-label":N,"aria-labelledby":L,labelsFit:R=!1,dotLabel:A="Has a setting"}){const $=i([]),S=i(null),D="pill"===x,[H,W]=c(null),j=H??"none",z=i(()=>{});z.current=()=>{const t=S.current;if(!t||!R)return;const n=function(e){return[...e.querySelectorAll('[role="tab"]')].map(e=>{const t=getComputedStyle(e),n=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)+(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.borderRightWidth)||0),r=e.querySelector("[data-tab-glyph]")?.getBoundingClientRect().width??0,o=e.querySelector("[data-tab-word]")?.scrollWidth??0;return{bare:n+r,worded:n+r+(r&&o?8:0)+o,active:"true"===e.getAttribute("aria-selected")}})}(t);W(function({tabs:t,block:n,chrome:r,room:o}){if(!n)return e({buttons:t,orientation:"horizontal",chrome:r,room:o});if(0===t.length)return"none";const l=e=>r+e*t.length<=o+.5;if(l(Math.max(...t.map(e=>e.worded))))return"all";const a=t.find(e=>e.active);return a&&l(Math.max(a.worded,...t.map(e=>e.bare)))?"chosen":"none"}({tabs:n,block:k,...w(t,n.length)}))},a(()=>{z.current()}),d(()=>{const e=S.current?.parentElement;if(!R||!e)return;let t=!0;const n=()=>{t&&z.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[R]);const I=(e,t)=>{for(let n=1;n<=h.length;n+=1){const r=((e+t*n)%h.length+h.length)%h.length;if(!h[r]?.disabled)return r}return null},M=e=>{const t=1===e?h.map((e,t)=>t):h.map((e,t)=>h.length-1-t);for(const e of t)if(!h[e]?.disabled)return e;return null};/* @__PURE__ */
|
|
3
|
+
return s("div",{ref:S,role:"tablist","data-labels-shown":R?j:void 0,"aria-label":N,"aria-labelledby":L,onKeyDown:e=>{const t=h.findIndex(e=>e.id===p);let n=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=I(t,1);else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=I(t,-1);else if("Home"===e.key)n=M(1);else{if("End"!==e.key)return;n=M(-1)}e.preventDefault(),null!==n&&n!==t&&(g(h[n].id),$.current[n]?.focus())},className:D?o(k,E):b(k,E),children:h.map((e,o)=>{const a=e.id===p,i=R&&null!=e.icon,c="all"===j||"chosen"===j&&a,d=e.dot?/* @__PURE__ */s(C,{label:e.label,on:a,said:A}):e.label,b=/* @__PURE__ */s("button",{ref:e=>{$.current[o]=e},type:"button",role:"tab",id:F?v(F,e.id):void 0,"aria-controls":F?y(F,e.id):void 0,"aria-selected":a,tabIndex:a?0:-1,disabled:e.disabled,onClick:()=>g(e.id),className:D?n({selected:a,disabled:e.disabled,block:k}):f(a,k,"warning"===e.tone?"warning":"default"),children:i?/* @__PURE__ */u(m,{children:[
|
|
4
4
|
/* @__PURE__ */s("span",{"aria-hidden":"true","data-tab-glyph":"",className:"inline-flex shrink-0",children:e.icon}),
|
|
5
|
-
/* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:
|
|
5
|
+
/* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:d})]}):/* @__PURE__ */s(t,{icon:e.icon,label:d})},e.id),h=i?e.tooltip??e.label:e.tooltip;return null!=h&&!1!==h?/* @__PURE__ */s(l,{content:h,className:D||k?r(k):void 0,children:b},e.id):b})})}function C({label:e,on:t,said:n}){/* @__PURE__ */
|
|
6
|
+
return u("span",{className:"inline-flex items-center gap-(--space-4)",children:[e,
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-hidden":"true","data-tab-dot":t?"on":"off",className:"size-2 shrink-0 rounded-full "+(t?"bg-current":"bg-accent-fill")}),
|
|
8
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:n})]})}export{x as Tabs,v as tabButtonId,y as tabPanelId};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function h({size:h=18,...e}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:h,height:h,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...e,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M8.125,6.125h3.75c0.49841,0.03274 1.09349,0.26507 1.41421,0.58579c0.32072,0.32072 0.55305,0.9158 0.58579,1.41421v3.75c-0.03274,0.49841 -0.26507,1.09349 -0.58579,1.41421c-0.32072,0.32072 -0.9158,0.55305 -1.41421,0.58579h-3.75c-0.49841,-0.03274 -1.09349,-0.26507 -1.41421,-0.58579c-0.32072,-0.32072 -0.55305,-0.9158 -0.58579,-1.41421v-3.75c0.03274,-0.49841 0.26507,-1.09349 0.58579,-1.41421c0.32072,-0.32072 0.9158,-0.55305 1.41421,-0.58579zM3.75,5.75c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-1.25c0,-0.41421 0.33579,-0.75 0.75,-0.75h1.25c0.41421,0 0.75,0.33579 0.75,0.75c0,0.41421 -0.33579,0.75 -0.75,0.75h-0.5v0.5c0,0.41421 -0.33579,0.75 -0.75,0.75zM14.25,3.75c0,-0.41421 0.33579,-0.75 0.75,-0.75h1.25c0.41421,0 0.75,0.33579 0.75,0.75v1.25c0,0.41421 -0.33579,0.75 -0.75,0.75c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-0.5h-0.5c-0.41421,0 -0.75,-0.33579 -0.75,-0.75zM16.25,14.25c0.41421,0 0.75,0.33579 0.75,0.75v1.25c0,0.41421 -0.33579,0.75 -0.75,0.75h-1.25c-0.41421,0 -0.75,-0.33579 -0.75,-0.75c0,-0.41421 0.33579,-0.75 0.75,-0.75h0.5v-0.5c0,-0.41421 0.33579,-0.75 0.75,-0.75zM5.75,16.25c0,0.41421 -0.33579,0.75 -0.75,0.75h-1.25c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-1.25c0,-0.41421 0.33579,-0.75 0.75,-0.75c0.41421,0 0.75,0.33579 0.75,0.75v0.5h0.5c0.41421,0 0.75,0.33579 0.75,0.75z"})})}export{h as EntranceScaleMiniIcon};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{jsxs as a,jsx as r}from"react/jsx-runtime";function t({size:t=18,...e}){/* @__PURE__ */
|
|
2
|
+
return a("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[
|
|
3
|
+
/* @__PURE__ */r("path",{d:"M3.75 6h1.5a1.5 1.5 0 0 1 1.5 1.5v4.5a1.5 1.5 0 0 1 -1.5 1.5h-1.5a1.5 1.5 0 0 1 -1.5 -1.5v-4.5a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
4
|
+
/* @__PURE__ */r("path",{d:"M11.25 6h1.5a1.5 1.5 0 0 1 1.5 1.5v4.5a1.5 1.5 0 0 1 -1.5 1.5h-1.5a1.5 1.5 0 0 1 -1.5 -1.5v-4.5a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
5
|
+
/* @__PURE__ */r("path",{d:"M18.75 6h1.5a1.5 1.5 0 0 1 1.5 1.5v4.5a1.5 1.5 0 0 1 -1.5 1.5h-1.5a1.5 1.5 0 0 1 -1.5 -1.5v-4.5a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
6
|
+
/* @__PURE__ */r("path",{d:"M7.5 18L16.5 18M14.25 15.75L16.5 18L14.25 20.25"})]})}export{t as LoopMarqueeIcon};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function h({size:h=18,...e}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:h,height:h,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M9.75,7.5h4.5c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v4.5c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-4.5c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-4.5c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM4.5,6.75c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-1.5c0,-0.41421 0.33579,-0.75 0.75,-0.75h1.5c0.41421,0 0.75,0.33579 0.75,0.75c0,0.41421 -0.33579,0.75 -0.75,0.75h-0.75v0.75c0,0.41421 -0.33579,0.75 -0.75,0.75zM17.25,4.5c0,-0.41421 0.33579,-0.75 0.75,-0.75h1.5c0.41421,0 0.75,0.33579 0.75,0.75v1.5c0,0.41421 -0.33579,0.75 -0.75,0.75c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-0.75h-0.75c-0.41421,0 -0.75,-0.33579 -0.75,-0.75zM19.5,17.25c0.41421,0 0.75,0.33579 0.75,0.75v1.5c0,0.41421 -0.33579,0.75 -0.75,0.75h-1.5c-0.41421,0 -0.75,-0.33579 -0.75,-0.75c0,-0.41421 0.33579,-0.75 0.75,-0.75h0.75v-0.75c0,-0.41421 0.33579,-0.75 0.75,-0.75zM6.75,19.5c0,0.41421 -0.33579,0.75 -0.75,0.75h-1.5c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-1.5c0,-0.41421 0.33579,-0.75 0.75,-0.75c0.41421,0 0.75,0.33579 0.75,0.75v0.75h0.75c0.41421,0 0.75,0.33579 0.75,0.75z"})})}export{h as EntranceScaleSolidIcon};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M9,1.5h6c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v6c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-6c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-6c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM12,22.5c-0.41421,0 -0.75,-0.33579 -0.75,-0.75v-5.68934l-0.96967,0.96967c-0.29289,0.29289 -0.76777,0.29289 -1.06066,0c-0.29289,-0.29289 -0.29289,-0.76777 0,-1.06066l2.25,-2.25c0.07191,-0.07191 0.15478,-0.12616 0.24324,-0.16276c0.08843,-0.03667 0.1854,-0.05691 0.28709,-0.05691c0.10169,0 0.19866,0.02024 0.28709,0.05691c0.08846,0.0366 0.17134,0.09085 0.24324,0.16276l2.25,2.25c0.29289,0.29289 0.29289,0.76777 0,1.06066c-0.29289,0.29289 -0.76777,0.29289 -1.06066,0l-0.96967,-0.96967v5.68934c0,0.41421 -0.33579,0.75 -0.75,0.75z"})})}export{e as EntranceRiseSolidIcon};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-EDX55XGV.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-4I4WZHMV.js";import{ImageLightbox as r}from"./chunk-DVYBJOD3.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-YFUY3VDW.js";import{Breadcrumbs as d}from"./chunk-JTGRLXZN.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-MRLXGLNZ.js";import{useMediaMoveItems as u}from"./chunk-NOGSS432.js";import{RenameField as m}from"./chunk-LNZMA4PB.js";import{NativeSelect as h}from"./chunk-VJXPT53M.js";import{MediaUploadGrid as p}from"./chunk-ZTRKM3B5.js";import{MediaUsedInList as f}from"./chunk-LQVQX5B2.js";import{Segmented as g}from"./chunk-QAS22BIS.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{useMarquee as k}from"./chunk-OLFYNMTD.js";import{copyToClipboard as y}from"./chunk-Y7KDCC6E.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-7ARBBWPQ.js";import{Banner as N}from"./chunk-YU52WMSH.js";import{Input_default as C}from"./chunk-ZKGUBIBT.js";import{DropdownMenu as I}from"./chunk-QBWMWK2W.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-V4XR4MOS.js";import{ColoredBadge as z}from"./chunk-WQ4YKWN2.js";import{Button_default as T}from"./chunk-EVYD6UFQ.js";import{Icon as O}from"./chunk-JOAKKXTL.js";import{Tooltip as F}from"./chunk-SOZCWT6I.js";import{buttonClasses as L}from"./chunk-UQYNPYF4.js";import{usePlotWidth as M}from"./chunk-MAFUXCPZ.js";import{useShellStrings as A}from"./chunk-JSHMIMAJ.js";import{useRef as P,useMemo as E,useCallback as B,useState as R,useEffect as K}from"react";import{jsxs as U,Fragment as V,jsx as W}from"react/jsx-runtime";var J="application/x-efficient-media-files",Y="application/x-efficient-media-folder",G="application/x-efficient-media-file";function Q(e){if(!e||!Array.from(e.types).includes(G))return null;try{const n=JSON.parse(e.getData(G));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 X={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */W(O,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */W(O,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */W(O,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */W(O,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */W(O,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */W(O,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */W(O,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */W(O,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */W(O,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */W(O,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */W(O,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */W(O,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */W(O,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */W(O,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */W(O,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */W(O,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},H={link:/* @__PURE__ */W(O,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */W(O,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */W(O,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */W(O,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function $(O){const{mode:Q="manage",layout:$="auto",location:q,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=X,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:he,usedIn:pe,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ne,onTrash:Ce,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Te,onOpenInDesign:Oe,onChoose:Fe,onCancel:Le,pickNote:Me,onDragOut:Ae,className:Pe=""}=O,Ee=A().mediaLibrary,Be=A().media,Re="pick"===Q,Ke=!Re,Ue=P(null),Ve=M(Ue,"phone"===$?343:1200),We="phone"===$||"auto"===$&&Ve<640,Je=E(()=>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]),Ye=E(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Ge=E(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Ye.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Ye]),Qe=B(e=>{const n=[];for(let l=e?Ye.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Ye.get(l.parentId):void 0);return n},[Ye,ee.length]),Xe=B((e,n)=>Qe(e).some(e=>e.id===n),[Qe]),[Ze,He]=R(()=>/* @__PURE__ */new Set(["@files"])),$e=e=>He(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),qe=B(e=>{He(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?Je.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?Je.get(q.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ee.readOnly} ${Ee.editedAtHq(e.sharedFrom)}`:Ee.readOnly,dn=E(()=>ie.map(e=>e.id),[ie]),sn=E(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=v(dn),un=E(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,hn=P(!0);K(()=>{hn.current?hn.current=!1:cn.clear()},[_e]);const pn=me?.join("\0");K(()=>{me&&cn.setSelection(me)},[pn]);const fn=P(pn??""),gn=un.join("\0");K(()=>{fn.current!==gn&&(fn.current=gn,he?.(un))},[gn]);const vn=(e,n={})=>{Re?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?Ye.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(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})},xn=B(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ee.alreadyHere:void 0;const l=Ye.get(e.id);return n===e.id||n&&Xe(n,e.id)?Ee.notIntoItself:(l?.parentId??null)===n?Ee.folderAlreadyHere:void 0};n.push({key:s,label:Ee.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,Ye,an,Xe,rn,Ee]),Nn=B(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:Ee,media:Be,denied:fe,moveTargets:xn,kindOf:Nn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Ke?e=>{wn(e)}:void 0,rename:xe&&Ke?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ne&&Ke?Ne:void 0,trash:Ce&&Ke?Ce:void 0,deleteFolder:Ie&&Ke?Ie:void 0,folderNotEmpty:e=>!!Ye.get(e)?.notEmpty,replace:ze&&Ke?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&y(Ee.urlLabel,n)},openInDesign:Oe,restore:De,deleteForever:Se},Sn=e=>c(e,Dn),jn=w(),zn=(e,n)=>{Re||(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)))},[Tn,On]=R(null),[Fn,Ln]=R(null),[Mn,An]=R(null);K(()=>{if(!Fn&&!Tn)return;const e=()=>{Ln(null),On(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[Fn,Tn]);const Pn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),En=(e,n)=>!(!Ne||fe.move||Re)&&(!!Pn(e,J)||!(!Pn(e,Y)||!Mn)&&(n!==Mn&&!(n&&Xe(n,Mn)))),Bn=(e,n)=>({onDragEnter:l=>{En(l,n)&&(l.preventDefault(),On(e))},onDragOver:l=>{En(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Tn!==e&&On(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)},onDrop:e=>{if(En(e,n))if(e.preventDefault(),On(null),Pn(e,J)){let l;try{l=JSON.parse(e.dataTransfer.getData(J))}catch{l=null}Array.isArray(l)&&l.length&&Ne({kind:"files",ids:l.map(String)},n)}else Mn&&(Ne({kind:"folder",id:Mn},n),An(null))}}),Rn=e=>{const n=e=>Pn(e,J)||Pn(e,Y)||Pn(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&Fn!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Kn=(e,n,l)=>/* @__PURE__ */W(F,{side:"right",content:Fn===e?Ee.noDropProducts:on(l),open:Fn===e||!Fn&&void 0,children:/* @__PURE__ */W("span",{children:n})}),Un=e=>({onContextMenu:n=>{jn.open(n,e)}}),Vn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=Ze.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */W(n,{label:Kn(r,e.name,t),level:a,icon:d&&o?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.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,...Rn(r),...Ke?Un({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */W(l,{children:Vn(d,a+1,t)})]},e.id)}),Wn=(e,a)=>(Ge.get(e)??[]).map(e=>{const i=Ge.get(e.id),r=Ze.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */W(n,{label:e.name,level:a,icon:i&&r?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.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:Tn===e.id?"into":void 0,dragging:Mn===e.id,draggable:Ke&&!!Ne&&!fe.move,rename:t?/* @__PURE__ */W(m,{value:e.name,label:Ee.folderName,onDone:bn}):void 0,actions:Ke&&o.length?/* @__PURE__ */W(I,{align:"end","aria-label":Ee.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Bn(e.id,e.id),...Ke?Un({kind:"folder",id:e.id}):{},...Ke&&Ne&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(Y,e.id),An(e.id)},onDragEnd:()=>{An(null),On(null)}}:{}}}),i&&r&&/* @__PURE__ */W(l,{children:Wn(e.id,a+1)})]},e.id)}),Jn=Ze.has("@files"),Yn=Ze.has("@products"),Gn=/* @__PURE__ */U(e,{"aria-label":Ee.folders,children:[ne&&/* @__PURE__ */U(V,{children:[
|
|
6
|
+
/* @__PURE__ */W(n,{label:Kn("@products",Ee.products),level:1,icon:Z.lock,badge:{label:Ee.readOnlyBadge,tone:"neutral"},expanded:ne.length?Yn:void 0,onToggle:()=>$e("@products"),selected:nn&&null==q.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Rn("@products")}}),Yn&&ne.length>0&&/* @__PURE__ */W(l,{children:Vn(ne,2)})]}),
|
|
7
|
+
/* @__PURE__ */W(n,{label:Ee.allFiles,level:1,icon:Jn?Z.folderOpen:Z.folder,count:le,countLabel:null!=le?Ee.fileCount(le):void 0,expanded:Ge.get(null)?.length?Jn:void 0,onToggle:()=>$e("@files"),selected:an&&null==q.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Tn?"into":void 0,rowProps:{"data-media-row":"@files",...Bn("@files",null)}}),Jn&&(Ge.get(null)?.length??0)>0&&/* @__PURE__ */W(l,{children:Wn(null,2)}),Ke&&/* @__PURE__ */W(n,{label:Ee.trash,level:1,icon:Z.trash,count:ae,countLabel:null!=ae?Ee.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Qn=(()=>{if(ln)return[{label:Ee.trash}];if(nn){const e=q.nodeId?Je.get(q.nodeId)?.path??[]:[];return[{label:Ee.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:Ee.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}))]})(),Xn=nn?Ee.readOnly:fe.upload,Zn=!!be&&!ln&&!Xn,Hn=S({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Zn,onAccept:e=>be?.(e,rn)}),$n=nn?Ee.noProductFolder:fe.newFolder,qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[Ke&&we&&!ln&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{wn(rn)},...qn($n),children:Ee.newFolder}),be&&!ln&&/* @__PURE__ */W(T,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>Hn.open(),...qn(Xn),children:Ee.upload}),Ke&&ln&&je&&ie.length>0&&/* @__PURE__ */W(T,{variant:"danger",size:"sm",onClick:je,...qn(fe.deleteForever),children:Ee.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */W("div",{style:{width:We?void 0:i,flex:We?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */W(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__ */W("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */W(C,{size:"sm",type:"search",leftIcon:Z.search,placeholder:nn?Ee.searchProducts:Ee.search,"aria-label":nn?Ee.searchProducts:Ee.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ee.mediaType,oe.type,[{value:"all",label:Ee.allTypes},{value:"image",label:Ee.images},{value:"video",label:Ee.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ee.use,oe.use,[{value:"any",label:Ee.anyUse},{value:"email",label:Ee.emailOnly},{value:"website",label:Ee.websiteOnly},{value:"unused",label:Ee.notUsed}],nl("use"),130),de&&Ke&&el(Ee.sort,oe.sort,[{value:"newest",label:Ee.newest},{value:"name",label:Ee.byName},{value:"size",label:Ee.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */W(g,{size:"sm",label:Ee.view,value:ce,onChange:ue,options:[{value:"grid",label:Ee.grid,icon:Z.grid},{value:"list",label:Ee.list,icon:Z.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ee.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:H.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ee.used(e.usedCount),count:e.usedCount,icon:H.link,tone:"active"}),e.email&&n.push({key:"e",label:Ee.email,icon:H.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ee.private,icon:H.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */W(z,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Ke&&an&&!!Ne&&!fe.move,tl=!!Ae&&!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:{[G]:ol(e)}}:{}})),sl=We?Math.max(72,Math.floor((Ve-24-16-1)/3)):112,cl=P(null),ul=k({containerRef:cl,enabled:Ke&&!We&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Re){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Fe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},hl=ie.length?null:re?/* @__PURE__ */W(i,{variant:"dashed",title:Ee.noMatches}):nn?/* @__PURE__ */W(i,{variant:"dashed",title:Ee.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */W(i,{variant:"dashed",title:Ee.trashEmpty}):!Zn||Re?/* @__PURE__ */W(i,{variant:"dashed",title:Ee.emptyFolder}):null,pl="list"===ce&&ie.length>0,fl=hl??(pl?/* @__PURE__ */W("ul",{role:"listbox","aria-multiselectable":Ke||void 0,"aria-label":Ee.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(G,ol(e)),Ae("start")}:void 0,onDragEnd:ol(e)?e=>Ae("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:[
|
|
8
|
+
/* @__PURE__ */W("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */W("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */W("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */W("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */W(p,{items:dl,readOnly:!Zn||Re,onFiles:Zn&&!Re?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?J:tl?G:void 0,onDragOutChange:tl?e=>Ae(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Ke?zn:void 0,menuOnMedia:Ke})),gl=u({count:un.length,kind:Nn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ne?.({kind:"files",ids:un},e.key===s?null:e.key)}),vl=L({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */W(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */U(V,{children:[Z.folder,Ee.moveTo]}),items:gl,disabled:!!fe.move}),yl=Ke&&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:[
|
|
11
|
+
/* @__PURE__ */W(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ee.selected(un.length)}),/* @__PURE__ */U(V,ln?{children:[De&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>De(un),...qn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */W(T,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...qn(fe.deleteForever),children:Ee.deleteForever})]}:{children:[Ne&&kl,xe&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Ee.rename}),Ce&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>Ce({kind:"files",ids:un}),...qn(fe.trash),children:Ee.moveFilesToTrash(un.length)})]}),
|
|
12
|
+
/* @__PURE__ */W(T,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ee.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",Ee.name,a?/* @__PURE__ */W(m,{value:e.name,label:Ee.fileName,onDone:bn}):e.name),l("type",Ee.type,e.typeLabel),l("size",Ee.size,e.sizeLabel),l("resolution",Ee.resolution,e.resolution),nn?(l("design",Ee.design,e.design),l("finish",Ee.finish,e.finish),l("angle",Ee.angleLug,e.angleLug),l("owner",Ee.owner,e.owner)):(l("added",Ee.addedBy,e.addedBy),l("folder",Ee.folder,e.folderPath)),l("used",Ee.usedIn,null!=e.usedCount?Ee.places(e.usedCount):void 0);const i=c({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return U("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */W("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */W(N,{tone:"neutral",title:Ee.readOnlyBadge,children:on(tn)}),
|
|
15
|
+
/* @__PURE__ */W(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */U("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */W("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */W(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ee.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>Dn.copyUrl(e.id),children:Ee.copyUrl})]}),an&&Ke&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>ze(e.id),...qn(fe.replace),children:Ee.replace}),Te&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>Te(e.id),children:Ee.cropEdit}),Ne&&"submenu"===i?.type&&/* @__PURE__ */W(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */U(V,{children:[Z.folder,Ee.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>yn({kind:"file",id:e.id}),...qn(fe.rename),children:Ee.rename}),Ce&&/* @__PURE__ */W(D,{"aria-label":Ee.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:Z.trash})]}),ln&&Ke&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */W(T,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>De([e.id]),...qn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */W(T,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...qn(fe.deleteForever),children:Ee.deleteForever})]}),nn&&Oe&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>Oe({kind:"render",id:e.id}),children:Ee.openInDesign}),pe&&/* @__PURE__ */W(f,{items:pe})]})},wl=mn?mn.private?Ee.privateNoPick:mn.pickDisabledReason:void 0,xl=Re?/* @__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:[
|
|
18
|
+
/* @__PURE__ */W("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ee.oneChosen(mn.name):Ee.noneChosen}),
|
|
19
|
+
/* @__PURE__ */U("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */W(T,{variant:"secondary",size:"sm",onClick:Le,children:Ee.cancel}),
|
|
20
|
+
/* @__PURE__ */W(T,{variant:"primary",size:"sm",disabled:!mn,...qn(wl),onClick:()=>{mn&&!wl&&Fe?.(mn)},children:Ee.chooseImage})]})]}):null,Nl=Ke&&!!mn,Cl=/* @__PURE__ */U("div",{className:"flex min-w-0 flex-col gap-3",children:[Me&&/* @__PURE__ */W(N,{tone:"neutral",children:Me}),
|
|
21
|
+
/* @__PURE__ */U("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */W(d,{items:Qn}),_n]}),ll,yl,
|
|
23
|
+
/* @__PURE__ */U("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Ke&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
24
|
+
/* @__PURE__ */W(a,{rect:ul.rect})]}),Zn&&/* @__PURE__ */W("input",{...Hn.inputProps}),
|
|
25
|
+
/* @__PURE__ */W(j,{rejections:Hn.rejections})]});/* @__PURE__ */
|
|
26
|
+
return U("div",{ref:Ue,"data-media-library":"","data-layout":We?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Pe}`.trim(),children:[/* @__PURE__ */U("div",We?{className:"flex flex-col gap-3 p-3",children:[Gn,Cl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */W("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Gn}),
|
|
28
|
+
/* @__PURE__ */W("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Cl}),Nl&&/* @__PURE__ */W("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),xl,We&&/* @__PURE__ */W(o,{open:Nl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */W(x,{...jn.props,items:Sn(jn.state.data)}),null!=Cn&&ie.length>0&&/* @__PURE__ */W(r,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Cn,ie.length-1),onClose:()=>In(null)})]})}export{J as MEDIA_FILES_DRAG_TYPE,G as MEDIA_FILE_DRAG_TYPE,Y as MEDIA_FOLDER_DRAG_TYPE,$ as MediaLibrary,Q as readMediaFileDrag};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M7.5,1.125h5c0.49841,0.03274 1.09349,0.26507 1.41421,0.58579c0.32072,0.32072 0.55305,0.9158 0.58579,1.41421v5c-0.03274,0.49841 -0.26507,1.09349 -0.58579,1.41421c-0.32072,0.32072 -0.9158,0.55305 -1.41421,0.58579h-5c-0.49841,-0.03274 -1.09349,-0.26507 -1.41421,-0.58579c-0.32072,-0.32072 -0.55305,-0.9158 -0.58579,-1.41421v-5c0.03274,-0.49841 0.26507,-1.09349 0.58579,-1.41421c0.32072,-0.32072 0.9158,-0.55305 1.41421,-0.58579zM2.16459,15.67082c-0.37048,-0.18524 -0.52065,-0.63575 -0.33541,-1.00623c0.69525,-1.34746 1.65566,-2.28959 2.54582,-2.28959c0.89017,0 1.86779,0.93352 2.54582,2.28959c0.57197,1.14393 0.84434,1.46041 1.20418,1.46041c0.35983,0 0.63221,-0.31648 1.20418,-1.46041c0.67803,-1.35607 1.65566,-2.28959 2.54582,-2.28959c0.89017,0 1.86779,0.93352 2.54582,2.28959c0.57197,1.14393 0.84434,1.46041 1.20418,1.46041c0.14479,0 0.17852,-0.02043 0.40717,-0.24908c0.12697,-0.12697 0.23681,-0.26429 0.37504,-0.47163c0.14194,-0.21291 0.46875,-0.82031 0.46875,-0.82031c-0.01357,0.02196 0,0 0,0c0.16859,-0.20771 0.43545,-0.3093 0.69949,-0.26629c0.26404,0.04301 0.48486,0.22404 0.57882,0.47452c0.0931,0.24819 0.04752,0.52694 -0.1193,0.73247c0.01008,-0.0123 0.03073,-0.03749 0,0c-0.00154,0.00189 -0.00308,0.00378 -0.00464,0.00566c0,0 0.00194,-0.00237 0.00464,-0.00566c-0.00143,0.00175 -0.00298,0.00363 -0.00464,0.00566c0,0 -0.573,1.04175 -0.9375,1.40625c-0.39635,0.39635 -0.98762,0.68842 -1.46783,0.68842c-0.89017,0 -1.86779,-0.93352 -2.54582,-2.28959c-0.57197,-1.14393 -0.84434,-1.46041 -1.20418,-1.46041c-0.35983,0 -0.63221,0.31648 -1.20418,1.46041c-0.67803,1.35607 -1.65566,2.28959 -2.54582,2.28959c-0.89017,0 -1.86779,-0.93352 -2.54582,-2.28959c-0.57197,-1.14393 -0.84434,-1.46041 -1.20418,-1.46041c-0.35983,0 -0.64942,0.30787 -1.20418,1.46041c-0.18524,0.37048 -0.63575,0.52065 -1.00623,0.33541z"})})}export{e as EntranceBounceMiniIcon};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-SOZCWT6I.js";import{jsx as
|
|
2
|
-
return
|
|
1
|
+
import{Tooltip as e}from"./chunk-SOZCWT6I.js";import{jsx as r,jsxs as a}from"react/jsx-runtime";function l({options:l,value:i,onChange:o,onClear:s,columns:n,captions:t=!1,label:c,className:d="","aria-labelledby":u}){/* @__PURE__ */
|
|
2
|
+
return r("div",{role:"group","aria-label":u?void 0:c,"aria-labelledby":u,style:n?{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`}:void 0,className:`grid gap-(--space-8) ${n?"":"grid-cols-[repeat(auto-fill,minmax(58px,1fr))]"} ${d}`.replace(/\s+/g," ").trim(),children:l.map(l=>{const n=l.value===i,c=/* @__PURE__ */a("button",{type:"button","aria-pressed":n,"aria-label":t?void 0:l.label,disabled:l.disabled||void 0,onClick:()=>{n?s?.():o(l.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${t?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${n?"border-blue-600 bg-surface text-blue-600 ring-2 ring-blue-400/40":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink"}`,children:[l.picture,t&&/* @__PURE__ */r("span",{className:"max-w-full text-center text-2xs leading-4 break-words",children:l.label})]});return t?/* @__PURE__ */r("div",{className:"flex min-w-0",children:c},l.value):/* @__PURE__ */r(e,{content:l.label,describe:!1,className:"relative flex min-w-0",children:c},l.value)})})}export{l as PictureTiles};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M3.75,5.5h5c0.49841,0.03274 1.09349,0.26507 1.41421,0.58579c0.32072,0.32072 0.55305,0.9158 0.58579,1.41421v5c-0.03274,0.49841 -0.26507,1.09349 -0.58579,1.41421c-0.32072,0.32072 -0.9158,0.55305 -1.41421,0.58579h-5c-0.49841,-0.03274 -1.09349,-0.26507 -1.41421,-0.58579c-0.32072,-0.32072 -0.55305,-0.9158 -0.58579,-1.41421v-5c0.03274,-0.49841 0.26507,-1.09349 0.58579,-1.41421c0.32072,-0.32072 0.9158,-0.55305 1.41421,-0.58579zM11.75,5.625c0,-0.41421 0.33579,-0.75 0.75,-0.75c1.36136,0.03274 2.73769,0.61485 3.62392,1.50108c0.88623,0.88623 1.50108,2.26256 1.50108,3.62392c0,1.36136 -0.61485,2.73769 -1.50108,3.62392c-0.44554,0.44554 -1.03787,0.84807 -1.62881,1.09802c-0.129,0.05456 -0.28322,0.10172 -0.44541,0.1421l0.85563,0.85563c0.29289,0.29289 0.29289,0.76777 0,1.06066c-0.29289,0.29289 -0.76777,0.29289 -1.06066,0l-1.875,-1.875c-0.29289,-0.29289 -0.29289,-0.76777 0,-1.06066l1.875,-1.875c0.29289,-0.29289 0.76777,-0.29289 1.06066,0c0.14653,0.14653 0.21975,0.3386 0.21967,0.53065c0.65697,-0.68306 1,-1.47702 1,-2.50032c0,-1.05489 -0.36453,-1.86606 -1.06174,-2.56326c-0.69721,-0.69721 -1.50838,-1.09448 -2.56326,-1.06174c-0.41421,0 -0.75,-0.33579 -0.75,-0.75z"})})}export{e as EntranceSpinMiniIcon};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...h}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...h,children:[
|
|
3
|
+
/* @__PURE__ */e("path",{d:"M2.25 7.5V6h1.5M6.75 6h1.5v1.5M8.25 10.5v1.5h-1.5M3.75 12h-1.5v-1.5"}),
|
|
4
|
+
/* @__PURE__ */e("path",{d:"M14.25 4.5h6a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1 -1.5 1.5h-6a1.5 1.5 0 0 1 -1.5 -1.5v-6a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
5
|
+
/* @__PURE__ */e("path",{d:"M8.25 18.75L15.75 18.75M13.5 16.5L15.75 18.75L13.5 21"})]})}export{t as ScrollFadeInIcon};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...i}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:[
|
|
3
|
+
/* @__PURE__ */e("path",{d:"M4.5 7.5h6a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1 -1.5 1.5h-6a1.5 1.5 0 0 1 -1.5 -1.5v-6a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
4
|
+
/* @__PURE__ */e("path",{d:"M15 6.75a5.25 5.25 0 0 1 0 10.5M17.25 15L15 17.25L17.25 19.5"})]})}export{t as EntranceSpinIcon};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...h}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...h,children:[
|
|
3
|
+
/* @__PURE__ */e("path",{d:"M3.75 4.5h6a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1 -1.5 1.5h-6a1.5 1.5 0 0 1 -1.5 -1.5v-6a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
4
|
+
/* @__PURE__ */e("path",{d:"M15.75 7.5V6h1.5M20.25 6h1.5v1.5M21.75 10.5v1.5h-1.5M17.25 12h-1.5v-1.5"}),
|
|
5
|
+
/* @__PURE__ */e("path",{d:"M8.25 18.75L15.75 18.75M13.5 16.5L15.75 18.75L13.5 21"})]})}export{t as ScrollFadeOutIcon};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...i}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:[
|
|
3
|
+
/* @__PURE__ */e("path",{d:"M9 2.25h6a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1 -1.5 1.5h-6a1.5 1.5 0 0 1 -1.5 -1.5v-6a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
4
|
+
/* @__PURE__ */e("path",{d:"M3 18c1.5-3 3-3 4.5 0s3 3 4.5 0 3-3 4.5 0 3 3 4.5 0"})]})}export{t as EntranceBounceIcon};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...i}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:[
|
|
3
|
+
/* @__PURE__ */e("path",{d:"M2.25 8.25L4.5 8.25M2.25 15.75L4.5 15.75"}),
|
|
4
|
+
/* @__PURE__ */e("path",{d:"M3 12L9 12M6.75 9.75L9 12L6.75 14.25"}),
|
|
5
|
+
/* @__PURE__ */e("path",{d:"M14.25 7.5h6a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1 -1.5 1.5h-6a1.5 1.5 0 0 1 -1.5 -1.5v-6a1.5 1.5 0 0 1 1.5 -1.5Z"})]})}export{t as EntranceGlideIcon};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...h}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...h,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M14.25,6.75h6c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v6c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-6c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-6c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM1.5,8.25c0,-0.41421 0.33579,-0.75 0.75,-0.75h2.25c0.41421,0 0.75,0.33579 0.75,0.75c0,0.41421 -0.33579,0.75 -0.75,0.75h-2.25c-0.41421,0 -0.75,-0.33579 -0.75,-0.75zM1.5,15.75c0,-0.41421 0.33579,-0.75 0.75,-0.75h2.25c0.41421,0 0.75,0.33579 0.75,0.75c0,0.41421 -0.33579,0.75 -0.75,0.75h-2.25c-0.41421,0 -0.75,-0.33579 -0.75,-0.75zM2.25,12c0,-0.41421 0.33579,-0.75 0.75,-0.75h4.18934l-0.96967,-0.96967c-0.29289,-0.29289 -0.29289,-0.76777 0,-1.06066c0.29289,-0.29289 0.76777,-0.29289 1.06066,0l2.25,2.25c0.07191,0.07191 0.12616,0.15478 0.16276,0.24324c0.03667,0.08843 0.05691,0.1854 0.05691,0.28709c0,0.10169 -0.02024,0.19866 -0.05691,0.28709c-0.0366,0.08846 -0.09085,0.17134 -0.16276,0.24324l-2.25,2.25c-0.29289,0.29289 -0.76777,0.29289 -1.06066,0c-0.29289,-0.29289 -0.29289,-0.76777 0,-1.06066l0.96967,-0.96967h-4.18934c-0.41421,0 -0.75,-0.33579 -0.75,-0.75z"})})}export{e as EntranceGlideSolidIcon};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";function t({size:t=18,...i}){/* @__PURE__ */
|
|
2
|
+
return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:[
|
|
3
|
+
/* @__PURE__ */e("path",{d:"M9 2.25h6a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1 -1.5 1.5h-6a1.5 1.5 0 0 1 -1.5 -1.5v-6a1.5 1.5 0 0 1 1.5 -1.5Z"}),
|
|
4
|
+
/* @__PURE__ */e("path",{d:"M12 21.75L12 14.25M9.75 16.5L12 14.25L14.25 16.5"})]})}export{t as EntranceRiseIcon};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...h}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...h,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M3.75,5.25h1.5c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v4.5c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-1.5c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-4.5c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM11.25,5.25h1.5c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v4.5c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-1.5c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-4.5c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM18.75,5.25h1.5c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v4.5c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-1.5c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-4.5c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM6.75,18c0,-0.41421 0.33579,-0.75 0.75,-0.75l7.18934,0l-0.96967,-0.96967c-0.29289,-0.29289 -0.29289,-0.76777 0,-1.06066c0.29289,-0.29289 0.76777,-0.29289 1.06066,0l2.25,2.25c0.07191,0.07191 0.12616,0.15478 0.16276,0.24324c0.03667,0.08843 0.05691,0.1854 0.05691,0.28709c0,0.10169 -0.02024,0.19866 -0.05691,0.28709c-0.0366,0.08846 -0.09085,0.17134 -0.16276,0.24324l-2.25,2.25c-0.29289,0.29289 -0.76777,0.29289 -1.06066,0c-0.29289,-0.29289 -0.29289,-0.76777 0,-1.06066l0.96967,-0.96967h-7.18934c-0.41421,0 -0.75,-0.33579 -0.75,-0.75z"})})}export{e as LoopMarqueeSolidIcon};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as t,usePopupLevel as r,usePopupLevelBindings as i,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as a}from"./chunk-2VFSYSDS.js";import{dialogA11y as d}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-7QSDPSXP.js";import{useFocusTrap as m,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{Icon as u}from"./chunk-JOAKKXTL.js";import{useHydrated as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as b}from"./chunk-JSHMIMAJ.js";import{useRef as g,useId as x,useState as y,useEffect as v}from"react";import{createPortal as w}from"react-dom";import{jsxs as k,Fragment as N,jsx as j}from"react/jsx-runtime";var C={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},S={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function D(e,t){const r=window.innerHeight-(t.top+t.height);if("bottom"===e)return{left:t.left,width:t.width,bottom:r};const i={top:t.top,height:t.height};return"left"===e?{...i,left:t.left}:{...i,right:window.innerWidth-(t.left+t.width)}}function W({onClose:e}){const t=b().dialog;/* @__PURE__ */
|
|
2
|
+
return j("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */j(u,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function H({open:u,onClose:b,side:H="right",size:J="md",title:V,description:A,footer:F,children:G,blocking:I=!1,dirty:T=!1,initialFocus:U,"aria-label":Y,"aria-labelledby":z,"aria-describedby":B,className:E=""}){const K=g(null),L=x(),M=x(),O=x(),P=e(p()),[Q,X]=y(null),R=a({open:u,dirty:T,onClose:b,title:V,layer:Q}),Z=g(null),$=t(u&&null!==P,Z),q=r(u&&null!==P,Z),_=i(q,Q),ee=o(q),te=null!==q.host;if(c(u),m(K,u&&null!==P,U,_),h(u),v(()=>{if(u)return f(()=>!_.current?.(document.activeElement)&&(I||R(),!0),()=>K.current)},[u,I,R,_]),!u||!P)return null;const re="bottom"===H,ie={...re?{maxHeight:"85vh"}:{},...$?D(H,$):{}};/* @__PURE__ */
|
|
3
|
+
return k(N,{children:[/* @__PURE__ */j("span",{ref:Z,hidden:!0,"data-popup-anchor":""}),w(
|
|
4
|
+
/* @__PURE__ */j(n,{value:Q,children:/* @__PURE__ */k("div",{ref:X,className:te?"fixed inset-0 pointer-events-none":"fixed inset-0",style:s(q),role:"presentation","data-overlay-layer":"",children:[
|
|
5
|
+
/* @__PURE__ */j("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(te?"pointer-events-auto"+(l(q)?" rounded-(--radius-window)":""):"inset-0"),style:ee??void 0,hidden:te&&!ee,onClick:I?void 0:R,"aria-hidden":"true","data-popup-scrim":te?"window":"system"}),
|
|
6
|
+
/* @__PURE__ */k("div",{ref:K,...d({modal:!0,titleId:V?O:void 0,labelledBy:z,label:Y}),"aria-describedby":B??(A?M:G?L:void 0),"data-drawer-side":H,"data-popup-panel":"",style:ie,className:["fixed flex flex-col bg-white shadow-xl",te?"pointer-events-auto":"",re?"":`w-full max-w-full ${C[J]}`,$?"":S[H],re?"rounded-t-xl":"",E].filter(Boolean).join(" "),children:[V?/* @__PURE__ */k("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
7
|
+
/* @__PURE__ */k("div",{className:"min-w-0",children:[
|
|
8
|
+
/* @__PURE__ */j("h2",{id:O,className:"text-base font-semibold text-gray-900",children:V}),A&&/* @__PURE__ */j("p",{id:M,className:"mt-0.5 text-sm text-gray-500",children:A})]}),!I&&/* @__PURE__ */j(W,{onClose:R})]}):!I&&/* @__PURE__ */j("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */j(W,{onClose:R})}),
|
|
9
|
+
/* @__PURE__ */k("div",{id:L,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[A&&!V&&/* @__PURE__ */j("p",{id:M,className:("mb-3 text-sm text-gray-500 "+(I?"":"pr-8")).trim(),children:A}),G]}),F&&/* @__PURE__ */j("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:F})]})]})}),P)]})}export{H as Drawer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-2DQHXJPM.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-JOAKKXTL.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-JSHMIMAJ.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[v,N]=a(""),[w,k]=a(null),[C,j]=a({}),M=v.trim().toLowerCase(),A=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),L=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),_=n(()=>A.map(e=>({...e,docs:e.docs.filter(L)})).filter(e=>e.docs.length>0),[A,M]),J=n(()=>_.flatMap(e=>e.docs),[_]),E=(w?J.find(e=>e.slug===w):void 0)??J[0]??null,H=e=>!!M||(C[e]??e===E?.category);/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
|
6
6
|
/* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
8
|
/* @__PURE__ */o("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===_.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):_.map(e=>{const t=
|
|
9
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===_.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):_.map(e=>{const t=H(e.key);/* @__PURE__ */
|
|
10
10
|
return i("div",{className:"py-0.5",children:[
|
|
11
|
-
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!
|
|
11
|
+
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!H(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */o(d,{open:t}),
|
|
13
|
-
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=
|
|
13
|
+
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
15
15
|
/* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
16
|
-
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:
|
|
16
|
+
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
|
|
17
17
|
/* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
18
18
|
/* @__PURE__ */i("div",{className:"min-w-0",children:[
|
|
19
|
-
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:
|
|
20
|
-
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[
|
|
21
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(
|
|
19
|
+
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
|
|
20
|
+
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
|
|
21
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-TKPUYQ3Q.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{DropdownMenu as e,TRIGGER_CLASS as r}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e,TRIGGER_CLASS as r}from"./chunk-QBWMWK2W.js";import{Tooltip as a}from"./chunk-SOZCWT6I.js";import{jsx as i,jsxs as t}from"react/jsx-runtime";var l=`${r} -ml-1 h-6 px-1 text-xs`;function n({value:r,options:n,onChange:s,label:c,disabled:o}){
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return i(a,{content:c,describe:!1,children:/* @__PURE__ */i(e,{trigger:
|
|
4
4
|
/* @__PURE__ */t("span",{className:"inline-grid justify-items-end",children:[n.includes(r)?null:/* @__PURE__ */i("span",{className:"col-start-1 row-start-1",children:r}),n.map(e=>/* @__PURE__ */i("span",{className:"col-start-1 row-start-1"+(e===r?"":" invisible"),children:e},e))]}),"aria-label":`${c}: ${r}`,align:"end",minWidth:0,disabled:o,triggerClassName:l,items:n.map(e=>({type:"radio",key:e,label:e,checked:e===r,mark:"colour",onSelect:()=>{e!==r&&s(e)}}))})})}export{n as UnitMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};function t(e){return/^[a-z][a-z0-9-]*$/.test(e)}function n(e){return t(e)||/^#[0-9a-fA-F]{6}$/.test(e)}function l(e){return n(e)?e.startsWith("#")?e.toLowerCase():e:null}var r=["main","text","background","muted"],s=[...r,"surface"];function i(e){return r.includes(e)?{kind:"slot",slot:e}:/^#[0-9a-fA-F]{6}$/.test(e)?{kind:"hex",hex:e.toLowerCase()}:null}function o(e){return"surface"===e?{kind:"slot",slot:"surface"}:i(e)}function c(e){return/^[a-z]+-[0-9]+$/.test(e)}function u(e,t){const n=/^\{(underline|sup|sub|color=([a-z][a-z0-9-]*|#[0-9a-fA-F]{6})|style=([a-z]+-[0-9]+))\}/.exec(e.slice(t,t+64));return n?void 0!==n[2]?{kind:"color",color:n[2],length:n[0].length}:void 0!==n[3]?{kind:"style",style:n[3],length:n[0].length}:{kind:n[1],length:n[0].length}:null}var a={bold:e.bold.placeholder,italic:e.italic.placeholder,strike:e.strike.placeholder,code:e.code.placeholder,highlight:e.highlight.placeholder,quiet:e.quiet.placeholder,link:"link text",underline:e.underline.placeholder,sup:e.sup.placeholder,sub:e.sub.placeholder,color:"colored text",style:"styled text"},h={bullet:()=>"- ",number:e=>`${e+1}. `,quote:()=>"> "};function f(t,n,l,r,s=y,i=a){if("clear"===r)return X(t,n,l,s);const o=t.slice(n,l);if("link"===r){const e=o||i.link,r=`[${e}](https://)`;return{text:t.slice(0,n)+r+t.slice(l),selectionStart:n+e.length+3,selectionEnd:n+r.length-1}}const c=h[r];if(c){const e=t.lastIndexOf("\n",Math.max(n-1,0))+1,r=t.indexOf("\n",l),s=-1===r?t.length:r,i=t.slice(e,s).split("\n"),o=i.every((e,t)=>e.startsWith(c(t))),u=i.map((e,t)=>o?e.slice(c(t).length):c(t)+e).join("\n");return{text:t.slice(0,e)+u+t.slice(s),selectionStart:e,selectionEnd:e+u.length}}const{open:u,close:f}=e[r],d=r,p=i[d]??a[d];if(m(t,n,l,r))return{text:t.slice(0,n-u.length)+o+t.slice(l+f.length),selectionStart:n-u.length,selectionEnd:n-u.length+o.length};const k=o||p;return{text:t.slice(0,n)+u+k+f+t.slice(l),selectionStart:n+u.length,selectionEnd:n+u.length+k.length}}function d(e,t,n,r,s=a){const i={text:e,selectionStart:t,selectionEnd:n};if(null!==r){const e=l(r);if(null===e)return i;r=e}const o=e.slice(t,n),c=t>=1&&"["===e[t-1]&&"]"===e[n]?u(e,n+1):null;if("color"===c?.kind){const l=t-1,s=e.slice(n+1+c.length);return null===r?{text:e.slice(0,l)+o+s,selectionStart:l,selectionEnd:l+o.length}:{text:`${e.slice(0,n)}]{color=${r}}${s}`,selectionStart:t,selectionEnd:n}}if(null===r)return i;const h=o||(s.color??a.color);return{text:`${e.slice(0,t)}[${h}]{color=${r}}${e.slice(n)}`,selectionStart:t+1,selectionEnd:t+1+h.length}}function m(t,n,l,r){const s=e[r];if(!s)return!1;const{open:i,close:o}=s;return n>=i.length&&t.slice(n-i.length,n)===i&&t.slice(l,l+o.length)===o}function p(e,t,n){const l=0===t?0:e.lastIndexOf("\n",t-1)+1;for(let r=e.lastIndexOf("[",t);r>=l;r=0===r?-1:e.lastIndexOf("[",r-1)){const t=C(e,r);if(t&&n<=t.end)return{start:r,end:t.end,label:t.label,href:t.href}}return null}function k(e,t,n,l){const r=p(e,t,n),s=r?r.start:t,i=r?r.end:n,o=`[${r?r.label:e.slice(t,n)||l}](${l})`,c=s+o.length;return{text:e.slice(0,s)+o+e.slice(i),selectionStart:c,selectionEnd:c}}function b(e,t){return{text:e.slice(0,t.start)+t.label+e.slice(t.end),selectionStart:t.start,selectionEnd:t.start+t.label.length}}var g=[{style:"bold",label:"B",name:"Strong",title:"Strong · **words** · ⌘B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic · _words_ · ⌘I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough · ~~words~~"},{style:"highlight",label:"◆",name:"Emphasis",title:"Emphasis · ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet · ^^words^^"},{style:"code",label:"‹›",name:"Code",title:"Code"},{style:"link",label:"🔗",name:"Link",title:"Link · [words](https://…) · ⌘K",shortcut:"k"},{style:"bullet",label:"•",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"❝",name:"Quote",title:"Quote"},{style:"clear",label:"T×",name:"Clear marks",title:"Clear marks · ⌘⇧X",shortcut:"shift+x"}],x={bold:"Strong",highlight:"Emphasis",quiet:"Quiet"};function S(e){return g.filter(t=>e.includes(t.style))}var y=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],v=["highlight","quiet"],w=g.map(e=>e.style).filter(e=>y.some(t=>t.kind===e)).filter(e=>!v.includes(e)),E=[...y,{open:"*",close:"*",kind:"accent"}],M=[...y,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];function $(e){return!/\s/.test(e)&&!/[!-\/:-@[-`{-~]/.test(e)}function B(e,t){const n=[];let l="",r=0;for(;r<e.length;){const s=z(e,r,t);s?(n.push({kind:"text",text:l}),l="",n.push({kind:s.rule.kind,text:s.inner}),r=s.end):(l+=e[r],r+=1)}return n.push({kind:"text",text:l}),n}function z(e,t,n){for(const l of n){if(!e.startsWith(l.open,t))continue;if(l.wordBoundary&&t>0&&$(e[t-1]))continue;if(l.wordStart&&t>0&&/[\p{L}\p{N}]/u.test(e[t-1]))continue;const n=t+l.open.length,r=e.indexOf(l.close,n);if(r<n+1)continue;const s=e.slice(n,r);if(s.includes(l.close[0]))continue;if(s.includes("\n"))continue;const i=r+l.close.length,o=e[i];if((!l.notBefore||void 0===o||!l.notBefore.includes(o))&&!(l.notBeforeBlock&&u(e,i)||l.wordBoundary&&void 0!==o&&$(o)))return{rule:l,inner:s,end:i}}return null}function q(e,t){return B(e,t).map(e=>e.text).join("")}var I=["http","https","mailto","tel"];function O(e){if(""===e||/[\s\u0000-\u001f\u007f]/.test(e))return!1;const t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||I.includes(t[1].toLowerCase())}function C(e,t){if("["!==e[t])return null;const n=e.indexOf("]",t+1);if(n<t+2||"("!==e[n+1])return null;const l=e.slice(t+1,n);if(l.includes("["))return null;const r=e.indexOf(")",n+2);if(-1===r)return null;const s=e.slice(n+2,r);return O(s)?{label:l,href:s,end:r+1}:null}function L(e,t){if("["!==e[t])return null;let n=0;for(let l=t;l<e.length;l+=1){const r=e[l];if("\n"===r)return null;if("["===r)n+=1;else if("]"===r){if(n-=1,n>0)continue;if(l===t+1)return null;const r=u(e,l+1);return r?{kind:r.kind,color:r.color,style:r.style,label:e.slice(t+1,l),close:e.slice(l,l+1+r.length),end:l+1+r.length}:null}}return null}var _=4;function j(e,t,n){const l=[];let r="";const s=()=>{r&&l.push({kind:"text",text:r}),r=""},i=e=>n+1<_?j(e,t,n+1):[{kind:"text",text:e}];let o=0;for(;o<e.length;){const n=C(e,o);if(n){s(),l.push({kind:"link",href:n.href,children:i(n.label)}),o=n.end;continue}const c=L(e,o);if(c){s(),l.push({kind:c.kind,open:"[",close:c.close,...void 0===c.color?{}:{color:c.color},...void 0===c.style?{}:{style:c.style},children:i(c.label)}),o=c.end;continue}const u=z(e,o,t);u?(s(),l.push({kind:u.rule.kind,open:u.rule.open,close:u.rule.close,children:i(u.inner)}),o=u.end):(r+=e[o],o+=1)}return s(),l}function A(e,t){return e.split("\n").map(e=>{const{bullet:n,number:l,rest:r}=function(e){if(e.startsWith("- ")&&""!==e.slice(2).trim())return{bullet:!0,number:null,rest:e.slice(2)};const t=/^([0-9]{1,3})\. /.exec(e);return t&&""!==e.slice(t[0].length).trim()?{bullet:!1,number:t[1],rest:e.slice(t[0].length)}:{bullet:!1,number:null,rest:e}}(e);return{bullet:n,number:l,children:j(r,t,0)}})}function Q(e){return null!=e.number?`${e.number}. `:e.bullet?"- ":""}function N(e){return e.map(e=>"text"===e.kind?e.text:"link"===e.kind?`[${N(e.children)}](${e.href})`:e.open+N(e.children)+e.close).join("")}function W(e){return e.map(e=>Q(e)+N(e.children)).join("\n")}function F(t,n,r){if("link"===n)return void 0===r?null:{id:t,kind:"link",open:"[",close:`](${r})`,href:r};if("color"===n){const e=void 0===r?null:l(r);return null===e?null:{id:t,kind:"color",open:"[",close:`]{color=${e}}`,color:e}}if("style"===n)return void 0!==r&&c(r)?{id:t,kind:"style",open:"[",close:`]{style=${r}}`,style:r}:null;const s=e[n];return s&&"code"!==n?{id:t,kind:n,open:s.open,close:s.close}:null}function Z(e,t){let n=0,l=0;return e.split("\n").map(e=>{const[r]=A(e,t);let s=l+Q(r).length;l+=e.length+1;const i=[],o=(e,t)=>{for(const l of e){if("text"===l.kind){for(const e of l.text)i.push({ch:e,marks:t,at:s}),s+=e.length;continue}const e="link"===l.kind?F(++n,"link",l.href):{id:++n,kind:l.kind,open:l.open,close:l.close,...void 0===l.color?{}:{color:l.color},...void 0===l.style?{}:{style:l.style}};s+=e.open.length,o(l.children,[...t,e]),s+=e.close.length}};return o(r.children,[]),{bullet:r.bullet,number:r.number??null,chars:i}})}function K(e){let t="";const n=[];return e.forEach((e,l)=>{l>0&&(t+="\n"),t+=Q(e);const r=[],s=[];for(const n of e.chars){let e=0;for(;e<r.length&&e<n.marks.length&&r[e].id===n.marks[e].id;)e+=1;for(;r.length>e;)t+=r.pop().close;for(let l=e;l<n.marks.length;l+=1)t+=n.marks[l].open,r.push(n.marks[l]);s.push(t.length),t+=n.ch}for(;r.length>0;)t+=r.pop().close;n.push(s)}),{text:t,at:n}}function T(e,t){return e.length===t.length&&e.every((e,n)=>{const l=t[n];return e.bullet===l.bullet&&(e.number??null)===(l.number??null)&&(e.chars.length===l.chars.length&&e.chars.every((e,t)=>{const n=l.chars[t];return e.ch===n.ch&&e.marks.length===n.marks.length&&e.marks.every((e,t)=>e.kind===n.marks[t].kind&&e.href===n.marks[t].href&&e.color===n.marks[t].color&&e.style===n.marks[t].style)}))})}function X(e,t,n,l=y){const r=Z(e,l),s=r.flatMap(e=>e.chars),i={text:e,selectionStart:t,selectionEnd:n},o=e=>r.map(t=>({bullet:t.bullet,number:t.number,chars:t.chars.map(t=>({...t,marks:t.marks.filter(n=>"link"===n.kind||!e(t,n))}))})),c=e=>{const t=K(e);return T(e,Z(t.text,l))?t:null},u=(e,t)=>{let n=s.indexOf(t);for(let t=0;t<e.at.length;t+=1){if(n<e.at[t].length)return e.at[t][n];n-=e.at[t].length}return 0};if(t===n){const e=[...s].reverse().find(e=>e.at<t),n=s.find(e=>e.at>=t),l=new Set([...e?.marks??[],...n?.marks??[]].map(e=>e.id));if(![...l].some(e=>s.some(t=>t.marks.some(t=>t.id===e&&"link"!==t.kind))))return i;const r=c(o((e,t)=>l.has(t.id)));if(!r)return i;const a=n?u(r,n):e?u(r,e)+e.ch.length:0;return{text:r.text,selectionStart:a,selectionEnd:a}}const a=new Set(s.filter(e=>e.at>=t&&e.at<n));if(0===a.size)return i;const h=new Set([...a].flatMap(e=>e.marks.map(e=>e.id))),f=c(J(o(e=>a.has(e)),h))??c(o((e,t)=>h.has(t.id)));if(!f)return i;const d=s.find(e=>a.has(e)),m=[...s].reverse().find(e=>a.has(e));return{text:f.text,selectionStart:u(f,d),selectionEnd:u(f,m)+m.ch.length}}function D(e,t,n,l=y){if(t===n)return{text:e,selectionStart:t,selectionEnd:n};const r=Z(e,l),s=r.flatMap(e=>e.chars),i=new Set(s.filter(e=>e.at>=t&&e.at<n)),o=e=>"link"!==e.kind,c=new Set([...i].flatMap(e=>e.marks.filter(o).map(e=>e.id)));if(0===c.size)return{text:e,selectionStart:t,selectionEnd:n};const u=e=>r.map(t=>({bullet:t.bullet,number:t.number,chars:t.chars.map(t=>({...t,marks:e(t)}))})),a=u(e=>i.has(e)?e.marks.filter(e=>!o(e)):e.marks);a.forEach((e,t)=>{const n=e.chars,l=r[t].chars.map(e=>i.has(e)),s=e=>{n[e].marks=n[e].marks.filter(e=>!c.has(e.id))};n.forEach((e,t)=>{if(l[t]){if(0===t||!l[t-1])for(let e=t-1;e>=0&&/\s/.test(n[e].ch);e-=1)s(e);if(t===n.length-1||!l[t+1])for(let e=t+1;e<n.length&&/\s/.test(n[e].ch);e+=1)s(e)}})});const h=H(a,l)??H(u(e=>e.marks.filter(e=>!c.has(e.id))),l);return U(e,s,i,h,t,n)}function G(e){return e.at.flat()}function H(e,t){const n=K(e);return T(e,Z(n.text,t))?n:null}function J(e,t){return e.map(e=>{const n=e.chars.map(e=>({...e}));for(const e of t){const t=t=>t.marks.some(t=>t.id===e),l=n.flatMap((e,n)=>t(e)?[n]:[]),r=t=>{n[t].marks=n[t].marks.filter(t=>t.id!==e)};for(let e=0;e<l.length&&/\s/.test(n[l[e]].ch);e+=1)r(l[e]);for(let e=l.length-1;e>=0&&/\s/.test(n[l[e]].ch)&&t(n[l[e]]);e-=1)r(l[e])}return{bullet:e.bullet,number:e.number,chars:n}})}function P(e,t){return t.kind===e||"highlight"===e&&"accent"===t.kind}function R(e,t,n){const l=e.findIndex(e=>n(e.id));return-1===l?[...e,t]:[...e.slice(0,l),t,...e.slice(l)]}function U(e,t,n,l,r,s){if(!l)return{text:e,selectionStart:r,selectionEnd:s};const i=G(l),o=t.flatMap((e,t)=>n.has(e)?[t]:[]),c=o[0],u=o[o.length-1];return{text:l.text,selectionStart:i[c],selectionEnd:i[u]+t[u].ch.length}}function V(e,t,n,l,r=y){if(t===n||!F(0,l))return f(e,t,n,l,r);const s=Z(e,r),i=s.flatMap(e=>e.chars),o=new Set(i.filter(e=>e.at>=t&&e.at<n));if(0===o.size)return{text:e,selectionStart:t,selectionEnd:n};const c=e=>s.map(t=>({bullet:t.bullet,number:t.number,chars:t.chars.map(t=>({...t,marks:e(t)}))}));if([...o].every(e=>e.marks.some(e=>P(l,e)))){const s=new Set([...o].flatMap(e=>e.marks.filter(e=>P(l,e)).map(e=>e.id))),u=H(J(c(e=>o.has(e)?e.marks.filter(e=>!P(l,e)):e.marks),s),r)??H(c(e=>e.marks.filter(e=>!s.has(e.id))),r);return U(e,i,o,u,t,n)}const u=new Set([...o].flatMap(e=>e.marks.filter(e=>P(l,e)).map(e=>e.id))),a=new Set(i.filter(e=>o.has(e)||e.marks.some(e=>u.has(e.id)))),h=Math.max(0,...i.flatMap(e=>e.marks.map(e=>e.id)))+1,d=F(h,l),m=e=>i.every(t=>!t.marks.some(t=>t.id===e)||a.has(t)),p=H(J(c(e=>a.has(e)?R(e.marks.filter(e=>!P(l,e)),d,m):e.marks),/* @__PURE__ */new Set([h])),r);return U(e,i,o,p,t,n)}function Y(e,t,n,l=y){const r=Z(e,l).flatMap(e=>e.chars);let s;if(t===n){const n=[...r].reverse().find(n=>n.at<t&&!e.slice(n.at,t).includes("\n"));s=n?[n]:[]}else s=r.filter(e=>e.at>=t&&e.at<n);if(0===s.length)/* @__PURE__ */return new Set;const i=s.map(e=>new Set(e.marks.map(e=>e.kind)));return new Set([...i[0]].filter(e=>i.every(t=>t.has(e))))}function ee(e,t,n){const l=t===n?[[...e].reverse().find(e=>e.at<t),e.find(e=>e.at>=t)]:e.filter(e=>e.at>=t&&e.at<n);for(const e of l){const t=e?.marks.find(e=>"link"===e.kind);if(t)return t.id}return null}function te(e,t,n,l,r=y){const s=Z(e,r),i=s.flatMap(e=>e.chars),o=e=>s.map(t=>({bullet:t.bullet,number:t.number,chars:t.chars.map(t=>({...t,marks:e(t)}))})),c=(e,t,n)=>{const l=G(e),r=i.reduce((e,n,l)=>t(n)?l:e,-1),s=l[r]+i[r].ch.length+n.close.length;return{text:e.text,selectionStart:s,selectionEnd:s}};if(t===n){const s=ee(i,t,n);if(null===s)return k(e,t,n,l);const u=F(s,"link",l),a=H(o(e=>e.marks.map(e=>e.id===s?u:e)),r);return a?c(a,e=>e.marks.some(e=>e.id===s),u):{text:e,selectionStart:t,selectionEnd:n}}const u=new Set(i.filter(e=>e.at>=t&&e.at<n));if(0===u.size)return k(e,t,n,l);const a=F(Math.max(0,...i.flatMap(e=>e.marks.map(e=>e.id)))+1,"link",l),h=e=>i.every(t=>!t.marks.some(t=>t.id===e)||u.has(t)),f=H(o(e=>u.has(e)?R(e.marks.filter(e=>"link"!==e.kind),a,h):e.marks),r);return f?c(f,e=>u.has(e),a):{text:e,selectionStart:t,selectionEnd:n}}function ne(e,t,n,l=y){const r=Z(e,l),s=r.flatMap(e=>e.chars),i=ee(s,t,n);if(null===i)return{text:e,selectionStart:t,selectionEnd:n};const o=new Set(s.filter(e=>e.marks.some(e=>e.id===i)));return U(e,s,o,H(r.map(e=>({bullet:e.bullet,number:e.number,chars:e.chars.map(e=>({...e,marks:e.marks.filter(e=>e.id!==i)}))})),l),t,n)}function le(e,t,n,l,r,s){const i={text:t,selectionStart:n,selectionEnd:l};if(n===l||null!==r&&null===F(0,e,r))return i;const o=Z(t,s),c=o.flatMap(e=>e.chars),u=new Set(c.filter(e=>e.at>=n&&e.at<l));if(0===u.size)return i;const a=e=>o.map(t=>({bullet:t.bullet,number:t.number,chars:t.chars.map(t=>({...t,marks:e(t)}))})),h=new Set([...u].flatMap(t=>t.marks.filter(t=>t.kind===e).map(e=>e.id)));if(null===r){const r=H(J(a(t=>u.has(t)?t.marks.filter(t=>t.kind!==e):t.marks),h),s)??H(a(e=>e.marks.filter(e=>!h.has(e.id))),s);return U(t,c,u,r,n,l)}const f=Math.max(0,...c.flatMap(e=>e.marks.map(e=>e.id)))+1,d=F(f,e,r),m=e=>c.every(t=>!t.marks.some(t=>t.id===e)||u.has(t)),p=H(J(a(t=>u.has(t)?R(t.marks.filter(t=>t.kind!==e),d,m):t.marks),/* @__PURE__ */new Set([f,...h])),s);return U(t,c,u,p,n,l)}function re(e,t,n,l,r){const s=Z(t,r).flatMap(e=>e.chars),i=n===l?[[...s].reverse().find(e=>e.at<n&&!t.slice(e.at,n).includes("\n"))].filter(e=>void 0!==e):s.filter(e=>e.at>=n&&e.at<l);if(0===i.length)return null;const o=t=>t.marks.filter(t=>t.kind===e).pop()?.[e]??null,c=o(i[0]);return null!==c&&i.every(e=>o(e)===c)?c:null}function se(e,t,n,l,r=y){return le("color",e,t,n,l,r)}function ie(e,t,n,l=y){return re("color",e,t,n,l)}function oe(e,t,n,l,r=y){return le("style",e,t,n,l,r)}function ce(e,t,n,l=y){return re("style",e,t,n,l)}var ue=/^(?:- |([0-9]{1,3})\. )$/;function ae(e,t,n){const l=e.split("\n"),r=[];let s=0;for(const e of l)r.push(s),s+=e.length+1;const i=e=>{let t=0;for(;t+1<r.length&&r[t+1]<=e;)t+=1;return t};return{first:i(t),last:i(Math.max(t,n)),starts:r}}function he(e,t){if(null!=t.number)return"number";if(t.bullet)return"bullet";const n=ue.exec(e);return n?void 0===n[1]?"bullet":"number":null}function fe(e,t,n,l,r=y){const s=e.split("\n"),i=Z(e,r),{first:o,last:c}=ae(e,t,n),u=i.map((e,t)=>null===he(s[t],e)||e.bullet||null!=e.number?{bullet:e.bullet,number:e.number??null,chars:e.chars}:{bullet:!1,number:null,chars:[]});let a=0;if("number"===l&&o>0&&"number"===he(s[o-1],i[o-1])){const e=i[o-1].number??ue.exec(s[o-1])?.[1]??"0";a=Number(e)}const h=K(u.map((e,t)=>t<o||t>c?e:"bullet"===l?{bullet:!0,number:null,chars:e.chars}:"number"===l?{bullet:!1,number:String(a+=1),chars:e.chars}:{bullet:!1,number:null,chars:e.chars})).text.split("\n").map((e,t)=>t<o||t>c?s[t]:e),f=h.join("\n"),{starts:d}=ae(e,0,0),m=t=>{const{first:n}=ae(e,t,t);let l=0;for(let e=0;e<n;e+=1)l+=h[e].length-s[e].length;const r=null===he(s[o=n],i[o])||i[o].bullet||null!=i[o].number?Q(i[o]).length:s[o].length;var o;const c=h[n].length-(s[n].length-r),u=t-d[n];return d[n]+l+(u<r?c:u-r+c)};return{text:f,selectionStart:m(t),selectionEnd:m(n)}}function de(e,t,n,l=y){const r=e.split("\n"),s=Z(e,l),{first:i,last:o}=ae(e,t,n),c=new Set(s.slice(i,o+1).map((e,t)=>he(r[i+t],e)));return 1===c.size?[...c][0]:null}export{M as CAMPAIGN_MARKUP,r as COLOR_SLOTS,w as COPY_FIELD_TOOLS,s as FILL_COLOR_SLOTS,g as MARKUP_TOOLS,x as MARK_NAMES,a as MARK_PLACEHOLDERS,v as RETIRED_MARKS,y as STANDARD_MARKUP,E as STOREFRONT_MARKUP,d as applyColor,f as applyMark,X as clearMarks,D as clearStyle,ie as colorIn,se as colorOver,i as colorRole,o as fillColorRole,p as findLink,t as isColorName,n as isColorValue,O as isSafeLinkHref,c as isStyleId,te as linkOver,de as listIn,m as markedAt,Z as markedLines,Y as marksIn,S as markupTools,A as parseMarkup,b as removeLink,T as sameMarks,W as serializeMarkup,fe as setList,F as spanFor,q as stripInline,ce as styleIn,oe as styleOver,V as toggleMark,B as tokenizeInline,ne as unlinkAt,k as writeLink,K as writeMarkedLines};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{UnitMenu as e}from"./chunk-
|
|
1
|
+
import{UnitMenu as e}from"./chunk-YVHEKEHJ.js";import{InputNumber_default as a,stepRounding as t}from"./chunk-RMDVKQJE.js";import{IconButton_default as i}from"./chunk-SV5RRBVA.js";import{Icon as r}from"./chunk-JOAKKXTL.js";import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{jsx as o,jsxs as d,Fragment as l}from"react/jsx-runtime";var s="h-3.5 w-3.5",m={padding:{top:/* @__PURE__ */o(r,{name:"padding-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */o(r,{name:"padding-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */o(r,{name:"padding-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */o(r,{name:"padding-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */o(r,{name:"padding-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */o(r,{name:"padding-left-right","aria-hidden":"true",className:s})},crop:{top:/* @__PURE__ */o(r,{name:"crop-top","aria-hidden":"true",className:s}),right:/* @__PURE__ */o(r,{name:"crop-right","aria-hidden":"true",className:s}),bottom:/* @__PURE__ */o(r,{name:"crop-bottom","aria-hidden":"true",className:s}),left:/* @__PURE__ */o(r,{name:"crop-left","aria-hidden":"true",className:s}),vertical:/* @__PURE__ */o(r,{name:"crop-y","aria-hidden":"true",className:s}),horizontal:/* @__PURE__ */o(r,{name:"crop-left-right","aria-hidden":"true",className:s})}},c=/* @__PURE__ */o(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var h=(e,a,t)=>null===e[t]?a[t]:String(e[t]);function p(e,a){const t=t=>h(e,a,t);return t("left")!==t("right")||t("top")!==t("bottom")}function u({label:i,value:r,onChange:n,each:s,placeholder:c,words:p,min:u=0,max:g=200,step:f=4,readOnly:b,glyphs:N="padding",units:v}){const x=m[N],C=(i,d,l)=>{const s=function(e,a){const t=a.map(a=>e[a]);return t.every(e=>e===t[0])?t[0]:"mixed"}(r,i),m=i.map(e=>h(r,c,e)),N="mixed"!==s&&m.every(e=>e===m[0])?m[0]:"–";/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-side":i.join("-"),className:"min-w-0",children:/* @__PURE__ */o(a,{value:"mixed"===s?null:s,onChange:e=>((e,a)=>{const t={...r};for(const i of e)t[i]=a;n(t)})(i,e),min:u,max:g,step:f,snap:!0,...t(f),steppers:"compact",readOnly:b,placeholder:N,prefix:l,suffix:p.unit,suffixControl:v&&/* @__PURE__ */o(e,{value:p.unit,options:v.options,onChange:v.onChange,label:v.label,disabled:b}),"aria-label":d})})};/* @__PURE__ */
|
|
3
3
|
return o("div",{role:"group","aria-label":i,"data-sides":s?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */d(l,s?{children:[C(["left"],p.sides.left,x.left),C(["top"],p.sides.top,x.top),C(["right"],p.sides.right,x.right),C(["bottom"],p.sides.bottom,x.bottom)]}:{children:[C(["left","right"],p.horizontal,x.horizontal),C(["top","bottom"],p.vertical,x.vertical)]})})}function g({each:e,onChange:a,label:t,disabled:r}){/* @__PURE__ */
|
|
4
4
|
return o(n,{content:t,children:/* @__PURE__ */o(i,{size:"md","aria-label":t,"aria-pressed":e,disabled:r,onClick:()=>a(!e),children:c})})}export{g as SidesEachToggle,u as SidesInput,p as sidesStartEach};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Calendar as e}from"./chunk-QPYVCG74.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-
|
|
2
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:
|
|
3
|
-
/* @__PURE__ */D(e,{mode:"range",min:
|
|
4
|
-
return j("div",{className:"relative"+(
|
|
5
|
-
/* @__PURE__ */j("div",{className:`relative ${
|
|
6
|
-
/* @__PURE__ */j("button",{ref:de,type:"button",onClick:()=>{
|
|
1
|
+
import{Calendar as e}from"./chunk-QPYVCG74.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-ZKGUBIBT.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{Icon as u}from"./chunk-JOAKKXTL.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{buttonClasses as b}from"./chunk-UQYNPYF4.js";import{glassStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as v,useShellLocale as y}from"./chunk-JSHMIMAJ.js";import{useState as w,useRef as k,useId as N,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as j,Fragment as W,jsx as D}from"react/jsx-runtime";var $=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Y=t;function F(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function O(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var H=/* @__PURE__ */new Map;function L({from:t,to:n,onChange:m,formatDisplay:Y,clearable:L,required:B=!1,name:J,id:T,"aria-labelledby":G,"aria-label":A,weekStartsOn:I,placeholder:U,fullWidth:E=!1,min:K,max:R,disabled:q=!1,allowOpenEnd:P=!1}){const Z=v().dateRange,Q=y(),V=Y??(Q?function(e){let t=H.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),H.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(Q):O),X=U??Z.placeholder,z=L??!B,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=k(null),de=k(null),me=k(null),ue=N(),he=N(),pe=N(),[fe,ge]=w(!1),be=f(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=k(null),ve=k(null),[ye,we]=w(!0);g(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const ke=k(null);g(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==ke.current&&ke.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;ke.current=e,e>r+.5&&ge(!0)}});const[Ne,Ce]=w(!1);g(()=>{const e=!!T&&(de.current?.labels?.length??0)>0;e!==Ne&&Ce(e)});const Me=!!A||!!G||Ne,je=/* @__PURE__ */new Date,[We,De]=w(()=>t?t.slice(0,7):S(je,K,R)),$e=$.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,je),K,R)),Ye=e=>e?V(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=h(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{q&&ee(!1)},[q]);const Fe=()=>{m("",""),ee(!1)},Se=z&&!q&&Boolean(t||n),Oe=t&&n?`${Ye(t)} — ${Ye(n)}`:t?Z.fromOnly(Ye(t)):n?Z.toOnly(Ye(n)):"",He=d(Q),Le=e=>{const t=r(e);return t?He.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Be=t&&n?Z.range(Le(t),Le(n)):t?Z.fromOnly(Le(t)):n?Z.toOnly(Le(n)):X,Je=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Te=/* @__PURE__ */j(W,{children:[$e.map(e=>/* @__PURE__ */D("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,je);re(t.from),ae(t.to),le(e),De(t.from.slice(0,7))})(e),className:Je(e),"aria-label":fe?Z[e]:void 0,children:fe?ye?Z[e]:Z[`${e}Short`]:Z[e]},e)),
|
|
2
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Je("Custom"),children:Z.custom})]}),Ge=(e,t)=>P?/* @__PURE__ */D("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */D("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ae=e=>P&&ie===e?" ring-1 ring-blue-400":"",Ie=
|
|
3
|
+
/* @__PURE__ */D(e,{mode:"range",min:K,max:R,value:te||null,endValue:ne||null,month:We,onMonthChange:De,onSelect:e=>{le("Custom"),P?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:I,"aria-label":Z.dialog});/* @__PURE__ */
|
|
4
|
+
return j("div",{className:"relative"+(E?" w-full":""),ref:ce,children:[
|
|
5
|
+
/* @__PURE__ */j("div",{className:`relative ${E?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${q?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
+
/* @__PURE__ */j("button",{ref:de,type:"button",onClick:()=>{q||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),De(t?t.slice(0,7):S(je,K,R)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:T,disabled:q||void 0,"aria-label":A,"aria-labelledby":G,"aria-describedby":[Me?he:void 0,B?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(E?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
7
|
/* @__PURE__ */D(u,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */D("span",{className:"truncate",children:Oe||X})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:Z.clearRange,icon:/* @__PURE__ */D(u,{name:"close"}),onClick:Fe}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:
|
|
9
|
-
/* @__PURE__ */D("input",{type:"hidden",name:
|
|
10
|
-
/* @__PURE__ */D("input",{type:"hidden",name:
|
|
8
|
+
/* @__PURE__ */D("span",{className:"truncate",children:Oe||X})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:Z.clearRange,icon:/* @__PURE__ */D(u,{name:"close"}),onClick:Fe}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:Be}),B&&/* @__PURE__ */D("span",{id:pe,className:"sr-only",children:Z.required}),J&&/* @__PURE__ */j(W,{children:[
|
|
9
|
+
/* @__PURE__ */D("input",{type:"hidden",name:J.from,value:t,disabled:q||void 0}),
|
|
10
|
+
/* @__PURE__ */D("input",{type:"hidden",name:J.to,value:n,disabled:q||void 0})]}),_&&M(
|
|
11
11
|
/* @__PURE__ */j("div",{ref:me,id:ue,role:"dialog","aria-label":Z.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:p.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...x()},children:[
|
|
12
|
-
/* @__PURE__ */j("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
|
|
12
|
+
/* @__PURE__ */j("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ge("from",/* @__PURE__ */j(W,{children:[
|
|
13
13
|
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:Z.from}),
|
|
14
|
-
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
14
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ae("from")}`,children:te?Ye(te):Z.start})]})),!fe&&/* @__PURE__ */D("span",{className:"text-gray-300",children:"—"}),Ge("to",/* @__PURE__ */j(W,{children:[
|
|
15
15
|
/* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:Z.to}),
|
|
16
|
-
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${
|
|
17
|
-
/* @__PURE__ */j("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[
|
|
18
|
-
/* @__PURE__ */D("div",{className:"w-full",children:
|
|
16
|
+
/* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ae("to")}`,children:ne?Ye(ne):Z.end})]}))]}),fe?/* @__PURE__ */j(W,{children:[$e.length>0&&/* @__PURE__ */j("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */D("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Z.lastHeading}),
|
|
17
|
+
/* @__PURE__ */j("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Te,$e.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Z[e]},e))]})]}),
|
|
18
|
+
/* @__PURE__ */D("div",{className:"w-full",children:Ie})]}):
|
|
19
19
|
/* @__PURE__ */j("div",{ref:xe,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */D("div",{className:"w-64",children:
|
|
20
|
+
/* @__PURE__ */D("div",{className:"w-64",children:Ie}),$e.length>0&&/* @__PURE__ */D("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Te})]}),
|
|
21
21
|
/* @__PURE__ */j("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[z&&/* @__PURE__ */D("button",{type:"button",onClick:Fe,className:b({variant:"ghost"}),children:Z.clear}),
|
|
22
22
|
/* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:b({variant:"secondary"}),children:Z.cancel}),
|
|
23
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:P?!te&&!ne:!te||!ne,className:b({variant:"primary"}),children:Z.apply})]})]}),document.body)]})}export{
|
|
23
|
+
/* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:P?!te&&!ne:!te||!ne,className:b({variant:"primary"}),children:Z.apply})]})]}),document.body)]})}export{L as DateRangePicker,F as presetRange,Y as toISODate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";function e({size:e=18,...r}){/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */c("path",{fillRule:"evenodd",d:"M4.5,6.75h6c0.56745,0.03274 1.22503,0.29305 1.59099,0.65901c0.36596,0.36596 0.62627,1.02354 0.65901,1.59099v6c-0.03274,0.56745 -0.29305,1.22503 -0.65901,1.59099c-0.36596,0.36596 -1.02354,0.62627 -1.59099,0.65901h-6c-0.56745,-0.03274 -1.22503,-0.29305 -1.59099,-0.65901c-0.36596,-0.36596 -0.62627,-1.02354 -0.65901,-1.59099v-6c0.03274,-0.56745 0.29305,-1.22503 0.65901,-1.59099c0.36596,-0.36596 1.02354,-0.62627 1.59099,-0.65901zM14.25,6.75c0,-0.41421 0.33579,-0.75 0.75,-0.75c1.60298,0.03274 3.19806,0.71278 4.24264,1.75736c1.04458,1.04458 1.75736,2.63966 1.75736,4.24264c0,1.60298 -0.71278,3.19806 -1.75736,4.24264c-0.52471,0.52471 -1.21132,0.99132 -1.90694,1.28554c-0.2146,0.09077 -0.49206,0.16487 -0.77294,0.22392l1.21757,1.21757c0.29289,0.29289 0.29289,0.76777 0,1.06066c-0.29289,0.29289 -0.76777,0.29289 -1.06066,0l-2.25,-2.25c-0.29289,-0.29289 -0.29289,-0.76777 0,-1.06066l2.25,-2.25c0.29289,-0.29289 0.76777,-0.29289 1.06066,0c0.29289,0.29289 0.29289,0.76777 0,1.06066l-0.05318,0.05318c0.15666,-0.12058 0.30691,-0.25361 0.45483,-0.40153c0.85555,-0.85555 1.31802,-1.88547 1.31802,-3.18198c0,-1.29651 -0.46247,-2.32643 -1.31802,-3.18198c-0.85555,-0.85555 -1.88547,-1.35076 -3.18198,-1.31802c-0.41421,0 -0.75,-0.33579 -0.75,-0.75z"})})}export{e as EntranceSpinSolidIcon};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-QBWMWK2W.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{inputClasses as n,PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Tooltip as i}from"./chunk-SOZCWT6I.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
|
|
2
2
|
return o("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-1",children:e})}function d({action:e,size:r="md"}){/* @__PURE__ */
|
|
3
3
|
return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:n,size:t}){const{label:s,icon:l,onClick:c,menu:m}=n;/* @__PURE__ */
|
|
4
4
|
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(e,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:t})}):/* @__PURE__ */o(r,{"aria-label":s,size:t,onClick:c,children:l})})}var f=s(function({invalid:e,leftIcon:r,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",v=`${r?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),N=
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{IconPicker as e}from"./chunk-
|
|
2
|
-
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[J("left",w.sides.left,p.left,
|
|
1
|
+
import{IconPicker as e}from"./chunk-PDA77NNC.js";import{ColorPicker as t}from"./chunk-MJVFIH3J.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-RMDVKQJE.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-JOAKKXTL.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",p={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},u={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:j}){const k=e=>"number"==typeof m[e]?m[e]:null,C=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},J=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:j,placeholder:i,prefix:o,suffix:w.unit,"aria-label":t})}),O=d.map(k),S="number"==typeof m.width?m.width:O.every(e=>null!==e&&e===O[0])?O[0]:null,K=null===S&&O.some(e=>null!==e),M=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",A=e=>k(e)??("number"==typeof m.width?m.width:null),D=m.style??f.style;/* @__PURE__ */
|
|
2
|
+
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[J("left",w.sides.left,p.left,A("left"),String(f.sides.left),e=>C("left",e)),J("top",w.sides.top,p.top,A("top"),String(f.sides.top),e=>C("top",e)),J("right",w.sides.right,p.right,A("right"),String(f.sides.right),e=>C("right",e)),J("bottom",w.sides.bottom,p.bottom,A("bottom"),String(f.sides.bottom),e=>C("bottom",e))]}):J("all",w.width,p.all,S,K?"–":M,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:D,disabled:j,onChange:e=>{j||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:u[e]}))})}),
|
|
3
3
|
/* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{j||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:j})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
|