@powerhousedao/connect 1.0.22-dev.4 → 1.0.22-dev.5

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 (37) hide show
  1. package/dist/assets/{app-CmlD3Pwe.css → app-D5gNm0Gn.css} +67 -26
  2. package/dist/assets/{app-DZfkpUSg.js → app-bXMgXr_2.js} +2102 -5095
  3. package/dist/assets/app-bXMgXr_2.js.map +1 -0
  4. package/dist/assets/{app-loader-DWy8SQ7o.js → app-loader-Bbnowyvy.js} +70 -49
  5. package/dist/assets/app-loader-Bbnowyvy.js.map +1 -0
  6. package/dist/assets/{app-loader-DaCxVT0x.css → app-loader-NDVZu4bS.css} +28 -34
  7. package/dist/assets/{browser-B_zTOFuJ.js → browser-CX-a5MKk.js} +38 -48
  8. package/dist/assets/browser-CX-a5MKk.js.map +1 -0
  9. package/dist/assets/{ccip-Br7QabLv.js → ccip-BBMJrqAU.js} +5 -5
  10. package/dist/assets/ccip-BBMJrqAU.js.map +1 -0
  11. package/dist/assets/{content-Ch_VzBZ4.js → content-B0W_DYic.js} +74 -114
  12. package/dist/assets/content-B0W_DYic.js.map +1 -0
  13. package/dist/assets/{index-CVuue1Uq.js → index-CPgk_OFL.js} +4 -4
  14. package/dist/assets/{index-CVuue1Uq.js.map → index-CPgk_OFL.js.map} +1 -1
  15. package/dist/assets/{index-Dkmlt_Sd.js → index-CU_lAxAd.js} +4 -4
  16. package/dist/assets/{index-Dkmlt_Sd.js.map → index-CU_lAxAd.js.map} +1 -1
  17. package/dist/assets/{index--JP0V-_i.js → index-DT91xQ-T.js} +5 -5
  18. package/dist/assets/{index--JP0V-_i.js.map → index-DT91xQ-T.js.map} +1 -1
  19. package/dist/assets/{index-BW2kpwdQ.js → index-IlX4YC7Y.js} +551 -748
  20. package/dist/assets/index-IlX4YC7Y.js.map +1 -0
  21. package/dist/assets/{main.DjHkckQe.js → main.D4SFrwJR.js} +2 -2
  22. package/dist/assets/{main.DjHkckQe.js.map → main.D4SFrwJR.js.map} +1 -1
  23. package/dist/assets/{reactor-analytics-U0uwNQ_2.js → reactor-analytics-e6XADmbk.js} +6 -6
  24. package/dist/assets/{reactor-analytics-U0uwNQ_2.js.map → reactor-analytics-e6XADmbk.js.map} +1 -1
  25. package/dist/assets/{router-D0FWn4U0.js → router-Cw4YsdTX.js} +12 -12
  26. package/dist/assets/router-Cw4YsdTX.js.map +1 -0
  27. package/dist/assets/{style-BPUyhu8E.css → style-CdxGKc2g.css} +36 -25
  28. package/dist/index.html +1 -1
  29. package/dist/vite-envs.sh +1 -1
  30. package/package.json +7 -7
  31. package/dist/assets/app-DZfkpUSg.js.map +0 -1
  32. package/dist/assets/app-loader-DWy8SQ7o.js.map +0 -1
  33. package/dist/assets/browser-B_zTOFuJ.js.map +0 -1
  34. package/dist/assets/ccip-Br7QabLv.js.map +0 -1
  35. package/dist/assets/content-Ch_VzBZ4.js.map +0 -1
  36. package/dist/assets/index-BW2kpwdQ.js.map +0 -1
  37. package/dist/assets/router-D0FWn4U0.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { aE as BaseError, aF as getUrl, aG as stringify, aH as decodeErrorResult, aI as isAddressEqual, aJ as call, aK as concat, aL as encodeAbiParameters, aM as HttpRequestError, aN as isHex } from "./app-DZfkpUSg.js";
2
- import "./main.DjHkckQe.js";
1
+ import { aE as BaseError, aF as getUrl, aG as stringify, aH as decodeErrorResult, aI as isAddressEqual, aJ as call, aK as concat, aL as encodeAbiParameters, aM as HttpRequestError, aN as isHex } from "./app-bXMgXr_2.js";
2
+ import "./main.D4SFrwJR.js";
3
3
  import "react/jsx-runtime";
