@lexical/file
Advanced tools
Comparing version 0.2.9 to 0.3.0
@@ -7,4 +7,4 @@ /** | ||
*/ | ||
var e=require("lexical");function f(a){const b=document.createElement("input");b.type="file";b.accept=".lexical";b.addEventListener("change",c=>{c=c.target.files[0];const d=new FileReader;d.readAsText(c,"UTF-8");d.onload=g=>{a(g.target.result)}});b.click()} | ||
exports.exportFile=function(a,b=Object.freeze({})){var c=new Date;a={editorState:a.getEditorState(),lastSaved:c.getTime(),source:b.source||"Lexical",version:e.VERSION};{b=`${b.fileName||c.toISOString()}.lexical`;c=document.createElement("a");const d=document.body;null!==d&&(d.appendChild(c),c.style.display="none",a=JSON.stringify(a),a=new Blob([a],{type:"octet/stream"}),a=window.URL.createObjectURL(a),c.href=a,c.download=b,c.click(),window.URL.revokeObjectURL(a),c.remove())}}; | ||
exports.importFile=function(a){f(b=>{b=JSON.parse(b);b=a.parseEditorState(JSON.stringify(b.editorState));a.setEditorState(b);a.dispatchCommand(e.CLEAR_HISTORY_COMMAND,void 0)})}; | ||
'use strict';var e=require("lexical");function f(a){let b=document.createElement("input");b.type="file";b.accept=".lexical";b.addEventListener("change",c=>{c=c.target.files[0];let d=new FileReader;d.readAsText(c,"UTF-8");d.onload=g=>{a(g.target.result)}});b.click()} | ||
exports.exportFile=function(a,b=Object.freeze({})){var c=new Date;a={editorState:a.getEditorState(),lastSaved:c.getTime(),source:b.source||"Lexical",version:e.VERSION};{b=`${b.fileName||c.toISOString()}.lexical`;c=document.createElement("a");let d=document.body;null!==d&&(d.appendChild(c),c.style.display="none",a=JSON.stringify(a),a=new Blob([a],{type:"octet/stream"}),a=window.URL.createObjectURL(a),c.href=a,c.download=b,c.click(),window.URL.revokeObjectURL(a),c.remove())}}; | ||
exports.importFile=function(a){f(b=>{b=JSON.parse(b);b=a.parseEditorState(JSON.stringify(b.editorState));a.setEditorState(b);a.dispatchCommand(e.CLEAR_HISTORY_COMMAND,void 0)})} |
@@ -13,6 +13,6 @@ { | ||
"license": "MIT", | ||
"version": "0.2.9", | ||
"version": "0.3.0", | ||
"main": "LexicalFile.js", | ||
"peerDependencies": { | ||
"lexical": "0.2.9" | ||
"lexical": "0.3.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "repository": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6218
105
0