@powerhousedao/connect 1.0.22-staging.1 → 1.0.23-dev.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/.env +1 -1
- package/dist/assets/{app-CSCydE8J.css → app-D5gNm0Gn.css} +240 -181
- package/dist/assets/{app-BIg_-piZ.js → app-DCtCV8Sz.js} +19842 -18216
- package/dist/assets/app-DCtCV8Sz.js.map +1 -0
- package/dist/assets/{app-loader-mwZgOVwV.js → app-loader-BAEWEx-m.js} +740 -422
- package/dist/assets/app-loader-BAEWEx-m.js.map +1 -0
- package/dist/assets/{app-loader-3ipafc56.css → app-loader-NDVZu4bS.css} +238 -228
- package/dist/assets/browser-BeUBqndM.js +27224 -0
- package/dist/assets/browser-BeUBqndM.js.map +1 -0
- package/dist/assets/{ccip-i-oLVbil.js → ccip-CMd6tRtn.js} +6 -8
- package/dist/assets/ccip-CMd6tRtn.js.map +1 -0
- package/dist/assets/{content-CsEKVDJz.js → content-DsWyfJvF.js} +1105 -463
- package/dist/assets/content-DsWyfJvF.js.map +1 -0
- package/dist/assets/{index-M4h38SB3.js → index-ADsM2QWh.js} +23 -171
- package/dist/assets/index-ADsM2QWh.js.map +1 -0
- package/dist/assets/{index-BOWJSJaO.js → index-CCDoOj0e.js} +4 -3
- package/dist/assets/index-CCDoOj0e.js.map +1 -0
- package/dist/assets/{index-B469WXKP.js → index-CSN0Iyem.js} +615 -830
- package/dist/assets/index-CSN0Iyem.js.map +1 -0
- package/dist/assets/index-Dl8ZqWS0.js +208 -0
- package/dist/assets/index-Dl8ZqWS0.js.map +1 -0
- package/dist/assets/{main.DfFOgz9f.js → main.DW9UCmAK.js} +3 -12
- package/dist/assets/main.DW9UCmAK.js.map +1 -0
- package/dist/assets/reactor-analytics-hlzA2WG5.js +42 -0
- package/dist/assets/reactor-analytics-hlzA2WG5.js.map +1 -0
- package/dist/assets/router-DJRPUFad.js +1585 -0
- package/dist/assets/router-DJRPUFad.js.map +1 -0
- package/dist/assets/{style-0ej1afQi.css → style-CdxGKc2g.css} +39 -95
- package/dist/external-packages.js +1 -0
- package/dist/external-packages.js.map +1 -0
- package/dist/hmr.js +1 -0
- package/dist/hmr.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -0
- package/dist/service-worker.js.map +1 -0
- package/dist/vite-envs.sh +1 -1
- package/package.json +26 -19
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { a3 as AnalyticsPath, a4 as DateTime } from "./app-DCtCV8Sz.js";
|
|
5
|
+
import { ak as childLogger } from "./app-loader-BAEWEx-m.js";
|
|
6
|
+
import "./main.DW9UCmAK.js";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "react";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
function diffDocumentStates(doc1, doc2) {
|
|
11
|
+
const changes = [];
|
|
12
|
+
const globalChanges = diffStateObjects(doc1, doc2, "state.global", "global");
|
|
13
|
+
changes.push(...globalChanges);
|
|
14
|
+
const additions = changes.filter((c) => c.type === "add").length;
|
|
15
|
+
const removals = changes.filter((c) => c.type === "remove").length;
|
|
16
|
+
const changesByScope = {
|
|
17
|
+
global: changes.filter((c) => c.scope === "global")
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
totalChanges: changes.length,
|
|
21
|
+
additions,
|
|
22
|
+
removals,
|
|
23
|
+
changesByScope,
|
|
24
|
+
changes
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function diffStateObjects(obj1, obj2, path, scope) {
|
|
28
|
+
const changes = [];
|
|
29
|
+
if (typeof obj1 !== "object" || typeof obj2 !== "object" || obj1 === null || obj2 === null) {
|
|
30
|
+
if (obj1 !== obj2) {
|
|
31
|
+
if (typeof obj1 === "string" && typeof obj2 === "string") {
|
|
32
|
+
return diffStateStrings(obj1, obj2, path, scope);
|
|
33
|
+
} else {
|
|
34
|
+
changes.push({
|
|
35
|
+
type: "remove",
|
|
36
|
+
path,
|
|
37
|
+
oldValue: obj1,
|
|
38
|
+
scope
|
|
39
|
+
});
|
|
40
|
+
changes.push({
|
|
41
|
+
type: "add",
|
|
42
|
+
path,
|
|
43
|
+
newValue: obj2,
|
|
44
|
+
scope
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return changes;
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
51
|
+
if (obj1.length !== obj2.length) {
|
|
52
|
+
changes.push({
|
|
53
|
+
type: "remove",
|
|
54
|
+
path,
|
|
55
|
+
oldValue: obj1,
|
|
56
|
+
scope
|
|
57
|
+
});
|
|
58
|
+
changes.push({
|
|
59
|
+
type: "add",
|
|
60
|
+
path,
|
|
61
|
+
newValue: obj2,
|
|
62
|
+
scope
|
|
63
|
+
});
|
|
64
|
+
return changes;
|
|
65
|
+
}
|
|
66
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
67
|
+
const elementChanges = diffStateObjects(obj1[i], obj2[i], `${path}[${i}]`, scope);
|
|
68
|
+
changes.push(...elementChanges);
|
|
69
|
+
}
|
|
70
|
+
return changes;
|
|
71
|
+
}
|
|
72
|
+
const obj1Record = obj1;
|
|
73
|
+
const obj2Record = obj2;
|
|
74
|
+
const obj1Keys = Object.keys(obj1Record);
|
|
75
|
+
const obj2Keys = Object.keys(obj2Record);
|
|
76
|
+
for (const key of obj1Keys) {
|
|
77
|
+
if (!(key in obj2Record)) {
|
|
78
|
+
changes.push({
|
|
79
|
+
type: "remove",
|
|
80
|
+
path: `${path}.${key}`,
|
|
81
|
+
oldValue: obj1Record[key],
|
|
82
|
+
scope
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (const key of obj2Keys) {
|
|
87
|
+
if (!(key in obj1Record)) {
|
|
88
|
+
changes.push({
|
|
89
|
+
type: "add",
|
|
90
|
+
path: `${path}.${key}`,
|
|
91
|
+
newValue: obj2Record[key],
|
|
92
|
+
scope
|
|
93
|
+
});
|
|
94
|
+
} else if (obj1Record[key] !== obj2Record[key]) {
|
|
95
|
+
const nestedChanges = diffStateObjects(obj1Record[key], obj2Record[key], `${path}.${key}`, scope);
|
|
96
|
+
changes.push(...nestedChanges);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return changes;
|
|
100
|
+
}
|
|
101
|
+
function diffStateStrings(str1, str2, path, scope) {
|
|
102
|
+
const changes = [];
|
|
103
|
+
const maxLen = Math.max(str1.length, str2.length);
|
|
104
|
+
for (let i = 0; i < maxLen; i++) {
|
|
105
|
+
if (i >= str1.length) {
|
|
106
|
+
changes.push({
|
|
107
|
+
type: "add",
|
|
108
|
+
path: `${path}[${i}]`,
|
|
109
|
+
newValue: str2[i],
|
|
110
|
+
scope
|
|
111
|
+
});
|
|
112
|
+
} else if (i >= str2.length) {
|
|
113
|
+
changes.push({
|
|
114
|
+
type: "remove",
|
|
115
|
+
path: `${path}[${i}]`,
|
|
116
|
+
oldValue: str1[i],
|
|
117
|
+
scope
|
|
118
|
+
});
|
|
119
|
+
} else if (str1[i] !== str2[i]) {
|
|
120
|
+
changes.push({
|
|
121
|
+
type: "remove",
|
|
122
|
+
path: `${path}[${i}]`,
|
|
123
|
+
oldValue: str1[i],
|
|
124
|
+
scope
|
|
125
|
+
});
|
|
126
|
+
changes.push({
|
|
127
|
+
type: "add",
|
|
128
|
+
path: `${path}[${i}]`,
|
|
129
|
+
newValue: str2[i],
|
|
130
|
+
scope
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return changes;
|
|
135
|
+
}
|
|
136
|
+
class DiffAnalyticsProcessor {
|
|
137
|
+
constructor(analyticsStore, logger = childLogger(["processor", "diff-analytics"])) {
|
|
138
|
+
__publicField(this, "analyticsStore");
|
|
139
|
+
__publicField(this, "logger");
|
|
140
|
+
this.analyticsStore = analyticsStore;
|
|
141
|
+
this.logger = logger;
|
|
142
|
+
}
|
|
143
|
+
async onStrands(strands) {
|
|
144
|
+
if (strands.length === 0) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const inputs = [];
|
|
148
|
+
for (const strand of strands) {
|
|
149
|
+
if (strand.operations.length === 0) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const firstOp = strand.operations[0];
|
|
153
|
+
const source = AnalyticsPath.fromString(`ph/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);
|
|
154
|
+
if (firstOp.index === 0) {
|
|
155
|
+
await this.clearSource(source);
|
|
156
|
+
}
|
|
157
|
+
for (const operation of strand.operations) {
|
|
158
|
+
const diff = diffDocumentStates(operation.previousState, operation.state);
|
|
159
|
+
for (const change of diff.changes) {
|
|
160
|
+
inputs.push(this.generateInput(strand.documentId, strand.branch, strand.scope, operation.index, change.type, 1, source, operation.timestamp, change.path));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (inputs.length) {
|
|
165
|
+
await this.analyticsStore.addSeriesValues(inputs);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async onDisconnect() {
|
|
169
|
+
}
|
|
170
|
+
async clearSource(source) {
|
|
171
|
+
try {
|
|
172
|
+
await this.analyticsStore.clearSeriesBySource(source, true);
|
|
173
|
+
} catch (e) {
|
|
174
|
+
this.logger.error("Failed to clear source", e);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
generateInput(documentId, branch, scope, revision, type, value, source, timestamp, path) {
|
|
178
|
+
const dimensions = {};
|
|
179
|
+
const changePath = path.split("[")[0].replaceAll(".", "/");
|
|
180
|
+
dimensions.changes = AnalyticsPath.fromString(`changes/${type}`);
|
|
181
|
+
dimensions.document = AnalyticsPath.fromString(`document/${documentId}/${branch}/${scope}/${revision}`);
|
|
182
|
+
dimensions.path = AnalyticsPath.fromString(`path/${changePath}`);
|
|
183
|
+
return {
|
|
184
|
+
dimensions,
|
|
185
|
+
metric: "Count",
|
|
186
|
+
start: DateTime.fromISO(timestamp),
|
|
187
|
+
source,
|
|
188
|
+
value
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const processorFactory = (module) => (driveId) => {
|
|
193
|
+
return [
|
|
194
|
+
{
|
|
195
|
+
processor: new DiffAnalyticsProcessor(module.analyticsStore),
|
|
196
|
+
filter: {
|
|
197
|
+
branch: ["main"],
|
|
198
|
+
documentId: ["*"],
|
|
199
|
+
scope: ["*"],
|
|
200
|
+
documentType: ["*"]
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
];
|
|
204
|
+
};
|
|
205
|
+
export {
|
|
206
|
+
processorFactory
|
|
207
|
+
};
|
|
208
|
+
//# sourceMappingURL=index-Dl8ZqWS0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Dl8ZqWS0.js","sources":["../../../../node_modules/.pnpm/@powerhousedao+diff-analyzer@0.0.0-dev.4_e50d953f6b9fa2dad90d6e2c4cd047d4/node_modules/@powerhousedao/diff-analyzer/dist/lib/document-diff.js","../../../../node_modules/.pnpm/@powerhousedao+diff-analyzer@0.0.0-dev.4_e50d953f6b9fa2dad90d6e2c4cd047d4/node_modules/@powerhousedao/diff-analyzer/dist/processors/diff-analytics/index.js","../../../../node_modules/.pnpm/@powerhousedao+diff-analyzer@0.0.0-dev.4_e50d953f6b9fa2dad90d6e2c4cd047d4/node_modules/@powerhousedao/diff-analyzer/dist/processors/index.js"],"sourcesContent":["/**\n * Calculates the difference between two document states\n */\nexport function diffDocumentStates(doc1, doc2) {\n const changes = [];\n // Compare global state\n const globalChanges = diffStateObjects(doc1, doc2, \"state.global\", \"global\");\n changes.push(...globalChanges);\n // Count changes by type\n const additions = changes.filter((c) => c.type === \"add\").length;\n const removals = changes.filter((c) => c.type === \"remove\").length;\n // Group changes by scope\n const changesByScope = {\n global: changes.filter((c) => c.scope === \"global\"),\n };\n return {\n totalChanges: changes.length,\n additions,\n removals,\n changesByScope,\n changes,\n };\n}\n/**\n * Recursively compares two state objects and returns a list of changes\n */\nfunction diffStateObjects(obj1, obj2, path, scope) {\n const changes = [];\n // Handle primitive values\n if (typeof obj1 !== \"object\" ||\n typeof obj2 !== \"object\" ||\n obj1 === null ||\n obj2 === null) {\n if (obj1 !== obj2) {\n // Special handling for strings to diff character by character\n if (typeof obj1 === \"string\" && typeof obj2 === \"string\") {\n return diffStateStrings(obj1, obj2, path, scope);\n }\n else {\n // For non-string primitives, treat a change as a remove + add\n changes.push({\n type: \"remove\",\n path,\n oldValue: obj1,\n scope,\n });\n changes.push({\n type: \"add\",\n path,\n newValue: obj2,\n scope,\n });\n }\n }\n return changes;\n }\n // Handle arrays\n if (Array.isArray(obj1) && Array.isArray(obj2)) {\n // Compare array lengths\n if (obj1.length !== obj2.length) {\n // For arrays with different lengths, treat as a remove + add\n changes.push({\n type: \"remove\",\n path,\n oldValue: obj1,\n scope,\n });\n changes.push({\n type: \"add\",\n path,\n newValue: obj2,\n scope,\n });\n return changes;\n }\n // Compare array elements\n for (let i = 0; i < obj1.length; i++) {\n const elementChanges = diffStateObjects(obj1[i], obj2[i], `${path}[${i}]`, scope);\n changes.push(...elementChanges);\n }\n return changes;\n }\n // Handle objects\n const obj1Record = obj1;\n const obj2Record = obj2;\n const obj1Keys = Object.keys(obj1Record);\n const obj2Keys = Object.keys(obj2Record);\n // First, check for removed keys\n for (const key of obj1Keys) {\n if (!(key in obj2Record)) {\n // Key was removed\n changes.push({\n type: \"remove\",\n path: `${path}.${key}`,\n oldValue: obj1Record[key],\n scope,\n });\n }\n }\n // Then, check for added keys and modified values\n for (const key of obj2Keys) {\n if (!(key in obj1Record)) {\n // Key was added\n changes.push({\n type: \"add\",\n path: `${path}.${key}`,\n newValue: obj2Record[key],\n scope,\n });\n }\n else if (obj1Record[key] !== obj2Record[key]) {\n // For object changes, recursively diff the objects\n const nestedChanges = diffStateObjects(obj1Record[key], obj2Record[key], `${path}.${key}`, scope);\n changes.push(...nestedChanges);\n }\n }\n return changes;\n}\n/**\n * Compares two strings character by character and returns a list of changes\n */\nfunction diffStateStrings(str1, str2, path, scope) {\n const changes = [];\n const maxLen = Math.max(str1.length, str2.length);\n for (let i = 0; i < maxLen; i++) {\n if (i >= str1.length) {\n // Addition of new character\n changes.push({\n type: \"add\",\n path: `${path}[${i}]`,\n newValue: str2[i],\n scope,\n });\n }\n else if (i >= str2.length) {\n // Removal of character\n changes.push({\n type: \"remove\",\n path: `${path}[${i}]`,\n oldValue: str1[i],\n scope,\n });\n }\n else if (str1[i] !== str2[i]) {\n // Character changed\n changes.push({\n type: \"remove\",\n path: `${path}[${i}]`,\n oldValue: str1[i],\n scope,\n });\n changes.push({\n type: \"add\",\n path: `${path}[${i}]`,\n newValue: str2[i],\n scope,\n });\n }\n }\n return changes;\n}\n/**\n * Generates analytics data from a state diff summary\n */\nexport function generateStateAnalyticsData(diff) {\n return {\n totalChanges: diff.totalChanges,\n changesByType: {\n add: diff.additions,\n remove: diff.removals,\n },\n changesByScope: {\n global: diff.changesByScope.global.length,\n },\n changePaths: diff.changes.map((c) => c.path),\n };\n}\n","import { AnalyticsPath, } from \"@powerhousedao/analytics-engine-core\";\nimport { DateTime } from \"luxon\";\nimport { diffDocumentStates } from \"../../lib/document-diff.js\";\nimport { childLogger } from \"document-drive\";\nexport class DiffAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"diff-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n const inputs = [];\n for (const strand of strands) {\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n for (const operation of strand.operations) {\n const diff = diffDocumentStates(operation.previousState, operation.state);\n for (const change of diff.changes) {\n inputs.push(this.generateInput(strand.documentId, strand.branch, strand.scope, operation.index, change.type, 1, source, operation.timestamp, change.path));\n }\n }\n }\n if (inputs.length) {\n await this.analyticsStore.addSeriesValues(inputs);\n }\n }\n async onDisconnect() { }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n generateInput(documentId, branch, scope, revision, type, value, source, timestamp, path) {\n const dimensions = {};\n const changePath = path.split(\"[\")[0].replaceAll(\".\", \"/\");\n dimensions.changes = AnalyticsPath.fromString(`changes/${type}`);\n dimensions.document = AnalyticsPath.fromString(`document/${documentId}/${branch}/${scope}/${revision}`);\n dimensions.path = AnalyticsPath.fromString(`path/${changePath}`);\n return {\n dimensions,\n metric: \"Count\",\n start: DateTime.fromISO(timestamp),\n source,\n value,\n };\n }\n}\n","/**\n * This is a scaffold file meant for customization.\n * Delete the file and run the code generator again to have it reset\n */\nimport { DiffAnalyticsProcessor } from \"./diff-analytics/index.js\";\nexport const processorFactory = (module) => (driveId) => {\n return [\n {\n processor: new DiffAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"*\"],\n },\n },\n ];\n};\n"],"names":[],"mappings":";;;;;;;;;AAGO,SAAS,mBAAmB,MAAM,MAAM;AAC3C,QAAM,UAAU,CAAE;AAElB,QAAM,gBAAgB,iBAAiB,MAAM,MAAM,gBAAgB,QAAQ;AAC3E,UAAQ,KAAK,GAAG,aAAa;AAE7B,QAAM,YAAY,QAAQ,OAAO,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE;AAC1D,QAAM,WAAW,QAAQ,OAAO,CAAC,MAAM,E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,MACA;AAAA,IACA;AACQ,QAAI,OAAO,QAAQ;AACf,YAAM,KAAK,eAAe,gBAAgB,MAAM;AAAA,IAC5D;AAAA,EACA;AAAA,EACI,MAAM,eAAe;AAAA,EAAA;AAAA,EACrB,MAAM,YAAY,QAAQ;AACtB,QAAI;AACA,YAAM,KAAK,eAAe,oBAAoB,QAAQ,IAAI;AAAA,IACtE,SACe,GAAG;AACN,WAAK,OAAO,MAAM,0BAA0B,CAAC;AAAA,IACzD;AAAA,EACA;AAAA,EACI,cAAc,YAAY,QAAQ,OAAO,UAAU,MAAM,OAAO,QAAQ,WAAW,MAAM;AACrF,UAAM,aAAa,CAAE;AACrB,UAAM,aAAa,KAAK,MAAM,GAAG,EAAE,CAAC,EAAE,WAAW,KAAK,GAAG;AACzD,eAAW,UAAU,cAAc,WAAW,WAAW,IAAI,EAAE;AAC/D,eAAW,WAAW,cAAc,WAAW,YAAY,UAAU,IAAI,MAAM,IAAI,KAAK,IAAI,QAAQ,EAAE;AACtG,eAAW,OAAO,cAAc,WAAW,QAAQ,UAAU,EAAE;AAC/D,WAAO;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,MACR,OAAO,SAAS,QAAQ,SAAS;AAAA,MACjC;AAAA,MACA;AAAA,IACH;AAAA,EACT;AACA;ACvDY,MAAC,mBAAmB,CAAC,WAAW,CAAC,YAAY;AACrD,SAAO;AAAA,IACH;AAAA,MACI,WAAW,IAAI,uBAAuB,OAAO,cAAc;AAAA,MAC3D,QAAQ;AAAA,QACJ,QAAQ,CAAC,MAAM;AAAA,QACf,YAAY,CAAC,GAAG;AAAA,QAChB,OAAO,CAAC,GAAG;AAAA,QACX,cAAc,CAAC,GAAG;AAAA,MACrB;AAAA,IACJ;AAAA,EACJ;AACL;","x_google_ignoreList":[0,1,2]}
|
|
@@ -43,22 +43,12 @@ const seen = {};
|
|
|
43
43
|
const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
44
44
|
let promise = Promise.resolve();
|
|
45
45
|
if (deps && deps.length > 0) {
|
|
46
|
-
let allSettled2 = function(promises) {
|
|
47
|
-
return Promise.all(
|
|
48
|
-
promises.map(
|
|
49
|
-
(p) => Promise.resolve(p).then(
|
|
50
|
-
(value) => ({ status: "fulfilled", value }),
|
|
51
|
-
(reason) => ({ status: "rejected", reason })
|
|
52
|
-
)
|
|
53
|
-
)
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
46
|
document.getElementsByTagName("link");
|
|
57
47
|
const cspNonceMeta = document.querySelector(
|
|
58
48
|
"meta[property=csp-nonce]"
|
|
59
49
|
);
|
|
60
50
|
const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
|
|
61
|
-
promise =
|
|
51
|
+
promise = Promise.allSettled(
|
|
62
52
|
deps.map((dep) => {
|
|
63
53
|
dep = assetsURL(dep);
|
|
64
54
|
if (dep in seen) return;
|
|
@@ -109,7 +99,8 @@ const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
|
109
99
|
return baseModule().catch(handlePreloadError);
|
|
110
100
|
});
|
|
111
101
|
};
|
|
112
|
-
__vitePreload(() => import("./index-
|
|
102
|
+
__vitePreload(() => import("./index-CCDoOj0e.js"), true ? [] : void 0);
|
|
113
103
|
export {
|
|
114
104
|
__vitePreload as _
|
|
115
105
|
};
|
|
106
|
+
//# sourceMappingURL=main.DW9UCmAK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA8BA,OAAO,qBAAY","names":[],"ignoreList":[],"sources":["../../src/renderer.ts"],"sourcesContent":["/**\n * This file will automatically be loaded by vite and run in the \"renderer\" context.\n * To learn more about the differences between the \"main\" and the \"renderer\" context in\n * Electron, visit:\n *\n * https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes\n *\n * By default, Node.js integration in this file is disabled. When enabling Node.js integration\n * in a renderer process, please be aware of potential security implications. You can read\n * more about security risks here:\n *\n * https://electronjs.org/docs/tutorial/security\n *\n * To enable Node.js integration in this file, open up `main.js` and enable the `nodeIntegration`\n * flag:\n *\n * ```\n * // Create the browser window.\n * mainWindow = new BrowserWindow({\n * width: 800,\n * height: 600,\n * webPreferences: {\n * nodeIntegration: true\n * }\n * });\n * ```\n */\n\n// splits app code into separate chunk to avoid circular dependencies\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\nimport('./index.js');\n"],"file":"assets/main.DW9UCmAK.js"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dl8ZqWS0.js","assets/app-DCtCV8Sz.js","assets/main.DW9UCmAK.js","assets/app-loader-BAEWEx-m.js","assets/app-loader-NDVZu4bS.css","assets/app-D5gNm0Gn.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { _ as __vitePreload } from "./main.DW9UCmAK.js";
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { _ as logger, ah as connectConfig } from "./app-loader-BAEWEx-m.js";
|
|
5
|
+
import { N as useAnalyticsStore, Q as useUnwrappedProcessorManager, T as AnalyticsProvider } from "./app-DCtCV8Sz.js";
|
|
6
|
+
import { useRef, useEffect } from "react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
async function registerDiffAnalyzer(manager, analyticsStore) {
|
|
9
|
+
const { processorFactory } = await __vitePreload(async () => {
|
|
10
|
+
const { processorFactory: processorFactory2 } = await import("./index-Dl8ZqWS0.js");
|
|
11
|
+
return { processorFactory: processorFactory2 };
|
|
12
|
+
}, true ? __vite__mapDeps([0,1,2,3,4,5]) : void 0);
|
|
13
|
+
return await manager.registerFactory(
|
|
14
|
+
"@powerhousedao/diff-analyzer",
|
|
15
|
+
processorFactory({ analyticsStore })
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function DiffAnalyzerProcessor() {
|
|
19
|
+
const store = useAnalyticsStore();
|
|
20
|
+
const manager = useUnwrappedProcessorManager();
|
|
21
|
+
const hasRegistered = useRef(false);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!store || !manager || hasRegistered.current) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
hasRegistered.current = true;
|
|
27
|
+
registerDiffAnalyzer(manager, store).catch(logger.error);
|
|
28
|
+
}, [store, manager]);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
function ReactorAnalyticsProvider({ children }) {
|
|
32
|
+
return /* @__PURE__ */ jsxs(AnalyticsProvider, { databaseName: connectConfig.analyticsDatabaseName, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(DiffAnalyzerProcessor, {}),
|
|
34
|
+
children
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
DiffAnalyzerProcessor,
|
|
39
|
+
ReactorAnalyticsProvider,
|
|
40
|
+
ReactorAnalyticsProvider as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=reactor-analytics-hlzA2WG5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;;AAWA,eAAe,qBACX,SACA,gBACF;AACE,QAAM,EAAE,qBAAqB;0DAAM,OAC/B,qBACJ;AAAA,+BAAAA,kBAAA;AAAA;AAEA,SAAO,MAAM,QAAQ;AAAA,IACjB;AAAA,IACA,iBAAiB,EAAE,eAAgB;AAAA,EACvC;AACJ;AAEO,SAAS,wBAAwB;AACpC,QAAM,QAAQ,kBAAkB;AAChC,QAAM,UAAU,6BAA6B;AACvC,wBAAgB,OAAO,KAAK;AAElC,YAAU,MAAM;AACZ,QAAI,CAAC,SAAS,CAAC,WAAW,cAAc,SAAS;AAC7C;AAAA;AAGJ,kBAAc,UAAU;AACxB,yBAAqB,SAAS,KAAK,EAAE,MAAM,OAAO,KAAK;AAAA,KACxD,CAAC,OAAO,OAAO,CAAC;AAEZ;AACX;AAEgB,kCAAyB,EAAE,YAA+B;AACtE,SACK,0CAAkB,cAAc,cAAc,uBAC3C;AAAA,wBAAC,uBAAsB;AAAA,IACtB;AAAA,KACL;AAER","names":["processorFactory"],"ignoreList":[],"sources":["../../src/context/reactor-analytics.tsx"],"sourcesContent":["import connectConfig from '#connect-config';\nimport { type IAnalyticsStore } from '@powerhousedao/reactor-browser/analytics';\nimport {\n AnalyticsProvider,\n useAnalyticsStore,\n} from '@powerhousedao/reactor-browser/analytics/context';\nimport { logger } from 'document-drive';\nimport { type ProcessorManager } from 'document-drive/processors/processor-manager';\nimport { useEffect, useRef, type PropsWithChildren } from 'react';\nimport { useUnwrappedProcessorManager } from '../store/processors';\n\nasync function registerDiffAnalyzer(\n manager: ProcessorManager,\n analyticsStore: IAnalyticsStore,\n) {\n const { processorFactory } = await import(\n '@powerhousedao/diff-analyzer/processors'\n );\n\n return await manager.registerFactory(\n '@powerhousedao/diff-analyzer',\n processorFactory({ analyticsStore }),\n );\n}\n\nexport function DiffAnalyzerProcessor() {\n const store = useAnalyticsStore();\n const manager = useUnwrappedProcessorManager();\n const hasRegistered = useRef(false);\n\n useEffect(() => {\n if (!store || !manager || hasRegistered.current) {\n return;\n }\n\n hasRegistered.current = true;\n registerDiffAnalyzer(manager, store).catch(logger.error);\n }, [store, manager]);\n\n return null;\n}\n\nexport function ReactorAnalyticsProvider({ children }: PropsWithChildren) {\n return (\n <AnalyticsProvider databaseName={connectConfig.analyticsDatabaseName}>\n <DiffAnalyzerProcessor />\n {children}\n </AnalyticsProvider>\n );\n}\n\nexport default ReactorAnalyticsProvider;\n"],"file":"assets/reactor-analytics-hlzA2WG5.js"}
|