opfs-finder 0.1.1 → 0.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 +28 -4
- package/package.json +4 -1
- package/dist/const.d.ts +0 -34
- package/dist/const.d.ts.map +0 -1
- package/dist/index.cjs +0 -5
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +0 -1
- package/dist/style.d.ts +0 -55
- package/dist/style.d.ts.map +0 -1
- package/dist/types.d.ts +0 -88
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/api.d.ts +0 -8
- package/dist/utils/api.d.ts.map +0 -1
- package/dist/utils/hex.d.ts +0 -3
- package/dist/utils/hex.d.ts.map +0 -1
- package/dist/utils/jsx.d.ts +0 -17
- package/dist/utils/jsx.d.ts.map +0 -1
- package/dist/utils/node.d.ts +0 -18
- package/dist/utils/node.d.ts.map +0 -1
- package/dist/utils/opfs.d.ts +0 -24
- package/dist/utils/opfs.d.ts.map +0 -1
- package/dist/utils/path.d.ts +0 -16
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/utils.d.ts +0 -30
- package/dist/utils/utils.d.ts.map +0 -1
- package/dist/utils/viewer.d.ts +0 -7
- package/dist/utils/viewer.d.ts.map +0 -1
- package/dist/view.d.ts +0 -5
- package/dist/view.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img width="128px" src="https://opfs-finder.tsei.jp/opfs.webp">
|
|
5
5
|
</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/opfs-finder">
|
|
8
|
+
<img
|
|
9
|
+
src="https://img.shields.io/npm/v/opfs-finder?style=for-the-badge&colorA=5EACED&colorB=E6E3E4"
|
|
10
|
+
alt="npm version"
|
|
11
|
+
/>
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://www.npmtrends.com/opfs-finder">
|
|
14
|
+
<img
|
|
15
|
+
src="https://img.shields.io/npm/dy/opfs-finder.svg?style=for-the-badge&colorA=5EACED&colorB=E6E3E4"
|
|
16
|
+
alt="downloads"
|
|
17
|
+
/>
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://github.com/tseijp/opfs-finder">
|
|
20
|
+
<img
|
|
21
|
+
src="https://img.shields.io/npm/l/opfs-finder?style=for-the-badge&colorA=5EACED&colorB=E6E3E4"
|
|
22
|
+
alt="license MIT"
|
|
23
|
+
/>
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://opfs-finder.tsei.jp/">
|
|
26
|
+
<img
|
|
27
|
+
src="https://img.shields.io/badge/docs-available-000.svg?style=for-the-badge&colorA=5EACED&colorB=E6E3E4"
|
|
28
|
+
alt="docs available"
|
|
29
|
+
/>
|
|
30
|
+
</a>
|
|
31
|
+
</p>
|
|
6
32
|
|
|
7
33
|
## Installation
|
|
8
34
|
|
|
@@ -15,13 +41,11 @@ opfs-finder can be installed not only from [Chrome Web Store][cws], but also as
|
|
|
15
41
|
|
|
16
42
|
To install opfs-finder chrome extension, open [here][cws] and install it.
|
|
17
43
|
|
|
18
|
-
**[OPFS Finder - Chrome Web Store][3]**
|
|
19
|
-
|
|
20
44
|
### Manual installation
|
|
21
45
|
|
|
22
46
|
1. install opfs-finder library from npm
|
|
23
47
|
|
|
24
|
-
```
|
|
48
|
+
```tsx
|
|
25
49
|
pnpm install opfs-finder
|
|
26
50
|
```
|
|
27
51
|
|
|
@@ -31,7 +55,7 @@ pnpm install opfs-finder
|
|
|
31
55
|
```tsx
|
|
32
56
|
import { finder } from "opfs-finder"
|
|
33
57
|
|
|
34
|
-
<button onClick={finder}>
|
|
58
|
+
<button onClick={() => finder()}>
|
|
35
59
|
Open Finder Panel window
|
|
36
60
|
</button>
|
|
37
61
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opfs-finder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"author": "tseijp",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
],
|
|
78
78
|
"scripts": {
|
|
79
79
|
"dev": "vite",
|
|
80
|
+
"font": "node --experimental-strip-types lib/fonts/build.ts",
|
|
80
81
|
"tsup": "tsup && tsc -p tsconfig.lib.json",
|
|
81
82
|
"build": "tsc --noEmit && vite build",
|
|
82
83
|
"ls": "npm publish --dry-run",
|
|
@@ -85,6 +86,8 @@
|
|
|
85
86
|
"devDependencies": {
|
|
86
87
|
"@types/markdown-it": "^14.1.2",
|
|
87
88
|
"markdown-it": "^14.2.0",
|
|
89
|
+
"prism-react-renderer": "2.4.1",
|
|
90
|
+
"subset-font": "^2.5.0",
|
|
88
91
|
"tsup": "8.5.1",
|
|
89
92
|
"typescript": "~6.0.3",
|
|
90
93
|
"vite": "^8.0.14"
|
package/dist/const.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { FinderAction, FinderEntry, FinderSidebarSection, FinderState, RenderOption, ViewMode } from './types';
|
|
2
|
-
export declare const viewModes: ViewMode[];
|
|
3
|
-
export declare const finderActions: FinderAction[];
|
|
4
|
-
export declare const initialState: (option: RenderOption) => FinderState;
|
|
5
|
-
export declare const sidebarSections: (root: FinderEntry | null) => FinderSidebarSection[];
|
|
6
|
-
export declare const ensureMaterialSymbols: () => void;
|
|
7
|
-
export declare const iconStyle: {
|
|
8
|
-
fontSize: string;
|
|
9
|
-
lineHeight: string;
|
|
10
|
-
fontWeight: string;
|
|
11
|
-
fontVariationSettings: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const rowIcon: {
|
|
14
|
-
display: string;
|
|
15
|
-
alignItems: string;
|
|
16
|
-
gap: string;
|
|
17
|
-
minWidth: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const iconOf: (entry: Pick<FinderEntry, "kind" | "name">) => "folder" | "database" | "article" | "account_tree" | "description";
|
|
20
|
-
export declare const badgeIconOf: (entry: FinderEntry) => "" | "delete_sweep" | "auto_awesome" | "lock";
|
|
21
|
-
export declare const sidebarIconOf: (name: string) => "folder" | "database" | "article" | "folder_special" | "home_storage" | "sell";
|
|
22
|
-
export declare const viewModeIconOf: Record<FinderState['viewMode'], string>;
|
|
23
|
-
export declare const sizeOf: (size: number) => string;
|
|
24
|
-
export declare const dateOf: (time: number) => string;
|
|
25
|
-
export declare const detailRows: (entry: FinderEntry) => ({
|
|
26
|
-
icon: string;
|
|
27
|
-
value: string;
|
|
28
|
-
strong: boolean;
|
|
29
|
-
} | {
|
|
30
|
-
icon: string;
|
|
31
|
-
value: string;
|
|
32
|
-
strong?: undefined;
|
|
33
|
-
})[];
|
|
34
|
-
//# sourceMappingURL=const.d.ts.map
|
package/dist/const.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../lib/const.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEnH,eAAO,MAAM,SAAS,EAAE,QAAQ,EAA2C,CAAA;AAC3E,eAAO,MAAM,aAAa,EAAE,YAAY,EAYvC,CAAA;AACD,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,KAAG,WASlD,CAAA;AACF,eAAO,MAAM,eAAe,GAAI,MAAM,WAAW,GAAG,IAAI,KAAG,oBAAoB,EAgB9E,CAAA;AAGD,eAAO,MAAM,qBAAqB,YAQjC,CAAA;AACD,eAAO,MAAM,SAAS;;;;;CAA+H,CAAA;AACrJ,eAAO,MAAM,OAAO;;;;;CAA8E,CAAA;AAClG,eAAO,MAAM,MAAM,GAAI,OAAO,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,uEAM/D,CAAA;AACD,eAAO,MAAM,WAAW,GAAI,OAAO,WAAW,kDAK7C,CAAA;AACD,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,mFASzC,CAAA;AACD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,CAKlE,CAAA;AACD,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,WAKlC,CAAA;AACD,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,WAGlC,CAAA;AACD,eAAO,MAAM,UAAU,GAAI,OAAO,WAAW;;;;;;;;IAM5C,CAAA"}
|
package/dist/index.cjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var H=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var me=Object.prototype.hasOwnProperty;var ye=(e,t)=>{for(var i in t)H(e,i,{get:t[i],enumerable:!0})},fe=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ue(t))!me.call(e,l)&&l!==i&&H(e,l,{get:()=>t[l],enumerable:!(a=pe(t,l))||a.enumerable});return e};var ge=e=>fe(H({},"__esModule",{value:!0}),e);var Be={};ye(Be,{finder:()=>je,renderFinder:()=>de});module.exports=ge(Be);var he=new Set(["__proto__","constructor","prototype"]),M=(e,t,i)=>{for(let a in t)he.has(a)||i?.(a,t[a])||(F.obj(e[a])&&F.obj(t[a])?M(e[a],t[a],i):e[a]=t[a])},F={arr:Array.isArray,bol:e=>typeof e=="boolean",str:e=>typeof e=="string",num:e=>typeof e=="number",fun:e=>typeof e=="function",und:e=>typeof e>"u",nul:e=>e===null,set:e=>e instanceof Set,map:e=>e instanceof Map,obj:e=>!!e&&e.constructor.name==="Object",nan:e=>typeof e=="number"&&Number.isNaN(e)};var D=(e,t)=>e.forEach(t);var L=()=>typeof window<"u"&&typeof document<"u";var xe=new Set(["href","src","action","formAction","poster","data","cite"]),be=new Set(["innerHTML","outerHTML","srcdoc"]),we=e=>F.str(e)&&/^(javascript|vbscript|data):/i.test(e.trim().replace(/[\u0000-\u001f\u007f\s]+/g,"")),ve=(e,t)=>{F.num(e)&&(e=e.toString()),F.str(e)&&(e=document.createTextNode(e)),e&&t.appendChild(e)};function n(e,t,...i){t||(t={});let{key:a,ref:l,children:p,style:g,...b}=t;if(i.length||(i=F.arr(p)?p:[p]),F.fun(e))return M(t,{children:i}),e(t);let r=document.createElement(e);return M(r,b,(o,d)=>be.has(o)||xe.has(o)&&we(d)),g&&M(r.style,g),D(i.flat(),o=>ve(o,r)),l&&l(r),r}var h=e=>"/"+e.split("/").filter(Boolean).join("/"),j=e=>{let i=h(e).split("/").filter(Boolean);return i.length<2?"/":"/"+i.slice(0,-1).join("/")},w=e=>h(e).split("/").filter(Boolean).at(-1)||"",T=(e,t)=>h(`${e}/${t}`),O=e=>{let t=h(e).split("/").filter(Boolean);return[{name:"OPFS",path:"/"},...t.map((i,a)=>({name:i,path:"/"+t.slice(0,a+1).join("/")}))]},I=e=>e?[e,...e.children.flatMap(I)]:[],S=(e,t)=>e?e.path===h(t)?e:e.children.map(i=>S(i,t)).find(Boolean)||null:null,C=(e,t)=>I(e).find(i=>i.id===t)||null,A=(e,t)=>S(e,t)?.children||[],N=e=>{let t=e.split(".").at(-1)||"";return t===e?"":t},$=e=>{let t=e.query.toLowerCase();return A(e.root,e.currentPath).filter(i=>`${i.name} ${i.kind} ${i.path}`.toLowerCase().includes(t))};var q=["icons","list","column","gallery"],G=[{key:"open",label:"Open"},{key:"createFile",label:"New File"},{key:"createFolder",label:"New Folder"},{key:"rename",label:"Rename"},{key:"duplicate",label:"Duplicate"},{key:"copy",label:"Copy"},{key:"move",label:"Move"},{key:"paste",label:"Paste"},{key:"remove",label:"Delete"},{key:"copyPath",label:"Copy Path"},{key:"info",label:"Info"}],Y=e=>({root:null,currentPath:"/",selectedEntryId:"",viewMode:e.viewMode||"icons",query:"",history:[],future:[],clipboard:null}),Q=e=>[{title:"Favorites",items:[{name:"OPFS",path:"/"},{name:"Recent",path:"/"}]},{title:"Storage",items:["Origin","Databases","Pages"].map(t=>({name:t,path:"/"}))},{title:"Database",items:I(e).filter(t=>t.name.endsWith(".db")).map(t=>({name:t.name,path:t.path}))},{title:"Tags",items:["Red","Orange","Yellow","Green","Blue","Purple","Gray"].map(t=>({name:t,path:"/"}))}],V="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined",U=!1,Z=()=>{if(U||(U=!0,document.head.querySelector(`link[href="${V}"]`)))return;let e=document.createElement("link");e.rel="stylesheet",e.href=V,document.head.appendChild(e)},J={fontSize:"18px",lineHeight:"1",fontWeight:"400",fontVariationSettings:"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24"},P={display:"inline-flex",alignItems:"center",gap:"6px",minWidth:"0"},E=e=>e.kind==="directory"?"folder":e.name.endsWith(".db")?"database":e.name.endsWith(".page")?"article":e.name.endsWith(".idx")?"account_tree":"description",B=e=>e.name.includes("tombstone")?"delete_sweep":e.name.includes("generated")?"auto_awesome":e.name.includes("lock")?"lock":"",X=e=>e==="OPFS"?"folder_special":e==="Recent"||e==="Origin"?"home_storage":e==="Databases"?"database":e==="Pages"?"article":e.endsWith(".db")?"database":["Red","Orange","Yellow","Green","Blue","Purple","Gray"].includes(e)?"sell":"folder",ee={icons:"grid_view",list:"view_list",column:"view_column",gallery:"view_carousel"},R=e=>{if(!e)return"--";let t=["B","KB","MB","GB"],i=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return`${Number((e/1024**i).toFixed(1))} ${t[i]}`},z=e=>e?new Date(e).toLocaleString():"--",te=e=>[{icon:"badge",value:e.name,strong:!0},{icon:"category",value:e.kind},{icon:"route",value:e.path},{icon:"straighten",value:R(e.size)},{icon:"schedule",value:z(e.modified)}];var m={button:{border:"0",borderRadius:"6px",padding:"5px 8px",background:"transparent",color:"inherit",font:"inherit",cursor:"default"},activeButton:{border:"0",borderRadius:"6px",padding:"5px 8px",background:"#d7dbe4",color:"inherit",font:"inherit",cursor:"default"},field:{border:"1px solid rgba(0,0,0,.12)",borderRadius:"7px",padding:"6px 9px",background:"#fff",font:"inherit",outline:"none"},row:{display:"grid",gridTemplateColumns:"28px 1.5fr 120px 120px 90px 90px",alignItems:"center",height:"28px",padding:"0 10px",gap:"8px"},selected:{background:"#0a84ff",color:"#fff"},inspector:{display:"grid",alignContent:"start",gap:"10px",padding:"16px",borderLeft:"1px solid rgba(0,0,0,.1)",background:"#fff"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},v=(...e)=>Object.assign({},...e);var y=({name:e,size:t="18px"})=>n("span",{className:"material-symbols-outlined",style:v(J,{fontSize:t})},e),x=({name:e,children:t})=>n("span",{style:P},n(y,{name:e}),n("span",{style:m.ellipsis},t)),ne=({client:{state:e,send:t}})=>{Z();let i=$(e),a=C(e.root,e.selectedEntryId)||i[0]||S(e.root,e.currentPath),l=O(e.currentPath).map(r=>r.path),p=r=>e.selectedEntryId===r.id,g=r=>({oncontextmenu:o=>{o.preventDefault(),t({type:"entryMenu",entry:r})},ondblclick:()=>t({type:"openEntry",entry:r}),onclick:()=>t({type:"select",id:r.id})}),b=(r,o=!1)=>n("aside",{style:m.inspector},r?n("div",{style:{display:"grid",gap:"10px"}},te(r).map(d=>d.strong?n("strong",{style:P},n(y,{name:d.icon}),n("span",{style:m.ellipsis},d.value)):n(x,{name:d.icon},d.value)),n(x,{name:"sell"},"Tags"),o?n("button",{type:"button",onclick:()=>t({type:"action",key:"info"}),style:m.button},n(y,{name:"info"})):null):null);return n("main",{tabIndex:0,onkeydown:r=>{r.key==="Backspace"&&t({type:"back"}),r.key==="Delete"&&t({type:"action",key:"remove"}),r.key==="Enter"&&t({type:"action",key:"open"}),r.metaKey&&(r.key==="c"&&t({type:"action",key:"copy"}),r.key==="x"&&t({type:"action",key:"move"}),r.key==="v"&&t({type:"action",key:"paste"}),r.key==="i"&&t({type:"action",key:"info"}))},ondragover:r=>r.preventDefault(),ondrop:r=>{r.preventDefault(),t({type:"dropFiles",files:Array.from(r.dataTransfer.files||[])})},style:{display:"grid",gridTemplateColumns:"minmax(160px, 220px) minmax(0, 1fr)",width:"100%",height:"100%",minWidth:"0",overflow:"hidden",color:"#1d1d1f",background:"#eef0f4",font:'13px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif'}},n("aside",{style:{display:"grid",alignContent:"start",gap:"14px",padding:"14px 10px",background:"rgba(235,238,244,.92)",borderRight:"1px solid rgba(0,0,0,.12)",overflow:"auto"}},Q(e.root).map(r=>n("section",{style:{display:"grid",gap:"4px"}},n("p",{style:{...P,margin:"0 8px 3px",color:"#7b8290",fontSize:"11px",fontWeight:"700",textTransform:"uppercase"}},n(y,{name:r.title==="Tags"?"sell":"label"}),n("span",null,r.title)),r.items.map(o=>n("button",{type:"button",onclick:()=>t({type:"openPath",path:o.path}),style:v(m.button,{textAlign:"left"})},n(x,{name:X(o.name)},o.name)))))),n("section",{style:{display:"grid",gridTemplateRows:"48px 1fr 28px",minWidth:"0",minHeight:"0",background:"#f7f8fa"}},n("header",{style:{display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) minmax(0, auto) minmax(130px, 220px)",gap:"8px",alignItems:"center",minWidth:"0",overflow:"hidden",padding:"8px 12px",background:"rgba(250,251,253,.96)",borderBottom:"1px solid rgba(0,0,0,.1)"}},n("div",{style:{display:"flex",gap:"4px",minWidth:"0"}},n("button",{type:"button",onclick:()=>t({type:"back"}),style:m.button},n(y,{name:"chevron_left"})),n("button",{type:"button",onclick:()=>t({type:"forward"}),style:m.button},n(y,{name:"chevron_right"}))),n("strong",{style:v(P,m.ellipsis)},n(y,{name:"folder_open"}),n("span",{style:m.ellipsis},w(e.currentPath)||"OPFS")),n("div",{style:{display:"flex",gap:"3px",minWidth:"0",overflow:"hidden"}},q.map(r=>n("button",{type:"button",onclick:()=>t({type:"setViewMode",mode:r}),style:e.viewMode===r?m.activeButton:m.button},n(y,{name:ee[r]})))),n("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"6px",minWidth:"0"}},n("label",{style:{position:"relative",display:"grid",minWidth:"0"}},n("span",{style:{position:"absolute",left:"8px",top:"50%",transform:"translateY(-50%)",color:"#6b7280",display:"inline-flex"}},n(y,{name:"search"})),n("input",{type:"search",value:e.query,oninput:r=>t({type:"setQuery",query:r.target.value}),placeholder:"Search",style:v(m.field,{minWidth:"0",paddingLeft:"31px"})})),n("label",{style:{position:"relative",display:"grid",width:"34px"}},n("span",{style:{position:"absolute",inset:"0",display:"grid",placeItems:"center",pointerEvents:"none"}},n(y,{name:"more_horiz"})),n("select",{onchange:r=>{t({type:"action",key:r.target.value}),r.target.value=""},style:v(m.field,{width:"34px",color:"transparent",appearance:"none",background:"transparent"})},n("option",{value:""},"..."),G.map(r=>n("option",{value:r.key},r.label)))))),n("section",{style:{minWidth:"0",minHeight:"0",overflow:"auto"}},e.viewMode==="icons"?n("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(92px, 1fr))",alignContent:"start",gap:"14px",padding:"18px"}},i.length?null:n("div",{style:{display:"grid",justifyItems:"center",gap:"8px",color:"#7b8290"}},n(y,{name:"folder_off",size:"42px"})),i.map(r=>n("div",{tabIndex:0,draggable:!0,...g(r),style:v({display:"grid",justifyItems:"center",alignContent:"start",gap:"7px",minHeight:"86px",borderRadius:"7px",padding:"8px",textAlign:"center",cursor:"default"},p(r)?m.selected:{})},n("strong",null,n(y,{name:E(r),size:"34px"})),n("span",null,r.name),B(r)?n("small",null,n(y,{name:B(r)})):null))):null,e.viewMode==="list"?n("div",null,n("div",{style:v(m.row,{color:"#687080",fontWeight:"700",borderBottom:"1px solid rgba(0,0,0,.08)"})},n(y,{name:"unfold_more"}),n(x,{name:"sort_by_alpha"},"Name"),n(x,{name:"schedule"},"Modified"),n(x,{name:"event"},"Created"),n(x,{name:"straighten"},"Size"),n(x,{name:"category"},"Kind")),i.map(r=>n("div",{tabIndex:0,draggable:!0,...g(r),style:v(m.row,{cursor:"default"},p(r)?m.selected:{})},n(y,{name:E(r)}),[r.name,z(r.modified),"--",R(r.size)].map(o=>n("span",{style:m.ellipsis},o)),n(x,{name:"category"},r.kind)))):null,e.viewMode==="column"?n("div",{style:{display:"grid",gridAutoFlow:"column",gridAutoColumns:"230px",height:"100%",overflow:"auto"}},O(e.currentPath).map(r=>r.path).concat(e.currentPath).filter((r,o,d)=>d.indexOf(r)===o).map(r=>n("div",{style:{borderRight:"1px solid rgba(0,0,0,.1)",background:"#fff",overflow:"auto"}},A(e.root,r).map(o=>n("div",{tabIndex:0,onclick:()=>t({type:"columnEntry",entry:o}),style:v(m.row,{gridTemplateColumns:"28px 1fr 18px",cursor:"default"},p(o)||l.includes(o.path)?m.selected:{})},n(y,{name:E(o)}),n("span",null,o.name),n("span",null,o.kind==="directory"?n(y,{name:"chevron_right"}):""))))),b(a)):null,e.viewMode==="gallery"?n("div",{style:{display:"grid",gridTemplateColumns:"1fr 260px",gridTemplateRows:"1fr 106px",height:"100%"}},n("div",{style:{display:"grid",placeItems:"center",minHeight:"0",background:"#f2f3f6"}},a?n("div",{style:{display:"grid",justifyItems:"center",gap:"14px"}},n("strong",null,n(y,{name:E(a),size:"64px"})),n("strong",null,a.name)):n(y,{name:"hide_image",size:"54px"})),b(a,!0),n("div",{style:{gridColumn:"1 / 3",display:"grid",gridAutoFlow:"column",gridAutoColumns:"86px",gap:"10px",alignItems:"center",padding:"10px",borderTop:"1px solid rgba(0,0,0,.1)",overflow:"auto",background:"#fafafa"}},i.map(r=>n("button",{type:"button",onclick:()=>t({type:"select",id:r.id}),style:p(r)?m.activeButton:m.button},n(y,{name:E(r)}),n("br",null),r.name)))):null),n("footer",{style:{display:"grid",gridTemplateColumns:"1fr auto auto",gap:"12px",alignItems:"center",padding:"0 12px",color:"#5f6673",borderTop:"1px solid rgba(0,0,0,.08)"}},n("nav",{style:{display:"flex",gap:"4px",overflow:"hidden"}},n(y,{name:"account_tree"}),O(e.currentPath).map(r=>n("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"}},n(y,{name:"chevron_right"}),n("button",{type:"button",onclick:()=>t({type:"openPath",path:r.path}),style:m.button},r.name)))),n(x,{name:"check_circle"},e.selectedEntryId?"1 selected":"0 selected"),n(x,{name:"inventory_2"},i.length," items"))))};var ie=async(e,t,i,a)=>{i&&await t.create(T(e.currentPath,i),a)},re=async(e,t)=>{e&&await t(e)},ke=async(e,t)=>{let i=e.clipboard;i&&(await t.copy(i.path,e.currentPath),i.mode==="move"&&await t.delete(i.path),e.clipboard=null)},Fe=e=>[e.name,e.kind,e.path,e.size?`${e.size} bytes`:"--",e.modified?new Date(e.modified).toLocaleString():"--"].join(`
|
|
2
|
-
`),oe=e=>{let t=Y(e),i=()=>e.onChange?.(),a=()=>C(t.root,t.selectedEntryId),l=async()=>{t.root=await e.command.get("/"),i()},p=o=>{t.history=[...t.history,t.currentPath],t.future=[],t.currentPath=o,t.selectedEntryId="",i()},g=o=>{let d=a();d&&(t.clipboard={path:d.path,mode:o})},b=async o=>o.kind==="directory"?p(o.path):e.command.open(o),r={async open(){let o=a();o&&await b(o)},async createFile(){await ie(t,e.command,e.view.prompt("New File")?.trim(),"file"),await l()},async createFolder(){await ie(t,e.command,e.view.prompt("New Folder")?.trim(),"directory"),await l()},async rename(){await re(a(),async o=>{let d=e.view.prompt("Rename",o.name)?.trim();d&&(await e.command.move(o.path,d),t.selectedEntryId=T(t.currentPath,d))}),await l()},async duplicate(){await re(a(),o=>e.command.copy(o.path,t.currentPath,`${o.name} copy`)),await l()},async remove(){let o=a();o&&e.view.confirm(`Delete ${o.name}?`)&&(await e.command.delete(o.path),t.selectedEntryId="",await l())},async copy(){g("copy")},async move(){g("move")},async paste(){await ke(t,e.command),await l()},async copyPath(){let o=a();o&&await e.view.navigator.clipboard.writeText(o.path)},async info(){let o=a();o&&e.view.alert(Fe(o))}};return{refresh:l,state:t,async send(o){if(o.type==="action"){o.key&&await r[o.key]();return}if(o.type==="back"){let d=t.history.at(-1);if(!d)return;t.future=[t.currentPath,...t.future],t.currentPath=d,t.history=t.history.slice(0,-1),i();return}if(o.type==="columnEntry"){if(o.entry.kind==="directory")return p(o.entry.path);t.selectedEntryId=o.entry.id,i();return}if(o.type==="dropFiles"){for(let d of o.files)await e.command.put(T(t.currentPath,d.name),d);await l();return}if(o.type==="entryMenu"){t.selectedEntryId=o.entry.id,i(),await r.info();return}if(o.type==="forward"){let d=t.future[0];if(!d)return;t.history=[...t.history,t.currentPath],t.currentPath=d,t.future=t.future.slice(1),i();return}if(o.type==="openEntry"){await b(o.entry);return}if(o.type==="openPath")return p(o.path);o.type==="select"&&(t.selectedEntryId=o.id),o.type==="setQuery"&&(t.query=o.query),o.type==="setViewMode"&&(t.viewMode=o.mode),i()}}};var ae=(e={})=>{let t=()=>(e.view||window).navigator.storage.getDirectory(),i=async s=>{let c=h(s).split("/").filter(Boolean),u=await t();for(let f of c)u=await u.getDirectoryHandle(f);return u},a=async s=>i(j(s)),l=async(s,c)=>{if(s.kind==="file"){let f=await s.getFile();return{id:h(c),path:h(c),name:s.name,kind:"file",size:f.size,type:f.type,modified:f.lastModified,children:[]}}let u=[];for await(let[,f]of s.entries())u.push(await l(f,T(c,f.name)));return u.sort((f,k)=>f.kind.localeCompare(k.kind)||f.name.localeCompare(k.name)),{id:h(c),path:h(c),name:s.name||"OPFS",kind:"directory",size:0,type:"directory",modified:0,children:u}},p=async s=>{if(h(s)==="/")return t();let c=await a(s),u=w(s);for await(let[f,k]of c.entries())if(f===u)return k;return null},g=async(s,c)=>{let u=await s.createWritable();await u.write(c),await u.close()},b=async(s,c="")=>{let f=await(await a(s)).getFileHandle(w(s),{create:!0});await g(f,c)},r=async(s,c,u)=>{let f=await s.getFile(),k=await c.getFileHandle(u,{create:!0});await g(k,f)},o=async(s,c,u)=>{let f=await c.getDirectoryHandle(u,{create:!0});for await(let[,k]of s.entries())await d(k,f,k.name)},d=async(s,c,u)=>s.kind==="file"?r(s,c,u):o(s,c,u),_={async get(s="/"){let c=await p(s);return c.kind==="file"?c.getFile():l(c,s)},async create(s,c="file",u=""){return c==="directory"?(await a(s)).getDirectoryHandle(w(s),{create:!0}):b(s,u)},async put(s,c=""){return b(s,c)},async delete(s){return(await a(s)).removeEntry(w(s),{recursive:!0})},async copy(s,c,u=w(s)){return d(await p(s),await i(c),u)},async move(s,c){await _.copy(s,j(s),c),await _.delete(s)}};return _};var Te=e=>e.toString(16).padStart(2,"0"),Ee=e=>e.toString(16).padStart(8,"0"),Me=e=>e>=32&&e<127?String.fromCharCode(e):".",Pe=e=>e.every(t=>t===0),Oe=e=>{let t=["offset hex bytes ascii"],i=!1;for(let a=0;a<e.length;a+=16){let l=e.subarray(a,a+16);if(Pe(l)){i||t.push("*"),i=!0;continue}i=!1;let p=Array.from(l,Te).join(" ").padEnd(47," "),g=Array.from(l,Me).join("");t.push(`${Ee(a)} ${p} |${g}|`)}return t.join(`
|
|
3
|
-
`)},se=async(e,t,i=65536)=>{let a=Math.min(e.size,i),l=new Uint8Array(await e.slice(0,a).arrayBuffer()),p=[`${t}`,`${e.size} bytes`,"",Oe(l)];return a<e.size&&p.push("",`truncated at ${a} bytes`),p.join(`
|
|
4
|
-
`)};var Ie={webmanifest:"application/manifest+json",pdf:"application/pdf",xhtml:"application/xhtml+xml",xml:"application/xml",aac:"audio/aac",flac:"audio/flac",m4a:"audio/mp4",mp3:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg",wav:"audio/wav",wave:"audio/wav",weba:"audio/webm",apng:"image/apng",avif:"image/avif",bmp:"image/bmp",gif:"image/gif",jfif:"image/jpeg",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",pjp:"image/jpeg",pjpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",ico:"image/vnd.microsoft.icon",webp:"image/webp",cur:"image/x-icon",htm:"text/html",html:"text/html",m4v:"video/mp4",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},Se=8192,Ce=e=>{let t=0;for(let i of e){if(i===0)return!1;(i<7||i>13&&i<32)&&t++}return t/Math.max(e.length,1)<.02},_e=(e,t)=>e.type&&e.type!=="application/octet-stream"?e.type:Ie[N(t).toLowerCase()]||null,He=(e,t)=>{let i=e.open("","_blank");return i?(i.document.title=t,i.document.body.style.margin="0",i.document.body.style.font='13px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif',i.document.body.textContent=t,i):null},Le=async(e,t)=>{let i=_e(e,t);if(!i){let a=new Uint8Array(await e.slice(0,Se).arrayBuffer()),l=Ce(a)?e:await se(e,t);return new Blob([l],{type:"text/plain"})}return e.type===i?e:e.slice(0,e.size,i)},le=async({path:e,file:t,source:i})=>{let l=He(i||window,w(e));if(!l)return null;let p=URL.createObjectURL(await Le(t,e));return l.location.replace(p)};var W="opfs-finder",je=(e={})=>{if(!L())return null;typeof Event<"u"&&e instanceof Event&&(e={});let t=e,a=(t.document||document).defaultView||window,l=t.width||a.innerWidth,p=t.height||a.innerHeight,g=t.id?`${W}-${t.id}`:W;return a.open(location.href,g,`width=${l},height=${p}`)||null},de=(e,t={})=>{let i=e.ownerDocument.defaultView||window,a=ae({view:i}),l=oe({...t,command:{...a,async open(g){return le({path:g.path,file:await a.get(g.path),source:i})}},view:i,onChange:()=>p()}),p=()=>{e.replaceChildren(ne({client:l}))};l.refresh()},ce=()=>{if(!window.name.startsWith(W))return;document.title="OPFS Finder",document.body.style.margin="0";let e=n("div",{style:{width:"100vw",height:"100vh"}});document.body.replaceChildren(e),de(e)},Ae=()=>{if(L()){if(document.body)return ce();document.addEventListener("DOMContentLoaded",ce,{once:!0})}};Ae();0&&(module.exports={finder,renderFinder});
|
|
5
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/index.tsx","../lib/utils/utils.ts","../lib/utils/node.ts","../lib/utils/path.ts","../lib/const.ts","../lib/style.ts","../lib/view.tsx","../lib/utils/api.ts","../lib/utils/opfs.ts","../lib/utils/hex.ts","../lib/utils/viewer.ts"],"sourcesContent":["import * as core from './utils/node'\nimport { FinderView } from './view'\nimport { createAPI } from './utils/api'\nimport { createOPFS } from './utils/opfs'\nimport { openFile } from './utils/viewer'\nimport { isBrowser } from './utils/utils'\nexport type { OpfsEntry, OpfsKind, OpfsOption } from './utils/opfs'\nimport type { RenderOption } from './types'\nexport type FinderOption = RenderOption & {\n id?: string\n width?: number\n height?: number\n document?: Document\n}\nconst panelName = 'opfs-finder'\nexport const finder = (option: FinderOption | Event = {}) => {\n if (!isBrowser()) return null\n if (typeof Event !== 'undefined' && option instanceof Event) option = {}\n const config = option as FinderOption\n const owner = config.document || document\n const view = owner.defaultView || window\n const width = config.width || view.innerWidth\n const height = config.height || view.innerHeight\n const id = config.id ? `${panelName}-${config.id}` : panelName\n return view.open(location.href, id, `width=${width},height=${height}`) || null\n}\nexport const renderFinder = (mount: HTMLElement, option: RenderOption = {}) => {\n const view = mount.ownerDocument.defaultView || window\n const _store = createOPFS({ view })\n const client = createAPI({\n ...option,\n command: {\n ..._store,\n async open(entry) {\n return openFile({ path: entry.path, file: await _store.get(entry.path), source: view })\n },\n },\n view,\n onChange: () => paint(),\n })\n const paint = () => {\n mount.replaceChildren(FinderView({ client }))\n }\n client.refresh()\n}\nconst renderPanelWindow = () => {\n if (!window.name.startsWith(panelName)) return\n document.title = 'OPFS Finder'\n document.body.style.margin = '0'\n const mount = <div style={{ width: '100vw', height: '100vh' }} />\n document.body.replaceChildren(mount)\n renderFinder(mount)\n}\nconst bootPanelWindow = () => {\n if (!isBrowser()) return\n if (document.body) return renderPanelWindow()\n document.addEventListener('DOMContentLoaded', renderPanelWindow, { once: true })\n}\nbootPanelWindow()\n","export type Merge<T extends object> = Partial<{\n [K in keyof T]: T[K] extends object ? Merge<T[K]> : T[K]\n}>\nconst blocked = new Set(['__proto__', 'constructor', 'prototype'])\nexport const merge = <T extends object>(a: Merge<T>, b: Merge<T>, ignore?: (key: string, value: unknown) => boolean) => {\n for (const key in b) {\n if (blocked.has(key) || ignore?.(key, b[key])) continue\n if (is.obj(a[key]) && is.obj(b[key])) merge(a[key], b[key], ignore)\n else a[key] = b[key]\n }\n}\nexport const is = {\n arr: Array.isArray,\n bol: (a: unknown): a is boolean => typeof a === 'boolean',\n str: (a: unknown): a is string => typeof a === 'string',\n num: (a: unknown): a is number => typeof a === 'number',\n fun: (a: unknown): a is Function => typeof a === 'function',\n und: (a: unknown): a is undefined => typeof a === 'undefined',\n nul: (a: unknown): a is null => a === null,\n set: (a: unknown): a is Set<unknown> => a instanceof Set,\n map: (a: unknown): a is Map<unknown, unknown> => a instanceof Map,\n obj: (a: unknown): a is object => !!a && a.constructor.name === 'Object',\n nan: (a: unknown): a is number => typeof a === 'number' && Number.isNaN(a),\n}\nexport const isServer = () => {\n return typeof window === 'undefined'\n}\n/**\n * each\n */\ntype EachFn<Value, Key, This> = (this: This, value: Value, key: Key) => void\ntype Eachable<Value = any, Key = any, This = any> = {\n forEach(cb: EachFn<Value, Key, This>, ctx?: This): void\n}\nexport const each = <Value, Key, This>(obj: Eachable<Value, Key, This>, fn: EachFn<Value, Key, This>) => obj.forEach(fn)\nexport const flush = <Value extends Function, Key, This>(obj: Eachable<Value, Key, This>, ...args: any[]) => {\n each(obj, (f) => f(...args))\n}\nexport const isBrowser = () => typeof window !== 'undefined' && typeof document !== 'undefined'\n","import { each, is, merge } from './utils'\nimport type { Merge } from './utils'\nexport type HTMLMap = HTMLElementTagNameMap\nexport type HTMLTag = keyof HTMLMap\nexport type HTMLNode<T extends HTMLTag = HTMLTag> = HTMLMap[T] | string | number | null | undefined\nexport type Component<T extends HTMLTag, P = {}, Child = HTMLMap[T]> = (props: P) => Child\nexport type Props<T extends HTMLTag> = Merge<HTMLMap[T]> & {\n key?: string\n ref?: (el: HTMLMap[T]) => void\n children?: HTMLNode | HTMLNode[]\n className?: string\n}\nconst urlProps = new Set(['href', 'src', 'action', 'formAction', 'poster', 'data', 'cite'])\nconst docProps = new Set(['innerHTML', 'outerHTML', 'srcdoc'])\nconst isUnsafe = (value: unknown) => is.str(value) && /^(javascript|vbscript|data):/i.test(value.trim().replace(/[\\u0000-\\u001f\\u007f\\s]+/g, ''))\nexport const append = <El extends Node>(child: Node | string | number | null | undefined, el: El) => {\n if (is.num(child)) child = child.toString()\n if (is.str(child)) child = document.createTextNode(child)\n if (child) el.appendChild(child)\n}\nexport const remove = <El extends Node>(child: Node, el: El) => {\n el.removeChild(child)\n}\nfunction create<T extends HTMLTag>(type: T, props?: Props<T>, ...args: HTMLNode[]): HTMLMap[T]\nfunction create<T extends HTMLTag, P = {}, Child = HTMLMap[T]>(type: Component<T, P, Child>, props?: P, ...args: HTMLNode[]): Child\nfunction create(type: any, props: any, ...args: HTMLNode[]) {\n if (!props) props = {}\n const { key, ref, children, style, ...other } = props\n if (!args.length) args = is.arr(children) ? children : [children]\n if (is.fun(type)) {\n merge(props, { children: args })\n return type(props)\n }\n const el = document.createElement(type)\n merge(el, other, (key, value) => docProps.has(key) || (urlProps.has(key) && isUnsafe(value)))\n if (style) merge(el.style, style)\n each(args.flat(), (c) => append(c, el))\n if (ref) ref(el)\n return el\n}\nexport { create }\nexport default create\n","import type { FinderEntry, FinderState } from '../types'\nexport const normalizePath = (path: string) => {\n const parts = path.split('/').filter(Boolean)\n return '/' + parts.join('/')\n}\nexport const dirname = (path: string) => {\n const normalized = normalizePath(path)\n const parts = normalized.split('/').filter(Boolean)\n if (parts.length < 2) return '/'\n return '/' + parts.slice(0, -1).join('/')\n}\nexport const basename = (path: string) => {\n const parts = normalizePath(path).split('/').filter(Boolean)\n return parts.at(-1) || ''\n}\nexport const joinPath = (base: string, name: string) => normalizePath(`${base}/${name}`)\nexport const crumbs = (path: string) => {\n const parts = normalizePath(path).split('/').filter(Boolean)\n return [{ name: 'OPFS', path: '/' }, ...parts.map((name, index) => ({ name, path: '/' + parts.slice(0, index + 1).join('/') }))]\n}\nexport const flatten = (entry: FinderEntry | null): FinderEntry[] => {\n if (!entry) return []\n return [entry, ...entry.children.flatMap(flatten)]\n}\nexport const findEntry = (entry: FinderEntry | null, path: string): FinderEntry | null => {\n if (!entry) return null\n if (entry.path === normalizePath(path)) return entry\n return entry.children.map((child) => findEntry(child, path)).find(Boolean) || null\n}\nexport const selectedEntry = (entry: FinderEntry | null, id: string) => {\n return flatten(entry).find((item) => item.id === id) || null\n}\nexport const childrenOf = (entry: FinderEntry | null, path: string) => {\n return findEntry(entry, path)?.children || []\n}\nexport const extensionOf = (name: string) => {\n const value = name.split('.').at(-1) || ''\n if (value === name) return ''\n return value\n}\nexport const visibleEntries = (state: FinderState) => {\n const query = state.query.toLowerCase()\n return childrenOf(state.root, state.currentPath).filter((entry) => `${entry.name} ${entry.kind} ${entry.path}`.toLowerCase().includes(query))\n}\n","import type { FinderAction, FinderEntry, FinderSidebarSection, FinderState, RenderOption, ViewMode } from './types'\nimport { flatten } from './utils/path'\nexport const viewModes: ViewMode[] = ['icons', 'list', 'column', 'gallery']\nexport const finderActions: FinderAction[] = [\n { key: 'open', label: 'Open' },\n { key: 'createFile', label: 'New File' },\n { key: 'createFolder', label: 'New Folder' },\n { key: 'rename', label: 'Rename' },\n { key: 'duplicate', label: 'Duplicate' },\n { key: 'copy', label: 'Copy' },\n { key: 'move', label: 'Move' },\n { key: 'paste', label: 'Paste' },\n { key: 'remove', label: 'Delete' },\n { key: 'copyPath', label: 'Copy Path' },\n { key: 'info', label: 'Info' },\n]\nexport const initialState = (option: RenderOption): FinderState => ({\n root: null,\n currentPath: '/',\n selectedEntryId: '',\n viewMode: option.viewMode || 'icons',\n query: '',\n history: [],\n future: [],\n clipboard: null,\n})\nexport const sidebarSections = (root: FinderEntry | null): FinderSidebarSection[] => [\n {\n title: 'Favorites',\n items: [\n { name: 'OPFS', path: '/' },\n { name: 'Recent', path: '/' },\n ],\n },\n { title: 'Storage', items: ['Origin', 'Databases', 'Pages'].map((name) => ({ name, path: '/' })) },\n {\n title: 'Database',\n items: flatten(root)\n .filter((entry) => entry.name.endsWith('.db'))\n .map((entry) => ({ name: entry.name, path: entry.path })),\n },\n { title: 'Tags', items: ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Purple', 'Gray'].map((name) => ({ name, path: '/' })) },\n]\nconst materialSymbolsUrl = 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined'\nlet materialSymbolsReady = false\nexport const ensureMaterialSymbols = () => {\n if (materialSymbolsReady) return\n materialSymbolsReady = true\n if (document.head.querySelector(`link[href=\"${materialSymbolsUrl}\"]`)) return\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = materialSymbolsUrl\n document.head.appendChild(link)\n}\nexport const iconStyle = { fontSize: '18px', lineHeight: '1', fontWeight: '400', fontVariationSettings: \"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24\" }\nexport const rowIcon = { display: 'inline-flex', alignItems: 'center', gap: '6px', minWidth: '0' }\nexport const iconOf = (entry: Pick<FinderEntry, 'kind' | 'name'>) => {\n if (entry.kind === 'directory') return 'folder'\n if (entry.name.endsWith('.db')) return 'database'\n if (entry.name.endsWith('.page')) return 'article'\n if (entry.name.endsWith('.idx')) return 'account_tree'\n return 'description'\n}\nexport const badgeIconOf = (entry: FinderEntry) => {\n if (entry.name.includes('tombstone')) return 'delete_sweep'\n if (entry.name.includes('generated')) return 'auto_awesome'\n if (entry.name.includes('lock')) return 'lock'\n return ''\n}\nexport const sidebarIconOf = (name: string) => {\n if (name === 'OPFS') return 'folder_special'\n if (name === 'Recent') return 'home_storage'\n if (name === 'Origin') return 'home_storage'\n if (name === 'Databases') return 'database'\n if (name === 'Pages') return 'article'\n if (name.endsWith('.db')) return 'database'\n if (['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Purple', 'Gray'].includes(name)) return 'sell'\n return 'folder'\n}\nexport const viewModeIconOf: Record<FinderState['viewMode'], string> = {\n icons: 'grid_view',\n list: 'view_list',\n column: 'view_column',\n gallery: 'view_carousel',\n}\nexport const sizeOf = (size: number) => {\n if (!size) return '--'\n const units = ['B', 'KB', 'MB', 'GB']\n const index = Math.min(Math.floor(Math.log(size) / Math.log(1024)), units.length - 1)\n return `${Number((size / 1024 ** index).toFixed(1))} ${units[index]}`\n}\nexport const dateOf = (time: number) => {\n if (!time) return '--'\n return new Date(time).toLocaleString()\n}\nexport const detailRows = (entry: FinderEntry) => [\n { icon: 'badge', value: entry.name, strong: true },\n { icon: 'category', value: entry.kind },\n { icon: 'route', value: entry.path },\n { icon: 'straighten', value: sizeOf(entry.size) },\n { icon: 'schedule', value: dateOf(entry.modified) },\n]\n","export const ui = {\n button: { border: '0', borderRadius: '6px', padding: '5px 8px', background: 'transparent', color: 'inherit', font: 'inherit', cursor: 'default' },\n activeButton: { border: '0', borderRadius: '6px', padding: '5px 8px', background: '#d7dbe4', color: 'inherit', font: 'inherit', cursor: 'default' },\n field: { border: '1px solid rgba(0,0,0,.12)', borderRadius: '7px', padding: '6px 9px', background: '#fff', font: 'inherit', outline: 'none' },\n row: { display: 'grid', gridTemplateColumns: '28px 1.5fr 120px 120px 90px 90px', alignItems: 'center', height: '28px', padding: '0 10px', gap: '8px' },\n selected: { background: '#0a84ff', color: '#fff' },\n inspector: { display: 'grid', alignContent: 'start', gap: '10px', padding: '16px', borderLeft: '1px solid rgba(0,0,0,.1)', background: '#fff' },\n ellipsis: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },\n}\nexport const mix = (...values: Array<Record<string, string>>) => Object.assign({}, ...values)\n","import * as core from './utils/node'\nimport type { FinderEntry } from './types'\nimport { badgeIconOf, dateOf, detailRows, ensureMaterialSymbols, finderActions, iconOf, iconStyle, rowIcon, sidebarIconOf, sidebarSections, sizeOf, viewModeIconOf, viewModes } from './const'\nimport { basename, childrenOf, crumbs, findEntry, selectedEntry, visibleEntries } from './utils/path'\nimport { mix, ui } from './style'\nimport { API } from './utils/api'\nconst Icon = ({ name, size = '18px' }: { name: string; size?: string }) => (\n <span className=\"material-symbols-outlined\" style={mix(iconStyle, { fontSize: size })}>\n {name}\n </span>\n)\nconst InlineIcon = ({ name, children }: { name: string; children?: any }) => (\n <span style={rowIcon}>\n <Icon name={name} />\n <span style={ui.ellipsis}>{children}</span>\n </span>\n)\nexport const FinderView = ({ client: { state, send } }: { client: API }) => {\n ensureMaterialSymbols()\n const entries = visibleEntries(state)\n const item = selectedEntry(state.root, state.selectedEntryId) || entries[0] || findEntry(state.root, state.currentPath)\n const columnActivePaths = crumbs(state.currentPath).map((item) => item.path)\n const _selected = (entry: FinderEntry) => state.selectedEntryId === entry.id\n const _entryEvents = (entry: FinderEntry) => ({\n oncontextmenu: (event: any) => {\n event.preventDefault()\n send({ type: 'entryMenu', entry })\n },\n ondblclick: () => send({ type: 'openEntry', entry }),\n onclick: () => send({ type: 'select', id: entry.id }),\n })\n const _details = (entry: FinderEntry | null, action = false) => (\n <aside style={ui.inspector}>\n {entry ? (\n <div style={{ display: 'grid', gap: '10px' }}>\n {detailRows(entry).map((row) =>\n row.strong ? (\n <strong style={rowIcon}>\n <Icon name={row.icon} />\n <span style={ui.ellipsis}>{row.value}</span>\n </strong>\n ) : (\n <InlineIcon name={row.icon}>{row.value}</InlineIcon>\n ),\n )}\n <InlineIcon name=\"sell\">Tags</InlineIcon>\n {action ? (\n <button type=\"button\" onclick={() => send({ type: 'action', key: 'info' })} style={ui.button}>\n <Icon name=\"info\" />\n </button>\n ) : null}\n </div>\n ) : null}\n </aside>\n )\n return (\n <main\n tabIndex={0}\n onkeydown={(event: any) => {\n if (event.key === 'Backspace') send({ type: 'back' })\n if (event.key === 'Delete') send({ type: 'action', key: 'remove' })\n if (event.key === 'Enter') send({ type: 'action', key: 'open' })\n if (!event.metaKey) return\n if (event.key === 'c') send({ type: 'action', key: 'copy' })\n if (event.key === 'x') send({ type: 'action', key: 'move' })\n if (event.key === 'v') send({ type: 'action', key: 'paste' })\n if (event.key === 'i') send({ type: 'action', key: 'info' })\n }}\n ondragover={(event: any) => event.preventDefault()}\n ondrop={(event: any) => {\n event.preventDefault()\n send({ type: 'dropFiles', files: Array.from(event.dataTransfer.files || []) })\n }}\n style={{ display: 'grid', gridTemplateColumns: 'minmax(160px, 220px) minmax(0, 1fr)', width: '100%', height: '100%', minWidth: '0', overflow: 'hidden', color: '#1d1d1f', background: '#eef0f4', font: '13px -apple-system, BlinkMacSystemFont, \"SF Pro Text\", sans-serif' }}\n >\n <aside style={{ display: 'grid', alignContent: 'start', gap: '14px', padding: '14px 10px', background: 'rgba(235,238,244,.92)', borderRight: '1px solid rgba(0,0,0,.12)', overflow: 'auto' }}>\n {sidebarSections(state.root).map((section) => (\n <section style={{ display: 'grid', gap: '4px' }}>\n <p style={{ ...rowIcon, margin: '0 8px 3px', color: '#7b8290', fontSize: '11px', fontWeight: '700', textTransform: 'uppercase' }}>\n <Icon name={section.title === 'Tags' ? 'sell' : 'label'} />\n <span>{section.title}</span>\n </p>\n {section.items.map((item) => (\n <button type=\"button\" onclick={() => send({ type: 'openPath', path: item.path })} style={mix(ui.button, { textAlign: 'left' })}>\n <InlineIcon name={sidebarIconOf(item.name)}>{item.name}</InlineIcon>\n </button>\n ))}\n </section>\n ))}\n </aside>\n <section style={{ display: 'grid', gridTemplateRows: '48px 1fr 28px', minWidth: '0', minHeight: '0', background: '#f7f8fa' }}>\n <header style={{ display: 'grid', gridTemplateColumns: 'auto minmax(0, 1fr) minmax(0, auto) minmax(130px, 220px)', gap: '8px', alignItems: 'center', minWidth: '0', overflow: 'hidden', padding: '8px 12px', background: 'rgba(250,251,253,.96)', borderBottom: '1px solid rgba(0,0,0,.1)' }}>\n <div style={{ display: 'flex', gap: '4px', minWidth: '0' }}>\n <button type=\"button\" onclick={() => send({ type: 'back' })} style={ui.button}>\n <Icon name=\"chevron_left\" />\n </button>\n <button type=\"button\" onclick={() => send({ type: 'forward' })} style={ui.button}>\n <Icon name=\"chevron_right\" />\n </button>\n </div>\n <strong style={mix(rowIcon, ui.ellipsis)}>\n <Icon name=\"folder_open\" />\n <span style={ui.ellipsis}>{basename(state.currentPath) || 'OPFS'}</span>\n </strong>\n <div style={{ display: 'flex', gap: '3px', minWidth: '0', overflow: 'hidden' }}>\n {viewModes.map((mode) => (\n <button type=\"button\" onclick={() => send({ type: 'setViewMode', mode })} style={state.viewMode === mode ? ui.activeButton : ui.button}>\n <Icon name={viewModeIconOf[mode]} />\n </button>\n ))}\n </div>\n <div style={{ display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) auto', gap: '6px', minWidth: '0' }}>\n <label style={{ position: 'relative', display: 'grid', minWidth: '0' }}>\n <span style={{ position: 'absolute', left: '8px', top: '50%', transform: 'translateY(-50%)', color: '#6b7280', display: 'inline-flex' }}>\n <Icon name=\"search\" />\n </span>\n <input type=\"search\" value={state.query} oninput={(event: any) => send({ type: 'setQuery', query: event.target.value })} placeholder=\"Search\" style={mix(ui.field, { minWidth: '0', paddingLeft: '31px' })} />\n </label>\n <label style={{ position: 'relative', display: 'grid', width: '34px' }}>\n <span style={{ position: 'absolute', inset: '0', display: 'grid', placeItems: 'center', pointerEvents: 'none' }}>\n <Icon name=\"more_horiz\" />\n </span>\n <select\n onchange={(event: any) => {\n send({ type: 'action', key: event.target.value })\n event.target.value = ''\n }}\n style={mix(ui.field, { width: '34px', color: 'transparent', appearance: 'none', background: 'transparent' })}\n >\n <option value=\"\">...</option>\n {finderActions.map((action) => (\n <option value={action.key}>{action.label}</option>\n ))}\n </select>\n </label>\n </div>\n </header>\n <section style={{ minWidth: '0', minHeight: '0', overflow: 'auto' }}>\n {state.viewMode === 'icons' ? (\n <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(92px, 1fr))', alignContent: 'start', gap: '14px', padding: '18px' }}>\n {!entries.length ? (\n <div style={{ display: 'grid', justifyItems: 'center', gap: '8px', color: '#7b8290' }}>\n <Icon name=\"folder_off\" size=\"42px\" />\n </div>\n ) : null}\n {entries.map((entry) => (\n <div tabIndex={0} draggable={true} {..._entryEvents(entry)} style={mix({ display: 'grid', justifyItems: 'center', alignContent: 'start', gap: '7px', minHeight: '86px', borderRadius: '7px', padding: '8px', textAlign: 'center', cursor: 'default' }, _selected(entry) ? ui.selected : {})}>\n <strong>\n <Icon name={iconOf(entry)} size=\"34px\" />\n </strong>\n <span>{entry.name}</span>\n {badgeIconOf(entry) ? (\n <small>\n <Icon name={badgeIconOf(entry)} />\n </small>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n {state.viewMode === 'list' ? (\n <div>\n <div style={mix(ui.row, { color: '#687080', fontWeight: '700', borderBottom: '1px solid rgba(0,0,0,.08)' })}>\n <Icon name=\"unfold_more\" />\n <InlineIcon name=\"sort_by_alpha\">Name</InlineIcon>\n <InlineIcon name=\"schedule\">Modified</InlineIcon>\n <InlineIcon name=\"event\">Created</InlineIcon>\n <InlineIcon name=\"straighten\">Size</InlineIcon>\n <InlineIcon name=\"category\">Kind</InlineIcon>\n </div>\n {entries.map((entry) => (\n <div tabIndex={0} draggable={true} {..._entryEvents(entry)} style={mix(ui.row, { cursor: 'default' }, _selected(entry) ? ui.selected : {})}>\n <Icon name={iconOf(entry)} />\n {[entry.name, dateOf(entry.modified), '--', sizeOf(entry.size)].map((value) => (\n <span style={ui.ellipsis}>{value}</span>\n ))}\n <InlineIcon name=\"category\">{entry.kind}</InlineIcon>\n </div>\n ))}\n </div>\n ) : null}\n {state.viewMode === 'column' ? (\n <div style={{ display: 'grid', gridAutoFlow: 'column', gridAutoColumns: '230px', height: '100%', overflow: 'auto' }}>\n {crumbs(state.currentPath)\n .map((crumb) => crumb.path)\n .concat(state.currentPath)\n .filter((path, index, list) => list.indexOf(path) === index)\n .map((path) => (\n <div style={{ borderRight: '1px solid rgba(0,0,0,.1)', background: '#fff', overflow: 'auto' }}>\n {childrenOf(state.root, path).map((entry) => (\n <div tabIndex={0} onclick={() => send({ type: 'columnEntry', entry })} style={mix(ui.row, { gridTemplateColumns: '28px 1fr 18px', cursor: 'default' }, _selected(entry) || columnActivePaths.includes(entry.path) ? ui.selected : {})}>\n <Icon name={iconOf(entry)} />\n <span>{entry.name}</span>\n <span>{entry.kind === 'directory' ? <Icon name=\"chevron_right\" /> : ''}</span>\n </div>\n ))}\n </div>\n ))}\n {_details(item)}\n </div>\n ) : null}\n {state.viewMode === 'gallery' ? (\n <div style={{ display: 'grid', gridTemplateColumns: '1fr 260px', gridTemplateRows: '1fr 106px', height: '100%' }}>\n <div style={{ display: 'grid', placeItems: 'center', minHeight: '0', background: '#f2f3f6' }}>\n {item ? (\n <div style={{ display: 'grid', justifyItems: 'center', gap: '14px' }}>\n <strong>\n <Icon name={iconOf(item)} size=\"64px\" />\n </strong>\n <strong>{item.name}</strong>\n </div>\n ) : (\n <Icon name=\"hide_image\" size=\"54px\" />\n )}\n </div>\n {_details(item, true)}\n <div style={{ gridColumn: '1 / 3', display: 'grid', gridAutoFlow: 'column', gridAutoColumns: '86px', gap: '10px', alignItems: 'center', padding: '10px', borderTop: '1px solid rgba(0,0,0,.1)', overflow: 'auto', background: '#fafafa' }}>\n {entries.map((entry) => (\n <button type=\"button\" onclick={() => send({ type: 'select', id: entry.id })} style={_selected(entry) ? ui.activeButton : ui.button}>\n <Icon name={iconOf(entry)} />\n <br />\n {entry.name}\n </button>\n ))}\n </div>\n </div>\n ) : null}\n </section>\n <footer style={{ display: 'grid', gridTemplateColumns: '1fr auto auto', gap: '12px', alignItems: 'center', padding: '0 12px', color: '#5f6673', borderTop: '1px solid rgba(0,0,0,.08)' }}>\n <nav style={{ display: 'flex', gap: '4px', overflow: 'hidden' }}>\n <Icon name=\"account_tree\" />\n {crumbs(state.currentPath).map((crumb) => (\n <span style={{ display: 'inline-flex', alignItems: 'center', gap: '4px' }}>\n <Icon name=\"chevron_right\" />\n <button type=\"button\" onclick={() => send({ type: 'openPath', path: crumb.path })} style={ui.button}>\n {crumb.name}\n </button>\n </span>\n ))}\n </nav>\n <InlineIcon name=\"check_circle\">{state.selectedEntryId ? '1 selected' : '0 selected'}</InlineIcon>\n <InlineIcon name=\"inventory_2\">{entries.length} items</InlineIcon>\n </footer>\n </section>\n </main>\n )\n}\n","import { initialState } from '../const'\nimport { joinPath, selectedEntry } from './path'\nimport type { APIOption, ClipboardMode, Command, EntryKind, FinderActionKey, FinderEntry, FinderEvent, FinderState } from '../types'\nconst createEntry = async (state: FinderState, command: Command, name: string | null | undefined, kind: EntryKind) => {\n if (!name) return\n await command.create(joinPath(state.currentPath, name), kind)\n}\nconst editEntry = async (entry: FinderEntry | null, fn: (entry: FinderEntry) => Promise<unknown>) => {\n if (!entry) return\n await fn(entry)\n}\nconst copyClipboard = async (state: FinderState, command: Command) => {\n const item = state.clipboard\n if (!item) return\n await command.copy(item.path, state.currentPath)\n if (item.mode === 'move') await command.delete(item.path)\n state.clipboard = null\n}\n\nconst infoText = (entry: FinderEntry) => [entry.name, entry.kind, entry.path, entry.size ? `${entry.size} bytes` : '--', entry.modified ? new Date(entry.modified).toLocaleString() : '--'].join('\\n')\nexport const createAPI = (option: APIOption) => {\n const state = initialState(option)\n const _emit = () => option.onChange?.()\n const chosen = () => selectedEntry(state.root, state.selectedEntryId)\n const refresh = async () => {\n state.root = await option.command.get('/')\n _emit()\n }\n const openPath = (path: string) => {\n state.history = [...state.history, state.currentPath]\n state.future = []\n state.currentPath = path\n state.selectedEntryId = ''\n _emit()\n }\n const _setClipboard = (mode: ClipboardMode) => {\n const entry = chosen()\n if (!entry) return\n state.clipboard = { path: entry.path, mode }\n }\n const openEntry = async (entry: FinderEntry) => {\n if (entry.kind === 'directory') return openPath(entry.path)\n return option.command.open(entry)\n }\n const actions: Record<FinderActionKey, () => Promise<void>> = {\n async open() {\n const entry = chosen()\n if (entry) await openEntry(entry)\n },\n async createFile() {\n await createEntry(state, option.command, option.view.prompt('New File')?.trim(), 'file')\n await refresh()\n },\n async createFolder() {\n await createEntry(state, option.command, option.view.prompt('New Folder')?.trim(), 'directory')\n await refresh()\n },\n async rename() {\n await editEntry(chosen(), async (entry) => {\n const name = option.view.prompt('Rename', entry.name)?.trim()\n if (!name) return\n await option.command.move(entry.path, name)\n state.selectedEntryId = joinPath(state.currentPath, name)\n })\n await refresh()\n },\n async duplicate() {\n await editEntry(chosen(), (entry) => option.command.copy(entry.path, state.currentPath, `${entry.name} copy`))\n await refresh()\n },\n async remove() {\n const entry = chosen()\n if (!entry) return\n if (!option.view.confirm(`Delete ${entry.name}?`)) return\n await option.command.delete(entry.path)\n state.selectedEntryId = ''\n await refresh()\n },\n async copy() {\n _setClipboard('copy')\n },\n async move() {\n _setClipboard('move')\n },\n async paste() {\n await copyClipboard(state, option.command)\n await refresh()\n },\n async copyPath() {\n const entry = chosen()\n if (entry) await option.view.navigator.clipboard.writeText(entry.path)\n },\n async info() {\n const entry = chosen()\n if (entry) option.view.alert(infoText(entry))\n },\n }\n return {\n refresh,\n state,\n async send(event: FinderEvent) {\n if (event.type === 'action') {\n if (event.key) await actions[event.key]()\n return\n }\n if (event.type === 'back') {\n const path = state.history.at(-1)\n if (!path) return\n state.future = [state.currentPath, ...state.future]\n state.currentPath = path\n state.history = state.history.slice(0, -1)\n _emit()\n return\n }\n if (event.type === 'columnEntry') {\n if (event.entry.kind === 'directory') return openPath(event.entry.path)\n state.selectedEntryId = event.entry.id\n _emit()\n return\n }\n if (event.type === 'dropFiles') {\n for (const file of event.files) await option.command.put(joinPath(state.currentPath, file.name), file)\n await refresh()\n return\n }\n if (event.type === 'entryMenu') {\n state.selectedEntryId = event.entry.id\n _emit()\n await actions.info()\n return\n }\n if (event.type === 'forward') {\n const path = state.future[0]\n if (!path) return\n state.history = [...state.history, state.currentPath]\n state.currentPath = path\n state.future = state.future.slice(1)\n _emit()\n return\n }\n if (event.type === 'openEntry') {\n await openEntry(event.entry)\n return\n }\n if (event.type === 'openPath') return openPath(event.path)\n if (event.type === 'select') state.selectedEntryId = event.id\n if (event.type === 'setQuery') state.query = event.query\n if (event.type === 'setViewMode') state.viewMode = event.mode\n _emit()\n },\n }\n}\nexport type API = ReturnType<typeof createAPI>\n","import { basename, dirname, joinPath, normalizePath } from './path'\nexport type OpfsKind = 'directory' | 'file'\nexport type OpfsBody = BlobPart\nexport type OpfsOption = {\n view?: Window\n}\nexport type OpfsEntry = {\n id: string\n path: string\n name: string\n kind: OpfsKind\n size: number\n type: string\n modified: number\n children: OpfsEntry[]\n}\nexport const createOPFS = (option: OpfsOption = {}) => {\n const _root = () => (option.view || window).navigator.storage.getDirectory()\n const _directory = async (path: string) => {\n const parts = normalizePath(path).split('/').filter(Boolean)\n let current = await _root()\n for (const part of parts) current = await current.getDirectoryHandle(part)\n return current\n }\n const _parent = async (path: string) => {\n return _directory(dirname(path))\n }\n const _entry = async (handle: any, path: string): Promise<OpfsEntry> => {\n if (handle.kind === 'file') {\n const file = await handle.getFile()\n return { id: normalizePath(path), path: normalizePath(path), name: handle.name, kind: 'file', size: file.size, type: file.type, modified: file.lastModified, children: [] }\n }\n const children: OpfsEntry[] = []\n for await (const [, child] of handle.entries()) children.push(await _entry(child, joinPath(path, child.name)))\n children.sort((a, b) => a.kind.localeCompare(b.kind) || a.name.localeCompare(b.name))\n return { id: normalizePath(path), path: normalizePath(path), name: handle.name || 'OPFS', kind: 'directory', size: 0, type: 'directory', modified: 0, children }\n }\n const _handle = async (path: string) => {\n if (normalizePath(path) === '/') return _root()\n const dir = await _parent(path)\n const name = basename(path)\n for await (const [key, value] of dir.entries()) if (key === name) return value\n return null\n }\n const _write = async (file: FileSystemFileHandle, body: OpfsBody) => {\n const writable = await file.createWritable()\n await writable.write(body)\n await writable.close()\n }\n const _put = async (path: string, body: OpfsBody = '') => {\n const dir = await _parent(path)\n const file = await dir.getFileHandle(basename(path), { create: true })\n await _write(file, body)\n }\n const _copyFile = async (from: any, target: FileSystemDirectoryHandle, name: string) => {\n const file = await from.getFile()\n const next = await target.getFileHandle(name, { create: true })\n await _write(next, file)\n }\n const _copyDirectory = async (from: any, target: FileSystemDirectoryHandle, name: string) => {\n const next = await target.getDirectoryHandle(name, { create: true })\n for await (const [, child] of from.entries()) await _copyAny(child, next, child.name)\n }\n const _copyAny = async (from: any, target: FileSystemDirectoryHandle, name: string) => {\n if (from.kind === 'file') return _copyFile(from, target, name)\n return _copyDirectory(from, target, name)\n }\n const api = {\n async get(path = '/') {\n const source = (await _handle(path)) as any\n if (source.kind === 'file') return source.getFile()\n return _entry(source, path)\n },\n async create(path: string, kind: OpfsKind = 'file', body: OpfsBody = '') {\n if (kind === 'directory') return (await _parent(path)).getDirectoryHandle(basename(path), { create: true })\n return _put(path, body)\n },\n async put(path: string, body: OpfsBody = '') {\n return _put(path, body)\n },\n async delete(path: string) {\n return (await _parent(path)).removeEntry(basename(path), { recursive: true })\n },\n async copy(path: string, to: string, name = basename(path)) {\n return _copyAny(await _handle(path), await _directory(to), name)\n },\n async move(path: string, name: string) {\n await api.copy(path, dirname(path), name)\n await api.delete(path)\n },\n }\n return api\n}\n","const defaultLimit = 64 * 1024\nconst hexByte = (value: number) => value.toString(16).padStart(2, '0')\nconst hexOffset = (value: number) => value.toString(16).padStart(8, '0')\nconst asciiByte = (value: number) => (value >= 32 && value < 127 ? String.fromCharCode(value) : '.')\nconst isZero = (bytes: Uint8Array) => bytes.every((byte) => byte === 0)\n\nexport const hexdump = (bytes: Uint8Array) => {\n const lines = ['offset hex bytes ascii']\n let skippedZeros = false\n for (let offset = 0; offset < bytes.length; offset += 16) {\n const chunk = bytes.subarray(offset, offset + 16)\n if (isZero(chunk)) {\n if (!skippedZeros) lines.push('*')\n skippedZeros = true\n continue\n }\n skippedZeros = false\n const hex = Array.from(chunk, hexByte).join(' ').padEnd(47, ' ')\n const ascii = Array.from(chunk, asciiByte).join('')\n lines.push(`${hexOffset(offset)} ${hex} |${ascii}|`)\n }\n return lines.join('\\n')\n}\n\nexport const hexdumpFile = async (file: File, path: string, limit = defaultLimit) => {\n const size = Math.min(file.size, limit)\n const bytes = new Uint8Array(await file.slice(0, size).arrayBuffer())\n const lines = [`${path}`, `${file.size} bytes`, '', hexdump(bytes)]\n if (size < file.size) lines.push('', `truncated at ${size} bytes`)\n return lines.join('\\n')\n}\n","import { basename, extensionOf } from './path'\nimport { hexdumpFile } from './hex'\nexport type ViewerOption = {\n path: string\n file: File\n source?: Window | null\n}\nconst mimeTypes: Record<string, string> = {\n webmanifest: 'application/manifest+json',\n pdf: 'application/pdf',\n xhtml: 'application/xhtml+xml',\n xml: 'application/xml',\n aac: 'audio/aac',\n flac: 'audio/flac',\n m4a: 'audio/mp4',\n mp3: 'audio/mpeg',\n oga: 'audio/ogg',\n ogg: 'audio/ogg',\n opus: 'audio/ogg',\n wav: 'audio/wav',\n wave: 'audio/wav',\n weba: 'audio/webm',\n apng: 'image/apng',\n avif: 'image/avif',\n bmp: 'image/bmp',\n gif: 'image/gif',\n jfif: 'image/jpeg',\n jpe: 'image/jpeg',\n jpeg: 'image/jpeg',\n jpg: 'image/jpeg',\n pjp: 'image/jpeg',\n pjpeg: 'image/jpeg',\n png: 'image/png',\n svg: 'image/svg+xml',\n ico: 'image/vnd.microsoft.icon',\n webp: 'image/webp',\n cur: 'image/x-icon',\n htm: 'text/html',\n html: 'text/html',\n m4v: 'video/mp4',\n mp4: 'video/mp4',\n ogv: 'video/ogg',\n webm: 'video/webm',\n}\nconst textBytes = 8192\nconst isText = (bytes: Uint8Array) => {\n let controls = 0\n for (const byte of bytes) {\n if (byte === 0) return false\n if (byte < 7 || (byte > 13 && byte < 32)) controls++\n }\n return controls / Math.max(bytes.length, 1) < 0.02\n}\nconst contentTypeOf = (file: File, path: string) => {\n if (file.type && file.type !== 'application/octet-stream') return file.type\n return mimeTypes[extensionOf(path).toLowerCase()] || null\n}\nconst reserveTab = (view: Window, name: string) => {\n const tab = view.open('', '_blank')\n if (!tab) return null\n tab.document.title = name\n tab.document.body.style.margin = '0'\n tab.document.body.style.font = '13px -apple-system, BlinkMacSystemFont, \"SF Pro Text\", sans-serif'\n tab.document.body.textContent = name\n return tab\n}\nconst fileBlob = async (file: File, path: string) => {\n const type = contentTypeOf(file, path)\n if (!type) {\n const bytes = new Uint8Array(await file.slice(0, textBytes).arrayBuffer())\n const text = isText(bytes) ? file : await hexdumpFile(file, path)\n return new Blob([text], { type: 'text/plain' })\n }\n if (file.type === type) return file\n return file.slice(0, file.size, type)\n}\nexport const openFile = async ({ path, file, source }: ViewerOption) => {\n const view = source || window\n const tab = reserveTab(view, basename(path))\n if (!tab) return null\n const url = URL.createObjectURL(await fileBlob(file, path))\n return tab.location.replace(url)\n}\n"],"mappings":"mbAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,GAAA,iBAAAC,KAAA,eAAAC,GAAAJ,ICGA,IAAMK,GAAU,IAAI,IAAI,CAAC,YAAa,cAAe,WAAW,CAAC,EACpDC,EAAQ,CAAmBC,EAAaC,EAAaC,IAAsD,CAChH,QAAWC,KAAOF,EACNH,GAAQ,IAAIK,CAAG,GAAKD,IAASC,EAAKF,EAAEE,CAAG,CAAC,IACxCC,EAAG,IAAIJ,EAAEG,CAAG,CAAC,GAAKC,EAAG,IAAIH,EAAEE,CAAG,CAAC,EAAGJ,EAAMC,EAAEG,CAAG,EAAGF,EAAEE,CAAG,EAAGD,CAAM,EAC7DF,EAAEG,CAAG,EAAIF,EAAEE,CAAG,EAEnC,EACaC,EAAK,CACV,IAAK,MAAM,QACX,IAAMJ,GAA6B,OAAOA,GAAM,UAChD,IAAMA,GAA4B,OAAOA,GAAM,SAC/C,IAAMA,GAA4B,OAAOA,GAAM,SAC/C,IAAMA,GAA8B,OAAOA,GAAM,WACjD,IAAMA,GAA+B,OAAOA,EAAM,IAClD,IAAMA,GAA0BA,IAAM,KACtC,IAAMA,GAAkCA,aAAa,IACrD,IAAMA,GAA2CA,aAAa,IAC9D,IAAMA,GAA4B,CAAC,CAACA,GAAKA,EAAE,YAAY,OAAS,SAChE,IAAMA,GAA4B,OAAOA,GAAM,UAAY,OAAO,MAAMA,CAAC,CACjF,EAWO,IAAMK,EAAO,CAAmBC,EAAiCC,IAAiCD,EAAI,QAAQC,CAAE,EAIhH,IAAMC,EAAY,IAAM,OAAO,OA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export","finder","renderFinder","__toCommonJS","blocked","merge","a","b","ignore","key","is","each","obj","fn","isBrowser","urlProps","docProps","isUnsafe","value","is","append","child","el","create","type","props","args","key","ref","children","style","other","is","merge","el","value","docProps","urlProps","isUnsafe","each","c","append","normalizePath","path","dirname","parts","basename","joinPath","base","name","crumbs","index","flatten","entry","findEntry","child","selectedEntry","id","item","childrenOf","extensionOf","value","visibleEntries","state","query","viewModes","finderActions","initialState","option","sidebarSections","root","name","flatten","entry","materialSymbolsUrl","materialSymbolsReady","ensureMaterialSymbols","link","iconStyle","rowIcon","iconOf","badgeIconOf","sidebarIconOf","viewModeIconOf","sizeOf","size","units","index","dateOf","time","detailRows","ui","mix","values","Icon","name","size","create","mix","iconStyle","InlineIcon","children","rowIcon","ui","FinderView","state","send","ensureMaterialSymbols","entries","visibleEntries","item","selectedEntry","findEntry","columnActivePaths","crumbs","_selected","entry","_entryEvents","event","_details","action","detailRows","row","sidebarSections","section","sidebarIconOf","basename","viewModes","mode","viewModeIconOf","finderActions","iconOf","badgeIconOf","dateOf","sizeOf","value","crumb","path","index","list","childrenOf","createEntry","state","command","name","kind","joinPath","editEntry","entry","fn","copyClipboard","item","infoText","createAPI","option","initialState","_emit","chosen","selectedEntry","refresh","openPath","path","_setClipboard","mode","openEntry","actions","event","file","createOPFS","option","_root","_directory","path","parts","normalizePath","current","part","_parent","dirname","_entry","handle","file","children","child","joinPath","a","b","_handle","dir","name","basename","key","value","_write","body","writable","_put","_copyFile","from","target","next","_copyDirectory","_copyAny","api","source","kind","to","hexByte","value","hexOffset","asciiByte","isZero","bytes","byte","hexdump","lines","skippedZeros","offset","chunk","hex","ascii","hexdumpFile","file","path","limit","size","mimeTypes","textBytes","isText","bytes","controls","byte","contentTypeOf","file","path","extensionOf","reserveTab","view","name","tab","fileBlob","type","text","hexdumpFile","openFile","source","basename","url","panelName","finder","option","isBrowser","config","view","width","height","id","renderFinder","mount","_store","createOPFS","client","createAPI","entry","openFile","paint","FinderView","renderPanelWindow","create","bootPanelWindow"]}
|
package/dist/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type { OpfsEntry, OpfsKind, OpfsOption } from './utils/opfs';
|
|
2
|
-
import type { RenderOption } from './types';
|
|
3
|
-
export type FinderOption = RenderOption & {
|
|
4
|
-
id?: string;
|
|
5
|
-
width?: number;
|
|
6
|
-
height?: number;
|
|
7
|
-
document?: Document;
|
|
8
|
-
};
|
|
9
|
-
export declare const finder: (option?: FinderOption | Event) => Window | null;
|
|
10
|
-
export declare const renderFinder: (mount: HTMLElement, option?: RenderOption) => void;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.tsx"],"names":[],"mappings":"AAMA,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAClC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,SAAQ,YAAY,GAAG,KAAU,kBAUvD,CAAA;AACD,eAAO,MAAM,YAAY,GAAI,OAAO,WAAW,EAAE,SAAQ,YAAiB,SAkBzE,CAAA"}
|
package/dist/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var ce=new Set(["__proto__","constructor","prototype"]),M=(e,t,r)=>{for(let a in t)ce.has(a)||r?.(a,t[a])||(F.obj(e[a])&&F.obj(t[a])?M(e[a],t[a],r):e[a]=t[a])},F={arr:Array.isArray,bol:e=>typeof e=="boolean",str:e=>typeof e=="string",num:e=>typeof e=="number",fun:e=>typeof e=="function",und:e=>typeof e>"u",nul:e=>e===null,set:e=>e instanceof Set,map:e=>e instanceof Map,obj:e=>!!e&&e.constructor.name==="Object",nan:e=>typeof e=="number"&&Number.isNaN(e)};var W=(e,t)=>e.forEach(t);var H=()=>typeof window<"u"&&typeof document<"u";var de=new Set(["href","src","action","formAction","poster","data","cite"]),pe=new Set(["innerHTML","outerHTML","srcdoc"]),ue=e=>F.str(e)&&/^(javascript|vbscript|data):/i.test(e.trim().replace(/[\u0000-\u001f\u007f\s]+/g,"")),me=(e,t)=>{F.num(e)&&(e=e.toString()),F.str(e)&&(e=document.createTextNode(e)),e&&t.appendChild(e)};function n(e,t,...r){t||(t={});let{key:a,ref:l,children:p,style:g,...b}=t;if(r.length||(r=F.arr(p)?p:[p]),F.fun(e))return M(t,{children:r}),e(t);let i=document.createElement(e);return M(i,b,(o,d)=>pe.has(o)||de.has(o)&&ue(d)),g&&M(i.style,g),W(r.flat(),o=>me(o,i)),l&&l(i),i}var h=e=>"/"+e.split("/").filter(Boolean).join("/"),L=e=>{let r=h(e).split("/").filter(Boolean);return r.length<2?"/":"/"+r.slice(0,-1).join("/")},w=e=>h(e).split("/").filter(Boolean).at(-1)||"",T=(e,t)=>h(`${e}/${t}`),O=e=>{let t=h(e).split("/").filter(Boolean);return[{name:"OPFS",path:"/"},...t.map((r,a)=>({name:r,path:"/"+t.slice(0,a+1).join("/")}))]},I=e=>e?[e,...e.children.flatMap(I)]:[],S=(e,t)=>e?e.path===h(t)?e:e.children.map(r=>S(r,t)).find(Boolean)||null:null,C=(e,t)=>I(e).find(r=>r.id===t)||null,j=(e,t)=>S(e,t)?.children||[],K=e=>{let t=e.split(".").at(-1)||"";return t===e?"":t},N=e=>{let t=e.query.toLowerCase();return j(e.root,e.currentPath).filter(r=>`${r.name} ${r.kind} ${r.path}`.toLowerCase().includes(t))};var U=["icons","list","column","gallery"],q=[{key:"open",label:"Open"},{key:"createFile",label:"New File"},{key:"createFolder",label:"New Folder"},{key:"rename",label:"Rename"},{key:"duplicate",label:"Duplicate"},{key:"copy",label:"Copy"},{key:"move",label:"Move"},{key:"paste",label:"Paste"},{key:"remove",label:"Delete"},{key:"copyPath",label:"Copy Path"},{key:"info",label:"Info"}],G=e=>({root:null,currentPath:"/",selectedEntryId:"",viewMode:e.viewMode||"icons",query:"",history:[],future:[],clipboard:null}),Y=e=>[{title:"Favorites",items:[{name:"OPFS",path:"/"},{name:"Recent",path:"/"}]},{title:"Storage",items:["Origin","Databases","Pages"].map(t=>({name:t,path:"/"}))},{title:"Database",items:I(e).filter(t=>t.name.endsWith(".db")).map(t=>({name:t.name,path:t.path}))},{title:"Tags",items:["Red","Orange","Yellow","Green","Blue","Purple","Gray"].map(t=>({name:t,path:"/"}))}],$="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined",V=!1,Q=()=>{if(V||(V=!0,document.head.querySelector(`link[href="${$}"]`)))return;let e=document.createElement("link");e.rel="stylesheet",e.href=$,document.head.appendChild(e)},Z={fontSize:"18px",lineHeight:"1",fontWeight:"400",fontVariationSettings:"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24"},P={display:"inline-flex",alignItems:"center",gap:"6px",minWidth:"0"},E=e=>e.kind==="directory"?"folder":e.name.endsWith(".db")?"database":e.name.endsWith(".page")?"article":e.name.endsWith(".idx")?"account_tree":"description",A=e=>e.name.includes("tombstone")?"delete_sweep":e.name.includes("generated")?"auto_awesome":e.name.includes("lock")?"lock":"",J=e=>e==="OPFS"?"folder_special":e==="Recent"||e==="Origin"?"home_storage":e==="Databases"?"database":e==="Pages"?"article":e.endsWith(".db")?"database":["Red","Orange","Yellow","Green","Blue","Purple","Gray"].includes(e)?"sell":"folder",X={icons:"grid_view",list:"view_list",column:"view_column",gallery:"view_carousel"},B=e=>{if(!e)return"--";let t=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return`${Number((e/1024**r).toFixed(1))} ${t[r]}`},R=e=>e?new Date(e).toLocaleString():"--",ee=e=>[{icon:"badge",value:e.name,strong:!0},{icon:"category",value:e.kind},{icon:"route",value:e.path},{icon:"straighten",value:B(e.size)},{icon:"schedule",value:R(e.modified)}];var m={button:{border:"0",borderRadius:"6px",padding:"5px 8px",background:"transparent",color:"inherit",font:"inherit",cursor:"default"},activeButton:{border:"0",borderRadius:"6px",padding:"5px 8px",background:"#d7dbe4",color:"inherit",font:"inherit",cursor:"default"},field:{border:"1px solid rgba(0,0,0,.12)",borderRadius:"7px",padding:"6px 9px",background:"#fff",font:"inherit",outline:"none"},row:{display:"grid",gridTemplateColumns:"28px 1.5fr 120px 120px 90px 90px",alignItems:"center",height:"28px",padding:"0 10px",gap:"8px"},selected:{background:"#0a84ff",color:"#fff"},inspector:{display:"grid",alignContent:"start",gap:"10px",padding:"16px",borderLeft:"1px solid rgba(0,0,0,.1)",background:"#fff"},ellipsis:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},v=(...e)=>Object.assign({},...e);var y=({name:e,size:t="18px"})=>n("span",{className:"material-symbols-outlined",style:v(Z,{fontSize:t})},e),x=({name:e,children:t})=>n("span",{style:P},n(y,{name:e}),n("span",{style:m.ellipsis},t)),te=({client:{state:e,send:t}})=>{Q();let r=N(e),a=C(e.root,e.selectedEntryId)||r[0]||S(e.root,e.currentPath),l=O(e.currentPath).map(i=>i.path),p=i=>e.selectedEntryId===i.id,g=i=>({oncontextmenu:o=>{o.preventDefault(),t({type:"entryMenu",entry:i})},ondblclick:()=>t({type:"openEntry",entry:i}),onclick:()=>t({type:"select",id:i.id})}),b=(i,o=!1)=>n("aside",{style:m.inspector},i?n("div",{style:{display:"grid",gap:"10px"}},ee(i).map(d=>d.strong?n("strong",{style:P},n(y,{name:d.icon}),n("span",{style:m.ellipsis},d.value)):n(x,{name:d.icon},d.value)),n(x,{name:"sell"},"Tags"),o?n("button",{type:"button",onclick:()=>t({type:"action",key:"info"}),style:m.button},n(y,{name:"info"})):null):null);return n("main",{tabIndex:0,onkeydown:i=>{i.key==="Backspace"&&t({type:"back"}),i.key==="Delete"&&t({type:"action",key:"remove"}),i.key==="Enter"&&t({type:"action",key:"open"}),i.metaKey&&(i.key==="c"&&t({type:"action",key:"copy"}),i.key==="x"&&t({type:"action",key:"move"}),i.key==="v"&&t({type:"action",key:"paste"}),i.key==="i"&&t({type:"action",key:"info"}))},ondragover:i=>i.preventDefault(),ondrop:i=>{i.preventDefault(),t({type:"dropFiles",files:Array.from(i.dataTransfer.files||[])})},style:{display:"grid",gridTemplateColumns:"minmax(160px, 220px) minmax(0, 1fr)",width:"100%",height:"100%",minWidth:"0",overflow:"hidden",color:"#1d1d1f",background:"#eef0f4",font:'13px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif'}},n("aside",{style:{display:"grid",alignContent:"start",gap:"14px",padding:"14px 10px",background:"rgba(235,238,244,.92)",borderRight:"1px solid rgba(0,0,0,.12)",overflow:"auto"}},Y(e.root).map(i=>n("section",{style:{display:"grid",gap:"4px"}},n("p",{style:{...P,margin:"0 8px 3px",color:"#7b8290",fontSize:"11px",fontWeight:"700",textTransform:"uppercase"}},n(y,{name:i.title==="Tags"?"sell":"label"}),n("span",null,i.title)),i.items.map(o=>n("button",{type:"button",onclick:()=>t({type:"openPath",path:o.path}),style:v(m.button,{textAlign:"left"})},n(x,{name:J(o.name)},o.name)))))),n("section",{style:{display:"grid",gridTemplateRows:"48px 1fr 28px",minWidth:"0",minHeight:"0",background:"#f7f8fa"}},n("header",{style:{display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) minmax(0, auto) minmax(130px, 220px)",gap:"8px",alignItems:"center",minWidth:"0",overflow:"hidden",padding:"8px 12px",background:"rgba(250,251,253,.96)",borderBottom:"1px solid rgba(0,0,0,.1)"}},n("div",{style:{display:"flex",gap:"4px",minWidth:"0"}},n("button",{type:"button",onclick:()=>t({type:"back"}),style:m.button},n(y,{name:"chevron_left"})),n("button",{type:"button",onclick:()=>t({type:"forward"}),style:m.button},n(y,{name:"chevron_right"}))),n("strong",{style:v(P,m.ellipsis)},n(y,{name:"folder_open"}),n("span",{style:m.ellipsis},w(e.currentPath)||"OPFS")),n("div",{style:{display:"flex",gap:"3px",minWidth:"0",overflow:"hidden"}},U.map(i=>n("button",{type:"button",onclick:()=>t({type:"setViewMode",mode:i}),style:e.viewMode===i?m.activeButton:m.button},n(y,{name:X[i]})))),n("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"6px",minWidth:"0"}},n("label",{style:{position:"relative",display:"grid",minWidth:"0"}},n("span",{style:{position:"absolute",left:"8px",top:"50%",transform:"translateY(-50%)",color:"#6b7280",display:"inline-flex"}},n(y,{name:"search"})),n("input",{type:"search",value:e.query,oninput:i=>t({type:"setQuery",query:i.target.value}),placeholder:"Search",style:v(m.field,{minWidth:"0",paddingLeft:"31px"})})),n("label",{style:{position:"relative",display:"grid",width:"34px"}},n("span",{style:{position:"absolute",inset:"0",display:"grid",placeItems:"center",pointerEvents:"none"}},n(y,{name:"more_horiz"})),n("select",{onchange:i=>{t({type:"action",key:i.target.value}),i.target.value=""},style:v(m.field,{width:"34px",color:"transparent",appearance:"none",background:"transparent"})},n("option",{value:""},"..."),q.map(i=>n("option",{value:i.key},i.label)))))),n("section",{style:{minWidth:"0",minHeight:"0",overflow:"auto"}},e.viewMode==="icons"?n("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(92px, 1fr))",alignContent:"start",gap:"14px",padding:"18px"}},r.length?null:n("div",{style:{display:"grid",justifyItems:"center",gap:"8px",color:"#7b8290"}},n(y,{name:"folder_off",size:"42px"})),r.map(i=>n("div",{tabIndex:0,draggable:!0,...g(i),style:v({display:"grid",justifyItems:"center",alignContent:"start",gap:"7px",minHeight:"86px",borderRadius:"7px",padding:"8px",textAlign:"center",cursor:"default"},p(i)?m.selected:{})},n("strong",null,n(y,{name:E(i),size:"34px"})),n("span",null,i.name),A(i)?n("small",null,n(y,{name:A(i)})):null))):null,e.viewMode==="list"?n("div",null,n("div",{style:v(m.row,{color:"#687080",fontWeight:"700",borderBottom:"1px solid rgba(0,0,0,.08)"})},n(y,{name:"unfold_more"}),n(x,{name:"sort_by_alpha"},"Name"),n(x,{name:"schedule"},"Modified"),n(x,{name:"event"},"Created"),n(x,{name:"straighten"},"Size"),n(x,{name:"category"},"Kind")),r.map(i=>n("div",{tabIndex:0,draggable:!0,...g(i),style:v(m.row,{cursor:"default"},p(i)?m.selected:{})},n(y,{name:E(i)}),[i.name,R(i.modified),"--",B(i.size)].map(o=>n("span",{style:m.ellipsis},o)),n(x,{name:"category"},i.kind)))):null,e.viewMode==="column"?n("div",{style:{display:"grid",gridAutoFlow:"column",gridAutoColumns:"230px",height:"100%",overflow:"auto"}},O(e.currentPath).map(i=>i.path).concat(e.currentPath).filter((i,o,d)=>d.indexOf(i)===o).map(i=>n("div",{style:{borderRight:"1px solid rgba(0,0,0,.1)",background:"#fff",overflow:"auto"}},j(e.root,i).map(o=>n("div",{tabIndex:0,onclick:()=>t({type:"columnEntry",entry:o}),style:v(m.row,{gridTemplateColumns:"28px 1fr 18px",cursor:"default"},p(o)||l.includes(o.path)?m.selected:{})},n(y,{name:E(o)}),n("span",null,o.name),n("span",null,o.kind==="directory"?n(y,{name:"chevron_right"}):""))))),b(a)):null,e.viewMode==="gallery"?n("div",{style:{display:"grid",gridTemplateColumns:"1fr 260px",gridTemplateRows:"1fr 106px",height:"100%"}},n("div",{style:{display:"grid",placeItems:"center",minHeight:"0",background:"#f2f3f6"}},a?n("div",{style:{display:"grid",justifyItems:"center",gap:"14px"}},n("strong",null,n(y,{name:E(a),size:"64px"})),n("strong",null,a.name)):n(y,{name:"hide_image",size:"54px"})),b(a,!0),n("div",{style:{gridColumn:"1 / 3",display:"grid",gridAutoFlow:"column",gridAutoColumns:"86px",gap:"10px",alignItems:"center",padding:"10px",borderTop:"1px solid rgba(0,0,0,.1)",overflow:"auto",background:"#fafafa"}},r.map(i=>n("button",{type:"button",onclick:()=>t({type:"select",id:i.id}),style:p(i)?m.activeButton:m.button},n(y,{name:E(i)}),n("br",null),i.name)))):null),n("footer",{style:{display:"grid",gridTemplateColumns:"1fr auto auto",gap:"12px",alignItems:"center",padding:"0 12px",color:"#5f6673",borderTop:"1px solid rgba(0,0,0,.08)"}},n("nav",{style:{display:"flex",gap:"4px",overflow:"hidden"}},n(y,{name:"account_tree"}),O(e.currentPath).map(i=>n("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"}},n(y,{name:"chevron_right"}),n("button",{type:"button",onclick:()=>t({type:"openPath",path:i.path}),style:m.button},i.name)))),n(x,{name:"check_circle"},e.selectedEntryId?"1 selected":"0 selected"),n(x,{name:"inventory_2"},r.length," items"))))};var ne=async(e,t,r,a)=>{r&&await t.create(T(e.currentPath,r),a)},ie=async(e,t)=>{e&&await t(e)},ye=async(e,t)=>{let r=e.clipboard;r&&(await t.copy(r.path,e.currentPath),r.mode==="move"&&await t.delete(r.path),e.clipboard=null)},fe=e=>[e.name,e.kind,e.path,e.size?`${e.size} bytes`:"--",e.modified?new Date(e.modified).toLocaleString():"--"].join(`
|
|
2
|
-
`),re=e=>{let t=G(e),r=()=>e.onChange?.(),a=()=>C(t.root,t.selectedEntryId),l=async()=>{t.root=await e.command.get("/"),r()},p=o=>{t.history=[...t.history,t.currentPath],t.future=[],t.currentPath=o,t.selectedEntryId="",r()},g=o=>{let d=a();d&&(t.clipboard={path:d.path,mode:o})},b=async o=>o.kind==="directory"?p(o.path):e.command.open(o),i={async open(){let o=a();o&&await b(o)},async createFile(){await ne(t,e.command,e.view.prompt("New File")?.trim(),"file"),await l()},async createFolder(){await ne(t,e.command,e.view.prompt("New Folder")?.trim(),"directory"),await l()},async rename(){await ie(a(),async o=>{let d=e.view.prompt("Rename",o.name)?.trim();d&&(await e.command.move(o.path,d),t.selectedEntryId=T(t.currentPath,d))}),await l()},async duplicate(){await ie(a(),o=>e.command.copy(o.path,t.currentPath,`${o.name} copy`)),await l()},async remove(){let o=a();o&&e.view.confirm(`Delete ${o.name}?`)&&(await e.command.delete(o.path),t.selectedEntryId="",await l())},async copy(){g("copy")},async move(){g("move")},async paste(){await ye(t,e.command),await l()},async copyPath(){let o=a();o&&await e.view.navigator.clipboard.writeText(o.path)},async info(){let o=a();o&&e.view.alert(fe(o))}};return{refresh:l,state:t,async send(o){if(o.type==="action"){o.key&&await i[o.key]();return}if(o.type==="back"){let d=t.history.at(-1);if(!d)return;t.future=[t.currentPath,...t.future],t.currentPath=d,t.history=t.history.slice(0,-1),r();return}if(o.type==="columnEntry"){if(o.entry.kind==="directory")return p(o.entry.path);t.selectedEntryId=o.entry.id,r();return}if(o.type==="dropFiles"){for(let d of o.files)await e.command.put(T(t.currentPath,d.name),d);await l();return}if(o.type==="entryMenu"){t.selectedEntryId=o.entry.id,r(),await i.info();return}if(o.type==="forward"){let d=t.future[0];if(!d)return;t.history=[...t.history,t.currentPath],t.currentPath=d,t.future=t.future.slice(1),r();return}if(o.type==="openEntry"){await b(o.entry);return}if(o.type==="openPath")return p(o.path);o.type==="select"&&(t.selectedEntryId=o.id),o.type==="setQuery"&&(t.query=o.query),o.type==="setViewMode"&&(t.viewMode=o.mode),r()}}};var oe=(e={})=>{let t=()=>(e.view||window).navigator.storage.getDirectory(),r=async s=>{let c=h(s).split("/").filter(Boolean),u=await t();for(let f of c)u=await u.getDirectoryHandle(f);return u},a=async s=>r(L(s)),l=async(s,c)=>{if(s.kind==="file"){let f=await s.getFile();return{id:h(c),path:h(c),name:s.name,kind:"file",size:f.size,type:f.type,modified:f.lastModified,children:[]}}let u=[];for await(let[,f]of s.entries())u.push(await l(f,T(c,f.name)));return u.sort((f,k)=>f.kind.localeCompare(k.kind)||f.name.localeCompare(k.name)),{id:h(c),path:h(c),name:s.name||"OPFS",kind:"directory",size:0,type:"directory",modified:0,children:u}},p=async s=>{if(h(s)==="/")return t();let c=await a(s),u=w(s);for await(let[f,k]of c.entries())if(f===u)return k;return null},g=async(s,c)=>{let u=await s.createWritable();await u.write(c),await u.close()},b=async(s,c="")=>{let f=await(await a(s)).getFileHandle(w(s),{create:!0});await g(f,c)},i=async(s,c,u)=>{let f=await s.getFile(),k=await c.getFileHandle(u,{create:!0});await g(k,f)},o=async(s,c,u)=>{let f=await c.getDirectoryHandle(u,{create:!0});for await(let[,k]of s.entries())await d(k,f,k.name)},d=async(s,c,u)=>s.kind==="file"?i(s,c,u):o(s,c,u),_={async get(s="/"){let c=await p(s);return c.kind==="file"?c.getFile():l(c,s)},async create(s,c="file",u=""){return c==="directory"?(await a(s)).getDirectoryHandle(w(s),{create:!0}):b(s,u)},async put(s,c=""){return b(s,c)},async delete(s){return(await a(s)).removeEntry(w(s),{recursive:!0})},async copy(s,c,u=w(s)){return d(await p(s),await r(c),u)},async move(s,c){await _.copy(s,L(s),c),await _.delete(s)}};return _};var ge=e=>e.toString(16).padStart(2,"0"),he=e=>e.toString(16).padStart(8,"0"),xe=e=>e>=32&&e<127?String.fromCharCode(e):".",be=e=>e.every(t=>t===0),we=e=>{let t=["offset hex bytes ascii"],r=!1;for(let a=0;a<e.length;a+=16){let l=e.subarray(a,a+16);if(be(l)){r||t.push("*"),r=!0;continue}r=!1;let p=Array.from(l,ge).join(" ").padEnd(47," "),g=Array.from(l,xe).join("");t.push(`${he(a)} ${p} |${g}|`)}return t.join(`
|
|
3
|
-
`)},ae=async(e,t,r=65536)=>{let a=Math.min(e.size,r),l=new Uint8Array(await e.slice(0,a).arrayBuffer()),p=[`${t}`,`${e.size} bytes`,"",we(l)];return a<e.size&&p.push("",`truncated at ${a} bytes`),p.join(`
|
|
4
|
-
`)};var ve={webmanifest:"application/manifest+json",pdf:"application/pdf",xhtml:"application/xhtml+xml",xml:"application/xml",aac:"audio/aac",flac:"audio/flac",m4a:"audio/mp4",mp3:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg",wav:"audio/wav",wave:"audio/wav",weba:"audio/webm",apng:"image/apng",avif:"image/avif",bmp:"image/bmp",gif:"image/gif",jfif:"image/jpeg",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",pjp:"image/jpeg",pjpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",ico:"image/vnd.microsoft.icon",webp:"image/webp",cur:"image/x-icon",htm:"text/html",html:"text/html",m4v:"video/mp4",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},ke=8192,Fe=e=>{let t=0;for(let r of e){if(r===0)return!1;(r<7||r>13&&r<32)&&t++}return t/Math.max(e.length,1)<.02},Te=(e,t)=>e.type&&e.type!=="application/octet-stream"?e.type:ve[K(t).toLowerCase()]||null,Ee=(e,t)=>{let r=e.open("","_blank");return r?(r.document.title=t,r.document.body.style.margin="0",r.document.body.style.font='13px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif',r.document.body.textContent=t,r):null},Me=async(e,t)=>{let r=Te(e,t);if(!r){let a=new Uint8Array(await e.slice(0,ke).arrayBuffer()),l=Fe(a)?e:await ae(e,t);return new Blob([l],{type:"text/plain"})}return e.type===r?e:e.slice(0,e.size,r)},se=async({path:e,file:t,source:r})=>{let l=Ee(r||window,w(e));if(!l)return null;let p=URL.createObjectURL(await Me(t,e));return l.location.replace(p)};var z="opfs-finder",Xe=(e={})=>{if(!H())return null;typeof Event<"u"&&e instanceof Event&&(e={});let t=e,a=(t.document||document).defaultView||window,l=t.width||a.innerWidth,p=t.height||a.innerHeight,g=t.id?`${z}-${t.id}`:z;return a.open(location.href,g,`width=${l},height=${p}`)||null},Pe=(e,t={})=>{let r=e.ownerDocument.defaultView||window,a=oe({view:r}),l=re({...t,command:{...a,async open(g){return se({path:g.path,file:await a.get(g.path),source:r})}},view:r,onChange:()=>p()}),p=()=>{e.replaceChildren(te({client:l}))};l.refresh()},le=()=>{if(!window.name.startsWith(z))return;document.title="OPFS Finder",document.body.style.margin="0";let e=n("div",{style:{width:"100vw",height:"100vh"}});document.body.replaceChildren(e),Pe(e)},Oe=()=>{if(H()){if(document.body)return le();document.addEventListener("DOMContentLoaded",le,{once:!0})}};Oe();export{Xe as finder,Pe as renderFinder};
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/utils/utils.ts","../lib/utils/node.ts","../lib/utils/path.ts","../lib/const.ts","../lib/style.ts","../lib/view.tsx","../lib/utils/api.ts","../lib/utils/opfs.ts","../lib/utils/hex.ts","../lib/utils/viewer.ts","../lib/index.tsx"],"sourcesContent":["export type Merge<T extends object> = Partial<{\n [K in keyof T]: T[K] extends object ? Merge<T[K]> : T[K]\n}>\nconst blocked = new Set(['__proto__', 'constructor', 'prototype'])\nexport const merge = <T extends object>(a: Merge<T>, b: Merge<T>, ignore?: (key: string, value: unknown) => boolean) => {\n for (const key in b) {\n if (blocked.has(key) || ignore?.(key, b[key])) continue\n if (is.obj(a[key]) && is.obj(b[key])) merge(a[key], b[key], ignore)\n else a[key] = b[key]\n }\n}\nexport const is = {\n arr: Array.isArray,\n bol: (a: unknown): a is boolean => typeof a === 'boolean',\n str: (a: unknown): a is string => typeof a === 'string',\n num: (a: unknown): a is number => typeof a === 'number',\n fun: (a: unknown): a is Function => typeof a === 'function',\n und: (a: unknown): a is undefined => typeof a === 'undefined',\n nul: (a: unknown): a is null => a === null,\n set: (a: unknown): a is Set<unknown> => a instanceof Set,\n map: (a: unknown): a is Map<unknown, unknown> => a instanceof Map,\n obj: (a: unknown): a is object => !!a && a.constructor.name === 'Object',\n nan: (a: unknown): a is number => typeof a === 'number' && Number.isNaN(a),\n}\nexport const isServer = () => {\n return typeof window === 'undefined'\n}\n/**\n * each\n */\ntype EachFn<Value, Key, This> = (this: This, value: Value, key: Key) => void\ntype Eachable<Value = any, Key = any, This = any> = {\n forEach(cb: EachFn<Value, Key, This>, ctx?: This): void\n}\nexport const each = <Value, Key, This>(obj: Eachable<Value, Key, This>, fn: EachFn<Value, Key, This>) => obj.forEach(fn)\nexport const flush = <Value extends Function, Key, This>(obj: Eachable<Value, Key, This>, ...args: any[]) => {\n each(obj, (f) => f(...args))\n}\nexport const isBrowser = () => typeof window !== 'undefined' && typeof document !== 'undefined'\n","import { each, is, merge } from './utils'\nimport type { Merge } from './utils'\nexport type HTMLMap = HTMLElementTagNameMap\nexport type HTMLTag = keyof HTMLMap\nexport type HTMLNode<T extends HTMLTag = HTMLTag> = HTMLMap[T] | string | number | null | undefined\nexport type Component<T extends HTMLTag, P = {}, Child = HTMLMap[T]> = (props: P) => Child\nexport type Props<T extends HTMLTag> = Merge<HTMLMap[T]> & {\n key?: string\n ref?: (el: HTMLMap[T]) => void\n children?: HTMLNode | HTMLNode[]\n className?: string\n}\nconst urlProps = new Set(['href', 'src', 'action', 'formAction', 'poster', 'data', 'cite'])\nconst docProps = new Set(['innerHTML', 'outerHTML', 'srcdoc'])\nconst isUnsafe = (value: unknown) => is.str(value) && /^(javascript|vbscript|data):/i.test(value.trim().replace(/[\\u0000-\\u001f\\u007f\\s]+/g, ''))\nexport const append = <El extends Node>(child: Node | string | number | null | undefined, el: El) => {\n if (is.num(child)) child = child.toString()\n if (is.str(child)) child = document.createTextNode(child)\n if (child) el.appendChild(child)\n}\nexport const remove = <El extends Node>(child: Node, el: El) => {\n el.removeChild(child)\n}\nfunction create<T extends HTMLTag>(type: T, props?: Props<T>, ...args: HTMLNode[]): HTMLMap[T]\nfunction create<T extends HTMLTag, P = {}, Child = HTMLMap[T]>(type: Component<T, P, Child>, props?: P, ...args: HTMLNode[]): Child\nfunction create(type: any, props: any, ...args: HTMLNode[]) {\n if (!props) props = {}\n const { key, ref, children, style, ...other } = props\n if (!args.length) args = is.arr(children) ? children : [children]\n if (is.fun(type)) {\n merge(props, { children: args })\n return type(props)\n }\n const el = document.createElement(type)\n merge(el, other, (key, value) => docProps.has(key) || (urlProps.has(key) && isUnsafe(value)))\n if (style) merge(el.style, style)\n each(args.flat(), (c) => append(c, el))\n if (ref) ref(el)\n return el\n}\nexport { create }\nexport default create\n","import type { FinderEntry, FinderState } from '../types'\nexport const normalizePath = (path: string) => {\n const parts = path.split('/').filter(Boolean)\n return '/' + parts.join('/')\n}\nexport const dirname = (path: string) => {\n const normalized = normalizePath(path)\n const parts = normalized.split('/').filter(Boolean)\n if (parts.length < 2) return '/'\n return '/' + parts.slice(0, -1).join('/')\n}\nexport const basename = (path: string) => {\n const parts = normalizePath(path).split('/').filter(Boolean)\n return parts.at(-1) || ''\n}\nexport const joinPath = (base: string, name: string) => normalizePath(`${base}/${name}`)\nexport const crumbs = (path: string) => {\n const parts = normalizePath(path).split('/').filter(Boolean)\n return [{ name: 'OPFS', path: '/' }, ...parts.map((name, index) => ({ name, path: '/' + parts.slice(0, index + 1).join('/') }))]\n}\nexport const flatten = (entry: FinderEntry | null): FinderEntry[] => {\n if (!entry) return []\n return [entry, ...entry.children.flatMap(flatten)]\n}\nexport const findEntry = (entry: FinderEntry | null, path: string): FinderEntry | null => {\n if (!entry) return null\n if (entry.path === normalizePath(path)) return entry\n return entry.children.map((child) => findEntry(child, path)).find(Boolean) || null\n}\nexport const selectedEntry = (entry: FinderEntry | null, id: string) => {\n return flatten(entry).find((item) => item.id === id) || null\n}\nexport const childrenOf = (entry: FinderEntry | null, path: string) => {\n return findEntry(entry, path)?.children || []\n}\nexport const extensionOf = (name: string) => {\n const value = name.split('.').at(-1) || ''\n if (value === name) return ''\n return value\n}\nexport const visibleEntries = (state: FinderState) => {\n const query = state.query.toLowerCase()\n return childrenOf(state.root, state.currentPath).filter((entry) => `${entry.name} ${entry.kind} ${entry.path}`.toLowerCase().includes(query))\n}\n","import type { FinderAction, FinderEntry, FinderSidebarSection, FinderState, RenderOption, ViewMode } from './types'\nimport { flatten } from './utils/path'\nexport const viewModes: ViewMode[] = ['icons', 'list', 'column', 'gallery']\nexport const finderActions: FinderAction[] = [\n { key: 'open', label: 'Open' },\n { key: 'createFile', label: 'New File' },\n { key: 'createFolder', label: 'New Folder' },\n { key: 'rename', label: 'Rename' },\n { key: 'duplicate', label: 'Duplicate' },\n { key: 'copy', label: 'Copy' },\n { key: 'move', label: 'Move' },\n { key: 'paste', label: 'Paste' },\n { key: 'remove', label: 'Delete' },\n { key: 'copyPath', label: 'Copy Path' },\n { key: 'info', label: 'Info' },\n]\nexport const initialState = (option: RenderOption): FinderState => ({\n root: null,\n currentPath: '/',\n selectedEntryId: '',\n viewMode: option.viewMode || 'icons',\n query: '',\n history: [],\n future: [],\n clipboard: null,\n})\nexport const sidebarSections = (root: FinderEntry | null): FinderSidebarSection[] => [\n {\n title: 'Favorites',\n items: [\n { name: 'OPFS', path: '/' },\n { name: 'Recent', path: '/' },\n ],\n },\n { title: 'Storage', items: ['Origin', 'Databases', 'Pages'].map((name) => ({ name, path: '/' })) },\n {\n title: 'Database',\n items: flatten(root)\n .filter((entry) => entry.name.endsWith('.db'))\n .map((entry) => ({ name: entry.name, path: entry.path })),\n },\n { title: 'Tags', items: ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Purple', 'Gray'].map((name) => ({ name, path: '/' })) },\n]\nconst materialSymbolsUrl = 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined'\nlet materialSymbolsReady = false\nexport const ensureMaterialSymbols = () => {\n if (materialSymbolsReady) return\n materialSymbolsReady = true\n if (document.head.querySelector(`link[href=\"${materialSymbolsUrl}\"]`)) return\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = materialSymbolsUrl\n document.head.appendChild(link)\n}\nexport const iconStyle = { fontSize: '18px', lineHeight: '1', fontWeight: '400', fontVariationSettings: \"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24\" }\nexport const rowIcon = { display: 'inline-flex', alignItems: 'center', gap: '6px', minWidth: '0' }\nexport const iconOf = (entry: Pick<FinderEntry, 'kind' | 'name'>) => {\n if (entry.kind === 'directory') return 'folder'\n if (entry.name.endsWith('.db')) return 'database'\n if (entry.name.endsWith('.page')) return 'article'\n if (entry.name.endsWith('.idx')) return 'account_tree'\n return 'description'\n}\nexport const badgeIconOf = (entry: FinderEntry) => {\n if (entry.name.includes('tombstone')) return 'delete_sweep'\n if (entry.name.includes('generated')) return 'auto_awesome'\n if (entry.name.includes('lock')) return 'lock'\n return ''\n}\nexport const sidebarIconOf = (name: string) => {\n if (name === 'OPFS') return 'folder_special'\n if (name === 'Recent') return 'home_storage'\n if (name === 'Origin') return 'home_storage'\n if (name === 'Databases') return 'database'\n if (name === 'Pages') return 'article'\n if (name.endsWith('.db')) return 'database'\n if (['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Purple', 'Gray'].includes(name)) return 'sell'\n return 'folder'\n}\nexport const viewModeIconOf: Record<FinderState['viewMode'], string> = {\n icons: 'grid_view',\n list: 'view_list',\n column: 'view_column',\n gallery: 'view_carousel',\n}\nexport const sizeOf = (size: number) => {\n if (!size) return '--'\n const units = ['B', 'KB', 'MB', 'GB']\n const index = Math.min(Math.floor(Math.log(size) / Math.log(1024)), units.length - 1)\n return `${Number((size / 1024 ** index).toFixed(1))} ${units[index]}`\n}\nexport const dateOf = (time: number) => {\n if (!time) return '--'\n return new Date(time).toLocaleString()\n}\nexport const detailRows = (entry: FinderEntry) => [\n { icon: 'badge', value: entry.name, strong: true },\n { icon: 'category', value: entry.kind },\n { icon: 'route', value: entry.path },\n { icon: 'straighten', value: sizeOf(entry.size) },\n { icon: 'schedule', value: dateOf(entry.modified) },\n]\n","export const ui = {\n button: { border: '0', borderRadius: '6px', padding: '5px 8px', background: 'transparent', color: 'inherit', font: 'inherit', cursor: 'default' },\n activeButton: { border: '0', borderRadius: '6px', padding: '5px 8px', background: '#d7dbe4', color: 'inherit', font: 'inherit', cursor: 'default' },\n field: { border: '1px solid rgba(0,0,0,.12)', borderRadius: '7px', padding: '6px 9px', background: '#fff', font: 'inherit', outline: 'none' },\n row: { display: 'grid', gridTemplateColumns: '28px 1.5fr 120px 120px 90px 90px', alignItems: 'center', height: '28px', padding: '0 10px', gap: '8px' },\n selected: { background: '#0a84ff', color: '#fff' },\n inspector: { display: 'grid', alignContent: 'start', gap: '10px', padding: '16px', borderLeft: '1px solid rgba(0,0,0,.1)', background: '#fff' },\n ellipsis: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },\n}\nexport const mix = (...values: Array<Record<string, string>>) => Object.assign({}, ...values)\n","import * as core from './utils/node'\nimport type { FinderEntry } from './types'\nimport { badgeIconOf, dateOf, detailRows, ensureMaterialSymbols, finderActions, iconOf, iconStyle, rowIcon, sidebarIconOf, sidebarSections, sizeOf, viewModeIconOf, viewModes } from './const'\nimport { basename, childrenOf, crumbs, findEntry, selectedEntry, visibleEntries } from './utils/path'\nimport { mix, ui } from './style'\nimport { API } from './utils/api'\nconst Icon = ({ name, size = '18px' }: { name: string; size?: string }) => (\n <span className=\"material-symbols-outlined\" style={mix(iconStyle, { fontSize: size })}>\n {name}\n </span>\n)\nconst InlineIcon = ({ name, children }: { name: string; children?: any }) => (\n <span style={rowIcon}>\n <Icon name={name} />\n <span style={ui.ellipsis}>{children}</span>\n </span>\n)\nexport const FinderView = ({ client: { state, send } }: { client: API }) => {\n ensureMaterialSymbols()\n const entries = visibleEntries(state)\n const item = selectedEntry(state.root, state.selectedEntryId) || entries[0] || findEntry(state.root, state.currentPath)\n const columnActivePaths = crumbs(state.currentPath).map((item) => item.path)\n const _selected = (entry: FinderEntry) => state.selectedEntryId === entry.id\n const _entryEvents = (entry: FinderEntry) => ({\n oncontextmenu: (event: any) => {\n event.preventDefault()\n send({ type: 'entryMenu', entry })\n },\n ondblclick: () => send({ type: 'openEntry', entry }),\n onclick: () => send({ type: 'select', id: entry.id }),\n })\n const _details = (entry: FinderEntry | null, action = false) => (\n <aside style={ui.inspector}>\n {entry ? (\n <div style={{ display: 'grid', gap: '10px' }}>\n {detailRows(entry).map((row) =>\n row.strong ? (\n <strong style={rowIcon}>\n <Icon name={row.icon} />\n <span style={ui.ellipsis}>{row.value}</span>\n </strong>\n ) : (\n <InlineIcon name={row.icon}>{row.value}</InlineIcon>\n ),\n )}\n <InlineIcon name=\"sell\">Tags</InlineIcon>\n {action ? (\n <button type=\"button\" onclick={() => send({ type: 'action', key: 'info' })} style={ui.button}>\n <Icon name=\"info\" />\n </button>\n ) : null}\n </div>\n ) : null}\n </aside>\n )\n return (\n <main\n tabIndex={0}\n onkeydown={(event: any) => {\n if (event.key === 'Backspace') send({ type: 'back' })\n if (event.key === 'Delete') send({ type: 'action', key: 'remove' })\n if (event.key === 'Enter') send({ type: 'action', key: 'open' })\n if (!event.metaKey) return\n if (event.key === 'c') send({ type: 'action', key: 'copy' })\n if (event.key === 'x') send({ type: 'action', key: 'move' })\n if (event.key === 'v') send({ type: 'action', key: 'paste' })\n if (event.key === 'i') send({ type: 'action', key: 'info' })\n }}\n ondragover={(event: any) => event.preventDefault()}\n ondrop={(event: any) => {\n event.preventDefault()\n send({ type: 'dropFiles', files: Array.from(event.dataTransfer.files || []) })\n }}\n style={{ display: 'grid', gridTemplateColumns: 'minmax(160px, 220px) minmax(0, 1fr)', width: '100%', height: '100%', minWidth: '0', overflow: 'hidden', color: '#1d1d1f', background: '#eef0f4', font: '13px -apple-system, BlinkMacSystemFont, \"SF Pro Text\", sans-serif' }}\n >\n <aside style={{ display: 'grid', alignContent: 'start', gap: '14px', padding: '14px 10px', background: 'rgba(235,238,244,.92)', borderRight: '1px solid rgba(0,0,0,.12)', overflow: 'auto' }}>\n {sidebarSections(state.root).map((section) => (\n <section style={{ display: 'grid', gap: '4px' }}>\n <p style={{ ...rowIcon, margin: '0 8px 3px', color: '#7b8290', fontSize: '11px', fontWeight: '700', textTransform: 'uppercase' }}>\n <Icon name={section.title === 'Tags' ? 'sell' : 'label'} />\n <span>{section.title}</span>\n </p>\n {section.items.map((item) => (\n <button type=\"button\" onclick={() => send({ type: 'openPath', path: item.path })} style={mix(ui.button, { textAlign: 'left' })}>\n <InlineIcon name={sidebarIconOf(item.name)}>{item.name}</InlineIcon>\n </button>\n ))}\n </section>\n ))}\n </aside>\n <section style={{ display: 'grid', gridTemplateRows: '48px 1fr 28px', minWidth: '0', minHeight: '0', background: '#f7f8fa' }}>\n <header style={{ display: 'grid', gridTemplateColumns: 'auto minmax(0, 1fr) minmax(0, auto) minmax(130px, 220px)', gap: '8px', alignItems: 'center', minWidth: '0', overflow: 'hidden', padding: '8px 12px', background: 'rgba(250,251,253,.96)', borderBottom: '1px solid rgba(0,0,0,.1)' }}>\n <div style={{ display: 'flex', gap: '4px', minWidth: '0' }}>\n <button type=\"button\" onclick={() => send({ type: 'back' })} style={ui.button}>\n <Icon name=\"chevron_left\" />\n </button>\n <button type=\"button\" onclick={() => send({ type: 'forward' })} style={ui.button}>\n <Icon name=\"chevron_right\" />\n </button>\n </div>\n <strong style={mix(rowIcon, ui.ellipsis)}>\n <Icon name=\"folder_open\" />\n <span style={ui.ellipsis}>{basename(state.currentPath) || 'OPFS'}</span>\n </strong>\n <div style={{ display: 'flex', gap: '3px', minWidth: '0', overflow: 'hidden' }}>\n {viewModes.map((mode) => (\n <button type=\"button\" onclick={() => send({ type: 'setViewMode', mode })} style={state.viewMode === mode ? ui.activeButton : ui.button}>\n <Icon name={viewModeIconOf[mode]} />\n </button>\n ))}\n </div>\n <div style={{ display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) auto', gap: '6px', minWidth: '0' }}>\n <label style={{ position: 'relative', display: 'grid', minWidth: '0' }}>\n <span style={{ position: 'absolute', left: '8px', top: '50%', transform: 'translateY(-50%)', color: '#6b7280', display: 'inline-flex' }}>\n <Icon name=\"search\" />\n </span>\n <input type=\"search\" value={state.query} oninput={(event: any) => send({ type: 'setQuery', query: event.target.value })} placeholder=\"Search\" style={mix(ui.field, { minWidth: '0', paddingLeft: '31px' })} />\n </label>\n <label style={{ position: 'relative', display: 'grid', width: '34px' }}>\n <span style={{ position: 'absolute', inset: '0', display: 'grid', placeItems: 'center', pointerEvents: 'none' }}>\n <Icon name=\"more_horiz\" />\n </span>\n <select\n onchange={(event: any) => {\n send({ type: 'action', key: event.target.value })\n event.target.value = ''\n }}\n style={mix(ui.field, { width: '34px', color: 'transparent', appearance: 'none', background: 'transparent' })}\n >\n <option value=\"\">...</option>\n {finderActions.map((action) => (\n <option value={action.key}>{action.label}</option>\n ))}\n </select>\n </label>\n </div>\n </header>\n <section style={{ minWidth: '0', minHeight: '0', overflow: 'auto' }}>\n {state.viewMode === 'icons' ? (\n <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(92px, 1fr))', alignContent: 'start', gap: '14px', padding: '18px' }}>\n {!entries.length ? (\n <div style={{ display: 'grid', justifyItems: 'center', gap: '8px', color: '#7b8290' }}>\n <Icon name=\"folder_off\" size=\"42px\" />\n </div>\n ) : null}\n {entries.map((entry) => (\n <div tabIndex={0} draggable={true} {..._entryEvents(entry)} style={mix({ display: 'grid', justifyItems: 'center', alignContent: 'start', gap: '7px', minHeight: '86px', borderRadius: '7px', padding: '8px', textAlign: 'center', cursor: 'default' }, _selected(entry) ? ui.selected : {})}>\n <strong>\n <Icon name={iconOf(entry)} size=\"34px\" />\n </strong>\n <span>{entry.name}</span>\n {badgeIconOf(entry) ? (\n <small>\n <Icon name={badgeIconOf(entry)} />\n </small>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n {state.viewMode === 'list' ? (\n <div>\n <div style={mix(ui.row, { color: '#687080', fontWeight: '700', borderBottom: '1px solid rgba(0,0,0,.08)' })}>\n <Icon name=\"unfold_more\" />\n <InlineIcon name=\"sort_by_alpha\">Name</InlineIcon>\n <InlineIcon name=\"schedule\">Modified</InlineIcon>\n <InlineIcon name=\"event\">Created</InlineIcon>\n <InlineIcon name=\"straighten\">Size</InlineIcon>\n <InlineIcon name=\"category\">Kind</InlineIcon>\n </div>\n {entries.map((entry) => (\n <div tabIndex={0} draggable={true} {..._entryEvents(entry)} style={mix(ui.row, { cursor: 'default' }, _selected(entry) ? ui.selected : {})}>\n <Icon name={iconOf(entry)} />\n {[entry.name, dateOf(entry.modified), '--', sizeOf(entry.size)].map((value) => (\n <span style={ui.ellipsis}>{value}</span>\n ))}\n <InlineIcon name=\"category\">{entry.kind}</InlineIcon>\n </div>\n ))}\n </div>\n ) : null}\n {state.viewMode === 'column' ? (\n <div style={{ display: 'grid', gridAutoFlow: 'column', gridAutoColumns: '230px', height: '100%', overflow: 'auto' }}>\n {crumbs(state.currentPath)\n .map((crumb) => crumb.path)\n .concat(state.currentPath)\n .filter((path, index, list) => list.indexOf(path) === index)\n .map((path) => (\n <div style={{ borderRight: '1px solid rgba(0,0,0,.1)', background: '#fff', overflow: 'auto' }}>\n {childrenOf(state.root, path).map((entry) => (\n <div tabIndex={0} onclick={() => send({ type: 'columnEntry', entry })} style={mix(ui.row, { gridTemplateColumns: '28px 1fr 18px', cursor: 'default' }, _selected(entry) || columnActivePaths.includes(entry.path) ? ui.selected : {})}>\n <Icon name={iconOf(entry)} />\n <span>{entry.name}</span>\n <span>{entry.kind === 'directory' ? <Icon name=\"chevron_right\" /> : ''}</span>\n </div>\n ))}\n </div>\n ))}\n {_details(item)}\n </div>\n ) : null}\n {state.viewMode === 'gallery' ? (\n <div style={{ display: 'grid', gridTemplateColumns: '1fr 260px', gridTemplateRows: '1fr 106px', height: '100%' }}>\n <div style={{ display: 'grid', placeItems: 'center', minHeight: '0', background: '#f2f3f6' }}>\n {item ? (\n <div style={{ display: 'grid', justifyItems: 'center', gap: '14px' }}>\n <strong>\n <Icon name={iconOf(item)} size=\"64px\" />\n </strong>\n <strong>{item.name}</strong>\n </div>\n ) : (\n <Icon name=\"hide_image\" size=\"54px\" />\n )}\n </div>\n {_details(item, true)}\n <div style={{ gridColumn: '1 / 3', display: 'grid', gridAutoFlow: 'column', gridAutoColumns: '86px', gap: '10px', alignItems: 'center', padding: '10px', borderTop: '1px solid rgba(0,0,0,.1)', overflow: 'auto', background: '#fafafa' }}>\n {entries.map((entry) => (\n <button type=\"button\" onclick={() => send({ type: 'select', id: entry.id })} style={_selected(entry) ? ui.activeButton : ui.button}>\n <Icon name={iconOf(entry)} />\n <br />\n {entry.name}\n </button>\n ))}\n </div>\n </div>\n ) : null}\n </section>\n <footer style={{ display: 'grid', gridTemplateColumns: '1fr auto auto', gap: '12px', alignItems: 'center', padding: '0 12px', color: '#5f6673', borderTop: '1px solid rgba(0,0,0,.08)' }}>\n <nav style={{ display: 'flex', gap: '4px', overflow: 'hidden' }}>\n <Icon name=\"account_tree\" />\n {crumbs(state.currentPath).map((crumb) => (\n <span style={{ display: 'inline-flex', alignItems: 'center', gap: '4px' }}>\n <Icon name=\"chevron_right\" />\n <button type=\"button\" onclick={() => send({ type: 'openPath', path: crumb.path })} style={ui.button}>\n {crumb.name}\n </button>\n </span>\n ))}\n </nav>\n <InlineIcon name=\"check_circle\">{state.selectedEntryId ? '1 selected' : '0 selected'}</InlineIcon>\n <InlineIcon name=\"inventory_2\">{entries.length} items</InlineIcon>\n </footer>\n </section>\n </main>\n )\n}\n","import { initialState } from '../const'\nimport { joinPath, selectedEntry } from './path'\nimport type { APIOption, ClipboardMode, Command, EntryKind, FinderActionKey, FinderEntry, FinderEvent, FinderState } from '../types'\nconst createEntry = async (state: FinderState, command: Command, name: string | null | undefined, kind: EntryKind) => {\n if (!name) return\n await command.create(joinPath(state.currentPath, name), kind)\n}\nconst editEntry = async (entry: FinderEntry | null, fn: (entry: FinderEntry) => Promise<unknown>) => {\n if (!entry) return\n await fn(entry)\n}\nconst copyClipboard = async (state: FinderState, command: Command) => {\n const item = state.clipboard\n if (!item) return\n await command.copy(item.path, state.currentPath)\n if (item.mode === 'move') await command.delete(item.path)\n state.clipboard = null\n}\n\nconst infoText = (entry: FinderEntry) => [entry.name, entry.kind, entry.path, entry.size ? `${entry.size} bytes` : '--', entry.modified ? new Date(entry.modified).toLocaleString() : '--'].join('\\n')\nexport const createAPI = (option: APIOption) => {\n const state = initialState(option)\n const _emit = () => option.onChange?.()\n const chosen = () => selectedEntry(state.root, state.selectedEntryId)\n const refresh = async () => {\n state.root = await option.command.get('/')\n _emit()\n }\n const openPath = (path: string) => {\n state.history = [...state.history, state.currentPath]\n state.future = []\n state.currentPath = path\n state.selectedEntryId = ''\n _emit()\n }\n const _setClipboard = (mode: ClipboardMode) => {\n const entry = chosen()\n if (!entry) return\n state.clipboard = { path: entry.path, mode }\n }\n const openEntry = async (entry: FinderEntry) => {\n if (entry.kind === 'directory') return openPath(entry.path)\n return option.command.open(entry)\n }\n const actions: Record<FinderActionKey, () => Promise<void>> = {\n async open() {\n const entry = chosen()\n if (entry) await openEntry(entry)\n },\n async createFile() {\n await createEntry(state, option.command, option.view.prompt('New File')?.trim(), 'file')\n await refresh()\n },\n async createFolder() {\n await createEntry(state, option.command, option.view.prompt('New Folder')?.trim(), 'directory')\n await refresh()\n },\n async rename() {\n await editEntry(chosen(), async (entry) => {\n const name = option.view.prompt('Rename', entry.name)?.trim()\n if (!name) return\n await option.command.move(entry.path, name)\n state.selectedEntryId = joinPath(state.currentPath, name)\n })\n await refresh()\n },\n async duplicate() {\n await editEntry(chosen(), (entry) => option.command.copy(entry.path, state.currentPath, `${entry.name} copy`))\n await refresh()\n },\n async remove() {\n const entry = chosen()\n if (!entry) return\n if (!option.view.confirm(`Delete ${entry.name}?`)) return\n await option.command.delete(entry.path)\n state.selectedEntryId = ''\n await refresh()\n },\n async copy() {\n _setClipboard('copy')\n },\n async move() {\n _setClipboard('move')\n },\n async paste() {\n await copyClipboard(state, option.command)\n await refresh()\n },\n async copyPath() {\n const entry = chosen()\n if (entry) await option.view.navigator.clipboard.writeText(entry.path)\n },\n async info() {\n const entry = chosen()\n if (entry) option.view.alert(infoText(entry))\n },\n }\n return {\n refresh,\n state,\n async send(event: FinderEvent) {\n if (event.type === 'action') {\n if (event.key) await actions[event.key]()\n return\n }\n if (event.type === 'back') {\n const path = state.history.at(-1)\n if (!path) return\n state.future = [state.currentPath, ...state.future]\n state.currentPath = path\n state.history = state.history.slice(0, -1)\n _emit()\n return\n }\n if (event.type === 'columnEntry') {\n if (event.entry.kind === 'directory') return openPath(event.entry.path)\n state.selectedEntryId = event.entry.id\n _emit()\n return\n }\n if (event.type === 'dropFiles') {\n for (const file of event.files) await option.command.put(joinPath(state.currentPath, file.name), file)\n await refresh()\n return\n }\n if (event.type === 'entryMenu') {\n state.selectedEntryId = event.entry.id\n _emit()\n await actions.info()\n return\n }\n if (event.type === 'forward') {\n const path = state.future[0]\n if (!path) return\n state.history = [...state.history, state.currentPath]\n state.currentPath = path\n state.future = state.future.slice(1)\n _emit()\n return\n }\n if (event.type === 'openEntry') {\n await openEntry(event.entry)\n return\n }\n if (event.type === 'openPath') return openPath(event.path)\n if (event.type === 'select') state.selectedEntryId = event.id\n if (event.type === 'setQuery') state.query = event.query\n if (event.type === 'setViewMode') state.viewMode = event.mode\n _emit()\n },\n }\n}\nexport type API = ReturnType<typeof createAPI>\n","import { basename, dirname, joinPath, normalizePath } from './path'\nexport type OpfsKind = 'directory' | 'file'\nexport type OpfsBody = BlobPart\nexport type OpfsOption = {\n view?: Window\n}\nexport type OpfsEntry = {\n id: string\n path: string\n name: string\n kind: OpfsKind\n size: number\n type: string\n modified: number\n children: OpfsEntry[]\n}\nexport const createOPFS = (option: OpfsOption = {}) => {\n const _root = () => (option.view || window).navigator.storage.getDirectory()\n const _directory = async (path: string) => {\n const parts = normalizePath(path).split('/').filter(Boolean)\n let current = await _root()\n for (const part of parts) current = await current.getDirectoryHandle(part)\n return current\n }\n const _parent = async (path: string) => {\n return _directory(dirname(path))\n }\n const _entry = async (handle: any, path: string): Promise<OpfsEntry> => {\n if (handle.kind === 'file') {\n const file = await handle.getFile()\n return { id: normalizePath(path), path: normalizePath(path), name: handle.name, kind: 'file', size: file.size, type: file.type, modified: file.lastModified, children: [] }\n }\n const children: OpfsEntry[] = []\n for await (const [, child] of handle.entries()) children.push(await _entry(child, joinPath(path, child.name)))\n children.sort((a, b) => a.kind.localeCompare(b.kind) || a.name.localeCompare(b.name))\n return { id: normalizePath(path), path: normalizePath(path), name: handle.name || 'OPFS', kind: 'directory', size: 0, type: 'directory', modified: 0, children }\n }\n const _handle = async (path: string) => {\n if (normalizePath(path) === '/') return _root()\n const dir = await _parent(path)\n const name = basename(path)\n for await (const [key, value] of dir.entries()) if (key === name) return value\n return null\n }\n const _write = async (file: FileSystemFileHandle, body: OpfsBody) => {\n const writable = await file.createWritable()\n await writable.write(body)\n await writable.close()\n }\n const _put = async (path: string, body: OpfsBody = '') => {\n const dir = await _parent(path)\n const file = await dir.getFileHandle(basename(path), { create: true })\n await _write(file, body)\n }\n const _copyFile = async (from: any, target: FileSystemDirectoryHandle, name: string) => {\n const file = await from.getFile()\n const next = await target.getFileHandle(name, { create: true })\n await _write(next, file)\n }\n const _copyDirectory = async (from: any, target: FileSystemDirectoryHandle, name: string) => {\n const next = await target.getDirectoryHandle(name, { create: true })\n for await (const [, child] of from.entries()) await _copyAny(child, next, child.name)\n }\n const _copyAny = async (from: any, target: FileSystemDirectoryHandle, name: string) => {\n if (from.kind === 'file') return _copyFile(from, target, name)\n return _copyDirectory(from, target, name)\n }\n const api = {\n async get(path = '/') {\n const source = (await _handle(path)) as any\n if (source.kind === 'file') return source.getFile()\n return _entry(source, path)\n },\n async create(path: string, kind: OpfsKind = 'file', body: OpfsBody = '') {\n if (kind === 'directory') return (await _parent(path)).getDirectoryHandle(basename(path), { create: true })\n return _put(path, body)\n },\n async put(path: string, body: OpfsBody = '') {\n return _put(path, body)\n },\n async delete(path: string) {\n return (await _parent(path)).removeEntry(basename(path), { recursive: true })\n },\n async copy(path: string, to: string, name = basename(path)) {\n return _copyAny(await _handle(path), await _directory(to), name)\n },\n async move(path: string, name: string) {\n await api.copy(path, dirname(path), name)\n await api.delete(path)\n },\n }\n return api\n}\n","const defaultLimit = 64 * 1024\nconst hexByte = (value: number) => value.toString(16).padStart(2, '0')\nconst hexOffset = (value: number) => value.toString(16).padStart(8, '0')\nconst asciiByte = (value: number) => (value >= 32 && value < 127 ? String.fromCharCode(value) : '.')\nconst isZero = (bytes: Uint8Array) => bytes.every((byte) => byte === 0)\n\nexport const hexdump = (bytes: Uint8Array) => {\n const lines = ['offset hex bytes ascii']\n let skippedZeros = false\n for (let offset = 0; offset < bytes.length; offset += 16) {\n const chunk = bytes.subarray(offset, offset + 16)\n if (isZero(chunk)) {\n if (!skippedZeros) lines.push('*')\n skippedZeros = true\n continue\n }\n skippedZeros = false\n const hex = Array.from(chunk, hexByte).join(' ').padEnd(47, ' ')\n const ascii = Array.from(chunk, asciiByte).join('')\n lines.push(`${hexOffset(offset)} ${hex} |${ascii}|`)\n }\n return lines.join('\\n')\n}\n\nexport const hexdumpFile = async (file: File, path: string, limit = defaultLimit) => {\n const size = Math.min(file.size, limit)\n const bytes = new Uint8Array(await file.slice(0, size).arrayBuffer())\n const lines = [`${path}`, `${file.size} bytes`, '', hexdump(bytes)]\n if (size < file.size) lines.push('', `truncated at ${size} bytes`)\n return lines.join('\\n')\n}\n","import { basename, extensionOf } from './path'\nimport { hexdumpFile } from './hex'\nexport type ViewerOption = {\n path: string\n file: File\n source?: Window | null\n}\nconst mimeTypes: Record<string, string> = {\n webmanifest: 'application/manifest+json',\n pdf: 'application/pdf',\n xhtml: 'application/xhtml+xml',\n xml: 'application/xml',\n aac: 'audio/aac',\n flac: 'audio/flac',\n m4a: 'audio/mp4',\n mp3: 'audio/mpeg',\n oga: 'audio/ogg',\n ogg: 'audio/ogg',\n opus: 'audio/ogg',\n wav: 'audio/wav',\n wave: 'audio/wav',\n weba: 'audio/webm',\n apng: 'image/apng',\n avif: 'image/avif',\n bmp: 'image/bmp',\n gif: 'image/gif',\n jfif: 'image/jpeg',\n jpe: 'image/jpeg',\n jpeg: 'image/jpeg',\n jpg: 'image/jpeg',\n pjp: 'image/jpeg',\n pjpeg: 'image/jpeg',\n png: 'image/png',\n svg: 'image/svg+xml',\n ico: 'image/vnd.microsoft.icon',\n webp: 'image/webp',\n cur: 'image/x-icon',\n htm: 'text/html',\n html: 'text/html',\n m4v: 'video/mp4',\n mp4: 'video/mp4',\n ogv: 'video/ogg',\n webm: 'video/webm',\n}\nconst textBytes = 8192\nconst isText = (bytes: Uint8Array) => {\n let controls = 0\n for (const byte of bytes) {\n if (byte === 0) return false\n if (byte < 7 || (byte > 13 && byte < 32)) controls++\n }\n return controls / Math.max(bytes.length, 1) < 0.02\n}\nconst contentTypeOf = (file: File, path: string) => {\n if (file.type && file.type !== 'application/octet-stream') return file.type\n return mimeTypes[extensionOf(path).toLowerCase()] || null\n}\nconst reserveTab = (view: Window, name: string) => {\n const tab = view.open('', '_blank')\n if (!tab) return null\n tab.document.title = name\n tab.document.body.style.margin = '0'\n tab.document.body.style.font = '13px -apple-system, BlinkMacSystemFont, \"SF Pro Text\", sans-serif'\n tab.document.body.textContent = name\n return tab\n}\nconst fileBlob = async (file: File, path: string) => {\n const type = contentTypeOf(file, path)\n if (!type) {\n const bytes = new Uint8Array(await file.slice(0, textBytes).arrayBuffer())\n const text = isText(bytes) ? file : await hexdumpFile(file, path)\n return new Blob([text], { type: 'text/plain' })\n }\n if (file.type === type) return file\n return file.slice(0, file.size, type)\n}\nexport const openFile = async ({ path, file, source }: ViewerOption) => {\n const view = source || window\n const tab = reserveTab(view, basename(path))\n if (!tab) return null\n const url = URL.createObjectURL(await fileBlob(file, path))\n return tab.location.replace(url)\n}\n","import * as core from './utils/node'\nimport { FinderView } from './view'\nimport { createAPI } from './utils/api'\nimport { createOPFS } from './utils/opfs'\nimport { openFile } from './utils/viewer'\nimport { isBrowser } from './utils/utils'\nexport type { OpfsEntry, OpfsKind, OpfsOption } from './utils/opfs'\nimport type { RenderOption } from './types'\nexport type FinderOption = RenderOption & {\n id?: string\n width?: number\n height?: number\n document?: Document\n}\nconst panelName = 'opfs-finder'\nexport const finder = (option: FinderOption | Event = {}) => {\n if (!isBrowser()) return null\n if (typeof Event !== 'undefined' && option instanceof Event) option = {}\n const config = option as FinderOption\n const owner = config.document || document\n const view = owner.defaultView || window\n const width = config.width || view.innerWidth\n const height = config.height || view.innerHeight\n const id = config.id ? `${panelName}-${config.id}` : panelName\n return view.open(location.href, id, `width=${width},height=${height}`) || null\n}\nexport const renderFinder = (mount: HTMLElement, option: RenderOption = {}) => {\n const view = mount.ownerDocument.defaultView || window\n const _store = createOPFS({ view })\n const client = createAPI({\n ...option,\n command: {\n ..._store,\n async open(entry) {\n return openFile({ path: entry.path, file: await _store.get(entry.path), source: view })\n },\n },\n view,\n onChange: () => paint(),\n })\n const paint = () => {\n mount.replaceChildren(FinderView({ client }))\n }\n client.refresh()\n}\nconst renderPanelWindow = () => {\n if (!window.name.startsWith(panelName)) return\n document.title = 'OPFS Finder'\n document.body.style.margin = '0'\n const mount = <div style={{ width: '100vw', height: '100vh' }} />\n document.body.replaceChildren(mount)\n renderFinder(mount)\n}\nconst bootPanelWindow = () => {\n if (!isBrowser()) return\n if (document.body) return renderPanelWindow()\n document.addEventListener('DOMContentLoaded', renderPanelWindow, { once: true })\n}\nbootPanelWindow()\n"],"mappings":"AAGA,IAAMA,GAAU,IAAI,IAAI,CAAC,YAAa,cAAe,WAAW,CAAC,EACpDC,EAAQ,CAAmBC,EAAaC,EAAaC,IAAsD,CAChH,QAAWC,KAAOF,EACNH,GAAQ,IAAIK,CAAG,GAAKD,IAASC,EAAKF,EAAEE,CAAG,CAAC,IACxCC,EAAG,IAAIJ,EAAEG,CAAG,CAAC,GAAKC,EAAG,IAAIH,EAAEE,CAAG,CAAC,EAAGJ,EAAMC,EAAEG,CAAG,EAAGF,EAAEE,CAAG,EAAGD,CAAM,EAC7DF,EAAEG,CAAG,EAAIF,EAAEE,CAAG,EAEnC,EACaC,EAAK,CACV,IAAK,MAAM,QACX,IAAMJ,GAA6B,OAAOA,GAAM,UAChD,IAAMA,GAA4B,OAAOA,GAAM,SAC/C,IAAMA,GAA4B,OAAOA,GAAM,SAC/C,IAAMA,GAA8B,OAAOA,GAAM,WACjD,IAAMA,GAA+B,OAAOA,EAAM,IAClD,IAAMA,GAA0BA,IAAM,KACtC,IAAMA,GAAkCA,aAAa,IACrD,IAAMA,GAA2CA,aAAa,IAC9D,IAAMA,GAA4B,CAAC,CAACA,GAAKA,EAAE,YAAY,OAAS,SAChE,IAAMA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ACtB,GAAKlB,EAAU,EACf,IAAI,SAAS,KAAM,OAAOgB,GAAkB,EAC5C,SAAS,iBAAiB,mBAAoBA,GAAmB,CAAE,KAAM,EAAK,CAAC,EACvF,EACAE,GAAgB","names":["blocked","merge","a","b","ignore","key","is","each","obj","fn","isBrowser","urlProps","docProps","isUnsafe","value","is","append","child","el","create","type","props","args","key","ref","children","style","other","is","merge","el","value","docProps","urlProps","isUnsafe","each","c","append","normalizePath","path","dirname","parts","basename","joinPath","base","name","crumbs","index","flatten","entry","findEntry","child","selectedEntry","id","item","childrenOf","extensionOf","value","visibleEntries","state","query","viewModes","finderActions","initialState","option","sidebarSections","root","name","flatten","entry","materialSymbolsUrl","materialSymbolsReady","ensureMaterialSymbols","link","iconStyle","rowIcon","iconOf","badgeIconOf","sidebarIconOf","viewModeIconOf","sizeOf","size","units","index","dateOf","time","detailRows","ui","mix","values","Icon","name","size","create","mix","iconStyle","InlineIcon","children","rowIcon","ui","FinderView","state","send","ensureMaterialSymbols","entries","visibleEntries","item","selectedEntry","findEntry","columnActivePaths","crumbs","_selected","entry","_entryEvents","event","_details","action","detailRows","row","sidebarSections","section","sidebarIconOf","basename","viewModes","mode","viewModeIconOf","finderActions","iconOf","badgeIconOf","dateOf","sizeOf","value","crumb","path","index","list","childrenOf","createEntry","state","command","name","kind","joinPath","editEntry","entry","fn","copyClipboard","item","infoText","createAPI","option","initialState","_emit","chosen","selectedEntry","refresh","openPath","path","_setClipboard","mode","openEntry","actions","event","file","createOPFS","option","_root","_directory","path","parts","normalizePath","current","part","_parent","dirname","_entry","handle","file","children","child","joinPath","a","b","_handle","dir","name","basename","key","value","_write","body","writable","_put","_copyFile","from","target","next","_copyDirectory","_copyAny","api","source","kind","to","hexByte","value","hexOffset","asciiByte","isZero","bytes","byte","hexdump","lines","skippedZeros","offset","chunk","hex","ascii","hexdumpFile","file","path","limit","size","mimeTypes","textBytes","isText","bytes","controls","byte","contentTypeOf","file","path","extensionOf","reserveTab","view","name","tab","fileBlob","type","text","hexdumpFile","openFile","source","basename","url","panelName","finder","option","isBrowser","config","view","width","height","id","renderFinder","mount","_store","createOPFS","client","createAPI","entry","openFile","paint","FinderView","renderPanelWindow","create","bootPanelWindow"]}
|
package/dist/style.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export declare const ui: {
|
|
2
|
-
button: {
|
|
3
|
-
border: string;
|
|
4
|
-
borderRadius: string;
|
|
5
|
-
padding: string;
|
|
6
|
-
background: string;
|
|
7
|
-
color: string;
|
|
8
|
-
font: string;
|
|
9
|
-
cursor: string;
|
|
10
|
-
};
|
|
11
|
-
activeButton: {
|
|
12
|
-
border: string;
|
|
13
|
-
borderRadius: string;
|
|
14
|
-
padding: string;
|
|
15
|
-
background: string;
|
|
16
|
-
color: string;
|
|
17
|
-
font: string;
|
|
18
|
-
cursor: string;
|
|
19
|
-
};
|
|
20
|
-
field: {
|
|
21
|
-
border: string;
|
|
22
|
-
borderRadius: string;
|
|
23
|
-
padding: string;
|
|
24
|
-
background: string;
|
|
25
|
-
font: string;
|
|
26
|
-
outline: string;
|
|
27
|
-
};
|
|
28
|
-
row: {
|
|
29
|
-
display: string;
|
|
30
|
-
gridTemplateColumns: string;
|
|
31
|
-
alignItems: string;
|
|
32
|
-
height: string;
|
|
33
|
-
padding: string;
|
|
34
|
-
gap: string;
|
|
35
|
-
};
|
|
36
|
-
selected: {
|
|
37
|
-
background: string;
|
|
38
|
-
color: string;
|
|
39
|
-
};
|
|
40
|
-
inspector: {
|
|
41
|
-
display: string;
|
|
42
|
-
alignContent: string;
|
|
43
|
-
gap: string;
|
|
44
|
-
padding: string;
|
|
45
|
-
borderLeft: string;
|
|
46
|
-
background: string;
|
|
47
|
-
};
|
|
48
|
-
ellipsis: {
|
|
49
|
-
overflow: string;
|
|
50
|
-
textOverflow: string;
|
|
51
|
-
whiteSpace: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
export declare const mix: (...values: Array<Record<string, string>>) => any;
|
|
55
|
-
//# sourceMappingURL=style.d.ts.map
|
package/dist/style.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../lib/style.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQd,CAAA;AACD,eAAO,MAAM,GAAG,GAAI,GAAG,QAAQ,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAAiC,CAAA"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
export type ViewMode = 'icons' | 'list' | 'column' | 'gallery';
|
|
2
|
-
export type EntryKind = 'directory' | 'file';
|
|
3
|
-
export type ClipboardMode = 'copy' | 'move';
|
|
4
|
-
export type FinderEntry = {
|
|
5
|
-
id: string;
|
|
6
|
-
path: string;
|
|
7
|
-
name: string;
|
|
8
|
-
kind: EntryKind;
|
|
9
|
-
size: number;
|
|
10
|
-
type: string;
|
|
11
|
-
modified: number;
|
|
12
|
-
children: FinderEntry[];
|
|
13
|
-
};
|
|
14
|
-
export type FinderState = {
|
|
15
|
-
root: FinderEntry | null;
|
|
16
|
-
currentPath: string;
|
|
17
|
-
selectedEntryId: string;
|
|
18
|
-
viewMode: ViewMode;
|
|
19
|
-
query: string;
|
|
20
|
-
history: string[];
|
|
21
|
-
future: string[];
|
|
22
|
-
clipboard: {
|
|
23
|
-
path: string;
|
|
24
|
-
mode: ClipboardMode;
|
|
25
|
-
} | null;
|
|
26
|
-
};
|
|
27
|
-
export type FinderActionKey = 'open' | 'createFile' | 'createFolder' | 'rename' | 'duplicate' | 'remove' | 'copy' | 'move' | 'paste' | 'copyPath' | 'info';
|
|
28
|
-
export type FinderEvent = {
|
|
29
|
-
type: 'action';
|
|
30
|
-
key: FinderActionKey | '';
|
|
31
|
-
} | {
|
|
32
|
-
type: 'back';
|
|
33
|
-
} | {
|
|
34
|
-
type: 'columnEntry';
|
|
35
|
-
entry: FinderEntry;
|
|
36
|
-
} | {
|
|
37
|
-
type: 'dropFiles';
|
|
38
|
-
files: File[];
|
|
39
|
-
} | {
|
|
40
|
-
type: 'entryMenu';
|
|
41
|
-
entry: FinderEntry;
|
|
42
|
-
} | {
|
|
43
|
-
type: 'forward';
|
|
44
|
-
} | {
|
|
45
|
-
type: 'openEntry';
|
|
46
|
-
entry: FinderEntry;
|
|
47
|
-
} | {
|
|
48
|
-
type: 'openPath';
|
|
49
|
-
path: string;
|
|
50
|
-
} | {
|
|
51
|
-
type: 'select';
|
|
52
|
-
id: string;
|
|
53
|
-
} | {
|
|
54
|
-
type: 'setQuery';
|
|
55
|
-
query: string;
|
|
56
|
-
} | {
|
|
57
|
-
type: 'setViewMode';
|
|
58
|
-
mode: ViewMode;
|
|
59
|
-
};
|
|
60
|
-
export type Command = {
|
|
61
|
-
copy: (path: string, directory: string, name?: string) => Promise<unknown>;
|
|
62
|
-
create: (path: string, kind: EntryKind) => Promise<unknown>;
|
|
63
|
-
delete: (path: string) => Promise<unknown>;
|
|
64
|
-
get: (path?: string) => Promise<any>;
|
|
65
|
-
move: (path: string, name: string) => Promise<unknown>;
|
|
66
|
-
open: (entry: FinderEntry) => Promise<unknown>;
|
|
67
|
-
put: (path: string, body: BlobPart) => Promise<unknown>;
|
|
68
|
-
};
|
|
69
|
-
export type APIOption = RenderOption & {
|
|
70
|
-
command: Command;
|
|
71
|
-
view: Window;
|
|
72
|
-
onChange?: () => void;
|
|
73
|
-
};
|
|
74
|
-
export type FinderAction = {
|
|
75
|
-
key: FinderActionKey;
|
|
76
|
-
label: string;
|
|
77
|
-
};
|
|
78
|
-
export type FinderSidebarSection = {
|
|
79
|
-
title: string;
|
|
80
|
-
items: Array<{
|
|
81
|
-
name: string;
|
|
82
|
-
path: string;
|
|
83
|
-
}>;
|
|
84
|
-
};
|
|
85
|
-
export type RenderOption = {
|
|
86
|
-
viewMode?: ViewMode;
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;AAC9D,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,MAAM,CAAA;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAA;AAC3C,MAAM,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,WAAW,EAAE,CAAA;CAC9B,CAAA;AACD,MAAM,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,QAAQ,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,aAAa,CAAA;KAAE,GAAG,IAAI,CAAA;CAC9D,CAAA;AACD,MAAM,MAAM,eAAe,GACjB,MAAM,GACN,YAAY,GACZ,cAAc,GACd,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,UAAU,GACV,MAAM,CAAA;AAChB,MAAM,MAAM,WAAW,GACb;IAAE,IAAI,E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AE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACtD,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9C,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9D,CAAA;AACD,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CAC5B,CAAA;AACD,MAAM,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,eAAe,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACnD,CAAA;AACD,MAAM,MAAM,YAAY,GAAG;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAC1B,CAAA"}
|
package/dist/utils/api.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { APIOption, FinderEvent, FinderState } from '../types';
|
|
2
|
-
export declare const createAPI: (option: APIOption) => {
|
|
3
|
-
refresh: () => Promise<void>;
|
|
4
|
-
state: FinderState;
|
|
5
|
-
send(event: FinderEvent): Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
export type API = ReturnType<typeof createAPI>;
|
|
8
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/utils/api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../lib/utils/api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAmE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAkBpI,eAAO,MAAM,SAAS,GAAI,QAAQ,SAAS;;;gBAgFT,WAAW;CAmD5C,CAAA;AACD,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
package/dist/utils/hex.d.ts
DELETED
package/dist/utils/hex.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../lib/utils/hex.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,GAAI,OAAO,UAAU,WAgBxC,CAAA;AAED,eAAO,MAAM,WAAW,GAAU,MAAM,IAAI,EAAE,MAAM,MAAM,EAAE,cAAoB,oBAM/E,CAAA"}
|
package/dist/utils/jsx.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { HTMLTag, Props } from './node';
|
|
2
|
-
type IntrinsicElementMap = {
|
|
3
|
-
[T in HTMLTag]: Props<T>;
|
|
4
|
-
};
|
|
5
|
-
declare global {
|
|
6
|
-
namespace JSX {
|
|
7
|
-
interface Element extends HTMLElement {
|
|
8
|
-
}
|
|
9
|
-
interface IntrinsicElements extends IntrinsicElementMap {
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const Fragment: ({ children }: any) => any;
|
|
14
|
-
export declare const jsx: (type: any, props: any, key?: any) => any;
|
|
15
|
-
export declare const jsxs: (type: any, props: any, key?: any) => any;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=jsx.d.ts.map
|
package/dist/utils/jsx.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsx.d.ts","sourceRoot":"","sources":["../../lib/utils/jsx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC5C,KAAK,mBAAmB,GAAG;KAClB,CAAC,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;CAC/B,CAAA;AACD,OAAO,CAAC,MAAM,CAAC;IACP,UAAU,GAAG,CAAC;QACN,UAAU,OAAQ,SAAQ,WAAW;SAAG;QACxC,UAAU,iBAAkB,SAAQ,mBAAmB;SAAG;KACjE;CACR;AACD,eAAO,MAAM,QAAQ,GAAI,cAAc,GAAG,QAAa,CAAA;AACvD,eAAO,MAAM,GAAG,GAAI,MAAM,GAAG,EAAE,OAAO,GAAG,EAAE,MAAM,GAAG,QAOnD,CAAA;AACD,eAAO,MAAM,IAAI,SARS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAQ7B,CAAA"}
|
package/dist/utils/node.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Merge } from './utils';
|
|
2
|
-
export type HTMLMap = HTMLElementTagNameMap;
|
|
3
|
-
export type HTMLTag = keyof HTMLMap;
|
|
4
|
-
export type HTMLNode<T extends HTMLTag = HTMLTag> = HTMLMap[T] | string | number | null | undefined;
|
|
5
|
-
export type Component<T extends HTMLTag, P = {}, Child = HTMLMap[T]> = (props: P) => Child;
|
|
6
|
-
export type Props<T extends HTMLTag> = Merge<HTMLMap[T]> & {
|
|
7
|
-
key?: string;
|
|
8
|
-
ref?: (el: HTMLMap[T]) => void;
|
|
9
|
-
children?: HTMLNode | HTMLNode[];
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const append: <El extends Node>(child: Node | string | number | null | undefined, el: El) => void;
|
|
13
|
-
export declare const remove: <El extends Node>(child: Node, el: El) => void;
|
|
14
|
-
declare function create<T extends HTMLTag>(type: T, props?: Props<T>, ...args: HTMLNode[]): HTMLMap[T];
|
|
15
|
-
declare function create<T extends HTMLTag, P = {}, Child = HTMLMap[T]>(type: Component<T, P, Child>, props?: P, ...args: HTMLNode[]): Child;
|
|
16
|
-
export { create };
|
|
17
|
-
export default create;
|
|
18
|
-
//# sourceMappingURL=node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AAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAC9F,iBAAS,MAAM,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;AAgBnI,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,eAAe,MAAM,CAAA"}
|
package/dist/utils/opfs.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type OpfsKind = 'directory' | 'file';
|
|
2
|
-
export type OpfsBody = BlobPart;
|
|
3
|
-
export type OpfsOption = {
|
|
4
|
-
view?: Window;
|
|
5
|
-
};
|
|
6
|
-
export type OpfsEntry = {
|
|
7
|
-
id: string;
|
|
8
|
-
path: string;
|
|
9
|
-
name: string;
|
|
10
|
-
kind: OpfsKind;
|
|
11
|
-
size: number;
|
|
12
|
-
type: string;
|
|
13
|
-
modified: number;
|
|
14
|
-
children: OpfsEntry[];
|
|
15
|
-
};
|
|
16
|
-
export declare const createOPFS: (option?: OpfsOption) => {
|
|
17
|
-
get(path?: string): Promise<any>;
|
|
18
|
-
create(path: string, kind?: OpfsKind, body?: OpfsBody): Promise<void | FileSystemDirectoryHandle>;
|
|
19
|
-
put(path: string, body?: OpfsBody): Promise<void>;
|
|
20
|
-
delete(path: string): Promise<void>;
|
|
21
|
-
copy(path: string, to: string, name?: string): Promise<void>;
|
|
22
|
-
move(path: string, name: string): Promise<void>;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=opfs.d.ts.map
|
package/dist/utils/opfs.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opfs.d.ts","sourceRoot":"","sources":["../../lib/utils/opfs.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,MAAM,CAAA;AAC3C,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAA;AAC/B,MAAM,MAAM,UAAU,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,SAAS,GAAG;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,SAAS,EAAE,CAAA;CAC5B,CAAA;AACD,eAAO,MAAM,UAAU,GAAI,SAAQ,UAAe;;iBAyDf,MAAM,SAAQ,QAAQ,SAAiB,QAAQ;cAIlD,MAAM,SAAQ,QAAQ;iBAGnB,MAAM;eAGR,MAAM,MAAM,MAAM;eAGlB,MAAM,QAAQ,MAAM;CAMpD,CAAA"}
|
package/dist/utils/path.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { FinderEntry, FinderState } from '../types';
|
|
2
|
-
export declare const normalizePath: (path: string) => string;
|
|
3
|
-
export declare const dirname: (path: string) => string;
|
|
4
|
-
export declare const basename: (path: string) => string;
|
|
5
|
-
export declare const joinPath: (base: string, name: string) => string;
|
|
6
|
-
export declare const crumbs: (path: string) => {
|
|
7
|
-
name: string;
|
|
8
|
-
path: string;
|
|
9
|
-
}[];
|
|
10
|
-
export declare const flatten: (entry: FinderEntry | null) => FinderEntry[];
|
|
11
|
-
export declare const findEntry: (entry: FinderEntry | null, path: string) => FinderEntry | null;
|
|
12
|
-
export declare const selectedEntry: (entry: FinderEntry | null, id: string) => FinderEntry | null;
|
|
13
|
-
export declare const childrenOf: (entry: FinderEntry | null, path: string) => FinderEntry[];
|
|
14
|
-
export declare const extensionOf: (name: string) => string;
|
|
15
|
-
export declare const visibleEntries: (state: FinderState) => FinderEntry[];
|
|
16
|
-
//# sourceMappingURL=path.d.ts.map
|
package/dist/utils/path.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../lib/utils/path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACxD,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,WAGzC,CAAA;AACD,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,WAKnC,CAAA;AACD,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,WAGpC,CAAA;AACD,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,WAAqC,CAAA;AACxF,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM;;;GAGlC,CAAA;AACD,eAAO,MAAM,OAAO,GAAI,OAAO,WAAW,GAAG,IAAI,KAAG,WAAW,EAG9D,CAAA;AACD,eAAO,MAAM,SAAS,GAAI,OAAO,WAAW,GAAG,IAAI,EAAE,MAAM,MAAM,KAAG,WAAW,GAAG,IAIjF,CAAA;AACD,eAAO,MAAM,aAAa,GAAI,OAAO,WAAW,GAAG,IAAI,EAAE,IAAI,MAAM,uBAElE,CAAA;AACD,eAAO,MAAM,UAAU,GAAI,OAAO,WAAW,GAAG,IAAI,EAAE,MAAM,MAAM,kBAEjE,CAAA;AACD,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,WAIvC,CAAA;AACD,eAAO,MAAM,cAAc,GAAI,OAAO,WAAW,kBAGhD,CAAA"}
|
package/dist/utils/utils.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export type Merge<T extends object> = Partial<{
|
|
2
|
-
[K in keyof T]: T[K] extends object ? Merge<T[K]> : T[K];
|
|
3
|
-
}>;
|
|
4
|
-
export declare const merge: <T extends object>(a: Merge<T>, b: Merge<T>, ignore?: (key: string, value: unknown) => boolean) => void;
|
|
5
|
-
export declare const is: {
|
|
6
|
-
arr: (arg: any) => arg is any[];
|
|
7
|
-
bol: (a: unknown) => a is boolean;
|
|
8
|
-
str: (a: unknown) => a is string;
|
|
9
|
-
num: (a: unknown) => a is number;
|
|
10
|
-
fun: (a: unknown) => a is Function;
|
|
11
|
-
und: (a: unknown) => a is undefined;
|
|
12
|
-
nul: (a: unknown) => a is null;
|
|
13
|
-
set: (a: unknown) => a is Set<unknown>;
|
|
14
|
-
map: (a: unknown) => a is Map<unknown, unknown>;
|
|
15
|
-
obj: (a: unknown) => a is object;
|
|
16
|
-
nan: (a: unknown) => a is number;
|
|
17
|
-
};
|
|
18
|
-
export declare const isServer: () => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* each
|
|
21
|
-
*/
|
|
22
|
-
type EachFn<Value, Key, This> = (this: This, value: Value, key: Key) => void;
|
|
23
|
-
type Eachable<Value = any, Key = any, This = any> = {
|
|
24
|
-
forEach(cb: EachFn<Value, Key, This>, ctx?: This): void;
|
|
25
|
-
};
|
|
26
|
-
export declare const each: <Value, Key, This>(obj: Eachable<Value, Key, This>, fn: EachFn<Value, Key, This>) => void;
|
|
27
|
-
export declare const flush: <Value extends Function, Key, This>(obj: Eachable<Value, Key, This>, ...args: any[]) => void;
|
|
28
|
-
export declare const isBrowser: () => boolean;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC;KACrC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,K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E,IAAI,EAAE,KAAK,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAoB,CAAA;AACxH,eAAO,MAAM,KAAK,GAAI,KAAK,SAAS,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,GAAG,EAAE,SAEvG,CAAA;AACD,eAAO,MAAM,SAAS,eAAyE,CAAA"}
|
package/dist/utils/viewer.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../../lib/utils/viewer.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B,CAAA;AAsED,eAAO,MAAM,QAAQ,GAAU,wBAAwB,YAAY,yBAMlE,CAAA"}
|
package/dist/view.d.ts
DELETED
package/dist/view.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../lib/view.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAYjC,eAAO,MAAM,UAAU,GAAI,6BAA6B;IAAE,MAAM,EAAE,GAAG,CAAA;CAAE,gBAqOtE,CAAA"}
|