UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

2 lines (1 loc) 611 B
var l=Object.defineProperty;var i=(o,t)=>l(o,"name",{value:t,configurable:!0});const e=class e{constructor(t){this.jodit=t,this.key="backup.default.storage"}async add(t){if(!t.html.trim().length)return!1;const s=this.jodit.storage.get(this.key)||[];return s.find(h=>h.html===t.html)||(s.unshift(t),s.length>this.jodit.o.backup.limit&&(s.length=this.jodit.o.backup.limit),this.jodit.storage.set(this.key,s)),!1}items(){return Promise.resolve(this.jodit.storage.get(this.key)||[])}clear(){return this.jodit.storage.delete(this.key),Promise.resolve(!1)}};i(e,"DefaultStorage");let r=e;export{r as DefaultStorage};