@powerhousedao/connect 5.2.0-staging.9 → 5.3.0-staging.1

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.
Files changed (118) hide show
  1. package/dist/assets/AddDriveModal-BaGIi8vQ.js +1 -0
  2. package/dist/assets/ClearStorageModal-CScB4u-p.js +1 -0
  3. package/dist/assets/CookiesPolicyModal-DulYZ5bm.js +1 -0
  4. package/dist/assets/CreateDocumentModal-BFEO-_3C.js +1 -0
  5. package/dist/assets/DebugSettingsModal-X0kJfQAa.js +1 -0
  6. package/dist/assets/DeleteDriveModal-D6ii7XTq.js +1 -0
  7. package/dist/assets/DeleteItemModal-DkwcYMp2.js +1 -0
  8. package/dist/assets/DisclaimerModal-KCxDVSG6.js +1 -0
  9. package/dist/assets/DriveSettingsModal-dYjQYZro.js +1 -0
  10. package/dist/assets/ExportDocumentWithErrorsModal-vxemnGJT.js +1 -0
  11. package/dist/assets/SettingsModal-BFoKkqXU.js +1 -0
  12. package/dist/assets/UpgradeDriveModal-nmnDh0_f.js +1 -0
  13. package/dist/assets/{design_system-A06C6Yf1.js → design_system-_b6SoDrj.js} +2 -2
  14. package/dist/assets/design_system_connect-DbWBZgB6.js +47 -0
  15. package/dist/assets/design_system_ui-CDriTbBJ.js +1 -0
  16. package/dist/assets/document_drive-BJsaRH1s.js +316 -0
  17. package/dist/assets/{document_engineering-DyUJTCDd.js → document_engineering-qm7xrxNm.js} +1 -1
  18. package/dist/assets/document_model-ZlYfiMj0.js +230 -0
  19. package/dist/assets/document_model_editor-oMof2yfF.js +25 -0
  20. package/dist/assets/{drive_explorer-CmtyoZn3.js → drive_explorer-DWwFzk6h.js} +2 -2
  21. package/dist/assets/{graphql-BS4Brs_E.js → graphql-AKTCpY7l.js} +45 -45
  22. package/dist/assets/{graphql-editor-XmXHvN5a.js → graphql-editor-4pzWaFSe.js} +2 -2
  23. package/dist/assets/{graphql_request-9RNJ00DB.js → graphql_request-BJtmW2JS.js} +1 -1
  24. package/dist/assets/{hooks-BErIZKfJ.js → hooks-Cjt8t5rh.js} +1 -1
  25. package/dist/assets/index-DGEkQuau.css +1 -0
  26. package/dist/assets/index-DvZTwJrp.js +28 -0
  27. package/dist/assets/index-nUEwQ7yX.js +18 -0
  28. package/dist/assets/{json-editor-DlieF2PT.js → json-editor-pFQ5xjc9.js} +1 -1
  29. package/dist/assets/nodefs-Cy7Dibn2.js +1 -0
  30. package/dist/assets/{opfs-ahp-DL7h9dwT.js → opfs-ahp-DEHvPLFW.js} +1 -1
  31. package/dist/assets/{reactor_browser-C9bmc1dB.js → reactor_browser-BlK2TQJE.js} +31 -29
  32. package/dist/assets/state-schemas-DJRajivH.js +2 -0
  33. package/dist/index.html +13 -13
  34. package/lib/package.copy.json +6 -2
  35. package/lib/src/components/app-loader.d.ts +0 -4
  36. package/lib/src/components/app-loader.d.ts.map +1 -1
  37. package/lib/src/components/app-loader.js +2 -2
  38. package/lib/src/components/app-loader.js.map +1 -1
  39. package/lib/src/components/app.d.ts.map +1 -1
  40. package/lib/src/components/app.js +11 -0
  41. package/lib/src/components/app.js.map +1 -1
  42. package/lib/src/components/document-editor-container.d.ts +1 -1
  43. package/lib/src/components/document-editor-container.d.ts.map +1 -1
  44. package/lib/src/components/document-editor-container.js +19 -16
  45. package/lib/src/components/document-editor-container.js.map +1 -1
  46. package/lib/src/components/drive-editor-container.d.ts.map +1 -1
  47. package/lib/src/components/drive-editor-container.js +6 -9
  48. package/lib/src/components/drive-editor-container.js.map +1 -1
  49. package/lib/src/components/editors.d.ts.map +1 -1
  50. package/lib/src/components/editors.js +3 -9
  51. package/lib/src/components/editors.js.map +1 -1
  52. package/lib/src/components/error-boundary.d.ts +103 -0
  53. package/lib/src/components/error-boundary.d.ts.map +1 -0
  54. package/lib/src/components/error-boundary.js +104 -0
  55. package/lib/src/components/error-boundary.js.map +1 -0
  56. package/lib/src/components/modal/index.d.ts +0 -1
  57. package/lib/src/components/modal/index.d.ts.map +1 -1
  58. package/lib/src/components/modal/index.js +0 -1
  59. package/lib/src/components/modal/index.js.map +1 -1
  60. package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts.map +1 -1
  61. package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js +5 -2
  62. package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js.map +1 -1
  63. package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts +3 -4
  64. package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts.map +1 -1
  65. package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js +116 -13
  66. package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js.map +1 -1
  67. package/lib/src/components/modal/modals-container.js +2 -2
  68. package/lib/src/components/modal/modals-container.js.map +1 -1
  69. package/lib/src/components/sidebar.d.ts.map +1 -1
  70. package/lib/src/components/sidebar.js +2 -3
  71. package/lib/src/components/sidebar.js.map +1 -1
  72. package/lib/src/pages/content.d.ts.map +1 -1
  73. package/lib/src/pages/content.js +5 -5
  74. package/lib/src/pages/content.js.map +1 -1
  75. package/lib/src/store/reactor.d.ts.map +1 -1
  76. package/lib/src/store/reactor.js +9 -4
  77. package/lib/src/store/reactor.js.map +1 -1
  78. package/lib/src/utils/reactor.d.ts +2 -2
  79. package/lib/src/utils/reactor.d.ts.map +1 -1
  80. package/lib/src/utils/reactor.js +5 -3
  81. package/lib/src/utils/reactor.js.map +1 -1
  82. package/lib/style.css +12466 -0
  83. package/lib/test/utils/signer.test.js +22 -11
  84. package/lib/test/utils/signer.test.js.map +1 -1
  85. package/lib/tsconfig.tsbuildinfo +1 -1
  86. package/package.copy.json +6 -2
  87. package/package.json +15 -11
  88. package/src/index.css +1 -0
  89. package/dist/assets/AddDriveModal-NSVF-Mdc.js +0 -1
  90. package/dist/assets/ClearStorageModal-DD_JYsOg.js +0 -1
  91. package/dist/assets/CookiesPolicyModal--DN3PA4H.js +0 -1
  92. package/dist/assets/CreateDocumentModal-DvZ8e-Lk.js +0 -1
  93. package/dist/assets/DebugSettingsModal-CZWJH2s9.js +0 -1
  94. package/dist/assets/DeleteDriveModal-C0WqLyV9.js +0 -1
  95. package/dist/assets/DeleteItemModal-xzaro45o.js +0 -1
  96. package/dist/assets/DisclaimerModal-BBwmK3NU.js +0 -1
  97. package/dist/assets/DriveSettingsModal-IncRChmg.js +0 -1
  98. package/dist/assets/ExportDocumentWithErrorsModal-Co3Mgkql.js +0 -1
  99. package/dist/assets/SettingsModal-DG-7Po7Z.js +0 -1
  100. package/dist/assets/UpgradeDriveModal-C7ZsOHp2.js +0 -1
  101. package/dist/assets/design_system_connect-BWyThEO1.js +0 -45
  102. package/dist/assets/design_system_ui-lw84_Ll6.js +0 -1
  103. package/dist/assets/document_drive-BuVpBb4l.js +0 -316
  104. package/dist/assets/document_model-DB4SzBSe.js +0 -230
  105. package/dist/assets/document_model_editor-Bvy5ZEHe.js +0 -23
  106. package/dist/assets/index-BilHslhO.css +0 -1
  107. package/dist/assets/index-CzN3WTTB.js +0 -20
  108. package/dist/assets/index-DhjId3Dc.js +0 -25
  109. package/dist/assets/nodefs-DuVlDR-q.js +0 -1
  110. package/dist/assets/state-schemas-D3n-7j6n.js +0 -2
  111. package/lib/src/components/modal/modals-error-boundary.d.ts +0 -18
  112. package/lib/src/components/modal/modals-error-boundary.d.ts.map +0 -1
  113. package/lib/src/components/modal/modals-error-boundary.js +0 -22
  114. package/lib/src/components/modal/modals-error-boundary.js.map +0 -1
  115. package/lib/src/utils/signer.d.ts +0 -18
  116. package/lib/src/utils/signer.d.ts.map +0 -1
  117. package/lib/src/utils/signer.js +0 -215
  118. package/lib/src/utils/signer.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/graphql-editor-4pzWaFSe.js","assets/document_model_editor-oMof2yfF.js","assets/graphql-AKTCpY7l.js","assets/drive_explorer-DWwFzk6h.js","assets/sentry_react-cODD7zWc.js","assets/react-DQSxOgtG.js","assets/sentry_browser-B4YoBIIG.js","assets/react/jsx-runtime-DldvXD6N.js","assets/document_model-ZlYfiMj0.js","assets/zod-BpTyxkjy.js","assets/design_system-_b6SoDrj.js","assets/tailwind_merge-Dr4f9Rms.js","assets/react-dom-D6zQJsh6.js","assets/reactor_browser-BlK2TQJE.js","assets/document_drive-BJsaRH1s.js","assets/config-CU-aFfVJ.js","assets/design_system_connect-DbWBZgB6.js","assets/design_system_ui-CDriTbBJ.js","assets/react-dom/client-BVPiT_FE.js","assets/hooks-Cjt8t5rh.js","assets/json-editor-pFQ5xjc9.js"])))=>i.map(i=>d[i]);
