@meogic/lexical-file
Advanced tools
Comparing version 0.11.1-mod6 to 0.11.1-mod7
@@ -11,3 +11,3 @@ /** | ||
var version = "0.11.1-mod6"; | ||
var version = "0.11.1-mod7"; | ||
@@ -14,0 +14,0 @@ /** |
@@ -8,3 +8,3 @@ /** | ||
'use strict';var f=require("@meogic/lexical");function g(a){let c=document.createElement("input");c.type="file";c.accept=".lexical";c.addEventListener("change",b=>{b=b.target;if(b.files){b=b.files[0];let d=new FileReader;d.readAsText(b,"UTF-8");d.onload=e=>{e.target&&a(e.target.result)}}});c.click()} | ||
exports.exportFile=function(a,c=Object.freeze({})){var b=new Date;a={editorState:a.getEditorState(),lastSaved:b.getTime(),source:c.source||"Lexical",version:"0.11.1-mod6"};{c=`${c.fileName||b.toISOString()}.lexical`;b=document.createElement("a");let d=document.body;null!==d&&(d.appendChild(b),b.style.display="none",a=JSON.stringify(a),a=new Blob([a],{type:"octet/stream"}),a=window.URL.createObjectURL(a),b.href=a,b.download=c,b.click(),window.URL.revokeObjectURL(a),b.remove())}}; | ||
exports.exportFile=function(a,c=Object.freeze({})){var b=new Date;a={editorState:a.getEditorState(),lastSaved:b.getTime(),source:c.source||"Lexical",version:"0.11.1-mod7"};{c=`${c.fileName||b.toISOString()}.lexical`;b=document.createElement("a");let d=document.body;null!==d&&(d.appendChild(b),b.style.display="none",a=JSON.stringify(a),a=new Blob([a],{type:"octet/stream"}),a=window.URL.createObjectURL(a),b.href=a,b.download=c,b.click(),window.URL.revokeObjectURL(a),b.remove())}}; | ||
exports.importFile=function(a){g(c=>{c=JSON.parse(c);c=a.parseEditorState(JSON.stringify(c.editorState));a.setEditorState(c);a.dispatchCommand(f.CLEAR_HISTORY_COMMAND,void 0)})} |
@@ -13,6 +13,6 @@ { | ||
"license": "MIT", | ||
"version": "0.11.1-mod6", | ||
"version": "0.11.1-mod7", | ||
"main": "LexicalFile.js", | ||
"peerDependencies": { | ||
"@meogic/lexical": "0.11.1-mod6" | ||
"@meogic/lexical": "0.11.1-mod7" | ||
}, | ||
@@ -19,0 +19,0 @@ "repository": { |