@doxsync/core 0.1.0-alpha.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/LICENSE-APACHE +202 -0
- package/LICENSE-MIT +21 -0
- package/README.md +193 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +9 -0
- package/dist/node.js +19 -0
- package/dist/runtime.js +85 -0
- package/dist/wasm/doxsync.d.ts +61 -0
- package/dist/wasm/doxsync.js +520 -0
- package/dist/wasm/doxsync_bg.wasm +0 -0
- package/dist/wasm/doxsync_bg.wasm.d.ts +18 -0
- package/examples/browser.css +110 -0
- package/examples/browser.html +94 -0
- package/examples/browser.js +347 -0
- package/examples/node.mjs +19 -0
- package/package.json +35 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
/* @ts-self-types="./doxsync.d.ts" */
|
|
2
|
+
|
|
3
|
+
export class Consumer {
|
|
4
|
+
__destroy_into_raw() {
|
|
5
|
+
const ptr = this.__wbg_ptr;
|
|
6
|
+
this.__wbg_ptr = 0;
|
|
7
|
+
ConsumerFinalization.unregister(this);
|
|
8
|
+
return ptr;
|
|
9
|
+
}
|
|
10
|
+
free() {
|
|
11
|
+
const ptr = this.__destroy_into_raw();
|
|
12
|
+
wasm.__wbg_consumer_free(ptr, 0);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {any} bytes
|
|
16
|
+
*/
|
|
17
|
+
consumeDiff(bytes) {
|
|
18
|
+
const ret = wasm.consumer_consumeDiff(this.__wbg_ptr, bytes);
|
|
19
|
+
if (ret[1]) {
|
|
20
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
document() {
|
|
27
|
+
const ret = wasm.consumer_document(this.__wbg_ptr);
|
|
28
|
+
if (ret[2]) {
|
|
29
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
30
|
+
}
|
|
31
|
+
return takeFromExternrefTable0(ret[0]);
|
|
32
|
+
}
|
|
33
|
+
constructor() {
|
|
34
|
+
const ret = wasm.consumer_new();
|
|
35
|
+
this.__wbg_ptr = ret;
|
|
36
|
+
ConsumerFinalization.register(this, this.__wbg_ptr, this);
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (Symbol.dispose) Consumer.prototype[Symbol.dispose] = Consumer.prototype.free;
|
|
41
|
+
|
|
42
|
+
export class Producer {
|
|
43
|
+
__destroy_into_raw() {
|
|
44
|
+
const ptr = this.__wbg_ptr;
|
|
45
|
+
this.__wbg_ptr = 0;
|
|
46
|
+
ProducerFinalization.unregister(this);
|
|
47
|
+
return ptr;
|
|
48
|
+
}
|
|
49
|
+
free() {
|
|
50
|
+
const ptr = this.__destroy_into_raw();
|
|
51
|
+
wasm.__wbg_producer_free(ptr, 0);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @param {any} value
|
|
55
|
+
* @param {any} protocols
|
|
56
|
+
*/
|
|
57
|
+
constructor(value, protocols) {
|
|
58
|
+
const ret = wasm.producer_new(value, protocols);
|
|
59
|
+
if (ret[2]) {
|
|
60
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
61
|
+
}
|
|
62
|
+
this.__wbg_ptr = ret[0];
|
|
63
|
+
ProducerFinalization.register(this, this.__wbg_ptr, this);
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @returns {any}
|
|
68
|
+
*/
|
|
69
|
+
produceDiff() {
|
|
70
|
+
const ret = wasm.producer_produceDiff(this.__wbg_ptr);
|
|
71
|
+
if (ret[2]) {
|
|
72
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
73
|
+
}
|
|
74
|
+
return takeFromExternrefTable0(ret[0]);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @param {any} value
|
|
78
|
+
*/
|
|
79
|
+
replace(value) {
|
|
80
|
+
const ret = wasm.producer_replace(this.__wbg_ptr, value);
|
|
81
|
+
if (ret[1]) {
|
|
82
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (Symbol.dispose) Producer.prototype[Symbol.dispose] = Producer.prototype.free;
|
|
87
|
+
function __wbg_get_imports() {
|
|
88
|
+
const import0 = {
|
|
89
|
+
__proto__: null,
|
|
90
|
+
__wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
|
|
91
|
+
const v = arg1;
|
|
92
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
93
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
94
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
95
|
+
},
|
|
96
|
+
__wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
|
|
97
|
+
const v = arg0;
|
|
98
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
99
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
100
|
+
},
|
|
101
|
+
__wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
|
|
102
|
+
const ret = typeof(arg0) === 'bigint';
|
|
103
|
+
return ret;
|
|
104
|
+
},
|
|
105
|
+
__wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
|
|
106
|
+
const ret = arg0 === null;
|
|
107
|
+
return ret;
|
|
108
|
+
},
|
|
109
|
+
__wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
|
|
110
|
+
const val = arg0;
|
|
111
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
112
|
+
return ret;
|
|
113
|
+
},
|
|
114
|
+
__wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
|
|
115
|
+
const ret = typeof(arg0) === 'string';
|
|
116
|
+
return ret;
|
|
117
|
+
},
|
|
118
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
119
|
+
const ret = arg0 === undefined;
|
|
120
|
+
return ret;
|
|
121
|
+
},
|
|
122
|
+
__wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
|
|
123
|
+
const ret = arg0 === arg1;
|
|
124
|
+
return ret;
|
|
125
|
+
},
|
|
126
|
+
__wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
|
|
127
|
+
const obj = arg1;
|
|
128
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
129
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
130
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
131
|
+
},
|
|
132
|
+
__wbg___wbindgen_shr_56cae1eadababcab: function(arg0, arg1) {
|
|
133
|
+
const ret = arg0 >> arg1;
|
|
134
|
+
return ret;
|
|
135
|
+
},
|
|
136
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
137
|
+
const obj = arg1;
|
|
138
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
139
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
140
|
+
var len1 = WASM_VECTOR_LEN;
|
|
141
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
142
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
143
|
+
},
|
|
144
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
145
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
146
|
+
},
|
|
147
|
+
__wbg_add_8a5c57dd2c815678: function(arg0, arg1) {
|
|
148
|
+
const ret = arg0.add(arg1);
|
|
149
|
+
return ret;
|
|
150
|
+
},
|
|
151
|
+
__wbg_charCodeAt_90635349fbda9f5f: function(arg0, arg1) {
|
|
152
|
+
const ret = arg0.charCodeAt(arg1 >>> 0);
|
|
153
|
+
return ret;
|
|
154
|
+
},
|
|
155
|
+
__wbg_defineProperty_8a37abacf958bd67: function() { return handleError(function (arg0, arg1, arg2) {
|
|
156
|
+
const ret = Reflect.defineProperty(arg0, arg1, arg2);
|
|
157
|
+
return ret;
|
|
158
|
+
}, arguments); },
|
|
159
|
+
__wbg_delete_3b9bb6fcd83f823a: function(arg0, arg1) {
|
|
160
|
+
const ret = arg0.delete(arg1);
|
|
161
|
+
return ret;
|
|
162
|
+
},
|
|
163
|
+
__wbg_from_a39669ce566077da: function(arg0) {
|
|
164
|
+
const ret = Array.from(arg0);
|
|
165
|
+
return ret;
|
|
166
|
+
},
|
|
167
|
+
__wbg_getOwnPropertyDescriptor_5f6b7f5440aa87c2: function() { return handleError(function (arg0, arg1) {
|
|
168
|
+
const ret = Reflect.getOwnPropertyDescriptor(arg0, arg1);
|
|
169
|
+
return ret;
|
|
170
|
+
}, arguments); },
|
|
171
|
+
__wbg_getPrototypeOf_5c4b9dbbf25290de: function(arg0) {
|
|
172
|
+
const ret = Object.getPrototypeOf(arg0);
|
|
173
|
+
return ret;
|
|
174
|
+
},
|
|
175
|
+
__wbg_getPrototypeOf_7370acb5ea67b92d: function() { return handleError(function (arg0) {
|
|
176
|
+
const ret = Reflect.getPrototypeOf(arg0);
|
|
177
|
+
return ret;
|
|
178
|
+
}, arguments); },
|
|
179
|
+
__wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
|
|
180
|
+
const ret = Reflect.get(arg0, arg1);
|
|
181
|
+
return ret;
|
|
182
|
+
}, arguments); },
|
|
183
|
+
__wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
|
|
184
|
+
const ret = arg0[arg1 >>> 0];
|
|
185
|
+
return ret;
|
|
186
|
+
},
|
|
187
|
+
__wbg_has_464f8b9416279d65: function() { return handleError(function (arg0, arg1) {
|
|
188
|
+
const ret = Reflect.has(arg0, arg1);
|
|
189
|
+
return ret;
|
|
190
|
+
}, arguments); },
|
|
191
|
+
__wbg_has_894984e1f2f8792a: function(arg0, arg1) {
|
|
192
|
+
const ret = arg0.has(arg1);
|
|
193
|
+
return ret;
|
|
194
|
+
},
|
|
195
|
+
__wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
|
|
196
|
+
let result;
|
|
197
|
+
try {
|
|
198
|
+
result = arg0 instanceof Uint8Array;
|
|
199
|
+
} catch (_) {
|
|
200
|
+
result = false;
|
|
201
|
+
}
|
|
202
|
+
const ret = result;
|
|
203
|
+
return ret;
|
|
204
|
+
},
|
|
205
|
+
__wbg_isArray_5674713bb7b79043: function(arg0) {
|
|
206
|
+
const ret = Array.isArray(arg0);
|
|
207
|
+
return ret;
|
|
208
|
+
},
|
|
209
|
+
__wbg_is_61443cc073056436: function(arg0, arg1) {
|
|
210
|
+
const ret = Object.is(arg0, arg1);
|
|
211
|
+
return ret;
|
|
212
|
+
},
|
|
213
|
+
__wbg_length_31bdaf014f5fbde2: function(arg0) {
|
|
214
|
+
const ret = arg0.length;
|
|
215
|
+
return ret;
|
|
216
|
+
},
|
|
217
|
+
__wbg_length_4e1adc0d42e23620: function(arg0) {
|
|
218
|
+
const ret = arg0.length;
|
|
219
|
+
return ret;
|
|
220
|
+
},
|
|
221
|
+
__wbg_length_d52ee452c5be0c99: function(arg0) {
|
|
222
|
+
const ret = arg0.length;
|
|
223
|
+
return ret;
|
|
224
|
+
},
|
|
225
|
+
__wbg_new_5d3e59ef841aa96f: function(arg0) {
|
|
226
|
+
const ret = new Set(arg0);
|
|
227
|
+
return ret;
|
|
228
|
+
},
|
|
229
|
+
__wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
|
|
230
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
231
|
+
return ret;
|
|
232
|
+
},
|
|
233
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
234
|
+
const ret = new Object();
|
|
235
|
+
return ret;
|
|
236
|
+
},
|
|
237
|
+
__wbg_new_ffa92086ea89f79c: function() {
|
|
238
|
+
const ret = new Array();
|
|
239
|
+
return ret;
|
|
240
|
+
},
|
|
241
|
+
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
242
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
243
|
+
return ret;
|
|
244
|
+
},
|
|
245
|
+
__wbg_ownKeys_2fa7299880410d24: function() { return handleError(function (arg0) {
|
|
246
|
+
const ret = Reflect.ownKeys(arg0);
|
|
247
|
+
return ret;
|
|
248
|
+
}, arguments); },
|
|
249
|
+
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
250
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
251
|
+
},
|
|
252
|
+
__wbg_push_bfdf956ba476f65b: function(arg0, arg1) {
|
|
253
|
+
const ret = arg0.push(arg1);
|
|
254
|
+
return ret;
|
|
255
|
+
},
|
|
256
|
+
__wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
|
|
257
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
258
|
+
return ret;
|
|
259
|
+
}, arguments); },
|
|
260
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
261
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
262
|
+
const ret = arg0;
|
|
263
|
+
return ret;
|
|
264
|
+
},
|
|
265
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
266
|
+
// Cast intrinsic for `I128 -> Externref`.
|
|
267
|
+
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
268
|
+
return ret;
|
|
269
|
+
},
|
|
270
|
+
__wbindgen_generic_0000000000000003: function(arg0) {
|
|
271
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
272
|
+
const ret = arg0;
|
|
273
|
+
return ret;
|
|
274
|
+
},
|
|
275
|
+
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
276
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
277
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
278
|
+
return ret;
|
|
279
|
+
},
|
|
280
|
+
__wbindgen_generic_0000000000000005: function(arg0) {
|
|
281
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
282
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
283
|
+
return ret;
|
|
284
|
+
},
|
|
285
|
+
__wbindgen_init_externref_table: function() {
|
|
286
|
+
const table = wasm.__wbindgen_externrefs;
|
|
287
|
+
const offset = table.grow(4);
|
|
288
|
+
table.set(0, undefined);
|
|
289
|
+
table.set(offset + 0, undefined);
|
|
290
|
+
table.set(offset + 1, null);
|
|
291
|
+
table.set(offset + 2, true);
|
|
292
|
+
table.set(offset + 3, false);
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
return {
|
|
296
|
+
__proto__: null,
|
|
297
|
+
"./doxsync_bg.js": import0,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const ConsumerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
302
|
+
? { register: () => {}, unregister: () => {} }
|
|
303
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_consumer_free(ptr, 1));
|
|
304
|
+
const ProducerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
305
|
+
? { register: () => {}, unregister: () => {} }
|
|
306
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_producer_free(ptr, 1));
|
|
307
|
+
|
|
308
|
+
function addToExternrefTable0(obj) {
|
|
309
|
+
const idx = wasm.__externref_table_alloc();
|
|
310
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
311
|
+
return idx;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
315
|
+
ptr = ptr >>> 0;
|
|
316
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
let cachedDataViewMemory0 = null;
|
|
320
|
+
function getDataViewMemory0() {
|
|
321
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
322
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
323
|
+
}
|
|
324
|
+
return cachedDataViewMemory0;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function getStringFromWasm0(ptr, len) {
|
|
328
|
+
return decodeText(ptr >>> 0, len);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
let cachedUint8ArrayMemory0 = null;
|
|
332
|
+
function getUint8ArrayMemory0() {
|
|
333
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
334
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
335
|
+
}
|
|
336
|
+
return cachedUint8ArrayMemory0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function handleError(f, args) {
|
|
340
|
+
try {
|
|
341
|
+
return f.apply(this, args);
|
|
342
|
+
} catch (e) {
|
|
343
|
+
const idx = addToExternrefTable0(e);
|
|
344
|
+
wasm.__wbindgen_exn_store(idx);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function isLikeNone(x) {
|
|
349
|
+
return x === undefined || x === null;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
353
|
+
if (realloc === undefined) {
|
|
354
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
355
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
356
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
357
|
+
WASM_VECTOR_LEN = buf.length;
|
|
358
|
+
return ptr;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
let len = arg.length;
|
|
362
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
363
|
+
|
|
364
|
+
const mem = getUint8ArrayMemory0();
|
|
365
|
+
|
|
366
|
+
let offset = 0;
|
|
367
|
+
|
|
368
|
+
for (; offset < len; offset++) {
|
|
369
|
+
const code = arg.charCodeAt(offset);
|
|
370
|
+
if (code > 0x7F) break;
|
|
371
|
+
mem[ptr + offset] = code;
|
|
372
|
+
}
|
|
373
|
+
if (offset !== len) {
|
|
374
|
+
if (offset !== 0) {
|
|
375
|
+
arg = arg.slice(offset);
|
|
376
|
+
}
|
|
377
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
378
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
379
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
380
|
+
|
|
381
|
+
offset += ret.written;
|
|
382
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
WASM_VECTOR_LEN = offset;
|
|
386
|
+
return ptr;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function takeFromExternrefTable0(idx) {
|
|
390
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
391
|
+
wasm.__externref_table_dealloc(idx);
|
|
392
|
+
return value;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
396
|
+
cachedTextDecoder.decode();
|
|
397
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
398
|
+
let numBytesDecoded = 0;
|
|
399
|
+
function decodeText(ptr, len) {
|
|
400
|
+
numBytesDecoded += len;
|
|
401
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
402
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
403
|
+
cachedTextDecoder.decode();
|
|
404
|
+
numBytesDecoded = len;
|
|
405
|
+
}
|
|
406
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const cachedTextEncoder = new TextEncoder();
|
|
410
|
+
|
|
411
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
412
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
413
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
414
|
+
view.set(buf);
|
|
415
|
+
return {
|
|
416
|
+
read: arg.length,
|
|
417
|
+
written: buf.length
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
let WASM_VECTOR_LEN = 0;
|
|
423
|
+
|
|
424
|
+
let wasmModule, wasmInstance, wasm;
|
|
425
|
+
function __wbg_finalize_init(instance, module) {
|
|
426
|
+
wasmInstance = instance;
|
|
427
|
+
wasm = instance.exports;
|
|
428
|
+
wasmModule = module;
|
|
429
|
+
cachedDataViewMemory0 = null;
|
|
430
|
+
cachedUint8ArrayMemory0 = null;
|
|
431
|
+
wasm.__wbindgen_start();
|
|
432
|
+
return wasm;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
async function __wbg_load(module, imports) {
|
|
436
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
437
|
+
if (!module.ok) {
|
|
438
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
442
|
+
try {
|
|
443
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
444
|
+
} catch (e) {
|
|
445
|
+
const validResponse = expectedResponseType(module.type);
|
|
446
|
+
|
|
447
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
448
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
449
|
+
|
|
450
|
+
} else { throw e; }
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
const bytes = await module.arrayBuffer();
|
|
455
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
456
|
+
} else {
|
|
457
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
458
|
+
|
|
459
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
460
|
+
return { instance, module };
|
|
461
|
+
} else {
|
|
462
|
+
return instance;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function expectedResponseType(type) {
|
|
467
|
+
switch (type) {
|
|
468
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
469
|
+
}
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function initSync(module) {
|
|
475
|
+
if (wasm !== undefined) return wasm;
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
if (module !== undefined) {
|
|
479
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
480
|
+
({module} = module)
|
|
481
|
+
} else {
|
|
482
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const imports = __wbg_get_imports();
|
|
487
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
488
|
+
module = new WebAssembly.Module(module);
|
|
489
|
+
}
|
|
490
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
491
|
+
return __wbg_finalize_init(instance, module);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
async function __wbg_init(module_or_path) {
|
|
495
|
+
if (wasm !== undefined) return wasm;
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
if (module_or_path !== undefined) {
|
|
499
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
500
|
+
({module_or_path} = module_or_path)
|
|
501
|
+
} else {
|
|
502
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
if (module_or_path === undefined) {
|
|
507
|
+
module_or_path = new URL('doxsync_bg.wasm', import.meta.url);
|
|
508
|
+
}
|
|
509
|
+
const imports = __wbg_get_imports();
|
|
510
|
+
|
|
511
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
512
|
+
module_or_path = fetch(module_or_path);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
516
|
+
|
|
517
|
+
return __wbg_finalize_init(instance, module);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_consumer_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_producer_free: (a: number, b: number) => void;
|
|
6
|
+
export const consumer_consumeDiff: (a: number, b: any) => [number, number];
|
|
7
|
+
export const consumer_document: (a: number) => [number, number, number];
|
|
8
|
+
export const consumer_new: () => number;
|
|
9
|
+
export const producer_new: (a: any, b: any) => [number, number, number];
|
|
10
|
+
export const producer_produceDiff: (a: number) => [number, number, number];
|
|
11
|
+
export const producer_replace: (a: number, b: any) => [number, number];
|
|
12
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
13
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
14
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
15
|
+
export const __externref_table_alloc: () => number;
|
|
16
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
17
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
18
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
|
|
4
|
+
color: #243348;
|
|
5
|
+
background: #f5f7f9;
|
|
6
|
+
font-synthesis: none;
|
|
7
|
+
--border: #dce2e9;
|
|
8
|
+
--muted: #627085;
|
|
9
|
+
--blue: #245ccc;
|
|
10
|
+
--green: #12765b;
|
|
11
|
+
--mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
12
|
+
}
|
|
13
|
+
* { box-sizing: border-box; }
|
|
14
|
+
body { margin: 0; }
|
|
15
|
+
main { max-width: 1380px; margin: 0 auto; padding: 38px 32px 24px; }
|
|
16
|
+
h1, h2, h3, p { margin: 0; }
|
|
17
|
+
button, input, select { font: inherit; }
|
|
18
|
+
button, select, input[type="number"] { min-height: 38px; border: 1px solid #cbd3de; border-radius: 6px; background: #fff; color: inherit; }
|
|
19
|
+
button { padding: 8px 13px; cursor: pointer; white-space: nowrap; }
|
|
20
|
+
button:hover:not(:disabled) { background: #edf2f8; border-color: #a6b5ca; }
|
|
21
|
+
button:disabled, input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
|
|
22
|
+
:focus-visible { outline: 3px solid #83adff; outline-offset: 3px; }
|
|
23
|
+
button.primary { background: var(--blue); color: white; border-color: var(--blue); }
|
|
24
|
+
button.primary:hover:not(:disabled) { background: #194bb0; }
|
|
25
|
+
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 27px; }
|
|
26
|
+
.brand { font-family: var(--mono); font-size: 16px; font-weight: 700; margin-bottom: 16px; }
|
|
27
|
+
.brand span { font-weight: 400; color: var(--muted); font-size: 13px; }
|
|
28
|
+
h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; font-weight: 650; }
|
|
29
|
+
.intro { color: var(--muted); font-size: 14px; margin-top: 9px; line-height: 1.6; }
|
|
30
|
+
.sync-state { font-size: 13px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 6px; background: white; white-space: nowrap; }
|
|
31
|
+
.sync-state[data-state="pending"] { color: #875719; background: #fff9ed; border-color: #ecdbb7; }
|
|
32
|
+
.sync-state[data-state="synced"] { color: var(--green); background: #edf8f2; border-color: #c9e5d5; }
|
|
33
|
+
.sync-state[data-state="error"] { color: #a32c30; background: #fff1f1; border-color: #ebc4c5; }
|
|
34
|
+
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; font-size: 13px; }
|
|
35
|
+
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-right: auto; }
|
|
36
|
+
.controls label { display: flex; align-items: center; gap: 9px; color: var(--muted); }
|
|
37
|
+
select { padding: 0 28px 0 10px; }
|
|
38
|
+
.delay-input { display: flex; align-items: center; gap: 6px; }
|
|
39
|
+
.delay-input input { width: 92px; padding: 8px 9px; font-family: var(--mono); }
|
|
40
|
+
.delay-input span { font-family: var(--mono); font-size: 12px; }
|
|
41
|
+
.control-note { margin: 11px 0 21px; color: var(--muted); font-size: 12px; line-height: 1.6; }
|
|
42
|
+
.error { padding: 14px; border: 1px solid #ebc4c5; background: #fff1f1; color: #a32c30; margin-bottom: 16px; border-radius: 6px; white-space: pre-wrap; font-size: 13px; }
|
|
43
|
+
.documents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
|
|
44
|
+
.document-panel { min-width: 0; background: white; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
|
|
45
|
+
.panel-header { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
|
|
46
|
+
.panel-header > div { display: flex; align-items: center; gap: 10px; }
|
|
47
|
+
h2 { font-size: 15px; font-weight: 650; }
|
|
48
|
+
.subtle { color: var(--muted); font-size: 12px; font-weight: 400; }
|
|
49
|
+
.role-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
|
|
50
|
+
.consumer-panel .role-dot { background: var(--green); }
|
|
51
|
+
.version { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
|
|
52
|
+
.document-code { margin: 0; padding: 15px 0; height: 410px; overflow: auto; tab-size: 2; font: 12px/1.85 var(--mono); }
|
|
53
|
+
.document-code > code { display: block; min-width: max-content; }
|
|
54
|
+
.code-line { display: block; padding: 0 20px 0 50px; position: relative; min-height: 22px; }
|
|
55
|
+
.code-line::before { content: attr(data-line); color: #8b97a7; position: absolute; left: 0; width: 33px; text-align: right; user-select: none; font-size: 11px; }
|
|
56
|
+
.code-line.changed { background: #fff6db; box-shadow: inset 2px 0 #dbb14e; }
|
|
57
|
+
.token-key { color: #3e526f; }
|
|
58
|
+
.token-string { color: #16734e; }
|
|
59
|
+
.token-number { color: #255fc1; }
|
|
60
|
+
.token-literal { color: #995221; }
|
|
61
|
+
.document-footer { padding: 12px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; min-height: 43px; overflow-wrap: anywhere; }
|
|
62
|
+
.transport { margin-top: 26px; }
|
|
63
|
+
.transport-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
|
|
64
|
+
.transport-header > div { display: flex; align-items: center; gap: 16px; }
|
|
65
|
+
#metrics { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
|
|
66
|
+
.message-workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); background: white; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
|
|
67
|
+
.message-history { min-width: 0; border-right: 1px solid var(--border); }
|
|
68
|
+
.history-heading { display: flex; justify-content: space-between; padding: 13px 18px; background: #fafbfd; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--border); }
|
|
69
|
+
#message-list { list-style: none; margin: 0; padding: 5px; height: 270px; overflow: auto; }
|
|
70
|
+
.message-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 5px; padding: 10px 11px; min-height: 55px; white-space: normal; }
|
|
71
|
+
.message-row[aria-pressed="true"] { background: #edf3ff; border-color: #c9d9f9; }
|
|
72
|
+
.message-row .message-id { font: 12px var(--mono); color: var(--muted); }
|
|
73
|
+
.message-summary { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
74
|
+
.message-size { display: block; font: 11px var(--mono); margin-bottom: 4px; text-align: right; }
|
|
75
|
+
.message-state { display: block; font-size: 11px; color: #875719; text-align: right; }
|
|
76
|
+
.message-row[data-status="delivered"] .message-state { color: var(--green); }
|
|
77
|
+
.message-row[data-status="failed"] .message-state { color: #a32c30; }
|
|
78
|
+
.history-note { padding: 11px 18px; font-size: 11px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--border); }
|
|
79
|
+
.message-detail { padding: 18px 20px; min-width: 0; }
|
|
80
|
+
.detail-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
|
|
81
|
+
h3 { font: 600 14px var(--mono); }
|
|
82
|
+
.follow { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
|
|
83
|
+
.follow input { accent-color: var(--blue); }
|
|
84
|
+
.message-description { margin-top: 10px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
|
|
85
|
+
.message-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
|
|
86
|
+
.message-facts dt { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
|
|
87
|
+
.message-facts dd { margin: 0; font: 12px var(--mono); }
|
|
88
|
+
.bytes-heading { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
|
|
89
|
+
.message-bytes { margin: 8px 0 0; padding: 13px; background: #f5f7fa; border: 1px solid #e7ebf0; border-radius: 5px; font: 11px/1.9 var(--mono); height: 139px; overflow: auto; color: #425570; }
|
|
90
|
+
.page-footer { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; line-height: 1.6; padding-top: 20px; }
|
|
91
|
+
@media (max-width: 850px) {
|
|
92
|
+
main { padding: 25px 18px; }
|
|
93
|
+
.page-header { align-items: flex-start; }
|
|
94
|
+
.message-workspace { grid-template-columns: 1fr; }
|
|
95
|
+
.message-history { border-right: 0; border-bottom: 1px solid var(--border); }
|
|
96
|
+
#message-list { height: 190px; }
|
|
97
|
+
.controls { gap: 12px 20px; }
|
|
98
|
+
.buttons { width: 100%; }
|
|
99
|
+
}
|
|
100
|
+
@media (max-width: 600px) {
|
|
101
|
+
main { padding: 22px 14px; }
|
|
102
|
+
.page-header { flex-direction: column; gap: 15px; }
|
|
103
|
+
.documents { grid-template-columns: 1fr; gap: 14px; }
|
|
104
|
+
.document-code { height: 350px; }
|
|
105
|
+
.transport-header { align-items: flex-start; flex-direction: column; }
|
|
106
|
+
.page-footer { flex-direction: column; gap: 5px; }
|
|
107
|
+
.panel-header { padding: 14px; }
|
|
108
|
+
.message-detail { padding: 16px 14px; }
|
|
109
|
+
.message-facts { gap: 8px; }
|
|
110
|
+
}
|