@powerhousedao/connect 1.0.0-dev.223 → 1.0.0-dev.225

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 (38) hide show
  1. package/dist/assets/{app-Cln9uYMI.css → app-ClxoJuGw.css} +1 -1
  2. package/dist/assets/{app-CTigHfYe.js → app-DS1CKnZX.js} +312 -89
  3. package/dist/assets/{app-loader-BY0bGSIq.css → app-loader-C6FgR-r9.css} +4 -12
  4. package/dist/assets/{app-loader-DyNwL34W.js → app-loader-CQk_i65y.js} +10 -6
  5. package/dist/assets/{ccip-H9r68nMy.js → ccip-h0SFswcH.js} +3 -3
  6. package/dist/assets/{content-DKRyIOSC.js → content-dCYtAq_j.js} +36 -13
  7. package/dist/assets/{index-ClLjsnWF.js → index-BP3HovgJ.js} +3 -3
  8. package/dist/assets/{index-1eSbLJ8N.js → index-BaJByDnQ.js} +4 -4
  9. package/dist/assets/{index-U2JOCFbk.js → index-BgGO2KiQ.js} +3 -3
  10. package/dist/assets/{main.DW-SDHrh.js → main.BTNubzb3.js} +1 -1
  11. package/dist/assets/{style-CQ-MDl3w.css → style-DFCtruT_.css} +1 -1
  12. package/dist/index.html +3 -3
  13. package/dist/modules/@powerhousedao/reactor-browser/{chunk-DZDC5PJZ.js → chunk-45DCPCA7.js} +1 -1
  14. package/dist/modules/@powerhousedao/reactor-browser/{chunk-YBWJLG4N.js → chunk-4C7V2GAN.js} +1 -1
  15. package/dist/modules/@powerhousedao/reactor-browser/{chunk-KDBDV2ML.js → chunk-55TZMPQQ.js} +4 -0
  16. package/dist/modules/@powerhousedao/reactor-browser/{chunk-IFKFX4E7.js → chunk-726EFDQ6.js} +1 -1
  17. package/dist/modules/@powerhousedao/reactor-browser/{chunk-R3DNAUCO.js → chunk-F3RCGUF6.js} +2 -2
  18. package/dist/modules/@powerhousedao/reactor-browser/{chunk-2457SE2E.js → chunk-FW7N6EJH.js} +55 -65
  19. package/dist/modules/@powerhousedao/reactor-browser/{chunk-MHTRZST7.js → chunk-G6LMXRY5.js} +1 -1
  20. package/dist/modules/@powerhousedao/reactor-browser/{chunk-OS3WZ4EZ.js → chunk-GAG4Z4JD.js} +1 -1
  21. package/dist/modules/@powerhousedao/reactor-browser/{chunk-2ZNMEO7F.js → chunk-M2UUQ5LH.js} +4 -4
  22. package/dist/modules/@powerhousedao/reactor-browser/chunk-QXHTR6KF.js +0 -0
  23. package/dist/modules/@powerhousedao/reactor-browser/{chunk-AF3TNTAG.js → chunk-X3GCDCJN.js} +1 -1
  24. package/dist/modules/@powerhousedao/reactor-browser/context/index.js +2 -2
  25. package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +2 -2
  26. package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +10 -10
  27. package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +3 -3
  28. package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +2 -2
  29. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +2 -2
  30. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +7 -7
  31. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +2 -2
  32. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +3 -3
  33. package/dist/modules/@powerhousedao/reactor-browser/index.js +14 -13
  34. package/dist/modules/@powerhousedao/reactor-browser/reactor.js +2 -2
  35. package/dist/modules/@powerhousedao/reactor-browser/renown/types.js +1 -0
  36. package/dist/vite-envs.sh +1 -1
  37. package/package.json +10 -13
  38. /package/dist/modules/@powerhousedao/reactor-browser/{chunk-DI2LBUDE.js → chunk-LH2T6NLN.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  @import "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";
2
2
 
3
- /*! tailwindcss v4.0.9 | MIT License | https://tailwindcss.com */
4
- /*! tailwindcss v4.0.9 | MIT License | https://tailwindcss.com */
3
+ /*! tailwindcss v4.0.13 | MIT License | https://tailwindcss.com */
4
+ /*! tailwindcss v4.0.13 | MIT License | https://tailwindcss.com */
5
5
  :root {
6
6
  --toastify-color-light: #fff;
7
7
  --toastify-color-dark: #121212;
@@ -1386,12 +1386,8 @@
1386
1386
  display: inline-flex;
1387
1387
  }
1388
1388
 
1389
- .table-cell {
1390
- display: table-cell;
1391
- }
1392
-
1393
- .table-row {
1394
- display: table-row;
1389
+ .table {
1390
+ display: table;
1395
1391
  }
1396
1392
 
1397
1393
  .aspect-square {
@@ -4502,10 +4498,6 @@
4502
4498
  display: inline-block;
4503
4499
  }
4504
4500
 
4505
- .table {
4506
- display: table;
4507
- }
4508
-
4509
4501
  .size-full {
4510
4502
  width: 100%;
4511
4503
  height: 100%;
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-CTigHfYe.js","assets/main.DW-SDHrh.js","assets/app-Cln9uYMI.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-DS1CKnZX.js","assets/main.BTNubzb3.js","assets/app-ClxoJuGw.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, _InternalTransmitter_instances, buildInternalOperationUpdate_fn, _a, _ServiceWorkerManager_instances, handleServiceWorkerMessage_fn, handleServiceWorker_fn;
14
- import { _ as __vitePreload } from "./main.DW-SDHrh.js";
14
+ import { _ as __vitePreload } from "./main.BTNubzb3.js";
15
15
  import { jsx } from "react/jsx-runtime";
16
16
  import { useState, useEffect, useMemo, Suspense, lazy } from "react";
17
17
  function _mergeNamespaces(n, m) {
@@ -22938,6 +22938,10 @@ class BaseDocumentDriveServer {
22938
22938
  });
22939
22939
  this.initializePromise = this._initialize();
22940
22940
  }
22941
+ // workaround for testing the ephemeral listeners -- we don't have DI in place yet
22942
+ getListenerManager() {
22943
+ return this.listenerManager;
22944
+ }
22941
22945
  initialize() {
22942
22946
  return this.initializePromise;
22943
22947
  }
@@ -25734,7 +25738,7 @@ const nodeOptionsMap = {
25734
25738
  };
25735
25739
  const name = "@powerhousedao/connect";
25736
25740
  const productName = "Powerhouse-Connect";
25737
- const version$1 = "1.0.0-dev.223";
25741
+ const version$1 = "1.0.0-dev.225";
25738
25742
  const description = "Powerhouse Connect";
25739
25743
  const main = "./dist/index.html";
25740
25744
  const type = "module";
@@ -25745,8 +25749,8 @@ const author = "acaldas@powerhouse.inc";
25745
25749
  const repository = { "type": "git", "url": "git+https://github.com/powerhouse-inc/document-model-electron.git" };
25746
25750
  const bugs = { "url": "https://github.com/powerhouse-inc/document-model-electron/issues" };
25747
25751
  const homepage = "https://github.com/powerhouse-inc/document-model-electron#readme";
25748
- 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:web": "vite -c vite.renderer.config.mts", "dev:nocache": "rm -rf node_modules/.vite && rm -rf node_modules/.cache && npm run dev:web", "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", "install:packages": "node ./scripts/install-packages.js" };
25749
- 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", "autoprefixer": "^10.4.14", "cypress": "^13.11.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", "postcss": "^8.4.33", "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" };
25752
+ 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:web": "vite -c vite.renderer.config.mts", "dev:nocache": "rm -rf node_modules/.vite && rm -rf node_modules/.cache && npm run dev:web", "build": "NODE_OPTIONS=--max-old-space-size=6144 vite build -c vite.renderer.config.mts --debug", "preview:web": "vite preview -c vite.renderer.config.mts", "e2e": "playwright test", "cy:open": "cypress open", "build:service-worker": "tsc --build ./tsconfig.sw.json", "install:packages": "node ./scripts/install-packages.js" };
25753
+ 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" };
25750
25754
  const optionalDependencies = { "@esbuild/linux-x64": "^0.21.4", "@rollup/rollup-linux-x64-musl": "4.14.3" };
25751
25755
  const packageJson = {
25752
25756
  name,
@@ -30807,7 +30811,7 @@ if (window.__VITE_ENVS.MODE === "development") {
30807
30811
  } else {
30808
30812
  serviceWorkerManager.registerServiceWorker(false);
30809
30813
  }
30810
- const App = lazy(() => __vitePreload(() => import("./app-CTigHfYe.js").then((n) => n.aN), true ? __vite__mapDeps([0,1,2]) : void 0));
30814
+ const App = lazy(() => __vitePreload(() => import("./app-DS1CKnZX.js").then((n) => n.aN), true ? __vite__mapDeps([0,1,2]) : void 0));
30811
30815
  const AppLoader = /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(App, {}) });
30812
30816
  const appLoader = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
30813
30817
  __proto__: null,
@@ -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-CTigHfYe.js";
2
- import "./main.DW-SDHrh.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-DS1CKnZX.js";
2
+ import "./main.BTNubzb3.js";
3
3
  import "react/jsx-runtime";
4
- import "./app-loader-DyNwL34W.js";
4
+ import "./app-loader-CQk_i65y.js";
5
5
  import "react";
6
6
  import "@powerhousedao/reactor-browser";
7
7
  import "react-dom";
@@ -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, 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-CTigHfYe.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-DS1CKnZX.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, aV as getDimensions, aW as READ, aX as nodeOptionsMap, aY as defaultFileOptions, aZ as DELETE, a_ as RENAME, a$ as WRITE, b0 as DUPLICATE, b1 as defaultFolderOptions, b2 as garbageCollect, b3 as sortOperations, b4 as UI_NODE, aM as DRIVE, ay as FILE, b5 as undo, b6 as redo, ac as logger, b7 as useDocumentDispatch, aN as FOLDER, ak as driveDocumentModelModule } from "./app-loader-DyNwL34W.js";
5
+ import { _ as Icon, aV as getDimensions, aW as READ, aX as nodeOptionsMap, aY as defaultFileOptions, aZ as DELETE, a_ as RENAME, a$ as WRITE, b0 as DUPLICATE, b1 as defaultFolderOptions, b2 as garbageCollect, b3 as sortOperations, b4 as UI_NODE, aM as DRIVE, ay as FILE, b5 as undo, b6 as redo, ac as logger, b7 as useDocumentDispatch, aN as FOLDER, ak as driveDocumentModelModule } from "./app-loader-CQk_i65y.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.DW-SDHrh.js";
13
+ import "./main.BTNubzb3.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");
@@ -2514,10 +2514,19 @@ class Virtualizer {
2514
2514
  let end;
2515
2515
  if (measurements.length === 0) {
2516
2516
  end = this.options.paddingStart;
2517
+ } else if (this.options.lanes === 1) {
2518
+ end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0;
2517
2519
  } 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
- );
2520
+ const endByLane = Array(this.options.lanes).fill(null);
2521
+ let endIndex = measurements.length - 1;
2522
+ while (endIndex > 0 && endByLane.some((val) => val === null)) {
2523
+ const item = measurements[endIndex];
2524
+ if (endByLane[item.lane] === null) {
2525
+ endByLane[item.lane] = item.end;
2526
+ }
2527
+ endIndex--;
2528
+ }
2529
+ end = Math.max(...endByLane.filter((val) => val !== null));
2521
2530
  }
