-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(browser-nativefs): update web_modules
- Loading branch information
1 parent
fb11b2a
commit 1922f72
Showing
18 changed files
with
36 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
var directoryOpen = async(e={})=>(e.recursive=e.recursive||!1,new Promise(t=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0,r.addEventListener("change",()=>{let i=Array.from(r.files);e.recursive||(i=i.filter(e=>2===e.webkitRelativePath.split("/").length)),t(i);}),r.click();})); | ||
|
||
export default directoryOpen; |
4 changes: 2 additions & 2 deletions
4
...ommon/directory-open-nativefs-edd3f2a1.js → ...modules/common/directory-open-7bae6a7f.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...ommon/directory-open-nativefs-20e5d376.js → ...modules/common/directory-open-eb3669c5.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
const e=async e=>{const t=await e.getFile();return t.handle=e,t};var fileOpen = async(t={})=>{const i={};t.mimeTypes?t.mimeTypes.map(e=>{i[e]=t.extensions||[];}):i["*.*"]=t.extensions||[];const n=await window.showOpenFilePicker({types:[{description:t.description||"",accept:i}],multiple:t.multiple||!1}),s=await Promise.all(n.map(e));return t.multiple?s:s[0]}; | ||
|
||
export default fileOpen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
var fileOpen = async(e={})=>new Promise(t=>{const i=document.createElement("input");i.type="file";const n=[...e.mimeTypes?e.mimeTypes:[],e.extensions?e.extensions.map(e=>"."+e):[]].join();i.multiple=e.multiple||!1,i.accept=n||"*/*",i.addEventListener("change",()=>{t(i.multiple?i.files:i.files[0]);}),i.click();}); | ||
|
||
export default fileOpen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
const e=async e=>{const t=await e.getFile();return t.handle=e,t};var fileOpen = async(t={})=>{const i=await window.chooseFileSystemEntries({accepts:[{description:t.description||"",mimeTypes:t.mimeTypes||["*/*"],extensions:t.extensions||[""]}],multiple:t.multiple||!1});return t.multiple?Promise.all(i.map(e)):e(i)}; | ||
|
||
export default fileOpen; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
var fileSave = async(e,t={},i=null)=>{t.fileName=t.fileName||"Untitled",i=i||await window.chooseFileSystemEntries({type:"save-file",accepts:[{description:t.description||"",mimeTypes:[e.type],extensions:t.extensions||[""]}]});const a=await i.createWritable();return await a.write(e),await a.close(),i}; | ||
|
||
export default fileSave; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
var fileSave = async(e,t={},i=null)=>{t.fileName=t.fileName||"Untitled",i=i||await window.showSaveFilePicker({types:[{description:t.description||"",accept:{[e.type]:t.extensions||[""]}}]});const a=await i.createWritable();return await a.write(e),await a.close(),i}; | ||
|
||
export default fileSave; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @license © 2020 Google LLC. Licensed under the Apache License, Version 2.0. | ||
var fileSave = async(e,t={})=>{const c=document.createElement("a");c.download=t.fileName||"Untitled",c.href=URL.createObjectURL(e),c.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(c.href),3e4);}),c.click();}; | ||
|
||
export default fileSave; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.