tinybase 5.3.0-beta.0 → 5.3.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/index.d.cts +0 -2
- package/@types/index.d.ts +0 -2
- package/@types/persisters/persister-partykit-client/index.d.cts +2 -2
- package/@types/persisters/persister-partykit-client/index.d.ts +2 -2
- package/@types/persisters/persister-partykit-client/with-schemas/index.d.cts +2 -2
- package/@types/persisters/persister-partykit-client/with-schemas/index.d.ts +2 -2
- package/@types/ui-react/index.d.cts +88 -0
- package/@types/ui-react/index.d.ts +88 -0
- package/@types/ui-react/with-schemas/index.d.cts +21 -0
- package/@types/ui-react/with-schemas/index.d.ts +21 -0
- package/@types/with-schemas/index.d.cts +0 -2
- package/@types/with-schemas/index.d.ts +0 -2
- 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/ui-react/index.cjs +99 -30
- package/cjs/es6/ui-react/with-schemas/index.cjs +99 -30
- package/cjs/es6/ui-react-inspector/index.cjs +1 -1
- package/cjs/es6/ui-react-inspector/with-schemas/index.cjs +1 -1
- 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/ui-react/index.cjs +73 -31
- package/cjs/ui-react/with-schemas/index.cjs +73 -31
- package/cjs/ui-react-inspector/index.cjs +1 -1
- package/cjs/ui-react-inspector/with-schemas/index.cjs +1 -1
- 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/ui-react/index.js +99 -30
- package/es6/ui-react/with-schemas/index.js +99 -30
- package/es6/ui-react-inspector/index.js +1 -1
- package/es6/ui-react-inspector/with-schemas/index.js +1 -1
- 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/package.json +2 -2
- package/readme.md +14 -14
- package/releases.md +24 -24
- package/ui-react/index.js +73 -31
- package/ui-react/with-schemas/index.js +73 -31
- package/ui-react-inspector/index.js +1 -1
- package/ui-react-inspector/with-schemas/index.js +1 -1
- 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/ui-react/index.js +102 -34
- package/umd/es6/ui-react/with-schemas/index.js +102 -34
- package/umd/es6/ui-react-inspector/index.js +2 -1
- package/umd/es6/ui-react-inspector/with-schemas/index.js +2 -1
- 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/ui-react/index.js +77 -31
- package/umd/ui-react/with-schemas/index.js +77 -31
- package/umd/ui-react-inspector/index.js +2 -1
- package/umd/ui-react-inspector/with-schemas/index.js +2 -1
package/@types/index.d.cts
CHANGED
|
@@ -11,8 +11,6 @@ export * from './checkpoints/index.d.cts';
|
|
|
11
11
|
export * from './common/index.d.cts';
|
|
12
12
|
export * from './indexes/index.d.cts';
|
|
13
13
|
export * from './metrics/index.d.cts';
|
|
14
|
-
export * from './persisters/index.d.cts';
|
|
15
|
-
export * from './synchronizers/index.d.cts';
|
|
16
14
|
export * from './queries/index.d.cts';
|
|
17
15
|
export * from './relationships/index.d.cts';
|
|
18
16
|
export * from './mergeable-store/index.d.cts';
|
package/@types/index.d.ts
CHANGED
|
@@ -11,8 +11,6 @@ export * from './checkpoints/index.d.ts';
|
|
|
11
11
|
export * from './common/index.d.ts';
|
|
12
12
|
export * from './indexes/index.d.ts';
|
|
13
13
|
export * from './metrics/index.d.ts';
|
|
14
|
-
export * from './persisters/index.d.ts';
|
|
15
|
-
export * from './synchronizers/index.d.ts';
|
|
16
14
|
export * from './queries/index.d.ts';
|
|
17
15
|
export * from './relationships/index.d.ts';
|
|
18
16
|
export * from './mergeable-store/index.d.ts';
|
|
@@ -46,7 +46,7 @@ export interface PartyKitPersister extends Persister {
|
|
|
46
46
|
* then gets the PartySocket back out again.
|
|
47
47
|
*
|
|
48
48
|
* ```js yolo
|
|
49
|
-
* import PartySocket from 'partysocket';
|
|
49
|
+
* import {PartySocket} from 'partysocket';
|
|
50
50
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
51
51
|
* import {createStore} from 'tinybase';
|
|
52
52
|
*
|
|
@@ -166,7 +166,7 @@ export type PartyKitPersisterConfig = {
|
|
|
166
166
|
* browser's IndexedDB storage.
|
|
167
167
|
*
|
|
168
168
|
* ```js yolo
|
|
169
|
-
* import PartySocket from 'partysocket';
|
|
169
|
+
* import {PartySocket} from 'partysocket';
|
|
170
170
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
171
171
|
* import {createStore} from 'tinybase';
|
|
172
172
|
*
|
|
@@ -46,7 +46,7 @@ export interface PartyKitPersister extends Persister {
|
|
|
46
46
|
* then gets the PartySocket back out again.
|
|
47
47
|
*
|
|
48
48
|
* ```js yolo
|
|
49
|
-
* import PartySocket from 'partysocket';
|
|
49
|
+
* import {PartySocket} from 'partysocket';
|
|
50
50
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
51
51
|
* import {createStore} from 'tinybase';
|
|
52
52
|
*
|
|
@@ -166,7 +166,7 @@ export type PartyKitPersisterConfig = {
|
|
|
166
166
|
* browser's IndexedDB storage.
|
|
167
167
|
*
|
|
168
168
|
* ```js yolo
|
|
169
|
-
* import PartySocket from 'partysocket';
|
|
169
|
+
* import {PartySocket} from 'partysocket';
|
|
170
170
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
171
171
|
* import {createStore} from 'tinybase';
|
|
172
172
|
*
|
|
@@ -50,7 +50,7 @@ export interface PartyKitPersister<Schemas extends OptionalSchemas>
|
|
|
50
50
|
* then gets the PartySocket back out again.
|
|
51
51
|
*
|
|
52
52
|
* ```js yolo
|
|
53
|
-
* import PartySocket from 'partysocket';
|
|
53
|
+
* import {PartySocket} from 'partysocket';
|
|
54
54
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
55
55
|
* import {createStore} from 'tinybase';
|
|
56
56
|
*
|
|
@@ -181,7 +181,7 @@ export type PartyKitPersisterConfig = {
|
|
|
181
181
|
* browser's IndexedDB storage.
|
|
182
182
|
*
|
|
183
183
|
* ```js yolo
|
|
184
|
-
* import PartySocket from 'partysocket';
|
|
184
|
+
* import {PartySocket} from 'partysocket';
|
|
185
185
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
186
186
|
* import {createStore} from 'tinybase';
|
|
187
187
|
*
|
|
@@ -50,7 +50,7 @@ export interface PartyKitPersister<Schemas extends OptionalSchemas>
|
|
|
50
50
|
* then gets the PartySocket back out again.
|
|
51
51
|
*
|
|
52
52
|
* ```js yolo
|
|
53
|
-
* import PartySocket from 'partysocket';
|
|
53
|
+
* import {PartySocket} from 'partysocket';
|
|
54
54
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
55
55
|
* import {createStore} from 'tinybase';
|
|
56
56
|
*
|
|
@@ -181,7 +181,7 @@ export type PartyKitPersisterConfig = {
|
|
|
181
181
|
* browser's IndexedDB storage.
|
|
182
182
|
*
|
|
183
183
|
* ```js yolo
|
|
184
|
-
* import PartySocket from 'partysocket';
|
|
184
|
+
* import {PartySocket} from 'partysocket';
|
|
185
185
|
* import {createPartyKitPersister} from 'tinybase/persisters/persister-partykit-client';
|
|
186
186
|
* import {createStore} from 'tinybase';
|
|
187
187
|
*
|
|
@@ -5902,6 +5902,76 @@ export function useMetricsOrMetricsById(
|
|
|
5902
5902
|
metricsOrMetricsId?: MetricsOrMetricsId,
|
|
5903
5903
|
): Metrics | undefined;
|
|
5904
5904
|
|
|
5905
|
+
/**
|
|
5906
|
+
* The useProvideMetrics hook is used to add a Metrics object by Id to a
|
|
5907
|
+
* Provider component, but imperatively from a component within it.
|
|
5908
|
+
*
|
|
5909
|
+
* Normally you will register a Metrics object by Id in a context by using the
|
|
5910
|
+
* `metricsById` prop of the top-level Provider component. This hook, however,
|
|
5911
|
+
* lets you dynamically add a new Metrics object to the context, from within a
|
|
5912
|
+
* descendent component. This is useful for applications where the set of
|
|
5913
|
+
* Metrics objects is not known at the time of the first render of the root
|
|
5914
|
+
* Provider.
|
|
5915
|
+
*
|
|
5916
|
+
* A Metrics object added to the Provider context in this way will be available
|
|
5917
|
+
* to other components within the context (using the useMetrics hook and so on).
|
|
5918
|
+
* If you use the same Id as an existing Metrics object registration, the new
|
|
5919
|
+
* one will take priority over one provided by the `metricsById` prop.
|
|
5920
|
+
*
|
|
5921
|
+
* Note that other components that consume a Metrics object registered like this
|
|
5922
|
+
* should defend against it being undefined at first. On the first render, the
|
|
5923
|
+
* other component will likely not yet have completed the registration. In the
|
|
5924
|
+
* example below, we use the null-safe `useMetrics('petMetrics')?` to do this.
|
|
5925
|
+
* @param metricsId The Id of the Metrics object to be registered with the
|
|
5926
|
+
* Provider.
|
|
5927
|
+
* @param metrics The Metrics object to be registered.
|
|
5928
|
+
* @example
|
|
5929
|
+
* This example creates a Provider context. A child component registers a
|
|
5930
|
+
* Metrics object into it which is then consumable by a peer child component.
|
|
5931
|
+
*
|
|
5932
|
+
* ```jsx
|
|
5933
|
+
* import {
|
|
5934
|
+
* Provider,
|
|
5935
|
+
* useCreateMetrics,
|
|
5936
|
+
* useCreateStore,
|
|
5937
|
+
* useMetrics,
|
|
5938
|
+
* useProvideMetrics,
|
|
5939
|
+
* } from 'tinybase/ui-react';
|
|
5940
|
+
* import {createMetrics, createStore} from 'tinybase';
|
|
5941
|
+
* import React from 'react';
|
|
5942
|
+
* import {createRoot} from 'react-dom/client';
|
|
5943
|
+
*
|
|
5944
|
+
* const App = () => (
|
|
5945
|
+
* <Provider>
|
|
5946
|
+
* <RegisterMetrics />
|
|
5947
|
+
* <ConsumeMetrics />
|
|
5948
|
+
* </Provider>
|
|
5949
|
+
* );
|
|
5950
|
+
* const RegisterMetrics = () => {
|
|
5951
|
+
* const store = useCreateStore(() =>
|
|
5952
|
+
* createStore().setCell('pets', 'fido', 'color', 'brown'),
|
|
5953
|
+
* );
|
|
5954
|
+
* const metrics = useCreateMetrics(store, (store) =>
|
|
5955
|
+
* createMetrics(store).setMetricDefinition('petCount', 'pets', 'count'),
|
|
5956
|
+
* );
|
|
5957
|
+
* useProvideMetrics('petMetrics', metrics);
|
|
5958
|
+
* return null;
|
|
5959
|
+
* };
|
|
5960
|
+
* const ConsumeMetrics = () => (
|
|
5961
|
+
* <span>{useMetrics('petMetrics')?.getMetric('petCount')}</span>
|
|
5962
|
+
* );
|
|
5963
|
+
*
|
|
5964
|
+
* const app = document.createElement('div');
|
|
5965
|
+
* const root = createRoot(app);
|
|
5966
|
+
* root.render(<App />); // !act
|
|
5967
|
+
* console.log(app.innerHTML);
|
|
5968
|
+
* // -> '<span>1</span>'
|
|
5969
|
+
* ```
|
|
5970
|
+
* @category Metrics hooks
|
|
5971
|
+
* @since v5.3.0
|
|
5972
|
+
*/
|
|
5973
|
+
export function useProvideMetrics(metricsId: Id, metrics: Metrics): void;
|
|
5974
|
+
|
|
5905
5975
|
/**
|
|
5906
5976
|
* The useMetricIds hook gets an array of the Metric Ids registered with a
|
|
5907
5977
|
* Metrics object, and registers a listener so that any changes to that result
|
|
@@ -6454,6 +6524,9 @@ export function useIndexesOrIndexesById(
|
|
|
6454
6524
|
indexesOrIndexesId?: IndexesOrIndexesId,
|
|
6455
6525
|
): Indexes | undefined;
|
|
6456
6526
|
|
|
6527
|
+
// useProvideIndexes
|
|
6528
|
+
export function useProvideIndexes(indexesId: Id, indexes: Indexes): void;
|
|
6529
|
+
|
|
6457
6530
|
/**
|
|
6458
6531
|
* The useIndexIds hook gets an array of the Index Ids registered with an
|
|
6459
6532
|
* Indexes object, and registers a listener so that any changes to that result
|
|
@@ -7258,6 +7331,12 @@ export function useRelationshipsOrRelationshipsById(
|
|
|
7258
7331
|
relationshipsOrRelationshipsId?: RelationshipsOrRelationshipsId,
|
|
7259
7332
|
): Relationships | undefined;
|
|
7260
7333
|
|
|
7334
|
+
// useProvideRelationships
|
|
7335
|
+
export function useProvideRelationships(
|
|
7336
|
+
relationshipsId: Id,
|
|
7337
|
+
relationships: Relationships,
|
|
7338
|
+
): void;
|
|
7339
|
+
|
|
7261
7340
|
/**
|
|
7262
7341
|
* The useRelationshipIds hook gets an array of the Relationship Ids registered
|
|
7263
7342
|
* with a Relationships object, and registers a listener so that any changes to
|
|
@@ -8306,6 +8385,9 @@ export function useQueriesOrQueriesById(
|
|
|
8306
8385
|
queriesOrQueriesId?: QueriesOrQueriesId,
|
|
8307
8386
|
): Queries | undefined;
|
|
8308
8387
|
|
|
8388
|
+
// useProvideQueries
|
|
8389
|
+
export function useProvideQueries(queriesId: Id, queries: Queries): void;
|
|
8390
|
+
|
|
8309
8391
|
/**
|
|
8310
8392
|
* The useQueryIds hook gets an array of the Query Ids registered with a Queries
|
|
8311
8393
|
* object, and registers a listener so that any changes to that result will
|
|
@@ -10490,6 +10572,12 @@ export function useCheckpointsOrCheckpointsById(
|
|
|
10490
10572
|
checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId,
|
|
10491
10573
|
): Checkpoints | undefined;
|
|
10492
10574
|
|
|
10575
|
+
// useProvideCheckpoints
|
|
10576
|
+
export function useProvideCheckpoints(
|
|
10577
|
+
checkpointsId: Id,
|
|
10578
|
+
checkpoints: Checkpoints,
|
|
10579
|
+
): void;
|
|
10580
|
+
|
|
10493
10581
|
/**
|
|
10494
10582
|
* The useCheckpointIds hook returns an array of the checkpoint Ids being
|
|
10495
10583
|
* managed by this Checkpoints object, and registers a listener so that any
|
|
@@ -5902,6 +5902,76 @@ export function useMetricsOrMetricsById(
|
|
|
5902
5902
|
metricsOrMetricsId?: MetricsOrMetricsId,
|
|
5903
5903
|
): Metrics | undefined;
|
|
5904
5904
|
|
|
5905
|
+
/**
|
|
5906
|
+
* The useProvideMetrics hook is used to add a Metrics object by Id to a
|
|
5907
|
+
* Provider component, but imperatively from a component within it.
|
|
5908
|
+
*
|
|
5909
|
+
* Normally you will register a Metrics object by Id in a context by using the
|
|
5910
|
+
* `metricsById` prop of the top-level Provider component. This hook, however,
|
|
5911
|
+
* lets you dynamically add a new Metrics object to the context, from within a
|
|
5912
|
+
* descendent component. This is useful for applications where the set of
|
|
5913
|
+
* Metrics objects is not known at the time of the first render of the root
|
|
5914
|
+
* Provider.
|
|
5915
|
+
*
|
|
5916
|
+
* A Metrics object added to the Provider context in this way will be available
|
|
5917
|
+
* to other components within the context (using the useMetrics hook and so on).
|
|
5918
|
+
* If you use the same Id as an existing Metrics object registration, the new
|
|
5919
|
+
* one will take priority over one provided by the `metricsById` prop.
|
|
5920
|
+
*
|
|
5921
|
+
* Note that other components that consume a Metrics object registered like this
|
|
5922
|
+
* should defend against it being undefined at first. On the first render, the
|
|
5923
|
+
* other component will likely not yet have completed the registration. In the
|
|
5924
|
+
* example below, we use the null-safe `useMetrics('petMetrics')?` to do this.
|
|
5925
|
+
* @param metricsId The Id of the Metrics object to be registered with the
|
|
5926
|
+
* Provider.
|
|
5927
|
+
* @param metrics The Metrics object to be registered.
|
|
5928
|
+
* @example
|
|
5929
|
+
* This example creates a Provider context. A child component registers a
|
|
5930
|
+
* Metrics object into it which is then consumable by a peer child component.
|
|
5931
|
+
*
|
|
5932
|
+
* ```jsx
|
|
5933
|
+
* import {
|
|
5934
|
+
* Provider,
|
|
5935
|
+
* useCreateMetrics,
|
|
5936
|
+
* useCreateStore,
|
|
5937
|
+
* useMetrics,
|
|
5938
|
+
* useProvideMetrics,
|
|
5939
|
+
* } from 'tinybase/ui-react';
|
|
5940
|
+
* import {createMetrics, createStore} from 'tinybase';
|
|
5941
|
+
* import React from 'react';
|
|
5942
|
+
* import {createRoot} from 'react-dom/client';
|
|
5943
|
+
*
|
|
5944
|
+
* const App = () => (
|
|
5945
|
+
* <Provider>
|
|
5946
|
+
* <RegisterMetrics />
|
|
5947
|
+
* <ConsumeMetrics />
|
|
5948
|
+
* </Provider>
|
|
5949
|
+
* );
|
|
5950
|
+
* const RegisterMetrics = () => {
|
|
5951
|
+
* const store = useCreateStore(() =>
|
|
5952
|
+
* createStore().setCell('pets', 'fido', 'color', 'brown'),
|
|
5953
|
+
* );
|
|
5954
|
+
* const metrics = useCreateMetrics(store, (store) =>
|
|
5955
|
+
* createMetrics(store).setMetricDefinition('petCount', 'pets', 'count'),
|
|
5956
|
+
* );
|
|
5957
|
+
* useProvideMetrics('petMetrics', metrics);
|
|
5958
|
+
* return null;
|
|
5959
|
+
* };
|
|
5960
|
+
* const ConsumeMetrics = () => (
|
|
5961
|
+
* <span>{useMetrics('petMetrics')?.getMetric('petCount')}</span>
|
|
5962
|
+
* );
|
|
5963
|
+
*
|
|
5964
|
+
* const app = document.createElement('div');
|
|
5965
|
+
* const root = createRoot(app);
|
|
5966
|
+
* root.render(<App />); // !act
|
|
5967
|
+
* console.log(app.innerHTML);
|
|
5968
|
+
* // -> '<span>1</span>'
|
|
5969
|
+
* ```
|
|
5970
|
+
* @category Metrics hooks
|
|
5971
|
+
* @since v5.3.0
|
|
5972
|
+
*/
|
|
5973
|
+
export function useProvideMetrics(metricsId: Id, metrics: Metrics): void;
|
|
5974
|
+
|
|
5905
5975
|
/**
|
|
5906
5976
|
* The useMetricIds hook gets an array of the Metric Ids registered with a
|
|
5907
5977
|
* Metrics object, and registers a listener so that any changes to that result
|
|
@@ -6454,6 +6524,9 @@ export function useIndexesOrIndexesById(
|
|
|
6454
6524
|
indexesOrIndexesId?: IndexesOrIndexesId,
|
|
6455
6525
|
): Indexes | undefined;
|
|
6456
6526
|
|
|
6527
|
+
// useProvideIndexes
|
|
6528
|
+
export function useProvideIndexes(indexesId: Id, indexes: Indexes): void;
|
|
6529
|
+
|
|
6457
6530
|
/**
|
|
6458
6531
|
* The useIndexIds hook gets an array of the Index Ids registered with an
|
|
6459
6532
|
* Indexes object, and registers a listener so that any changes to that result
|
|
@@ -7258,6 +7331,12 @@ export function useRelationshipsOrRelationshipsById(
|
|
|
7258
7331
|
relationshipsOrRelationshipsId?: RelationshipsOrRelationshipsId,
|
|
7259
7332
|
): Relationships | undefined;
|
|
7260
7333
|
|
|
7334
|
+
// useProvideRelationships
|
|
7335
|
+
export function useProvideRelationships(
|
|
7336
|
+
relationshipsId: Id,
|
|
7337
|
+
relationships: Relationships,
|
|
7338
|
+
): void;
|
|
7339
|
+
|
|
7261
7340
|
/**
|
|
7262
7341
|
* The useRelationshipIds hook gets an array of the Relationship Ids registered
|
|
7263
7342
|
* with a Relationships object, and registers a listener so that any changes to
|
|
@@ -8306,6 +8385,9 @@ export function useQueriesOrQueriesById(
|
|
|
8306
8385
|
queriesOrQueriesId?: QueriesOrQueriesId,
|
|
8307
8386
|
): Queries | undefined;
|
|
8308
8387
|
|
|
8388
|
+
// useProvideQueries
|
|
8389
|
+
export function useProvideQueries(queriesId: Id, queries: Queries): void;
|
|
8390
|
+
|
|
8309
8391
|
/**
|
|
8310
8392
|
* The useQueryIds hook gets an array of the Query Ids registered with a Queries
|
|
8311
8393
|
* object, and registers a listener so that any changes to that result will
|
|
@@ -10490,6 +10572,12 @@ export function useCheckpointsOrCheckpointsById(
|
|
|
10490
10572
|
checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId,
|
|
10491
10573
|
): Checkpoints | undefined;
|
|
10492
10574
|
|
|
10575
|
+
// useProvideCheckpoints
|
|
10576
|
+
export function useProvideCheckpoints(
|
|
10577
|
+
checkpointsId: Id,
|
|
10578
|
+
checkpoints: Checkpoints,
|
|
10579
|
+
): void;
|
|
10580
|
+
|
|
10493
10581
|
/**
|
|
10494
10582
|
* The useCheckpointIds hook returns an array of the checkpoint Ids being
|
|
10495
10583
|
* managed by this Checkpoints object, and registers a listener so that any
|
|
@@ -6802,6 +6802,9 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
6802
6802
|
metricsOrMetricsId?: MetricsOrMetricsId<Schemas>,
|
|
6803
6803
|
) => Metrics<Schemas> | undefined;
|
|
6804
6804
|
|
|
6805
|
+
// useProvideMetrics
|
|
6806
|
+
useProvideMetrics: (metricsId: Id, metrics: Metrics<Schemas>) => void;
|
|
6807
|
+
|
|
6805
6808
|
/**
|
|
6806
6809
|
* The useMetricIds hook gets an array of the Metric Ids registered with a
|
|
6807
6810
|
* Metrics object, and registers a listener so that any changes to that result
|
|
@@ -7404,6 +7407,9 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
7404
7407
|
indexesOrIndexesId?: IndexesOrIndexesId<Schemas>,
|
|
7405
7408
|
) => Indexes<Schemas> | undefined;
|
|
7406
7409
|
|
|
7410
|
+
// useProvideIndexes
|
|
7411
|
+
useProvideIndexes: (indexesId: Id, indexes: Indexes<Schemas>) => void;
|
|
7412
|
+
|
|
7407
7413
|
/**
|
|
7408
7414
|
* The useIndexIds hook gets an array of the Index Ids registered with an
|
|
7409
7415
|
* Indexes object, and registers a listener so that any changes to that result
|
|
@@ -8280,6 +8286,12 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
8280
8286
|
relationshipsOrRelationshipsId?: RelationshipsOrRelationshipsId<Schemas>,
|
|
8281
8287
|
) => Relationships<Schemas> | undefined;
|
|
8282
8288
|
|
|
8289
|
+
// useProvideRelationships
|
|
8290
|
+
useProvideRelationships: (
|
|
8291
|
+
relationshipsId: Id,
|
|
8292
|
+
relationships: Relationships<Schemas>,
|
|
8293
|
+
) => void;
|
|
8294
|
+
|
|
8283
8295
|
/**
|
|
8284
8296
|
* The useRelationshipIds hook gets an array of the Relationship Ids registered
|
|
8285
8297
|
* with a Relationships object, and registers a listener so that any changes to
|
|
@@ -9426,6 +9438,9 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
9426
9438
|
queriesOrQueriesId?: QueriesOrQueriesId<Schemas>,
|
|
9427
9439
|
) => Queries<Schemas> | undefined;
|
|
9428
9440
|
|
|
9441
|
+
// useProvideQueries
|
|
9442
|
+
useProvideQueries: (queriesId: Id, queries: Queries<Schemas>) => void;
|
|
9443
|
+
|
|
9429
9444
|
/**
|
|
9430
9445
|
* The useQueryIds hook gets an array of the Query Ids registered with a Queries
|
|
9431
9446
|
* object, and registers a listener so that any changes to that result will
|
|
@@ -11816,6 +11831,12 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11816
11831
|
checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId<Schemas>,
|
|
11817
11832
|
) => Checkpoints<Schemas> | undefined;
|
|
11818
11833
|
|
|
11834
|
+
// useProvideCheckpoints
|
|
11835
|
+
useProvideCheckpoints: (
|
|
11836
|
+
checkpointsId: Id,
|
|
11837
|
+
checkpoints: Checkpoints<Schemas>,
|
|
11838
|
+
) => void;
|
|
11839
|
+
|
|
11819
11840
|
/**
|
|
11820
11841
|
* The useCheckpointIds hook returns an array of the checkpoint Ids being
|
|
11821
11842
|
* managed by this Checkpoints object, and registers a listener so that any
|
|
@@ -6802,6 +6802,9 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
6802
6802
|
metricsOrMetricsId?: MetricsOrMetricsId<Schemas>,
|
|
6803
6803
|
) => Metrics<Schemas> | undefined;
|
|
6804
6804
|
|
|
6805
|
+
// useProvideMetrics
|
|
6806
|
+
useProvideMetrics: (metricsId: Id, metrics: Metrics<Schemas>) => void;
|
|
6807
|
+
|
|
6805
6808
|
/**
|
|
6806
6809
|
* The useMetricIds hook gets an array of the Metric Ids registered with a
|
|
6807
6810
|
* Metrics object, and registers a listener so that any changes to that result
|
|
@@ -7404,6 +7407,9 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
7404
7407
|
indexesOrIndexesId?: IndexesOrIndexesId<Schemas>,
|
|
7405
7408
|
) => Indexes<Schemas> | undefined;
|
|
7406
7409
|
|
|
7410
|
+
// useProvideIndexes
|
|
7411
|
+
useProvideIndexes: (indexesId: Id, indexes: Indexes<Schemas>) => void;
|
|
7412
|
+
|
|
7407
7413
|
/**
|
|
7408
7414
|
* The useIndexIds hook gets an array of the Index Ids registered with an
|
|
7409
7415
|
* Indexes object, and registers a listener so that any changes to that result
|
|
@@ -8280,6 +8286,12 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
8280
8286
|
relationshipsOrRelationshipsId?: RelationshipsOrRelationshipsId<Schemas>,
|
|
8281
8287
|
) => Relationships<Schemas> | undefined;
|
|
8282
8288
|
|
|
8289
|
+
// useProvideRelationships
|
|
8290
|
+
useProvideRelationships: (
|
|
8291
|
+
relationshipsId: Id,
|
|
8292
|
+
relationships: Relationships<Schemas>,
|
|
8293
|
+
) => void;
|
|
8294
|
+
|
|
8283
8295
|
/**
|
|
8284
8296
|
* The useRelationshipIds hook gets an array of the Relationship Ids registered
|
|
8285
8297
|
* with a Relationships object, and registers a listener so that any changes to
|
|
@@ -9426,6 +9438,9 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
9426
9438
|
queriesOrQueriesId?: QueriesOrQueriesId<Schemas>,
|
|
9427
9439
|
) => Queries<Schemas> | undefined;
|
|
9428
9440
|
|
|
9441
|
+
// useProvideQueries
|
|
9442
|
+
useProvideQueries: (queriesId: Id, queries: Queries<Schemas>) => void;
|
|
9443
|
+
|
|
9429
9444
|
/**
|
|
9430
9445
|
* The useQueryIds hook gets an array of the Query Ids registered with a Queries
|
|
9431
9446
|
* object, and registers a listener so that any changes to that result will
|
|
@@ -11816,6 +11831,12 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
11816
11831
|
checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId<Schemas>,
|
|
11817
11832
|
) => Checkpoints<Schemas> | undefined;
|
|
11818
11833
|
|
|
11834
|
+
// useProvideCheckpoints
|
|
11835
|
+
useProvideCheckpoints: (
|
|
11836
|
+
checkpointsId: Id,
|
|
11837
|
+
checkpoints: Checkpoints<Schemas>,
|
|
11838
|
+
) => void;
|
|
11839
|
+
|
|
11819
11840
|
/**
|
|
11820
11841
|
* The useCheckpointIds hook returns an array of the checkpoint Ids being
|
|
11821
11842
|
* managed by this Checkpoints object, and registers a listener so that any
|
|
@@ -11,8 +11,6 @@ export * from '../checkpoints/with-schemas/index.d.cts';
|
|
|
11
11
|
export * from '../common/with-schemas/index.d.cts';
|
|
12
12
|
export * from '../indexes/with-schemas/index.d.cts';
|
|
13
13
|
export * from '../metrics/with-schemas/index.d.cts';
|
|
14
|
-
export * from '../persisters/with-schemas/index.d.cts';
|
|
15
|
-
export * from '../synchronizers/with-schemas/index.d.cts';
|
|
16
14
|
export * from '../queries/with-schemas/index.d.cts';
|
|
17
15
|
export * from '../relationships/with-schemas/index.d.cts';
|
|
18
16
|
export * from '../mergeable-store/with-schemas/index.d.cts';
|
|
@@ -11,8 +11,6 @@ export * from '../checkpoints/with-schemas/index.d.ts';
|
|
|
11
11
|
export * from '../common/with-schemas/index.d.ts';
|
|
12
12
|
export * from '../indexes/with-schemas/index.d.ts';
|
|
13
13
|
export * from '../metrics/with-schemas/index.d.ts';
|
|
14
|
-
export * from '../persisters/with-schemas/index.d.ts';
|
|
15
|
-
export * from '../synchronizers/with-schemas/index.d.ts';
|
|
16
14
|
export * from '../queries/with-schemas/index.d.ts';
|
|
17
15
|
export * from '../relationships/with-schemas/index.d.ts';
|
|
18
16
|
export * from '../mergeable-store/with-schemas/index.d.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",d="Ids",i="Table",a=i+"s",p=i+d,c="Row",x=c+"Count",I=c+d,C="Sorted"+c+d,b="Cell",w=b+d,R="Value",k=R+"s",v=R+d,g=e=>null==e,y=(e,s,t)=>g(e)?null==t?void 0:t():s(e),h=e=>s(e)==r,L=e=>s(e)==o,m=e=>e.length,S=()=>{},V=(e,s)=>e.every(s),f=(e,s)=>m(e)===m(s)&&V(e,((e,t)=>s[t]===e)),T=(e,s)=>e.map(s),P=Object,O=e=>P.getPrototypeOf(e),q=P.entries,B=e=>!g(e)&&y(O(e),(e=>e==P.prototype||g(O(e))),(()=>!0)),H=P.keys,M=(e,s)=>y(e,(e=>e[s])),D=(e,s)=>{const t=q(e);return m(t)===m(H(s))&&V(t,(([e,t])=>B(t)?!!B(s[e])&&D(s[e],t):s[e]===t))},{createContext:F,useContext:j,useEffect:E}=e,Q=F([]),A=(e,s)=>{var t;const r=j(Q);return g(e)?r[s]:h(e)?M(null!=(t=r[s+1])?t:{},e):e},G=(e,s)=>{const t=A(e,s);return g(e)||h(e)?t:e},W=e=>{var s;return H(null!=(s=j(Q)[e])?s:{})},z=e=>G(e,0),U=e=>G(e,2),J=e=>G(e,4),K=e=>G(e,6),N=e=>G(e,8),X=e=>G(e,10),Y=e=>e.toLowerCase();Y(l);const Z="Transaction";Y(Z);var $=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:re,useState:oe,useSyncExternalStore:le}=e,ue=[],ne=[{},[],[ue,void 0,ue],void 0,!1,0],de=[D,f,([e,s,t],[r,o,l])=>s===o&&f(e,r)&&f(t,l)],ie=(e,s)=>e===s,ae=(e,s,t=ue)=>{const[,r]=oe(),[o,l]=oe();return ee((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},pe=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ce=(e,s,r,o=ue)=>{const l=re(ne[r]),u=_((()=>{var t,u,n;const d=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:ne[r];return(null!=(n=de[r])?n:ie)(d,l.current)?l.current:l.current=d}),[s,r,e,...o]),d=_((l=>pe(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return le(d,u)},xe=(e,s,t,r=ue,o=ue,...l)=>te((()=>pe(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Ie=(e,s,t,r=ue,o=S,l=ue,...u)=>{const n=z(e);return _((e=>y(n,(r=>y(t(e,r),(t=>o(r["set"+s](...Ce(u,r,e),t),t)))))),[n,s,...r,...l,...be(u)])},Ce=(e,s,t)=>T(e,(e=>L(e)?e(t,s):e)),be=e=>{return s=e=>!L(e),e.filter(s);var s},we=(e,s,t=S,r=ue,...o)=>{const l=z(e);return _((e=>t(null==l?void 0:l["del"+s](...Ce(o,l,e)))),[l,s,...r,...be(o)])},Re=(e,s,t)=>{const r=X(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},ke=e=>ce(p,z(e),1),ve=(e,s)=>ce(I,z(s),1,[e]),ge=(e,s,t,r=0,o,l)=>ce(C,z(l),1,[e,s,t,r,o]),ye=(e,s,t)=>ce(w,z(t),1,[e,s]),he=(e,s,t,r)=>ce(b,z(r),3,[e,s,t]),Le=e=>ce(v,z(e),1),me=(e,s)=>ce(R,z(s),3,[e]),Se=(e,s)=>ce("Metric",U(s),3,[e]),Ve=(e,s)=>ce("SliceIds",J(s),1,[e]),fe=(e,s,t)=>ce("Slice"+I,J(t),1,[e,s]),Te=(e,s,t)=>ce("RemoteRowId",K(t),3,[e,s]),Pe=(e,s,t)=>ce("Local"+I,K(t),1,[e,s]),Oe=(e,s,t)=>ce("Linked"+I,K(t),1,[e,s]),qe=(e,s)=>ce(u+I,N(s),1,[e]),Be=(e,s,t,r=0,o,l)=>ce(u+C,N(l),1,[e,s,t,r,o]),He=(e,s,t)=>ce(u+w,N(t),1,[e,s]),Me=(e,s,t,r)=>ce(u+b,N(r),3,[e,s,t]),De=e=>ce("CheckpointIds",X(e),2),Fe=(e,s)=>ce("Checkpoint",X(s),3,[e]),je=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Qe,Fragment:Ae,createElement:Ge,useCallback:We,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>g(e)?{}:e(...s),Ne=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var Xe=Object.defineProperty,Ye=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable,ss=(e,s,t)=>s in e?Xe(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ts=(e,s)=>{for(var t in s||(s={}))_e.call(s,t)&&ss(e,t,s[t]);if($e)for(var t of $e(s))es.call(s,t)&&ss(e,t,s[t]);return e},rs=(e,s)=>Ye(e,Ze(s)),os=(e,s)=>{var t={};for(var r in e)_e.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&$e)for(var r of $e(e))s.indexOf(r)<0&&es.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:ls,useContext:us,useMemo:ns,useState:ds}=e,is=({tableId:e,store:s,rowComponent:t=Cs,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>xs(T(n,(l=>Ge(t,rs(ts({},Ke(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),as=({queryId:e,queries:s,resultRowComponent:t=vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>xs(T(u,(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),ps=({relationshipId:e,relationships:s,rowComponent:t=Cs,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Ne(K(s),e),p=u(e,n,d);return xs(T(p,(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},cs=e=>({checkpoints:s,checkpointComponent:t=gs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=X(s);return xs(T(e(De(u)),(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},xs=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:T(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},Is=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return xs(t+(null!=(u=he(e,s,r,o))?u:t),void 0,l,r)},Cs=({tableId:e,rowId:s,store:t,cellComponent:r=Is,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>xs(T(((e,s,t,r)=>{const o=ye(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),bs=e=>is(e,ve(e.tableId,e.store)),ws=({valueId:e,store:s,debugIds:r})=>{var o;return xs(t+(null!=(o=me(e,s))?o:t),void 0,r,e)},Rs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Cs,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,d,i]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(J(t),e),a=fe(e,s,n);return xs(T(a,(e=>Ge(r,rs(ts({},Ke(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},ks=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return xs(t+(null!=(u=Me(e,s,r,o))?u:t),void 0,l,r)},vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=ks,getResultCellComponentProps:o,separator:l,debugIds:u})=>xs(T(He(e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),gs=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return xs(null!=(o=Fe(s,e))?o:t,void 0,r,s)},ys=cs((e=>e[0])),hs=cs((e=>g(e[1])?[]:[e[1]])),Ls=cs((e=>e[2]));exports.BackwardCheckpointsView=ys,exports.CellView=Is,exports.CheckpointView=gs,exports.CurrentCheckpointView=hs,exports.ForwardCheckpointsView=Ls,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Rs,getSliceComponentProps:r,separator:o,debugIds:l})=>xs(T(Ve(e,s),(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>ps(e,Oe,e.firstRowId),exports.LocalRowsView=e=>ps(e,Pe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return xs(null!=(o=Se(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:d,queriesById:i,checkpoints:a,checkpointsById:p,children:c})=>{const x=us(Q),[I,C]=ds({}),b=ls(((e,s)=>C((t=>M(t,e)==s?t:rs(ts({},t),{[e]:s})))),[]),w=ls((e=>C((s=>ts({},((e,s)=>(delete e[s],e))(s,e))))),[]);return Ge(Q.Provider,{value:ns((()=>[null!=e?e:x[0],ts(ts(ts({},x[1]),s),I),null!=t?t:x[2],ts(ts({},x[3]),r),null!=o?o:x[4],ts(ts({},x[5]),l),null!=u?u:x[6],ts(ts({},x[7]),n),null!=d?d:x[8],ts(ts({},x[9]),i),null!=a?a:x[10],ts(ts({},x[11]),p),b,w]),[e,s,I,t,r,o,l,u,n,d,i,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Cs,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Ne(K(t),e),i=Te(e,s,u);return xs(g(d)||g(i)?null:Ge(r,rs(ts({},Ke(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=ks,exports.ResultRowView=vs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return as(u,Be(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>as(e,qe(e.queryId,e.queries)),exports.RowView=Cs,exports.SliceView=Rs,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return is(u,ge(u.tableId,t,r,o,l,u.store))},exports.TableView=bs,exports.TablesView=({store:e,tableComponent:s=bs,getTableComponentProps:t,separator:r,debugIds:o})=>xs(T(ke(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=ws,exports.ValuesView=({store:e,valueComponent:s=ws,getValueComponentProps:t,separator:r,debugIds:o})=>xs(T(Le(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=ue,r,o=S,l=ue,u=!0)=>{const n=z(r);return _((t=>y(n,(r=>y(s(t,r),(s=>o(r.addRow(L(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=he,exports.useCellIds=ye,exports.useCellIdsListener=(e,s,t,r,o,l)=>xe(w,z(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>xe(b,z(u),r,o,[e,s,t],l),exports.useCheckpoint=Fe,exports.useCheckpointIds=De,exports.useCheckpointIdsListener=(e,s,t)=>xe("CheckpointIds",X(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>xe("Checkpoint",X(r),s,t,[e]),exports.useCheckpoints=e=>A(e,10),exports.useCheckpointsIds=()=>W(11),exports.useCheckpointsOrCheckpointsById=X,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=ue)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=ue,r,o=ue,l,u=ue)=>{const[,n]=oe(),[d,i]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;i(t),t&&r&&$(void 0,null,(function*(){yield r(t),n([])}))}))}),[e,...t,...o]),ee((()=>()=>{d&&(d.destroy(),null==l||l(d))}),[d,...u]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=ue)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=ue,r,o=ue)=>{const[l,u]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ee((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>we(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>we(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>we(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>we(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>xe("DidFinish"+Z,z(t),e,s),exports.useGoBackwardCallback=je,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>y(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ce(b,z(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>xe(n+b,z(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ce(c,z(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>xe(n+c,z(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ce(i,z(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ce(i+b,z(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>xe(n+i+b,z(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>xe(n+i,z(o),s,t,[e],r),exports.useHasTables=e=>ce(a,z(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>xe(n+a,z(r),e,s,[],t),exports.useHasValue=(e,s)=>ce(R,z(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>xe(n+R,z(o),s,t,[e],r),exports.useHasValues=e=>ce(k,z(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>xe(n+k,z(r),e,s,[],t),exports.useIndexIds=e=>ce("IndexIds",J(e),1),exports.useIndexes=e=>A(e,4),exports.useIndexesIds=()=>W(5),exports.useIndexesOrIndexesById=J,exports.useLinkedRowIds=Oe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>xe("Linked"+I,K(o),t,r,[e,s]),exports.useLocalRowIds=Pe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>xe("Local"+I,K(o),t,r,[e,s]),exports.useMetric=Se,exports.useMetricIds=e=>ce("MetricIds",U(e),1),exports.useMetricListener=(e,s,t,r)=>xe("Metric",U(r),s,t,[e]),exports.useMetrics=e=>A(e,2),exports.useMetricsIds=()=>W(3),exports.useMetricsOrMetricsById=U,exports.useProvideStore=(e,s)=>{const{12:t,13:r}=j(Q);E((()=>(null==t||t(e,s),()=>null==r?void 0:r(e))),[t,e,s,r])},exports.useQueries=e=>A(e,8),exports.useQueriesIds=()=>W(9),exports.useQueriesOrQueriesById=N,exports.useQueryIds=e=>ce("QueryIds",N(e),1),exports.useRedoInformation=e=>{var s;const r=X(e),[,,[o]]=De(r);return[!g(o),Ee(r),o,null!=(s=y(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ce("RelationshipIds",K(e),1),exports.useRelationships=e=>A(e,6),exports.useRelationshipsIds=()=>W(7),exports.useRelationshipsOrRelationshipsById=K,exports.useRemoteRowId=Te,exports.useRemoteRowIdListener=(e,s,t,r,o)=>xe("RemoteRowId",K(o),t,r,[e,s]),exports.useResultCell=Me,exports.useResultCellIds=He,exports.useResultCellIdsListener=(e,s,t,r,o)=>xe(u+w,N(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>xe(u+b,N(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ce(u+c,N(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ce(u+x,N(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>xe(u+x,N(r),s,t,[e]),exports.useResultRowIds=qe,exports.useResultRowIdsListener=(e,s,t,r)=>xe(u+I,N(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>xe(u+c,N(o),t,r,[e,s]),exports.useResultSortedRowIds=Be,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,d)=>xe(u+C,N(d),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ce(u+i,N(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ce(u+i+w,N(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>xe(u+i+w,N(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>xe(u+i,N(r),s,t,[e]),exports.useRow=(e,s,t)=>ce(c,z(t),0,[e,s]),exports.useRowCount=(e,s)=>ce(x,z(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>xe(x,z(o),s,t,[e],r),exports.useRowIds=ve,exports.useRowIdsListener=(e,s,t,r,o)=>xe(I,z(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>xe(c,z(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Ie(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=S,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Ie(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>Ie(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>Ie(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>Ie(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>Ie(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>Ie(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>Ie(t,k,e,s,r,o),exports.useSliceIds=Ve,exports.useSliceIdsListener=(e,s,t,r)=>xe("SliceIds",J(r),s,t,[e]),exports.useSliceRowIds=fe,exports.useSliceRowIdsListener=(e,s,t,r,o)=>xe("Slice"+I,J(o),t,r,[e,s]),exports.useSortedRowIds=ge,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>xe(C,z(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>xe("Start"+Z,z(t),e,s),exports.useStore=e=>A(e,0),exports.useStoreIds=()=>W(1),exports.useStoreOrStoreById=z,exports.useTable=(e,s)=>ce(i,z(s),0,[e]),exports.useTableCellIds=(e,s)=>ce(i+w,z(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>xe(i+w,z(o),s,t,[e],r),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,r)=>xe(p,z(r),e,s,ue,t),exports.useTableListener=(e,s,t,r,o)=>xe(i,z(o),s,t,[e],r),exports.useTables=e=>ce(a,z(e),0),exports.useTablesListener=(e,s,t,r)=>xe(a,z(r),e,s,ue,t),exports.useUndoInformation=e=>{var s;const r=X(e),[o,l]=De(r);return[(u=o,!(0==m(u))),je(r),l,null!=(s=y(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=me,exports.useValueIds=Le,exports.useValueIdsListener=(e,s,t,r)=>xe(v,z(r),e,s,ue,t),exports.useValueListener=(e,s,t,r,o)=>xe(R,z(o),s,t,[e],r),exports.useValues=e=>ce(k,z(e),0),exports.useValuesListener=(e,s,t,r)=>xe(k,z(r),e,s,ue,t),exports.useWillFinishTransactionListener=(e,s,t)=>xe("WillFinish"+Z,z(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",i="Ids",d="Table",a=d+"s",p=d+i,c="Row",x=c+"Count",I=c+i,C="Sorted"+c+i,b="Cell",w=b+i,R="Value",k=R+"s",v=R+i,g=globalThis,y=e=>null==e,h=(e,s,t)=>y(e)?null==t?void 0:t():s(e),L=e=>s(e)==r,m=e=>s(e)==o,S=e=>e.length,V=()=>{},f=(e,s)=>e.every(s),T=(e,s)=>S(e)===S(s)&&f(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),O=(e,s,t)=>e.with(s,t),q=Object,M=e=>q.getPrototypeOf(e),B=q.entries,H=e=>!y(e)&&h(M(e),(e=>e==q.prototype||y(M(e))),(()=>!0)),D=q.keys,F=(e,s)=>h(e,(e=>e[s])),Q=(e,s)=>s in e,j=(e,s)=>{const t=B(e);return S(t)===S(D(s))&&f(t,(([e,t])=>H(t)?!!H(s[e])&&j(s[e],t):s[e]===t))},{createContext:E,useContext:A,useEffect:G}=e,W=(_=()=>E([]),Q(z=g,U="tinybase_uirc")||(z[U]=_()),z[U]);var z,U,_;const J=(e,s)=>{var t;const r=A(W);return y(e)?r[s]:L(e)?F(null!=(t=r[s+1])?t:{},e):e},K=(e,s)=>{const t=J(e,s);return y(e)||L(e)?t:e},N=(e,s,t)=>{const{12:r,13:o}=A(W);G((()=>(null==r||r(t,e,s),()=>null==o?void 0:o(t,e))),[r,e,s,t,o])},X=e=>{var s;return D(null!=(s=A(W)[e])?s:{})},Y=e=>K(e,0),Z=e=>K(e,2),$=e=>K(e,4),ee=e=>K(e,6),se=e=>K(e,8),te=e=>K(e,10),re=e=>e.toLowerCase();re(l);const oe="Transaction";re(oe);var le=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:ue,useEffect:ne,useMemo:ie,useLayoutEffect:de,useRef:ae,useState:pe,useSyncExternalStore:ce}=e,xe=[],Ie=[{},[],[xe,void 0,xe],void 0,!1,0],Ce=[j,T,([e,s,t],[r,o,l])=>s===o&&T(e,r)&&T(t,l)],be=(e,s)=>e===s,we=(e,s,t=xe)=>{const[,r]=pe(),[o,l]=pe();return ne((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},Re=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ke=(e,s,r,o=xe)=>{const l=ae(Ie[r]),u=ue((()=>{var t,u,n;const i=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:Ie[r];return(null!=(n=Ce[r])?n:be)(i,l.current)?l.current:l.current=i}),[s,r,e,...o]),i=ue((l=>Re(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return ce(i,u)},ve=(e,s,t,r=xe,o=xe,...l)=>de((()=>Re(s,e,...o,t,...l)),[s,e,...o,...r,...l]),ge=(e,s,t,r=xe,o=V,l=xe,...u)=>{const n=Y(e);return ue((e=>h(n,(r=>h(t(e,r),(t=>o(r["set"+s](...ye(u,r,e),t),t)))))),[n,s,...r,...l,...he(u)])},ye=(e,s,t)=>P(e,(e=>m(e)?e(t,s):e)),he=e=>{return s=e=>!m(e),e.filter(s);var s},Le=(e,s,t=V,r=xe,...o)=>{const l=Y(e);return ue((e=>t(null==l?void 0:l["del"+s](...ye(o,l,e)))),[l,s,...r,...he(o)])},me=(e,s,t)=>{const r=te(e);return ue((()=>null==r?void 0:r[s](t)),[r,s,t])},Se=e=>ke(p,Y(e),1),Ve=(e,s)=>ke(I,Y(s),1,[e]),fe=(e,s,t,r=0,o,l)=>ke(C,Y(l),1,[e,s,t,r,o]),Te=(e,s,t)=>ke(w,Y(t),1,[e,s]),Pe=(e,s,t,r)=>ke(b,Y(r),3,[e,s,t]),Oe=e=>ke(v,Y(e),1),qe=(e,s)=>ke(R,Y(s),3,[e]),Me=(e,s)=>ke("Metric",Z(s),3,[e]),Be=(e,s)=>ke("SliceIds",$(s),1,[e]),He=(e,s,t)=>ke("Slice"+I,$(t),1,[e,s]),De=(e,s,t)=>ke("RemoteRowId",ee(t),3,[e,s]),Fe=(e,s,t)=>ke("Local"+I,ee(t),1,[e,s]),Qe=(e,s,t)=>ke("Linked"+I,ee(t),1,[e,s]),je=(e,s)=>ke(u+I,se(s),1,[e]),Ee=(e,s,t,r=0,o,l)=>ke(u+C,se(l),1,[e,s,t,r,o]),Ae=(e,s,t)=>ke(u+w,se(t),1,[e,s]),Ge=(e,s,t,r)=>ke(u+b,se(r),3,[e,s,t]),We=e=>ke("CheckpointIds",te(e),2),ze=(e,s)=>ke("Checkpoint",te(s),3,[e]),Ue=e=>me(e,"goBackward"),_e=e=>me(e,"goForward"),{PureComponent:Je,Fragment:Ke,createElement:Ne,useCallback:Xe,useLayoutEffect:Ye,useRef:Ze,useState:$e}=e,es=(e,...s)=>y(e)?{}:e(...s),ss=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var ts=Object.defineProperty,rs=Object.defineProperties,os=Object.getOwnPropertyDescriptors,ls=Object.getOwnPropertySymbols,us=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,is=(e,s,t)=>s in e?ts(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ds=(e,s)=>{for(var t in s||(s={}))us.call(s,t)&&is(e,t,s[t]);if(ls)for(var t of ls(s))ns.call(s,t)&&is(e,t,s[t]);return e},as=(e,s)=>rs(e,os(s)),ps=(e,s)=>{var t={};for(var r in e)us.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&ls)for(var r of ls(e))s.indexOf(r)<0&&ns.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:cs,useContext:xs,useMemo:Is,useState:Cs}=e,bs=({tableId:e,store:s,rowComponent:t=ys,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>vs(P(n,(l=>Ne(t,as(ds({},es(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),ws=({queryId:e,queries:s,resultRowComponent:t=Vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>vs(P(u,(o=>Ne(t,as(ds({},es(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),Rs=({relationshipId:e,relationships:s,rowComponent:t=ys,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[i,d,a]=ss(ee(s),e),p=u(e,n,i);return vs(P(p,(e=>Ne(t,as(ds({},es(r,e)),{key:e,tableId:a,rowId:e,store:d,debugIds:l})))),o,l,n)},ks=e=>({checkpoints:s,checkpointComponent:t=fs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=te(s);return vs(P(e(We(u)),(e=>Ne(t,as(ds({},es(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},vs=(e,s,t,r)=>{const o=y(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},gs=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return vs(t+(null!=(u=Pe(e,s,r,o))?u:t),void 0,l,r)},ys=({tableId:e,rowId:s,store:t,cellComponent:r=gs,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>vs(P(((e,s,t,r)=>{const o=Te(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Ne(r,as(ds({},es(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),hs=e=>bs(e,Ve(e.tableId,e.store)),Ls=({valueId:e,store:s,debugIds:r})=>{var o;return vs(t+(null!=(o=qe(e,s))?o:t),void 0,r,e)},ms=({indexId:e,sliceId:s,indexes:t,rowComponent:r=ys,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,i,d]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])($(t),e),a=He(e,s,n);return vs(P(a,(e=>Ne(r,as(ds({},es(o,e)),{key:e,tableId:d,rowId:e,store:i,debugIds:u})))),l,u,s)},Ss=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return vs(t+(null!=(u=Ge(e,s,r,o))?u:t),void 0,l,r)},Vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=Ss,getResultCellComponentProps:o,separator:l,debugIds:u})=>vs(P(Ae(e,s,t),(l=>Ne(r,as(ds({},es(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),fs=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return vs(null!=(o=ze(s,e))?o:t,void 0,r,s)},Ts=ks((e=>e[0])),Ps=ks((e=>y(e[1])?[]:[e[1]])),Os=ks((e=>e[2]));exports.BackwardCheckpointsView=Ts,exports.CellView=gs,exports.CheckpointView=fs,exports.CurrentCheckpointView=Ps,exports.ForwardCheckpointsView=Os,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ms,getSliceComponentProps:r,separator:o,debugIds:l})=>vs(P(Be(e,s),(o=>Ne(t,as(ds({},es(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>Rs(e,Qe,e.firstRowId),exports.LocalRowsView=e=>Rs(e,Fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return vs(null!=(o=Me(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:i,queriesById:d,checkpoints:a,checkpointsById:p,children:c})=>{const x=xs(W),[I,C]=Cs([{},{},{},{},{},{}]),b=cs(((e,s,t)=>C((r=>F(r[e],s)==t?r:O(r,e,as(ds({},r[e]),{[s]:t}))))),[]),w=cs(((e,s)=>C((t=>Q(t[e],s)?O(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return Ne(W.Provider,{value:Is((()=>[null!=e?e:x[0],ds(ds(ds({},x[1]),s),I[0]),null!=t?t:x[2],ds(ds(ds({},x[3]),r),I[1]),null!=o?o:x[4],ds(ds(ds({},x[5]),l),I[2]),null!=u?u:x[6],ds(ds(ds({},x[7]),n),I[3]),null!=i?i:x[8],ds(ds(ds({},x[9]),d),I[4]),null!=a?a:x[10],ds(ds(ds({},x[11]),p),I[5]),b,w]),[e,s,I,t,r,o,l,u,n,i,d,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=ys,getRowComponentProps:o,debugIds:l})=>{const[u,n,,i]=ss(ee(t),e),d=De(e,s,u);return vs(y(i)||y(d)?null:Ne(r,as(ds({},es(o,d)),{key:d,tableId:i,rowId:d,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=Ss,exports.ResultRowView=Vs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ps(s,["cellId","descending","offset","limit"]);return ws(u,Ee(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>ws(e,je(e.queryId,e.queries)),exports.RowView=ys,exports.SliceView=ms,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ps(s,["cellId","descending","offset","limit"]);return bs(u,fe(u.tableId,t,r,o,l,u.store))},exports.TableView=hs,exports.TablesView=({store:e,tableComponent:s=hs,getTableComponentProps:t,separator:r,debugIds:o})=>vs(P(Se(e),(r=>Ne(s,as(ds({},es(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=Ls,exports.ValuesView=({store:e,valueComponent:s=Ls,getValueComponentProps:t,separator:r,debugIds:o})=>vs(P(Oe(e),(r=>Ne(s,as(ds({},es(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=xe,r,o=V,l=xe,u=!0)=>{const n=Y(r);return ue((t=>h(n,(r=>h(s(t,r),(s=>o(r.addRow(m(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=Pe,exports.useCellIds=Te,exports.useCellIdsListener=(e,s,t,r,o,l)=>ve(w,Y(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>ve(b,Y(u),r,o,[e,s,t],l),exports.useCheckpoint=ze,exports.useCheckpointIds=We,exports.useCheckpointIdsListener=(e,s,t)=>ve("CheckpointIds",te(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>ve("Checkpoint",te(r),s,t,[e]),exports.useCheckpoints=e=>J(e,10),exports.useCheckpointsIds=()=>X(11),exports.useCheckpointsOrCheckpointsById=te,exports.useCreateCheckpoints=(e,s,t)=>we(e,s,t),exports.useCreateIndexes=(e,s,t)=>we(e,s,t),exports.useCreateMergeableStore=(e,s=xe)=>ie(e,s),exports.useCreateMetrics=(e,s,t)=>we(e,s,t),exports.useCreatePersister=(e,s,t=xe,r,o=xe,l,u=xe)=>{const[,n]=pe(),[i,d]=pe();return ne((()=>{le(void 0,null,(function*(){const t=e?yield s(e):void 0;d(t),t&&r&&le(void 0,null,(function*(){yield r(t),n([])}))}))}),[e,...t,...o]),ne((()=>()=>{i&&(i.destroy(),null==l||l(i))}),[i,...u]),i},exports.useCreateQueries=(e,s,t)=>we(e,s,t),exports.useCreateRelationships=(e,s,t)=>we(e,s,t),exports.useCreateStore=(e,s=xe)=>ie(e,s),exports.useCreateSynchronizer=(e,s,t=xe,r,o=xe)=>{const[l,u]=pe();return ne((()=>{le(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ne((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>Le(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Le(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Le(s,d,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Le(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>Le(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Le(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ve("DidFinish"+oe,Y(t),e,s),exports.useGoBackwardCallback=Ue,exports.useGoForwardCallback=_e,exports.useGoToCallback=(e,s=xe,t,r=V,o=xe)=>{const l=te(t);return ue((s=>h(l,(t=>h(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ke(b,Y(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>ve(n+b,Y(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ke(c,Y(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>ve(n+c,Y(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ke(d,Y(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ke(d+b,Y(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>ve(n+d+b,Y(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>ve(n+d,Y(o),s,t,[e],r),exports.useHasTables=e=>ke(a,Y(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>ve(n+a,Y(r),e,s,[],t),exports.useHasValue=(e,s)=>ke(R,Y(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>ve(n+R,Y(o),s,t,[e],r),exports.useHasValues=e=>ke(k,Y(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>ve(n+k,Y(r),e,s,[],t),exports.useIndexIds=e=>ke("IndexIds",$(e),1),exports.useIndexes=e=>J(e,4),exports.useIndexesIds=()=>X(5),exports.useIndexesOrIndexesById=$,exports.useLinkedRowIds=Qe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>ve("Linked"+I,ee(o),t,r,[e,s]),exports.useLocalRowIds=Fe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>ve("Local"+I,ee(o),t,r,[e,s]),exports.useMetric=Me,exports.useMetricIds=e=>ke("MetricIds",Z(e),1),exports.useMetricListener=(e,s,t,r)=>ve("Metric",Z(r),s,t,[e]),exports.useMetrics=e=>J(e,2),exports.useMetricsIds=()=>X(3),exports.useMetricsOrMetricsById=Z,exports.useProvideCheckpoints=(e,s)=>N(e,s,5),exports.useProvideIndexes=(e,s)=>N(e,s,2),exports.useProvideMetrics=(e,s)=>N(e,s,1),exports.useProvideQueries=(e,s)=>N(e,s,4),exports.useProvideRelationships=(e,s)=>N(e,s,3),exports.useProvideStore=(e,s)=>N(e,s,0),exports.useQueries=e=>J(e,8),exports.useQueriesIds=()=>X(9),exports.useQueriesOrQueriesById=se,exports.useQueryIds=e=>ke("QueryIds",se(e),1),exports.useRedoInformation=e=>{var s;const r=te(e),[,,[o]]=We(r);return[!y(o),_e(r),o,null!=(s=h(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ke("RelationshipIds",ee(e),1),exports.useRelationships=e=>J(e,6),exports.useRelationshipsIds=()=>X(7),exports.useRelationshipsOrRelationshipsById=ee,exports.useRemoteRowId=De,exports.useRemoteRowIdListener=(e,s,t,r,o)=>ve("RemoteRowId",ee(o),t,r,[e,s]),exports.useResultCell=Ge,exports.useResultCellIds=Ae,exports.useResultCellIdsListener=(e,s,t,r,o)=>ve(u+w,se(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>ve(u+b,se(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ke(u+c,se(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ke(u+x,se(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>ve(u+x,se(r),s,t,[e]),exports.useResultRowIds=je,exports.useResultRowIdsListener=(e,s,t,r)=>ve(u+I,se(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>ve(u+c,se(o),t,r,[e,s]),exports.useResultSortedRowIds=Ee,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,i)=>ve(u+C,se(i),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ke(u+d,se(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ke(u+d+w,se(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>ve(u+d+w,se(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>ve(u+d,se(r),s,t,[e]),exports.useRow=(e,s,t)=>ke(c,Y(t),0,[e,s]),exports.useRowCount=(e,s)=>ke(x,Y(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>ve(x,Y(o),s,t,[e],r),exports.useRowIds=Ve,exports.useRowIdsListener=(e,s,t,r,o)=>ve(I,Y(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>ve(c,Y(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>ge(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=xe,t,r=V,o=xe)=>{const l=te(t);return ue((s=>h(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>ge(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>ge(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>ge(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>ge(r,d,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>ge(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>ge(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>ge(t,k,e,s,r,o),exports.useSliceIds=Be,exports.useSliceIdsListener=(e,s,t,r)=>ve("SliceIds",$(r),s,t,[e]),exports.useSliceRowIds=He,exports.useSliceRowIdsListener=(e,s,t,r,o)=>ve("Slice"+I,$(o),t,r,[e,s]),exports.useSortedRowIds=fe,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,i)=>ve(C,Y(i),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>ve("Start"+oe,Y(t),e,s),exports.useStore=e=>J(e,0),exports.useStoreIds=()=>X(1),exports.useStoreOrStoreById=Y,exports.useTable=(e,s)=>ke(d,Y(s),0,[e]),exports.useTableCellIds=(e,s)=>ke(d+w,Y(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>ve(d+w,Y(o),s,t,[e],r),exports.useTableIds=Se,exports.useTableIdsListener=(e,s,t,r)=>ve(p,Y(r),e,s,xe,t),exports.useTableListener=(e,s,t,r,o)=>ve(d,Y(o),s,t,[e],r),exports.useTables=e=>ke(a,Y(e),0),exports.useTablesListener=(e,s,t,r)=>ve(a,Y(r),e,s,xe,t),exports.useUndoInformation=e=>{var s;const r=te(e),[o,l]=We(r);return[(u=o,!(0==S(u))),Ue(r),l,null!=(s=h(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=qe,exports.useValueIds=Oe,exports.useValueIdsListener=(e,s,t,r)=>ve(v,Y(r),e,s,xe,t),exports.useValueListener=(e,s,t,r,o)=>ve(R,Y(o),s,t,[e],r),exports.useValues=e=>ke(k,Y(e),0),exports.useValuesListener=(e,s,t,r)=>ve(k,Y(r),e,s,xe,t),exports.useWillFinishTransactionListener=(e,s,t)=>ve("WillFinish"+oe,Y(t),e,s);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",d="Ids",i="Table",a=i+"s",p=i+d,c="Row",x=c+"Count",I=c+d,C="Sorted"+c+d,b="Cell",w=b+d,R="Value",k=R+"s",v=R+d,g=e=>null==e,y=(e,s,t)=>g(e)?null==t?void 0:t():s(e),h=e=>s(e)==r,L=e=>s(e)==o,m=e=>e.length,S=()=>{},V=(e,s)=>e.every(s),f=(e,s)=>m(e)===m(s)&&V(e,((e,t)=>s[t]===e)),T=(e,s)=>e.map(s),P=Object,O=e=>P.getPrototypeOf(e),q=P.entries,B=e=>!g(e)&&y(O(e),(e=>e==P.prototype||g(O(e))),(()=>!0)),H=P.keys,M=(e,s)=>y(e,(e=>e[s])),D=(e,s)=>{const t=q(e);return m(t)===m(H(s))&&V(t,(([e,t])=>B(t)?!!B(s[e])&&D(s[e],t):s[e]===t))},{createContext:F,useContext:j,useEffect:E}=e,Q=F([]),A=(e,s)=>{var t;const r=j(Q);return g(e)?r[s]:h(e)?M(null!=(t=r[s+1])?t:{},e):e},G=(e,s)=>{const t=A(e,s);return g(e)||h(e)?t:e},W=e=>{var s;return H(null!=(s=j(Q)[e])?s:{})},z=e=>G(e,0),U=e=>G(e,2),J=e=>G(e,4),K=e=>G(e,6),N=e=>G(e,8),X=e=>G(e,10),Y=e=>e.toLowerCase();Y(l);const Z="Transaction";Y(Z);var $=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:re,useState:oe,useSyncExternalStore:le}=e,ue=[],ne=[{},[],[ue,void 0,ue],void 0,!1,0],de=[D,f,([e,s,t],[r,o,l])=>s===o&&f(e,r)&&f(t,l)],ie=(e,s)=>e===s,ae=(e,s,t=ue)=>{const[,r]=oe(),[o,l]=oe();return ee((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},pe=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ce=(e,s,r,o=ue)=>{const l=re(ne[r]),u=_((()=>{var t,u,n;const d=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:ne[r];return(null!=(n=de[r])?n:ie)(d,l.current)?l.current:l.current=d}),[s,r,e,...o]),d=_((l=>pe(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return le(d,u)},xe=(e,s,t,r=ue,o=ue,...l)=>te((()=>pe(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Ie=(e,s,t,r=ue,o=S,l=ue,...u)=>{const n=z(e);return _((e=>y(n,(r=>y(t(e,r),(t=>o(r["set"+s](...Ce(u,r,e),t),t)))))),[n,s,...r,...l,...be(u)])},Ce=(e,s,t)=>T(e,(e=>L(e)?e(t,s):e)),be=e=>{return s=e=>!L(e),e.filter(s);var s},we=(e,s,t=S,r=ue,...o)=>{const l=z(e);return _((e=>t(null==l?void 0:l["del"+s](...Ce(o,l,e)))),[l,s,...r,...be(o)])},Re=(e,s,t)=>{const r=X(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},ke=e=>ce(p,z(e),1),ve=(e,s)=>ce(I,z(s),1,[e]),ge=(e,s,t,r=0,o,l)=>ce(C,z(l),1,[e,s,t,r,o]),ye=(e,s,t)=>ce(w,z(t),1,[e,s]),he=(e,s,t,r)=>ce(b,z(r),3,[e,s,t]),Le=e=>ce(v,z(e),1),me=(e,s)=>ce(R,z(s),3,[e]),Se=(e,s)=>ce("Metric",U(s),3,[e]),Ve=(e,s)=>ce("SliceIds",J(s),1,[e]),fe=(e,s,t)=>ce("Slice"+I,J(t),1,[e,s]),Te=(e,s,t)=>ce("RemoteRowId",K(t),3,[e,s]),Pe=(e,s,t)=>ce("Local"+I,K(t),1,[e,s]),Oe=(e,s,t)=>ce("Linked"+I,K(t),1,[e,s]),qe=(e,s)=>ce(u+I,N(s),1,[e]),Be=(e,s,t,r=0,o,l)=>ce(u+C,N(l),1,[e,s,t,r,o]),He=(e,s,t)=>ce(u+w,N(t),1,[e,s]),Me=(e,s,t,r)=>ce(u+b,N(r),3,[e,s,t]),De=e=>ce("CheckpointIds",X(e),2),Fe=(e,s)=>ce("Checkpoint",X(s),3,[e]),je=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Qe,Fragment:Ae,createElement:Ge,useCallback:We,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>g(e)?{}:e(...s),Ne=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var Xe=Object.defineProperty,Ye=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable,ss=(e,s,t)=>s in e?Xe(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ts=(e,s)=>{for(var t in s||(s={}))_e.call(s,t)&&ss(e,t,s[t]);if($e)for(var t of $e(s))es.call(s,t)&&ss(e,t,s[t]);return e},rs=(e,s)=>Ye(e,Ze(s)),os=(e,s)=>{var t={};for(var r in e)_e.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&$e)for(var r of $e(e))s.indexOf(r)<0&&es.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:ls,useContext:us,useMemo:ns,useState:ds}=e,is=({tableId:e,store:s,rowComponent:t=Cs,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>xs(T(n,(l=>Ge(t,rs(ts({},Ke(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),as=({queryId:e,queries:s,resultRowComponent:t=vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>xs(T(u,(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),ps=({relationshipId:e,relationships:s,rowComponent:t=Cs,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Ne(K(s),e),p=u(e,n,d);return xs(T(p,(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},cs=e=>({checkpoints:s,checkpointComponent:t=gs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=X(s);return xs(T(e(De(u)),(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},xs=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:T(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},Is=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return xs(t+(null!=(u=he(e,s,r,o))?u:t),void 0,l,r)},Cs=({tableId:e,rowId:s,store:t,cellComponent:r=Is,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>xs(T(((e,s,t,r)=>{const o=ye(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),bs=e=>is(e,ve(e.tableId,e.store)),ws=({valueId:e,store:s,debugIds:r})=>{var o;return xs(t+(null!=(o=me(e,s))?o:t),void 0,r,e)},Rs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Cs,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,d,i]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(J(t),e),a=fe(e,s,n);return xs(T(a,(e=>Ge(r,rs(ts({},Ke(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},ks=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return xs(t+(null!=(u=Me(e,s,r,o))?u:t),void 0,l,r)},vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=ks,getResultCellComponentProps:o,separator:l,debugIds:u})=>xs(T(He(e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),gs=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return xs(null!=(o=Fe(s,e))?o:t,void 0,r,s)},ys=cs((e=>e[0])),hs=cs((e=>g(e[1])?[]:[e[1]])),Ls=cs((e=>e[2]));exports.BackwardCheckpointsView=ys,exports.CellView=Is,exports.CheckpointView=gs,exports.CurrentCheckpointView=hs,exports.ForwardCheckpointsView=Ls,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Rs,getSliceComponentProps:r,separator:o,debugIds:l})=>xs(T(Ve(e,s),(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>ps(e,Oe,e.firstRowId),exports.LocalRowsView=e=>ps(e,Pe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return xs(null!=(o=Se(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:d,queriesById:i,checkpoints:a,checkpointsById:p,children:c})=>{const x=us(Q),[I,C]=ds({}),b=ls(((e,s)=>C((t=>M(t,e)==s?t:rs(ts({},t),{[e]:s})))),[]),w=ls((e=>C((s=>ts({},((e,s)=>(delete e[s],e))(s,e))))),[]);return Ge(Q.Provider,{value:ns((()=>[null!=e?e:x[0],ts(ts(ts({},x[1]),s),I),null!=t?t:x[2],ts(ts({},x[3]),r),null!=o?o:x[4],ts(ts({},x[5]),l),null!=u?u:x[6],ts(ts({},x[7]),n),null!=d?d:x[8],ts(ts({},x[9]),i),null!=a?a:x[10],ts(ts({},x[11]),p),b,w]),[e,s,I,t,r,o,l,u,n,d,i,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Cs,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Ne(K(t),e),i=Te(e,s,u);return xs(g(d)||g(i)?null:Ge(r,rs(ts({},Ke(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=ks,exports.ResultRowView=vs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return as(u,Be(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>as(e,qe(e.queryId,e.queries)),exports.RowView=Cs,exports.SliceView=Rs,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return is(u,ge(u.tableId,t,r,o,l,u.store))},exports.TableView=bs,exports.TablesView=({store:e,tableComponent:s=bs,getTableComponentProps:t,separator:r,debugIds:o})=>xs(T(ke(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=ws,exports.ValuesView=({store:e,valueComponent:s=ws,getValueComponentProps:t,separator:r,debugIds:o})=>xs(T(Le(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=ue,r,o=S,l=ue,u=!0)=>{const n=z(r);return _((t=>y(n,(r=>y(s(t,r),(s=>o(r.addRow(L(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=he,exports.useCellIds=ye,exports.useCellIdsListener=(e,s,t,r,o,l)=>xe(w,z(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>xe(b,z(u),r,o,[e,s,t],l),exports.useCheckpoint=Fe,exports.useCheckpointIds=De,exports.useCheckpointIdsListener=(e,s,t)=>xe("CheckpointIds",X(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>xe("Checkpoint",X(r),s,t,[e]),exports.useCheckpoints=e=>A(e,10),exports.useCheckpointsIds=()=>W(11),exports.useCheckpointsOrCheckpointsById=X,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=ue)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=ue,r,o=ue,l,u=ue)=>{const[,n]=oe(),[d,i]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;i(t),t&&r&&$(void 0,null,(function*(){yield r(t),n([])}))}))}),[e,...t,...o]),ee((()=>()=>{d&&(d.destroy(),null==l||l(d))}),[d,...u]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=ue)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=ue,r,o=ue)=>{const[l,u]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ee((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>we(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>we(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>we(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>we(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>xe("DidFinish"+Z,z(t),e,s),exports.useGoBackwardCallback=je,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>y(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ce(b,z(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>xe(n+b,z(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ce(c,z(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>xe(n+c,z(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ce(i,z(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ce(i+b,z(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>xe(n+i+b,z(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>xe(n+i,z(o),s,t,[e],r),exports.useHasTables=e=>ce(a,z(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>xe(n+a,z(r),e,s,[],t),exports.useHasValue=(e,s)=>ce(R,z(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>xe(n+R,z(o),s,t,[e],r),exports.useHasValues=e=>ce(k,z(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>xe(n+k,z(r),e,s,[],t),exports.useIndexIds=e=>ce("IndexIds",J(e),1),exports.useIndexes=e=>A(e,4),exports.useIndexesIds=()=>W(5),exports.useIndexesOrIndexesById=J,exports.useLinkedRowIds=Oe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>xe("Linked"+I,K(o),t,r,[e,s]),exports.useLocalRowIds=Pe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>xe("Local"+I,K(o),t,r,[e,s]),exports.useMetric=Se,exports.useMetricIds=e=>ce("MetricIds",U(e),1),exports.useMetricListener=(e,s,t,r)=>xe("Metric",U(r),s,t,[e]),exports.useMetrics=e=>A(e,2),exports.useMetricsIds=()=>W(3),exports.useMetricsOrMetricsById=U,exports.useProvideStore=(e,s)=>{const{12:t,13:r}=j(Q);E((()=>(null==t||t(e,s),()=>null==r?void 0:r(e))),[t,e,s,r])},exports.useQueries=e=>A(e,8),exports.useQueriesIds=()=>W(9),exports.useQueriesOrQueriesById=N,exports.useQueryIds=e=>ce("QueryIds",N(e),1),exports.useRedoInformation=e=>{var s;const r=X(e),[,,[o]]=De(r);return[!g(o),Ee(r),o,null!=(s=y(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ce("RelationshipIds",K(e),1),exports.useRelationships=e=>A(e,6),exports.useRelationshipsIds=()=>W(7),exports.useRelationshipsOrRelationshipsById=K,exports.useRemoteRowId=Te,exports.useRemoteRowIdListener=(e,s,t,r,o)=>xe("RemoteRowId",K(o),t,r,[e,s]),exports.useResultCell=Me,exports.useResultCellIds=He,exports.useResultCellIdsListener=(e,s,t,r,o)=>xe(u+w,N(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>xe(u+b,N(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ce(u+c,N(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ce(u+x,N(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>xe(u+x,N(r),s,t,[e]),exports.useResultRowIds=qe,exports.useResultRowIdsListener=(e,s,t,r)=>xe(u+I,N(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>xe(u+c,N(o),t,r,[e,s]),exports.useResultSortedRowIds=Be,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,d)=>xe(u+C,N(d),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ce(u+i,N(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ce(u+i+w,N(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>xe(u+i+w,N(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>xe(u+i,N(r),s,t,[e]),exports.useRow=(e,s,t)=>ce(c,z(t),0,[e,s]),exports.useRowCount=(e,s)=>ce(x,z(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>xe(x,z(o),s,t,[e],r),exports.useRowIds=ve,exports.useRowIdsListener=(e,s,t,r,o)=>xe(I,z(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>xe(c,z(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Ie(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=S,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Ie(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>Ie(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>Ie(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>Ie(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>Ie(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>Ie(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>Ie(t,k,e,s,r,o),exports.useSliceIds=Ve,exports.useSliceIdsListener=(e,s,t,r)=>xe("SliceIds",J(r),s,t,[e]),exports.useSliceRowIds=fe,exports.useSliceRowIdsListener=(e,s,t,r,o)=>xe("Slice"+I,J(o),t,r,[e,s]),exports.useSortedRowIds=ge,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>xe(C,z(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>xe("Start"+Z,z(t),e,s),exports.useStore=e=>A(e,0),exports.useStoreIds=()=>W(1),exports.useStoreOrStoreById=z,exports.useTable=(e,s)=>ce(i,z(s),0,[e]),exports.useTableCellIds=(e,s)=>ce(i+w,z(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>xe(i+w,z(o),s,t,[e],r),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,r)=>xe(p,z(r),e,s,ue,t),exports.useTableListener=(e,s,t,r,o)=>xe(i,z(o),s,t,[e],r),exports.useTables=e=>ce(a,z(e),0),exports.useTablesListener=(e,s,t,r)=>xe(a,z(r),e,s,ue,t),exports.useUndoInformation=e=>{var s;const r=X(e),[o,l]=De(r);return[(u=o,!(0==m(u))),je(r),l,null!=(s=y(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=me,exports.useValueIds=Le,exports.useValueIdsListener=(e,s,t,r)=>xe(v,z(r),e,s,ue,t),exports.useValueListener=(e,s,t,r,o)=>xe(R,z(o),s,t,[e],r),exports.useValues=e=>ce(k,z(e),0),exports.useValuesListener=(e,s,t,r)=>xe(k,z(r),e,s,ue,t),exports.useWillFinishTransactionListener=(e,s,t)=>xe("WillFinish"+Z,z(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",i="Ids",d="Table",a=d+"s",p=d+i,c="Row",x=c+"Count",I=c+i,C="Sorted"+c+i,b="Cell",w=b+i,R="Value",k=R+"s",v=R+i,g=globalThis,y=e=>null==e,h=(e,s,t)=>y(e)?null==t?void 0:t():s(e),L=e=>s(e)==r,m=e=>s(e)==o,S=e=>e.length,V=()=>{},f=(e,s)=>e.every(s),T=(e,s)=>S(e)===S(s)&&f(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),O=(e,s,t)=>e.with(s,t),q=Object,M=e=>q.getPrototypeOf(e),B=q.entries,H=e=>!y(e)&&h(M(e),(e=>e==q.prototype||y(M(e))),(()=>!0)),D=q.keys,F=(e,s)=>h(e,(e=>e[s])),Q=(e,s)=>s in e,j=(e,s)=>{const t=B(e);return S(t)===S(D(s))&&f(t,(([e,t])=>H(t)?!!H(s[e])&&j(s[e],t):s[e]===t))},{createContext:E,useContext:A,useEffect:G}=e,W=(_=()=>E([]),Q(z=g,U="tinybase_uirc")||(z[U]=_()),z[U]);var z,U,_;const J=(e,s)=>{var t;const r=A(W);return y(e)?r[s]:L(e)?F(null!=(t=r[s+1])?t:{},e):e},K=(e,s)=>{const t=J(e,s);return y(e)||L(e)?t:e},N=(e,s,t)=>{const{12:r,13:o}=A(W);G((()=>(null==r||r(t,e,s),()=>null==o?void 0:o(t,e))),[r,e,s,t,o])},X=e=>{var s;return D(null!=(s=A(W)[e])?s:{})},Y=e=>K(e,0),Z=e=>K(e,2),$=e=>K(e,4),ee=e=>K(e,6),se=e=>K(e,8),te=e=>K(e,10),re=e=>e.toLowerCase();re(l);const oe="Transaction";re(oe);var le=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:ue,useEffect:ne,useMemo:ie,useLayoutEffect:de,useRef:ae,useState:pe,useSyncExternalStore:ce}=e,xe=[],Ie=[{},[],[xe,void 0,xe],void 0,!1,0],Ce=[j,T,([e,s,t],[r,o,l])=>s===o&&T(e,r)&&T(t,l)],be=(e,s)=>e===s,we=(e,s,t=xe)=>{const[,r]=pe(),[o,l]=pe();return ne((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},Re=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ke=(e,s,r,o=xe)=>{const l=ae(Ie[r]),u=ue((()=>{var t,u,n;const i=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:Ie[r];return(null!=(n=Ce[r])?n:be)(i,l.current)?l.current:l.current=i}),[s,r,e,...o]),i=ue((l=>Re(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return ce(i,u)},ve=(e,s,t,r=xe,o=xe,...l)=>de((()=>Re(s,e,...o,t,...l)),[s,e,...o,...r,...l]),ge=(e,s,t,r=xe,o=V,l=xe,...u)=>{const n=Y(e);return ue((e=>h(n,(r=>h(t(e,r),(t=>o(r["set"+s](...ye(u,r,e),t),t)))))),[n,s,...r,...l,...he(u)])},ye=(e,s,t)=>P(e,(e=>m(e)?e(t,s):e)),he=e=>{return s=e=>!m(e),e.filter(s);var s},Le=(e,s,t=V,r=xe,...o)=>{const l=Y(e);return ue((e=>t(null==l?void 0:l["del"+s](...ye(o,l,e)))),[l,s,...r,...he(o)])},me=(e,s,t)=>{const r=te(e);return ue((()=>null==r?void 0:r[s](t)),[r,s,t])},Se=e=>ke(p,Y(e),1),Ve=(e,s)=>ke(I,Y(s),1,[e]),fe=(e,s,t,r=0,o,l)=>ke(C,Y(l),1,[e,s,t,r,o]),Te=(e,s,t)=>ke(w,Y(t),1,[e,s]),Pe=(e,s,t,r)=>ke(b,Y(r),3,[e,s,t]),Oe=e=>ke(v,Y(e),1),qe=(e,s)=>ke(R,Y(s),3,[e]),Me=(e,s)=>ke("Metric",Z(s),3,[e]),Be=(e,s)=>ke("SliceIds",$(s),1,[e]),He=(e,s,t)=>ke("Slice"+I,$(t),1,[e,s]),De=(e,s,t)=>ke("RemoteRowId",ee(t),3,[e,s]),Fe=(e,s,t)=>ke("Local"+I,ee(t),1,[e,s]),Qe=(e,s,t)=>ke("Linked"+I,ee(t),1,[e,s]),je=(e,s)=>ke(u+I,se(s),1,[e]),Ee=(e,s,t,r=0,o,l)=>ke(u+C,se(l),1,[e,s,t,r,o]),Ae=(e,s,t)=>ke(u+w,se(t),1,[e,s]),Ge=(e,s,t,r)=>ke(u+b,se(r),3,[e,s,t]),We=e=>ke("CheckpointIds",te(e),2),ze=(e,s)=>ke("Checkpoint",te(s),3,[e]),Ue=e=>me(e,"goBackward"),_e=e=>me(e,"goForward"),{PureComponent:Je,Fragment:Ke,createElement:Ne,useCallback:Xe,useLayoutEffect:Ye,useRef:Ze,useState:$e}=e,es=(e,...s)=>y(e)?{}:e(...s),ss=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var ts=Object.defineProperty,rs=Object.defineProperties,os=Object.getOwnPropertyDescriptors,ls=Object.getOwnPropertySymbols,us=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,is=(e,s,t)=>s in e?ts(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ds=(e,s)=>{for(var t in s||(s={}))us.call(s,t)&&is(e,t,s[t]);if(ls)for(var t of ls(s))ns.call(s,t)&&is(e,t,s[t]);return e},as=(e,s)=>rs(e,os(s)),ps=(e,s)=>{var t={};for(var r in e)us.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&ls)for(var r of ls(e))s.indexOf(r)<0&&ns.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:cs,useContext:xs,useMemo:Is,useState:Cs}=e,bs=({tableId:e,store:s,rowComponent:t=ys,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>vs(P(n,(l=>Ne(t,as(ds({},es(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),ws=({queryId:e,queries:s,resultRowComponent:t=Vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>vs(P(u,(o=>Ne(t,as(ds({},es(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),Rs=({relationshipId:e,relationships:s,rowComponent:t=ys,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[i,d,a]=ss(ee(s),e),p=u(e,n,i);return vs(P(p,(e=>Ne(t,as(ds({},es(r,e)),{key:e,tableId:a,rowId:e,store:d,debugIds:l})))),o,l,n)},ks=e=>({checkpoints:s,checkpointComponent:t=fs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=te(s);return vs(P(e(We(u)),(e=>Ne(t,as(ds({},es(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},vs=(e,s,t,r)=>{const o=y(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},gs=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return vs(t+(null!=(u=Pe(e,s,r,o))?u:t),void 0,l,r)},ys=({tableId:e,rowId:s,store:t,cellComponent:r=gs,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>vs(P(((e,s,t,r)=>{const o=Te(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Ne(r,as(ds({},es(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),hs=e=>bs(e,Ve(e.tableId,e.store)),Ls=({valueId:e,store:s,debugIds:r})=>{var o;return vs(t+(null!=(o=qe(e,s))?o:t),void 0,r,e)},ms=({indexId:e,sliceId:s,indexes:t,rowComponent:r=ys,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,i,d]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])($(t),e),a=He(e,s,n);return vs(P(a,(e=>Ne(r,as(ds({},es(o,e)),{key:e,tableId:d,rowId:e,store:i,debugIds:u})))),l,u,s)},Ss=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return vs(t+(null!=(u=Ge(e,s,r,o))?u:t),void 0,l,r)},Vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=Ss,getResultCellComponentProps:o,separator:l,debugIds:u})=>vs(P(Ae(e,s,t),(l=>Ne(r,as(ds({},es(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),fs=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return vs(null!=(o=ze(s,e))?o:t,void 0,r,s)},Ts=ks((e=>e[0])),Ps=ks((e=>y(e[1])?[]:[e[1]])),Os=ks((e=>e[2]));exports.BackwardCheckpointsView=Ts,exports.CellView=gs,exports.CheckpointView=fs,exports.CurrentCheckpointView=Ps,exports.ForwardCheckpointsView=Os,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ms,getSliceComponentProps:r,separator:o,debugIds:l})=>vs(P(Be(e,s),(o=>Ne(t,as(ds({},es(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>Rs(e,Qe,e.firstRowId),exports.LocalRowsView=e=>Rs(e,Fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return vs(null!=(o=Me(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:i,queriesById:d,checkpoints:a,checkpointsById:p,children:c})=>{const x=xs(W),[I,C]=Cs([{},{},{},{},{},{}]),b=cs(((e,s,t)=>C((r=>F(r[e],s)==t?r:O(r,e,as(ds({},r[e]),{[s]:t}))))),[]),w=cs(((e,s)=>C((t=>Q(t[e],s)?O(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return Ne(W.Provider,{value:Is((()=>[null!=e?e:x[0],ds(ds(ds({},x[1]),s),I[0]),null!=t?t:x[2],ds(ds(ds({},x[3]),r),I[1]),null!=o?o:x[4],ds(ds(ds({},x[5]),l),I[2]),null!=u?u:x[6],ds(ds(ds({},x[7]),n),I[3]),null!=i?i:x[8],ds(ds(ds({},x[9]),d),I[4]),null!=a?a:x[10],ds(ds(ds({},x[11]),p),I[5]),b,w]),[e,s,I,t,r,o,l,u,n,i,d,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=ys,getRowComponentProps:o,debugIds:l})=>{const[u,n,,i]=ss(ee(t),e),d=De(e,s,u);return vs(y(i)||y(d)?null:Ne(r,as(ds({},es(o,d)),{key:d,tableId:i,rowId:d,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=Ss,exports.ResultRowView=Vs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ps(s,["cellId","descending","offset","limit"]);return ws(u,Ee(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>ws(e,je(e.queryId,e.queries)),exports.RowView=ys,exports.SliceView=ms,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ps(s,["cellId","descending","offset","limit"]);return bs(u,fe(u.tableId,t,r,o,l,u.store))},exports.TableView=hs,exports.TablesView=({store:e,tableComponent:s=hs,getTableComponentProps:t,separator:r,debugIds:o})=>vs(P(Se(e),(r=>Ne(s,as(ds({},es(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=Ls,exports.ValuesView=({store:e,valueComponent:s=Ls,getValueComponentProps:t,separator:r,debugIds:o})=>vs(P(Oe(e),(r=>Ne(s,as(ds({},es(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=xe,r,o=V,l=xe,u=!0)=>{const n=Y(r);return ue((t=>h(n,(r=>h(s(t,r),(s=>o(r.addRow(m(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=Pe,exports.useCellIds=Te,exports.useCellIdsListener=(e,s,t,r,o,l)=>ve(w,Y(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>ve(b,Y(u),r,o,[e,s,t],l),exports.useCheckpoint=ze,exports.useCheckpointIds=We,exports.useCheckpointIdsListener=(e,s,t)=>ve("CheckpointIds",te(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>ve("Checkpoint",te(r),s,t,[e]),exports.useCheckpoints=e=>J(e,10),exports.useCheckpointsIds=()=>X(11),exports.useCheckpointsOrCheckpointsById=te,exports.useCreateCheckpoints=(e,s,t)=>we(e,s,t),exports.useCreateIndexes=(e,s,t)=>we(e,s,t),exports.useCreateMergeableStore=(e,s=xe)=>ie(e,s),exports.useCreateMetrics=(e,s,t)=>we(e,s,t),exports.useCreatePersister=(e,s,t=xe,r,o=xe,l,u=xe)=>{const[,n]=pe(),[i,d]=pe();return ne((()=>{le(void 0,null,(function*(){const t=e?yield s(e):void 0;d(t),t&&r&&le(void 0,null,(function*(){yield r(t),n([])}))}))}),[e,...t,...o]),ne((()=>()=>{i&&(i.destroy(),null==l||l(i))}),[i,...u]),i},exports.useCreateQueries=(e,s,t)=>we(e,s,t),exports.useCreateRelationships=(e,s,t)=>we(e,s,t),exports.useCreateStore=(e,s=xe)=>ie(e,s),exports.useCreateSynchronizer=(e,s,t=xe,r,o=xe)=>{const[l,u]=pe();return ne((()=>{le(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ne((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>Le(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Le(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Le(s,d,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Le(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>Le(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Le(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ve("DidFinish"+oe,Y(t),e,s),exports.useGoBackwardCallback=Ue,exports.useGoForwardCallback=_e,exports.useGoToCallback=(e,s=xe,t,r=V,o=xe)=>{const l=te(t);return ue((s=>h(l,(t=>h(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ke(b,Y(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>ve(n+b,Y(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ke(c,Y(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>ve(n+c,Y(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ke(d,Y(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ke(d+b,Y(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>ve(n+d+b,Y(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>ve(n+d,Y(o),s,t,[e],r),exports.useHasTables=e=>ke(a,Y(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>ve(n+a,Y(r),e,s,[],t),exports.useHasValue=(e,s)=>ke(R,Y(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>ve(n+R,Y(o),s,t,[e],r),exports.useHasValues=e=>ke(k,Y(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>ve(n+k,Y(r),e,s,[],t),exports.useIndexIds=e=>ke("IndexIds",$(e),1),exports.useIndexes=e=>J(e,4),exports.useIndexesIds=()=>X(5),exports.useIndexesOrIndexesById=$,exports.useLinkedRowIds=Qe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>ve("Linked"+I,ee(o),t,r,[e,s]),exports.useLocalRowIds=Fe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>ve("Local"+I,ee(o),t,r,[e,s]),exports.useMetric=Me,exports.useMetricIds=e=>ke("MetricIds",Z(e),1),exports.useMetricListener=(e,s,t,r)=>ve("Metric",Z(r),s,t,[e]),exports.useMetrics=e=>J(e,2),exports.useMetricsIds=()=>X(3),exports.useMetricsOrMetricsById=Z,exports.useProvideCheckpoints=(e,s)=>N(e,s,5),exports.useProvideIndexes=(e,s)=>N(e,s,2),exports.useProvideMetrics=(e,s)=>N(e,s,1),exports.useProvideQueries=(e,s)=>N(e,s,4),exports.useProvideRelationships=(e,s)=>N(e,s,3),exports.useProvideStore=(e,s)=>N(e,s,0),exports.useQueries=e=>J(e,8),exports.useQueriesIds=()=>X(9),exports.useQueriesOrQueriesById=se,exports.useQueryIds=e=>ke("QueryIds",se(e),1),exports.useRedoInformation=e=>{var s;const r=te(e),[,,[o]]=We(r);return[!y(o),_e(r),o,null!=(s=h(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ke("RelationshipIds",ee(e),1),exports.useRelationships=e=>J(e,6),exports.useRelationshipsIds=()=>X(7),exports.useRelationshipsOrRelationshipsById=ee,exports.useRemoteRowId=De,exports.useRemoteRowIdListener=(e,s,t,r,o)=>ve("RemoteRowId",ee(o),t,r,[e,s]),exports.useResultCell=Ge,exports.useResultCellIds=Ae,exports.useResultCellIdsListener=(e,s,t,r,o)=>ve(u+w,se(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>ve(u+b,se(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ke(u+c,se(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ke(u+x,se(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>ve(u+x,se(r),s,t,[e]),exports.useResultRowIds=je,exports.useResultRowIdsListener=(e,s,t,r)=>ve(u+I,se(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>ve(u+c,se(o),t,r,[e,s]),exports.useResultSortedRowIds=Ee,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,i)=>ve(u+C,se(i),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ke(u+d,se(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ke(u+d+w,se(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>ve(u+d+w,se(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>ve(u+d,se(r),s,t,[e]),exports.useRow=(e,s,t)=>ke(c,Y(t),0,[e,s]),exports.useRowCount=(e,s)=>ke(x,Y(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>ve(x,Y(o),s,t,[e],r),exports.useRowIds=Ve,exports.useRowIdsListener=(e,s,t,r,o)=>ve(I,Y(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>ve(c,Y(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>ge(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=xe,t,r=V,o=xe)=>{const l=te(t);return ue((s=>h(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>ge(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>ge(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>ge(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>ge(r,d,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>ge(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>ge(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>ge(t,k,e,s,r,o),exports.useSliceIds=Be,exports.useSliceIdsListener=(e,s,t,r)=>ve("SliceIds",$(r),s,t,[e]),exports.useSliceRowIds=He,exports.useSliceRowIdsListener=(e,s,t,r,o)=>ve("Slice"+I,$(o),t,r,[e,s]),exports.useSortedRowIds=fe,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,i)=>ve(C,Y(i),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>ve("Start"+oe,Y(t),e,s),exports.useStore=e=>J(e,0),exports.useStoreIds=()=>X(1),exports.useStoreOrStoreById=Y,exports.useTable=(e,s)=>ke(d,Y(s),0,[e]),exports.useTableCellIds=(e,s)=>ke(d+w,Y(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>ve(d+w,Y(o),s,t,[e],r),exports.useTableIds=Se,exports.useTableIdsListener=(e,s,t,r)=>ve(p,Y(r),e,s,xe,t),exports.useTableListener=(e,s,t,r,o)=>ve(d,Y(o),s,t,[e],r),exports.useTables=e=>ke(a,Y(e),0),exports.useTablesListener=(e,s,t,r)=>ve(a,Y(r),e,s,xe,t),exports.useUndoInformation=e=>{var s;const r=te(e),[o,l]=We(r);return[(u=o,!(0==S(u))),Ue(r),l,null!=(s=h(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=qe,exports.useValueIds=Oe,exports.useValueIdsListener=(e,s,t,r)=>ve(v,Y(r),e,s,xe,t),exports.useValueListener=(e,s,t,r,o)=>ve(R,Y(o),s,t,[e],r),exports.useValues=e=>ke(k,Y(e),0),exports.useValuesListener=(e,s,t,r)=>ve(k,Y(r),e,s,xe,t),exports.useWillFinishTransactionListener=(e,s,t)=>ve("WillFinish"+oe,Y(t),e,s);
|
|
Binary file
|