@powerhousedao/connect 1.0.0-dev.229 → 1.0.0-dev.231

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 (32) hide show
  1. package/dist/assets/{app-ZQW92t6O.js → app-DrLeYlAb.js} +5018 -2509
  2. package/dist/assets/{app-loader-4lDPeVBu.js → app-loader-C4p-IWfP.js} +20 -23
  3. package/dist/assets/{ccip-BrCn_W71.js → ccip-BEtUPxLs.js} +4 -4
  4. package/dist/assets/{content-FQ01fqZV.js → content-AMlCFe4r.js} +96 -66
  5. package/dist/assets/{index-CRaABQnH.js → index-CpnYUECS.js} +4 -4
  6. package/dist/assets/{index-DI33bCpS.js → index-DBr1VmSJ.js} +80 -34
  7. package/dist/assets/{index-DqtLcprb.js → index-DtSGN5KF.js} +3 -3
  8. package/dist/assets/{main.DT1Mf4Jj.js → main.D0ReSJ3B.js} +1 -1
  9. package/dist/index.html +1 -1
  10. package/dist/modules/@powerhousedao/reactor-browser/{chunk-4FLW226S.js → chunk-2E6C3NB7.js} +4 -4
  11. package/dist/modules/@powerhousedao/reactor-browser/{chunk-YIBO3HUQ.js → chunk-45DCPCA7.js} +1 -1
  12. package/dist/modules/@powerhousedao/reactor-browser/{chunk-NNVEKADD.js → chunk-F3RCGUF6.js} +2 -2
  13. package/dist/modules/@powerhousedao/reactor-browser/{chunk-EWVIHKMF.js → chunk-F4K6ICY4.js} +1 -1
  14. package/dist/modules/@powerhousedao/reactor-browser/{chunk-D2ZLIUVV.js → chunk-FW7N6EJH.js} +378 -337
  15. package/dist/modules/@powerhousedao/reactor-browser/{chunk-AVKPBC5Q.js → chunk-G6LMXRY5.js} +1 -1
  16. package/dist/modules/@powerhousedao/reactor-browser/{chunk-PLA5FQXD.js → chunk-JWR2PSS2.js} +1 -1
  17. package/dist/modules/@powerhousedao/reactor-browser/{chunk-56M56AY3.js → chunk-M2UUQ5LH.js} +4 -4
  18. package/dist/modules/@powerhousedao/reactor-browser/{chunk-VOHVPRMH.js → chunk-NUW2A4R5.js} +1 -1
  19. package/dist/modules/@powerhousedao/reactor-browser/{chunk-M2DMGCWB.js → chunk-RSZCDZGH.js} +1 -1
  20. package/dist/modules/@powerhousedao/reactor-browser/context/index.js +2 -2
  21. package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +2 -2
  22. package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +8 -8
  23. package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +3 -3
  24. package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +2 -2
  25. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +2 -2
  26. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +5 -5
  27. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +2 -2
  28. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +3 -3
  29. package/dist/modules/@powerhousedao/reactor-browser/index.js +10 -10
  30. package/dist/modules/@powerhousedao/reactor-browser/reactor.js +2 -2
  31. package/dist/vite-envs.sh +1 -1
  32. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-ZQW92t6O.js","assets/main.DT1Mf4Jj.js","assets/app-CSi6MS9b.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-DrLeYlAb.js","assets/main.D0ReSJ3B.js","assets/app-CSi6MS9b.css"])))=>i.map(i=>d[i]);
2
2
  var __defProp = Object.defineProperty;