2522
2531
  return Math.max(
2523
2532
  end - this.options.scrollMargin + this.options.paddingEnd,
@@ -2570,10 +2579,23 @@ function calculateRange({
2570
2579
  scrollOffset
2571
2580
  );
2572
2581
  let endIndex = startIndex;
2573
- while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
2574
- endIndex++;
2575
- }
2576
- if (lanes > 1) {
2582
+ if (lanes === 1) {
2583
+ while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
2584
+ endIndex++;
2585
+ }
2586
+ } else if (lanes > 1) {
2587
+ const endPerLane = Array(lanes).fill(0);
2588
+ while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
2589
+ const item = measurements[endIndex];
2590
+ endPerLane[item.lane] = item.end;
2591
+ endIndex++;
2592
+ }
2593
+ const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
2594
+ while (startIndex > 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
2595
+ const item = measurements[startIndex];
2596
+ startPerLane[item.lane] = item.start;
2597
+ startIndex--;
2598
+ }
2577
2599
  startIndex = Math.max(0, startIndex - startIndex % lanes);
2578
2600
  endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
2579
2601
  }
@@ -2980,7 +3002,7 @@ const validateDocument = (document2) => {
2980
3002
  return [...initialStateErrors, ...schemaStateErrors, ...modulesErrors];
2981
3003
  };
