@powerhousedao/connect 1.0.3-dev.0 → 1.0.4-dev.0
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/LICENSE +661 -0
- package/dist/assets/{app-D9QJBr8i.css → app-CYjeY4R-.css} +113 -50
- package/dist/assets/{app-BYkaiTES.js → app-DRGUnpgP.js} +2098 -1018
- package/dist/assets/{app-loader-Bnp0H-wa.css → app-loader-DC8DXqh9.css} +129 -18
- package/dist/assets/{app-loader-Bkg_WUos.js → app-loader-q6UCPwaf.js} +210 -185
- package/dist/assets/{ccip-Dn5Ob09y.js → ccip-BMVv2Emt.js} +3 -3
- package/dist/assets/{content-DcF7YyCb.js → content-CVGL3ZO5.js} +36 -6
- package/dist/assets/{index-CBIcU4C0.js → index-Bn8-eDIz.js} +670 -519
- package/dist/assets/{index-B62Phyap.js → index-BsB1NVuP.js} +3 -3
- package/dist/assets/{index-zVQzC6z2.js → index-CR5B5rEB.js} +4 -4
- package/dist/assets/{main.CgKmK6gL.js → main.DL5ahUYG.js} +1 -1
- package/dist/assets/{style-D4JhTt_m.css → style-Ce3V83BE.css} +31 -36
- package/dist/hmr.js +1 -1
- package/dist/index.html +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-G6LMXRY5.js → chunk-2ONJ2PX4.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-XXFOSD4A.js → chunk-6MBHOHAA.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-FW7N6EJH.js → chunk-C7QRY43M.js} +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-45DCPCA7.js → chunk-CO2RVWYY.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-YDERCA5J.js → chunk-IC6B3767.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-A4GIWVYS.js → chunk-N5UNGAA6.js} +94 -74
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-F3RCGUF6.js → chunk-NHD6VUCD.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-UP4DC4D2.js → chunk-OYYVE7RP.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-M2UUQ5LH.js → chunk-U34SEKEB.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-PQ4UODLR.js → chunk-UDKYG6I4.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/context/index.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +8 -8
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +5 -5
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/index.js +10 -10
- package/dist/modules/@powerhousedao/reactor-browser/reactor.js +2 -2
- package/dist/vite-envs.sh +1 -1
- package/package.json +9 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-
|
|
2
|
-
import { _ as __vitePreload } from "./main.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-q6UCPwaf.js","assets/main.DL5ahUYG.js","assets/app-loader-DC8DXqh9.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { _ as __vitePreload } from "./main.DL5ahUYG.js";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
async function renderApp(element) {
|
|
5
|
-
const AppLoader = await __vitePreload(() => import("./app-loader-
|
|
5
|
+
const AppLoader = await __vitePreload(() => import("./app-loader-q6UCPwaf.js").then((n) => n.c9), 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.
|
|
14
|
-
import { aW as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-
|
|
15
|
-
import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-
|
|
16
|
-
import { d, c, b, f, a, r, s } from "./app-
|
|
13
|
+
import { _ as __vitePreload } from "./main.DL5ahUYG.js";
|
|
14
|
+
import { aW as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-q6UCPwaf.js";
|
|
15
|
+
import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-DRGUnpgP.js";
|
|
16
|
+
import { d, c, b, f, a, r, s } from "./app-DRGUnpgP.js";
|
|
17
17
|
import "react/jsx-runtime";
|
|
18
18
|
import "react";
|
|
19
19
|
import "@powerhousedao/reactor-browser";
|
|
@@ -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-
|
|
102
|
+
__vitePreload(() => import("./index-BsB1NVuP.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.
|
|
3
|
+
/*! tailwindcss v4.0.17 | MIT License | https://tailwindcss.com */
|
|
4
4
|
:root {
|
|
5
5
|
--toastify-color-light: #fff;
|
|
6
6
|
--toastify-color-dark: #121212;
|
|
@@ -687,9 +687,6 @@
|
|
|
687
687
|
@layer theme, base, components, utilities;
|
|
688
688
|
@layer theme {
|
|
689
689
|
:root, :host {
|
|
690
|
-
--font-sans: "Inter", sans-serif;
|
|
691
|
-
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
692
|
-
"Courier New", monospace;
|
|
693
690
|
--color-red-800: hsl(5 81% 61%);
|
|
694
691
|
--color-red-900: hsl(5 81% 56%);
|
|
695
692
|
--color-slate-50: hsl(210 20% 96%);
|
|
@@ -721,18 +718,6 @@
|
|
|
721
718
|
--radius-3xl: 1.5rem;
|
|
722
719
|
--default-transition-duration: 150ms;
|
|
723
720
|
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
724
|
-
--default-font-family: var(--font-sans);
|
|
725
|
-
--default-font-feature-settings: var(--font-sans--font-feature-settings);
|
|
726
|
-
--default-font-variation-settings: var(
|
|
727
|
-
--font-sans--font-variation-settings
|
|
728
|
-
);
|
|
729
|
-
--default-mono-font-family: var(--font-mono);
|
|
730
|
-
--default-mono-font-feature-settings: var(
|
|
731
|
-
--font-mono--font-feature-settings
|
|
732
|
-
);
|
|
733
|
-
--default-mono-font-variation-settings: var(
|
|
734
|
-
--font-mono--font-variation-settings
|
|
735
|
-
);
|
|
736
721
|
}
|
|
737
722
|
}
|
|
738
723
|
@layer base {
|
|
@@ -746,14 +731,11 @@
|
|
|
746
731
|
line-height: 1.5;
|
|
747
732
|
-webkit-text-size-adjust: 100%;
|
|
748
733
|
tab-size: 4;
|
|
749
|
-
font-family:
|
|
750
|
-
font-feature-settings:
|
|
751
|
-
font-variation-settings:
|
|
734
|
+
font-family: "Inter", sans-serif;
|
|
735
|
+
font-feature-settings: initial;
|
|
736
|
+
font-variation-settings: initial;
|
|
752
737
|
-webkit-tap-highlight-color: transparent;
|
|
753
738
|
}
|
|
754
|
-
body {
|
|
755
|
-
line-height: inherit;
|
|
756
|
-
}
|
|
757
739
|
hr {
|
|
758
740
|
height: 0;
|
|
759
741
|
color: inherit;
|
|
@@ -776,9 +758,10 @@
|
|
|
776
758
|
font-weight: bolder;
|
|
777
759
|
}
|
|
778
760
|
code, kbd, samp, pre {
|
|
779
|
-
font-family:
|
|
780
|
-
|
|
781
|
-
font-
|
|
761
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
762
|
+
"Courier New", monospace;
|
|
763
|
+
font-feature-settings: initial;
|
|
764
|
+
font-variation-settings: initial;
|
|
782
765
|
font-size: 1em;
|
|
783
766
|
}
|
|
784
767
|
small {
|
|
@@ -842,7 +825,11 @@
|
|
|
842
825
|
}
|
|
843
826
|
::placeholder {
|
|
844
827
|
opacity: 1;
|
|
845
|
-
|
|
828
|
+
}
|
|
829
|
+
@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
|
|
830
|
+
::placeholder {
|
|
831
|
+
color: color-mix(in oklab, currentColor 50%, transparent);
|
|
832
|
+
}
|
|
846
833
|
}
|
|
847
834
|
textarea {
|
|
848
835
|
resize: vertical;
|
|
@@ -1392,14 +1379,11 @@ input[type="number"] {
|
|
|
1392
1379
|
line-height: 1.5;
|
|
1393
1380
|
-webkit-text-size-adjust: 100%;
|
|
1394
1381
|
tab-size: 4;
|
|
1395
|
-
font-family:
|
|
1396
|
-
font-feature-settings:
|
|
1397
|
-
font-variation-settings:
|
|
1382
|
+
font-family: "Inter", sans-serif;
|
|
1383
|
+
font-feature-settings: initial;
|
|
1384
|
+
font-variation-settings: initial;
|
|
1398
1385
|
-webkit-tap-highlight-color: transparent;
|
|
1399
1386
|
}
|
|
1400
|
-
body {
|
|
1401
|
-
line-height: inherit;
|
|
1402
|
-
}
|
|
1403
1387
|
hr {
|
|
1404
1388
|
height: 0;
|
|
1405
1389
|
color: inherit;
|
|
@@ -1422,9 +1406,10 @@ input[type="number"] {
|
|
|
1422
1406
|
font-weight: bolder;
|
|
1423
1407
|
}
|
|
1424
1408
|
code, kbd, samp, pre {
|
|
1425
|
-
font-family:
|
|
1426
|
-
|
|
1427
|
-
font-
|
|
1409
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
1410
|
+
"Courier New", monospace;
|
|
1411
|
+
font-feature-settings: initial;
|
|
1412
|
+
font-variation-settings: initial;
|
|
1428
1413
|
font-size: 1em;
|
|
1429
1414
|
}
|
|
1430
1415
|
small {
|
|
@@ -1488,7 +1473,11 @@ input[type="number"] {
|
|
|
1488
1473
|
}
|
|
1489
1474
|
::placeholder {
|
|
1490
1475
|
opacity: 1;
|
|
1491
|
-
|
|
1476
|
+
}
|
|
1477
|
+
@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
|
|
1478
|
+
::placeholder {
|
|
1479
|
+
color: color-mix(in oklab, currentColor 50%, transparent);
|
|
1480
|
+
}
|
|
1492
1481
|
}
|
|
1493
1482
|
textarea {
|
|
1494
1483
|
resize: vertical;
|
|
@@ -1523,6 +1512,12 @@ input[type="number"] {
|
|
|
1523
1512
|
}
|
|
1524
1513
|
}
|
|
1525
1514
|
@layer utilities;
|
|
1515
|
+
@layer base {
|
|
1516
|
+
* {
|
|
1517
|
+
scrollbar-color: initial;
|
|
1518
|
+
scrollbar-width: initial;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1526
1521
|
@property --tw-rotate-x {
|
|
1527
1522
|
syntax: "*";
|
|
1528
1523
|
inherits: false;
|
package/dist/hmr.js
CHANGED
package/dist/index.html
CHANGED
|
@@ -94,4 +94,4 @@
|
|
|
94
94
|
"@powerhousedao/reactor-browser/utils/index": "/modules/@powerhousedao/reactor-browser/utils/index.js",
|
|
95
95
|
"@powerhousedao/reactor-browser/utils/signature": "/modules/@powerhousedao/reactor-browser/utils/signature.js"
|
|
96
96
|
}
|
|
97
|
-
}</script><script type="module" crossorigin="" src="/assets/main.
|
|
97
|
+
}</script><script type="module" crossorigin="" src="/assets/main.DL5ahUYG.js"></script></head><body><div id="app"></div></body></html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.
|
|
1
|
+
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.20_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;
|
|
@@ -533,7 +533,7 @@ var INTERNAL_buildStoreRev1 = buildStore;
|
|
|
533
533
|
var INTERNAL_initializeStoreHooks = initializeStoreHooks;
|
|
534
534
|
var INTERNAL_registerAbortHandler = registerAbortHandler;
|
|
535
535
|
|
|
536
|
-
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.
|
|
536
|
+
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.20_react@18.3.1/node_modules/jotai/esm/vanilla.mjs
|
|
537
537
|
var keyCount = 0;
|
|
538
538
|
function atom(read, write) {
|
|
539
539
|
const key = `atom${++keyCount}`;
|
|
@@ -643,7 +643,7 @@ function getDefaultStore() {
|
|
|
643
643
|
return defaultStore;
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
-
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.
|
|
646
|
+
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.20_react@18.3.1/node_modules/jotai/esm/react.mjs
|
|
647
647
|
import ReactExports, { createContext, useContext, useRef, createElement, useReducer, useEffect, useDebugValue, useCallback } from "react";
|
|
648
648
|
var StoreContext = createContext(
|
|
649
649
|
void 0
|
|
@@ -12163,6 +12163,80 @@ var PullResponderTransmitter = class _PullResponderTransmitter {
|
|
|
12163
12163
|
}
|
|
12164
12164
|
};
|
|
12165
12165
|
|
|
12166
|
+
// ../../packages/document-drive/dist/src/server/listener/transmitter/switchboard-push.js
|
|
12167
|
+
var import_json_stringify_deterministic = __toESM(require_lib(), 1);
|
|
12168
|
+
var SYNC_OPS_BATCH_LIMIT = 10;
|
|
12169
|
+
var SwitchboardPushTransmitter = class {
|
|
12170
|
+
targetURL;
|
|
12171
|
+
logger = childLogger([
|
|
12172
|
+
"SwitchboardPushTransmitter",
|
|
12173
|
+
Math.floor(Math.random() * 999).toString()
|
|
12174
|
+
]);
|
|
12175
|
+
constructor(targetURL) {
|
|
12176
|
+
this.targetURL = targetURL;
|
|
12177
|
+
}
|
|
12178
|
+
async transmit(strands, source) {
|
|
12179
|
+
if (source.type === "trigger" && source.trigger.data?.url === this.targetURL) {
|
|
12180
|
+
this.logger.verbose(`Cutting trigger loop from ${this.targetURL}.`);
|
|
12181
|
+
return strands.map((strand) => ({
|
|
12182
|
+
driveId: strand.driveId,
|
|
12183
|
+
documentId: strand.documentId,
|
|
12184
|
+
scope: strand.scope,
|
|
12185
|
+
branch: strand.branch,
|
|
12186
|
+
status: "SUCCESS",
|
|
12187
|
+
revision: strand.operations.at(-1)?.index ?? -1
|
|
12188
|
+
}));
|
|
12189
|
+
}
|
|
12190
|
+
const culledStrands = [];
|
|
12191
|
+
let opsCounter = 0;
|
|
12192
|
+
for (let s = 0; opsCounter <= SYNC_OPS_BATCH_LIMIT && s < strands.length; s++) {
|
|
12193
|
+
const currentStrand = strands.at(s);
|
|
12194
|
+
if (!currentStrand) {
|
|
12195
|
+
break;
|
|
12196
|
+
}
|
|
12197
|
+
const newOps = Math.min(SYNC_OPS_BATCH_LIMIT - opsCounter, currentStrand.operations.length);
|
|
12198
|
+
culledStrands.push({
|
|
12199
|
+
...currentStrand,
|
|
12200
|
+
operations: currentStrand.operations.slice(0, newOps)
|
|
12201
|
+
});
|
|
12202
|
+
opsCounter += newOps;
|
|
12203
|
+
}
|
|
12204
|
+
this.logger.verbose(` Total update: [${strands.map((s) => s.operations.length).join(", ")}] operations`);
|
|
12205
|
+
this.logger.verbose(`Culled update: [${culledStrands.map((s) => s.operations.length).join(", ")}] operations`);
|
|
12206
|
+
try {
|
|
12207
|
+
const { pushUpdates } = await requestGraphql(this.targetURL, gql`
|
|
12208
|
+
mutation pushUpdates($strands: [InputStrandUpdate!]) {
|
|
12209
|
+
pushUpdates(strands: $strands) {
|
|
12210
|
+
driveId
|
|
12211
|
+
documentId
|
|
12212
|
+
scope
|
|
12213
|
+
branch
|
|
12214
|
+
status
|
|
12215
|
+
revision
|
|
12216
|
+
error
|
|
12217
|
+
}
|
|
12218
|
+
}
|
|
12219
|
+
`, {
|
|
12220
|
+
strands: culledStrands.map((strand) => ({
|
|
12221
|
+
...strand,
|
|
12222
|
+
operations: strand.operations.map((op) => ({
|
|
12223
|
+
...op,
|
|
12224
|
+
input: (0, import_json_stringify_deterministic.default)(op.input)
|
|
12225
|
+
}))
|
|
12226
|
+
}))
|
|
12227
|
+
});
|
|
12228
|
+
if (!pushUpdates) {
|
|
12229
|
+
throw new Error("Couldn't update listener revision");
|
|
12230
|
+
}
|
|
12231
|
+
return pushUpdates;
|
|
12232
|
+
} catch (e) {
|
|
12233
|
+
this.logger.error(e);
|
|
12234
|
+
throw e;
|
|
12235
|
+
}
|
|
12236
|
+
return [];
|
|
12237
|
+
}
|
|
12238
|
+
};
|
|
12239
|
+
|
|
12166
12240
|
// ../../packages/document-drive/dist/src/server/types.js
|
|
12167
12241
|
var TransmitterType;
|
|
12168
12242
|
(function(TransmitterType2) {
|
|
@@ -12403,6 +12477,26 @@ var BaseDocumentDriveServer = class {
|
|
|
12403
12477
|
if (this.shouldSyncRemoteDrive(drive)) {
|
|
12404
12478
|
await this.startSyncRemoteDrive(driveId);
|
|
12405
12479
|
}
|
|
12480
|
+
for (const zodListener of drive.state.local.listeners) {
|
|
12481
|
+
if (zodListener.callInfo?.transmitterType === "SwitchboardPush") {
|
|
12482
|
+
const transmitter = new SwitchboardPushTransmitter(zodListener.callInfo?.data ?? "");
|
|
12483
|
+
this.listenerManager.setListener(driveId, {
|
|
12484
|
+
block: zodListener.block,
|
|
12485
|
+
driveId: drive.state.global.id,
|
|
12486
|
+
filter: {
|
|
12487
|
+
branch: zodListener.filter?.branch ?? [],
|
|
12488
|
+
documentId: zodListener.filter?.documentId ?? [],
|
|
12489
|
+
documentType: zodListener.filter?.documentType ?? [],
|
|
12490
|
+
scope: zodListener.filter?.scope ?? []
|
|
12491
|
+
},
|
|
12492
|
+
listenerId: zodListener.listenerId,
|
|
12493
|
+
callInfo: zodListener.callInfo,
|
|
12494
|
+
system: zodListener.system,
|
|
12495
|
+
label: zodListener.label ?? "",
|
|
12496
|
+
transmitter
|
|
12497
|
+
});
|
|
12498
|
+
}
|
|
12499
|
+
}
|
|
12406
12500
|
}
|
|
12407
12501
|
// Delegate synchronization methods to synchronizationManager
|
|
12408
12502
|
getSynchronizationUnits(driveId, documentId, scope, branch, documentType2) {
|
|
@@ -13583,80 +13677,6 @@ var ListenerManager = class _ListenerManager {
|
|
|
13583
13677
|
}
|
|
13584
13678
|
};
|
|
13585
13679
|
|
|
13586
|
-
// ../../packages/document-drive/dist/src/server/listener/transmitter/switchboard-push.js
|
|
13587
|
-
var import_json_stringify_deterministic = __toESM(require_lib(), 1);
|
|
13588
|
-
var SYNC_OPS_BATCH_LIMIT = 10;
|
|
13589
|
-
var SwitchboardPushTransmitter = class {
|
|
13590
|
-
targetURL;
|
|
13591
|
-
logger = childLogger([
|
|
13592
|
-
"SwitchboardPushTransmitter",
|
|
13593
|
-
Math.floor(Math.random() * 999).toString()
|
|
13594
|
-
]);
|
|
13595
|
-
constructor(targetURL) {
|
|
13596
|
-
this.targetURL = targetURL;
|
|
13597
|
-
}
|
|
13598
|
-
async transmit(strands, source) {
|
|
13599
|
-
if (source.type === "trigger" && source.trigger.data?.url === this.targetURL) {
|
|
13600
|
-
this.logger.verbose(`Cutting trigger loop from ${this.targetURL}.`);
|
|
13601
|
-
return strands.map((strand) => ({
|
|
13602
|
-
driveId: strand.driveId,
|
|
13603
|
-
documentId: strand.documentId,
|
|
13604
|
-
scope: strand.scope,
|
|
13605
|
-
branch: strand.branch,
|
|
13606
|
-
status: "SUCCESS",
|
|
13607
|
-
revision: strand.operations.at(-1)?.index ?? -1
|
|
13608
|
-
}));
|
|
13609
|
-
}
|
|
13610
|
-
const culledStrands = [];
|
|
13611
|
-
let opsCounter = 0;
|
|
13612
|
-
for (let s = 0; opsCounter <= SYNC_OPS_BATCH_LIMIT && s < strands.length; s++) {
|
|
13613
|
-
const currentStrand = strands.at(s);
|
|
13614
|
-
if (!currentStrand) {
|
|
13615
|
-
break;
|
|
13616
|
-
}
|
|
13617
|
-
const newOps = Math.min(SYNC_OPS_BATCH_LIMIT - opsCounter, currentStrand.operations.length);
|
|
13618
|
-
culledStrands.push({
|
|
13619
|
-
...currentStrand,
|
|
13620
|
-
operations: currentStrand.operations.slice(0, newOps)
|
|
13621
|
-
});
|
|
13622
|
-
opsCounter += newOps;
|
|
13623
|
-
}
|
|
13624
|
-
this.logger.verbose(` Total update: [${strands.map((s) => s.operations.length).join(", ")}] operations`);
|
|
13625
|
-
this.logger.verbose(`Culled update: [${culledStrands.map((s) => s.operations.length).join(", ")}] operations`);
|
|
13626
|
-
try {
|
|
13627
|
-
const { pushUpdates } = await requestGraphql(this.targetURL, gql`
|
|
13628
|
-
mutation pushUpdates($strands: [InputStrandUpdate!]) {
|
|
13629
|
-
pushUpdates(strands: $strands) {
|
|
13630
|
-
driveId
|
|
13631
|
-
documentId
|
|
13632
|
-
scope
|
|
13633
|
-
branch
|
|
13634
|
-
status
|
|
13635
|
-
revision
|
|
13636
|
-
error
|
|
13637
|
-
}
|
|
13638
|
-
}
|
|
13639
|
-
`, {
|
|
13640
|
-
strands: culledStrands.map((strand) => ({
|
|
13641
|
-
...strand,
|
|
13642
|
-
operations: strand.operations.map((op) => ({
|
|
13643
|
-
...op,
|
|
13644
|
-
input: (0, import_json_stringify_deterministic.default)(op.input)
|
|
13645
|
-
}))
|
|
13646
|
-
}))
|
|
13647
|
-
});
|
|
13648
|
-
if (!pushUpdates) {
|
|
13649
|
-
throw new Error("Couldn't update listener revision");
|
|
13650
|
-
}
|
|
13651
|
-
return pushUpdates;
|
|
13652
|
-
} catch (e) {
|
|
13653
|
-
this.logger.error(e);
|
|
13654
|
-
throw e;
|
|
13655
|
-
}
|
|
13656
|
-
return [];
|
|
13657
|
-
}
|
|
13658
|
-
};
|
|
13659
|
-
|
|
13660
13680
|
// ../../packages/document-drive/dist/src/server/listener/transmitter/factory.js
|
|
13661
13681
|
var TransmitterFactory = class {
|
|
13662
13682
|
listenerManager;
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./chunk-IQTSFTNF.js";
|
|
5
5
|
import {
|
|
6
6
|
useAddDebouncedOperations
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CO2RVWYY.js";
|
|
8
8
|
import {
|
|
9
9
|
useConnectCrypto,
|
|
10
10
|
useConnectDid
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2ONJ2PX4.js";
|
|
12
12
|
import {
|
|
13
13
|
useDocumentDispatch
|
|
14
14
|
} from "./chunk-GDP7BUIH.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
atom,
|
|
3
3
|
useAtom
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C7QRY43M.js";
|
|
5
5
|
import {
|
|
6
6
|
documentToHash
|
|
7
7
|
} from "./chunk-P6NJ6IAQ.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
// ../../packages/reactor-browser/dist/src/hooks/useDocumentDrives.js
|
|
10
10
|
import { useMemo, useCallback } from "react";
|
|
11
11
|
|
|
12
|
-
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.
|
|
12
|
+
// ../../node_modules/.pnpm/jotai@2.12.2_@types+react@18.3.20_react@18.3.1/node_modules/jotai/esm/vanilla/utils.mjs
|
|
13
13
|
var RESET = Symbol(
|
|
14
14
|
(import.meta.env ? import.meta.env.MODE : void 0) !== "production" ? "RESET" : ""
|
|
15
15
|
);
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
ReadModeContext,
|
|
4
4
|
ReadModeContextProvider,
|
|
5
5
|
useReadModeContext
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-OYYVE7RP.js";
|
|
7
7
|
import "../chunk-OVGOA2P5.js";
|
|
8
8
|
import "../chunk-P6NJ6IAQ.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-N5UNGAA6.js";
|
|
10
10
|
import "../chunk-FQF4YAVC.js";
|
|
11
11
|
import "../chunk-2ESYSVXG.js";
|
|
12
12
|
export {
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
ReadModeContext,
|
|
3
3
|
ReadModeContextProvider,
|
|
4
4
|
useReadModeContext
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-OYYVE7RP.js";
|
|
6
6
|
import "../chunk-OVGOA2P5.js";
|
|
7
7
|
import "../chunk-P6NJ6IAQ.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-N5UNGAA6.js";
|
|
9
9
|
import "../chunk-FQF4YAVC.js";
|
|
10
10
|
import "../chunk-2ESYSVXG.js";
|
|
11
11
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-DKDARAJS.js";
|
|
2
2
|
import {
|
|
3
3
|
useDriveActionsWithUiNodes
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-IC6B3767.js";
|
|
5
5
|
import {
|
|
6
6
|
useDriveActions
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-UDKYG6I4.js";
|
|
8
8
|
import {
|
|
9
9
|
DriveContextProvider,
|
|
10
10
|
useDriveContext
|
|
@@ -39,25 +39,25 @@ import {
|
|
|
39
39
|
import {
|
|
40
40
|
useDocumentEditor,
|
|
41
41
|
useDocumentEditorProps
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-NHD6VUCD.js";
|
|
43
43
|
import "../chunk-IQTSFTNF.js";
|
|
44
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-CO2RVWYY.js";
|
|
45
45
|
import {
|
|
46
46
|
useConnectCrypto,
|
|
47
47
|
useConnectDid
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-2ONJ2PX4.js";
|
|
49
49
|
import "../chunk-GDP7BUIH.js";
|
|
50
50
|
import {
|
|
51
51
|
documentDrivesInitializedMapAtomFamily,
|
|
52
52
|
drivesToHash,
|
|
53
53
|
useDocumentDrives
|
|
54
|
-
} from "../chunk-
|
|
55
|
-
import "../chunk-
|
|
54
|
+
} from "../chunk-U34SEKEB.js";
|
|
55
|
+
import "../chunk-C7QRY43M.js";
|
|
56
56
|
import {
|
|
57
57
|
useUserPermissions
|
|
58
58
|
} from "../chunk-OVGOA2P5.js";
|
|
59
59
|
import "../chunk-P6NJ6IAQ.js";
|
|
60
|
-
import "../chunk-
|
|
60
|
+
import "../chunk-N5UNGAA6.js";
|
|
61
61
|
import "../chunk-FQF4YAVC.js";
|
|
62
62
|
import "../chunk-YWKVPJNL.js";
|
|
63
63
|
import "../chunk-2X2M6BYG.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAddDebouncedOperations
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-CO2RVWYY.js";
|
|
4
|
+
import "../chunk-U34SEKEB.js";
|
|
5
|
+
import "../chunk-C7QRY43M.js";
|
|
6
6
|
import "../chunk-OVGOA2P5.js";
|
|
7
7
|
import "../chunk-P6NJ6IAQ.js";
|
|
8
8
|
import "../chunk-2ESYSVXG.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useConnectCrypto,
|
|
3
3
|
useConnectDid
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-2ONJ2PX4.js";
|
|
5
|
+
import "../chunk-C7QRY43M.js";
|
|
6
6
|
import "../chunk-YWKVPJNL.js";
|
|
7
7
|
import "../chunk-2X2M6BYG.js";
|
|
8
8
|
import "../chunk-2ESYSVXG.js";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
documentDrivesInitializedMapAtomFamily,
|
|
3
3
|
drivesToHash,
|
|
4
4
|
useDocumentDrives
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-U34SEKEB.js";
|
|
6
|
+
import "../chunk-C7QRY43M.js";
|
|
7
7
|
import "../chunk-P6NJ6IAQ.js";
|
|
8
8
|
import "../chunk-2ESYSVXG.js";
|
|
9
9
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDocumentEditor,
|
|
3
3
|
useDocumentEditorProps
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NHD6VUCD.js";
|
|
5
5
|
import "../chunk-IQTSFTNF.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-CO2RVWYY.js";
|
|
7
|
+
import "../chunk-2ONJ2PX4.js";
|
|
8
8
|
import "../chunk-GDP7BUIH.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-U34SEKEB.js";
|
|
10
|
+
import "../chunk-C7QRY43M.js";
|
|
11
11
|
import "../chunk-OVGOA2P5.js";
|
|
12
12
|
import "../chunk-P6NJ6IAQ.js";
|
|
13
13
|
import "../chunk-FQF4YAVC.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDriveActionsWithUiNodes
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-IC6B3767.js";
|
|
4
|
+
import "../chunk-UDKYG6I4.js";
|
|
5
5
|
import "../chunk-XBTEGV5M.js";
|
|
6
6
|
import "../chunk-RGIB4DD4.js";
|
|
7
7
|
import "../chunk-7OQWVUC5.js";
|
|
8
8
|
import "../chunk-ZL5IPB6D.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-N5UNGAA6.js";
|
|
10
10
|
import "../chunk-FQF4YAVC.js";
|
|
11
11
|
import "../chunk-2ESYSVXG.js";
|
|
12
12
|
export {
|