@powerhousedao/connect 1.0.29-staging.0 → 1.0.29-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{app-DOWyCHY9.js → app-2f8NgcMB.js} +20 -27
- package/dist/assets/{app-DOWyCHY9.js.map → app-2f8NgcMB.js.map} +1 -1
- package/dist/assets/{app-Di6g_N6F.css → app-COfEByKR.css} +1 -1
- package/dist/assets/{app-loader-BFaCwOJN.js → app-loader-CvX4GbRQ.js} +5 -5
- package/dist/assets/{app-loader-BFaCwOJN.js.map → app-loader-CvX4GbRQ.js.map} +1 -1
- package/dist/assets/{browser-wGML-xFV.js → browser-BUsw7JcX.js} +4 -4
- package/dist/assets/{browser-wGML-xFV.js.map → browser-BUsw7JcX.js.map} +1 -1
- package/dist/assets/{ccip-ci64ReMe.js → ccip-DYXeWSkm.js} +4 -4
- package/dist/assets/{ccip-ci64ReMe.js.map → ccip-DYXeWSkm.js.map} +1 -1
- package/dist/assets/{content-CB2GmXm2.js → content-CCy41Oo9.js} +8 -166
- package/dist/assets/{content-CB2GmXm2.js.map → content-CCy41Oo9.js.map} +1 -1
- package/dist/assets/{index-1KpVBeli.js → index-BRKlEURx.js} +4 -4
- package/dist/assets/{index-1KpVBeli.js.map → index-BRKlEURx.js.map} +1 -1
- package/dist/assets/{index-BvPdIQG_.js → index-C_YFOkHu.js} +4 -4
- package/dist/assets/{index-BvPdIQG_.js.map → index-C_YFOkHu.js.map} +1 -1
- package/dist/assets/{index-C-h-LtO7.js → index-Ciq50mHH.js} +4 -4
- package/dist/assets/{index-C-h-LtO7.js.map → index-Ciq50mHH.js.map} +1 -1
- package/dist/assets/{index-Bt63yYdA.js → index-D4gN1KN8.js} +5 -5
- package/dist/assets/{index-Bt63yYdA.js.map → index-D4gN1KN8.js.map} +1 -1
- package/dist/assets/{main.j3kGOMFP.js → main.CI_-BxOS.js} +2 -2
- package/dist/assets/{main.j3kGOMFP.js.map → main.CI_-BxOS.js.map} +1 -1
- package/dist/assets/{reactor-analytics-DgIGj3MX.js → reactor-analytics-DKH6CL5y.js} +6 -6
- package/dist/assets/{reactor-analytics-DgIGj3MX.js.map → reactor-analytics-DKH6CL5y.js.map} +1 -1
- package/dist/assets/{router-CWb_fOjv.js → router-wXMSoHrg.js} +6 -6
- package/dist/assets/{router-CWb_fOjv.js.map → router-wXMSoHrg.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/vite-envs.sh +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { aM as BaseError, aN as getUrl, aO as stringify, aP as decodeErrorResult, aQ as isAddressEqual, aR as localBatchGatewayUrl, aS as localBatchGatewayRequest, aT as call, aU as concat, aV as encodeAbiParameters, aW as HttpRequestError, aX as isHex } from "./app-
|
|
2
|
-
import "./main.
|
|
1
|
+
import { aM as BaseError, aN as getUrl, aO as stringify, aP as decodeErrorResult, aQ as isAddressEqual, aR as localBatchGatewayUrl, aS as localBatchGatewayRequest, aT as call, aU as concat, aV as encodeAbiParameters, aW as HttpRequestError, aX as isHex } from "./app-2f8NgcMB.js";
|
|
2
|
+
import "./main.CI_-BxOS.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./app-loader-
|
|
5
|
+
import "./app-loader-CvX4GbRQ.js";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
class OffchainLookupError extends BaseError {
|
|
8
8
|
constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
|
|
@@ -165,4 +165,4 @@ export {
|
|
|
165
165
|
offchainLookupAbiItem,
|
|
166
166
|
offchainLookupSignature
|
|
167
167
|
};
|
|
168
|
-
//# sourceMappingURL=ccip-
|
|
168
|
+
//# sourceMappingURL=ccip-DYXeWSkm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ccip-
|
|
1
|
+
{"version":3,"file":"ccip-DYXeWSkm.js","sources":["../../../../node_modules/.pnpm/viem@2.29.0_bufferutil@4.0.9_typescript@5.7.3_utf-8-validate@5.0.10_zod@3.24.4/node_modules/viem/_esm/errors/ccip.js","../../../../node_modules/.pnpm/viem@2.29.0_bufferutil@4.0.9_typescript@5.7.3_utf-8-validate@5.0.10_zod@3.24.4/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 { localBatchGatewayRequest, localBatchGatewayUrl, } from './ens/localBatchGatewayRequest.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 = urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({\n data: callData,\n ccipRequest: ccipRequest_,\n })\n : 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.toLowerCase()).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,UAAM,8EAA8E;AAAA,MAChF,cAAc;AAAA,QACV,gBAAgB,OAAO,GAAG,CAAC;AAAA,QAC3B,aAAa,UAAU,MAAM,CAAC;AAAA,MACjC;AAAA,MACD,MAAM;AAAA,IAClB,CAAS;AAAA,EACT;AACA;AACO,MAAM,0CAA0C,UAAU;AAAA,EAC7D,YAAY,EAAE,QAAQ,M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AI,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
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { useState, useCallback, useMemo, useEffect, Fragment, useRef, useLayoutEffect, memo as memo$1, createElement, useSyncExternalStore, Suspense } from "react";
|
|
4
|
-
import { t as twMerge, B as Button, aY as mergeClassNameProps, I as Icon, aZ as getDimensions, a_ as useDocumentDrives, h as useUiNodesContext, a$ as useDriveContext, b0 as FILE, G as ERROR, b1 as MISSING, C as CONFLICT, S as SUCCESS, b2 as SYNCING, b3 as INITIAL_SYNC, b4 as READ, b5 as nodeOptionsMap, b6 as defaultFileOptions, b7 as ConnectDropdownMenu, b8 as DELETE, b9 as RENAME, ba as WRITE, bb as DUPLICATE, bc as defaultFolderOptions, bd as useOnClickOutside, be as useEventListener, bf as useCopyToClipboard, bg as Select, bh as Provider, bi as Root3, bj as Trigger, bk as Portal, bl as Content2, bm as UI_NODE, D as DRIVE, F as FILE$1, bn as validateInitialState, bo as validateStateSchemaName, bp as validateModules, e as useDocumentDriveServer, K as useUnwrappedReactor, bq as useConnectDid, br as useConnectCrypto, w as useTranslation, f as useModal, bs as useAtomValue, bt as themeAtom, bu as useUser, bv as useUserPermissions$1, bw as useFileNodeDocument, bx as useGetDocumentModelModule, by as exportFile, bz as addActionContext$1, bA as signOperation$1, bB as useHotkeys, bC as FOLDER, bD as DriveLayout, bE as DriveContextProvider, bF as SearchBar,
|
|
5
|
-
import { ab as buildSignedOperation, am as generateId$1, aw as isFolderNode, aA as generateNodesCopy, aB as copyNode, az as moveNode, ay as updateNode, ax as deleteNode, ar as generateAddNodeAction, as as isFileNode, av as addFolder, bN as garbageCollect, bO as sortOperations, bP as LZString, bQ as undo, bR as redo, _ as logger, bS as openUrl, bT as useDocumentDispatch$1, aj as module, af as connectConfig } from "./app-loader-
|
|
6
|
-
import { E as ENSAvatar, a as ErrorBoundary, t as toast } from "./router-
|
|
4
|
+
import { t as twMerge, B as Button, aY as mergeClassNameProps, I as Icon, aZ as getDimensions, a_ as useDocumentDrives, h as useUiNodesContext, a$ as useDriveContext, b0 as FILE, G as ERROR, b1 as MISSING, C as CONFLICT, S as SUCCESS, b2 as SYNCING, b3 as INITIAL_SYNC, b4 as READ, b5 as nodeOptionsMap, b6 as defaultFileOptions, b7 as ConnectDropdownMenu, b8 as DELETE, b9 as RENAME, ba as WRITE, bb as DUPLICATE, bc as defaultFolderOptions, bd as useOnClickOutside, be as useEventListener, bf as useCopyToClipboard, bg as Select, bh as Provider, bi as Root3, bj as Trigger, bk as Portal, bl as Content2, bm as UI_NODE, D as DRIVE, F as FILE$1, bn as validateInitialState, bo as validateStateSchemaName, bp as validateModules, e as useDocumentDriveServer, K as useUnwrappedReactor, bq as useConnectDid, br as useConnectCrypto, w as useTranslation, f as useModal, bs as useAtomValue, bt as themeAtom, bu as useUser, bv as useUserPermissions$1, bw as useFileNodeDocument, bx as useGetDocumentModelModule, by as exportFile, bz as addActionContext$1, bA as signOperation$1, bB as useHotkeys, bC as FOLDER, bD as DriveLayout, bE as DriveContextProvider, bF as SearchBar, bG as useGetEditor, bH as isSameDocument, v as useNavigate, z as useAsyncReactor, bI as useFilteredDocumentModels, bJ as useDriveEditor, J as useParams, x as useDocumentDrives$1 } from "./app-2f8NgcMB.js";
|
|
5
|
+
import { ab as buildSignedOperation, am as generateId$1, aw as isFolderNode, aA as generateNodesCopy, aB as copyNode, az as moveNode, ay as updateNode, ax as deleteNode, ar as generateAddNodeAction, as as isFileNode, av as addFolder, bN as garbageCollect, bO as sortOperations, bP as LZString, bQ as undo, bR as redo, _ as logger, bS as openUrl, bT as useDocumentDispatch$1, aj as module, af as connectConfig } from "./app-loader-CvX4GbRQ.js";
|
|
6
|
+
import { E as ENSAvatar, a as ErrorBoundary, t as toast } from "./router-wXMSoHrg.js";
|
|
7
7
|
import { flushSync } from "react-dom";
|
|
8
|
-
import "./main.
|
|
8
|
+
import "./main.CI_-BxOS.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 });
|
|
@@ -4310,163 +4310,6 @@ function Editor(props) {
|
|
|
4310
4310
|
const GenericDriveExplorer = {
|
|
4311
4311
|
Component: Editor
|
|
4312
4312
|
};
|
|
4313
|
-
function useAnalyticsQueryWrapper(options) {
|
|
4314
|
-
const { queryFn, ...queryOptions } = options;
|
|
4315
|
-
const store = useAnalyticsStore();
|
|
4316
|
-
const engine = useAnalyticsEngine();
|
|
4317
|
-
return useQuery({
|
|
4318
|
-
...queryOptions,
|
|
4319
|
-
queryFn: () => {
|
|
4320
|
-
if (!store || !engine) {
|
|
4321
|
-
throw new Error("No analytics store available. Use within an AnalyticsProvider.");
|
|
4322
|
-
}
|
|
4323
|
-
return queryFn({ store, engine });
|
|
4324
|
-
}
|
|
4325
|
-
});
|
|
4326
|
-
}
|
|
4327
|
-
function useAnalyticsQuery(query, options) {
|
|
4328
|
-
const store = useAnalyticsStore();
|
|
4329
|
-
const { data: querySources } = useQuerySources(query);
|
|
4330
|
-
const queryClient = useQueryClient();
|
|
4331
|
-
const subscriptions = useRef([]);
|
|
4332
|
-
const result = useAnalyticsQueryWrapper({
|
|
4333
|
-
queryKey: ["analytics", "query", query],
|
|
4334
|
-
queryFn: ({ engine }) => engine.execute(query),
|
|
4335
|
-
...options
|
|
4336
|
-
});
|
|
4337
|
-
useEffect(() => {
|
|
4338
|
-
if (!(querySources == null ? void 0 : querySources.length) || !store) {
|
|
4339
|
-
return;
|
|
4340
|
-
}
|
|
4341
|
-
querySources.forEach((source) => {
|
|
4342
|
-
const unsub = store.subscribeToSource(source, () => {
|
|
4343
|
-
return queryClient.invalidateQueries({
|
|
4344
|
-
queryKey: ["analytics", "query", query]
|
|
4345
|
-
});
|
|
4346
|
-
});
|
|
4347
|
-
subscriptions.current.push(unsub);
|
|
4348
|
-
});
|
|
4349
|
-
return () => {
|
|
4350
|
-
subscriptions.current.forEach((unsub) => unsub());
|
|
4351
|
-
subscriptions.current = [];
|
|
4352
|
-
};
|
|
4353
|
-
}, [querySources]);
|
|
4354
|
-
return result;
|
|
4355
|
-
}
|
|
4356
|
-
function useMatchingSeries(query, options) {
|
|
4357
|
-
const result = useAnalyticsQueryWrapper({
|
|
4358
|
-
queryKey: ["analytics", "matchingSeries", query],
|
|
4359
|
-
queryFn: ({ store }) => store.getMatchingSeries(query),
|
|
4360
|
-
...options
|
|
4361
|
-
});
|
|
4362
|
-
return result;
|
|
4363
|
-
}
|
|
4364
|
-
function useQuerySources(query, options) {
|
|
4365
|
-
const { data: matchingSeries } = useMatchingSeries(query);
|
|
4366
|
-
return useQuery({
|
|
4367
|
-
queryKey: ["analytics", "sources", query],
|
|
4368
|
-
queryFn: () => {
|
|
4369
|
-
if (!(matchingSeries == null ? void 0 : matchingSeries.length)) {
|
|
4370
|
-
return [];
|
|
4371
|
-
}
|
|
4372
|
-
const uniqueSources = [
|
|
4373
|
-
...new Set(matchingSeries.map((s) => s.source.toString()))
|
|
4374
|
-
];
|
|
4375
|
-
return uniqueSources.map((source) => AnalyticsPath.fromString(source));
|
|
4376
|
-
},
|
|
4377
|
-
enabled: !!matchingSeries,
|
|
4378
|
-
...options
|
|
4379
|
-
});
|
|
4380
|
-
}
|
|
4381
|
-
const getBarSize = (value) => {
|
|
4382
|
-
if (value <= 0)
|
|
4383
|
-
return 0;
|
|
4384
|
-
if (value > 0 && value <= 50)
|
|
4385
|
-
return 1;
|
|
4386
|
-
if (value > 50 && value <= 100)
|
|
4387
|
-
return 2;
|
|
4388
|
-
if (value > 100 && value <= 250)
|
|
4389
|
-
return 3;
|
|
4390
|
-
return 4;
|
|
4391
|
-
};
|
|
4392
|
-
const useTimelineItems = (documentId, startTimestamp) => {
|
|
4393
|
-
const start = startTimestamp ? DateTime.fromISO(startTimestamp) : DateTime.now().startOf("day");
|
|
4394
|
-
const { data: diffResult, isLoading } = useAnalyticsQuery({
|
|
4395
|
-
start,
|
|
4396
|
-
end: DateTime.now().endOf("day"),
|
|
4397
|
-
granularity: AnalyticsGranularity.Hourly,
|
|
4398
|
-
metrics: ["Count"],
|
|
4399
|
-
select: {
|
|
4400
|
-
changes: [AnalyticsPath.fromString(`changes`)],
|
|
4401
|
-
document: [AnalyticsPath.fromString(`document/${documentId}`)]
|
|
4402
|
-
},
|
|
4403
|
-
lod: {
|
|
4404
|
-
changes: 2
|
|
4405
|
-
},
|
|
4406
|
-
currency: AnalyticsPath.fromString("")
|
|
4407
|
-
});
|
|
4408
|
-
const mappedResult = useMemo(() => {
|
|
4409
|
-
if (!diffResult)
|
|
4410
|
-
return [];
|
|
4411
|
-
return diffResult.sort((a, b) => {
|
|
4412
|
-
const aDate = new Date(a.start);
|
|
4413
|
-
const bDate = new Date(b.start);
|
|
4414
|
-
return aDate.getTime() - bDate.getTime();
|
|
4415
|
-
}).filter((result) => {
|
|
4416
|
-
return result.rows.every((row) => row.value > 0);
|
|
4417
|
-
}).map((result) => {
|
|
4418
|
-
const { additions, deletions } = result.rows.reduce((acc, row) => {
|
|
4419
|
-
if (row.dimensions.changes.path === "changes/add") {
|
|
4420
|
-
acc.additions += row.value;
|
|
4421
|
-
} else if (row.dimensions.changes.path === "changes/remove") {
|
|
4422
|
-
acc.deletions += row.value;
|
|
4423
|
-
}
|
|
4424
|
-
return acc;
|
|
4425
|
-
}, { additions: 0, deletions: 0 });
|
|
4426
|
-
const startDate = new Date(result.start);
|
|
4427
|
-
return {
|
|
4428
|
-
id: startDate.toISOString(),
|
|
4429
|
-
type: "bar",
|
|
4430
|
-
addSize: getBarSize(additions),
|
|
4431
|
-
delSize: getBarSize(deletions),
|
|
4432
|
-
additions,
|
|
4433
|
-
deletions,
|
|
4434
|
-
timestamp: startDate.toISOString(),
|
|
4435
|
-
startDate,
|
|
4436
|
-
endDate: new Date(result.end),
|
|
4437
|
-
revision: 0
|
|
4438
|
-
};
|
|
4439
|
-
});
|
|
4440
|
-
}, [diffResult]);
|
|
4441
|
-
const resultWithDividers = useMemo(() => {
|
|
4442
|
-
if (!mappedResult.length)
|
|
4443
|
-
return [];
|
|
4444
|
-
const result = [];
|
|
4445
|
-
mappedResult.forEach((item, index) => {
|
|
4446
|
-
result.push(item);
|
|
4447
|
-
if (index < mappedResult.length - 1) {
|
|
4448
|
-
const currentDate = new Date(item.startDate);
|
|
4449
|
-
const nextDate = new Date(mappedResult[index + 1].startDate);
|
|
4450
|
-
const currentHour = currentDate.getHours();
|
|
4451
|
-
const nextHour = nextDate.getHours();
|
|
4452
|
-
const currentDay = currentDate.toDateString();
|
|
4453
|
-
const nextDay = nextDate.toDateString();
|
|
4454
|
-
if (currentDay !== nextDay || currentDay === nextDay && Math.abs(nextHour - currentHour) > 1) {
|
|
4455
|
-
result.push({
|
|
4456
|
-
id: `divider-${item.id}-${mappedResult[index + 1].id}`,
|
|
4457
|
-
type: "divider",
|
|
4458
|
-
revision: 0
|
|
4459
|
-
});
|
|
4460
|
-
}
|
|
4461
|
-
}
|
|
4462
|
-
});
|
|
4463
|
-
return result;
|
|
4464
|
-
}, [mappedResult]);
|
|
4465
|
-
return {
|
|
4466
|
-
isLoading,
|
|
4467
|
-
data: resultWithDividers
|
|
4468
|
-
};
|
|
4469
|
-
};
|
|
4470
4313
|
const getRevisionFromDate = (startDate, endDate, operations = []) => {
|
|
4471
4314
|
if (!startDate || !endDate)
|
|
4472
4315
|
return 0;
|
|
@@ -4533,10 +4376,9 @@ const DocumentEditor = (props) => {
|
|
|
4533
4376
|
[theme, user]
|
|
4534
4377
|
);
|
|
4535
4378
|
const userPermissions = useUserPermissions$1();
|
|
4536
|
-
const timelineItems =
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
);
|
|
4379
|
+
const timelineItems = {
|
|
4380
|
+
data: []
|
|
4381
|
+
};
|
|
4540
4382
|
const currentDocument = useRef({ ...fileNodeDocument, document: document2 });
|
|
4541
4383
|
useEffect(() => {
|
|
4542
4384
|
var _a;
|
|
@@ -5210,4 +5052,4 @@ function Content() {
|
|
|
5210
5052
|
export {
|
|
5211
5053
|
Content as default
|
|
5212
5054
|
};
|
|
5213
|
-
//# sourceMappingURL=content-
|
|
5055
|
+
//# sourceMappingURL=content-CCy41Oo9.js.map
|