2982
3004
  function useDocumentEditor(props) {
2983
- const { driveId, documentId, documentType, documentModelModule } = props;
3005
+ const { driveId, documentId, documentType, documentModelModule, user } = props;
2984
3006
  const reactor = useUnwrappedReactor();
2985
3007
  const connectDid = useConnectDid();
2986
3008
  const { sign } = useConnectCrypto();
@@ -2991,7 +3013,8 @@ function useDocumentEditor(props) {
2991
3013
  document: doc,
2992
3014
  documentModelModule,
2993
3015
  connectDid,
2994
- sign
3016
+ sign,
3017
+ user
2995
3018
  });
2996
3019
  return documentEditorProps;
2997
3020
  }
@@ -3770,7 +3793,7 @@ function useGetDriveDocuments(props) {
3770
3793
  });
3771
3794
  return removeListener;
3772
3795
  }, [onStrandUpdate, driveId]);
3773
- return documents;
3796
+ return [documents, fetchDocuments];
3774
3797
  }
3775
3798
  function DriveEditorError({ error }) {
3776
3799
  return /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center", children: [
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-DyNwL34W.js","assets/main.DW-SDHrh.js","assets/app-loader-BY0bGSIq.css"])))=>i.map(i=>d[i]);
2
- import { _ as __vitePreload } from "./main.DW-SDHrh.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-CQk_i65y.js","assets/main.BTNubzb3.js","assets/app-loader-C6FgR-r9.css"])))=>i.map(i=>d[i]);
2
+ import { _ as __vitePreload } from "./main.BTNubzb3.js";
3
3
  import { createRoot } from "react-dom/client";
