tinybase 8.1.0-beta.0 → 8.1.0-beta.2
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/index.d.ts +0 -0
- package/@types/_internal/ui/with-schemas/index.d.ts +47 -0
- package/@types/_internal/ui-react/with-schemas/index.d.ts +9 -31
- package/@types/omni/index.d.ts +0 -3
- package/@types/omni/with-schemas/index.d.ts +0 -3
- package/@types/ui-react/with-schemas/index.d.ts +10 -8
- package/@types/ui-react-dom/with-schemas/index.d.ts +6 -4
- package/@types/ui-svelte/index.d.ts +3484 -0
- package/@types/ui-svelte/with-schemas/index.d.ts +3628 -0
- package/checkpoints/index.js +4 -1
- package/checkpoints/with-schemas/index.js +4 -1
- package/common/index.js +4 -1
- package/common/with-schemas/index.js +4 -1
- package/index.js +4 -1
- package/indexes/index.js +4 -1
- package/indexes/with-schemas/index.js +4 -1
- package/mergeable-store/index.js +4 -1
- package/mergeable-store/with-schemas/index.js +4 -1
- package/metrics/index.js +4 -1
- package/metrics/with-schemas/index.js +4 -1
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/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/ui-svelte/index.js +1 -0
- package/min/ui-svelte/index.js.gz +0 -0
- package/min/ui-svelte/with-schemas/index.js +1 -0
- package/min/ui-svelte/with-schemas/index.js.gz +0 -0
- package/omni/index.js +11 -4739
- package/omni/with-schemas/index.js +11 -4739
- package/package.json +47 -7
- package/persisters/index.js +4 -1
- package/persisters/persister-automerge/index.js +4 -1
- package/persisters/persister-automerge/with-schemas/index.js +4 -1
- package/persisters/persister-browser/index.js +4 -1
- package/persisters/persister-browser/with-schemas/index.js +4 -1
- package/persisters/persister-cr-sqlite-wasm/index.js +4 -1
- package/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +4 -1
- package/persisters/persister-durable-object-sql-storage/index.js +4 -1
- package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +4 -1
- package/persisters/persister-durable-object-storage/index.js +4 -1
- package/persisters/persister-durable-object-storage/with-schemas/index.js +4 -1
- package/persisters/persister-electric-sql/index.js +4 -1
- package/persisters/persister-electric-sql/with-schemas/index.js +4 -1
- package/persisters/persister-expo-sqlite/index.js +4 -1
- package/persisters/persister-expo-sqlite/with-schemas/index.js +4 -1
- package/persisters/persister-file/index.js +4 -1
- package/persisters/persister-file/with-schemas/index.js +4 -1
- package/persisters/persister-indexed-db/index.js +4 -1
- package/persisters/persister-indexed-db/with-schemas/index.js +4 -1
- package/persisters/persister-libsql/index.js +4 -1
- package/persisters/persister-libsql/with-schemas/index.js +4 -1
- package/persisters/persister-partykit-client/index.js +4 -1
- package/persisters/persister-partykit-client/with-schemas/index.js +4 -1
- package/persisters/persister-partykit-server/index.js +4 -1
- package/persisters/persister-partykit-server/with-schemas/index.js +4 -1
- package/persisters/persister-pglite/index.js +4 -1
- package/persisters/persister-pglite/with-schemas/index.js +4 -1
- package/persisters/persister-postgres/index.js +4 -1
- package/persisters/persister-postgres/with-schemas/index.js +4 -1
- package/persisters/persister-powersync/index.js +4 -1
- package/persisters/persister-powersync/with-schemas/index.js +4 -1
- package/persisters/persister-react-native-mmkv/index.js +4 -1
- package/persisters/persister-react-native-mmkv/with-schemas/index.js +4 -1
- package/persisters/persister-react-native-sqlite/index.js +4 -1
- package/persisters/persister-react-native-sqlite/with-schemas/index.js +4 -1
- package/persisters/persister-remote/index.js +4 -1
- package/persisters/persister-remote/with-schemas/index.js +4 -1
- package/persisters/persister-sqlite-bun/index.js +4 -1
- package/persisters/persister-sqlite-bun/with-schemas/index.js +4 -1
- package/persisters/persister-sqlite-wasm/index.js +4 -1
- package/persisters/persister-sqlite-wasm/with-schemas/index.js +4 -1
- package/persisters/persister-sqlite3/index.js +4 -1
- package/persisters/persister-sqlite3/with-schemas/index.js +4 -1
- package/persisters/persister-yjs/index.js +4 -1
- package/persisters/persister-yjs/with-schemas/index.js +4 -1
- package/persisters/with-schemas/index.js +4 -1
- package/queries/index.js +4 -1
- package/queries/with-schemas/index.js +4 -1
- package/readme.md +14 -14
- package/relationships/index.js +4 -1
- package/relationships/with-schemas/index.js +4 -1
- package/releases.md +70 -44
- package/schematizers/index.js +4 -1
- package/schematizers/schematizer-arktype/index.js +4 -1
- package/schematizers/schematizer-arktype/with-schemas/index.js +4 -1
- package/schematizers/schematizer-effect/index.js +4 -1
- package/schematizers/schematizer-effect/with-schemas/index.js +4 -1
- package/schematizers/schematizer-typebox/index.js +4 -1
- package/schematizers/schematizer-typebox/with-schemas/index.js +4 -1
- package/schematizers/schematizer-valibot/index.js +4 -1
- package/schematizers/schematizer-valibot/with-schemas/index.js +4 -1
- package/schematizers/schematizer-yup/index.js +4 -1
- package/schematizers/schematizer-yup/with-schemas/index.js +4 -1
- package/schematizers/schematizer-zod/index.js +4 -1
- package/schematizers/schematizer-zod/with-schemas/index.js +4 -1
- package/schematizers/with-schemas/index.js +4 -1
- package/store/index.js +4 -1
- package/store/with-schemas/index.js +4 -1
- package/synchronizers/index.js +4 -1
- package/synchronizers/synchronizer-broadcast-channel/index.js +4 -1
- package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +4 -1
- package/synchronizers/synchronizer-local/index.js +4 -1
- package/synchronizers/synchronizer-local/with-schemas/index.js +4 -1
- package/synchronizers/synchronizer-ws-client/index.js +4 -1
- package/synchronizers/synchronizer-ws-client/with-schemas/index.js +4 -1
- package/synchronizers/synchronizer-ws-server/index.js +4 -1
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -1
- package/synchronizers/synchronizer-ws-server-durable-object/index.js +4 -1
- package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +4 -1
- package/synchronizers/synchronizer-ws-server-simple/index.js +4 -1
- package/synchronizers/synchronizer-ws-server-simple/with-schemas/index.js +4 -1
- package/synchronizers/with-schemas/index.js +4 -1
- package/ui-react/index.js +100 -100
- package/ui-react/with-schemas/index.js +100 -100
- package/ui-react-dom/index.js +4 -1
- package/ui-react-dom/with-schemas/index.js +4 -1
- package/ui-react-inspector/index.js +4 -1
- package/ui-react-inspector/with-schemas/index.js +4 -1
- package/ui-svelte/index.js +2684 -0
- package/ui-svelte/with-schemas/index.js +2684 -0
- package/with-schemas/index.js +4 -1
|
@@ -0,0 +1,2684 @@
|
|
|
1
|
+
import {getContext, setContext, untrack} from 'svelte';
|
|
2
|
+
import * as $ from 'svelte/internal/client';
|
|
3
|
+
import 'svelte/internal/disclose-version';
|
|
4
|
+
|
|
5
|
+
const getTypeOf = (thing) => typeof thing;
|
|
6
|
+
const TINYBASE = 'tinybase';
|
|
7
|
+
const EMPTY_STRING = '';
|
|
8
|
+
const STRING = getTypeOf(EMPTY_STRING);
|
|
9
|
+
const FUNCTION = getTypeOf(getTypeOf);
|
|
10
|
+
const LISTENER = 'Listener';
|
|
11
|
+
const RESULT = 'Result';
|
|
12
|
+
const GET = 'get';
|
|
13
|
+
const ADD = 'add';
|
|
14
|
+
const HAS = 'Has';
|
|
15
|
+
const _HAS = 'has';
|
|
16
|
+
const IDS = 'Ids';
|
|
17
|
+
const TABLE = 'Table';
|
|
18
|
+
const TABLES = TABLE + 's';
|
|
19
|
+
const TABLE_IDS = TABLE + IDS;
|
|
20
|
+
const ROW = 'Row';
|
|
21
|
+
const ROW_COUNT = ROW + 'Count';
|
|
22
|
+
const ROW_IDS = ROW + IDS;
|
|
23
|
+
const SORTED_ROW_IDS = 'Sorted' + ROW + IDS;
|
|
24
|
+
const CELL = 'Cell';
|
|
25
|
+
const CELL_IDS = CELL + IDS;
|
|
26
|
+
const VALUE = 'Value';
|
|
27
|
+
const VALUES = VALUE + 's';
|
|
28
|
+
const VALUE_IDS = VALUE + IDS;
|
|
29
|
+
const TRANSACTION = 'Transaction';
|
|
30
|
+
const FINISH = 'Finish';
|
|
31
|
+
const STATUS = 'Status';
|
|
32
|
+
const METRIC = 'Metric';
|
|
33
|
+
const INDEX = 'Index';
|
|
34
|
+
const SLICE = 'Slice';
|
|
35
|
+
const RELATIONSHIP = 'Relationship';
|
|
36
|
+
const REMOTE_ROW_ID = 'Remote' + ROW + 'Id';
|
|
37
|
+
const LOCAL = 'Local';
|
|
38
|
+
const LINKED = 'Linked';
|
|
39
|
+
const QUERY = 'Query';
|
|
40
|
+
const CHECKPOINT = 'Checkpoint';
|
|
41
|
+
|
|
42
|
+
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
43
|
+
predicate(value)
|
|
44
|
+
? /* istanbul ignore next */
|
|
45
|
+
otherwise?.()
|
|
46
|
+
: then(value);
|
|
47
|
+
const isUndefined = (thing) => thing === void 0;
|
|
48
|
+
const ifNotUndefined = getIfNotFunction(isUndefined);
|
|
49
|
+
const isString = (thing) => getTypeOf(thing) == STRING;
|
|
50
|
+
const isFunction = (thing) => getTypeOf(thing) == FUNCTION;
|
|
51
|
+
|
|
52
|
+
const object = Object;
|
|
53
|
+
const objIds = object.keys;
|
|
54
|
+
const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
|
|
55
|
+
|
|
56
|
+
const TINYBASE_CONTEXT_KEY = TINYBASE + '_uisc';
|
|
57
|
+
|
|
58
|
+
/* hooks.svelte.ts generated by Svelte v5.53.11 */
|
|
59
|
+
|
|
60
|
+
const EMPTY_ARR = [];
|
|
61
|
+
const EMPTY_OBJ = {};
|
|
62
|
+
const DEFAULT_CHECKPOINT_IDS = [EMPTY_ARR, void 0, EMPTY_ARR];
|
|
63
|
+
const OFFSET_STORE = 0;
|
|
64
|
+
const OFFSET_METRICS = 1;
|
|
65
|
+
const OFFSET_INDEXES = 2;
|
|
66
|
+
const OFFSET_RELATIONSHIPS = 3;
|
|
67
|
+
const OFFSET_QUERIES = 4;
|
|
68
|
+
const OFFSET_CHECKPOINTS = 5;
|
|
69
|
+
const OFFSET_PERSISTER = 6;
|
|
70
|
+
const OFFSET_SYNCHRONIZER = 7;
|
|
71
|
+
const maybeGet = (thing) => (isFunction(thing) ? thing() : thing);
|
|
72
|
+
const getContextValue = () => getContext(TINYBASE_CONTEXT_KEY) ?? [];
|
|
73
|
+
|
|
74
|
+
const getThing = (contextValue, thingOrThingId, offset) =>
|
|
75
|
+
isUndefined(thingOrThingId)
|
|
76
|
+
? contextValue[offset * 2]
|
|
77
|
+
: isString(thingOrThingId)
|
|
78
|
+
? objGet(contextValue[offset * 2 + 1], thingOrThingId)
|
|
79
|
+
: thingOrThingId;
|
|
80
|
+
|
|
81
|
+
const useThing = (thingOrThingId, offset) =>
|
|
82
|
+
getThing(getContextValue(), thingOrThingId, offset);
|
|
83
|
+
|
|
84
|
+
const useThingOrThingById = (thingOrThingId, offset) => {
|
|
85
|
+
const contextValue = getContextValue();
|
|
86
|
+
|
|
87
|
+
return () => getThing(contextValue, maybeGet(thingOrThingId), offset);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const getThingIds = (contextValue, offset) =>
|
|
91
|
+
objIds(contextValue[offset * 2 + 1] ?? EMPTY_OBJ);
|
|
92
|
+
|
|
93
|
+
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
94
|
+
useThingOrThingById(storeOrStoreId, OFFSET_STORE);
|
|
95
|
+
const useMetricsOrMetricsById = (metricsOrMetricsId) =>
|
|
96
|
+
useThingOrThingById(metricsOrMetricsId, OFFSET_METRICS);
|
|
97
|
+
const useIndexesOrIndexesById = (indexesOrIndexesId) =>
|
|
98
|
+
useThingOrThingById(indexesOrIndexesId, OFFSET_INDEXES);
|
|
99
|
+
const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
|
|
100
|
+
useThingOrThingById(relationshipsOrRelationshipsId, OFFSET_RELATIONSHIPS);
|
|
101
|
+
const useQueriesOrQueriesById = (queriesOrQueriesId) =>
|
|
102
|
+
useThingOrThingById(queriesOrQueriesId, OFFSET_QUERIES);
|
|
103
|
+
const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
|
|
104
|
+
useThingOrThingById(checkpointsOrCheckpointsId, OFFSET_CHECKPOINTS);
|
|
105
|
+
const usePersisterOrPersisterById = (persisterOrPersisterId) =>
|
|
106
|
+
useThingOrThingById(persisterOrPersisterId, OFFSET_PERSISTER);
|
|
107
|
+
const useSynchronizerOrSynchronizerById = (synchronizerOrSynchronizerId) =>
|
|
108
|
+
useThingOrThingById(synchronizerOrSynchronizerId, OFFSET_SYNCHRONIZER);
|
|
109
|
+
|
|
110
|
+
const useListenable = (
|
|
111
|
+
getThing2,
|
|
112
|
+
listenable,
|
|
113
|
+
defaultValue,
|
|
114
|
+
getArgs = () => EMPTY_ARR,
|
|
115
|
+
isHas,
|
|
116
|
+
) => {
|
|
117
|
+
const getMethod = (isHas ? _HAS : GET) + listenable;
|
|
118
|
+
const addMethod = ADD + (isHas ? HAS : '') + listenable + LISTENER;
|
|
119
|
+
let value = $.state(
|
|
120
|
+
$.proxy(getThing2()?.[getMethod]?.(...getArgs()) ?? defaultValue),
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
if (typeof window !== 'undefined') {
|
|
124
|
+
$.user_effect(() => {
|
|
125
|
+
const thing = getThing2();
|
|
126
|
+
const args = getArgs();
|
|
127
|
+
|
|
128
|
+
$.set(value, thing?.[getMethod]?.(...args) ?? defaultValue, true);
|
|
129
|
+
|
|
130
|
+
const listenerId = thing?.[addMethod]?.(...args, () => {
|
|
131
|
+
$.set(value, thing[getMethod](...getArgs()) ?? defaultValue, true);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
return () => thing?.delListener?.(listenerId);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
get current() {
|
|
140
|
+
return $.get(value);
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const useListener = (
|
|
146
|
+
getThing2,
|
|
147
|
+
listenable,
|
|
148
|
+
listener,
|
|
149
|
+
getPreArgs = () => EMPTY_ARR,
|
|
150
|
+
mutator,
|
|
151
|
+
) => {
|
|
152
|
+
if (typeof window !== 'undefined') {
|
|
153
|
+
$.user_effect(() => {
|
|
154
|
+
const thing = getThing2();
|
|
155
|
+
const preArgs = getPreArgs();
|
|
156
|
+
const listenerId = thing?.[ADD + listenable + LISTENER]?.(
|
|
157
|
+
...preArgs,
|
|
158
|
+
listener,
|
|
159
|
+
...(mutator !== void 0 ? [mutator] : EMPTY_ARR),
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
return () => thing?.delListener?.(listenerId);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const useHasTables = (storeOrStoreId) =>
|
|
168
|
+
useListenable(
|
|
169
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
170
|
+
TABLES,
|
|
171
|
+
false,
|
|
172
|
+
() => EMPTY_ARR,
|
|
173
|
+
1,
|
|
174
|
+
);
|
|
175
|
+
const useTables = (storeOrStoreId) =>
|
|
176
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), TABLES, EMPTY_OBJ);
|
|
177
|
+
const useTableIds = (storeOrStoreId) =>
|
|
178
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), TABLE_IDS, EMPTY_ARR);
|
|
179
|
+
const useHasTable = (tableId, storeOrStoreId) =>
|
|
180
|
+
useListenable(
|
|
181
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
182
|
+
TABLE,
|
|
183
|
+
false,
|
|
184
|
+
() => [maybeGet(tableId)],
|
|
185
|
+
1,
|
|
186
|
+
);
|
|
187
|
+
const useTable = (tableId, storeOrStoreId) =>
|
|
188
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), TABLE, EMPTY_OBJ, () => [
|
|
189
|
+
maybeGet(tableId),
|
|
190
|
+
]);
|
|
191
|
+
const useTableCellIds = (tableId, storeOrStoreId) =>
|
|
192
|
+
useListenable(
|
|
193
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
194
|
+
TABLE + CELL_IDS,
|
|
195
|
+
EMPTY_ARR,
|
|
196
|
+
() => [maybeGet(tableId)],
|
|
197
|
+
);
|
|
198
|
+
const useHasTableCell = (tableId, cellId, storeOrStoreId) =>
|
|
199
|
+
useListenable(
|
|
200
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
201
|
+
TABLE + CELL,
|
|
202
|
+
false,
|
|
203
|
+
() => [maybeGet(tableId), maybeGet(cellId)],
|
|
204
|
+
1,
|
|
205
|
+
);
|
|
206
|
+
const useRowCount = (tableId, storeOrStoreId) =>
|
|
207
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), ROW_COUNT, 0, () => [
|
|
208
|
+
maybeGet(tableId),
|
|
209
|
+
]);
|
|
210
|
+
const useRowIds = (tableId, storeOrStoreId) =>
|
|
211
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), ROW_IDS, EMPTY_ARR, () => [
|
|
212
|
+
maybeGet(tableId),
|
|
213
|
+
]);
|
|
214
|
+
|
|
215
|
+
const useSortedRowIds = (
|
|
216
|
+
tableId,
|
|
217
|
+
cellId,
|
|
218
|
+
descending = false,
|
|
219
|
+
offset = 0,
|
|
220
|
+
limit,
|
|
221
|
+
storeOrStoreId,
|
|
222
|
+
) =>
|
|
223
|
+
useListenable(
|
|
224
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
225
|
+
SORTED_ROW_IDS,
|
|
226
|
+
EMPTY_ARR,
|
|
227
|
+
() => [
|
|
228
|
+
maybeGet(tableId),
|
|
229
|
+
maybeGet(cellId),
|
|
230
|
+
maybeGet(descending),
|
|
231
|
+
maybeGet(offset),
|
|
232
|
+
maybeGet(limit),
|
|
233
|
+
],
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
const useHasRow = (tableId, rowId, storeOrStoreId) =>
|
|
237
|
+
useListenable(
|
|
238
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
239
|
+
ROW,
|
|
240
|
+
false,
|
|
241
|
+
() => [maybeGet(tableId), maybeGet(rowId)],
|
|
242
|
+
1,
|
|
243
|
+
);
|
|
244
|
+
const useRow = (tableId, rowId, storeOrStoreId) =>
|
|
245
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), ROW, EMPTY_OBJ, () => [
|
|
246
|
+
maybeGet(tableId),
|
|
247
|
+
maybeGet(rowId),
|
|
248
|
+
]);
|
|
249
|
+
const useCellIds = (tableId, rowId, storeOrStoreId) =>
|
|
250
|
+
useListenable(
|
|
251
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
252
|
+
CELL_IDS,
|
|
253
|
+
EMPTY_ARR,
|
|
254
|
+
() => [maybeGet(tableId), maybeGet(rowId)],
|
|
255
|
+
);
|
|
256
|
+
const useHasCell = (tableId, rowId, cellId, storeOrStoreId) =>
|
|
257
|
+
useListenable(
|
|
258
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
259
|
+
CELL,
|
|
260
|
+
false,
|
|
261
|
+
() => [maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)],
|
|
262
|
+
1,
|
|
263
|
+
);
|
|
264
|
+
const useCell = (tableId, rowId, cellId, storeOrStoreId) =>
|
|
265
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), CELL, void 0, () => [
|
|
266
|
+
maybeGet(tableId),
|
|
267
|
+
maybeGet(rowId),
|
|
268
|
+
maybeGet(cellId),
|
|
269
|
+
]);
|
|
270
|
+
|
|
271
|
+
const useBindableCell = (tableId, rowId, cellId, storeOrStoreId) => {
|
|
272
|
+
const getS = useStoreOrStoreById(storeOrStoreId);
|
|
273
|
+
let value = $.state(
|
|
274
|
+
$.proxy(
|
|
275
|
+
getS()?.getCell(maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)),
|
|
276
|
+
),
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
if (typeof window !== 'undefined') {
|
|
280
|
+
$.user_effect(() => {
|
|
281
|
+
const s = getS();
|
|
282
|
+
|
|
283
|
+
const t = maybeGet(tableId),
|
|
284
|
+
r = maybeGet(rowId),
|
|
285
|
+
c = maybeGet(cellId);
|
|
286
|
+
|
|
287
|
+
$.set(value, s?.getCell(t, r, c), true);
|
|
288
|
+
|
|
289
|
+
const listenerId = s?.addCellListener(t, r, c, (st) => {
|
|
290
|
+
$.set(
|
|
291
|
+
value,
|
|
292
|
+
st.getCell(maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)),
|
|
293
|
+
true,
|
|
294
|
+
);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
return () => s?.delListener?.(listenerId);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return {
|
|
302
|
+
get current() {
|
|
303
|
+
return $.get(value);
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
set current(v) {
|
|
307
|
+
getS()?.setCell(maybeGet(tableId), maybeGet(rowId), maybeGet(cellId), v);
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
const useHasValues = (storeOrStoreId) =>
|
|
313
|
+
useListenable(
|
|
314
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
315
|
+
VALUES,
|
|
316
|
+
false,
|
|
317
|
+
() => EMPTY_ARR,
|
|
318
|
+
1,
|
|
319
|
+
);
|
|
320
|
+
const useValues = (storeOrStoreId) =>
|
|
321
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), VALUES, EMPTY_OBJ);
|
|
322
|
+
const useValueIds = (storeOrStoreId) =>
|
|
323
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), VALUE_IDS, EMPTY_ARR);
|
|
324
|
+
const useHasValue = (valueId, storeOrStoreId) =>
|
|
325
|
+
useListenable(
|
|
326
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
327
|
+
VALUE,
|
|
328
|
+
false,
|
|
329
|
+
() => [maybeGet(valueId)],
|
|
330
|
+
1,
|
|
331
|
+
);
|
|
332
|
+
const useValue = (valueId, storeOrStoreId) =>
|
|
333
|
+
useListenable(useStoreOrStoreById(storeOrStoreId), VALUE, void 0, () => [
|
|
334
|
+
maybeGet(valueId),
|
|
335
|
+
]);
|
|
336
|
+
|
|
337
|
+
const useBindableValue = (valueId, storeOrStoreId) => {
|
|
338
|
+
const getS = useStoreOrStoreById(storeOrStoreId);
|
|
339
|
+
let value = $.state($.proxy(getS()?.getValue(maybeGet(valueId))));
|
|
340
|
+
|
|
341
|
+
if (typeof window !== 'undefined') {
|
|
342
|
+
$.user_effect(() => {
|
|
343
|
+
const s = getS();
|
|
344
|
+
const vid = maybeGet(valueId);
|
|
345
|
+
|
|
346
|
+
$.set(value, s?.getValue(vid), true);
|
|
347
|
+
|
|
348
|
+
const listenerId = s?.addValueListener(vid, (st) => {
|
|
349
|
+
$.set(value, st.getValue(maybeGet(valueId)), true);
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
return () => s?.delListener?.(listenerId);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return {
|
|
357
|
+
get current() {
|
|
358
|
+
return $.get(value);
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
set current(v) {
|
|
362
|
+
getS()?.setValue(maybeGet(valueId), v);
|
|
363
|
+
},
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
const useStore = (id) => useThing(id, OFFSET_STORE);
|
|
368
|
+
|
|
369
|
+
const useStoreIds = () => {
|
|
370
|
+
const contextValue = getContextValue();
|
|
371
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_STORE)));
|
|
372
|
+
|
|
373
|
+
if (typeof window !== 'undefined') {
|
|
374
|
+
$.user_effect(() => {
|
|
375
|
+
$.set(ids, getThingIds(contextValue, OFFSET_STORE), true);
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return {
|
|
380
|
+
get current() {
|
|
381
|
+
return $.get(ids);
|
|
382
|
+
},
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
const useMetrics = (id) => useThing(id, OFFSET_METRICS);
|
|
387
|
+
|
|
388
|
+
const useMetricsIds = () => {
|
|
389
|
+
const contextValue = getContextValue();
|
|
390
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_METRICS)));
|
|
391
|
+
|
|
392
|
+
if (typeof window !== 'undefined') {
|
|
393
|
+
$.user_effect(() => {
|
|
394
|
+
$.set(ids, getThingIds(contextValue, OFFSET_METRICS), true);
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return {
|
|
399
|
+
get current() {
|
|
400
|
+
return $.get(ids);
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
const useMetricIds = (metricsOrMetricsId) =>
|
|
406
|
+
useListenable(
|
|
407
|
+
useMetricsOrMetricsById(metricsOrMetricsId),
|
|
408
|
+
METRIC + IDS,
|
|
409
|
+
EMPTY_ARR,
|
|
410
|
+
);
|
|
411
|
+
const useMetric = (metricId, metricsOrMetricsId) =>
|
|
412
|
+
useListenable(
|
|
413
|
+
useMetricsOrMetricsById(metricsOrMetricsId),
|
|
414
|
+
METRIC,
|
|
415
|
+
void 0,
|
|
416
|
+
() => [maybeGet(metricId)],
|
|
417
|
+
);
|
|
418
|
+
const useIndexes = (id) => useThing(id, OFFSET_INDEXES);
|
|
419
|
+
|
|
420
|
+
const useIndexesIds = () => {
|
|
421
|
+
const contextValue = getContextValue();
|
|
422
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_INDEXES)));
|
|
423
|
+
|
|
424
|
+
if (typeof window !== 'undefined') {
|
|
425
|
+
$.user_effect(() => {
|
|
426
|
+
$.set(ids, getThingIds(contextValue, OFFSET_INDEXES), true);
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return {
|
|
431
|
+
get current() {
|
|
432
|
+
return $.get(ids);
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
const useIndexIds = (indexesOrIndexesId) =>
|
|
438
|
+
useListenable(
|
|
439
|
+
useIndexesOrIndexesById(indexesOrIndexesId),
|
|
440
|
+
INDEX + IDS,
|
|
441
|
+
EMPTY_ARR,
|
|
442
|
+
);
|
|
443
|
+
const useSliceIds = (indexId, indexesOrIndexesId) =>
|
|
444
|
+
useListenable(
|
|
445
|
+
useIndexesOrIndexesById(indexesOrIndexesId),
|
|
446
|
+
SLICE + IDS,
|
|
447
|
+
EMPTY_ARR,
|
|
448
|
+
() => [maybeGet(indexId)],
|
|
449
|
+
);
|
|
450
|
+
const useSliceRowIds = (indexId, sliceId, indexesOrIndexesId) =>
|
|
451
|
+
useListenable(
|
|
452
|
+
useIndexesOrIndexesById(indexesOrIndexesId),
|
|
453
|
+
SLICE + ROW_IDS,
|
|
454
|
+
EMPTY_ARR,
|
|
455
|
+
() => [maybeGet(indexId), maybeGet(sliceId)],
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
const useIndexStoreTableId = (indexesOrId, indexId) => {
|
|
459
|
+
const getI = useIndexesOrIndexesById(indexesOrId);
|
|
460
|
+
|
|
461
|
+
return {
|
|
462
|
+
get store() {
|
|
463
|
+
return getI()?.getStore();
|
|
464
|
+
},
|
|
465
|
+
|
|
466
|
+
get tableId() {
|
|
467
|
+
return getI()?.getTableId(maybeGet(indexId));
|
|
468
|
+
},
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
const useQueries = (id) => useThing(id, OFFSET_QUERIES);
|
|
473
|
+
|
|
474
|
+
const useQueriesIds = () => {
|
|
475
|
+
const contextValue = getContextValue();
|
|
476
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_QUERIES)));
|
|
477
|
+
|
|
478
|
+
if (typeof window !== 'undefined') {
|
|
479
|
+
$.user_effect(() => {
|
|
480
|
+
$.set(ids, getThingIds(contextValue, OFFSET_QUERIES), true);
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return {
|
|
485
|
+
get current() {
|
|
486
|
+
return $.get(ids);
|
|
487
|
+
},
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
const useQueryIds = (queriesOrQueriesId) =>
|
|
492
|
+
useListenable(
|
|
493
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
494
|
+
QUERY + IDS,
|
|
495
|
+
EMPTY_ARR,
|
|
496
|
+
);
|
|
497
|
+
const useResultTable = (queryId, queriesOrQueriesId) =>
|
|
498
|
+
useListenable(
|
|
499
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
500
|
+
RESULT + TABLE,
|
|
501
|
+
EMPTY_OBJ,
|
|
502
|
+
() => [maybeGet(queryId)],
|
|
503
|
+
);
|
|
504
|
+
const useResultTableCellIds = (queryId, queriesOrQueriesId) =>
|
|
505
|
+
useListenable(
|
|
506
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
507
|
+
RESULT + TABLE + CELL_IDS,
|
|
508
|
+
EMPTY_ARR,
|
|
509
|
+
() => [maybeGet(queryId)],
|
|
510
|
+
);
|
|
511
|
+
const useResultRowCount = (queryId, queriesOrQueriesId) =>
|
|
512
|
+
useListenable(
|
|
513
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
514
|
+
RESULT + ROW_COUNT,
|
|
515
|
+
0,
|
|
516
|
+
() => [maybeGet(queryId)],
|
|
517
|
+
);
|
|
518
|
+
const useResultRowIds = (queryId, queriesOrQueriesId) =>
|
|
519
|
+
useListenable(
|
|
520
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
521
|
+
RESULT + ROW_IDS,
|
|
522
|
+
EMPTY_ARR,
|
|
523
|
+
() => [maybeGet(queryId)],
|
|
524
|
+
);
|
|
525
|
+
|
|
526
|
+
const useResultSortedRowIds = (
|
|
527
|
+
queryId,
|
|
528
|
+
cellId,
|
|
529
|
+
descending = false,
|
|
530
|
+
offset = 0,
|
|
531
|
+
limit,
|
|
532
|
+
queriesOrQueriesId,
|
|
533
|
+
) =>
|
|
534
|
+
useListenable(
|
|
535
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
536
|
+
RESULT + SORTED_ROW_IDS,
|
|
537
|
+
EMPTY_ARR,
|
|
538
|
+
() => [
|
|
539
|
+
maybeGet(queryId),
|
|
540
|
+
maybeGet(cellId),
|
|
541
|
+
maybeGet(descending),
|
|
542
|
+
maybeGet(offset),
|
|
543
|
+
maybeGet(limit),
|
|
544
|
+
],
|
|
545
|
+
);
|
|
546
|
+
|
|
547
|
+
const useResultRow = (queryId, rowId, queriesOrQueriesId) =>
|
|
548
|
+
useListenable(
|
|
549
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
550
|
+
RESULT + ROW,
|
|
551
|
+
EMPTY_OBJ,
|
|
552
|
+
() => [maybeGet(queryId), maybeGet(rowId)],
|
|
553
|
+
);
|
|
554
|
+
const useResultCellIds = (queryId, rowId, queriesOrQueriesId) =>
|
|
555
|
+
useListenable(
|
|
556
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
557
|
+
RESULT + CELL_IDS,
|
|
558
|
+
EMPTY_ARR,
|
|
559
|
+
() => [maybeGet(queryId), maybeGet(rowId)],
|
|
560
|
+
);
|
|
561
|
+
const useResultCell = (queryId, rowId, cellId, queriesOrQueriesId) =>
|
|
562
|
+
useListenable(
|
|
563
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
564
|
+
RESULT + CELL,
|
|
565
|
+
void 0,
|
|
566
|
+
() => [maybeGet(queryId), maybeGet(rowId), maybeGet(cellId)],
|
|
567
|
+
);
|
|
568
|
+
const useRelationships = (id) => useThing(id, OFFSET_RELATIONSHIPS);
|
|
569
|
+
|
|
570
|
+
const useRelationshipsIds = () => {
|
|
571
|
+
const contextValue = getContextValue();
|
|
572
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_RELATIONSHIPS)));
|
|
573
|
+
|
|
574
|
+
if (typeof window !== 'undefined') {
|
|
575
|
+
$.user_effect(() => {
|
|
576
|
+
$.set(ids, getThingIds(contextValue, OFFSET_RELATIONSHIPS), true);
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
return {
|
|
581
|
+
get current() {
|
|
582
|
+
return $.get(ids);
|
|
583
|
+
},
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
const useRelationshipIds = (relationshipsOrRelationshipsId) =>
|
|
588
|
+
useListenable(
|
|
589
|
+
useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
|
|
590
|
+
RELATIONSHIP + IDS,
|
|
591
|
+
EMPTY_ARR,
|
|
592
|
+
);
|
|
593
|
+
const useRemoteRowId = (
|
|
594
|
+
relationshipId,
|
|
595
|
+
localRowId,
|
|
596
|
+
relationshipsOrRelationshipsId,
|
|
597
|
+
) =>
|
|
598
|
+
useListenable(
|
|
599
|
+
useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
|
|
600
|
+
REMOTE_ROW_ID,
|
|
601
|
+
void 0,
|
|
602
|
+
() => [maybeGet(relationshipId), maybeGet(localRowId)],
|
|
603
|
+
);
|
|
604
|
+
const useLocalRowIds = (
|
|
605
|
+
relationshipId,
|
|
606
|
+
remoteRowId,
|
|
607
|
+
relationshipsOrRelationshipsId,
|
|
608
|
+
) =>
|
|
609
|
+
useListenable(
|
|
610
|
+
useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
|
|
611
|
+
LOCAL + ROW_IDS,
|
|
612
|
+
EMPTY_ARR,
|
|
613
|
+
() => [maybeGet(relationshipId), maybeGet(remoteRowId)],
|
|
614
|
+
);
|
|
615
|
+
const useLinkedRowIds = (
|
|
616
|
+
relationshipId,
|
|
617
|
+
firstRowId,
|
|
618
|
+
relationshipsOrRelationshipsId,
|
|
619
|
+
) =>
|
|
620
|
+
useListenable(
|
|
621
|
+
useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
|
|
622
|
+
LINKED + ROW_IDS,
|
|
623
|
+
EMPTY_ARR,
|
|
624
|
+
() => [maybeGet(relationshipId), maybeGet(firstRowId)],
|
|
625
|
+
);
|
|
626
|
+
|
|
627
|
+
const useRelationshipsStoreTableIds = (relationshipsOrId, relationshipId) => {
|
|
628
|
+
const getR = useRelationshipsOrRelationshipsById(relationshipsOrId);
|
|
629
|
+
|
|
630
|
+
return {
|
|
631
|
+
get store() {
|
|
632
|
+
return getR()?.getStore();
|
|
633
|
+
},
|
|
634
|
+
|
|
635
|
+
get localTableId() {
|
|
636
|
+
return getR()?.getLocalTableId(maybeGet(relationshipId));
|
|
637
|
+
},
|
|
638
|
+
|
|
639
|
+
get remoteTableId() {
|
|
640
|
+
return getR()?.getRemoteTableId(maybeGet(relationshipId));
|
|
641
|
+
},
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
const useCheckpoints = (id) => useThing(id, OFFSET_CHECKPOINTS);
|
|
646
|
+
|
|
647
|
+
const useCheckpointsIds = () => {
|
|
648
|
+
const contextValue = getContextValue();
|
|
649
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_CHECKPOINTS)));
|
|
650
|
+
|
|
651
|
+
if (typeof window !== 'undefined') {
|
|
652
|
+
$.user_effect(() => {
|
|
653
|
+
$.set(ids, getThingIds(contextValue, OFFSET_CHECKPOINTS), true);
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
return {
|
|
658
|
+
get current() {
|
|
659
|
+
return $.get(ids);
|
|
660
|
+
},
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
const useCheckpointIds = (checkpointsOrCheckpointsId) =>
|
|
665
|
+
useListenable(
|
|
666
|
+
useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
|
|
667
|
+
CHECKPOINT + IDS,
|
|
668
|
+
DEFAULT_CHECKPOINT_IDS,
|
|
669
|
+
);
|
|
670
|
+
const useCheckpoint = (checkpointId, checkpointsOrCheckpointsId) =>
|
|
671
|
+
useListenable(
|
|
672
|
+
useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
|
|
673
|
+
CHECKPOINT,
|
|
674
|
+
void 0,
|
|
675
|
+
() => [maybeGet(checkpointId)],
|
|
676
|
+
);
|
|
677
|
+
|
|
678
|
+
const useGoBackwardCallback = (checkpointsOrCheckpointsId) => {
|
|
679
|
+
const getC = useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId);
|
|
680
|
+
|
|
681
|
+
return () => getC()?.goBackward();
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
const useGoForwardCallback = (checkpointsOrCheckpointsId) => {
|
|
685
|
+
const getC = useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId);
|
|
686
|
+
|
|
687
|
+
return () => getC()?.goForward();
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
const usePersister = (id) => useThing(id, OFFSET_PERSISTER);
|
|
691
|
+
|
|
692
|
+
const usePersisterIds = () => {
|
|
693
|
+
const contextValue = getContextValue();
|
|
694
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_PERSISTER)));
|
|
695
|
+
|
|
696
|
+
if (typeof window !== 'undefined') {
|
|
697
|
+
$.user_effect(() => {
|
|
698
|
+
$.set(ids, getThingIds(contextValue, OFFSET_PERSISTER), true);
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return {
|
|
703
|
+
get current() {
|
|
704
|
+
return $.get(ids);
|
|
705
|
+
},
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
const usePersisterStatus = (persisterOrPersisterId) =>
|
|
710
|
+
useListenable(usePersisterOrPersisterById(persisterOrPersisterId), STATUS, 0);
|
|
711
|
+
const useSynchronizer = (id) => useThing(id, OFFSET_SYNCHRONIZER);
|
|
712
|
+
|
|
713
|
+
const useSynchronizerIds = () => {
|
|
714
|
+
const contextValue = getContextValue();
|
|
715
|
+
let ids = $.state($.proxy(getThingIds(contextValue, OFFSET_SYNCHRONIZER)));
|
|
716
|
+
|
|
717
|
+
if (typeof window !== 'undefined') {
|
|
718
|
+
$.user_effect(() => {
|
|
719
|
+
$.set(ids, getThingIds(contextValue, OFFSET_SYNCHRONIZER), true);
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
return {
|
|
724
|
+
get current() {
|
|
725
|
+
return $.get(ids);
|
|
726
|
+
},
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
const useSynchronizerStatus = (synchronizerOrSynchronizerId) =>
|
|
731
|
+
useListenable(
|
|
732
|
+
useSynchronizerOrSynchronizerById(synchronizerOrSynchronizerId),
|
|
733
|
+
STATUS,
|
|
734
|
+
0,
|
|
735
|
+
);
|
|
736
|
+
const useHasTablesListener = (listener, mutator, storeOrStoreId) =>
|
|
737
|
+
useListener(
|
|
738
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
739
|
+
HAS + TABLES,
|
|
740
|
+
listener,
|
|
741
|
+
() => EMPTY_ARR,
|
|
742
|
+
mutator,
|
|
743
|
+
);
|
|
744
|
+
const useTablesListener = (listener, mutator, storeOrStoreId) =>
|
|
745
|
+
useListener(
|
|
746
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
747
|
+
TABLES,
|
|
748
|
+
listener,
|
|
749
|
+
() => EMPTY_ARR,
|
|
750
|
+
mutator,
|
|
751
|
+
);
|
|
752
|
+
const useTableIdsListener = (listener, mutator, storeOrStoreId) =>
|
|
753
|
+
useListener(
|
|
754
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
755
|
+
TABLE_IDS,
|
|
756
|
+
listener,
|
|
757
|
+
() => EMPTY_ARR,
|
|
758
|
+
mutator,
|
|
759
|
+
);
|
|
760
|
+
const useHasTableListener = (tableId, listener, mutator, storeOrStoreId) =>
|
|
761
|
+
useListener(
|
|
762
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
763
|
+
HAS + TABLE,
|
|
764
|
+
listener,
|
|
765
|
+
() => [maybeGet(tableId)],
|
|
766
|
+
mutator,
|
|
767
|
+
);
|
|
768
|
+
const useTableListener = (tableId, listener, mutator, storeOrStoreId) =>
|
|
769
|
+
useListener(
|
|
770
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
771
|
+
TABLE,
|
|
772
|
+
listener,
|
|
773
|
+
() => [maybeGet(tableId)],
|
|
774
|
+
mutator,
|
|
775
|
+
);
|
|
776
|
+
const useTableCellIdsListener = (tableId, listener, mutator, storeOrStoreId) =>
|
|
777
|
+
useListener(
|
|
778
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
779
|
+
TABLE + CELL_IDS,
|
|
780
|
+
listener,
|
|
781
|
+
() => [maybeGet(tableId)],
|
|
782
|
+
mutator,
|
|
783
|
+
);
|
|
784
|
+
const useHasTableCellListener = (
|
|
785
|
+
tableId,
|
|
786
|
+
cellId,
|
|
787
|
+
listener,
|
|
788
|
+
mutator,
|
|
789
|
+
storeOrStoreId,
|
|
790
|
+
) =>
|
|
791
|
+
useListener(
|
|
792
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
793
|
+
HAS + TABLE + CELL,
|
|
794
|
+
listener,
|
|
795
|
+
() => [maybeGet(tableId), maybeGet(cellId)],
|
|
796
|
+
mutator,
|
|
797
|
+
);
|
|
798
|
+
const useRowCountListener = (tableId, listener, mutator, storeOrStoreId) =>
|
|
799
|
+
useListener(
|
|
800
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
801
|
+
ROW_COUNT,
|
|
802
|
+
listener,
|
|
803
|
+
() => [maybeGet(tableId)],
|
|
804
|
+
mutator,
|
|
805
|
+
);
|
|
806
|
+
const useRowIdsListener = (tableId, listener, mutator, storeOrStoreId) =>
|
|
807
|
+
useListener(
|
|
808
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
809
|
+
ROW_IDS,
|
|
810
|
+
listener,
|
|
811
|
+
() => [maybeGet(tableId)],
|
|
812
|
+
mutator,
|
|
813
|
+
);
|
|
814
|
+
|
|
815
|
+
const useSortedRowIdsListener = (
|
|
816
|
+
tableId,
|
|
817
|
+
cellId,
|
|
818
|
+
descending,
|
|
819
|
+
offset,
|
|
820
|
+
limit,
|
|
821
|
+
listener,
|
|
822
|
+
mutator,
|
|
823
|
+
storeOrStoreId,
|
|
824
|
+
) =>
|
|
825
|
+
useListener(
|
|
826
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
827
|
+
SORTED_ROW_IDS,
|
|
828
|
+
listener,
|
|
829
|
+
() => [
|
|
830
|
+
maybeGet(tableId),
|
|
831
|
+
maybeGet(cellId),
|
|
832
|
+
maybeGet(descending),
|
|
833
|
+
maybeGet(offset),
|
|
834
|
+
maybeGet(limit),
|
|
835
|
+
],
|
|
836
|
+
mutator,
|
|
837
|
+
);
|
|
838
|
+
|
|
839
|
+
const useHasRowListener = (tableId, rowId, listener, mutator, storeOrStoreId) =>
|
|
840
|
+
useListener(
|
|
841
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
842
|
+
HAS + ROW,
|
|
843
|
+
listener,
|
|
844
|
+
() => [maybeGet(tableId), maybeGet(rowId)],
|
|
845
|
+
mutator,
|
|
846
|
+
);
|
|
847
|
+
const useRowListener = (tableId, rowId, listener, mutator, storeOrStoreId) =>
|
|
848
|
+
useListener(
|
|
849
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
850
|
+
ROW,
|
|
851
|
+
listener,
|
|
852
|
+
() => [maybeGet(tableId), maybeGet(rowId)],
|
|
853
|
+
mutator,
|
|
854
|
+
);
|
|
855
|
+
const useCellIdsListener = (
|
|
856
|
+
tableId,
|
|
857
|
+
rowId,
|
|
858
|
+
listener,
|
|
859
|
+
mutator,
|
|
860
|
+
storeOrStoreId,
|
|
861
|
+
) =>
|
|
862
|
+
useListener(
|
|
863
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
864
|
+
CELL_IDS,
|
|
865
|
+
listener,
|
|
866
|
+
() => [maybeGet(tableId), maybeGet(rowId)],
|
|
867
|
+
mutator,
|
|
868
|
+
);
|
|
869
|
+
const useHasCellListener = (
|
|
870
|
+
tableId,
|
|
871
|
+
rowId,
|
|
872
|
+
cellId,
|
|
873
|
+
listener,
|
|
874
|
+
mutator,
|
|
875
|
+
storeOrStoreId,
|
|
876
|
+
) =>
|
|
877
|
+
useListener(
|
|
878
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
879
|
+
HAS + CELL,
|
|
880
|
+
listener,
|
|
881
|
+
() => [maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)],
|
|
882
|
+
mutator,
|
|
883
|
+
);
|
|
884
|
+
const useCellListener = (
|
|
885
|
+
tableId,
|
|
886
|
+
rowId,
|
|
887
|
+
cellId,
|
|
888
|
+
listener,
|
|
889
|
+
mutator,
|
|
890
|
+
storeOrStoreId,
|
|
891
|
+
) =>
|
|
892
|
+
useListener(
|
|
893
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
894
|
+
CELL,
|
|
895
|
+
listener,
|
|
896
|
+
() => [maybeGet(tableId), maybeGet(rowId), maybeGet(cellId)],
|
|
897
|
+
mutator,
|
|
898
|
+
);
|
|
899
|
+
const useHasValuesListener = (listener, mutator, storeOrStoreId) =>
|
|
900
|
+
useListener(
|
|
901
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
902
|
+
HAS + VALUES,
|
|
903
|
+
listener,
|
|
904
|
+
() => EMPTY_ARR,
|
|
905
|
+
mutator,
|
|
906
|
+
);
|
|
907
|
+
const useValuesListener = (listener, mutator, storeOrStoreId) =>
|
|
908
|
+
useListener(
|
|
909
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
910
|
+
VALUES,
|
|
911
|
+
listener,
|
|
912
|
+
() => EMPTY_ARR,
|
|
913
|
+
mutator,
|
|
914
|
+
);
|
|
915
|
+
const useValueIdsListener = (listener, mutator, storeOrStoreId) =>
|
|
916
|
+
useListener(
|
|
917
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
918
|
+
VALUE_IDS,
|
|
919
|
+
listener,
|
|
920
|
+
() => EMPTY_ARR,
|
|
921
|
+
mutator,
|
|
922
|
+
);
|
|
923
|
+
const useHasValueListener = (valueId, listener, mutator, storeOrStoreId) =>
|
|
924
|
+
useListener(
|
|
925
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
926
|
+
HAS + VALUE,
|
|
927
|
+
listener,
|
|
928
|
+
() => [maybeGet(valueId)],
|
|
929
|
+
mutator,
|
|
930
|
+
);
|
|
931
|
+
const useValueListener = (valueId, listener, mutator, storeOrStoreId) =>
|
|
932
|
+
useListener(
|
|
933
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
934
|
+
VALUE,
|
|
935
|
+
listener,
|
|
936
|
+
() => [maybeGet(valueId)],
|
|
937
|
+
mutator,
|
|
938
|
+
);
|
|
939
|
+
const useStartTransactionListener = (listener, storeOrStoreId) =>
|
|
940
|
+
useListener(
|
|
941
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
942
|
+
'Start' + TRANSACTION,
|
|
943
|
+
listener,
|
|
944
|
+
);
|
|
945
|
+
const useWillFinishTransactionListener = (listener, storeOrStoreId) =>
|
|
946
|
+
useListener(
|
|
947
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
948
|
+
'Will' + FINISH + TRANSACTION,
|
|
949
|
+
listener,
|
|
950
|
+
);
|
|
951
|
+
const useDidFinishTransactionListener = (listener, storeOrStoreId) =>
|
|
952
|
+
useListener(
|
|
953
|
+
useStoreOrStoreById(storeOrStoreId),
|
|
954
|
+
'Did' + FINISH + TRANSACTION,
|
|
955
|
+
listener,
|
|
956
|
+
);
|
|
957
|
+
const useMetricListener = (metricId, listener, metricsOrMetricsId) =>
|
|
958
|
+
useListener(
|
|
959
|
+
useMetricsOrMetricsById(metricsOrMetricsId),
|
|
960
|
+
METRIC,
|
|
961
|
+
listener,
|
|
962
|
+
() => [maybeGet(metricId)],
|
|
963
|
+
);
|
|
964
|
+
const useSliceIdsListener = (indexId, listener, indexesOrIndexesId) =>
|
|
965
|
+
useListener(
|
|
966
|
+
useIndexesOrIndexesById(indexesOrIndexesId),
|
|
967
|
+
SLICE + IDS,
|
|
968
|
+
listener,
|
|
969
|
+
() => [maybeGet(indexId)],
|
|
970
|
+
);
|
|
971
|
+
const useSliceRowIdsListener = (
|
|
972
|
+
indexId,
|
|
973
|
+
sliceId,
|
|
974
|
+
listener,
|
|
975
|
+
indexesOrIndexesId,
|
|
976
|
+
) =>
|
|
977
|
+
useListener(
|
|
978
|
+
useIndexesOrIndexesById(indexesOrIndexesId),
|
|
979
|
+
SLICE + ROW_IDS,
|
|
980
|
+
listener,
|
|
981
|
+
() => [maybeGet(indexId), maybeGet(sliceId)],
|
|
982
|
+
);
|
|
983
|
+
|
|
984
|
+
const useRemoteRowIdListener = (
|
|
985
|
+
relationshipId,
|
|
986
|
+
localRowId,
|
|
987
|
+
listener,
|
|
988
|
+
relationshipsOrRelationshipsId,
|
|
989
|
+
) =>
|
|
990
|
+
useListener(
|
|
991
|
+
useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
|
|
992
|
+
REMOTE_ROW_ID,
|
|
993
|
+
listener,
|
|
994
|
+
() => [maybeGet(relationshipId), maybeGet(localRowId)],
|
|
995
|
+
);
|
|
996
|
+
|
|
997
|
+
const useLocalRowIdsListener = (
|
|
998
|
+
relationshipId,
|
|
999
|
+
remoteRowId,
|
|
1000
|
+
listener,
|
|
1001
|
+
relationshipsOrRelationshipsId,
|
|
1002
|
+
) =>
|
|
1003
|
+
useListener(
|
|
1004
|
+
useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
|
|
1005
|
+
LOCAL + ROW_IDS,
|
|
1006
|
+
listener,
|
|
1007
|
+
() => [maybeGet(relationshipId), maybeGet(remoteRowId)],
|
|
1008
|
+
);
|
|
1009
|
+
|
|
1010
|
+
const useLinkedRowIdsListener = (
|
|
1011
|
+
relationshipId,
|
|
1012
|
+
firstRowId,
|
|
1013
|
+
listener,
|
|
1014
|
+
relationshipsOrRelationshipsId,
|
|
1015
|
+
) =>
|
|
1016
|
+
useListener(
|
|
1017
|
+
useRelationshipsOrRelationshipsById(relationshipsOrRelationshipsId),
|
|
1018
|
+
LINKED + ROW_IDS,
|
|
1019
|
+
listener,
|
|
1020
|
+
() => [maybeGet(relationshipId), maybeGet(firstRowId)],
|
|
1021
|
+
);
|
|
1022
|
+
|
|
1023
|
+
const useResultTableListener = (queryId, listener, queriesOrQueriesId) =>
|
|
1024
|
+
useListener(
|
|
1025
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1026
|
+
RESULT + TABLE,
|
|
1027
|
+
listener,
|
|
1028
|
+
() => [maybeGet(queryId)],
|
|
1029
|
+
);
|
|
1030
|
+
const useResultTableCellIdsListener = (queryId, listener, queriesOrQueriesId) =>
|
|
1031
|
+
useListener(
|
|
1032
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1033
|
+
RESULT + TABLE + CELL_IDS,
|
|
1034
|
+
listener,
|
|
1035
|
+
() => [maybeGet(queryId)],
|
|
1036
|
+
);
|
|
1037
|
+
const useResultRowCountListener = (queryId, listener, queriesOrQueriesId) =>
|
|
1038
|
+
useListener(
|
|
1039
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1040
|
+
RESULT + ROW_COUNT,
|
|
1041
|
+
listener,
|
|
1042
|
+
() => [maybeGet(queryId)],
|
|
1043
|
+
);
|
|
1044
|
+
const useResultRowIdsListener = (queryId, listener, queriesOrQueriesId) =>
|
|
1045
|
+
useListener(
|
|
1046
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1047
|
+
RESULT + ROW_IDS,
|
|
1048
|
+
listener,
|
|
1049
|
+
() => [maybeGet(queryId)],
|
|
1050
|
+
);
|
|
1051
|
+
|
|
1052
|
+
const useResultSortedRowIdsListener = (
|
|
1053
|
+
queryId,
|
|
1054
|
+
cellId,
|
|
1055
|
+
descending,
|
|
1056
|
+
offset,
|
|
1057
|
+
limit,
|
|
1058
|
+
listener,
|
|
1059
|
+
queriesOrQueriesId,
|
|
1060
|
+
) =>
|
|
1061
|
+
useListener(
|
|
1062
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1063
|
+
RESULT + SORTED_ROW_IDS,
|
|
1064
|
+
listener,
|
|
1065
|
+
() => [
|
|
1066
|
+
maybeGet(queryId),
|
|
1067
|
+
maybeGet(cellId),
|
|
1068
|
+
maybeGet(descending),
|
|
1069
|
+
maybeGet(offset),
|
|
1070
|
+
maybeGet(limit),
|
|
1071
|
+
],
|
|
1072
|
+
);
|
|
1073
|
+
|
|
1074
|
+
const useResultRowListener = (queryId, rowId, listener, queriesOrQueriesId) =>
|
|
1075
|
+
useListener(
|
|
1076
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1077
|
+
RESULT + ROW,
|
|
1078
|
+
listener,
|
|
1079
|
+
() => [maybeGet(queryId), maybeGet(rowId)],
|
|
1080
|
+
);
|
|
1081
|
+
const useResultCellIdsListener = (
|
|
1082
|
+
queryId,
|
|
1083
|
+
rowId,
|
|
1084
|
+
listener,
|
|
1085
|
+
queriesOrQueriesId,
|
|
1086
|
+
) =>
|
|
1087
|
+
useListener(
|
|
1088
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1089
|
+
RESULT + CELL_IDS,
|
|
1090
|
+
listener,
|
|
1091
|
+
() => [maybeGet(queryId), maybeGet(rowId)],
|
|
1092
|
+
);
|
|
1093
|
+
const useResultCellListener = (
|
|
1094
|
+
queryId,
|
|
1095
|
+
rowId,
|
|
1096
|
+
cellId,
|
|
1097
|
+
listener,
|
|
1098
|
+
queriesOrQueriesId,
|
|
1099
|
+
) =>
|
|
1100
|
+
useListener(
|
|
1101
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1102
|
+
RESULT + CELL,
|
|
1103
|
+
listener,
|
|
1104
|
+
() => [maybeGet(queryId), maybeGet(rowId), maybeGet(cellId)],
|
|
1105
|
+
);
|
|
1106
|
+
const useParamValuesListener = (queryId, listener, queriesOrQueriesId) =>
|
|
1107
|
+
useListener(
|
|
1108
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1109
|
+
'ParamValues',
|
|
1110
|
+
listener,
|
|
1111
|
+
() => [maybeGet(queryId)],
|
|
1112
|
+
);
|
|
1113
|
+
const useParamValueListener = (
|
|
1114
|
+
queryId,
|
|
1115
|
+
paramId,
|
|
1116
|
+
listener,
|
|
1117
|
+
queriesOrQueriesId,
|
|
1118
|
+
) =>
|
|
1119
|
+
useListener(
|
|
1120
|
+
useQueriesOrQueriesById(queriesOrQueriesId),
|
|
1121
|
+
'ParamValue',
|
|
1122
|
+
listener,
|
|
1123
|
+
() => [maybeGet(queryId), maybeGet(paramId)],
|
|
1124
|
+
);
|
|
1125
|
+
const useCheckpointIdsListener = (listener, checkpointsOrCheckpointsId) =>
|
|
1126
|
+
useListener(
|
|
1127
|
+
useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
|
|
1128
|
+
CHECKPOINT + IDS,
|
|
1129
|
+
listener,
|
|
1130
|
+
);
|
|
1131
|
+
const useCheckpointListener = (
|
|
1132
|
+
checkpointId,
|
|
1133
|
+
listener,
|
|
1134
|
+
checkpointsOrCheckpointsId,
|
|
1135
|
+
) =>
|
|
1136
|
+
useListener(
|
|
1137
|
+
useCheckpointsOrCheckpointsById(checkpointsOrCheckpointsId),
|
|
1138
|
+
CHECKPOINT,
|
|
1139
|
+
listener,
|
|
1140
|
+
() => [maybeGet(checkpointId)],
|
|
1141
|
+
);
|
|
1142
|
+
const usePersisterStatusListener = (listener, persisterOrPersisterId) =>
|
|
1143
|
+
useListener(
|
|
1144
|
+
usePersisterOrPersisterById(persisterOrPersisterId),
|
|
1145
|
+
STATUS,
|
|
1146
|
+
listener,
|
|
1147
|
+
);
|
|
1148
|
+
const useSynchronizerStatusListener = (
|
|
1149
|
+
listener,
|
|
1150
|
+
synchronizerOrSynchronizerId,
|
|
1151
|
+
) =>
|
|
1152
|
+
useListener(
|
|
1153
|
+
useSynchronizerOrSynchronizerById(synchronizerOrSynchronizerId),
|
|
1154
|
+
STATUS,
|
|
1155
|
+
listener,
|
|
1156
|
+
);
|
|
1157
|
+
|
|
1158
|
+
const provideThing = (thingId, thing, offset) => {
|
|
1159
|
+
const contextValue = getContextValue();
|
|
1160
|
+
|
|
1161
|
+
if (typeof window !== 'undefined') {
|
|
1162
|
+
$.user_effect(() => {
|
|
1163
|
+
contextValue[16]?.(offset, thingId, thing);
|
|
1164
|
+
|
|
1165
|
+
return () => contextValue[17]?.(offset, thingId);
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
const provideStore = (storeId, store) =>
|
|
1171
|
+
provideThing(storeId, store, OFFSET_STORE);
|
|
1172
|
+
const provideMetrics = (metricsId, metrics) =>
|
|
1173
|
+
provideThing(metricsId, metrics, OFFSET_METRICS);
|
|
1174
|
+
const provideIndexes = (indexesId, indexes) =>
|
|
1175
|
+
provideThing(indexesId, indexes, OFFSET_INDEXES);
|
|
1176
|
+
const provideRelationships = (relationshipsId, relationships) =>
|
|
1177
|
+
provideThing(relationshipsId, relationships, OFFSET_RELATIONSHIPS);
|
|
1178
|
+
const provideQueries = (queriesId, queries) =>
|
|
1179
|
+
provideThing(queriesId, queries, OFFSET_QUERIES);
|
|
1180
|
+
const provideCheckpoints = (checkpointsId, checkpoints) =>
|
|
1181
|
+
provideThing(checkpointsId, checkpoints, OFFSET_CHECKPOINTS);
|
|
1182
|
+
const providePersister = (persisterId, persister) =>
|
|
1183
|
+
provideThing(persisterId, persister, OFFSET_PERSISTER);
|
|
1184
|
+
const provideSynchronizer = (synchronizerId, synchronizer) =>
|
|
1185
|
+
provideThing(synchronizerId, synchronizer, OFFSET_SYNCHRONIZER);
|
|
1186
|
+
|
|
1187
|
+
function CheckpointView($$anchor, $$props) {
|
|
1188
|
+
$.push($$props, true);
|
|
1189
|
+
|
|
1190
|
+
const checkpoint = useCheckpoint(
|
|
1191
|
+
() => $$props.checkpointId,
|
|
1192
|
+
() => $$props.checkpoints,
|
|
1193
|
+
);
|
|
1194
|
+
const display = $.derived(() => '' + (checkpoint.current ?? ''));
|
|
1195
|
+
|
|
1196
|
+
const output = $.derived(() =>
|
|
1197
|
+
$$props.debugIds
|
|
1198
|
+
? `${$$props.checkpointId}:{${$.get(display)}}`
|
|
1199
|
+
: $.get(display),
|
|
1200
|
+
);
|
|
1201
|
+
|
|
1202
|
+
$.next();
|
|
1203
|
+
|
|
1204
|
+
var text = $.text();
|
|
1205
|
+
|
|
1206
|
+
$.template_effect(() => $.set_text(text, $.get(output)));
|
|
1207
|
+
$.append($$anchor, text);
|
|
1208
|
+
$.pop();
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
var root_2 = $.from_html(`<!><!>`, 1);
|
|
1212
|
+
var root$1 = $.from_html(`<!><!><!>`, 1);
|
|
1213
|
+
|
|
1214
|
+
function Wrap($$anchor, $$props) {
|
|
1215
|
+
$.push($$props, true);
|
|
1216
|
+
|
|
1217
|
+
var fragment = root$1();
|
|
1218
|
+
var node = $.first_child(fragment);
|
|
1219
|
+
|
|
1220
|
+
{
|
|
1221
|
+
var consequent = ($$anchor) => {
|
|
1222
|
+
var text = $.text();
|
|
1223
|
+
|
|
1224
|
+
$.template_effect(() => $.set_text(text, `${$$props.id ?? ''}:{`));
|
|
1225
|
+
$.append($$anchor, text);
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
var d = $.derived(() => $$props.debugIds && !isUndefined($$props.id));
|
|
1229
|
+
|
|
1230
|
+
$.if(node, ($$render) => {
|
|
1231
|
+
if ($.get(d)) $$render(consequent);
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
var node_1 = $.sibling(node);
|
|
1236
|
+
|
|
1237
|
+
$.each(
|
|
1238
|
+
node_1,
|
|
1239
|
+
18,
|
|
1240
|
+
() => $$props.ids,
|
|
1241
|
+
(itemId) => itemId,
|
|
1242
|
+
($$anchor, itemId, i) => {
|
|
1243
|
+
var fragment_2 = root_2();
|
|
1244
|
+
var node_2 = $.first_child(fragment_2);
|
|
1245
|
+
|
|
1246
|
+
{
|
|
1247
|
+
var consequent_1 = ($$anchor) => {
|
|
1248
|
+
var fragment_3 = $.comment();
|
|
1249
|
+
var node_3 = $.first_child(fragment_3);
|
|
1250
|
+
|
|
1251
|
+
$.snippet(node_3, () => $$props.separator);
|
|
1252
|
+
$.append($$anchor, fragment_3);
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
$.if(node_2, ($$render) => {
|
|
1256
|
+
if ($.get(i) > 0 && $$props.separator) $$render(consequent_1);
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
var node_4 = $.sibling(node_2);
|
|
1261
|
+
|
|
1262
|
+
{
|
|
1263
|
+
var consequent_2 = ($$anchor) => {
|
|
1264
|
+
var fragment_4 = $.comment();
|
|
1265
|
+
var node_5 = $.first_child(fragment_4);
|
|
1266
|
+
|
|
1267
|
+
$.snippet(
|
|
1268
|
+
node_5,
|
|
1269
|
+
() => $$props.custom,
|
|
1270
|
+
() => itemId,
|
|
1271
|
+
);
|
|
1272
|
+
$.append($$anchor, fragment_4);
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
var alternate = ($$anchor) => {
|
|
1276
|
+
var fragment_5 = $.comment();
|
|
1277
|
+
var node_6 = $.first_child(fragment_5);
|
|
1278
|
+
|
|
1279
|
+
$.snippet(
|
|
1280
|
+
node_6,
|
|
1281
|
+
() => $$props.children,
|
|
1282
|
+
() => itemId,
|
|
1283
|
+
);
|
|
1284
|
+
$.append($$anchor, fragment_5);
|
|
1285
|
+
};
|
|
1286
|
+
|
|
1287
|
+
$.if(node_4, ($$render) => {
|
|
1288
|
+
if ($$props.custom) $$render(consequent_2);
|
|
1289
|
+
else $$render(alternate, -1);
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
$.append($$anchor, fragment_2);
|
|
1294
|
+
},
|
|
1295
|
+
);
|
|
1296
|
+
|
|
1297
|
+
var node_7 = $.sibling(node_1);
|
|
1298
|
+
|
|
1299
|
+
{
|
|
1300
|
+
var consequent_3 = ($$anchor) => {
|
|
1301
|
+
var text_1 = $.text();
|
|
1302
|
+
|
|
1303
|
+
text_1.nodeValue = '}';
|
|
1304
|
+
$.append($$anchor, text_1);
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
var d_1 = $.derived(() => $$props.debugIds && !isUndefined($$props.id));
|
|
1308
|
+
|
|
1309
|
+
$.if(node_7, ($$render) => {
|
|
1310
|
+
if ($.get(d_1)) $$render(consequent_3);
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
$.append($$anchor, fragment);
|
|
1315
|
+
$.pop();
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
function BackwardCheckpointsView($$anchor, $$props) {
|
|
1319
|
+
$.push($$props, true);
|
|
1320
|
+
|
|
1321
|
+
const checkpointIds = useCheckpointIds(() => $$props.checkpoints);
|
|
1322
|
+
const ids = $.derived(() => checkpointIds.current[0]);
|
|
1323
|
+
|
|
1324
|
+
{
|
|
1325
|
+
const children = ($$anchor, checkpointId = $.noop) => {
|
|
1326
|
+
CheckpointView($$anchor, {
|
|
1327
|
+
get checkpointId() {
|
|
1328
|
+
return checkpointId();
|
|
1329
|
+
},
|
|
1330
|
+
|
|
1331
|
+
get checkpoints() {
|
|
1332
|
+
return $$props.checkpoints;
|
|
1333
|
+
},
|
|
1334
|
+
|
|
1335
|
+
get debugIds() {
|
|
1336
|
+
return $$props.debugIds;
|
|
1337
|
+
},
|
|
1338
|
+
});
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
Wrap($$anchor, {
|
|
1342
|
+
get ids() {
|
|
1343
|
+
return $.get(ids);
|
|
1344
|
+
},
|
|
1345
|
+
|
|
1346
|
+
get separator() {
|
|
1347
|
+
return $$props.separator;
|
|
1348
|
+
},
|
|
1349
|
+
|
|
1350
|
+
get debugIds() {
|
|
1351
|
+
return $$props.debugIds;
|
|
1352
|
+
},
|
|
1353
|
+
|
|
1354
|
+
get custom() {
|
|
1355
|
+
return $$props.checkpoint;
|
|
1356
|
+
},
|
|
1357
|
+
children,
|
|
1358
|
+
$$slots: {default: true},
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
$.pop();
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
function CellView($$anchor, $$props) {
|
|
1366
|
+
$.push($$props, true);
|
|
1367
|
+
|
|
1368
|
+
const cell = useCell(
|
|
1369
|
+
() => $$props.tableId,
|
|
1370
|
+
() => $$props.rowId,
|
|
1371
|
+
() => $$props.cellId,
|
|
1372
|
+
() => $$props.store,
|
|
1373
|
+
);
|
|
1374
|
+
const display = $.derived(() => '' + (cell.current ?? ''));
|
|
1375
|
+
|
|
1376
|
+
const output = $.derived(() =>
|
|
1377
|
+
$$props.debugIds ? `${$$props.cellId}:{${$.get(display)}}` : $.get(display),
|
|
1378
|
+
);
|
|
1379
|
+
|
|
1380
|
+
$.next();
|
|
1381
|
+
|
|
1382
|
+
var text = $.text();
|
|
1383
|
+
|
|
1384
|
+
$.template_effect(() => $.set_text(text, $.get(output)));
|
|
1385
|
+
$.append($$anchor, text);
|
|
1386
|
+
$.pop();
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
function CurrentCheckpointView($$anchor, $$props) {
|
|
1390
|
+
$.push($$props, true);
|
|
1391
|
+
|
|
1392
|
+
const checkpointIds = useCheckpointIds(() => $$props.checkpoints);
|
|
1393
|
+
const currentId = $.derived(() => checkpointIds.current[1]);
|
|
1394
|
+
var fragment = $.comment();
|
|
1395
|
+
var node = $.first_child(fragment);
|
|
1396
|
+
|
|
1397
|
+
{
|
|
1398
|
+
var consequent_1 = ($$anchor) => {
|
|
1399
|
+
var fragment_1 = $.comment();
|
|
1400
|
+
var node_1 = $.first_child(fragment_1);
|
|
1401
|
+
|
|
1402
|
+
{
|
|
1403
|
+
var consequent = ($$anchor) => {
|
|
1404
|
+
var fragment_2 = $.comment();
|
|
1405
|
+
var node_2 = $.first_child(fragment_2);
|
|
1406
|
+
|
|
1407
|
+
$.snippet(
|
|
1408
|
+
node_2,
|
|
1409
|
+
() => $$props.checkpoint,
|
|
1410
|
+
() => $.get(currentId),
|
|
1411
|
+
);
|
|
1412
|
+
$.append($$anchor, fragment_2);
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
var alternate = ($$anchor) => {
|
|
1416
|
+
CheckpointView($$anchor, {
|
|
1417
|
+
get checkpointId() {
|
|
1418
|
+
return $.get(currentId);
|
|
1419
|
+
},
|
|
1420
|
+
|
|
1421
|
+
get checkpoints() {
|
|
1422
|
+
return $$props.checkpoints;
|
|
1423
|
+
},
|
|
1424
|
+
|
|
1425
|
+
get debugIds() {
|
|
1426
|
+
return $$props.debugIds;
|
|
1427
|
+
},
|
|
1428
|
+
});
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1431
|
+
$.if(node_1, ($$render) => {
|
|
1432
|
+
if ($$props.checkpoint) $$render(consequent);
|
|
1433
|
+
else $$render(alternate, -1);
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
$.append($$anchor, fragment_1);
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
var d = $.derived(() => !isUndefined($.get(currentId)));
|
|
1441
|
+
|
|
1442
|
+
$.if(node, ($$render) => {
|
|
1443
|
+
if ($.get(d)) $$render(consequent_1);
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
$.append($$anchor, fragment);
|
|
1448
|
+
$.pop();
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
function ForwardCheckpointsView($$anchor, $$props) {
|
|
1452
|
+
$.push($$props, true);
|
|
1453
|
+
|
|
1454
|
+
const checkpointIds = useCheckpointIds(() => $$props.checkpoints);
|
|
1455
|
+
const ids = $.derived(() => checkpointIds.current[2]);
|
|
1456
|
+
|
|
1457
|
+
{
|
|
1458
|
+
const children = ($$anchor, checkpointId = $.noop) => {
|
|
1459
|
+
CheckpointView($$anchor, {
|
|
1460
|
+
get checkpointId() {
|
|
1461
|
+
return checkpointId();
|
|
1462
|
+
},
|
|
1463
|
+
|
|
1464
|
+
get checkpoints() {
|
|
1465
|
+
return $$props.checkpoints;
|
|
1466
|
+
},
|
|
1467
|
+
|
|
1468
|
+
get debugIds() {
|
|
1469
|
+
return $$props.debugIds;
|
|
1470
|
+
},
|
|
1471
|
+
});
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
Wrap($$anchor, {
|
|
1475
|
+
get ids() {
|
|
1476
|
+
return $.get(ids);
|
|
1477
|
+
},
|
|
1478
|
+
|
|
1479
|
+
get separator() {
|
|
1480
|
+
return $$props.separator;
|
|
1481
|
+
},
|
|
1482
|
+
|
|
1483
|
+
get debugIds() {
|
|
1484
|
+
return $$props.debugIds;
|
|
1485
|
+
},
|
|
1486
|
+
|
|
1487
|
+
get custom() {
|
|
1488
|
+
return $$props.checkpoint;
|
|
1489
|
+
},
|
|
1490
|
+
children,
|
|
1491
|
+
$$slots: {default: true},
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
$.pop();
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
function RowView($$anchor, $$props) {
|
|
1499
|
+
$.push($$props, true);
|
|
1500
|
+
|
|
1501
|
+
const defaultCellIds = useCellIds(
|
|
1502
|
+
() => $$props.tableId,
|
|
1503
|
+
() => $$props.rowId,
|
|
1504
|
+
() => $$props.store,
|
|
1505
|
+
);
|
|
1506
|
+
const activeCellIds = $.derived(
|
|
1507
|
+
() => $$props.customCellIds ?? defaultCellIds.current,
|
|
1508
|
+
);
|
|
1509
|
+
|
|
1510
|
+
{
|
|
1511
|
+
const children = ($$anchor, cellId = $.noop) => {
|
|
1512
|
+
CellView($$anchor, {
|
|
1513
|
+
get tableId() {
|
|
1514
|
+
return $$props.tableId;
|
|
1515
|
+
},
|
|
1516
|
+
|
|
1517
|
+
get rowId() {
|
|
1518
|
+
return $$props.rowId;
|
|
1519
|
+
},
|
|
1520
|
+
|
|
1521
|
+
get cellId() {
|
|
1522
|
+
return cellId();
|
|
1523
|
+
},
|
|
1524
|
+
|
|
1525
|
+
get store() {
|
|
1526
|
+
return $$props.store;
|
|
1527
|
+
},
|
|
1528
|
+
|
|
1529
|
+
get debugIds() {
|
|
1530
|
+
return $$props.debugIds;
|
|
1531
|
+
},
|
|
1532
|
+
});
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
Wrap($$anchor, {
|
|
1536
|
+
get ids() {
|
|
1537
|
+
return $.get(activeCellIds);
|
|
1538
|
+
},
|
|
1539
|
+
|
|
1540
|
+
get separator() {
|
|
1541
|
+
return $$props.separator;
|
|
1542
|
+
},
|
|
1543
|
+
|
|
1544
|
+
get debugIds() {
|
|
1545
|
+
return $$props.debugIds;
|
|
1546
|
+
},
|
|
1547
|
+
|
|
1548
|
+
get id() {
|
|
1549
|
+
return $$props.rowId;
|
|
1550
|
+
},
|
|
1551
|
+
|
|
1552
|
+
get custom() {
|
|
1553
|
+
return $$props.cell;
|
|
1554
|
+
},
|
|
1555
|
+
children,
|
|
1556
|
+
$$slots: {default: true},
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
$.pop();
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
function SliceView($$anchor, $$props) {
|
|
1564
|
+
$.push($$props, true);
|
|
1565
|
+
|
|
1566
|
+
const {store, tableId} = useIndexStoreTableId(
|
|
1567
|
+
() => $$props.indexes,
|
|
1568
|
+
() => $$props.indexId,
|
|
1569
|
+
);
|
|
1570
|
+
const rowIds = useSliceRowIds(
|
|
1571
|
+
() => $$props.indexId,
|
|
1572
|
+
() => $$props.sliceId,
|
|
1573
|
+
() => $$props.indexes,
|
|
1574
|
+
);
|
|
1575
|
+
|
|
1576
|
+
{
|
|
1577
|
+
const children = ($$anchor, rowId = $.noop) => {
|
|
1578
|
+
var fragment_1 = $.comment();
|
|
1579
|
+
var node = $.first_child(fragment_1);
|
|
1580
|
+
|
|
1581
|
+
{
|
|
1582
|
+
var consequent = ($$anchor) => {
|
|
1583
|
+
RowView($$anchor, {
|
|
1584
|
+
get tableId() {
|
|
1585
|
+
return tableId;
|
|
1586
|
+
},
|
|
1587
|
+
|
|
1588
|
+
get rowId() {
|
|
1589
|
+
return rowId();
|
|
1590
|
+
},
|
|
1591
|
+
|
|
1592
|
+
get store() {
|
|
1593
|
+
return store;
|
|
1594
|
+
},
|
|
1595
|
+
|
|
1596
|
+
get debugIds() {
|
|
1597
|
+
return $$props.debugIds;
|
|
1598
|
+
},
|
|
1599
|
+
});
|
|
1600
|
+
};
|
|
1601
|
+
|
|
1602
|
+
$.if(node, ($$render) => {
|
|
1603
|
+
if (tableId) $$render(consequent);
|
|
1604
|
+
});
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
$.append($$anchor, fragment_1);
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1610
|
+
Wrap($$anchor, {
|
|
1611
|
+
get ids() {
|
|
1612
|
+
return rowIds.current;
|
|
1613
|
+
},
|
|
1614
|
+
|
|
1615
|
+
get separator() {
|
|
1616
|
+
return $$props.separator;
|
|
1617
|
+
},
|
|
1618
|
+
|
|
1619
|
+
get debugIds() {
|
|
1620
|
+
return $$props.debugIds;
|
|
1621
|
+
},
|
|
1622
|
+
|
|
1623
|
+
get id() {
|
|
1624
|
+
return $$props.sliceId;
|
|
1625
|
+
},
|
|
1626
|
+
|
|
1627
|
+
get custom() {
|
|
1628
|
+
return $$props.row;
|
|
1629
|
+
},
|
|
1630
|
+
children,
|
|
1631
|
+
$$slots: {default: true},
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
$.pop();
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
function IndexView($$anchor, $$props) {
|
|
1639
|
+
$.push($$props, true);
|
|
1640
|
+
|
|
1641
|
+
const sliceIds = useSliceIds(
|
|
1642
|
+
() => $$props.indexId,
|
|
1643
|
+
() => $$props.indexes,
|
|
1644
|
+
);
|
|
1645
|
+
|
|
1646
|
+
{
|
|
1647
|
+
const children = ($$anchor, sliceId = $.noop) => {
|
|
1648
|
+
SliceView($$anchor, {
|
|
1649
|
+
get indexId() {
|
|
1650
|
+
return $$props.indexId;
|
|
1651
|
+
},
|
|
1652
|
+
|
|
1653
|
+
get sliceId() {
|
|
1654
|
+
return sliceId();
|
|
1655
|
+
},
|
|
1656
|
+
|
|
1657
|
+
get indexes() {
|
|
1658
|
+
return $$props.indexes;
|
|
1659
|
+
},
|
|
1660
|
+
|
|
1661
|
+
get debugIds() {
|
|
1662
|
+
return $$props.debugIds;
|
|
1663
|
+
},
|
|
1664
|
+
});
|
|
1665
|
+
};
|
|
1666
|
+
|
|
1667
|
+
Wrap($$anchor, {
|
|
1668
|
+
get ids() {
|
|
1669
|
+
return sliceIds.current;
|
|
1670
|
+
},
|
|
1671
|
+
|
|
1672
|
+
get separator() {
|
|
1673
|
+
return $$props.separator;
|
|
1674
|
+
},
|
|
1675
|
+
|
|
1676
|
+
get debugIds() {
|
|
1677
|
+
return $$props.debugIds;
|
|
1678
|
+
},
|
|
1679
|
+
|
|
1680
|
+
get id() {
|
|
1681
|
+
return $$props.indexId;
|
|
1682
|
+
},
|
|
1683
|
+
|
|
1684
|
+
get custom() {
|
|
1685
|
+
return $$props.slice;
|
|
1686
|
+
},
|
|
1687
|
+
children,
|
|
1688
|
+
$$slots: {default: true},
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
$.pop();
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
function LinkedRowsView($$anchor, $$props) {
|
|
1696
|
+
$.push($$props, true);
|
|
1697
|
+
|
|
1698
|
+
const {store, localTableId} = useRelationshipsStoreTableIds(
|
|
1699
|
+
() => $$props.relationships,
|
|
1700
|
+
() => $$props.relationshipId,
|
|
1701
|
+
);
|
|
1702
|
+
const rowIds = useLinkedRowIds(
|
|
1703
|
+
() => $$props.relationshipId,
|
|
1704
|
+
() => $$props.firstRowId,
|
|
1705
|
+
() => $$props.relationships,
|
|
1706
|
+
);
|
|
1707
|
+
|
|
1708
|
+
{
|
|
1709
|
+
const children = ($$anchor, rowId = $.noop) => {
|
|
1710
|
+
var fragment_1 = $.comment();
|
|
1711
|
+
var node = $.first_child(fragment_1);
|
|
1712
|
+
|
|
1713
|
+
{
|
|
1714
|
+
var consequent = ($$anchor) => {
|
|
1715
|
+
RowView($$anchor, {
|
|
1716
|
+
get tableId() {
|
|
1717
|
+
return localTableId;
|
|
1718
|
+
},
|
|
1719
|
+
|
|
1720
|
+
get rowId() {
|
|
1721
|
+
return rowId();
|
|
1722
|
+
},
|
|
1723
|
+
|
|
1724
|
+
get store() {
|
|
1725
|
+
return store;
|
|
1726
|
+
},
|
|
1727
|
+
|
|
1728
|
+
get debugIds() {
|
|
1729
|
+
return $$props.debugIds;
|
|
1730
|
+
},
|
|
1731
|
+
});
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1734
|
+
$.if(node, ($$render) => {
|
|
1735
|
+
if (localTableId) $$render(consequent);
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
$.append($$anchor, fragment_1);
|
|
1740
|
+
};
|
|
1741
|
+
|
|
1742
|
+
Wrap($$anchor, {
|
|
1743
|
+
get ids() {
|
|
1744
|
+
return rowIds.current;
|
|
1745
|
+
},
|
|
1746
|
+
|
|
1747
|
+
get separator() {
|
|
1748
|
+
return $$props.separator;
|
|
1749
|
+
},
|
|
1750
|
+
|
|
1751
|
+
get debugIds() {
|
|
1752
|
+
return $$props.debugIds;
|
|
1753
|
+
},
|
|
1754
|
+
|
|
1755
|
+
get id() {
|
|
1756
|
+
return $$props.firstRowId;
|
|
1757
|
+
},
|
|
1758
|
+
|
|
1759
|
+
get custom() {
|
|
1760
|
+
return $$props.row;
|
|
1761
|
+
},
|
|
1762
|
+
children,
|
|
1763
|
+
$$slots: {default: true},
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
$.pop();
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
function LocalRowsView($$anchor, $$props) {
|
|
1771
|
+
$.push($$props, true);
|
|
1772
|
+
|
|
1773
|
+
const {store, localTableId} = useRelationshipsStoreTableIds(
|
|
1774
|
+
() => $$props.relationships,
|
|
1775
|
+
() => $$props.relationshipId,
|
|
1776
|
+
);
|
|
1777
|
+
const rowIds = useLocalRowIds(
|
|
1778
|
+
() => $$props.relationshipId,
|
|
1779
|
+
() => $$props.remoteRowId,
|
|
1780
|
+
() => $$props.relationships,
|
|
1781
|
+
);
|
|
1782
|
+
|
|
1783
|
+
{
|
|
1784
|
+
const children = ($$anchor, rowId = $.noop) => {
|
|
1785
|
+
var fragment_1 = $.comment();
|
|
1786
|
+
var node = $.first_child(fragment_1);
|
|
1787
|
+
|
|
1788
|
+
{
|
|
1789
|
+
var consequent = ($$anchor) => {
|
|
1790
|
+
RowView($$anchor, {
|
|
1791
|
+
get tableId() {
|
|
1792
|
+
return localTableId;
|
|
1793
|
+
},
|
|
1794
|
+
|
|
1795
|
+
get rowId() {
|
|
1796
|
+
return rowId();
|
|
1797
|
+
},
|
|
1798
|
+
|
|
1799
|
+
get store() {
|
|
1800
|
+
return store;
|
|
1801
|
+
},
|
|
1802
|
+
|
|
1803
|
+
get debugIds() {
|
|
1804
|
+
return $$props.debugIds;
|
|
1805
|
+
},
|
|
1806
|
+
});
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
$.if(node, ($$render) => {
|
|
1810
|
+
if (localTableId) $$render(consequent);
|
|
1811
|
+
});
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
$.append($$anchor, fragment_1);
|
|
1815
|
+
};
|
|
1816
|
+
|
|
1817
|
+
Wrap($$anchor, {
|
|
1818
|
+
get ids() {
|
|
1819
|
+
return rowIds.current;
|
|
1820
|
+
},
|
|
1821
|
+
|
|
1822
|
+
get separator() {
|
|
1823
|
+
return $$props.separator;
|
|
1824
|
+
},
|
|
1825
|
+
|
|
1826
|
+
get debugIds() {
|
|
1827
|
+
return $$props.debugIds;
|
|
1828
|
+
},
|
|
1829
|
+
|
|
1830
|
+
get id() {
|
|
1831
|
+
return $$props.remoteRowId;
|
|
1832
|
+
},
|
|
1833
|
+
|
|
1834
|
+
get custom() {
|
|
1835
|
+
return $$props.row;
|
|
1836
|
+
},
|
|
1837
|
+
children,
|
|
1838
|
+
$$slots: {default: true},
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
$.pop();
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
function MetricView($$anchor, $$props) {
|
|
1846
|
+
$.push($$props, true);
|
|
1847
|
+
|
|
1848
|
+
const metric = useMetric(
|
|
1849
|
+
() => $$props.metricId,
|
|
1850
|
+
() => $$props.metrics,
|
|
1851
|
+
);
|
|
1852
|
+
const display = $.derived(() => '' + (metric.current ?? ''));
|
|
1853
|
+
|
|
1854
|
+
const output = $.derived(() =>
|
|
1855
|
+
$$props.debugIds
|
|
1856
|
+
? `${$$props.metricId}:{${$.get(display)}}`
|
|
1857
|
+
: $.get(display),
|
|
1858
|
+
);
|
|
1859
|
+
|
|
1860
|
+
$.next();
|
|
1861
|
+
|
|
1862
|
+
var text = $.text();
|
|
1863
|
+
|
|
1864
|
+
$.template_effect(() => $.set_text(text, $.get(output)));
|
|
1865
|
+
$.append($$anchor, text);
|
|
1866
|
+
$.pop();
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
function Provider($$anchor, $$props) {
|
|
1870
|
+
$.push($$props, true);
|
|
1871
|
+
|
|
1872
|
+
const parentCtx = getContext(TINYBASE_CONTEXT_KEY) ?? [];
|
|
1873
|
+
let extras = $.proxy(Array.from({length: 8}, () => ({})));
|
|
1874
|
+
|
|
1875
|
+
const addThing = (offset, id, thing) => {
|
|
1876
|
+
extras[offset] = {...untrack(() => extras[offset]), [id]: thing};
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1879
|
+
const delThing = (offset, id) => {
|
|
1880
|
+
const {[id]: _, ...rest} = untrack(() => extras[offset]);
|
|
1881
|
+
|
|
1882
|
+
extras[offset] = rest;
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
const ctx = {
|
|
1886
|
+
get [0]() {
|
|
1887
|
+
return $$props.store ?? parentCtx[0];
|
|
1888
|
+
},
|
|
1889
|
+
|
|
1890
|
+
get [1]() {
|
|
1891
|
+
return {...(parentCtx[1] ?? {}), ...$$props.storesById, ...extras[0]};
|
|
1892
|
+
},
|
|
1893
|
+
|
|
1894
|
+
get [2]() {
|
|
1895
|
+
return $$props.metrics ?? parentCtx[2];
|
|
1896
|
+
},
|
|
1897
|
+
|
|
1898
|
+
get [3]() {
|
|
1899
|
+
return {...(parentCtx[3] ?? {}), ...$$props.metricsById, ...extras[1]};
|
|
1900
|
+
},
|
|
1901
|
+
|
|
1902
|
+
get [4]() {
|
|
1903
|
+
return $$props.indexes ?? parentCtx[4];
|
|
1904
|
+
},
|
|
1905
|
+
|
|
1906
|
+
get [5]() {
|
|
1907
|
+
return {...(parentCtx[5] ?? {}), ...$$props.indexesById, ...extras[2]};
|
|
1908
|
+
},
|
|
1909
|
+
|
|
1910
|
+
get [6]() {
|
|
1911
|
+
return $$props.relationships ?? parentCtx[6];
|
|
1912
|
+
},
|
|
1913
|
+
|
|
1914
|
+
get [7]() {
|
|
1915
|
+
return {
|
|
1916
|
+
...(parentCtx[7] ?? {}),
|
|
1917
|
+
...$$props.relationshipsById,
|
|
1918
|
+
...extras[3],
|
|
1919
|
+
};
|
|
1920
|
+
},
|
|
1921
|
+
|
|
1922
|
+
get [8]() {
|
|
1923
|
+
return $$props.queries ?? parentCtx[8];
|
|
1924
|
+
},
|
|
1925
|
+
|
|
1926
|
+
get [9]() {
|
|
1927
|
+
return {...(parentCtx[9] ?? {}), ...$$props.queriesById, ...extras[4]};
|
|
1928
|
+
},
|
|
1929
|
+
|
|
1930
|
+
get [10]() {
|
|
1931
|
+
return $$props.checkpoints ?? parentCtx[10];
|
|
1932
|
+
},
|
|
1933
|
+
|
|
1934
|
+
get [11]() {
|
|
1935
|
+
return {
|
|
1936
|
+
...(parentCtx[11] ?? {}),
|
|
1937
|
+
...$$props.checkpointsById,
|
|
1938
|
+
...extras[5],
|
|
1939
|
+
};
|
|
1940
|
+
},
|
|
1941
|
+
|
|
1942
|
+
get [12]() {
|
|
1943
|
+
return $$props.persister ?? parentCtx[12];
|
|
1944
|
+
},
|
|
1945
|
+
|
|
1946
|
+
get [13]() {
|
|
1947
|
+
return {
|
|
1948
|
+
...(parentCtx[13] ?? {}),
|
|
1949
|
+
...$$props.persistersById,
|
|
1950
|
+
...extras[6],
|
|
1951
|
+
};
|
|
1952
|
+
},
|
|
1953
|
+
|
|
1954
|
+
get [14]() {
|
|
1955
|
+
return $$props.synchronizer ?? parentCtx[14];
|
|
1956
|
+
},
|
|
1957
|
+
|
|
1958
|
+
get [15]() {
|
|
1959
|
+
return {
|
|
1960
|
+
...(parentCtx[15] ?? {}),
|
|
1961
|
+
...$$props.synchronizersById,
|
|
1962
|
+
...extras[7],
|
|
1963
|
+
};
|
|
1964
|
+
},
|
|
1965
|
+
|
|
1966
|
+
get [16]() {
|
|
1967
|
+
return addThing;
|
|
1968
|
+
},
|
|
1969
|
+
|
|
1970
|
+
get [17]() {
|
|
1971
|
+
return delThing;
|
|
1972
|
+
},
|
|
1973
|
+
};
|
|
1974
|
+
|
|
1975
|
+
setContext(TINYBASE_CONTEXT_KEY, ctx);
|
|
1976
|
+
|
|
1977
|
+
var fragment = $.comment();
|
|
1978
|
+
var node = $.first_child(fragment);
|
|
1979
|
+
|
|
1980
|
+
$.snippet(node, () => $$props.children);
|
|
1981
|
+
$.append($$anchor, fragment);
|
|
1982
|
+
$.pop();
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
var root = $.from_html(`<!><!><!>`, 1);
|
|
1986
|
+
|
|
1987
|
+
function RemoteRowView($$anchor, $$props) {
|
|
1988
|
+
$.push($$props, true);
|
|
1989
|
+
|
|
1990
|
+
const {store, remoteTableId} = useRelationshipsStoreTableIds(
|
|
1991
|
+
() => $$props.relationships,
|
|
1992
|
+
() => $$props.relationshipId,
|
|
1993
|
+
);
|
|
1994
|
+
const remoteRowId = useRemoteRowId(
|
|
1995
|
+
() => $$props.relationshipId,
|
|
1996
|
+
() => $$props.localRowId,
|
|
1997
|
+
() => $$props.relationships,
|
|
1998
|
+
);
|
|
1999
|
+
var fragment = root();
|
|
2000
|
+
var node = $.first_child(fragment);
|
|
2001
|
+
|
|
2002
|
+
{
|
|
2003
|
+
var consequent = ($$anchor) => {
|
|
2004
|
+
var text = $.text();
|
|
2005
|
+
|
|
2006
|
+
$.template_effect(() =>
|
|
2007
|
+
$.set_text(text, `${$$props.localRowId ?? ''}:{`),
|
|
2008
|
+
);
|
|
2009
|
+
$.append($$anchor, text);
|
|
2010
|
+
};
|
|
2011
|
+
|
|
2012
|
+
$.if(node, ($$render) => {
|
|
2013
|
+
if ($$props.debugIds) $$render(consequent);
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
var node_1 = $.sibling(node);
|
|
2018
|
+
|
|
2019
|
+
{
|
|
2020
|
+
var consequent_3 = ($$anchor) => {
|
|
2021
|
+
var fragment_2 = $.comment();
|
|
2022
|
+
var node_2 = $.first_child(fragment_2);
|
|
2023
|
+
|
|
2024
|
+
{
|
|
2025
|
+
var consequent_1 = ($$anchor) => {
|
|
2026
|
+
var fragment_3 = $.comment();
|
|
2027
|
+
var node_3 = $.first_child(fragment_3);
|
|
2028
|
+
|
|
2029
|
+
$.snippet(
|
|
2030
|
+
node_3,
|
|
2031
|
+
() => $$props.row,
|
|
2032
|
+
() => remoteRowId.current,
|
|
2033
|
+
);
|
|
2034
|
+
$.append($$anchor, fragment_3);
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
var consequent_2 = ($$anchor) => {
|
|
2038
|
+
RowView($$anchor, {
|
|
2039
|
+
get tableId() {
|
|
2040
|
+
return remoteTableId;
|
|
2041
|
+
},
|
|
2042
|
+
|
|
2043
|
+
get rowId() {
|
|
2044
|
+
return remoteRowId.current;
|
|
2045
|
+
},
|
|
2046
|
+
|
|
2047
|
+
get store() {
|
|
2048
|
+
return store;
|
|
2049
|
+
},
|
|
2050
|
+
|
|
2051
|
+
get debugIds() {
|
|
2052
|
+
return $$props.debugIds;
|
|
2053
|
+
},
|
|
2054
|
+
});
|
|
2055
|
+
};
|
|
2056
|
+
|
|
2057
|
+
$.if(node_2, ($$render) => {
|
|
2058
|
+
if ($$props.row) $$render(consequent_1);
|
|
2059
|
+
else if (remoteTableId) $$render(consequent_2, 1);
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
$.append($$anchor, fragment_2);
|
|
2064
|
+
};
|
|
2065
|
+
|
|
2066
|
+
var d = $.derived(() => !isUndefined(remoteRowId.current));
|
|
2067
|
+
|
|
2068
|
+
$.if(node_1, ($$render) => {
|
|
2069
|
+
if ($.get(d)) $$render(consequent_3);
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
var node_4 = $.sibling(node_1);
|
|
2074
|
+
|
|
2075
|
+
{
|
|
2076
|
+
var consequent_4 = ($$anchor) => {
|
|
2077
|
+
var text_1 = $.text();
|
|
2078
|
+
|
|
2079
|
+
text_1.nodeValue = '}';
|
|
2080
|
+
$.append($$anchor, text_1);
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
$.if(node_4, ($$render) => {
|
|
2084
|
+
if ($$props.debugIds) $$render(consequent_4);
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
$.append($$anchor, fragment);
|
|
2089
|
+
$.pop();
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
function ResultCellView($$anchor, $$props) {
|
|
2093
|
+
$.push($$props, true);
|
|
2094
|
+
|
|
2095
|
+
const cell = useResultCell(
|
|
2096
|
+
() => $$props.queryId,
|
|
2097
|
+
() => $$props.rowId,
|
|
2098
|
+
() => $$props.cellId,
|
|
2099
|
+
() => $$props.queries,
|
|
2100
|
+
);
|
|
2101
|
+
const display = $.derived(() => '' + (cell.current ?? ''));
|
|
2102
|
+
|
|
2103
|
+
const output = $.derived(() =>
|
|
2104
|
+
$$props.debugIds ? `${$$props.cellId}:{${$.get(display)}}` : $.get(display),
|
|
2105
|
+
);
|
|
2106
|
+
|
|
2107
|
+
$.next();
|
|
2108
|
+
|
|
2109
|
+
var text = $.text();
|
|
2110
|
+
|
|
2111
|
+
$.template_effect(() => $.set_text(text, $.get(output)));
|
|
2112
|
+
$.append($$anchor, text);
|
|
2113
|
+
$.pop();
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
function ResultRowView($$anchor, $$props) {
|
|
2117
|
+
$.push($$props, true);
|
|
2118
|
+
|
|
2119
|
+
const cellIds = useResultCellIds(
|
|
2120
|
+
() => $$props.queryId,
|
|
2121
|
+
() => $$props.rowId,
|
|
2122
|
+
() => $$props.queries,
|
|
2123
|
+
);
|
|
2124
|
+
|
|
2125
|
+
{
|
|
2126
|
+
const children = ($$anchor, cellId = $.noop) => {
|
|
2127
|
+
ResultCellView($$anchor, {
|
|
2128
|
+
get queryId() {
|
|
2129
|
+
return $$props.queryId;
|
|
2130
|
+
},
|
|
2131
|
+
|
|
2132
|
+
get rowId() {
|
|
2133
|
+
return $$props.rowId;
|
|
2134
|
+
},
|
|
2135
|
+
|
|
2136
|
+
get cellId() {
|
|
2137
|
+
return cellId();
|
|
2138
|
+
},
|
|
2139
|
+
|
|
2140
|
+
get queries() {
|
|
2141
|
+
return $$props.queries;
|
|
2142
|
+
},
|
|
2143
|
+
|
|
2144
|
+
get debugIds() {
|
|
2145
|
+
return $$props.debugIds;
|
|
2146
|
+
},
|
|
2147
|
+
});
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2150
|
+
Wrap($$anchor, {
|
|
2151
|
+
get ids() {
|
|
2152
|
+
return cellIds.current;
|
|
2153
|
+
},
|
|
2154
|
+
|
|
2155
|
+
get separator() {
|
|
2156
|
+
return $$props.separator;
|
|
2157
|
+
},
|
|
2158
|
+
|
|
2159
|
+
get debugIds() {
|
|
2160
|
+
return $$props.debugIds;
|
|
2161
|
+
},
|
|
2162
|
+
|
|
2163
|
+
get id() {
|
|
2164
|
+
return $$props.rowId;
|
|
2165
|
+
},
|
|
2166
|
+
|
|
2167
|
+
get custom() {
|
|
2168
|
+
return $$props.cell;
|
|
2169
|
+
},
|
|
2170
|
+
children,
|
|
2171
|
+
$$slots: {default: true},
|
|
2172
|
+
});
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
$.pop();
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
function ResultSortedTableView($$anchor, $$props) {
|
|
2179
|
+
$.push($$props, true);
|
|
2180
|
+
|
|
2181
|
+
const rowIds = useResultSortedRowIds(
|
|
2182
|
+
() => $$props.queryId,
|
|
2183
|
+
() => $$props.cellId,
|
|
2184
|
+
() => $$props.descending ?? false,
|
|
2185
|
+
() => $$props.offset ?? 0,
|
|
2186
|
+
() => $$props.limit,
|
|
2187
|
+
() => $$props.queries,
|
|
2188
|
+
);
|
|
2189
|
+
|
|
2190
|
+
{
|
|
2191
|
+
const children = ($$anchor, rowId = $.noop) => {
|
|
2192
|
+
ResultRowView($$anchor, {
|
|
2193
|
+
get queryId() {
|
|
2194
|
+
return $$props.queryId;
|
|
2195
|
+
},
|
|
2196
|
+
|
|
2197
|
+
get rowId() {
|
|
2198
|
+
return rowId();
|
|
2199
|
+
},
|
|
2200
|
+
|
|
2201
|
+
get queries() {
|
|
2202
|
+
return $$props.queries;
|
|
2203
|
+
},
|
|
2204
|
+
|
|
2205
|
+
get debugIds() {
|
|
2206
|
+
return $$props.debugIds;
|
|
2207
|
+
},
|
|
2208
|
+
});
|
|
2209
|
+
};
|
|
2210
|
+
|
|
2211
|
+
Wrap($$anchor, {
|
|
2212
|
+
get ids() {
|
|
2213
|
+
return rowIds.current;
|
|
2214
|
+
},
|
|
2215
|
+
|
|
2216
|
+
get separator() {
|
|
2217
|
+
return $$props.separator;
|
|
2218
|
+
},
|
|
2219
|
+
|
|
2220
|
+
get debugIds() {
|
|
2221
|
+
return $$props.debugIds;
|
|
2222
|
+
},
|
|
2223
|
+
|
|
2224
|
+
get id() {
|
|
2225
|
+
return $$props.queryId;
|
|
2226
|
+
},
|
|
2227
|
+
|
|
2228
|
+
get custom() {
|
|
2229
|
+
return $$props.row;
|
|
2230
|
+
},
|
|
2231
|
+
children,
|
|
2232
|
+
$$slots: {default: true},
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
$.pop();
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
function ResultTableView($$anchor, $$props) {
|
|
2240
|
+
$.push($$props, true);
|
|
2241
|
+
|
|
2242
|
+
const rowIds = useResultRowIds(
|
|
2243
|
+
() => $$props.queryId,
|
|
2244
|
+
() => $$props.queries,
|
|
2245
|
+
);
|
|
2246
|
+
|
|
2247
|
+
{
|
|
2248
|
+
const children = ($$anchor, rowId = $.noop) => {
|
|
2249
|
+
ResultRowView($$anchor, {
|
|
2250
|
+
get queryId() {
|
|
2251
|
+
return $$props.queryId;
|
|
2252
|
+
},
|
|
2253
|
+
|
|
2254
|
+
get rowId() {
|
|
2255
|
+
return rowId();
|
|
2256
|
+
},
|
|
2257
|
+
|
|
2258
|
+
get queries() {
|
|
2259
|
+
return $$props.queries;
|
|
2260
|
+
},
|
|
2261
|
+
|
|
2262
|
+
get debugIds() {
|
|
2263
|
+
return $$props.debugIds;
|
|
2264
|
+
},
|
|
2265
|
+
});
|
|
2266
|
+
};
|
|
2267
|
+
|
|
2268
|
+
Wrap($$anchor, {
|
|
2269
|
+
get ids() {
|
|
2270
|
+
return rowIds.current;
|
|
2271
|
+
},
|
|
2272
|
+
|
|
2273
|
+
get separator() {
|
|
2274
|
+
return $$props.separator;
|
|
2275
|
+
},
|
|
2276
|
+
|
|
2277
|
+
get debugIds() {
|
|
2278
|
+
return $$props.debugIds;
|
|
2279
|
+
},
|
|
2280
|
+
|
|
2281
|
+
get id() {
|
|
2282
|
+
return $$props.queryId;
|
|
2283
|
+
},
|
|
2284
|
+
|
|
2285
|
+
get custom() {
|
|
2286
|
+
return $$props.row;
|
|
2287
|
+
},
|
|
2288
|
+
children,
|
|
2289
|
+
$$slots: {default: true},
|
|
2290
|
+
});
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
$.pop();
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
function SortedTableView($$anchor, $$props) {
|
|
2297
|
+
$.push($$props, true);
|
|
2298
|
+
|
|
2299
|
+
const rowIds = useSortedRowIds(
|
|
2300
|
+
() => $$props.tableId,
|
|
2301
|
+
() => $$props.cellId,
|
|
2302
|
+
() => $$props.descending ?? false,
|
|
2303
|
+
() => $$props.offset ?? 0,
|
|
2304
|
+
() => $$props.limit,
|
|
2305
|
+
() => $$props.store,
|
|
2306
|
+
);
|
|
2307
|
+
|
|
2308
|
+
{
|
|
2309
|
+
const children = ($$anchor, rowId = $.noop) => {
|
|
2310
|
+
RowView($$anchor, {
|
|
2311
|
+
get tableId() {
|
|
2312
|
+
return $$props.tableId;
|
|
2313
|
+
},
|
|
2314
|
+
|
|
2315
|
+
get rowId() {
|
|
2316
|
+
return rowId();
|
|
2317
|
+
},
|
|
2318
|
+
|
|
2319
|
+
get store() {
|
|
2320
|
+
return $$props.store;
|
|
2321
|
+
},
|
|
2322
|
+
|
|
2323
|
+
get customCellIds() {
|
|
2324
|
+
return $$props.customCellIds;
|
|
2325
|
+
},
|
|
2326
|
+
|
|
2327
|
+
get debugIds() {
|
|
2328
|
+
return $$props.debugIds;
|
|
2329
|
+
},
|
|
2330
|
+
});
|
|
2331
|
+
};
|
|
2332
|
+
|
|
2333
|
+
Wrap($$anchor, {
|
|
2334
|
+
get ids() {
|
|
2335
|
+
return rowIds.current;
|
|
2336
|
+
},
|
|
2337
|
+
|
|
2338
|
+
get separator() {
|
|
2339
|
+
return $$props.separator;
|
|
2340
|
+
},
|
|
2341
|
+
|
|
2342
|
+
get debugIds() {
|
|
2343
|
+
return $$props.debugIds;
|
|
2344
|
+
},
|
|
2345
|
+
|
|
2346
|
+
get id() {
|
|
2347
|
+
return $$props.tableId;
|
|
2348
|
+
},
|
|
2349
|
+
|
|
2350
|
+
get custom() {
|
|
2351
|
+
return $$props.row;
|
|
2352
|
+
},
|
|
2353
|
+
children,
|
|
2354
|
+
$$slots: {default: true},
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
$.pop();
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
function TableView($$anchor, $$props) {
|
|
2362
|
+
$.push($$props, true);
|
|
2363
|
+
|
|
2364
|
+
const rowIds = useRowIds(
|
|
2365
|
+
() => $$props.tableId,
|
|
2366
|
+
() => $$props.store,
|
|
2367
|
+
);
|
|
2368
|
+
|
|
2369
|
+
{
|
|
2370
|
+
const children = ($$anchor, rowId = $.noop) => {
|
|
2371
|
+
RowView($$anchor, {
|
|
2372
|
+
get tableId() {
|
|
2373
|
+
return $$props.tableId;
|
|
2374
|
+
},
|
|
2375
|
+
|
|
2376
|
+
get rowId() {
|
|
2377
|
+
return rowId();
|
|
2378
|
+
},
|
|
2379
|
+
|
|
2380
|
+
get store() {
|
|
2381
|
+
return $$props.store;
|
|
2382
|
+
},
|
|
2383
|
+
|
|
2384
|
+
get customCellIds() {
|
|
2385
|
+
return $$props.customCellIds;
|
|
2386
|
+
},
|
|
2387
|
+
|
|
2388
|
+
get debugIds() {
|
|
2389
|
+
return $$props.debugIds;
|
|
2390
|
+
},
|
|
2391
|
+
});
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2394
|
+
Wrap($$anchor, {
|
|
2395
|
+
get ids() {
|
|
2396
|
+
return rowIds.current;
|
|
2397
|
+
},
|
|
2398
|
+
|
|
2399
|
+
get separator() {
|
|
2400
|
+
return $$props.separator;
|
|
2401
|
+
},
|
|
2402
|
+
|
|
2403
|
+
get debugIds() {
|
|
2404
|
+
return $$props.debugIds;
|
|
2405
|
+
},
|
|
2406
|
+
|
|
2407
|
+
get id() {
|
|
2408
|
+
return $$props.tableId;
|
|
2409
|
+
},
|
|
2410
|
+
|
|
2411
|
+
get custom() {
|
|
2412
|
+
return $$props.row;
|
|
2413
|
+
},
|
|
2414
|
+
children,
|
|
2415
|
+
$$slots: {default: true},
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
$.pop();
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
function TablesView($$anchor, $$props) {
|
|
2423
|
+
$.push($$props, true);
|
|
2424
|
+
|
|
2425
|
+
const tableIds = useTableIds(() => $$props.store);
|
|
2426
|
+
|
|
2427
|
+
{
|
|
2428
|
+
const children = ($$anchor, tableId = $.noop) => {
|
|
2429
|
+
TableView($$anchor, {
|
|
2430
|
+
get tableId() {
|
|
2431
|
+
return tableId();
|
|
2432
|
+
},
|
|
2433
|
+
|
|
2434
|
+
get store() {
|
|
2435
|
+
return $$props.store;
|
|
2436
|
+
},
|
|
2437
|
+
|
|
2438
|
+
get debugIds() {
|
|
2439
|
+
return $$props.debugIds;
|
|
2440
|
+
},
|
|
2441
|
+
});
|
|
2442
|
+
};
|
|
2443
|
+
|
|
2444
|
+
Wrap($$anchor, {
|
|
2445
|
+
get ids() {
|
|
2446
|
+
return tableIds.current;
|
|
2447
|
+
},
|
|
2448
|
+
|
|
2449
|
+
get separator() {
|
|
2450
|
+
return $$props.separator;
|
|
2451
|
+
},
|
|
2452
|
+
|
|
2453
|
+
get debugIds() {
|
|
2454
|
+
return $$props.debugIds;
|
|
2455
|
+
},
|
|
2456
|
+
|
|
2457
|
+
get custom() {
|
|
2458
|
+
return $$props.table;
|
|
2459
|
+
},
|
|
2460
|
+
children,
|
|
2461
|
+
$$slots: {default: true},
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
$.pop();
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
function ValueView($$anchor, $$props) {
|
|
2469
|
+
$.push($$props, true);
|
|
2470
|
+
|
|
2471
|
+
const value = useValue(
|
|
2472
|
+
() => $$props.valueId,
|
|
2473
|
+
() => $$props.store,
|
|
2474
|
+
);
|
|
2475
|
+
const display = $.derived(() => '' + (value.current ?? ''));
|
|
2476
|
+
|
|
2477
|
+
const output = $.derived(() =>
|
|
2478
|
+
$$props.debugIds
|
|
2479
|
+
? `${$$props.valueId}:{${$.get(display)}}`
|
|
2480
|
+
: $.get(display),
|
|
2481
|
+
);
|
|
2482
|
+
|
|
2483
|
+
$.next();
|
|
2484
|
+
|
|
2485
|
+
var text = $.text();
|
|
2486
|
+
|
|
2487
|
+
$.template_effect(() => $.set_text(text, $.get(output)));
|
|
2488
|
+
$.append($$anchor, text);
|
|
2489
|
+
$.pop();
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
function ValuesView($$anchor, $$props) {
|
|
2493
|
+
$.push($$props, true);
|
|
2494
|
+
|
|
2495
|
+
const valueIds = useValueIds(() => $$props.store);
|
|
2496
|
+
|
|
2497
|
+
{
|
|
2498
|
+
const children = ($$anchor, valueId = $.noop) => {
|
|
2499
|
+
ValueView($$anchor, {
|
|
2500
|
+
get valueId() {
|
|
2501
|
+
return valueId();
|
|
2502
|
+
},
|
|
2503
|
+
|
|
2504
|
+
get store() {
|
|
2505
|
+
return $$props.store;
|
|
2506
|
+
},
|
|
2507
|
+
|
|
2508
|
+
get debugIds() {
|
|
2509
|
+
return $$props.debugIds;
|
|
2510
|
+
},
|
|
2511
|
+
});
|
|
2512
|
+
};
|
|
2513
|
+
|
|
2514
|
+
Wrap($$anchor, {
|
|
2515
|
+
get ids() {
|
|
2516
|
+
return valueIds.current;
|
|
2517
|
+
},
|
|
2518
|
+
|
|
2519
|
+
get separator() {
|
|
2520
|
+
return $$props.separator;
|
|
2521
|
+
},
|
|
2522
|
+
|
|
2523
|
+
get debugIds() {
|
|
2524
|
+
return $$props.debugIds;
|
|
2525
|
+
},
|
|
2526
|
+
|
|
2527
|
+
get custom() {
|
|
2528
|
+
return $$props.value;
|
|
2529
|
+
},
|
|
2530
|
+
children,
|
|
2531
|
+
$$slots: {default: true},
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
$.pop();
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2538
|
+
export {
|
|
2539
|
+
BackwardCheckpointsView,
|
|
2540
|
+
CellView,
|
|
2541
|
+
CheckpointView,
|
|
2542
|
+
CurrentCheckpointView,
|
|
2543
|
+
ForwardCheckpointsView,
|
|
2544
|
+
IndexView,
|
|
2545
|
+
LinkedRowsView,
|
|
2546
|
+
LocalRowsView,
|
|
2547
|
+
MetricView,
|
|
2548
|
+
provideCheckpoints,
|
|
2549
|
+
provideIndexes,
|
|
2550
|
+
provideMetrics,
|
|
2551
|
+
providePersister,
|
|
2552
|
+
provideQueries,
|
|
2553
|
+
Provider,
|
|
2554
|
+
provideRelationships,
|
|
2555
|
+
provideStore,
|
|
2556
|
+
provideSynchronizer,
|
|
2557
|
+
RemoteRowView,
|
|
2558
|
+
ResultCellView,
|
|
2559
|
+
ResultRowView,
|
|
2560
|
+
ResultSortedTableView,
|
|
2561
|
+
ResultTableView,
|
|
2562
|
+
RowView,
|
|
2563
|
+
SliceView,
|
|
2564
|
+
SortedTableView,
|
|
2565
|
+
TablesView,
|
|
2566
|
+
TableView,
|
|
2567
|
+
useBindableCell,
|
|
2568
|
+
useBindableValue,
|
|
2569
|
+
useCell,
|
|
2570
|
+
useCellIds,
|
|
2571
|
+
useCellIdsListener,
|
|
2572
|
+
useCellListener,
|
|
2573
|
+
useCheckpoint,
|
|
2574
|
+
useCheckpointIds,
|
|
2575
|
+
useCheckpointIdsListener,
|
|
2576
|
+
useCheckpointListener,
|
|
2577
|
+
useCheckpoints,
|
|
2578
|
+
useCheckpointsIds,
|
|
2579
|
+
useCheckpointsOrCheckpointsById,
|
|
2580
|
+
useDidFinishTransactionListener,
|
|
2581
|
+
useGoBackwardCallback,
|
|
2582
|
+
useGoForwardCallback,
|
|
2583
|
+
useHasCell,
|
|
2584
|
+
useHasCellListener,
|
|
2585
|
+
useHasRow,
|
|
2586
|
+
useHasRowListener,
|
|
2587
|
+
useHasTable,
|
|
2588
|
+
useHasTableCell,
|
|
2589
|
+
useHasTableCellListener,
|
|
2590
|
+
useHasTableListener,
|
|
2591
|
+
useHasTables,
|
|
2592
|
+
useHasTablesListener,
|
|
2593
|
+
useHasValue,
|
|
2594
|
+
useHasValueListener,
|
|
2595
|
+
useHasValues,
|
|
2596
|
+
useHasValuesListener,
|
|
2597
|
+
useIndexes,
|
|
2598
|
+
useIndexesIds,
|
|
2599
|
+
useIndexesOrIndexesById,
|
|
2600
|
+
useIndexIds,
|
|
2601
|
+
useIndexStoreTableId,
|
|
2602
|
+
useLinkedRowIds,
|
|
2603
|
+
useLinkedRowIdsListener,
|
|
2604
|
+
useLocalRowIds,
|
|
2605
|
+
useLocalRowIdsListener,
|
|
2606
|
+
useMetric,
|
|
2607
|
+
useMetricIds,
|
|
2608
|
+
useMetricListener,
|
|
2609
|
+
useMetrics,
|
|
2610
|
+
useMetricsIds,
|
|
2611
|
+
useMetricsOrMetricsById,
|
|
2612
|
+
useParamValueListener,
|
|
2613
|
+
useParamValuesListener,
|
|
2614
|
+
usePersister,
|
|
2615
|
+
usePersisterIds,
|
|
2616
|
+
usePersisterOrPersisterById,
|
|
2617
|
+
usePersisterStatus,
|
|
2618
|
+
usePersisterStatusListener,
|
|
2619
|
+
useQueries,
|
|
2620
|
+
useQueriesIds,
|
|
2621
|
+
useQueriesOrQueriesById,
|
|
2622
|
+
useQueryIds,
|
|
2623
|
+
useRelationshipIds,
|
|
2624
|
+
useRelationships,
|
|
2625
|
+
useRelationshipsIds,
|
|
2626
|
+
useRelationshipsOrRelationshipsById,
|
|
2627
|
+
useRelationshipsStoreTableIds,
|
|
2628
|
+
useRemoteRowId,
|
|
2629
|
+
useRemoteRowIdListener,
|
|
2630
|
+
useResultCell,
|
|
2631
|
+
useResultCellIds,
|
|
2632
|
+
useResultCellIdsListener,
|
|
2633
|
+
useResultCellListener,
|
|
2634
|
+
useResultRow,
|
|
2635
|
+
useResultRowCount,
|
|
2636
|
+
useResultRowCountListener,
|
|
2637
|
+
useResultRowIds,
|
|
2638
|
+
useResultRowIdsListener,
|
|
2639
|
+
useResultRowListener,
|
|
2640
|
+
useResultSortedRowIds,
|
|
2641
|
+
useResultSortedRowIdsListener,
|
|
2642
|
+
useResultTable,
|
|
2643
|
+
useResultTableCellIds,
|
|
2644
|
+
useResultTableCellIdsListener,
|
|
2645
|
+
useResultTableListener,
|
|
2646
|
+
useRow,
|
|
2647
|
+
useRowCount,
|
|
2648
|
+
useRowCountListener,
|
|
2649
|
+
useRowIds,
|
|
2650
|
+
useRowIdsListener,
|
|
2651
|
+
useRowListener,
|
|
2652
|
+
useSliceIds,
|
|
2653
|
+
useSliceIdsListener,
|
|
2654
|
+
useSliceRowIds,
|
|
2655
|
+
useSliceRowIdsListener,
|
|
2656
|
+
useSortedRowIds,
|
|
2657
|
+
useSortedRowIdsListener,
|
|
2658
|
+
useStartTransactionListener,
|
|
2659
|
+
useStore,
|
|
2660
|
+
useStoreIds,
|
|
2661
|
+
useStoreOrStoreById,
|
|
2662
|
+
useSynchronizer,
|
|
2663
|
+
useSynchronizerIds,
|
|
2664
|
+
useSynchronizerOrSynchronizerById,
|
|
2665
|
+
useSynchronizerStatus,
|
|
2666
|
+
useSynchronizerStatusListener,
|
|
2667
|
+
useTable,
|
|
2668
|
+
useTableCellIds,
|
|
2669
|
+
useTableCellIdsListener,
|
|
2670
|
+
useTableIds,
|
|
2671
|
+
useTableIdsListener,
|
|
2672
|
+
useTableListener,
|
|
2673
|
+
useTables,
|
|
2674
|
+
useTablesListener,
|
|
2675
|
+
useValue,
|
|
2676
|
+
useValueIds,
|
|
2677
|
+
useValueIdsListener,
|
|
2678
|
+
useValueListener,
|
|
2679
|
+
useValues,
|
|
2680
|
+
useValuesListener,
|
|
2681
|
+
useWillFinishTransactionListener,
|
|
2682
|
+
ValuesView,
|
|
2683
|
+
ValueView,
|
|
2684
|
+
};
|