@powerhousedao/connect 5.1.0 → 5.2.0-staging.10
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.
- package/.env +1 -0
- package/dist/assets/AddDriveModal-BKsp1GKP.js +1 -0
- package/dist/assets/ClearStorageModal-B3rAmh6U.js +1 -0
- package/dist/assets/CookiesPolicyModal-BD4fUdQU.js +1 -0
- package/dist/assets/CreateDocumentModal-DT2pJk9F.js +1 -0
- package/dist/assets/{DebugSettingsModal-CooFY-Go.js → DebugSettingsModal-Bpv5w1Ev.js} +1 -1
- package/dist/assets/{DeleteDriveModal-BOdu1bg5.js → DeleteDriveModal-B2zQKf5S.js} +1 -1
- package/dist/assets/DeleteItemModal-BWJk73GV.js +1 -0
- package/dist/assets/DisclaimerModal-gyJ1Y8Yu.js +1 -0
- package/dist/assets/DriveSettingsModal-DSlmx9Uy.js +1 -0
- package/dist/assets/{ExportDocumentWithErrorsModal-BzgGSmxg.js → ExportDocumentWithErrorsModal-dmhuqm_k.js} +1 -1
- package/dist/assets/SettingsModal-CqzY2Sla.js +1 -0
- package/dist/assets/UpgradeDriveModal-CPg3HZ8E.js +1 -0
- package/dist/assets/{design_system-DGYPpUGa.js → design_system-DA3IeyCz.js} +1 -1
- package/dist/assets/design_system_connect-DLuxbpVg.js +45 -0
- package/dist/assets/design_system_ui-BsPI-v0K.js +1 -0
- package/dist/assets/{document_drive-BEIKnuGM.js → document_drive-BuVpBb4l.js} +25 -14
- package/dist/assets/{document_engineering-B49PhCDR.js → document_engineering-CMsY-5mv.js} +1 -1
- package/dist/assets/{document_model-DXcLJEjZ.js → document_model-DB4SzBSe.js} +3 -3
- package/dist/assets/document_model_editor-Hr9QN_E4.js +23 -0
- package/dist/assets/{drive_explorer-d0kn77Nx.js → drive_explorer-DdA2TGOv.js} +2 -2
- package/dist/assets/{graphql-editor-CSkqTexL.js → graphql-editor-CRTTfLkB.js} +2 -2
- package/dist/assets/{hooks-D4Uas2SG.js → hooks-BMmZ6T4Z.js} +1 -1
- package/dist/assets/index-BIBr9aw_.js +25 -0
- package/dist/assets/index-BilHslhO.css +1 -0
- package/dist/assets/index-BnAbZbzc.js +20 -0
- package/dist/assets/json-editor-Dj_ZLQWL.js +1 -0
- package/dist/assets/nodefs-Dj_FjUeJ.js +1 -0
- package/dist/assets/opfs-ahp-BAhC6XMe.js +3 -0
- package/dist/assets/pg_dump-CW0pN9tG.wasm +0 -0
- package/dist/assets/postgres-CkP7QCDB.data +0 -0
- package/dist/assets/postgres-CyuUVpXN.wasm +0 -0
- package/dist/assets/reactor_browser-Cnu-VPLd.js +127 -0
- package/dist/assets/state-schemas-DiKCHGjf.js +2 -0
- package/dist/assets/zod-BpTyxkjy.js +20 -0
- package/dist/index.html +11 -11
- package/heroku/Dockerfile +4 -1
- package/lib/package.copy.json +14 -8
- package/lib/src/components/app-skeleton.js +1 -1
- package/lib/src/components/app-skeleton.js.map +1 -1
- package/lib/src/components/modal/modals/AddDriveModal.d.ts.map +1 -1
- package/lib/src/components/modal/modals/AddDriveModal.js +35 -27
- package/lib/src/components/modal/modals/AddDriveModal.js.map +1 -1
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts +2 -0
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js +26 -0
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/index.d.ts +2 -0
- package/lib/src/components/modal/modals/InspectorModal/index.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/index.js +2 -0
- package/lib/src/components/modal/modals/InspectorModal/index.js.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts +32 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js +108 -0
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts +4 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts.map +1 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js +12 -0
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js.map +1 -0
- package/lib/src/components/modal/modals-container.d.ts.map +1 -1
- package/lib/src/components/modal/modals-container.js +4 -0
- package/lib/src/components/modal/modals-container.js.map +1 -1
- package/lib/src/components/root.js +1 -1
- package/lib/src/components/root.js.map +1 -1
- package/lib/src/components/sidebar.d.ts.map +1 -1
- package/lib/src/components/sidebar.js +6 -2
- package/lib/src/components/sidebar.js.map +1 -1
- package/lib/src/connect.config.d.ts +2 -0
- package/lib/src/connect.config.d.ts.map +1 -1
- package/lib/src/connect.config.js +1 -0
- package/lib/src/connect.config.js.map +1 -1
- package/lib/src/feature-flags.d.ts +22 -3
- package/lib/src/feature-flags.d.ts.map +1 -1
- package/lib/src/feature-flags.js +48 -3
- package/lib/src/feature-flags.js.map +1 -1
- package/lib/src/hooks/useClientErrorHandler.d.ts.map +1 -1
- package/lib/src/hooks/useClientErrorHandler.js +13 -2
- package/lib/src/hooks/useClientErrorHandler.js.map +1 -1
- package/lib/src/pages/demo/atlas-import.js +2 -2
- package/lib/src/pages/demo/atlas-import.js.map +1 -1
- package/lib/src/store/reactor.d.ts.map +1 -1
- package/lib/src/store/reactor.js +102 -51
- package/lib/src/store/reactor.js.map +1 -1
- package/lib/src/utils/reactor.d.ts +7 -0
- package/lib/src/utils/reactor.d.ts.map +1 -1
- package/lib/src/utils/reactor.js +35 -2
- package/lib/src/utils/reactor.js.map +1 -1
- package/lib/src/utils/signer.d.ts +18 -0
- package/lib/src/utils/signer.d.ts.map +1 -0
- package/lib/src/utils/signer.js +215 -0
- package/lib/src/utils/signer.js.map +1 -0
- package/lib/test/utils/signer.test.d.ts +2 -0
- package/lib/test/utils/signer.test.d.ts.map +1 -0
- package/lib/test/utils/signer.test.js +319 -0
- package/lib/test/utils/signer.test.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/vite.config.d.ts.map +1 -1
- package/lib/vite.config.js +4 -0
- package/lib/vite.config.js.map +1 -1
- package/lib/vitest.config.d.ts +3 -0
- package/lib/vitest.config.d.ts.map +1 -0
- package/lib/vitest.config.js +8 -0
- package/lib/vitest.config.js.map +1 -0
- package/nginx.conf +7 -0
- package/package.copy.json +14 -8
- package/package.json +21 -15
- package/dist/assets/AddDriveModal-_XSf2ZlN.js +0 -1
- package/dist/assets/ClearStorageModal-CbfJTlAo.js +0 -1
- package/dist/assets/CookiesPolicyModal-DTRuUeM_.js +0 -1
- package/dist/assets/CreateDocumentModal-DUTbfZYr.js +0 -1
- package/dist/assets/DeleteItemModal-D8MlQS3W.js +0 -1
- package/dist/assets/DisclaimerModal-RBBaiKyO.js +0 -1
- package/dist/assets/DriveSettingsModal-BHBZfzaY.js +0 -1
- package/dist/assets/SettingsModal-BXDXscnR.js +0 -1
- package/dist/assets/UpgradeDriveModal-15TBzq11.js +0 -1
- package/dist/assets/design_system_connect-Vb8XBnLs.js +0 -45
- package/dist/assets/design_system_ui-Dnwc_Xm9.js +0 -1
- package/dist/assets/document_model_editor-lmHQ6HZy.js +0 -23
- package/dist/assets/index-Br7E7qjt.css +0 -1
- package/dist/assets/index-CK2Jk_ho.js +0 -18
- package/dist/assets/json-editor-CQKAVxat.js +0 -1
- package/dist/assets/reactor_browser-BGn_P-dn.js +0 -25
- package/dist/assets/state-schemas-36mF-wEI.js +0 -2
- package/dist/assets/zod-C6yxFxyo.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b4 as H,b5 as m,b6 as o,b7 as s,b8 as A,b3 as C,b9 as P,ba as x}from"./reactor_browser-Cnu-VPLd.js";import"./document_model-DB4SzBSe.js";import"./zod-BpTyxkjy.js";import"./react-DQSxOgtG.js";import"./document_drive-BuVpBb4l.js";import"./graphql-BS4Brs_E.js";import"./config-CU-aFfVJ.js";import"./drive_explorer-DdA2TGOv.js";import"./sentry_react-cODD7zWc.js";import"./sentry_browser-B4YoBIIG.js";import"./document_model_editor-Hr9QN_E4.js";import"./react/jsx-runtime-DldvXD6N.js";import"./design_system-DA3IeyCz.js";import"./tailwind_merge-Dr4f9Rms.js";import"./react-dom-D6zQJsh6.js";import"./design_system_connect-DLuxbpVg.js";import"./design_system_ui-BsPI-v0K.js";import"./react-dom/client-BVPiT_FE.js";C();var B="state.txt",L="data",$={DIR:16384,FILE:32768},T,I,E,_,w,k,y,j,N,b,S,l,v,O,M,g,f,D,R,W,ht=class extends H{constructor(t,{initialPoolSize:e=1e3,maintainedPoolSize:a=100,debug:i=!1}={}){super(t,{debug:i}),m(this,l),m(this,T),m(this,I),m(this,E),m(this,_),m(this,w),m(this,k,new Map),m(this,y,new Map),m(this,j,0),m(this,N,new Map),m(this,b,new Map),this.lastCheckpoint=0,this.checkpointInterval=1e3*60,this.poolCounter=0,m(this,S,new Set),this.initialPoolSize=e,this.maintainedPoolSize=a}async init(t,e){return await o(this,l,v).call(this),super.init(t,e)}async syncToFs(t=!1){await this.maybeCheckpointState(),await this.maintainPool(),t||this.flush()}async closeFs(){for(let t of s(this,y).values())t.close();s(this,w).flush(),s(this,w).close(),this.pg.Module.FS.quit()}async maintainPool(t){t=t||this.maintainedPoolSize;let e=t-this.state.pool.length,a=[];for(let i=0;i<e;i++)a.push(new Promise(async h=>{++this.poolCounter;let r=`${(Date.now()-1704063600).toString(16).padStart(8,"0")}-${this.poolCounter.toString(16).padStart(8,"0")}`,c=await s(this,E).getFileHandle(r,{create:!0}),d=await c.createSyncAccessHandle();s(this,k).set(r,c),s(this,y).set(r,d),o(this,l,M).call(this,{opp:"createPoolFile",args:[r]}),this.state.pool.push(r),h()}));for(let i=0;i>e;i--)a.push(new Promise(async h=>{let r=this.state.pool.pop();o(this,l,M).call(this,{opp:"deletePoolFile",args:[r]});let c=s(this,k).get(r);s(this,y).get(r)?.close(),await s(this,E).removeEntry(c.name),s(this,k).delete(r),s(this,y).delete(r),h()}));await Promise.all(a)}_createPoolFileState(t){this.state.pool.push(t)}_deletePoolFileState(t){let e=this.state.pool.indexOf(t);e>-1&&this.state.pool.splice(e,1)}async maybeCheckpointState(){Date.now()-this.lastCheckpoint>this.checkpointInterval&&await this.checkpointState()}async checkpointState(){let t=new TextEncoder().encode(JSON.stringify(this.state));s(this,w).truncate(0),s(this,w).write(t,{at:0}),s(this,w).flush(),this.lastCheckpoint=Date.now()}flush(){for(let t of s(this,S))try{t.flush()}catch{}s(this,S).clear()}chmod(t,e){o(this,l,O).call(this,{opp:"chmod",args:[t,e]},()=>{this._chmodState(t,e)})}_chmodState(t,e){let a=o(this,l,f).call(this,t);a.mode=e}close(t){let e=o(this,l,D).call(this,t);s(this,N).delete(t),s(this,b).delete(e)}fstat(t){let e=o(this,l,D).call(this,t);return this.lstat(e)}lstat(t){let e=o(this,l,f).call(this,t),a=e.type==="file"?s(this,y).get(e.backingFilename).getSize():0,i=4096;return{dev:0,ino:0,mode:e.mode,nlink:1,uid:0,gid:0,rdev:0,size:a,blksize:i,blocks:Math.ceil(a/i),atime:e.lastModified,mtime:e.lastModified,ctime:e.lastModified}}mkdir(t,e){o(this,l,O).call(this,{opp:"mkdir",args:[t,e]},()=>{this._mkdirState(t,e)})}_mkdirState(t,e){let a=o(this,l,g).call(this,t),i=a.pop(),h=[],r=this.state.root;for(let d of a){if(h.push(t),!Object.prototype.hasOwnProperty.call(r.children,d))if(e?.recursive)this.mkdir(h.join("/"));else throw new p("ENOENT","No such file or directory");if(r.children[d].type!=="directory")throw new p("ENOTDIR","Not a directory");r=r.children[d]}if(Object.prototype.hasOwnProperty.call(r.children,i))throw new p("EEXIST","File exists");let c={type:"directory",lastModified:Date.now(),mode:e?.mode||$.DIR,children:{}};r.children[i]=c}open(t,e,a){if(o(this,l,f).call(this,t).type!=="file")throw new p("EISDIR","Is a directory");let i=o(this,l,R).call(this);return s(this,N).set(i,t),s(this,b).set(t,i),i}readdir(t){let e=o(this,l,f).call(this,t);if(e.type!=="directory")throw new p("ENOTDIR","Not a directory");return Object.keys(e.children)}read(t,e,a,i,h){let r=o(this,l,D).call(this,t),c=o(this,l,f).call(this,r);if(c.type!=="file")throw new p("EISDIR","Is a directory");return s(this,y).get(c.backingFilename).read(new Uint8Array(e.buffer,a,i),{at:h})}rename(t,e){o(this,l,O).call(this,{opp:"rename",args:[t,e]},()=>{this._renameState(t,e,!0)})}_renameState(t,e,a=!1){let i=o(this,l,g).call(this,t),h=i.pop(),r=o(this,l,f).call(this,i.join("/"));if(!Object.prototype.hasOwnProperty.call(r.children,h))throw new p("ENOENT","No such file or directory");let c=o(this,l,g).call(this,e),d=c.pop(),n=o(this,l,f).call(this,c.join("/"));if(a&&Object.prototype.hasOwnProperty.call(n.children,d)){let u=n.children[d];s(this,y).get(u.backingFilename).truncate(0),this.state.pool.push(u.backingFilename)}n.children[d]=r.children[h],delete r.children[h]}rmdir(t){o(this,l,O).call(this,{opp:"rmdir",args:[t]},()=>{this._rmdirState(t)})}_rmdirState(t){let e=o(this,l,g).call(this,t),a=e.pop(),i=o(this,l,f).call(this,e.join("/"));if(!Object.prototype.hasOwnProperty.call(i.children,a))throw new p("ENOENT","No such file or directory");let h=i.children[a];if(h.type!=="directory")throw new p("ENOTDIR","Not a directory");if(Object.keys(h.children).length>0)throw new p("ENOTEMPTY","Directory not empty");delete i.children[a]}truncate(t,e=0){let a=o(this,l,f).call(this,t);if(a.type!=="file")throw new p("EISDIR","Is a directory");let i=s(this,y).get(a.backingFilename);if(!i)throw new p("ENOENT","No such file or directory");i.truncate(e),s(this,S).add(i)}unlink(t){o(this,l,O).call(this,{opp:"unlink",args:[t]},()=>{this._unlinkState(t,!0)})}_unlinkState(t,e=!1){let a=o(this,l,g).call(this,t),i=a.pop(),h=o(this,l,f).call(this,a.join("/"));if(!Object.prototype.hasOwnProperty.call(h.children,i))throw new p("ENOENT","No such file or directory");let r=h.children[i];if(r.type!=="file")throw new p("EISDIR","Is a directory");if(delete h.children[i],e){let c=s(this,y).get(r.backingFilename);c?.truncate(0),s(this,S).add(c),s(this,b).has(t)&&(s(this,N).delete(s(this,b).get(t)),s(this,b).delete(t))}this.state.pool.push(r.backingFilename)}utimes(t,e,a){o(this,l,O).call(this,{opp:"utimes",args:[t,e,a]},()=>{this._utimesState(t,e,a)})}_utimesState(t,e,a){let i=o(this,l,f).call(this,t);i.lastModified=a}writeFile(t,e,a){let i=o(this,l,g).call(this,t),h=i.pop(),r=o(this,l,f).call(this,i.join("/"));if(Object.prototype.hasOwnProperty.call(r.children,h)){let n=r.children[h];n.lastModified=Date.now(),o(this,l,M).call(this,{opp:"setLastModified",args:[t,n.lastModified]})}else{if(this.state.pool.length===0)throw new Error("No more file handles available in the pool");let n={type:"file",lastModified:Date.now(),mode:a?.mode||$.FILE,backingFilename:this.state.pool.pop()};r.children[h]=n,o(this,l,M).call(this,{opp:"createFileNode",args:[t,n]})}let c=r.children[h],d=s(this,y).get(c.backingFilename);e.length>0&&(d.write(typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(e),{at:0}),t.startsWith("/pg_wal")&&s(this,S).add(d))}_createFileNodeState(t,e){let a=o(this,l,g).call(this,t),i=a.pop(),h=o(this,l,f).call(this,a.join("/"));h.children[i]=e;let r=this.state.pool.indexOf(e.backingFilename);return r>-1&&this.state.pool.splice(r,1),e}_setLastModifiedState(t,e){let a=o(this,l,f).call(this,t);a.lastModified=e}write(t,e,a,i,h){let r=o(this,l,D).call(this,t),c=o(this,l,f).call(this,r);if(c.type!=="file")throw new p("EISDIR","Is a directory");let d=s(this,y).get(c.backingFilename);if(!d)throw new p("EBADF","Bad file descriptor");let n=d.write(new Uint8Array(e,a,i),{at:h});return r.startsWith("/pg_wal")&&s(this,S).add(d),n}};T=new WeakMap,I=new WeakMap,E=new WeakMap,_=new WeakMap,w=new WeakMap,k=new WeakMap,y=new WeakMap,j=new WeakMap,N=new WeakMap,b=new WeakMap,S=new WeakMap,l=new WeakSet,v=async function(){P(this,T,await navigator.storage.getDirectory()),P(this,I,await o(this,l,W).call(this,this.dataDir,{create:!0})),P(this,E,await o(this,l,W).call(this,L,{from:s(this,I),create:!0})),P(this,_,await s(this,I).getFileHandle(B,{create:!0})),P(this,w,await s(this,_).createSyncAccessHandle());let t=new ArrayBuffer(s(this,w).getSize());s(this,w).read(t,{at:0});let e,a=new TextDecoder().decode(t).split(`
|
|
2
|
+
`),i=!1;try{e=JSON.parse(a[0])}catch{e={root:{type:"directory",lastModified:Date.now(),mode:$.DIR,children:{}},pool:[]},s(this,w).truncate(0),s(this,w).write(new TextEncoder().encode(JSON.stringify(e)),{at:0}),i=!0}this.state=e;let h=a.slice(1).filter(Boolean).map(n=>JSON.parse(n));for(let n of h){let u=`_${n.opp}State`;if(typeof this[u]=="function")try{this[u].bind(this)(...n.args)}catch(F){console.warn("Error applying OPFS AHP WAL entry",n,F)}}let r=[],c=async n=>{if(n.type==="file")try{let u=await s(this,E).getFileHandle(n.backingFilename),F=await u.createSyncAccessHandle();s(this,k).set(n.backingFilename,u),s(this,y).set(n.backingFilename,F)}catch(u){console.error("Error opening file handle for node",n,u)}else for(let u of Object.values(n.children))r.push(c(u))};await c(this.state.root);let d=[];for(let n of this.state.pool)d.push(new Promise(async u=>{s(this,k).has(n)&&console.warn("File handle already exists for pool file",n);let F=await s(this,E).getFileHandle(n),z=await F.createSyncAccessHandle();s(this,k).set(n,F),s(this,y).set(n,z),u()}));await Promise.all([...r,...d]),await this.maintainPool(i?this.initialPoolSize:this.maintainedPoolSize)},O=function(t,e){let a=o(this,l,M).call(this,t);try{e()}catch(i){throw s(this,w).truncate(a),i}},M=function(t){let e=JSON.stringify(t),a=new TextEncoder().encode(`
|
|
3
|
+
${e}`),i=s(this,w).getSize();return s(this,w).write(a,{at:i}),s(this,S).add(s(this,w)),i},g=function(t){return t.split("/").filter(Boolean)},f=function(t,e){let a=o(this,l,g).call(this,t),i=e||this.state.root;for(let h of a){if(i.type!=="directory")throw new p("ENOTDIR","Not a directory");if(!Object.prototype.hasOwnProperty.call(i.children,h))throw new p("ENOENT","No such file or directory");i=i.children[h]}return i},D=function(t){let e=s(this,N).get(t);if(!e)throw new p("EBADF","Bad file descriptor");return e},R=function(){let t=++x(this,j)._;for(;s(this,N).has(t);)x(this,j)._++;return t},W=async function(t,e){let a=o(this,l,g).call(this,t),i=e?.from||s(this,T);for(let h of a)i=await i.getDirectoryHandle(h,{create:e?.create});return i};var p=class extends Error{constructor(t,e){super(e),typeof t=="number"?this.code=t:typeof t=="string"&&(this.code=A[t])}};export{ht as OpfsAhpFS};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|