efficient-shell 14.7.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/README.md +3 -2
- package/dist/Browser-42QAXKYW.js +44 -0
- package/dist/Calculator-C7APPCLE.js +29 -0
- package/dist/CurrencyConverter-VFTDSYQ3.js +21 -0
- package/dist/{Files-EQBPHAUH.js → Files-OAVWF6EW.js} +68 -68
- package/dist/Notepad-LNNSVEFG.js +24 -0
- package/dist/PdfViewer-ADPTYOAO.js +1 -0
- package/dist/PomodoroTimer-AGSHX2JO.js +91 -0
- package/dist/{Preview-ZHZ4CEWF.js → Preview-GDNUQKGN.js} +40 -40
- package/dist/Sidebar-SWLVNJ6L.js +44 -0
- package/dist/{Stock-S3LKKT3K.js → Stock-NNDDNQBJ.js} +5 -5
- package/dist/{Weather-KEOJ3BBV.js → Weather-NGQALCXO.js} +19 -19
- package/dist/{WorldClock-GKMDG2KU.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/brand.css +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-727NHWCZ.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-WBUAO7T7.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-NRX6JQV5.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-U5OSLUDU.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-LJS7UF3M.js → chunk-NBV3XK3Q.js} +2 -2
- 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-SH7PJC4P.js +1 -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/icons/index.js +1 -1
- package/dist/index.d.ts +2 -2
- 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.d.ts +4 -5
- 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/tokens/spacing.d.ts +4 -3
- package/dist/tokens/spacing.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +6 -4
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-HX3QY73A.js +0 -44
- package/dist/Calculator-TJDZOTG7.js +0 -29
- package/dist/CurrencyConverter-JL5JIVJG.js +0 -21
- package/dist/Notepad-5BQUYQNJ.js +0 -24
- package/dist/PdfViewer-FWGHFO4N.js +0 -1
- package/dist/PomodoroTimer-7W5ZHKUL.js +0 -91
- package/dist/Sidebar-2TYZENQL.js +0 -44
- package/dist/chunk-4DNPUG3T.js +0 -7
- package/dist/chunk-5IXCLPVZ.js +0 -1
- package/dist/chunk-A3VLZZHJ.js +0 -9
- package/dist/chunk-AJPQJ7TC.js +0 -6
- package/dist/chunk-ALZHFQRX.js +0 -4
- package/dist/chunk-AW7TOB6N.js +0 -1
- package/dist/chunk-CHDGSJLV.js +0 -8
- package/dist/chunk-DTFX624I.js +0 -8
- package/dist/chunk-EBODRYXS.js +0 -19
- package/dist/chunk-ERI63O4A.js +0 -28
- package/dist/chunk-FFPIT2LB.js +0 -3
- package/dist/chunk-GRZPIV2G.js +0 -14
- package/dist/chunk-HOPHOF2C.js +0 -2
- package/dist/chunk-HX5QSQ2C.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-PWON7O3N.js +0 -9
- package/dist/chunk-RTK77DMP.js +0 -15
- package/dist/chunk-UZATF4OZ.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-Y7D2CZ4H.js +0 -13
- package/dist/chunk-ZSVU44OB.js +0 -6
- /package/dist/{chunk-5YTZBYG4.js → chunk-LPQQNPH5.js} +0 -0
package/dist/apps/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{FILES_ROUTE,chooseInFiles,openFilesInTrashMode,setFilesDemoTree,withdrawFilesChoice}from"../chunk-CUNYWXUT.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-
|
|
2
|
+
export{FILES_ROUTE,chooseInFiles,openFilesInTrashMode,setFilesDemoTree,withdrawFilesChoice}from"../chunk-CUNYWXUT.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-NBV3XK3Q.js";import{setSpreadsheetPreview as e}from"../chunk-KGRJSTPM.js";export{FILES_OFFICE_EXTENSIONS,FILES_ROLE_LABELS,FilesQuotaError,SPREADSHEET_PREVIEW_UPDATE_EVENT,claimSpreadsheetPreviewStage,createFileServerStore,filesRoleWrites,peekSpreadsheetPreviewStage,setFilesStore,setSpreadsheetPreview}from"../chunk-KGRJSTPM.js";import{setPdfPreview as t}from"../chunk-I4RJAMLJ.js";export{setPdfPreview}from"../chunk-I4RJAMLJ.js";import"../chunk-QQ6TGD7K.js";import"../chunk-4LXCCZDM.js";import"../chunk-KNUR2UEG.js";import"../chunk-JDCM2VHG.js";import"../chunk-PSVGB7KT.js";import"../chunk-YI4T5I5D.js";import"../chunk-TTD2M6RF.js";import"../chunk-5A7MWTXX.js";import"../chunk-TJ5YMXVB.js";import"../chunk-NJJG2VAW.js";import"../chunk-T43ATI2N.js";import"../chunk-EIFNESXS.js";import"../chunk-ABAUJLI4.js";import"../chunk-CJ4OEY3T.js";import"../chunk-AVUH35GW.js";import"../chunk-LPQQNPH5.js";import"../chunk-VWGWZY7A.js";import"../chunk-DBQNYJZ6.js";import"../chunk-VIBGF2HJ.js";import"../chunk-SH7PJC4P.js";import"../chunk-YPXONNBV.js";import"../chunk-4PJFL26P.js";import"../chunk-2QY5BJLA.js";import"../chunk-UGTRSRIW.js";import"../chunk-POBVGDZP.js";import"../chunk-F3ZOO23R.js";import"../chunk-Z2MP46QJ.js";import"../chunk-M6ODRWTM.js";import"../chunk-FM5ASDVN.js";import"../chunk-DWGYC7OD.js";import"../chunk-QZYV4TDD.js";import"../chunk-PAD65HG7.js";import"../chunk-3HPCQMYH.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-7YJBWOQG.js";import"../chunk-J43RRDEP.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-7FYTL6SD.js";import"../chunk-2MUZFHZW.js";import"../chunk-PGN5ME7B.js";import"../chunk-52YTUQW3.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-UMLXFQVC.js";import"../chunk-STKJA4PV.js";import"../chunk-M6UKCZHT.js";import{toast_default as o}from"../chunk-I2NVBDKH.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import{currentShellStrings as n}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{lazy as i}from"react";function r(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var s=/* @__PURE__ */new Set(["csv","tsv"]),c=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),m=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),a=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function u(e){const t=r(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":s.has(t)?"csv":m.has(t)?"image":a.has(t)?"3d":null}function p(e){window.open(e,"_blank","noopener,noreferrer")}async function l(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const n=await fetch(e);if(!n.ok)throw new Error(`fetch failed: ${n.status}`);return n.text()}function h(e,t){return(e instanceof Error?e.message:"")||t}async function k(i,s,m={}){const a=n().attachment,k=i?.url||"",j=i?.filename||a.fallbackName;if(!k&&!m.fetchBlob)return void o.error(a.noLink);const f=u(j)??u(k);if("csv"===f){try{e({csv:await l(k,m,i),filename:j}),s("/spreadsheet")}catch{o.error(a.spreadsheetFailed),k&&p(k)}return}if(c.has(r(j)||r(k)))return o.error(a.workbookUnavailable),void(k&&p(k));if(!f)return k?(o.info(a.noViewer),void p(k)):void o.error(a.noLink);if(!m.fetchBlob)return t({url:k,filename:j,kind:f}),void s("/preview");const d=t({filename:j,kind:f,converting:!0,convertingMessage:m.loadingMessage||a.loading});s("/preview");try{const e=await m.fetchBlob(i);d.update({url:URL.createObjectURL(e),filename:j,kind:f})}catch(e){d.update({filename:j,kind:f,converting:!1,convertingMessage:h(e,a.loadFailed)})}}function j(e,t,o={}){const i=n().attachment,s=[];let m=-1;return e.forEach((e,n)=>{const a=e?.url||"";if(!a&&!o.fetchBlob)return;const p=e?.filename||i.fallbackName;if(c.has(r(p)||r(a)))return;const l=u(p)??u(a);l&&"csv"!==l&&(n===t&&(m=s.length),s.push({att:e,sourceIndex:n,filename:p,url:a,kind:l}))}),{items:s,start:m}}async function f(e,o,i,r={}){const{items:s,start:c}=j(e,o,r);if(c<0||s.length<2){const t=e[o];return void(t&&await k(t,i,r))}const m=n().attachment,a=s.length;let u=null,p=-1;const l=e=>({position:{index:e,count:a},onPrevious:e>0?()=>{d(e-1)}:void 0,onNext:e<a-1?()=>{d(e+1)}:void 0}),f=e=>{u?u.update(e):(u=t(e),i("/preview"))};async function d(e){p=e;const{att:t,filename:o,url:n,kind:i}=s[e];if(r.fetchBlob){f({filename:o,kind:i,converting:!0,convertingMessage:r.loadingMessage||m.loading,...l(e)});try{const n=await r.fetchBlob(t),s=URL.createObjectURL(n);if(p!==e)return void URL.revokeObjectURL(s);f({url:s,filename:o,kind:i,...l(e)})}catch(t){if(p!==e)return;f({filename:o,kind:i,converting:!1,convertingMessage:h(t,m.loadFailed),...l(e)})}}else f({url:n,filename:o,kind:i,...l(e)})}await d(c)}var d=i(()=>import("../Calculator-C7APPCLE.js")),w=i(()=>import("../Weather-NGQALCXO.js")),g=i(()=>import("../CurrencyConverter-VFTDSYQ3.js")),P=i(()=>import("../PomodoroTimer-AGSHX2JO.js")),v=i(()=>import("../Notepad-LNNSVEFG.js")),S=i(()=>import("../WorldClock-LX4BQPZJ.js")),T=i(()=>import("../Stock-NNDDNQBJ.js")),N=i(()=>import("../Preview-GDNUQKGN.js")),F=i(()=>import("../PdfViewer-ADPTYOAO.js")),E=i(()=>import("../Files-OAVWF6EW.js")),L=i(()=>import("../Browser-42QAXKYW.js")),b={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/notepad":{component:v,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:w,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:g,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:P,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:S,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:T,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},R={"/preview":{component:N,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/files":{component:E,label:"Files",size:"xl",appStyle:!0}},B={"/browser":{component:L,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},D={...b,...R,...B};export{L as Browser,d as Calculator,g as CurrencyConverter,E as Files,v as Notepad,F as PdfViewer,P as PomodoroTimer,N as Preview,T as Stock,w as Weather,S as WorldClock,u as attachmentKind,D as bundledApps,R as documentApps,k as openAttachment,f as openAttachments,b as utilityApps,j as viewableAttachments,B as webApps};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as e}from"module";import{extname as t,isAbsolute as r,join as s,resolve as n}from"path";import{readFileSync as i,existsSync as o,statSync as c,readdirSync as a,mkdtempSync as l,rmSync as d}from"fs";import{execFileSync as h}from"child_process";import{tmpdir as f}from"os";import u from"assert/strict";import{createServer as w}from"http";import{pathToFileURL as p}from"url";function m(t,r){for(const n of[s(process.cwd(),"package.json"),r])try{return e(n)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}var g=class extends Error{};var y="efficient-shell-browser-check",v=`${y}: run real-browser checks, one <name>.entry.tsx page and one <name>.check.mjs check per scenario.\n\n ${y} [--dir tests/browser] [--css <file>]... [--tailwind <entry.css>]... [--serve <urlPath>=<file>]... [--define KEY=JSON]...\n\n --dir <folder> the scenario folder (default tests/browser)\n --css <file> a stylesheet every page links, in the order given\n --tailwind <entry.css> a Tailwind entry, compiled with this repository's @tailwindcss/cli,\n linked like a --css sheet, in the order given\n --serve <urlPath>=<file> a file the page can fetch at urlPath (starts with /)\n --define KEY=JSON replace KEY in the bundle with the JSON value\n --version, --help\n\nesbuild and playwright come from this repository's devDependencies.\nBROWSER_SHARD=<i>/<n> runs one shard. Exits 1 when a check fails.`,b={".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".html":"text/html; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".pdf":"application/pdf",".wasm":"application/wasm",".woff2":"font/woff2",".glb":"model/gltf-binary"},$=class extends Error{};function x(e,t,n){const i=r(t)?t:s(e,t);if(!o(i)||!c(i).isFile())throw new $(`${n} ${t}: no such file`);return i}function E(e,t,r){return i(x(e,t,r))}async function j(e){const{dir:t,root:r=process.cwd(),esbuild:i,chromium:o,stylesheets:c=[],serve:l={},define:d={},shard:h,reactDir:f,out:m=e=>console.log(e),err:g=(...e)=>console.error(...e)}=e,y=a(t).filter(e=>e.endsWith(".entry.tsx")).map(e=>e.replace(/\.entry\.tsx$/,"")).sort();if(0===y.length)throw new Error(`no *.entry.tsx found in ${t}`);const v=function(e,t){if(!t)return e;const r=/^(\d+)\/(\d+)$/.exec(t);if(!r)throw new Error(`BROWSER_SHARD must look like 1/3, got ${JSON.stringify(t)}`);const[s,n]=[Number(r[1]),Number(r[2])];if(!(n>=1&&s>=1&&s<=n))throw new Error(`BROWSER_SHARD ${t} is out of range`);return e.filter((e,t)=>t%n===s-1)}(y,h);h&&m(`shard ${h}: ${v.length} of ${y.length} scenarios`);const b=c.map((e,t)=>`/styles-${t+1}.css`),$=new Map(Object.entries(l));c.forEach((e,t)=>$.set(b[t],{contentType:"text/css; charset=utf-8",body:e}));const x=await o.launch({headless:!0});let E=!1;try{for(const e of v){const{default:o,describe:c,viewport:a}=await(import(p(s(t,`${e}.check.mjs`)).href)),l=await i.build({entryPoints:[s(t,`${e}.entry.tsx`)],bundle:!0,write:!1,outdir:s(r,"node_modules",".cache","efficient-shell-browser"),entryNames:"bundle",format:"esm",platform:"browser",target:"chrome120",jsx:"automatic",define:d,logLevel:"warning",...f&&{alias:{react:s(n(f),"react"),"react-dom":s(n(f),"react-dom")}}}),h=l.outputFiles.find(e=>e.path.endsWith(".js")).text,y=l.outputFiles.find(e=>e.path.endsWith(".css"))?.text??null,v=w((e,t)=>{const r=e.url??"/";if("/bundle.js"===r)return t.writeHead(200,{"content-type":"text/javascript; charset=utf-8"}),void t.end(h);if("/bundle.css"===r&&null!==y)return t.writeHead(200,{"content-type":"text/css; charset=utf-8"}),void t.end(y);const s=$.get(r);if(s)return t.writeHead(200,{"content-type":s.contentType}),void t.end(s.body);t.writeHead(200,{"content-type":"text/html; charset=utf-8"}),t.end("<!doctype html><html><head>"+b.map(e=>`<link rel="stylesheet" href="${e}">`).join("")+(null!==y?'<link rel="stylesheet" href="/bundle.css">':"")+'</head><body><div id="root"></div><script type="module" src="/bundle.js"><\/script></body></html>')});await new Promise((e,t)=>{v.once("error",t),v.listen(0,"127.0.0.1",e)});const j=v.address();u.ok(j&&"object"==typeof j);const R=`http://127.0.0.1:${j.port}`,S=await x.newPage({viewport:a??{width:1280,height:720}}),k=(e="")=>S.goto(`${R}/${e}`,{waitUntil:"networkidle"});S.setDefaultTimeout(15e3);const O=[];S.on("pageerror",e=>O.push(e));try{await k(),await o(S,{pageErrors:O,baseUrl:R,open:k}),m(`✔ ${c??e}`)}catch(t){E=!0,g(`✖ ${c??e}`),g(t);for(const e of O)g(" page error:",e.message)}finally{await S.close(),await new Promise(e=>v.close(e))}}}finally{await x.close()}return!E}var R=import.meta.url;process.exitCode=await async function(e,n){let i;try{i=function(e,n,i){let o="tests/browser";const c=[],a={},l={};for(let r=0;r<e.length;r++){const s=e[r];if("--help"===s||"-h"===s)return"help";if("--version"===s||"-v"===s)return"version";const d=s.indexOf("="),h=s.startsWith("--")&&d>0?s.slice(0,d):s;if(!["--dir","--css","--tailwind","--serve","--define"].includes(h))throw new $(`unknown argument "${s}"`);let f;if(h!==s)f=s.slice(d+1);else{if(r+1>=e.length)throw new $(`${h} needs a value`);f=e[++r]}if("--dir"===h)o=f;else if("--css"===h)c.push(E(n,f,h).toString("utf8"));else if("--tailwind"===h){const e=x(n,f,h);try{c.push(i(e))}catch(e){if(e instanceof g)throw new $(e.message);throw e}}else if("--serve"===h){const e=f.indexOf("=");if(e<=0)throw new $(`--serve ${f}: expected <urlPath>=<file>`);const r=f.slice(0,e);if(!r.startsWith("/"))throw new $(`--serve ${f}: the URL path must start with /`);const s=f.slice(e+1);a[r]={contentType:b[t(s).toLowerCase()]??"application/octet-stream",body:E(n,s,h)}}else{const e=f.indexOf("=");if(e<=0)throw new $(`--define ${f}: expected KEY=JSON`);const t=f.slice(0,e),r=f.slice(e+1);try{JSON.parse(r)}catch{throw new $(`--define ${t}: ${JSON.stringify(r)} is not JSON (a string needs its quotes: KEY='"text"')`)}l[t]=r}}return{dir:r(o)?o:s(n,o),stylesheets:c,serve:a,define:l}}(e,n.cwd,n.compileTailwind)}catch(e){if(!(e instanceof $))throw e;return n.err(`${y}: ${e.message}\n\n${v}`),1}if("help"===i)return n.out(v),0;if("version"===i)return n.out(n.version),0;n.env.BROWSER_SHARD&&(i.shard=n.env.BROWSER_SHARD),n.env.REACT_DIR&&(i.reactDir=n.env.REACT_DIR),i.root=n.cwd;try{return await n.runLane(i)?0:1}catch(e){return n.err(`${y}: ${e instanceof Error?e.message:String(e)}`),1}}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),version:"
|
|
2
|
+
import{createRequire as e}from"module";import{extname as t,isAbsolute as r,join as s,resolve as n}from"path";import{readFileSync as i,existsSync as o,statSync as c,readdirSync as a,mkdtempSync as l,rmSync as d}from"fs";import{execFileSync as h}from"child_process";import{tmpdir as f}from"os";import u from"assert/strict";import{createServer as w}from"http";import{pathToFileURL as p}from"url";function m(t,r){for(const n of[s(process.cwd(),"package.json"),r])try{return e(n)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}var g=class extends Error{};var y="efficient-shell-browser-check",v=`${y}: run real-browser checks, one <name>.entry.tsx page and one <name>.check.mjs check per scenario.\n\n ${y} [--dir tests/browser] [--css <file>]... [--tailwind <entry.css>]... [--serve <urlPath>=<file>]... [--define KEY=JSON]...\n\n --dir <folder> the scenario folder (default tests/browser)\n --css <file> a stylesheet every page links, in the order given\n --tailwind <entry.css> a Tailwind entry, compiled with this repository's @tailwindcss/cli,\n linked like a --css sheet, in the order given\n --serve <urlPath>=<file> a file the page can fetch at urlPath (starts with /)\n --define KEY=JSON replace KEY in the bundle with the JSON value\n --version, --help\n\nesbuild and playwright come from this repository's devDependencies.\nBROWSER_SHARD=<i>/<n> runs one shard. Exits 1 when a check fails.`,b={".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".html":"text/html; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".pdf":"application/pdf",".wasm":"application/wasm",".woff2":"font/woff2",".glb":"model/gltf-binary"},$=class extends Error{};function x(e,t,n){const i=r(t)?t:s(e,t);if(!o(i)||!c(i).isFile())throw new $(`${n} ${t}: no such file`);return i}function E(e,t,r){return i(x(e,t,r))}async function j(e){const{dir:t,root:r=process.cwd(),esbuild:i,chromium:o,stylesheets:c=[],serve:l={},define:d={},shard:h,reactDir:f,out:m=e=>console.log(e),err:g=(...e)=>console.error(...e)}=e,y=a(t).filter(e=>e.endsWith(".entry.tsx")).map(e=>e.replace(/\.entry\.tsx$/,"")).sort();if(0===y.length)throw new Error(`no *.entry.tsx found in ${t}`);const v=function(e,t){if(!t)return e;const r=/^(\d+)\/(\d+)$/.exec(t);if(!r)throw new Error(`BROWSER_SHARD must look like 1/3, got ${JSON.stringify(t)}`);const[s,n]=[Number(r[1]),Number(r[2])];if(!(n>=1&&s>=1&&s<=n))throw new Error(`BROWSER_SHARD ${t} is out of range`);return e.filter((e,t)=>t%n===s-1)}(y,h);h&&m(`shard ${h}: ${v.length} of ${y.length} scenarios`);const b=c.map((e,t)=>`/styles-${t+1}.css`),$=new Map(Object.entries(l));c.forEach((e,t)=>$.set(b[t],{contentType:"text/css; charset=utf-8",body:e}));const x=await o.launch({headless:!0});let E=!1;try{for(const e of v){const{default:o,describe:c,viewport:a}=await(import(p(s(t,`${e}.check.mjs`)).href)),l=await i.build({entryPoints:[s(t,`${e}.entry.tsx`)],bundle:!0,write:!1,outdir:s(r,"node_modules",".cache","efficient-shell-browser"),entryNames:"bundle",format:"esm",platform:"browser",target:"chrome120",jsx:"automatic",define:d,logLevel:"warning",...f&&{alias:{react:s(n(f),"react"),"react-dom":s(n(f),"react-dom")}}}),h=l.outputFiles.find(e=>e.path.endsWith(".js")).text,y=l.outputFiles.find(e=>e.path.endsWith(".css"))?.text??null,v=w((e,t)=>{const r=e.url??"/";if("/bundle.js"===r)return t.writeHead(200,{"content-type":"text/javascript; charset=utf-8"}),void t.end(h);if("/bundle.css"===r&&null!==y)return t.writeHead(200,{"content-type":"text/css; charset=utf-8"}),void t.end(y);const s=$.get(r);if(s)return t.writeHead(200,{"content-type":s.contentType}),void t.end(s.body);t.writeHead(200,{"content-type":"text/html; charset=utf-8"}),t.end("<!doctype html><html><head>"+b.map(e=>`<link rel="stylesheet" href="${e}">`).join("")+(null!==y?'<link rel="stylesheet" href="/bundle.css">':"")+'</head><body><div id="root"></div><script type="module" src="/bundle.js"><\/script></body></html>')});await new Promise((e,t)=>{v.once("error",t),v.listen(0,"127.0.0.1",e)});const j=v.address();u.ok(j&&"object"==typeof j);const R=`http://127.0.0.1:${j.port}`,S=await x.newPage({viewport:a??{width:1280,height:720}}),k=(e="")=>S.goto(`${R}/${e}`,{waitUntil:"networkidle"});S.setDefaultTimeout(15e3);const O=[];S.on("pageerror",e=>O.push(e));try{await k(),await o(S,{pageErrors:O,baseUrl:R,open:k}),m(`✔ ${c??e}`)}catch(t){E=!0,g(`✖ ${c??e}`),g(t);for(const e of O)g(" page error:",e.message)}finally{await S.close(),await new Promise(e=>v.close(e))}}}finally{await x.close()}return!E}var R=import.meta.url;process.exitCode=await async function(e,n){let i;try{i=function(e,n,i){let o="tests/browser";const c=[],a={},l={};for(let r=0;r<e.length;r++){const s=e[r];if("--help"===s||"-h"===s)return"help";if("--version"===s||"-v"===s)return"version";const d=s.indexOf("="),h=s.startsWith("--")&&d>0?s.slice(0,d):s;if(!["--dir","--css","--tailwind","--serve","--define"].includes(h))throw new $(`unknown argument "${s}"`);let f;if(h!==s)f=s.slice(d+1);else{if(r+1>=e.length)throw new $(`${h} needs a value`);f=e[++r]}if("--dir"===h)o=f;else if("--css"===h)c.push(E(n,f,h).toString("utf8"));else if("--tailwind"===h){const e=x(n,f,h);try{c.push(i(e))}catch(e){if(e instanceof g)throw new $(e.message);throw e}}else if("--serve"===h){const e=f.indexOf("=");if(e<=0)throw new $(`--serve ${f}: expected <urlPath>=<file>`);const r=f.slice(0,e);if(!r.startsWith("/"))throw new $(`--serve ${f}: the URL path must start with /`);const s=f.slice(e+1);a[r]={contentType:b[t(s).toLowerCase()]??"application/octet-stream",body:E(n,s,h)}}else{const e=f.indexOf("=");if(e<=0)throw new $(`--define ${f}: expected KEY=JSON`);const t=f.slice(0,e),r=f.slice(e+1);try{JSON.parse(r)}catch{throw new $(`--define ${t}: ${JSON.stringify(r)} is not JSON (a string needs its quotes: KEY='"text"')`)}l[t]=r}}return{dir:r(o)?o:s(n,o),stylesheets:c,serve:a,define:l}}(e,n.cwd,n.compileTailwind)}catch(e){if(!(e instanceof $))throw e;return n.err(`${y}: ${e.message}\n\n${v}`),1}if("help"===i)return n.out(v),0;if("version"===i)return n.out(n.version),0;n.env.BROWSER_SHARD&&(i.shard=n.env.BROWSER_SHARD),n.env.REACT_DIR&&(i.reactDir=n.env.REACT_DIR),i.root=n.cwd;try{return await n.runLane(i)?0:1}catch(e){return n.err(`${y}: ${e instanceof Error?e.message:String(e)}`),1}}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),version:"15.2.0",compileTailwind:e=>function(e,t){if(!o(e)||!c(e).isFile())throw new g(`--tailwind ${e}: no such file`);const r=s(t,"node_modules",".bin","tailwindcss");if(!o(r))throw new g("--tailwind needs the Tailwind CLI: add @tailwindcss/cli to this repository's devDependencies");const n=l(s(f(),"browser-check-css-"));try{const o=s(n,"styles.css");return h(r,["-i",e,"-o",o],{cwd:t,stdio:["ignore","ignore","inherit"]}),i(o,"utf8")}finally{d(n,{recursive:!0,force:!0})}}(e,process.cwd()),runLane:e=>j({...e,esbuild:m("esbuild",R),chromium:m("playwright",R).chromium})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function g(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function d(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=g(t),o=[...new Set(t.map(d))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?c.has(e.name)||""===t&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(u)}var u=(e,n)=>e<n?-1:e>n?1:0;Object.keys({fast:120,base:160}).map(e=>`--motion-${e}`).join(", "),Object.keys({body:400,control:500,heading:600,figure:700}).map(e=>`--weight-${e}`).join(", "),Object.keys({hairline:1,strong:2,accent:4}).map(e=>`--border-${e}`).join(", "),[2,4,8,12,16,20,24,32,40,48].join("/");var p=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${p("top","left")}(?![\\w-])`,`(?<![\\w-])!?${p("\\[0_0\\]")}`].join("|"));var f=(...e)=>e.join(""),m="3xs|2xs|xs|sm|base|lg|xl|[2-9]xl";new RegExp(`(?<![\\w-])!?(?:${f("te","xt-")}(?:(?:${m})(?:\\/[\\w.()-]+)?|\\[(?:length:)?[\\d.]+(?:px|rem|em)\\])|${f("fo","nt-")}(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\\[\\d+\\]))(?![\\w-])`),new RegExp(`(?<![\\w-])${f("round","ed")}(?:-(?:full|sm|md|lg|xl|[23]xl|[trblse]|tl|tr|br|bl|\\([^)]*\\)|\\[[^\\]]*\\]))*(?![\\w-])`);new RegExp(`(?<![\\w-])${f("b","g-")}(?!(?:none|transparent|current|inherit|cover|contain|auto|fixed|local|scroll|center|top|bottom|left|right|repeat|no-repeat|clip|origin|blend|linear|radial|conic|gradient|position|size|image)(?![\\w]))[\\w\\[(#][^\\s'"\`]*`);var w=`${m}|left|center|right|justify|start|end|wrap|nowrap|balance|pretty|ellipsis|clip|transparent|current|inherit|shadow`;new RegExp(`(?<![\\w-])${f("te","xt-")}(?!(?:${w})(?![\\w]))(?!\\[[\\d.]+(?:px|rem|em)\\])(?!\\[length:)[\\w\\[(#][^\\s'"\`]*`),new RegExp(`(?<![\\w-])${f("p","[xs]?-")}(?:\\d|\\[|\\()`),new RegExp(`(?<![\\w-])${f("p","y-")}(?:0|px|0\\.5|\\[[0-3](?:\\.\\d+)?px\\])(?![\\w.-])`),new RegExp(`(?<![\\w-])${f("round","ed-full")}(?![\\w-])`),new RegExp(`(?<![\\w-])${f("te","xt-")}(?:xs|2xs|3xs|\\[(?:9|10|11|12)px\\])(?![\\w-])`),new RegExp(`(?<![\\w-])${f("p","y-")}`),new RegExp(`(?<![\\w-])!?(?:${f("dura","tion-")}|${f("del","ay-")})(?:\\d+|\\[[^\\]]+\\])(?![\\w-])|(?<![\\w-])!?${f("fo","nt-")}\\[\\d+\\](?![\\w-])|(?<![\\w-])!?${f("bor","der")}(?:-[xytrblse])?-\\[[\\d.]+px\\](?![\\w-])`,"g");var $={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set(($.busy?.words??[]).map(e=>e.toLowerCase()));var x=(...e)=>e.join("-");x("p[xytrblse]?",""),x("max","[wh]",""),x("h",""),x("w",""),x("[wh]",""),x("min","h","");var y=class extends Error{},b=new Set(["$schema","schema","include","exclude","allow"]),R=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var v="d3as2htf4hwbtr.cloudfront.net",k={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},j=Object.values(k),C=Object.freeze([...new Set([...j.flatMap(e=>e.hosts),v,...j.map(e=>e.bucket)])].sort()),A=new RegExp([...C.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function E(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(A)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var O="media-host-check.config.json",T="efficient-shell-media-host-check",P=`${T}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${T} check this repository; exits 1 on a finding\n ${T} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${O} in the current directory.`;function L(e,t,r){const o=[],s=g(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),c=[];for(const r of a)for(const o of E(e,r,i(n(t,r),"utf8")))c.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)c.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:a.length,findings:c.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(P),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${T}: unknown argument "${n}"\n\n${P}`),2;o=!0}const s=n(r.cwd,O);if(!t(s))return r.err(`${T}: no ${O} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!R(e))throw new y(`${n}: expected an object`);for(const n of Object.keys(e))b.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(S)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!(R(i)&&S(i.file)&&S(i.match)&&S(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new y(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),O);a=L(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${T}: ${e instanceof y||e instanceof SyntaxError?e.message:String(e)}`),2}const g=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!g,...a},null,2)),g?1:0;if(!g)return r.out(`${T}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${O}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${O}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"14.7.0"});
|
|
2
|
+
import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function g(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function d(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=g(t),o=[...new Set(t.map(d))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?c.has(e.name)||""===t&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(u)}var u=(e,n)=>e<n?-1:e>n?1:0;Object.keys({fast:120,base:160}).map(e=>`--motion-${e}`).join(", "),Object.keys({body:400,control:500,heading:600,figure:700}).map(e=>`--weight-${e}`).join(", "),Object.keys({hairline:1,strong:2,accent:4}).map(e=>`--border-${e}`).join(", "),[2,4,8,12,16,20,24,32,40,48].join("/");var p=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${p("top","left")}(?![\\w-])`,`(?<![\\w-])!?${p("\\[0_0\\]")}`].join("|"));var f=(...e)=>e.join(""),m="3xs|2xs|xs|sm|base|lg|xl|[2-9]xl";new RegExp(`(?<![\\w-])!?(?:${f("te","xt-")}(?:(?:${m})(?:\\/[\\w.()-]+)?|\\[(?:length:)?[\\d.]+(?:px|rem|em)\\])|${f("fo","nt-")}(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\\[\\d+\\]))(?![\\w-])`),new RegExp(`(?<![\\w-])${f("round","ed")}(?:-(?:full|sm|md|lg|xl|[23]xl|[trblse]|tl|tr|br|bl|\\([^)]*\\)|\\[[^\\]]*\\]))*(?![\\w-])`);new RegExp(`(?<![\\w-])${f("b","g-")}(?!(?:none|transparent|current|inherit|cover|contain|auto|fixed|local|scroll|center|top|bottom|left|right|repeat|no-repeat|clip|origin|blend|linear|radial|conic|gradient|position|size|image)(?![\\w]))[\\w\\[(#][^\\s'"\`]*`);var w=`${m}|left|center|right|justify|start|end|wrap|nowrap|balance|pretty|ellipsis|clip|transparent|current|inherit|shadow`;new RegExp(`(?<![\\w-])${f("te","xt-")}(?!(?:${w})(?![\\w]))(?!\\[[\\d.]+(?:px|rem|em)\\])(?!\\[length:)[\\w\\[(#][^\\s'"\`]*`),new RegExp(`(?<![\\w-])${f("p","[xs]?-")}(?:\\d|\\[|\\()`),new RegExp(`(?<![\\w-])${f("p","y-")}(?:0|px|0\\.5|\\[[0-3](?:\\.\\d+)?px\\])(?![\\w.-])`),new RegExp(`(?<![\\w-])${f("round","ed-full")}(?![\\w-])`),new RegExp(`(?<![\\w-])${f("te","xt-")}(?:xs|2xs|3xs|\\[(?:9|10|11|12)px\\])(?![\\w-])`),new RegExp(`(?<![\\w-])${f("p","y-")}`),new RegExp(`(?<![\\w-])!?(?:${f("dura","tion-")}|${f("del","ay-")})(?:\\d+|\\[[^\\]]+\\])(?![\\w-])|(?<![\\w-])!?${f("fo","nt-")}\\[\\d+\\](?![\\w-])|(?<![\\w-])!?${f("bor","der")}(?:-[xytrblse])?-\\[[\\d.]+px\\](?![\\w-])`,"g");var $={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set(($.busy?.words??[]).map(e=>e.toLowerCase()));var x=(...e)=>e.join("-");x("p[xytrblse]?",""),x("max","[wh]",""),x("h",""),x("w",""),x("[wh]",""),x("min","h","");var y=class extends Error{},b=new Set(["$schema","schema","include","exclude","allow"]),R=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var v="d3as2htf4hwbtr.cloudfront.net",k={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},j=Object.values(k),C=Object.freeze([...new Set([...j.flatMap(e=>e.hosts),v,...j.map(e=>e.bucket)])].sort()),A=new RegExp([...C.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function E(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(A)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var O="media-host-check.config.json",T="efficient-shell-media-host-check",P=`${T}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${T} check this repository; exits 1 on a finding\n ${T} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${O} in the current directory.`;function L(e,t,r){const o=[],s=g(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),c=[];for(const r of a)for(const o of E(e,r,i(n(t,r),"utf8")))c.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)c.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:a.length,findings:c.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(P),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${T}: unknown argument "${n}"\n\n${P}`),2;o=!0}const s=n(r.cwd,O);if(!t(s))return r.err(`${T}: no ${O} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!R(e))throw new y(`${n}: expected an object`);for(const n of Object.keys(e))b.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(S)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!(R(i)&&S(i.file)&&S(i.match)&&S(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new y(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),O);a=L(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${T}: ${e instanceof y||e instanceof SyntaxError?e.message:String(e)}`),2}const g=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!g,...a},null,2)),g?1:0;if(!g)return r.out(`${T}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${O}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${O}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"15.2.0"});
|