4
4
  async function renderApp(element) {
5
- const AppLoader = await __vitePreload(() => import("./app-loader-DyNwL34W.js").then((n) => n.c7), true ? __vite__mapDeps([0,1,2]) : void 0);
5
+ const AppLoader = await __vitePreload(() => import("./app-loader-CQk_i65y.js").then((n) => n.c7), true ? __vite__mapDeps([0,1,2]) : void 0);
6
6
  createRoot(element).render(AppLoader.default);
7
7
  }
8
8
  const AppElement = document.getElementById("app");
@@ -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.DW-SDHrh.js";
14
- import { aU as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-DyNwL34W.js";
15
- import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-CTigHfYe.js";
16
- import { d, c, b, f, a, r, s } from "./app-CTigHfYe.js";
13
+ import { _ as __vitePreload } from "./main.BTNubzb3.js";
14
+ import { aU as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-CQk_i65y.js";
15
+ import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-DS1CKnZX.js";
16
+ import { d, c, b, f, a, r, s } from "./app-DS1CKnZX.js";
17
17
  import "react/jsx-runtime";
18
18
  import "react";
19
19
  import "@powerhousedao/reactor-browser";
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { t as twMerge, a5 as clsx, a6 as get, a7 as set, a8 as appendErrors, a9 as useFormContext, aa as Primitive, ab as cva, ac as FormProvider, ad as Controller, ae as Slot, af as useForm, ag as Root2, ah as List, ai as Trigger, aj as Content, ak as setModelName, al as setModelId, am as setModelDescription, an as setModelExtension, ao as setAuthorName, ap as setAuthorWebsite, aq as setStateSchema, ar as setInitialState, as as addModule, at as setModuleName, au as deleteModule, av as addOperation, aw as setOperationName, ax as setOperationSchema, ay as setOperationDescription, az as deleteOperation, aA as addOperationError, aB as deleteOperationError, aC as setOperationErrorName } from "./app-CTigHfYe.js";
3
- import { b8 as inspect$1, b9 as GraphQLError$1, ba as getNamedType, bb as invariant$2, bc as isInputObjectType, bd as isScalarType, be as isObjectType, bf as isInterfaceType, bg as isUnionType, bh as isEnumType, bi as print, bj as isPrintableAsBlockString, bk as Kind, bl as astFromValue$1, bm as DEFAULT_DEPRECATION_REASON, bn as isSpecifiedDirective, bo as isSpecifiedScalarType, bp as isIntrospectionType, bq as z, br as GraphQLScalarType, Z as pascalCase, bs as parse, bt as visit, bu as buildASTSchema, bv as extendSchema, bw as getNullableType, bx as isListType, $ as getDefaultExportFromCjs, by as snakeCase, bz as constantCase, bA as isAbstractType, bB as BREAK, bC as GraphQLInputObjectType, bD as GraphQLList, bE as GraphQLEnumType, bF as GraphQLObjectType, bG as GraphQLInterfaceType, bH as SchemaMetaFieldDef, bI as TypeMetaFieldDef, bJ as TypeNameMetaFieldDef, bK as isCompositeType, bL as isOutputType, bM as isInputType, bN as GraphQLBoolean, bO as assertAbstractType, bP as doTypesOverlap, bQ as DirectiveLocation, bR as specifiedRules$1, bS as NoUnusedFragmentsRule$1, bT as ExecutableDefinitionsRule$1, bU as validate$2, bV as validateSchema, bW as GraphQLID, bX as GraphQLString, bY as GraphQLFloat, bZ as GraphQLInt, b_ as GraphQLDirective, b$ as GraphQLUnionType, c0 as isNonNullType, c1 as GraphQLNonNull, c2 as isNamedType, c3 as isLeafType, c4 as GraphQLSchema, c5 as buildSchema, c6 as sentenceCase, am as hashKey } from "./app-loader-DyNwL34W.js";
2
+ import { t as twMerge, a5 as clsx, a6 as get, a7 as set, a8 as appendErrors, a9 as useFormContext, aa as Primitive, ab as cva, ac as FormProvider, ad as Controller, ae as Slot, af as useForm, ag as Root2, ah as List, ai as Trigger, aj as Content, ak as setModelName, al as setModelId, am as setModelDescription, an as setModelExtension, ao as setAuthorName, ap as setAuthorWebsite, aq as setStateSchema, ar as setInitialState, as as addModule, at as setModuleName, au as deleteModule, av as addOperation, aw as setOperationName, ax as setOperationSchema, ay as setOperationDescription, az as deleteOperation, aA as addOperationError, aB as deleteOperationError, aC as setOperationErrorName } from "./app-DS1CKnZX.js";
3
+ import { b8 as inspect$1, b9 as GraphQLError$1, ba as getNamedType, bb as invariant$2, bc as isInputObjectType, bd as isScalarType, be as isObjectType, bf as isInterfaceType, bg as isUnionType, bh as isEnumType, bi as print, bj as isPrintableAsBlockString, bk as Kind, bl as astFromValue$1, bm as DEFAULT_DEPRECATION_REASON, bn as isSpecifiedDirective, bo as isSpecifiedScalarType, bp as isIntrospectionType, bq as z, br as GraphQLScalarType, Z as pascalCase, bs as parse, bt as visit, bu as buildASTSchema, bv as extendSchema, bw as getNullableType, bx as isListType, $ as getDefaultExportFromCjs, by as snakeCase, bz as constantCase, bA as isAbstractType, bB as BREAK, bC as GraphQLInputObjectType, bD as GraphQLList, bE as GraphQLEnumType, bF as GraphQLObjectType, bG as GraphQLInterfaceType, bH as SchemaMetaFieldDef, bI as TypeMetaFieldDef, bJ as TypeNameMetaFieldDef, bK as isCompositeType, bL as isOutputType, bM as isInputType, bN as GraphQLBoolean, bO as assertAbstractType, bP as doTypesOverlap, bQ as DirectiveLocation, bR as specifiedRules$1, bS as NoUnusedFragmentsRule$1, bT as ExecutableDefinitionsRule$1, bU as validate$2, bV as validateSchema, bW as GraphQLID, bX as GraphQLString, bY as GraphQLFloat, bZ as GraphQLInt, b_ as GraphQLDirective, b$ as GraphQLUnionType, c0 as isNonNullType, c1 as GraphQLNonNull, c2 as isNamedType, c3 as isLeafType, c4 as GraphQLSchema, c5 as buildSchema, c6 as sentenceCase, am as hashKey } from "./app-loader-CQk_i65y.js";
4
4
  import * as React from "react";
5
5
  import React__default, { forwardRef, useRef, useCallback, useImperativeHandle, useEffect, useState, createContext, useContext, memo, useId, useMemo } from "react";
6
- import "./main.DW-SDHrh.js";
6
+ import "./main.BTNubzb3.js";
7
7
  import "@powerhousedao/reactor-browser";
8
8
  import "react-dom";
9
9
  import "@powerhousedao/reactor-browser/hooks/useUiNodesContext";
@@ -99,7 +99,7 @@ const __vitePreload = function preload(baseModule, deps, importerUrl) {
99
99
  return baseModule().catch(handlePreloadError);
100
100
  });
101
101
  };
