efficient-shell 7.21.1 → 7.23.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 +47 -0
- package/dist/{Browser-XPRHVZJS.js → Browser-GSPJTRX3.js} +15 -15
- package/dist/Calculator-S4SULQZG.js +29 -0
- package/dist/ConfirmDialog-TGAPFTMU.js +1 -0
- package/dist/CurrencyConverter-6A5U4LH3.js +21 -0
- package/dist/Documents-LUEBMB23.js +52 -0
- package/dist/Files-SPFE23UK.js +87 -0
- package/dist/Notepad-D3QV7R6T.js +25 -0
- package/dist/PdfViewer-2OHHAS7B.js +1 -0
- package/dist/PomodoroTimer-F7BGUOY2.js +91 -0
- package/dist/Preview-5JLBKQWH.js +179 -0
- package/dist/Sidebar-PU6MUQEQ.js +44 -0
- package/dist/Spreadsheet-3F5P5SC2.js +37 -0
- package/dist/{Stock-44LXLO2A.js → Stock-EC62JSPA.js} +2 -2
- package/dist/Weather-VHHULAGC.js +60 -0
- package/dist/WorldClock-AM54TQZB.js +32 -0
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/chunk-43KURNHH.js +1 -0
- package/dist/{chunk-2QC3VXCS.js → chunk-6CC3IJ7Y.js} +1 -1
- package/dist/{chunk-M4TRVJTO.js → chunk-75BDNIYU.js} +1 -1
- package/dist/{chunk-GIWC2ZTG.js → chunk-AW7GP54G.js} +4 -4
- package/dist/{chunk-ZGUQLVY4.js → chunk-B427NVDP.js} +28 -12
- package/dist/chunk-BSCGC2HA.js +1 -0
- package/dist/{chunk-JQRIAZDP.js → chunk-CZZYMC7P.js} +17 -17
- package/dist/{chunk-2GJNH4XW.js → chunk-D5CGXUQK.js} +51 -51
- package/dist/{chunk-RN3NG35J.js → chunk-E64SHLPT.js} +1 -1
- package/dist/{chunk-ITCBLL72.js → chunk-EEXHZUG5.js} +2 -2
- package/dist/{chunk-RUHUTZN4.js → chunk-G6LV5Z2W.js} +1 -1
- package/dist/{chunk-IQDY2YFN.js → chunk-GNW45MGV.js} +10 -10
- package/dist/{chunk-RBKIYZ7H.js → chunk-ISEM2MNY.js} +1 -1
- package/dist/{chunk-BVYOUFSW.js → chunk-ISN4DJJ7.js} +8 -8
- package/dist/{chunk-SCJT2XXU.js → chunk-JI2JL7ZQ.js} +1 -1
- package/dist/chunk-K7PQXJO7.js +1 -0
- package/dist/chunk-MMHI7WBL.js +24 -0
- package/dist/{chunk-GNCH3JEH.js → chunk-MUDY7BV4.js} +7 -7
- package/dist/{chunk-7HLTPMQV.js → chunk-MZHH3MC7.js} +1 -1
- package/dist/{chunk-XM2IIPJO.js → chunk-NKMK6WRI.js} +1 -1
- package/dist/chunk-NVFKXL52.js +2 -0
- package/dist/chunk-ODGCVNYP.js +10 -0
- package/dist/{chunk-JUISSKJW.js → chunk-R3IJQGAB.js} +1 -1
- package/dist/{chunk-VOFDPOB6.js → chunk-RVPQRXC4.js} +1 -1
- package/dist/{chunk-IJ7RXIWX.js → chunk-SZTKBF3D.js} +8 -8
- package/dist/{chunk-KBOYLXAT.js → chunk-TTUVL25O.js} +1 -1
- package/dist/{chunk-76VCH7N6.js → chunk-U5H3Q5JM.js} +19 -19
- package/dist/{chunk-Z2TTHY7G.js → chunk-UQOFRZMX.js} +1 -1
- package/dist/chunk-VKCLCFEE.js +1034 -0
- package/dist/{chunk-B4PGVDB6.js → chunk-W77WLTTH.js} +1 -1
- package/dist/{chunk-XN7CAWSZ.js → chunk-Y6UUDJNU.js} +2 -2
- package/dist/chunk-YJRAJD27.js +27 -0
- package/dist/file-intake/index.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/icons/efficient-looks.js +189 -177
- package/dist/icons/efficient.d.ts +16 -1
- package/dist/icons/efficient.js +92 -86
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/{index-DbNqOkOy.d.ts → index-91i1XDHz.d.ts} +82 -8
- package/dist/index.d.ts +3 -3
- package/dist/index.js +631 -631
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +8 -8
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/{strings-BQtq9300.d.ts → strings-D9AIYTbE.d.ts} +28 -2
- package/dist/telemetry/index.js +1 -1
- package/dist/themes.css +20 -20
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +122 -7
- package/package.json +1 -1
- package/dist/Calculator-BLKI5RDH.js +0 -29
- package/dist/ConfirmDialog-AVFQGXKL.js +0 -1
- package/dist/CurrencyConverter-MELIA5ZN.js +0 -21
- package/dist/Documents-BC5M2PBJ.js +0 -52
- package/dist/Files-AOQNEOZ7.js +0 -87
- package/dist/Notepad-DWVT66EF.js +0 -25
- package/dist/PdfViewer-PHABUM7K.js +0 -1
- package/dist/PomodoroTimer-RHJHTLSU.js +0 -91
- package/dist/Preview-7LYC662F.js +0 -182
- package/dist/Sidebar-PYURV2S2.js +0 -44
- package/dist/Spreadsheet-PDA4JIJ6.js +0 -37
- package/dist/Weather-TCGDUHYK.js +0 -60
- package/dist/WorldClock-GIRESICQ.js +0 -32
- package/dist/chunk-BQ7GR7H6.js +0 -27
- package/dist/chunk-FTJ2G343.js +0 -24
- package/dist/chunk-G3WYQP4R.js +0 -1027
- package/dist/chunk-IDJPDSA3.js +0 -1
- package/dist/chunk-JTNKC4CR.js +0 -1
- package/dist/chunk-QRCDQPJA.js +0 -1
- package/dist/chunk-ZRU5F2XT.js +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-
|
|
1
|
+
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-G6LV5Z2W.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-DSSLOQDW.js";import{Icon as t}from"./chunk-
|
|
1
|
+
import{navIcons as e}from"./chunk-DSSLOQDW.js";import{Icon as t}from"./chunk-B427NVDP.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},s={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
|
|
2
2
|
return o(t,{name:"folder",look:"solid",className:e})}function u(t,r){return r&&e[r]||(t?e[t]:void 0)}var m=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function h({entityType:e,isSelected:t,entityId:l,label:h,fileKind:w}){const g="preview-file"===e&&w,y=g?f[w]:null,x=g?c[w]:null;if("folder"===e)/* @__PURE__ */
|
|
3
3
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o(p,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=u(l,h),i=a(l||h||"page");/* @__PURE__ */
|
|
4
4
|
return o("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&r(e)?n(e,{className:"h-7 w-7 text-white"}):m})})}/* @__PURE__ */
|
|
@@ -10,4 +10,4 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
|
|
|
10
10
|
/* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${y??d[e]??"text-gray-600"}`,children:x??s[e]??e.slice(0,3).toUpperCase()})]})}function w({item:e}){if("folder"===e.entityType)/* @__PURE__ */
|
|
11
11
|
return o(p,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=u(e.entityId,e.label);/* @__PURE__ */
|
|
12
12
|
return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${a(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&r(t)?n(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?f[e.fileKind]:d[e.entityType])??"text-gray-400";/* @__PURE__ */
|
|
13
|
-
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",j="react-os-shell:files-open-desktop-folder";function C(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function S(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(j,{detail:{folderId:e}})))}function I(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function
|
|
13
|
+
return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",j="react-os-shell:files-open-desktop-folder";function C(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function S(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(j,{detail:{folderId:e}})))}function I(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function P(){const e=I();return"undefined"!=typeof window&&(window[k]=null),e}export{w as DesktopItemMiniIcon,j as FILES_OPEN_DESKTOP_FOLDER_EVENT,N as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,P as consumeFilesViewRequest,g as desktopItemTypeLabel,_ as getDesktopFoldersSnapshot,I as peekFilesViewRequest,b as publishDesktopFolders,S as requestFilesDesktopFolderView,C as requestFilesTrashView,v as subscribeDesktopFolders};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{LoadingSpinner as a}from"./chunk-NVFKXL52.js";import{useDismissPopupsOnOpen as l}from"./chunk-UVBK6YSR.js";import{glassStyle as o}from"./chunk-7IQ3B77H.js";import{Z_LAYERS as s}from"./chunk-FIEA5CGB.js";import{useShellStrings as i}from"./chunk-BSCGC2HA.js";import{useState as c,useEffect as d,useRef as u,useMemo as p,useId as y,useCallback as f}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{createPortal as b}from"react-dom";var g={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function k(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function x(e,t,n){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===n?"plate-dark":"bare":"dark"===n?"plate-light":"bare"}var v={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function w(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function N({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:i,width:u,height:p,decorative:y=!1,fallbackMode:f="monogram",adaptive:h=!1,hasAlpha:b=null,isLight:N=null,treatmentPadding:L=4,treatmentRadius:_=8,className:A="",style:C}){const[$,E]=c(e||t||"");d(()=>{E(e||t||"")},[e,t]);const I=Boolean(t&&$===t&&$!==e),T=(I?a??h:h)?x(I?n:b,I?r:N,s):"bare",j=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==i&&null==u&&null==p?g[o]:"","dark"===s?"text-white":"text-gray-700",v[T],A].filter(Boolean).join(" "),S={...w(T,_,L),...null==i?{width:u,height:p}:{width:i,height:i},...C};return $?/* @__PURE__ */m("span",{className:j,"data-brand-treatment":T,style:S,children:/* @__PURE__ */m("img",{src:$,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>E(e=>t&&e!==t?t:"")})}):"none"===f?null:/* @__PURE__ */m("span",{"data-brand-fallback":!0,"data-brand-slot":o,"aria-label":y?void 0:l,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${j} rounded-md bg-gray-100 font-semibold`,style:S,children:y?null:k(l)})}function L(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function _(e,r){return n(e,r).filter(e=>t(e,r))}function A(n,a,l){const o=new Set(a.erp),s=new Set(a.system),i=new Set(a.footer??[]),c=n.filter(r),d=e=>c.filter(t=>e.has(t.label)&&L(t,l).length>0);return{topItems:n.filter(e=>!r(e)).filter(n=>e(n,l)&&t(n,l)),erpSections:d(o),systemSections:d(s),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(n=>e(n,l)&&t(n,l))}}function C(e,t,n){return!!t&&e.some(e=>e.to===t||C(_(e,n),t,n))}var $="__page__";function E(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const n=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:n.get("search")??""}}function I(e,t,n){const r=function(e,t){const n=[],r=e=>{const a=_(e,t);0===a.length?n.push(e):a.forEach(r)};e.topItems.forEach(r);for(const n of[...e.erpSections,...e.systemSections,...e.footerSections])L(n,t).forEach(r);for(const t of e.virtualSections)t.items.forEach(r);return e.footerItems.forEach(r),n}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,l=[];for(const e of r){const r=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!r.toLowerCase().includes(t)||(a.add(e.to),l.push({type:n,label:e.label,entity_type:$,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function T(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||"string"!=typeof r.entityType||"string"!=typeof r.entityId||"string"!=typeof r.label)continue;if("preview-file"===r.entityType)continue;const e="page"===r.entityType;n.push({type:e?t:"",label:r.label,entity_type:e?$:r.entityType,entity_id:r.entityId})}return n}var j="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function S(e){return e.typeKey??e.type}function M(e,t){return t?.[S(e)]??e.type}function K(e,t,n){return 0===n.length?null:{key:e,title:t,rows:n.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:n.length}}function R(e,t,n,r){return{type:e,label:t,entity_type:$,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function B(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=S(n),r=t.get(e);r?r.results.push(n):t.set(e,{type:n.type,results:[n]})}return Array.from(t,([e,t])=>({key:e,...t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.key}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.key),l=r?a?.listRoutes?.[e.key]:void 0,o=a?.typeLabels?.[e.key]??e.type;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.key}`,label:r,result:R(o,r,l.path,n)})}return{key:`type:${e.key}`,title:o,rows:t,count:e.results.length,truncated:r}}),o=K("actions",r,function(e,t){const n=t.trim().toLowerCase();return e&&n?e.filter(e=>e.label.toLowerCase().includes(n)||(e.keywords??[]).some(e=>e.toLowerCase().includes(n))):[]}(t,n));return o?[...l,o]:l}function D(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var P=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function z(e,t,n=8){return[t,...e.filter(e=>!P(e,t))].slice(0,n)}function H(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e=n;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const r={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(r.sub=e.sub),"string"==typeof e.typeKey&&(r.typeKey=e.typeKey),t.some(e=>P(e,r))||t.push(r)}return t.slice(0,8)}function F(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:n}=e;return{results:t,truncatedTypes:Array.isArray(n)?n:[]}}return{results:[],truncatedTypes:[]}}var U=[];function G(e,t,n){const[r,a]=c([]),[l,o]=c(U),[s,i]=c(!1),[p,y]=c("none"),m=u(function(){let e=0,t=null;const n=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{n();const r=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>r===e}},cancel:n}}());d(()=>{const r=m.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(U),y("none"),void i(!1);i(!0);const l=setTimeout(async()=>{const n=r.begin(),l=await async function(e,t,n){const r=await Promise.all(e.map(async e=>{try{return{failed:!1,...F(await e(t,{signal:n}))}}catch(e){const t=n.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:n}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===n}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:r.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(r.flatMap(e=>e.truncatedTypes))),failed:r.filter(e=>e.failed).length}}(t,e,n.signal);n.isCurrent()&&(a(l.results),o(l.truncatedTypes),y(0===l.failed?"none":l.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:p,reset:f(()=>{m.current.cancel(),a(e=>0===e.length?e:[]),o(U),y("none"),i(!1)},[])}}var V=(e,t)=>`${e}-opt-${t}`;function W(e,t){if("seeAll"===e.kind)return"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3";if("action"===e.kind)return e.icon??j;if(e.icon)return e.icon;const n=t?.[S(e.result)];return n||j}function X({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
|
+
return m("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */h("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
|
|
3
|
+
/* @__PURE__ */h("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
4
|
+
/* @__PURE__ */m("span",{children:e.title}),
|
|
5
|
+
/* @__PURE__ */m("span",{className:"font-medium normal-case tracking-normal",children:l(e.count,!!e.truncated)})]}),e.rows.map(e=>{const r=c++,l=r===t,o="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
|
|
6
|
+
return h("div",{id:V(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(l?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>s(r),children:[
|
|
7
|
+
/* @__PURE__ */m("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:W(e,a)})}),
|
|
8
|
+
/* @__PURE__ */h("div",{className:"flex-1 min-w-0",children:[
|
|
9
|
+
/* @__PURE__ */m("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */m("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */m("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var O="react-os-shell:open-global-search";function q(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(O))}function Q({providers:e,typeIcons:t,typeLabels:n,listRoutes:r,placeholder:g,quickActions:k,onSelect:x,recent:v,onRecord:w,favorites:N,hotkey:L=!0}={}){const _=i().search,A=g??_.placeholder,[C,$]=c(!1),[E,I]=c(""),[T,S]=c(0),R=u(null),{results:P,truncatedTypes:z,loading:H,failure:F,reset:U}=G(E,e,2);d(()=>{const e=e=>{L&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),$(e=>!e)),"Escape"===e.key&&C&&$(!1)},t=()=>$(!0);return window.addEventListener("keydown",e),window.addEventListener(O,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(O,t)}},[C,L]),l(C);const[W,q]=c(!1);C!==W&&(q(C),C&&(I(""),S(0),U())),d(()=>{C?setTimeout(()=>R.current?.focus(),50):I("")},[C]),d(()=>{S(0)},[P]);const Q=E.length>=2,Y=p(()=>Q?B(P,k,E,_.actions,{truncatedTypes:z,listRoutes:r,typeLabels:n,seeAllLabel:_.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((t,n)=>({kind:"recent",key:`recent:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,badge:M(t,e.typeLabels),result:t})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((t,n)=>({kind:"favorite",key:`favorite:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,badge:M(t,e.typeLabels)||void 0,icon:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",result:t})),count:e.favorites.length});const r=K("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:v,favorites:N,actions:k,typeLabels:n},_),[Q,P,z,r,n,k,E,v,N,_]),J=p(()=>function(e){return e.flatMap(e=>e.rows)}(Y),[Y]),Z=Math.min(T,Math.max(J.length-1,0)),ee=y(),te=J.length>0;d(()=>{C&&0!==J.length&&document.getElementById(V(ee,Z))?.scrollIntoView?.({block:"nearest"})},[C,Z,J.length,ee]);const ne=f(e=>{$(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||w?.(e.result),x?.(e.result)):e.action.onSelect()},[x,w]);return C?b(
|
|
10
|
+
/* @__PURE__ */h("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:s.overlay},onClick:()=>$(!1),children:[
|
|
11
|
+
/* @__PURE__ */m("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
|
+
/* @__PURE__ */h("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:o(),children:[
|
|
13
|
+
/* @__PURE__ */h("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
|
|
14
|
+
/* @__PURE__ */m("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:j})}),
|
|
15
|
+
/* @__PURE__ */m("input",{ref:R,type:"text",value:E,onChange:e=>{I(e.target.value),S(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),S(D(Z,1,J.length))):"ArrowUp"===e.key?(e.preventDefault(),S(D(Z,-1,J.length))):"Tab"===e.key&&J.length>0?(e.preventDefault(),S(function(e,t,n){const r=e.length;if(0===r)return 0;const a=[];let l=0;for(const t of e)a.push(l),l+=t;let o=0;for(let e=0;e<r;e++)t>=a[e]&&(o=e);return a[(o+n+r)%r]}(Y.map(e=>e.rows.length),Z,e.shiftKey?-1:1))):"Enter"===e.key&&J[Z]&&ne(J[Z])},placeholder:A,role:"combobox","aria-expanded":te,"aria-controls":te?ee:void 0,"aria-activedescendant":te?V(ee,Z):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),H&&/* @__PURE__ */m("span",{"data-global-search-spinner":"",role:"status","aria-label":_.searching,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"}),
|
|
16
|
+
/* @__PURE__ */m("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-2 py-0.5 text-2xs font-medium text-gray-400",children:_.escBadge})]}),
|
|
17
|
+
/* @__PURE__ */h("div",{className:"max-h-[50vh] overflow-y-auto",children:[H&&0===J.length&&/* @__PURE__ */m(a,{size:"sm",padding:"py-6",label:_.searching}),!H&&"all"===F&&Q&&/* @__PURE__ */m("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:_.searchFailed}),!H&&Q&&0===J.length&&"all"!==F&&/* @__PURE__ */m("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:_.noResults}),te&&/* @__PURE__ */m(X,{sections:Y,activeIdx:Z,listId:ee,label:_.listLabel,typeIcons:t,groupCount:_.groupCount,groupLabel:_.groupLabel,onHover:S,onPick:ne}),!H&&"some"===F&&Q&&/* @__PURE__ */m("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:_.partialFailure}),!H&&!Q&&0===J.length&&/* @__PURE__ */m("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:_.minChars(2)})]}),
|
|
18
|
+
/* @__PURE__ */h("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-2xs text-gray-400",children:[
|
|
19
|
+
/* @__PURE__ */h("div",{className:"flex items-center gap-3",children:[
|
|
20
|
+
/* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
|
|
21
|
+
/* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
|
|
22
|
+
/* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${_.navigate}`]}),
|
|
23
|
+
/* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
|
|
24
|
+
/* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:_.enterKey}),` ${_.open}`]}),Y.length>1&&/* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
|
|
25
|
+
/* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:_.tabKey}),` ${_.nextGroup}`]})]}),
|
|
26
|
+
/* @__PURE__ */h("span",{className:"flex items-center gap-1",children:[
|
|
27
|
+
/* @__PURE__ */m("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:_.escKey}),` ${_.close}`]})]})]})]}),document.body):null}export{N as BrandMark,Q as GlobalSearch,$ as PAGE_RESULT_ENTITY,T as favoritesToResults,I as navPagesProvider,q as openGlobalSearch,E as parsePageResultTarget,A as partitionNav,z as pushRecent,x as resolveBrandMarkTreatment,C as rowsContainRoute,H as sanitizeRecent,_ as visibleNavChildren,L as visibleSectionItems};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-
|
|
2
|
+
export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-75BDNIYU.js";import"../chunk-BSCGC2HA.js";import"../chunk-C3QOHMR6.js";
|
package/dist/i18n/index.d.ts
CHANGED