tinybase 2.0.0 → 2.0.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/lib/common.js +1 -1
- package/lib/common.js.gz +0 -0
- package/lib/debug/common.js +1 -4
- package/lib/debug/metrics.d.ts +1 -1
- package/lib/debug/persisters.d.ts +5 -5
- package/lib/debug/relationships.d.ts +3 -3
- package/lib/debug/store.js +1 -1
- package/lib/debug/tinybase.js +1 -2
- package/lib/debug/ui-react.d.ts +17 -17
- package/lib/es6/checkpoints.d.ts +946 -0
- package/lib/es6/checkpoints.js +1 -0
- package/lib/es6/checkpoints.js.gz +0 -0
- package/lib/es6/common.d.ts +115 -0
- package/lib/es6/common.js +1 -0
- package/lib/es6/common.js.gz +0 -0
- package/lib/es6/indexes.d.ts +941 -0
- package/lib/es6/indexes.js +1 -0
- package/lib/es6/indexes.js.gz +0 -0
- package/lib/es6/metrics.d.ts +829 -0
- package/lib/es6/metrics.js +1 -0
- package/lib/es6/metrics.js.gz +0 -0
- package/lib/es6/persisters.d.ts +717 -0
- package/lib/es6/persisters.js +1 -0
- package/lib/es6/persisters.js.gz +0 -0
- package/lib/es6/queries.d.ts +3026 -0
- package/lib/es6/queries.js +1 -0
- package/lib/es6/queries.js.gz +0 -0
- package/lib/es6/relationships.d.ts +1203 -0
- package/lib/es6/relationships.js +1 -0
- package/lib/es6/relationships.js.gz +0 -0
- package/lib/es6/store.d.ts +3572 -0
- package/lib/es6/store.js +1 -0
- package/lib/es6/store.js.gz +0 -0
- package/lib/es6/tinybase.d.ts +14 -0
- package/lib/es6/tinybase.js +1 -0
- package/lib/es6/tinybase.js.gz +0 -0
- package/lib/es6/ui-react.d.ts +9777 -0
- package/lib/es6/ui-react.js +1 -0
- package/lib/es6/ui-react.js.gz +0 -0
- package/lib/metrics.d.ts +1 -1
- package/lib/persisters.d.ts +5 -5
- package/lib/relationships.d.ts +3 -3
- package/lib/store.js +1 -1
- package/lib/store.js.gz +0 -0
- package/lib/tinybase.js +1 -1
- package/lib/tinybase.js.gz +0 -0
- package/lib/ui-react.d.ts +17 -17
- package/lib/umd/checkpoints.d.ts +946 -0
- package/lib/umd/common.d.ts +115 -0
- package/lib/umd/common.js +1 -1
- package/lib/umd/common.js.gz +0 -0
- package/lib/umd/indexes.d.ts +941 -0
- package/lib/umd/metrics.d.ts +829 -0
- package/lib/umd/persisters.d.ts +717 -0
- package/lib/umd/queries.d.ts +3026 -0
- package/lib/umd/relationships.d.ts +1203 -0
- package/lib/umd/store.d.ts +3572 -0
- package/lib/umd/store.js +1 -1
- package/lib/umd/store.js.gz +0 -0
- package/lib/umd/tinybase.d.ts +14 -0
- package/lib/umd/tinybase.js +1 -1
- package/lib/umd/tinybase.js.gz +0 -0
- package/lib/umd/ui-react.d.ts +9777 -0
- package/lib/umd-es6/checkpoints.d.ts +946 -0
- package/lib/umd-es6/checkpoints.js +1 -0
- package/lib/umd-es6/checkpoints.js.gz +0 -0
- package/lib/umd-es6/common.d.ts +115 -0
- package/lib/umd-es6/common.js +1 -0
- package/lib/umd-es6/common.js.gz +0 -0
- package/lib/umd-es6/indexes.d.ts +941 -0
- package/lib/umd-es6/indexes.js +1 -0
- package/lib/umd-es6/indexes.js.gz +0 -0
- package/lib/umd-es6/metrics.d.ts +829 -0
- package/lib/umd-es6/metrics.js +1 -0
- package/lib/umd-es6/metrics.js.gz +0 -0
- package/lib/umd-es6/persisters.d.ts +717 -0
- package/lib/umd-es6/persisters.js +1 -0
- package/lib/umd-es6/persisters.js.gz +0 -0
- package/lib/umd-es6/queries.d.ts +3026 -0
- package/lib/umd-es6/queries.js +1 -0
- package/lib/umd-es6/queries.js.gz +0 -0
- package/lib/umd-es6/relationships.d.ts +1203 -0
- package/lib/umd-es6/relationships.js +1 -0
- package/lib/umd-es6/relationships.js.gz +0 -0
- package/lib/umd-es6/store.d.ts +3572 -0
- package/lib/umd-es6/store.js +1 -0
- package/lib/umd-es6/store.js.gz +0 -0
- package/lib/umd-es6/tinybase.d.ts +14 -0
- package/lib/umd-es6/tinybase.js +1 -0
- package/lib/umd-es6/tinybase.js.gz +0 -0
- package/lib/umd-es6/ui-react.d.ts +9777 -0
- package/lib/umd-es6/ui-react.js +1 -0
- package/lib/umd-es6/ui-react.js.gz +0 -0
- package/package.json +1 -1
- package/readme.md +1 -1
package/lib/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o=(o,t)=>o<t?-1:1
|
|
1
|
+
const o=(o,t)=>o<t?-1:1;export{o as defaultSorter};
|
package/lib/common.js.gz
CHANGED
|
Binary file
|
package/lib/debug/common.js
CHANGED
package/lib/debug/metrics.d.ts
CHANGED
|
@@ -210,7 +210,7 @@ export type MetricsListenerStats = {
|
|
|
210
210
|
*
|
|
211
211
|
* @example
|
|
212
212
|
* This example shows a very simple lifecycle of a Metrics object: from
|
|
213
|
-
* creation, to adding a definition, getting
|
|
213
|
+
* creation, to adding a definition, getting a Metric, and then registering and
|
|
214
214
|
* removing a listener for it.
|
|
215
215
|
*
|
|
216
216
|
* ```js
|
|
@@ -509,7 +509,7 @@ export interface Persister {
|
|
|
509
509
|
}
|
|
510
510
|
|
|
511
511
|
/**
|
|
512
|
-
* The createSessionPersister function creates
|
|
512
|
+
* The createSessionPersister function creates a Persister object that can
|
|
513
513
|
* persist the Store to the browser's session storage.
|
|
514
514
|
*
|
|
515
515
|
* As well as providing a reference to the Store to persist, you must provide a
|
|
@@ -542,7 +542,7 @@ export function createSessionPersister(
|
|
|
542
542
|
): Persister;
|
|
543
543
|
|
|
544
544
|
/**
|
|
545
|
-
* The createLocalPersister function creates
|
|
545
|
+
* The createLocalPersister function creates a Persister object that can
|
|
546
546
|
* persist the Store to the browser's local storage.
|
|
547
547
|
*
|
|
548
548
|
* As well as providing a reference to the Store to persist, you must provide a
|
|
@@ -575,7 +575,7 @@ export function createLocalPersister(
|
|
|
575
575
|
): Persister;
|
|
576
576
|
|
|
577
577
|
/**
|
|
578
|
-
* The createRemotePersister function creates
|
|
578
|
+
* The createRemotePersister function creates a Persister object that can
|
|
579
579
|
* persist the Store to a remote server.
|
|
580
580
|
*
|
|
581
581
|
* As well as providing a reference to the Store to persist, you must provide
|
|
@@ -624,7 +624,7 @@ export function createRemotePersister(
|
|
|
624
624
|
): Persister;
|
|
625
625
|
|
|
626
626
|
/**
|
|
627
|
-
* The createFilePersister function creates
|
|
627
|
+
* The createFilePersister function creates a Persister object that can persist
|
|
628
628
|
* the Store to a local file (in an appropriate environment).
|
|
629
629
|
*
|
|
630
630
|
* As well as providing a reference to the Store to persist, you must provide
|
|
@@ -654,7 +654,7 @@ export function createRemotePersister(
|
|
|
654
654
|
export function createFilePersister(store: Store, filePath: string): Persister;
|
|
655
655
|
|
|
656
656
|
/**
|
|
657
|
-
* The createCustomPersister function creates
|
|
657
|
+
* The createCustomPersister function creates a Persister object that you can
|
|
658
658
|
* configure to persist the Store in any way you wish.
|
|
659
659
|
*
|
|
660
660
|
* As well as providing a reference to the Store to persist, you must provide
|
|
@@ -1091,7 +1091,7 @@ export interface Relationships {
|
|
|
1091
1091
|
* the underlying Store are removed and it can be correctly garbage collected.
|
|
1092
1092
|
*
|
|
1093
1093
|
* @example
|
|
1094
|
-
* This example creates a Store, adds
|
|
1094
|
+
* This example creates a Store, adds a Relationships object with a
|
|
1095
1095
|
* definition (that registers a RowListener with the underlying Store),
|
|
1096
1096
|
* and then destroys it again, removing the listener.
|
|
1097
1097
|
*
|
|
@@ -1167,7 +1167,7 @@ export interface Relationships {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
|
|
1169
1169
|
/**
|
|
1170
|
-
* The createRelationships function creates
|
|
1170
|
+
* The createRelationships function creates a Relationships object, and is the
|
|
1171
1171
|
* main entry point into the relationships module.
|
|
1172
1172
|
*
|
|
1173
1173
|
* It is trivially simple.
|
|
@@ -1179,7 +1179,7 @@ export interface Relationships {
|
|
|
1179
1179
|
* @param store The Store for which to register Relationships.
|
|
1180
1180
|
* @returns A reference to the new Relationships object.
|
|
1181
1181
|
* @example
|
|
1182
|
-
* This example creates
|
|
1182
|
+
* This example creates a Relationships object.
|
|
1183
1183
|
*
|
|
1184
1184
|
* ```js
|
|
1185
1185
|
* const store = createStore();
|
package/lib/debug/store.js
CHANGED
|
@@ -16,6 +16,7 @@ const ROW_IDS = 'RowIds';
|
|
|
16
16
|
const ROW = 'Row';
|
|
17
17
|
const CELL_IDS = 'CellIds';
|
|
18
18
|
const CELL = 'Cell';
|
|
19
|
+
const id = (key) => EMPTY_STRING + key;
|
|
19
20
|
|
|
20
21
|
const arrayHas = (array, value) => array.includes(value);
|
|
21
22
|
const arrayEvery = (array, cb) => array.every(cb);
|
|
@@ -221,7 +222,6 @@ const setOrDelCell = (store, tableId, rowId, cellId, cell) =>
|
|
|
221
222
|
: store.setCell(tableId, rowId, cellId, cell);
|
|
222
223
|
|
|
223
224
|
const defaultSorter = (sortKey1, sortKey2) => (sortKey1 < sortKey2 ? -1 : 1);
|
|
224
|
-
const id = (key) => EMPTY_STRING + key;
|
|
225
225
|
|
|
226
226
|
const transformMap = (map, toBeLikeObject, setId, delId = mapSet) => {
|
|
227
227
|
const idsToDelete = arrayFilter(
|
package/lib/debug/tinybase.js
CHANGED
|
@@ -26,6 +26,7 @@ const SORTED_ROW_IDS = 'SortedRowIds';
|
|
|
26
26
|
const ROW = 'Row';
|
|
27
27
|
const CELL_IDS = 'CellIds';
|
|
28
28
|
const CELL = 'Cell';
|
|
29
|
+
const id = (key) => EMPTY_STRING + key;
|
|
29
30
|
|
|
30
31
|
const arrayHas = (array, value) => array.includes(value);
|
|
31
32
|
const arrayEvery = (array, cb) => array.every(cb);
|
|
@@ -587,7 +588,6 @@ const createCheckpoints = getCreateFunction((store) => {
|
|
|
587
588
|
});
|
|
588
589
|
|
|
589
590
|
const defaultSorter = (sortKey1, sortKey2) => (sortKey1 < sortKey2 ? -1 : 1);
|
|
590
|
-
const id = (key) => EMPTY_STRING + key;
|
|
591
591
|
|
|
592
592
|
const createIndexes = getCreateFunction((store) => {
|
|
593
593
|
const sliceIdsListeners = mapNew();
|
|
@@ -2546,5 +2546,4 @@ export {
|
|
|
2546
2546
|
createSessionPersister,
|
|
2547
2547
|
createStore,
|
|
2548
2548
|
defaultSorter,
|
|
2549
|
-
id,
|
|
2550
2549
|
};
|
package/lib/debug/ui-react.d.ts
CHANGED
|
@@ -285,7 +285,7 @@ export function useCreateStore(
|
|
|
285
285
|
* component.
|
|
286
286
|
*
|
|
287
287
|
* The useStore hook lets you either get a reference to the default Store (when
|
|
288
|
-
* called without
|
|
288
|
+
* called without a parameter), or one of the Store objects that are named by
|
|
289
289
|
* Id (when called with an Id parameter).
|
|
290
290
|
*
|
|
291
291
|
* @param id An optional Id for accessing a Store that was named with an Id in
|
|
@@ -2551,7 +2551,7 @@ export function useCreateMetrics(
|
|
|
2551
2551
|
* through every component.
|
|
2552
2552
|
*
|
|
2553
2553
|
* The useMetrics hook lets you either get a reference to the default Metrics
|
|
2554
|
-
* object (when called without
|
|
2554
|
+
* object (when called without a parameter), or one of the Metrics objects that
|
|
2555
2555
|
* are named by Id (when called with an Id parameter).
|
|
2556
2556
|
*
|
|
2557
2557
|
* @param id An optional Id for accessing a Metrics object that was named with
|
|
@@ -2903,7 +2903,7 @@ export function useCreateIndexes(
|
|
|
2903
2903
|
* through every component.
|
|
2904
2904
|
*
|
|
2905
2905
|
* The useIndexes hook lets you either get a reference to the default Indexes
|
|
2906
|
-
* object (when called without
|
|
2906
|
+
* object (when called without a parameter), or one of the Indexes objects that
|
|
2907
2907
|
* are named by Id (when called with an Id parameter).
|
|
2908
2908
|
*
|
|
2909
2909
|
* @param id An optional Id for accessing an Indexes object that was named with
|
|
@@ -3463,7 +3463,7 @@ export function useCreateRelationships(
|
|
|
3463
3463
|
* props through every component.
|
|
3464
3464
|
*
|
|
3465
3465
|
* The useRelationships hook lets you either get a reference to the default
|
|
3466
|
-
* Relationships object (when called without
|
|
3466
|
+
* Relationships object (when called without a parameter), or one of the
|
|
3467
3467
|
* Relationships objects that are named by Id (when called with an Id
|
|
3468
3468
|
* parameter).
|
|
3469
3469
|
*
|
|
@@ -4257,7 +4257,7 @@ export function useCreateQueries(
|
|
|
4257
4257
|
* through every component.
|
|
4258
4258
|
*
|
|
4259
4259
|
* The useQueries hook lets you either get a reference to the default Queries
|
|
4260
|
-
* object (when called without
|
|
4260
|
+
* object (when called without a parameter), or one of the Queries objects that
|
|
4261
4261
|
* are named by Id (when called with an Id parameter).
|
|
4262
4262
|
*
|
|
4263
4263
|
* @param id An optional Id for accessing a Queries object that was named with
|
|
@@ -5695,7 +5695,7 @@ export function useCreateCheckpoints(
|
|
|
5695
5695
|
* props through every component.
|
|
5696
5696
|
*
|
|
5697
5697
|
* The useCheckpoints hook lets you either get a reference to the default
|
|
5698
|
-
* Checkpoints object (when called without
|
|
5698
|
+
* Checkpoints object (when called without a parameter), or one of the
|
|
5699
5699
|
* Checkpoints objects that are named by Id (when called with an Id parameter).
|
|
5700
5700
|
*
|
|
5701
5701
|
* @param id An optional Id for accessing a Checkpoints object that was named
|
|
@@ -6876,7 +6876,7 @@ export type SliceProps = {
|
|
|
6876
6876
|
|
|
6877
6877
|
/**
|
|
6878
6878
|
* RemoteRowProps props are used for components that refer to a single
|
|
6879
|
-
* Relationship in
|
|
6879
|
+
* Relationship in a Relationships object, and where you want to render a
|
|
6880
6880
|
* remote Row based on a local Row, such as in the RemoteRowView component.
|
|
6881
6881
|
*
|
|
6882
6882
|
* @category Props
|
|
@@ -6915,7 +6915,7 @@ export type RemoteRowProps = {
|
|
|
6915
6915
|
|
|
6916
6916
|
/**
|
|
6917
6917
|
* LocalRowsProps props are used for components that refer to a single
|
|
6918
|
-
* Relationship in
|
|
6918
|
+
* Relationship in a Relationships object, and where you want to render local
|
|
6919
6919
|
* Rows based on a remote Row, such as the LocalRowsView component.
|
|
6920
6920
|
*
|
|
6921
6921
|
* @category Props
|
|
@@ -6958,7 +6958,7 @@ export type LocalRowsProps = {
|
|
|
6958
6958
|
|
|
6959
6959
|
/**
|
|
6960
6960
|
* LinkedRowsProps props are used for components that refer to a single
|
|
6961
|
-
* Relationship in
|
|
6961
|
+
* Relationship in a Relationships object, and where you want to render a
|
|
6962
6962
|
* linked list of Rows starting from a first Row, such as the LinkedRowsView
|
|
6963
6963
|
* component.
|
|
6964
6964
|
*
|
|
@@ -7177,7 +7177,7 @@ export type ResultCellProps = {
|
|
|
7177
7177
|
|
|
7178
7178
|
/**
|
|
7179
7179
|
* CheckpointProps props are used for components that refer to a single
|
|
7180
|
-
* checkpoint in
|
|
7180
|
+
* checkpoint in a Checkpoints object, such as the CheckpointView component.
|
|
7181
7181
|
*
|
|
7182
7182
|
* @category Props
|
|
7183
7183
|
*/
|
|
@@ -8406,7 +8406,7 @@ export function IndexView(props: IndexProps): ComponentReturnType;
|
|
|
8406
8406
|
* @param props The props for this component.
|
|
8407
8407
|
* @returns A rendering of the remote Row, or nothing, if not present.
|
|
8408
8408
|
* @example
|
|
8409
|
-
* This example creates
|
|
8409
|
+
* This example creates a Relationships object outside the application, which
|
|
8410
8410
|
* is used in the RemoteRowView component by reference. A change to the Row Ids
|
|
8411
8411
|
* re-renders the component.
|
|
8412
8412
|
*
|
|
@@ -8538,7 +8538,7 @@ export function RemoteRowView(props: RemoteRowProps): ComponentReturnType;
|
|
|
8538
8538
|
* @param props The props for this component.
|
|
8539
8539
|
* @returns A rendering of the local Row objects, or nothing, if not present.
|
|
8540
8540
|
* @example
|
|
8541
|
-
* This example creates
|
|
8541
|
+
* This example creates a Relationships object outside the application, which
|
|
8542
8542
|
* is used in the LocalRowsView component by reference. A change to the Row Ids
|
|
8543
8543
|
* re-renders the component.
|
|
8544
8544
|
*
|
|
@@ -8671,7 +8671,7 @@ export function LocalRowsView(props: LocalRowsProps): ComponentReturnType;
|
|
|
8671
8671
|
* @param props The props for this component.
|
|
8672
8672
|
* @returns A rendering of the local Row objects, or nothing, if not present.
|
|
8673
8673
|
* @example
|
|
8674
|
-
* This example creates
|
|
8674
|
+
* This example creates a Relationships object outside the application, which
|
|
8675
8675
|
* is used in the LinkedRowsView component by reference. A change to the Row Ids
|
|
8676
8676
|
* re-renders the component.
|
|
8677
8677
|
*
|
|
@@ -9335,7 +9335,7 @@ export function ResultTableView(props: ResultTableProps): ComponentReturnType;
|
|
|
9335
9335
|
* @param props The props for this component.
|
|
9336
9336
|
* @returns A rendering of the checkpoint: its label if present, or Id.
|
|
9337
9337
|
* @example
|
|
9338
|
-
* This example creates
|
|
9338
|
+
* This example creates a Checkpoints object outside the application, which is
|
|
9339
9339
|
* used in the CheckpointView component by reference to render a checkpoint with
|
|
9340
9340
|
* a label (with its Id for readability).
|
|
9341
9341
|
*
|
|
@@ -9392,7 +9392,7 @@ export function CheckpointView(props: CheckpointProps): ComponentReturnType;
|
|
|
9392
9392
|
* @param props The props for this component.
|
|
9393
9393
|
* @returns A rendering of the previous checkpoints, if present.
|
|
9394
9394
|
* @example
|
|
9395
|
-
* This example creates
|
|
9395
|
+
* This example creates a Checkpoints object outside the application, which is
|
|
9396
9396
|
* used in the BackwardCheckpointsView component by reference to render a list
|
|
9397
9397
|
* of previous checkpoints.
|
|
9398
9398
|
*
|
|
@@ -9526,7 +9526,7 @@ export function BackwardCheckpointsView(
|
|
|
9526
9526
|
* @param props The props for this component.
|
|
9527
9527
|
* @returns A rendering of the current checkpoint, if present.
|
|
9528
9528
|
* @example
|
|
9529
|
-
* This example creates
|
|
9529
|
+
* This example creates a Checkpoints object outside the application, which is
|
|
9530
9530
|
* used in the CurrentCheckpointView component by reference to render the
|
|
9531
9531
|
* current checkpoints.
|
|
9532
9532
|
*
|
|
@@ -9662,7 +9662,7 @@ export function CurrentCheckpointView(
|
|
|
9662
9662
|
* @param props The props for this component.
|
|
9663
9663
|
* @returns A rendering of the future checkpoints, if present.
|
|
9664
9664
|
* @example
|
|
9665
|
-
* This example creates
|
|
9665
|
+
* This example creates a Checkpoints object outside the application, which is
|
|
9666
9666
|
* used in the ForwardCheckpointsView component by reference to render a list
|
|
9667
9667
|
* of future checkpoints.
|
|
9668
9668
|
*
|