tinybase 6.0.0 → 6.1.0-beta.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/@types/_internal/ui-react/with-schemas/index.d.cts +1 -1
- package/@types/_internal/ui-react/with-schemas/index.d.ts +1 -1
- package/@types/index.d.cts +1 -1
- package/@types/index.d.ts +1 -1
- package/@types/persisters/persister-automerge/index.d.cts +1 -1
- package/@types/persisters/persister-automerge/index.d.ts +1 -1
- package/@types/persisters/persister-automerge/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-automerge/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-cr-sqlite-wasm/index.d.cts +1 -1
- package/@types/persisters/persister-cr-sqlite-wasm/index.d.ts +1 -1
- package/@types/persisters/persister-cr-sqlite-wasm/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-cr-sqlite-wasm/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-electric-sql/index.d.cts +4 -4
- package/@types/persisters/persister-electric-sql/index.d.ts +4 -4
- package/@types/persisters/persister-electric-sql/with-schemas/index.d.cts +4 -4
- package/@types/persisters/persister-electric-sql/with-schemas/index.d.ts +4 -4
- package/@types/persisters/persister-expo-sqlite/index.d.cts +1 -1
- package/@types/persisters/persister-expo-sqlite/index.d.ts +1 -1
- package/@types/persisters/persister-expo-sqlite/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-expo-sqlite/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-libsql/index.d.cts +1 -1
- package/@types/persisters/persister-libsql/index.d.ts +1 -1
- package/@types/persisters/persister-libsql/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-libsql/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-partykit-client/index.d.cts +1 -1
- package/@types/persisters/persister-partykit-client/index.d.ts +1 -1
- package/@types/persisters/persister-partykit-client/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-partykit-client/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-partykit-server/index.d.cts +7 -7
- package/@types/persisters/persister-partykit-server/index.d.ts +7 -7
- package/@types/persisters/persister-partykit-server/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-partykit-server/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-pglite/index.d.cts +1 -1
- package/@types/persisters/persister-pglite/index.d.ts +1 -1
- package/@types/persisters/persister-pglite/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-pglite/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-postgres/index.d.cts +1 -1
- package/@types/persisters/persister-postgres/index.d.ts +1 -1
- package/@types/persisters/persister-postgres/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-postgres/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-powersync/index.d.cts +1 -1
- package/@types/persisters/persister-powersync/index.d.ts +1 -1
- package/@types/persisters/persister-powersync/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-powersync/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-sqlite3/index.d.cts +1 -1
- package/@types/persisters/persister-sqlite3/index.d.ts +1 -1
- package/@types/persisters/persister-sqlite3/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-sqlite3/with-schemas/index.d.ts +1 -1
- package/@types/persisters/persister-yjs/index.d.cts +1 -1
- package/@types/persisters/persister-yjs/index.d.ts +1 -1
- package/@types/persisters/persister-yjs/with-schemas/index.d.cts +1 -1
- package/@types/persisters/persister-yjs/with-schemas/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-client/index.d.cts +1 -1
- package/@types/synchronizers/synchronizer-ws-client/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.cts +1 -1
- package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-server/index.d.cts +1 -1
- package/@types/synchronizers/synchronizer-ws-server/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.cts +1 -1
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.cts +1 -1
- package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.cts +1 -1
- package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.ts +1 -1
- package/@types/ui-react/index.d.cts +3 -3
- package/@types/ui-react/index.d.ts +3 -3
- package/@types/ui-react/with-schemas/index.d.cts +1 -1
- package/@types/ui-react/with-schemas/index.d.ts +1 -1
- package/@types/ui-react-dom/index.d.cts +1 -1
- package/@types/ui-react-dom/index.d.ts +1 -1
- package/@types/ui-react-dom/with-schemas/index.d.cts +1 -1
- package/@types/ui-react-dom/with-schemas/index.d.ts +1 -1
- package/@types/ui-react-inspector/with-schemas/index.d.cts +1 -1
- package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
- package/@types/with-schemas/index.d.cts +1 -1
- package/@types/with-schemas/index.d.ts +1 -1
- package/index.js +1564 -1564
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/persisters/index.js +1 -1
- package/min/persisters/index.js.gz +0 -0
- package/min/persisters/with-schemas/index.js +1 -1
- package/min/persisters/with-schemas/index.js.gz +0 -0
- package/min/ui-react/index.js +1 -1
- package/min/ui-react/index.js.gz +0 -0
- package/min/ui-react/with-schemas/index.js +1 -1
- package/min/ui-react/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/package.json +1 -4
- package/persisters/index.js +95 -95
- package/persisters/with-schemas/index.js +95 -95
- package/readme.md +13 -13
- package/releases.md +25 -25
- package/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/ui-react/index.js +64 -53
- package/ui-react/with-schemas/index.js +64 -53
- package/ui-react-dom/index.js +3 -3
- package/ui-react-dom/with-schemas/index.js +3 -3
- package/ui-react-inspector/index.js +4 -4
- package/ui-react-inspector/with-schemas/index.js +4 -4
- package/with-schemas/index.js +1564 -1564
|
@@ -791,4 +791,4 @@ const getWsServerDurableObjectFetch = (namespace) => (request, env) =>
|
|
|
791
791
|
.fetch(request)
|
|
792
792
|
: createUpgradeRequiredResponse();
|
|
793
793
|
|
|
794
|
-
export {
|
|
794
|
+
export {getWsServerDurableObjectFetch, WsServerDurableObject};
|
|
@@ -791,4 +791,4 @@ const getWsServerDurableObjectFetch = (namespace) => (request, env) =>
|
|
|
791
791
|
.fetch(request)
|
|
792
792
|
: createUpgradeRequiredResponse();
|
|
793
793
|
|
|
794
|
-
export {
|
|
794
|
+
export {getWsServerDurableObjectFetch, WsServerDurableObject};
|
package/ui-react/index.js
CHANGED
|
@@ -124,6 +124,17 @@ const getIndexStoreTableId = (indexes, indexId) => [
|
|
|
124
124
|
indexes?.getTableId(indexId),
|
|
125
125
|
];
|
|
126
126
|
|
|
127
|
+
var Offsets = /* @__PURE__ */ ((Offsets2) => {
|
|
128
|
+
Offsets2[(Offsets2['Store'] = 0)] = 'Store';
|
|
129
|
+
Offsets2[(Offsets2['Metrics'] = 1)] = 'Metrics';
|
|
130
|
+
Offsets2[(Offsets2['Indexes'] = 2)] = 'Indexes';
|
|
131
|
+
Offsets2[(Offsets2['Relationships'] = 3)] = 'Relationships';
|
|
132
|
+
Offsets2[(Offsets2['Queries'] = 4)] = 'Queries';
|
|
133
|
+
Offsets2[(Offsets2['Checkpoints'] = 5)] = 'Checkpoints';
|
|
134
|
+
Offsets2[(Offsets2['Persister'] = 6)] = 'Persister';
|
|
135
|
+
Offsets2[(Offsets2['Synchronizer'] = 7)] = 'Synchronizer';
|
|
136
|
+
return Offsets2;
|
|
137
|
+
})(Offsets || {});
|
|
127
138
|
const TINYBASE_CONTEXT = TINYBASE + '_uirc';
|
|
128
139
|
const Context = GLOBAL[TINYBASE_CONTEXT]
|
|
129
140
|
? /* istanbul ignore next */
|
|
@@ -153,55 +164,6 @@ const useProvideThing = (thingId, thing, offset) => {
|
|
|
153
164
|
};
|
|
154
165
|
const useThingIds = (offset) =>
|
|
155
166
|
objIds(useContext(Context)[offset * 2 + 1] ?? {});
|
|
156
|
-
const useStoreIds = () => useThingIds(0 /* Store */);
|
|
157
|
-
const useStore = (id) => useThing(id, 0 /* Store */);
|
|
158
|
-
const useStores = () => useThings(0 /* Store */);
|
|
159
|
-
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
160
|
-
useThingOrThingById(storeOrStoreId, 0 /* Store */);
|
|
161
|
-
const useProvideStore = (storeId, store) =>
|
|
162
|
-
useProvideThing(storeId, store, 0 /* Store */);
|
|
163
|
-
const useMetricsIds = () => useThingIds(1 /* Metrics */);
|
|
164
|
-
const useMetrics = (id) => useThing(id, 1 /* Metrics */);
|
|
165
|
-
const useMetricsOrMetricsById = (metricsOrMetricsId) =>
|
|
166
|
-
useThingOrThingById(metricsOrMetricsId, 1 /* Metrics */);
|
|
167
|
-
const useProvideMetrics = (metricsId, metrics) =>
|
|
168
|
-
useProvideThing(metricsId, metrics, 1 /* Metrics */);
|
|
169
|
-
const useIndexesIds = () => useThingIds(2 /* Indexes */);
|
|
170
|
-
const useIndexes = (id) => useThing(id, 2 /* Indexes */);
|
|
171
|
-
const useIndexesOrIndexesById = (indexesOrIndexesId) =>
|
|
172
|
-
useThingOrThingById(indexesOrIndexesId, 2 /* Indexes */);
|
|
173
|
-
const useProvideIndexes = (indexesId, indexes) =>
|
|
174
|
-
useProvideThing(indexesId, indexes, 2 /* Indexes */);
|
|
175
|
-
const useRelationshipsIds = () => useThingIds(3 /* Relationships */);
|
|
176
|
-
const useRelationships = (id) => useThing(id, 3 /* Relationships */);
|
|
177
|
-
const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
|
|
178
|
-
useThingOrThingById(relationshipsOrRelationshipsId, 3 /* Relationships */);
|
|
179
|
-
const useProvideRelationships = (relationshipsId, relationships) =>
|
|
180
|
-
useProvideThing(relationshipsId, relationships, 3 /* Relationships */);
|
|
181
|
-
const useQueriesIds = () => useThingIds(4 /* Queries */);
|
|
182
|
-
const useQueries = (id) => useThing(id, 4 /* Queries */);
|
|
183
|
-
const useQueriesOrQueriesById = (queriesOrQueriesId) =>
|
|
184
|
-
useThingOrThingById(queriesOrQueriesId, 4 /* Queries */);
|
|
185
|
-
const useProvideQueries = (queriesId, queries) =>
|
|
186
|
-
useProvideThing(queriesId, queries, 4 /* Queries */);
|
|
187
|
-
const useCheckpointsIds = () => useThingIds(5 /* Checkpoints */);
|
|
188
|
-
const useCheckpoints = (id) => useThing(id, 5 /* Checkpoints */);
|
|
189
|
-
const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
|
|
190
|
-
useThingOrThingById(checkpointsOrCheckpointsId, 5 /* Checkpoints */);
|
|
191
|
-
const useProvideCheckpoints = (checkpointsId, checkpoints) =>
|
|
192
|
-
useProvideThing(checkpointsId, checkpoints, 5 /* Checkpoints */);
|
|
193
|
-
const usePersisterIds = () => useThingIds(6 /* Persister */);
|
|
194
|
-
const usePersister = (id) => useThing(id, 6 /* Persister */);
|
|
195
|
-
const usePersisterOrPersisterById = (persisterOrPersisterId) =>
|
|
196
|
-
useThingOrThingById(persisterOrPersisterId, 6 /* Persister */);
|
|
197
|
-
const useProvidePersister = (persisterId, persister) =>
|
|
198
|
-
useProvideThing(persisterId, persister, 6 /* Persister */);
|
|
199
|
-
const useSynchronizerIds = () => useThingIds(7 /* Synchronizer */);
|
|
200
|
-
const useSynchronizer = (id) => useThing(id, 7 /* Synchronizer */);
|
|
201
|
-
const useSynchronizerOrSynchronizerById = (synchronizerOrSynchronizerId) =>
|
|
202
|
-
useThingOrThingById(synchronizerOrSynchronizerId, 7 /* Synchronizer */);
|
|
203
|
-
const useProvideSynchronizer = (persisterId, persister) =>
|
|
204
|
-
useProvideThing(persisterId, persister, 7 /* Synchronizer */);
|
|
205
167
|
|
|
206
168
|
const EMPTY_ARRAY = [];
|
|
207
169
|
const DEFAULTS = [{}, [], [EMPTY_ARRAY, void 0, EMPTY_ARRAY], void 0, false, 0];
|
|
@@ -334,6 +296,13 @@ const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
|
334
296
|
};
|
|
335
297
|
const useCreateStore = (create, createDeps = EMPTY_ARRAY) =>
|
|
336
298
|
useMemo(create, createDeps);
|
|
299
|
+
const useStoreIds = () => useThingIds(Offsets.Store);
|
|
300
|
+
const useStore = (id) => useThing(id, Offsets.Store);
|
|
301
|
+
const useStores = () => useThings(Offsets.Store);
|
|
302
|
+
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
303
|
+
useThingOrThingById(storeOrStoreId, Offsets.Store);
|
|
304
|
+
const useProvideStore = (storeId, store) =>
|
|
305
|
+
useProvideThing(storeId, store, Offsets.Store);
|
|
337
306
|
const useCreateMergeableStore = (create, createDeps = EMPTY_ARRAY) =>
|
|
338
307
|
useMemo(create, createDeps);
|
|
339
308
|
const useHasTables = (storeOrStoreId) =>
|
|
@@ -957,6 +926,12 @@ const useDidFinishTransactionListener = (
|
|
|
957
926
|
);
|
|
958
927
|
const useCreateMetrics = (store, create, createDeps) =>
|
|
959
928
|
useCreate(store, create, createDeps);
|
|
929
|
+
const useMetricsIds = () => useThingIds(Offsets.Metrics);
|
|
930
|
+
const useMetrics = (id) => useThing(id, Offsets.Metrics);
|
|
931
|
+
const useMetricsOrMetricsById = (metricsOrMetricsId) =>
|
|
932
|
+
useThingOrThingById(metricsOrMetricsId, Offsets.Metrics);
|
|
933
|
+
const useProvideMetrics = (metricsId, metrics) =>
|
|
934
|
+
useProvideThing(metricsId, metrics, Offsets.Metrics);
|
|
960
935
|
const useMetricIds = (metricsOrMetricsId) =>
|
|
961
936
|
useListenable(
|
|
962
937
|
METRIC + IDS,
|
|
@@ -985,6 +960,12 @@ const useMetricListener = (
|
|
|
985
960
|
);
|
|
986
961
|
const useCreateIndexes = (store, create, createDeps) =>
|
|
987
962
|
useCreate(store, create, createDeps);
|
|
963
|
+
const useIndexesIds = () => useThingIds(Offsets.Indexes);
|
|
964
|
+
const useIndexes = (id) => useThing(id, Offsets.Indexes);
|
|
965
|
+
const useIndexesOrIndexesById = (indexesOrIndexesId) =>
|
|
966
|
+
useThingOrThingById(indexesOrIndexesId, Offsets.Indexes);
|
|
967
|
+
const useProvideIndexes = (indexesId, indexes) =>
|
|
968
|
+
useProvideThing(indexesId, indexes, Offsets.Indexes);
|
|
988
969
|
const useSliceIds = (indexId, indexesOrIndexesId) =>
|
|
989
970
|
useListenable(
|
|
990
971
|
SLICE + IDS,
|
|
@@ -1034,6 +1015,12 @@ const useSliceRowIdsListener = (
|
|
|
1034
1015
|
);
|
|
1035
1016
|
const useCreateRelationships = (store, create, createDeps) =>
|
|
1036
1017
|
useCreate(store, create, createDeps);
|
|
1018
|
+
const useRelationshipsIds = () => useThingIds(Offsets.Relationships);
|
|
1019
|
+
const useRelationships = (id) => useThing(id, Offsets.Relationships);
|
|
1020
|
+
const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
|
|
1021
|
+
useThingOrThingById(relationshipsOrRelationshipsId, Offsets.Relationships);
|
|
1022
|
+
const useProvideRelationships = (relationshipsId, relationships) =>
|
|
1023
|
+
useProvideThing(relationshipsId, relationships, Offsets.Relationships);
|
|
1037
1024
|
const useRelationshipIds = (relationshipsOrRelationshipsId) =>
|
|
1038
1025
|
useListenable(
|
|
1039
1026
|
RELATIONSHIP + IDS,
|
|
@@ -1117,6 +1104,12 @@ const useLinkedRowIdsListener = (
|
|
|
1117
1104
|
);
|
|
1118
1105
|
const useCreateQueries = (store, create, createDeps) =>
|
|
1119
1106
|
useCreate(store, create, createDeps);
|
|
1107
|
+
const useQueriesIds = () => useThingIds(Offsets.Queries);
|
|
1108
|
+
const useQueries = (id) => useThing(id, Offsets.Queries);
|
|
1109
|
+
const useQueriesOrQueriesById = (queriesOrQueriesId) =>
|
|
1110
|
+
useThingOrThingById(queriesOrQueriesId, Offsets.Queries);
|
|
1111
|
+
const useProvideQueries = (queriesId, queries) =>
|
|
1112
|
+
useProvideThing(queriesId, queries, Offsets.Queries);
|
|
1120
1113
|
const useQueryIds = (queriesOrQueriesId) =>
|
|
1121
1114
|
useListenable(
|
|
1122
1115
|
QUERY + IDS,
|
|
@@ -1300,6 +1293,12 @@ const useResultCellListener = (
|
|
|
1300
1293
|
);
|
|
1301
1294
|
const useCreateCheckpoints = (store, create, createDeps) =>
|
|
1302
1295
|
useCreate(store, create, createDeps);
|
|
1296
|
+
const useCheckpointsIds = () => useThingIds(Offsets.Checkpoints);
|
|
1297
|
+
const useCheckpoints = (id) => useThing(id, Offsets.Checkpoints);
|
|
1298
|
+
const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
|
|
1299
|
+
useThingOrThingById(checkpointsOrCheckpointsId, Offsets.Checkpoints);
|
|
1300
|
+
const useProvideCheckpoints = (checkpointsId, checkpoints) =>
|
|
1301
|
+
useProvideThing(checkpointsId, checkpoints, Offsets.Checkpoints);
|
|
1303
1302
|
const useCheckpointIds = (checkpointsOrCheckpointsId) =>
|
|
1304
1303
|
useListenable(
|
|
1305
1304
|
CHECKPOINT + IDS,
|
|
@@ -1447,6 +1446,12 @@ const useCreatePersister = (
|
|
|
1447
1446
|
);
|
|
1448
1447
|
return persister;
|
|
1449
1448
|
};
|
|
1449
|
+
const usePersisterIds = () => useThingIds(Offsets.Persister);
|
|
1450
|
+
const usePersister = (id) => useThing(id, Offsets.Persister);
|
|
1451
|
+
const usePersisterOrPersisterById = (persisterOrPersisterId) =>
|
|
1452
|
+
useThingOrThingById(persisterOrPersisterId, Offsets.Persister);
|
|
1453
|
+
const useProvidePersister = (persisterId, persister) =>
|
|
1454
|
+
useProvideThing(persisterId, persister, Offsets.Persister);
|
|
1450
1455
|
const usePersisterStatus = (persisterOrPersisterId) =>
|
|
1451
1456
|
useListenable(
|
|
1452
1457
|
STATUS,
|
|
@@ -1496,6 +1501,12 @@ const useCreateSynchronizer = (
|
|
|
1496
1501
|
);
|
|
1497
1502
|
return synchronizer;
|
|
1498
1503
|
};
|
|
1504
|
+
const useSynchronizerIds = () => useThingIds(Offsets.Synchronizer);
|
|
1505
|
+
const useSynchronizer = (id) => useThing(id, Offsets.Synchronizer);
|
|
1506
|
+
const useSynchronizerOrSynchronizerById = (synchronizerOrSynchronizerId) =>
|
|
1507
|
+
useThingOrThingById(synchronizerOrSynchronizerId, Offsets.Synchronizer);
|
|
1508
|
+
const useProvideSynchronizer = (persisterId, persister) =>
|
|
1509
|
+
useProvideThing(persisterId, persister, Offsets.Synchronizer);
|
|
1499
1510
|
const useSynchronizerStatus = (synchronizerOrSynchronizerId) =>
|
|
1500
1511
|
useListenable(
|
|
1501
1512
|
STATUS,
|
|
@@ -2098,10 +2109,8 @@ export {
|
|
|
2098
2109
|
RowView,
|
|
2099
2110
|
SliceView,
|
|
2100
2111
|
SortedTableView,
|
|
2101
|
-
TableView,
|
|
2102
2112
|
TablesView,
|
|
2103
|
-
|
|
2104
|
-
ValuesView,
|
|
2113
|
+
TableView,
|
|
2105
2114
|
useAddRowCallback,
|
|
2106
2115
|
useCell,
|
|
2107
2116
|
useCellIds,
|
|
@@ -2147,10 +2156,10 @@ export {
|
|
|
2147
2156
|
useHasValueListener,
|
|
2148
2157
|
useHasValues,
|
|
2149
2158
|
useHasValuesListener,
|
|
2150
|
-
useIndexIds,
|
|
2151
2159
|
useIndexes,
|
|
2152
2160
|
useIndexesIds,
|
|
2153
2161
|
useIndexesOrIndexesById,
|
|
2162
|
+
useIndexIds,
|
|
2154
2163
|
useLinkedRowIds,
|
|
2155
2164
|
useLinkedRowIdsListener,
|
|
2156
2165
|
useLocalRowIds,
|
|
@@ -2248,4 +2257,6 @@ export {
|
|
|
2248
2257
|
useValues,
|
|
2249
2258
|
useValuesListener,
|
|
2250
2259
|
useWillFinishTransactionListener,
|
|
2260
|
+
ValuesView,
|
|
2261
|
+
ValueView,
|
|
2251
2262
|
};
|
|
@@ -124,6 +124,17 @@ const getIndexStoreTableId = (indexes, indexId) => [
|
|
|
124
124
|
indexes?.getTableId(indexId),
|
|
125
125
|
];
|
|
126
126
|
|
|
127
|
+
var Offsets = /* @__PURE__ */ ((Offsets2) => {
|
|
128
|
+
Offsets2[(Offsets2['Store'] = 0)] = 'Store';
|
|
129
|
+
Offsets2[(Offsets2['Metrics'] = 1)] = 'Metrics';
|
|
130
|
+
Offsets2[(Offsets2['Indexes'] = 2)] = 'Indexes';
|
|
131
|
+
Offsets2[(Offsets2['Relationships'] = 3)] = 'Relationships';
|
|
132
|
+
Offsets2[(Offsets2['Queries'] = 4)] = 'Queries';
|
|
133
|
+
Offsets2[(Offsets2['Checkpoints'] = 5)] = 'Checkpoints';
|
|
134
|
+
Offsets2[(Offsets2['Persister'] = 6)] = 'Persister';
|
|
135
|
+
Offsets2[(Offsets2['Synchronizer'] = 7)] = 'Synchronizer';
|
|
136
|
+
return Offsets2;
|
|
137
|
+
})(Offsets || {});
|
|
127
138
|
const TINYBASE_CONTEXT = TINYBASE + '_uirc';
|
|
128
139
|
const Context = GLOBAL[TINYBASE_CONTEXT]
|
|
129
140
|
? /* istanbul ignore next */
|
|
@@ -153,55 +164,6 @@ const useProvideThing = (thingId, thing, offset) => {
|
|
|
153
164
|
};
|
|
154
165
|
const useThingIds = (offset) =>
|
|
155
166
|
objIds(useContext(Context)[offset * 2 + 1] ?? {});
|
|
156
|
-
const useStoreIds = () => useThingIds(0 /* Store */);
|
|
157
|
-
const useStore = (id) => useThing(id, 0 /* Store */);
|
|
158
|
-
const useStores = () => useThings(0 /* Store */);
|
|
159
|
-
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
160
|
-
useThingOrThingById(storeOrStoreId, 0 /* Store */);
|
|
161
|
-
const useProvideStore = (storeId, store) =>
|
|
162
|
-
useProvideThing(storeId, store, 0 /* Store */);
|
|
163
|
-
const useMetricsIds = () => useThingIds(1 /* Metrics */);
|
|
164
|
-
const useMetrics = (id) => useThing(id, 1 /* Metrics */);
|
|
165
|
-
const useMetricsOrMetricsById = (metricsOrMetricsId) =>
|
|
166
|
-
useThingOrThingById(metricsOrMetricsId, 1 /* Metrics */);
|
|
167
|
-
const useProvideMetrics = (metricsId, metrics) =>
|
|
168
|
-
useProvideThing(metricsId, metrics, 1 /* Metrics */);
|
|
169
|
-
const useIndexesIds = () => useThingIds(2 /* Indexes */);
|
|
170
|
-
const useIndexes = (id) => useThing(id, 2 /* Indexes */);
|
|
171
|
-
const useIndexesOrIndexesById = (indexesOrIndexesId) =>
|
|
172
|
-
useThingOrThingById(indexesOrIndexesId, 2 /* Indexes */);
|
|
173
|
-
const useProvideIndexes = (indexesId, indexes) =>
|
|
174
|
-
useProvideThing(indexesId, indexes, 2 /* Indexes */);
|
|
175
|
-
const useRelationshipsIds = () => useThingIds(3 /* Relationships */);
|
|
176
|
-
const useRelationships = (id) => useThing(id, 3 /* Relationships */);
|
|
177
|
-
const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
|
|
178
|
-
useThingOrThingById(relationshipsOrRelationshipsId, 3 /* Relationships */);
|
|
179
|
-
const useProvideRelationships = (relationshipsId, relationships) =>
|
|
180
|
-
useProvideThing(relationshipsId, relationships, 3 /* Relationships */);
|
|
181
|
-
const useQueriesIds = () => useThingIds(4 /* Queries */);
|
|
182
|
-
const useQueries = (id) => useThing(id, 4 /* Queries */);
|
|
183
|
-
const useQueriesOrQueriesById = (queriesOrQueriesId) =>
|
|
184
|
-
useThingOrThingById(queriesOrQueriesId, 4 /* Queries */);
|
|
185
|
-
const useProvideQueries = (queriesId, queries) =>
|
|
186
|
-
useProvideThing(queriesId, queries, 4 /* Queries */);
|
|
187
|
-
const useCheckpointsIds = () => useThingIds(5 /* Checkpoints */);
|
|
188
|
-
const useCheckpoints = (id) => useThing(id, 5 /* Checkpoints */);
|
|
189
|
-
const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
|
|
190
|
-
useThingOrThingById(checkpointsOrCheckpointsId, 5 /* Checkpoints */);
|
|
191
|
-
const useProvideCheckpoints = (checkpointsId, checkpoints) =>
|
|
192
|
-
useProvideThing(checkpointsId, checkpoints, 5 /* Checkpoints */);
|
|
193
|
-
const usePersisterIds = () => useThingIds(6 /* Persister */);
|
|
194
|
-
const usePersister = (id) => useThing(id, 6 /* Persister */);
|
|
195
|
-
const usePersisterOrPersisterById = (persisterOrPersisterId) =>
|
|
196
|
-
useThingOrThingById(persisterOrPersisterId, 6 /* Persister */);
|
|
197
|
-
const useProvidePersister = (persisterId, persister) =>
|
|
198
|
-
useProvideThing(persisterId, persister, 6 /* Persister */);
|
|
199
|
-
const useSynchronizerIds = () => useThingIds(7 /* Synchronizer */);
|
|
200
|
-
const useSynchronizer = (id) => useThing(id, 7 /* Synchronizer */);
|
|
201
|
-
const useSynchronizerOrSynchronizerById = (synchronizerOrSynchronizerId) =>
|
|
202
|
-
useThingOrThingById(synchronizerOrSynchronizerId, 7 /* Synchronizer */);
|
|
203
|
-
const useProvideSynchronizer = (persisterId, persister) =>
|
|
204
|
-
useProvideThing(persisterId, persister, 7 /* Synchronizer */);
|
|
205
167
|
|
|
206
168
|
const EMPTY_ARRAY = [];
|
|
207
169
|
const DEFAULTS = [{}, [], [EMPTY_ARRAY, void 0, EMPTY_ARRAY], void 0, false, 0];
|
|
@@ -334,6 +296,13 @@ const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
|
334
296
|
};
|
|
335
297
|
const useCreateStore = (create, createDeps = EMPTY_ARRAY) =>
|
|
336
298
|
useMemo(create, createDeps);
|
|
299
|
+
const useStoreIds = () => useThingIds(Offsets.Store);
|
|
300
|
+
const useStore = (id) => useThing(id, Offsets.Store);
|
|
301
|
+
const useStores = () => useThings(Offsets.Store);
|
|
302
|
+
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
303
|
+
useThingOrThingById(storeOrStoreId, Offsets.Store);
|
|
304
|
+
const useProvideStore = (storeId, store) =>
|
|
305
|
+
useProvideThing(storeId, store, Offsets.Store);
|
|
337
306
|
const useCreateMergeableStore = (create, createDeps = EMPTY_ARRAY) =>
|
|
338
307
|
useMemo(create, createDeps);
|
|
339
308
|
const useHasTables = (storeOrStoreId) =>
|
|
@@ -957,6 +926,12 @@ const useDidFinishTransactionListener = (
|
|
|
957
926
|
);
|
|
958
927
|
const useCreateMetrics = (store, create, createDeps) =>
|
|
959
928
|
useCreate(store, create, createDeps);
|
|
929
|
+
const useMetricsIds = () => useThingIds(Offsets.Metrics);
|
|
930
|
+
const useMetrics = (id) => useThing(id, Offsets.Metrics);
|
|
931
|
+
const useMetricsOrMetricsById = (metricsOrMetricsId) =>
|
|
932
|
+
useThingOrThingById(metricsOrMetricsId, Offsets.Metrics);
|
|
933
|
+
const useProvideMetrics = (metricsId, metrics) =>
|
|
934
|
+
useProvideThing(metricsId, metrics, Offsets.Metrics);
|
|
960
935
|
const useMetricIds = (metricsOrMetricsId) =>
|
|
961
936
|
useListenable(
|
|
962
937
|
METRIC + IDS,
|
|
@@ -985,6 +960,12 @@ const useMetricListener = (
|
|
|
985
960
|
);
|
|
986
961
|
const useCreateIndexes = (store, create, createDeps) =>
|
|
987
962
|
useCreate(store, create, createDeps);
|
|
963
|
+
const useIndexesIds = () => useThingIds(Offsets.Indexes);
|
|
964
|
+
const useIndexes = (id) => useThing(id, Offsets.Indexes);
|
|
965
|
+
const useIndexesOrIndexesById = (indexesOrIndexesId) =>
|
|
966
|
+
useThingOrThingById(indexesOrIndexesId, Offsets.Indexes);
|
|
967
|
+
const useProvideIndexes = (indexesId, indexes) =>
|
|
968
|
+
useProvideThing(indexesId, indexes, Offsets.Indexes);
|
|
988
969
|
const useSliceIds = (indexId, indexesOrIndexesId) =>
|
|
989
970
|
useListenable(
|
|
990
971
|
SLICE + IDS,
|
|
@@ -1034,6 +1015,12 @@ const useSliceRowIdsListener = (
|
|
|
1034
1015
|
);
|
|
1035
1016
|
const useCreateRelationships = (store, create, createDeps) =>
|
|
1036
1017
|
useCreate(store, create, createDeps);
|
|
1018
|
+
const useRelationshipsIds = () => useThingIds(Offsets.Relationships);
|
|
1019
|
+
const useRelationships = (id) => useThing(id, Offsets.Relationships);
|
|
1020
|
+
const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
|
|
1021
|
+
useThingOrThingById(relationshipsOrRelationshipsId, Offsets.Relationships);
|
|
1022
|
+
const useProvideRelationships = (relationshipsId, relationships) =>
|
|
1023
|
+
useProvideThing(relationshipsId, relationships, Offsets.Relationships);
|
|
1037
1024
|
const useRelationshipIds = (relationshipsOrRelationshipsId) =>
|
|
1038
1025
|
useListenable(
|
|
1039
1026
|
RELATIONSHIP + IDS,
|
|
@@ -1117,6 +1104,12 @@ const useLinkedRowIdsListener = (
|
|
|
1117
1104
|
);
|
|
1118
1105
|
const useCreateQueries = (store, create, createDeps) =>
|
|
1119
1106
|
useCreate(store, create, createDeps);
|
|
1107
|
+
const useQueriesIds = () => useThingIds(Offsets.Queries);
|
|
1108
|
+
const useQueries = (id) => useThing(id, Offsets.Queries);
|
|
1109
|
+
const useQueriesOrQueriesById = (queriesOrQueriesId) =>
|
|
1110
|
+
useThingOrThingById(queriesOrQueriesId, Offsets.Queries);
|
|
1111
|
+
const useProvideQueries = (queriesId, queries) =>
|
|
1112
|
+
useProvideThing(queriesId, queries, Offsets.Queries);
|
|
1120
1113
|
const useQueryIds = (queriesOrQueriesId) =>
|
|
1121
1114
|
useListenable(
|
|
1122
1115
|
QUERY + IDS,
|
|
@@ -1300,6 +1293,12 @@ const useResultCellListener = (
|
|
|
1300
1293
|
);
|
|
1301
1294
|
const useCreateCheckpoints = (store, create, createDeps) =>
|
|
1302
1295
|
useCreate(store, create, createDeps);
|
|
1296
|
+
const useCheckpointsIds = () => useThingIds(Offsets.Checkpoints);
|
|
1297
|
+
const useCheckpoints = (id) => useThing(id, Offsets.Checkpoints);
|
|
1298
|
+
const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
|
|
1299
|
+
useThingOrThingById(checkpointsOrCheckpointsId, Offsets.Checkpoints);
|
|
1300
|
+
const useProvideCheckpoints = (checkpointsId, checkpoints) =>
|
|
1301
|
+
useProvideThing(checkpointsId, checkpoints, Offsets.Checkpoints);
|
|
1303
1302
|
const useCheckpointIds = (checkpointsOrCheckpointsId) =>
|
|
1304
1303
|
useListenable(
|
|
1305
1304
|
CHECKPOINT + IDS,
|
|
@@ -1447,6 +1446,12 @@ const useCreatePersister = (
|
|
|
1447
1446
|
);
|
|
1448
1447
|
return persister;
|
|
1449
1448
|
};
|
|
1449
|
+
const usePersisterIds = () => useThingIds(Offsets.Persister);
|
|
1450
|
+
const usePersister = (id) => useThing(id, Offsets.Persister);
|
|
1451
|
+
const usePersisterOrPersisterById = (persisterOrPersisterId) =>
|
|
1452
|
+
useThingOrThingById(persisterOrPersisterId, Offsets.Persister);
|
|
1453
|
+
const useProvidePersister = (persisterId, persister) =>
|
|
1454
|
+
useProvideThing(persisterId, persister, Offsets.Persister);
|
|
1450
1455
|
const usePersisterStatus = (persisterOrPersisterId) =>
|
|
1451
1456
|
useListenable(
|
|
1452
1457
|
STATUS,
|
|
@@ -1496,6 +1501,12 @@ const useCreateSynchronizer = (
|
|
|
1496
1501
|
);
|
|
1497
1502
|
return synchronizer;
|
|
1498
1503
|
};
|
|
1504
|
+
const useSynchronizerIds = () => useThingIds(Offsets.Synchronizer);
|
|
1505
|
+
const useSynchronizer = (id) => useThing(id, Offsets.Synchronizer);
|
|
1506
|
+
const useSynchronizerOrSynchronizerById = (synchronizerOrSynchronizerId) =>
|
|
1507
|
+
useThingOrThingById(synchronizerOrSynchronizerId, Offsets.Synchronizer);
|
|
1508
|
+
const useProvideSynchronizer = (persisterId, persister) =>
|
|
1509
|
+
useProvideThing(persisterId, persister, Offsets.Synchronizer);
|
|
1499
1510
|
const useSynchronizerStatus = (synchronizerOrSynchronizerId) =>
|
|
1500
1511
|
useListenable(
|
|
1501
1512
|
STATUS,
|
|
@@ -2098,10 +2109,8 @@ export {
|
|
|
2098
2109
|
RowView,
|
|
2099
2110
|
SliceView,
|
|
2100
2111
|
SortedTableView,
|
|
2101
|
-
TableView,
|
|
2102
2112
|
TablesView,
|
|
2103
|
-
|
|
2104
|
-
ValuesView,
|
|
2113
|
+
TableView,
|
|
2105
2114
|
useAddRowCallback,
|
|
2106
2115
|
useCell,
|
|
2107
2116
|
useCellIds,
|
|
@@ -2147,10 +2156,10 @@ export {
|
|
|
2147
2156
|
useHasValueListener,
|
|
2148
2157
|
useHasValues,
|
|
2149
2158
|
useHasValuesListener,
|
|
2150
|
-
useIndexIds,
|
|
2151
2159
|
useIndexes,
|
|
2152
2160
|
useIndexesIds,
|
|
2153
2161
|
useIndexesOrIndexesById,
|
|
2162
|
+
useIndexIds,
|
|
2154
2163
|
useLinkedRowIds,
|
|
2155
2164
|
useLinkedRowIdsListener,
|
|
2156
2165
|
useLocalRowIds,
|
|
@@ -2248,4 +2257,6 @@ export {
|
|
|
2248
2257
|
useValues,
|
|
2249
2258
|
useValuesListener,
|
|
2250
2259
|
useWillFinishTransactionListener,
|
|
2260
|
+
ValuesView,
|
|
2261
|
+
ValueView,
|
|
2251
2262
|
};
|
package/ui-react-dom/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
1
3
|
import {
|
|
2
4
|
CellView,
|
|
3
5
|
ResultCellView,
|
|
4
|
-
ValueView,
|
|
5
6
|
useCell,
|
|
6
7
|
useIndexesOrIndexesById,
|
|
7
8
|
useRelationshipsOrRelationshipsById,
|
|
@@ -20,9 +21,8 @@ import {
|
|
|
20
21
|
useTableCellIds,
|
|
21
22
|
useValue,
|
|
22
23
|
useValueIds,
|
|
24
|
+
ValueView,
|
|
23
25
|
} from '../ui-react/index.js';
|
|
24
|
-
import React from 'react';
|
|
25
|
-
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
26
26
|
|
|
27
27
|
const getTypeOf = (thing) => typeof thing;
|
|
28
28
|
const EMPTY_STRING = '';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
1
3
|
import {
|
|
2
4
|
CellView,
|
|
3
5
|
ResultCellView,
|
|
4
|
-
ValueView,
|
|
5
6
|
useCell,
|
|
6
7
|
useIndexesOrIndexesById,
|
|
7
8
|
useRelationshipsOrRelationshipsById,
|
|
@@ -20,9 +21,8 @@ import {
|
|
|
20
21
|
useTableCellIds,
|
|
21
22
|
useValue,
|
|
22
23
|
useValueIds,
|
|
24
|
+
ValueView,
|
|
23
25
|
} from '../../ui-react/with-schemas/index.js';
|
|
24
|
-
import React from 'react';
|
|
25
|
-
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
26
26
|
|
|
27
27
|
const getTypeOf = (thing) => typeof thing;
|
|
28
28
|
const EMPTY_STRING = '';
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
1
3
|
import {
|
|
2
4
|
CellView,
|
|
3
5
|
ResultCellView,
|
|
4
|
-
ValueView,
|
|
5
6
|
useCell,
|
|
6
7
|
useCreatePersister,
|
|
7
8
|
useCreateStore,
|
|
8
|
-
useIndexIds,
|
|
9
9
|
useIndexes,
|
|
10
10
|
useIndexesIds,
|
|
11
11
|
useIndexesOrIndexesById,
|
|
12
|
+
useIndexIds,
|
|
12
13
|
useMetric,
|
|
13
14
|
useMetricIds,
|
|
14
15
|
useMetrics,
|
|
@@ -39,9 +40,8 @@ import {
|
|
|
39
40
|
useValue,
|
|
40
41
|
useValueIds,
|
|
41
42
|
useValues,
|
|
43
|
+
ValueView,
|
|
42
44
|
} from '../ui-react/index.js';
|
|
43
|
-
import React from 'react';
|
|
44
|
-
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
45
45
|
|
|
46
46
|
const getTypeOf = (thing) => typeof thing;
|
|
47
47
|
const EMPTY_STRING = '';
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
1
3
|
import {
|
|
2
4
|
CellView,
|
|
3
5
|
ResultCellView,
|
|
4
|
-
ValueView,
|
|
5
6
|
useCell,
|
|
6
7
|
useCreatePersister,
|
|
7
8
|
useCreateStore,
|
|
8
|
-
useIndexIds,
|
|
9
9
|
useIndexes,
|
|
10
10
|
useIndexesIds,
|
|
11
11
|
useIndexesOrIndexesById,
|
|
12
|
+
useIndexIds,
|
|
12
13
|
useMetric,
|
|
13
14
|
useMetricIds,
|
|
14
15
|
useMetrics,
|
|
@@ -39,9 +40,8 @@ import {
|
|
|
39
40
|
useValue,
|
|
40
41
|
useValueIds,
|
|
41
42
|
useValues,
|
|
43
|
+
ValueView,
|
|
42
44
|
} from '../../ui-react/with-schemas/index.js';
|
|
43
|
-
import React from 'react';
|
|
44
|
-
import {Fragment, jsx, jsxs} from 'react/jsx-runtime';
|
|
45
45
|
|
|
46
46
|
const getTypeOf = (thing) => typeof thing;
|
|
47
47
|
const EMPTY_STRING = '';
|