4
- import "./app-loader-DWy8SQ7o.js";
4
+ import "./app-loader-Bbnowyvy.js";
5
5
  import "react";
6
6
  import "react-dom";
7
7
  class OffchainLookupError extends BaseError {
@@ -117,7 +117,7 @@ async function ccipRequest({ data, sender, urls }) {
117
117
  const body = method === "POST" ? { data, sender } : void 0;
118
118
  const headers = method === "POST" ? { "Content-Type": "application/json" } : {};
119
119
  try {
120
- const response = await fetch(url.replace("{sender}", sender.toLowerCase()).replace("{data}", data), {
120
+ const response = await fetch(url.replace("{sender}", sender).replace("{data}", data), {
121
121
  body: JSON.stringify(body),
122
122
  headers,
123
123
  method
@@ -162,4 +162,4 @@ export {
162
162
  offchainLookupAbiItem,
163
163
  offchainLookupSignature
164
164
  };
165
- //# sourceMappingURL=ccip-Br7QabLv.js.map
165
+ //# sourceMappingURL=ccip-BBMJrqAU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ccip-BBMJrqAU.js","sources":["../../../../node_modules/.pnpm/viem@2.22.17_bufferutil@4.0.9_typescript@5.7.3_utf-8-validate@5.0.10_zod@3.24.2/node_modules/viem/_esm/errors/ccip.js","../../../../node_modules/.pnpm/viem@2.22.17_bufferutil@4.0.9_typescript@5.7.3_utf-8-validate@5.0.10_zod@3.24.2/node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n name: 'OffchainLookupError',\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n name: 'OffchainLookupResponseMalformedError',\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n name: 'OffchainLookupSenderMismatchError',\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n const headers = method === 'POST' ? { 'Content-Type': 'application/json' } : {};\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n headers,\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":[],"mappings":";;;;;;AAGO,MAAM,4BAA4B,UAAU;AAAA,EAC/C,YAAY,EAAE,kBAAkB,OAAO,MAAM,WAAW,QAAQ,QAAS;;AACrE,UAAM,MAAM,gBACR,4DAA4D;AAAA,MAC5D;AAAA,MACA,cAAc;AAAA,QACV,GAAI,MAAM,gBAAgB;UAC1B,WAAM,iBAAN,mBAAoB,UAAS,KAAK,CAAE;AAAA,QACpC;AAAA,QACA,QAAQ;AAAA,UACJ;AAAA,UACA,GAAG,KAAK,IAAI,CAAC,QAAQ,OAAO,OAAO,GAAG,CAAC,EAAE;AAAA,QAC5C;AAAA,QACD,aAAa,MAAM;AAAA,QACnB,WAAW,IAAI;AAAA,QACf,wBAAwB,gBAAgB;AAAA,QACxC,iBAAiB,SAAS;AAAA,MAC7B,EAAC,KAAM;AAAA,MACR,MAAM;AAAA,IAClB,CAAS;AAAA,EACT;AACA;AACO,MAAM,6CAA6C,UAAU;AAAA,EAChE,YAAY,EAAE,QAAQ,OAAO;AACzB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,SAAS;AAAA,UACf,SAAS,SAAS;AAAA,UAClB,QAAQ,SAAS;AAAA,UACjB;AAAA,QACpB,CAAiB;AACD;AAAA,MAChB;AACY,UAAI,CAAC,MAAM,MAAM,GAAG;AAChB,gBAAQ,IAAI,qCAAqC;AAAA,UAC7C;AAAA,UACA;AAAA,QACpB,CAAiB;AACD;AAAA,MAChB;AACY,aAAO;AAAA,IACnB,SACe,KAAK;AACR,cAAQ,IAAI,iBAAiB;AAAA,QACzB;AAAA,QACA,SAAS,IAAI;AAAA,QACb;AAAA,MAChB,CAAa;AAAA,IACb;AAAA,EACA;AACI,QAAM;AACV;","x_google_ignoreList":[0,1]}
@@ -1,11 +1,11 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
- import { t as twMerge, B as Button, aO as mergeClassNameProps, x as ERROR, aP as MISSING, C as CONFLICT, S as SUCCESS, aQ as SYNCING, aR as INITIAL_SYNC, aS as ConnectDropdownMenu, aT as useOnClickOutside, aU as useEventListener, aV as useCopyToClipboard, aW as Select, aX as Provider, aY as Root3, aZ as Trigger, a_ as Portal, a$ as Content2, b0 as validateInitialState, b1 as validateStateSchemaName, b2 as validateModules, b3 as useDocumentDrives, A as useUiNodesContext, b4 as useDriveContext, b5 as FILE$1, F as useUnwrappedReactor, b6 as useConnectDid, b7 as useConnectCrypto, o as useTranslation, G as useModal, b8 as useAtomValue, b9 as themeAtom, ba as useUser, bb as useUserPermissions$1, p as useUiNodes, bc as exportFile, bd as useGetDocumentModelModule, be as addActionContext$1, bf as signOperation$1, e as useDocumentDriveServer, bg as useHotkeys, bh as DriveLayout, bi as DriveContextProvider, bj as SearchBar, N as useAnalyticsStore, bk as useQueryClient, u as useQuery, a4 as AnalyticsPath, bl as useAnalyticsEngine, a3 as DateTime, bm as AnalyticsGranularity, bn as useGetEditor, bo as isSameDocument, n as useNavigate, s as useAsyncReactor, bp as useFilteredDocumentModels, bq as useDriveEditor, br as useDocumentDriveById, z as useParams, q as useDocumentDrives$1, w as toast } from "./app-DZfkpUSg.js";
2
+ import { t as twMerge, B as Button, aO as mergeClassNameProps, aP as INITIAL_SYNC, aQ as SYNCING, S as SUCCESS, C as CONFLICT, aR as MISSING, x as ERROR, aS as ConnectDropdownMenu, aT as useOnClickOutside, aU as useEventListener, aV as useCopyToClipboard, aW as Select, aX as Provider, aY as Root3, aZ as Trigger, a_ as Portal, a$ as Content2, b0 as validateInitialState, b1 as validateStateSchemaName, b2 as validateModules, b3 as useDocumentDrives, A as useUiNodesContext, b4 as useDriveContext, b5 as FILE$1, F as useUnwrappedReactor, b6 as useConnectDid, b7 as useConnectCrypto, o as useTranslation, G as useModal, b8 as useAtomValue, b9 as themeAtom, ba as useUser, bb as useUserPermissions$1, p as useUiNodes, bc as exportFile, bd as useGetDocumentModelModule, be as addActionContext$1, bf as signOperation$1, e as useDocumentDriveServer, bg as useHotkeys, bh as DriveLayout, bi as DriveContextProvider, bj as SearchBar, N as useAnalyticsStore, bk as useQueryClient, u as useQuery, a3 as AnalyticsPath, bl as useAnalyticsEngine, a4 as DateTime, bm as AnalyticsGranularity, bn as useGetEditor, bo as isSameDocument, n as useNavigate, s as useAsyncReactor, bp as useFilteredDocumentModels, bq as useDriveEditor, br as useDocumentDriveById, z as useParams, q as useDocumentDrives$1, w as toast } from "./app-bXMgXr_2.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, bX as getDimensions, bY as READ, bZ as nodeOptionsMap, b_ as defaultFileOptions, b$ as DELETE, c0 as RENAME, c1 as WRITE, c2 as DUPLICATE, c3 as defaultFolderOptions, c4 as garbageCollect, c5 as sortOperations, c6 as UI_NODE, aQ as DRIVE, aB as FILE, ae as buildSignedOperation, aq as generateId$1, ay as isFolderNode, aD as generateNodesCopy, aE as copyNode, aC as moveNode, aA as updateNode, az as deleteNode, at as generateAddNodeAction, au as isFileNode, ax as addFolder, c7 as undo, c8 as redo, _ as logger, aR as FOLDER, c9 as useDocumentDispatch$1, an as driveDocumentModelModule, ah as connectConfig } from "./app-loader-DWy8SQ7o.js";
6
- import { E as ENSAvatar, a as ErrorBoundary } from "./router-D0FWn4U0.js";
5
+ import { $ as Icon, bX as getDimensions, bY as READ, bZ as nodeOptionsMap, b_ as defaultFileOptions, b$ as DUPLICATE, c0 as RENAME, c1 as WRITE, c2 as DELETE, c3 as defaultFolderOptions, c4 as garbageCollect, c5 as sortOperations, c6 as UI_NODE, aQ as DRIVE, aB as FILE, ae as buildSignedOperation, ax as addFolder, at as generateAddNodeAction, ay as isFolderNode, au as isFileNode, az as deleteNode, aA as updateNode, aC as moveNode, aD as generateNodesCopy, aE as copyNode, aq as generateId$1, c7 as undo, c8 as redo, _ as logger, aR as FOLDER, c9 as useDocumentDispatch$1, an as driveDocumentModelModule, ah as connectConfig } from "./app-loader-Bbnowyvy.js";
6
+ import { E as ENSAvatar, a as ErrorBoundary } from "./router-Cw4YsdTX.js";
7
7
  import { flushSync } from "react-dom";
8
- import "./main.DjHkckQe.js";
8
+ import "./main.D4SFrwJR.js";
9
9
  const PaginationButton = ({ active = false, ...props }) => {
10
10
  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");
11
11
  return jsx(Button, { color: "light", size: "small", ...mergeClassNameProps(props, className), children: props.children });
@@ -15,7 +15,7 @@ const Pagination = (props) => {
15
15
  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] });
16
16
  };
17
17
  function usePagination(items, options) {
18
- const { itemsPerPage = 20, initialPage = 0, pageRange = 3 } = options || {};
18
+ const { itemsPerPage = 20, initialPage = 0, pageRange = 3 } = options;
19
19
  const [currentPage, setCurrentPage] = useState(initialPage);
20
20
  const pageCount = Math.ceil(items.length / itemsPerPage);
21
21
  const isNextPageAvailable = currentPage < pageCount - 1;
@@ -938,6 +938,8 @@ const lightFormatters = {
938
938
  }
939
939
  };
940
940
  const dayPeriodEnum = {
941
+ am: "am",
942
+ pm: "pm",
941
943
  midnight: "midnight",
942
944
  noon: "noon",
943
945
  morning: "morning",
@@ -2275,7 +2277,7 @@ function Header(props) {
2275
2277
  function memo(getDeps, fn, opts) {
2276
2278
  let deps = opts.initialDeps ?? [];
2277
2279
  let result;
2278
- function memoizedFunction() {
2280
+ return () => {
2279
2281
  var _a, _b, _c, _d;
2280
2282
  let depTime;
2281
2283
  if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
@@ -2313,11 +2315,7 @@ function memo(getDeps, fn, opts) {
2313
2315
  }
2314
2316
  (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
2315
2317
  return result;
2316
- }
2317
- memoizedFunction.updateDeps = (newDeps) => {
2318
- deps = newDeps;
2319
2318
  };
2320
- return memoizedFunction;
2321
2319
  }
2322
2320
  function notUndefined(value, msg) {
2323
2321
  if (value === void 0) {
@@ -2363,18 +2361,15 @@ const observeElementRect = (instance, cb) => {
2363
2361
  };
2364
2362
  }
2365
2363
  const observer = new targetWindow.ResizeObserver((entries) => {
2366
- const run = () => {
2367
- const entry = entries[0];
2368
- if (entry == null ? void 0 : entry.borderBoxSize) {
2369
- const box = entry.borderBoxSize[0];
2370
- if (box) {
2371
- handler({ width: box.inlineSize, height: box.blockSize });
2372
- return;
2373
- }
2364
+ const entry = entries[0];
2365
+ if (entry == null ? void 0 : entry.borderBoxSize) {
2366
+ const box = entry.borderBoxSize[0];
2367
+ if (box) {
2368
+ handler({ width: box.inlineSize, height: box.blockSize });
2369
+ return;
2374
2370
  }
2375
- handler(element.getBoundingClientRect());
2376
- };
2377
- instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
2371
+ }
2372
+ handler(element.getBoundingClientRect());
2378
2373
  });
2379
2374
  observer.observe(element, { box: "border-box" });
2380
2375
  return () => {
@@ -2412,15 +2407,10 @@ const observeElementOffset = (instance, cb) => {
2412
2407
  const endHandler = createHandler(false);
2413
2408
  endHandler();
2414
2409
  element.addEventListener("scroll", handler, addEventListenerOptions);
2415
- const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
2416
- if (registerScrollendEvent) {
2417
- element.addEventListener("scrollend", endHandler, addEventListenerOptions);
2418
- }
2410
+ element.addEventListener("scrollend", endHandler, addEventListenerOptions);
2419
2411
  return () => {
2420
2412
  element.removeEventListener("scroll", handler);
2421
- if (registerScrollendEvent) {
2422
- element.removeEventListener("scrollend", endHandler);
2423
- }
2413
+ element.removeEventListener("scrollend", endHandler);
2424
2414
  };
2425
2415
  };
2426
2416
  const measureElement = (element, entry, instance) => {
@@ -2474,10 +2464,7 @@ class Virtualizer {
2474
2464
  }
2475
2465
  return _ro = new this.targetWindow.ResizeObserver((entries) => {
2476
2466
  entries.forEach((entry) => {
2477
- const run = () => {
2478
- this._measureElement(entry.target, entry);
2479
- };
2480
- this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
2467
+ this._measureElement(entry.target, entry);
2481
2468
  });
2482
2469
  });
2483
2470
  };
@@ -2525,8 +2512,7 @@ class Virtualizer {
2525
2512
  isScrollingResetDelay: 150,
2526
2513
  enabled: true,
2527
2514
  isRtl: false,
2528
- useScrollendEvent: false,
2529
- useAnimationFrameWithResizeObserver: false,
2515
+ useScrollendEvent: true,
2530
2516
  ...opts2
2531
2517
  };
2532
2518
  };
@@ -2715,18 +2701,12 @@ class Virtualizer {
2715
2701
  }
2716
2702
  );
2717
2703
  this.calculateRange = memo(
2718
- () => [
2719
- this.getMeasurements(),
2720
- this.getSize(),
2721
- this.getScrollOffset(),
2722
- this.options.lanes
2723
- ],
2724
- (measurements, outerSize, scrollOffset, lanes) => {
2704
+ () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
2705
+ (measurements, outerSize, scrollOffset) => {
2725
2706
  return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
2726
2707
  measurements,
2727
2708
  outerSize,
2728
- scrollOffset,
2729
- lanes
2709
+ scrollOffset
2730
2710
  }) : null;
2731
2711
  },
2732
2712
  {
@@ -2734,7 +2714,7 @@ class Virtualizer {
2734
2714
  debug: () => this.options.debug
2735
2715
  }
2736
2716
  );
2737
- this.getVirtualIndexes = memo(
2717
+ this.getIndexes = memo(
2738
2718
  () => {
2739
2719
  let startIndex = null;
2740
2720
  let endIndex = null;
@@ -2743,7 +2723,6 @@ class Virtualizer {
2743
2723
  startIndex = range.startIndex;
2744
2724
  endIndex = range.endIndex;
2745
2725
  }
2746
- this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
2747
2726
  return [
2748
2727
  this.options.rangeExtractor,
2749
2728
  this.options.overscan,
@@ -2827,7 +2806,7 @@ class Virtualizer {
2827
2806
  this._measureElement(node, void 0);
2828
2807
  };
2829
2808
  this.getVirtualItems = memo(
2830
- () => [this.getVirtualIndexes(), this.getMeasurements()],
2809
+ () => [this.getIndexes(), this.getMeasurements()],
2831
2810
  (indexes, measurements) => {
2832
2811
  const virtualItems = [];
2833
2812
  for (let k = 0, len = indexes.length; k < len; k++) {
@@ -2856,15 +2835,15 @@ class Virtualizer {
2856
2835
  )]
2857
2836
  );
2858
2837
  };
2859
- this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
2838
+ this.getOffsetForAlignment = (toOffset, align) => {
2860
2839
  const size = this.getSize();
2861
2840
  const scrollOffset = this.getScrollOffset();
2862
2841
  if (align === "auto") {
2863
- align = toOffset >= scrollOffset + size ? "end" : "start";
2842
+ if (toOffset >= scrollOffset + size) {
2843
+ align = "end";
2844
+ }
2864
2845
  }
2865
- if (align === "center") {
2866
- toOffset += (itemSize - size) / 2;
2867
- } else if (align === "end") {
2846
+ if (align === "end") {
2868
2847
  toOffset -= size;
2869
2848
  }
2870
2849
  const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
@@ -2889,11 +2868,27 @@ class Virtualizer {
2889
2868
  return [scrollOffset, align];
2890
2869
  }
2891
2870
  }
2892
- const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
2893
- return [
2894
- this.getOffsetForAlignment(toOffset, align, item.size),
2895
- align
2896
- ];
2871
+ const centerOffset = item.start - this.options.scrollPaddingStart + (item.size - size) / 2;
2872
+ switch (align) {
2873
+ case "center":
2874
+ return [this.getOffsetForAlignment(centerOffset, align), align];
2875
+ case "end":
2876
+ return [
2877
+ this.getOffsetForAlignment(
2878
+ item.end + this.options.scrollPaddingEnd,
2879
+ align
2880
+ ),
2881
+ align
2882
+ ];
2883
+ default:
2884
+ return [
2885
+ this.getOffsetForAlignment(
2886
+ item.start - this.options.scrollPaddingStart,
2887
+ align
2888
+ ),
2889
+ align
2890
+ ];
2891
+ }
2897
2892
  };
2898
2893
  this.isDynamicMode = () => this.elementsCache.size > 0;
2899
2894
  this.cancelScrollToIndex = () => {
@@ -2963,19 +2958,10 @@ class Virtualizer {
2963
2958
  let end;
2964
2959
  if (measurements.length === 0) {
2965
2960
  end = this.options.paddingStart;
2966
- } else if (this.options.lanes === 1) {
2967
- end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0;
2968
2961
  } else {
2969
- const endByLane = Array(this.options.lanes).fill(null);
2970
- let endIndex = measurements.length - 1;
2971
- while (endIndex > 0 && endByLane.some((val) => val === null)) {
2972
- const item = measurements[endIndex];
2973
- if (endByLane[item.lane] === null) {
2974
- endByLane[item.lane] = item.end;
2975
- }
2976
- endIndex--;
2977
- }
2978
- end = Math.max(...endByLane.filter((val) => val !== null));
2962
+ end = this.options.lanes === 1 ? ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0 : Math.max(
2963
+ ...measurements.slice(-this.options.lanes).map((m) => m.end)
2964
+ );
2979
2965
  }
2980
2966
  return Math.max(
2981
2967
  end - this.options.scrollMargin + this.options.paddingEnd,
@@ -3016,43 +3002,14 @@ const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
3016
3002
  function calculateRange({
3017
3003
  measurements,
3018
3004
  outerSize,
3019
- scrollOffset,
3020
- lanes
3005
+ scrollOffset
3021
3006
  }) {
3022
- const lastIndex = measurements.length - 1;
3007
+ const count = measurements.length - 1;
3023
3008
  const getOffset = (index) => measurements[index].start;
3024
- if (measurements.length <= lanes) {
3025
- return {
3026
- startIndex: 0,
3027
- endIndex: lastIndex
3028
- };
3029
- }
3030
- let startIndex = findNearestBinarySearch(
3031
- 0,
3032
- lastIndex,
3033
- getOffset,
3034
- scrollOffset
3035
- );
3009
+ const startIndex = findNearestBinarySearch(0, count, getOffset, scrollOffset);
3036
3010
  let endIndex = startIndex;
3037
- if (lanes === 1) {
3038
- while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
3039
- endIndex++;
3040
- }
3041
- } else if (lanes > 1) {
3042
- const endPerLane = Array(lanes).fill(0);
3043
- while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
3044
- const item = measurements[endIndex];
3045
- endPerLane[item.lane] = item.end;
3046
- endIndex++;
3047
- }
3048
- const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
3049
- while (startIndex > 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
3050
- const item = measurements[startIndex];
3051
- startPerLane[item.lane] = item.start;
3052
- startIndex--;
3053
- }
3054
- startIndex = Math.max(0, startIndex - startIndex % lanes);
3055
- endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
3011
+ while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {
3012
+ endIndex++;
3056
3013
  }
3057
3014
  return { startIndex, endIndex };
3058
3015
  }
@@ -3558,9 +3515,7 @@ function useAddDebouncedOperations(reactor, props) {
3558
3515
  const { driveId, documentId } = props;
3559
3516
  const [documentDrives] = useDocumentDrives(reactor);
3560
3517
  const documentDrivesRef = useRef(documentDrives);
3561
- const { isAllowedToEditDocuments } = useUserPermissions() || {
3562
- isAllowedToEditDocuments: false
3563
- };
3518
+ const { isAllowedToEditDocuments } = useUserPermissions();
3564
3519
  useEffect(() => {
3565
3520
  documentDrivesRef.current = documentDrives;
3566
3521
  }, [documentDrives]);
@@ -3571,7 +3526,7 @@ function useAddDebouncedOperations(reactor, props) {
3571
3526
  if (!reactor) {
3572
3527
  throw new Error("Reactor is not loaded");
3573
3528
  }
3574
- const drive = documentDrivesRef.current.find((drive2) => drive2.state.global.id === driveId2);
3529
+ const drive = documentDrivesRef.current.find((drive2) => drive2.id === driveId2);
3575
3530
  if (!drive) {
3576
3531
  throw new Error(`Drive with id ${driveId2} not found`);
3577
3532
  }
@@ -3650,7 +3605,7 @@ function getNode(id, drive) {
3650
3605
  }
3651
3606
  function createDriveActions(document2, dispatch, context) {
3652
3607
  const drive = document2;
3653
- const { id: driveId } = drive.state.global;
3608
+ const driveId = drive.id;
3654
3609
  const { selectedNode } = context;
3655
3610
  const handleAddFolder = async (name, parentFolder, id = generateId()) => {
3656
3611
  dispatch(addFolder({
@@ -3960,9 +3915,7 @@ function useSyncStatus(driveId, documentId) {
3960
3915
  },
3961
3916
  () => {
3962
3917
  var _a;
3963
- const drive = documentDrives.find(
3964
- (_drive) => _drive.state.global.id === driveId
3965
- );
3918
+ const drive = documentDrives.find((_drive) => _drive.id === driveId);
3966
3919
  if (!drive) return;
3967
3920
  const isReadDrive = "readContext" in drive;
3968
3921
  const _sharingType = !isReadDrive ? (_a = drive.state.local.sharingType) == null ? void 0 : _a.toUpperCase() : "PUBLIC";
@@ -4146,7 +4099,7 @@ function FolderView(props) {
4146
4099
  }
4147
4100
  function BaseEditor(props) {
4148
4101
  const { document: document2, dispatch, className, children } = props;
4149
- const { state: { global: { id: driveId } } } = document2;
4102
+ const { id: driveId } = document2;
4150
4103
  const { showSearchBar, isAllowedToCreateDocuments, documentModels, showCreateDocumentModal } = useDriveContext();
4151
4104
  const { driveNodes, selectedNode, selectedNodePath, getNodeById, setSelectedNode } = useUiNodesContext();
4152
4105
  const driveNode = useMemo(() => driveNodes.find((n) => n.id === driveId), [driveNodes, driveId]);
@@ -4178,7 +4131,14 @@ function Editor(props) {
4178
4131
  return jsx(DriveContextProvider, { value: props.context, children: jsx(BaseEditor, { ...props }) });
4179
4132
  }
4180
4133
  const GenericDriveExplorer = {
4181
- Component: Editor
4134
+ Component: Editor,
4135
+ documentTypes: ["powerhouse/document-drive"],
4136
+ config: {
4137
+ id: "GenericDriveExplorer",
4138
+ disableExternalControls: true,
4139
+ documentToolbarEnabled: true,
4140
+ showSwitchboardLink: true
4141
+ }
4182
4142
  };
4183
4143
  function useAnalyticsQueryWrapper(options) {
4184
4144
  const { queryFn, ...queryOptions } = options;
@@ -5061,7 +5021,7 @@ function Content() {
5061
5021
  }, [selectedDriveNode, selectedNode, addFile]);
5062
5022
  useEffect(() => {
5063
5023
  if ((status === "LOADED" || status === "ERROR") && !documentDrives.find(
5064
- (d) => d.state.global.id === driveId || d.slug === driveId || d.state.global.name === driveId
5024
+ (d) => d.id === driveId || d.slug === driveId || d.state.global.name === driveId
5065
5025
  )) {
5066
5026
  toast(/* @__PURE__ */ jsxs("p", { children: [
5067
5027
  "Drive ",
@@ -5076,4 +5036,4 @@ function Content() {
5076
5036
  export {
5077
5037
  Content as default
5078
5038
  };
5079
- //# sourceMappingURL=content-Ch_VzBZ4.js.map
5039
+ //# sourceMappingURL=content-B0W_DYic.js.map