@pol-studios/db 1.0.58 → 1.0.61
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/DataLayerContext-V5FotiSk.d.ts +563 -0
- package/dist/auth/context.js +2 -2
- package/dist/auth/hooks.js +3 -3
- package/dist/auth/index.js +3 -3
- package/dist/{chunk-YRIPM2AN.js → chunk-4PZ744G2.js} +207 -6
- package/dist/chunk-4PZ744G2.js.map +1 -0
- package/dist/{chunk-OK2C54B6.js → chunk-7PBTPCRN.js} +340 -386
- package/dist/chunk-7PBTPCRN.js.map +1 -0
- package/dist/{chunk-6SDH7M7J.js → chunk-ARALLEDJ.js} +2 -2
- package/dist/{chunk-Z456IHCB.js → chunk-F4HW4NT5.js} +1 -1
- package/dist/chunk-F4HW4NT5.js.map +1 -0
- package/dist/{chunk-LG3OHLGB.js → chunk-FWCHS5NN.js} +16 -337
- package/dist/chunk-FWCHS5NN.js.map +1 -0
- package/dist/{chunk-4EO55YV2.js → chunk-H4Z73DC4.js} +4 -4
- package/dist/{chunk-GWYTROSD.js → chunk-L4DFVMTS.js} +335 -4
- package/dist/chunk-L4DFVMTS.js.map +1 -0
- package/dist/{chunk-7BGDQT5X.js → chunk-PIPB3JMK.js} +1 -7
- package/dist/{chunk-7BGDQT5X.js.map → chunk-PIPB3JMK.js.map} +1 -1
- package/dist/{chunk-MEBT5YHA.js → chunk-SNPZMRBC.js} +2 -2
- package/dist/{chunk-VYFAMTHI.js → chunk-ZPFZ2ZRW.js} +4 -13
- package/dist/{chunk-VYFAMTHI.js.map → chunk-ZPFZ2ZRW.js.map} +1 -1
- package/dist/core/index.d.ts +8 -44
- package/dist/{executor-D15yjeMo.d.ts → executor-Bu1OlqCl.d.ts} +43 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +2 -2
- package/dist/{index-CFUuTzXO.d.ts → index-vwVJ0BWj.d.ts} +1 -9
- package/dist/index.d.ts +5 -5
- package/dist/index.js +21 -13
- package/dist/index.native.d.ts +77 -76
- package/dist/index.native.js +20 -12
- package/dist/index.web.d.ts +21 -44
- package/dist/index.web.js +215 -156
- package/dist/index.web.js.map +1 -1
- package/dist/powersync-bridge/index.d.ts +1 -1
- package/dist/powersync-bridge/index.js +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/query/index.js +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +1 -1
- package/dist/{useDbCount-Ckb-FhZk.d.ts → useDbCount-dCkdaBpP.d.ts} +41 -83
- package/dist/{useResolveFeedback-CuUkdHoR.d.ts → useResolveFeedback-thFi-4h8.d.ts} +429 -5
- package/dist/with-auth/index.js +5 -5
- package/package.json +1 -1
- package/dist/DataLayerContext-BYZtDD0g.d.ts +0 -946
- package/dist/chunk-GWYTROSD.js.map +0 -1
- package/dist/chunk-LG3OHLGB.js.map +0 -1
- package/dist/chunk-OK2C54B6.js.map +0 -1
- package/dist/chunk-YRIPM2AN.js.map +0 -1
- package/dist/chunk-Z456IHCB.js.map +0 -1
- /package/dist/{chunk-6SDH7M7J.js.map → chunk-ARALLEDJ.js.map} +0 -0
- /package/dist/{chunk-4EO55YV2.js.map → chunk-H4Z73DC4.js.map} +0 -0
- /package/dist/{chunk-MEBT5YHA.js.map → chunk-SNPZMRBC.js.map} +0 -0
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
createAdapterRegistry,
|
|
2
|
+
SyncTrackingAdapter,
|
|
4
3
|
createSupabaseAdapter,
|
|
4
|
+
getPowerSyncAlias,
|
|
5
5
|
stripSchemaPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FWCHS5NN.js";
|
|
7
7
|
import {
|
|
8
8
|
DataLayerContext,
|
|
9
9
|
DataLayerCoreContext,
|
|
10
10
|
DataLayerNestingContext,
|
|
11
11
|
DataLayerStatusContext
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-L4DFVMTS.js";
|
|
13
13
|
import {
|
|
14
|
-
QueryExecutor
|
|
15
|
-
|
|
14
|
+
QueryExecutor,
|
|
15
|
+
transformResultsFromStorage,
|
|
16
|
+
transformWithRelations
|
|
17
|
+
} from "./chunk-4PZ744G2.js";
|
|
16
18
|
import {
|
|
17
19
|
extractRelationNames,
|
|
18
20
|
parseSelect
|
|
@@ -1000,112 +1002,6 @@ var require_es = __commonJS({
|
|
|
1000
1002
|
}
|
|
1001
1003
|
});
|
|
1002
1004
|
|
|
1003
|
-
// src/utils/type-transformer.ts
|
|
1004
|
-
var columnMapCache = /* @__PURE__ */ new WeakMap();
|
|
1005
|
-
function getOrCreateSchemaCache(schema) {
|
|
1006
|
-
let cache = columnMapCache.get(schema);
|
|
1007
|
-
if (!cache) {
|
|
1008
|
-
cache = /* @__PURE__ */ new Map();
|
|
1009
|
-
columnMapCache.set(schema, cache);
|
|
1010
|
-
}
|
|
1011
|
-
return cache;
|
|
1012
|
-
}
|
|
1013
|
-
function transformValueFromStorage(value, columnInfo) {
|
|
1014
|
-
if (value === null || value === void 0) {
|
|
1015
|
-
return value;
|
|
1016
|
-
}
|
|
1017
|
-
switch (columnInfo.type) {
|
|
1018
|
-
case "boolean":
|
|
1019
|
-
if (typeof value === "number") {
|
|
1020
|
-
return value === 1;
|
|
1021
|
-
}
|
|
1022
|
-
if (typeof value === "string") {
|
|
1023
|
-
return value === "1" || value.toLowerCase() === "true";
|
|
1024
|
-
}
|
|
1025
|
-
return Boolean(value);
|
|
1026
|
-
case "number":
|
|
1027
|
-
if (typeof value === "string") {
|
|
1028
|
-
const num = Number(value);
|
|
1029
|
-
return isNaN(num) ? value : num;
|
|
1030
|
-
}
|
|
1031
|
-
return value;
|
|
1032
|
-
case "date":
|
|
1033
|
-
return value;
|
|
1034
|
-
case "enum":
|
|
1035
|
-
case "string":
|
|
1036
|
-
default:
|
|
1037
|
-
return value;
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
function getColumnInfoMap(schema, tableName) {
|
|
1041
|
-
const cache = getOrCreateSchemaCache(schema);
|
|
1042
|
-
if (cache.has(tableName)) {
|
|
1043
|
-
return cache.get(tableName);
|
|
1044
|
-
}
|
|
1045
|
-
const columnMap = /* @__PURE__ */ new Map();
|
|
1046
|
-
for (const schemaName of Object.keys(schema.schemas)) {
|
|
1047
|
-
const schemaData = schema.schemas[schemaName];
|
|
1048
|
-
const table = schemaData.tables?.[tableName];
|
|
1049
|
-
if (table) {
|
|
1050
|
-
for (const col of table.columns) {
|
|
1051
|
-
columnMap.set(col.name, col);
|
|
1052
|
-
}
|
|
1053
|
-
cache.set(tableName, columnMap);
|
|
1054
|
-
return columnMap;
|
|
1055
|
-
}
|
|
1056
|
-
const view = schemaData.views?.[tableName];
|
|
1057
|
-
if (view) {
|
|
1058
|
-
for (const col of view.columns) {
|
|
1059
|
-
columnMap.set(col.name, col);
|
|
1060
|
-
}
|
|
1061
|
-
cache.set(tableName, columnMap);
|
|
1062
|
-
return columnMap;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
cache.set(tableName, null);
|
|
1066
|
-
return null;
|
|
1067
|
-
}
|
|
1068
|
-
function transformRowFromStorage(row, schema, tableName) {
|
|
1069
|
-
const columnMap = getColumnInfoMap(schema, tableName);
|
|
1070
|
-
if (!columnMap) {
|
|
1071
|
-
return row;
|
|
1072
|
-
}
|
|
1073
|
-
const result = {};
|
|
1074
|
-
for (const [key, value] of Object.entries(row)) {
|
|
1075
|
-
const columnInfo = columnMap.get(key);
|
|
1076
|
-
if (columnInfo) {
|
|
1077
|
-
result[key] = transformValueFromStorage(value, columnInfo);
|
|
1078
|
-
} else {
|
|
1079
|
-
result[key] = value;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
return result;
|
|
1083
|
-
}
|
|
1084
|
-
function transformResultsFromStorage(rows, schema, tableName) {
|
|
1085
|
-
return rows.map((row) => transformRowFromStorage(row, schema, tableName));
|
|
1086
|
-
}
|
|
1087
|
-
function transformWithRelations(row, schema, tableName) {
|
|
1088
|
-
const columnMap = getColumnInfoMap(schema, tableName);
|
|
1089
|
-
const result = {};
|
|
1090
|
-
for (const [key, value] of Object.entries(row)) {
|
|
1091
|
-
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
1092
|
-
result[key] = transformWithRelations(value, schema, key);
|
|
1093
|
-
} else if (Array.isArray(value) && value.length > 0 && typeof value[0] === "object") {
|
|
1094
|
-
result[key] = value.map((item) => transformWithRelations(item, schema, key));
|
|
1095
|
-
} else if (columnMap) {
|
|
1096
|
-
const columnInfo = columnMap.get(key);
|
|
1097
|
-
if (columnInfo) {
|
|
1098
|
-
result[key] = transformValueFromStorage(value, columnInfo);
|
|
1099
|
-
} else {
|
|
1100
|
-
result[key] = value;
|
|
1101
|
-
}
|
|
1102
|
-
} else {
|
|
1103
|
-
result[key] = value;
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
return result;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
1005
|
// src/adapters/powersync-adapter.ts
|
|
1110
1006
|
import stringify from "fast-json-stable-stringify";
|
|
1111
1007
|
var DEFAULT_MAX_SUBSCRIPTIONS = 100;
|
|
@@ -1120,7 +1016,6 @@ var PowerSyncAdapter = class {
|
|
|
1120
1016
|
constructor(db, schema, options) {
|
|
1121
1017
|
this.db = db;
|
|
1122
1018
|
this.schema = schema;
|
|
1123
|
-
this.executor = new QueryExecutor(db, schema);
|
|
1124
1019
|
if (typeof options === "function") {
|
|
1125
1020
|
this.tableNameResolver = options;
|
|
1126
1021
|
this.maxSubscriptions = DEFAULT_MAX_SUBSCRIPTIONS;
|
|
@@ -1128,6 +1023,7 @@ var PowerSyncAdapter = class {
|
|
|
1128
1023
|
this.tableNameResolver = options?.tableNameResolver;
|
|
1129
1024
|
this.maxSubscriptions = options?.maxSubscriptions ?? DEFAULT_MAX_SUBSCRIPTIONS;
|
|
1130
1025
|
}
|
|
1026
|
+
this.executor = new QueryExecutor(db, schema, this.tableNameResolver);
|
|
1131
1027
|
}
|
|
1132
1028
|
/**
|
|
1133
1029
|
* Unique identifier for this adapter type
|
|
@@ -1494,12 +1390,13 @@ var PowerSyncAdapter = class {
|
|
|
1494
1390
|
return this.schema;
|
|
1495
1391
|
}
|
|
1496
1392
|
};
|
|
1497
|
-
function createPowerSyncAdapter(db, schema) {
|
|
1498
|
-
return new PowerSyncAdapter(db, schema);
|
|
1393
|
+
function createPowerSyncAdapter(db, schema, options) {
|
|
1394
|
+
return new PowerSyncAdapter(db, schema, options);
|
|
1499
1395
|
}
|
|
1500
1396
|
|
|
1501
1397
|
// src/providers/DataLayerProvider.tsx
|
|
1502
|
-
import {
|
|
1398
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1399
|
+
import { useRef, useEffect, useContext } from "react";
|
|
1503
1400
|
import { jsx } from "react/jsx-runtime";
|
|
1504
1401
|
var defaultSyncStatus = {
|
|
1505
1402
|
isConnected: false,
|
|
@@ -1521,289 +1418,346 @@ var defaultSyncControl = {
|
|
|
1521
1418
|
setScope: async () => {
|
|
1522
1419
|
console.warn("Scope control not available: PowerSync not initialized");
|
|
1523
1420
|
},
|
|
1524
|
-
// Auto-retry controls
|
|
1525
|
-
pauseAutoRetry: () => {
|
|
1526
|
-
console.warn("Pause auto-retry not available: PowerSync not initialized");
|
|
1527
|
-
},
|
|
1528
|
-
resumeAutoRetry: () => {
|
|
1529
|
-
console.warn("Resume auto-retry not available: PowerSync not initialized");
|
|
1530
|
-
},
|
|
1531
|
-
isAutoRetryPaused: false,
|
|
1532
|
-
// Pending mutations
|
|
1533
1421
|
addPendingMutation: () => {
|
|
1534
1422
|
},
|
|
1535
1423
|
removePendingMutation: () => {
|
|
1536
1424
|
}
|
|
1537
1425
|
};
|
|
1538
|
-
function DataLayerProvider({
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
}
|
|
1426
|
+
function DataLayerProvider(t0) {
|
|
1427
|
+
const $ = _c(70);
|
|
1428
|
+
const {
|
|
1429
|
+
config,
|
|
1430
|
+
children,
|
|
1431
|
+
powerSyncInstance: t1,
|
|
1432
|
+
supabaseClient,
|
|
1433
|
+
queryClient,
|
|
1434
|
+
syncControl: externalSyncControl,
|
|
1435
|
+
powerSyncSyncStatus
|
|
1436
|
+
} = t0;
|
|
1437
|
+
const powerSyncInstance = t1 === void 0 ? null : t1;
|
|
1438
|
+
const hasSynced = powerSyncSyncStatus?.hasSynced ?? (powerSyncInstance ? false : true);
|
|
1439
|
+
const isOnline = powerSyncSyncStatus?.isOnline ?? (typeof navigator !== "undefined" ? navigator.onLine : false);
|
|
1549
1440
|
const isNested = useContext(DataLayerNestingContext);
|
|
1550
1441
|
const hasWarnedNesting = useRef(false);
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1442
|
+
let t2;
|
|
1443
|
+
let t3;
|
|
1444
|
+
if ($[0] !== isNested) {
|
|
1445
|
+
t2 = () => {
|
|
1446
|
+
if (isNested && !hasWarnedNesting.current && typeof __DEV__ !== "undefined" && __DEV__) {
|
|
1447
|
+
hasWarnedNesting.current = true;
|
|
1448
|
+
console.warn("[DataLayerProvider] Nested DataLayerProvider detected! This usually indicates a setup issue. Remove the outer wrapper.");
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
t3 = [isNested];
|
|
1452
|
+
$[0] = isNested;
|
|
1453
|
+
$[1] = t2;
|
|
1454
|
+
$[2] = t3;
|
|
1455
|
+
} else {
|
|
1456
|
+
t2 = $[1];
|
|
1457
|
+
t3 = $[2];
|
|
1554
1458
|
}
|
|
1555
|
-
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1459
|
+
useEffect(t2, t3);
|
|
1460
|
+
const syncControl = externalSyncControl ?? defaultSyncControl;
|
|
1461
|
+
let t4;
|
|
1462
|
+
if ($[3] !== config.tables) {
|
|
1463
|
+
t4 = (table) => {
|
|
1464
|
+
const tableWithoutSchema = table.includes(".") ? stripSchemaPrefix(table) : table;
|
|
1465
|
+
return config.tables[table] ?? config.tables[tableWithoutSchema];
|
|
1466
|
+
};
|
|
1467
|
+
$[3] = config.tables;
|
|
1468
|
+
$[4] = t4;
|
|
1469
|
+
} else {
|
|
1470
|
+
t4 = $[4];
|
|
1471
|
+
}
|
|
1472
|
+
const getTableStrategy = t4;
|
|
1473
|
+
let t5;
|
|
1474
|
+
if ($[5] !== config.tables) {
|
|
1475
|
+
t5 = (table_0) => {
|
|
1476
|
+
const tableWithoutSchema_0 = table_0.includes(".") ? stripSchemaPrefix(table_0) : table_0;
|
|
1477
|
+
const strategy = config.tables[table_0] ?? config.tables[tableWithoutSchema_0];
|
|
1478
|
+
const configKey = config.tables[table_0] ? table_0 : tableWithoutSchema_0;
|
|
1479
|
+
return getPowerSyncAlias(configKey, strategy);
|
|
1480
|
+
};
|
|
1481
|
+
$[5] = config.tables;
|
|
1482
|
+
$[6] = t5;
|
|
1483
|
+
} else {
|
|
1484
|
+
t5 = $[6];
|
|
1485
|
+
}
|
|
1486
|
+
const getTableAlias = t5;
|
|
1487
|
+
let t6;
|
|
1488
|
+
if ($[7] !== config.schema || $[8] !== supabaseClient) {
|
|
1489
|
+
t6 = createSupabaseAdapter(supabaseClient, config.schema);
|
|
1490
|
+
$[7] = config.schema;
|
|
1491
|
+
$[8] = supabaseClient;
|
|
1492
|
+
$[9] = t6;
|
|
1493
|
+
} else {
|
|
1494
|
+
t6 = $[9];
|
|
1495
|
+
}
|
|
1496
|
+
const supabaseAdapter = t6;
|
|
1497
|
+
let powerSyncAdapter = null;
|
|
1498
|
+
let syncTrackingAdapter = null;
|
|
1499
|
+
if (powerSyncInstance) {
|
|
1500
|
+
if ($[10] !== config.schema || $[11] !== externalSyncControl || $[12] !== getTableAlias || $[13] !== powerSyncInstance) {
|
|
1501
|
+
powerSyncAdapter = createPowerSyncAdapter(powerSyncInstance, config.schema, {
|
|
1502
|
+
tableNameResolver: getTableAlias
|
|
1578
1503
|
});
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
registry.setPowerSyncAdapter(powerSyncAdapter);
|
|
1504
|
+
if (externalSyncControl?.addPendingMutation) {
|
|
1505
|
+
syncTrackingAdapter = new SyncTrackingAdapter(powerSyncAdapter, {
|
|
1506
|
+
addPendingMutation: externalSyncControl.addPendingMutation,
|
|
1507
|
+
removePendingMutation: externalSyncControl.removePendingMutation
|
|
1508
|
+
});
|
|
1585
1509
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
});
|
|
1596
|
-
registry.initializeAutoDetection(detector);
|
|
1597
|
-
const detection = detector.detect();
|
|
1598
|
-
setStatus({
|
|
1599
|
-
isInitialized: true,
|
|
1600
|
-
currentBackend: detection.recommendedBackend,
|
|
1601
|
-
powerSyncStatus: detection.powerSyncStatus,
|
|
1602
|
-
isOnline: detection.isOnline,
|
|
1603
|
-
lastDetection: detection,
|
|
1604
|
-
error: null,
|
|
1605
|
-
hasSynced: false
|
|
1606
|
-
// Will be updated by Sync Status Update Effect
|
|
1607
|
-
});
|
|
1608
|
-
} catch (error) {
|
|
1609
|
-
const err = error instanceof Error ? error : new Error(String(error));
|
|
1610
|
-
setStatus((prev) => ({
|
|
1611
|
-
...prev,
|
|
1612
|
-
error: err
|
|
1613
|
-
}));
|
|
1614
|
-
onError?.(err);
|
|
1615
|
-
}
|
|
1616
|
-
}, [powerSyncInstance, supabaseClient, queryClient, config.schema, registry, onError]);
|
|
1617
|
-
useEffect(() => {
|
|
1618
|
-
if (powerSyncSyncStatus?.isOnline !== void 0) {
|
|
1619
|
-
return;
|
|
1510
|
+
$[10] = config.schema;
|
|
1511
|
+
$[11] = externalSyncControl;
|
|
1512
|
+
$[12] = getTableAlias;
|
|
1513
|
+
$[13] = powerSyncInstance;
|
|
1514
|
+
$[14] = powerSyncAdapter;
|
|
1515
|
+
$[15] = syncTrackingAdapter;
|
|
1516
|
+
} else {
|
|
1517
|
+
powerSyncAdapter = $[14];
|
|
1518
|
+
syncTrackingAdapter = $[15];
|
|
1620
1519
|
}
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
setStatus((prev) => ({
|
|
1629
|
-
...prev,
|
|
1630
|
-
currentBackend: detection.recommendedBackend,
|
|
1631
|
-
powerSyncStatus: detection.powerSyncStatus,
|
|
1632
|
-
lastDetection: detection
|
|
1633
|
-
}));
|
|
1634
|
-
}
|
|
1520
|
+
}
|
|
1521
|
+
let t7;
|
|
1522
|
+
if ($[16] !== powerSyncAdapter || $[17] !== supabaseAdapter || $[18] !== syncTrackingAdapter) {
|
|
1523
|
+
t7 = {
|
|
1524
|
+
supabase: supabaseAdapter,
|
|
1525
|
+
powerSync: powerSyncAdapter,
|
|
1526
|
+
syncTracking: syncTrackingAdapter
|
|
1635
1527
|
};
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
}
|
|
1528
|
+
$[16] = powerSyncAdapter;
|
|
1529
|
+
$[17] = supabaseAdapter;
|
|
1530
|
+
$[18] = syncTrackingAdapter;
|
|
1531
|
+
$[19] = t7;
|
|
1532
|
+
} else {
|
|
1533
|
+
t7 = $[19];
|
|
1534
|
+
}
|
|
1535
|
+
const adapters = t7;
|
|
1536
|
+
let t8;
|
|
1537
|
+
if ($[20] !== getTableStrategy) {
|
|
1538
|
+
t8 = (table_1) => {
|
|
1539
|
+
const strategy_0 = getTableStrategy(table_1);
|
|
1540
|
+
return strategy_0?.strategy === "powersync" || strategy_0?.strategy === "hybrid" || strategy_0?.strategy === "auto" || !strategy_0;
|
|
1650
1541
|
};
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
useEffect(() => {
|
|
1675
|
-
const currentDetector = registry.getAutoDetector();
|
|
1676
|
-
if (!currentDetector) return;
|
|
1677
|
-
if (powerSyncInstance && currentDetector.getPowerSync() !== powerSyncInstance) {
|
|
1678
|
-
currentDetector.setPowerSyncDb(powerSyncInstance);
|
|
1679
|
-
}
|
|
1680
|
-
currentDetector.updateSyncStatus(powerSyncSyncStatus ?? null);
|
|
1681
|
-
setStatus((prev) => {
|
|
1682
|
-
const newHasSynced = powerSyncSyncStatus?.hasSynced ?? false;
|
|
1683
|
-
const newIsOnline = powerSyncSyncStatus?.isOnline;
|
|
1684
|
-
const hasSyncedChanged = prev.hasSynced !== newHasSynced;
|
|
1685
|
-
const isOnlineChanged = newIsOnline !== void 0 && prev.isOnline !== newIsOnline;
|
|
1686
|
-
if (!hasSyncedChanged && !isOnlineChanged) {
|
|
1687
|
-
return prev;
|
|
1542
|
+
$[20] = getTableStrategy;
|
|
1543
|
+
$[21] = t8;
|
|
1544
|
+
} else {
|
|
1545
|
+
t8 = $[21];
|
|
1546
|
+
}
|
|
1547
|
+
const usesPowerSync = t8;
|
|
1548
|
+
let t9;
|
|
1549
|
+
if ($[22] !== config.tables) {
|
|
1550
|
+
t9 = () => Object.entries(config.tables).filter(_temp).map(_temp2);
|
|
1551
|
+
$[22] = config.tables;
|
|
1552
|
+
$[23] = t9;
|
|
1553
|
+
} else {
|
|
1554
|
+
t9 = $[23];
|
|
1555
|
+
}
|
|
1556
|
+
const getPowerSyncTables = t9;
|
|
1557
|
+
let t10;
|
|
1558
|
+
if ($[24] !== adapters.powerSync || $[25] !== adapters.supabase || $[26] !== adapters.syncTracking || $[27] !== config.tables || $[28] !== hasSynced || $[29] !== isOnline) {
|
|
1559
|
+
t10 = (table_2, t112) => {
|
|
1560
|
+
t112 === void 0 ? "read" : t112;
|
|
1561
|
+
const tableWithoutSchema_1 = table_2.includes(".") ? stripSchemaPrefix(table_2) : table_2;
|
|
1562
|
+
const strategy_3 = config.tables[table_2] ?? config.tables[tableWithoutSchema_1];
|
|
1563
|
+
if (strategy_3?.strategy === "supabase") {
|
|
1564
|
+
return adapters.supabase;
|
|
1688
1565
|
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1566
|
+
if (strategy_3?.strategy === "cached") {
|
|
1567
|
+
return adapters.supabase;
|
|
1568
|
+
}
|
|
1569
|
+
if (strategy_3?.strategy === "powersync") {
|
|
1570
|
+
if (adapters.powerSync) {
|
|
1571
|
+
return adapters.syncTracking ?? adapters.powerSync;
|
|
1694
1572
|
}
|
|
1695
|
-
|
|
1696
|
-
});
|
|
1697
|
-
}, [
|
|
1698
|
-
// Note: We use registry.getAutoDetector() instead of autoDetector state
|
|
1699
|
-
// to avoid race conditions. The registry is stable and always has the latest detector.
|
|
1700
|
-
registry,
|
|
1701
|
-
powerSyncInstance,
|
|
1702
|
-
powerSyncSyncStatus?.hasSynced,
|
|
1703
|
-
powerSyncSyncStatus?.connected,
|
|
1704
|
-
powerSyncSyncStatus?.connecting,
|
|
1705
|
-
powerSyncSyncStatus?.isOnline
|
|
1706
|
-
]);
|
|
1707
|
-
useEffect(() => {
|
|
1708
|
-
if (registry) {
|
|
1709
|
-
registry.setSyncTracker({
|
|
1710
|
-
addPendingMutation: resolvedSyncControl.addPendingMutation,
|
|
1711
|
-
removePendingMutation: resolvedSyncControl.removePendingMutation
|
|
1712
|
-
});
|
|
1713
|
-
}
|
|
1714
|
-
}, [resolvedSyncControl, registry]);
|
|
1715
|
-
useEffect(() => {
|
|
1716
|
-
if (status.isInitialized && !status.error && onInitialized) {
|
|
1717
|
-
const contextValue2 = buildContextValue();
|
|
1718
|
-
if (contextValue2) {
|
|
1719
|
-
onInitialized(contextValue2);
|
|
1573
|
+
return adapters.supabase;
|
|
1720
1574
|
}
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1575
|
+
const isAutoTable = !strategy_3 || strategy_3.strategy === "auto" || strategy_3.strategy === "hybrid";
|
|
1576
|
+
if (isAutoTable) {
|
|
1577
|
+
const powerSyncTableKeys = Object.keys(config.tables).filter((key_0) => {
|
|
1578
|
+
const s = config.tables[key_0];
|
|
1579
|
+
return s.strategy === "powersync" || s.strategy === "hybrid" || s.strategy === "auto";
|
|
1580
|
+
});
|
|
1581
|
+
const isConfigured = powerSyncTableKeys.some((key_1) => key_1 === table_2 || key_1 === tableWithoutSchema_1 || key_1.includes(".") && key_1.split(".")[1] === tableWithoutSchema_1);
|
|
1582
|
+
if (!isConfigured) {
|
|
1583
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
1584
|
+
console.warn(`[DataLayerProvider] Table "${table_2}" is not configured for PowerSync. Using Supabase fallback.`);
|
|
1585
|
+
}
|
|
1586
|
+
return adapters.supabase;
|
|
1587
|
+
}
|
|
1588
|
+
if (isOnline && !hasSynced) {
|
|
1589
|
+
return adapters.supabase;
|
|
1590
|
+
}
|
|
1591
|
+
if (adapters.powerSync) {
|
|
1592
|
+
return adapters.syncTracking ?? adapters.powerSync;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
if (!adapters.supabase) {
|
|
1596
|
+
throw new Error(`No adapter available for table "${table_2}". Ensure Supabase client is properly initialized.`);
|
|
1597
|
+
}
|
|
1598
|
+
return adapters.supabase;
|
|
1599
|
+
};
|
|
1600
|
+
$[24] = adapters.powerSync;
|
|
1601
|
+
$[25] = adapters.supabase;
|
|
1602
|
+
$[26] = adapters.syncTracking;
|
|
1603
|
+
$[27] = config.tables;
|
|
1604
|
+
$[28] = hasSynced;
|
|
1605
|
+
$[29] = isOnline;
|
|
1606
|
+
$[30] = t10;
|
|
1607
|
+
} else {
|
|
1608
|
+
t10 = $[30];
|
|
1609
|
+
}
|
|
1610
|
+
const getAdapter = t10;
|
|
1611
|
+
let t11;
|
|
1612
|
+
if ($[31] !== adapters.powerSync || $[32] !== config.tables || $[33] !== getPowerSyncTables) {
|
|
1613
|
+
t11 = () => ({
|
|
1614
|
+
isInitialized: true,
|
|
1615
|
+
hasPowerSync: adapters.powerSync !== null,
|
|
1616
|
+
hasSupabase: true,
|
|
1617
|
+
configuredTableCount: Object.keys(config.tables).length,
|
|
1618
|
+
powerSyncTables: getPowerSyncTables()
|
|
1619
|
+
});
|
|
1620
|
+
$[31] = adapters.powerSync;
|
|
1621
|
+
$[32] = config.tables;
|
|
1622
|
+
$[33] = getPowerSyncTables;
|
|
1623
|
+
$[34] = t11;
|
|
1624
|
+
} else {
|
|
1625
|
+
t11 = $[34];
|
|
1626
|
+
}
|
|
1627
|
+
let t12;
|
|
1628
|
+
if ($[35] !== config || $[36] !== getAdapter || $[37] !== getPowerSyncTables || $[38] !== getTableAlias || $[39] !== getTableStrategy || $[40] !== t11 || $[41] !== usesPowerSync) {
|
|
1629
|
+
t12 = {
|
|
1735
1630
|
getAdapter,
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1631
|
+
getTableStrategy,
|
|
1632
|
+
usesPowerSync,
|
|
1633
|
+
getPowerSyncTables,
|
|
1634
|
+
getTableAlias,
|
|
1635
|
+
getDebugInfo: t11,
|
|
1636
|
+
config,
|
|
1637
|
+
isInitialized: true
|
|
1743
1638
|
};
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1639
|
+
$[35] = config;
|
|
1640
|
+
$[36] = getAdapter;
|
|
1641
|
+
$[37] = getPowerSyncTables;
|
|
1642
|
+
$[38] = getTableAlias;
|
|
1643
|
+
$[39] = getTableStrategy;
|
|
1644
|
+
$[40] = t11;
|
|
1645
|
+
$[41] = usesPowerSync;
|
|
1646
|
+
$[42] = t12;
|
|
1647
|
+
} else {
|
|
1648
|
+
t12 = $[42];
|
|
1649
|
+
}
|
|
1650
|
+
const registry = t12;
|
|
1651
|
+
let t13;
|
|
1652
|
+
if ($[43] !== config.schema || $[44] !== getAdapter || $[45] !== powerSyncInstance || $[46] !== queryClient || $[47] !== registry || $[48] !== supabaseClient || $[49] !== syncControl) {
|
|
1653
|
+
t13 = {
|
|
1748
1654
|
registry,
|
|
1749
1655
|
getAdapter,
|
|
1750
1656
|
powerSync: powerSyncInstance,
|
|
1751
1657
|
supabase: supabaseClient,
|
|
1752
1658
|
queryClient,
|
|
1753
1659
|
schema: config.schema,
|
|
1754
|
-
syncControl
|
|
1660
|
+
syncControl
|
|
1755
1661
|
};
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1662
|
+
$[43] = config.schema;
|
|
1663
|
+
$[44] = getAdapter;
|
|
1664
|
+
$[45] = powerSyncInstance;
|
|
1665
|
+
$[46] = queryClient;
|
|
1666
|
+
$[47] = registry;
|
|
1667
|
+
$[48] = supabaseClient;
|
|
1668
|
+
$[49] = syncControl;
|
|
1669
|
+
$[50] = t13;
|
|
1670
|
+
} else {
|
|
1671
|
+
t13 = $[50];
|
|
1672
|
+
}
|
|
1673
|
+
const coreContextValue = t13;
|
|
1674
|
+
const t14 = powerSyncInstance ? "powersync" : "supabase";
|
|
1675
|
+
const t15 = powerSyncInstance ? "available" /* AVAILABLE */ : "unavailable" /* UNAVAILABLE */;
|
|
1676
|
+
let t16;
|
|
1677
|
+
if ($[51] !== hasSynced || $[52] !== isOnline || $[53] !== t14 || $[54] !== t15) {
|
|
1678
|
+
t16 = {
|
|
1679
|
+
isInitialized: true,
|
|
1680
|
+
currentBackend: t14,
|
|
1681
|
+
powerSyncStatus: t15,
|
|
1682
|
+
isOnline,
|
|
1683
|
+
lastDetection: null,
|
|
1684
|
+
error: null,
|
|
1685
|
+
hasSynced
|
|
1686
|
+
};
|
|
1687
|
+
$[51] = hasSynced;
|
|
1688
|
+
$[52] = isOnline;
|
|
1689
|
+
$[53] = t14;
|
|
1690
|
+
$[54] = t15;
|
|
1691
|
+
$[55] = t16;
|
|
1692
|
+
} else {
|
|
1693
|
+
t16 = $[55];
|
|
1694
|
+
}
|
|
1695
|
+
const status = t16;
|
|
1696
|
+
let t17;
|
|
1697
|
+
if ($[56] !== status) {
|
|
1698
|
+
t17 = {
|
|
1760
1699
|
status,
|
|
1761
1700
|
syncStatus: defaultSyncStatus
|
|
1762
1701
|
};
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1702
|
+
$[56] = status;
|
|
1703
|
+
$[57] = t17;
|
|
1704
|
+
} else {
|
|
1705
|
+
t17 = $[57];
|
|
1706
|
+
}
|
|
1707
|
+
const statusContextValue = t17;
|
|
1708
|
+
let t18;
|
|
1709
|
+
if ($[58] !== coreContextValue || $[59] !== statusContextValue) {
|
|
1710
|
+
t18 = {
|
|
1767
1711
|
...coreContextValue,
|
|
1768
1712
|
...statusContextValue
|
|
1769
1713
|
};
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
}
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
[
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1714
|
+
$[58] = coreContextValue;
|
|
1715
|
+
$[59] = statusContextValue;
|
|
1716
|
+
$[60] = t18;
|
|
1717
|
+
} else {
|
|
1718
|
+
t18 = $[60];
|
|
1719
|
+
}
|
|
1720
|
+
const contextValue = t18;
|
|
1721
|
+
let t19;
|
|
1722
|
+
if ($[61] !== children || $[62] !== statusContextValue) {
|
|
1723
|
+
t19 = /* @__PURE__ */ jsx(DataLayerStatusContext.Provider, { value: statusContextValue, children });
|
|
1724
|
+
$[61] = children;
|
|
1725
|
+
$[62] = statusContextValue;
|
|
1726
|
+
$[63] = t19;
|
|
1727
|
+
} else {
|
|
1728
|
+
t19 = $[63];
|
|
1729
|
+
}
|
|
1730
|
+
let t20;
|
|
1731
|
+
if ($[64] !== coreContextValue || $[65] !== t19) {
|
|
1732
|
+
t20 = /* @__PURE__ */ jsx(DataLayerCoreContext.Provider, { value: coreContextValue, children: t19 });
|
|
1733
|
+
$[64] = coreContextValue;
|
|
1734
|
+
$[65] = t19;
|
|
1735
|
+
$[66] = t20;
|
|
1736
|
+
} else {
|
|
1737
|
+
t20 = $[66];
|
|
1738
|
+
}
|
|
1739
|
+
let t21;
|
|
1740
|
+
if ($[67] !== contextValue || $[68] !== t20) {
|
|
1741
|
+
t21 = /* @__PURE__ */ jsx(DataLayerNestingContext.Provider, { value: true, children: /* @__PURE__ */ jsx(DataLayerContext.Provider, { value: contextValue, children: t20 }) });
|
|
1742
|
+
$[67] = contextValue;
|
|
1743
|
+
$[68] = t20;
|
|
1744
|
+
$[69] = t21;
|
|
1745
|
+
} else {
|
|
1746
|
+
t21 = $[69];
|
|
1747
|
+
}
|
|
1748
|
+
return t21;
|
|
1749
|
+
}
|
|
1750
|
+
function _temp2(t0) {
|
|
1751
|
+
const [key, strategy_2] = t0;
|
|
1752
|
+
return getPowerSyncAlias(key, strategy_2);
|
|
1753
|
+
}
|
|
1754
|
+
function _temp(t0) {
|
|
1755
|
+
const [, strategy_1] = t0;
|
|
1756
|
+
return strategy_1.strategy === "powersync" || strategy_1.strategy === "hybrid" || strategy_1.strategy === "auto";
|
|
1803
1757
|
}
|
|
1804
1758
|
|
|
1805
1759
|
// src/storage/use-supabase-upload.tsx
|
|
1806
|
-
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo3, useState
|
|
1760
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo3, useState } from "react";
|
|
1807
1761
|
|
|
1808
1762
|
// ../../../node_modules/.pnpm/react-dropzone@14.3.8_react@19.2.0/node_modules/react-dropzone/dist/es/index.js
|
|
1809
1763
|
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
@@ -4220,10 +4174,10 @@ var useSupabaseUpload = (options) => {
|
|
|
4220
4174
|
cacheControl = 3600,
|
|
4221
4175
|
upsert = false
|
|
4222
4176
|
} = options;
|
|
4223
|
-
const [files, setFiles] =
|
|
4224
|
-
const [loading, setLoading] =
|
|
4225
|
-
const [errors, setErrors] =
|
|
4226
|
-
const [successes, setSuccesses] =
|
|
4177
|
+
const [files, setFiles] = useState([]);
|
|
4178
|
+
const [loading, setLoading] = useState(false);
|
|
4179
|
+
const [errors, setErrors] = useState([]);
|
|
4180
|
+
const [successes, setSuccesses] = useState([]);
|
|
4227
4181
|
const isSuccess = useMemo3(() => {
|
|
4228
4182
|
if (errors.length === 0 && successes.length === 0) {
|
|
4229
4183
|
return false;
|
|
@@ -4327,7 +4281,7 @@ var useSupabaseUpload = (options) => {
|
|
|
4327
4281
|
};
|
|
4328
4282
|
|
|
4329
4283
|
// src/conflicts/ConflictContext.tsx
|
|
4330
|
-
import { c as
|
|
4284
|
+
import { c as _c2 } from "react/compiler-runtime";
|
|
4331
4285
|
import { createContext, useEffect as useEffect4, useReducer as useReducer2, useRef as useRef3 } from "react";
|
|
4332
4286
|
|
|
4333
4287
|
// src/conflicts/storage.ts
|
|
@@ -4479,7 +4433,7 @@ function conflictReducer(state, action) {
|
|
|
4479
4433
|
}
|
|
4480
4434
|
}
|
|
4481
4435
|
function ConflictProvider(t0) {
|
|
4482
|
-
const $ =
|
|
4436
|
+
const $ = _c2(29);
|
|
4483
4437
|
const {
|
|
4484
4438
|
children,
|
|
4485
4439
|
conflictBus
|
|
@@ -4513,7 +4467,7 @@ function ConflictProvider(t0) {
|
|
|
4513
4467
|
conflicts
|
|
4514
4468
|
});
|
|
4515
4469
|
}
|
|
4516
|
-
}).catch(
|
|
4470
|
+
}).catch(_temp3).finally(() => {
|
|
4517
4471
|
hasFinishedLoadingRef.current = true;
|
|
4518
4472
|
});
|
|
4519
4473
|
};
|
|
@@ -4541,7 +4495,7 @@ function ConflictProvider(t0) {
|
|
|
4541
4495
|
updatedTimestamps.set(key, now);
|
|
4542
4496
|
}
|
|
4543
4497
|
}
|
|
4544
|
-
const currentKeys = new Set(state.pendingConflicts.map(
|
|
4498
|
+
const currentKeys = new Set(state.pendingConflicts.map(_temp22));
|
|
4545
4499
|
for (const key_0 of updatedTimestamps.keys()) {
|
|
4546
4500
|
if (!currentKeys.has(key_0)) {
|
|
4547
4501
|
updatedTimestamps.delete(key_0);
|
|
@@ -4721,15 +4675,15 @@ function ConflictProvider(t0) {
|
|
|
4721
4675
|
}
|
|
4722
4676
|
return t17;
|
|
4723
4677
|
}
|
|
4724
|
-
function
|
|
4678
|
+
function _temp22(c) {
|
|
4725
4679
|
return `${c.table}:${c.recordId}`;
|
|
4726
4680
|
}
|
|
4727
|
-
function
|
|
4681
|
+
function _temp3(err) {
|
|
4728
4682
|
console.warn("[ConflictProvider] Failed to load conflicts:", err);
|
|
4729
4683
|
}
|
|
4730
4684
|
|
|
4731
4685
|
// src/conflicts/useConflictState.ts
|
|
4732
|
-
import { c as
|
|
4686
|
+
import { c as _c3 } from "react/compiler-runtime";
|
|
4733
4687
|
import { useContext as useContext2 } from "react";
|
|
4734
4688
|
function useConflictState() {
|
|
4735
4689
|
const context = useContext2(ConflictContext);
|
|
@@ -4739,7 +4693,7 @@ function useConflictState() {
|
|
|
4739
4693
|
return context;
|
|
4740
4694
|
}
|
|
4741
4695
|
function usePendingConflicts() {
|
|
4742
|
-
const $ =
|
|
4696
|
+
const $ = _c3(2);
|
|
4743
4697
|
const context = useContext2(ConflictContext);
|
|
4744
4698
|
let t0;
|
|
4745
4699
|
if ($[0] !== context?.pendingConflicts) {
|
|
@@ -4756,7 +4710,7 @@ function useHasConflicts() {
|
|
|
4756
4710
|
return context?.hasConflicts ?? false;
|
|
4757
4711
|
}
|
|
4758
4712
|
function useConflictForRecord(table, recordId) {
|
|
4759
|
-
const $ =
|
|
4713
|
+
const $ = _c3(4);
|
|
4760
4714
|
const conflicts = usePendingConflicts();
|
|
4761
4715
|
let t0;
|
|
4762
4716
|
if ($[0] !== conflicts || $[1] !== recordId || $[2] !== table) {
|
|
@@ -4771,7 +4725,7 @@ function useConflictForRecord(table, recordId) {
|
|
|
4771
4725
|
return t0;
|
|
4772
4726
|
}
|
|
4773
4727
|
function useConflictsForTable(table) {
|
|
4774
|
-
const $ =
|
|
4728
|
+
const $ = _c3(5);
|
|
4775
4729
|
const conflicts = usePendingConflicts();
|
|
4776
4730
|
let t0;
|
|
4777
4731
|
if ($[0] !== conflicts || $[1] !== table) {
|
|
@@ -4793,7 +4747,7 @@ function useConflictsForTable(table) {
|
|
|
4793
4747
|
return t0;
|
|
4794
4748
|
}
|
|
4795
4749
|
function useConflictCountByTable() {
|
|
4796
|
-
const $ =
|
|
4750
|
+
const $ = _c3(2);
|
|
4797
4751
|
const conflicts = usePendingConflicts();
|
|
4798
4752
|
let counts;
|
|
4799
4753
|
if ($[0] !== conflicts) {
|
|
@@ -4810,9 +4764,9 @@ function useConflictCountByTable() {
|
|
|
4810
4764
|
}
|
|
4811
4765
|
|
|
4812
4766
|
// src/conflicts/useConflictResolution.ts
|
|
4813
|
-
import { c as
|
|
4767
|
+
import { c as _c4 } from "react/compiler-runtime";
|
|
4814
4768
|
function useConflictResolution(conflict) {
|
|
4815
|
-
const $ =
|
|
4769
|
+
const $ = _c4(28);
|
|
4816
4770
|
const {
|
|
4817
4771
|
resolveConflict
|
|
4818
4772
|
} = useConflictState();
|
|
@@ -4886,7 +4840,7 @@ function useConflictResolution(conflict) {
|
|
|
4886
4840
|
const syncFields = t4;
|
|
4887
4841
|
let t5;
|
|
4888
4842
|
if ($[13] !== conflict.conflicts) {
|
|
4889
|
-
t5 = new Set(conflict.conflicts.map(
|
|
4843
|
+
t5 = new Set(conflict.conflicts.map(_temp4));
|
|
4890
4844
|
$[13] = conflict.conflicts;
|
|
4891
4845
|
$[14] = t5;
|
|
4892
4846
|
} else {
|
|
@@ -4948,11 +4902,11 @@ function useConflictResolution(conflict) {
|
|
|
4948
4902
|
}
|
|
4949
4903
|
return t8;
|
|
4950
4904
|
}
|
|
4951
|
-
function
|
|
4905
|
+
function _temp4(c) {
|
|
4952
4906
|
return c.field;
|
|
4953
4907
|
}
|
|
4954
4908
|
function useBulkConflictResolution() {
|
|
4955
|
-
const $ =
|
|
4909
|
+
const $ = _c4(13);
|
|
4956
4910
|
const {
|
|
4957
4911
|
resolveAll,
|
|
4958
4912
|
resolveConflict,
|
|
@@ -5068,4 +5022,4 @@ object-assign/index.js:
|
|
|
5068
5022
|
@license MIT
|
|
5069
5023
|
*)
|
|
5070
5024
|
*/
|
|
5071
|
-
//# sourceMappingURL=chunk-
|
|
5025
|
+
//# sourceMappingURL=chunk-7PBTPCRN.js.map
|