102
- __vitePreload(() => import("./index-ClLjsnWF.js"), true ? [] : void 0);
102
+ __vitePreload(() => import("./index-BP3HovgJ.js"), true ? [] : void 0);
103
103
  export {
104
104
  __vitePreload as _
105
105
  };
@@ -1,6 +1,6 @@
1
1
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
2
2
 
3
- /*! tailwindcss v4.0.9 | MIT License | https://tailwindcss.com */
3
+ /*! tailwindcss v4.0.13 | MIT License | https://tailwindcss.com */
4
4
  :root {
5
5
  --toastify-color-light: #fff;
6
6
  --toastify-color-dark: #121212;
package/dist/index.html CHANGED
@@ -70,10 +70,10 @@
70
70
  "@powerhousedao/reactor-browser/document-model": "/modules/@powerhousedao/reactor-browser/document-model.js",
71
71
  "@powerhousedao/reactor-browser/index": "/modules/@powerhousedao/reactor-browser/index.js",
72
72
  "@powerhousedao/reactor-browser/reactor": "/modules/@powerhousedao/reactor-browser/reactor.js",
73
- "@powerhousedao/reactor-browser/context/index": "/modules/@powerhousedao/reactor-browser/context/index.js",
74
- "@powerhousedao/reactor-browser/context/read-mode": "/modules/@powerhousedao/reactor-browser/context/read-mode.js",
75
73
  "@powerhousedao/reactor-browser/crypto/browser": "/modules/@powerhousedao/reactor-browser/crypto/browser.js",
76
74
  "@powerhousedao/reactor-browser/crypto/index": "/modules/@powerhousedao/reactor-browser/crypto/index.js",
75
+ "@powerhousedao/reactor-browser/context/index": "/modules/@powerhousedao/reactor-browser/context/index.js",
76
+ "@powerhousedao/reactor-browser/context/read-mode": "/modules/@powerhousedao/reactor-browser/context/read-mode.js",
77
77
  "@powerhousedao/reactor-browser/hooks/document-state": "/modules/@powerhousedao/reactor-browser/hooks/document-state.js",
78
78
  "@powerhousedao/reactor-browser/hooks/index": "/modules/@powerhousedao/reactor-browser/hooks/index.js",
79
79
  "@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations": "/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js",
@@ -97,4 +97,4 @@
97
97
  "@powerhousedao/reactor-browser/utils/index": "/modules/@powerhousedao/reactor-browser/utils/index.js",
98
98
  "@powerhousedao/reactor-browser/utils/signature": "/modules/@powerhousedao/reactor-browser/utils/signature.js"
99
99
  }