3
3
  var __typeError = (msg) => {
4
4
  throw TypeError(msg);
@@ -11,7 +11,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
11
11
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
12
12
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
13
13
  var _tags, _levelString, _errorHandler, _ConsoleLogger_instances, levelValue_get, _getDocumentModelModule, _drives, _ReadModeService_instances, parseGraphQLErrors_fn, fetchDrive_fn, _a, _ServiceWorkerManager_instances, handleServiceWorkerMessage_fn, handleServiceWorker_fn;
14
- import { _ as __vitePreload } from "./main.DT1Mf4Jj.js";
14
+ import { _ as __vitePreload } from "./main.D0ReSJ3B.js";
15
15
  import { jsx, jsxs } from "react/jsx-runtime";
16
16
  import { useState, useEffect, Suspense, lazy } from "react";
17
17
  function _mergeNamespaces(n, m) {
@@ -6896,7 +6896,6 @@ function processSkipOperation(document, action, customReducer, skipValue, reuseO
6896
6896
  scopeState = resultingStateParser(lastRemainingOperation.resultingState);
6897
6897
  } else {
6898
6898
  const { state } = replayOperations(document.initialState, documentOperations, customReducer, void 0, void 0, void 0, void 0, {
6899
- reuseHash: true,
6900
6899
  reuseOperationResultingState,
6901
6900
  operationResultingStateParser: resultingStateParser
6902
6901
  });
@@ -6923,7 +6922,6 @@ function processUndoOperation(document, scope, customReducer, reuseOperationResu
6923
6922
  const clearedOperations = [...documentOperations[scope]];
6924
6923
  const diff = diffOperations(garbageCollect(sortedOperations), clearedOperations);
6925
6924
  const doc = replayOperations(document.initialState, documentOperations, customReducer, void 0, void 0, void 0, void 0, {
6926
- reuseHash: true,
6927
6925
  reuseOperationResultingState,
6928
6926
  operationResultingStateParser: resultingStateParser
6929
6927
  });
@@ -25497,7 +25495,7 @@ const nodeOptionsMap = {
25497
25495
  };
25498
25496
  const name = "@powerhousedao/connect";
25499
25497
  const productName = "Powerhouse-Connect";
25500
- const version$1 = "1.0.0-dev.229";
25498
+ const version$1 = "1.0.0-dev.231";
25501
25499
  const description = "Powerhouse Connect";
25502
25500
  const main = "./dist/index.html";
25503
25501
  const type = "module";
@@ -25509,7 +25507,7 @@ const repository = { "type": "git", "url": "git+https://github.com/powerhouse-in
25509
25507
  const bugs = { "url": "https://github.com/powerhouse-inc/document-model-electron/issues" };
25510
25508
  const homepage = "https://github.com/powerhouse-inc/document-model-electron#readme";
25511
25509
  const scripts = { "build:tsc": "tsc --build", "start": "electron-forge start", "package": "electron-forge package", "make": "PH_CONNECT_BASE_HREF=./ electron-forge make", "make:mac": "PH_CONNECT_BASE_HREF=./ electron-forge make -p darwin", "make:linux": "PH_CONNECT_BASE_HREF=./ electron-forge make -p linux", "make:windows": "PH_CONNECT_BASE_HREF=./ electron-forge make -p win32", "publish:electron": "electron-forge publish", "prepublishOnly": "npm run build", "lint": "eslint .", "lint:fix": "eslint --fix .", "lint:nx": "eslint --quiet --fix .", "format": 'prettier --write "**/*.+(js|ts|jsx|tsx|json)"', "dev": "vite -c vite.renderer.config.mts", "dev:web": "vite -c vite.renderer.config.mts", "dev:nocache": "rm -rf node_modules/.vite && rm -rf node_modules/.cache && npm run dev:web", "prebuild": "tsc --build --noEmit", "build": "NODE_OPTIONS=--max-old-space-size=6144 vite build -c vite.renderer.config.mts", "preview:web": "vite preview -c vite.renderer.config.mts", "e2e": "playwright test", "cy:open": "cypress open", "build:service-worker": "tsc --build ./tsconfig.sw.json" };
25512
- const devDependencies = { "@electron-forge/cli": "^6.1.1", "@electron-forge/maker-deb": "^6.1.1", "@electron-forge/maker-rpm": "^6.1.1", "@electron-forge/maker-squirrel": "^6.1.1", "@electron-forge/maker-zip": "^6.1.1", "@electron-forge/plugin-vite": "^6.1.1", "@electron-forge/publisher-electron-release-server": "^6.2.1", "@electron-forge/publisher-github": "^7.2.0", "@electron-forge/shared-types": "^7.7.0", "@playwright/test": "^1.41.2", "@powerhousedao/builder-tools": "workspace:*", "@powerhousedao/common": "workspace:*", "@powerhousedao/config": "workspace:*", "@powerhousedao/design-system": "workspace:*", "@powerhousedao/reactor-browser": "workspace:*", "@powerhousedao/scalars": "workspace:*", "@rollup/plugin-node-resolve": "^15.2.3", "@sentry/browser": "^9.1.0", "@sentry/react": "^7.109.0", "@sentry/vite-plugin": "^2.22.2", "@tailwindcss/vite": "^4.0.9", "@tanstack/react-virtual": "^3.8.1", "@types/node": "^22.13.10", "@types/react": "^18.2.79", "@types/react-dom": "^18.2.18", "@types/uuid": "^9.0.7", "@types/wicg-file-system-access": "^2020.9.6", "@vitejs/plugin-basic-ssl": "^1.2.0", "@vitejs/plugin-react": "^4.2.1", "asar": "^3.2.0", "did-key-creator": "^1.2.0", "document-drive": "workspace:*", "document-model": "workspace:*", "electron": "30.0.0", "electron-is-dev": "^3.0.1", "electron-playwright-helpers": "^1.7.1", "electron-squirrel-startup": "^1.0.0", "electron-store": "^8.1.0", "esbuild": "^0.24.0", "graphql": "^16.8.1", "graphql-request": "^6.1.0", "i18next": "^23.7.6", "jotai": "^2.1.0", "jotai-effect": "^1.1.6", "localforage": "^1.10.0", "lz-string": "^1.5.0", "playwright": "^1.41.2", "playwright-core": "^1.41.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-error-boundary": "^4.0.11", "react-hotkeys-hook": "^4.5.0", "react-i18next": "^13.5.0", "react-router-dom": "^6.11.2", "tailwind-merge": "^3.0.2", "tailwindcss": "^4.0.9", "uuid": "^9.0.1", "viem": "^2.8.13", "vite": "^6.2.0", "vite-envs": "^4.4.11", "vite-plugin-html": "^3.2.2", "vite-plugin-node-polyfills": "^0.23.0", "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.3.2", "xvfb-maybe": "^0.2.1" };
25510
+ const devDependencies = { "@electron-forge/cli": "^6.1.1", "@electron-forge/maker-deb": "^6.1.1", "@electron-forge/maker-rpm": "^6.1.1", "@electron-forge/maker-squirrel": "^6.1.1", "@electron-forge/maker-zip": "^6.1.1", "@electron-forge/plugin-vite": "^6.1.1", "@electron-forge/publisher-electron-release-server": "^6.2.1", "@electron-forge/publisher-github": "^7.2.0", "@electron-forge/shared-types": "^7.7.0", "@playwright/test": "^1.41.2", "@powerhousedao/builder-tools": "workspace:*", "@powerhousedao/common": "workspace:*", "@powerhousedao/config": "workspace:*", "@powerhousedao/design-system": "workspace:*", "@powerhousedao/reactor-browser": "workspace:*", "@powerhousedao/scalars": "workspace:*", "@rollup/plugin-node-resolve": "^15.2.3", "@sentry/browser": "^9.1.0", "@sentry/react": "^7.109.0", "@sentry/vite-plugin": "^2.22.2", "@tailwindcss/vite": "^4.0.9", "@tanstack/react-virtual": "^3.8.1", "@types/node": "^22.13.10", "@types/react": "^18.2.79", "@types/react-dom": "^18.2.18", "@types/uuid": "^9.0.7", "@types/wicg-file-system-access": "^2020.9.6", "@vitejs/plugin-basic-ssl": "^1.2.0", "@vitejs/plugin-react": "^4.2.1", "asar": "^3.2.0", "did-key-creator": "^1.2.0", "document-drive": "workspace:*", "document-model": "workspace:*", "electron": "30.0.0", "electron-is-dev": "^3.0.1", "electron-playwright-helpers": "^1.7.1", "electron-squirrel-startup": "^1.0.0", "electron-store": "^8.1.0", "esbuild": "^0.24.0", "graphql": "^16.8.1", "graphql-request": "^6.1.0", "i18next": "^23.7.6", "jotai": "^2.1.0", "jotai-effect": "^1.1.6", "localforage": "^1.10.0", "lz-string": "^1.5.0", "playwright": "^1.41.2", "playwright-core": "^1.41.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-error-boundary": "^4.0.11", "react-hotkeys-hook": "^4.5.0", "react-i18next": "^13.5.0", "react-router-dom": "^6.11.2", "tailwind-merge": "^3.0.2", "tailwindcss": "^4.0.9", "uuid": "^9.0.1", "viem": "^2.8.13", "vite": "^6.2.2", "vite-envs": "^4.4.11", "vite-plugin-html": "^3.2.2", "vite-plugin-node-polyfills": "^0.23.0", "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.3.2", "xvfb-maybe": "^0.2.1" };
25513
25511
  const optionalDependencies = { "@esbuild/linux-x64": "^0.21.4", "@rollup/rollup-linux-x64-musl": "4.14.3" };
25514
25512
  const packageJson = {
25515
25513
  name,
@@ -25650,7 +25648,6 @@ DriveSections.filter(
25650
25648
  };
25651
25649
  });
25652
25650
  var lzString = { exports: {} };
25653
- lzString.exports;
25654
25651
  var hasRequiredLzString;
25655
25652
  function requireLzString() {
25656
25653
  if (hasRequiredLzString) return lzString.exports;
@@ -31068,7 +31065,7 @@ if (window.__VITE_ENVS.MODE === "development") {
31068
31065
  } else {
31069
31066
  serviceWorkerManager.registerServiceWorker(false);
31070
31067
  }
31071
- const App = lazy(() => __vitePreload(() => import("./app-ZQW92t6O.js").then((n) => n.aN), true ? __vite__mapDeps([0,1,2]) : void 0));
31068
+ const App = lazy(() => __vitePreload(() => import("./app-DrLeYlAb.js").then((n) => n.aN), true ? __vite__mapDeps([0,1,2]) : void 0));
31072
31069
  const AppLoader = /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(App, {}) });
31073
31070
  const appLoader = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31074
31071
  __proto__: null,
@@ -31104,16 +31101,16 @@ export {
31104
31101
  pascalCase as Z,
31105
31102
  Icon as _,
31106
31103
  createReducer as a,
31107
- DUPLICATE as a$,
31104
+ DELETE as a$,
31108
31105
  LOCAL as a0,
31109
31106
  commonjsGlobal as a1,
31110
- SWITCHBOARD as a2,
31111
- PUBLIC as a3,
31107
+ PUBLIC as a2,
31108
+ SWITCHBOARD as a3,
31112
31109
  locationInfoByLocation as a4,
31113
31110
  sharingTypeOptions as a5,
31114
31111
  objectType as a6,
31115
- stringType as a7,
31116
- recordType as a8,
31112
+ recordType as a7,
31113
+ stringType as a8,
31117
31114
  capitalCase as a9,
31118
31115
  generateNodesCopy as aA,
31119
31116
  copyNode as aB,
@@ -31147,8 +31144,8 @@ export {
31147
31144
  logger$1 as ac,
31148
31145
  LZString as ad,
31149
31146
  buildSignedOperation as ae,
31150
- getDefaults as af,
31151
- getI18n as ag,
31147
+ getI18n as af,
31148
+ getDefaults as ag,
31152
31149
  connectConfig as ah,
31153
31150
  hashDocumentStateForScope as ai,
31154
31151
  setErrorHandler as aj,
@@ -31172,7 +31169,7 @@ export {
31172
31169
  GraphQLInt as b$,
31173
31170
  RENAME as b0,
31174
31171
  WRITE as b1,
31175
- DELETE as b2,
31172
+ DUPLICATE as b2,
31176
31173
  defaultFolderOptions as b3,
31177
31174
  garbageCollect as b4,
31178
31175
  sortOperations as b5,
@@ -31209,19 +31206,19 @@ export {
31209
31206
  GraphQLFloat as b_,
31210
31207
  inspect as ba,
31211
31208
  GraphQLError as bb,
31212
- invariant as bc,
31213
- getNamedType as bd,
31209
+ getNamedType as bc,
31210
+ invariant as bd,
31214
31211
  isInputObjectType as be,
31215
31212
  isScalarType as bf,
31216
31213
  isObjectType as bg,
31217
31214
  isInterfaceType as bh,
31218
31215
  isUnionType as bi,
31219
31216
  isEnumType as bj,
31220
- astFromValue as bk,
31221
- print as bl,
31222
- DEFAULT_DEPRECATION_REASON as bm,
31223
- Kind as bn,
31224
- isPrintableAsBlockString as bo,
31217
+ print as bk,
31218
+ isPrintableAsBlockString as bl,
31219
+ Kind as bm,
31220
+ astFromValue as bn,
31221
+ DEFAULT_DEPRECATION_REASON as bo,
31225
31222
  isSpecifiedDirective as bp,
31226
31223
  isSpecifiedScalarType as bq,
31227
31224
  isIntrospectionType as br,
@@ -1,7 +1,7 @@
1
- import { aD as BaseError, aE as getUrl, aF as stringify, aG as decodeErrorResult, aH as isAddressEqual, aI as call, aJ as concat, aK as encodeAbiParameters, aL as HttpRequestError, aM as isHex } from "./app-ZQW92t6O.js";
2
- import "./main.DT1Mf4Jj.js";
1
+ import { aD as BaseError, aE as getUrl, aF as stringify, aG as decodeErrorResult, aH as isAddressEqual, aI as call, aJ as concat, aK as encodeAbiParameters, aL as HttpRequestError, aM as isHex } from "./app-DrLeYlAb.js";
2
+ import "./main.D0ReSJ3B.js";
3
3
  import "react/jsx-runtime";
4
- import "./app-loader-4lDPeVBu.js";
4
+ import "./app-loader-C4p-IWfP.js";
5
5
  import "react";
6
6
  import "@powerhousedao/reactor-browser";
7
7
  import "react-dom";
@@ -123,7 +123,7 @@ async function ccipRequest({ data, sender, urls }) {
123
123
  const body = method === "POST" ? { data, sender } : void 0;
124
124
  const headers = method === "POST" ? { "Content-Type": "application/json" } : {};
125
125
  try {
126
- const response = await fetch(url.replace("{sender}", sender).replace("{data}", data), {
126
+ const response = await fetch(url.replace("{sender}", sender.toLowerCase()).replace("{data}", data), {
127
127
  body: JSON.stringify(body),
128
128
  headers,
129
129
  method
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
- import { t as twMerge, B as Button, m as mergeClassNameProps, I as INITIAL_SYNC, S as SYNCING, h as SUCCESS, C as CONFLICT, M as MISSING, E as ERROR, i as ConnectDropdownMenu, u as useOnClickOutside, j as useEventListener, k as useCopyToClipboard, l as Select, n as ENSAvatar, P as Provider, o as Root3, T as Trigger, p as Portal, q as Content2, v as validateInitialState, w as validateStateSchemaName, x as validateModules, y as useUnwrappedReactor, z as useConnectDid, A as useConnectCrypto, D as useTranslation, F as useModal, G as useAtomValue, H as themeAtom, J as useUser, K as useUserPermissions, L as useUiNodes, N as exportFile, O as useGetDocumentModelModule, Q as addActionContext, U as signOperation, V as useDocumentDriveServer, W as useHotkeys, X as useGetEditor, Y as isSameDocument, Z as useNavigate, _ as ErrorBoundary, $ as DriveLayout, a0 as SearchBar, a1 as useAsyncReactor, a2 as useFilteredDocumentModels, a3 as useDriveEditor, a4 as useDocumentDriveById } from "./app-ZQW92t6O.js";
2
+ import { t as twMerge, B as Button, m as mergeClassNameProps, E as ERROR, M as MISSING, C as CONFLICT, S as SUCCESS, h as SYNCING, I as INITIAL_SYNC, i as ConnectDropdownMenu, u as useOnClickOutside, j as useEventListener, k as useCopyToClipboard, l as Select, n as ENSAvatar, P as Provider, o as Root3, T as Trigger, p as Portal, q as Content2, v as validateInitialState, w as validateStateSchemaName, x as validateModules, y as useUnwrappedReactor, z as useConnectDid, A as useConnectCrypto, D as useTranslation, F as useModal, G as useAtomValue, H as themeAtom, J as useUser, K as useUserPermissions, L as useUiNodes, N as exportFile, O as useGetDocumentModelModule, Q as addActionContext, U as signOperation, V as useDocumentDriveServer, W as useHotkeys, X as useGetEditor, Y as isSameDocument, Z as useNavigate, _ as ErrorBoundary, $ as DriveLayout, a0 as SearchBar, a1 as useAsyncReactor, a2 as useFilteredDocumentModels, a3 as useDriveEditor, a4 as useDocumentDriveById } from "./app-DrLeYlAb.js";
3
3
  import * as React from "react";
4
4
  import React__default, { useState, useCallback, useMemo, useEffect, Fragment, useRef, useLayoutEffect, memo as memo$1, createElement, useSyncExternalStore, Suspense } from "react";
5
- import { _ as Icon, aX as getDimensions, aY as READ, aZ as nodeOptionsMap, a_ as defaultFileOptions, a$ as DUPLICATE, b0 as RENAME, b1 as WRITE, b2 as DELETE, b3 as defaultFolderOptions, b4 as garbageCollect, b5 as sortOperations, b6 as UI_NODE, aO as DRIVE, ay as FILE, b7 as undo, b8 as redo, ac as logger, b9 as useDocumentDispatch, aP as FOLDER, ak as driveDocumentModelModule } from "./app-loader-4lDPeVBu.js";
5
+ import { _ as Icon, aX as getDimensions, aY as READ, aZ as nodeOptionsMap, a_ as defaultFileOptions, a$ as DELETE, b0 as RENAME, b1 as WRITE, b2 as DUPLICATE, b3 as defaultFolderOptions, b4 as garbageCollect, b5 as sortOperations, b6 as UI_NODE, aO as DRIVE, ay as FILE, b7 as undo, b8 as redo, ac as logger, b9 as useDocumentDispatch, aP as FOLDER, ak as driveDocumentModelModule } from "./app-loader-C4p-IWfP.js";
6
6
  import { useDocument, useDocumentEditorProps } from "@powerhousedao/reactor-browser";
7
7
  import { useUiNodesContext, FILE as FILE$1 } from "@powerhousedao/reactor-browser/hooks/useUiNodesContext";
8
8
  import { useDriveActionsWithUiNodes } from "@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes";
@@ -10,7 +10,7 @@ import { useDriveContext, DriveContextProvider } from "@powerhousedao/reactor-br
10
10
  import "@powerhousedao/reactor-browser/uiNodes/constants";
11
11
  import { makeDriveDocumentStateHook } from "@powerhousedao/reactor-browser/hooks/document-state";
12
12
  import { flushSync } from "react-dom";
13
- import "./main.DT1Mf4Jj.js";
13
+ import "./main.D0ReSJ3B.js";
14
14
  const ConnectLoaderVideo = "/assets/connect-loader-CvOC68Ih.mp4";
15
15
  const PaginationButton = ({ active = false, ...props }) => {
16
16
  const className = twMerge("h-8 min-w-8 border border-solid border-gray-300 bg-white px-3 py-1 text-xs text-gray-900 hover:bg-gray-100", !active && "border-0");
@@ -21,7 +21,7 @@ const Pagination = (props) => {
21
21
  return jsxs("div", { className: "flex gap-x-1", children: [firstPageLabel ? jsx(PaginationButton, { disabled: !isPreviousPageAvailable, onClick: () => goToFirstPage(), children: firstPageLabel }) : null, previousPageLabel ? jsxs(PaginationButton, { disabled: !isPreviousPageAvailable, onClick: () => goToPreviousPage(), children: [jsx(Icon, { className: "rotate-90", name: "ChevronDown", size: 16 }), previousPageLabel] }) : null, pages.map((page) => jsx(PaginationButton, { active: page.active, onClick: () => goToPage(page.index), children: page.number }, page.index)), hiddenNextPages ? jsx("span", { className: "flex items-center justify-center px-2", children: "..." }) : null, nextPageLabel ? jsxs(PaginationButton, { disabled: !isNextPageAvailable, onClick: () => goToNextPage(), children: [nextPageLabel, jsx(Icon, { className: "-rotate-90", name: "ChevronDown", size: 16 })] }) : null, lastPageLabel ? jsx(PaginationButton, { disabled: !isNextPageAvailable, onClick: () => goToLastPage(), children: lastPageLabel }) : null] });
22
22
  };
23
23
  function usePagination(items, options) {
24
- const { itemsPerPage = 20, initialPage = 0, pageRange = 3 } = options;
24
+ const { itemsPerPage = 20, initialPage = 0, pageRange = 3 } = options || {};
25
25
  const [currentPage, setCurrentPage] = useState(initialPage);
26
26
  const pageCount = Math.ceil(items.length / itemsPerPage);
27
27
  const isNextPageAvailable = currentPage < pageCount - 1;
@@ -993,8 +993,6 @@ const lightFormatters = {
993
993
  }
994
994
  };
995
995
  const dayPeriodEnum = {
996
- am: "am",
997
- pm: "pm",
998
996
  midnight: "midnight",
999
997
  noon: "noon",
1000
998
  morning: "morning",
@@ -1833,7 +1831,7 @@ function Header(props) {
1833
1831
  function memo(getDeps, fn, opts) {
1834
1832
  let deps = opts.initialDeps ?? [];
1835
1833
  let result;
1836
- return () => {
1834
+ function memoizedFunction() {
1837
1835
  var _a, _b, _c, _d;
1838
1836
  let depTime;
1839
1837
  if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
@@ -1871,7 +1869,11 @@ function memo(getDeps, fn, opts) {
1871
1869
  }
1872
1870
  (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
1873
1871
  return result;
1872
+ }
1873
+ memoizedFunction.updateDeps = (newDeps) => {
1874
+ deps = newDeps;
1874
1875
  };
1876
+ return memoizedFunction;
1875
1877
  }
1876
1878
  function notUndefined(value, msg) {
1877
1879
  if (value === void 0) {
@@ -1917,15 +1919,18 @@ const observeElementRect = (instance, cb) => {
1917
1919
  };
1918
1920
  }
1919
1921
  const observer = new targetWindow.ResizeObserver((entries) => {
1920
- const entry = entries[0];
1921
- if (entry == null ? void 0 : entry.borderBoxSize) {
1922
- const box = entry.borderBoxSize[0];
1923
- if (box) {
1924
- handler({ width: box.inlineSize, height: box.blockSize });
1925
- return;
1922
+ const run = () => {
1923
+ const entry = entries[0];
1924
+ if (entry == null ? void 0 : entry.borderBoxSize) {
1925
+ const box = entry.borderBoxSize[0];
1926
+ if (box) {
1927
+ handler({ width: box.inlineSize, height: box.blockSize });
1928
+ return;
1929
+ }
1926
1930
  }
1927
- }
1928
- handler(element.getBoundingClientRect());
1931
+ handler(element.getBoundingClientRect());
1932
+ };
1933
+ instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
1929
1934
  });
1930
1935
  observer.observe(element, { box: "border-box" });
1931
1936
  return () => {
@@ -1963,10 +1968,15 @@ const observeElementOffset = (instance, cb) => {
1963
1968
  const endHandler = createHandler(false);
1964
1969
  endHandler();
1965
1970
  element.addEventListener("scroll", handler, addEventListenerOptions);
1966
- element.addEventListener("scrollend", endHandler, addEventListenerOptions);
1971
+ const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
1972
+ if (registerScrollendEvent) {
1973
+ element.addEventListener("scrollend", endHandler, addEventListenerOptions);
1974
+ }
1967
1975
  return () => {
1968
1976
  element.removeEventListener("scroll", handler);
1969
- element.removeEventListener("scrollend", endHandler);
1977
+ if (registerScrollendEvent) {
1978
+ element.removeEventListener("scrollend", endHandler);
1979
+ }
1970
1980
  };
1971
1981
  };
1972
1982
  const measureElement = (element, entry, instance) => {
@@ -2020,7 +2030,10 @@ class Virtualizer {
2020
2030
  }
2021
2031
  return _ro = new this.targetWindow.ResizeObserver((entries) => {
2022
2032
  entries.forEach((entry) => {
2023
- this._measureElement(entry.target, entry);
2033
+ const run = () => {
2034
+ this._measureElement(entry.target, entry);
2035
+ };
2036
+ this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
2024
2037
  });
2025
2038
  });
2026
2039
  };
@@ -2068,7 +2081,8 @@ class Virtualizer {
2068
2081
  isScrollingResetDelay: 150,
2069
2082
  enabled: true,
2070
2083
  isRtl: false,
2071
- useScrollendEvent: true,
2084
+ useScrollendEvent: false,
2085
+ useAnimationFrameWithResizeObserver: false,
2072
2086
  ...opts2
2073
2087
  };
2074
2088
  };
@@ -2257,12 +2271,18 @@ class Virtualizer {
2257
2271
  }
2258
2272
  );
2259
2273
  this.calculateRange = memo(
2260
- () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
2261
- (measurements, outerSize, scrollOffset) => {
2274
+ () => [
2275
+ this.getMeasurements(),
2276
+ this.getSize(),
2277
+ this.getScrollOffset(),
2278
+ this.options.lanes
2279
+ ],
2280
+ (measurements, outerSize, scrollOffset, lanes) => {
2262
2281
  return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
2263
2282
  measurements,
2264
2283
  outerSize,
2265
- scrollOffset
2284
+ scrollOffset,
2285
+ lanes
2266
2286
  }) : null;
2267
2287
  },
2268
2288
  {
@@ -2270,7 +2290,7 @@ class Virtualizer {
2270
2290
  debug: () => this.options.debug
2271
2291
  }
2272
2292
  );
2273
- this.getIndexes = memo(
2293
+ this.getVirtualIndexes = memo(
2274
2294
  () => {
2275
2295
  let startIndex = null;
2276
2296
  let endIndex = null;
@@ -2279,6 +2299,7 @@ class Virtualizer {
2279
2299
  startIndex = range.startIndex;
2280
2300
  endIndex = range.endIndex;
2281
2301
  }
2302
+ this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
2282
2303
  return [
2283
2304
  this.options.rangeExtractor,
2284
2305
  this.options.overscan,
@@ -2362,7 +2383,7 @@ class Virtualizer {
2362
2383
  this._measureElement(node, void 0);
2363
2384
  };
2364
2385
  this.getVirtualItems = memo(
2365
- () => [this.getIndexes(), this.getMeasurements()],
2386
+ () => [this.getVirtualIndexes(), this.getMeasurements()],
2366
2387
  (indexes, measurements) => {
2367
2388
  const virtualItems = [];
2368
2389
  for (let k = 0, len = indexes.length; k < len; k++) {
@@ -2391,15 +2412,15 @@ class Virtualizer {
2391
2412
  )]
2392
2413
  );
2393
2414
  };
2394
- this.getOffsetForAlignment = (toOffset, align) => {
2415
+ this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
2395
2416
  const size = this.getSize();
2396
2417
  const scrollOffset = this.getScrollOffset();
2397
2418
  if (align === "auto") {
2398
- if (toOffset >= scrollOffset + size) {
2399
- align = "end";
2400
- }
2419
+ align = toOffset >= scrollOffset + size ? "end" : "start";
2401
2420
  }
2402
- if (align === "end") {
2421
+ if (align === "center") {
2422
+ toOffset += (itemSize - size) / 2;
2423
+ } else if (align === "end") {
2403
2424
  toOffset -= size;
2404
2425
  }
2405
2426
  const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
@@ -2424,27 +2445,11 @@ class Virtualizer {
2424
2445
  return [scrollOffset, align];
2425
2446
  }
2426
2447
  }
2427
- const centerOffset = item.start - this.options.scrollPaddingStart + (item.size - size) / 2;
2428
- switch (align) {
2429
- case "center":
2430
- return [this.getOffsetForAlignment(centerOffset, align), align];
2431
- case "end":
2432
- return [
2433
- this.getOffsetForAlignment(
2434
- item.end + this.options.scrollPaddingEnd,
2435
- align
2436
- ),
2437
- align
2438
- ];
2439
- default:
2440
- return [
2441
- this.getOffsetForAlignment(
2442
- item.start - this.options.scrollPaddingStart,
2443
- align
2444
- ),
2445
- align
2446
- ];
2447
- }
2448
+ const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
2449
+ return [
2450
+ this.getOffsetForAlignment(toOffset, align, item.size),
2451
+ align
2452
+ ];
2448
2453
  };
2449
2454
  this.isDynamicMode = () => this.elementsCache.size > 0;
2450
2455
  this.cancelScrollToIndex = () => {
@@ -2514,10 +2519,19 @@ class Virtualizer {
2514
2519
  let end;
2515
2520
  if (measurements.length === 0) {
2516
2521
  end = this.options.paddingStart;
2522
+ } else if (this.options.lanes === 1) {
2523
+ end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0;
2517
2524
  } else {
2518
- end = this.options.lanes === 1 ? ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0 : Math.max(
2519
- ...measurements.slice(-this.options.lanes).map((m) => m.end)
2520
- );
2525
+ const endByLane = Array(this.options.lanes).fill(null);
2526
+ let endIndex = measurements.length - 1;
2527
+ while (endIndex > 0 && endByLane.some((val) => val === null)) {
2528
+ const item = measurements[endIndex];
2529
+ if (endByLane[item.lane] === null) {
2530
+ endByLane[item.lane] = item.end;
2531
+ }
2532
+ endIndex--;
2533
+ }
2534
+ end = Math.max(...endByLane.filter((val) => val !== null));
2521
2535
  }
2522
2536
  return Math.max(
2523
2537
  end - this.options.scrollMargin + this.options.paddingEnd,
@@ -2558,14 +2572,37 @@ const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
2558
2572
  function calculateRange({
2559
2573
  measurements,
2560
2574
  outerSize,
2561
- scrollOffset
2575
+ scrollOffset,
2576
+ lanes
2562
2577
  }) {
2563
- const count = measurements.length - 1;
2578
+ const lastIndex = measurements.length - 1;
2564
2579
  const getOffset = (index) => measurements[index].start;
2565
- const startIndex = findNearestBinarySearch(0, count, getOffset, scrollOffset);
2580
+ let startIndex = findNearestBinarySearch(
2581
+ 0,
2582
+ lastIndex,
2583
+ getOffset,
2584
+ scrollOffset
2585
+ );
2566
2586
  let endIndex = startIndex;
2567
- while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {
2568
- endIndex++;
2587
+ if (lanes === 1) {
2588
+ while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
2589
+ endIndex++;
2590
+ }
2591
+ } else if (lanes > 1) {
2592
+ const endPerLane = Array(lanes).fill(0);
2593
+ while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
2594
+ const item = measurements[endIndex];
2595
+ endPerLane[item.lane] = item.end;
2596
+ endIndex++;
2597
+ }
2598
+ const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
2599
+ while (startIndex > 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
2600
+ const item = measurements[startIndex];
2601
+ startPerLane[item.lane] = item.start;
2602
+ startIndex--;
2603
+ }
2604
+ startIndex = Math.max(0, startIndex - startIndex % lanes);
2605
+ endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
2569
2606
  }
2570
2607
  return { startIndex, endIndex };
2571
2608
  }
@@ -3712,14 +3749,7 @@ function Editor(props) {
3712
3749
  return jsxs(DriveLayout, { className, children: [children, jsxs(DriveLayout.Header, { children: [jsx(Breadcrumbs, { breadcrumbs, createEnabled: isAllowedToCreateDocuments, onCreate: addFolder, onBreadcrumbSelected }), showSearchBar && jsx(SearchBar, {})] }), jsx(DriveLayout.Content, { children: jsx(FolderView, { node: selectedNode || driveNode, onSelectNode: setSelectedNode, onRenameNode: renameNode, onDuplicateNode: duplicateNode, onDeleteNode: deleteNode, onAddFile: addFile, onCopyNode: copyNode, onMoveNode: moveNode, isDropTarget, isAllowedToCreateDocuments }) }), jsx(DriveLayout.Footer, { children: isAllowedToCreateDocuments && jsx(CreateDocument, { documentModels, createDocument: onCreateDocument }) })] });
3713
3750
  }
3714
3751
  const GenericDriveExplorer = {
3715
- Component: Editor,
3716
- documentTypes: ["powerhouse/document-drive"],
3717
- config: {
3718
- id: "GenericDriveExplorer",
3719
- disableExternalControls: true,
3720
- documentToolbarEnabled: true,
3721
- showSwitchboardLink: true
3722
- }
3752
+ Component: Editor
3723
3753
  };
3724
3754
  function useGetDriveDocuments(props) {
3725
3755
  const { driveId } = props;
@@ -10,10 +10,10 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
12
  var _DB_NAME, _STORE_NAME, _KEY, _db, _BrowserKeyStorage_instances, useStore_fn, _subtleCrypto, _keyPair, _keyPairStorage, _did, _ConnectCrypto_instances, initCrypto_fn, initialize_fn, parseDid_fn, generateECDSAKeyPair_fn, exportKeyPair_fn, importKeyPair_fn, _sign, _verify, _store, _namespace, _BaseStorage_instances, buildKey_fn, _baseUrl, _store2, _connectId, _eventEmitter, _Renown_instances, updateUser_fn, getCredential_fn;
13
- import { _ as __vitePreload } from "./main.DT1Mf4Jj.js";
14
- import { aW as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-4lDPeVBu.js";
15
- import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-ZQW92t6O.js";
16
- import { d, c, b, f, a, r, s } from "./app-ZQW92t6O.js";
13
+ import { _ as __vitePreload } from "./main.D0ReSJ3B.js";
14
+ import { aW as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-C4p-IWfP.js";
15
+ import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-DrLeYlAb.js";
16
+ import { d, c, b, f, a, r, s } from "./app-DrLeYlAb.js";
17
17
  import "react/jsx-runtime";
18
18
  import "react";
19
19
  import "@powerhousedao/reactor-browser";