tinybase 9.0.0 → 9.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/common/index.d.ts +17 -2
- package/@types/common/with-schemas/index.d.ts +18 -2
- package/@types/store/index.d.ts +37 -7
- package/@types/store/with-schemas/index.d.ts +38 -7
- package/@types/ui-react/index.d.ts +6 -2
- package/@types/ui-react/with-schemas/index.d.ts +7 -2
- package/@types/ui-react-dom/index.d.ts +10 -10
- package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-react-dom-charts/index.d.ts +7 -7
- package/@types/ui-react-dom-charts/with-schemas/index.d.ts +7 -7
- package/@types/ui-react-inspector/index.d.ts +1 -1
- package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-solid/index.d.ts +9 -2
- package/@types/ui-solid/with-schemas/index.d.ts +10 -2
- package/@types/ui-solid-dom/index.d.ts +10 -10
- package/@types/ui-solid-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-solid-inspector/index.d.ts +1 -1
- package/@types/ui-solid-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-svelte/index.d.ts +50 -2
- package/@types/ui-svelte/with-schemas/index.d.ts +88 -25
- package/@types/ui-svelte-dom/index.d.ts +10 -10
- package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-svelte-inspector/index.d.ts +1 -1
- package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
- package/index.js +34 -6
- package/mergeable-store/index.js +34 -6
- package/mergeable-store/with-schemas/index.js +34 -6
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/mergeable-store/index.js +1 -1
- package/min/mergeable-store/index.js.gz +0 -0
- package/min/mergeable-store/with-schemas/index.js +1 -1
- package/min/mergeable-store/with-schemas/index.js.gz +0 -0
- 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/store/index.js +1 -1
- package/min/store/index.js.gz +0 -0
- package/min/store/with-schemas/index.js +1 -1
- package/min/store/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-react-dom/index.js +1 -1
- package/min/ui-react-dom/index.js.gz +0 -0
- package/min/ui-react-dom/with-schemas/index.js +1 -1
- package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom-charts/index.js +1 -1
- package/min/ui-react-dom-charts/index.js.gz +0 -0
- package/min/ui-react-dom-charts/with-schemas/index.js +1 -1
- package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-solid/index.js +1 -1
- package/min/ui-solid/index.js.gz +0 -0
- package/min/ui-solid/with-schemas/index.js +1 -1
- package/min/ui-solid/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-dom/index.js +1 -1
- package/min/ui-solid-dom/index.js.gz +0 -0
- package/min/ui-solid-dom/with-schemas/index.js +1 -1
- package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-inspector/index.js +1 -1
- package/min/ui-solid-inspector/index.js.gz +0 -0
- package/min/ui-solid-inspector/with-schemas/index.js +1 -1
- package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte/index.js +1 -1
- package/min/ui-svelte/index.js.gz +0 -0
- package/min/ui-svelte/with-schemas/index.js +1 -1
- package/min/ui-svelte/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-dom/index.js +1 -1
- package/min/ui-svelte-dom/index.js.gz +0 -0
- package/min/ui-svelte-dom/with-schemas/index.js +1 -1
- package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-inspector/index.js +1 -1
- package/min/ui-svelte-inspector/index.js.gz +0 -0
- package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
- package/min/ui-svelte-inspector/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/omni/index.js +34 -6
- package/omni/with-schemas/index.js +34 -6
- package/package.json +3 -3
- package/readme.md +14 -14
- package/releases.md +59 -59
- package/store/index.js +34 -6
- package/store/with-schemas/index.js +34 -6
- package/ui-react/index.js +36 -6
- package/ui-react/with-schemas/index.js +36 -6
- package/ui-react-dom/index.js +24 -4
- package/ui-react-dom/with-schemas/index.js +24 -4
- package/ui-react-dom-charts/index.js +24 -4
- package/ui-react-dom-charts/with-schemas/index.js +24 -4
- package/ui-react-inspector/index.js +58 -10
- package/ui-react-inspector/with-schemas/index.js +58 -10
- package/ui-solid/index.js +32 -2
- package/ui-solid/with-schemas/index.js +32 -2
- package/ui-solid-dom/index.js +17 -1
- package/ui-solid-dom/with-schemas/index.js +17 -1
- package/ui-solid-inspector/index.js +51 -7
- package/ui-solid-inspector/with-schemas/index.js +51 -7
- package/ui-svelte/index.js +73 -31
- package/ui-svelte/with-schemas/index.js +73 -31
- package/ui-svelte-dom/index.js +35 -14
- package/ui-svelte-dom/with-schemas/index.js +35 -14
- package/ui-svelte-inspector/index.js +69 -20
- package/ui-svelte-inspector/with-schemas/index.js +69 -20
- package/with-schemas/index.js +34 -6
package/omni/index.js
CHANGED
|
@@ -2206,13 +2206,36 @@ const createStore = () => {
|
|
|
2206
2206
|
listener,
|
|
2207
2207
|
mutator,
|
|
2208
2208
|
) => {
|
|
2209
|
-
|
|
2209
|
+
const [descending, offset, limit, sorter] = otherArgs;
|
|
2210
|
+
let sortedRowIds = getSortedRowIds(
|
|
2211
|
+
tableId,
|
|
2212
|
+
cellId,
|
|
2213
|
+
descending,
|
|
2214
|
+
offset,
|
|
2215
|
+
limit,
|
|
2216
|
+
sorter,
|
|
2217
|
+
);
|
|
2210
2218
|
return addListener(
|
|
2211
2219
|
() => {
|
|
2212
|
-
const newSortedRowIds = getSortedRowIds(
|
|
2220
|
+
const newSortedRowIds = getSortedRowIds(
|
|
2221
|
+
tableId,
|
|
2222
|
+
cellId,
|
|
2223
|
+
descending,
|
|
2224
|
+
offset,
|
|
2225
|
+
limit,
|
|
2226
|
+
sorter,
|
|
2227
|
+
);
|
|
2213
2228
|
if (!arrayIsEqual(newSortedRowIds, sortedRowIds)) {
|
|
2214
2229
|
sortedRowIds = newSortedRowIds;
|
|
2215
|
-
listener(
|
|
2230
|
+
listener(
|
|
2231
|
+
store,
|
|
2232
|
+
tableId,
|
|
2233
|
+
cellId,
|
|
2234
|
+
descending,
|
|
2235
|
+
offset,
|
|
2236
|
+
limit,
|
|
2237
|
+
sortedRowIds,
|
|
2238
|
+
);
|
|
2216
2239
|
}
|
|
2217
2240
|
},
|
|
2218
2241
|
sortedRowIdsListeners[mutator ? 1 : 0],
|
|
@@ -2266,6 +2289,7 @@ const createStore = () => {
|
|
|
2266
2289
|
descending,
|
|
2267
2290
|
offset = 0,
|
|
2268
2291
|
limit,
|
|
2292
|
+
sorter = defaultSorter,
|
|
2269
2293
|
) =>
|
|
2270
2294
|
isObject(tableIdOrArgs)
|
|
2271
2295
|
? getSortedRowIds(
|
|
@@ -2274,16 +2298,19 @@ const createStore = () => {
|
|
|
2274
2298
|
tableIdOrArgs.descending,
|
|
2275
2299
|
tableIdOrArgs.offset,
|
|
2276
2300
|
tableIdOrArgs.limit,
|
|
2301
|
+
tableIdOrArgs.sorter,
|
|
2277
2302
|
)
|
|
2278
2303
|
: arrayMap(
|
|
2279
2304
|
slice(
|
|
2280
2305
|
arraySort(
|
|
2281
2306
|
mapMap(mapGet(tablesMap, id(tableIdOrArgs)), (row, rowId) => [
|
|
2282
|
-
isUndefined(cellId)
|
|
2307
|
+
isUndefined(cellId)
|
|
2308
|
+
? rowId
|
|
2309
|
+
: decodeIfJson(mapGet(row, id(cellId))),
|
|
2283
2310
|
rowId,
|
|
2284
2311
|
]),
|
|
2285
2312
|
([cell1], [cell2]) =>
|
|
2286
|
-
|
|
2313
|
+
sorter(cell1, cell2) * (descending ? -1 : 1),
|
|
2287
2314
|
),
|
|
2288
2315
|
offset,
|
|
2289
2316
|
isUndefined(limit) ? limit : offset + limit,
|
|
@@ -2761,6 +2788,7 @@ const createStore = () => {
|
|
|
2761
2788
|
tableIdOrArgs.descending ?? false,
|
|
2762
2789
|
tableIdOrArgs.offset ?? 0,
|
|
2763
2790
|
tableIdOrArgs.limit,
|
|
2791
|
+
tableIdOrArgs.sorter,
|
|
2764
2792
|
],
|
|
2765
2793
|
cellIdOrListener,
|
|
2766
2794
|
descendingOrMutator,
|
|
@@ -2768,7 +2796,7 @@ const createStore = () => {
|
|
|
2768
2796
|
: addSortedRowIdsListenerImpl(
|
|
2769
2797
|
tableIdOrArgs,
|
|
2770
2798
|
cellIdOrListener,
|
|
2771
|
-
[descendingOrMutator, offset, limit],
|
|
2799
|
+
[descendingOrMutator, offset, limit, void 0],
|
|
2772
2800
|
listener,
|
|
2773
2801
|
mutator,
|
|
2774
2802
|
);
|
|
@@ -2206,13 +2206,36 @@ const createStore = () => {
|
|
|
2206
2206
|
listener,
|
|
2207
2207
|
mutator,
|
|
2208
2208
|
) => {
|
|
2209
|
-
|
|
2209
|
+
const [descending, offset, limit, sorter] = otherArgs;
|
|
2210
|
+
let sortedRowIds = getSortedRowIds(
|
|
2211
|
+
tableId,
|
|
2212
|
+
cellId,
|
|
2213
|
+
descending,
|
|
2214
|
+
offset,
|
|
2215
|
+
limit,
|
|
2216
|
+
sorter,
|
|
2217
|
+
);
|
|
2210
2218
|
return addListener(
|
|
2211
2219
|
() => {
|
|
2212
|
-
const newSortedRowIds = getSortedRowIds(
|
|
2220
|
+
const newSortedRowIds = getSortedRowIds(
|
|
2221
|
+
tableId,
|
|
2222
|
+
cellId,
|
|
2223
|
+
descending,
|
|
2224
|
+
offset,
|
|
2225
|
+
limit,
|
|
2226
|
+
sorter,
|
|
2227
|
+
);
|
|
2213
2228
|
if (!arrayIsEqual(newSortedRowIds, sortedRowIds)) {
|
|
2214
2229
|
sortedRowIds = newSortedRowIds;
|
|
2215
|
-
listener(
|
|
2230
|
+
listener(
|
|
2231
|
+
store,
|
|
2232
|
+
tableId,
|
|
2233
|
+
cellId,
|
|
2234
|
+
descending,
|
|
2235
|
+
offset,
|
|
2236
|
+
limit,
|
|
2237
|
+
sortedRowIds,
|
|
2238
|
+
);
|
|
2216
2239
|
}
|
|
2217
2240
|
},
|
|
2218
2241
|
sortedRowIdsListeners[mutator ? 1 : 0],
|
|
@@ -2266,6 +2289,7 @@ const createStore = () => {
|
|
|
2266
2289
|
descending,
|
|
2267
2290
|
offset = 0,
|
|
2268
2291
|
limit,
|
|
2292
|
+
sorter = defaultSorter,
|
|
2269
2293
|
) =>
|
|
2270
2294
|
isObject(tableIdOrArgs)
|
|
2271
2295
|
? getSortedRowIds(
|
|
@@ -2274,16 +2298,19 @@ const createStore = () => {
|
|
|
2274
2298
|
tableIdOrArgs.descending,
|
|
2275
2299
|
tableIdOrArgs.offset,
|
|
2276
2300
|
tableIdOrArgs.limit,
|
|
2301
|
+
tableIdOrArgs.sorter,
|
|
2277
2302
|
)
|
|
2278
2303
|
: arrayMap(
|
|
2279
2304
|
slice(
|
|
2280
2305
|
arraySort(
|
|
2281
2306
|
mapMap(mapGet(tablesMap, id(tableIdOrArgs)), (row, rowId) => [
|
|
2282
|
-
isUndefined(cellId)
|
|
2307
|
+
isUndefined(cellId)
|
|
2308
|
+
? rowId
|
|
2309
|
+
: decodeIfJson(mapGet(row, id(cellId))),
|
|
2283
2310
|
rowId,
|
|
2284
2311
|
]),
|
|
2285
2312
|
([cell1], [cell2]) =>
|
|
2286
|
-
|
|
2313
|
+
sorter(cell1, cell2) * (descending ? -1 : 1),
|
|
2287
2314
|
),
|
|
2288
2315
|
offset,
|
|
2289
2316
|
isUndefined(limit) ? limit : offset + limit,
|
|
@@ -2761,6 +2788,7 @@ const createStore = () => {
|
|
|
2761
2788
|
tableIdOrArgs.descending ?? false,
|
|
2762
2789
|
tableIdOrArgs.offset ?? 0,
|
|
2763
2790
|
tableIdOrArgs.limit,
|
|
2791
|
+
tableIdOrArgs.sorter,
|
|
2764
2792
|
],
|
|
2765
2793
|
cellIdOrListener,
|
|
2766
2794
|
descendingOrMutator,
|
|
@@ -2768,7 +2796,7 @@ const createStore = () => {
|
|
|
2768
2796
|
: addSortedRowIdsListenerImpl(
|
|
2769
2797
|
tableIdOrArgs,
|
|
2770
2798
|
cellIdOrListener,
|
|
2771
|
-
[descendingOrMutator, offset, limit],
|
|
2799
|
+
[descendingOrMutator, offset, limit, void 0],
|
|
2772
2800
|
listener,
|
|
2773
2801
|
mutator,
|
|
2774
2802
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.1.0-beta.1",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@automerge/automerge-repo": "^2.5.6",
|
|
27
|
-
"@cloudflare/workers-types": "^5.
|
|
27
|
+
"@cloudflare/workers-types": "^5.20260704.1",
|
|
28
28
|
"@electric-sql/pglite": "^0.5.4",
|
|
29
29
|
"@libsql/client": "^0.17.4",
|
|
30
30
|
"@powersync/common": "^1.57.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"bun": "^1.3.14",
|
|
36
36
|
"effect": "^3.21.4",
|
|
37
37
|
"electric-sql": "^0.12.1",
|
|
38
|
-
"expo": "^57.0.
|
|
38
|
+
"expo": "^57.0.2",
|
|
39
39
|
"expo-sqlite": "^57.0.0",
|
|
40
40
|
"partykit": "^0.0.115",
|
|
41
41
|
"partysocket": "^1.3.0",
|