@spaceandtimelabs/makeinfinite-ui 0.8.26 → 0.8.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(us,Fr){typeof exports=="object"&&typeof module<"u"?Fr(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],Fr):(us=typeof globalThis<"u"?globalThis:us||self,Fr(us
|
|
1
|
+
(function(us,Fr){typeof exports=="object"&&typeof module<"u"?Fr(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],Fr):(us=typeof globalThis<"u"?globalThis:us||self,Fr(us.MakeInfinite={},us.React,us.ReactDOM))})(this,function(us,Fr,Fu){"use strict";var Xyt=Object.defineProperty;var Jyt=(us,Fr,Fu)=>Fr in us?Xyt(us,Fr,{enumerable:!0,configurable:!0,writable:!0,value:Fu}):us[Fr]=Fu;var GE=(us,Fr,Fu)=>Jyt(us,typeof Fr!="symbol"?Fr+"":Fr,Fu);function Rq(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const u in i)if(u!=="default"){const d=Object.getOwnPropertyDescriptor(i,u);Object.defineProperty(o,u,d.get?d:{enumerable:!0,get:()=>i[u]})}}return o.default=i,Object.freeze(o)}const dt=Rq(Fr),lFe=Rq(Fu);var an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ol(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function VE(i){if(i.__esModule)return i;var o=i.default;if(typeof o=="function"){var u=function d(){return this instanceof d?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};u.prototype=o.prototype}else u={};return Object.defineProperty(u,"__esModule",{value:!0}),Object.keys(i).forEach(function(d){var D=Object.getOwnPropertyDescriptor(i,d);Object.defineProperty(u,d,D.get?D:{enumerable:!0,get:function(){return i[d]}})}),u}var dFe=cFe;function cFe(i){var o,u;if(typeof i!="function")throw new Error("expected a function but got "+i);return function(){return o||(o=!0,u=i.apply(this,arguments)),u}}(function(i){function o(_,P){var U;return _ instanceof Buffer?U=_:U=Buffer.from(_.buffer,_.byteOffset,_.byteLength),U.toString(P)}var u=function(_){return Buffer.from(_)};function d(_){for(var P=0,U=Math.min(256*256,_.length+1),$=new Uint16Array(U),I=[],W=0;;){var K=P<_.length;if(!K||W>=U-1){var Z=$.subarray(0,W),ne=Z;if(I.push(String.fromCharCode.apply(null,ne)),!K)return I.join("");_=_.subarray(P),P=0,W=0}var q=_[P++];if(!(q&128))$[W++]=q;else if((q&224)===192){var V=_[P++]&63;$[W++]=(q&31)<<6|V}else if((q&240)===224){var V=_[P++]&63,N=_[P++]&63;$[W++]=(q&31)<<12|V<<6|N}else if((q&248)===240){var V=_[P++]&63,N=_[P++]&63,Q=_[P++]&63,G=(q&7)<<18|V<<12|N<<6|Q;G>65535&&(G-=65536,$[W++]=G>>>10&1023|55296,G=56320|G&1023),$[W++]=G}}}function D(_){for(var P=0,U=_.length,$=0,I=Math.max(32,U+(U>>>1)+7),W=new Uint8Array(I>>>3<<3);P<U;){var K=_.charCodeAt(P++);if(K>=55296&&K<=56319){if(P<U){var Z=_.charCodeAt(P);(Z&64512)===56320&&(++P,K=((K&1023)<<10)+(Z&1023)+65536)}if(K>=55296&&K<=56319)continue}if($+4>W.length){I+=8,I*=1+P/_.length*2,I=I>>>3<<3;var ne=new Uint8Array(I);ne.set(W),W=ne}if(K&4294967168)if(!(K&4294965248))W[$++]=K>>>6&31|192;else if(!(K&4294901760))W[$++]=K>>>12&15|224,W[$++]=K>>>6&63|128;else if(!(K&4292870144))W[$++]=K>>>18&7|240,W[$++]=K>>>12&63|128,W[$++]=K>>>6&63|128;else continue;else{W[$++]=K;continue}W[$++]=K&63|128}return W.slice?W.slice(0,$):W.subarray(0,$)}var f="Failed to ",h=function(_,P,U){if(_)throw new Error("".concat(f).concat(P,": the '").concat(U,"' option is unsupported."))},C=typeof Buffer=="function"&&Buffer.from,v=C?u:D;function b(){this.encoding="utf-8"}b.prototype.encode=function(_,P){return h(P&&P.stream,"encode","stream"),v(_)};function g(_){var P;try{var U=new Blob([_],{type:"text/plain;charset=UTF-8"});P=URL.createObjectURL(U);var $=new XMLHttpRequest;return $.open("GET",P,!1),$.send(),$.responseText}finally{P&&URL.revokeObjectURL(P)}}var F=!C&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",E=["utf-8","utf8","unicode-1-1-utf-8"],y=d;C?y=o:F&&(y=function(_){try{return g(_)}catch{return d(_)}});var A="construct 'TextDecoder'",w="".concat(f," ").concat(A,": the ");function S(_,P){h(P&&P.fatal,A,"fatal"),_=_||"utf-8";var U;if(C?U=Buffer.isEncoding(_):U=E.indexOf(_.toLowerCase())!==-1,!U)throw new RangeError("".concat(w," encoding label provided ('").concat(_,"') is invalid."));this.encoding=_,this.fatal=!1,this.ignoreBOM=!1}S.prototype.decode=function(_,P){h(P&&P.stream,"decode","stream");var U;return _ instanceof Uint8Array?U=_:_.buffer instanceof ArrayBuffer?U=new Uint8Array(_.buffer):U=new Uint8Array(_),y(U,this.encoding)},i.TextEncoder=i.TextEncoder||b,i.TextDecoder=i.TextDecoder||S})(typeof window<"u"?window:an);var fFe={encode:i=>new TextEncoder().encode(i),decode:i=>new TextDecoder().decode(i)},pFe=xFe;function xFe(i,o,u){var d;return function(){if(!o)return i.apply(this,arguments);var D=this,f=arguments,h=u&&!d;if(clearTimeout(d),d=setTimeout(function(){if(d=null,!h)return i.apply(D,f)},o),h)return i.apply(this,arguments)}}function wq(i){if(i.length===0)return".";let o=Bq(i);return o=o.reduce(mFe,[]),f6(...o)}function DFe(...i){let o="";for(let u of i)u.startsWith("/")?o=u:o=wq(f6(o,u));return o}function f6(...i){if(i.length===0)return"";let o=i.join("/");return o=o.replace(/\/{2,}/g,"/"),o}function Bq(i){if(i.length===0)return[];if(i==="/")return["/"];let o=i.split("/");return o[o.length-1]===""&&o.pop(),i[0]==="/"?o[0]="/":o[0]!=="."&&o.unshift("."),o}function hFe(i){const o=i.lastIndexOf("/");if(o===-1)throw new Error(`Cannot get dirname of "${i}"`);return o===0?"/":i.slice(0,o)}function gFe(i){if(i==="/")throw new Error(`Cannot get basename of "${i}"`);const o=i.lastIndexOf("/");return o===-1?i:i.slice(o+1)}function mFe(i,o){if(i.length===0)return i.push(o),i;if(o===".")return i;if(o===".."){if(i.length===1){if(i[0]==="/")throw new Error("Unable to normalize path - traverses above root directory");if(i[0]===".")return i.push(o),i}return i[i.length-1]===".."?(i.push(".."),i):(i.pop(),i)}return i.push(o),i}var p6={join:f6,normalize:wq,split:Bq,basename:gFe,dirname:hFe,resolve:DFe};function hg(i){return class extends Error{constructor(...o){super(...o),this.code=i,this.message?this.message=i+": "+this.message:this.message=i}}}const yFe=hg("EEXIST"),FFe=hg("ENOENT"),vFe=hg("ENOTDIR"),EFe=hg("ENOTEMPTY"),CFe=hg("ETIMEDOUT");var Sq={EEXIST:yFe,ENOENT:FFe,ENOTDIR:vFe,ENOTEMPTY:EFe,ETIMEDOUT:CFe};const Zi=p6,{EEXIST:Tq,ENOENT:bFe,ENOTDIR:_q,ENOTEMPTY:AFe}=Sq,Li=0;var RFe=class{constructor(){}_makeRoot(o=new Map){return o.set(Li,{mode:511,type:"dir",size:0,ino:0,mtimeMs:Date.now()}),o}activate(o=null){o===null?this._root=new Map([["/",this._makeRoot()]]):typeof o=="string"?this._root=new Map([["/",this._makeRoot(this.parse(o))]]):this._root=o}get activated(){return!!this._root}deactivate(){this._root=void 0}size(){return this._countInodes(this._root.get("/"))-1}_countInodes(o){let u=1;for(let[d,D]of o)d!==Li&&(u+=this._countInodes(D));return u}autoinc(){return this._maxInode(this._root.get("/"))+1}_maxInode(o){let u=o.get(Li).ino;for(let[d,D]of o)d!==Li&&(u=Math.max(u,this._maxInode(D)));return u}print(o=this._root.get("/")){let u="";const d=(D,f)=>{for(let[h,C]of D){if(h===0)continue;let v=C.get(Li),b=v.mode.toString(8);u+=`${" ".repeat(f)}${h} ${b}`,v.type==="file"?u+=` ${v.size} ${v.mtimeMs}
|
|
2
2
|
`:(u+=`
|
|
3
3
|
`,d(C,f+1))}};return d(o,0),u}parse(o){let u=0;function d(C){const v=++u,b=C.length===1?"dir":"file";let[g,F,E]=C;return g=parseInt(g,8),F=F?parseInt(F):0,E=E?parseInt(E):Date.now(),new Map([[Li,{mode:g,type:b,size:F,mtimeMs:E,ino:v}]])}let D=o.trim().split(`
|
|
4
4
|
`),f=this._makeRoot(),h=[{indent:-1,node:f},{indent:0,node:null}];for(let C of D){let b=C.match(/^\t*/)[0].length;C=C.slice(b);let[g,...F]=C.split(" "),E=d(F);if(b<=h[h.length-1].indent)for(;b<=h[h.length-1].indent;)h.pop();h.push({indent:b,node:E}),h[h.length-2].node.set(g,E)}return f}_lookup(o,u=!0){let d=this._root,D="/",f=Zi.split(o);for(let h=0;h<f.length;++h){let C=f[h];if(d=d.get(C),!d)throw new bFe(o);if(u||h<f.length-1){const v=d.get(Li);if(v.type==="symlink"){let b=Zi.resolve(D,v.target);d=this._lookup(b)}D?D=Zi.join(D,C):D=C}}return d}mkdir(o,{mode:u}){if(o==="/")throw new Tq;let d=this._lookup(Zi.dirname(o)),D=Zi.basename(o);if(d.has(D))throw new Tq;let f=new Map,h={mode:u,type:"dir",size:0,mtimeMs:Date.now(),ino:this.autoinc()};f.set(Li,h),d.set(D,f)}rmdir(o){let u=this._lookup(o);if(u.get(Li).type!=="dir")throw new _q;if(u.size>1)throw new AFe;let d=this._lookup(Zi.dirname(o)),D=Zi.basename(o);d.delete(D)}readdir(o){let u=this._lookup(o);if(u.get(Li).type!=="dir")throw new _q;return[...u.keys()].filter(d=>typeof d=="string")}writeStat(o,u,{mode:d}){let D;try{let b=this.stat(o);d==null&&(d=b.mode),D=b.ino}catch{}d==null&&(d=438),D==null&&(D=this.autoinc());let f=this._lookup(Zi.dirname(o)),h=Zi.basename(o),C={mode:d,type:"file",size:u,mtimeMs:Date.now(),ino:D},v=new Map;return v.set(Li,C),f.set(h,v),C}unlink(o){let u=this._lookup(Zi.dirname(o)),d=Zi.basename(o);u.delete(d)}rename(o,u){let d=Zi.basename(u),D=this._lookup(o);this._lookup(Zi.dirname(u)).set(d,D),this.unlink(o)}stat(o){return this._lookup(o).get(Li)}lstat(o){return this._lookup(o,!1).get(Li)}readlink(o){return this._lookup(o,!1).get(Li).target}symlink(o,u){let d,D;try{let b=this.stat(u);D===null&&(D=b.mode),d=b.ino}catch{}D==null&&(D=40960),d==null&&(d=this.autoinc());let f=this._lookup(Zi.dirname(u)),h=Zi.basename(u),C={mode:D,type:"symlink",target:o,size:0,mtimeMs:Date.now(),ino:d},v=new Map;return v.set(Li,C),f.set(h,v),C}_du(o){let u=0;for(const[d,D]of o.entries())d===Li?u+=D.size:u+=this._du(D);return u}du(o){let u=this._lookup(o);return this._du(u)}};class jq{constructor(o="keyval-store",u="keyval"){this.storeName=u,this._dbName=o,this._storeName=u,this._init()}_init(){this._dbp||(this._dbp=new Promise((o,u)=>{const d=indexedDB.open(this._dbName);d.onerror=()=>u(d.error),d.onsuccess=()=>o(d.result),d.onupgradeneeded=()=>{d.result.createObjectStore(this._storeName)}}))}_withIDBStore(o,u){return this._init(),this._dbp.then(d=>new Promise((D,f)=>{const h=d.transaction(this.storeName,o);h.oncomplete=()=>D(),h.onabort=h.onerror=()=>f(h.error),u(h.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(o=>{o.close(),this._dbp=void 0})}}let x6;function Of(){return x6||(x6=new jq),x6}function wFe(i,o=Of()){let u;return o._withIDBStore("readwrite",d=>{u=d.get(i)}).then(()=>u.result)}function BFe(i,o,u=Of()){return u._withIDBStore("readwrite",d=>{d.put(o,i)})}function SFe(i,o,u=Of()){return u._withIDBStore("readwrite",d=>{const D=d.get(i);D.onsuccess=()=>{d.put(o(D.result),i)}})}function TFe(i,o=Of()){return o._withIDBStore("readwrite",u=>{u.delete(i)})}function _Fe(i=Of()){return i._withIDBStore("readwrite",o=>{o.clear()})}function jFe(i=Of()){const o=[];return i._withIDBStore("readwrite",u=>{(u.openKeyCursor||u.openCursor).call(u).onsuccess=function(){this.result&&(o.push(this.result.key),this.result.continue())}}).then(()=>o)}function PFe(i=Of()){return i._close()}const Pq=VE(Object.freeze(Object.defineProperty({__proto__:null,Store:jq,clear:_Fe,close:PFe,del:TFe,get:wFe,keys:jFe,set:BFe,update:SFe},Symbol.toStringTag,{value:"Module"}))),oc=Pq;var IFe=class{constructor(o,u){this._database=o,this._storename=u,this._store=new oc.Store(this._database,this._storename)}saveSuperblock(o){return oc.set("!root",o,this._store)}loadSuperblock(){return oc.get("!root",this._store)}readFile(o){return oc.get(o,this._store)}writeFile(o,u){return oc.set(o,u,this._store)}unlink(o){return oc.del(o,this._store)}wipe(){return oc.clear(this._store)}close(){return oc.close(this._store)}},kFe=class{constructor(o){this._url=o}loadSuperblock(){return fetch(this._url+"/.superblock.txt").then(o=>o.ok?o.text():null)}async readFile(o){const u=await fetch(this._url+o);if(u.status===200)return u.arrayBuffer();throw new Error("ENOENT")}async sizeFile(o){const u=await fetch(this._url+o,{method:"HEAD"});if(u.status===200)return u.headers.get("content-length");throw new Error("ENOENT")}};const gg=Pq,OFe=i=>new Promise(o=>setTimeout(o,i));var MFe=class{constructor(o,u){this._id=Math.random(),this._database=o,this._storename=u,this._store=new gg.Store(this._database,this._storename),this._lock=null}async has({margin:o=2e3}={}){if(this._lock&&this._lock.holder===this._id){const u=Date.now();return this._lock.expires>u+o?!0:await this.renew()}else return!1}async renew({ttl:o=5e3}={}){let u;return await gg.update("lock",d=>{const f=Date.now()+o;return u=d&&d.holder===this._id,this._lock=u?{holder:this._id,expires:f}:d,this._lock},this._store),u}async acquire({ttl:o=5e3}={}){let u,d,D;if(await gg.update("lock",f=>{const h=Date.now(),C=h+o;return d=f&&f.expires<h,u=f===void 0||d,D=f&&f.holder===this._id,this._lock=u?{holder:this._id,expires:C}:f,this._lock},this._store),D)throw new Error("Mutex double-locked");return u}async wait({interval:o=100,limit:u=6e3,ttl:d}={}){for(;u--;){if(await this.acquire({ttl:d}))return!0;await OFe(o)}throw new Error("Mutex timeout")}async release({force:o=!1}={}){let u,d,D;if(await gg.update("lock",f=>(u=o||f&&f.holder===this._id,d=f===void 0,D=f&&f.holder!==this._id,this._lock=u?void 0:f,this._lock),this._store),await gg.close(this._store),!u&&!o){if(d)throw new Error("Mutex double-freed");if(D)throw new Error("Mutex lost ownership")}return u}},NFe=class{constructor(o){this._id=Math.random(),this._database=o,this._has=!1,this._release=null}async has(){return this._has}async acquire(){return new Promise(o=>{navigator.locks.request(this._database+"_lock",{ifAvailable:!0},u=>(this._has=!!u,o(!!u),new Promise(d=>{this._release=d})))})}async wait({timeout:o=6e5}={}){return new Promise((u,d)=>{const D=new AbortController;setTimeout(()=>{D.abort(),d(new Error("Mutex timeout"))},o),navigator.locks.request(this._database+"_lock",{signal:D.signal},f=>(this._has=!!f,u(!!f),new Promise(h=>{this._release=h})))})}async release({force:o=!1}={}){this._has=!1,this._release?this._release():o&&navigator.locks.request(this._database+"_lock",{steal:!0},u=>!0)}};const{encode:LFe,decode:Iq}=fFe,$Fe=pFe,UFe=RFe,{ENOENT:WFe,ENOTEMPTY:qFe,ETIMEDOUT:zFe}=Sq,HFe=IFe,GFe=kFe,VFe=MFe,KFe=NFe,mg=p6;var YFe=class{constructor(){this.saveSuperblock=$Fe(()=>{this.flush()},500)}async init(o,{wipe:u,url:d,urlauto:D,fileDbName:f=o,db:h=null,fileStoreName:C=o+"_files",lockDbName:v=o+"_lock",lockStoreName:b=o+"_lock"}={}){this._name=o,this._idb=h||new HFe(f,C),this._mutex=navigator.locks?new KFe(o):new VFe(v,b),this._cache=new UFe(o),this._opts={wipe:u,url:d},this._needsWipe=!!u,d&&(this._http=new GFe(d),this._urlauto=!!D)}async activate(){if(this._cache.activated)return;this._needsWipe&&(this._needsWipe=!1,await this._idb.wipe(),await this._mutex.release({force:!0})),await this._mutex.has()||await this._mutex.wait();const o=await this._idb.loadSuperblock();if(o)this._cache.activate(o);else if(this._http){const u=await this._http.loadSuperblock();this._cache.activate(u),await this._saveSuperblock()}else this._cache.activate();if(!await this._mutex.has())throw new zFe}async deactivate(){await this._mutex.has()&&await this._saveSuperblock(),this._cache.deactivate();try{await this._mutex.release()}catch(o){console.log(o)}await this._idb.close()}async _saveSuperblock(){this._cache.activated&&(this._lastSavedAt=Date.now(),await this._idb.saveSuperblock(this._cache._root))}_writeStat(o,u,d){let D=mg.split(mg.dirname(o)),f=D.shift();for(let h of D){f=mg.join(f,h);try{this._cache.mkdir(f,{mode:511})}catch{}}return this._cache.writeStat(o,u,d)}async readFile(o,u){const{encoding:d}=u;if(d&&d!=="utf8")throw new Error('Only "utf8" encoding is supported in readFile');let D=null,f=null;try{f=this._cache.stat(o),D=await this._idb.readFile(f.ino)}catch(h){if(!this._urlauto)throw h}if(!D&&this._http){let h=this._cache.lstat(o);for(;h.type==="symlink";)o=mg.resolve(mg.dirname(o),h.target),h=this._cache.lstat(o);D=await this._http.readFile(o)}if(D&&((!f||f.size!=D.byteLength)&&(f=await this._writeStat(o,D.byteLength,{mode:f?f.mode:438}),this.saveSuperblock()),d==="utf8"?D=Iq(D):D.toString=()=>Iq(D)),!f)throw new WFe(o);return D}async writeFile(o,u,d){const{mode:D,encoding:f="utf8"}=d;if(typeof u=="string"){if(f!=="utf8")throw new Error('Only "utf8" encoding is supported in writeFile');u=LFe(u)}const h=await this._cache.writeStat(o,u.byteLength,{mode:D});await this._idb.writeFile(h.ino,u)}async unlink(o,u){const d=this._cache.lstat(o);this._cache.unlink(o),d.type!=="symlink"&&await this._idb.unlink(d.ino)}readdir(o,u){return this._cache.readdir(o)}mkdir(o,u){const{mode:d=511}=u;this._cache.mkdir(o,{mode:d})}rmdir(o,u){if(o==="/")throw new qFe;this._cache.rmdir(o)}rename(o,u){this._cache.rename(o,u)}stat(o,u){return this._cache.stat(o)}lstat(o,u){return this._cache.lstat(o)}readlink(o,u){return this._cache.readlink(o)}symlink(o,u){this._cache.symlink(o,u)}async backFile(o,u){let d=await this._http.sizeFile(o);await this._writeStat(o,d,u)}du(o){return this._cache.du(o)}flush(){return this._saveSuperblock()}},XFe=class{constructor(o){this.type=o.type,this.mode=o.mode,this.size=o.size,this.ino=o.ino,this.mtimeMs=o.mtimeMs,this.ctimeMs=o.ctimeMs||o.mtimeMs,this.uid=1,this.gid=1,this.dev=1}isFile(){return this.type==="file"}isDirectory(){return this.type==="dir"}isSymbolicLink(){return this.type==="symlink"}};const JFe=YFe,kq=XFe,KE=p6;function $l(i,o,...u){return i=KE.normalize(i),(typeof o>"u"||typeof o=="function")&&(o={}),typeof o=="string"&&(o={encoding:o}),[i,o,...u]}function ZFe(i,o,u,...d){return i=KE.normalize(i),(typeof u>"u"||typeof u=="function")&&(u={}),typeof u=="string"&&(u={encoding:u}),[i,o,u,...d]}function Oq(i,o,...u){return[KE.normalize(i),KE.normalize(o),...u]}var QFe=class{constructor(o,u={}){this.init=this.init.bind(this),this.readFile=this._wrap(this.readFile,$l,!1),this.writeFile=this._wrap(this.writeFile,ZFe,!0),this.unlink=this._wrap(this.unlink,$l,!0),this.readdir=this._wrap(this.readdir,$l,!1),this.mkdir=this._wrap(this.mkdir,$l,!0),this.rmdir=this._wrap(this.rmdir,$l,!0),this.rename=this._wrap(this.rename,Oq,!0),this.stat=this._wrap(this.stat,$l,!1),this.lstat=this._wrap(this.lstat,$l,!1),this.readlink=this._wrap(this.readlink,$l,!1),this.symlink=this._wrap(this.symlink,Oq,!0),this.backFile=this._wrap(this.backFile,$l,!0),this.du=this._wrap(this.du,$l,!1),this._deactivationPromise=null,this._deactivationTimeout=null,this._activationPromise=null,this._operations=new Set,o&&this.init(o,u)}async init(...o){return this._initPromiseResolve&&await this._initPromise,this._initPromise=this._init(...o),this._initPromise}async _init(o,u={}){await this._gracefulShutdown(),this._activationPromise&&await this._deactivate(),this._backend&&this._backend.destroy&&await this._backend.destroy(),this._backend=u.backend||new JFe,this._backend.init&&await this._backend.init(o,u),this._initPromiseResolve&&(this._initPromiseResolve(),this._initPromiseResolve=null),u.defer||this.stat("/")}async _gracefulShutdown(){this._operations.size>0&&(this._isShuttingDown=!0,await new Promise(o=>this._gracefulShutdownResolve=o),this._isShuttingDown=!1,this._gracefulShutdownResolve=null)}_wrap(o,u,d){return async(...D)=>{D=u(...D);let f={name:o.name,args:D};this._operations.add(f);try{return await this._activate(),await o.apply(this,D)}finally{this._operations.delete(f),d&&this._backend.saveSuperblock(),this._operations.size===0&&(this._deactivationTimeout||clearTimeout(this._deactivationTimeout),this._deactivationTimeout=setTimeout(this._deactivate.bind(this),500))}}}async _activate(){this._initPromise||console.warn(new Error(`Attempted to use LightningFS ${this._name} before it was initialized.`)),await this._initPromise,this._deactivationTimeout&&(clearTimeout(this._deactivationTimeout),this._deactivationTimeout=null),this._deactivationPromise&&await this._deactivationPromise,this._deactivationPromise=null,this._activationPromise||(this._activationPromise=this._backend.activate?this._backend.activate():Promise.resolve()),await this._activationPromise}async _deactivate(){return this._activationPromise&&await this._activationPromise,this._deactivationPromise||(this._deactivationPromise=this._backend.deactivate?this._backend.deactivate():Promise.resolve()),this._activationPromise=null,this._gracefulShutdownResolve&&this._gracefulShutdownResolve(),this._deactivationPromise}async readFile(o,u){return this._backend.readFile(o,u)}async writeFile(o,u,d){return await this._backend.writeFile(o,u,d),null}async unlink(o,u){return await this._backend.unlink(o,u),null}async readdir(o,u){return this._backend.readdir(o,u)}async mkdir(o,u){return await this._backend.mkdir(o,u),null}async rmdir(o,u){return await this._backend.rmdir(o,u),null}async rename(o,u){return await this._backend.rename(o,u),null}async stat(o,u){const d=await this._backend.stat(o,u);return new kq(d)}async lstat(o,u){const d=await this._backend.lstat(o,u);return new kq(d)}async readlink(o,u){return this._backend.readlink(o,u)}async symlink(o,u){return await this._backend.symlink(o,u),null}async backFile(o,u){return await this._backend.backFile(o,u),null}async du(o){return this._backend.du(o)}async flush(){return this._backend.flush()}};const eve=dFe,tve=QFe;function bo(i,o){return typeof i=="function"&&(o=i),o=eve(o),[(...d)=>o(null,...d),o]}var rve=class{constructor(...o){this.promises=new tve(...o),this.init=this.init.bind(this),this.readFile=this.readFile.bind(this),this.writeFile=this.writeFile.bind(this),this.unlink=this.unlink.bind(this),this.readdir=this.readdir.bind(this),this.mkdir=this.mkdir.bind(this),this.rmdir=this.rmdir.bind(this),this.rename=this.rename.bind(this),this.stat=this.stat.bind(this),this.lstat=this.lstat.bind(this),this.readlink=this.readlink.bind(this),this.symlink=this.symlink.bind(this),this.backFile=this.backFile.bind(this),this.du=this.du.bind(this),this.flush=this.flush.bind(this)}init(o,u){return this.promises.init(o,u)}readFile(o,u,d){const[D,f]=bo(u,d);this.promises.readFile(o,u).then(D).catch(f)}writeFile(o,u,d,D){const[f,h]=bo(d,D);this.promises.writeFile(o,u,d).then(f).catch(h)}unlink(o,u,d){const[D,f]=bo(u,d);this.promises.unlink(o,u).then(D).catch(f)}readdir(o,u,d){const[D,f]=bo(u,d);this.promises.readdir(o,u).then(D).catch(f)}mkdir(o,u,d){const[D,f]=bo(u,d);this.promises.mkdir(o,u).then(D).catch(f)}rmdir(o,u,d){const[D,f]=bo(u,d);this.promises.rmdir(o,u).then(D).catch(f)}rename(o,u,d){const[D,f]=bo(d);this.promises.rename(o,u).then(D).catch(f)}stat(o,u,d){const[D,f]=bo(u,d);this.promises.stat(o).then(D).catch(f)}lstat(o,u,d){const[D,f]=bo(u,d);this.promises.lstat(o).then(D).catch(f)}readlink(o,u,d){const[D,f]=bo(u,d);this.promises.readlink(o).then(D).catch(f)}symlink(o,u,d){const[D,f]=bo(d);this.promises.symlink(o,u).then(D).catch(f)}backFile(o,u,d){const[D,f]=bo(u,d);this.promises.backFile(o,u).then(D).catch(f)}du(o,u){const[d,D]=bo(u);this.promises.du(o).then(d).catch(D)}flush(o){const[u,d]=bo(o);this.promises.flush().then(u).catch(d)}};const ave=ol(rve);var D6={},YE={};YE.byteLength=ive,YE.toByteArray=uve,YE.fromByteArray=cve;for(var Ul=[],vu=[],nve=typeof Uint8Array<"u"?Uint8Array:Array,h6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zx=0,sve=h6.length;Zx<sve;++Zx)Ul[Zx]=h6[Zx],vu[h6.charCodeAt(Zx)]=Zx;vu[45]=62,vu[95]=63;function Mq(i){var o=i.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=i.indexOf("=");u===-1&&(u=o);var d=u===o?0:4-u%4;return[u,d]}function ive(i){var o=Mq(i),u=o[0],d=o[1];return(u+d)*3/4-d}function ove(i,o,u){return(o+u)*3/4-u}function uve(i){var o,u=Mq(i),d=u[0],D=u[1],f=new nve(ove(i,d,D)),h=0,C=D>0?d-4:d,v;for(v=0;v<C;v+=4)o=vu[i.charCodeAt(v)]<<18|vu[i.charCodeAt(v+1)]<<12|vu[i.charCodeAt(v+2)]<<6|vu[i.charCodeAt(v+3)],f[h++]=o>>16&255,f[h++]=o>>8&255,f[h++]=o&255;return D===2&&(o=vu[i.charCodeAt(v)]<<2|vu[i.charCodeAt(v+1)]>>4,f[h++]=o&255),D===1&&(o=vu[i.charCodeAt(v)]<<10|vu[i.charCodeAt(v+1)]<<4|vu[i.charCodeAt(v+2)]>>2,f[h++]=o>>8&255,f[h++]=o&255),f}function lve(i){return Ul[i>>18&63]+Ul[i>>12&63]+Ul[i>>6&63]+Ul[i&63]}function dve(i,o,u){for(var d,D=[],f=o;f<u;f+=3)d=(i[f]<<16&16711680)+(i[f+1]<<8&65280)+(i[f+2]&255),D.push(lve(d));return D.join("")}function cve(i){for(var o,u=i.length,d=u%3,D=[],f=16383,h=0,C=u-d;h<C;h+=f)D.push(dve(i,h,h+f>C?C:h+f));return d===1?(o=i[u-1],D.push(Ul[o>>2]+Ul[o<<4&63]+"==")):d===2&&(o=(i[u-2]<<8)+i[u-1],D.push(Ul[o>>10]+Ul[o>>4&63]+Ul[o<<2&63]+"=")),D.join("")}var g6={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */g6.read=function(i,o,u,d,D){var f,h,C=D*8-d-1,v=(1<<C)-1,b=v>>1,g=-7,F=u?D-1:0,E=u?-1:1,y=i[o+F];for(F+=E,f=y&(1<<-g)-1,y>>=-g,g+=C;g>0;f=f*256+i[o+F],F+=E,g-=8);for(h=f&(1<<-g)-1,f>>=-g,g+=d;g>0;h=h*256+i[o+F],F+=E,g-=8);if(f===0)f=1-b;else{if(f===v)return h?NaN:(y?-1:1)*(1/0);h=h+Math.pow(2,d),f=f-b}return(y?-1:1)*h*Math.pow(2,f-d)},g6.write=function(i,o,u,d,D,f){var h,C,v,b=f*8-D-1,g=(1<<b)-1,F=g>>1,E=D===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=d?0:f-1,A=d?1:-1,w=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(C=isNaN(o)?1:0,h=g):(h=Math.floor(Math.log(o)/Math.LN2),o*(v=Math.pow(2,-h))<1&&(h--,v*=2),h+F>=1?o+=E/v:o+=E*Math.pow(2,1-F),o*v>=2&&(h++,v/=2),h+F>=g?(C=0,h=g):h+F>=1?(C=(o*v-1)*Math.pow(2,D),h=h+F):(C=o*Math.pow(2,F-1)*Math.pow(2,D),h=0));D>=8;i[u+y]=C&255,y+=A,C/=256,D-=8);for(h=h<<D|C,b+=D;b>0;i[u+y]=h&255,y+=A,h/=256,b-=8);i[u+y-A]|=w*128};/*!
|
package/package.json
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
"name": "@spaceandtimelabs/makeinfinite-ui",
|
|
3
3
|
"author": "aw-sxt",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.27",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"
|
|
9
|
+
"import": "./dist/makeinfinite-ui.es.js",
|
|
10
|
+
"require": "./dist/makeinfinite-ui.umd.js",
|
|
10
11
|
"types": "./dist/index.d.ts"
|
|
11
12
|
}
|
|
12
13
|
},
|
|
13
|
-
"main": "dist/makeinfinite-ui.umd.js",
|
|
14
|
-
"module": "dist/makeinfinite-ui.es.js",
|
|
15
|
-
"browser": "dist/makeinfinite-ui.umd.js",
|
|
14
|
+
"main": "./dist/makeinfinite-ui.umd.js",
|
|
15
|
+
"module": "./dist/makeinfinite-ui.es.js",
|
|
16
16
|
"files": [
|
|
17
17
|
"dist"
|
|
18
18
|
],
|