efficient-shell 4.168.0 → 4.171.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 +151 -1
- package/dist/{Browser-PZPREN6H.js → Browser-BW3EZ7B2.js} +14 -14
- package/dist/Calculator-VBK5NSMU.js +29 -0
- package/dist/ConfirmDialog-YRCG3W2T.js +1 -0
- package/dist/{CurrencyConverter-3BTIZ2LT.js → CurrencyConverter-IW6F7HW4.js} +6 -6
- package/dist/{Documents-YAOM3L47.js → Documents-VH3JXSSJ.js} +5 -5
- package/dist/{Files-2UHYDMLL.js → Files-R4ZA5MXU.js} +30 -30
- package/dist/{Notepad-OWL75AYX.js → Notepad-FOITSJJA.js} +10 -10
- package/dist/{PomodoroTimer-SCPEOG6W.js → PomodoroTimer-C4SVIFC6.js} +31 -31
- package/dist/{Preview-5R3QZSJU.js → Preview-5K6LK6WZ.js} +21 -21
- package/dist/{Sidebar-C5RXL72L.js → Sidebar-FDFNRXJU.js} +20 -20
- package/dist/Spreadsheet-CZC3QU2G.js +37 -0
- package/dist/{Stock-UGDIALNB.js → Stock-B4WWEBZH.js} +6 -6
- package/dist/{Weather-CR2MN5XF.js → Weather-TDB5AY23.js} +15 -15
- package/dist/{WorldClock-JBNJ7C7J.js → WorldClock-HYHDVPBV.js} +7 -7
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-JLPJBO7K.js → chunk-2UIKLYAI.js} +1 -1
- package/dist/{chunk-6MBERZOS.js → chunk-36QX6LOQ.js} +3 -3
- package/dist/{chunk-SOI4LR67.js → chunk-5G4QMZGJ.js} +3 -3
- package/dist/chunk-67ZUPDWG.js +1 -0
- package/dist/{chunk-PLX2N4N6.js → chunk-7YFAFXQG.js} +2 -2
- package/dist/{chunk-FVXBJGY5.js → chunk-AUKURHBZ.js} +3 -3
- package/dist/{chunk-A7Q4BCPI.js → chunk-CRI4UFBU.js} +5 -5
- package/dist/{chunk-M4DB7UBZ.js → chunk-ECFMRDUP.js} +1 -1
- package/dist/chunk-EXXHI5DO.js +12 -0
- package/dist/chunk-FWOPZB6I.js +1 -0
- package/dist/chunk-FWZUTHP5.js +112 -0
- package/dist/chunk-GKLJ2SYS.js +995 -0
- package/dist/{chunk-YWXYBJ5Y.js → chunk-HA2WG27U.js} +2 -2
- package/dist/{chunk-CUX4XGLS.js → chunk-HNXPIYRS.js} +1 -1
- package/dist/{chunk-QZG72OVX.js → chunk-NTCAZ6Y3.js} +1 -1
- package/dist/{chunk-N3ZXQE4M.js → chunk-PGVUO7GB.js} +5 -5
- package/dist/{chunk-XKHAP6N2.js → chunk-Y3UKUB7V.js} +8 -8
- package/dist/chunk-YKZHOXI4.js +2 -0
- package/dist/icons/efficient.d.ts +355 -0
- package/dist/icons/efficient.js +470 -0
- package/dist/icons/heroicons.d.ts +6 -0
- package/dist/icons/heroicons.js +1 -0
- package/dist/icons/index.d.ts +64 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons/lucide.d.ts +6 -0
- package/dist/icons/lucide.js +1 -0
- package/dist/{index-CbLbd__n.d.ts → index-Dq20bi8D.d.ts} +125 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +650 -645
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/registry-FHdUeVww.d.ts +71 -0
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +81 -0
- package/package.json +27 -1
- package/dist/Calculator-NXMUEH5D.js +0 -29
- package/dist/ConfirmDialog-ZDVMT74Y.js +0 -1
- package/dist/Spreadsheet-XT4HF7MQ.js +0 -37
- package/dist/chunk-7U3F53IG.js +0 -1
- package/dist/chunk-GVZLCY3B.js +0 -994
- package/dist/chunk-JYLI2WXW.js +0 -12
- package/dist/chunk-LW27IM3S.js +0 -112
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{EditableGrid as e}from"./chunk-PLX2N4N6.js";import"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-6MBERZOS.js";import{peekSpreadsheetPreviewStage as r,claimSpreadsheetPreviewStage as n,SPREADSHEET_PREVIEW_UPDATE_EVENT as o}from"./chunk-VTVSMRFX.js";import"./chunk-7U3F53IG.js";import{WindowTitle as a}from"./chunk-LW27IM3S.js";import"./chunk-A7Q4BCPI.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-JYLI2WXW.js";import"./chunk-6KO2U66R.js";import"./chunk-M4DB7UBZ.js";import"./chunk-N3ZXQE4M.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-NCQLGQYR.js";import"./chunk-D65T4H6J.js";import{useRef as l,useState as s,useEffect as c,useCallback as i}from"react";import{jsxs as u,jsx as d,Fragment as h}from"react/jsx-runtime";var m="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p=10,x=30;function g(e){return e<26?m[e]:m[Math.floor(e/26)-1]+m[e%26]}function y(e){return Array.from({length:e},(e,t)=>({key:`col_${t}`,title:g(t),width:100}))}function b(e,t){return Array.from({length:e},()=>Array(t).fill(""))}function f(e){return{id:crypto.randomUUID(),name:e,columns:y(p),data:b(x,p),cellStyles:{}}}function v(e){return e.split("\n").map(e=>{if(e.includes("\t"))return e.split("\t").map(e=>e.trim());const t=[];let r="",n=!1;for(const o of e)'"'!==o?","!==o||n?r+=o:(t.push(r.trim()),r=""):n=!n;return t.push(r.trim()),t}).filter(e=>e.some(e=>e.trim()))}function w(e,t){const r=v(e);if(0===r.length)return null;const n=Math.max(p,r.reduce((e,t)=>Math.max(e,t.length),0)),o=r.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));return{id:crypto.randomUUID(),name:t,columns:y(n),data:o,cellStyles:{}}}function k(){const m=l(null),g=l(void 0);void 0===g.current&&(g.current=r());const k=l(g.current?.data??null),N=(()=>{const e=g.current;if(!e)return null;const t=w(e.data.csv,"Sheet 1");if(!t)return null;return{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}})(),[C,S]=s(N?[N.sheet]:[f("Sheet 1")]),[j,M]=s(0),$=l([]),U=l(C),E=l(!1);c(()=>{E.current?E.current=!1:U.current!==C&&($.current.push(U.current),$.current.length>50&&$.current.shift()),U.current=C},[C]);const L=i(()=>{const e=$.current.pop();e&&(E.current=!0,S(e))},[]);c(()=>{const e=e=>{if(!m.current?.contains(document.activeElement)&&!m.current?.matches(":focus-within"))return;(e.ctrlKey||e.metaKey)&&!e.shiftKey&&("z"===e.key||"Z"===e.key)&&(e.preventDefault(),L())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[L]);const[A,D]=s(N?.title??"Untitled"),[R,B]=s(()=>g.current?.data.onEmail),F=i(e=>{const t=w(e.csv,"Sheet 1");t&&(S([t]),M(0),D(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),B(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(n(e),e.data!==k.current&&F(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&F(r.data)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)},[]);const[I,X]=s(!1),[O,Z]=s(null),[K,Q]=s(""),H=l(null),[P,W]=s("1"),[J,T]=s("10"),V=C[j]||C[0],z=V.data,Y=V.columns,G=V.cellStyles??{},[_,q]=s(null),[ee,te]=s(null),re=i(()=>{if(ee){const e=Math.min(ee.anchor.row,ee.end.row),t=Math.max(ee.anchor.row,ee.end.row),r=Math.min(ee.anchor.col,ee.end.col),n=Math.max(ee.anchor.col,ee.end.col),o=[];for(let a=e;a<=t;a++)for(let e=r;e<=n;e++)o.push({row:a,col:e});return o}return _?[_]:[]},[ee,_]),ne=i((e,t)=>{const r=re();0!==r.length&&S(n=>n.map((n,o)=>{if(o!==j)return n;const a={...n.cellStyles??{}},l=`${r[0].row}:${r[0].col}`,s=void 0!==t?t:!(a[l]??{})[e];for(const{row:t,col:n}of r){const r=`${t}:${n}`;a[r]={...a[r]??{},[e]:s}}return{...n,cellStyles:a}}))},[re,j]),oe=ee?{row:ee.anchor.row,col:ee.anchor.col}:_,ae=oe?G[`${oe.row}:${oe.col}`]??{}:{},le=!!oe,se=i(e=>{S(t=>t.map((t,r)=>r===j?{...t,...e}:t))},[j]),ce=i(e=>{const t=e.reduce((e,t)=>Math.max(e,t.length),0);t!==Y.length?se({data:e,columns:y(t)}):se({data:e})},[se,Y.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),Z(null)},ue=()=>z.filter(e=>e.some(e=>e.trim())).map(e=>e.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?`"${e.replace(/"/g,'""')}"`:e).join(",")).join("\n"),de=[];z.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=z.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
|
|
2
|
-
return u("div",{ref:m,className:"flex flex-col h-full",children:[
|
|
3
|
-
/* @__PURE__ */d(a,{title:`${me=A||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
|
|
4
|
-
/* @__PURE__ */d(t,{app:"spreadsheet"}),
|
|
5
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[I?/* @__PURE__ */d("input",{type:"text",value:A,onChange:e=>D(e.target.value),onBlur:()=>X(!1),onKeyDown:e=>{"Enter"===e.key&&X(!1)},autoFocus:!0,className:"text-sm font-medium text-gray-900 border border-gray-300 rounded px-2 py-0.5 w-40 focus:border-blue-500 focus:ring-blue-500"}):/* @__PURE__ */d("button",{onClick:()=>X(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:A||"Untitled"}),
|
|
6
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
7
|
-
/* @__PURE__ */d("input",{ref:H,type:"file",accept:".csv,.tsv,.txt,.xlsx,.xls,.ods",onChange:async e=>{const t=e.target.files?.[0];if(!t)return;const r=t.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");if(/\.(xlsx|xls|ods)$/i.test(t.name)){const e=new Uint8Array(await t.arrayBuffer()),n=await(import("xlsx")),o=n.read(e,{type:"array"}),a=o.SheetNames.map(e=>{const t=n.utils.sheet_to_json(o.Sheets[e],{header:1,defval:""}),r=Math.max(p,t.reduce((e,t)=>Math.max(e,t.length),0)),a=t.map(e=>{const t=e.map(e=>String(e??""));for(;t.length<r;)t.push("");return t});for(;a.length<x;)a.push(Array(r).fill(""));return{id:crypto.randomUUID(),name:e,columns:y(r),data:a}});S(a),M(0),D(r)}else{const e=v(await t.text());if(0===e.length)return;const n=Math.max(p,e.reduce((e,t)=>Math.max(e,t.length),0)),o=e.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));se({columns:y(n),data:o}),D(r)}H.current&&(H.current.value="")},className:"hidden"}),
|
|
8
|
-
/* @__PURE__ */d("button",{onClick:()=>H.current?.click(),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Open"}),
|
|
9
|
-
/* @__PURE__ */d("button",{onClick:()=>{const e=new Blob([ue()],{type:"text/csv"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`${A||"spreadsheet"}.csv`,r.click(),URL.revokeObjectURL(t)},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save CSV"}),R&&/* @__PURE__ */d("button",{onClick:()=>R(ue(),`${A||"spreadsheet"}.csv`),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Email"}),
|
|
10
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
11
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
|
|
12
|
-
/* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:P,onChange:e=>W(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
|
|
13
|
-
/* @__PURE__ */d("button",{onClick:()=>(e=>{const t=Y.length+e;se({columns:y(t),data:z.map(t=>[...t,...Array(e).fill("")])})})(parseInt(P)||1),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Col"})]}),
|
|
14
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
|
|
15
|
-
/* @__PURE__ */d("input",{type:"number",min:"1",max:"500",value:J,onChange:e=>T(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
|
|
16
|
-
/* @__PURE__ */d("button",{onClick:()=>{return e=parseInt(J)||10,void se({data:[...z,...Array.from({length:e},()=>Array(Y.length).fill(""))]});var e},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Row"})]}),
|
|
17
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
18
|
-
/* @__PURE__ */d("button",{onClick:()=>{se({columns:y(p),data:b(x,p)})},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Clear"}),
|
|
19
|
-
/* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
|
|
20
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5",title:le?"":"Click a cell first",children:[
|
|
21
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("bold"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors font-bold ${ae.bold?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"B"}),
|
|
22
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("italic"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors italic ${ae.italic?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"I"}),
|
|
23
|
-
/* @__PURE__ */d("button",{onClick:()=>ne("underline"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors underline ${ae.underline?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"U"}),
|
|
24
|
-
/* @__PURE__ */u("select",{value:ae.fontSize??"base",onChange:e=>ne("fontSize",e.target.value),disabled:!le,className:"ml-1 text-xs border border-gray-300 rounded px-1 py-0.5 bg-white disabled:opacity-40 disabled:cursor-not-allowed",children:[
|
|
25
|
-
/* @__PURE__ */d("option",{value:"sm",children:"XS"}),
|
|
26
|
-
/* @__PURE__ */d("option",{value:"base",children:"S"}),
|
|
27
|
-
/* @__PURE__ */d("option",{value:"lg",children:"M"}),
|
|
28
|
-
/* @__PURE__ */d("option",{value:"xl",children:"L"})]})]})]}),
|
|
29
|
-
/* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(e,{columns:Y,data:z,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:G,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
|
|
30
|
-
/* @__PURE__ */u("div",{className:"flex items-center border-t border-gray-200 bg-gray-50 shrink-0",children:[
|
|
31
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5 px-1 py-1 overflow-x-auto flex-1 min-w-0",children:[C.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>M(t),onDoubleClick:()=>{Z(t),Q(e.name)},onContextMenu:e=>{e.preventDefault(),C.length>1&&(e=>{C.length<=1||(S(t=>t.filter((t,r)=>r!==e)),j>=e&&j>0&&M(j-1))})(t)},className:"px-3 py-1 text-xs font-medium rounded-b whitespace-nowrap transition-colors "+(t===j?"bg-white text-blue-700 border border-t-0 border-gray-300 -mt-px relative z-10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:O===t?/* @__PURE__ */d("input",{type:"text",value:K,onChange:e=>Q(e.target.value),onBlur:()=>ie(t,K||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,K||e.name),"Escape"===r.key&&Z(null)},onClick:e=>e.stopPropagation(),autoFocus:!0,className:"w-20 text-xs border border-blue-400 rounded px-1 py-0 focus:ring-0 focus:outline-none"}):e.name},e.id)),
|
|
32
|
-
/* @__PURE__ */d("button",{onClick:()=>{const e=`Sheet ${C.length+1}`;S(t=>[...t,f(e)]),M(C.length)},className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded",title:"Add sheet",children:"+"})]}),
|
|
33
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-4 px-3 py-1 text-xs text-gray-500 shrink-0 border-l border-gray-200",children:[
|
|
34
|
-
/* @__PURE__ */u("span",{children:[he," cells"]}),de.length>0&&/* @__PURE__ */u(h,{children:[
|
|
35
|
-
/* @__PURE__ */u("span",{children:["Sum: ",de.reduce((e,t)=>e+t,0).toLocaleString(void 0,{maximumFractionDigits:2})]}),
|
|
36
|
-
/* @__PURE__ */u("span",{children:["Avg: ",(de.reduce((e,t)=>e+t,0)/de.length).toLocaleString(void 0,{maximumFractionDigits:2})]})]}),
|
|
37
|
-
/* @__PURE__ */u("span",{children:[z.length," × ",Y.length]})]})]})]});var me}export{k as default};
|
package/dist/chunk-7U3F53IG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="4.168.0",a=r;export{a as APP_VERSION,r as VERSION};
|