@lexical/file
Advanced tools
Comparing version 0.23.1-nightly.20250109.0 to 0.23.1
@@ -13,3 +13,3 @@ /** | ||
var version = "0.23.1-nightly.20250109.0"; | ||
var version = "0.23.1"; | ||
@@ -16,0 +16,0 @@ /** |
@@ -9,5 +9,5 @@ /** | ||
'use strict';var e=require("lexical");function f(a,b=Object.freeze({})){return{editorState:a.toJSON(),lastSaved:b.lastSaved||Date.now(),source:b.source||"Lexical",version:"0.23.1-nightly.20250109.0"}}function h(a,b){b="string"===typeof b?JSON.parse(b):b;return a.parseEditorState(b.editorState)} | ||
'use strict';var e=require("lexical");function f(a,b=Object.freeze({})){return{editorState:a.toJSON(),lastSaved:b.lastSaved||Date.now(),source:b.source||"Lexical",version:"0.23.1"}}function h(a,b){b="string"===typeof b?JSON.parse(b):b;return a.parseEditorState(b.editorState)} | ||
function k(a){let b=document.createElement("input");b.type="file";b.accept=".lexical";b.addEventListener("change",c=>{c=c.target;if(c.files){c=c.files[0];let d=new FileReader;d.readAsText(c,"UTF-8");d.onload=g=>{g.target&&a(g.target.result)}}});b.click()}exports.editorStateFromSerializedDocument=h; | ||
exports.exportFile=function(a,b=Object.freeze({})){var c=new Date;a=f(a.getEditorState(),{...b,lastSaved:c.getTime()});{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){k(b=>{a.setEditorState(h(a,b));a.dispatchCommand(e.CLEAR_HISTORY_COMMAND,void 0)})};exports.serializedDocumentFromEditorState=f |
@@ -13,3 +13,3 @@ { | ||
"license": "MIT", | ||
"version": "0.23.1-nightly.20250109.0", | ||
"version": "0.23.1", | ||
"main": "LexicalFile.js", | ||
@@ -42,4 +42,4 @@ "types": "index.d.ts", | ||
"dependencies": { | ||
"lexical": "0.23.1-nightly.20250109.0" | ||
"lexical": "0.23.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17109
+ Addedlexical@0.23.1(transitive)
- Removedlexical@0.23.1-nightly.20250109.0(transitive)
Updatedlexical@0.23.1