100
- }</script><script type="module" crossorigin="" src="/assets/main.DW-SDHrh.js"></script></head><body><div id="app"></div></body></html>
100
+ }</script><script type="module" crossorigin="" src="/assets/main.BTNubzb3.js"></script></head><body><div id="app"></div></body></html>
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useDocumentDrives
3
- } from "./chunk-2ZNMEO7F.js";
3
+ } from "./chunk-M2UUQ5LH.js";
4
4
  import {
5
5
  useUserPermissions
6
6
  } from "./chunk-OVGOA2P5.js";
@@ -4,7 +4,7 @@ import {
4
4
  ReactorBuilder,
5
5
  memory_default,
6
6
  mergeOperations
7
- } from "./chunk-KDBDV2ML.js";
7
+ } from "./chunk-55TZMPQQ.js";
8
8
  import {
9
9
  __commonJS,
10
10
  __require,
@@ -12212,6 +12212,10 @@ var BaseDocumentDriveServer = class {
12212
12212
  });
12213
12213
  this.initializePromise = this._initialize();
12214
12214
  }
12215
+ // workaround for testing the ephemeral listeners -- we don't have DI in place yet
12216
+ getListenerManager() {
12217
+ return this.listenerManager;
12218
+ }
12215
12219
  initialize() {
12216
12220
  return this.initializePromise;
12217
12221
  }
@@ -8,7 +8,7 @@ import {
8
8
  isFolderNode,
9
9
  moveNode,
10
10
  updateNode
11
- } from "./chunk-KDBDV2ML.js";
11
+ } from "./chunk-55TZMPQQ.js";
12
12
  import {
13
13
  generateId
14
14
  } from "./chunk-FQF4YAVC.js";
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-IQTSFTNF.js";
5
5
  import {
6
6
  useAddDebouncedOperations
7
- } from "./chunk-DZDC5PJZ.js";
7
+ } from "./chunk-45DCPCA7.js";
8
8
  import {
9
9
  useConnectCrypto,
10
10
  useConnectDid
11
- } from "./chunk-MHTRZST7.js";
11
+ } from "./chunk-G6LMXRY5.js";
12
12
  import {
13
13
  useDocumentDispatch
14
14
  } from "./chunk-GDP7BUIH.js";
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/jotai@2.12.1_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/vanilla/internals.mjs
1
+ // ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/vanilla/internals.mjs
2
2
  var isSelfAtom = (atom2, a) => atom2.unstable_is ? atom2.unstable_is(a) : a === atom2;
3
3
  var hasInitialValue = (atom2) => "init" in atom2;
4
4
  var isActuallyWritableAtom = (atom2) => !!atom2.write;
@@ -12,34 +12,29 @@ var returnAtomValue = (atomState) => {
12
12
  }
13
13
  return atomState.v;
14
14
  };
15
- var PROMISE_STATE = Symbol();
16
- var getPromiseState = (promise) => promise[PROMISE_STATE];
15
+ var promiseStateMap = /* @__PURE__ */ new WeakMap();
17
16
  var isPendingPromise = (value) => {
18
17
  var _a;
19
- return isPromiseLike(value) && !((_a = getPromiseState(value)) == null ? void 0 : _a[1]);
18
+ return isPromiseLike(value) && !!((_a = promiseStateMap.get(value)) == null ? void 0 : _a[0]);
20
19
  };
