tinybase 5.3.0-beta.0 → 5.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/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 +159 -0
- package/@types/ui-react/index.d.ts +159 -0
- package/@types/ui-react/with-schemas/index.d.cts +92 -0
- package/@types/ui-react/with-schemas/index.d.ts +92 -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/ui-react/index.cjs +99 -30
- package/cjs/es6/ui-react/with-schemas/index.cjs +99 -30
- 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/ui-react/index.cjs +73 -31
- package/cjs/ui-react/with-schemas/index.cjs +73 -31
- 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/ui-react/index.js +99 -30
- package/es6/ui-react/with-schemas/index.js +99 -30
- 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/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/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/ui-react/index.js +102 -34
- package/umd/es6/ui-react/with-schemas/index.js +102 -34
- 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/ui-react/index.js +77 -31
- package/umd/ui-react/with-schemas/index.js +77 -31
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
5
|
const getTypeOf = (thing) => typeof thing;
|
|
6
|
+
const TINYBASE = 'tinybase';
|
|
6
7
|
const EMPTY_STRING = '';
|
|
7
8
|
const STRING = getTypeOf(EMPTY_STRING);
|
|
8
9
|
const FUNCTION = getTypeOf(getTypeOf);
|
|
@@ -26,6 +27,7 @@ const VALUE = 'Value';
|
|
|
26
27
|
const VALUES = VALUE + 's';
|
|
27
28
|
const VALUE_IDS = VALUE + IDS;
|
|
28
29
|
|
|
30
|
+
const GLOBAL = globalThis;
|
|
29
31
|
const isUndefined = (thing) => thing == void 0;
|
|
30
32
|
const ifNotUndefined = (value, then, otherwise) =>
|
|
31
33
|
isUndefined(value) ? (otherwise == null ? void 0 : otherwise()) : then(value);
|
|
@@ -42,6 +44,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
42
44
|
const arrayMap = (array, cb) => array.map(cb);
|
|
43
45
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
44
46
|
const arrayFilter = (array, cb) => array.filter(cb);
|
|
47
|
+
const arrayWith = (array, index, value) => array.with(index, value);
|
|
45
48
|
|
|
46
49
|
const object = Object;
|
|
47
50
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -59,6 +62,7 @@ const isObject = (obj) =>
|
|
|
59
62
|
);
|
|
60
63
|
const objIds = object.keys;
|
|
61
64
|
const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
|
|
65
|
+
const objHas = (obj, id) => id in obj;
|
|
62
66
|
const objDel = (obj, id) => {
|
|
63
67
|
delete obj[id];
|
|
64
68
|
return obj;
|
|
@@ -77,9 +81,15 @@ const objIsEqual = (obj1, obj2) => {
|
|
|
77
81
|
)
|
|
78
82
|
);
|
|
79
83
|
};
|
|
84
|
+
const objEnsure = (obj, id, getDefaultValue) => {
|
|
85
|
+
if (!objHas(obj, id)) {
|
|
86
|
+
obj[id] = getDefaultValue();
|
|
87
|
+
}
|
|
88
|
+
return obj[id];
|
|
89
|
+
};
|
|
80
90
|
|
|
81
91
|
const {createContext, useContext: useContext$1, useEffect: useEffect$1} = React;
|
|
82
|
-
const Context = createContext([]);
|
|
92
|
+
const Context = objEnsure(GLOBAL, TINYBASE + '_uirc', () => createContext([]));
|
|
83
93
|
const useThing = (id, offset) => {
|
|
84
94
|
var _a;
|
|
85
95
|
const contextValue = useContext$1(Context);
|
|
@@ -95,6 +105,16 @@ const useThingOrThingById = (thingOrThingId, offset) => {
|
|
|
95
105
|
? thing
|
|
96
106
|
: thingOrThingId;
|
|
97
107
|
};
|
|
108
|
+
const useProvideThing = (thingId, thing, offset) => {
|
|
109
|
+
const {12: addExtraThingById, 13: delExtraThingById} = useContext$1(Context);
|
|
110
|
+
useEffect$1(() => {
|
|
111
|
+
addExtraThingById == null
|
|
112
|
+
? void 0
|
|
113
|
+
: addExtraThingById(offset, thingId, thing);
|
|
114
|
+
return () =>
|
|
115
|
+
delExtraThingById == null ? void 0 : delExtraThingById(offset, thingId);
|
|
116
|
+
}, [addExtraThingById, thingId, thing, offset, delExtraThingById]);
|
|
117
|
+
};
|
|
98
118
|
const useThingIds = (offset) => {
|
|
99
119
|
var _a;
|
|
100
120
|
return objIds((_a = useContext$1(Context)[offset]) != null ? _a : {});
|
|
@@ -102,28 +122,32 @@ const useThingIds = (offset) => {
|
|
|
102
122
|
const useStore = (id) => useThing(id, 0);
|
|
103
123
|
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
104
124
|
useThingOrThingById(storeOrStoreId, 0);
|
|
105
|
-
const useProvideStore = (storeId, store) =>
|
|
106
|
-
const {12: addExtraStore, 13: delExtraStore} = useContext$1(Context);
|
|
107
|
-
useEffect$1(() => {
|
|
108
|
-
addExtraStore == null ? void 0 : addExtraStore(storeId, store);
|
|
109
|
-
return () => (delExtraStore == null ? void 0 : delExtraStore(storeId));
|
|
110
|
-
}, [addExtraStore, storeId, store, delExtraStore]);
|
|
111
|
-
};
|
|
125
|
+
const useProvideStore = (storeId, store) => useProvideThing(storeId, store, 0);
|
|
112
126
|
const useMetrics = (id) => useThing(id, 2);
|
|
113
127
|
const useMetricsOrMetricsById = (metricsOrMetricsId) =>
|
|
114
128
|
useThingOrThingById(metricsOrMetricsId, 2);
|
|
129
|
+
const useProvideMetrics = (metricsId, metrics) =>
|
|
130
|
+
useProvideThing(metricsId, metrics, 1);
|
|
115
131
|
const useIndexes = (id) => useThing(id, 4);
|
|
116
132
|
const useIndexesOrIndexesById = (indexesOrIndexesId) =>
|
|
117
133
|
useThingOrThingById(indexesOrIndexesId, 4);
|
|
134
|
+
const useProvideIndexes = (indexesId, indexes) =>
|
|
135
|
+
useProvideThing(indexesId, indexes, 2);
|
|
118
136
|
const useRelationships = (id) => useThing(id, 6);
|
|
119
137
|
const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
|
|
120
138
|
useThingOrThingById(relationshipsOrRelationshipsId, 6);
|
|
139
|
+
const useProvideRelationships = (relationshipsId, relationships) =>
|
|
140
|
+
useProvideThing(relationshipsId, relationships, 3);
|
|
121
141
|
const useQueries = (id) => useThing(id, 8);
|
|
122
142
|
const useQueriesOrQueriesById = (queriesOrQueriesId) =>
|
|
123
143
|
useThingOrThingById(queriesOrQueriesId, 8);
|
|
144
|
+
const useProvideQueries = (queriesId, queries) =>
|
|
145
|
+
useProvideThing(queriesId, queries, 4);
|
|
124
146
|
const useCheckpoints = (id) => useThing(id, 10);
|
|
125
147
|
const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
|
|
126
148
|
useThingOrThingById(checkpointsOrCheckpointsId, 10);
|
|
149
|
+
const useProvideCheckpoints = (checkpointsId, checkpoints) =>
|
|
150
|
+
useProvideThing(checkpointsId, checkpoints, 5);
|
|
127
151
|
|
|
128
152
|
const lower = (str) => str.toLowerCase();
|
|
129
153
|
lower(LISTENER);
|
|
@@ -1692,20 +1716,39 @@ const Provider = ({
|
|
|
1692
1716
|
children,
|
|
1693
1717
|
}) => {
|
|
1694
1718
|
const parentValue = useContext(Context);
|
|
1695
|
-
const [
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1719
|
+
const [extraThingsById, setExtraThingsById] = useState([
|
|
1720
|
+
{},
|
|
1721
|
+
{},
|
|
1722
|
+
{},
|
|
1723
|
+
{},
|
|
1724
|
+
{},
|
|
1725
|
+
{},
|
|
1726
|
+
]);
|
|
1727
|
+
const addExtraThingById = useCallback(
|
|
1728
|
+
(thingOffset, id, thing) =>
|
|
1729
|
+
setExtraThingsById((extraThingsById2) =>
|
|
1730
|
+
objGet(extraThingsById2[thingOffset], id) == thing
|
|
1731
|
+
? extraThingsById2
|
|
1732
|
+
: arrayWith(
|
|
1733
|
+
extraThingsById2,
|
|
1734
|
+
thingOffset,
|
|
1735
|
+
__spreadProps(__spreadValues({}, extraThingsById2[thingOffset]), {
|
|
1736
|
+
[id]: thing,
|
|
1737
|
+
}),
|
|
1738
|
+
),
|
|
1702
1739
|
),
|
|
1703
1740
|
[],
|
|
1704
1741
|
);
|
|
1705
|
-
const
|
|
1706
|
-
(id) =>
|
|
1707
|
-
|
|
1708
|
-
|
|
1742
|
+
const delExtraThingById = useCallback(
|
|
1743
|
+
(thingOffset, id) =>
|
|
1744
|
+
setExtraThingsById((extraThingsById2) =>
|
|
1745
|
+
!objHas(extraThingsById2[thingOffset], id)
|
|
1746
|
+
? extraThingsById2
|
|
1747
|
+
: arrayWith(
|
|
1748
|
+
extraThingsById2,
|
|
1749
|
+
thingOffset,
|
|
1750
|
+
objDel(extraThingsById2[thingOffset], id),
|
|
1751
|
+
),
|
|
1709
1752
|
),
|
|
1710
1753
|
[],
|
|
1711
1754
|
);
|
|
@@ -1717,25 +1760,46 @@ const Provider = ({
|
|
|
1717
1760
|
store != null ? store : parentValue[0],
|
|
1718
1761
|
__spreadValues(
|
|
1719
1762
|
__spreadValues(__spreadValues({}, parentValue[1]), storesById),
|
|
1720
|
-
|
|
1763
|
+
extraThingsById[0],
|
|
1721
1764
|
),
|
|
1722
1765
|
metrics != null ? metrics : parentValue[2],
|
|
1723
|
-
__spreadValues(
|
|
1766
|
+
__spreadValues(
|
|
1767
|
+
__spreadValues(__spreadValues({}, parentValue[3]), metricsById),
|
|
1768
|
+
extraThingsById[1],
|
|
1769
|
+
),
|
|
1724
1770
|
indexes != null ? indexes : parentValue[4],
|
|
1725
|
-
__spreadValues(
|
|
1771
|
+
__spreadValues(
|
|
1772
|
+
__spreadValues(__spreadValues({}, parentValue[5]), indexesById),
|
|
1773
|
+
extraThingsById[2],
|
|
1774
|
+
),
|
|
1726
1775
|
relationships != null ? relationships : parentValue[6],
|
|
1727
|
-
__spreadValues(
|
|
1776
|
+
__spreadValues(
|
|
1777
|
+
__spreadValues(
|
|
1778
|
+
__spreadValues({}, parentValue[7]),
|
|
1779
|
+
relationshipsById,
|
|
1780
|
+
),
|
|
1781
|
+
extraThingsById[3],
|
|
1782
|
+
),
|
|
1728
1783
|
queries != null ? queries : parentValue[8],
|
|
1729
|
-
__spreadValues(
|
|
1784
|
+
__spreadValues(
|
|
1785
|
+
__spreadValues(__spreadValues({}, parentValue[9]), queriesById),
|
|
1786
|
+
extraThingsById[4],
|
|
1787
|
+
),
|
|
1730
1788
|
checkpoints != null ? checkpoints : parentValue[10],
|
|
1731
|
-
__spreadValues(
|
|
1732
|
-
|
|
1733
|
-
|
|
1789
|
+
__spreadValues(
|
|
1790
|
+
__spreadValues(
|
|
1791
|
+
__spreadValues({}, parentValue[11]),
|
|
1792
|
+
checkpointsById,
|
|
1793
|
+
),
|
|
1794
|
+
extraThingsById[5],
|
|
1795
|
+
),
|
|
1796
|
+
addExtraThingById,
|
|
1797
|
+
delExtraThingById,
|
|
1734
1798
|
],
|
|
1735
1799
|
[
|
|
1736
1800
|
store,
|
|
1737
1801
|
storesById,
|
|
1738
|
-
|
|
1802
|
+
extraThingsById,
|
|
1739
1803
|
metrics,
|
|
1740
1804
|
metricsById,
|
|
1741
1805
|
indexes,
|
|
@@ -1747,8 +1811,8 @@ const Provider = ({
|
|
|
1747
1811
|
checkpoints,
|
|
1748
1812
|
checkpointsById,
|
|
1749
1813
|
parentValue,
|
|
1750
|
-
|
|
1751
|
-
|
|
1814
|
+
addExtraThingById,
|
|
1815
|
+
delExtraThingById,
|
|
1752
1816
|
],
|
|
1753
1817
|
),
|
|
1754
1818
|
},
|
|
@@ -2162,6 +2226,11 @@ exports.useMetricListener = useMetricListener;
|
|
|
2162
2226
|
exports.useMetrics = useMetrics;
|
|
2163
2227
|
exports.useMetricsIds = useMetricsIds;
|
|
2164
2228
|
exports.useMetricsOrMetricsById = useMetricsOrMetricsById;
|
|
2229
|
+
exports.useProvideCheckpoints = useProvideCheckpoints;
|
|
2230
|
+
exports.useProvideIndexes = useProvideIndexes;
|
|
2231
|
+
exports.useProvideMetrics = useProvideMetrics;
|
|
2232
|
+
exports.useProvideQueries = useProvideQueries;
|
|
2233
|
+
exports.useProvideRelationships = useProvideRelationships;
|
|
2165
2234
|
exports.useProvideStore = useProvideStore;
|
|
2166
2235
|
exports.useQueries = useQueries;
|
|
2167
2236
|
exports.useQueriesIds = useQueriesIds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",a=p+"s",i=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,L=e=>null==e,h=(e,s,t)=>L(e)?t?.():s(e),y=e=>s(e)==o,m=e=>s(e)==r,S=e=>e.length,V=()=>{},T=(e,s)=>e.every(s),v=(e,s)=>S(e)===S(s)&&T(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),f=Object,q=e=>f.getPrototypeOf(e),B=f.entries,H=e=>!L(e)&&h(q(e),(e=>e==f.prototype||L(q(e))),(()=>!0)),M=f.keys,D=(e,s)=>h(e,(e=>e[s])),F=(e,s)=>(delete e[s],e),O=(e,s)=>{const t=B(e);return S(t)===S(M(s))&&T(t,(([e,t])=>H(t)?!!H(s[e])&&O(s[e],t):s[e]===t))},{createContext:Q,useContext:E,useEffect:A}=e,G=Q([]),W=(e,s)=>{const t=E(G);return L(e)?t[s]:y(e)?D(t[s+1]??{},e):e},j=(e,s)=>{const t=W(e,s);return L(e)||y(e)?t:e},z=e=>M(E(G)[e]??{}),U=e=>j(e,0),J=e=>j(e,2),K=e=>j(e,4),N=e=>j(e,6),X=e=>j(e,8),Y=e=>j(e,10),Z=e=>e.toLowerCase();Z(u);const $="Transaction";Z($);const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:oe,useState:re,useSyncExternalStore:ue}=e,le=[],ne=[{},[],[le,void 0,le],void 0,!1,0],de=[O,v,([e,s,t],[o,r,u])=>s===r&&v(e,o)&&v(t,u)],pe=(e,s)=>e===s,ae=(e,s,t=le)=>{const[,o]=re(),[r,u]=re();return ee((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},ie=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},xe=(e,s,o,r=le)=>{const u=oe(ne[o]),l=_((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ne[o];return(de[o]??pe)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=_((u=>ie(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ue(d,l)},ce=(e,s,t,o=le,r=le,...u)=>te((()=>ie(s,e,...r,t,...u)),[s,e,...r,...o,...u]),Ie=(e,s,t,o=le,r=V,u=le,...l)=>{const n=U(e);return _((e=>h(n,(o=>h(t(e,o),(t=>r(o["set"+s](...Ce(l,o,e),t),t)))))),[n,s,...o,...u,...be(l)])},Ce=(e,s,t)=>P(e,(e=>m(e)?e(t,s):e)),be=e=>{return s=e=>!m(e),e.filter(s);var s},we=(e,s,t=V,o=le,...r)=>{const u=U(e);return _((e=>t(u?.["del"+s](...Ce(r,u,e)))),[u,s,...o,...be(r)])},Re=(e,s,t)=>{const o=Y(e);return _((()=>o?.[s](t)),[o,s,t])},ke=e=>xe(i,U(e),1),ge=(e,s)=>xe(I,U(s),1,[e]),Le=(e,s,t,o=0,r,u)=>xe(C,U(u),1,[e,s,t,o,r]),he=(e,s,t)=>xe(w,U(t),1,[e,s]),ye=(e,s,t,o)=>xe(b,U(o),3,[e,s,t]),me=e=>xe(g,U(e),1),Se=(e,s)=>xe(R,U(s),3,[e]),Ve=(e,s)=>xe("Metric",J(s),3,[e]),Te=(e,s)=>xe("SliceIds",K(s),1,[e]),ve=(e,s,t)=>xe("Slice"+I,K(t),1,[e,s]),Pe=(e,s,t)=>xe("RemoteRowId",N(t),3,[e,s]),fe=(e,s,t)=>xe("Local"+I,N(t),1,[e,s]),qe=(e,s,t)=>xe("Linked"+I,N(t),1,[e,s]),Be=(e,s)=>xe(l+I,X(s),1,[e]),He=(e,s,t,o=0,r,u)=>xe(l+C,X(u),1,[e,s,t,o,r]),Me=(e,s,t)=>xe(l+w,X(t),1,[e,s]),De=(e,s,t,o)=>xe(l+b,X(o),3,[e,s,t]),Fe=e=>xe("CheckpointIds",Y(e),2),Oe=(e,s)=>xe("Checkpoint",Y(s),3,[e]),Qe=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Ae,Fragment:Ge,createElement:We,useCallback:je,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>L(e)?{}:e(...s),Ne=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:Xe,useContext:Ye,useMemo:Ze,useState:$e}=e,_e=({tableId:e,store:s,rowComponent:t=us,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>os(P(n,(u=>We(t,{...Ke(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),es=({queryId:e,queries:s,resultRowComponent:t=as,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>os(P(l,(r=>We(t,{...Ke(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),ss=({relationshipId:e,relationships:s,rowComponent:t=us,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,a]=Ne(N(s),e),i=l(e,n,d);return os(P(i,(e=>We(t,{...Ke(o,e),key:e,tableId:a,rowId:e,store:p,debugIds:u}))),r,u,n)},ts=e=>({checkpoints:s,checkpointComponent:t=is,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=Y(s);return os(P(e(Fe(l)),(e=>We(t,{...Ke(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},os=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},rs=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>os(t+(ye(e,s,o,r)??t),void 0,u,o),us=({tableId:e,rowId:s,store:t,cellComponent:o=rs,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>os(P(((e,s,t,o)=>{const r=he(s,t,o);return e??r})(u,e,s,t),(u=>We(o,{...Ke(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),ls=e=>_e(e,ge(e.tableId,e.store)),ns=({valueId:e,store:s,debugIds:o})=>os(t+(Se(e,s)??t),void 0,o,e),ds=({indexId:e,sliceId:s,indexes:t,rowComponent:o=us,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(K(t),e),a=ve(e,s,n);return os(P(a,(e=>We(o,{...Ke(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},ps=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>os(t+(De(e,s,o,r)??t),void 0,u,o),as=({queryId:e,rowId:s,queries:t,resultCellComponent:o=ps,getResultCellComponentProps:r,separator:u,debugIds:l})=>os(P(Me(e,s,t),(u=>We(o,{...Ke(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),is=({checkpoints:e,checkpointId:s,debugIds:o})=>os(Oe(s,e)??t,void 0,o,s),xs=ts((e=>e[0])),cs=ts((e=>L(e[1])?[]:[e[1]])),Is=ts((e=>e[2]));exports.BackwardCheckpointsView=xs,exports.CellView=rs,exports.CheckpointView=is,exports.CurrentCheckpointView=cs,exports.ForwardCheckpointsView=Is,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ds,getSliceComponentProps:o,separator:r,debugIds:u})=>os(P(Te(e,s),(r=>We(t,{...Ke(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>ss(e,qe,e.firstRowId),exports.LocalRowsView=e=>ss(e,fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>os(Ve(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:a,checkpointsById:i,children:x})=>{const c=Ye(G),[I,C]=$e({}),b=Xe(((e,s)=>C((t=>D(t,e)==s?t:{...t,[e]:s}))),[]),w=Xe((e=>C((s=>({...F(s,e)})))),[]);return We(G.Provider,{value:Ze((()=>[e??c[0],{...c[1],...s,...I},t??c[2],{...c[3],...o},r??c[4],{...c[5],...u},l??c[6],{...c[7],...n},d??c[8],{...c[9],...p},a??c[10],{...c[11],...i},b,w]),[e,s,I,t,o,r,u,l,n,d,p,a,i,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=us,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=Ne(N(t),e),p=Pe(e,s,l);return os(L(d)||L(p)?null:We(o,{...Ke(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=ps,exports.ResultRowView=as,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>es(r,He(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>es(e,Be(e.queryId,e.queries)),exports.RowView=us,exports.SliceView=ds,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>_e(r,Le(r.tableId,e,s,t,o,r.store)),exports.TableView=ls,exports.TablesView=({store:e,tableComponent:s=ls,getTableComponentProps:t,separator:o,debugIds:r})=>os(P(ke(e),(o=>We(s,{...Ke(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=ns,exports.ValuesView=({store:e,valueComponent:s=ns,getValueComponentProps:t,separator:o,debugIds:r})=>os(P(me(e),(o=>We(s,{...Ke(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=le,o,r=V,u=le,l=!0)=>{const n=U(o);return _((t=>h(n,(o=>h(s(t,o),(s=>r(o.addRow(m(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=ye,exports.useCellIds=he,exports.useCellIdsListener=(e,s,t,o,r,u)=>ce(w,U(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ce(b,U(l),o,r,[e,s,t],u),exports.useCheckpoint=Oe,exports.useCheckpointIds=Fe,exports.useCheckpointIdsListener=(e,s,t)=>ce("CheckpointIds",Y(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ce("Checkpoint",Y(o),s,t,[e]),exports.useCheckpoints=e=>W(e,10),exports.useCheckpointsIds=()=>z(11),exports.useCheckpointsOrCheckpointsById=Y,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=le)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=le,o,r=le,u,l=le)=>{const[,n]=re(),[d,p]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()})()}),[e,...t,...r]),ee((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=le)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=le,o,r=le)=>{const[u,l]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),ee((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>we(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>we(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>we(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,o)=>we(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ce("DidFinish"+$,U(t),e,s),exports.useGoBackwardCallback=Qe,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>xe(b,U(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ce(n+b,U(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>xe(x,U(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ce(n+x,U(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>xe(p,U(s),4,[e]),exports.useHasTableCell=(e,s,t)=>xe(p+b,U(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ce(n+p+b,U(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ce(n+p,U(r),s,t,[e],o),exports.useHasTables=e=>xe(a,U(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ce(n+a,U(o),e,s,[],t),exports.useHasValue=(e,s)=>xe(R,U(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ce(n+R,U(r),s,t,[e],o),exports.useHasValues=e=>xe(k,U(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ce(n+k,U(o),e,s,[],t),exports.useIndexIds=e=>xe("IndexIds",K(e),1),exports.useIndexes=e=>W(e,4),exports.useIndexesIds=()=>z(5),exports.useIndexesOrIndexesById=K,exports.useLinkedRowIds=qe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ce("Linked"+I,N(r),t,o,[e,s]),exports.useLocalRowIds=fe,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ce("Local"+I,N(r),t,o,[e,s]),exports.useMetric=Ve,exports.useMetricIds=e=>xe("MetricIds",J(e),1),exports.useMetricListener=(e,s,t,o)=>ce("Metric",J(o),s,t,[e]),exports.useMetrics=e=>W(e,2),exports.useMetricsIds=()=>z(3),exports.useMetricsOrMetricsById=J,exports.useProvideStore=(e,s)=>{const{12:t,13:o}=E(G);A((()=>(t?.(e,s),()=>o?.(e))),[t,e,s,o])},exports.useQueries=e=>W(e,8),exports.useQueriesIds=()=>z(9),exports.useQueriesOrQueriesById=X,exports.useQueryIds=e=>xe("QueryIds",X(e),1),exports.useRedoInformation=e=>{const s=Y(e),[,,[o]]=Fe(s);return[!L(o),Ee(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>xe("RelationshipIds",N(e),1),exports.useRelationships=e=>W(e,6),exports.useRelationshipsIds=()=>z(7),exports.useRelationshipsOrRelationshipsById=N,exports.useRemoteRowId=Pe,exports.useRemoteRowIdListener=(e,s,t,o,r)=>ce("RemoteRowId",N(r),t,o,[e,s]),exports.useResultCell=De,exports.useResultCellIds=Me,exports.useResultCellIdsListener=(e,s,t,o,r)=>ce(l+w,X(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ce(l+b,X(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>xe(l+x,X(t),0,[e,s]),exports.useResultRowCount=(e,s)=>xe(l+c,X(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ce(l+c,X(o),s,t,[e]),exports.useResultRowIds=Be,exports.useResultRowIdsListener=(e,s,t,o)=>ce(l+I,X(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ce(l+x,X(r),t,o,[e,s]),exports.useResultSortedRowIds=He,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ce(l+C,X(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>xe(l+p,X(s),0,[e]),exports.useResultTableCellIds=(e,s)=>xe(l+p+w,X(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ce(l+p+w,X(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ce(l+p,X(o),s,t,[e]),exports.useRow=(e,s,t)=>xe(x,U(t),0,[e,s]),exports.useRowCount=(e,s)=>xe(c,U(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ce(c,U(r),s,t,[e],o),exports.useRowIds=ge,exports.useRowIdsListener=(e,s,t,o,r)=>ce(I,U(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ce(x,U(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>Ie(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>Ie(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>Ie(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>Ie(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>Ie(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>Ie(t,a,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>Ie(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>Ie(t,k,e,s,o,r),exports.useSliceIds=Te,exports.useSliceIdsListener=(e,s,t,o)=>ce("SliceIds",K(o),s,t,[e]),exports.useSliceRowIds=ve,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ce("Slice"+I,K(r),t,o,[e,s]),exports.useSortedRowIds=Le,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ce(C,U(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ce("Start"+$,U(t),e,s),exports.useStore=e=>W(e,0),exports.useStoreIds=()=>z(1),exports.useStoreOrStoreById=U,exports.useTable=(e,s)=>xe(p,U(s),0,[e]),exports.useTableCellIds=(e,s)=>xe(p+w,U(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ce(p+w,U(r),s,t,[e],o),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,o)=>ce(i,U(o),e,s,le,t),exports.useTableListener=(e,s,t,o,r)=>ce(p,U(r),s,t,[e],o),exports.useTables=e=>xe(a,U(e),0),exports.useTablesListener=(e,s,t,o)=>ce(a,U(o),e,s,le,t),exports.useUndoInformation=e=>{const s=Y(e),[o,r]=Fe(s);return[(u=o,!(0==S(u))),Qe(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=Se,exports.useValueIds=me,exports.useValueIdsListener=(e,s,t,o)=>ce(g,U(o),e,s,le,t),exports.useValueListener=(e,s,t,o,r)=>ce(R,U(r),s,t,[e],o),exports.useValues=e=>xe(k,U(e),0),exports.useValuesListener=(e,s,t,o)=>ce(k,U(o),e,s,le,t),exports.useWillFinishTransactionListener=(e,s,t)=>ce("WillFinish"+$,U(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",i=p+"s",a=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,h=globalThis,L=e=>null==e,y=(e,s,t)=>L(e)?t?.():s(e),m=e=>s(e)==o,S=e=>s(e)==r,V=e=>e.length,T=()=>{},v=(e,s)=>e.every(s),P=(e,s)=>V(e)===V(s)&&v(e,((e,t)=>s[t]===e)),f=(e,s)=>e.map(s),q=(e,s,t)=>e.with(s,t),M=Object,B=e=>M.getPrototypeOf(e),H=M.entries,D=e=>!L(e)&&y(B(e),(e=>e==M.prototype||L(B(e))),(()=>!0)),F=M.keys,O=(e,s)=>y(e,(e=>e[s])),Q=(e,s)=>s in e,E=(e,s)=>{const t=H(e);return V(t)===V(F(s))&&v(t,(([e,t])=>D(t)?!!D(s[e])&&E(s[e],t):s[e]===t))},{createContext:A,useContext:G,useEffect:W}=e,j=(_=()=>A([]),Q(z=h,U="tinybase_uirc")||(z[U]=_()),z[U]);var z,U,_;const J=(e,s)=>{const t=G(j);return L(e)?t[s]:m(e)?O(t[s+1]??{},e):e},K=(e,s)=>{const t=J(e,s);return L(e)||m(e)?t:e},N=(e,s,t)=>{const{12:o,13:r}=G(j);W((()=>(o?.(t,e,s),()=>r?.(t,e))),[o,e,s,t,r])},X=e=>F(G(j)[e]??{}),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),oe=e=>e.toLowerCase();oe(u);const re="Transaction";oe(re);const{useCallback:ue,useEffect:le,useMemo:ne,useLayoutEffect:de,useRef:pe,useState:ie,useSyncExternalStore:ae}=e,xe=[],ce=[{},[],[xe,void 0,xe],void 0,!1,0],Ie=[E,P,([e,s,t],[o,r,u])=>s===r&&P(e,o)&&P(t,u)],Ce=(e,s)=>e===s,be=(e,s,t=xe)=>{const[,o]=ie(),[r,u]=ie();return le((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},we=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},Re=(e,s,o,r=xe)=>{const u=pe(ce[o]),l=ue((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ce[o];return(Ie[o]??Ce)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=ue((u=>we(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ae(d,l)},ke=(e,s,t,o=xe,r=xe,...u)=>de((()=>we(s,e,...r,t,...u)),[s,e,...r,...o,...u]),ge=(e,s,t,o=xe,r=T,u=xe,...l)=>{const n=Y(e);return ue((e=>y(n,(o=>y(t(e,o),(t=>r(o["set"+s](...he(l,o,e),t),t)))))),[n,s,...o,...u,...Le(l)])},he=(e,s,t)=>f(e,(e=>S(e)?e(t,s):e)),Le=e=>{return s=e=>!S(e),e.filter(s);var s},ye=(e,s,t=T,o=xe,...r)=>{const u=Y(e);return ue((e=>t(u?.["del"+s](...he(r,u,e)))),[u,s,...o,...Le(r)])},me=(e,s,t)=>{const o=te(e);return ue((()=>o?.[s](t)),[o,s,t])},Se=e=>Re(a,Y(e),1),Ve=(e,s)=>Re(I,Y(s),1,[e]),Te=(e,s,t,o=0,r,u)=>Re(C,Y(u),1,[e,s,t,o,r]),ve=(e,s,t)=>Re(w,Y(t),1,[e,s]),Pe=(e,s,t,o)=>Re(b,Y(o),3,[e,s,t]),fe=e=>Re(g,Y(e),1),qe=(e,s)=>Re(R,Y(s),3,[e]),Me=(e,s)=>Re("Metric",Z(s),3,[e]),Be=(e,s)=>Re("SliceIds",$(s),1,[e]),He=(e,s,t)=>Re("Slice"+I,$(t),1,[e,s]),De=(e,s,t)=>Re("RemoteRowId",ee(t),3,[e,s]),Fe=(e,s,t)=>Re("Local"+I,ee(t),1,[e,s]),Oe=(e,s,t)=>Re("Linked"+I,ee(t),1,[e,s]),Qe=(e,s)=>Re(l+I,se(s),1,[e]),Ee=(e,s,t,o=0,r,u)=>Re(l+C,se(u),1,[e,s,t,o,r]),Ae=(e,s,t)=>Re(l+w,se(t),1,[e,s]),Ge=(e,s,t,o)=>Re(l+b,se(o),3,[e,s,t]),We=e=>Re("CheckpointIds",te(e),2),je=(e,s)=>Re("Checkpoint",te(s),3,[e]),ze=e=>me(e,"goBackward"),Ue=e=>me(e,"goForward"),{PureComponent:_e,Fragment:Je,createElement:Ke,useCallback:Ne,useLayoutEffect:Xe,useRef:Ye,useState:Ze}=e,$e=(e,...s)=>L(e)?{}:e(...s),es=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:ss,useContext:ts,useMemo:os,useState:rs}=e,us=({tableId:e,store:s,rowComponent:t=as,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>ps(f(n,(u=>Ke(t,{...$e(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),ls=({queryId:e,queries:s,resultRowComponent:t=bs,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>ps(f(l,(r=>Ke(t,{...$e(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),ns=({relationshipId:e,relationships:s,rowComponent:t=as,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,i]=es(ee(s),e),a=l(e,n,d);return ps(f(a,(e=>Ke(t,{...$e(o,e),key:e,tableId:i,rowId:e,store:p,debugIds:u}))),r,u,n)},ds=e=>({checkpoints:s,checkpointComponent:t=ws,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=te(s);return ps(f(e(We(l)),(e=>Ke(t,{...$e(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},ps=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:f(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},is=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>ps(t+(Pe(e,s,o,r)??t),void 0,u,o),as=({tableId:e,rowId:s,store:t,cellComponent:o=is,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>ps(f(((e,s,t,o)=>{const r=ve(s,t,o);return e??r})(u,e,s,t),(u=>Ke(o,{...$e(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),xs=e=>us(e,Ve(e.tableId,e.store)),cs=({valueId:e,store:s,debugIds:o})=>ps(t+(qe(e,s)??t),void 0,o,e),Is=({indexId:e,sliceId:s,indexes:t,rowComponent:o=as,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])($(t),e),i=He(e,s,n);return ps(f(i,(e=>Ke(o,{...$e(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},Cs=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>ps(t+(Ge(e,s,o,r)??t),void 0,u,o),bs=({queryId:e,rowId:s,queries:t,resultCellComponent:o=Cs,getResultCellComponentProps:r,separator:u,debugIds:l})=>ps(f(Ae(e,s,t),(u=>Ke(o,{...$e(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),ws=({checkpoints:e,checkpointId:s,debugIds:o})=>ps(je(s,e)??t,void 0,o,s),Rs=ds((e=>e[0])),ks=ds((e=>L(e[1])?[]:[e[1]])),gs=ds((e=>e[2]));exports.BackwardCheckpointsView=Rs,exports.CellView=is,exports.CheckpointView=ws,exports.CurrentCheckpointView=ks,exports.ForwardCheckpointsView=gs,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Is,getSliceComponentProps:o,separator:r,debugIds:u})=>ps(f(Be(e,s),(r=>Ke(t,{...$e(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>ns(e,Oe,e.firstRowId),exports.LocalRowsView=e=>ns(e,Fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>ps(Me(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:i,checkpointsById:a,children:x})=>{const c=ts(j),[I,C]=rs([{},{},{},{},{},{}]),b=ss(((e,s,t)=>C((o=>O(o[e],s)==t?o:q(o,e,{...o[e],[s]:t})))),[]),w=ss(((e,s)=>C((t=>Q(t[e],s)?q(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return Ke(j.Provider,{value:os((()=>[e??c[0],{...c[1],...s,...I[0]},t??c[2],{...c[3],...o,...I[1]},r??c[4],{...c[5],...u,...I[2]},l??c[6],{...c[7],...n,...I[3]},d??c[8],{...c[9],...p,...I[4]},i??c[10],{...c[11],...a,...I[5]},b,w]),[e,s,I,t,o,r,u,l,n,d,p,i,a,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=as,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=es(ee(t),e),p=De(e,s,l);return ps(L(d)||L(p)?null:Ke(o,{...$e(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=Cs,exports.ResultRowView=bs,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>ls(r,Ee(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>ls(e,Qe(e.queryId,e.queries)),exports.RowView=as,exports.SliceView=Is,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>us(r,Te(r.tableId,e,s,t,o,r.store)),exports.TableView=xs,exports.TablesView=({store:e,tableComponent:s=xs,getTableComponentProps:t,separator:o,debugIds:r})=>ps(f(Se(e),(o=>Ke(s,{...$e(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=cs,exports.ValuesView=({store:e,valueComponent:s=cs,getValueComponentProps:t,separator:o,debugIds:r})=>ps(f(fe(e),(o=>Ke(s,{...$e(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=xe,o,r=T,u=xe,l=!0)=>{const n=Y(o);return ue((t=>y(n,(o=>y(s(t,o),(s=>r(o.addRow(S(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=Pe,exports.useCellIds=ve,exports.useCellIdsListener=(e,s,t,o,r,u)=>ke(w,Y(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ke(b,Y(l),o,r,[e,s,t],u),exports.useCheckpoint=je,exports.useCheckpointIds=We,exports.useCheckpointIdsListener=(e,s,t)=>ke("CheckpointIds",te(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ke("Checkpoint",te(o),s,t,[e]),exports.useCheckpoints=e=>J(e,10),exports.useCheckpointsIds=()=>X(11),exports.useCheckpointsOrCheckpointsById=te,exports.useCreateCheckpoints=(e,s,t)=>be(e,s,t),exports.useCreateIndexes=(e,s,t)=>be(e,s,t),exports.useCreateMergeableStore=(e,s=xe)=>ne(e,s),exports.useCreateMetrics=(e,s,t)=>be(e,s,t),exports.useCreatePersister=(e,s,t=xe,o,r=xe,u,l=xe)=>{const[,n]=ie(),[d,p]=ie();return le((()=>{(async()=>{const t=e?await s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()})()}),[e,...t,...r]),le((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>be(e,s,t),exports.useCreateRelationships=(e,s,t)=>be(e,s,t),exports.useCreateStore=(e,s=xe)=>ne(e,s),exports.useCreateSynchronizer=(e,s,t=xe,o,r=xe)=>{const[u,l]=ie();return le((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),le((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>ye(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>ye(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>ye(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>ye(e,i,s,t),exports.useDelValueCallback=(e,s,t,o)=>ye(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>ye(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ke("DidFinish"+re,Y(t),e,s),exports.useGoBackwardCallback=ze,exports.useGoForwardCallback=Ue,exports.useGoToCallback=(e,s=xe,t,o=T,r=xe)=>{const u=te(t);return ue((s=>y(u,(t=>y(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>Re(b,Y(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ke(n+b,Y(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>Re(x,Y(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ke(n+x,Y(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>Re(p,Y(s),4,[e]),exports.useHasTableCell=(e,s,t)=>Re(p+b,Y(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ke(n+p+b,Y(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ke(n+p,Y(r),s,t,[e],o),exports.useHasTables=e=>Re(i,Y(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ke(n+i,Y(o),e,s,[],t),exports.useHasValue=(e,s)=>Re(R,Y(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ke(n+R,Y(r),s,t,[e],o),exports.useHasValues=e=>Re(k,Y(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ke(n+k,Y(o),e,s,[],t),exports.useIndexIds=e=>Re("IndexIds",$(e),1),exports.useIndexes=e=>J(e,4),exports.useIndexesIds=()=>X(5),exports.useIndexesOrIndexesById=$,exports.useLinkedRowIds=Oe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ke("Linked"+I,ee(r),t,o,[e,s]),exports.useLocalRowIds=Fe,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ke("Local"+I,ee(r),t,o,[e,s]),exports.useMetric=Me,exports.useMetricIds=e=>Re("MetricIds",Z(e),1),exports.useMetricListener=(e,s,t,o)=>ke("Metric",Z(o),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=>Re("QueryIds",se(e),1),exports.useRedoInformation=e=>{const s=te(e),[,,[o]]=We(s);return[!L(o),Ue(s),o,y(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>Re("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,o,r)=>ke("RemoteRowId",ee(r),t,o,[e,s]),exports.useResultCell=Ge,exports.useResultCellIds=Ae,exports.useResultCellIdsListener=(e,s,t,o,r)=>ke(l+w,se(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ke(l+b,se(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>Re(l+x,se(t),0,[e,s]),exports.useResultRowCount=(e,s)=>Re(l+c,se(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ke(l+c,se(o),s,t,[e]),exports.useResultRowIds=Qe,exports.useResultRowIdsListener=(e,s,t,o)=>ke(l+I,se(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ke(l+x,se(r),t,o,[e,s]),exports.useResultSortedRowIds=Ee,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ke(l+C,se(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>Re(l+p,se(s),0,[e]),exports.useResultTableCellIds=(e,s)=>Re(l+p+w,se(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ke(l+p+w,se(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ke(l+p,se(o),s,t,[e]),exports.useRow=(e,s,t)=>Re(x,Y(t),0,[e,s]),exports.useRowCount=(e,s)=>Re(c,Y(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ke(c,Y(r),s,t,[e],o),exports.useRowIds=Ve,exports.useRowIdsListener=(e,s,t,o,r)=>ke(I,Y(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ke(x,Y(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>ge(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=T,s=xe,t,o=T,r=xe)=>{const u=te(t);return ue((s=>y(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>ge(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>ge(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>ge(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>ge(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>ge(t,i,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>ge(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>ge(t,k,e,s,o,r),exports.useSliceIds=Be,exports.useSliceIdsListener=(e,s,t,o)=>ke("SliceIds",$(o),s,t,[e]),exports.useSliceRowIds=He,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ke("Slice"+I,$(r),t,o,[e,s]),exports.useSortedRowIds=Te,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ke(C,Y(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ke("Start"+re,Y(t),e,s),exports.useStore=e=>J(e,0),exports.useStoreIds=()=>X(1),exports.useStoreOrStoreById=Y,exports.useTable=(e,s)=>Re(p,Y(s),0,[e]),exports.useTableCellIds=(e,s)=>Re(p+w,Y(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ke(p+w,Y(r),s,t,[e],o),exports.useTableIds=Se,exports.useTableIdsListener=(e,s,t,o)=>ke(a,Y(o),e,s,xe,t),exports.useTableListener=(e,s,t,o,r)=>ke(p,Y(r),s,t,[e],o),exports.useTables=e=>Re(i,Y(e),0),exports.useTablesListener=(e,s,t,o)=>ke(i,Y(o),e,s,xe,t),exports.useUndoInformation=e=>{const s=te(e),[o,r]=We(s);return[(u=o,!(0==V(u))),ze(s),r,y(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=qe,exports.useValueIds=fe,exports.useValueIdsListener=(e,s,t,o)=>ke(g,Y(o),e,s,xe,t),exports.useValueListener=(e,s,t,o,r)=>ke(R,Y(r),s,t,[e],o),exports.useValues=e=>Re(k,Y(e),0),exports.useValuesListener=(e,s,t,o)=>ke(k,Y(o),e,s,xe,t),exports.useWillFinishTransactionListener=(e,s,t)=>ke("WillFinish"+re,Y(t),e,s);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",a=p+"s",i=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,L=e=>null==e,h=(e,s,t)=>L(e)?t?.():s(e),y=e=>s(e)==o,m=e=>s(e)==r,S=e=>e.length,V=()=>{},T=(e,s)=>e.every(s),v=(e,s)=>S(e)===S(s)&&T(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),f=Object,q=e=>f.getPrototypeOf(e),B=f.entries,H=e=>!L(e)&&h(q(e),(e=>e==f.prototype||L(q(e))),(()=>!0)),M=f.keys,D=(e,s)=>h(e,(e=>e[s])),F=(e,s)=>(delete e[s],e),O=(e,s)=>{const t=B(e);return S(t)===S(M(s))&&T(t,(([e,t])=>H(t)?!!H(s[e])&&O(s[e],t):s[e]===t))},{createContext:Q,useContext:E,useEffect:A}=e,G=Q([]),W=(e,s)=>{const t=E(G);return L(e)?t[s]:y(e)?D(t[s+1]??{},e):e},j=(e,s)=>{const t=W(e,s);return L(e)||y(e)?t:e},z=e=>M(E(G)[e]??{}),U=e=>j(e,0),J=e=>j(e,2),K=e=>j(e,4),N=e=>j(e,6),X=e=>j(e,8),Y=e=>j(e,10),Z=e=>e.toLowerCase();Z(u);const $="Transaction";Z($);const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:oe,useState:re,useSyncExternalStore:ue}=e,le=[],ne=[{},[],[le,void 0,le],void 0,!1,0],de=[O,v,([e,s,t],[o,r,u])=>s===r&&v(e,o)&&v(t,u)],pe=(e,s)=>e===s,ae=(e,s,t=le)=>{const[,o]=re(),[r,u]=re();return ee((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},ie=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},xe=(e,s,o,r=le)=>{const u=oe(ne[o]),l=_((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ne[o];return(de[o]??pe)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=_((u=>ie(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ue(d,l)},ce=(e,s,t,o=le,r=le,...u)=>te((()=>ie(s,e,...r,t,...u)),[s,e,...r,...o,...u]),Ie=(e,s,t,o=le,r=V,u=le,...l)=>{const n=U(e);return _((e=>h(n,(o=>h(t(e,o),(t=>r(o["set"+s](...Ce(l,o,e),t),t)))))),[n,s,...o,...u,...be(l)])},Ce=(e,s,t)=>P(e,(e=>m(e)?e(t,s):e)),be=e=>{return s=e=>!m(e),e.filter(s);var s},we=(e,s,t=V,o=le,...r)=>{const u=U(e);return _((e=>t(u?.["del"+s](...Ce(r,u,e)))),[u,s,...o,...be(r)])},Re=(e,s,t)=>{const o=Y(e);return _((()=>o?.[s](t)),[o,s,t])},ke=e=>xe(i,U(e),1),ge=(e,s)=>xe(I,U(s),1,[e]),Le=(e,s,t,o=0,r,u)=>xe(C,U(u),1,[e,s,t,o,r]),he=(e,s,t)=>xe(w,U(t),1,[e,s]),ye=(e,s,t,o)=>xe(b,U(o),3,[e,s,t]),me=e=>xe(g,U(e),1),Se=(e,s)=>xe(R,U(s),3,[e]),Ve=(e,s)=>xe("Metric",J(s),3,[e]),Te=(e,s)=>xe("SliceIds",K(s),1,[e]),ve=(e,s,t)=>xe("Slice"+I,K(t),1,[e,s]),Pe=(e,s,t)=>xe("RemoteRowId",N(t),3,[e,s]),fe=(e,s,t)=>xe("Local"+I,N(t),1,[e,s]),qe=(e,s,t)=>xe("Linked"+I,N(t),1,[e,s]),Be=(e,s)=>xe(l+I,X(s),1,[e]),He=(e,s,t,o=0,r,u)=>xe(l+C,X(u),1,[e,s,t,o,r]),Me=(e,s,t)=>xe(l+w,X(t),1,[e,s]),De=(e,s,t,o)=>xe(l+b,X(o),3,[e,s,t]),Fe=e=>xe("CheckpointIds",Y(e),2),Oe=(e,s)=>xe("Checkpoint",Y(s),3,[e]),Qe=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Ae,Fragment:Ge,createElement:We,useCallback:je,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>L(e)?{}:e(...s),Ne=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:Xe,useContext:Ye,useMemo:Ze,useState:$e}=e,_e=({tableId:e,store:s,rowComponent:t=us,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>os(P(n,(u=>We(t,{...Ke(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),es=({queryId:e,queries:s,resultRowComponent:t=as,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>os(P(l,(r=>We(t,{...Ke(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),ss=({relationshipId:e,relationships:s,rowComponent:t=us,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,a]=Ne(N(s),e),i=l(e,n,d);return os(P(i,(e=>We(t,{...Ke(o,e),key:e,tableId:a,rowId:e,store:p,debugIds:u}))),r,u,n)},ts=e=>({checkpoints:s,checkpointComponent:t=is,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=Y(s);return os(P(e(Fe(l)),(e=>We(t,{...Ke(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},os=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},rs=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>os(t+(ye(e,s,o,r)??t),void 0,u,o),us=({tableId:e,rowId:s,store:t,cellComponent:o=rs,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>os(P(((e,s,t,o)=>{const r=he(s,t,o);return e??r})(u,e,s,t),(u=>We(o,{...Ke(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),ls=e=>_e(e,ge(e.tableId,e.store)),ns=({valueId:e,store:s,debugIds:o})=>os(t+(Se(e,s)??t),void 0,o,e),ds=({indexId:e,sliceId:s,indexes:t,rowComponent:o=us,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(K(t),e),a=ve(e,s,n);return os(P(a,(e=>We(o,{...Ke(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},ps=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>os(t+(De(e,s,o,r)??t),void 0,u,o),as=({queryId:e,rowId:s,queries:t,resultCellComponent:o=ps,getResultCellComponentProps:r,separator:u,debugIds:l})=>os(P(Me(e,s,t),(u=>We(o,{...Ke(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),is=({checkpoints:e,checkpointId:s,debugIds:o})=>os(Oe(s,e)??t,void 0,o,s),xs=ts((e=>e[0])),cs=ts((e=>L(e[1])?[]:[e[1]])),Is=ts((e=>e[2]));exports.BackwardCheckpointsView=xs,exports.CellView=rs,exports.CheckpointView=is,exports.CurrentCheckpointView=cs,exports.ForwardCheckpointsView=Is,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ds,getSliceComponentProps:o,separator:r,debugIds:u})=>os(P(Te(e,s),(r=>We(t,{...Ke(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>ss(e,qe,e.firstRowId),exports.LocalRowsView=e=>ss(e,fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>os(Ve(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:a,checkpointsById:i,children:x})=>{const c=Ye(G),[I,C]=$e({}),b=Xe(((e,s)=>C((t=>D(t,e)==s?t:{...t,[e]:s}))),[]),w=Xe((e=>C((s=>({...F(s,e)})))),[]);return We(G.Provider,{value:Ze((()=>[e??c[0],{...c[1],...s,...I},t??c[2],{...c[3],...o},r??c[4],{...c[5],...u},l??c[6],{...c[7],...n},d??c[8],{...c[9],...p},a??c[10],{...c[11],...i},b,w]),[e,s,I,t,o,r,u,l,n,d,p,a,i,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=us,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=Ne(N(t),e),p=Pe(e,s,l);return os(L(d)||L(p)?null:We(o,{...Ke(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=ps,exports.ResultRowView=as,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>es(r,He(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>es(e,Be(e.queryId,e.queries)),exports.RowView=us,exports.SliceView=ds,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>_e(r,Le(r.tableId,e,s,t,o,r.store)),exports.TableView=ls,exports.TablesView=({store:e,tableComponent:s=ls,getTableComponentProps:t,separator:o,debugIds:r})=>os(P(ke(e),(o=>We(s,{...Ke(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=ns,exports.ValuesView=({store:e,valueComponent:s=ns,getValueComponentProps:t,separator:o,debugIds:r})=>os(P(me(e),(o=>We(s,{...Ke(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=le,o,r=V,u=le,l=!0)=>{const n=U(o);return _((t=>h(n,(o=>h(s(t,o),(s=>r(o.addRow(m(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=ye,exports.useCellIds=he,exports.useCellIdsListener=(e,s,t,o,r,u)=>ce(w,U(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ce(b,U(l),o,r,[e,s,t],u),exports.useCheckpoint=Oe,exports.useCheckpointIds=Fe,exports.useCheckpointIdsListener=(e,s,t)=>ce("CheckpointIds",Y(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ce("Checkpoint",Y(o),s,t,[e]),exports.useCheckpoints=e=>W(e,10),exports.useCheckpointsIds=()=>z(11),exports.useCheckpointsOrCheckpointsById=Y,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=le)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=le,o,r=le,u,l=le)=>{const[,n]=re(),[d,p]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()})()}),[e,...t,...r]),ee((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=le)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=le,o,r=le)=>{const[u,l]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),ee((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>we(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>we(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>we(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,o)=>we(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ce("DidFinish"+$,U(t),e,s),exports.useGoBackwardCallback=Qe,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>xe(b,U(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ce(n+b,U(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>xe(x,U(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ce(n+x,U(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>xe(p,U(s),4,[e]),exports.useHasTableCell=(e,s,t)=>xe(p+b,U(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ce(n+p+b,U(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ce(n+p,U(r),s,t,[e],o),exports.useHasTables=e=>xe(a,U(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ce(n+a,U(o),e,s,[],t),exports.useHasValue=(e,s)=>xe(R,U(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ce(n+R,U(r),s,t,[e],o),exports.useHasValues=e=>xe(k,U(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ce(n+k,U(o),e,s,[],t),exports.useIndexIds=e=>xe("IndexIds",K(e),1),exports.useIndexes=e=>W(e,4),exports.useIndexesIds=()=>z(5),exports.useIndexesOrIndexesById=K,exports.useLinkedRowIds=qe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ce("Linked"+I,N(r),t,o,[e,s]),exports.useLocalRowIds=fe,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ce("Local"+I,N(r),t,o,[e,s]),exports.useMetric=Ve,exports.useMetricIds=e=>xe("MetricIds",J(e),1),exports.useMetricListener=(e,s,t,o)=>ce("Metric",J(o),s,t,[e]),exports.useMetrics=e=>W(e,2),exports.useMetricsIds=()=>z(3),exports.useMetricsOrMetricsById=J,exports.useProvideStore=(e,s)=>{const{12:t,13:o}=E(G);A((()=>(t?.(e,s),()=>o?.(e))),[t,e,s,o])},exports.useQueries=e=>W(e,8),exports.useQueriesIds=()=>z(9),exports.useQueriesOrQueriesById=X,exports.useQueryIds=e=>xe("QueryIds",X(e),1),exports.useRedoInformation=e=>{const s=Y(e),[,,[o]]=Fe(s);return[!L(o),Ee(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>xe("RelationshipIds",N(e),1),exports.useRelationships=e=>W(e,6),exports.useRelationshipsIds=()=>z(7),exports.useRelationshipsOrRelationshipsById=N,exports.useRemoteRowId=Pe,exports.useRemoteRowIdListener=(e,s,t,o,r)=>ce("RemoteRowId",N(r),t,o,[e,s]),exports.useResultCell=De,exports.useResultCellIds=Me,exports.useResultCellIdsListener=(e,s,t,o,r)=>ce(l+w,X(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ce(l+b,X(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>xe(l+x,X(t),0,[e,s]),exports.useResultRowCount=(e,s)=>xe(l+c,X(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ce(l+c,X(o),s,t,[e]),exports.useResultRowIds=Be,exports.useResultRowIdsListener=(e,s,t,o)=>ce(l+I,X(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ce(l+x,X(r),t,o,[e,s]),exports.useResultSortedRowIds=He,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ce(l+C,X(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>xe(l+p,X(s),0,[e]),exports.useResultTableCellIds=(e,s)=>xe(l+p+w,X(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ce(l+p+w,X(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ce(l+p,X(o),s,t,[e]),exports.useRow=(e,s,t)=>xe(x,U(t),0,[e,s]),exports.useRowCount=(e,s)=>xe(c,U(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ce(c,U(r),s,t,[e],o),exports.useRowIds=ge,exports.useRowIdsListener=(e,s,t,o,r)=>ce(I,U(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ce(x,U(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>Ie(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>Ie(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>Ie(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>Ie(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>Ie(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>Ie(t,a,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>Ie(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>Ie(t,k,e,s,o,r),exports.useSliceIds=Te,exports.useSliceIdsListener=(e,s,t,o)=>ce("SliceIds",K(o),s,t,[e]),exports.useSliceRowIds=ve,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ce("Slice"+I,K(r),t,o,[e,s]),exports.useSortedRowIds=Le,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ce(C,U(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ce("Start"+$,U(t),e,s),exports.useStore=e=>W(e,0),exports.useStoreIds=()=>z(1),exports.useStoreOrStoreById=U,exports.useTable=(e,s)=>xe(p,U(s),0,[e]),exports.useTableCellIds=(e,s)=>xe(p+w,U(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ce(p+w,U(r),s,t,[e],o),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,o)=>ce(i,U(o),e,s,le,t),exports.useTableListener=(e,s,t,o,r)=>ce(p,U(r),s,t,[e],o),exports.useTables=e=>xe(a,U(e),0),exports.useTablesListener=(e,s,t,o)=>ce(a,U(o),e,s,le,t),exports.useUndoInformation=e=>{const s=Y(e),[o,r]=Fe(s);return[(u=o,!(0==S(u))),Qe(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=Se,exports.useValueIds=me,exports.useValueIdsListener=(e,s,t,o)=>ce(g,U(o),e,s,le,t),exports.useValueListener=(e,s,t,o,r)=>ce(R,U(r),s,t,[e],o),exports.useValues=e=>xe(k,U(e),0),exports.useValuesListener=(e,s,t,o)=>ce(k,U(o),e,s,le,t),exports.useWillFinishTransactionListener=(e,s,t)=>ce("WillFinish"+$,U(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",i=p+"s",a=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,h=globalThis,L=e=>null==e,y=(e,s,t)=>L(e)?t?.():s(e),m=e=>s(e)==o,S=e=>s(e)==r,V=e=>e.length,T=()=>{},v=(e,s)=>e.every(s),P=(e,s)=>V(e)===V(s)&&v(e,((e,t)=>s[t]===e)),f=(e,s)=>e.map(s),q=(e,s,t)=>e.with(s,t),M=Object,B=e=>M.getPrototypeOf(e),H=M.entries,D=e=>!L(e)&&y(B(e),(e=>e==M.prototype||L(B(e))),(()=>!0)),F=M.keys,O=(e,s)=>y(e,(e=>e[s])),Q=(e,s)=>s in e,E=(e,s)=>{const t=H(e);return V(t)===V(F(s))&&v(t,(([e,t])=>D(t)?!!D(s[e])&&E(s[e],t):s[e]===t))},{createContext:A,useContext:G,useEffect:W}=e,j=(_=()=>A([]),Q(z=h,U="tinybase_uirc")||(z[U]=_()),z[U]);var z,U,_;const J=(e,s)=>{const t=G(j);return L(e)?t[s]:m(e)?O(t[s+1]??{},e):e},K=(e,s)=>{const t=J(e,s);return L(e)||m(e)?t:e},N=(e,s,t)=>{const{12:o,13:r}=G(j);W((()=>(o?.(t,e,s),()=>r?.(t,e))),[o,e,s,t,r])},X=e=>F(G(j)[e]??{}),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),oe=e=>e.toLowerCase();oe(u);const re="Transaction";oe(re);const{useCallback:ue,useEffect:le,useMemo:ne,useLayoutEffect:de,useRef:pe,useState:ie,useSyncExternalStore:ae}=e,xe=[],ce=[{},[],[xe,void 0,xe],void 0,!1,0],Ie=[E,P,([e,s,t],[o,r,u])=>s===r&&P(e,o)&&P(t,u)],Ce=(e,s)=>e===s,be=(e,s,t=xe)=>{const[,o]=ie(),[r,u]=ie();return le((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},we=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},Re=(e,s,o,r=xe)=>{const u=pe(ce[o]),l=ue((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ce[o];return(Ie[o]??Ce)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=ue((u=>we(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ae(d,l)},ke=(e,s,t,o=xe,r=xe,...u)=>de((()=>we(s,e,...r,t,...u)),[s,e,...r,...o,...u]),ge=(e,s,t,o=xe,r=T,u=xe,...l)=>{const n=Y(e);return ue((e=>y(n,(o=>y(t(e,o),(t=>r(o["set"+s](...he(l,o,e),t),t)))))),[n,s,...o,...u,...Le(l)])},he=(e,s,t)=>f(e,(e=>S(e)?e(t,s):e)),Le=e=>{return s=e=>!S(e),e.filter(s);var s},ye=(e,s,t=T,o=xe,...r)=>{const u=Y(e);return ue((e=>t(u?.["del"+s](...he(r,u,e)))),[u,s,...o,...Le(r)])},me=(e,s,t)=>{const o=te(e);return ue((()=>o?.[s](t)),[o,s,t])},Se=e=>Re(a,Y(e),1),Ve=(e,s)=>Re(I,Y(s),1,[e]),Te=(e,s,t,o=0,r,u)=>Re(C,Y(u),1,[e,s,t,o,r]),ve=(e,s,t)=>Re(w,Y(t),1,[e,s]),Pe=(e,s,t,o)=>Re(b,Y(o),3,[e,s,t]),fe=e=>Re(g,Y(e),1),qe=(e,s)=>Re(R,Y(s),3,[e]),Me=(e,s)=>Re("Metric",Z(s),3,[e]),Be=(e,s)=>Re("SliceIds",$(s),1,[e]),He=(e,s,t)=>Re("Slice"+I,$(t),1,[e,s]),De=(e,s,t)=>Re("RemoteRowId",ee(t),3,[e,s]),Fe=(e,s,t)=>Re("Local"+I,ee(t),1,[e,s]),Oe=(e,s,t)=>Re("Linked"+I,ee(t),1,[e,s]),Qe=(e,s)=>Re(l+I,se(s),1,[e]),Ee=(e,s,t,o=0,r,u)=>Re(l+C,se(u),1,[e,s,t,o,r]),Ae=(e,s,t)=>Re(l+w,se(t),1,[e,s]),Ge=(e,s,t,o)=>Re(l+b,se(o),3,[e,s,t]),We=e=>Re("CheckpointIds",te(e),2),je=(e,s)=>Re("Checkpoint",te(s),3,[e]),ze=e=>me(e,"goBackward"),Ue=e=>me(e,"goForward"),{PureComponent:_e,Fragment:Je,createElement:Ke,useCallback:Ne,useLayoutEffect:Xe,useRef:Ye,useState:Ze}=e,$e=(e,...s)=>L(e)?{}:e(...s),es=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:ss,useContext:ts,useMemo:os,useState:rs}=e,us=({tableId:e,store:s,rowComponent:t=as,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>ps(f(n,(u=>Ke(t,{...$e(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),ls=({queryId:e,queries:s,resultRowComponent:t=bs,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>ps(f(l,(r=>Ke(t,{...$e(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),ns=({relationshipId:e,relationships:s,rowComponent:t=as,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,i]=es(ee(s),e),a=l(e,n,d);return ps(f(a,(e=>Ke(t,{...$e(o,e),key:e,tableId:i,rowId:e,store:p,debugIds:u}))),r,u,n)},ds=e=>({checkpoints:s,checkpointComponent:t=ws,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=te(s);return ps(f(e(We(l)),(e=>Ke(t,{...$e(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},ps=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:f(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},is=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>ps(t+(Pe(e,s,o,r)??t),void 0,u,o),as=({tableId:e,rowId:s,store:t,cellComponent:o=is,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>ps(f(((e,s,t,o)=>{const r=ve(s,t,o);return e??r})(u,e,s,t),(u=>Ke(o,{...$e(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),xs=e=>us(e,Ve(e.tableId,e.store)),cs=({valueId:e,store:s,debugIds:o})=>ps(t+(qe(e,s)??t),void 0,o,e),Is=({indexId:e,sliceId:s,indexes:t,rowComponent:o=as,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])($(t),e),i=He(e,s,n);return ps(f(i,(e=>Ke(o,{...$e(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},Cs=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>ps(t+(Ge(e,s,o,r)??t),void 0,u,o),bs=({queryId:e,rowId:s,queries:t,resultCellComponent:o=Cs,getResultCellComponentProps:r,separator:u,debugIds:l})=>ps(f(Ae(e,s,t),(u=>Ke(o,{...$e(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),ws=({checkpoints:e,checkpointId:s,debugIds:o})=>ps(je(s,e)??t,void 0,o,s),Rs=ds((e=>e[0])),ks=ds((e=>L(e[1])?[]:[e[1]])),gs=ds((e=>e[2]));exports.BackwardCheckpointsView=Rs,exports.CellView=is,exports.CheckpointView=ws,exports.CurrentCheckpointView=ks,exports.ForwardCheckpointsView=gs,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Is,getSliceComponentProps:o,separator:r,debugIds:u})=>ps(f(Be(e,s),(r=>Ke(t,{...$e(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>ns(e,Oe,e.firstRowId),exports.LocalRowsView=e=>ns(e,Fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>ps(Me(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:i,checkpointsById:a,children:x})=>{const c=ts(j),[I,C]=rs([{},{},{},{},{},{}]),b=ss(((e,s,t)=>C((o=>O(o[e],s)==t?o:q(o,e,{...o[e],[s]:t})))),[]),w=ss(((e,s)=>C((t=>Q(t[e],s)?q(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return Ke(j.Provider,{value:os((()=>[e??c[0],{...c[1],...s,...I[0]},t??c[2],{...c[3],...o,...I[1]},r??c[4],{...c[5],...u,...I[2]},l??c[6],{...c[7],...n,...I[3]},d??c[8],{...c[9],...p,...I[4]},i??c[10],{...c[11],...a,...I[5]},b,w]),[e,s,I,t,o,r,u,l,n,d,p,i,a,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=as,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=es(ee(t),e),p=De(e,s,l);return ps(L(d)||L(p)?null:Ke(o,{...$e(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=Cs,exports.ResultRowView=bs,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>ls(r,Ee(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>ls(e,Qe(e.queryId,e.queries)),exports.RowView=as,exports.SliceView=Is,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>us(r,Te(r.tableId,e,s,t,o,r.store)),exports.TableView=xs,exports.TablesView=({store:e,tableComponent:s=xs,getTableComponentProps:t,separator:o,debugIds:r})=>ps(f(Se(e),(o=>Ke(s,{...$e(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=cs,exports.ValuesView=({store:e,valueComponent:s=cs,getValueComponentProps:t,separator:o,debugIds:r})=>ps(f(fe(e),(o=>Ke(s,{...$e(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=xe,o,r=T,u=xe,l=!0)=>{const n=Y(o);return ue((t=>y(n,(o=>y(s(t,o),(s=>r(o.addRow(S(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=Pe,exports.useCellIds=ve,exports.useCellIdsListener=(e,s,t,o,r,u)=>ke(w,Y(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ke(b,Y(l),o,r,[e,s,t],u),exports.useCheckpoint=je,exports.useCheckpointIds=We,exports.useCheckpointIdsListener=(e,s,t)=>ke("CheckpointIds",te(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ke("Checkpoint",te(o),s,t,[e]),exports.useCheckpoints=e=>J(e,10),exports.useCheckpointsIds=()=>X(11),exports.useCheckpointsOrCheckpointsById=te,exports.useCreateCheckpoints=(e,s,t)=>be(e,s,t),exports.useCreateIndexes=(e,s,t)=>be(e,s,t),exports.useCreateMergeableStore=(e,s=xe)=>ne(e,s),exports.useCreateMetrics=(e,s,t)=>be(e,s,t),exports.useCreatePersister=(e,s,t=xe,o,r=xe,u,l=xe)=>{const[,n]=ie(),[d,p]=ie();return le((()=>{(async()=>{const t=e?await s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()})()}),[e,...t,...r]),le((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>be(e,s,t),exports.useCreateRelationships=(e,s,t)=>be(e,s,t),exports.useCreateStore=(e,s=xe)=>ne(e,s),exports.useCreateSynchronizer=(e,s,t=xe,o,r=xe)=>{const[u,l]=ie();return le((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),le((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>ye(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>ye(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>ye(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>ye(e,i,s,t),exports.useDelValueCallback=(e,s,t,o)=>ye(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>ye(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ke("DidFinish"+re,Y(t),e,s),exports.useGoBackwardCallback=ze,exports.useGoForwardCallback=Ue,exports.useGoToCallback=(e,s=xe,t,o=T,r=xe)=>{const u=te(t);return ue((s=>y(u,(t=>y(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>Re(b,Y(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ke(n+b,Y(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>Re(x,Y(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ke(n+x,Y(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>Re(p,Y(s),4,[e]),exports.useHasTableCell=(e,s,t)=>Re(p+b,Y(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ke(n+p+b,Y(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ke(n+p,Y(r),s,t,[e],o),exports.useHasTables=e=>Re(i,Y(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ke(n+i,Y(o),e,s,[],t),exports.useHasValue=(e,s)=>Re(R,Y(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ke(n+R,Y(r),s,t,[e],o),exports.useHasValues=e=>Re(k,Y(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ke(n+k,Y(o),e,s,[],t),exports.useIndexIds=e=>Re("IndexIds",$(e),1),exports.useIndexes=e=>J(e,4),exports.useIndexesIds=()=>X(5),exports.useIndexesOrIndexesById=$,exports.useLinkedRowIds=Oe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ke("Linked"+I,ee(r),t,o,[e,s]),exports.useLocalRowIds=Fe,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ke("Local"+I,ee(r),t,o,[e,s]),exports.useMetric=Me,exports.useMetricIds=e=>Re("MetricIds",Z(e),1),exports.useMetricListener=(e,s,t,o)=>ke("Metric",Z(o),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=>Re("QueryIds",se(e),1),exports.useRedoInformation=e=>{const s=te(e),[,,[o]]=We(s);return[!L(o),Ue(s),o,y(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>Re("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,o,r)=>ke("RemoteRowId",ee(r),t,o,[e,s]),exports.useResultCell=Ge,exports.useResultCellIds=Ae,exports.useResultCellIdsListener=(e,s,t,o,r)=>ke(l+w,se(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ke(l+b,se(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>Re(l+x,se(t),0,[e,s]),exports.useResultRowCount=(e,s)=>Re(l+c,se(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ke(l+c,se(o),s,t,[e]),exports.useResultRowIds=Qe,exports.useResultRowIdsListener=(e,s,t,o)=>ke(l+I,se(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ke(l+x,se(r),t,o,[e,s]),exports.useResultSortedRowIds=Ee,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ke(l+C,se(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>Re(l+p,se(s),0,[e]),exports.useResultTableCellIds=(e,s)=>Re(l+p+w,se(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ke(l+p+w,se(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ke(l+p,se(o),s,t,[e]),exports.useRow=(e,s,t)=>Re(x,Y(t),0,[e,s]),exports.useRowCount=(e,s)=>Re(c,Y(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ke(c,Y(r),s,t,[e],o),exports.useRowIds=Ve,exports.useRowIdsListener=(e,s,t,o,r)=>ke(I,Y(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ke(x,Y(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>ge(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=T,s=xe,t,o=T,r=xe)=>{const u=te(t);return ue((s=>y(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>ge(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>ge(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>ge(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>ge(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>ge(t,i,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>ge(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>ge(t,k,e,s,o,r),exports.useSliceIds=Be,exports.useSliceIdsListener=(e,s,t,o)=>ke("SliceIds",$(o),s,t,[e]),exports.useSliceRowIds=He,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ke("Slice"+I,$(r),t,o,[e,s]),exports.useSortedRowIds=Te,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ke(C,Y(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ke("Start"+re,Y(t),e,s),exports.useStore=e=>J(e,0),exports.useStoreIds=()=>X(1),exports.useStoreOrStoreById=Y,exports.useTable=(e,s)=>Re(p,Y(s),0,[e]),exports.useTableCellIds=(e,s)=>Re(p+w,Y(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ke(p+w,Y(r),s,t,[e],o),exports.useTableIds=Se,exports.useTableIdsListener=(e,s,t,o)=>ke(a,Y(o),e,s,xe,t),exports.useTableListener=(e,s,t,o,r)=>ke(p,Y(r),s,t,[e],o),exports.useTables=e=>Re(i,Y(e),0),exports.useTablesListener=(e,s,t,o)=>ke(i,Y(o),e,s,xe,t),exports.useUndoInformation=e=>{const s=te(e),[o,r]=We(s);return[(u=o,!(0==V(u))),ze(s),r,y(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=qe,exports.useValueIds=fe,exports.useValueIdsListener=(e,s,t,o)=>ke(g,Y(o),e,s,xe,t),exports.useValueListener=(e,s,t,o,r)=>ke(R,Y(r),s,t,[e],o),exports.useValues=e=>Re(k,Y(e),0),exports.useValuesListener=(e,s,t,o)=>ke(k,Y(o),e,s,xe,t),exports.useWillFinishTransactionListener=(e,s,t)=>ke("WillFinish"+re,Y(t),e,s);
|
|
Binary file
|
package/cjs/ui-react/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
5
|
const getTypeOf = (thing) => typeof thing;
|
|
6
|
+
const TINYBASE = 'tinybase';
|
|
6
7
|
const EMPTY_STRING = '';
|
|
7
8
|
const STRING = getTypeOf(EMPTY_STRING);
|
|
8
9
|
const FUNCTION = getTypeOf(getTypeOf);
|
|
@@ -26,6 +27,7 @@ const VALUE = 'Value';
|
|
|
26
27
|
const VALUES = VALUE + 's';
|
|
27
28
|
const VALUE_IDS = VALUE + IDS;
|
|
28
29
|
|
|
30
|
+
const GLOBAL = globalThis;
|
|
29
31
|
const isUndefined = (thing) => thing == void 0;
|
|
30
32
|
const ifNotUndefined = (value, then, otherwise) =>
|
|
31
33
|
isUndefined(value) ? otherwise?.() : then(value);
|
|
@@ -42,6 +44,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
42
44
|
const arrayMap = (array, cb) => array.map(cb);
|
|
43
45
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
44
46
|
const arrayFilter = (array, cb) => array.filter(cb);
|
|
47
|
+
const arrayWith = (array, index, value) => array.with(index, value);
|
|
45
48
|
|
|
46
49
|
const object = Object;
|
|
47
50
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -59,6 +62,7 @@ const isObject = (obj) =>
|
|
|
59
62
|
);
|
|
60
63
|
const objIds = object.keys;
|
|
61
64
|
const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
|
|
65
|
+
const objHas = (obj, id) => id in obj;
|
|
62
66
|
const objDel = (obj, id) => {
|
|
63
67
|
delete obj[id];
|
|
64
68
|
return obj;
|
|
@@ -77,9 +81,15 @@ const objIsEqual = (obj1, obj2) => {
|
|
|
77
81
|
)
|
|
78
82
|
);
|
|
79
83
|
};
|
|
84
|
+
const objEnsure = (obj, id, getDefaultValue) => {
|
|
85
|
+
if (!objHas(obj, id)) {
|
|
86
|
+
obj[id] = getDefaultValue();
|
|
87
|
+
}
|
|
88
|
+
return obj[id];
|
|
89
|
+
};
|
|
80
90
|
|
|
81
91
|
const {createContext, useContext: useContext$1, useEffect: useEffect$1} = React;
|
|
82
|
-
const Context = createContext([]);
|
|
92
|
+
const Context = objEnsure(GLOBAL, TINYBASE + '_uirc', () => createContext([]));
|
|
83
93
|
const useThing = (id, offset) => {
|
|
84
94
|
const contextValue = useContext$1(Context);
|
|
85
95
|
return isUndefined(id)
|
|
@@ -94,32 +104,43 @@ const useThingOrThingById = (thingOrThingId, offset) => {
|
|
|
94
104
|
? thing
|
|
95
105
|
: thingOrThingId;
|
|
96
106
|
};
|
|
107
|
+
const useProvideThing = (thingId, thing, offset) => {
|
|
108
|
+
const {12: addExtraThingById, 13: delExtraThingById} = useContext$1(Context);
|
|
109
|
+
useEffect$1(() => {
|
|
110
|
+
addExtraThingById?.(offset, thingId, thing);
|
|
111
|
+
return () => delExtraThingById?.(offset, thingId);
|
|
112
|
+
}, [addExtraThingById, thingId, thing, offset, delExtraThingById]);
|
|
113
|
+
};
|
|
97
114
|
const useThingIds = (offset) => objIds(useContext$1(Context)[offset] ?? {});
|
|
98
115
|
const useStore = (id) => useThing(id, 0);
|
|
99
116
|
const useStoreOrStoreById = (storeOrStoreId) =>
|
|
100
117
|
useThingOrThingById(storeOrStoreId, 0);
|
|
101
|
-
const useProvideStore = (storeId, store) =>
|
|
102
|
-
const {12: addExtraStore, 13: delExtraStore} = useContext$1(Context);
|
|
103
|
-
useEffect$1(() => {
|
|
104
|
-
addExtraStore?.(storeId, store);
|
|
105
|
-
return () => delExtraStore?.(storeId);
|
|
106
|
-
}, [addExtraStore, storeId, store, delExtraStore]);
|
|
107
|
-
};
|
|
118
|
+
const useProvideStore = (storeId, store) => useProvideThing(storeId, store, 0);
|
|
108
119
|
const useMetrics = (id) => useThing(id, 2);
|
|
109
120
|
const useMetricsOrMetricsById = (metricsOrMetricsId) =>
|
|
110
121
|
useThingOrThingById(metricsOrMetricsId, 2);
|
|
122
|
+
const useProvideMetrics = (metricsId, metrics) =>
|
|
123
|
+
useProvideThing(metricsId, metrics, 1);
|
|
111
124
|
const useIndexes = (id) => useThing(id, 4);
|
|
112
125
|
const useIndexesOrIndexesById = (indexesOrIndexesId) =>
|
|
113
126
|
useThingOrThingById(indexesOrIndexesId, 4);
|
|
127
|
+
const useProvideIndexes = (indexesId, indexes) =>
|
|
128
|
+
useProvideThing(indexesId, indexes, 2);
|
|
114
129
|
const useRelationships = (id) => useThing(id, 6);
|
|
115
130
|
const useRelationshipsOrRelationshipsById = (relationshipsOrRelationshipsId) =>
|
|
116
131
|
useThingOrThingById(relationshipsOrRelationshipsId, 6);
|
|
132
|
+
const useProvideRelationships = (relationshipsId, relationships) =>
|
|
133
|
+
useProvideThing(relationshipsId, relationships, 3);
|
|
117
134
|
const useQueries = (id) => useThing(id, 8);
|
|
118
135
|
const useQueriesOrQueriesById = (queriesOrQueriesId) =>
|
|
119
136
|
useThingOrThingById(queriesOrQueriesId, 8);
|
|
137
|
+
const useProvideQueries = (queriesId, queries) =>
|
|
138
|
+
useProvideThing(queriesId, queries, 4);
|
|
120
139
|
const useCheckpoints = (id) => useThing(id, 10);
|
|
121
140
|
const useCheckpointsOrCheckpointsById = (checkpointsOrCheckpointsId) =>
|
|
122
141
|
useThingOrThingById(checkpointsOrCheckpointsId, 10);
|
|
142
|
+
const useProvideCheckpoints = (checkpointsId, checkpoints) =>
|
|
143
|
+
useProvideThing(checkpointsId, checkpoints, 5);
|
|
123
144
|
|
|
124
145
|
const lower = (str) => str.toLowerCase();
|
|
125
146
|
lower(LISTENER);
|
|
@@ -1572,21 +1593,37 @@ const Provider = ({
|
|
|
1572
1593
|
children,
|
|
1573
1594
|
}) => {
|
|
1574
1595
|
const parentValue = useContext(Context);
|
|
1575
|
-
const [
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1596
|
+
const [extraThingsById, setExtraThingsById] = useState([
|
|
1597
|
+
{},
|
|
1598
|
+
{},
|
|
1599
|
+
{},
|
|
1600
|
+
{},
|
|
1601
|
+
{},
|
|
1602
|
+
{},
|
|
1603
|
+
]);
|
|
1604
|
+
const addExtraThingById = useCallback(
|
|
1605
|
+
(thingOffset, id, thing) =>
|
|
1606
|
+
setExtraThingsById((extraThingsById2) =>
|
|
1607
|
+
objGet(extraThingsById2[thingOffset], id) == thing
|
|
1608
|
+
? extraThingsById2
|
|
1609
|
+
: arrayWith(extraThingsById2, thingOffset, {
|
|
1610
|
+
...extraThingsById2[thingOffset],
|
|
1611
|
+
[id]: thing,
|
|
1612
|
+
}),
|
|
1582
1613
|
),
|
|
1583
1614
|
[],
|
|
1584
1615
|
);
|
|
1585
|
-
const
|
|
1586
|
-
(id) =>
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1616
|
+
const delExtraThingById = useCallback(
|
|
1617
|
+
(thingOffset, id) =>
|
|
1618
|
+
setExtraThingsById((extraThingsById2) =>
|
|
1619
|
+
!objHas(extraThingsById2[thingOffset], id)
|
|
1620
|
+
? extraThingsById2
|
|
1621
|
+
: arrayWith(
|
|
1622
|
+
extraThingsById2,
|
|
1623
|
+
thingOffset,
|
|
1624
|
+
objDel(extraThingsById2[thingOffset], id),
|
|
1625
|
+
),
|
|
1626
|
+
),
|
|
1590
1627
|
[],
|
|
1591
1628
|
);
|
|
1592
1629
|
return /* @__PURE__ */ createElement(
|
|
@@ -1595,24 +1632,24 @@ const Provider = ({
|
|
|
1595
1632
|
value: useMemo(
|
|
1596
1633
|
() => [
|
|
1597
1634
|
store ?? parentValue[0],
|
|
1598
|
-
{...parentValue[1], ...storesById, ...
|
|
1635
|
+
{...parentValue[1], ...storesById, ...extraThingsById[0]},
|
|
1599
1636
|
metrics ?? parentValue[2],
|
|
1600
|
-
{...parentValue[3], ...metricsById},
|
|
1637
|
+
{...parentValue[3], ...metricsById, ...extraThingsById[1]},
|
|
1601
1638
|
indexes ?? parentValue[4],
|
|
1602
|
-
{...parentValue[5], ...indexesById},
|
|
1639
|
+
{...parentValue[5], ...indexesById, ...extraThingsById[2]},
|
|
1603
1640
|
relationships ?? parentValue[6],
|
|
1604
|
-
{...parentValue[7], ...relationshipsById},
|
|
1641
|
+
{...parentValue[7], ...relationshipsById, ...extraThingsById[3]},
|
|
1605
1642
|
queries ?? parentValue[8],
|
|
1606
|
-
{...parentValue[9], ...queriesById},
|
|
1643
|
+
{...parentValue[9], ...queriesById, ...extraThingsById[4]},
|
|
1607
1644
|
checkpoints ?? parentValue[10],
|
|
1608
|
-
{...parentValue[11], ...checkpointsById},
|
|
1609
|
-
|
|
1610
|
-
|
|
1645
|
+
{...parentValue[11], ...checkpointsById, ...extraThingsById[5]},
|
|
1646
|
+
addExtraThingById,
|
|
1647
|
+
delExtraThingById,
|
|
1611
1648
|
],
|
|
1612
1649
|
[
|
|
1613
1650
|
store,
|
|
1614
1651
|
storesById,
|
|
1615
|
-
|
|
1652
|
+
extraThingsById,
|
|
1616
1653
|
metrics,
|
|
1617
1654
|
metricsById,
|
|
1618
1655
|
indexes,
|
|
@@ -1624,8 +1661,8 @@ const Provider = ({
|
|
|
1624
1661
|
checkpoints,
|
|
1625
1662
|
checkpointsById,
|
|
1626
1663
|
parentValue,
|
|
1627
|
-
|
|
1628
|
-
|
|
1664
|
+
addExtraThingById,
|
|
1665
|
+
delExtraThingById,
|
|
1629
1666
|
],
|
|
1630
1667
|
),
|
|
1631
1668
|
},
|
|
@@ -1980,6 +2017,11 @@ exports.useMetricListener = useMetricListener;
|
|
|
1980
2017
|
exports.useMetrics = useMetrics;
|
|
1981
2018
|
exports.useMetricsIds = useMetricsIds;
|
|
1982
2019
|
exports.useMetricsOrMetricsById = useMetricsOrMetricsById;
|
|
2020
|
+
exports.useProvideCheckpoints = useProvideCheckpoints;
|
|
2021
|
+
exports.useProvideIndexes = useProvideIndexes;
|
|
2022
|
+
exports.useProvideMetrics = useProvideMetrics;
|
|
2023
|
+
exports.useProvideQueries = useProvideQueries;
|
|
2024
|
+
exports.useProvideRelationships = useProvideRelationships;
|
|
1983
2025
|
exports.useProvideStore = useProvideStore;
|
|
1984
2026
|
exports.useQueries = useQueries;
|
|
1985
2027
|
exports.useQueriesIds = useQueriesIds;
|