2
+ import{_ as L}from"./drive_explorer-DWwFzk6h.js";import{j as e,m as g,p as A,q as B,t as C,v as U,w as G,x as Y,y as J,z as K,A as W}from"./document_model_editor-oMof2yfF.js";import{C as Z}from"./design_system_ui-CDriTbBJ.js";import{r}from"./sentry_react-cODD7zWc.js";import{M as q,N as I,O as k,Q as O}from"./design_system_connect-DbWBZgB6.js";import{K as E}from"./graphql-AKTCpY7l.js";import{c as Q}from"./design_system-_b6SoDrj.js";import"./react/jsx-runtime-DldvXD6N.js";import"./document_model-ZlYfiMj0.js";import"./zod-BpTyxkjy.js";import"./react-DQSxOgtG.js";import"./tailwind_merge-Dr4f9Rms.js";import"./react-dom-D6zQJsh6.js";import"./reactor_browser-BlK2TQJE.js";import"./document_drive-BJsaRH1s.js";import"./config-CU-aFfVJ.js";import"./react-dom/client-BVPiT_FE.js";import"./sentry_browser-B4YoBIIG.js";const V=r.forwardRef((a,s)=>{const{className:n,...c}=a;return e.jsx("button",{ref:s,...c,className:g("h-10 whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",n)})});function $({error:a}){const{payload:s}=a;switch(s.kind){case"MISSING":return e.jsxs("span",{children:["Field ",e.jsx("strong",{children:s.field})," is missing."]});case"MISSING_OPTIONAL":return e.jsxs("span",{children:["Optional field ",e.jsx("strong",{children:s.field})," is not defined."]});case"UNKNOWN_FIELD":return e.jsxs("span",{children:["Field ",e.jsx("strong",{children:s.field})," is not a known field."]});case"NON_NULL":return e.jsxs("span",{children:["Field ",e.jsx("strong",{children:s.field})," cannot be null."]});case"TYPE":return e.jsxs("span",{children:["Field ",e.jsx("strong",{children:s.field}),s.expectedType?e.jsxs(e.Fragment,{children:[" ","must be a"," ",e.jsx("strong",{children:s.expectedType.replace(/!/g,"")}),"."]}):e.jsx(e.Fragment,{children:" has an invalid value."})]});case"RECURSIVE_TYPE":return e.jsxs("span",{children:["Field ",e.jsx("strong",{children:s.typeName})," has a recursive type. It must be optional."]});default:return e.jsx("span",{children:"Invalid value."})}}const X=q,D=r.forwardRef(({className:a,...s},n)=>e.jsx(I,{ref:n,className:g("flex items-center justify-center rounded-xl bg-slate-50 p-1 shadow-[inset_0px_0px_2px_rgba(255,255,255,0.50)]",a),...s}));D.displayName=I.displayName;const v=r.forwardRef(({className:a,...s},n)=>e.jsx(k,{ref:n,className:g("flex w-full items-center justify-center whitespace-nowrap rounded-lg p-1 text-sm text-gray-500 transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-gray-50 data-[state=active]:text-gray-800 data-[state=active]:shadow-[0px_16px_16px_-4px_rgba(0,0,0,0.10)]",a),...s}));v.displayName=k.displayName;const y=r.forwardRef(({className:a,...s},n)=>e.jsx(O,{ref:n,className:g("",a),...s}));y.displayName=O.displayName;const _=r.lazy(()=>L(()=>import("./graphql-editor-4pzWaFSe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),ee=r.lazy(()=>L(()=>import("./json-editor-pFQ5xjc9.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])));function T({modelName:a,stateSchema:s,initialValue:n,setStateSchema:c,setInitialState:d,scope:t}){const{sharedSchema:l,error:x}=B(),[h,j]=r.useState(!1),[o,F]=r.useState(!0),M=r.useCallback(i=>C(i,a,t),[a,t]),N=r.useMemo(()=>{const i=C(s,a,t);return x?[...i,x]:i},[s,a,t,x]),R=r.useCallback(()=>{j(i=>!i)},[]),P=r.useCallback(i=>c(i,t),[c,t]),H=r.useCallback(i=>d(i,t),[d,t]),b=r.useRef(!1),{initialValueErrors:z,fixedState:f}=r.useMemo(()=>{const i=n||"{}",m=U(l);if(!m)return{initialValueErrors:[],fixedState:null};const S=G(a,t);if(!S)return{initialValueErrors:[],fixedState:null};const p=m.definitions.find(u=>u.kind===E.OBJECT_TYPE_DEFINITION&&u.name.value===S);if(!p||p.kind!==E.OBJECT_TYPE_DEFINITION)return{initialValueErrors:[],fixedState:null};const w=Y(m,p,i);if(w.length&&o){const u=J({sharedSchemaDocumentNode:m,stateTypeDefinitionNode:p,existingValue:i});if(n!==u)return{initialValueErrors:[],fixedState:u}}return{initialValueErrors:w,fixedState:null}},[l,n,o,t,a]);return r.useEffect(()=>{f&&!b.current?(b.current=!0,d(f,t)):f||(b.current=!1)},[f,d,t]),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-2 text-lg capitalize",children:[t," state schema *"]}),e.jsxs(V,{onClick:R,className:"mb-2 flex w-fit items-center gap-2",children:[h?"Hide":"Show"," standard library",e.jsx("svg",{className:Q("inline-block transition-transform",h?"rotate-180":"rotate-0"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M11.9883 6.01172C11.4363 6.01172 10.9883 6.45972 10.9883 7.01172V13.0117H6.98828L11.9883 18.0117L16.9883 13.0117H12.9883V7.01172C12.9883 6.45972 12.5403 6.01172 11.9883 6.01172Z",fill:"black"})})]}),e.jsxs(r.Suspense,{children:[h&&e.jsx(_,{doc:K,readonly:!0}),e.jsx(_,{doc:s,updateDocumentInModel:P,customLinter:M}),N.length>0&&e.jsx("p",{className:"mt-2 text-sm text-red-600",children:N[0].message})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsxs("h3",{className:"mb-2 text-right text-lg capitalize",children:[t," state initial value *"]}),e.jsx(Z,{value:o,onChange:F,className:"mb-2 w-fit whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 pl-2 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",label:e.jsxs("div",{className:"flex items-center gap-2 py-2 pr-2",children:["Sync with schema"," ",e.jsx("svg",{className:"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M8.00521 1.99219C6.63588 1.99219 5.32788 2.45152 4.27588 3.28419C3.98721 3.51219 3.94321 3.93285 4.17188 4.22151C4.40054 4.51018 4.82055 4.55418 5.10921 4.32552C5.92721 3.67819 6.93921 3.32552 8.00521 3.32552C10.5825 3.32552 12.6719 5.41485 12.6719 7.99218H11.3385L13.3385 10.6588L15.3385 7.99218H14.0052C14.0052 4.67818 11.3192 1.99219 8.00521 1.99219ZM2.67188 5.32552L0.671875 7.99218H2.00521C2.00521 11.3062 4.69121 13.9922 8.00521 13.9922C9.37521 13.9922 10.6825 13.5335 11.7345 12.7002C12.0232 12.4722 12.0672 12.0515 11.8385 11.7628C11.6099 11.4742 11.1899 11.4302 10.9012 11.6588C10.0825 12.3068 9.07188 12.6588 8.00521 12.6588C5.42788 12.6588 3.33854 10.5695 3.33854 7.99218H4.67188L2.67188 5.32552Z",fill:"#343839"})})]})})]}),e.jsxs(r.Suspense,{children:[e.jsx(ee,{doc:n,updateDocumentInModel:H}),z.map((i,m)=>e.jsx("p",{className:"mt-2 text-sm text-red-600",children:i instanceof W?e.jsx($,{error:i}):i.message},m))]})]})]})}function be({modelName:a,globalStateSchema:s,localStateSchema:n,globalStateInitialValue:c,localStateInitialValue:d,setStateSchema:t,setInitialState:l,currentScope:x,onScopeChange:h}){const j=r.useCallback(()=>{const o=A(a,"local");t(o,"local"),l("","local")},[a,t,l]);return e.jsxs(X,{className:"pb-8",activationMode:"manual",value:x,onValueChange:o=>h(o),children:[e.jsx("div",{className:"my-6",children:e.jsxs(D,{className:"mx-auto flex max-w-sm",children:[e.jsx(v,{value:"global",children:"Global"}),e.jsx(v,{value:"local",children:"Local"})]})}),e.jsx(y,{value:"global",tabIndex:-1,children:e.jsx(T,{modelName:a,stateSchema:s,initialValue:c,setStateSchema:t,setInitialState:l,scope:"global"})}),e.jsx(y,{value:"local",tabIndex:-1,children:n?e.jsx(T,{modelName:a,stateSchema:n,initialValue:d,setStateSchema:t,setInitialState:l,scope:"local"}):e.jsxs("div",{className:"",children:[e.jsx("h3",{className:"mb-2 text-lg capitalize",children:"local state schema *"}),e.jsx(V,{onClick:j,children:"Add local state"})]})})]})}export{be as default};
package/dist/index.html CHANGED
@@ -22,27 +22,27 @@
22
22
  <meta name="twitter:image" content="https://cf-ipfs.com/ipfs/bafkreigrmclndf2jpbolaq22535q2sw5t44uad3az3dpvkzrnt4lpjt63e">