21
- var cancelPromise = (promise, nextValue) => {
22
- const promiseState = getPromiseState(promise);
23
- if (promiseState) {
24
- promiseState[1] = true;
25
- promiseState[0].forEach((fn) => fn(nextValue));
26
- } else if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
27
- throw new Error("[Bug] cancelable promise not found");
20
+ var abortPromise = (promise) => {
21
+ const promiseState = promiseStateMap.get(promise);
22
+ if (promiseState == null ? void 0 : promiseState[0]) {
23
+ promiseState[0] = false;
24
+ promiseState[1].forEach((fn) => fn());
28
25
  }
29
26
  };
30
- var patchPromiseForCancelability = (promise) => {
31
- if (getPromiseState(promise)) {
32
- return;
27
+ var registerAbortHandler = (promise, abortHandler) => {
28
+ let promiseState = promiseStateMap.get(promise);
29
+ if (!promiseState) {
30
+ promiseState = [true, /* @__PURE__ */ new Set()];
31
+ promiseStateMap.set(promise, promiseState);
32
+ const settle = () => {
33
+ promiseState[0] = false;
34
+ };
35
+ promise.then(settle, settle);
33
36
  }
34
- const promiseState = [/* @__PURE__ */ new Set(), false];
35
- promise[PROMISE_STATE] = promiseState;
36
- const settle = () => {
37
- promiseState[1] = true;
38
- };
39
- promise.then(settle, settle);
40
- promise.onCancel = (fn) => {
41
- promiseState[0].add(fn);
42
- };
37
+ promiseState[1].add(abortHandler);
43
38
  };
44
39
  var isPromiseLike = (p) => typeof (p == null ? void 0 : p.then) === "function";
45
40
  var addPendingPromiseToDependency = (atom2, promise, dependencyAtomState) => {
@@ -59,9 +54,7 @@ var setAtomStateValueOrPromise = (atom2, valueOrPromise, ensureAtomState) => {
59
54
  const atomState = ensureAtomState(atom2);
60
55
  const hasPrevValue = "v" in atomState;
61
56
  const prevValue = atomState.v;
62
- const pendingPromise = isPendingPromise(atomState.v) ? atomState.v : null;
63
57
  if (isPromiseLike(valueOrPromise)) {
64
- patchPromiseForCancelability(valueOrPromise);
65
58
  for (const a of atomState.d.keys()) {
66
59
  addPendingPromiseToDependency(atom2, valueOrPromise, ensureAtomState(a));
67
60
  }
@@ -70,8 +63,8 @@ var setAtomStateValueOrPromise = (atom2, valueOrPromise, ensureAtomState) => {
70
63
  delete atomState.e;
71
64
  if (!hasPrevValue || !Object.is(prevValue, atomState.v)) {
72
65
  ++atomState.n;
73
- if (pendingPromise) {
74
- cancelPromise(pendingPromise, valueOrPromise);
66
+ if (isPromiseLike(prevValue)) {
67
+ abortPromise(prevValue);
75
68
  }
76
69
  }
77
70
  };
@@ -150,16 +143,12 @@ var buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /*
150
143
  return atomState;
151
144
  });
152
145
  const flushCallbacks = buildingBlockFunctions[1] || (() => {
153
- let hasError;
154
- let error;
146
+ const errors = [];
155
147
  const call = (fn) => {
156
148
  try {
157
149
  fn();
158
150
  } catch (e) {
159
- if (!hasError) {
160
- hasError = true;
161
- error = e;
162
- }
151
+ errors.push(e);
163
152
  }
164
153
  };
165
154
  do {
@@ -182,8 +171,8 @@ var buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /*
182
171
  recomputeInvalidatedAtoms();
183
172
  }
184
173
  } while (changedAtoms.size || unmountCallbacks.size || mountCallbacks.size);
185
- if (hasError) {
186
- throw error;
174
+ if (errors.length) {
175
+ throw new AggregateError(errors);
187
176
  }
188
177
  });
189
178
  const recomputeInvalidatedAtoms = buildingBlockFunctions[2] || (() => {
@@ -232,7 +221,7 @@ var buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /*
232
221
  }
233
222
  });
234
223
  const readAtomState = buildingBlockFunctions[3] || ((atom2) => {
235
- var _a, _b;
224
+ var _a;
236
225
  const atomState = ensureAtomState(atom2);
237
226
  if (isAtomStateInitialized(atomState)) {
238
227
  if (mountedMap.has(atom2) && invalidatedAtoms.get(atom2) !== atomState.n) {
@@ -320,7 +309,7 @@ var buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /*
320
309
  const valueOrPromise = atomRead(atom2, getter, options);
321
310
  setAtomStateValueOrPromise(atom2, valueOrPromise, ensureAtomState);
322
311
  if (isPromiseLike(valueOrPromise)) {
323
- (_a = valueOrPromise.onCancel) == null ? void 0 : _a.call(valueOrPromise, () => controller == null ? void 0 : controller.abort());
312
+ registerAbortHandler(valueOrPromise, () => controller == null ? void 0 : controller.abort());
324
313
  valueOrPromise.then(
325
314
  mountDependenciesIfAsync,
326
315
  mountDependenciesIfAsync
@@ -337,7 +326,7 @@ var buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /*
337
326
  if (prevEpochNumber !== atomState.n && invalidatedAtoms.get(atom2) === prevEpochNumber) {
338
327
  invalidatedAtoms.set(atom2, atomState.n);
339
328
  changedAtoms.add(atom2);
340
- (_b = storeHooks.c) == null ? void 0 : _b.call(storeHooks, atom2);
329
+ (_a = storeHooks.c) == null ? void 0 : _a.call(storeHooks, atom2);
341
330
  }
342
331
  }
343
332
  });
@@ -542,8 +531,9 @@ var buildStore = (atomStateMap = /* @__PURE__ */ new WeakMap(), mountedMap = /*
542
531
  };
543
532
  var INTERNAL_buildStoreRev1 = buildStore;
544
533
  var INTERNAL_initializeStoreHooks = initializeStoreHooks;
534
+ var INTERNAL_registerAbortHandler = registerAbortHandler;
545
535
 
546
- // ../../node_modules/.pnpm/jotai@2.12.1_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/vanilla.mjs
536
+ // ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/vanilla.mjs
547
537
  var keyCount = 0;
548
538
  function atom(read, write) {
549
539
  const key = `atom${++keyCount}`;
@@ -630,15 +620,15 @@ var createDevStoreRev4 = () => {
630
620
  };
631
621
  return Object.assign(store, devStore);
632
622
  };
633
- var createStore = () => {
623
+ function createStore() {
634
624
  if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
635
625
  return createDevStoreRev4();
636
626
  }
637
627
  const store = INTERNAL_buildStoreRev1();
638
628
  return store;
639
- };
629
+ }
640
630
  var defaultStore;
641
- var getDefaultStore = () => {
631
+ function getDefaultStore() {
642
632
  if (!defaultStore) {
643
633
  defaultStore = createStore();
644
634
  if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
@@ -651,17 +641,17 @@ var getDefaultStore = () => {
651
641
  }
652
642
  }
653
643
  return defaultStore;
654
- };
644
+ }
655
645
 
656
- // ../../node_modules/.pnpm/jotai@2.12.1_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/react.mjs
646
+ // ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.18_react@18.3.1/node_modules/jotai/esm/react.mjs
657
647
  import ReactExports, { createContext, useContext, useRef, createElement, useReducer, useEffect, useDebugValue, useCallback } from "react";
658
648
  var StoreContext = createContext(
659
649
  void 0
660
650
  );
661
- var useStore = (options) => {
651
+ function useStore(options) {
662
652
  const store = useContext(StoreContext);
663
653
  return (options == null ? void 0 : options.store) || store || getDefaultStore();
664
- };
654
+ }
665
655
  var isPromiseLike2 = (x) => typeof (x == null ? void 0 : x.then) === "function";
666
656
  var attachPromiseMeta = (promise) => {
667
657
  promise.status = "pending";
@@ -689,7 +679,7 @@ var use = ReactExports.use || ((promise) => {
689
679
  }
690
680
  });
691
681
  var continuablePromiseMap = /* @__PURE__ */ new WeakMap();
692
- var createContinuablePromise = (promise) => {
682
+ var createContinuablePromise = (promise, getValue) => {
693
683
  let continuablePromise = continuablePromiseMap.get(promise);
694
684
  if (!continuablePromise) {
695
685
  continuablePromise = new Promise((resolve, reject) => {
@@ -704,25 +694,23 @@ var createContinuablePromise = (promise) => {
704
694
  reject(e);
705
695
  }
706
696
  };
707
- const registerCancelHandler = (p) => {
708
- if ("onCancel" in p && typeof p.onCancel === "function") {
709
- p.onCancel((nextValue) => {
710
- if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && nextValue === p) {
711
- throw new Error("[Bug] p is not updated even after cancelation");
712
- }
713
- if (isPromiseLike2(nextValue)) {
714
- continuablePromiseMap.set(nextValue, continuablePromise);
715
- curr = nextValue;
716
- nextValue.then(onFulfilled(nextValue), onRejected(nextValue));
717
- registerCancelHandler(nextValue);
718
- } else {
719
- resolve(nextValue);
720
- }
721
- });
697
+ const onAbort = () => {
698
+ try {
699
+ const nextValue = getValue();
700
+ if (isPromiseLike2(nextValue)) {
701
+ continuablePromiseMap.set(nextValue, continuablePromise);
702
+ curr = nextValue;
703
+ nextValue.then(onFulfilled(nextValue), onRejected(nextValue));
704
+ INTERNAL_registerAbortHandler(nextValue, onAbort);
705
+ } else {
706
+ resolve(nextValue);
707
+ }
708
+ } catch (e) {
709
+ reject(e);
722
710
  }
723
711
  };
724
712
  promise.then(onFulfilled(promise), onRejected(promise));
725
- registerCancelHandler(promise);
713
+ INTERNAL_registerAbortHandler(promise, onAbort);
726
714
  });
727
715
  continuablePromiseMap.set(promise, continuablePromise);
728
716
  }
@@ -752,7 +740,9 @@ function useAtomValue(atom2, options) {
752
740
  if (typeof delay === "number") {
753
741
  const value2 = store.get(atom2);
754
742
  if (isPromiseLike2(value2)) {
755
- attachPromiseMeta(createContinuablePromise(value2));
743
+ attachPromiseMeta(
744
+ createContinuablePromise(value2, () => store.get(atom2))
745
+ );
756
746
  }
757
747
  setTimeout(rerender, delay);
758
748
  return;
@@ -764,7 +754,7 @@ function useAtomValue(atom2, options) {
764
754
  }, [store, atom2, delay]);
765
755
  useDebugValue(value);
766
756
  if (isPromiseLike2(value)) {
767
- const promise = createContinuablePromise(value);
757
+ const promise = createContinuablePromise(value, () => store.get(atom2));
768
758
  return use(promise);
769
759
  }
770
760
  return value;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  atom,
3
3
  useAtom
4
- } from "./chunk-2457SE2E.js";
4
+ } from "./chunk-FW7N6EJH.js";
5
5
  import {
6
6
  BrowserKeyStorage
7
7
  } from "./chunk-YWKVPJNL.js";