tinybase 5.0.1 → 5.0.3
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/synchronizers/synchronizer-ws-server/index.d.cts +32 -27
- package/@types/synchronizers/synchronizer-ws-server/index.d.ts +32 -27
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.cts +32 -27
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +32 -27
- package/@types/ui-react/index.d.cts +62 -45
- package/@types/ui-react/index.d.ts +62 -45
- package/@types/ui-react/with-schemas/index.d.cts +83 -59
- package/@types/ui-react/with-schemas/index.d.ts +83 -59
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/index.cjs +1 -1
- package/cjs/es6/min/ui-react/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/synchronizers/synchronizer-ws-server/index.cjs +4 -6
- package/cjs/es6/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +4 -6
- package/cjs/es6/ui-react/index.cjs +13 -6
- package/cjs/es6/ui-react/with-schemas/index.cjs +13 -6
- package/cjs/min/synchronizers/synchronizer-ws-server/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react/index.cjs +1 -1
- package/cjs/min/ui-react/index.cjs.gz +0 -0
- package/cjs/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/synchronizers/synchronizer-ws-server/index.cjs +4 -4
- package/cjs/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +4 -4
- package/cjs/ui-react/index.cjs +11 -6
- package/cjs/ui-react/with-schemas/index.cjs +11 -6
- package/es6/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react/index.js +1 -1
- package/es6/min/ui-react/index.js.gz +0 -0
- package/es6/min/ui-react/with-schemas/index.js +1 -1
- package/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/es6/synchronizers/synchronizer-ws-server/index.js +4 -6
- package/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -6
- package/es6/ui-react/index.js +13 -6
- package/es6/ui-react/with-schemas/index.js +13 -6
- package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/min/ui-react/index.js +1 -1
- package/min/ui-react/index.js.gz +0 -0
- package/min/ui-react/with-schemas/index.js +1 -1
- package/min/ui-react/with-schemas/index.js.gz +0 -0
- package/package.json +1 -1
- package/readme.md +2 -2
- package/synchronizers/synchronizer-ws-server/index.js +4 -4
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -4
- package/ui-react/index.js +11 -6
- package/ui-react/with-schemas/index.js +11 -6
- package/umd/es6/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react/index.js +1 -1
- package/umd/es6/min/ui-react/index.js.gz +0 -0
- package/umd/es6/min/ui-react/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/es6/synchronizers/synchronizer-ws-server/index.js +4 -6
- package/umd/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -6
- package/umd/es6/ui-react/index.js +16 -6
- package/umd/es6/ui-react/with-schemas/index.js +16 -6
- package/umd/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react/index.js +1 -1
- package/umd/min/ui-react/index.js.gz +0 -0
- package/umd/min/ui-react/with-schemas/index.js +1 -1
- package/umd/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/synchronizers/synchronizer-ws-server/index.js +4 -6
- package/umd/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -6
- package/umd/ui-react/index.js +12 -6
- package/umd/ui-react/with-schemas/index.js +12 -6
package/cjs/ui-react/index.cjs
CHANGED
|
@@ -41,6 +41,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
41
41
|
arrayEvery(array1, (value1, index) => array2[index] === value1);
|
|
42
42
|
const arrayMap = (array, cb) => array.map(cb);
|
|
43
43
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
44
|
+
const arrayFilter = (array, cb) => array.filter(cb);
|
|
44
45
|
|
|
45
46
|
const object = Object;
|
|
46
47
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -225,9 +226,7 @@ const useSetCallback = (
|
|
|
225
226
|
ifNotUndefined(get(parameter, store2), (thing) =>
|
|
226
227
|
then(
|
|
227
228
|
store2['set' + settable](
|
|
228
|
-
...
|
|
229
|
-
isFunction(arg) ? arg(parameter, store2) : arg,
|
|
230
|
-
),
|
|
229
|
+
...argsOrGetArgs(args, store2, parameter),
|
|
231
230
|
thing,
|
|
232
231
|
),
|
|
233
232
|
thing,
|
|
@@ -235,9 +234,12 @@ const useSetCallback = (
|
|
|
235
234
|
),
|
|
236
235
|
),
|
|
237
236
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
238
|
-
[store, settable, ...getDeps, ...thenDeps, ...args],
|
|
237
|
+
[store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
|
|
239
238
|
);
|
|
240
239
|
};
|
|
240
|
+
const argsOrGetArgs = (args, store, parameter) =>
|
|
241
|
+
arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
|
|
242
|
+
const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
|
|
241
243
|
const useDel = (
|
|
242
244
|
storeOrStoreId,
|
|
243
245
|
deletable,
|
|
@@ -247,9 +249,12 @@ const useDel = (
|
|
|
247
249
|
) => {
|
|
248
250
|
const store = useStoreOrStoreById(storeOrStoreId);
|
|
249
251
|
return useCallback$2(
|
|
250
|
-
() =>
|
|
252
|
+
(parameter) =>
|
|
253
|
+
then(
|
|
254
|
+
store?.['del' + deletable](...argsOrGetArgs(args, store, parameter)),
|
|
255
|
+
),
|
|
251
256
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
252
|
-
[store, deletable, ...thenDeps, ...args],
|
|
257
|
+
[store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
|
|
253
258
|
);
|
|
254
259
|
};
|
|
255
260
|
const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
@@ -41,6 +41,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
41
41
|
arrayEvery(array1, (value1, index) => array2[index] === value1);
|
|
42
42
|
const arrayMap = (array, cb) => array.map(cb);
|
|
43
43
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
44
|
+
const arrayFilter = (array, cb) => array.filter(cb);
|
|
44
45
|
|
|
45
46
|
const object = Object;
|
|
46
47
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -225,9 +226,7 @@ const useSetCallback = (
|
|
|
225
226
|
ifNotUndefined(get(parameter, store2), (thing) =>
|
|
226
227
|
then(
|
|
227
228
|
store2['set' + settable](
|
|
228
|
-
...
|
|
229
|
-
isFunction(arg) ? arg(parameter, store2) : arg,
|
|
230
|
-
),
|
|
229
|
+
...argsOrGetArgs(args, store2, parameter),
|
|
231
230
|
thing,
|
|
232
231
|
),
|
|
233
232
|
thing,
|
|
@@ -235,9 +234,12 @@ const useSetCallback = (
|
|
|
235
234
|
),
|
|
236
235
|
),
|
|
237
236
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
238
|
-
[store, settable, ...getDeps, ...thenDeps, ...args],
|
|
237
|
+
[store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
|
|
239
238
|
);
|
|
240
239
|
};
|
|
240
|
+
const argsOrGetArgs = (args, store, parameter) =>
|
|
241
|
+
arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
|
|
242
|
+
const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
|
|
241
243
|
const useDel = (
|
|
242
244
|
storeOrStoreId,
|
|
243
245
|
deletable,
|
|
@@ -247,9 +249,12 @@ const useDel = (
|
|
|
247
249
|
) => {
|
|
248
250
|
const store = useStoreOrStoreById(storeOrStoreId);
|
|
249
251
|
return useCallback$2(
|
|
250
|
-
() =>
|
|
252
|
+
(parameter) =>
|
|
253
|
+
then(
|
|
254
|
+
store?.['del' + deletable](...argsOrGetArgs(args, store, parameter)),
|
|
255
|
+
),
|
|
251
256
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
252
|
-
[store, deletable, ...thenDeps, ...args],
|
|
257
|
+
[store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
|
|
253
258
|
);
|
|
254
259
|
};
|
|
255
260
|
const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const n=n=>null==n,l=(l,e,t)=>n(l)?null==t?void 0:t():e(l),e=(n,l,e)=>n.slice(l,e),t=n=>n.length,r=(n,l)=>n.forEach(l),u=(n,...l)=>n.push(...l),s=Object.freeze,o=n=>{var l;return null!=(l=null==n?void 0:n.size)?l:0},d=(a=o,n=>{return l=(n,l)=>n+a(l),c(n).reduce(l,0);var l});var a;const i=l=>n(l)||0==o(l),c=n=>{var l;return[...null!=(l=null==n?void 0:n.values())?l:[]]},v=(n,l)=>null==n?void 0:n.forEach(l),h=(n,l)=>null==n?void 0:n.delete(l),f=n=>new Map(n),g=n=>{var l;return[...null!=(l=null==n?void 0:n.keys())?l:[]]},y=(n,l)=>null==n?void 0:n.get(l),S=(l,e,t)=>n(t)?(h(l,e),l):null==l?void 0:l.set(e,t),k=(n,l,e,t)=>{var r,u,s;return u=l,null!=(s=null==(r=n)?void 0:r.has(u))&&s?null==t||t(y(n,l)):S(n,l,e()),y(n,l)},p=(n,e,r,u,s=0)=>l((r?k:y)(n,e[s],s>t(e)-2?r:f),(l=>{if(s>t(e)-2)return(null==u?void 0:u(l))&&S(n,e[s]),l;const o=p(l,e,r,u,s+1);return i(l)&&S(n,e[s]),o})),I=l=>new Set(Array.isArray(l)||n(l)?l:[l]),b=/^\d+$/,w=/\/([^?]*)/,z=a=>{const c=f(),z=f(),L=f(),[m,x,A]=(e=>{let s;const[o,d]=(()=>{const n=[];let l=0;return[e=>{var t;return null!=(t=e?n.shift():null)?t:""+l++},l=>{b.test(l)&&t(n)<1e3&&u(n,l)}]})(),a=f();return[(n,l,e,t=[],r=(()=>[]))=>{null!=s||(s=C);const u=o(1);var d,i;return S(a,u,[n,l,e,t,r]),i=u,null==(d=p(l,null!=e?e:[""],I))||d.add(i),u},(n,l,...e)=>r(((n,l=[""])=>{const e=[],s=(n,o)=>o==t(l)?u(e,n):null===l[o]?v(n,(n=>s(n,o+1))):r([l[o],null],(l=>s(y(n,l),o+1)));return s(n,0),e})(n,l),(n=>v(n,(n=>y(a,n)[0](s,...null!=l?l:[],...e))))),n=>l(y(a,n),(([,l,e])=>(p(l,null!=e?e:[""],void 0,(l=>(h(l,n),i(l)?1:0))),S(a,n),d(n),e))),e=>l(y(a,e),(([l,,e=[],u,o])=>{const d=(...a)=>{var i,c;const v=t(a);v==t(e)?l(s,...a,...o(a)):n(e[v])?r(null!=(c=null==(i=u[v])?void 0:i.call(u,...a))?c:[],(n=>d(...a,n))):d(...a,e[v])};d()}))]})();a.on("connection",((n,t)=>{var r;return l(null==(r=t.url)?void 0:r.match(w),(([,r])=>l(t.headers["sec-websocket-key"],(l=>{const t=k(L,r,f);S(t,l,n),1==t.size&&x(c,void 0,
|
|
1
|
+
const n=n=>null==n,l=(l,e,t)=>n(l)?null==t?void 0:t():e(l),e=(n,l,e)=>n.slice(l,e),t=n=>n.length,r=(n,l)=>n.forEach(l),u=(n,...l)=>n.push(...l),s=Object.freeze,o=n=>{var l;return null!=(l=null==n?void 0:n.size)?l:0},d=(a=o,n=>{return l=(n,l)=>n+a(l),c(n).reduce(l,0);var l});var a;const i=l=>n(l)||0==o(l),c=n=>{var l;return[...null!=(l=null==n?void 0:n.values())?l:[]]},v=(n,l)=>null==n?void 0:n.forEach(l),h=(n,l)=>null==n?void 0:n.delete(l),f=n=>new Map(n),g=n=>{var l;return[...null!=(l=null==n?void 0:n.keys())?l:[]]},y=(n,l)=>null==n?void 0:n.get(l),S=(l,e,t)=>n(t)?(h(l,e),l):null==l?void 0:l.set(e,t),k=(n,l,e,t)=>{var r,u,s;return u=l,null!=(s=null==(r=n)?void 0:r.has(u))&&s?null==t||t(y(n,l)):S(n,l,e()),y(n,l)},p=(n,e,r,u,s=0)=>l((r?k:y)(n,e[s],s>t(e)-2?r:f),(l=>{if(s>t(e)-2)return(null==u?void 0:u(l))&&S(n,e[s]),l;const o=p(l,e,r,u,s+1);return i(l)&&S(n,e[s]),o})),I=l=>new Set(Array.isArray(l)||n(l)?l:[l]),b=/^\d+$/,w=/\/([^?]*)/,z=a=>{const c=f(),z=f(),L=f(),[m,x,A]=(e=>{let s;const[o,d]=(()=>{const n=[];let l=0;return[e=>{var t;return null!=(t=e?n.shift():null)?t:""+l++},l=>{b.test(l)&&t(n)<1e3&&u(n,l)}]})(),a=f();return[(n,l,e,t=[],r=(()=>[]))=>{null!=s||(s=C);const u=o(1);var d,i;return S(a,u,[n,l,e,t,r]),i=u,null==(d=p(l,null!=e?e:[""],I))||d.add(i),u},(n,l,...e)=>r(((n,l=[""])=>{const e=[],s=(n,o)=>o==t(l)?u(e,n):null===l[o]?v(n,(n=>s(n,o+1))):r([l[o],null],(l=>s(y(n,l),o+1)));return s(n,0),e})(n,l),(n=>v(n,(n=>y(a,n)[0](s,...null!=l?l:[],...e))))),n=>l(y(a,n),(([,l,e])=>(p(l,null!=e?e:[""],void 0,(l=>(h(l,n),i(l)?1:0))),S(a,n),d(n),e))),e=>l(y(a,e),(([l,,e=[],u,o])=>{const d=(...a)=>{var i,c;const v=t(a);v==t(e)?l(s,...a,...o(a)):n(e[v])?r(null!=(c=null==(i=u[v])?void 0:i.call(u,...a))?c:[],(n=>d(...a,n))):d(...a,e[v])};d()}))]})();a.on("connection",((n,t)=>{var r;return l(null==(r=t.url)?void 0:r.match(w),(([,r])=>l(t.headers["sec-websocket-key"],(l=>{const t=k(L,r,f);S(t,l,n),1==t.size&&x(c,void 0,r,1),x(z,[r],l,1),n.on("message",(n=>{var r;const u=n.toString("utf8"),s=u.indexOf("\n");if(-1!==s){const n=e(u,0,s),d=e(u,s+1);""===n?(o=(n,e)=>n!=l?e.send(l+"\n"+d):0,v(t,((n,l)=>o(l,n)))):null==(r=y(t,n))||r.send(l+"\n"+d)}var o})),n.on("close",(()=>{h(t,l),x(z,[r],l,-1),i(t)&&(h(L,r),x(c,void 0,r,-1))}))}))))}));const C={getWebSocketServer:()=>a,getPathIds:()=>g(L),getClientIds:n=>g(y(L,n)),addPathIdsListener:n=>m(n,c),addClientIdsListener:(n,l)=>m(l,z,[n]),delListener:n=>(A(n),C),getStats:()=>({paths:o(L),clients:d(L)}),destroy:()=>{a.close(),L.clear()}};return s(C)};export{z as createWsServer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const n=n=>null==n,l=(l,e,t)=>n(l)?null==t?void 0:t():e(l),e=(n,l,e)=>n.slice(l,e),t=n=>n.length,r=(n,l)=>n.forEach(l),u=(n,...l)=>n.push(...l),s=Object.freeze,o=n=>{var l;return null!=(l=null==n?void 0:n.size)?l:0},d=(a=o,n=>{return l=(n,l)=>n+a(l),c(n).reduce(l,0);var l});var a;const i=l=>n(l)||0==o(l),c=n=>{var l;return[...null!=(l=null==n?void 0:n.values())?l:[]]},v=(n,l)=>null==n?void 0:n.forEach(l),h=(n,l)=>null==n?void 0:n.delete(l),f=n=>new Map(n),g=n=>{var l;return[...null!=(l=null==n?void 0:n.keys())?l:[]]},y=(n,l)=>null==n?void 0:n.get(l),S=(l,e,t)=>n(t)?(h(l,e),l):null==l?void 0:l.set(e,t),k=(n,l,e,t)=>{var r,u,s;return u=l,null!=(s=null==(r=n)?void 0:r.has(u))&&s?null==t||t(y(n,l)):S(n,l,e()),y(n,l)},p=(n,e,r,u,s=0)=>l((r?k:y)(n,e[s],s>t(e)-2?r:f),(l=>{if(s>t(e)-2)return(null==u?void 0:u(l))&&S(n,e[s]),l;const o=p(l,e,r,u,s+1);return i(l)&&S(n,e[s]),o})),I=l=>new Set(Array.isArray(l)||n(l)?l:[l]),b=/^\d+$/,w=/\/([^?]*)/,z=a=>{const c=f(),z=f(),L=f(),[m,x,A]=(e=>{let s;const[o,d]=(()=>{const n=[];let l=0;return[e=>{var t;return null!=(t=e?n.shift():null)?t:""+l++},l=>{b.test(l)&&t(n)<1e3&&u(n,l)}]})(),a=f();return[(n,l,e,t=[],r=(()=>[]))=>{null!=s||(s=C);const u=o(1);var d,i;return S(a,u,[n,l,e,t,r]),i=u,null==(d=p(l,null!=e?e:[""],I))||d.add(i),u},(n,l,...e)=>r(((n,l=[""])=>{const e=[],s=(n,o)=>o==t(l)?u(e,n):null===l[o]?v(n,(n=>s(n,o+1))):r([l[o],null],(l=>s(y(n,l),o+1)));return s(n,0),e})(n,l),(n=>v(n,(n=>y(a,n)[0](s,...null!=l?l:[],...e))))),n=>l(y(a,n),(([,l,e])=>(p(l,null!=e?e:[""],void 0,(l=>(h(l,n),i(l)?1:0))),S(a,n),d(n),e))),e=>l(y(a,e),(([l,,e=[],u,o])=>{const d=(...a)=>{var i,c;const v=t(a);v==t(e)?l(s,...a,...o(a)):n(e[v])?r(null!=(c=null==(i=u[v])?void 0:i.call(u,...a))?c:[],(n=>d(...a,n))):d(...a,e[v])};d()}))]})();a.on("connection",((n,t)=>{var r;return l(null==(r=t.url)?void 0:r.match(w),(([,r])=>l(t.headers["sec-websocket-key"],(l=>{const t=k(L,r,f);S(t,l,n),1==t.size&&x(c,void 0,
|
|
1
|
+
const n=n=>null==n,l=(l,e,t)=>n(l)?null==t?void 0:t():e(l),e=(n,l,e)=>n.slice(l,e),t=n=>n.length,r=(n,l)=>n.forEach(l),u=(n,...l)=>n.push(...l),s=Object.freeze,o=n=>{var l;return null!=(l=null==n?void 0:n.size)?l:0},d=(a=o,n=>{return l=(n,l)=>n+a(l),c(n).reduce(l,0);var l});var a;const i=l=>n(l)||0==o(l),c=n=>{var l;return[...null!=(l=null==n?void 0:n.values())?l:[]]},v=(n,l)=>null==n?void 0:n.forEach(l),h=(n,l)=>null==n?void 0:n.delete(l),f=n=>new Map(n),g=n=>{var l;return[...null!=(l=null==n?void 0:n.keys())?l:[]]},y=(n,l)=>null==n?void 0:n.get(l),S=(l,e,t)=>n(t)?(h(l,e),l):null==l?void 0:l.set(e,t),k=(n,l,e,t)=>{var r,u,s;return u=l,null!=(s=null==(r=n)?void 0:r.has(u))&&s?null==t||t(y(n,l)):S(n,l,e()),y(n,l)},p=(n,e,r,u,s=0)=>l((r?k:y)(n,e[s],s>t(e)-2?r:f),(l=>{if(s>t(e)-2)return(null==u?void 0:u(l))&&S(n,e[s]),l;const o=p(l,e,r,u,s+1);return i(l)&&S(n,e[s]),o})),I=l=>new Set(Array.isArray(l)||n(l)?l:[l]),b=/^\d+$/,w=/\/([^?]*)/,z=a=>{const c=f(),z=f(),L=f(),[m,x,A]=(e=>{let s;const[o,d]=(()=>{const n=[];let l=0;return[e=>{var t;return null!=(t=e?n.shift():null)?t:""+l++},l=>{b.test(l)&&t(n)<1e3&&u(n,l)}]})(),a=f();return[(n,l,e,t=[],r=(()=>[]))=>{null!=s||(s=C);const u=o(1);var d,i;return S(a,u,[n,l,e,t,r]),i=u,null==(d=p(l,null!=e?e:[""],I))||d.add(i),u},(n,l,...e)=>r(((n,l=[""])=>{const e=[],s=(n,o)=>o==t(l)?u(e,n):null===l[o]?v(n,(n=>s(n,o+1))):r([l[o],null],(l=>s(y(n,l),o+1)));return s(n,0),e})(n,l),(n=>v(n,(n=>y(a,n)[0](s,...null!=l?l:[],...e))))),n=>l(y(a,n),(([,l,e])=>(p(l,null!=e?e:[""],void 0,(l=>(h(l,n),i(l)?1:0))),S(a,n),d(n),e))),e=>l(y(a,e),(([l,,e=[],u,o])=>{const d=(...a)=>{var i,c;const v=t(a);v==t(e)?l(s,...a,...o(a)):n(e[v])?r(null!=(c=null==(i=u[v])?void 0:i.call(u,...a))?c:[],(n=>d(...a,n))):d(...a,e[v])};d()}))]})();a.on("connection",((n,t)=>{var r;return l(null==(r=t.url)?void 0:r.match(w),(([,r])=>l(t.headers["sec-websocket-key"],(l=>{const t=k(L,r,f);S(t,l,n),1==t.size&&x(c,void 0,r,1),x(z,[r],l,1),n.on("message",(n=>{var r;const u=n.toString("utf8"),s=u.indexOf("\n");if(-1!==s){const n=e(u,0,s),d=e(u,s+1);""===n?(o=(n,e)=>n!=l?e.send(l+"\n"+d):0,v(t,((n,l)=>o(l,n)))):null==(r=y(t,n))||r.send(l+"\n"+d)}var o})),n.on("close",(()=>{h(t,l),x(z,[r],l,-1),i(t)&&(h(L,r),x(c,void 0,r,-1))}))}))))}));const C={getWebSocketServer:()=>a,getPathIds:()=>g(L),getClientIds:n=>g(y(L,n)),addPathIdsListener:n=>m(n,c),addClientIdsListener:(n,l)=>m(l,z,[n]),delListener:n=>(A(n),C),getStats:()=>({paths:o(L),clients:d(L)}),destroy:()=>{a.close(),L.clear()}};return s(C)};export{z as createWsServer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",c=i+"s",a=i+u,I="Row",p=I+"Count",v=I+u,b="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",w=m+u,f=e=>null==e,k=(e,t,o)=>f(e)?null==o?void 0:o():t(e),h=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,x=()=>{},q=(e,t)=>e.every(t),S=(e,t)=>R(e)===R(t)&&q(e,((e,o)=>t[o]===e)),O=(e,t)=>e.map(t),L=Object,j=e=>L.getPrototypeOf(e),B=L.entries,E=e=>!f(e)&&k(j(e),(e=>e==L.prototype||f(j(e))),(()=>!0)),T=L.keys,M=(e,t)=>k(e,(e=>e[t])),F=(e,t)=>{const o=B(e);return R(o)===R(T(t))&&q(o,(([e,o])=>E(o)?!!E(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return f(e)?r[t]:h(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return f(e)||h(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:se,useEffect:de,useMemo:ue,useLayoutEffect:ie,useRef:ce,useState:ae,useSyncExternalStore:Ie}=e,pe=[],ve=[{},[],[pe,void 0,pe],void 0,!1,0],be=[F,S,([e,t,o],[r,n,l])=>t===n&&S(e,r)&&S(o,l)],ge=(e,t)=>e===t,ye=(e,t,o=pe)=>{const[,r]=ae(),[n,l]=ae();return de((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},me=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Ce=(e,t,r,n=pe)=>{const l=ce(ve[r]),s=se((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:ve[r];return(null!=(d=be[r])?d:ge)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=se((l=>me(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]);return Ie(u,s)},we=(e,t,o,r=pe,n=pe,...l)=>ie((()=>me(t,e,...n,o,...l)),[t,e,...n,...r,...l]),fe=(e,t,o,r=pe,n=x,l=pe,...s)=>{const d=J(e);return se((e=>k(d,(r=>k(o(e,r),(o=>n(r["set"+t](...O(s,(t=>P(t)?t(e,r):t)),o),o)))))),[d,t,...r,...l,...s])},ke=(e,t,o=x,r=pe,...n)=>{const l=J(e);return se((()=>o(null==l?void 0:l["del"+t](...n))),[l,t,...r,...n])},he=(e,t,o)=>{const r=oe(e);return se((()=>null==r?void 0:r[t](o)),[r,t,o])},Pe=(e,t=pe)=>ue(e,t),Re=(e,t=pe)=>ue(e,t),xe=()=>z(1),qe=e=>Ce(c,J(e),4,[]),Se=e=>Ce(c,J(e),0),Oe=e=>Ce(a,J(e),1),Le=(e,t)=>Ce(i,J(t),4,[e]),je=(e,t)=>Ce(i,J(t),0,[e]),Be=(e,t)=>Ce(i+y,J(t),1,[e]),Ee=(e,t,o)=>Ce(i+g,J(o),4,[e,t]),Te=(e,t)=>Ce(p,J(t),5,[e]),Me=(e,t)=>Ce(v,J(t),1,[e]),Fe=(e,t,o,r=0,n,l)=>Ce(b,J(l),1,[e,t,o,r,n]),Ve=(e,t,o)=>Ce(I,J(o),4,[e,t]),Ae=(e,t,o)=>Ce(I,J(o),0,[e,t]),De=(e,t,o)=>Ce(y,J(o),1,[e,t]),He=(e,t,o,r)=>Ce(g,J(r),4,[e,t,o]),Qe=(e,t,o,r)=>Ce(g,J(r),3,[e,t,o]),We=e=>Ce(C,J(e),4,[]),ze=e=>Ce(C,J(e),0),Ge=e=>Ce(w,J(e),1),Je=(e,t)=>Ce(m,J(t),4,[e]),Ke=(e,t)=>Ce(m,J(t),3,[e]),Ne=(e,t,o,r,n)=>fe(o,c,e,t,r,n),Ue=(e,t,o,r,n,l)=>fe(r,i,t,o,n,l,e),Xe=(e,t,o,r,n,l,s)=>fe(n,I,o,r,l,s,e,t),Ye=(e,t,o=pe,r,n=x,l=pe,s=!0)=>{const d=J(r);return se((o=>k(d,(r=>k(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},Ze=(e,t,o,r,n,l,s)=>fe(n,"PartialRow",o,r,l,s,e,t),$e=(e,t,o,r,n,l,s,d)=>fe(l,g,r,n,s,d,e,t,o),_e=(e,t,o,r,n)=>fe(o,C,e,t,r,n),et=(e,t,o,r,n)=>fe(o,"PartialValues",e,t,r,n),tt=(e,t,o,r,n,l)=>fe(r,m,t,o,n,l,e),ot=(e,t,o)=>ke(e,c,t,o),rt=(e,t,o,r)=>ke(t,i,o,r,e),nt=(e,t,o,r,n)=>ke(o,I,r,n,e,t),lt=(e,t,o,r,n,l,s)=>ke(n,g,l,s,e,t,o,r),st=(e,t,o)=>ke(e,C,t,o),dt=(e,t,o,r)=>ke(t,m,o,r,e),ut=(e,t,o,r)=>we(d+c,J(r),e,t,[],o),it=(e,t,o,r)=>we(c,J(r),e,t,pe,o),ct=(e,t,o,r)=>we(a,J(r),e,t,pe,o),at=(e,t,o,r,n)=>we(d+i,J(n),t,o,[e],r),It=(e,t,o,r,n)=>we(i,J(n),t,o,[e],r),pt=(e,t,o,r,n)=>we(i+y,J(n),t,o,[e],r),vt=(e,t,o,r,n,l)=>we(d+i+g,J(l),o,r,[e,t],n),bt=(e,t,o,r,n)=>we(p,J(n),t,o,[e],r),gt=(e,t,o,r,n)=>we(v,J(n),t,o,[e],r),yt=(e,t,o,r,n,l,s,d,u)=>we(b,J(u),l,s,[e,t,o,r,n],d),mt=(e,t,o,r,n,l)=>we(d+I,J(l),o,r,[e,t],n),Ct=(e,t,o,r,n,l)=>we(I,J(l),o,r,[e,t],n),wt=(e,t,o,r,n,l)=>we(y,J(l),o,r,[e,t],n),ft=(e,t,o,r,n,l,s)=>we(d+g,J(s),r,n,[e,t,o],l),kt=(e,t,o,r,n,l,s)=>we(g,J(s),r,n,[e,t,o],l),ht=(e,t,o,r)=>we(d+C,J(r),e,t,[],o),Pt=(e,t,o,r)=>we(C,J(r),e,t,pe,o),Rt=(e,t,o,r)=>we(w,J(r),e,t,pe,o),xt=(e,t,o,r,n)=>we(d+m,J(n),t,o,[e],r),qt=(e,t,o,r,n)=>we(m,J(n),t,o,[e],r),St=(e,t,o)=>we("Start"+ne,J(o),e,t),Ot=(e,t,o)=>we("WillFinish"+ne,J(o),e,t),Lt=(e,t,o)=>we("DidFinish"+ne,J(o),e,t),jt=(e,t,o)=>ye(e,t,o),Bt=()=>z(3),Et=e=>Ce("MetricIds",U(e),1),Tt=(e,t)=>Ce("Metric",U(t),3,[e]),Mt=(e,t,o,r)=>we("Metric",U(r),t,o,[e]),Ft=(e,t,o)=>ye(e,t,o),Vt=()=>z(5),At=(e,t)=>Ce("SliceIds",Y(t),1,[e]),Dt=e=>Ce("IndexIds",Y(e),1),Ht=(e,t,o)=>Ce("Slice"+v,Y(o),1,[e,t]),Qt=(e,t,o,r)=>we("SliceIds",Y(r),t,o,[e]),Wt=(e,t,o,r,n)=>we("Slice"+v,Y(n),o,r,[e,t]),zt=(e,t,o)=>ye(e,t,o),Gt=()=>z(7),Jt=e=>Ce("RelationshipIds",$(e),1),Kt=(e,t,o)=>Ce("RemoteRowId",$(o),3,[e,t]),Nt=(e,t,o)=>Ce("Local"+v,$(o),1,[e,t]),Ut=(e,t,o)=>Ce("Linked"+v,$(o),1,[e,t]),Xt=(e,t,o,r,n)=>we("RemoteRowId",$(n),o,r,[e,t]),Yt=(e,t,o,r,n)=>we("Local"+v,$(n),o,r,[e,t]),Zt=(e,t,o,r,n)=>we("Linked"+v,$(n),o,r,[e,t]),$t=(e,t,o)=>ye(e,t,o),_t=()=>z(9),eo=e=>Ce("QueryIds",ee(e),1),to=(e,t)=>Ce(s+i,ee(t),0,[e]),oo=(e,t)=>Ce(s+i+y,ee(t),1,[e]),ro=(e,t)=>Ce(s+p,ee(t),5,[e]),no=(e,t)=>Ce(s+v,ee(t),1,[e]),lo=(e,t,o,r=0,n,l)=>Ce(s+b,ee(l),1,[e,t,o,r,n]),so=(e,t,o)=>Ce(s+I,ee(o),0,[e,t]),uo=(e,t,o)=>Ce(s+y,ee(o),1,[e,t]),io=(e,t,o,r)=>Ce(s+g,ee(r),3,[e,t,o]),co=(e,t,o,r)=>we(s+i,ee(r),t,o,[e]),ao=(e,t,o,r)=>we(s+i+y,ee(r),t,o,[e]),Io=(e,t,o,r)=>we(s+p,ee(r),t,o,[e]),po=(e,t,o,r)=>we(s+v,ee(r),t,o,[e]),vo=(e,t,o,r,n,l,d,u)=>we(s+b,ee(u),l,d,[e,t,o,r,n]),bo=(e,t,o,r,n)=>we(s+I,ee(n),o,r,[e,t]),go=(e,t,o,r,n)=>we(s+y,ee(n),o,r,[e,t]),yo=(e,t,o,r,n,l)=>we(s+g,ee(l),r,n,[e,t,o]),mo=(e,t,o)=>ye(e,t,o),Co=()=>z(11),wo=e=>Ce("CheckpointIds",oe(e),2),fo=(e,t)=>Ce("Checkpoint",oe(t),3,[e]),ko=(e=x,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},ho=e=>he(e,"goBackward"),Po=e=>he(e,"goForward"),Ro=(e,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>k(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},xo=e=>{var t;const r=oe(e),[n,l]=wo(r);return[(s=n,!(0==R(s))),ho(r),l,null!=(t=k(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},qo=e=>{var t;const r=oe(e),[,,[n]]=wo(r);return[!f(n),Po(r),n,null!=(t=k(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},So=(e,t,o)=>we("CheckpointIds",oe(o),e,t),Oo=(e,t,o,r)=>we("Checkpoint",oe(r),t,o,[e]),Lo=(e,t,o=pe,r,n=pe,l,s=pe)=>{const[,d]=ae(),[u,i]=ae();return de((()=>{const o=e?t(e):void 0;i(o),o&&r&&le(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),de((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},jo=(e,t,o=pe,r,n=pe)=>{const[l,s]=ae();return de((()=>{le(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),de((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:Bo,Fragment:Eo,createElement:To,useCallback:Mo,useLayoutEffect:Fo,useRef:Vo,useState:Ao}=e,Do=(e,...t)=>f(e)?{}:e(...t),Ho=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var Qo=Object.defineProperty,Wo=Object.defineProperties,zo=Object.getOwnPropertyDescriptors,Go=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,No=(e,t,o)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Uo=(e,t)=>{for(var o in t||(t={}))Jo.call(t,o)&&No(e,o,t[o]);if(Go)for(var o of Go(t))Ko.call(t,o)&&No(e,o,t[o]);return e},Xo=(e,t)=>Wo(e,zo(t)),Yo=(e,t)=>{var o={};for(var r in e)Jo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Go)for(var r of Go(e))t.indexOf(r)<0&&Ko.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:Zo,useContext:$o,useMemo:_o,useState:er}=e,tr=({tableId:e,store:t,rowComponent:o=ur,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>sr(O(d,(l=>To(o,Xo(Uo({},Do(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),or=({queryId:e,queries:t,resultRowComponent:o=fr,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>sr(O(s,(n=>To(o,Xo(Uo({},Do(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),rr=({relationshipId:e,relationships:t,rowComponent:o=ur,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,c]=Ho($(t),e),a=s(e,d,u);return sr(O(a,(e=>To(o,Xo(Uo({},Do(r,e)),{key:e,tableId:c,rowId:e,store:i,debugIds:l})))),n,l,d)},nr=e=>({checkpoints:t,checkpointComponent:o=Pr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return sr(O(e(wo(s)),(e=>To(o,Xo(Uo({},Do(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},lr=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:c,checkpointsById:a,children:I})=>{const p=$o(H),[v,b]=er({}),g=Zo(((e,t)=>b((o=>M(o,e)==t?o:Xo(Uo({},o),{[e]:t})))),[]),y=Zo((e=>b((t=>Uo({},((e,t)=>(delete e[t],e))(t,e))))),[]);return To(H.Provider,{value:_o((()=>[null!=e?e:p[0],Uo(Uo(Uo({},p[1]),t),v),null!=o?o:p[2],Uo(Uo({},p[3]),r),null!=n?n:p[4],Uo(Uo({},p[5]),l),null!=s?s:p[6],Uo(Uo({},p[7]),d),null!=u?u:p[8],Uo(Uo({},p[9]),i),null!=c?c:p[10],Uo(Uo({},p[11]),a),g,y]),[e,t,v,o,r,n,l,s,d,u,i,c,a,p,g,y])},I)},sr=(e,t,o,r)=>{const n=f(t)||!Array.isArray(e)?e:O(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},dr=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return sr(o+(null!=(s=Qe(e,t,r,n))?s:o),void 0,l,r)},ur=({tableId:e,rowId:t,store:o,cellComponent:r=dr,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>sr(O(((e,t,o,r)=>{const n=De(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>To(r,Xo(Uo({},Do(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),ir=e=>tr(e,Me(e.tableId,e.store)),cr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=Yo(t,["cellId","descending","offset","limit"]);return tr(s,Fe(s.tableId,o,r,n,l,s.store))},ar=({store:e,tableComponent:t=ir,getTableComponentProps:o,separator:r,debugIds:n})=>sr(O(Oe(e),(r=>To(t,Xo(Uo({},Do(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),Ir=({valueId:e,store:t,debugIds:r})=>{var n;return sr(o+(null!=(n=Ke(e,t))?n:o),void 0,r,e)},pr=({store:e,valueComponent:t=Ir,getValueComponentProps:o,separator:r,debugIds:n})=>sr(O(Ge(e),(r=>To(t,Xo(Uo({},Do(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),vr=({metricId:e,metrics:t,debugIds:r})=>{var n;return sr(null!=(n=Tt(e,t))?n:o,void 0,r,e)},br=({indexId:e,sliceId:t,indexes:o,rowComponent:r=ur,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),c=Ht(e,t,d);return sr(O(c,(e=>To(r,Xo(Uo({},Do(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},gr=({indexId:e,indexes:t,sliceComponent:o=br,getSliceComponentProps:r,separator:n,debugIds:l})=>sr(O(At(e,t),(n=>To(o,Xo(Uo({},Do(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),yr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=ur,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Ho($(o),e),i=Kt(e,t,s);return sr(f(u)||f(i)?null:To(r,Xo(Uo({},Do(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},mr=e=>rr(e,Nt,e.remoteRowId),Cr=e=>rr(e,Ut,e.firstRowId),wr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return sr(o+(null!=(s=io(e,t,r,n))?s:o),void 0,l,r)},fr=({queryId:e,rowId:t,queries:o,resultCellComponent:r=wr,getResultCellComponentProps:n,separator:l,debugIds:s})=>sr(O(uo(e,t,o),(l=>To(r,Xo(Uo({},Do(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),kr=e=>or(e,no(e.queryId,e.queries)),hr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=Yo(t,["cellId","descending","offset","limit"]);return or(s,lo(s.queryId,o,r,n,l,s.queries))},Pr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return sr(null!=(n=fo(t,e))?n:o,void 0,r,t)},Rr=nr((e=>e[0])),xr=nr((e=>f(e[1])?[]:[e[1]])),qr=nr((e=>e[2]));export{Rr as BackwardCheckpointsView,dr as CellView,Pr as CheckpointView,xr as CurrentCheckpointView,qr as ForwardCheckpointsView,gr as IndexView,Cr as LinkedRowsView,mr as LocalRowsView,vr as MetricView,lr as Provider,yr as RemoteRowView,wr as ResultCellView,fr as ResultRowView,hr as ResultSortedTableView,kr as ResultTableView,ur as RowView,br as SliceView,cr as SortedTableView,ir as TableView,ar as TablesView,Ir as ValueView,pr as ValuesView,Ye as useAddRowCallback,Qe as useCell,De as useCellIds,wt as useCellIdsListener,kt as useCellListener,fo as useCheckpoint,wo as useCheckpointIds,So as useCheckpointIdsListener,Oo as useCheckpointListener,te as useCheckpoints,Co as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,mo as useCreateCheckpoints,Ft as useCreateIndexes,Re as useCreateMergeableStore,jt as useCreateMetrics,Lo as useCreatePersister,$t as useCreateQueries,zt as useCreateRelationships,Pe as useCreateStore,jo as useCreateSynchronizer,lt as useDelCellCallback,nt as useDelRowCallback,rt as useDelTableCallback,ot as useDelTablesCallback,dt as useDelValueCallback,st as useDelValuesCallback,Lt as useDidFinishTransactionListener,ho as useGoBackwardCallback,Po as useGoForwardCallback,Ro as useGoToCallback,He as useHasCell,ft as useHasCellListener,Ve as useHasRow,mt as useHasRowListener,Le as useHasTable,Ee as useHasTableCell,vt as useHasTableCellListener,at as useHasTableListener,qe as useHasTables,ut as useHasTablesListener,Je as useHasValue,xt as useHasValueListener,We as useHasValues,ht as useHasValuesListener,Dt as useIndexIds,X as useIndexes,Vt as useIndexesIds,Y as useIndexesOrIndexesById,Ut as useLinkedRowIds,Zt as useLinkedRowIdsListener,Nt as useLocalRowIds,Yt as useLocalRowIdsListener,Tt as useMetric,Et as useMetricIds,Mt as useMetricListener,N as useMetrics,Bt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,_t as useQueriesIds,ee as useQueriesOrQueriesById,eo as useQueryIds,qo as useRedoInformation,Jt as useRelationshipIds,Z as useRelationships,Gt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Kt as useRemoteRowId,Xt as useRemoteRowIdListener,io as useResultCell,uo as useResultCellIds,go as useResultCellIdsListener,yo as useResultCellListener,so as useResultRow,ro as useResultRowCount,Io as useResultRowCountListener,no as useResultRowIds,po as useResultRowIdsListener,bo as useResultRowListener,lo as useResultSortedRowIds,vo as useResultSortedRowIdsListener,to as useResultTable,oo as useResultTableCellIds,ao as useResultTableCellIdsListener,co as useResultTableListener,Ae as useRow,Te as useRowCount,bt as useRowCountListener,Me as useRowIds,gt as useRowIdsListener,Ct as useRowListener,$e as useSetCellCallback,ko as useSetCheckpointCallback,Ze as useSetPartialRowCallback,et as useSetPartialValuesCallback,Xe as useSetRowCallback,Ue as useSetTableCallback,Ne as useSetTablesCallback,tt as useSetValueCallback,_e as useSetValuesCallback,At as useSliceIds,Qt as useSliceIdsListener,Ht as useSliceRowIds,Wt as useSliceRowIdsListener,Fe as useSortedRowIds,yt as useSortedRowIdsListener,St as useStartTransactionListener,G as useStore,xe as useStoreIds,J as useStoreOrStoreById,je as useTable,Be as useTableCellIds,pt as useTableCellIdsListener,Oe as useTableIds,ct as useTableIdsListener,It as useTableListener,Se as useTables,it as useTablesListener,xo as useUndoInformation,Ke as useValue,Ge as useValueIds,Rt as useValueIdsListener,qt as useValueListener,ze as useValues,Pt as useValuesListener,Ot as useWillFinishTransactionListener};
|
|
1
|
+
import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",a=i+"s",c=i+u,I="Row",p=I+"Count",v=I+u,b="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",f=m+u,w=e=>null==e,k=(e,t,o)=>w(e)?null==o?void 0:o():t(e),h=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,x=()=>{},q=(e,t)=>e.every(t),S=(e,t)=>R(e)===R(t)&&q(e,((e,o)=>t[o]===e)),O=(e,t)=>e.map(t),L=Object,j=e=>L.getPrototypeOf(e),B=L.entries,E=e=>!w(e)&&k(j(e),(e=>e==L.prototype||w(j(e))),(()=>!0)),T=L.keys,M=(e,t)=>k(e,(e=>e[t])),F=(e,t)=>{const o=B(e);return R(o)===R(T(t))&&q(o,(([e,o])=>E(o)?!!E(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return w(e)?r[t]:h(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return w(e)||h(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:se,useEffect:de,useMemo:ue,useLayoutEffect:ie,useRef:ae,useState:ce,useSyncExternalStore:Ie}=e,pe=[],ve=[{},[],[pe,void 0,pe],void 0,!1,0],be=[F,S,([e,t,o],[r,n,l])=>t===n&&S(e,r)&&S(o,l)],ge=(e,t)=>e===t,ye=(e,t,o=pe)=>{const[,r]=ce(),[n,l]=ce();return de((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},me=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Ce=(e,t,r,n=pe)=>{const l=ae(ve[r]),s=se((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:ve[r];return(null!=(d=be[r])?d:ge)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=se((l=>me(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]);return Ie(u,s)},fe=(e,t,o,r=pe,n=pe,...l)=>ie((()=>me(t,e,...n,o,...l)),[t,e,...n,...r,...l]),we=(e,t,o,r=pe,n=x,l=pe,...s)=>{const d=J(e);return se((e=>k(d,(r=>k(o(e,r),(o=>n(r["set"+t](...ke(s,r,e),o),o)))))),[d,t,...r,...l,...he(s)])},ke=(e,t,o)=>O(e,(e=>P(e)?e(o,t):e)),he=e=>{return t=e=>!P(e),e.filter(t);var t},Pe=(e,t,o=x,r=pe,...n)=>{const l=J(e);return se((e=>o(null==l?void 0:l["del"+t](...ke(n,l,e)))),[l,t,...r,...he(n)])},Re=(e,t,o)=>{const r=oe(e);return se((()=>null==r?void 0:r[t](o)),[r,t,o])},xe=(e,t=pe)=>ue(e,t),qe=(e,t=pe)=>ue(e,t),Se=()=>z(1),Oe=e=>Ce(a,J(e),4,[]),Le=e=>Ce(a,J(e),0),je=e=>Ce(c,J(e),1),Be=(e,t)=>Ce(i,J(t),4,[e]),Ee=(e,t)=>Ce(i,J(t),0,[e]),Te=(e,t)=>Ce(i+y,J(t),1,[e]),Me=(e,t,o)=>Ce(i+g,J(o),4,[e,t]),Fe=(e,t)=>Ce(p,J(t),5,[e]),Ve=(e,t)=>Ce(v,J(t),1,[e]),Ae=(e,t,o,r=0,n,l)=>Ce(b,J(l),1,[e,t,o,r,n]),De=(e,t,o)=>Ce(I,J(o),4,[e,t]),He=(e,t,o)=>Ce(I,J(o),0,[e,t]),Qe=(e,t,o)=>Ce(y,J(o),1,[e,t]),We=(e,t,o,r)=>Ce(g,J(r),4,[e,t,o]),ze=(e,t,o,r)=>Ce(g,J(r),3,[e,t,o]),Ge=e=>Ce(C,J(e),4,[]),Je=e=>Ce(C,J(e),0),Ke=e=>Ce(f,J(e),1),Ne=(e,t)=>Ce(m,J(t),4,[e]),Ue=(e,t)=>Ce(m,J(t),3,[e]),Xe=(e,t,o,r,n)=>we(o,a,e,t,r,n),Ye=(e,t,o,r,n,l)=>we(r,i,t,o,n,l,e),Ze=(e,t,o,r,n,l,s)=>we(n,I,o,r,l,s,e,t),$e=(e,t,o=pe,r,n=x,l=pe,s=!0)=>{const d=J(r);return se((o=>k(d,(r=>k(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},_e=(e,t,o,r,n,l,s)=>we(n,"PartialRow",o,r,l,s,e,t),et=(e,t,o,r,n,l,s,d)=>we(l,g,r,n,s,d,e,t,o),tt=(e,t,o,r,n)=>we(o,C,e,t,r,n),ot=(e,t,o,r,n)=>we(o,"PartialValues",e,t,r,n),rt=(e,t,o,r,n,l)=>we(r,m,t,o,n,l,e),nt=(e,t,o)=>Pe(e,a,t,o),lt=(e,t,o,r)=>Pe(t,i,o,r,e),st=(e,t,o,r,n)=>Pe(o,I,r,n,e,t),dt=(e,t,o,r,n,l,s)=>Pe(n,g,l,s,e,t,o,r),ut=(e,t,o)=>Pe(e,C,t,o),it=(e,t,o,r)=>Pe(t,m,o,r,e),at=(e,t,o,r)=>fe(d+a,J(r),e,t,[],o),ct=(e,t,o,r)=>fe(a,J(r),e,t,pe,o),It=(e,t,o,r)=>fe(c,J(r),e,t,pe,o),pt=(e,t,o,r,n)=>fe(d+i,J(n),t,o,[e],r),vt=(e,t,o,r,n)=>fe(i,J(n),t,o,[e],r),bt=(e,t,o,r,n)=>fe(i+y,J(n),t,o,[e],r),gt=(e,t,o,r,n,l)=>fe(d+i+g,J(l),o,r,[e,t],n),yt=(e,t,o,r,n)=>fe(p,J(n),t,o,[e],r),mt=(e,t,o,r,n)=>fe(v,J(n),t,o,[e],r),Ct=(e,t,o,r,n,l,s,d,u)=>fe(b,J(u),l,s,[e,t,o,r,n],d),ft=(e,t,o,r,n,l)=>fe(d+I,J(l),o,r,[e,t],n),wt=(e,t,o,r,n,l)=>fe(I,J(l),o,r,[e,t],n),kt=(e,t,o,r,n,l)=>fe(y,J(l),o,r,[e,t],n),ht=(e,t,o,r,n,l,s)=>fe(d+g,J(s),r,n,[e,t,o],l),Pt=(e,t,o,r,n,l,s)=>fe(g,J(s),r,n,[e,t,o],l),Rt=(e,t,o,r)=>fe(d+C,J(r),e,t,[],o),xt=(e,t,o,r)=>fe(C,J(r),e,t,pe,o),qt=(e,t,o,r)=>fe(f,J(r),e,t,pe,o),St=(e,t,o,r,n)=>fe(d+m,J(n),t,o,[e],r),Ot=(e,t,o,r,n)=>fe(m,J(n),t,o,[e],r),Lt=(e,t,o)=>fe("Start"+ne,J(o),e,t),jt=(e,t,o)=>fe("WillFinish"+ne,J(o),e,t),Bt=(e,t,o)=>fe("DidFinish"+ne,J(o),e,t),Et=(e,t,o)=>ye(e,t,o),Tt=()=>z(3),Mt=e=>Ce("MetricIds",U(e),1),Ft=(e,t)=>Ce("Metric",U(t),3,[e]),Vt=(e,t,o,r)=>fe("Metric",U(r),t,o,[e]),At=(e,t,o)=>ye(e,t,o),Dt=()=>z(5),Ht=(e,t)=>Ce("SliceIds",Y(t),1,[e]),Qt=e=>Ce("IndexIds",Y(e),1),Wt=(e,t,o)=>Ce("Slice"+v,Y(o),1,[e,t]),zt=(e,t,o,r)=>fe("SliceIds",Y(r),t,o,[e]),Gt=(e,t,o,r,n)=>fe("Slice"+v,Y(n),o,r,[e,t]),Jt=(e,t,o)=>ye(e,t,o),Kt=()=>z(7),Nt=e=>Ce("RelationshipIds",$(e),1),Ut=(e,t,o)=>Ce("RemoteRowId",$(o),3,[e,t]),Xt=(e,t,o)=>Ce("Local"+v,$(o),1,[e,t]),Yt=(e,t,o)=>Ce("Linked"+v,$(o),1,[e,t]),Zt=(e,t,o,r,n)=>fe("RemoteRowId",$(n),o,r,[e,t]),$t=(e,t,o,r,n)=>fe("Local"+v,$(n),o,r,[e,t]),_t=(e,t,o,r,n)=>fe("Linked"+v,$(n),o,r,[e,t]),eo=(e,t,o)=>ye(e,t,o),to=()=>z(9),oo=e=>Ce("QueryIds",ee(e),1),ro=(e,t)=>Ce(s+i,ee(t),0,[e]),no=(e,t)=>Ce(s+i+y,ee(t),1,[e]),lo=(e,t)=>Ce(s+p,ee(t),5,[e]),so=(e,t)=>Ce(s+v,ee(t),1,[e]),uo=(e,t,o,r=0,n,l)=>Ce(s+b,ee(l),1,[e,t,o,r,n]),io=(e,t,o)=>Ce(s+I,ee(o),0,[e,t]),ao=(e,t,o)=>Ce(s+y,ee(o),1,[e,t]),co=(e,t,o,r)=>Ce(s+g,ee(r),3,[e,t,o]),Io=(e,t,o,r)=>fe(s+i,ee(r),t,o,[e]),po=(e,t,o,r)=>fe(s+i+y,ee(r),t,o,[e]),vo=(e,t,o,r)=>fe(s+p,ee(r),t,o,[e]),bo=(e,t,o,r)=>fe(s+v,ee(r),t,o,[e]),go=(e,t,o,r,n,l,d,u)=>fe(s+b,ee(u),l,d,[e,t,o,r,n]),yo=(e,t,o,r,n)=>fe(s+I,ee(n),o,r,[e,t]),mo=(e,t,o,r,n)=>fe(s+y,ee(n),o,r,[e,t]),Co=(e,t,o,r,n,l)=>fe(s+g,ee(l),r,n,[e,t,o]),fo=(e,t,o)=>ye(e,t,o),wo=()=>z(11),ko=e=>Ce("CheckpointIds",oe(e),2),ho=(e,t)=>Ce("Checkpoint",oe(t),3,[e]),Po=(e=x,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},Ro=e=>Re(e,"goBackward"),xo=e=>Re(e,"goForward"),qo=(e,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>k(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},So=e=>{var t;const r=oe(e),[n,l]=ko(r);return[(s=n,!(0==R(s))),Ro(r),l,null!=(t=k(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},Oo=e=>{var t;const r=oe(e),[,,[n]]=ko(r);return[!w(n),xo(r),n,null!=(t=k(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},Lo=(e,t,o)=>fe("CheckpointIds",oe(o),e,t),jo=(e,t,o,r)=>fe("Checkpoint",oe(r),t,o,[e]),Bo=(e,t,o=pe,r,n=pe,l,s=pe)=>{const[,d]=ce(),[u,i]=ce();return de((()=>{const o=e?t(e):void 0;i(o),o&&r&&le(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),de((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},Eo=(e,t,o=pe,r,n=pe)=>{const[l,s]=ce();return de((()=>{le(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),de((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:To,Fragment:Mo,createElement:Fo,useCallback:Vo,useLayoutEffect:Ao,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>w(e)?{}:e(...t),Wo=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var zo=Object.defineProperty,Go=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,No=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Xo=(e,t,o)=>t in e?zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Yo=(e,t)=>{for(var o in t||(t={}))No.call(t,o)&&Xo(e,o,t[o]);if(Ko)for(var o of Ko(t))Uo.call(t,o)&&Xo(e,o,t[o]);return e},Zo=(e,t)=>Go(e,Jo(t)),$o=(e,t)=>{var o={};for(var r in e)No.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Ko)for(var r of Ko(e))t.indexOf(r)<0&&Uo.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:_o,useContext:er,useMemo:tr,useState:or}=e,rr=({tableId:e,store:t,rowComponent:o=ar,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>ur(O(d,(l=>Fo(o,Zo(Yo({},Qo(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),nr=({queryId:e,queries:t,resultRowComponent:o=hr,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>ur(O(s,(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),lr=({relationshipId:e,relationships:t,rowComponent:o=ar,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,a]=Wo($(t),e),c=s(e,d,u);return ur(O(c,(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),n,l,d)},sr=e=>({checkpoints:t,checkpointComponent:o=xr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return ur(O(e(ko(s)),(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},dr=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:a,checkpointsById:c,children:I})=>{const p=er(H),[v,b]=or({}),g=_o(((e,t)=>b((o=>M(o,e)==t?o:Zo(Yo({},o),{[e]:t})))),[]),y=_o((e=>b((t=>Yo({},((e,t)=>(delete e[t],e))(t,e))))),[]);return Fo(H.Provider,{value:tr((()=>[null!=e?e:p[0],Yo(Yo(Yo({},p[1]),t),v),null!=o?o:p[2],Yo(Yo({},p[3]),r),null!=n?n:p[4],Yo(Yo({},p[5]),l),null!=s?s:p[6],Yo(Yo({},p[7]),d),null!=u?u:p[8],Yo(Yo({},p[9]),i),null!=a?a:p[10],Yo(Yo({},p[11]),c),g,y]),[e,t,v,o,r,n,l,s,d,u,i,a,c,p,g,y])},I)},ur=(e,t,o,r)=>{const n=w(t)||!Array.isArray(e)?e:O(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},ir=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return ur(o+(null!=(s=ze(e,t,r,n))?s:o),void 0,l,r)},ar=({tableId:e,rowId:t,store:o,cellComponent:r=ir,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>ur(O(((e,t,o,r)=>{const n=Qe(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),cr=e=>rr(e,Ve(e.tableId,e.store)),Ir=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return rr(s,Ae(s.tableId,o,r,n,l,s.store))},pr=({store:e,tableComponent:t=cr,getTableComponentProps:o,separator:r,debugIds:n})=>ur(O(je(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),vr=({valueId:e,store:t,debugIds:r})=>{var n;return ur(o+(null!=(n=Ue(e,t))?n:o),void 0,r,e)},br=({store:e,valueComponent:t=vr,getValueComponentProps:o,separator:r,debugIds:n})=>ur(O(Ke(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),gr=({metricId:e,metrics:t,debugIds:r})=>{var n;return ur(null!=(n=Ft(e,t))?n:o,void 0,r,e)},yr=({indexId:e,sliceId:t,indexes:o,rowComponent:r=ar,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),a=Wt(e,t,d);return ur(O(a,(e=>Fo(r,Zo(Yo({},Qo(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},mr=({indexId:e,indexes:t,sliceComponent:o=yr,getSliceComponentProps:r,separator:n,debugIds:l})=>ur(O(Ht(e,t),(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),Cr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=ar,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Wo($(o),e),i=Ut(e,t,s);return ur(w(u)||w(i)?null:Fo(r,Zo(Yo({},Qo(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},fr=e=>lr(e,Xt,e.remoteRowId),wr=e=>lr(e,Yt,e.firstRowId),kr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return ur(o+(null!=(s=co(e,t,r,n))?s:o),void 0,l,r)},hr=({queryId:e,rowId:t,queries:o,resultCellComponent:r=kr,getResultCellComponentProps:n,separator:l,debugIds:s})=>ur(O(ao(e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),Pr=e=>nr(e,so(e.queryId,e.queries)),Rr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return nr(s,uo(s.queryId,o,r,n,l,s.queries))},xr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return ur(null!=(n=ho(t,e))?n:o,void 0,r,t)},qr=sr((e=>e[0])),Sr=sr((e=>w(e[1])?[]:[e[1]])),Or=sr((e=>e[2]));export{qr as BackwardCheckpointsView,ir as CellView,xr as CheckpointView,Sr as CurrentCheckpointView,Or as ForwardCheckpointsView,mr as IndexView,wr as LinkedRowsView,fr as LocalRowsView,gr as MetricView,dr as Provider,Cr as RemoteRowView,kr as ResultCellView,hr as ResultRowView,Rr as ResultSortedTableView,Pr as ResultTableView,ar as RowView,yr as SliceView,Ir as SortedTableView,cr as TableView,pr as TablesView,vr as ValueView,br as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,kt as useCellIdsListener,Pt as useCellListener,ho as useCheckpoint,ko as useCheckpointIds,Lo as useCheckpointIdsListener,jo as useCheckpointListener,te as useCheckpoints,wo as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,fo as useCreateCheckpoints,At as useCreateIndexes,qe as useCreateMergeableStore,Et as useCreateMetrics,Bo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,xe as useCreateStore,Eo as useCreateSynchronizer,dt as useDelCellCallback,st as useDelRowCallback,lt as useDelTableCallback,nt as useDelTablesCallback,it as useDelValueCallback,ut as useDelValuesCallback,Bt as useDidFinishTransactionListener,Ro as useGoBackwardCallback,xo as useGoForwardCallback,qo as useGoToCallback,We as useHasCell,ht as useHasCellListener,De as useHasRow,ft as useHasRowListener,Be as useHasTable,Me as useHasTableCell,gt as useHasTableCellListener,pt as useHasTableListener,Oe as useHasTables,at as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,Rt as useHasValuesListener,Qt as useIndexIds,X as useIndexes,Dt as useIndexesIds,Y as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,Ft as useMetric,Mt as useMetricIds,Vt as useMetricListener,N as useMetrics,Tt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,to as useQueriesIds,ee as useQueriesOrQueriesById,oo as useQueryIds,Oo as useRedoInformation,Nt as useRelationshipIds,Z as useRelationships,Kt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,co as useResultCell,ao as useResultCellIds,mo as useResultCellIdsListener,Co as useResultCellListener,io as useResultRow,lo as useResultRowCount,vo as useResultRowCountListener,so as useResultRowIds,bo as useResultRowIdsListener,yo as useResultRowListener,uo as useResultSortedRowIds,go as useResultSortedRowIdsListener,ro as useResultTable,no as useResultTableCellIds,po as useResultTableCellIdsListener,Io as useResultTableListener,He as useRow,Fe as useRowCount,yt as useRowCountListener,Ve as useRowIds,mt as useRowIdsListener,wt as useRowListener,et as useSetCellCallback,Po as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,rt as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,Ae as useSortedRowIds,Ct as useSortedRowIdsListener,Lt as useStartTransactionListener,G as useStore,Se as useStoreIds,J as useStoreOrStoreById,Ee as useTable,Te as useTableCellIds,bt as useTableCellIdsListener,je as useTableIds,It as useTableIdsListener,vt as useTableListener,Le as useTables,ct as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,qt as useValueIdsListener,Ot as useValueListener,Je as useValues,xt as useValuesListener,jt as useWillFinishTransactionListener};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",c=i+"s",a=i+u,I="Row",p=I+"Count",v=I+u,b="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",w=m+u,f=e=>null==e,k=(e,t,o)=>f(e)?null==o?void 0:o():t(e),h=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,x=()=>{},q=(e,t)=>e.every(t),S=(e,t)=>R(e)===R(t)&&q(e,((e,o)=>t[o]===e)),O=(e,t)=>e.map(t),L=Object,j=e=>L.getPrototypeOf(e),B=L.entries,E=e=>!f(e)&&k(j(e),(e=>e==L.prototype||f(j(e))),(()=>!0)),T=L.keys,M=(e,t)=>k(e,(e=>e[t])),F=(e,t)=>{const o=B(e);return R(o)===R(T(t))&&q(o,(([e,o])=>E(o)?!!E(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return f(e)?r[t]:h(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return f(e)||h(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:se,useEffect:de,useMemo:ue,useLayoutEffect:ie,useRef:ce,useState:ae,useSyncExternalStore:Ie}=e,pe=[],ve=[{},[],[pe,void 0,pe],void 0,!1,0],be=[F,S,([e,t,o],[r,n,l])=>t===n&&S(e,r)&&S(o,l)],ge=(e,t)=>e===t,ye=(e,t,o=pe)=>{const[,r]=ae(),[n,l]=ae();return de((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},me=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Ce=(e,t,r,n=pe)=>{const l=ce(ve[r]),s=se((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:ve[r];return(null!=(d=be[r])?d:ge)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=se((l=>me(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]);return Ie(u,s)},we=(e,t,o,r=pe,n=pe,...l)=>ie((()=>me(t,e,...n,o,...l)),[t,e,...n,...r,...l]),fe=(e,t,o,r=pe,n=x,l=pe,...s)=>{const d=J(e);return se((e=>k(d,(r=>k(o(e,r),(o=>n(r["set"+t](...O(s,(t=>P(t)?t(e,r):t)),o),o)))))),[d,t,...r,...l,...s])},ke=(e,t,o=x,r=pe,...n)=>{const l=J(e);return se((()=>o(null==l?void 0:l["del"+t](...n))),[l,t,...r,...n])},he=(e,t,o)=>{const r=oe(e);return se((()=>null==r?void 0:r[t](o)),[r,t,o])},Pe=(e,t=pe)=>ue(e,t),Re=(e,t=pe)=>ue(e,t),xe=()=>z(1),qe=e=>Ce(c,J(e),4,[]),Se=e=>Ce(c,J(e),0),Oe=e=>Ce(a,J(e),1),Le=(e,t)=>Ce(i,J(t),4,[e]),je=(e,t)=>Ce(i,J(t),0,[e]),Be=(e,t)=>Ce(i+y,J(t),1,[e]),Ee=(e,t,o)=>Ce(i+g,J(o),4,[e,t]),Te=(e,t)=>Ce(p,J(t),5,[e]),Me=(e,t)=>Ce(v,J(t),1,[e]),Fe=(e,t,o,r=0,n,l)=>Ce(b,J(l),1,[e,t,o,r,n]),Ve=(e,t,o)=>Ce(I,J(o),4,[e,t]),Ae=(e,t,o)=>Ce(I,J(o),0,[e,t]),De=(e,t,o)=>Ce(y,J(o),1,[e,t]),He=(e,t,o,r)=>Ce(g,J(r),4,[e,t,o]),Qe=(e,t,o,r)=>Ce(g,J(r),3,[e,t,o]),We=e=>Ce(C,J(e),4,[]),ze=e=>Ce(C,J(e),0),Ge=e=>Ce(w,J(e),1),Je=(e,t)=>Ce(m,J(t),4,[e]),Ke=(e,t)=>Ce(m,J(t),3,[e]),Ne=(e,t,o,r,n)=>fe(o,c,e,t,r,n),Ue=(e,t,o,r,n,l)=>fe(r,i,t,o,n,l,e),Xe=(e,t,o,r,n,l,s)=>fe(n,I,o,r,l,s,e,t),Ye=(e,t,o=pe,r,n=x,l=pe,s=!0)=>{const d=J(r);return se((o=>k(d,(r=>k(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},Ze=(e,t,o,r,n,l,s)=>fe(n,"PartialRow",o,r,l,s,e,t),$e=(e,t,o,r,n,l,s,d)=>fe(l,g,r,n,s,d,e,t,o),_e=(e,t,o,r,n)=>fe(o,C,e,t,r,n),et=(e,t,o,r,n)=>fe(o,"PartialValues",e,t,r,n),tt=(e,t,o,r,n,l)=>fe(r,m,t,o,n,l,e),ot=(e,t,o)=>ke(e,c,t,o),rt=(e,t,o,r)=>ke(t,i,o,r,e),nt=(e,t,o,r,n)=>ke(o,I,r,n,e,t),lt=(e,t,o,r,n,l,s)=>ke(n,g,l,s,e,t,o,r),st=(e,t,o)=>ke(e,C,t,o),dt=(e,t,o,r)=>ke(t,m,o,r,e),ut=(e,t,o,r)=>we(d+c,J(r),e,t,[],o),it=(e,t,o,r)=>we(c,J(r),e,t,pe,o),ct=(e,t,o,r)=>we(a,J(r),e,t,pe,o),at=(e,t,o,r,n)=>we(d+i,J(n),t,o,[e],r),It=(e,t,o,r,n)=>we(i,J(n),t,o,[e],r),pt=(e,t,o,r,n)=>we(i+y,J(n),t,o,[e],r),vt=(e,t,o,r,n,l)=>we(d+i+g,J(l),o,r,[e,t],n),bt=(e,t,o,r,n)=>we(p,J(n),t,o,[e],r),gt=(e,t,o,r,n)=>we(v,J(n),t,o,[e],r),yt=(e,t,o,r,n,l,s,d,u)=>we(b,J(u),l,s,[e,t,o,r,n],d),mt=(e,t,o,r,n,l)=>we(d+I,J(l),o,r,[e,t],n),Ct=(e,t,o,r,n,l)=>we(I,J(l),o,r,[e,t],n),wt=(e,t,o,r,n,l)=>we(y,J(l),o,r,[e,t],n),ft=(e,t,o,r,n,l,s)=>we(d+g,J(s),r,n,[e,t,o],l),kt=(e,t,o,r,n,l,s)=>we(g,J(s),r,n,[e,t,o],l),ht=(e,t,o,r)=>we(d+C,J(r),e,t,[],o),Pt=(e,t,o,r)=>we(C,J(r),e,t,pe,o),Rt=(e,t,o,r)=>we(w,J(r),e,t,pe,o),xt=(e,t,o,r,n)=>we(d+m,J(n),t,o,[e],r),qt=(e,t,o,r,n)=>we(m,J(n),t,o,[e],r),St=(e,t,o)=>we("Start"+ne,J(o),e,t),Ot=(e,t,o)=>we("WillFinish"+ne,J(o),e,t),Lt=(e,t,o)=>we("DidFinish"+ne,J(o),e,t),jt=(e,t,o)=>ye(e,t,o),Bt=()=>z(3),Et=e=>Ce("MetricIds",U(e),1),Tt=(e,t)=>Ce("Metric",U(t),3,[e]),Mt=(e,t,o,r)=>we("Metric",U(r),t,o,[e]),Ft=(e,t,o)=>ye(e,t,o),Vt=()=>z(5),At=(e,t)=>Ce("SliceIds",Y(t),1,[e]),Dt=e=>Ce("IndexIds",Y(e),1),Ht=(e,t,o)=>Ce("Slice"+v,Y(o),1,[e,t]),Qt=(e,t,o,r)=>we("SliceIds",Y(r),t,o,[e]),Wt=(e,t,o,r,n)=>we("Slice"+v,Y(n),o,r,[e,t]),zt=(e,t,o)=>ye(e,t,o),Gt=()=>z(7),Jt=e=>Ce("RelationshipIds",$(e),1),Kt=(e,t,o)=>Ce("RemoteRowId",$(o),3,[e,t]),Nt=(e,t,o)=>Ce("Local"+v,$(o),1,[e,t]),Ut=(e,t,o)=>Ce("Linked"+v,$(o),1,[e,t]),Xt=(e,t,o,r,n)=>we("RemoteRowId",$(n),o,r,[e,t]),Yt=(e,t,o,r,n)=>we("Local"+v,$(n),o,r,[e,t]),Zt=(e,t,o,r,n)=>we("Linked"+v,$(n),o,r,[e,t]),$t=(e,t,o)=>ye(e,t,o),_t=()=>z(9),eo=e=>Ce("QueryIds",ee(e),1),to=(e,t)=>Ce(s+i,ee(t),0,[e]),oo=(e,t)=>Ce(s+i+y,ee(t),1,[e]),ro=(e,t)=>Ce(s+p,ee(t),5,[e]),no=(e,t)=>Ce(s+v,ee(t),1,[e]),lo=(e,t,o,r=0,n,l)=>Ce(s+b,ee(l),1,[e,t,o,r,n]),so=(e,t,o)=>Ce(s+I,ee(o),0,[e,t]),uo=(e,t,o)=>Ce(s+y,ee(o),1,[e,t]),io=(e,t,o,r)=>Ce(s+g,ee(r),3,[e,t,o]),co=(e,t,o,r)=>we(s+i,ee(r),t,o,[e]),ao=(e,t,o,r)=>we(s+i+y,ee(r),t,o,[e]),Io=(e,t,o,r)=>we(s+p,ee(r),t,o,[e]),po=(e,t,o,r)=>we(s+v,ee(r),t,o,[e]),vo=(e,t,o,r,n,l,d,u)=>we(s+b,ee(u),l,d,[e,t,o,r,n]),bo=(e,t,o,r,n)=>we(s+I,ee(n),o,r,[e,t]),go=(e,t,o,r,n)=>we(s+y,ee(n),o,r,[e,t]),yo=(e,t,o,r,n,l)=>we(s+g,ee(l),r,n,[e,t,o]),mo=(e,t,o)=>ye(e,t,o),Co=()=>z(11),wo=e=>Ce("CheckpointIds",oe(e),2),fo=(e,t)=>Ce("Checkpoint",oe(t),3,[e]),ko=(e=x,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},ho=e=>he(e,"goBackward"),Po=e=>he(e,"goForward"),Ro=(e,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>k(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},xo=e=>{var t;const r=oe(e),[n,l]=wo(r);return[(s=n,!(0==R(s))),ho(r),l,null!=(t=k(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},qo=e=>{var t;const r=oe(e),[,,[n]]=wo(r);return[!f(n),Po(r),n,null!=(t=k(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},So=(e,t,o)=>we("CheckpointIds",oe(o),e,t),Oo=(e,t,o,r)=>we("Checkpoint",oe(r),t,o,[e]),Lo=(e,t,o=pe,r,n=pe,l,s=pe)=>{const[,d]=ae(),[u,i]=ae();return de((()=>{const o=e?t(e):void 0;i(o),o&&r&&le(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),de((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},jo=(e,t,o=pe,r,n=pe)=>{const[l,s]=ae();return de((()=>{le(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),de((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:Bo,Fragment:Eo,createElement:To,useCallback:Mo,useLayoutEffect:Fo,useRef:Vo,useState:Ao}=e,Do=(e,...t)=>f(e)?{}:e(...t),Ho=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var Qo=Object.defineProperty,Wo=Object.defineProperties,zo=Object.getOwnPropertyDescriptors,Go=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,No=(e,t,o)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Uo=(e,t)=>{for(var o in t||(t={}))Jo.call(t,o)&&No(e,o,t[o]);if(Go)for(var o of Go(t))Ko.call(t,o)&&No(e,o,t[o]);return e},Xo=(e,t)=>Wo(e,zo(t)),Yo=(e,t)=>{var o={};for(var r in e)Jo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Go)for(var r of Go(e))t.indexOf(r)<0&&Ko.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:Zo,useContext:$o,useMemo:_o,useState:er}=e,tr=({tableId:e,store:t,rowComponent:o=ur,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>sr(O(d,(l=>To(o,Xo(Uo({},Do(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),or=({queryId:e,queries:t,resultRowComponent:o=fr,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>sr(O(s,(n=>To(o,Xo(Uo({},Do(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),rr=({relationshipId:e,relationships:t,rowComponent:o=ur,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,c]=Ho($(t),e),a=s(e,d,u);return sr(O(a,(e=>To(o,Xo(Uo({},Do(r,e)),{key:e,tableId:c,rowId:e,store:i,debugIds:l})))),n,l,d)},nr=e=>({checkpoints:t,checkpointComponent:o=Pr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return sr(O(e(wo(s)),(e=>To(o,Xo(Uo({},Do(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},lr=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:c,checkpointsById:a,children:I})=>{const p=$o(H),[v,b]=er({}),g=Zo(((e,t)=>b((o=>M(o,e)==t?o:Xo(Uo({},o),{[e]:t})))),[]),y=Zo((e=>b((t=>Uo({},((e,t)=>(delete e[t],e))(t,e))))),[]);return To(H.Provider,{value:_o((()=>[null!=e?e:p[0],Uo(Uo(Uo({},p[1]),t),v),null!=o?o:p[2],Uo(Uo({},p[3]),r),null!=n?n:p[4],Uo(Uo({},p[5]),l),null!=s?s:p[6],Uo(Uo({},p[7]),d),null!=u?u:p[8],Uo(Uo({},p[9]),i),null!=c?c:p[10],Uo(Uo({},p[11]),a),g,y]),[e,t,v,o,r,n,l,s,d,u,i,c,a,p,g,y])},I)},sr=(e,t,o,r)=>{const n=f(t)||!Array.isArray(e)?e:O(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},dr=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return sr(o+(null!=(s=Qe(e,t,r,n))?s:o),void 0,l,r)},ur=({tableId:e,rowId:t,store:o,cellComponent:r=dr,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>sr(O(((e,t,o,r)=>{const n=De(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>To(r,Xo(Uo({},Do(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),ir=e=>tr(e,Me(e.tableId,e.store)),cr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=Yo(t,["cellId","descending","offset","limit"]);return tr(s,Fe(s.tableId,o,r,n,l,s.store))},ar=({store:e,tableComponent:t=ir,getTableComponentProps:o,separator:r,debugIds:n})=>sr(O(Oe(e),(r=>To(t,Xo(Uo({},Do(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),Ir=({valueId:e,store:t,debugIds:r})=>{var n;return sr(o+(null!=(n=Ke(e,t))?n:o),void 0,r,e)},pr=({store:e,valueComponent:t=Ir,getValueComponentProps:o,separator:r,debugIds:n})=>sr(O(Ge(e),(r=>To(t,Xo(Uo({},Do(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),vr=({metricId:e,metrics:t,debugIds:r})=>{var n;return sr(null!=(n=Tt(e,t))?n:o,void 0,r,e)},br=({indexId:e,sliceId:t,indexes:o,rowComponent:r=ur,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),c=Ht(e,t,d);return sr(O(c,(e=>To(r,Xo(Uo({},Do(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},gr=({indexId:e,indexes:t,sliceComponent:o=br,getSliceComponentProps:r,separator:n,debugIds:l})=>sr(O(At(e,t),(n=>To(o,Xo(Uo({},Do(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),yr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=ur,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Ho($(o),e),i=Kt(e,t,s);return sr(f(u)||f(i)?null:To(r,Xo(Uo({},Do(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},mr=e=>rr(e,Nt,e.remoteRowId),Cr=e=>rr(e,Ut,e.firstRowId),wr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return sr(o+(null!=(s=io(e,t,r,n))?s:o),void 0,l,r)},fr=({queryId:e,rowId:t,queries:o,resultCellComponent:r=wr,getResultCellComponentProps:n,separator:l,debugIds:s})=>sr(O(uo(e,t,o),(l=>To(r,Xo(Uo({},Do(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),kr=e=>or(e,no(e.queryId,e.queries)),hr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=Yo(t,["cellId","descending","offset","limit"]);return or(s,lo(s.queryId,o,r,n,l,s.queries))},Pr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return sr(null!=(n=fo(t,e))?n:o,void 0,r,t)},Rr=nr((e=>e[0])),xr=nr((e=>f(e[1])?[]:[e[1]])),qr=nr((e=>e[2]));export{Rr as BackwardCheckpointsView,dr as CellView,Pr as CheckpointView,xr as CurrentCheckpointView,qr as ForwardCheckpointsView,gr as IndexView,Cr as LinkedRowsView,mr as LocalRowsView,vr as MetricView,lr as Provider,yr as RemoteRowView,wr as ResultCellView,fr as ResultRowView,hr as ResultSortedTableView,kr as ResultTableView,ur as RowView,br as SliceView,cr as SortedTableView,ir as TableView,ar as TablesView,Ir as ValueView,pr as ValuesView,Ye as useAddRowCallback,Qe as useCell,De as useCellIds,wt as useCellIdsListener,kt as useCellListener,fo as useCheckpoint,wo as useCheckpointIds,So as useCheckpointIdsListener,Oo as useCheckpointListener,te as useCheckpoints,Co as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,mo as useCreateCheckpoints,Ft as useCreateIndexes,Re as useCreateMergeableStore,jt as useCreateMetrics,Lo as useCreatePersister,$t as useCreateQueries,zt as useCreateRelationships,Pe as useCreateStore,jo as useCreateSynchronizer,lt as useDelCellCallback,nt as useDelRowCallback,rt as useDelTableCallback,ot as useDelTablesCallback,dt as useDelValueCallback,st as useDelValuesCallback,Lt as useDidFinishTransactionListener,ho as useGoBackwardCallback,Po as useGoForwardCallback,Ro as useGoToCallback,He as useHasCell,ft as useHasCellListener,Ve as useHasRow,mt as useHasRowListener,Le as useHasTable,Ee as useHasTableCell,vt as useHasTableCellListener,at as useHasTableListener,qe as useHasTables,ut as useHasTablesListener,Je as useHasValue,xt as useHasValueListener,We as useHasValues,ht as useHasValuesListener,Dt as useIndexIds,X as useIndexes,Vt as useIndexesIds,Y as useIndexesOrIndexesById,Ut as useLinkedRowIds,Zt as useLinkedRowIdsListener,Nt as useLocalRowIds,Yt as useLocalRowIdsListener,Tt as useMetric,Et as useMetricIds,Mt as useMetricListener,N as useMetrics,Bt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,_t as useQueriesIds,ee as useQueriesOrQueriesById,eo as useQueryIds,qo as useRedoInformation,Jt as useRelationshipIds,Z as useRelationships,Gt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Kt as useRemoteRowId,Xt as useRemoteRowIdListener,io as useResultCell,uo as useResultCellIds,go as useResultCellIdsListener,yo as useResultCellListener,so as useResultRow,ro as useResultRowCount,Io as useResultRowCountListener,no as useResultRowIds,po as useResultRowIdsListener,bo as useResultRowListener,lo as useResultSortedRowIds,vo as useResultSortedRowIdsListener,to as useResultTable,oo as useResultTableCellIds,ao as useResultTableCellIdsListener,co as useResultTableListener,Ae as useRow,Te as useRowCount,bt as useRowCountListener,Me as useRowIds,gt as useRowIdsListener,Ct as useRowListener,$e as useSetCellCallback,ko as useSetCheckpointCallback,Ze as useSetPartialRowCallback,et as useSetPartialValuesCallback,Xe as useSetRowCallback,Ue as useSetTableCallback,Ne as useSetTablesCallback,tt as useSetValueCallback,_e as useSetValuesCallback,At as useSliceIds,Qt as useSliceIdsListener,Ht as useSliceRowIds,Wt as useSliceRowIdsListener,Fe as useSortedRowIds,yt as useSortedRowIdsListener,St as useStartTransactionListener,G as useStore,xe as useStoreIds,J as useStoreOrStoreById,je as useTable,Be as useTableCellIds,pt as useTableCellIdsListener,Oe as useTableIds,ct as useTableIdsListener,It as useTableListener,Se as useTables,it as useTablesListener,xo as useUndoInformation,Ke as useValue,Ge as useValueIds,Rt as useValueIdsListener,qt as useValueListener,ze as useValues,Pt as useValuesListener,Ot as useWillFinishTransactionListener};
|
|
1
|
+
import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",a=i+"s",c=i+u,I="Row",p=I+"Count",v=I+u,b="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",f=m+u,w=e=>null==e,k=(e,t,o)=>w(e)?null==o?void 0:o():t(e),h=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,x=()=>{},q=(e,t)=>e.every(t),S=(e,t)=>R(e)===R(t)&&q(e,((e,o)=>t[o]===e)),O=(e,t)=>e.map(t),L=Object,j=e=>L.getPrototypeOf(e),B=L.entries,E=e=>!w(e)&&k(j(e),(e=>e==L.prototype||w(j(e))),(()=>!0)),T=L.keys,M=(e,t)=>k(e,(e=>e[t])),F=(e,t)=>{const o=B(e);return R(o)===R(T(t))&&q(o,(([e,o])=>E(o)?!!E(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return w(e)?r[t]:h(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return w(e)||h(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:se,useEffect:de,useMemo:ue,useLayoutEffect:ie,useRef:ae,useState:ce,useSyncExternalStore:Ie}=e,pe=[],ve=[{},[],[pe,void 0,pe],void 0,!1,0],be=[F,S,([e,t,o],[r,n,l])=>t===n&&S(e,r)&&S(o,l)],ge=(e,t)=>e===t,ye=(e,t,o=pe)=>{const[,r]=ce(),[n,l]=ce();return de((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},me=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Ce=(e,t,r,n=pe)=>{const l=ae(ve[r]),s=se((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:ve[r];return(null!=(d=be[r])?d:ge)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=se((l=>me(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]);return Ie(u,s)},fe=(e,t,o,r=pe,n=pe,...l)=>ie((()=>me(t,e,...n,o,...l)),[t,e,...n,...r,...l]),we=(e,t,o,r=pe,n=x,l=pe,...s)=>{const d=J(e);return se((e=>k(d,(r=>k(o(e,r),(o=>n(r["set"+t](...ke(s,r,e),o),o)))))),[d,t,...r,...l,...he(s)])},ke=(e,t,o)=>O(e,(e=>P(e)?e(o,t):e)),he=e=>{return t=e=>!P(e),e.filter(t);var t},Pe=(e,t,o=x,r=pe,...n)=>{const l=J(e);return se((e=>o(null==l?void 0:l["del"+t](...ke(n,l,e)))),[l,t,...r,...he(n)])},Re=(e,t,o)=>{const r=oe(e);return se((()=>null==r?void 0:r[t](o)),[r,t,o])},xe=(e,t=pe)=>ue(e,t),qe=(e,t=pe)=>ue(e,t),Se=()=>z(1),Oe=e=>Ce(a,J(e),4,[]),Le=e=>Ce(a,J(e),0),je=e=>Ce(c,J(e),1),Be=(e,t)=>Ce(i,J(t),4,[e]),Ee=(e,t)=>Ce(i,J(t),0,[e]),Te=(e,t)=>Ce(i+y,J(t),1,[e]),Me=(e,t,o)=>Ce(i+g,J(o),4,[e,t]),Fe=(e,t)=>Ce(p,J(t),5,[e]),Ve=(e,t)=>Ce(v,J(t),1,[e]),Ae=(e,t,o,r=0,n,l)=>Ce(b,J(l),1,[e,t,o,r,n]),De=(e,t,o)=>Ce(I,J(o),4,[e,t]),He=(e,t,o)=>Ce(I,J(o),0,[e,t]),Qe=(e,t,o)=>Ce(y,J(o),1,[e,t]),We=(e,t,o,r)=>Ce(g,J(r),4,[e,t,o]),ze=(e,t,o,r)=>Ce(g,J(r),3,[e,t,o]),Ge=e=>Ce(C,J(e),4,[]),Je=e=>Ce(C,J(e),0),Ke=e=>Ce(f,J(e),1),Ne=(e,t)=>Ce(m,J(t),4,[e]),Ue=(e,t)=>Ce(m,J(t),3,[e]),Xe=(e,t,o,r,n)=>we(o,a,e,t,r,n),Ye=(e,t,o,r,n,l)=>we(r,i,t,o,n,l,e),Ze=(e,t,o,r,n,l,s)=>we(n,I,o,r,l,s,e,t),$e=(e,t,o=pe,r,n=x,l=pe,s=!0)=>{const d=J(r);return se((o=>k(d,(r=>k(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},_e=(e,t,o,r,n,l,s)=>we(n,"PartialRow",o,r,l,s,e,t),et=(e,t,o,r,n,l,s,d)=>we(l,g,r,n,s,d,e,t,o),tt=(e,t,o,r,n)=>we(o,C,e,t,r,n),ot=(e,t,o,r,n)=>we(o,"PartialValues",e,t,r,n),rt=(e,t,o,r,n,l)=>we(r,m,t,o,n,l,e),nt=(e,t,o)=>Pe(e,a,t,o),lt=(e,t,o,r)=>Pe(t,i,o,r,e),st=(e,t,o,r,n)=>Pe(o,I,r,n,e,t),dt=(e,t,o,r,n,l,s)=>Pe(n,g,l,s,e,t,o,r),ut=(e,t,o)=>Pe(e,C,t,o),it=(e,t,o,r)=>Pe(t,m,o,r,e),at=(e,t,o,r)=>fe(d+a,J(r),e,t,[],o),ct=(e,t,o,r)=>fe(a,J(r),e,t,pe,o),It=(e,t,o,r)=>fe(c,J(r),e,t,pe,o),pt=(e,t,o,r,n)=>fe(d+i,J(n),t,o,[e],r),vt=(e,t,o,r,n)=>fe(i,J(n),t,o,[e],r),bt=(e,t,o,r,n)=>fe(i+y,J(n),t,o,[e],r),gt=(e,t,o,r,n,l)=>fe(d+i+g,J(l),o,r,[e,t],n),yt=(e,t,o,r,n)=>fe(p,J(n),t,o,[e],r),mt=(e,t,o,r,n)=>fe(v,J(n),t,o,[e],r),Ct=(e,t,o,r,n,l,s,d,u)=>fe(b,J(u),l,s,[e,t,o,r,n],d),ft=(e,t,o,r,n,l)=>fe(d+I,J(l),o,r,[e,t],n),wt=(e,t,o,r,n,l)=>fe(I,J(l),o,r,[e,t],n),kt=(e,t,o,r,n,l)=>fe(y,J(l),o,r,[e,t],n),ht=(e,t,o,r,n,l,s)=>fe(d+g,J(s),r,n,[e,t,o],l),Pt=(e,t,o,r,n,l,s)=>fe(g,J(s),r,n,[e,t,o],l),Rt=(e,t,o,r)=>fe(d+C,J(r),e,t,[],o),xt=(e,t,o,r)=>fe(C,J(r),e,t,pe,o),qt=(e,t,o,r)=>fe(f,J(r),e,t,pe,o),St=(e,t,o,r,n)=>fe(d+m,J(n),t,o,[e],r),Ot=(e,t,o,r,n)=>fe(m,J(n),t,o,[e],r),Lt=(e,t,o)=>fe("Start"+ne,J(o),e,t),jt=(e,t,o)=>fe("WillFinish"+ne,J(o),e,t),Bt=(e,t,o)=>fe("DidFinish"+ne,J(o),e,t),Et=(e,t,o)=>ye(e,t,o),Tt=()=>z(3),Mt=e=>Ce("MetricIds",U(e),1),Ft=(e,t)=>Ce("Metric",U(t),3,[e]),Vt=(e,t,o,r)=>fe("Metric",U(r),t,o,[e]),At=(e,t,o)=>ye(e,t,o),Dt=()=>z(5),Ht=(e,t)=>Ce("SliceIds",Y(t),1,[e]),Qt=e=>Ce("IndexIds",Y(e),1),Wt=(e,t,o)=>Ce("Slice"+v,Y(o),1,[e,t]),zt=(e,t,o,r)=>fe("SliceIds",Y(r),t,o,[e]),Gt=(e,t,o,r,n)=>fe("Slice"+v,Y(n),o,r,[e,t]),Jt=(e,t,o)=>ye(e,t,o),Kt=()=>z(7),Nt=e=>Ce("RelationshipIds",$(e),1),Ut=(e,t,o)=>Ce("RemoteRowId",$(o),3,[e,t]),Xt=(e,t,o)=>Ce("Local"+v,$(o),1,[e,t]),Yt=(e,t,o)=>Ce("Linked"+v,$(o),1,[e,t]),Zt=(e,t,o,r,n)=>fe("RemoteRowId",$(n),o,r,[e,t]),$t=(e,t,o,r,n)=>fe("Local"+v,$(n),o,r,[e,t]),_t=(e,t,o,r,n)=>fe("Linked"+v,$(n),o,r,[e,t]),eo=(e,t,o)=>ye(e,t,o),to=()=>z(9),oo=e=>Ce("QueryIds",ee(e),1),ro=(e,t)=>Ce(s+i,ee(t),0,[e]),no=(e,t)=>Ce(s+i+y,ee(t),1,[e]),lo=(e,t)=>Ce(s+p,ee(t),5,[e]),so=(e,t)=>Ce(s+v,ee(t),1,[e]),uo=(e,t,o,r=0,n,l)=>Ce(s+b,ee(l),1,[e,t,o,r,n]),io=(e,t,o)=>Ce(s+I,ee(o),0,[e,t]),ao=(e,t,o)=>Ce(s+y,ee(o),1,[e,t]),co=(e,t,o,r)=>Ce(s+g,ee(r),3,[e,t,o]),Io=(e,t,o,r)=>fe(s+i,ee(r),t,o,[e]),po=(e,t,o,r)=>fe(s+i+y,ee(r),t,o,[e]),vo=(e,t,o,r)=>fe(s+p,ee(r),t,o,[e]),bo=(e,t,o,r)=>fe(s+v,ee(r),t,o,[e]),go=(e,t,o,r,n,l,d,u)=>fe(s+b,ee(u),l,d,[e,t,o,r,n]),yo=(e,t,o,r,n)=>fe(s+I,ee(n),o,r,[e,t]),mo=(e,t,o,r,n)=>fe(s+y,ee(n),o,r,[e,t]),Co=(e,t,o,r,n,l)=>fe(s+g,ee(l),r,n,[e,t,o]),fo=(e,t,o)=>ye(e,t,o),wo=()=>z(11),ko=e=>Ce("CheckpointIds",oe(e),2),ho=(e,t)=>Ce("Checkpoint",oe(t),3,[e]),Po=(e=x,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},Ro=e=>Re(e,"goBackward"),xo=e=>Re(e,"goForward"),qo=(e,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>k(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},So=e=>{var t;const r=oe(e),[n,l]=ko(r);return[(s=n,!(0==R(s))),Ro(r),l,null!=(t=k(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},Oo=e=>{var t;const r=oe(e),[,,[n]]=ko(r);return[!w(n),xo(r),n,null!=(t=k(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},Lo=(e,t,o)=>fe("CheckpointIds",oe(o),e,t),jo=(e,t,o,r)=>fe("Checkpoint",oe(r),t,o,[e]),Bo=(e,t,o=pe,r,n=pe,l,s=pe)=>{const[,d]=ce(),[u,i]=ce();return de((()=>{const o=e?t(e):void 0;i(o),o&&r&&le(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),de((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},Eo=(e,t,o=pe,r,n=pe)=>{const[l,s]=ce();return de((()=>{le(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),de((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:To,Fragment:Mo,createElement:Fo,useCallback:Vo,useLayoutEffect:Ao,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>w(e)?{}:e(...t),Wo=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var zo=Object.defineProperty,Go=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,No=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Xo=(e,t,o)=>t in e?zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Yo=(e,t)=>{for(var o in t||(t={}))No.call(t,o)&&Xo(e,o,t[o]);if(Ko)for(var o of Ko(t))Uo.call(t,o)&&Xo(e,o,t[o]);return e},Zo=(e,t)=>Go(e,Jo(t)),$o=(e,t)=>{var o={};for(var r in e)No.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Ko)for(var r of Ko(e))t.indexOf(r)<0&&Uo.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:_o,useContext:er,useMemo:tr,useState:or}=e,rr=({tableId:e,store:t,rowComponent:o=ar,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>ur(O(d,(l=>Fo(o,Zo(Yo({},Qo(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),nr=({queryId:e,queries:t,resultRowComponent:o=hr,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>ur(O(s,(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),lr=({relationshipId:e,relationships:t,rowComponent:o=ar,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,a]=Wo($(t),e),c=s(e,d,u);return ur(O(c,(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),n,l,d)},sr=e=>({checkpoints:t,checkpointComponent:o=xr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return ur(O(e(ko(s)),(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},dr=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:a,checkpointsById:c,children:I})=>{const p=er(H),[v,b]=or({}),g=_o(((e,t)=>b((o=>M(o,e)==t?o:Zo(Yo({},o),{[e]:t})))),[]),y=_o((e=>b((t=>Yo({},((e,t)=>(delete e[t],e))(t,e))))),[]);return Fo(H.Provider,{value:tr((()=>[null!=e?e:p[0],Yo(Yo(Yo({},p[1]),t),v),null!=o?o:p[2],Yo(Yo({},p[3]),r),null!=n?n:p[4],Yo(Yo({},p[5]),l),null!=s?s:p[6],Yo(Yo({},p[7]),d),null!=u?u:p[8],Yo(Yo({},p[9]),i),null!=a?a:p[10],Yo(Yo({},p[11]),c),g,y]),[e,t,v,o,r,n,l,s,d,u,i,a,c,p,g,y])},I)},ur=(e,t,o,r)=>{const n=w(t)||!Array.isArray(e)?e:O(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},ir=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return ur(o+(null!=(s=ze(e,t,r,n))?s:o),void 0,l,r)},ar=({tableId:e,rowId:t,store:o,cellComponent:r=ir,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>ur(O(((e,t,o,r)=>{const n=Qe(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),cr=e=>rr(e,Ve(e.tableId,e.store)),Ir=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return rr(s,Ae(s.tableId,o,r,n,l,s.store))},pr=({store:e,tableComponent:t=cr,getTableComponentProps:o,separator:r,debugIds:n})=>ur(O(je(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),vr=({valueId:e,store:t,debugIds:r})=>{var n;return ur(o+(null!=(n=Ue(e,t))?n:o),void 0,r,e)},br=({store:e,valueComponent:t=vr,getValueComponentProps:o,separator:r,debugIds:n})=>ur(O(Ke(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),gr=({metricId:e,metrics:t,debugIds:r})=>{var n;return ur(null!=(n=Ft(e,t))?n:o,void 0,r,e)},yr=({indexId:e,sliceId:t,indexes:o,rowComponent:r=ar,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),a=Wt(e,t,d);return ur(O(a,(e=>Fo(r,Zo(Yo({},Qo(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},mr=({indexId:e,indexes:t,sliceComponent:o=yr,getSliceComponentProps:r,separator:n,debugIds:l})=>ur(O(Ht(e,t),(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),Cr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=ar,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Wo($(o),e),i=Ut(e,t,s);return ur(w(u)||w(i)?null:Fo(r,Zo(Yo({},Qo(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},fr=e=>lr(e,Xt,e.remoteRowId),wr=e=>lr(e,Yt,e.firstRowId),kr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return ur(o+(null!=(s=co(e,t,r,n))?s:o),void 0,l,r)},hr=({queryId:e,rowId:t,queries:o,resultCellComponent:r=kr,getResultCellComponentProps:n,separator:l,debugIds:s})=>ur(O(ao(e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),Pr=e=>nr(e,so(e.queryId,e.queries)),Rr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return nr(s,uo(s.queryId,o,r,n,l,s.queries))},xr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return ur(null!=(n=ho(t,e))?n:o,void 0,r,t)},qr=sr((e=>e[0])),Sr=sr((e=>w(e[1])?[]:[e[1]])),Or=sr((e=>e[2]));export{qr as BackwardCheckpointsView,ir as CellView,xr as CheckpointView,Sr as CurrentCheckpointView,Or as ForwardCheckpointsView,mr as IndexView,wr as LinkedRowsView,fr as LocalRowsView,gr as MetricView,dr as Provider,Cr as RemoteRowView,kr as ResultCellView,hr as ResultRowView,Rr as ResultSortedTableView,Pr as ResultTableView,ar as RowView,yr as SliceView,Ir as SortedTableView,cr as TableView,pr as TablesView,vr as ValueView,br as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,kt as useCellIdsListener,Pt as useCellListener,ho as useCheckpoint,ko as useCheckpointIds,Lo as useCheckpointIdsListener,jo as useCheckpointListener,te as useCheckpoints,wo as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,fo as useCreateCheckpoints,At as useCreateIndexes,qe as useCreateMergeableStore,Et as useCreateMetrics,Bo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,xe as useCreateStore,Eo as useCreateSynchronizer,dt as useDelCellCallback,st as useDelRowCallback,lt as useDelTableCallback,nt as useDelTablesCallback,it as useDelValueCallback,ut as useDelValuesCallback,Bt as useDidFinishTransactionListener,Ro as useGoBackwardCallback,xo as useGoForwardCallback,qo as useGoToCallback,We as useHasCell,ht as useHasCellListener,De as useHasRow,ft as useHasRowListener,Be as useHasTable,Me as useHasTableCell,gt as useHasTableCellListener,pt as useHasTableListener,Oe as useHasTables,at as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,Rt as useHasValuesListener,Qt as useIndexIds,X as useIndexes,Dt as useIndexesIds,Y as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,Ft as useMetric,Mt as useMetricIds,Vt as useMetricListener,N as useMetrics,Tt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,to as useQueriesIds,ee as useQueriesOrQueriesById,oo as useQueryIds,Oo as useRedoInformation,Nt as useRelationshipIds,Z as useRelationships,Kt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,co as useResultCell,ao as useResultCellIds,mo as useResultCellIdsListener,Co as useResultCellListener,io as useResultRow,lo as useResultRowCount,vo as useResultRowCountListener,so as useResultRowIds,bo as useResultRowIdsListener,yo as useResultRowListener,uo as useResultSortedRowIds,go as useResultSortedRowIdsListener,ro as useResultTable,no as useResultTableCellIds,po as useResultTableCellIdsListener,Io as useResultTableListener,He as useRow,Fe as useRowCount,yt as useRowCountListener,Ve as useRowIds,mt as useRowIdsListener,wt as useRowListener,et as useSetCellCallback,Po as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,rt as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,Ae as useSortedRowIds,Ct as useSortedRowIdsListener,Lt as useStartTransactionListener,G as useStore,Se as useStoreIds,J as useStoreOrStoreById,Ee as useTable,Te as useTableCellIds,bt as useTableCellIdsListener,je as useTableIds,It as useTableIdsListener,vt as useTableListener,Le as useTables,ct as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,qt as useValueIdsListener,Ot as useValueListener,Je as useValues,xt as useValuesListener,jt as useWillFinishTransactionListener};
|
|
Binary file
|
|
@@ -219,9 +219,9 @@ const createWsServer = (webSocketServer) => {
|
|
|
219
219
|
const clients = mapEnsure(clientsByPath, pathId, mapNew);
|
|
220
220
|
mapSet(clients, clientId, webSocket);
|
|
221
221
|
if (clients.size == 1) {
|
|
222
|
-
callListeners(pathIdListeners, void 0,
|
|
222
|
+
callListeners(pathIdListeners, void 0, pathId, 1);
|
|
223
223
|
}
|
|
224
|
-
callListeners(clientIdListeners, [pathId],
|
|
224
|
+
callListeners(clientIdListeners, [pathId], clientId, 1);
|
|
225
225
|
webSocket.on('message', (data) => {
|
|
226
226
|
var _a2;
|
|
227
227
|
const payload = data.toString(UTF8);
|
|
@@ -244,12 +244,10 @@ const createWsServer = (webSocketServer) => {
|
|
|
244
244
|
});
|
|
245
245
|
webSocket.on('close', () => {
|
|
246
246
|
collDel(clients, clientId);
|
|
247
|
-
callListeners(clientIdListeners, [pathId],
|
|
248
|
-
[clientId]: -1,
|
|
249
|
-
}));
|
|
247
|
+
callListeners(clientIdListeners, [pathId], clientId, -1);
|
|
250
248
|
if (collIsEmpty(clients)) {
|
|
251
249
|
collDel(clientsByPath, pathId);
|
|
252
|
-
callListeners(pathIdListeners, void 0,
|
|
250
|
+
callListeners(pathIdListeners, void 0, pathId, -1);
|
|
253
251
|
}
|
|
254
252
|
});
|
|
255
253
|
}),
|
|
@@ -219,9 +219,9 @@ const createWsServer = (webSocketServer) => {
|
|
|
219
219
|
const clients = mapEnsure(clientsByPath, pathId, mapNew);
|
|
220
220
|
mapSet(clients, clientId, webSocket);
|
|
221
221
|
if (clients.size == 1) {
|
|
222
|
-
callListeners(pathIdListeners, void 0,
|
|
222
|
+
callListeners(pathIdListeners, void 0, pathId, 1);
|
|
223
223
|
}
|
|
224
|
-
callListeners(clientIdListeners, [pathId],
|
|
224
|
+
callListeners(clientIdListeners, [pathId], clientId, 1);
|
|
225
225
|
webSocket.on('message', (data) => {
|
|
226
226
|
var _a2;
|
|
227
227
|
const payload = data.toString(UTF8);
|
|
@@ -244,12 +244,10 @@ const createWsServer = (webSocketServer) => {
|
|
|
244
244
|
});
|
|
245
245
|
webSocket.on('close', () => {
|
|
246
246
|
collDel(clients, clientId);
|
|
247
|
-
callListeners(clientIdListeners, [pathId],
|
|
248
|
-
[clientId]: -1,
|
|
249
|
-
}));
|
|
247
|
+
callListeners(clientIdListeners, [pathId], clientId, -1);
|
|
250
248
|
if (collIsEmpty(clients)) {
|
|
251
249
|
collDel(clientsByPath, pathId);
|
|
252
|
-
callListeners(pathIdListeners, void 0,
|
|
250
|
+
callListeners(pathIdListeners, void 0, pathId, -1);
|
|
253
251
|
}
|
|
254
252
|
});
|
|
255
253
|
}),
|
package/es6/ui-react/index.js
CHANGED
|
@@ -39,6 +39,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
39
39
|
arrayEvery(array1, (value1, index) => array2[index] === value1);
|
|
40
40
|
const arrayMap = (array, cb) => array.map(cb);
|
|
41
41
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
42
|
+
const arrayFilter = (array, cb) => array.filter(cb);
|
|
42
43
|
|
|
43
44
|
const object = Object;
|
|
44
45
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -266,9 +267,7 @@ const useSetCallback = (
|
|
|
266
267
|
ifNotUndefined(get(parameter, store2), (thing) =>
|
|
267
268
|
then(
|
|
268
269
|
store2['set' + settable](
|
|
269
|
-
...
|
|
270
|
-
isFunction(arg) ? arg(parameter, store2) : arg,
|
|
271
|
-
),
|
|
270
|
+
...argsOrGetArgs(args, store2, parameter),
|
|
272
271
|
thing,
|
|
273
272
|
),
|
|
274
273
|
thing,
|
|
@@ -276,9 +275,12 @@ const useSetCallback = (
|
|
|
276
275
|
),
|
|
277
276
|
),
|
|
278
277
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
279
|
-
[store, settable, ...getDeps, ...thenDeps, ...args],
|
|
278
|
+
[store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
|
|
280
279
|
);
|
|
281
280
|
};
|
|
281
|
+
const argsOrGetArgs = (args, store, parameter) =>
|
|
282
|
+
arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
|
|
283
|
+
const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
|
|
282
284
|
const useDel = (
|
|
283
285
|
storeOrStoreId,
|
|
284
286
|
deletable,
|
|
@@ -288,9 +290,14 @@ const useDel = (
|
|
|
288
290
|
) => {
|
|
289
291
|
const store = useStoreOrStoreById(storeOrStoreId);
|
|
290
292
|
return useCallback$2(
|
|
291
|
-
() =>
|
|
293
|
+
(parameter) =>
|
|
294
|
+
then(
|
|
295
|
+
store == null
|
|
296
|
+
? void 0
|
|
297
|
+
: store['del' + deletable](...argsOrGetArgs(args, store, parameter)),
|
|
298
|
+
),
|
|
292
299
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
293
|
-
[store, deletable, ...thenDeps, ...args],
|
|
300
|
+
[store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
|
|
294
301
|
);
|
|
295
302
|
};
|
|
296
303
|
const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
@@ -39,6 +39,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
39
39
|
arrayEvery(array1, (value1, index) => array2[index] === value1);
|
|
40
40
|
const arrayMap = (array, cb) => array.map(cb);
|
|
41
41
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
42
|
+
const arrayFilter = (array, cb) => array.filter(cb);
|
|
42
43
|
|
|
43
44
|
const object = Object;
|
|
44
45
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -266,9 +267,7 @@ const useSetCallback = (
|
|
|
266
267
|
ifNotUndefined(get(parameter, store2), (thing) =>
|
|
267
268
|
then(
|
|
268
269
|
store2['set' + settable](
|
|
269
|
-
...
|
|
270
|
-
isFunction(arg) ? arg(parameter, store2) : arg,
|
|
271
|
-
),
|
|
270
|
+
...argsOrGetArgs(args, store2, parameter),
|
|
272
271
|
thing,
|
|
273
272
|
),
|
|
274
273
|
thing,
|
|
@@ -276,9 +275,12 @@ const useSetCallback = (
|
|
|
276
275
|
),
|
|
277
276
|
),
|
|
278
277
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
279
|
-
[store, settable, ...getDeps, ...thenDeps, ...args],
|
|
278
|
+
[store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
|
|
280
279
|
);
|
|
281
280
|
};
|
|
281
|
+
const argsOrGetArgs = (args, store, parameter) =>
|
|
282
|
+
arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
|
|
283
|
+
const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
|
|
282
284
|
const useDel = (
|
|
283
285
|
storeOrStoreId,
|
|
284
286
|
deletable,
|
|
@@ -288,9 +290,14 @@ const useDel = (
|
|
|
288
290
|
) => {
|
|
289
291
|
const store = useStoreOrStoreById(storeOrStoreId);
|
|
290
292
|
return useCallback$2(
|
|
291
|
-
() =>
|
|
293
|
+
(parameter) =>
|
|
294
|
+
then(
|
|
295
|
+
store == null
|
|
296
|
+
? void 0
|
|
297
|
+
: store['del' + deletable](...argsOrGetArgs(args, store, parameter)),
|
|
298
|
+
),
|
|
292
299
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
293
|
-
[store, deletable, ...thenDeps, ...args],
|
|
300
|
+
[store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
|
|
294
301
|
);
|
|
295
302
|
};
|
|
296
303
|
const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),o=(e,...t)=>e.push(...t),c=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],y=(e,t)=>e?.get(t),S=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,o;return r=e,o=t,r?.has(o)?s?.(y(e,t)):S(e,t,n()),y(e,t)},p=(e,n,r,o,c=0)=>t((r?k:y)(e,n[c],c>s(n)-2?r:f),(t=>{if(c>s(n)-2)return o?.(t)&&S(e,n[c]),t;const a=p(t,n,r,o,c+1);return i(t)&&S(e,n[c]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/,z=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let c;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&o(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{c??=C;const o=a(1);var d,i;return S(l,o,[e,t,n,s,r]),d=p(t,n??[""],I),i=o,d?.add(i),o},(e,t,...n)=>r(((e,t=[""])=>{const n=[],c=(e,a)=>a==s(t)?o(n,e):null===t[a]?h(e,(e=>c(e,a+1))):r([t[a],null],(t=>c(y(e,t),a+1)));return c(e,0),n})(e,t),(e=>h(e,(e=>y(l,e)[0](c,...t??[],...n))))),e=>t(y(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),S(l,e),d(e),n))),n=>t(y(l,n),(([t,,n=[],o,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(c,...l,...a(l)):e(n[i])?r(o[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);S(s,t,e),1==s.size&&x(u,void 0,
|
|
1
|
+
const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),o=(e,...t)=>e.push(...t),c=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],y=(e,t)=>e?.get(t),S=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,o;return r=e,o=t,r?.has(o)?s?.(y(e,t)):S(e,t,n()),y(e,t)},p=(e,n,r,o,c=0)=>t((r?k:y)(e,n[c],c>s(n)-2?r:f),(t=>{if(c>s(n)-2)return o?.(t)&&S(e,n[c]),t;const a=p(t,n,r,o,c+1);return i(t)&&S(e,n[c]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/,z=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let c;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&o(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{c??=C;const o=a(1);var d,i;return S(l,o,[e,t,n,s,r]),d=p(t,n??[""],I),i=o,d?.add(i),o},(e,t,...n)=>r(((e,t=[""])=>{const n=[],c=(e,a)=>a==s(t)?o(n,e):null===t[a]?h(e,(e=>c(e,a+1))):r([t[a],null],(t=>c(y(e,t),a+1)));return c(e,0),n})(e,t),(e=>h(e,(e=>y(l,e)[0](c,...t??[],...n))))),e=>t(y(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),S(l,e),d(e),n))),n=>t(y(l,n),(([t,,n=[],o,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(c,...l,...a(l)):e(n[i])?r(o[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);S(s,t,e),1==s.size&&x(u,void 0,r,1),x(z,[r],t,1),e.on("message",(e=>{const r=e.toString("utf8"),o=r.indexOf("\n");if(-1!==o){const e=n(r,0,o),a=n(r,o+1);""===e?(c=(e,n)=>e!=t?n.send(t+"\n"+a):0,h(s,((e,t)=>c(t,e)))):y(s,e)?.send(t+"\n"+a)}var c})),e.on("close",(()=>{v(s,t),x(z,[r],t,-1),i(s)&&(v(L,r),x(u,void 0,r,-1))}))}))))));const C={getWebSocketServer:()=>l,getPathIds:()=>g(L),getClientIds:e=>g(y(L,e)),addPathIdsListener:e=>m(e,u),addClientIdsListener:(e,t)=>m(t,z,[e]),delListener:e=>(A(e),C),getStats:()=>({paths:a(L),clients:d(L)}),destroy:()=>{l.close(),L.clear()}};return c(C)};export{z as createWsServer};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),o=(e,...t)=>e.push(...t),c=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],y=(e,t)=>e?.get(t),S=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,o;return r=e,o=t,r?.has(o)?s?.(y(e,t)):S(e,t,n()),y(e,t)},p=(e,n,r,o,c=0)=>t((r?k:y)(e,n[c],c>s(n)-2?r:f),(t=>{if(c>s(n)-2)return o?.(t)&&S(e,n[c]),t;const a=p(t,n,r,o,c+1);return i(t)&&S(e,n[c]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/,z=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let c;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&o(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{c??=C;const o=a(1);var d,i;return S(l,o,[e,t,n,s,r]),d=p(t,n??[""],I),i=o,d?.add(i),o},(e,t,...n)=>r(((e,t=[""])=>{const n=[],c=(e,a)=>a==s(t)?o(n,e):null===t[a]?h(e,(e=>c(e,a+1))):r([t[a],null],(t=>c(y(e,t),a+1)));return c(e,0),n})(e,t),(e=>h(e,(e=>y(l,e)[0](c,...t??[],...n))))),e=>t(y(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),S(l,e),d(e),n))),n=>t(y(l,n),(([t,,n=[],o,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(c,...l,...a(l)):e(n[i])?r(o[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);S(s,t,e),1==s.size&&x(u,void 0,
|
|
1
|
+
const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),o=(e,...t)=>e.push(...t),c=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],y=(e,t)=>e?.get(t),S=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,o;return r=e,o=t,r?.has(o)?s?.(y(e,t)):S(e,t,n()),y(e,t)},p=(e,n,r,o,c=0)=>t((r?k:y)(e,n[c],c>s(n)-2?r:f),(t=>{if(c>s(n)-2)return o?.(t)&&S(e,n[c]),t;const a=p(t,n,r,o,c+1);return i(t)&&S(e,n[c]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/,z=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let c;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&o(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{c??=C;const o=a(1);var d,i;return S(l,o,[e,t,n,s,r]),d=p(t,n??[""],I),i=o,d?.add(i),o},(e,t,...n)=>r(((e,t=[""])=>{const n=[],c=(e,a)=>a==s(t)?o(n,e):null===t[a]?h(e,(e=>c(e,a+1))):r([t[a],null],(t=>c(y(e,t),a+1)));return c(e,0),n})(e,t),(e=>h(e,(e=>y(l,e)[0](c,...t??[],...n))))),e=>t(y(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),S(l,e),d(e),n))),n=>t(y(l,n),(([t,,n=[],o,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(c,...l,...a(l)):e(n[i])?r(o[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);S(s,t,e),1==s.size&&x(u,void 0,r,1),x(z,[r],t,1),e.on("message",(e=>{const r=e.toString("utf8"),o=r.indexOf("\n");if(-1!==o){const e=n(r,0,o),a=n(r,o+1);""===e?(c=(e,n)=>e!=t?n.send(t+"\n"+a):0,h(s,((e,t)=>c(t,e)))):y(s,e)?.send(t+"\n"+a)}var c})),e.on("close",(()=>{v(s,t),x(z,[r],t,-1),i(s)&&(v(L,r),x(u,void 0,r,-1))}))}))))));const C={getWebSocketServer:()=>l,getPathIds:()=>g(L),getClientIds:e=>g(y(L,e)),addPathIdsListener:e=>m(e,u),addClientIdsListener:(e,t)=>m(t,z,[e]),delListener:e=>(A(e),C),getStats:()=>({paths:a(L),clients:d(L)}),destroy:()=>{l.close(),L.clear()}};return c(C)};export{z as createWsServer};
|
|
Binary file
|
package/min/ui-react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",I="Table",i=I+"s",l=I+c,a="Row",p=a+"Count",g=a+c,b="Sorted"+a+c,C="Cell",m=C+c,y="Value",k=y+"s",w=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:Ie,useRef:ie,useState:le,useSyncExternalStore:ae}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=le(),[r,d]=le();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ke=(e,t,s,r=pe)=>{const d=ie(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return ae(c,n)},we=(e,t,o,s=pe,r=pe,...d)=>Ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...L(n,(t=>v(t)?t(e,s):t)),o),o)))))),[u,t,...s,...d,...n])},Re=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((()=>o(d?.["del"+t](...r))),[d,t,...s,...r])},fe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},ve=(e,t=pe)=>ce(e,t),qe=(e,t=pe)=>ce(e,t),Pe=()=>G(1),xe=e=>ke(i,K(e),4,[]),Se=e=>ke(i,K(e),0),Le=e=>ke(l,K(e),1),Be=(e,t)=>ke(I,K(t),4,[e]),Te=(e,t)=>ke(I,K(t),0,[e]),Ee=(e,t)=>ke(I+m,K(t),1,[e]),Me=(e,t,o)=>ke(I+C,K(o),4,[e,t]),Fe=(e,t)=>ke(p,K(t),5,[e]),Ve=(e,t)=>ke(g,K(t),1,[e]),Ae=(e,t,o,s=0,r,d)=>ke(b,K(d),1,[e,t,o,s,r]),Oe=(e,t,o)=>ke(a,K(o),4,[e,t]),je=(e,t,o)=>ke(a,K(o),0,[e,t]),De=(e,t,o)=>ke(m,K(o),1,[e,t]),He=(e,t,o,s)=>ke(C,K(s),4,[e,t,o]),Qe=(e,t,o,s)=>ke(C,K(s),3,[e,t,o]),We=e=>ke(k,K(e),4,[]),ze=e=>ke(k,K(e),0),Ge=e=>ke(w,K(e),1),Je=(e,t)=>ke(y,K(t),4,[e]),Ke=(e,t)=>ke(y,K(t),3,[e]),Ne=(e,t,o,s,r)=>he(o,i,e,t,s,r),Ue=(e,t,o,s,r,d)=>he(s,I,t,o,r,d,e),Xe=(e,t,o,s,r,d,n)=>he(r,a,o,s,d,n,e,t),Ye=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},Ze=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),$e=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),_e=(e,t,o,s,r)=>he(o,k,e,t,s,r),et=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),tt=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),ot=(e,t,o)=>Re(e,i,t,o),st=(e,t,o,s)=>Re(t,I,o,s,e),rt=(e,t,o,s,r)=>Re(o,a,s,r,e,t),dt=(e,t,o,s,r,d,n)=>Re(r,C,d,n,e,t,o,s),nt=(e,t,o)=>Re(e,k,t,o),ut=(e,t,o,s)=>Re(t,y,o,s,e),ct=(e,t,o,s)=>we(u+i,K(s),e,t,[],o),It=(e,t,o,s)=>we(i,K(s),e,t,pe,o),it=(e,t,o,s)=>we(l,K(s),e,t,pe,o),lt=(e,t,o,s,r)=>we(u+I,K(r),t,o,[e],s),at=(e,t,o,s,r)=>we(I,K(r),t,o,[e],s),pt=(e,t,o,s,r)=>we(I+m,K(r),t,o,[e],s),gt=(e,t,o,s,r,d)=>we(u+I+C,K(d),o,s,[e,t],r),bt=(e,t,o,s,r)=>we(p,K(r),t,o,[e],s),Ct=(e,t,o,s,r)=>we(g,K(r),t,o,[e],s),mt=(e,t,o,s,r,d,n,u,c)=>we(b,K(c),d,n,[e,t,o,s,r],u),yt=(e,t,o,s,r,d)=>we(u+a,K(d),o,s,[e,t],r),kt=(e,t,o,s,r,d)=>we(a,K(d),o,s,[e,t],r),wt=(e,t,o,s,r,d)=>we(m,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d,n)=>we(u+C,K(n),s,r,[e,t,o],d),Rt=(e,t,o,s,r,d,n)=>we(C,K(n),s,r,[e,t,o],d),ft=(e,t,o,s)=>we(u+k,K(s),e,t,[],o),vt=(e,t,o,s)=>we(k,K(s),e,t,pe,o),qt=(e,t,o,s)=>we(w,K(s),e,t,pe,o),Pt=(e,t,o,s,r)=>we(u+y,K(r),t,o,[e],s),xt=(e,t,o,s,r)=>we(y,K(r),t,o,[e],s),St=(e,t,o)=>we("Start"+de,K(o),e,t),Lt=(e,t,o)=>we("WillFinish"+de,K(o),e,t),Bt=(e,t,o)=>we("DidFinish"+de,K(o),e,t),Tt=(e,t,o)=>me(e,t,o),Et=()=>G(3),Mt=e=>ke("MetricIds",X(e),1),Ft=(e,t)=>ke("Metric",X(t),3,[e]),Vt=(e,t,o,s)=>we("Metric",X(s),t,o,[e]),At=(e,t,o)=>me(e,t,o),Ot=()=>G(5),jt=(e,t)=>ke("SliceIds",Z(t),1,[e]),Dt=e=>ke("IndexIds",Z(e),1),Ht=(e,t,o)=>ke("Slice"+g,Z(o),1,[e,t]),Qt=(e,t,o,s)=>we("SliceIds",Z(s),t,o,[e]),Wt=(e,t,o,s,r)=>we("Slice"+g,Z(r),o,s,[e,t]),zt=(e,t,o)=>me(e,t,o),Gt=()=>G(7),Jt=e=>ke("RelationshipIds",_(e),1),Kt=(e,t,o)=>ke("RemoteRowId",_(o),3,[e,t]),Nt=(e,t,o)=>ke("Local"+g,_(o),1,[e,t]),Ut=(e,t,o)=>ke("Linked"+g,_(o),1,[e,t]),Xt=(e,t,o,s,r)=>we("RemoteRowId",_(r),o,s,[e,t]),Yt=(e,t,o,s,r)=>we("Local"+g,_(r),o,s,[e,t]),Zt=(e,t,o,s,r)=>we("Linked"+g,_(r),o,s,[e,t]),$t=(e,t,o)=>me(e,t,o),_t=()=>G(9),eo=e=>ke("QueryIds",te(e),1),to=(e,t)=>ke(n+I,te(t),0,[e]),oo=(e,t)=>ke(n+I+m,te(t),1,[e]),so=(e,t)=>ke(n+p,te(t),5,[e]),ro=(e,t)=>ke(n+g,te(t),1,[e]),no=(e,t,o,s=0,r,d)=>ke(n+b,te(d),1,[e,t,o,s,r]),uo=(e,t,o)=>ke(n+a,te(o),0,[e,t]),co=(e,t,o)=>ke(n+m,te(o),1,[e,t]),Io=(e,t,o,s)=>ke(n+C,te(s),3,[e,t,o]),io=(e,t,o,s)=>we(n+I,te(s),t,o,[e]),lo=(e,t,o,s)=>we(n+I+m,te(s),t,o,[e]),ao=(e,t,o,s)=>we(n+p,te(s),t,o,[e]),po=(e,t,o,s)=>we(n+g,te(s),t,o,[e]),go=(e,t,o,s,r,d,u,c)=>we(n+b,te(c),d,u,[e,t,o,s,r]),bo=(e,t,o,s,r)=>we(n+a,te(r),o,s,[e,t]),Co=(e,t,o,s,r)=>we(n+m,te(r),o,s,[e,t]),mo=(e,t,o,s,r,d)=>we(n+C,te(d),s,r,[e,t,o]),yo=(e,t,o)=>me(e,t,o),ko=()=>G(11),wo=e=>ke("CheckpointIds",se(e),2),ho=(e,t)=>ke("Checkpoint",se(t),3,[e]),Ro=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},fo=e=>fe(e,"goBackward"),vo=e=>fe(e,"goForward"),qo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},Po=e=>{const t=se(e),[s,r]=wo(t);return[(d=s,!(0==q(d))),fo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},xo=e=>{const t=se(e),[,,[s]]=wo(t);return[!h(s),vo(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},So=(e,t,o)=>we("CheckpointIds",se(o),e,t),Lo=(e,t,o,s)=>we("Checkpoint",se(s),t,o,[e]),Bo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=le(),[c,I]=le();return ue((()=>{const o=e?t(e):void 0;I(o),o&&s&&(async()=>{await s(o),u([])})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},To=(e,t,o=pe,s,r=pe)=>{const[d,n]=le();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Eo,Fragment:Mo,createElement:Fo,useCallback:Vo,useLayoutEffect:Ao,useRef:Oo,useState:jo}=e,Do=(e,...t)=>h(e)?{}:e(...t),Ho=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:Qo,useContext:Wo,useMemo:zo,useState:Go}=e,Jo=({tableId:e,store:t,rowComponent:o=$o,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>Yo(L(u,(d=>Fo(o,{...Do(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Ko=({queryId:e,queries:t,resultRowComponent:o=ls,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>Yo(L(n,(r=>Fo(o,{...Do(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),No=({relationshipId:e,relationships:t,rowComponent:o=$o,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,I,i]=Ho(_(t),e),l=n(e,u,c);return Yo(L(l,(e=>Fo(o,{...Do(s,e),key:e,tableId:i,rowId:e,store:I,debugIds:d}))),r,d,u)},Uo=e=>({checkpoints:t,checkpointComponent:o=gs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return Yo(L(e(wo(n)),(e=>Fo(o,{...Do(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Xo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:I,checkpoints:i,checkpointsById:l,children:a})=>{const p=Wo(Q),[g,b]=Go({}),C=Qo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=Qo((e=>b((t=>({...A(t,e)})))),[]);return Fo(Q.Provider,{value:zo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...I},i??p[10],{...p[11],...l},C,m]),[e,t,g,o,s,r,d,n,u,c,I,i,l,p,C,m])},a)},Yo=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},Zo=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>Yo(o+(Qe(e,t,s,r)??o),void 0,d,s),$o=({tableId:e,rowId:t,store:o,cellComponent:s=Zo,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>Yo(L(((e,t,o,s)=>{const r=De(t,o,s);return e??r})(d,e,t,o),(d=>Fo(s,{...Do(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),_o=e=>Jo(e,Ve(e.tableId,e.store)),es=({cellId:e,descending:t,offset:o,limit:s,...r})=>Jo(r,Ae(r.tableId,e,t,o,s,r.store)),ts=({store:e,tableComponent:t=_o,getTableComponentProps:o,separator:s,debugIds:r})=>Yo(L(Le(e),(s=>Fo(t,{...Do(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),os=({valueId:e,store:t,debugIds:s})=>Yo(o+(Ke(e,t)??o),void 0,s,e),ss=({store:e,valueComponent:t=os,getValueComponentProps:o,separator:s,debugIds:r})=>Yo(L(Ge(e),(s=>Fo(t,{...Do(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),rs=({metricId:e,metrics:t,debugIds:s})=>Yo(Ft(e,t)??o,void 0,s,e),ds=({indexId:e,sliceId:t,indexes:o,rowComponent:s=$o,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,I]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),i=Ht(e,t,u);return Yo(L(i,(e=>Fo(s,{...Do(r,e),key:e,tableId:I,rowId:e,store:c,debugIds:n}))),d,n,t)},ns=({indexId:e,indexes:t,sliceComponent:o=ds,getSliceComponentProps:s,separator:r,debugIds:d})=>Yo(L(jt(e,t),(r=>Fo(o,{...Do(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),us=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=$o,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Ho(_(o),e),I=Kt(e,t,n);return Yo(h(c)||h(I)?null:Fo(s,{...Do(r,I),key:I,tableId:c,rowId:I,store:u,debugIds:d}),void 0,d,t)},cs=e=>No(e,Nt,e.remoteRowId),Is=e=>No(e,Ut,e.firstRowId),is=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>Yo(o+(Io(e,t,s,r)??o),void 0,d,s),ls=({queryId:e,rowId:t,queries:o,resultCellComponent:s=is,getResultCellComponentProps:r,separator:d,debugIds:n})=>Yo(L(co(e,t,o),(d=>Fo(s,{...Do(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),as=e=>Ko(e,ro(e.queryId,e.queries)),ps=({cellId:e,descending:t,offset:o,limit:s,...r})=>Ko(r,no(r.queryId,e,t,o,s,r.queries)),gs=({checkpoints:e,checkpointId:t,debugIds:s})=>Yo(ho(t,e)??o,void 0,s,t),bs=Uo((e=>e[0])),Cs=Uo((e=>h(e[1])?[]:[e[1]])),ms=Uo((e=>e[2]));export{bs as BackwardCheckpointsView,Zo as CellView,gs as CheckpointView,Cs as CurrentCheckpointView,ms as ForwardCheckpointsView,ns as IndexView,Is as LinkedRowsView,cs as LocalRowsView,rs as MetricView,Xo as Provider,us as RemoteRowView,is as ResultCellView,ls as ResultRowView,ps as ResultSortedTableView,as as ResultTableView,$o as RowView,ds as SliceView,es as SortedTableView,_o as TableView,ts as TablesView,os as ValueView,ss as ValuesView,Ye as useAddRowCallback,Qe as useCell,De as useCellIds,wt as useCellIdsListener,Rt as useCellListener,ho as useCheckpoint,wo as useCheckpointIds,So as useCheckpointIdsListener,Lo as useCheckpointListener,oe as useCheckpoints,ko as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,yo as useCreateCheckpoints,At as useCreateIndexes,qe as useCreateMergeableStore,Tt as useCreateMetrics,Bo as useCreatePersister,$t as useCreateQueries,zt as useCreateRelationships,ve as useCreateStore,To as useCreateSynchronizer,dt as useDelCellCallback,rt as useDelRowCallback,st as useDelTableCallback,ot as useDelTablesCallback,ut as useDelValueCallback,nt as useDelValuesCallback,Bt as useDidFinishTransactionListener,fo as useGoBackwardCallback,vo as useGoForwardCallback,qo as useGoToCallback,He as useHasCell,ht as useHasCellListener,Oe as useHasRow,yt as useHasRowListener,Be as useHasTable,Me as useHasTableCell,gt as useHasTableCellListener,lt as useHasTableListener,xe as useHasTables,ct as useHasTablesListener,Je as useHasValue,Pt as useHasValueListener,We as useHasValues,ft as useHasValuesListener,Dt as useIndexIds,Y as useIndexes,Ot as useIndexesIds,Z as useIndexesOrIndexesById,Ut as useLinkedRowIds,Zt as useLinkedRowIdsListener,Nt as useLocalRowIds,Yt as useLocalRowIdsListener,Ft as useMetric,Mt as useMetricIds,Vt as useMetricListener,U as useMetrics,Et as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,_t as useQueriesIds,te as useQueriesOrQueriesById,eo as useQueryIds,xo as useRedoInformation,Jt as useRelationshipIds,$ as useRelationships,Gt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Kt as useRemoteRowId,Xt as useRemoteRowIdListener,Io as useResultCell,co as useResultCellIds,Co as useResultCellIdsListener,mo as useResultCellListener,uo as useResultRow,so as useResultRowCount,ao as useResultRowCountListener,ro as useResultRowIds,po as useResultRowIdsListener,bo as useResultRowListener,no as useResultSortedRowIds,go as useResultSortedRowIdsListener,to as useResultTable,oo as useResultTableCellIds,lo as useResultTableCellIdsListener,io as useResultTableListener,je as useRow,Fe as useRowCount,bt as useRowCountListener,Ve as useRowIds,Ct as useRowIdsListener,kt as useRowListener,$e as useSetCellCallback,Ro as useSetCheckpointCallback,Ze as useSetPartialRowCallback,et as useSetPartialValuesCallback,Xe as useSetRowCallback,Ue as useSetTableCallback,Ne as useSetTablesCallback,tt as useSetValueCallback,_e as useSetValuesCallback,jt as useSliceIds,Qt as useSliceIdsListener,Ht as useSliceRowIds,Wt as useSliceRowIdsListener,Ae as useSortedRowIds,mt as useSortedRowIdsListener,St as useStartTransactionListener,J as useStore,Pe as useStoreIds,K as useStoreOrStoreById,Te as useTable,Ee as useTableCellIds,pt as useTableCellIdsListener,Le as useTableIds,it as useTableIdsListener,at as useTableListener,Se as useTables,It as useTablesListener,Po as useUndoInformation,Ke as useValue,Ge as useValueIds,qt as useValueIdsListener,xt as useValueListener,ze as useValues,vt as useValuesListener,Lt as useWillFinishTransactionListener};
|
|
1
|
+
import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",i="Table",l=i+"s",I=i+c,a="Row",p=a+"Count",g=a+c,b="Sorted"+a+c,C="Cell",m=C+c,y="Value",k=y+"s",w=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:ie,useRef:le,useState:Ie,useSyncExternalStore:ae}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=Ie(),[r,d]=Ie();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ke=(e,t,s,r=pe)=>{const d=le(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return ae(c,n)},we=(e,t,o,s=pe,r=pe,...d)=>ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...Re(n,s,e),o),o)))))),[u,t,...s,...d,...fe(n)])},Re=(e,t,o)=>L(e,(e=>v(e)?e(o,t):e)),fe=e=>{return t=e=>!v(e),e.filter(t);var t},ve=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((e=>o(d?.["del"+t](...Re(r,d,e)))),[d,t,...s,...fe(r)])},qe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},Pe=(e,t=pe)=>ce(e,t),xe=(e,t=pe)=>ce(e,t),Se=()=>G(1),Le=e=>ke(l,K(e),4,[]),Be=e=>ke(l,K(e),0),Te=e=>ke(I,K(e),1),Ee=(e,t)=>ke(i,K(t),4,[e]),Me=(e,t)=>ke(i,K(t),0,[e]),Fe=(e,t)=>ke(i+m,K(t),1,[e]),Ve=(e,t,o)=>ke(i+C,K(o),4,[e,t]),Ae=(e,t)=>ke(p,K(t),5,[e]),Oe=(e,t)=>ke(g,K(t),1,[e]),je=(e,t,o,s=0,r,d)=>ke(b,K(d),1,[e,t,o,s,r]),De=(e,t,o)=>ke(a,K(o),4,[e,t]),He=(e,t,o)=>ke(a,K(o),0,[e,t]),Qe=(e,t,o)=>ke(m,K(o),1,[e,t]),We=(e,t,o,s)=>ke(C,K(s),4,[e,t,o]),ze=(e,t,o,s)=>ke(C,K(s),3,[e,t,o]),Ge=e=>ke(k,K(e),4,[]),Je=e=>ke(k,K(e),0),Ke=e=>ke(w,K(e),1),Ne=(e,t)=>ke(y,K(t),4,[e]),Ue=(e,t)=>ke(y,K(t),3,[e]),Xe=(e,t,o,s,r)=>he(o,l,e,t,s,r),Ye=(e,t,o,s,r,d)=>he(s,i,t,o,r,d,e),Ze=(e,t,o,s,r,d,n)=>he(r,a,o,s,d,n,e,t),$e=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},_e=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),et=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),tt=(e,t,o,s,r)=>he(o,k,e,t,s,r),ot=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),st=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),rt=(e,t,o)=>ve(e,l,t,o),dt=(e,t,o,s)=>ve(t,i,o,s,e),nt=(e,t,o,s,r)=>ve(o,a,s,r,e,t),ut=(e,t,o,s,r,d,n)=>ve(r,C,d,n,e,t,o,s),ct=(e,t,o)=>ve(e,k,t,o),it=(e,t,o,s)=>ve(t,y,o,s,e),lt=(e,t,o,s)=>we(u+l,K(s),e,t,[],o),It=(e,t,o,s)=>we(l,K(s),e,t,pe,o),at=(e,t,o,s)=>we(I,K(s),e,t,pe,o),pt=(e,t,o,s,r)=>we(u+i,K(r),t,o,[e],s),gt=(e,t,o,s,r)=>we(i,K(r),t,o,[e],s),bt=(e,t,o,s,r)=>we(i+m,K(r),t,o,[e],s),Ct=(e,t,o,s,r,d)=>we(u+i+C,K(d),o,s,[e,t],r),mt=(e,t,o,s,r)=>we(p,K(r),t,o,[e],s),yt=(e,t,o,s,r)=>we(g,K(r),t,o,[e],s),kt=(e,t,o,s,r,d,n,u,c)=>we(b,K(c),d,n,[e,t,o,s,r],u),wt=(e,t,o,s,r,d)=>we(u+a,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d)=>we(a,K(d),o,s,[e,t],r),Rt=(e,t,o,s,r,d)=>we(m,K(d),o,s,[e,t],r),ft=(e,t,o,s,r,d,n)=>we(u+C,K(n),s,r,[e,t,o],d),vt=(e,t,o,s,r,d,n)=>we(C,K(n),s,r,[e,t,o],d),qt=(e,t,o,s)=>we(u+k,K(s),e,t,[],o),Pt=(e,t,o,s)=>we(k,K(s),e,t,pe,o),xt=(e,t,o,s)=>we(w,K(s),e,t,pe,o),St=(e,t,o,s,r)=>we(u+y,K(r),t,o,[e],s),Lt=(e,t,o,s,r)=>we(y,K(r),t,o,[e],s),Bt=(e,t,o)=>we("Start"+de,K(o),e,t),Tt=(e,t,o)=>we("WillFinish"+de,K(o),e,t),Et=(e,t,o)=>we("DidFinish"+de,K(o),e,t),Mt=(e,t,o)=>me(e,t,o),Ft=()=>G(3),Vt=e=>ke("MetricIds",X(e),1),At=(e,t)=>ke("Metric",X(t),3,[e]),Ot=(e,t,o,s)=>we("Metric",X(s),t,o,[e]),jt=(e,t,o)=>me(e,t,o),Dt=()=>G(5),Ht=(e,t)=>ke("SliceIds",Z(t),1,[e]),Qt=e=>ke("IndexIds",Z(e),1),Wt=(e,t,o)=>ke("Slice"+g,Z(o),1,[e,t]),zt=(e,t,o,s)=>we("SliceIds",Z(s),t,o,[e]),Gt=(e,t,o,s,r)=>we("Slice"+g,Z(r),o,s,[e,t]),Jt=(e,t,o)=>me(e,t,o),Kt=()=>G(7),Nt=e=>ke("RelationshipIds",_(e),1),Ut=(e,t,o)=>ke("RemoteRowId",_(o),3,[e,t]),Xt=(e,t,o)=>ke("Local"+g,_(o),1,[e,t]),Yt=(e,t,o)=>ke("Linked"+g,_(o),1,[e,t]),Zt=(e,t,o,s,r)=>we("RemoteRowId",_(r),o,s,[e,t]),$t=(e,t,o,s,r)=>we("Local"+g,_(r),o,s,[e,t]),_t=(e,t,o,s,r)=>we("Linked"+g,_(r),o,s,[e,t]),eo=(e,t,o)=>me(e,t,o),to=()=>G(9),oo=e=>ke("QueryIds",te(e),1),so=(e,t)=>ke(n+i,te(t),0,[e]),ro=(e,t)=>ke(n+i+m,te(t),1,[e]),no=(e,t)=>ke(n+p,te(t),5,[e]),uo=(e,t)=>ke(n+g,te(t),1,[e]),co=(e,t,o,s=0,r,d)=>ke(n+b,te(d),1,[e,t,o,s,r]),io=(e,t,o)=>ke(n+a,te(o),0,[e,t]),lo=(e,t,o)=>ke(n+m,te(o),1,[e,t]),Io=(e,t,o,s)=>ke(n+C,te(s),3,[e,t,o]),ao=(e,t,o,s)=>we(n+i,te(s),t,o,[e]),po=(e,t,o,s)=>we(n+i+m,te(s),t,o,[e]),go=(e,t,o,s)=>we(n+p,te(s),t,o,[e]),bo=(e,t,o,s)=>we(n+g,te(s),t,o,[e]),Co=(e,t,o,s,r,d,u,c)=>we(n+b,te(c),d,u,[e,t,o,s,r]),mo=(e,t,o,s,r)=>we(n+a,te(r),o,s,[e,t]),yo=(e,t,o,s,r)=>we(n+m,te(r),o,s,[e,t]),ko=(e,t,o,s,r,d)=>we(n+C,te(d),s,r,[e,t,o]),wo=(e,t,o)=>me(e,t,o),ho=()=>G(11),Ro=e=>ke("CheckpointIds",se(e),2),fo=(e,t)=>ke("Checkpoint",se(t),3,[e]),vo=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},qo=e=>qe(e,"goBackward"),Po=e=>qe(e,"goForward"),xo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},So=e=>{const t=se(e),[s,r]=Ro(t);return[(d=s,!(0==q(d))),qo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},Lo=e=>{const t=se(e),[,,[s]]=Ro(t);return[!h(s),Po(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},Bo=(e,t,o)=>we("CheckpointIds",se(o),e,t),To=(e,t,o,s)=>we("Checkpoint",se(s),t,o,[e]),Eo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=Ie(),[c,i]=Ie();return ue((()=>{const o=e?t(e):void 0;i(o),o&&s&&(async()=>{await s(o),u([])})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},Mo=(e,t,o=pe,s,r=pe)=>{const[d,n]=Ie();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Fo,Fragment:Vo,createElement:Ao,useCallback:Oo,useLayoutEffect:jo,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>h(e)?{}:e(...t),Wo=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:zo,useContext:Go,useMemo:Jo,useState:Ko}=e,No=({tableId:e,store:t,rowComponent:o=es,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>$o(L(u,(d=>Ao(o,{...Qo(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Uo=({queryId:e,queries:t,resultRowComponent:o=ps,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>$o(L(n,(r=>Ao(o,{...Qo(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),Xo=({relationshipId:e,relationships:t,rowComponent:o=es,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,i,l]=Wo(_(t),e),I=n(e,u,c);return $o(L(I,(e=>Ao(o,{...Qo(s,e),key:e,tableId:l,rowId:e,store:i,debugIds:d}))),r,d,u)},Yo=e=>({checkpoints:t,checkpointComponent:o=Cs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return $o(L(e(Ro(n)),(e=>Ao(o,{...Qo(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Zo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:i,checkpoints:l,checkpointsById:I,children:a})=>{const p=Go(Q),[g,b]=Ko({}),C=zo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=zo((e=>b((t=>({...A(t,e)})))),[]);return Ao(Q.Provider,{value:Jo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...i},l??p[10],{...p[11],...I},C,m]),[e,t,g,o,s,r,d,n,u,c,i,l,I,p,C,m])},a)},$o=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},_o=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>$o(o+(ze(e,t,s,r)??o),void 0,d,s),es=({tableId:e,rowId:t,store:o,cellComponent:s=_o,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>$o(L(((e,t,o,s)=>{const r=Qe(t,o,s);return e??r})(d,e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),ts=e=>No(e,Oe(e.tableId,e.store)),os=({cellId:e,descending:t,offset:o,limit:s,...r})=>No(r,je(r.tableId,e,t,o,s,r.store)),ss=({store:e,tableComponent:t=ts,getTableComponentProps:o,separator:s,debugIds:r})=>$o(L(Te(e),(s=>Ao(t,{...Qo(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),rs=({valueId:e,store:t,debugIds:s})=>$o(o+(Ue(e,t)??o),void 0,s,e),ds=({store:e,valueComponent:t=rs,getValueComponentProps:o,separator:s,debugIds:r})=>$o(L(Ke(e),(s=>Ao(t,{...Qo(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),ns=({metricId:e,metrics:t,debugIds:s})=>$o(At(e,t)??o,void 0,s,e),us=({indexId:e,sliceId:t,indexes:o,rowComponent:s=es,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),l=Wt(e,t,u);return $o(L(l,(e=>Ao(s,{...Qo(r,e),key:e,tableId:i,rowId:e,store:c,debugIds:n}))),d,n,t)},cs=({indexId:e,indexes:t,sliceComponent:o=us,getSliceComponentProps:s,separator:r,debugIds:d})=>$o(L(Ht(e,t),(r=>Ao(o,{...Qo(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),is=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=es,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Wo(_(o),e),i=Ut(e,t,n);return $o(h(c)||h(i)?null:Ao(s,{...Qo(r,i),key:i,tableId:c,rowId:i,store:u,debugIds:d}),void 0,d,t)},ls=e=>Xo(e,Xt,e.remoteRowId),Is=e=>Xo(e,Yt,e.firstRowId),as=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>$o(o+(Io(e,t,s,r)??o),void 0,d,s),ps=({queryId:e,rowId:t,queries:o,resultCellComponent:s=as,getResultCellComponentProps:r,separator:d,debugIds:n})=>$o(L(lo(e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),gs=e=>Uo(e,uo(e.queryId,e.queries)),bs=({cellId:e,descending:t,offset:o,limit:s,...r})=>Uo(r,co(r.queryId,e,t,o,s,r.queries)),Cs=({checkpoints:e,checkpointId:t,debugIds:s})=>$o(fo(t,e)??o,void 0,s,t),ms=Yo((e=>e[0])),ys=Yo((e=>h(e[1])?[]:[e[1]])),ks=Yo((e=>e[2]));export{ms as BackwardCheckpointsView,_o as CellView,Cs as CheckpointView,ys as CurrentCheckpointView,ks as ForwardCheckpointsView,cs as IndexView,Is as LinkedRowsView,ls as LocalRowsView,ns as MetricView,Zo as Provider,is as RemoteRowView,as as ResultCellView,ps as ResultRowView,bs as ResultSortedTableView,gs as ResultTableView,es as RowView,us as SliceView,os as SortedTableView,ts as TableView,ss as TablesView,rs as ValueView,ds as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,Rt as useCellIdsListener,vt as useCellListener,fo as useCheckpoint,Ro as useCheckpointIds,Bo as useCheckpointIdsListener,To as useCheckpointListener,oe as useCheckpoints,ho as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,wo as useCreateCheckpoints,jt as useCreateIndexes,xe as useCreateMergeableStore,Mt as useCreateMetrics,Eo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,Pe as useCreateStore,Mo as useCreateSynchronizer,ut as useDelCellCallback,nt as useDelRowCallback,dt as useDelTableCallback,rt as useDelTablesCallback,it as useDelValueCallback,ct as useDelValuesCallback,Et as useDidFinishTransactionListener,qo as useGoBackwardCallback,Po as useGoForwardCallback,xo as useGoToCallback,We as useHasCell,ft as useHasCellListener,De as useHasRow,wt as useHasRowListener,Ee as useHasTable,Ve as useHasTableCell,Ct as useHasTableCellListener,pt as useHasTableListener,Le as useHasTables,lt as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,qt as useHasValuesListener,Qt as useIndexIds,Y as useIndexes,Dt as useIndexesIds,Z as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,At as useMetric,Vt as useMetricIds,Ot as useMetricListener,U as useMetrics,Ft as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,to as useQueriesIds,te as useQueriesOrQueriesById,oo as useQueryIds,Lo as useRedoInformation,Nt as useRelationshipIds,$ as useRelationships,Kt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,Io as useResultCell,lo as useResultCellIds,yo as useResultCellIdsListener,ko as useResultCellListener,io as useResultRow,no as useResultRowCount,go as useResultRowCountListener,uo as useResultRowIds,bo as useResultRowIdsListener,mo as useResultRowListener,co as useResultSortedRowIds,Co as useResultSortedRowIdsListener,so as useResultTable,ro as useResultTableCellIds,po as useResultTableCellIdsListener,ao as useResultTableListener,He as useRow,Ae as useRowCount,mt as useRowCountListener,Oe as useRowIds,yt as useRowIdsListener,ht as useRowListener,et as useSetCellCallback,vo as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,st as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,je as useSortedRowIds,kt as useSortedRowIdsListener,Bt as useStartTransactionListener,J as useStore,Se as useStoreIds,K as useStoreOrStoreById,Me as useTable,Fe as useTableCellIds,bt as useTableCellIdsListener,Te as useTableIds,at as useTableIdsListener,gt as useTableListener,Be as useTables,It as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,xt as useValueIdsListener,Lt as useValueListener,Je as useValues,Pt as useValuesListener,Tt as useWillFinishTransactionListener};
|
package/min/ui-react/index.js.gz
CHANGED
|
Binary file
|