23
23
  <meta name="twitter:title" content="Connect">
24
24
  <meta name="twitter:description" content="Navigate your organisation’s toughest operational challenges and steer your contributors to success with Connect. A navigation, collaboration and reporting tool for decentralised and open organisation.">
25
- <script type="module" crossorigin src="/assets/index-CzN3WTTB.js"></script>
26
- <link rel="modulepreload" crossorigin href="/assets/graphql-BS4Brs_E.js">
25
+ <script type="module" crossorigin src="/assets/index-nUEwQ7yX.js"></script>
26
+ <link rel="modulepreload" crossorigin href="/assets/graphql-AKTCpY7l.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/react-DQSxOgtG.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/sentry_browser-B4YoBIIG.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/sentry_react-cODD7zWc.js">
30
- <link rel="modulepreload" crossorigin href="/assets/drive_explorer-CmtyoZn3.js">
30
+ <link rel="modulepreload" crossorigin href="/assets/drive_explorer-DWwFzk6h.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/react/jsx-runtime-DldvXD6N.js">
32
32
  <link rel="modulepreload" crossorigin href="/assets/zod-BpTyxkjy.js">
33
- <link rel="modulepreload" crossorigin href="/assets/document_model-DB4SzBSe.js">
33
+ <link rel="modulepreload" crossorigin href="/assets/document_model-ZlYfiMj0.js">
34
34
  <link rel="modulepreload" crossorigin href="/assets/tailwind_merge-Dr4f9Rms.js">
35
- <link rel="modulepreload" crossorigin href="/assets/design_system-A06C6Yf1.js">
36
- <link rel="modulepreload" crossorigin href="/assets/config-CU-aFfVJ.js">
37
- <link rel="modulepreload" crossorigin href="/assets/document_drive-BuVpBb4l.js">
38
- <link rel="modulepreload" crossorigin href="/assets/reactor_browser-C9bmc1dB.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/design_system-_b6SoDrj.js">
39
36
  <link rel="modulepreload" crossorigin href="/assets/react-dom-D6zQJsh6.js">
