efficient-shell 15.1.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Browser-42QAXKYW.js +44 -0
- package/dist/Calculator-C7APPCLE.js +29 -0
- package/dist/CurrencyConverter-VFTDSYQ3.js +21 -0
- package/dist/{Files-QNAN5FCH.js → Files-OAVWF6EW.js} +88 -88
- package/dist/Notepad-LNNSVEFG.js +24 -0
- package/dist/PdfViewer-ADPTYOAO.js +1 -0
- package/dist/PomodoroTimer-AGSHX2JO.js +91 -0
- package/dist/{Preview-I35MWZBC.js → Preview-GDNUQKGN.js} +40 -40
- package/dist/Sidebar-SWLVNJ6L.js +44 -0
- package/dist/{Stock-USRT7FDU.js → Stock-NNDDNQBJ.js} +4 -4
- package/dist/{Weather-CMA5QQYM.js → Weather-NGQALCXO.js} +20 -20
- package/dist/{WorldClock-WQ3XGK2J.js → WorldClock-LX4BQPZJ.js} +7 -7
- package/dist/ai/index.js +118 -118
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/{chunk-P5J7G7OV.js → chunk-26I3OTGP.js} +1 -1
- package/dist/{chunk-RXCBSQA2.js → chunk-2M3KB4RH.js} +1 -1
- package/dist/chunk-2MUZFHZW.js +6 -0
- package/dist/{chunk-F7J7XRVI.js → chunk-2QUACZ6O.js} +1 -1
- package/dist/{chunk-3ZJAQSFS.js → chunk-32HTOZFT.js} +3 -3
- package/dist/{chunk-OYQWBJ37.js → chunk-3CIJFWB4.js} +1 -1
- package/dist/chunk-3HPCQMYH.js +15 -0
- package/dist/{chunk-TBDILJ6G.js → chunk-3TVMQCYR.js} +1 -1
- package/dist/{chunk-MPC3CHAO.js → chunk-4H4HJIWI.js} +1 -1
- package/dist/chunk-52YTUQW3.js +2 -0
- package/dist/{chunk-DNPAYNNU.js → chunk-5JQCWXIQ.js} +1 -1
- package/dist/{chunk-5SQHRDFC.js → chunk-5R25GNE2.js} +2 -2
- package/dist/{chunk-T46I4YOI.js → chunk-6F3XQJR6.js} +1 -1
- package/dist/{chunk-G3TC2GIA.js → chunk-7FYTL6SD.js} +1 -1
- package/dist/{chunk-YX3JD6PA.js → chunk-7M7GKYHS.js} +5 -5
- package/dist/{chunk-HTBACICQ.js → chunk-7QFXUNFA.js} +6 -6
- package/dist/{chunk-XIX72C7K.js → chunk-7T6NWAPG.js} +1 -1
- package/dist/chunk-7YJBWOQG.js +2 -0
- package/dist/{chunk-O7A7PH3R.js → chunk-7ZJ7VK2N.js} +1 -1
- package/dist/{chunk-7WF6LFOJ.js → chunk-ABAUJLI4.js} +1 -1
- package/dist/{chunk-DBBOD5QW.js → chunk-ABRCV7DQ.js} +1 -1
- package/dist/{chunk-AH5MLH54.js → chunk-AVUH35GW.js} +1 -1
- package/dist/{chunk-GY7MJTIZ.js → chunk-BMZL5BHA.js} +1 -1
- package/dist/{chunk-QCLKRFL4.js → chunk-BN37AISA.js} +1 -1
- package/dist/{chunk-47BGAQWD.js → chunk-C5Q4AKXO.js} +1 -1
- package/dist/chunk-CIT4YPEO.js +8 -0
- package/dist/{chunk-JPVD3VS7.js → chunk-CMC25URA.js} +6 -6
- package/dist/{chunk-24BF22NF.js → chunk-D3L2QCGF.js} +1 -1
- package/dist/chunk-DTZDOXK3.js +19 -0
- package/dist/{chunk-UYUNREAL.js → chunk-DXTRHNP4.js} +3 -3
- package/dist/{chunk-ZA6ANC2D.js → chunk-ECZEJ6BE.js} +6 -6
- package/dist/chunk-EQDYCSUX.js +13 -0
- package/dist/{chunk-XNKNX5L3.js → chunk-FM5ASDVN.js} +1 -1
- package/dist/{chunk-RA5G4K3N.js → chunk-FYHUCRLU.js} +1 -1
- package/dist/{chunk-JU722M5V.js → chunk-FZZBBZXZ.js} +6 -6
- package/dist/{chunk-U75MSD4F.js → chunk-GBCLIWUQ.js} +1 -1
- package/dist/{chunk-4RF3C523.js → chunk-HBAATSUS.js} +1 -1
- package/dist/{chunk-EOYKUV2U.js → chunk-HKXP3JJ5.js} +1 -1
- package/dist/{chunk-6RU2PGQK.js → chunk-HMTZP7NJ.js} +1 -1
- package/dist/chunk-HVWRF7N4.js +23 -0
- package/dist/chunk-IBPJJO4N.js +28 -0
- package/dist/{chunk-7D2QZ6JA.js → chunk-IIUFCTT6.js} +1 -1
- package/dist/{chunk-EHNW3UNC.js → chunk-IJWRJPX6.js} +6 -6
- package/dist/{chunk-TFQC67XR.js → chunk-ILH7RDAD.js} +9 -9
- package/dist/{chunk-IVEM2BPC.js → chunk-J43RRDEP.js} +1 -1
- package/dist/{chunk-ION3XGLN.js → chunk-JE4BGFDJ.js} +1 -1
- package/dist/{chunk-P3XXFQG5.js → chunk-JFTLFF52.js} +3 -3
- package/dist/chunk-JHEHW5BE.js +5 -0
- package/dist/{chunk-EHPY3BFC.js → chunk-JJ5W4BRW.js} +1 -1
- package/dist/{chunk-ULSVYSVN.js → chunk-JVITCC65.js} +1 -1
- package/dist/{chunk-PTLVNC3V.js → chunk-K3OLOLFT.js} +6 -6
- package/dist/{chunk-I7WAOKU2.js → chunk-KKZXGWSX.js} +2 -2
- package/dist/chunk-KWBYE5MN.js +9 -0
- package/dist/{chunk-Y6FULJWJ.js → chunk-L664TIIV.js} +6 -6
- package/dist/{chunk-2RLWGWOU.js → chunk-LFGJUJRZ.js} +13 -13
- package/dist/{chunk-3L7BEEBW.js → chunk-LKNDLXL3.js} +1 -1
- package/dist/{chunk-EN3GYSCE.js → chunk-M4NT6HGJ.js} +1 -1
- package/dist/{chunk-NHALP3MW.js → chunk-M5JEYZ3A.js} +4 -4
- package/dist/chunk-M6ODRWTM.js +7 -0
- package/dist/chunk-M6T7N4SN.js +14 -0
- package/dist/{chunk-2TNG32QT.js → chunk-MDGM5NUO.js} +8 -8
- package/dist/chunk-MQERW3QR.js +3 -0
- package/dist/{chunk-XFN4DOXP.js → chunk-NBV3XK3Q.js} +3 -3
- package/dist/{chunk-2XDO7FZC.js → chunk-NJJG2VAW.js} +12 -12
- package/dist/chunk-NTVACRKD.js +4 -0
- package/dist/chunk-NXPIX7NO.js +2 -0
- package/dist/chunk-OCITNQGF.js +11 -0
- package/dist/{chunk-7OVMWXFM.js → chunk-OCKOZV46.js} +1 -1
- package/dist/{chunk-UGA5NGW4.js → chunk-OEZC5N6J.js} +1 -1
- package/dist/{chunk-EDRELF6L.js → chunk-PAD65HG7.js} +1 -1
- package/dist/{chunk-MKHOXO5O.js → chunk-PYGXSGXC.js} +1 -1
- package/dist/{chunk-BUUAALHH.js → chunk-QBR73AJX.js} +20 -20
- package/dist/{chunk-Y5RTVKMB.js → chunk-QI2LJ7OL.js} +9 -9
- package/dist/{chunk-DO6P6LYU.js → chunk-QIAJ3QNV.js} +1 -1
- package/dist/{chunk-4BRVZAIW.js → chunk-QJY52ZHG.js} +1 -1
- package/dist/{chunk-R36VZ35L.js → chunk-QMUW35QL.js} +6 -6
- package/dist/chunk-QQ6TGD7K.js +92 -0
- package/dist/chunk-QVGASI5H.js +9 -0
- package/dist/chunk-QZYV4TDD.js +1 -0
- package/dist/{chunk-XJK6VNXV.js → chunk-S3F2TY7X.js} +1 -1
- package/dist/chunk-S6IW2F4J.js +8 -0
- package/dist/{chunk-HAEZUUDT.js → chunk-SKPAIZSC.js} +3 -3
- package/dist/{chunk-Y5YVKUM4.js → chunk-SXNT73VT.js} +19 -19
- package/dist/chunk-T43ATI2N.js +6 -0
- package/dist/{chunk-4SFWQPOB.js → chunk-T65TAQLW.js} +7 -7
- package/dist/{chunk-DOJSWVBX.js → chunk-TB7BO2XS.js} +6 -6
- package/dist/{chunk-NC5FIFAY.js → chunk-TVMDDQJP.js} +1 -1
- package/dist/{chunk-GVAVIYE6.js → chunk-TWSROAS7.js} +1 -1
- package/dist/{chunk-EHSK43WG.js → chunk-UA7SWROJ.js} +8 -8
- package/dist/chunk-UMLXFQVC.js +1 -0
- package/dist/{chunk-6X32SWQI.js → chunk-VIBGF2HJ.js} +1 -1
- package/dist/{chunk-WYAKASF3.js → chunk-VNKLIWNQ.js} +1 -1
- package/dist/{chunk-2SOGTOUQ.js → chunk-VQ3OSYTA.js} +4 -4
- package/dist/{chunk-EEAOFYW5.js → chunk-VTYALYW4.js} +12 -12
- package/dist/chunk-WHHHECBC.js +2 -0
- package/dist/chunk-XQMVECQM.js +15 -0
- package/dist/{chunk-6AYAB5FN.js → chunk-YVI2XJCB.js} +5 -5
- package/dist/{chunk-ZEGCKIAL.js → chunk-YX4QGW7Z.js} +3 -3
- package/dist/chunk-Z2MP46QJ.js +1 -0
- package/dist/chunk-ZC2FZLYX.js +4 -0
- package/dist/{chunk-SP4S4HUJ.js → chunk-ZQWKVLSY.js} +13 -13
- package/dist/{chunk-5O4HMXPQ.js → chunk-ZS36DB4X.js} +2 -2
- package/dist/chunk-ZUQ72WER.js +7 -0
- package/dist/{chunk-IZ6D4KGR.js → chunk-ZYWLX5EK.js} +3 -3
- package/dist/{chunk-CXEELIRW.js → chunk-ZZKBCNK6.js} +9 -9
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ListToolbar.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SearchInput.js +1 -1
- package/dist/forms/Segmented.d.ts +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +662 -662
- package/dist/map/index.js +10 -10
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-MILMPZK2.js +0 -44
- package/dist/Calculator-MW7S4UKX.js +0 -29
- package/dist/CurrencyConverter-P3HQXUX2.js +0 -21
- package/dist/Notepad-VXENTPT2.js +0 -24
- package/dist/PdfViewer-FWGHFO4N.js +0 -1
- package/dist/PomodoroTimer-LJ6VBFGX.js +0 -91
- package/dist/Sidebar-2TYZENQL.js +0 -44
- package/dist/chunk-4DNPUG3T.js +0 -7
- package/dist/chunk-A3VLZZHJ.js +0 -9
- package/dist/chunk-AJPQJ7TC.js +0 -6
- package/dist/chunk-ALZHFQRX.js +0 -4
- package/dist/chunk-B34UWI47.js +0 -1
- package/dist/chunk-CHDGSJLV.js +0 -8
- package/dist/chunk-EBODRYXS.js +0 -19
- package/dist/chunk-FFPIT2LB.js +0 -3
- package/dist/chunk-HX5QSQ2C.js +0 -2
- package/dist/chunk-KETNB4NQ.js +0 -2
- package/dist/chunk-M5IZ7QLQ.js +0 -7
- package/dist/chunk-MEP6CZJ3.js +0 -2
- package/dist/chunk-MNZAAQLH.js +0 -15
- package/dist/chunk-MYH5H43C.js +0 -1
- package/dist/chunk-NDCS4COQ.js +0 -11
- package/dist/chunk-OJYEGB74.js +0 -28
- package/dist/chunk-PWON7O3N.js +0 -9
- package/dist/chunk-RTK77DMP.js +0 -15
- package/dist/chunk-SYUCEN76.js +0 -92
- package/dist/chunk-VUBDHFG5.js +0 -4
- package/dist/chunk-W4IH3BE3.js +0 -23
- package/dist/chunk-W6REY3SV.js +0 -5
- package/dist/chunk-WBZO6WRU.js +0 -8
- package/dist/chunk-Y7D2CZ4H.js +0 -13
- package/dist/chunk-YTLUSBDY.js +0 -14
- package/dist/chunk-ZSVU44OB.js +0 -6
- /package/dist/{chunk-5YTZBYG4.js → chunk-LPQQNPH5.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-72UHB4JU.js";import{IconButton_default as a}from"./chunk-
|
|
2
|
-
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":R,windows:j,className:
|
|
3
|
-
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),
|
|
4
|
-
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:
|
|
5
|
-
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:
|
|
6
|
-
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":R??q.formatting,children:
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-72UHB4JU.js";import{IconButton_default as a}from"./chunk-QZYV4TDD.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-2MUZFHZW.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
|
|
2
|
+
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":R,windows:j,className:S="",layout:U="grid"}){const q=s().textToolbar,A=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!A.words&&!A.paragraph)return null;const B=m(n,k,x,A.cells.paragraph),I=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,$=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:I(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:I(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,H=l(q),L=e.map(e=>[e,H[e],r(e)]),T=C?e.filter(e=>C.allow.includes(e)):[],K=C&&T.includes(C.value)?C.value:T[0],Z=[["none",q.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",q.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",q.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],O=x&&B?g(q.clear,/* @__PURE__ */i(a,{className:I(!1),"aria-label":q.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,Q=/* @__PURE__ */t(d,{children:[$("bold",q.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),$("italic",q.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),$("underline",q.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),$("strike",q.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(q.color,/* @__PURE__ */i(a,{pressed:k.open,className:I(k.open,"rosh-tb-color"),"aria-label":q.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,$("link",q.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),$("sup",q.sup,/* @__PURE__ */i(o,{name:"superscript"})),$("sub",q.sub,/* @__PURE__ */i(o,{name:"subscript"})),$("code",q.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===B?O:null]}),V=/* @__PURE__ */t(d,{children:[C&&T.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.alignment,onKeyDown:e=>p(e,T,e=>C.onChange(e)),children:L.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:I(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===K?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(q.bullet,/* @__PURE__ */i(a,{className:I("bullet"===D.pressed),"aria-label":q.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(q.number,/* @__PURE__ */i(a,{className:I("number"===D.pressed),"aria-label":q.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,$("quote",q.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.letterCase,onKeyDown:e=>p(e,Z.map(([e])=>e),e=>M.onChange(e)),children:Z.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:I(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===B?O:null]}),E="row"===U,F=E?" is-row":A.flow?" is-flow":A.oneRow?" is-one-row":A.words&&void 0===N&&"words"!==B?" is-eight":"",G=b(n,Boolean(k)),J={"--rosh-tb-color-col":String(G.color),"--rosh-tb-link-col":String(G.link),...E?{"--rosh-tb-cells":String(A.cells.words+A.cells.paragraph),"--rosh-tb-groupgap":A.words&&A.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let P;return P=E?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[A.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:Q}):null,A.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:V}):null]}):A.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[Q,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),V]}):A.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:Q}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:V})]}):/* @__PURE__ */t(d,{children:[A.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==B?" is-eight":""),children:Q}):null,A.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:V}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${F} ${S}`.trim(),style:J,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":R??q.formatting,children:P}),j]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-
|
|
1
|
+
import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-J43RRDEP.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{OneLineLabel as o}from"./chunk-7FYTL6SD.js";import{Tooltip as s}from"./chunk-2MUZFHZW.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
|
|
2
2
|
return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?e:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
|
|
3
3
|
/* @__PURE__ */t(a,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
4
4
|
/* @__PURE__ */t(o,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{WidestLabel as e}from"./chunk-X3LMTOMA.js";import{DropdownMenu as n,TRIGGER_CLASS as o}from"./chunk-
|
|
1
|
+
import{WidestLabel as e}from"./chunk-X3LMTOMA.js";import{DropdownMenu as n,TRIGGER_CLASS as o}from"./chunk-M6ODRWTM.js";import{Tooltip as i}from"./chunk-2MUZFHZW.js";import{jsx as r}from"react/jsx-runtime";function t(e,n,o){if(n&&!(n.options.length<2))/* @__PURE__ */
|
|
2
2
|
return r(l,{value:e,options:n.options,onChange:n.onChange,label:n.label,disabled:o})}var a=`${o} -ml-1 h-6 px-1 text-xs`;function l({value:o,options:t,onChange:l,label:s,disabled:m}){
|
|
3
3
|
/* @__PURE__ */
|
|
4
4
|
return r(i,{content:s,describe:!1,children:/* @__PURE__ */r(n,{trigger:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-ZYWLX5EK.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.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(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),L=N.trim().toLowerCase(),M=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]),R=e=>!L||e.title.toLowerCase().includes(L)||e.body.toLowerCase().includes(L)||e.category_label.toLowerCase().includes(L),_=n(()=>M.map(e=>({...e,docs:e.docs.filter(R)})).filter(e=>e.docs.length>0),[M,L]),E=n(()=>_.flatMap(e=>e.docs),[_]),Y=(w?E.find(e=>e.slug===w):void 0)??E[0]??null,A=e=>!!L||(C[e]??e===Y?.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:N,onChange:e=>v(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===
|
|
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:L?y.help.noResults:b??y.help.empty}):_.map(e=>{const t=A(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]:!A(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=Y?.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:Y?/* @__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:Y.title}),
|
|
20
|
+
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[Y.category_label,!1===Y.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(Y),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(Y):Y.body?/* @__PURE__ */o(e,{children:Y.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as r,useContext as o}from"react";var t=r(null);function n(r){const n=o(t);return n&&(void 0===r||"sm"===r||"md"===r||"lg"===r)?n:r}export{t as RowControlSizeContext,n as useRowControlSize};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-PAD65HG7.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{OneLineLabel as r}from"./chunk-7FYTL6SD.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Input_default as e}from"./chunk-
|
|
1
|
+
import{Input_default as e}from"./chunk-JHEHW5BE.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
|
|
2
2
|
return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as r}from"./chunk-
|
|
2
|
-
return s("div",{id:
|
|
3
|
-
/* @__PURE__ */d("div",{className:"w-30 shrink-0",children:/* @__PURE__ */d(e,{value:v,onChange:b,min:g,max:x,step:w,...r(w),placeholder:y,prefix:/* @__PURE__ */d("span",{"data-radius-mark":"","aria-hidden":"true",children:M.corners.radiusMark}),suffix:
|
|
4
|
-
/* @__PURE__ */d("div",{ref:
|
|
1
|
+
import{InputNumber_default as e,stepRounding as r}from"./chunk-KKZXGWSX.js";import{IconButton_default as a}from"./chunk-QZYV4TDD.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-2MUZFHZW.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{useState as t,useRef as o}from"react";import{jsxs as s,jsx as d}from"react/jsx-runtime";var u={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function m({label:m,value:f,corners:p,onChange:h,radius:v=null,onRadiusChange:b,radiusLabel:k,radiusMin:g=0,radiusMax:x,radiusStep:w=1,radiusPlaceholder:y,radiusUnit:j,units:R,disabled:A=!1,disabledReason:D,id:K,className:N=""}){const M=l(),S=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(p),[C,Z]=t(0),I=o(null);/* @__PURE__ */
|
|
2
|
+
return s("div",{id:K,role:"group","aria-label":m,className:`flex min-w-0 flex-wrap items-center gap-2 ${N}`.trim(),children:[b&&
|
|
3
|
+
/* @__PURE__ */d("div",{className:"w-30 shrink-0",children:/* @__PURE__ */d(e,{value:v,onChange:b,min:g,max:x,step:w,...r(w),placeholder:y,prefix:/* @__PURE__ */d("span",{"data-radius-mark":"","aria-hidden":"true",children:M.corners.radiusMark}),suffix:j??M.corners.unit,units:R,steppers:"compact",disabled:A,"aria-label":k??M.corners.radius})}),
|
|
4
|
+
/* @__PURE__ */d("div",{ref:I,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(I.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:S.map((e,r)=>{const l=f.includes(e.value),t=A||!0===e.disabled,o=t&&(!0===e.disabled&&e.title||(A?D:void 0))||void 0,s=/* @__PURE__ */d(a,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":t||void 0,disabledReason:o,"data-corner":e.value,size:"sm",tabIndex:r===C?0:-1,onFocus:()=>Z(r),onClick:()=>{t||h(l?f.filter(r=>r!==e.value):[...f,e.value])},children:/* @__PURE__ */d(i,{name:"corner",strokeWidth:2,className:["h-4 w-4",u[e.value]??""].filter(Boolean).join(" ")})},e.value);return o?s:/* @__PURE__ */d(n,{content:e.title??e.label,children:s},e.value)})})]})}export{m as CornersInput};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-
|
|
2
|
-
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function I(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var
|
|
3
|
-
return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${
|
|
4
|
-
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>
|
|
5
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*
|
|
6
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(
|
|
1
|
+
import{Popover as e}from"./chunk-ZC2FZLYX.js";import{InputNumber_default as r}from"./chunk-KKZXGWSX.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-2MUZFHZW.js";import{useShellStrings as h}from"./chunk-NRHG4R2Q.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"rosh-swatch-edge border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function A(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function I(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var M={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function P(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:j,onClose:K,id:S,className:R=""}){const U=h().color,H=k(z),L=e=>{const r=k(e);N||r===H||j?.(r)},O=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:H},X=a(f??""),[Z,W]=p(()=>n(e||X||"")),Y=b(e);m(()=>{e!==Y.current&&(Y.current=e,e?W(n(e)):X&&W(n(X)))},[e]);const E=a=>{N||a===e||(Y.current=a,r(a))},q=e=>{const r=a(e);r&&(W(n(r)),E(r))},F=e=>{W(e),E(o(e))},[G,J]=p(!1),Q=b(Z);Q.current=Z;const V=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===x?(J(!0),W(a)):F(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,Q.current);"end"===x?W(a):F(a)},onPointerUp:r=>{"end"===x&&G&&(J(!1),F(e(r,Q.current)))}}),_=V((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=V((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=G?o(Z):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||X||"";/* @__PURE__ */
|
|
3
|
+
return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${R}`.trim(),onKeyDown:e=>{"Escape"===e.key&&K&&(e.preventDefault(),e.stopPropagation(),K())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":U.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:U.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":U.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(Y.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
|
|
4
|
+
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>q(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
5
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*Z.v),"aria-valuetext":U.squareValue(Math.round(100*Z.s),Math.round(100*Z.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=A(Z,e.key,e.shiftKey);r&&(e.preventDefault(),F(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:Z.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(Z.s),top:ae(1-Z.v),...M}})}),
|
|
6
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(Z.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=I(Z.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),F({...Z,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:Z.h/360*100+"%",background:o({h:Z.h,s:1,v:1}),...M}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":U.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":H,"aria-valuetext":`${H}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=P(H,e.key,e.shiftKey);null!==r&&(e.preventDefault(),L(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),L(O(e)))},onPointerMove:e=>{!N&&1&e.buttons&&L(O(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${H}%`,...C(te||"black",H),...M}})}),
|
|
7
7
|
/* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
|
|
8
|
-
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?
|
|
9
|
-
/* @__PURE__ */v(
|
|
10
|
-
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function
|
|
11
|
-
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function U({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,A=k(p),I=f(),
|
|
8
|
+
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?H:null)}),
|
|
9
|
+
/* @__PURE__ */v(T,{value:re,placeholder:!e&&X?t(X):void 0,onChange:q,label:U.hex(i),disabled:N}),j&&/* @__PURE__ */v(B,{value:H,onChange:L,label:U.opacity(i),disabled:N})]})]})}var K={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},S={sm:"h-6",md:"h-8",lg:"h-10"},R=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function T({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${R} ${S[c]} ${h}`.trim():u({size:c,className:`${K[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
10
|
+
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function B({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
|
|
11
|
+
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function U({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,A=k(p),I=f(),M=a(s??""),P=r||M||"",K=r?t(r):M?t(M):D.none;
|
|
12
12
|
/* @__PURE__ */
|
|
13
13
|
return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
|
|
14
|
-
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(
|
|
15
|
-
/* @__PURE__ */v(
|
|
14
|
+
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(P,b?A:null)}),triggerLabel:D.swatch(o,K),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:I,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
|
|
15
|
+
/* @__PURE__ */v(T,{value:r,placeholder:!r&&M?t(M):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(B,{value:A,onChange:e=>{u||e===A||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{U as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,T as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,I as stepHue,P as stepOpacity,A as stepSquare};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createShellPortal as t}from"./chunk-52YTUQW3.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as r,placeMenu as n,followRect as o}from"./chunk-TAHHZGRH.js";import{useHydrated as i}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as s}from"./chunk-PU2GJVMG.js";import{solidSurfaceStyle as c}from"./chunk-5FYDNH4Y.js";import{useRef as u,useCallback as a,useEffect as d}from"react";import{jsx as f}from"react/jsx-runtime";var l=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:j=""}){const w=i(),k=u(null),v=u(p);v.current=p;const H=u(m);H.current=m;const W=a(()=>{const t=k.current,e=v.current();if(!t||!e)return;const o=(H.current??l)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*r)}px`;const s=n({trigger:e,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);s(()=>{w&&W()}),d(()=>{if(!w)return;const t=o(()=>v.current(),W),e=k.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>W());return r.observe(e),()=>{t(),r.disconnect()}},[w,W]);return w&&p()?t(
|
|
2
|
+
/* @__PURE__ */f("div",{ref:k,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${j}`.trim(),style:{...c(),position:"fixed",left:0,top:0,zIndex:e.popup},children:x}),document.body):null}export{p as FloatingBar};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-D3L2QCGF.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-NRHG4R2Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const F=m().charts,W=c(),R=N??(e=>h(e,W)),w=C??F.nothingToCompare,L=p(),[Q,A]=u(null),{highlighted:z}=a(),E=x;if(k.length<3||0===E.length)/* @__PURE__ */
|
|
2
|
+
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const H=y/2,T=y/2,U=y/2-46,V=o(k.length),Y=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...E.map(e=>e.values[t]??0).filter(Number.isFinite))),B=(e,t)=>{const r=Math.max(0,Math.min(1,t/Y[e])),l=V.center(e)-V.step/2;return[H+U*r*Math.cos(l),T+U*r*Math.sin(l)]},D=(e,t)=>null!==Q?Q!==e:null!==z&&z!==t,G=null!==Q?E[Q]:void 0;/* @__PURE__ */
|
|
3
|
+
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
|
+
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":L,onMouseLeave:()=>A(null),children:[
|
|
5
|
+
/* @__PURE__ */d("title",{id:L,children:F.acrossMeasures(E.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=U*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:H,cy:T,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(H,T,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=B(t,Y[t]);/* @__PURE__ */
|
|
6
|
+
return f("g",{children:[
|
|
7
|
+
/* @__PURE__ */d("line",{x1:H,y1:T,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
|
+
/* @__PURE__ */d("text",{x:H+(U+18)*Math.cos(V.center(t)-V.step/2),y:T+(U+18)*Math.sin(V.center(t)-V.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
+
/* @__PURE__ */d(r,{id:L,reveal:!!j&&"center-out"}),E.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>B(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:D(t,e.key)?.3:1,onMouseEnter:()=>A(t),mask:j?`url(#${l(L)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
+
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),G&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:G.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(Q,3,G.color,G.tone),value:R(G.values[t]??0)}))})}),
|
|
12
|
+
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:E.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
|
+
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
|
+
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
15
|
+
/* @__PURE__ */d(e,{caption:F.acrossMeasures(E.map(e=>e.label),k.length),head:[F.tableSeries,...k.map(e=>e.label)],rows:E.map(e=>[e.label,...k.map((t,r)=>R(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-XYVFJLAU.js";import{IconButton_default as r}from"./chunk-
|
|
1
|
+
import{writeClipboard as e}from"./chunk-XYVFJLAU.js";import{IconButton_default as r}from"./chunk-QZYV4TDD.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-I2NVBDKH.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
2
|
return s(t,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":
|
|
4
|
-
return m("div",{id:
|
|
3
|
+
return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":D,className:T=""}){const[V,B]=i(!1),C=o(null),R=a().copy;c(()=>()=>{C.current&&clearTimeout(C.current)},[]);const H=l(async()=>{await e(t)?(B(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{B(!1),C.current=null},2e3),v?.(t)):n.error(R.failed)},[t,v,R]),{box:I,button:L}=p[g],Q=!k;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:Q?void 0:j,"aria-describedby":Q?void 0:D,className:["inline-flex max-w-full items-center rounded-md",u[N],I,T].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
5
|
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:t,children:y??t}),!k&&/* @__PURE__ */m(d,{children:[
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?R.copyLabel(x):R.copy,"aria-describedby":D,onClick:H,className:`${L} text-gray-400`,children:/* @__PURE__ */s(V?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:V?R.copied:""})]})]})}export{y as Snippet};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-D3L2QCGF.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-NRHG4R2Q.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,C]=u(null),{highlighted:F}=r(),L=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",L),0===L.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const Q=Math.max(...L.map(e=>e.depth))+1,R=f/2,E=f/2,I=(f/2-8-b)/Q,z=L.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),A=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,D=e=>null!==w?e.id===w:null===F||e.branchKey===F,G=w?L.find(e=>e.id===w):void 0,H=e=>c(e.value/z*100,1,$);/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${g??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(z),
|
|
4
|
-
/* @__PURE__ */s(e,{caption:M.sunburst(j(z),
|
|
3
|
+
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(z),Q),onMouseLeave:()=>C(null),children:[L.map(e=>/* @__PURE__ */s("path",{d:t(R,E,b+e.depth*I+v/2,b+(e.depth+1)*I-v/2,e.start,e.end),fill:A(e),fillOpacity:D(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>C(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:R,y:E+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),G&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:G.label,rows:[{key:"value",label:M.value,color:A(G),value:j(G.value)},{key:"share",label:M.share,color:a.muted,value:H(G)}]})}),
|
|
4
|
+
/* @__PURE__ */s(e,{caption:M.sunburst(j(z),Q),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:L.map(e=>[e.depth+1,e.label,j(e.value),H(e)])})]})}export{f as SunburstChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="15.2.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-DWGYC7OD.js";import{DESCRIPTION_TEXT as n}from"./chunk-BWJZTHZ6.js";import{onOverlayOpen as i}from"./chunk-PGN5ME7B.js";import{createShellPortal as o}from"./chunk-52YTUQW3.js";import{Z_LAYERS as a}from"./chunk-62LW225J.js";import{popupBounds as c,VIEWPORT_MARGIN as s,placeMenu as u,followAnchor as l}from"./chunk-TAHHZGRH.js";import{useHydrated as d}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as m}from"./chunk-PU2GJVMG.js";import{buttonClasses as p}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as h,useRef as g,useId as v,useCallback as b,useEffect as w}from"react";import{jsxs as x,jsx as y}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/;function N({trigger:N,children:j,title:C,description:E,"aria-label":T,align:D="start",side:H="bottom",open:O,defaultOpen:W=!1,onOpenChange:$,matchTriggerWidth:P=!1,maxHeight:L,initialFocus:M,id:U,triggerLabel:G,"aria-describedby":K,disabled:S,className:Y="",triggerClassName:z,panelClassName:F=""}){const[Q,R]=h(W),Z=(O??Q)&&!S,B=d(),J=g(null),I=g(null),V=g(null),A=g(null),X=v(),q=U??X,_=v(),ee=v(),te=v(),re=g(null),ne=g(!1),ie=g({openProp:O,onOpenChange:$});ie.current={openProp:O,onOpenChange:$};const oe=b(e=>{void 0===ie.current.openProp&&R(e),ie.current.onOpenChange?.(e)},[]),ae=b((e=!1)=>{ne.current=e,oe(!1)},[oe]),ce=e=>{re.current=e.nativeEvent},se=b(()=>{const e=V.current,t=I.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=c(t),i=Math.max(0,n.right-n.left-2*s),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${i}px`,o.maxHeight="none",o.width=P?`${Math.min(r.width,i)}px`:"";const a={width:e.offsetWidth,height:e.offsetHeight},l=L??1/0,d=u({trigger:r,menu:{width:a.width,height:Math.min(a.height,l)},bounds:n,align:D,side:H}),m=Math.min(d.maxHeight,l);o.left=`${d.left}px`,o.top=`${d.top}px`,o.maxHeight=`${m}px`,o.overflowY=a.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=D},[D,H,P,L]);m(()=>{Z&&B&&se()}),w(()=>{if(!Z||!B)return;const e=l(()=>I.current,se),t=A.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>se());return r.observe(t),()=>{e(),r.disconnect()}},[Z,B,se]),w(()=>{if(!Z)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(re.current===e)return!1;const t=e.target;return!(t&&(J.current?.contains(t)||V.current?.contains(t)))})(e)&&ae(!0))},i=e=>{t=e,r=window.setTimeout(()=>n(e),0)},o=e=>n(e);return document.addEventListener(e,i,!0),window.addEventListener(e,o),()=>{window.clearTimeout(r),document.removeEventListener(e,i,!0),window.removeEventListener(e,o)}},t=e("pointerdown"),r=e("focusin"),n=i(()=>ae()),o=f(e=>"Escape"===e.key&&(ae(),I.current?.focus(),!0),()=>V.current);return()=>{t(),r(),n(),o()}},[Z,ae]),e(V,Z&&B),m(()=>{if(!Z||!B)return;const e=V.current;return()=>{if(ne.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||I.current?.focus({preventScroll:!0})}},[Z,B]),w(()=>{if(!Z||!B)return;const e=V.current;e&&(ne.current=!1,(M?.current??t(e)[0]??e).focus({preventScroll:!0}))},[Z,B]);const ue="function"==typeof j?j({close:()=>ae()}):j,le=C?{"aria-labelledby":ee}:T?{"aria-label":T}:{"aria-labelledby":q};/* @__PURE__ */
|
|
2
|
+
return x("div",{ref:J,className:`relative inline-flex ${Y}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */y("button",{ref:I,id:q,type:"button","aria-haspopup":"dialog","aria-expanded":Z,"aria-controls":Z&&B?_:void 0,"aria-label":G,"aria-describedby":K,disabled:S,onClick:()=>Z?ae():oe(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!Z)return;const r=(()=>{const e=V.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:z??p({variant:"secondary"}),children:N}),Z&&B&&o(
|
|
4
|
+
/* @__PURE__ */y("div",{ref:V,id:_,role:"dialog",...le,"aria-describedby":E?te:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:ce,onFocusCapture:ce,onKeyDown:e=>{const n=V.current,i=I.current;if("Tab"!==e.key||!n||!i||!n.contains(e.target))return;const o=t(n),a=document.activeElement;if(e.shiftKey){if(o.length>0&&a!==o[0]&&a!==n)return;return e.preventDefault(),void i.focus({preventScroll:!0})}if(o.length>0&&a!==o[o.length-1])return;e.preventDefault();const c=r(i,n);ae(!!c),(c??i).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${F}`.trim(),style:k.test(F)?void 0:{zIndex:a.popup},children:/* @__PURE__ */x("div",{ref:A,children:[C&&/* @__PURE__ */y("h2",{id:ee,className:"text-sm font-semibold text-gray-900",children:C}),E&&/* @__PURE__ */y("p",{id:te,className:`mt-1 ${n}`,children:E}),C||E?/* @__PURE__ */y("div",{className:"mt-3",children:ue}):ue]})}),document.body)]})}export{N as Popover};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-
|
|
1
|
+
import{Segmented as e}from"./chunk-NTVACRKD.js";import{calendarNames as t,formatDate as n}from"./chunk-NHKT5IH6.js";import{toDateKey as r,fromDateKey as a,DAY_MS as o}from"./chunk-JRQMX4PK.js";import{LoadingSpinner as i}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as s}from"./chunk-PU2GJVMG.js";import{useShellStrings as l,useShellLocale as d}from"./chunk-NRHG4R2Q.js";import{useState as c,useRef as u,useId as h,useMemo as m}from"react";import{jsx as f,Fragment as p,jsxs as b}from"react/jsx-runtime";var g={day:32,week:16,month:4},y=44;function w(e){const t="string"==typeof e?a(e.slice(0,10)):null;return t?Math.round(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())/o):null}function x(e){return new Date(e*o).toISOString().slice(0,10)}function v(e){return new Date(e*o)}function k(e){return((e+3)%7+7)%7}function N(e){return e-k(e)}function D(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)/o)}function M(e){const t=v(e);return Math.round(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)/o)}function C(e){return Math.round(Date.UTC(v(e).getUTCFullYear(),0,1)/o)}function $(e){return Math.round(Date.UTC(v(e).getUTCFullYear()+1,0,1)/o)}var T={day:3,week:7,month:14},U={day:28,week:84,month:182};function j(e,t,n){return(e-t.startDay)*g[n]}function P(e,t,n){return j(e,t,n)+g[n]/2}function R(e,t,n,r){const a=[];let o=e.startDay;if(n(o)!==o){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}for(;o<e.endDay;){const n=Math.min(r(o),e.endDay);a.push({startDay:o,endDay:n,x:j(o,e,t),width:(n-o)*g[t]}),o=n}return a}function S(e,t,n,r){if(null===e&&null===t)return{kind:"none"};if(null===e)return{kind:"milestone",day:t,cx:j(t,n,r)+g[r]/2};const a=null===t?e:Math.min(e,t),o=null===t?e:Math.max(e,t);return{kind:"bar",startDay:a,endDay:o,x:j(a,n,r),width:(o-a+1)*g[r]}}function X(e){return"bar"===e.kind?{inX:e.x,outX:e.x+e.width}:"milestone"===e.kind?{inX:e.cx-9,outX:e.cx+9}:null}function I(e,t,n,r,a=44,o=10){let i;if(n-e>=2*o){const a=e+o;i=[[e,t],[a,t],[a,r],[n,r]]}else{const s=t+(r>=t?1:-1)*a/2,l=e+o,d=n-o;i=[[e,t],[l,t],[l,s],[d,s],[d,r],[n,r]]}return i.filter((e,t)=>0===t||e[0]!==i[t-1][0]||e[1]!==i[t-1][1])}function z(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e} ${t}`).join(" ")}function Y(e,t,n=5){return`${e},${t} ${e-n},${t-n} ${e-n},${t+n}`}function F(e,t,n,r){if("move"===e)return{start:null===t?null:t+r,end:null===n?null:n+r};if("start"===e){if(null===t)return{start:t,end:n};const e=t+r;return{start:null===n?e:Math.min(e,n),end:n}}if(null===n)return{start:t,end:n};const a=n+r;return{start:t,end:null===t?a:Math.max(a,t)}}var H=24;function K({rows:a,groups:o=[],dependencies:j=[],scale:K,onScaleChange:A,onRowClick:Q,onRowChange:L,readOnly:W=!1,today:E,isLoading:G=!1,emptyState:V,labelHeader:J,labelWidth:O=240,className:Z=""}){const q=l().gantt,B=d(),_=t(B),ee=!!L&&!W,[te,ne]=c(null),re=u(!1),ae=u(null),oe=h(),ie=w(E)??w(r(/* @__PURE__ */new Date)),se=m(()=>{const e=/* @__PURE__ */new Map;for(const t of a){const n=w(t.start),r=w(t.end);e.set(t.id,te&&te.id===t.id?F(te.mode,te.start,te.end,te.delta):{start:n,end:r})}return e},[a,te]),le=m(()=>{const e=[ie];for(const t of a){const n=w(t.start),r=w(t.end);null!==n&&e.push(n),null!==r&&e.push(r)}return function(e,t){const n=e.filter(e=>Number.isFinite(e)),r=n.length?Math.min(...n):0,a=n.length?Math.max(...n):0;let o=r-T[t],i=a+1+T[t];const s=U[t]-(i-o);return s>0&&(o-=Math.floor(s/2),i+=Math.ceil(s/2)),"week"===t?(o=N(o),i=N(i-1)+7):"month"===t&&(o=D(o),i=M(i-1)),{startDay:o,endDay:i}}(e,K)},[a,K,ie]),de=m(()=>function(e,t){return"day"===t?{major:R(e,t,D,M),minor:R(e,t,e=>e,e=>e+1)}:"week"===t?{major:R(e,t,D,M),minor:R(e,t,N,e=>N(e)+7)}:{major:R(e,t,C,$),minor:R(e,t,D,M)}}(le,K),[le,K]),ce=function(e,t){return(e.endDay-e.startDay)*g[t]}(le,K),ue=m(()=>function(e,t){const n=new Set(t.map(e=>e.id)),r=/* @__PURE__ */new Map,a=[];for(const t of e)if(null!=t.groupId&&n.has(t.groupId)){const e=r.get(t.groupId)??[];e.push(t),r.set(t.groupId,e)}else a.push(t);const o=a.map(e=>({kind:"row",row:e}));for(const e of t){o.push({kind:"group",group:e});for(const t of r.get(e.id)??[])o.push({kind:"row",row:t})}return o}(a,o),[a,o]),he=m(()=>{const e=/* @__PURE__ */new Map;return ue.forEach((t,n)=>{if("row"!==t.kind)return;const r=se.get(t.row.id);e.set(t.row.id,{shape:S(r.start,r.end,le,K),line:n})}),e},[ue,se,le,K]),me=m(()=>{const e=[];for(const t of j){const n=he.get(t.from),r=he.get(t.to);if(!n||!r)continue;const a=X(n.shape),o=X(r.shape);if(!a||!o)continue;const i=n.line*y+22,s=r.line*y+22,l=I(a.outX,i,o.inX,s);e.push({key:`${t.from}>${t.to}`,d:z(l),head:Y(o.inX,s)})}return e},[j,he]),fe=!G&&(a.length>0||o.length>0);s(()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-O;e.scrollLeft=Math.max(0,P(ie,le,K)-t/4)},[K,fe]);if(G)/* @__PURE__ */return f(i,{size:"sm",padding:"p-4",label:q.loading});if(!fe)/* @__PURE__ */return f(p,{children:V??/* @__PURE__ */f("div",{className:"text-sm text-ink-faint p-4",children:q.empty})});const pe=(e,t,n)=>{L?.(e.id,{start:null===t?null:x(t),end:null===n?null:x(n)})},be=(e,t,n)=>{if(re.current=!1,ee&&0===e.button){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}ne({id:t.id,mode:n,originX:e.clientX,start:w(t.start),end:w(t.end),delta:0})}},ge=e=>{if(!te)return;const t=function(e,t){const n=Math.round(e/g[t]);return 0===n?0:n}(e.clientX-te.originX,K);t!==te.delta&&ne({...te,delta:t})},ye=e=>{if(te){if(0!==te.delta){const t=F(te.mode,te.start,te.end,te.delta);re.current=!0,pe(e,t.start,t.end)}ne(null)}},we=(e,t)=>{if("Enter"===e.key||" "===e.key)return e.preventDefault(),void Q?.(t);if(!ee||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const n="ArrowRight"===e.key?1:-1,r=F(e.shiftKey?"end":"move",w(t.start),w(t.end),n);pe(t,r.start,r.end)},xe=e=>{re.current?re.current=!1:Q?.(e)},ve=e=>n(x(e),{locale:B}),ke=(e,t)=>{const n=v(e.startDay),r=n.getUTCFullYear(),a=n.getUTCMonth();return"major"===t?"month"===K?String(r):"week"===K?_.shortMonthYear(r,a):_.monthYear(r,a):"month"===K?_.monthsShort[a]:String(n.getUTCDate())},Ne=ue.length*y,De=P(ie,le,K),Me=De>=0&&De<=ce,Ce=de.minor.find(e=>e.startDay<=ie&&ie<e.endDay),$e=Ce?De-Ce.x:0,Te=!!Ce&&$e<=Ce.width/2;/* @__PURE__ */
|
|
2
2
|
return b("div",{className:`flex min-h-0 flex-col ${Z}`,children:[
|
|
3
3
|
/* @__PURE__ */b("div",{className:"flex items-center justify-end gap-2 pb-2",children:[
|
|
4
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-
|
|
5
|
-
/* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:
|
|
4
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>{const e=ae.current;if(!e)return;const t=e.clientWidth-O;e.scrollTo?.({left:Math.max(0,P(ie,le,K)-t/4),behavior:"smooth"})},className:"min-h-8 rounded-(--radius-control) border border-line bg-surface px-3 text-xs font-medium text-ink hover:bg-row-hover",children:q.today}),A&&/* @__PURE__ */f(e,{size:"sm",label:q.scale,value:K,onChange:A,options:[{value:"day",label:q.day},{value:"week",label:q.week},{value:"month",label:q.month}]})]}),
|
|
5
|
+
/* @__PURE__ */f("div",{ref:ae,"data-gantt-scroller":"",className:"relative min-h-0 flex-1 overflow-auto grid-scroll rounded-(--radius-card) border border-line bg-surface",children:/* @__PURE__ */b("div",{className:"relative",style:{width:O+ce,minHeight:48+Ne},children:[
|
|
6
6
|
/* @__PURE__ */b("div",{className:"sticky top-0 z-20 flex border-b border-line bg-surface",style:{height:48},children:[
|
|
7
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:
|
|
8
|
-
/* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:
|
|
9
|
-
/* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:
|
|
7
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-end border-r border-line bg-surface px-3 pb-1 text-xs font-medium text-ink-muted",style:{width:O},children:J??q.task}),
|
|
8
|
+
/* @__PURE__ */b("div",{className:"relative shrink-0",style:{width:ce},"aria-hidden":!0,children:[de.major.map(e=>/* @__PURE__ */f("div",{className:"absolute top-0 border-l border-line-subtle text-xs font-medium leading-6 text-ink",style:{left:e.x,width:e.width,height:H},children:/* @__PURE__ */f("span",{className:"sticky inline-block whitespace-nowrap px-2",style:{left:O},children:ke(e,"major")})},`M${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{"data-gantt-tick":"minor",className:`absolute truncate border-l border-line-subtle text-2xs leading-6 text-ink-faint ${"day"===K?"text-center":"px-1"} ${e.startDay===ie&&"day"===K?"font-semibold text-danger":""}`,style:{left:e.x,width:e.width,top:H,height:H},children:ke(e,"minor")},`m${e.startDay}`)),Me&&Ce&&"day"!==K&&
|
|
9
|
+
/* @__PURE__ */b("div",{className:"pointer-events-none absolute flex items-center text-2xs "+(Te?"":"flex-row-reverse"),style:{left:Te?Ce.x:De-(Ce.width-$e),width:2*(Te?$e:Ce.width-$e),top:H,height:H},children:[Te&&/* @__PURE__ */f("span",{className:"invisible shrink-0 whitespace-nowrap px-1",children:ke(Ce,"minor")}),
|
|
10
10
|
/* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),
|
|
11
11
|
/* @__PURE__ */f("span",{"data-gantt-today-label":"",className:"shrink-0 whitespace-nowrap rounded-(--radius-control) bg-danger px-1 font-medium leading-4 text-on-accent",children:q.today}),
|
|
12
12
|
/* @__PURE__ */f("span",{className:"min-w-0 flex-1"}),Te&&/* @__PURE__ */f("span",{className:"invisible min-w-0 shrink overflow-hidden",children:/* @__PURE__ */f("span",{className:"inline-block whitespace-nowrap px-1",children:ke(Ce,"minor")})})]})]})]}),
|
|
13
|
-
/* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:
|
|
13
|
+
/* @__PURE__ */b("div",{className:"pointer-events-none absolute",style:{left:O,top:48,width:ce,height:Ne},"aria-hidden":!0,children:["day"===K&&de.minor.filter(e=>k(e.startDay)>=5).map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 bg-surface-sunken",style:{left:e.x,width:e.width}},`w${e.startDay}`)),de.minor.map(e=>/* @__PURE__ */f("div",{className:"absolute inset-y-0 w-px bg-line-subtle",style:{left:e.x}},`g${e.startDay}`))]}),
|
|
14
14
|
/* @__PURE__ */f("div",{role:"list",children:ue.map(e=>{if("group"===e.kind)/* @__PURE__ */
|
|
15
15
|
return b("div",{role:"listitem",className:"flex",style:{height:y},children:[
|
|
16
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:
|
|
16
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 items-center border-r border-b border-line bg-surface-sunken px-3 text-sm font-semibold text-ink",style:{width:O},children:/* @__PURE__ */f("span",{className:"truncate",children:e.group.label})}),
|
|
17
17
|
/* @__PURE__ */f("div",{className:"shrink-0 border-b border-line-subtle",style:{width:ce}})]},`g:${e.group.id}`);const t=e.row,n=he.get(t.id).shape,r=function(e,t){return e.done?{className:"border text-ink-muted",style:{background:"var(--status-neutral-soft)",borderColor:"var(--status-neutral-line)"}}:e.tone?{className:"text-on-accent",style:{background:`var(--status-${e.tone}-solid)`}}:{className:t?"bg-identity-3":"bg-accent-fill text-on-accent"}}(t,"milestone"===n.kind),a=te?.id===t.id,o=t.done?`, ${q.done}`:"";/* @__PURE__ */
|
|
18
18
|
return b("div",{role:"listitem",className:"flex",style:{height:y},"data-gantt-row":t.id,children:[
|
|
19
|
-
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:
|
|
19
|
+
/* @__PURE__ */f("div",{className:"sticky left-0 z-10 flex shrink-0 border-r border-b border-line-subtle bg-surface",style:{width:O},children:/* @__PURE__ */f("button",{type:"button",tabIndex:"none"===n.kind&&Q?0:-1,onClick:()=>Q?.(t),className:`flex w-full min-w-0 items-center px-3 text-left text-sm hover:bg-row-hover ${t.done?"text-ink-faint line-through":"text-ink"} ${Q?"cursor-pointer":"cursor-default"}`,children:/* @__PURE__ */f("span",{className:"truncate",children:t.label})})}),
|
|
20
20
|
/* @__PURE__ */b("div",{className:"relative shrink-0 border-b border-line-subtle",style:{width:ce},children:["bar"===n.kind&&/* @__PURE__ */b(p,{children:[
|
|
21
|
-
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":q.barName(t.label,ve(n.startDay),ve(n.endDay))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":
|
|
21
|
+
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"aria-label":q.barName(t.label,ve(n.startDay),ve(n.endDay))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`group/bar absolute rounded-(--radius-control) shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":Q?"cursor-pointer":""} ${a?"opacity-80":""}`,style:{...r.style,left:n.x,width:n.width,top:10,height:24,touchAction:ee?"none":void 0},children:ee&&/* @__PURE__ */b(p,{children:[
|
|
22
22
|
/* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"start",className:"absolute inset-y-0 left-0 w-2 cursor-ew-resize rounded-l-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"start")}),
|
|
23
23
|
/* @__PURE__ */f("span",{"aria-hidden":!0,"data-gantt-handle":"end",className:"absolute inset-y-0 right-0 w-2 cursor-ew-resize rounded-r-(--radius-control) group-hover/bar:bg-scrim-soft",onPointerDown:e=>be(e,t,"end")})]})}),
|
|
24
24
|
/* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.x+n.width+16,top:16},children:t.label})]}),"milestone"===n.kind&&/* @__PURE__ */b(p,{children:[
|
|
25
|
-
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":q.milestoneName(t.label,ve(n.day))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":
|
|
25
|
+
/* @__PURE__ */f("div",{role:"button",tabIndex:0,"data-gantt-bar":t.id,"data-gantt-milestone":"","aria-label":q.milestoneName(t.label,ve(n.day))+o,"aria-describedby":ee?oe:void 0,onKeyDown:e=>we(e,t),onClick:()=>xe(t),onPointerDown:e=>be(e,t,"move"),onPointerMove:ge,onPointerUp:()=>ye(t),onPointerCancel:()=>ne(null),className:`absolute rotate-45 rounded-sm shadow-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${r.className} ${ee?a?"cursor-grabbing":"cursor-grab":Q?"cursor-pointer":""}`,style:{...r.style,left:n.cx-9/Math.SQRT2,top:22-9/Math.SQRT2,width:18/Math.SQRT2,height:18/Math.SQRT2,touchAction:ee?"none":void 0}}),
|
|
26
26
|
/* @__PURE__ */f("span",{"aria-hidden":!0,className:"pointer-events-none absolute whitespace-nowrap text-xs leading-none text-ink-muted",style:{left:n.cx+9+16,top:16},children:t.label})]})]})]},t.id)})}),
|
|
27
|
-
/* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:
|
|
27
|
+
/* @__PURE__ */f("svg",{className:"pointer-events-none absolute overflow-visible text-ink-faint",style:{left:O,top:48,width:ce,height:Ne},width:ce,height:Ne,"aria-hidden":!0,children:me.map(e=>/* @__PURE__ */b("g",{"data-gantt-arrow":e.key,children:[
|
|
28
28
|
/* @__PURE__ */f("path",{d:e.d,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"}),
|
|
29
|
-
/* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:
|
|
29
|
+
/* @__PURE__ */f("polygon",{points:e.head,fill:"currentColor"})]},e.key))}),Me&&/* @__PURE__ */f("div",{"data-gantt-today":"",className:"pointer-events-none absolute z-0 w-0.5 -translate-x-1/2 bg-danger",style:{left:O+De,top:48,height:Ne},"aria-hidden":!0}),ee&&/* @__PURE__ */f("span",{id:oe,hidden:!0,children:q.moveHint})]})})]})}export{K as Gantt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-
|
|
2
|
-
return p(n,{portal:!0,minWidth:x,style:P,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:
|
|
1
|
+
import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-FM5ASDVN.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-3HPCQMYH.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const A=s(null),L=a(),[j,S]=d(null),C=s(w);C.current=w,c(()=>{const e=A.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const U=s(null),F=s(!1);m(()=>(U.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!A.current?.contains(e)||U.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!F.current&&D&&(F.current=!0,h(A.current)[0]?.focus({preventScroll:!0}))},[j,D]),m(()=>{if(D)return;const e=e=>{if(A.current?.contains(document.activeElement))return;const t=h(A.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(C.current(),!0),()=>A.current),[]),m(()=>{const e=()=>C.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const M=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void C.current();const t=h(A.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),P=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
|
|
2
|
+
return p(n,{portal:!0,minWidth:x,style:P,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:A,id:L,role:"menu","aria-label":b,"aria-describedby":y?t(y,L):void 0,"data-context-menu":"",onKeyDown:M,children:[y&&e(y,{menuId:L,choose:e=>{e.disabled||(C.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>C.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-D3L2QCGF.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as a}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as r,CHART_INK as i}from"./chunk-TZFACUMR.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-NRHG4R2Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const w=n().charts,M=m(),N=y??(e=>h(e,M)),$=j??w.nothingToBreakDown,C=c(null),F=o(C),D=v??F,[G,Q]=u(null),{highlighted:R}=l(),z=e(p,D,d);if(0===z.length)/* @__PURE__ */
|
|
2
|
+
return s("div",{className:b,ref:C,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const A=k??r(0),B=Math.max(...z.map(e=>e.value),1),H=e=>34+e/B*62,L=e=>`color-mix(in oklab, ${A} ${H(e).toFixed(0)}%, ${i.surface})`,V=e=>H(e)>=55?i.surface:i.label,Y=G??R,E=G?z.find(e=>e.key===G):void 0;/* @__PURE__ */
|
|
3
|
+
return f("div",{className:`relative ${b??""}`,ref:C,children:[
|
|
4
|
+
/* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${D} ${d}`,role:"img","aria-label":w.treemap(p.length),onMouseLeave:()=>Q(null),children:z.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
|
|
5
|
+
return f("g",{opacity:Y&&Y!==e.key?.55:1,onMouseEnter:()=>Q(e.key),children:[
|
|
6
|
+
/* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:L(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:V(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:V(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),E&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(a,{title:E.label,rows:[{key:"value",label:w.value,color:L(E.value),value:N(E.value)}]})}),
|
|
7
|
+
/* @__PURE__ */s(t,{caption:w.treemap(p.length),head:[w.tableItem,w.value],rows:z.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{isSafeLinkHref as e}from"./chunk-Z5TE3MEG.js";import{Button_default as t}from"./chunk-7YJBWOQG.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useShellStrings as r}from"./chunk-NRHG4R2Q.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
|
|
2
2
|
return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
|
|
3
3
|
/* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
|
|
4
4
|
/* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
|
|
@@ -11,7 +11,7 @@ return i("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-
|
|
|
11
11
|
/* @__PURE__ */a("thead",{children:/* @__PURE__ */a("tr",{className:"bg-gray-50",children:s.map((e,t)=>/* @__PURE__ */a("th",{className:"border-b border-line px-3 py-2 text-left font-semibold text-ink",children:u(e)},t))})}),
|
|
12
12
|
/* @__PURE__ */a("tbody",{children:c.map((e,t)=>/* @__PURE__ */a("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */a("td",{className:"border-t border-line-subtle px-3 h-8 align-top text-ink",children:u(e)},t))},t))})]})},r);return l?.length?/* @__PURE__ */i("div",{children:[o,
|
|
13
13
|
/* @__PURE__ */a("div",{className:"flex flex-wrap justify-end gap-1",children:l.map(e=>/* @__PURE__ */a(t,{size:"sm",variant:"secondary",leftIcon:e.icon?/* @__PURE__ */a(n,{name:e.icon,look:"mini",className:"h-4 w-4","aria-hidden":"true"}):void 0,onClick:()=>e.onSelect({header:s.map(g),rows:c.map(e=>e.map(g))}),children:e.label},e.label))})]},r):o}var y=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/,v=/^[-*]\s+/,N=/^\d+\.\s+/,k=/^#{2,4}\s+/;function $(e){const t=e.split("\n"),n=[];let r=null;for(let e=0;e<t.length;e+=1){const l=t[e];let s=null;k.test(l)?s="heading":"table"!==r&&f(t.slice(e,e+2))?s="table":"bullet"!==r&&v.test(l)?s="bullet":"ordered"!==r&&N.test(l)&&("text"!==r||/^1\./.test(l))?s="ordered":"table"!==r||l.includes("|")?"heading"===r&&(s="text"):s="text",null!==s||null===r?(n.push([l]),r=s??"text"):n[n.length-1].push(l)}return n.map(e=>e.join("\n"))}function j(e){const t=e.replace(/\r\n/g,"\n").split("\n"),n=[];let r=[];const l=()=>{for(const e of r.join("\n").split(/\n{2,}/))for(const t of $(e.replace(/\s+$/,"")))""!==t.trim()&&n.push({text:t});r=[]};for(let e=0;e<t.length;e+=1){const s=y.exec(t[e]);if(!(null!==s&&!("`"===s[2][0]&&s[3].includes("`")))){r.push(t[e]);continue}l();const[,a,i,c]=s,o=[];let d=!1;for(e+=1;e<t.length;e+=1){const n=y.exec(t[e]);if(null!==n&&n[2][0]===i[0]&&n[2].length>=i.length&&""===n[3]){d=!0;break}o.push(a?t[e].replace(new RegExp(`^ {0,${a.length}}`),""):t[e])}n.push({fence:{lang:c.split(/[ \t]/)[0],code:o.join("\n"),closed:d}})}return l(),n}function w(e,t,n){if(n){let r=null;try{r=n(e)}catch{r=null}if(null!=r)/* @__PURE__ */return a("div",{children:r},t)}return function({lang:e,code:t},n){/* @__PURE__ */
|
|
14
|
-
return a("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */a("code",{children:t})},n)}(e,t)}function
|
|
14
|
+
return a("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */a("code",{children:t})},n)}(e,t)}function R({children:e,className:t,renderFence:n,tableActions:r,onLinkClick:l}){/* @__PURE__ */
|
|
15
15
|
return a(o.Provider,{value:l,children:/* @__PURE__ */a("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:j(e??"").map((e,t)=>"fence"in e?w(e.fence,t,n):function(e,t,n){const r=e.split("\n"),l=r[0],s=/^(#{2,4})\s+(.*)$/.exec(l);if(s&&1===r.length){const e=s[1].length;/* @__PURE__ */
|
|
16
16
|
return a(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-ink-faint":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:u(s[2])},t)}if(1===r.length&&/^---+$/.test(l))/* @__PURE__ */
|
|
17
17
|
return a("hr",{className:"border-gray-200"},t);if(f(r))return b(r,t,n);if(/^>\s?/.test(l)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
|
|
@@ -19,4 +19,4 @@ return a("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-
|
|
|
19
19
|
return a(m,{alt:i[1]},t);if(/^[-*]\s+/.test(l)){const e=h(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
20
20
|
return a("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */a("li",{children:u(e)},t))},t)}const c=/^(\d+)\.\s+/.exec(l);if(c){const e=h(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
21
21
|
return a("ol",{start:Number(c[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */a("li",{className:"pl-1",children:u(e)},t))},t)}/* @__PURE__ */
|
|
22
|
-
return a("p",{children:u(r.join(" "))},t)}(e.text,t,r))})})}export{
|
|
22
|
+
return a("p",{children:u(r.join(" "))},t)}(e.text,t,r))})})}export{R as Markdown,g as plainCell,x as tableToCsv};
|