tinybase 5.4.0 → 5.4.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/mergeable-store/index.d.cts +5 -2
- package/@types/mergeable-store/index.d.ts +5 -2
- package/@types/mergeable-store/with-schemas/index.d.cts +8 -3
- package/@types/mergeable-store/with-schemas/index.d.ts +8 -3
- package/@types/persisters/index.d.cts +6 -2
- package/@types/persisters/index.d.ts +6 -2
- package/@types/persisters/with-schemas/index.d.cts +12 -4
- package/@types/persisters/with-schemas/index.d.ts +12 -4
- package/@types/store/index.d.cts +20 -2
- package/@types/store/index.d.ts +20 -2
- package/@types/store/with-schemas/index.d.cts +23 -3
- package/@types/store/with-schemas/index.d.ts +23 -3
- package/@types/synchronizers/synchronizer-ws-server/index.d.cts +5 -2
- package/@types/synchronizers/synchronizer-ws-server/index.d.ts +5 -2
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.cts +5 -2
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +5 -2
- package/@types/ui-react/index.d.cts +42 -0
- package/@types/ui-react/index.d.ts +42 -0
- package/@types/ui-react/with-schemas/index.d.cts +48 -0
- package/@types/ui-react/with-schemas/index.d.ts +48 -0
- package/cjs/es6/index.cjs +6 -3
- package/cjs/es6/mergeable-store/index.cjs +6 -3
- package/cjs/es6/mergeable-store/with-schemas/index.cjs +6 -3
- package/cjs/es6/min/index.cjs +1 -1
- package/cjs/es6/min/index.cjs.gz +0 -0
- package/cjs/es6/min/mergeable-store/index.cjs +1 -1
- package/cjs/es6/min/mergeable-store/index.cjs.gz +0 -0
- package/cjs/es6/min/mergeable-store/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/store/index.cjs +1 -1
- package/cjs/es6/min/store/index.cjs.gz +0 -0
- package/cjs/es6/min/store/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/store/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/index.cjs +1 -1
- package/cjs/es6/min/ui-react/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-inspector/index.cjs +1 -1
- package/cjs/es6/min/ui-react-inspector/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/store/index.cjs +6 -3
- package/cjs/es6/store/with-schemas/index.cjs +6 -3
- package/cjs/es6/ui-react/index.cjs +26 -0
- package/cjs/es6/ui-react/with-schemas/index.cjs +26 -0
- package/cjs/es6/ui-react-inspector/index.cjs +6 -3
- package/cjs/es6/ui-react-inspector/with-schemas/index.cjs +6 -3
- package/cjs/es6/with-schemas/index.cjs +6 -3
- package/cjs/index.cjs +6 -3
- package/cjs/mergeable-store/index.cjs +6 -3
- package/cjs/mergeable-store/with-schemas/index.cjs +6 -3
- package/cjs/min/index.cjs +1 -1
- package/cjs/min/index.cjs.gz +0 -0
- package/cjs/min/mergeable-store/index.cjs +1 -1
- package/cjs/min/mergeable-store/index.cjs.gz +0 -0
- package/cjs/min/mergeable-store/with-schemas/index.cjs +1 -1
- package/cjs/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/store/index.cjs +1 -1
- package/cjs/min/store/index.cjs.gz +0 -0
- package/cjs/min/store/with-schemas/index.cjs +1 -1
- package/cjs/min/store/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react/index.cjs +1 -1
- package/cjs/min/ui-react/index.cjs.gz +0 -0
- package/cjs/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react-inspector/index.cjs +1 -1
- package/cjs/min/ui-react-inspector/index.cjs.gz +0 -0
- package/cjs/min/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/with-schemas/index.cjs +1 -1
- package/cjs/min/with-schemas/index.cjs.gz +0 -0
- package/cjs/store/index.cjs +6 -3
- package/cjs/store/with-schemas/index.cjs +6 -3
- package/cjs/ui-react/index.cjs +3 -0
- package/cjs/ui-react/with-schemas/index.cjs +3 -0
- package/cjs/ui-react-inspector/index.cjs +6 -3
- package/cjs/ui-react-inspector/with-schemas/index.cjs +6 -3
- package/cjs/with-schemas/index.cjs +6 -3
- package/es6/index.js +6 -3
- package/es6/mergeable-store/index.js +6 -3
- package/es6/mergeable-store/with-schemas/index.js +6 -3
- package/es6/min/index.js +1 -1
- package/es6/min/index.js.gz +0 -0
- package/es6/min/mergeable-store/index.js +1 -1
- package/es6/min/mergeable-store/index.js.gz +0 -0
- package/es6/min/mergeable-store/with-schemas/index.js +1 -1
- package/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/es6/min/store/index.js +1 -1
- package/es6/min/store/index.js.gz +0 -0
- package/es6/min/store/with-schemas/index.js +1 -1
- package/es6/min/store/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react/index.js +1 -1
- package/es6/min/ui-react/index.js.gz +0 -0
- package/es6/min/ui-react/with-schemas/index.js +1 -1
- package/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/index.js +1 -1
- package/es6/min/ui-react-inspector/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/es6/min/with-schemas/index.js +1 -1
- package/es6/min/with-schemas/index.js.gz +0 -0
- package/es6/store/index.js +6 -3
- package/es6/store/with-schemas/index.js +6 -3
- package/es6/ui-react/index.js +26 -0
- package/es6/ui-react/with-schemas/index.js +26 -0
- package/es6/ui-react-inspector/index.js +6 -3
- package/es6/ui-react-inspector/with-schemas/index.js +6 -3
- package/es6/with-schemas/index.js +6 -3
- package/index.js +6 -3
- package/mergeable-store/index.js +6 -3
- package/mergeable-store/with-schemas/index.js +6 -3
- 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/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-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/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/package.json +5 -5
- package/readme.md +14 -14
- package/releases.md +25 -25
- package/store/index.js +6 -3
- package/store/with-schemas/index.js +6 -3
- package/ui-react/index.js +3 -0
- package/ui-react/with-schemas/index.js +3 -0
- package/ui-react-inspector/index.js +6 -3
- package/ui-react-inspector/with-schemas/index.js +6 -3
- package/umd/es6/index.js +6 -3
- package/umd/es6/mergeable-store/index.js +6 -3
- package/umd/es6/mergeable-store/with-schemas/index.js +6 -3
- package/umd/es6/min/index.js +1 -1
- package/umd/es6/min/index.js.gz +0 -0
- package/umd/es6/min/mergeable-store/index.js +1 -1
- package/umd/es6/min/mergeable-store/index.js.gz +0 -0
- package/umd/es6/min/mergeable-store/with-schemas/index.js +1 -1
- package/umd/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/store/index.js +1 -1
- package/umd/es6/min/store/index.js.gz +0 -0
- package/umd/es6/min/store/with-schemas/index.js +1 -1
- package/umd/es6/min/store/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react/index.js +1 -1
- package/umd/es6/min/ui-react/index.js.gz +0 -0
- package/umd/es6/min/ui-react/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react-inspector/index.js +1 -1
- package/umd/es6/min/ui-react-inspector/index.js.gz +0 -0
- package/umd/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/with-schemas/index.js +1 -1
- package/umd/es6/min/with-schemas/index.js.gz +0 -0
- package/umd/es6/store/index.js +6 -3
- package/umd/es6/store/with-schemas/index.js +6 -3
- package/umd/es6/ui-react/index.js +26 -0
- package/umd/es6/ui-react/with-schemas/index.js +26 -0
- package/umd/es6/ui-react-inspector/index.js +6 -3
- package/umd/es6/ui-react-inspector/with-schemas/index.js +6 -3
- package/umd/es6/with-schemas/index.js +6 -3
- package/umd/index.js +6 -3
- package/umd/mergeable-store/index.js +6 -3
- package/umd/mergeable-store/with-schemas/index.js +6 -3
- package/umd/min/index.js +1 -1
- package/umd/min/index.js.gz +0 -0
- package/umd/min/mergeable-store/index.js +1 -1
- package/umd/min/mergeable-store/index.js.gz +0 -0
- package/umd/min/mergeable-store/with-schemas/index.js +1 -1
- package/umd/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/umd/min/store/index.js +1 -1
- package/umd/min/store/index.js.gz +0 -0
- package/umd/min/store/with-schemas/index.js +1 -1
- package/umd/min/store/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react/index.js +1 -1
- package/umd/min/ui-react/index.js.gz +0 -0
- package/umd/min/ui-react/with-schemas/index.js +1 -1
- package/umd/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react-inspector/index.js +1 -1
- package/umd/min/ui-react-inspector/index.js.gz +0 -0
- package/umd/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/umd/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/umd/min/with-schemas/index.js +1 -1
- package/umd/min/with-schemas/index.js.gz +0 -0
- package/umd/store/index.js +6 -3
- package/umd/store/with-schemas/index.js +6 -3
- package/umd/ui-react/index.js +3 -0
- package/umd/ui-react/with-schemas/index.js +3 -0
- package/umd/ui-react-inspector/index.js +6 -3
- package/umd/ui-react-inspector/with-schemas/index.js +6 -3
- package/umd/with-schemas/index.js +6 -3
- package/with-schemas/index.js +6 -3
|
@@ -1066,9 +1066,12 @@
|
|
|
1066
1066
|
const getSchemaJson = () =>
|
|
1067
1067
|
jsonStringWithMap([tablesSchemaMap, valuesSchemaMap]);
|
|
1068
1068
|
const setContent = (content) =>
|
|
1069
|
-
fluentTransaction(() =>
|
|
1070
|
-
|
|
1071
|
-
|
|
1069
|
+
fluentTransaction(() => {
|
|
1070
|
+
const content2 = isFunction(content) ? content() : content;
|
|
1071
|
+
if (validateContent(content2)) {
|
|
1072
|
+
setValidContent(content2);
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1072
1075
|
const setTables = (tables) =>
|
|
1073
1076
|
fluentTransaction(() =>
|
|
1074
1077
|
validateTables(tables) ? setValidTables(tables) : 0,
|
package/umd/ui-react/index.js
CHANGED
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
? objGet(contextValue[offset * 2 + 1] ?? {}, id)
|
|
152
152
|
: id;
|
|
153
153
|
};
|
|
154
|
+
const useThings = (offset) => ({...useContext(Context)[offset * 2 + 1]});
|
|
154
155
|
const useThingOrThingById = (thingOrThingId, offset) => {
|
|
155
156
|
const thing = useThing(thingOrThingId, offset);
|
|
156
157
|
return isUndefined(thingOrThingId) || isString(thingOrThingId)
|
|
@@ -168,6 +169,7 @@
|
|
|
168
169
|
objIds(useContext(Context)[offset * 2 + 1] ?? {});
|
|
169
170
|
const useStoreIds = () => useThingIds(0 /* Store */);
|
|
170
171
|
const useStore = (id) => useThing(id, 0 /* Store */);
|
|
172
|
+
const useStores = () => useThings(0 /* Store */);
|
|
171
173
|
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
172
174
|
useThingOrThingById(storeOrStoreId, 0 /* Store */);
|
|
173
175
|
const useProvideStore = (storeId, store) =>
|
|
@@ -2256,6 +2258,7 @@
|
|
|
2256
2258
|
exports.useStore = useStore;
|
|
2257
2259
|
exports.useStoreIds = useStoreIds;
|
|
2258
2260
|
exports.useStoreOrStoreById = useStoreOrStoreById;
|
|
2261
|
+
exports.useStores = useStores;
|
|
2259
2262
|
exports.useSynchronizer = useSynchronizer;
|
|
2260
2263
|
exports.useSynchronizerIds = useSynchronizerIds;
|
|
2261
2264
|
exports.useSynchronizerOrSynchronizerById = useSynchronizerOrSynchronizerById;
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
? objGet(contextValue[offset * 2 + 1] ?? {}, id)
|
|
152
152
|
: id;
|
|
153
153
|
};
|
|
154
|
+
const useThings = (offset) => ({...useContext(Context)[offset * 2 + 1]});
|
|
154
155
|
const useThingOrThingById = (thingOrThingId, offset) => {
|
|
155
156
|
const thing = useThing(thingOrThingId, offset);
|
|
156
157
|
return isUndefined(thingOrThingId) || isString(thingOrThingId)
|
|
@@ -168,6 +169,7 @@
|
|
|
168
169
|
objIds(useContext(Context)[offset * 2 + 1] ?? {});
|
|
169
170
|
const useStoreIds = () => useThingIds(0 /* Store */);
|
|
170
171
|
const useStore = (id) => useThing(id, 0 /* Store */);
|
|
172
|
+
const useStores = () => useThings(0 /* Store */);
|
|
171
173
|
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
172
174
|
useThingOrThingById(storeOrStoreId, 0 /* Store */);
|
|
173
175
|
const useProvideStore = (storeId, store) =>
|
|
@@ -2256,6 +2258,7 @@
|
|
|
2256
2258
|
exports.useStore = useStore;
|
|
2257
2259
|
exports.useStoreIds = useStoreIds;
|
|
2258
2260
|
exports.useStoreOrStoreById = useStoreOrStoreById;
|
|
2261
|
+
exports.useStores = useStores;
|
|
2259
2262
|
exports.useSynchronizer = useSynchronizer;
|
|
2260
2263
|
exports.useSynchronizerIds = useSynchronizerIds;
|
|
2261
2264
|
exports.useSynchronizerOrSynchronizerById = useSynchronizerOrSynchronizerById;
|
|
@@ -2739,9 +2739,12 @@
|
|
|
2739
2739
|
const getSchemaJson = () =>
|
|
2740
2740
|
jsonStringWithMap([tablesSchemaMap, valuesSchemaMap]);
|
|
2741
2741
|
const setContent = (content) =>
|
|
2742
|
-
fluentTransaction(() =>
|
|
2743
|
-
|
|
2744
|
-
|
|
2742
|
+
fluentTransaction(() => {
|
|
2743
|
+
const content2 = isFunction(content) ? content() : content;
|
|
2744
|
+
if (validateContent(content2)) {
|
|
2745
|
+
setValidContent(content2);
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2745
2748
|
const setTables = (tables) =>
|
|
2746
2749
|
fluentTransaction(() =>
|
|
2747
2750
|
validateTables(tables) ? setValidTables(tables) : 0,
|
|
@@ -2739,9 +2739,12 @@
|
|
|
2739
2739
|
const getSchemaJson = () =>
|
|
2740
2740
|
jsonStringWithMap([tablesSchemaMap, valuesSchemaMap]);
|
|
2741
2741
|
const setContent = (content) =>
|
|
2742
|
-
fluentTransaction(() =>
|
|
2743
|
-
|
|
2744
|
-
|
|
2742
|
+
fluentTransaction(() => {
|
|
2743
|
+
const content2 = isFunction(content) ? content() : content;
|
|
2744
|
+
if (validateContent(content2)) {
|
|
2745
|
+
setValidContent(content2);
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2745
2748
|
const setTables = (tables) =>
|
|
2746
2749
|
fluentTransaction(() =>
|
|
2747
2750
|
validateTables(tables) ? setValidTables(tables) : 0,
|
|
@@ -2635,9 +2635,12 @@
|
|
|
2635
2635
|
const getSchemaJson = () =>
|
|
2636
2636
|
jsonStringWithMap([tablesSchemaMap, valuesSchemaMap]);
|
|
2637
2637
|
const setContent = (content) =>
|
|
2638
|
-
fluentTransaction(() =>
|
|
2639
|
-
|
|
2640
|
-
|
|
2638
|
+
fluentTransaction(() => {
|
|
2639
|
+
const content2 = isFunction(content) ? content() : content;
|
|
2640
|
+
if (validateContent(content2)) {
|
|
2641
|
+
setValidContent(content2);
|
|
2642
|
+
}
|
|
2643
|
+
});
|
|
2641
2644
|
const setTables = (tables) =>
|
|
2642
2645
|
fluentTransaction(() =>
|
|
2643
2646
|
validateTables(tables) ? setValidTables(tables) : 0,
|
package/with-schemas/index.js
CHANGED
|
@@ -2572,9 +2572,12 @@ const createStore = () => {
|
|
|
2572
2572
|
const getSchemaJson = () =>
|
|
2573
2573
|
jsonStringWithMap([tablesSchemaMap, valuesSchemaMap]);
|
|
2574
2574
|
const setContent = (content) =>
|
|
2575
|
-
fluentTransaction(() =>
|
|
2576
|
-
|
|
2577
|
-
|
|
2575
|
+
fluentTransaction(() => {
|
|
2576
|
+
const content2 = isFunction(content) ? content() : content;
|
|
2577
|
+
if (validateContent(content2)) {
|
|
2578
|
+
setValidContent(content2);
|
|
2579
|
+
}
|
|
2580
|
+
});
|
|
2578
2581
|
const setTables = (tables) =>
|
|
2579
2582
|
fluentTransaction(() =>
|
|
2580
2583
|
validateTables(tables) ? setValidTables(tables) : 0,
|