37
+ <link rel="modulepreload" crossorigin href="/assets/config-CU-aFfVJ.js">
38
+ <link rel="modulepreload" crossorigin href="/assets/document_drive-BJsaRH1s.js">
39
+ <link rel="modulepreload" crossorigin href="/assets/reactor_browser-BlK2TQJE.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/react-dom/client-BVPiT_FE.js">
41
- <link rel="modulepreload" crossorigin href="/assets/design_system_ui-lw84_Ll6.js">
42
- <link rel="modulepreload" crossorigin href="/assets/design_system_connect-BWyThEO1.js">
43
- <link rel="modulepreload" crossorigin href="/assets/document_model_editor-Bvy5ZEHe.js">
44
- <link rel="modulepreload" crossorigin href="/assets/graphql_request-9RNJ00DB.js">
45
- <link rel="stylesheet" crossorigin href="/assets/index-BilHslhO.css">
41
+ <link rel="modulepreload" crossorigin href="/assets/design_system_ui-CDriTbBJ.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/design_system_connect-DbWBZgB6.js">
43
+ <link rel="modulepreload" crossorigin href="/assets/document_model_editor-oMof2yfF.js">
44
+ <link rel="modulepreload" crossorigin href="/assets/graphql_request-BJtmW2JS.js">
45
+ <link rel="stylesheet" crossorigin href="/assets/index-DGEkQuau.css">
46
46
  </head>
47
47
 
48
48
  <body>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powerhousedao/connect",
3
3
  "productName": "Powerhouse-Connect",
4
- "version": "5.2.0-staging.8",
4
+ "version": "5.1.0-dev.43",
5
5
  "description": "Powerhouse Connect",
6
6
  "main": "dist/index.html",
7
7
  "type": "module",
@@ -84,7 +84,7 @@
84
84
  "types": "./lib/src/i18n/index.d.ts"
85
85
  },
86
86
  "./custom.d.ts": "./lib/custom.d.ts",
87
- "./style.css": "./src/index.css",
87
+ "./style.css": "./lib/style.css",
88
88
  "./assets/*.mp4": "./assets/*.mp4",
89
89
  "./assets/*.png": "./assets/*.png",
90
90
  "./assets/*.svg": "./assets/*.svg",
@@ -115,6 +115,7 @@
115
115
  "test": "vitest run",
116
116
  "postinstall": "cp ./package.json ./package.copy.json",
117
117
  "dev": "vite dev",
118
+ "build:css": "npx @tailwindcss/cli -i ./src/index.css -o ./lib/style.css",
118
119
  "build:vite": "vite build",
119
120
  "build:debug": "PH_DEBUG_BUILD=true vite build",
120
121
  "preview": "vite preview",
@@ -169,5 +170,8 @@
169
170
  "vite-plugin-node-polyfills": "^0.24.0",
170
171
  "vite-plugin-svgr": "^4.5.0",
171
172
  "zod": "^4.1.13"
173
+ },
174
+ "devDependencies": {
175
+ "@tailwindcss/cli": "^4.1.16"
172
176
  }
173
177
  }
@@ -1,7 +1,3 @@
1
- import { type ReactNode } from "react";
2
1
  import "@powerhousedao/connect/i18n";
3
- export declare const Load: import("react").LazyExoticComponent<({ children }: {
4
- children?: ReactNode;
5
- }) => ReactNode>;
6
2
  export declare const AppLoader: () => import("react/jsx-runtime").JSX.Element;
7
3
  //# sourceMappingURL=app-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-loader.d.ts","sourceRoot":"","sources":["../../../src/components/app-loader.tsx"],"names":[],"mappings":"AASA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,6BAA6B,CAAC;AAErC,eAAO,MAAM,IAAI,qDAGW;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,eAOlD,CAAC;AAEH,eAAO,MAAM,SAAS,+CAYrB,CAAC"}
