dexie-cloud-addon 4.2.4 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dexie-cloud-import.json +2 -1
- package/dist/modern/dexie-cloud-addon.js +146 -168
- package/dist/modern/dexie-cloud-addon.js.map +1 -1
- package/dist/modern/dexie-cloud-addon.min.js +1 -1
- package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
- package/dist/modern/service-worker.js +146 -168
- package/dist/modern/service-worker.js.map +1 -1
- package/dist/modern/service-worker.min.js +1 -1
- package/dist/modern/service-worker.min.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.js +1623 -2458
- package/dist/umd/dexie-cloud-addon.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.min.js +1 -1
- package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/service-worker.js +2003 -2838
- package/dist/umd/service-worker.js.map +1 -1
- package/dist/umd/service-worker.min.js +1 -1
- package/dist/umd/service-worker.min.js.map +1 -1
- package/package.json +11 -8
- package/dist/umd/DISABLE_SERVICEWORKER_STRATEGY.d.ts +0 -1
- package/dist/umd/DXCWebSocketStatus.d.ts +0 -1
- package/dist/umd/DexieCloudAPI.d.ts +0 -75
- package/dist/umd/DexieCloudOptions.d.ts +0 -27
- package/dist/umd/DexieCloudSyncOptions.d.ts +0 -4
- package/dist/umd/DexieCloudTable.d.ts +0 -18
- package/dist/umd/InvalidLicenseError.d.ts +0 -5
- package/dist/umd/Invite.d.ts +0 -8
- package/dist/umd/PermissionChecker.d.ts +0 -15
- package/dist/umd/TSON.d.ts +0 -17
- package/dist/umd/WSObservable.d.ts +0 -72
- package/dist/umd/associate.d.ts +0 -1
- package/dist/umd/authentication/AuthPersistedContext.d.ts +0 -9
- package/dist/umd/authentication/TokenErrorResponseError.d.ts +0 -10
- package/dist/umd/authentication/TokenExpiredError.d.ts +0 -3
- package/dist/umd/authentication/UNAUTHORIZED_USER.d.ts +0 -2
- package/dist/umd/authentication/authenticate.d.ts +0 -13
- package/dist/umd/authentication/currentUserObservable.d.ts +0 -1
- package/dist/umd/authentication/interactWithUser.d.ts +0 -21
- package/dist/umd/authentication/login.d.ts +0 -3
- package/dist/umd/authentication/logout.d.ts +0 -5
- package/dist/umd/authentication/otpFetchTokenCallback.d.ts +0 -3
- package/dist/umd/authentication/setCurrentUser.d.ts +0 -14
- package/dist/umd/authentication/waitUntil.d.ts +0 -3
- package/dist/umd/computeSyncState.d.ts +0 -4
- package/dist/umd/createSharedValueObservable.d.ts +0 -3
- package/dist/umd/currentUserEmitter.d.ts +0 -3
- package/dist/umd/db/DexieCloudDB.d.ts +0 -61
- package/dist/umd/db/entities/BaseRevisionMapEntry.d.ts +0 -5
- package/dist/umd/db/entities/EntityCommon.d.ts +0 -5
- package/dist/umd/db/entities/GuardedJob.d.ts +0 -5
- package/dist/umd/db/entities/Member.d.ts +0 -19
- package/dist/umd/db/entities/PersistedSyncState.d.ts +0 -22
- package/dist/umd/db/entities/Realm.d.ts +0 -14
- package/dist/umd/db/entities/Role.d.ts +0 -11
- package/dist/umd/db/entities/UserLogin.d.ts +0 -23
- package/dist/umd/default-ui/Dialog.d.ts +0 -5
- package/dist/umd/default-ui/LoginDialog.d.ts +0 -3
- package/dist/umd/default-ui/Styles.d.ts +0 -3
- package/dist/umd/default-ui/index.d.ts +0 -24
- package/dist/umd/define-ydoc-trigger.d.ts +0 -3
- package/dist/umd/dexie-cloud-addon.d.ts +0 -3
- package/dist/umd/dexie-cloud-client.d.ts +0 -23
- package/dist/umd/errors/HttpError.d.ts +0 -5
- package/dist/umd/extend-dexie-interface.d.ts +0 -23
- package/dist/umd/getGlobalRolesObservable.d.ts +0 -5
- package/dist/umd/getInternalAccessControlObservable.d.ts +0 -12
- package/dist/umd/getInvitesObservable.d.ts +0 -23
- package/dist/umd/getPermissionsLookupObservable.d.ts +0 -16
- package/dist/umd/getTiedRealmId.d.ts +0 -2
- package/dist/umd/helpers/BroadcastedAndLocalEvent.d.ts +0 -8
- package/dist/umd/helpers/CancelToken.d.ts +0 -4
- package/dist/umd/helpers/IS_SERVICE_WORKER.d.ts +0 -1
- package/dist/umd/helpers/SWBroadcastChannel.d.ts +0 -12
- package/dist/umd/helpers/allSettled.d.ts +0 -1
- package/dist/umd/helpers/bulkUpdate.d.ts +0 -4
- package/dist/umd/helpers/computeRealmSetHash.d.ts +0 -2
- package/dist/umd/helpers/date-constants.d.ts +0 -5
- package/dist/umd/helpers/flatten.d.ts +0 -1
- package/dist/umd/helpers/getMutationTable.d.ts +0 -1
- package/dist/umd/helpers/getSyncableTables.d.ts +0 -4
- package/dist/umd/helpers/getTableFromMutationTable.d.ts +0 -1
- package/dist/umd/helpers/makeArray.d.ts +0 -1
- package/dist/umd/helpers/randomString.d.ts +0 -1
- package/dist/umd/helpers/resolveText.d.ts +0 -16
- package/dist/umd/helpers/throwVersionIncrementNeeded.d.ts +0 -1
- package/dist/umd/helpers/visibilityState.d.ts +0 -1
- package/dist/umd/isEagerSyncDisabled.d.ts +0 -2
- package/dist/umd/isFirefox.d.ts +0 -1
- package/dist/umd/isSafari.d.ts +0 -2
- package/dist/umd/mapValueObservable.d.ts +0 -5
- package/dist/umd/mergePermissions.d.ts +0 -2
- package/dist/umd/middleware-helpers/guardedTable.d.ts +0 -11
- package/dist/umd/middleware-helpers/idGenerationHelpers.d.ts +0 -18
- package/dist/umd/middlewares/createIdGenerationMiddleware.d.ts +0 -3
- package/dist/umd/middlewares/createImplicitPropSetterMiddleware.d.ts +0 -3
- package/dist/umd/middlewares/createMutationTrackingMiddleware.d.ts +0 -17
- package/dist/umd/middlewares/outstandingTransaction.d.ts +0 -4
- package/dist/umd/overrideParseStoresSpec.d.ts +0 -4
- package/dist/umd/performInitialSync.d.ts +0 -4
- package/dist/umd/permissions.d.ts +0 -9
- package/dist/umd/prodLog.d.ts +0 -9
- package/dist/umd/service-worker.d.ts +0 -1
- package/dist/umd/sync/DEXIE_CLOUD_SYNCER_ID.d.ts +0 -1
- package/dist/umd/sync/LocalSyncWorker.d.ts +0 -7
- package/dist/umd/sync/SyncRequiredError.d.ts +0 -3
- package/dist/umd/sync/applyServerChanges.d.ts +0 -3
- package/dist/umd/sync/connectWebSocket.d.ts +0 -2
- package/dist/umd/sync/encodeIdsForServer.d.ts +0 -4
- package/dist/umd/sync/extractRealm.d.ts +0 -2
- package/dist/umd/sync/getLatestRevisionsPerTable.d.ts +0 -6
- package/dist/umd/sync/getTablesToSyncify.d.ts +0 -3
- package/dist/umd/sync/isOnline.d.ts +0 -1
- package/dist/umd/sync/isSyncNeeded.d.ts +0 -2
- package/dist/umd/sync/listClientChanges.d.ts +0 -9
- package/dist/umd/sync/listSyncifiedChanges.d.ts +0 -5
- package/dist/umd/sync/messageConsumerIsReady.d.ts +0 -2
- package/dist/umd/sync/messagesFromServerQueue.d.ts +0 -8
- package/dist/umd/sync/modifyLocalObjectsWithNewUserId.d.ts +0 -4
- package/dist/umd/sync/myId.d.ts +0 -1
- package/dist/umd/sync/numUnsyncedMutations.d.ts +0 -2
- package/dist/umd/sync/old_startSyncingClientChanges.d.ts +0 -39
- package/dist/umd/sync/performGuardedJob.d.ts +0 -2
- package/dist/umd/sync/ratelimit.d.ts +0 -3
- package/dist/umd/sync/registerSyncEvent.d.ts +0 -3
- package/dist/umd/sync/sync.d.ts +0 -15
- package/dist/umd/sync/syncIfPossible.d.ts +0 -5
- package/dist/umd/sync/syncWithServer.d.ts +0 -6
- package/dist/umd/sync/triggerSync.d.ts +0 -2
- package/dist/umd/sync/updateBaseRevs.d.ts +0 -5
- package/dist/umd/types/DXCAlert.d.ts +0 -25
- package/dist/umd/types/DXCInputField.d.ts +0 -11
- package/dist/umd/types/DXCUserInteraction.d.ts +0 -93
- package/dist/umd/types/NewIdOptions.d.ts +0 -3
- package/dist/umd/types/SWMessageEvent.d.ts +0 -3
- package/dist/umd/types/SWSyncEvent.d.ts +0 -4
- package/dist/umd/types/SyncState.d.ts +0 -9
- package/dist/umd/types/TXExpandos.d.ts +0 -11
- package/dist/umd/updateSchemaFromOptions.d.ts +0 -3
- package/dist/umd/userIsActive.d.ts +0 -7
- package/dist/umd/verifyConfig.d.ts +0 -2
- package/dist/umd/verifySchema.d.ts +0 -2
- package/dist/umd/yjs/YDexieCloudSyncState.d.ts +0 -3
- package/dist/umd/yjs/YTable.d.ts +0 -3
- package/dist/umd/yjs/applyYMessages.d.ts +0 -9
- package/dist/umd/yjs/awareness.d.ts +0 -3
- package/dist/umd/yjs/createYClientUpdateObservable.d.ts +0 -4
- package/dist/umd/yjs/createYHandler.d.ts +0 -2
- package/dist/umd/yjs/downloadYDocsFromServer.d.ts +0 -3
- package/dist/umd/yjs/getUpdatesTable.d.ts +0 -3
- package/dist/umd/yjs/listUpdatesSince.d.ts +0 -3
- package/dist/umd/yjs/listYClientMessagesAndStateVector.d.ts +0 -26
- package/dist/umd/yjs/reopenDocSignal.d.ts +0 -10
- package/dist/umd/yjs/updateYSyncStates.d.ts +0 -6
package/dexie-cloud-import.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* ==========================================================================
|
|
10
10
|
*
|
|
11
|
-
* Version 4.2.
|
|
11
|
+
* Version 4.2.5, Sat Dec 20 2025
|
|
12
12
|
*
|
|
13
13
|
* https://dexie.org
|
|
14
14
|
*
|
|
@@ -39,7 +39,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
39
39
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
40
40
|
PERFORMANCE OF THIS SOFTWARE.
|
|
41
41
|
***************************************************************************** */
|
|
42
|
-
/* global Reflect, Promise */
|
|
42
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
function __rest(s, e) {
|
|
@@ -83,8 +83,9 @@ function __await(v) {
|
|
|
83
83
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
84
84
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
85
85
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
86
|
-
return i =
|
|
87
|
-
function
|
|
86
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
87
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
88
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
88
89
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
89
90
|
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
90
91
|
function fulfill(value) { resume("next", value); }
|
|
@@ -98,7 +99,12 @@ function __asyncValues(o) {
|
|
|
98
99
|
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
99
100
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
100
101
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
101
|
-
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
105
|
+
var e = new Error(message);
|
|
106
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
107
|
+
};
|
|
102
108
|
|
|
103
109
|
function assert(b) {
|
|
104
110
|
if (!b)
|
|
@@ -279,13 +285,12 @@ function applyOperations(target, ops) {
|
|
|
279
285
|
function subtractChanges(target, // Server change set
|
|
280
286
|
changesToSubtract // additional mutations on client during syncWithServer()
|
|
281
287
|
) {
|
|
282
|
-
var _a, _b, _c;
|
|
283
288
|
for (const [table, mutationSet] of Object.entries(changesToSubtract)) {
|
|
284
289
|
for (const [key, mut] of Object.entries(mutationSet)) {
|
|
285
290
|
switch (mut.type) {
|
|
286
291
|
case 'ups':
|
|
287
292
|
{
|
|
288
|
-
const targetMut =
|
|
293
|
+
const targetMut = target[table]?.[key];
|
|
289
294
|
if (targetMut) {
|
|
290
295
|
switch (targetMut.type) {
|
|
291
296
|
case 'ups':
|
|
@@ -303,10 +308,10 @@ changesToSubtract // additional mutations on client during syncWithServer()
|
|
|
303
308
|
}
|
|
304
309
|
break;
|
|
305
310
|
case 'del':
|
|
306
|
-
|
|
311
|
+
delete target[table]?.[key];
|
|
307
312
|
break;
|
|
308
313
|
case 'upd': {
|
|
309
|
-
const targetMut =
|
|
314
|
+
const targetMut = target[table]?.[key];
|
|
310
315
|
if (targetMut) {
|
|
311
316
|
switch (targetMut.type) {
|
|
312
317
|
case 'ups':
|
|
@@ -339,17 +344,14 @@ changesToSubtract // additional mutations on client during syncWithServer()
|
|
|
339
344
|
* @param inSet
|
|
340
345
|
* @returns DBOperationsSet representing inSet
|
|
341
346
|
*/
|
|
342
|
-
function toDBOperationSet(inSet, txid
|
|
343
|
-
// Fictive transaction:
|
|
344
|
-
if (!txid)
|
|
345
|
-
txid = randomString$1(16);
|
|
347
|
+
function toDBOperationSet(inSet, txid) {
|
|
346
348
|
// Convert data into a temporary map to collect mutations of same table and type
|
|
347
349
|
const map = {};
|
|
348
350
|
for (const [table, ops] of Object.entries(inSet)) {
|
|
349
351
|
for (const [key, op] of Object.entries(ops)) {
|
|
350
352
|
const mapEntry = map[table] || (map[table] = {});
|
|
351
353
|
const ops = mapEntry[op.type] || (mapEntry[op.type] = []);
|
|
352
|
-
ops.push(
|
|
354
|
+
ops.push({ key, ...op }); // DBKeyMutation doesn't contain key, so we need to bring it in.
|
|
353
355
|
}
|
|
354
356
|
}
|
|
355
357
|
// Start computing the resulting format:
|
|
@@ -527,142 +529,111 @@ function decodeYMessage(a) {
|
|
|
527
529
|
}
|
|
528
530
|
|
|
529
531
|
async function asyncIterablePipeline(source, ...stages) {
|
|
530
|
-
var _a, e_1, _b, _c;
|
|
531
532
|
// Chain generators by sending outdata from one to another
|
|
532
533
|
let result = source(); // Start with the source generator
|
|
533
534
|
for (let i = 0; i < stages.length; i++) {
|
|
534
535
|
result = stages[i](result); // Pass on the result to next generator
|
|
535
536
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
let state = 0;
|
|
558
|
-
let sizeBuf = new Uint8Array(4);
|
|
559
|
-
let sizeBufPos = 0;
|
|
560
|
-
let bufs = [];
|
|
561
|
-
let len = 0;
|
|
562
|
-
try {
|
|
563
|
-
for (var _d = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), _a = source_1_1.done, !_a; _d = true) {
|
|
564
|
-
_c = source_1_1.value;
|
|
565
|
-
_d = false;
|
|
566
|
-
const chunk = _c;
|
|
567
|
-
const dw = new DataView(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
568
|
-
let pos = 0;
|
|
569
|
-
while (pos < chunk.byteLength) {
|
|
570
|
-
switch (state) {
|
|
571
|
-
case 0:
|
|
572
|
-
// Beginning of a size header
|
|
573
|
-
if (pos + 4 > chunk.byteLength) {
|
|
574
|
-
for (const b of chunk.slice(pos)) {
|
|
575
|
-
if (sizeBufPos === 4)
|
|
576
|
-
break;
|
|
577
|
-
sizeBuf[sizeBufPos++] = b;
|
|
578
|
-
++pos;
|
|
579
|
-
}
|
|
580
|
-
if (sizeBufPos < 4) {
|
|
581
|
-
// Need more bytes in order to read length.
|
|
582
|
-
// Will go out from while loop as well because pos is defenitely = chunk.byteLength here.
|
|
583
|
-
break;
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
else if (sizeBufPos > 0 && sizeBufPos < 4) {
|
|
587
|
-
for (const b of chunk.slice(pos, pos + 4 - sizeBufPos)) {
|
|
588
|
-
sizeBuf[sizeBufPos++] = b;
|
|
589
|
-
++pos;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
// Intentional fall-through...
|
|
593
|
-
case 1:
|
|
594
|
-
len =
|
|
595
|
-
sizeBufPos === 4
|
|
596
|
-
? new DataView(sizeBuf.buffer, 0, 4).getUint32(0, false)
|
|
597
|
-
: dw.getUint32(pos, false);
|
|
598
|
-
if (sizeBufPos)
|
|
599
|
-
sizeBufPos = 0; // in this case pos is already forwarded
|
|
600
|
-
else
|
|
601
|
-
pos += 4; // else pos is not yet forwarded - that's why we do it now
|
|
602
|
-
// Intentional fall-through...
|
|
603
|
-
case 2:
|
|
604
|
-
// Eat the chunk
|
|
605
|
-
if (pos >= chunk.byteLength) {
|
|
606
|
-
state = 2;
|
|
537
|
+
// Start running the machine. If the last stage is a sink, it will consume the data and never emit anything
|
|
538
|
+
// to us here...
|
|
539
|
+
for await (const chunk of result) { }
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
async function* consumeChunkedBinaryStream(source) {
|
|
543
|
+
let state = 0;
|
|
544
|
+
let sizeBuf = new Uint8Array(4);
|
|
545
|
+
let sizeBufPos = 0;
|
|
546
|
+
let bufs = [];
|
|
547
|
+
let len = 0;
|
|
548
|
+
for await (const chunk of source) {
|
|
549
|
+
const dw = new DataView(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
550
|
+
let pos = 0;
|
|
551
|
+
while (pos < chunk.byteLength) {
|
|
552
|
+
switch (state) {
|
|
553
|
+
case 0:
|
|
554
|
+
// Beginning of a size header
|
|
555
|
+
if (pos + 4 > chunk.byteLength) {
|
|
556
|
+
for (const b of chunk.slice(pos)) {
|
|
557
|
+
if (sizeBufPos === 4)
|
|
607
558
|
break;
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
else {
|
|
616
|
-
if (bufs.length > 0) {
|
|
617
|
-
const concats = new Uint8Array(bufs.reduce((p, c) => p + c.byteLength, len));
|
|
618
|
-
let p = 0;
|
|
619
|
-
for (const buf of bufs) {
|
|
620
|
-
concats.set(buf, p);
|
|
621
|
-
p += buf.byteLength;
|
|
622
|
-
}
|
|
623
|
-
concats.set(chunk.slice(pos, pos + len), p);
|
|
624
|
-
bufs = [];
|
|
625
|
-
yield yield __await(concats);
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
yield yield __await(chunk.slice(pos, pos + len));
|
|
629
|
-
}
|
|
630
|
-
pos += len;
|
|
631
|
-
state = 0;
|
|
632
|
-
}
|
|
559
|
+
sizeBuf[sizeBufPos++] = b;
|
|
560
|
+
++pos;
|
|
561
|
+
}
|
|
562
|
+
if (sizeBufPos < 4) {
|
|
563
|
+
// Need more bytes in order to read length.
|
|
564
|
+
// Will go out from while loop as well because pos is defenitely = chunk.byteLength here.
|
|
633
565
|
break;
|
|
566
|
+
}
|
|
634
567
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
568
|
+
else if (sizeBufPos > 0 && sizeBufPos < 4) {
|
|
569
|
+
for (const b of chunk.slice(pos, pos + 4 - sizeBufPos)) {
|
|
570
|
+
sizeBuf[sizeBufPos++] = b;
|
|
571
|
+
++pos;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
// Intentional fall-through...
|
|
575
|
+
case 1:
|
|
576
|
+
len =
|
|
577
|
+
sizeBufPos === 4
|
|
578
|
+
? new DataView(sizeBuf.buffer, 0, 4).getUint32(0, false)
|
|
579
|
+
: dw.getUint32(pos, false);
|
|
580
|
+
if (sizeBufPos)
|
|
581
|
+
sizeBufPos = 0; // in this case pos is already forwarded
|
|
582
|
+
else
|
|
583
|
+
pos += 4; // else pos is not yet forwarded - that's why we do it now
|
|
584
|
+
// Intentional fall-through...
|
|
585
|
+
case 2:
|
|
586
|
+
// Eat the chunk
|
|
587
|
+
if (pos >= chunk.byteLength) {
|
|
588
|
+
state = 2;
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
if (pos + len > chunk.byteLength) {
|
|
592
|
+
bufs.push(chunk.slice(pos));
|
|
593
|
+
len -= (chunk.byteLength - pos);
|
|
594
|
+
state = 2;
|
|
595
|
+
pos = chunk.byteLength; // will break while loop.
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
if (bufs.length > 0) {
|
|
599
|
+
const concats = new Uint8Array(bufs.reduce((p, c) => p + c.byteLength, len));
|
|
600
|
+
let p = 0;
|
|
601
|
+
for (const buf of bufs) {
|
|
602
|
+
concats.set(buf, p);
|
|
603
|
+
p += buf.byteLength;
|
|
604
|
+
}
|
|
605
|
+
concats.set(chunk.slice(pos, pos + len), p);
|
|
606
|
+
bufs = [];
|
|
607
|
+
yield concats;
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
yield chunk.slice(pos, pos + len);
|
|
611
|
+
}
|
|
612
|
+
pos += len;
|
|
613
|
+
state = 0;
|
|
614
|
+
}
|
|
615
|
+
break;
|
|
642
616
|
}
|
|
643
|
-
finally { if (e_1) throw e_1.error; }
|
|
644
617
|
}
|
|
645
|
-
}
|
|
618
|
+
}
|
|
646
619
|
}
|
|
647
620
|
|
|
648
621
|
function getFetchResponseBodyGenerator(res) {
|
|
649
|
-
return function () {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
yield yield __await(value);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
finally {
|
|
663
|
-
reader.releaseLock();
|
|
622
|
+
return async function* () {
|
|
623
|
+
if (!res.body)
|
|
624
|
+
throw new Error("Response body is not readable");
|
|
625
|
+
const reader = res.body.getReader();
|
|
626
|
+
try {
|
|
627
|
+
while (true) {
|
|
628
|
+
const { done, value } = await reader.read();
|
|
629
|
+
if (done)
|
|
630
|
+
return;
|
|
631
|
+
yield value;
|
|
664
632
|
}
|
|
665
|
-
}
|
|
633
|
+
}
|
|
634
|
+
finally {
|
|
635
|
+
reader.releaseLock();
|
|
636
|
+
}
|
|
666
637
|
};
|
|
667
638
|
}
|
|
668
639
|
|
|
@@ -1716,10 +1687,17 @@ function removeRedundantUpdateOps(muts) {
|
|
|
1716
1687
|
return true;
|
|
1717
1688
|
if (mut.keys.length !== 1 || mut.changeSpecs.length !== 1)
|
|
1718
1689
|
return true;
|
|
1690
|
+
// Check if this has PropModifications - if so, skip optimization
|
|
1691
|
+
const changeSpecs = mut.changeSpecs[0];
|
|
1692
|
+
if (Object.values(changeSpecs).some(v => typeof v === "object" && v && "@@propmod" in v)) {
|
|
1693
|
+
return true; // Cannot optimize if any PropModification is present
|
|
1694
|
+
}
|
|
1719
1695
|
// Keep track of properties that aren't overlapped by later transactions
|
|
1720
1696
|
const unoverlappedProps = new Set(Object.keys(mut.changeSpecs[0]));
|
|
1721
1697
|
const strKey = '' + mut.keys[0];
|
|
1722
1698
|
const keyCoverage = updateCoverage.get(strKey);
|
|
1699
|
+
if (!keyCoverage)
|
|
1700
|
+
return true; // No coverage info - cannot optimize
|
|
1723
1701
|
for (let i = keyCoverage.length - 1; i >= 0; --i) {
|
|
1724
1702
|
const { txid, updateSpec } = keyCoverage[i];
|
|
1725
1703
|
if (txid === mut.txid)
|
|
@@ -2385,7 +2363,8 @@ const defs = Object.assign(Object.assign(Object.assign(Object.assign({}, undefin
|
|
|
2385
2363
|
return Object.assign({ $t: 'PropModification' }, propModification['@@propmod']);
|
|
2386
2364
|
},
|
|
2387
2365
|
revive: (_a) => {
|
|
2388
|
-
var
|
|
2366
|
+
var { $t } = _a, // strip '$t'
|
|
2367
|
+
propModSpec = __rest(_a, ["$t"]) // keep the rest
|
|
2389
2368
|
;
|
|
2390
2369
|
return new PropModification(propModSpec);
|
|
2391
2370
|
},
|
|
@@ -4494,7 +4473,8 @@ function overrideParseStoresSpec(origFunc, dexie) {
|
|
|
4494
4473
|
const cloudSchema = dexie.cloud.schema || (dexie.cloud.schema = {});
|
|
4495
4474
|
const allPrefixes = new Set();
|
|
4496
4475
|
Object.keys(storesClone).forEach(tableName => {
|
|
4497
|
-
|
|
4476
|
+
var _a;
|
|
4477
|
+
const schemaSrc = (_a = storesClone[tableName]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
4498
4478
|
const cloudTableSchema = cloudSchema[tableName] || (cloudSchema[tableName] = {});
|
|
4499
4479
|
if (schemaSrc != null) {
|
|
4500
4480
|
if (/^\@/.test(schemaSrc)) {
|
|
@@ -4535,7 +4515,8 @@ function performGuardedJob(db, jobName, job) {
|
|
|
4535
4515
|
// No support for guarding jobs. IE11, node.js, etc.
|
|
4536
4516
|
return job();
|
|
4537
4517
|
}
|
|
4538
|
-
|
|
4518
|
+
// @ts-expect-error - LockManager callback type inference issue with generics
|
|
4519
|
+
return navigator.locks.request(db.name + '|' + jobName, job);
|
|
4539
4520
|
}
|
|
4540
4521
|
|
|
4541
4522
|
function performInitialSync(db, cloudOptions, cloudSchema) {
|
|
@@ -5290,12 +5271,9 @@ function verifySchema(db) {
|
|
|
5290
5271
|
}
|
|
5291
5272
|
}
|
|
5292
5273
|
|
|
5293
|
-
var n,l$1,u$1,t$1,o$1,f$1={},e$1=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s$1(n,l){for(var u in l)n[u]=l[u];return n}function a$1(n){var l=n.parentNode;l&&l.removeChild(n);}function h(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _$1(n,l){if(null==l)return n.__?_$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_$1(n):null}function k$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$1.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s$1({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_$1(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$1,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$1(k,s,n):s=A(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_$1(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=_$1(i,h+1)),N(x[h],x[h]));if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$1(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$1(i,l,u):A(u,i,i,t,i.__e,l));return l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c$1.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$1(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);try{n:if("function"==typeof H){if(g=u.props,m=(a=H.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in H&&H.prototype.render?u.__c=h=new H(g,x):(u.__c=h=new d$1(g,x),h.constructor=H,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=H.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s$1({},h.__s)),s$1(h.__s,H.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==H.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==H.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,A=l$1.__r,C=0,"prototype"in H&&H.prototype.render)h.state=h.__s,h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context);else do{h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++C<25);h.state=h.__s,null!=h.getChildContext&&(t=s$1(s$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),$=null!=a&&a.type===p$1&&null==a.key?a.props.children:a,w$1(n,Array.isArray($)?$:[$],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l$1.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),h=(y=i.props||f$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w$1(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_$1(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a$1(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||a$1(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j$1(i,u=(!o&&t||i).__k=h(p$1,null,[u]),r||f$1,f$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z$1(e,u);}n=e$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,d$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s$1({},this.state),"function"==typeof n&&(n=n(s$1({},u),this.props)),n&&s$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b$1(this));},d$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b$1(this));},d$1.prototype.render=p$1,t$1=[],g$1.__r=0;
|
|
5274
|
+
var n,l$1,u$1,i$1,r$1,o$1,e$1,f$1,c$1,s$1,a$1,p$1={},v$1=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w$1=Array.isArray;function d$1(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function _$1(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return m$1(l,e,i,r,null)}function m$1(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$1:o,__i:-1,__u:0};return null==o&&null!=l$1.vnode&&l$1.vnode(e),e}function k$1(n){return n.children}function x(n,l){this.props=n,this.context=l;}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?S(n):null}function C$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C$1(n)}}function M(n){(!n.__d&&(n.__d=true)&&i$1.push(n)&&!$.__r++||r$1!=l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$1)($);}function $(){for(var n,u,t,r,o,f,c,s=1;i$1.length;)i$1.length>s&&i$1.sort(e$1),n=i$1.shift(),s=i$1.length,n.__d&&(t=void 0,r=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d$1({},r)).__v=r.__v+1,l$1.vnode&&l$1.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N(f,t,c),r.__e=r.__=null,t.__e!=o&&C$1(t)));$.__r=0;}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_,m=t&&t.__k||v$1,b=l.length;for(f=P(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p$1:m[y.__i]||p$1,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B$1(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),(_=!!(4&y.__u))||h.__k===y.__k?f=A$1(y,f,n,_):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=n.__k[r]=m$1(null,o,null,null,null):w$1(o)?o=n.__k[r]=m$1(k$1,{children:o},null,null,null):null==o.constructor&&o.__b>0?o=n.__k[r]=m$1(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D$1(e,e));return t}function A$1(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=A$1(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==e||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function T$1(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px";}function j$1(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T$1(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T$1(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f$1,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c$1,n.addEventListener(l,r?a$1:s$1,r)):n.removeEventListener(l,r?a$1:s$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c$1++;else if(u.t<t.u)return;return t(l$1.event?l$1.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l$1.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=E),C&&C.sub(h),h.state||(h.state={}),h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d$1({},h.__s)),d$1(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),u.__v==t.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_);});}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l$1.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d$1(d$1({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k$1&&null==a.key&&(L=V(a.props.children)),f=I(n,w$1(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null);}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f;}else {for(T=o.length;T--;)g(o[T]);z$1(u);}else u.__e=t.__e,u.__k=t.__k,n.then||z$1(u);l$1.__e(n,u,t);}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q(t.__e,u,t,i,r,o,e,c,s);return (a=l$1.diffed)&&a(u),128&u.__u?void 0:f}function z$1(n){n&&n.__c&&(n.__c.__e=true),n&&n.__k&&n.__k.forEach(z$1);}function N(n,u,t){for(var i=0;i<t.length;i++)B$1(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function V(n){return "object"!=typeof n||null==n||n.__b&&n.__b>0?n:w$1(n)?n.map(V):d$1({},n)}function q(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props||p$1,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=false),e=null;}if(null==x)b===k||c&&u.data==k||(u.data=k);else {if(e=e&&n.call(u.childNodes),!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j$1(u,a,null,d,o);}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j$1(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w$1(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j$1(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j$1(u,a,m,b[a],o));}return u}function B$1(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function D$1(n,u,t){var i,r;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B$1(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D$1(i[r],u,t||"function"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0;}function E(n,l,u){return this.constructor(n,u)}function G(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],O(t,u=(t).__k=_$1(k$1,null,[u]),o||p$1,p$1,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),N(e,u,f);}n=v$1.slice,l$1={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d$1({},this.state),"function"==typeof n&&(n=n(d$1({},u),this.props)),n&&d$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this));},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),M(this));},x.prototype.render=k$1,i$1=[],o$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f$1=/(PointerCapture)$|Capture$/i,c$1=0,s$1=F(false),a$1=F(true);
|
|
5294
5275
|
|
|
5295
5276
|
const Styles = {
|
|
5296
|
-
Error: {
|
|
5297
|
-
color: "red",
|
|
5298
|
-
},
|
|
5299
5277
|
Alert: {
|
|
5300
5278
|
error: {
|
|
5301
5279
|
color: "red",
|
|
@@ -5414,13 +5392,13 @@ const Styles = {
|
|
|
5414
5392
|
};
|
|
5415
5393
|
|
|
5416
5394
|
function Dialog({ children, className }) {
|
|
5417
|
-
return (
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5395
|
+
return (_$1("div", { className: `dexie-dialog ${className || ''}` },
|
|
5396
|
+
_$1("div", { style: Styles.Darken }),
|
|
5397
|
+
_$1("div", { style: Styles.DialogOuter },
|
|
5398
|
+
_$1("div", { style: Styles.DialogInner }, children))));
|
|
5421
5399
|
}
|
|
5422
5400
|
|
|
5423
|
-
var t,r,u,i,o=0,
|
|
5401
|
+
var t,r,u,i,o=0,f=[],c=l$1,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function p(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,h(D,n)}function h(n,u,i){var o=p(t++,2);if(o.t=n,!o.__c&&(o.__=[D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return true;var u=o.__c.__H.__.filter(function(n){return !!n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=true);}}),c&&c.call(this,n,t,r)||i};r.__f=true;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function _(n,u){var i=p(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i));}function A(n){return o=5,T(function(){return {current:n}},[])}function T(n,r){var u=p(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function j(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[];}catch(t){n.__H.__h=[],c.__e(t,n.__v);}}c.__b=function(n){r=null,e&&e(n);},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t);},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],t=0)),u=r;},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),u=r=null;},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return !n.__||B(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c.__e(r,n.__v);}}),l&&l(n,t);},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n);}catch(n){t=n;}}),r.__H=void 0,t&&c.__e(t,r.__v));};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r));}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function B(n){var t=r;n.__c=n.__(),r=t;}function C(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return "function"==typeof t?t(n):t}
|
|
5424
5402
|
|
|
5425
5403
|
/** Resolve a message template with parameters.
|
|
5426
5404
|
*
|
|
@@ -5442,19 +5420,19 @@ function resolveText({ message, messageCode, messageParams }) {
|
|
|
5442
5420
|
|
|
5443
5421
|
const OTP_LENGTH = 8;
|
|
5444
5422
|
function LoginDialog({ title, type, alerts, fields, submitLabel, cancelLabel, onCancel, onSubmit, }) {
|
|
5445
|
-
const [params, setParams] =
|
|
5446
|
-
const firstFieldRef =
|
|
5447
|
-
|
|
5448
|
-
return (
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
alerts.map((alert) => (
|
|
5452
|
-
|
|
5423
|
+
const [params, setParams] = d({});
|
|
5424
|
+
const firstFieldRef = A(null);
|
|
5425
|
+
_(() => { var _a; return (_a = firstFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, []);
|
|
5426
|
+
return (_$1(Dialog, { className: "dxc-login-dlg" },
|
|
5427
|
+
_$1(k$1, null,
|
|
5428
|
+
_$1("h3", { style: Styles.WindowHeader }, title),
|
|
5429
|
+
alerts.map((alert) => (_$1("p", { style: Styles.Alert[alert.type] }, resolveText(alert)))),
|
|
5430
|
+
_$1("form", { onSubmit: (ev) => {
|
|
5453
5431
|
ev.preventDefault();
|
|
5454
5432
|
onSubmit(params);
|
|
5455
|
-
} }, Object.entries(fields).map(([fieldName, { type, label, placeholder }], idx) => (
|
|
5433
|
+
} }, Object.entries(fields).map(([fieldName, { type, label, placeholder }], idx) => (_$1("label", { style: Styles.Label, key: idx },
|
|
5456
5434
|
label ? `${label}: ` : '',
|
|
5457
|
-
|
|
5435
|
+
_$1("input", { ref: idx === 0 ? firstFieldRef : undefined, type: type, name: fieldName, autoComplete: "on", style: Styles.Input, autoFocus: true, placeholder: placeholder, value: params[fieldName] || '', onInput: (ev) => {
|
|
5458
5436
|
var _a;
|
|
5459
5437
|
const value = valueTransformer(type, (_a = ev.target) === null || _a === void 0 ? void 0 : _a['value']);
|
|
5460
5438
|
let updatedParams = Object.assign(Object.assign({}, params), { [fieldName]: value });
|
|
@@ -5464,10 +5442,10 @@ function LoginDialog({ title, type, alerts, fields, submitLabel, cancelLabel, on
|
|
|
5464
5442
|
onSubmit(updatedParams);
|
|
5465
5443
|
}
|
|
5466
5444
|
} })))))),
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
cancelLabel && (
|
|
5445
|
+
_$1("div", { style: Styles.ButtonsDiv },
|
|
5446
|
+
_$1(k$1, null,
|
|
5447
|
+
_$1("button", { type: "submit", style: Styles.PrimaryButton, onClick: () => onSubmit(params) }, submitLabel),
|
|
5448
|
+
cancelLabel && (_$1("button", { style: Styles.Button, onClick: onCancel }, cancelLabel))))));
|
|
5471
5449
|
}
|
|
5472
5450
|
function valueTransformer(type, value) {
|
|
5473
5451
|
switch (type) {
|
|
@@ -5480,7 +5458,7 @@ function valueTransformer(type, value) {
|
|
|
5480
5458
|
}
|
|
5481
5459
|
}
|
|
5482
5460
|
|
|
5483
|
-
class LoginGui extends
|
|
5461
|
+
class LoginGui extends x {
|
|
5484
5462
|
constructor(props) {
|
|
5485
5463
|
super(props);
|
|
5486
5464
|
this.observer = (userInteraction) => this.setState({ userInteraction });
|
|
@@ -5499,7 +5477,7 @@ class LoginGui extends d$1 {
|
|
|
5499
5477
|
if (!userInteraction)
|
|
5500
5478
|
return null;
|
|
5501
5479
|
//if (props.db.cloud.userInteraction.observers.length > 1) return null; // Someone else subscribes.
|
|
5502
|
-
return
|
|
5480
|
+
return _$1(LoginDialog, Object.assign({}, userInteraction));
|
|
5503
5481
|
}
|
|
5504
5482
|
}
|
|
5505
5483
|
function setupDefaultGUI(db) {
|
|
@@ -5507,13 +5485,13 @@ function setupDefaultGUI(db) {
|
|
|
5507
5485
|
const el = document.createElement('div');
|
|
5508
5486
|
if (document.body) {
|
|
5509
5487
|
document.body.appendChild(el);
|
|
5510
|
-
|
|
5488
|
+
G(_$1(LoginGui, { db: db.vip }), el);
|
|
5511
5489
|
}
|
|
5512
5490
|
else {
|
|
5513
5491
|
addEventListener('DOMContentLoaded', () => {
|
|
5514
5492
|
if (!closed) {
|
|
5515
5493
|
document.body.appendChild(el);
|
|
5516
|
-
|
|
5494
|
+
G(_$1(LoginGui, { db: db.vip }), el);
|
|
5517
5495
|
}
|
|
5518
5496
|
});
|
|
5519
5497
|
}
|
|
@@ -6268,7 +6246,7 @@ function dexieCloud(dexie) {
|
|
|
6268
6246
|
const syncComplete = new Subject();
|
|
6269
6247
|
dexie.cloud = {
|
|
6270
6248
|
// @ts-ignore
|
|
6271
|
-
version: "4.2.
|
|
6249
|
+
version: "4.2.5",
|
|
6272
6250
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
6273
6251
|
schema: null,
|
|
6274
6252
|
get currentUserId() {
|
|
@@ -6585,7 +6563,7 @@ function dexieCloud(dexie) {
|
|
|
6585
6563
|
}
|
|
6586
6564
|
}
|
|
6587
6565
|
// @ts-ignore
|
|
6588
|
-
dexieCloud.version = "4.2.
|
|
6566
|
+
dexieCloud.version = "4.2.5";
|
|
6589
6567
|
Dexie.Cloud = dexieCloud;
|
|
6590
6568
|
|
|
6591
6569
|
export { dexieCloud as default, defineYDocTrigger, dexieCloud, getTiedObjectId, getTiedRealmId, resolveText };
|