1
+ {"version":3,"file":"app-loader.d.ts","sourceRoot":"","sources":["../../../src/components/app-loader.tsx"],"names":[],"mappings":"AAOA,OAAO,6BAA6B,CAAC;AAiBrC,eAAO,MAAM,SAAS,+CAYrB,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { App, AppSkeleton, CookieBanner, ModalsContainer, } from "@powerhousedao/connect/components";
3
3
  import { useCheckLatestVersion } from "@powerhousedao/connect/hooks";
4
+ import "@powerhousedao/connect/i18n";
4
5
  import { useSubscribeToVetraPackages } from "@powerhousedao/connect/services";
5
6
  import { createReactor, useSetSentryUser } from "@powerhousedao/connect/store";
6
7
  import { lazy, StrictMode, Suspense } from "react";
7
- import "@powerhousedao/connect/i18n";
8
- export const Load = lazy(async () => {
8
+ const Load = lazy(async () => {
9
9
  await createReactor();
10
10
  return {
11
11
  default: ({ children }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"app-loader.js","sourceRoot":"","sources":["../../../src/components/app-loader.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,UAAU,EAA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AAO,EAAE,CAAC,EAAE,QAAQ,EAA4B,EAAE,EAAE;YAClD,2BAA2B,EAAE,CAAC;YAC9B,gBAAgB,EAAE,CAAC;YACnB,qBAAqB,EAAE,CAAC;YACxB,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAC7B,MAAC,UAAU,eACT,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,WAAW,KAAG,EAAE,IAAI,EAAC,WAAW,YACnD,KAAC,IAAI,cACH,KAAC,GAAG,KAAG,GACF,GACE,EACX,KAAC,QAAQ,IAAC,IAAI,EAAC,cAAc,YAC3B,KAAC,YAAY,KAAG,GACP,EACX,KAAC,eAAe,KAAG,IACR,CACd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,GAAG,+CAoBf,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,GAAG,+CAkCf,CAAC"}
@@ -5,6 +5,17 @@ import { DocumentEditorDebugTools, serviceWorkerManager, } from "@powerhousedao/
5
5
  import { ToastContainer, WagmiContext, } from "@powerhousedao/design-system/connect";
6
6
  import { useEffect } from "react";
7
7
  export const App = () => {
8
+ // refresh page on vite preload error due to outdated chunks
9
+ useEffect(() => {
10
+ const handlePreloadError = () => {
11
+ console.log("Outdated chunks detected, reloading page...");
12
+ window.location.reload();
13
+ };
14
+ window.addEventListener("vite:preloadError", handlePreloadError);
15
+ return () => {
16
+ window.removeEventListener("vite:preloadError", handlePreloadError);
17
+ };
18
+ }, []);
8
19
  useEffect(() => {
9
20
  if (import.meta.env.MODE === "development") {
10
21
  window.documentEditorDebugTools = new DocumentEditorDebugTools();
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EACL,wBAAwB,EACxB,cAAc,GACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,cAAc,EACd,YAAY,GACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE;IACtB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YAC3C,MAAM,CAAC,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,oBAAoB,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,cAAc,cACb,KAAC,YAAY,cACX,MAAC,wBAAwB,eACvB,KAAC,cAAc,IAAC,QAAQ,EAAC,cAAc,EAAC,WAAW,EAAC,SAAS,GAAG,EAChE,KAAC,MAAM,KAAG,EACV,KAAC,SAAS,KAAG,IACY,GACd,GACA,CAClB,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EACL,wBAAwB,EACxB,cAAc,GACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,cAAc,EACd,YAAY,GACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE;IACtB,4DAA4D;IAC5D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,kBAAkB,GAAG,GAAG,EAAE;YAC9B,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;YAC3D,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC3B,CAAC,CAAC;QAEF,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAAC;QAEjE,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAAC;QACtE,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YAC3C,MAAM,CAAC,wBAAwB,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,oBAAoB,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,cAAc,cACb,KAAC,YAAY,cACX,MAAC,wBAAwB,eACvB,KAAC,cAAc,IAAC,QAAQ,EAAC,cAAc,EAAC,WAAW,EAAC,SAAS,GAAG,EAChE,KAAC,MAAM,KAAG,EACV,KAAC,SAAS,KAAG,IACY,GACd,GACA,CAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare function DocumentEditorContainer(): import("react/jsx-runtime").JSX.Element | null;
1
+ export declare function DocumentEditorContainer(): import("react/jsx-runtime").JSX.Element;
2
2
  //# sourceMappingURL=document-editor-container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"document-editor-container.d.ts","sourceRoot":"","sources":["../../../src/components/document-editor-container.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,uBAAuB,mDAiFtC"}
1
+ {"version":3,"file":"document-editor-container.d.ts","sourceRoot":"","sources":["../../../src/components/document-editor-container.tsx"],"names":[],"mappings":"AAqBA,wBAAgB,uBAAuB,4CAoFtC"}
@@ -1,39 +1,41 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { DocumentEditor } from "@powerhousedao/connect/components";
3
+ import { toast } from "@powerhousedao/connect/services";
3
4
  import { openUrl } from "@powerhousedao/connect/utils";
4
5
  import { buildDocumentSubgraphUrl, exportFile, getDriveIsRemote, getDriveRemoteUrl, setSelectedNode, showPHModal, useNodeParentFolderById, useSelectedDocument, useSelectedDrive, validateDocument, } from "@powerhousedao/reactor-browser";
5
6
  import { useConnectCrypto, useUser, } from "@powerhousedao/reactor-browser/connect";
6
- import { useMemo } from "react";
7
+ import { useCallback, useMemo } from "react";
7
8
  export function DocumentEditorContainer() {
8
9
  const [selectedDrive] = useSelectedDrive();
9
10
  const [selectedDocument] = useSelectedDocument();
10
- const parentFolder = useNodeParentFolderById(selectedDocument?.header.id);
11
+ const parentFolder = useNodeParentFolderById(selectedDocument.header.id);
11
12
  const isRemoteDrive = getDriveIsRemote(selectedDrive);
12
13
  const remoteUrl = getDriveRemoteUrl(selectedDrive);
13
14
  const connectCrypto = useConnectCrypto();
14
15
  const user = useUser();
15
- const exportDocument = (document) => {
16
- const validationErrors = validateDocument(document);
16
+ const onExport = useCallback(() => {
17
+ const validationErrors = validateDocument(selectedDocument);
17
18
  if (validationErrors.length) {
18
19
  showPHModal({
19
20
  type: "exportDocumentWithErrors",
20
- documentId: document.header.id,
21
+ documentId: selectedDocument.header.id,
21
22
  });
22
23
  }
23
24
  else {
24
- return exportFile(document);
25
- }
26
- };
27
- const onExport = () => {
28
- if (selectedDocument) {
29
- return exportDocument(selectedDocument);
25
+ exportFile(selectedDocument).catch((error) => {
26
+ console.error(error);
27
+ const errorMessage = error instanceof Error
28
+ ? error.message
29
+ : JSON.stringify(error, null, 1);
30
+ toast(`Failed to export document: ${errorMessage}`);
31
+ });
30
32
  }
31
- };
33
+ }, [selectedDocument]);
32
34
  // TODO: fix this mess
33
35
  const onOpenSwitchboardLink = useMemo(() => {
34
36
  return isRemoteDrive
35
37
  ? async () => {
36
- if (!selectedDocument?.header.id) {
38
+ if (!selectedDocument.header.id) {
37
39
  console.error("No selected document");
38
40
  return;
39
41
  }
@@ -55,8 +57,9 @@ export function DocumentEditorContainer() {
55
57
  }
56
58
  : undefined;
57
59
  }, [isRemoteDrive, remoteUrl, selectedDocument]);
58
- if (!selectedDocument)
59
- return null;
60
- return (_jsx("div", { id: "document-editor-container", className: "flex-1 rounded-2xl bg-gray-50 p-4", children: _jsx(DocumentEditor, { document: selectedDocument, onClose: () => setSelectedNode(parentFolder), onExport: onExport, onOpenSwitchboardLink: onOpenSwitchboardLink }) }));
60
+ const onClose = useCallback(() => {
61
+ setSelectedNode(parentFolder);
62
+ }, [parentFolder, setSelectedNode]);
63
+ return (_jsx("div", { id: "document-editor-container", className: "flex-1 rounded-2xl bg-gray-50 p-4", children: _jsx(DocumentEditor, { document: selectedDocument, onClose: onClose, onExport: onExport, onOpenSwitchboardLink: onOpenSwitchboardLink }) }));
61
64
  }
62
65
  //# sourceMappingURL=document-editor-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"document-editor-container.js","sourceRoot":"","sources":["../../../src/components/document-editor-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EACL,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO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AAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBACtC,OAAO;gBACT,CAAC;gBAED,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBAC3C,OAAO;gBACT,CAAC;gBAED,uDAAuD;gBACvD,MAAM,KAAK,GAAG,IAAI,EAAE,OAAO;oBACzB,CAAC,CAAC,MAAM,aAAa,EAAE,cAAc,CACjC,SAAS,EACT,IAAI,CAAC,OAAO,EACZ,KAAK,EACL,EAAE,SAAS,EAAE,GAAG,EAAE,CACnB;oBACH,CAAC,CAAC,SAAS,CAAC;gBAEd,MAAM,GAAG,GAAG,wBAAwB,CAClC,SAAS,EACT,gBAAgB,CAAC,MAAM,CAAC,EAAE,EAC1B,KAAK,CACN,CAAC;gBACF,IAAI,CAAC;oBACH,OAAO,CAAC,GAAG,CAAC,CAAC;gBACf,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,CAAC,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;YACH,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEjD,IAAI,CAAC,gBAAgB;QAAE,OAAO,IAAI,CAAC;IAEnC,OAAO,CACL,cACE,EAAE,EAAC,2BAA2B,EAC9B,SAAS,EAAC,mCAAmC,YAE7C,KAAC,cAAc,IACb,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,YAAY,CAAC,EAC5C,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,GAC5C,GACE,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"document-editor-container.js","sourceRoot":"","sources":["../../../src/components/document-editor-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAA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CAAC;IAChB,CAAC,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEjD,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,eAAe,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAEpC,OAAO,CACL,cACE,EAAE,EAAC,2BAA2B,EAC9B,SAAS,EAAC,mCAAmC,YAE7C,KAAC,cAAc,IACb,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,GAC5C,GACE,CACP,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"drive-editor-container.d.ts","sourceRoot":"","sources":["../../../src/components/drive-editor-container.tsx"],"names":[],"mappings":"AAwBA,wBAAgB,oBAAoB,4CA+BnC"}
1
+ {"version":3,"file":"drive-editor-container.d.ts","sourceRoot":"","sources":["../../../src/components/drive-editor-container.tsx"],"names":[],"mappings":"AAaA,wBAAgB,oBAAoB,4CAgCnC"}
@@ -1,18 +1,15 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { GenericDriveExplorer } from "@powerhousedao/common/generic-drive-explorer";
3
3
  import { DropZoneWrapper } from "@powerhousedao/design-system/connect";
4
- import { useDefaultDriveEditorModule, useDriveEditorModuleById, useSelectedDocument, useSelectedDrive, } from "@powerhousedao/reactor-browser";
4
+ import { useDefaultDriveEditorModule, useDriveEditorModuleById, useSelectedDocumentId, useSelectedDrive, } from "@powerhousedao/reactor-browser";
5
5
  import { Suspense } from "react";
6
- import { ErrorBoundary } from "react-error-boundary";
7
6
  import { DocumentEditorContainer } from "./document-editor-container.js";
8
7
  import { EditorLoader } from "./editor-loader.js";
9
- function DriveEditorError({ error }) {
10
- return (_jsxs("div", { className: "mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center", children: [_jsx("h1", { className: "mb-2 text-xl font-semibold", children: "Error" }), _jsx("i", { children: error instanceof Error ? error.message : error }), _jsx("pre", { children: JSON.stringify(error, null, 2) })] }));
11
- }
8
+ import { ErrorBoundary } from "./error-boundary.js";
12
9
  export function DriveEditorContainer() {
13
10
  const [selectedDrive] = useSelectedDrive();
14
- const [selectedDocument] = useSelectedDocument();
15
- const driveEditor = useDriveEditorModuleById(selectedDrive?.header.meta?.preferredEditor);
11
+ const selectedDocumentId = useSelectedDocumentId();
12
+ const driveEditor = useDriveEditorModuleById(selectedDrive.header.meta?.preferredEditor);
16
13
  const defaultDriveEditor = useDefaultDriveEditorModule();
17
14
  const DriveEditorComponent = driveEditor?.Component ??
18
15
  defaultDriveEditor?.Component ??
@@ -20,6 +17,6 @@ export function DriveEditorContainer() {
20
17
  if (!DriveEditorComponent) {
21
18
  throw new Error("No drive editor component found");
22
19
  }
23
- return (_jsx(ErrorBoundary, { fallbackRender: DriveEditorError, children: _jsx(Suspense, { fallback: _jsx(EditorLoader, {}), children: _jsx(DropZoneWrapper, { className: "flex h-full flex-col overflow-auto", children: _jsx(DriveEditorComponent, { children: selectedDocument ? _jsx(DocumentEditorContainer, {}) : null }) }) }) }, selectedDrive.header.id));
20
+ return (_jsx(ErrorBoundary, { variant: "detailed", resetKeys: [selectedDrive.header.id], loggerContext: ["Connect", "DriveEditor"], children: _jsx(Suspense, { fallback: _jsx(EditorLoader, {}), children: _jsx(DropZoneWrapper, { className: "flex h-full flex-col overflow-auto", children: _jsx(DriveEditorComponent, { children: selectedDocumentId ? _jsx(DocumentEditorContainer, {}) : null }) }) }) }));
24
21
  }
25
22
  //# sourceMappingURL=drive-editor-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drive-editor-container.js","sourceRoot":"","sources":["../../../src/components/drive-editor-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,C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AAgB,YAGhC,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,YAAY,KAAG,YAClC,KAAC,eAAe,IAAC,SAAS,EAAC,oCAAoC,YAC7D,KAAC,oBAAoB,cAClB,gBAAgB,CAAC,CAAC,CAAC,KAAC,uBAAuB,KAAG,CAAC,CAAC,CAAC,IAAI,GACjC,GACP,GACT,IARN,aAAa,CAAC,MAAM,CAAC,EAAE,CASd,CACjB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"drive-editor-container.js","sourceRoot":"","sources":["../../../src/components/drive-editor-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,oBAAoB;IAClC,MAAM,CAAC,aAAa,CAAC,GAAG,gBAAgB,EAAE,CAAC;IAC3C,MAAM,kBAAkB,GAAG,qBAAqB,EAAE,CAAC;IAEnD,MAAM,WAAW,GAAG,wBAAwB,CAC1C,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAC3C,CAAC;IACF,MAAM,kBAAkB,GAAG,2BAA2B,EAAE,CAAC;IAEzD,MAAM,oBAAoB,GACxB,WAAW,EAAE,SAAS;QACtB,kBAAkB,EAAE,SAAS;QAC7B,oBAAoB,CAAC,SAAS,CAAC;IAEjC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,CACL,KAAC,aAAa,IACZ,OAAO,EAAC,UAAU,EAClB,SAAS,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,EACpC,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,YAEzC,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,YAAY,KAAG,YAClC,KAAC,eAAe,IAAC,SAAS,EAAC,oCAAoC,YAC7D,KAAC,oBAAoB,cAClB,kBAAkB,CAAC,CAAC,CAAC,KAAC,uBAAuB,KAAG,CAAC,CAAC,CAAC,IAAI,GACnC,GACP,GACT,GACG,CACjB,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../../../src/components/editors.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,KAAK,KAAK,CAAC,SAAS,SAAS,UAAU,GAAG,UAAU,IAAI;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C,CAAC;AAkBF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgL1C,CAAC"}
1
+ {"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../../../src/components/editors.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASjD,KAAK,KAAK,CAAC,SAAS,SAAS,UAAU,GAAG,UAAU,IAAI;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C,CAAC;AAUF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiL1C,CAAC"}
@@ -6,16 +6,10 @@ import { RevisionHistory } from "@powerhousedao/design-system/connect";
6
6
  import { getRevisionFromDate, setRevisionHistoryVisible, showPHModal, useDocumentById, useDocumentModelModuleById, useEditorModuleById, useFallbackEditorModule, useRevisionHistoryVisible, useSelectedTimelineItem, } from "@powerhousedao/reactor-browser";
7
7
  import { redo, undo } from "document-model/core";
8
8
  import { Suspense, useEffect, useState } from "react";
9
- import { ErrorBoundary } from "react-error-boundary";
9
+ import { CenteredErrorMessage, ErrorBoundary, } from "./error-boundary.js";
10
10
  function EditorError({ message }) {
11
11
  return (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx("h3", { className: "text-lg font-semibold", children: message }) }));
12
12
  }
13
- function FallbackEditorError(props) {
14
- const message = props.error instanceof Error
15
- ? props.error.message
16
- : props.error;
17
- return _jsx(EditorError, { message: message });
18
- }
19
13
  export const DocumentEditor = (props) => {
20
14
  const { document: initialDocument, onClose, onExport, onOpenSwitchboardLink, } = props;
21
15
  const selectedTimelineItem = useSelectedTimelineItem();
@@ -85,9 +79,9 @@ export const DocumentEditor = (props) => {
85
79
  const EditorComponent = editorModule.Component;
86
80
  return (_jsx("div", { className: "relative h-full", id: "document-editor-context", children: revisionHistoryVisible ? (_jsx(RevisionHistory, { documentTitle: documentName ?? "", documentId: documentId ?? "", globalOperations: globalOperations, localOperations: localOperations, onClose: () => setRevisionHistoryVisible(false), documentState: document.state, onCopyState: () => {
87
81
  toast("Copied document state to clipboard", { type: "success" });
88
- } }, documentId)) : (_jsx(Suspense, { fallback: _jsx(EditorLoader, { message: "Loading editor" }), name: "EditorLoader", children: _jsx(ErrorBoundary, { fallbackRender: FallbackEditorError, onError: handleEditorError, children: !editorError?.error && (_jsx(EditorComponent, { context: {
82
+ } }, documentId)) : (_jsx(Suspense, { fallback: _jsx(EditorLoader, { message: "Loading editor" }), name: "EditorLoader", children: _jsx(ErrorBoundary, { fallbackRender: CenteredErrorMessage, resetKeys: [documentId], onError: handleEditorError, loggerContext: ["Connect", "DocumentEditor"], children: !editorError?.error && (_jsx(EditorComponent, { context: {
89
83
  readMode: !!selectedTimelineItem,
90
84
  selectedTimelineRevision: getRevisionFromDate(selectedTimelineItem?.startDate, selectedTimelineItem?.endDate, globalOperations),
91
- }, documentId: document.header.id }, documentId)) }, documentId) })) }));
85
+ }, documentId: document.header.id }, documentId)) }) })) }));
92
86
  };
93
87
  //# sourceMappingURL=editors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editors.js","sourceRoot":"","sources":["../../../src/components/editors.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,eAAe,EACf,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AASrD,SAAS,WAAW,CAAC,EAAE,OAAO,EAAgC;IAC5D,OAAO,CACL,cAAK,SAAS,EAAC,4CAA4C,YACzD,aAAI,SAAS,EAAC,uBAAuB,YAAE,OAAO,GAAM,GAChD,CACP,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAoB;IAC/C,MAAM,OAAO,GACX,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AAwB,EAAE,mBAAmB,CAC3C,oBAAoB,EAAE,SAAS,EAC/B,oBAAoB,EAAE,OAAO,EAC7B,gBAAgB,CACjB;qBACF,EACD,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,IATzB,UAAU,CAUf,CACH,GACa,GACP,CACZ,GACG,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,103 @@
1
+ import type { ReactNode } from "react";
2
+ import { type FallbackProps } from "react-error-boundary";
3
+ /**
4
+ * Available fallback UI variants for the ErrorBoundary component.
5
+ *
6
+ * - `"silent"` - Renders nothing when an error occurs (useful for modals)
7
+ * - `"text"` - Displays a simple centered text message
8
+ * - `"detailed"` - Shows full error details including message and JSON representation
9
+ */
10
+ type ErrorFallbackVariant = "silent" | "text" | "detailed";
11
+ /**
12
+ * Base props shared by all ErrorBoundary configurations.
13
+ */
14
+ type BaseErrorBoundaryProps = {
15
+ /** Content to wrap with error boundary protection */
16
+ children: ReactNode;
17
+ /** Optional callback invoked when an error is caught (in addition to logging) */
18
+ onError?: (error: Error, info: React.ErrorInfo) => void;
19
+ /** When any value in this array changes, the error boundary resets */
20
+ resetKeys?: unknown[];
21
+ /** Logger context path for error logging (e.g., ["Connect", "Editor"]) */
22
+ loggerContext?: string[];
23
+ };
24
+ /**
25
+ * Props for using a predefined fallback variant.
26
+ */
27
+ type VariantErrorBoundaryProps = BaseErrorBoundaryProps & {
28
+ /** The fallback UI variant to display on error */
29
+ variant: ErrorFallbackVariant;
30
+ /** Custom message for the "text" variant (default: "Something went wrong") */
31
+ fallbackMessage?: string;
32
+ };
33
+ /**
34
+ * Props for using a custom fallback render function.
35
+ */
36
+ type CustomFallbackErrorBoundaryProps = BaseErrorBoundaryProps & {
37
+ /** Custom render function for the fallback UI */
38
+ fallbackRender: (props: FallbackProps) => ReactNode;
39
+ };
40
+ /**
41
+ * Union type for all ErrorBoundary prop configurations.
42
+ * Use either a variant or a custom fallbackRender, but not both.
43
+ */
44
+ type ErrorBoundaryProps = VariantErrorBoundaryProps | CustomFallbackErrorBoundaryProps;
45
+ /**
46
+ * Simple text-based fallback component.
47
+ * Displays a centered message when an error occurs.
48
+ */
49
+ declare function TextFallback({ message, }: {
50
+ message?: string;
51
+ }): import("react/jsx-runtime").JSX.Element;
52
+ /**
53
+ * Detailed fallback component showing full error information.
54
+ * Displays error message and JSON representation of the error object.
55
+ * Useful for development and debugging purposes.
56
+ */
57
+ declare function DetailedFallback({ error }: FallbackProps): import("react/jsx-runtime").JSX.Element;
58
+ /**
59
+ * Centered error message fallback component.
60
+ * Displays the error message in a centered, full-size container.
61
+ * Suitable for use as a custom fallbackRender when you need simple error display.
62
+ */
63
+ declare function CenteredErrorMessage({ error }: FallbackProps): import("react/jsx-runtime").JSX.Element;
64
+ /**
65
+ * Unified error boundary component for catching and handling React errors.
66
+ *
67
+ * Built on top of `react-error-boundary`, this component provides:
68
+ * - Automatic error logging with configurable context
69
+ * - Multiple fallback UI variants (silent, text, detailed)
70
+ * - Support for custom fallback render functions
71
+ * - Reset capability via `resetKeys`
72
+ *
73
+ * @example
74
+ * // Using a predefined variant
75
+ * <ErrorBoundary variant="detailed" loggerContext={["Connect", "Editor"]}>
76
+ * <EditorComponent />
77
+ * </ErrorBoundary>
78
+ *
79
+ * @example
80
+ * // Using a custom message with the text variant
81
+ * <ErrorBoundary variant="text" fallbackMessage="Failed to load drives">
82
+ * <DrivesList />
83
+ * </ErrorBoundary>
84
+ *
85
+ * @example
86
+ * // Using a custom fallback render
87
+ * <ErrorBoundary
88
+ * fallbackRender={CenteredErrorMessage}
89
+ * onError={(error) => trackError(error)}
90
+ * >
91
+ * <MyComponent />
92
+ * </ErrorBoundary>
93
+ *
94
+ * @example
95
+ * // Silent mode for modals (renders null on error)
96
+ * <ErrorBoundary variant="silent" loggerContext={["Connect", "Modals"]}>
97
+ * <ModalContent />
98
+ * </ErrorBoundary>
99
+ */
100
+ export declare function ErrorBoundary(props: ErrorBoundaryProps): import("react/jsx-runtime").JSX.Element;
101
+ export { CenteredErrorMessage, DetailedFallback, TextFallback };
102
+ export type { FallbackProps };
103
+ //# sourceMappingURL=error-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../../src/components/error-boundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAI9B;;;;;;GAMG;AACH,KAAK,oBAAoB,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAE3D;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B,qDAAqD;IACrD,QAAQ,EAAE,SAAS,CAAC;IACpB,iFAAiF;IACjF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACxD,sEAAsE;IACtE,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,KAAK,yBAAyB,GAAG,sBAAsB,GAAG;IACxD,kDAAkD;IAClD,OAAO,EAAE,oBAAoB,CAAC;IAC9B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,KAAK,gCAAgC,GAAG,sBAAsB,GAAG;IAC/D,iDAAiD;IACjD,cAAc,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,CAAC;CACrD,CAAC;AAEF;;;GAGG;AACH,KAAK,kBAAkB,GACnB,yBAAyB,GACzB,gCAAgC,CAAC;AAYrC;;;GAGG;AACH,iBAAS,YAAY,CAAC,EACpB,OAAgC,GACjC,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,2CAEA;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,aAAa,2CASjD;AAED;;;;GAIG;AACH,iBAAS,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,aAAa,2CAOrD;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAgCtD;AAED,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { childLogger } from "document-drive";
3
+ import { ErrorBoundary as ReactErrorBoundary, } from "react-error-boundary";
4
+ const logger = childLogger(["Connect"]);
5
+ function hasCustomFallback(props) {
6
+ return "fallbackRender" in props;
7
+ }
8
+ function SilentFallback() {
9
+ return null;
10
+ }
11
+ /**
12
+ * Simple text-based fallback component.
13
+ * Displays a centered message when an error occurs.
14
+ */
15
+ function TextFallback({ message = "Something went wrong", }) {
16
+ return _jsx("div", { className: "text-center", children: message });
17
+ }
18
+ /**
19
+ * Detailed fallback component showing full error information.
20
+ * Displays error message and JSON representation of the error object.
21
+ * Useful for development and debugging purposes.
22
+ */
23
+ function DetailedFallback({ error }) {
24
+ const errorMessage = error instanceof Error ? error.message : String(error);
25
+ return (_jsxs("div", { className: "mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center", children: [_jsx("h1", { className: "mb-2 text-xl font-semibold", children: "Error" }), _jsx("i", { children: errorMessage }), _jsx("pre", { children: JSON.stringify(error, null, 2) })] }));
26
+ }
27
+ /**
28
+ * Centered error message fallback component.
29
+ * Displays the error message in a centered, full-size container.
30
+ * Suitable for use as a custom fallbackRender when you need simple error display.
31
+ */
32
+ function CenteredErrorMessage({ error }) {
33
+ const errorMessage = error instanceof Error ? error.message : String(error);
34
+ return (_jsx("div", { className: "flex size-full items-center justify-center", children: _jsx("h3", { className: "text-lg font-semibold", children: errorMessage }) }));
35
+ }
36
+ function getFallbackComponent(variant, fallbackMessage) {
37
+ switch (variant) {
38
+ case "silent":
39
+ return SilentFallback;
40
+ case "text":
41
+ return () => _jsx(TextFallback, { message: fallbackMessage });
42
+ case "detailed":
43
+ return DetailedFallback;
44
+ default:
45
+ return CenteredErrorMessage;
46
+ }
47
+ }
48
+ /**
49
+ * Unified error boundary component for catching and handling React errors.
50
+ *
51
+ * Built on top of `react-error-boundary`, this component provides:
52
+ * - Automatic error logging with configurable context
53
+ * - Multiple fallback UI variants (silent, text, detailed)
54
+ * - Support for custom fallback render functions
55
+ * - Reset capability via `resetKeys`
56
+ *
57
+ * @example
58
+ * // Using a predefined variant
59
+ * <ErrorBoundary variant="detailed" loggerContext={["Connect", "Editor"]}>
60
+ * <EditorComponent />
61
+ * </ErrorBoundary>
62
+ *
63
+ * @example
64
+ * // Using a custom message with the text variant
65
+ * <ErrorBoundary variant="text" fallbackMessage="Failed to load drives">
66
+ * <DrivesList />
67
+ * </ErrorBoundary>
68
+ *
69
+ * @example
70
+ * // Using a custom fallback render
71
+ * <ErrorBoundary
72
+ * fallbackRender={CenteredErrorMessage}
73
+ * onError={(error) => trackError(error)}
74
+ * >
75
+ * <MyComponent />
76
+ * </ErrorBoundary>
77
+ *
78
+ * @example
79
+ * // Silent mode for modals (renders null on error)
80
+ * <ErrorBoundary variant="silent" loggerContext={["Connect", "Modals"]}>
81
+ * <ModalContent />
82
+ * </ErrorBoundary>
83
+ */
84
+ export function ErrorBoundary(props) {
85
+ const { children, onError, resetKeys, loggerContext } = props;
86
+ const handleError = (error, info) => {
87
+ if (error.message.includes("Failed to fetch dynamically imported module") &&
88
+ error.message.includes("node_modules/.vite")) {
89
+ console.error(error);
90
+ console.log("Outdated chunk detected, reloading page...");
91
+ window.location.reload();
92
+ return;
93
+ }
94
+ const contextLogger = loggerContext ? childLogger(loggerContext) : logger;
95
+ contextLogger.error(error, info);
96
+ onError?.(error, info);
97
+ };
98
+ const fallbackRender = hasCustomFallback(props)
99
+ ? props.fallbackRender
100
+ : getFallbackComponent(props.variant, props.fallbackMessage);
101
+ return (_jsx(ReactErrorBoundary, { fallbackRender: fallbackRender, onError: handleError, resetKeys: resetKeys, children: children }));
102
+ }
103
+ export { CenteredErrorMessage, DetailedFallback, TextFallback };
104
+ //# sourceMappingURL=error-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../../../src/components/error-boundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACL,aAAa,IAAI,kBAAkB,GAEpC,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAmDxC,SAAS,iBAAiB,CACxB,KAAyB;IAEzB,OAAO,gBAAgB,IAAI,KAAK,CAAC;AACnC,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,EACpB,OAAO,GAAG,sBAAsB,GAGjC;IACC,OAAO,cAAK,SAAS,EAAC,aAAa,YAAE,OAAO,GAAO,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,EAAE,KAAK,EAAiB;IAChD,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5E,OAAO,CACL,eAAK,SAAS,EAAC,sEAAsE,aACnF,aAAI,SAAS,EAAC,4BAA4B,sBAAW,EACrD,sBAAI,YAAY,GAAK,EACrB,wBAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,IACvC,CACP,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB,C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C;QAC1E,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACjC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAC7C,CAAC,CAAC,KAAK,CAAC,cAAc;QACtB,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAE/D,OAAO,CACL,KAAC,kBAAkB,IACjB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,SAAS,YAEnB,QAAQ,GACU,CACtB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export * from "./modals-container.js";
2
- export * from "./modals-error-boundary.js";
3
2
  export * from "./modals/AddDriveModal.js";
4
3
  export * from "./modals/ClearStorageModal.js";
5
4
  export * from "./modals/CookiesPolicyModal.js";