tinybase 4.3.14 → 4.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/persisters/persister-automerge.cjs +1 -1
- package/lib/cjs/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-browser.cjs +1 -1
- package/lib/cjs/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs +1 -1
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-expo-sqlite.cjs +1 -1
- package/lib/cjs/persisters/persister-expo-sqlite.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-file.cjs +1 -1
- package/lib/cjs/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-indexed-db.cjs +1 -1
- package/lib/cjs/persisters/persister-indexed-db.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-partykit-client.cjs +1 -1
- package/lib/cjs/persisters/persister-partykit-client.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-remote.cjs +1 -1
- package/lib/cjs/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs +1 -1
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite3.cjs +1 -1
- package/lib/cjs/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-yjs.cjs +1 -1
- package/lib/cjs/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs/persisters.cjs +1 -1
- package/lib/cjs/persisters.cjs.gz +0 -0
- package/lib/cjs/tinybase.cjs +1 -1
- package/lib/cjs/tinybase.cjs.gz +0 -0
- package/lib/cjs/ui-react-dom-debug.cjs +1 -1
- package/lib/cjs/ui-react-dom-debug.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-automerge.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-browser.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-expo-sqlite.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-expo-sqlite.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-file.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-indexed-db.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-indexed-db.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-partykit-client.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-partykit-client.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-remote.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-yjs.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs-es6/persisters.cjs +1 -1
- package/lib/cjs-es6/persisters.cjs.gz +0 -0
- package/lib/cjs-es6/tinybase.cjs +1 -1
- package/lib/cjs-es6/tinybase.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react-dom-debug.cjs +1 -1
- package/lib/cjs-es6/ui-react-dom-debug.cjs.gz +0 -0
- package/lib/debug/persisters/persister-automerge.js +1 -0
- package/lib/debug/persisters/persister-browser.js +1 -0
- package/lib/debug/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/debug/persisters/persister-expo-sqlite.js +1 -0
- package/lib/debug/persisters/persister-file.js +1 -0
- package/lib/debug/persisters/persister-indexed-db.js +1 -0
- package/lib/debug/persisters/persister-partykit-client.js +1 -0
- package/lib/debug/persisters/persister-remote.js +1 -0
- package/lib/debug/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/debug/persisters/persister-sqlite3.js +1 -0
- package/lib/debug/persisters/persister-yjs.js +1 -0
- package/lib/debug/persisters.js +1 -0
- package/lib/debug/tinybase.js +1 -0
- package/lib/debug/ui-react-dom.js +1 -0
- package/lib/es6/persisters/persister-automerge.js +1 -1
- package/lib/es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/es6/persisters/persister-browser.js +1 -1
- package/lib/es6/persisters/persister-browser.js.gz +0 -0
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-expo-sqlite.js +1 -1
- package/lib/es6/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/es6/persisters/persister-file.js +1 -1
- package/lib/es6/persisters/persister-file.js.gz +0 -0
- package/lib/es6/persisters/persister-indexed-db.js +1 -1
- package/lib/es6/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/es6/persisters/persister-partykit-client.js +1 -1
- package/lib/es6/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/es6/persisters/persister-remote.js +1 -1
- package/lib/es6/persisters/persister-remote.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite3.js +1 -1
- package/lib/es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/es6/persisters/persister-yjs.js +1 -1
- package/lib/es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/es6/persisters.js +1 -1
- package/lib/es6/persisters.js.gz +0 -0
- package/lib/es6/tinybase.js +1 -1
- package/lib/es6/tinybase.js.gz +0 -0
- package/lib/es6/ui-react-dom-debug.js +1 -1
- package/lib/es6/ui-react-dom-debug.js.gz +0 -0
- package/lib/persisters/persister-automerge.js +1 -1
- package/lib/persisters/persister-automerge.js.gz +0 -0
- package/lib/persisters/persister-browser.js +1 -1
- package/lib/persisters/persister-browser.js.gz +0 -0
- package/lib/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-expo-sqlite.js +1 -1
- package/lib/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/persisters/persister-file.js +1 -1
- package/lib/persisters/persister-file.js.gz +0 -0
- package/lib/persisters/persister-indexed-db.js +1 -1
- package/lib/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/persisters/persister-partykit-client.js +1 -1
- package/lib/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/persisters/persister-remote.js +1 -1
- package/lib/persisters/persister-remote.js.gz +0 -0
- package/lib/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-sqlite3.js +1 -1
- package/lib/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/persisters/persister-yjs.js +1 -1
- package/lib/persisters/persister-yjs.js.gz +0 -0
- package/lib/persisters.js +1 -1
- package/lib/persisters.js.gz +0 -0
- package/lib/tinybase.js +1 -1
- package/lib/tinybase.js.gz +0 -0
- package/lib/types/persisters.d.ts +10 -10
- package/lib/types/with-schemas/persisters.d.ts +10 -10
- package/lib/umd/persisters/persister-automerge.js +1 -1
- package/lib/umd/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd/persisters/persister-browser.js +1 -1
- package/lib/umd/persisters/persister-browser.js.gz +0 -0
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-expo-sqlite.js +1 -1
- package/lib/umd/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/umd/persisters/persister-file.js +1 -1
- package/lib/umd/persisters/persister-file.js.gz +0 -0
- package/lib/umd/persisters/persister-indexed-db.js +1 -1
- package/lib/umd/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/umd/persisters/persister-partykit-client.js +1 -1
- package/lib/umd/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/umd/persisters/persister-remote.js +1 -1
- package/lib/umd/persisters/persister-remote.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/umd/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite3.js +1 -1
- package/lib/umd/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd/persisters/persister-yjs.js +1 -1
- package/lib/umd/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd/persisters.js +1 -1
- package/lib/umd/persisters.js.gz +0 -0
- package/lib/umd/tinybase.js +1 -1
- package/lib/umd/tinybase.js.gz +0 -0
- package/lib/umd/ui-react-dom-debug.js +1 -1
- package/lib/umd/ui-react-dom-debug.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-automerge.js +1 -1
- package/lib/umd-es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-browser.js +1 -1
- package/lib/umd-es6/persisters/persister-browser.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-expo-sqlite.js +1 -1
- package/lib/umd-es6/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-file.js +1 -1
- package/lib/umd-es6/persisters/persister-file.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-indexed-db.js +1 -1
- package/lib/umd-es6/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-partykit-client.js +1 -1
- package/lib/umd-es6/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-remote.js +1 -1
- package/lib/umd-es6/persisters/persister-remote.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite3.js +1 -1
- package/lib/umd-es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-yjs.js +1 -1
- package/lib/umd-es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd-es6/persisters.js +1 -1
- package/lib/umd-es6/persisters.js.gz +0 -0
- package/lib/umd-es6/tinybase.js +1 -1
- package/lib/umd-es6/tinybase.js.gz +0 -0
- package/lib/umd-es6/ui-react-dom-debug.js +1 -1
- package/lib/umd-es6/ui-react-dom-debug.js.gz +0 -0
- package/package.json +26 -26
- package/readme.md +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,s="",r=n(s),o=n(!0),a=n(0),i=n(n),u="type",d="default",c="Ids",h="Table",m=h+"s",b=h+c,p="Row",g=p+"Count",v=p+c,f="Cell",I=f+c,y="Value",w=y+"s",C=y+c,k="currentTarget",T="value",S=e=>s+e,x=Math.floor,V=isFinite,R=(e,l)=>e instanceof l,O=e=>null==e,q=(e,l,t)=>O(e)?null==t?void 0:t():l(e),N=e=>e==r||e==o,P=e=>n(e)==i,E=e=>Array.isArray(e),L=(e,l,t)=>e.slice(l,t),M=e=>e.length,{PureComponent:j,Fragment:z,createElement:$,useCallback:A,useLayoutEffect:F,useRef:J,useState:D}=l,B=(e,...l)=>O(e)?{}:e(...l),H=(e,l)=>e.forEach(l),Q=(e,l)=>e.map(l),W=e=>0==M(e),U=(e,...l)=>e.push(...l),G=e=>e.shift(),K=Object,X=K.keys,Y=K.isFrozen,Z=K.freeze,_=e=>R(e,K)&&e.constructor==K,ee=(e=[])=>K.fromEntries(e),le=(e,l)=>!O(((e,l)=>q(e,(e=>e[l])))(e,l)),te=(e,l)=>(delete e[l],e),ne=(e,l)=>Q(K.entries(e),(([e,t])=>l(t,e))),se=e=>_(e)&&0==(e=>M(X(e)))(e),re=e=>JSON.stringify(e,((e,l)=>R(l,Map)?K.fromEntries([...l]):l)),oe=JSON.parse,ae="tinybaseStoreInspector",ie="TinyBase Store Inspector",ue=["left","top","bottom","right","full"],de="state",ce="sort",he="open",me="position",be=he,pe="editable",ge=(...e)=>re(e),ve=(e,l)=>Q(e.sort(),l),fe=(e,l)=>[!!t.useCell(de,e,pe,l),A((t=>{l.setCell(de,e,pe,(e=>!e)),t.preventDefault()}),[l,e])],Ie="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",ye='content:url("',we=ye+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",Ce='</svg>")',ke=ye+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",Te=Q([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,l,t,n])=>we+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${l}' width='${t}' height='${n}' fill='white'/>`+Ce)),Se=we+"<path d='M20 20l60 60M20 80l60-60' />"+Ce,xe=we+`<path d='${Ie}' />`+Ce,Ve=we+`<path d='${Ie}M20 20l60 60' />`+Ce;var Re=Object.defineProperty,Oe=Object.defineProperties,qe=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Le=(e,l,t)=>l in e?Re(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Me=(e,l)=>{for(var t in l||(l={}))Pe.call(l,t)&&Le(e,t,l[t]);if(Ne)for(var t of Ne(l))Ee.call(l,t)&&Le(e,t,l[t]);return e},je=(e,l)=>Oe(e,qe(l));const ze="*::-webkit-scrollbar",$e=`#${ae}{\n all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999;\n ${((e,l="")=>e.join(l))(ne(je(Me(je(Me(je(Me({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[ze]:"width:0.5rem;height:0.5rem;",[ze+"-track"]:"background:#111",[ze+"-thumb"]:"background:#999;border:1px solid #111",[ze+"-thumb:hover"]:"background:#fff",[ze+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+ke},ee(Q(["bottom:0;left:0","top:0;right:0"],((e,l)=>[`>img[data-position='${l}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),ee(Q(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,l)=>[`main[data-position='${l}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":ke,"header>img:nth-of-type(6)":Se}),ee(Q(Te,((e,l)=>[`header>img[data-id='${l}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":xe,"details[open]>summary img.done":Ve,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,l)=>e?`& ${l}{${e}}`:"")))}`,Ae=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!0),[],e);return t.useValue(be,e)?null:$("img",{onClick:s,title:ie,"data-position":n})},Fe=({uniqueId:e,summary:l,editable:n,handleEditable:s,children:r,s:o})=>{const a=!!t.useCell(de,e,he,o),i=t.useSetCellCallback(de,e,he,(e=>e[k].open),[],o);return $("details",{open:a,onToggle:i},$("summary",null,l,s?$("img",{onClick:s,className:n?"done":"edit"}):null),r)},Je=e=>{const l=n(e);return N(l)||l==a&&V(e)?l:void 0},De=(e,l,t,n,s)=>O(s)?e.delCell(l,t,n,!0):e.setCell(l,t,n,s),Be=(e,l,t)=>O(t)?e.delValue(l):e.setValue(l,t),He=(e,l,t,n)=>e==r?l:e==a?t:n;var Qe=Object.defineProperty,We=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Ye=(e,l,t)=>l in e?Qe(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Ze=(e,l)=>{for(var t in l||(l={}))Ke.call(l,t)&&Ye(e,t,l[t]);if(Ge)for(var t of Ge(l))Xe.call(l,t)&&Ye(e,t,l[t]);return e},_e=(e,l)=>We(e,Ue(l)),el=(e,l)=>{var t={};for(var n in e)Ke.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&Ge)for(var n of Ge(e))l.indexOf(n)<0&&Xe.call(e,n)&&(t[n]=e[n]);return t};const{useCallback:ll,useMemo:tl,useState:nl}=l,sl="editable",rl=(e,l)=>Q(t.useTableCellIds(e,l),(l=>e+"."+l)),ol=(e,l,t)=>{const n=ll(e,l);return t?n:void 0},al=(...e)=>tl((()=>e),e),il=(e,l)=>tl((()=>({store:e,tableId:l})),[e,l]),ul=(e,l)=>tl((()=>({queries:e,queryId:l})),[e,l]),dl=(e,l=!1,t,n=0,s,r,o,a)=>{const[[i,u,d],c]=nl([e,l,n]),h=ll((e=>{c(e),null==a||a(e)}),[a]),m=ol((e=>h([e,e==i&&!u,d])),[h,i,u,d],t),b=ll((e=>h([i,u,e])),[h,i,u]),p=!0===o?kl:o;return[[i,u,d],m,tl((()=>!1===o?null:$(p,{offset:d,limit:s,total:r,onChange:b})),[o,p,d,s,r,b])]},cl=(e,l,t)=>tl((()=>{const s=null!=l?l:e;return ee(ne(E(s)?ee(Q(s,(e=>[e,e]))):s,((e,l)=>{return[l,Ze(Ze({},{label:l,component:t}),(s=e,n(s)==r?{label:e}:e))];var s})))}),[l,t,e]),hl=({className:e,headerRow:l,idColumn:t,params:[n,s,r,o,a,i]})=>$("table",{className:e},i?$("caption",null,i):null,!1===l?null:$("thead",null,$("tr",null,!1===t?null:$(ml,{sort:null!=o?o:[],label:"Id",onClick:a}),ne(n,(({label:e},l)=>$(ml,{key:l,cellId:l,label:e,sort:null!=o?o:[],onClick:a}))))),$("tbody",null,Q(r,(e=>$("tr",{key:e},!1===t?null:$("th",null,e),ne(n,(({component:l,getComponentProps:t},n)=>$("td",{key:n},$(l,_e(Ze(Ze({},B(t,e,n)),s),{rowId:e,cellId:n})))))))))),ml=({cellId:e,sort:[l,t],label:n=(null!=e?e:s),onClick:r})=>$("th",{onClick:ol((()=>null==r?void 0:r(e)),[r,e],r),className:O(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},O(t)||l!=e?null:(t?"↓":"↑")+" ",n),bl=({localRowId:e,params:[n,s,r,o,a,i,u]})=>{const d=t.useRemoteRowId(a,e,i);return $("tr",null,!1===n?null:$(l.Fragment,null,$("th",null,e),$("th",null,d)),ne(s,(({component:l,getComponentProps:t},n)=>{const[s,a]=n.split(".",2),i=s===r?e:s===o?d:null;return O(i)?null:$("td",{key:n},$(l,_e(Ze({},B(t,i,a)),{store:u,tableId:s,rowId:i,cellId:a})))})))},pl=({thing:e,onThingChange:l,className:t,hasSchema:n,showType:s=!0})=>{const[i,u]=nl(),[d,c]=nl(),[h,m]=nl(),[b,p]=nl(),[g,v]=nl();d!==e&&(u(Je(e)),c(e),m(e+""),p(Number(e)||0),v(!!e));const f=ll(((e,t)=>{t(e),c(e),l(e)}),[l]),I=ll((()=>{if(!(null==n?void 0:n())){const e=He(i,a,o,r),t=He(e,h,b,g);u(e),c(t),l(t)}}),[n,l,h,b,g,i]);return $("div",{className:t},s?$("button",{className:i,onClick:I},i):null,He(i,$("input",{key:i,value:h,onChange:ll((e=>f(e[k][T]+"",m)),[f])}),$("input",{key:i,type:"number",value:b,onChange:ll((e=>f(Number(e[k][T]||0),p)),[f])}),$("input",{key:i,type:"checkbox",checked:g,onChange:ll((e=>f(!!e[k].checked,v)),[f])})))},gl=e=>{var l=e,{tableId:n,cellId:s,descending:r,offset:o,limit:a,store:i,editable:u,sortOnClick:d,paginator:c=!1,onChange:h,customCells:m}=l,b=el(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[p,g,v]=dl(s,r,d,o,a,t.useRowCount(n,i),c,h);return $(hl,_e(Ze({},b),{params:al(cl(t.useTableCellIds(n,i),m,u?wl:t.CellView),il(i,n),t.useSortedRowIds(n,...p,a,i),p,g,v)}))},vl=({store:e,editable:l=!1,valueComponent:n=(l?Cl:t.ValueView),getValueComponentProps:s,className:r,headerRow:o,idColumn:a})=>$("table",{className:r},!1===o?null:$("thead",null,$("tr",null,!1===a?null:$("th",null,"Id"),$("th",null,y))),$("tbody",null,Q(t.useValueIds(e),(l=>$("tr",{key:l},!1===a?null:$("th",null,l),$("td",null,$(n,_e(Ze({},B(s,l)),{valueId:l,store:e})))))))),fl=e=>{var l=e,{indexId:n,sliceId:s,indexes:r,editable:o,customCells:a}=l,i=el(l,["indexId","sliceId","indexes","editable","customCells"]);const[u,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(t.useIndexesOrIndexesById(r),n);return $(hl,_e(Ze({},i),{params:al(cl(t.useTableCellIds(c,d),a,o?wl:t.CellView),il(d,c),t.useSliceRowIds(n,s,u))}))},Il=({relationshipId:e,relationships:n,editable:s,customCells:r,className:o,headerRow:a,idColumn:i=!0})=>{const[u,d,c,h]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(t.useRelationshipsOrRelationshipsById(n),e),m=cl([...rl(c,d),...rl(h,d)],r,s?wl:t.CellView),b=al(i,m,c,h,e,u,d);return $("table",{className:o},!1===a?null:$("thead",null,$("tr",null,!1===i?null:$(l.Fragment,null,$("th",null,c,".Id"),$("th",null,h,".Id")),ne(m,(({label:e},l)=>$("th",{key:l},e))))),$("tbody",null,Q(t.useRowIds(c,d),(e=>$(bl,{key:e,localRowId:e,params:b})))))},yl=e=>{var l=e,{queryId:n,cellId:s,descending:r,offset:o,limit:a,queries:i,sortOnClick:u,paginator:d=!1,customCells:c,onChange:h}=l,m=el(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[b,p,g]=dl(s,r,u,o,a,t.useResultRowCount(n,i),d,h);return $(hl,_e(Ze({},m),{params:al(cl(t.useResultTableCellIds(n,i),c,t.ResultCellView),ul(i,n),t.useResultSortedRowIds(n,...b,a,i),b,p,g)}))},wl=({tableId:e,rowId:l,cellId:n,store:s,className:r,showType:o})=>{var a;return $(pl,{thing:t.useCell(e,l,n,s),onThingChange:t.useSetCellCallback(e,l,n,(e=>e),[],s),className:null!=r?r:sl+f,showType:o,hasSchema:null==(a=t.useStoreOrStoreById(s))?void 0:a.hasTablesSchema})},Cl=({valueId:e,store:l,className:n,showType:s})=>{var r;return $(pl,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=n?n:sl+y,showType:s,hasSchema:null==(r=t.useStoreOrStoreById(l))?void 0:r.hasValuesSchema})},kl=({onChange:e,total:t,offset:n=0,limit:s=t,singular:r="row",plural:o=r+"s"})=>{(n>t||n<0)&&(n=0,e(0));const a=ol((()=>e(n-s)),[e,n,s],n>0),i=ol((()=>e(n+s)),[e,n,s],n+s<t);return $(l.Fragment,null,t>s&&$(l.Fragment,null,$("button",{className:"previous",disabled:0==n,onClick:a},"←"),$("button",{className:"next",disabled:n+s>=t,onClick:i},"→"),n+1," to ",Math.min(t,n+s)," of "),t," ",1!=t?o:r)},Tl=({indexes:e,indexesId:l,indexId:n,s:s})=>$(Fe,{uniqueId:ge("i",l,n),summary:"Index: "+n,s:s},Q(t.useSliceIds(n,e),(t=>$(Sl,{indexes:e,indexesId:l,indexId:n,sliceId:t,s:s,key:t})))),Sl=({indexes:e,indexesId:l,indexId:t,sliceId:n,s:s})=>{const r=ge("i",l,t,n),[o,a]=fe(r,s);return $(Fe,{uniqueId:r,summary:"Slice: "+n,editable:o,handleEditable:a,s:s},$(fl,{sliceId:n,indexId:t,indexes:e,editable:o}))},xl=({indexesId:e,s:l})=>{const n=t.useIndexes(e),s=t.useIndexIds(n);return O(n)?null:$(Fe,{uniqueId:ge("i",e),summary:"Indexes: "+(null!=e?e:d),s:l},W(s)?"No indexes defined":ve(s,(t=>$(Tl,{indexes:n,indexesId:e,indexId:t,s:l,key:t}))))},Vl=({metrics:e,metricId:l})=>$("tr",null,$("th",null,l),$("td",null,null==e?void 0:e.getTableId(l)),$("td",null,t.useMetric(l,e))),Rl=({metricsId:e,s:l})=>{const n=t.useMetrics(e),s=t.useMetricIds(n);return O(n)?null:$(Fe,{uniqueId:ge("m",e),summary:"Metrics: "+(null!=e?e:d),s:l},W(s)?"No metrics defined":$("table",null,$("thead",null,$("th",null,"Metric Id"),$("th",null,"Table Id"),$("th",null,"Metric")),$("tbody",null,Q(s,(e=>$(Vl,{metrics:n,metricId:e,key:e}))))))},Ol=({queries:e,queriesId:l,queryId:n,s:s})=>{var r;const o=ge("q",l,n),[a,i,u]=oe(null!=(r=t.useCell(de,o,ce,s))?r:"[]"),d=t.useSetCellCallback(de,o,ce,re,[],s);return $(Fe,{uniqueId:o,summary:"Query: "+n,s:s},$(yl,{queryId:n,queries:e,cellId:a,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d}))},ql=({queriesId:e,s:l})=>{const n=t.useQueries(e),s=t.useQueryIds(n);return O(n)?null:$(Fe,{uniqueId:ge("q",e),summary:"Queries: "+(null!=e?e:d),s:l},W(s)?"No queries defined":ve(s,(t=>$(Ol,{queries:n,queriesId:e,queryId:t,s:l,key:t}))))},Nl=({relationships:e,relationshipsId:l,relationshipId:t,s:n})=>{const s=ge("r",l,t),[r,o]=fe(s,n);return $(Fe,{uniqueId:s,summary:"Relationship: "+t,editable:r,handleEditable:o,s:n},$(Il,{relationshipId:t,relationships:e,editable:r}))},Pl=({relationshipsId:e,s:l})=>{const n=t.useRelationships(e),s=t.useRelationshipIds(n);return O(n)?null:$(Fe,{uniqueId:ge("r",e),summary:"Relationships: "+(null!=e?e:d),s:l},W(s)?"No relationships defined":ve(s,(t=>$(Nl,{relationships:n,relationshipsId:e,relationshipId:t,s:l,key:t}))))},El=({tableId:e,store:l,storeId:n,s:s})=>{var r;const o=ge("t",n,e),[a,i,u]=oe(null!=(r=t.useCell(de,o,ce,s))?r:"[]"),d=t.useSetCellCallback(de,o,ce,re,[],s),[c,m]=fe(o,s);return $(Fe,{uniqueId:o,summary:h+": "+e,editable:c,handleEditable:m,s:s},$(gl,{tableId:e,store:l,cellId:a,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d,editable:c}))},Ll=({store:e,storeId:l,s:n})=>{const s=ge("v",l),[r,o]=fe(s,n);return W(t.useValueIds(e))?null:$(Fe,{uniqueId:s,summary:w,editable:r,handleEditable:o,s:n},$(vl,{store:e,editable:r}))},Ml=({storeId:e,s:l})=>{const n=t.useStore(e),s=t.useTableIds(n);return O(n)?null:$(Fe,{uniqueId:ge("s",e),summary:"Store: "+(null!=e?e:d),s:l},$(Ll,{storeId:e,store:n,s:l}),ve(s,(t=>$(El,{store:n,storeId:e,tableId:t,s:l,key:t}))))},jl=({s:e})=>{const l=J(null),n=J(0),[s,r]=D(!1),{scrollLeft:o,scrollTop:a}=t.useValues(e);F((()=>{const e=l.current;if(e&&!s){const l=new MutationObserver((()=>{e.scrollWidth>=x(o)+e.clientWidth&&e.scrollHeight>=x(a)+e.clientHeight&&e.scrollTo(o,a)}));return l.observe(e,{childList:!0,subtree:!0}),()=>l.disconnect()}}),[s,o,a]);const i=A((l=>{const{scrollLeft:t,scrollTop:s}=l[k];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:t,scrollTop:s})}))}),[e]),u=t.useStore(),d=t.useStoreIds(),c=t.useMetrics(),h=t.useMetricsIds(),m=t.useIndexes(),b=t.useIndexesIds(),p=t.useRelationships(),g=t.useRelationshipsIds(),v=t.useQueries(),f=t.useQueriesIds();return O(u)&&W(d)&&O(c)&&W(h)&&O(m)&&W(b)&&O(p)&&W(g)&&O(v)&&W(f)?$("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the StoreInspector inside a Provider component."):$("article",{ref:l,onScroll:i},$(Ml,{s:e}),Q(d,(l=>$(Ml,{storeId:l,s:e,key:l}))),$(Rl,{s:e}),Q(h,(l=>$(Rl,{metricsId:l,s:e,key:l}))),$(xl,{s:e}),Q(b,(l=>$(xl,{indexesId:l,s:e,key:l}))),$(Pl,{s:e}),Q(g,(l=>$(Pl,{relationshipsId:l,s:e,key:l}))),$(ql,{s:e}),Q(f,(l=>$(ql,{queriesId:l,s:e,key:l}))))};class zl extends j{constructor(e){super(e),this.componentDidCatch=(e,l)=>console.error(e,l.componentStack),this.state={e:0}}render(){return this.state.e?$("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}zl.getDerivedStateFromError=()=>({e:1});const $l=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!1),[],e),r=t.useSetValueCallback(me,(e=>Number(e[k].dataset.id)),[],e);return $("header",null,$("img",{title:ie}),$("span",null,ie),Q(ue,((e,l)=>l==n?null:$("img",{onClick:r,"data-id":l,title:"Dock to "+e,key:l}))),$("img",{onClick:s,title:"Close"}))},Al=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1;return t.useValue(be,e)?$("main",{"data-position":n},$($l,{s:e}),$(zl,null,$(jl,{s:e}))):null},Fl=e=>l=>{return t=(l,t)=>l+e(t),Ul(l).reduce(t,0);var t},Jl=e=>{var l;return null!=(l=null==e?void 0:e.size)?l:0},Dl=Fl(Jl),Bl=Fl(Dl),Hl=Fl(Bl),Ql=(e,l)=>{var t;return null!=(t=null==e?void 0:e.has(l))&&t},Wl=e=>O(e)||0==Jl(e),Ul=e=>{var l;return[...null!=(l=null==e?void 0:e.values())?l:[]]},Gl=e=>e.clear(),Kl=(e,l)=>null==e?void 0:e.forEach(l),Xl=(e,l)=>null==e?void 0:e.delete(l),Yl=e=>new Map(e),Zl=e=>{var l;return[...null!=(l=null==e?void 0:e.keys())?l:[]]},_l=(e,l)=>null==e?void 0:e.get(l),et=(e,l)=>Kl(e,((e,t)=>l(t,e))),lt=(e,l,t)=>O(t)?(Xl(e,l),e):null==e?void 0:e.set(l,t),tt=(e,l,t)=>(Ql(e,l)||lt(e,l,t()),_l(e,l)),nt=(e,l,t,n=lt)=>(ne(l,((l,n)=>t(e,n,l))),et(e,(t=>le(l,t)?0:n(e,t))),e),st=(e,l,t)=>{const n={};return Kl(e,((e,s)=>{const r=l?l(e,s):e;!(null==t?void 0:t(r,e))&&(n[s]=r)})),n},rt=(e,l,t)=>st(e,(e=>st(e,l,t)),se),ot=(e,l,t)=>st(e,(e=>rt(e,l,t)),se),at=(e,l)=>{const t=Yl();return Kl(e,((e,n)=>{var s;return t.set(n,null!=(s=null==l?void 0:l(e))?s:e)})),t},it=e=>at(e,at),ut=e=>at(e,it),dt=(e,l,t,n,s=0)=>q((t?tt:_l)(e,l[s],s>M(l)-2?t:Yl),(r=>{if(s>M(l)-2)return(null==n?void 0:n(r))&<(e,l[s]),r;const o=dt(r,l,t,n,s+1);return Wl(r)&<(e,l[s]),o}));var ct=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{a(t.next(e))}catch(e){s(e)}},o=e=>{try{a(t.throw(e))}catch(e){s(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);a((t=t.apply(e,l)).next())}));const ht=Yl(),mt=Yl();var bt=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{a(t.next(e))}catch(e){s(e)}},o=e=>{try{a(t.throw(e))}catch(e){s(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);a((t=t.apply(e,l)).next())}));const pt="storage",gt=globalThis.window,vt=e=>new Set(E(e)||O(e)?e:[e]),ft=(e,l)=>null==e?void 0:e.add(l),It=/^\d+$/,yt=()=>{const e=[];let l=0;return[t=>{var n;return null!=(n=t?G(e):null)?n:s+l++},l=>{It.test(l)&&M(e)<1e3&&U(e,l)}]},wt=e=>[e,e],Ct=(e,l=Dl)=>l(e[0])+l(e[1]),kt=()=>[Yl(),Yl()],Tt=e=>[...e],St=([e,l])=>e===l,xt=(e,l,t)=>O(e)||!_(e)||se(e)||Y(e)?(null==t||t(),!1):(ne(e,((t,n)=>{l(t,n)||te(e,n)})),!se(e)),Vt=(e,l,t)=>lt(e,l,_l(e,l)==-t?void 0:t),Rt=()=>{let e,l,t=!1,n=!1,r=0;const o=Yl(),i=Yl(),c=Yl(),k=Yl(),T=Yl(),x=Yl(),V=Yl(),R=Yl(),E=Yl(),j=Yl(),z=Yl(),$=Yl(),A=Yl(),F=Yl(),J=vt(),D=Yl(),B=Yl(),W=Yl(),G=Yl(),K=kt(),X=kt(),Y=kt(),_=kt(),ee=kt(),ae=kt(),ie=kt(),ue=kt(),de=kt(),ce=kt(),he=kt(),me=kt(),be=kt(),pe=kt(),ge=kt(),ve=Yl(),fe=kt(),[Ie,ye,we,Ce]=(e=>{let l;const[t,n]=yt(),r=Yl();return[(e,n,o,a=[],i=(()=>[]))=>{null!=l||(l=Al);const u=t(1);return lt(r,u,[e,n,o,a,i]),ft(dt(n,null!=o?o:[s],vt),u),u},(e,t,...n)=>H(((e,l=[s])=>{const t=[],n=(e,s)=>s==M(l)?U(t,e):null===l[s]?Kl(e,(e=>n(e,s+1))):H([l[s],null],(l=>n(_l(e,l),s+1)));return n(e,0),t})(e,t),(e=>Kl(e,(e=>_l(r,e)[0](l,...null!=t?t:[],...n))))),e=>q(_l(r,e),(([,l,t])=>(dt(l,null!=t?t:[s],void 0,(l=>(Xl(l,e),Wl(l)?1:0))),lt(r,e),n(e),t))),e=>q(_l(r,e),(([e,,t=[],n,s])=>{const r=(...o)=>{var a,i;const u=M(o);u==M(t)?e(l,...o,...s(o)):O(t[u])?H(null!=(i=null==(a=n[u])?void 0:a.call(n,...o))?i:[],(e=>r(...o,e))):r(...o,t[u])};r()}))]})(),ke=e=>{if(!xt(e,((e,l)=>[u,d].includes(l))))return!1;const l=e[u];return!(!N(l)&&l!=a||(Je(e[d])!=l&&te(e,d),0))},Te=(l,t)=>(!e||Ql(z,t)||nl(t))&&xt(l,((e,l)=>Se(t,l,e)),(()=>nl(t))),Se=(e,l,t,n)=>xt(n?t:Oe(t,e,l),((n,s)=>q(xe(e,l,s,n),(e=>(t[s]=e,!0)),(()=>!1))),(()=>nl(e,l))),xe=(l,t,n,s)=>e?q(_l(_l(z,l),n),(e=>Je(s)!=e[u]?nl(l,t,n,s,e[d]):s),(()=>nl(l,t,n,s))):O(Je(s))?nl(l,t,n,s):s,Ve=(e,l)=>xt(l?e:qe(e),((l,t)=>q(Re(t,l),(l=>(e[t]=l,!0)),(()=>!1))),(()=>sl())),Re=(e,t)=>l?q(_l(A,e),(l=>Je(t)!=l[u]?sl(e,t,l[d]):t),(()=>sl(e,t))):O(Je(t))?sl(e,t):t,Oe=(e,l,t)=>(q(_l($,l),(([n,s])=>{Kl(n,((l,t)=>{le(e,t)||(e[t]=l)})),Kl(s,(n=>{le(e,n)||nl(l,t,n)}))})),e),qe=e=>(l&&(Kl(F,((l,t)=>{le(e,t)||(e[t]=l)})),Kl(J,(l=>{le(e,l)||sl(l)}))),e),Ne=e=>nt(z,e,((e,l,t)=>{const n=Yl(),s=vt();nt(tt(z,l,Yl),t,((e,l,t)=>{lt(e,l,t),q(t[d],(e=>lt(n,l,e)),(()=>ft(s,l)))})),lt($,l,[n,s])}),((e,l)=>{lt(z,l),lt($,l)})),Pe=e=>nt(A,e,((e,l,t)=>{lt(A,l,t),q(t[d],(e=>lt(F,l,e)),(()=>ft(J,l)))}),((e,l)=>{lt(A,l),lt(F,l),Xl(J,l)})),Ee=e=>se(e)?ql():Sl(e),Le=e=>nt(W,e,((e,l,t)=>Me(l,t)),((e,l)=>Ue(l))),Me=(e,l)=>nt(tt(W,e,(()=>(Ye(e,1),lt(D,e,yt()),lt(B,e,Yl()),Yl()))),l,((l,t,n)=>je(e,l,t,n)),((l,t)=>Ge(e,l,t))),je=(e,l,t,n,s)=>nt(tt(l,t,(()=>(Ze(e,t,1),Yl()))),n,((l,n,s)=>ze(e,t,l,n,s)),((n,r)=>Ke(e,l,t,n,r,s))),ze=(e,l,t,n,s)=>{Ql(t,n)||_e(e,l,n,1);const r=_l(t,n);s!==r&&(el(e,l,n,r,s),lt(t,n,s))},$e=(e,l,t,n,s)=>q(_l(l,t),(l=>ze(e,t,l,n,s)),(()=>je(e,l,t,Oe({[n]:s},e,t)))),Ae=e=>se(e)?El():xl(e),Fe=e=>nt(G,e,((e,l,t)=>He(l,t)),((e,l)=>Xe(l))),He=(e,l)=>{Ql(G,e)||ll(e,1);const t=_l(G,e);l!==t&&(tl(e,t,l),lt(G,e,l))},Qe=(e,l)=>{const[t]=_l(D,e),n=t(l);return Ql(_l(W,e),n)?Qe(e,l):n},We=e=>{var l;return null!=(l=_l(W,e))?l:Me(e,{})},Ue=e=>Me(e,{}),Ge=(e,l,t)=>{const[,n]=_l(D,e);n(t),je(e,l,t,{},!0)},Ke=(e,l,t,n,s,r)=>{var o;const a=_l(null==(o=_l($,e))?void 0:o[0],s);if(!O(a)&&!r)return ze(e,t,n,s,a);const i=l=>{el(e,t,l,_l(n,l)),_e(e,t,l,-1),lt(n,l)};O(a)?i(s):et(n,i),Wl(n)&&(Ze(e,t,-1),Wl(lt(l,t))&&(Ye(e,-1),lt(W,e),lt(D,e),lt(B,e)))},Xe=e=>{const l=_l(F,e);if(!O(l))return He(e,l);tl(e,_l(G,e)),ll(e,-1),lt(G,e)},Ye=(e,l)=>Vt(o,e,l),Ze=(e,l,t)=>Vt(tt(k,e,Yl),l,t)&<(c,e,tt(c,e,(()=>0))+t),_e=(e,l,t,n)=>{var s;const r=_l(B,e),o=null!=(s=_l(r,t))?s:0;(0==o&&1==n||1==o&&-1==n)&&Vt(tt(i,e,Yl),t,n),lt(r,t,o!=-n?o+n:null),Vt(tt(tt(T,e,Yl),l,Yl),t,n)},el=(e,l,t,n,s)=>tt(tt(tt(x,e,Yl),l,Yl),t,(()=>[n,0]))[1]=s,ll=(e,l)=>Vt(V,e,l),tl=(e,l,t)=>tt(R,e,(()=>[l,0]))[1]=t,nl=(e,l,t,n,s)=>(U(tt(tt(tt(E,e,Yl),l,Yl),t,(()=>[])),n),s),sl=(e,l,t)=>(U(tt(j,e,(()=>[])),l),t),rl=(e,l,t)=>q(_l(_l(_l(x,e),l),t),(([e,l])=>[!0,e,l]),(()=>[!1,...wt(wl(e,l,t))])),ol=e=>q(_l(R,e),(([e,l])=>[!0,e,l]),(()=>[!1,...wt(Tl(e))])),al=e=>Wl(E)||Wl(he[e])?0:Kl(e?ut(E):E,((l,t)=>Kl(l,((l,n)=>Kl(l,((l,s)=>ye(he[e],[t,n,s],l))))))),il=e=>Wl(j)||Wl(me[e])?0:Kl(e?at(j):j,((l,t)=>ye(me[e],[t],l))),ul=(e,l,t)=>{if(!Wl(l))return ye(e,t,(()=>st(l))),1},dl=e=>{const l=Wl(ie[e]),t=Wl(de[e])&&Wl(_[e])&&Wl(ee[e])&&Wl(ae[e])&&l&&Wl(X[e]),n=Wl(ce[e])&&Wl(ue[e])&&Wl(Y[e])&&Wl(K[e]);if(!t||!n){const s=e?[at(o),it(i),at(c),it(k),ut(T),ut(x)]:[o,i,c,k,T,x];if(!t){ul(X[e],s[0]),Kl(s[1],((l,t)=>ul(_[e],l,[t]))),Kl(s[2],((l,t)=>{0!=l&&ye(ee[e],[t],vl(t))}));const t=vt();Kl(s[3],((n,s)=>{ul(ae[e],n,[s])&&!l&&(ye(ie[e],[s,null]),ft(t,s))})),l||Kl(s[5],((l,n)=>{if(!Ql(t,n)){const t=vt();Kl(l,(e=>Kl(e,(([l,n],s)=>n!==l?ft(t,s):Xl(e,s))))),Kl(t,(l=>ye(ie[e],[n,l])))}})),Kl(s[4],((l,t)=>Kl(l,((l,n)=>ul(de[e],l,[t,n])))))}if(!n){let l;Kl(s[5],((t,n)=>{let s;Kl(t,((t,r)=>{let o;Kl(t,(([t,a],i)=>{a!==t&&(ye(ce[e],[n,r,i],a,t,rl),l=s=o=1)})),o&&ye(ue[e],[n,r],rl)})),s&&ye(Y[e],[n],rl)})),l&&ye(K[e],void 0,rl)}}},cl=e=>{const l=Wl(pe[e]),t=Wl(ge[e])&&Wl(be[e]);if(!l||!t){const n=e?[at(V),at(R)]:[V,R];if(l||ul(pe[e],n[0]),!t){let l;Kl(n[1],(([t,n],s)=>{n!==t&&(ye(ge[e],[s],n,t,ol),l=1)})),l&&ye(be[e],void 0,ol)}}},hl=(e,...l)=>(jl((()=>e(...Q(l,S)))),Al),ml=()=>[st(x,((e,l)=>-1===_l(o,l)?null:st(e,((e,t)=>-1===_l(_l(k,l),t)?null:st(e,(([,e])=>null!=e?e:null),((e,l)=>St(l)))),se)),se),st(R,(([,e])=>null!=e?e:null),((e,l)=>St(l)))],bl=()=>({cellsTouched:t,valuesTouched:n,changedCells:ot(x,Tt,St),invalidCells:ot(E),changedValues:st(R,Tt,St),invalidValues:st(j),changedTableIds:st(o),changedRowIds:rt(k),changedCellIds:ot(T),changedValueIds:st(V)}),pl=()=>ot(W),gl=()=>Zl(W),vl=e=>Jl(_l(W,S(e))),fl=e=>Zl(_l(W,S(e))),Il=(e,l,t,n=0,s)=>{return Q(L((o=_l(W,S(e)),a=(e,t)=>[O(l)?t:_l(e,S(l)),t],r=([e],[l])=>{return((null!=(n=e)?n:0)<(null!=(s=l)?s:0)?-1:1)*(t?-1:1);var n,s},Q([...null!=(i=null==o?void 0:o.entries())?i:[]],(([e,l])=>a(l,e))).sort(r)),n,O(s)?s:n+s),(([,e])=>e));var r,o,a,i},yl=(e,l)=>Zl(_l(_l(W,S(e)),S(l))),wl=(e,l,t)=>_l(_l(_l(W,S(e)),S(l)),S(t)),Cl=()=>st(G),kl=()=>Zl(G),Tl=e=>_l(G,S(e)),Sl=e=>hl((()=>(e=>xt(e,Te,nl))(e)?Le(e):0)),xl=e=>hl((()=>Ve(e)?Fe(e):0)),Vl=e=>{try{Ee(oe(e))}catch(e){}return Al},Rl=l=>hl((()=>{if((e=xt(l,(e=>xt(e,ke))))&&(Ne(l),!Wl(W))){const e=pl();ql(),Sl(e)}})),Ol=e=>hl((()=>{if(l=(e=>xt(e,ke))(e)){const t=Cl();Ml(),El(),l=!0,Pe(e),xl(t)}})),ql=()=>hl((()=>Le({}))),Nl=e=>hl((e=>Ql(W,e)?Ue(e):0),e),Pl=(e,l)=>hl(((e,l)=>q(_l(W,e),(t=>Ql(t,l)?Ge(e,t,l):0))),e,l),El=()=>hl((()=>Fe({}))),Ll=()=>hl((()=>{Ne({}),e=!1})),Ml=()=>hl((()=>{Pe({}),l=!1})),jl=(e,l)=>{if(-1!=r){zl();const t=e();return $l(l),t}},zl=()=>(-1!=r&&r++,1==r&&ye(ve,void 0,ml,bl),Al),$l=e=>(r>0&&(r--,0==r&&(t=!Wl(x),n=!Wl(R),r=1,al(1),t&&dl(1),il(1),n&&cl(1),(null==e?void 0:e(ml,bl))&&(Kl(x,((e,l)=>Kl(e,((e,t)=>Kl(e,(([e],n)=>De(Al,l,t,n,e))))))),Kl(R,(([e],l)=>Be(Al,l,e))),t=n=!1),ye(fe[0],void 0,ml,bl),r=-1,al(0),t&&dl(0),il(0),n&&cl(0),ye(fe[1],void 0,ml,bl),r=0,t=n=!1,H([o,i,c,k,T,x,E,V,R,j],Gl))),Al),Al={getContent:()=>[pl(),Cl()],getTables:pl,getTableIds:gl,getTable:e=>rt(_l(W,S(e))),getTableCellIds:e=>Zl(_l(B,S(e))),getRowCount:vl,getRowIds:fl,getSortedRowIds:Il,getRow:(e,l)=>st(_l(_l(W,S(e)),S(l))),getCellIds:yl,getCell:wl,getValues:Cl,getValueIds:kl,getValue:Tl,hasTables:()=>!Wl(W),hasTable:e=>Ql(W,S(e)),hasTableCell:(e,l)=>Ql(_l(B,S(e)),S(l)),hasRow:(e,l)=>Ql(_l(W,S(e)),S(l)),hasCell:(e,l,t)=>Ql(_l(_l(W,S(e)),S(l)),S(t)),hasValues:()=>!Wl(G),hasValue:e=>Ql(G,S(e)),getTablesJson:()=>re(W),getValuesJson:()=>re(G),getJson:()=>re([W,G]),getTablesSchemaJson:()=>re(z),getValuesSchemaJson:()=>re(A),getSchemaJson:()=>re([z,A]),hasTablesSchema:()=>e,hasValuesSchema:()=>l,setContent:([e,l])=>hl((()=>{(se(e)?ql:Sl)(e),(se(l)?El:xl)(l)})),setTables:Sl,setTable:(e,l)=>hl((e=>Te(l,e)?Me(e,l):0),e),setRow:(e,l,t)=>hl(((e,l)=>Se(e,l,t)?je(e,We(e),l,t):0),e,l),addRow:(e,l,t=!0)=>jl((()=>{let n;return Se(e,n,l)&&(e=S(e),je(e,We(e),n=Qe(e,t?1:0),l)),n})),setPartialRow:(e,l,t)=>hl(((e,l)=>{if(Se(e,l,t,1)){const n=We(e);ne(t,((t,s)=>$e(e,n,l,s,t)))}}),e,l),setCell:(e,l,t,n)=>hl(((e,l,t)=>q(xe(e,l,t,P(n)?n(wl(e,l,t)):n),(n=>$e(e,We(e),l,t,n)))),e,l,t),setValues:xl,setPartialValues:e=>hl((()=>Ve(e,1)?ne(e,((e,l)=>He(l,e))):0)),setValue:(e,l)=>hl((e=>q(Re(e,P(l)?l(Tl(e)):l),(l=>He(e,l)))),e),setTransactionChanges:e=>hl((()=>{ne(e[0],((e,l)=>O(e)?Nl(l):ne(e,((e,t)=>O(e)?Pl(l,t):ne(e,((e,n)=>De(Al,l,t,n,e))))))),ne(e[1],((e,l)=>Be(Al,l,e)))})),setTablesJson:Vl,setValuesJson:e=>{try{Ae(oe(e))}catch(e){}return Al},setJson:e=>hl((()=>{try{const[l,t]=oe(e);Ee(l),Ae(t)}catch(l){Vl(e)}})),setTablesSchema:Rl,setValuesSchema:Ol,setSchema:(e,l)=>hl((()=>{Rl(e),Ol(l)})),delTables:ql,delTable:Nl,delRow:Pl,delCell:(e,l,t,n)=>hl(((e,l,t)=>q(_l(W,e),(s=>q(_l(s,l),(r=>Ql(r,t)?Ke(e,s,l,r,t,n):0))))),e,l,t),delValues:El,delValue:e=>hl((e=>Ql(G,e)?Xe(e):0),e),delTablesSchema:Ll,delValuesSchema:Ml,delSchema:()=>hl((()=>{Ll(),Ml()})),transaction:jl,startTransaction:zl,finishTransaction:$l,forEachTable:e=>Kl(W,((l,t)=>e(t,(e=>Kl(l,((l,t)=>e(t,(e=>et(l,e))))))))),forEachTableCell:(e,l)=>et(_l(B,S(e)),l),forEachRow:(e,l)=>Kl(_l(W,S(e)),((e,t)=>l(t,(l=>et(e,l))))),forEachCell:(e,l,t)=>et(_l(_l(W,S(e)),S(l)),t),forEachValue:e=>et(G,e),addSortedRowIdsListener:(e,l,t,n,s,r,o)=>{let a=Il(e,l,t,n,s);return Ie((()=>{const o=Il(e,l,t,n,s);var i,u,d;u=a,M(i=o)===M(u)&&(d=(e,l)=>u[l]===e,i.every(d))||(a=o,r(Al,e,l,t,n,s,a))}),ie[o?1:0],[e,l],[gl])},addStartTransactionListener:e=>Ie(e,ve),addWillFinishTransactionListener:e=>Ie(e,fe[0]),addDidFinishTransactionListener:e=>Ie(e,fe[1]),callListener:e=>(Ce(e),Al),delListener:e=>(we(e),Al),getListenerStats:()=>({tables:Ct(K),tableIds:Ct(X),tableCellIds:Ct(_),table:Ct(Y),rowCount:Ct(ee),rowIds:Ct(ae),sortedRowIds:Ct(ie),row:Ct(ue,Bl),cellIds:Ct(de,Bl),cell:Ct(ce,Hl),invalidCell:Ct(he,Hl),values:Ct(be),valueIds:Ct(pe),value:Ct(ge),invalidValue:Ct(me),transaction:Dl(ve)+Ct(fe)}),createStore:Rt,addListener:Ie,callListeners:ye};return ne({[m]:[0,K],[b]:[0,X],[h]:[1,Y,[gl]],[h+I]:[1,_,[gl]],[g]:[1,ee,[gl]],[v]:[1,ae,[gl]],[p]:[2,ue,[gl,fl]],[I]:[2,de,[gl,fl]],[f]:[3,ce,[gl,fl,yl],e=>wt(wl(...e))],InvalidCell:[3,he],[w]:[0,be],[C]:[0,pe],[y]:[1,ge,[kl],e=>wt(Tl(e[0]))],InvalidValue:[1,me]},(([e,l,t,n],s)=>{Al["add"+s+"Listener"]=(...s)=>Ie(s[e],l[s[e+1]?1:0],e>0?L(s,0,e):void 0,t,n)})),Z(Al)},Ot=({position:e="right",open:l=!1})=>{const n=t.useCreateStore(Rt),s=ue.indexOf(e);return t.useCreatePersister(n,(e=>{return((e,l,t,n)=>((e,l,t,n,s,r,[o,a]=[],i=[])=>{let u,d,c,h=0,m=0,b=0,p=0;tt(ht,i,(()=>0)),tt(mt,i,(()=>[]));const g=e=>ct(void 0,null,(function*(){return 2!=h&&(h=1,m++,yield v.schedule((()=>ct(void 0,null,(function*(){yield e(),h=0}))))),v})),v={load:(t,n)=>ct(void 0,null,(function*(){return yield g((()=>ct(void 0,null,(function*(){try{e.setContent(yield l())}catch(l){e.setContent([t,n])}}))))})),startAutoLoad:(...t)=>ct(void 0,[...t],(function*(t={},s={}){return v.stopAutoLoad(),yield v.load(t,s),p=1,c=n(((t,n)=>ct(void 0,null,(function*(){if(n){const l=n();yield g((()=>ct(void 0,null,(function*(){return e.setTransactionChanges(l)}))))}else yield g((()=>ct(void 0,null,(function*(){var n;try{e.setContent(null!=(n=null==t?void 0:t())?n:yield l())}catch(e){null==r||r(e)}}))))})))),v})),stopAutoLoad:()=>(p&&(s(c),c=void 0,p=0),v),save:l=>ct(void 0,null,(function*(){return 1!=h&&(h=2,b++,yield v.schedule((()=>ct(void 0,null,(function*(){try{yield t(e.getContent,l)}catch(e){null==r||r(e)}h=0}))))),v})),startAutoSave:()=>ct(void 0,null,(function*(){return yield v.stopAutoSave().save(),u=e.addDidFinishTransactionListener(((e,l)=>{const[t,n]=l();se(t)&&se(n)||v.save((()=>[t,n]))})),v})),stopAutoSave:()=>(q(u,e.delListener),v),schedule:(...e)=>ct(void 0,null,(function*(){return U(_l(mt,i),...e),yield ct(void 0,null,(function*(){if(!_l(ht,i)){for(lt(ht,i,1);!O(d=G(_l(mt,i)));)try{yield d()}catch(e){null==r||r(e)}lt(ht,i,0)}})),v})),getStore:()=>e,destroy:()=>v.stopAutoLoad().stopAutoSave(),getStats:()=>({loads:m,saves:b})};return o&&(v[o]=()=>a),Z(v)})(e,(()=>bt(void 0,null,(function*(){return oe(t.getItem(l))}))),(e=>bt(void 0,null,(function*(){return t.setItem(l,re(e()))}))),(e=>{const n=n=>{n.storageArea===t&&n.key===l&&e((()=>oe(n.newValue)))};return gt.addEventListener(pt,n),n}),(e=>gt.removeEventListener(pt,e)),n,["getStorageName",l]))(e,ae,sessionStorage,l);var l}),void 0,(e=>{return t=function*(){yield e.load(void 0,{position:-1==s?1:s,open:!!l}),yield e.startAutoSave()},new Promise(((e,l)=>{var n=e=>{try{r(t.next(e))}catch(e){l(e)}},s=e=>{try{r(t.throw(e))}catch(e){l(e)}},r=l=>l.done?e(l.value):Promise.resolve(l.value).then(n,s);r((t=t.apply(void 0,null)).next())}));var t})),$(z,null,$("aside",{id:ae},$(Ae,{s:n}),$(Al,{s:n})),$("style",null,$e))};var qt=Object.defineProperty,Nt=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Lt=(e,l,t)=>l in e?qt(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t;e.EditableCellView=wl,e.EditableValueView=Cl,e.RelationshipInHtmlTable=Il,e.ResultSortedTableInHtmlTable=yl,e.ResultTableInHtmlTable=e=>{var l=e,{queryId:n,queries:s,customCells:r}=l,o=el(l,["queryId","queries","customCells"]);return $(hl,_e(Ze({},o),{params:al(cl(t.useResultTableCellIds(n,s),r,t.ResultCellView),ul(s,n),t.useResultRowIds(n,s))}))},e.SliceInHtmlTable=fl,e.SortedTableInHtmlTable=gl,e.SortedTablePaginator=kl,e.StoreInspector=e=>$(Ot,((e,l)=>{for(var t in l||(l={}))Pt.call(l,t)&&Lt(e,t,l[t]);if(Nt)for(var t of Nt(l))Et.call(l,t)&&Lt(e,t,l[t]);return e})({},e)),e.TableInHtmlTable=e=>{var l=e,{tableId:n,store:s,editable:r,customCells:o}=l,a=el(l,["tableId","store","editable","customCells"]);return $(hl,_e(Ze({},a),{params:al(cl(t.useTableCellIds(n,s),o,r?wl:t.CellView),il(s,n),t.useRowIds(n,s))}))},e.ValuesInHtmlTable=vl},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDomDebug={},e.React,e.TinyBaseUiReact);
|
|
1
|
+
var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,s="",r=n(s),o=n(!0),a=n(0),i=n(n),u="type",d="default",c="Ids",h="Table",m=h+"s",b=h+c,p="Row",g=p+"Count",v=p+c,f="Cell",I=f+c,y="Value",w=y+"s",C=y+c,k="currentTarget",T="value",S=e=>s+e,x=Math.floor,V=isFinite,R=(e,l)=>e instanceof l,O=e=>null==e,q=(e,l,t)=>O(e)?null==t?void 0:t():l(e),N=e=>e==r||e==o,P=e=>n(e)==i,E=e=>Array.isArray(e),L=(e,l,t)=>e.slice(l,t),M=e=>e.length,{PureComponent:j,Fragment:z,createElement:$,useCallback:A,useLayoutEffect:F,useRef:J,useState:D}=l,B=(e,...l)=>O(e)?{}:e(...l),H=(e,l)=>e.forEach(l),Q=(e,l)=>e.map(l),W=e=>0==M(e),U=(e,...l)=>e.push(...l),G=e=>e.shift(),K=Object,X=K.keys,Y=K.isFrozen,Z=K.freeze,_=e=>R(e,K)&&e.constructor==K,ee=(e=[])=>K.fromEntries(e),le=(e,l)=>!O(((e,l)=>q(e,(e=>e[l])))(e,l)),te=(e,l)=>(delete e[l],e),ne=(e,l)=>Q(K.entries(e),(([e,t])=>l(t,e))),se=e=>_(e)&&0==(e=>M(X(e)))(e),re=e=>JSON.stringify(e,((e,l)=>R(l,Map)?K.fromEntries([...l]):l)),oe=JSON.parse,ae="tinybaseStoreInspector",ie="TinyBase Store Inspector",ue=["left","top","bottom","right","full"],de="state",ce="sort",he="open",me="position",be=he,pe="editable",ge=(...e)=>re(e),ve=(e,l)=>Q(e.sort(),l),fe=(e,l)=>[!!t.useCell(de,e,pe,l),A((t=>{l.setCell(de,e,pe,(e=>!e)),t.preventDefault()}),[l,e])],Ie="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",ye='content:url("',we=ye+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",Ce='</svg>")',ke=ye+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",Te=Q([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,l,t,n])=>we+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${l}' width='${t}' height='${n}' fill='white'/>`+Ce)),Se=we+"<path d='M20 20l60 60M20 80l60-60' />"+Ce,xe=we+`<path d='${Ie}' />`+Ce,Ve=we+`<path d='${Ie}M20 20l60 60' />`+Ce;var Re=Object.defineProperty,Oe=Object.defineProperties,qe=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Le=(e,l,t)=>l in e?Re(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Me=(e,l)=>{for(var t in l||(l={}))Pe.call(l,t)&&Le(e,t,l[t]);if(Ne)for(var t of Ne(l))Ee.call(l,t)&&Le(e,t,l[t]);return e},je=(e,l)=>Oe(e,qe(l));const ze="*::-webkit-scrollbar",$e=`#${ae}{\n all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999;\n ${((e,l="")=>e.join(l))(ne(je(Me(je(Me(je(Me({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[ze]:"width:0.5rem;height:0.5rem;",[ze+"-track"]:"background:#111",[ze+"-thumb"]:"background:#999;border:1px solid #111",[ze+"-thumb:hover"]:"background:#fff",[ze+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+ke},ee(Q(["bottom:0;left:0","top:0;right:0"],((e,l)=>[`>img[data-position='${l}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),ee(Q(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,l)=>[`main[data-position='${l}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":ke,"header>img:nth-of-type(6)":Se}),ee(Q(Te,((e,l)=>[`header>img[data-id='${l}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":xe,"details[open]>summary img.done":Ve,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,l)=>e?`& ${l}{${e}}`:"")))}`,Ae=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!0),[],e);return t.useValue(be,e)?null:$("img",{onClick:s,title:ie,"data-position":n})},Fe=({uniqueId:e,summary:l,editable:n,handleEditable:s,children:r,s:o})=>{const a=!!t.useCell(de,e,he,o),i=t.useSetCellCallback(de,e,he,(e=>e[k].open),[],o);return $("details",{open:a,onToggle:i},$("summary",null,l,s?$("img",{onClick:s,className:n?"done":"edit"}):null),r)},Je=e=>{const l=n(e);return N(l)||l==a&&V(e)?l:void 0},De=(e,l,t,n,s)=>O(s)?e.delCell(l,t,n,!0):e.setCell(l,t,n,s),Be=(e,l,t)=>O(t)?e.delValue(l):e.setValue(l,t),He=(e,l,t,n)=>e==r?l:e==a?t:n;var Qe=Object.defineProperty,We=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Ye=(e,l,t)=>l in e?Qe(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Ze=(e,l)=>{for(var t in l||(l={}))Ke.call(l,t)&&Ye(e,t,l[t]);if(Ge)for(var t of Ge(l))Xe.call(l,t)&&Ye(e,t,l[t]);return e},_e=(e,l)=>We(e,Ue(l)),el=(e,l)=>{var t={};for(var n in e)Ke.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&Ge)for(var n of Ge(e))l.indexOf(n)<0&&Xe.call(e,n)&&(t[n]=e[n]);return t};const{useCallback:ll,useMemo:tl,useState:nl}=l,sl="editable",rl=(e,l)=>Q(t.useTableCellIds(e,l),(l=>e+"."+l)),ol=(e,l,t)=>{const n=ll(e,l);return t?n:void 0},al=(...e)=>tl((()=>e),e),il=(e,l)=>tl((()=>({store:e,tableId:l})),[e,l]),ul=(e,l)=>tl((()=>({queries:e,queryId:l})),[e,l]),dl=(e,l=!1,t,n=0,s,r,o,a)=>{const[[i,u,d],c]=nl([e,l,n]),h=ll((e=>{c(e),null==a||a(e)}),[a]),m=ol((e=>h([e,e==i&&!u,d])),[h,i,u,d],t),b=ll((e=>h([i,u,e])),[h,i,u]),p=!0===o?kl:o;return[[i,u,d],m,tl((()=>!1===o?null:$(p,{offset:d,limit:s,total:r,onChange:b})),[o,p,d,s,r,b])]},cl=(e,l,t)=>tl((()=>{const s=null!=l?l:e;return ee(ne(E(s)?ee(Q(s,(e=>[e,e]))):s,((e,l)=>{return[l,Ze(Ze({},{label:l,component:t}),(s=e,n(s)==r?{label:e}:e))];var s})))}),[l,t,e]),hl=({className:e,headerRow:l,idColumn:t,params:[n,s,r,o,a,i]})=>$("table",{className:e},i?$("caption",null,i):null,!1===l?null:$("thead",null,$("tr",null,!1===t?null:$(ml,{sort:null!=o?o:[],label:"Id",onClick:a}),ne(n,(({label:e},l)=>$(ml,{key:l,cellId:l,label:e,sort:null!=o?o:[],onClick:a}))))),$("tbody",null,Q(r,(e=>$("tr",{key:e},!1===t?null:$("th",null,e),ne(n,(({component:l,getComponentProps:t},n)=>$("td",{key:n},$(l,_e(Ze(Ze({},B(t,e,n)),s),{rowId:e,cellId:n})))))))))),ml=({cellId:e,sort:[l,t],label:n=(null!=e?e:s),onClick:r})=>$("th",{onClick:ol((()=>null==r?void 0:r(e)),[r,e],r),className:O(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},O(t)||l!=e?null:(t?"↓":"↑")+" ",n),bl=({localRowId:e,params:[n,s,r,o,a,i,u]})=>{const d=t.useRemoteRowId(a,e,i);return $("tr",null,!1===n?null:$(l.Fragment,null,$("th",null,e),$("th",null,d)),ne(s,(({component:l,getComponentProps:t},n)=>{const[s,a]=n.split(".",2),i=s===r?e:s===o?d:null;return O(i)?null:$("td",{key:n},$(l,_e(Ze({},B(t,i,a)),{store:u,tableId:s,rowId:i,cellId:a})))})))},pl=({thing:e,onThingChange:l,className:t,hasSchema:n,showType:s=!0})=>{const[i,u]=nl(),[d,c]=nl(),[h,m]=nl(),[b,p]=nl(),[g,v]=nl();d!==e&&(u(Je(e)),c(e),m(e+""),p(Number(e)||0),v(!!e));const f=ll(((e,t)=>{t(e),c(e),l(e)}),[l]),I=ll((()=>{if(!(null==n?void 0:n())){const e=He(i,a,o,r),t=He(e,h,b,g);u(e),c(t),l(t)}}),[n,l,h,b,g,i]);return $("div",{className:t},s?$("button",{className:i,onClick:I},i):null,He(i,$("input",{key:i,value:h,onChange:ll((e=>f(e[k][T]+"",m)),[f])}),$("input",{key:i,type:"number",value:b,onChange:ll((e=>f(Number(e[k][T]||0),p)),[f])}),$("input",{key:i,type:"checkbox",checked:g,onChange:ll((e=>f(!!e[k].checked,v)),[f])})))},gl=e=>{var l=e,{tableId:n,cellId:s,descending:r,offset:o,limit:a,store:i,editable:u,sortOnClick:d,paginator:c=!1,onChange:h,customCells:m}=l,b=el(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[p,g,v]=dl(s,r,d,o,a,t.useRowCount(n,i),c,h);return $(hl,_e(Ze({},b),{params:al(cl(t.useTableCellIds(n,i),m,u?wl:t.CellView),il(i,n),t.useSortedRowIds(n,...p,a,i),p,g,v)}))},vl=({store:e,editable:l=!1,valueComponent:n=(l?Cl:t.ValueView),getValueComponentProps:s,className:r,headerRow:o,idColumn:a})=>$("table",{className:r},!1===o?null:$("thead",null,$("tr",null,!1===a?null:$("th",null,"Id"),$("th",null,y))),$("tbody",null,Q(t.useValueIds(e),(l=>$("tr",{key:l},!1===a?null:$("th",null,l),$("td",null,$(n,_e(Ze({},B(s,l)),{valueId:l,store:e})))))))),fl=e=>{var l=e,{indexId:n,sliceId:s,indexes:r,editable:o,customCells:a}=l,i=el(l,["indexId","sliceId","indexes","editable","customCells"]);const[u,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(t.useIndexesOrIndexesById(r),n);return $(hl,_e(Ze({},i),{params:al(cl(t.useTableCellIds(c,d),a,o?wl:t.CellView),il(d,c),t.useSliceRowIds(n,s,u))}))},Il=({relationshipId:e,relationships:n,editable:s,customCells:r,className:o,headerRow:a,idColumn:i=!0})=>{const[u,d,c,h]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(t.useRelationshipsOrRelationshipsById(n),e),m=cl([...rl(c,d),...rl(h,d)],r,s?wl:t.CellView),b=al(i,m,c,h,e,u,d);return $("table",{className:o},!1===a?null:$("thead",null,$("tr",null,!1===i?null:$(l.Fragment,null,$("th",null,c,".Id"),$("th",null,h,".Id")),ne(m,(({label:e},l)=>$("th",{key:l},e))))),$("tbody",null,Q(t.useRowIds(c,d),(e=>$(bl,{key:e,localRowId:e,params:b})))))},yl=e=>{var l=e,{queryId:n,cellId:s,descending:r,offset:o,limit:a,queries:i,sortOnClick:u,paginator:d=!1,customCells:c,onChange:h}=l,m=el(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[b,p,g]=dl(s,r,u,o,a,t.useResultRowCount(n,i),d,h);return $(hl,_e(Ze({},m),{params:al(cl(t.useResultTableCellIds(n,i),c,t.ResultCellView),ul(i,n),t.useResultSortedRowIds(n,...b,a,i),b,p,g)}))},wl=({tableId:e,rowId:l,cellId:n,store:s,className:r,showType:o})=>{var a;return $(pl,{thing:t.useCell(e,l,n,s),onThingChange:t.useSetCellCallback(e,l,n,(e=>e),[],s),className:null!=r?r:sl+f,showType:o,hasSchema:null==(a=t.useStoreOrStoreById(s))?void 0:a.hasTablesSchema})},Cl=({valueId:e,store:l,className:n,showType:s})=>{var r;return $(pl,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=n?n:sl+y,showType:s,hasSchema:null==(r=t.useStoreOrStoreById(l))?void 0:r.hasValuesSchema})},kl=({onChange:e,total:t,offset:n=0,limit:s=t,singular:r="row",plural:o=r+"s"})=>{(n>t||n<0)&&(n=0,e(0));const a=ol((()=>e(n-s)),[e,n,s],n>0),i=ol((()=>e(n+s)),[e,n,s],n+s<t);return $(l.Fragment,null,t>s&&$(l.Fragment,null,$("button",{className:"previous",disabled:0==n,onClick:a},"←"),$("button",{className:"next",disabled:n+s>=t,onClick:i},"→"),n+1," to ",Math.min(t,n+s)," of "),t," ",1!=t?o:r)},Tl=({indexes:e,indexesId:l,indexId:n,s:s})=>$(Fe,{uniqueId:ge("i",l,n),summary:"Index: "+n,s:s},Q(t.useSliceIds(n,e),(t=>$(Sl,{indexes:e,indexesId:l,indexId:n,sliceId:t,s:s,key:t})))),Sl=({indexes:e,indexesId:l,indexId:t,sliceId:n,s:s})=>{const r=ge("i",l,t,n),[o,a]=fe(r,s);return $(Fe,{uniqueId:r,summary:"Slice: "+n,editable:o,handleEditable:a,s:s},$(fl,{sliceId:n,indexId:t,indexes:e,editable:o}))},xl=({indexesId:e,s:l})=>{const n=t.useIndexes(e),s=t.useIndexIds(n);return O(n)?null:$(Fe,{uniqueId:ge("i",e),summary:"Indexes: "+(null!=e?e:d),s:l},W(s)?"No indexes defined":ve(s,(t=>$(Tl,{indexes:n,indexesId:e,indexId:t,s:l,key:t}))))},Vl=({metrics:e,metricId:l})=>$("tr",null,$("th",null,l),$("td",null,null==e?void 0:e.getTableId(l)),$("td",null,t.useMetric(l,e))),Rl=({metricsId:e,s:l})=>{const n=t.useMetrics(e),s=t.useMetricIds(n);return O(n)?null:$(Fe,{uniqueId:ge("m",e),summary:"Metrics: "+(null!=e?e:d),s:l},W(s)?"No metrics defined":$("table",null,$("thead",null,$("th",null,"Metric Id"),$("th",null,"Table Id"),$("th",null,"Metric")),$("tbody",null,Q(s,(e=>$(Vl,{metrics:n,metricId:e,key:e}))))))},Ol=({queries:e,queriesId:l,queryId:n,s:s})=>{var r;const o=ge("q",l,n),[a,i,u]=oe(null!=(r=t.useCell(de,o,ce,s))?r:"[]"),d=t.useSetCellCallback(de,o,ce,re,[],s);return $(Fe,{uniqueId:o,summary:"Query: "+n,s:s},$(yl,{queryId:n,queries:e,cellId:a,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d}))},ql=({queriesId:e,s:l})=>{const n=t.useQueries(e),s=t.useQueryIds(n);return O(n)?null:$(Fe,{uniqueId:ge("q",e),summary:"Queries: "+(null!=e?e:d),s:l},W(s)?"No queries defined":ve(s,(t=>$(Ol,{queries:n,queriesId:e,queryId:t,s:l,key:t}))))},Nl=({relationships:e,relationshipsId:l,relationshipId:t,s:n})=>{const s=ge("r",l,t),[r,o]=fe(s,n);return $(Fe,{uniqueId:s,summary:"Relationship: "+t,editable:r,handleEditable:o,s:n},$(Il,{relationshipId:t,relationships:e,editable:r}))},Pl=({relationshipsId:e,s:l})=>{const n=t.useRelationships(e),s=t.useRelationshipIds(n);return O(n)?null:$(Fe,{uniqueId:ge("r",e),summary:"Relationships: "+(null!=e?e:d),s:l},W(s)?"No relationships defined":ve(s,(t=>$(Nl,{relationships:n,relationshipsId:e,relationshipId:t,s:l,key:t}))))},El=({tableId:e,store:l,storeId:n,s:s})=>{var r;const o=ge("t",n,e),[a,i,u]=oe(null!=(r=t.useCell(de,o,ce,s))?r:"[]"),d=t.useSetCellCallback(de,o,ce,re,[],s),[c,m]=fe(o,s);return $(Fe,{uniqueId:o,summary:h+": "+e,editable:c,handleEditable:m,s:s},$(gl,{tableId:e,store:l,cellId:a,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d,editable:c}))},Ll=({store:e,storeId:l,s:n})=>{const s=ge("v",l),[r,o]=fe(s,n);return W(t.useValueIds(e))?null:$(Fe,{uniqueId:s,summary:w,editable:r,handleEditable:o,s:n},$(vl,{store:e,editable:r}))},Ml=({storeId:e,s:l})=>{const n=t.useStore(e),s=t.useTableIds(n);return O(n)?null:$(Fe,{uniqueId:ge("s",e),summary:"Store: "+(null!=e?e:d),s:l},$(Ll,{storeId:e,store:n,s:l}),ve(s,(t=>$(El,{store:n,storeId:e,tableId:t,s:l,key:t}))))},jl=({s:e})=>{const l=J(null),n=J(0),[s,r]=D(!1),{scrollLeft:o,scrollTop:a}=t.useValues(e);F((()=>{const e=l.current;if(e&&!s){const l=new MutationObserver((()=>{e.scrollWidth>=x(o)+e.clientWidth&&e.scrollHeight>=x(a)+e.clientHeight&&e.scrollTo(o,a)}));return l.observe(e,{childList:!0,subtree:!0}),()=>l.disconnect()}}),[s,o,a]);const i=A((l=>{const{scrollLeft:t,scrollTop:s}=l[k];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:t,scrollTop:s})}))}),[e]),u=t.useStore(),d=t.useStoreIds(),c=t.useMetrics(),h=t.useMetricsIds(),m=t.useIndexes(),b=t.useIndexesIds(),p=t.useRelationships(),g=t.useRelationshipsIds(),v=t.useQueries(),f=t.useQueriesIds();return O(u)&&W(d)&&O(c)&&W(h)&&O(m)&&W(b)&&O(p)&&W(g)&&O(v)&&W(f)?$("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the StoreInspector inside a Provider component."):$("article",{ref:l,onScroll:i},$(Ml,{s:e}),Q(d,(l=>$(Ml,{storeId:l,s:e,key:l}))),$(Rl,{s:e}),Q(h,(l=>$(Rl,{metricsId:l,s:e,key:l}))),$(xl,{s:e}),Q(b,(l=>$(xl,{indexesId:l,s:e,key:l}))),$(Pl,{s:e}),Q(g,(l=>$(Pl,{relationshipsId:l,s:e,key:l}))),$(ql,{s:e}),Q(f,(l=>$(ql,{queriesId:l,s:e,key:l}))))};class zl extends j{constructor(e){super(e),this.componentDidCatch=(e,l)=>console.error(e,l.componentStack),this.state={e:0}}render(){return this.state.e?$("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}zl.getDerivedStateFromError=()=>({e:1});const $l=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!1),[],e),r=t.useSetValueCallback(me,(e=>Number(e[k].dataset.id)),[],e);return $("header",null,$("img",{title:ie}),$("span",null,ie),Q(ue,((e,l)=>l==n?null:$("img",{onClick:r,"data-id":l,title:"Dock to "+e,key:l}))),$("img",{onClick:s,title:"Close"}))},Al=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1;return t.useValue(be,e)?$("main",{"data-position":n},$($l,{s:e}),$(zl,null,$(jl,{s:e}))):null},Fl=e=>l=>{return t=(l,t)=>l+e(t),Ul(l).reduce(t,0);var t},Jl=e=>{var l;return null!=(l=null==e?void 0:e.size)?l:0},Dl=Fl(Jl),Bl=Fl(Dl),Hl=Fl(Bl),Ql=(e,l)=>{var t;return null!=(t=null==e?void 0:e.has(l))&&t},Wl=e=>O(e)||0==Jl(e),Ul=e=>{var l;return[...null!=(l=null==e?void 0:e.values())?l:[]]},Gl=e=>e.clear(),Kl=(e,l)=>null==e?void 0:e.forEach(l),Xl=(e,l)=>null==e?void 0:e.delete(l),Yl=e=>new Map(e),Zl=e=>{var l;return[...null!=(l=null==e?void 0:e.keys())?l:[]]},_l=(e,l)=>null==e?void 0:e.get(l),et=(e,l)=>Kl(e,((e,t)=>l(t,e))),lt=(e,l,t)=>O(t)?(Xl(e,l),e):null==e?void 0:e.set(l,t),tt=(e,l,t)=>(Ql(e,l)||lt(e,l,t()),_l(e,l)),nt=(e,l,t,n=lt)=>(ne(l,((l,n)=>t(e,n,l))),et(e,(t=>le(l,t)?0:n(e,t))),e),st=(e,l,t)=>{const n={};return Kl(e,((e,s)=>{const r=l?l(e,s):e;!(null==t?void 0:t(r,e))&&(n[s]=r)})),n},rt=(e,l,t)=>st(e,(e=>st(e,l,t)),se),ot=(e,l,t)=>st(e,(e=>rt(e,l,t)),se),at=(e,l)=>{const t=Yl();return Kl(e,((e,n)=>{var s;return t.set(n,null!=(s=null==l?void 0:l(e))?s:e)})),t},it=e=>at(e,at),ut=e=>at(e,it),dt=(e,l,t,n,s=0)=>q((t?tt:_l)(e,l[s],s>M(l)-2?t:Yl),(r=>{if(s>M(l)-2)return(null==n?void 0:n(r))&<(e,l[s]),r;const o=dt(r,l,t,n,s+1);return Wl(r)&<(e,l[s]),o}));var ct=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{a(t.next(e))}catch(e){s(e)}},o=e=>{try{a(t.throw(e))}catch(e){s(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);a((t=t.apply(e,l)).next())}));const ht=Yl(),mt=Yl();var bt=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{a(t.next(e))}catch(e){s(e)}},o=e=>{try{a(t.throw(e))}catch(e){s(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);a((t=t.apply(e,l)).next())}));const pt="storage",gt=globalThis.window,vt=e=>new Set(E(e)||O(e)?e:[e]),ft=(e,l)=>null==e?void 0:e.add(l),It=/^\d+$/,yt=()=>{const e=[];let l=0;return[t=>{var n;return null!=(n=t?G(e):null)?n:s+l++},l=>{It.test(l)&&M(e)<1e3&&U(e,l)}]},wt=e=>[e,e],Ct=(e,l=Dl)=>l(e[0])+l(e[1]),kt=()=>[Yl(),Yl()],Tt=e=>[...e],St=([e,l])=>e===l,xt=(e,l,t)=>O(e)||!_(e)||se(e)||Y(e)?(null==t||t(),!1):(ne(e,((t,n)=>{l(t,n)||te(e,n)})),!se(e)),Vt=(e,l,t)=>lt(e,l,_l(e,l)==-t?void 0:t),Rt=()=>{let e,l,t=!1,n=!1,r=0;const o=Yl(),i=Yl(),c=Yl(),k=Yl(),T=Yl(),x=Yl(),V=Yl(),R=Yl(),E=Yl(),j=Yl(),z=Yl(),$=Yl(),A=Yl(),F=Yl(),J=vt(),D=Yl(),B=Yl(),W=Yl(),G=Yl(),K=kt(),X=kt(),Y=kt(),_=kt(),ee=kt(),ae=kt(),ie=kt(),ue=kt(),de=kt(),ce=kt(),he=kt(),me=kt(),be=kt(),pe=kt(),ge=kt(),ve=Yl(),fe=kt(),[Ie,ye,we,Ce]=(e=>{let l;const[t,n]=yt(),r=Yl();return[(e,n,o,a=[],i=(()=>[]))=>{null!=l||(l=Al);const u=t(1);return lt(r,u,[e,n,o,a,i]),ft(dt(n,null!=o?o:[s],vt),u),u},(e,t,...n)=>H(((e,l=[s])=>{const t=[],n=(e,s)=>s==M(l)?U(t,e):null===l[s]?Kl(e,(e=>n(e,s+1))):H([l[s],null],(l=>n(_l(e,l),s+1)));return n(e,0),t})(e,t),(e=>Kl(e,(e=>_l(r,e)[0](l,...null!=t?t:[],...n))))),e=>q(_l(r,e),(([,l,t])=>(dt(l,null!=t?t:[s],void 0,(l=>(Xl(l,e),Wl(l)?1:0))),lt(r,e),n(e),t))),e=>q(_l(r,e),(([e,,t=[],n,s])=>{const r=(...o)=>{var a,i;const u=M(o);u==M(t)?e(l,...o,...s(o)):O(t[u])?H(null!=(i=null==(a=n[u])?void 0:a.call(n,...o))?i:[],(e=>r(...o,e))):r(...o,t[u])};r()}))]})(),ke=e=>{if(!xt(e,((e,l)=>[u,d].includes(l))))return!1;const l=e[u];return!(!N(l)&&l!=a||(Je(e[d])!=l&&te(e,d),0))},Te=(l,t)=>(!e||Ql(z,t)||nl(t))&&xt(l,((e,l)=>Se(t,l,e)),(()=>nl(t))),Se=(e,l,t,n)=>xt(n?t:Oe(t,e,l),((n,s)=>q(xe(e,l,s,n),(e=>(t[s]=e,!0)),(()=>!1))),(()=>nl(e,l))),xe=(l,t,n,s)=>e?q(_l(_l(z,l),n),(e=>Je(s)!=e[u]?nl(l,t,n,s,e[d]):s),(()=>nl(l,t,n,s))):O(Je(s))?nl(l,t,n,s):s,Ve=(e,l)=>xt(l?e:qe(e),((l,t)=>q(Re(t,l),(l=>(e[t]=l,!0)),(()=>!1))),(()=>sl())),Re=(e,t)=>l?q(_l(A,e),(l=>Je(t)!=l[u]?sl(e,t,l[d]):t),(()=>sl(e,t))):O(Je(t))?sl(e,t):t,Oe=(e,l,t)=>(q(_l($,l),(([n,s])=>{Kl(n,((l,t)=>{le(e,t)||(e[t]=l)})),Kl(s,(n=>{le(e,n)||nl(l,t,n)}))})),e),qe=e=>(l&&(Kl(F,((l,t)=>{le(e,t)||(e[t]=l)})),Kl(J,(l=>{le(e,l)||sl(l)}))),e),Ne=e=>nt(z,e,((e,l,t)=>{const n=Yl(),s=vt();nt(tt(z,l,Yl),t,((e,l,t)=>{lt(e,l,t),q(t[d],(e=>lt(n,l,e)),(()=>ft(s,l)))})),lt($,l,[n,s])}),((e,l)=>{lt(z,l),lt($,l)})),Pe=e=>nt(A,e,((e,l,t)=>{lt(A,l,t),q(t[d],(e=>lt(F,l,e)),(()=>ft(J,l)))}),((e,l)=>{lt(A,l),lt(F,l),Xl(J,l)})),Ee=e=>se(e)?ql():Sl(e),Le=e=>nt(W,e,((e,l,t)=>Me(l,t)),((e,l)=>Ue(l))),Me=(e,l)=>nt(tt(W,e,(()=>(Ye(e,1),lt(D,e,yt()),lt(B,e,Yl()),Yl()))),l,((l,t,n)=>je(e,l,t,n)),((l,t)=>Ge(e,l,t))),je=(e,l,t,n,s)=>nt(tt(l,t,(()=>(Ze(e,t,1),Yl()))),n,((l,n,s)=>ze(e,t,l,n,s)),((n,r)=>Ke(e,l,t,n,r,s))),ze=(e,l,t,n,s)=>{Ql(t,n)||_e(e,l,n,1);const r=_l(t,n);s!==r&&(el(e,l,n,r,s),lt(t,n,s))},$e=(e,l,t,n,s)=>q(_l(l,t),(l=>ze(e,t,l,n,s)),(()=>je(e,l,t,Oe({[n]:s},e,t)))),Ae=e=>se(e)?El():xl(e),Fe=e=>nt(G,e,((e,l,t)=>He(l,t)),((e,l)=>Xe(l))),He=(e,l)=>{Ql(G,e)||ll(e,1);const t=_l(G,e);l!==t&&(tl(e,t,l),lt(G,e,l))},Qe=(e,l)=>{const[t]=_l(D,e),n=t(l);return Ql(_l(W,e),n)?Qe(e,l):n},We=e=>{var l;return null!=(l=_l(W,e))?l:Me(e,{})},Ue=e=>Me(e,{}),Ge=(e,l,t)=>{const[,n]=_l(D,e);n(t),je(e,l,t,{},!0)},Ke=(e,l,t,n,s,r)=>{var o;const a=_l(null==(o=_l($,e))?void 0:o[0],s);if(!O(a)&&!r)return ze(e,t,n,s,a);const i=l=>{el(e,t,l,_l(n,l)),_e(e,t,l,-1),lt(n,l)};O(a)?i(s):et(n,i),Wl(n)&&(Ze(e,t,-1),Wl(lt(l,t))&&(Ye(e,-1),lt(W,e),lt(D,e),lt(B,e)))},Xe=e=>{const l=_l(F,e);if(!O(l))return He(e,l);tl(e,_l(G,e)),ll(e,-1),lt(G,e)},Ye=(e,l)=>Vt(o,e,l),Ze=(e,l,t)=>Vt(tt(k,e,Yl),l,t)&<(c,e,tt(c,e,(()=>0))+t),_e=(e,l,t,n)=>{var s;const r=_l(B,e),o=null!=(s=_l(r,t))?s:0;(0==o&&1==n||1==o&&-1==n)&&Vt(tt(i,e,Yl),t,n),lt(r,t,o!=-n?o+n:null),Vt(tt(tt(T,e,Yl),l,Yl),t,n)},el=(e,l,t,n,s)=>tt(tt(tt(x,e,Yl),l,Yl),t,(()=>[n,0]))[1]=s,ll=(e,l)=>Vt(V,e,l),tl=(e,l,t)=>tt(R,e,(()=>[l,0]))[1]=t,nl=(e,l,t,n,s)=>(U(tt(tt(tt(E,e,Yl),l,Yl),t,(()=>[])),n),s),sl=(e,l,t)=>(U(tt(j,e,(()=>[])),l),t),rl=(e,l,t)=>q(_l(_l(_l(x,e),l),t),(([e,l])=>[!0,e,l]),(()=>[!1,...wt(wl(e,l,t))])),ol=e=>q(_l(R,e),(([e,l])=>[!0,e,l]),(()=>[!1,...wt(Tl(e))])),al=e=>Wl(E)||Wl(he[e])?0:Kl(e?ut(E):E,((l,t)=>Kl(l,((l,n)=>Kl(l,((l,s)=>ye(he[e],[t,n,s],l))))))),il=e=>Wl(j)||Wl(me[e])?0:Kl(e?at(j):j,((l,t)=>ye(me[e],[t],l))),ul=(e,l,t)=>{if(!Wl(l))return ye(e,t,(()=>st(l))),1},dl=e=>{const l=Wl(ie[e]),t=Wl(de[e])&&Wl(_[e])&&Wl(ee[e])&&Wl(ae[e])&&l&&Wl(X[e]),n=Wl(ce[e])&&Wl(ue[e])&&Wl(Y[e])&&Wl(K[e]);if(!t||!n){const s=e?[at(o),it(i),at(c),it(k),ut(T),ut(x)]:[o,i,c,k,T,x];if(!t){ul(X[e],s[0]),Kl(s[1],((l,t)=>ul(_[e],l,[t]))),Kl(s[2],((l,t)=>{0!=l&&ye(ee[e],[t],vl(t))}));const t=vt();Kl(s[3],((n,s)=>{ul(ae[e],n,[s])&&!l&&(ye(ie[e],[s,null]),ft(t,s))})),l||Kl(s[5],((l,n)=>{if(!Ql(t,n)){const t=vt();Kl(l,(e=>Kl(e,(([l,n],s)=>n!==l?ft(t,s):Xl(e,s))))),Kl(t,(l=>ye(ie[e],[n,l])))}})),Kl(s[4],((l,t)=>Kl(l,((l,n)=>ul(de[e],l,[t,n])))))}if(!n){let l;Kl(s[5],((t,n)=>{let s;Kl(t,((t,r)=>{let o;Kl(t,(([t,a],i)=>{a!==t&&(ye(ce[e],[n,r,i],a,t,rl),l=s=o=1)})),o&&ye(ue[e],[n,r],rl)})),s&&ye(Y[e],[n],rl)})),l&&ye(K[e],void 0,rl)}}},cl=e=>{const l=Wl(pe[e]),t=Wl(ge[e])&&Wl(be[e]);if(!l||!t){const n=e?[at(V),at(R)]:[V,R];if(l||ul(pe[e],n[0]),!t){let l;Kl(n[1],(([t,n],s)=>{n!==t&&(ye(ge[e],[s],n,t,ol),l=1)})),l&&ye(be[e],void 0,ol)}}},hl=(e,...l)=>(jl((()=>e(...Q(l,S)))),Al),ml=()=>[st(x,((e,l)=>-1===_l(o,l)?null:st(e,((e,t)=>-1===_l(_l(k,l),t)?null:st(e,(([,e])=>null!=e?e:null),((e,l)=>St(l)))),se)),se),st(R,(([,e])=>null!=e?e:null),((e,l)=>St(l)))],bl=()=>({cellsTouched:t,valuesTouched:n,changedCells:ot(x,Tt,St),invalidCells:ot(E),changedValues:st(R,Tt,St),invalidValues:st(j),changedTableIds:st(o),changedRowIds:rt(k),changedCellIds:ot(T),changedValueIds:st(V)}),pl=()=>ot(W),gl=()=>Zl(W),vl=e=>Jl(_l(W,S(e))),fl=e=>Zl(_l(W,S(e))),Il=(e,l,t,n=0,s)=>{return Q(L((o=_l(W,S(e)),a=(e,t)=>[O(l)?t:_l(e,S(l)),t],r=([e],[l])=>{return((null!=(n=e)?n:0)<(null!=(s=l)?s:0)?-1:1)*(t?-1:1);var n,s},Q([...null!=(i=null==o?void 0:o.entries())?i:[]],(([e,l])=>a(l,e))).sort(r)),n,O(s)?s:n+s),(([,e])=>e));var r,o,a,i},yl=(e,l)=>Zl(_l(_l(W,S(e)),S(l))),wl=(e,l,t)=>_l(_l(_l(W,S(e)),S(l)),S(t)),Cl=()=>st(G),kl=()=>Zl(G),Tl=e=>_l(G,S(e)),Sl=e=>hl((()=>(e=>xt(e,Te,nl))(e)?Le(e):0)),xl=e=>hl((()=>Ve(e)?Fe(e):0)),Vl=e=>{try{Ee(oe(e))}catch(e){}return Al},Rl=l=>hl((()=>{if((e=xt(l,(e=>xt(e,ke))))&&(Ne(l),!Wl(W))){const e=pl();ql(),Sl(e)}})),Ol=e=>hl((()=>{if(l=(e=>xt(e,ke))(e)){const t=Cl();Ml(),El(),l=!0,Pe(e),xl(t)}})),ql=()=>hl((()=>Le({}))),Nl=e=>hl((e=>Ql(W,e)?Ue(e):0),e),Pl=(e,l)=>hl(((e,l)=>q(_l(W,e),(t=>Ql(t,l)?Ge(e,t,l):0))),e,l),El=()=>hl((()=>Fe({}))),Ll=()=>hl((()=>{Ne({}),e=!1})),Ml=()=>hl((()=>{Pe({}),l=!1})),jl=(e,l)=>{if(-1!=r){zl();const t=e();return $l(l),t}},zl=()=>(-1!=r&&r++,1==r&&ye(ve,void 0,ml,bl),Al),$l=e=>(r>0&&(r--,0==r&&(t=!Wl(x),n=!Wl(R),r=1,al(1),t&&dl(1),il(1),n&&cl(1),(null==e?void 0:e(ml,bl))&&(Kl(x,((e,l)=>Kl(e,((e,t)=>Kl(e,(([e],n)=>De(Al,l,t,n,e))))))),Kl(R,(([e],l)=>Be(Al,l,e))),t=n=!1),ye(fe[0],void 0,ml,bl),r=-1,al(0),t&&dl(0),il(0),n&&cl(0),ye(fe[1],void 0,ml,bl),r=0,t=n=!1,H([o,i,c,k,T,x,E,V,R,j],Gl))),Al),Al={getContent:()=>[pl(),Cl()],getTables:pl,getTableIds:gl,getTable:e=>rt(_l(W,S(e))),getTableCellIds:e=>Zl(_l(B,S(e))),getRowCount:vl,getRowIds:fl,getSortedRowIds:Il,getRow:(e,l)=>st(_l(_l(W,S(e)),S(l))),getCellIds:yl,getCell:wl,getValues:Cl,getValueIds:kl,getValue:Tl,hasTables:()=>!Wl(W),hasTable:e=>Ql(W,S(e)),hasTableCell:(e,l)=>Ql(_l(B,S(e)),S(l)),hasRow:(e,l)=>Ql(_l(W,S(e)),S(l)),hasCell:(e,l,t)=>Ql(_l(_l(W,S(e)),S(l)),S(t)),hasValues:()=>!Wl(G),hasValue:e=>Ql(G,S(e)),getTablesJson:()=>re(W),getValuesJson:()=>re(G),getJson:()=>re([W,G]),getTablesSchemaJson:()=>re(z),getValuesSchemaJson:()=>re(A),getSchemaJson:()=>re([z,A]),hasTablesSchema:()=>e,hasValuesSchema:()=>l,setContent:([e,l])=>hl((()=>{(se(e)?ql:Sl)(e),(se(l)?El:xl)(l)})),setTables:Sl,setTable:(e,l)=>hl((e=>Te(l,e)?Me(e,l):0),e),setRow:(e,l,t)=>hl(((e,l)=>Se(e,l,t)?je(e,We(e),l,t):0),e,l),addRow:(e,l,t=!0)=>jl((()=>{let n;return Se(e,n,l)&&(e=S(e),je(e,We(e),n=Qe(e,t?1:0),l)),n})),setPartialRow:(e,l,t)=>hl(((e,l)=>{if(Se(e,l,t,1)){const n=We(e);ne(t,((t,s)=>$e(e,n,l,s,t)))}}),e,l),setCell:(e,l,t,n)=>hl(((e,l,t)=>q(xe(e,l,t,P(n)?n(wl(e,l,t)):n),(n=>$e(e,We(e),l,t,n)))),e,l,t),setValues:xl,setPartialValues:e=>hl((()=>Ve(e,1)?ne(e,((e,l)=>He(l,e))):0)),setValue:(e,l)=>hl((e=>q(Re(e,P(l)?l(Tl(e)):l),(l=>He(e,l)))),e),setTransactionChanges:e=>hl((()=>{ne(e[0],((e,l)=>O(e)?Nl(l):ne(e,((e,t)=>O(e)?Pl(l,t):ne(e,((e,n)=>De(Al,l,t,n,e))))))),ne(e[1],((e,l)=>Be(Al,l,e)))})),setTablesJson:Vl,setValuesJson:e=>{try{Ae(oe(e))}catch(e){}return Al},setJson:e=>hl((()=>{try{const[l,t]=oe(e);Ee(l),Ae(t)}catch(l){Vl(e)}})),setTablesSchema:Rl,setValuesSchema:Ol,setSchema:(e,l)=>hl((()=>{Rl(e),Ol(l)})),delTables:ql,delTable:Nl,delRow:Pl,delCell:(e,l,t,n)=>hl(((e,l,t)=>q(_l(W,e),(s=>q(_l(s,l),(r=>Ql(r,t)?Ke(e,s,l,r,t,n):0))))),e,l,t),delValues:El,delValue:e=>hl((e=>Ql(G,e)?Xe(e):0),e),delTablesSchema:Ll,delValuesSchema:Ml,delSchema:()=>hl((()=>{Ll(),Ml()})),transaction:jl,startTransaction:zl,finishTransaction:$l,forEachTable:e=>Kl(W,((l,t)=>e(t,(e=>Kl(l,((l,t)=>e(t,(e=>et(l,e))))))))),forEachTableCell:(e,l)=>et(_l(B,S(e)),l),forEachRow:(e,l)=>Kl(_l(W,S(e)),((e,t)=>l(t,(l=>et(e,l))))),forEachCell:(e,l,t)=>et(_l(_l(W,S(e)),S(l)),t),forEachValue:e=>et(G,e),addSortedRowIdsListener:(e,l,t,n,s,r,o)=>{let a=Il(e,l,t,n,s);return Ie((()=>{const o=Il(e,l,t,n,s);var i,u,d;u=a,M(i=o)===M(u)&&(d=(e,l)=>u[l]===e,i.every(d))||(a=o,r(Al,e,l,t,n,s,a))}),ie[o?1:0],[e,l],[gl])},addStartTransactionListener:e=>Ie(e,ve),addWillFinishTransactionListener:e=>Ie(e,fe[0]),addDidFinishTransactionListener:e=>Ie(e,fe[1]),callListener:e=>(Ce(e),Al),delListener:e=>(we(e),Al),getListenerStats:()=>({tables:Ct(K),tableIds:Ct(X),tableCellIds:Ct(_),table:Ct(Y),rowCount:Ct(ee),rowIds:Ct(ae),sortedRowIds:Ct(ie),row:Ct(ue,Bl),cellIds:Ct(de,Bl),cell:Ct(ce,Hl),invalidCell:Ct(he,Hl),values:Ct(be),valueIds:Ct(pe),value:Ct(ge),invalidValue:Ct(me),transaction:Dl(ve)+Ct(fe)}),createStore:Rt,addListener:Ie,callListeners:ye};return ne({[m]:[0,K],[b]:[0,X],[h]:[1,Y,[gl]],[h+I]:[1,_,[gl]],[g]:[1,ee,[gl]],[v]:[1,ae,[gl]],[p]:[2,ue,[gl,fl]],[I]:[2,de,[gl,fl]],[f]:[3,ce,[gl,fl,yl],e=>wt(wl(...e))],InvalidCell:[3,he],[w]:[0,be],[C]:[0,pe],[y]:[1,ge,[kl],e=>wt(Tl(e[0]))],InvalidValue:[1,me]},(([e,l,t,n],s)=>{Al["add"+s+"Listener"]=(...s)=>Ie(s[e],l[s[e+1]?1:0],e>0?L(s,0,e):void 0,t,n)})),Z(Al)},Ot=({position:e="right",open:l=!1})=>{const n=t.useCreateStore(Rt),s=ue.indexOf(e);return t.useCreatePersister(n,(e=>{return((e,l,t,n)=>((e,l,t,n,s,r,[o,a]=[],i=[])=>{let u,d,c,h=0,m=0,b=0,p=0;tt(ht,i,(()=>0)),tt(mt,i,(()=>[]));const g=e=>ct(void 0,null,(function*(){return 2!=h&&(h=1,m++,yield v.schedule((()=>ct(void 0,null,(function*(){yield e(),h=0}))))),v})),v={load:(t,n)=>ct(void 0,null,(function*(){return yield g((()=>ct(void 0,null,(function*(){try{e.setContent(yield l())}catch(l){e.setContent([t,n])}}))))})),startAutoLoad:(...t)=>ct(void 0,[...t],(function*(t={},s={}){return v.stopAutoLoad(),yield v.load(t,s),p=1,c=n(((t,n)=>ct(void 0,null,(function*(){if(n){const l=n();yield g((()=>ct(void 0,null,(function*(){return e.setTransactionChanges(l)}))))}else yield g((()=>ct(void 0,null,(function*(){var n;try{e.setContent(null!=(n=null==t?void 0:t())?n:yield l())}catch(e){null==r||r(e)}}))))})))),v})),stopAutoLoad:()=>(p&&(s(c),c=void 0,p=0),v),save:l=>ct(void 0,null,(function*(){return 1!=h&&(h=2,b++,yield v.schedule((()=>ct(void 0,null,(function*(){try{yield t(e.getContent,l)}catch(e){null==r||r(e)}h=0}))))),v})),startAutoSave:()=>ct(void 0,null,(function*(){return yield v.stopAutoSave().save(),u=e.addDidFinishTransactionListener(((e,l)=>{const[t,n]=l();se(t)&&se(n)||v.save((()=>[t,n]))})),v})),stopAutoSave:()=>(q(u,e.delListener),u=void 0,v),schedule:(...e)=>ct(void 0,null,(function*(){return U(_l(mt,i),...e),yield ct(void 0,null,(function*(){if(!_l(ht,i)){for(lt(ht,i,1);!O(d=G(_l(mt,i)));)try{yield d()}catch(e){null==r||r(e)}lt(ht,i,0)}})),v})),getStore:()=>e,destroy:()=>v.stopAutoLoad().stopAutoSave(),getStats:()=>({loads:m,saves:b})};return o&&(v[o]=()=>a),Z(v)})(e,(()=>bt(void 0,null,(function*(){return oe(t.getItem(l))}))),(e=>bt(void 0,null,(function*(){return t.setItem(l,re(e()))}))),(e=>{const n=n=>{n.storageArea===t&&n.key===l&&e((()=>oe(n.newValue)))};return gt.addEventListener(pt,n),n}),(e=>gt.removeEventListener(pt,e)),n,["getStorageName",l]))(e,ae,sessionStorage,l);var l}),void 0,(e=>{return t=function*(){yield e.load(void 0,{position:-1==s?1:s,open:!!l}),yield e.startAutoSave()},new Promise(((e,l)=>{var n=e=>{try{r(t.next(e))}catch(e){l(e)}},s=e=>{try{r(t.throw(e))}catch(e){l(e)}},r=l=>l.done?e(l.value):Promise.resolve(l.value).then(n,s);r((t=t.apply(void 0,null)).next())}));var t})),$(z,null,$("aside",{id:ae},$(Ae,{s:n}),$(Al,{s:n})),$("style",null,$e))};var qt=Object.defineProperty,Nt=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Lt=(e,l,t)=>l in e?qt(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t;e.EditableCellView=wl,e.EditableValueView=Cl,e.RelationshipInHtmlTable=Il,e.ResultSortedTableInHtmlTable=yl,e.ResultTableInHtmlTable=e=>{var l=e,{queryId:n,queries:s,customCells:r}=l,o=el(l,["queryId","queries","customCells"]);return $(hl,_e(Ze({},o),{params:al(cl(t.useResultTableCellIds(n,s),r,t.ResultCellView),ul(s,n),t.useResultRowIds(n,s))}))},e.SliceInHtmlTable=fl,e.SortedTableInHtmlTable=gl,e.SortedTablePaginator=kl,e.StoreInspector=e=>$(Ot,((e,l)=>{for(var t in l||(l={}))Pt.call(l,t)&&Lt(e,t,l[t]);if(Nt)for(var t of Nt(l))Et.call(l,t)&&Lt(e,t,l[t]);return e})({},e)),e.TableInHtmlTable=e=>{var l=e,{tableId:n,store:s,editable:r,customCells:o}=l,a=el(l,["tableId","store","editable","customCells"]);return $(hl,_e(Ze({},a),{params:al(cl(t.useTableCellIds(n,s),o,r?wl:t.CellView),il(s,n),t.useRowIds(n,s))}))},e.ValuesInHtmlTable=vl},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDomDebug={},e.React,e.TinyBaseUiReact);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.16",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"publishPackage": "gulp publishPackage"
|
|
212
212
|
},
|
|
213
213
|
"devDependencies": {
|
|
214
|
-
"@automerge/automerge": "^2.1.
|
|
214
|
+
"@automerge/automerge": "^2.1.5",
|
|
215
215
|
"@babel/cli": "^7.23.0",
|
|
216
216
|
"@babel/core": "^7.23.2",
|
|
217
217
|
"@babel/preset-env": "^7.23.2",
|
|
@@ -219,23 +219,23 @@
|
|
|
219
219
|
"@babel/preset-typescript": "^7.23.2",
|
|
220
220
|
"@prettier/sync": "^0.3.0",
|
|
221
221
|
"@rollup/plugin-image": "^3.0.3",
|
|
222
|
-
"@rollup/plugin-replace": "^5.0.
|
|
222
|
+
"@rollup/plugin-replace": "^5.0.4",
|
|
223
223
|
"@rollup/plugin-terser": "^0.4.4",
|
|
224
|
-
"@sqlite.org/sqlite-wasm": "^3.43.
|
|
225
|
-
"@types/asciichart": "^1.5.
|
|
226
|
-
"@types/expect-puppeteer": "^5.0.
|
|
227
|
-
"@types/http-server": "^0.12.
|
|
228
|
-
"@types/jest": "^29.5.
|
|
229
|
-
"@types/jest-environment-puppeteer": "^5.0.
|
|
230
|
-
"@types/less": "^3.0.
|
|
231
|
-
"@types/node": "^20.8.
|
|
224
|
+
"@sqlite.org/sqlite-wasm": "^3.43.2-build1",
|
|
225
|
+
"@types/asciichart": "^1.5.7",
|
|
226
|
+
"@types/expect-puppeteer": "^5.0.5",
|
|
227
|
+
"@types/http-server": "^0.12.3",
|
|
228
|
+
"@types/jest": "^29.5.6",
|
|
229
|
+
"@types/jest-environment-puppeteer": "^5.0.5",
|
|
230
|
+
"@types/less": "^3.0.5",
|
|
231
|
+
"@types/node": "^20.8.7",
|
|
232
232
|
"@types/puppeteer": "^5.4.7",
|
|
233
|
-
"@types/react": "^18.2.
|
|
234
|
-
"@types/react-dom": "^18.2.
|
|
235
|
-
"@types/react-test-renderer": "^18.0.
|
|
236
|
-
"@types/tmp": "^0.2.
|
|
237
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
238
|
-
"@typescript-eslint/parser": "^6.
|
|
233
|
+
"@types/react": "^18.2.29",
|
|
234
|
+
"@types/react-dom": "^18.2.14",
|
|
235
|
+
"@types/react-test-renderer": "^18.0.5",
|
|
236
|
+
"@types/tmp": "^0.2.5",
|
|
237
|
+
"@typescript-eslint/eslint-plugin": "^6.8.0",
|
|
238
|
+
"@typescript-eslint/parser": "^6.8.0",
|
|
239
239
|
"@vlcn.io/crsqlite-wasm": "^0.15.2",
|
|
240
240
|
"asciichart": "^1.5.25",
|
|
241
241
|
"automerge-repo": "^0.1.0",
|
|
@@ -246,8 +246,8 @@
|
|
|
246
246
|
"babel-preset-minify": "^0.5.2",
|
|
247
247
|
"buffer-replace": "^1.0.0",
|
|
248
248
|
"country-flag-emoji-json": "^2.0.0",
|
|
249
|
-
"cspell": "^7.3.
|
|
250
|
-
"esbuild": "^0.19.
|
|
249
|
+
"cspell": "^7.3.8",
|
|
250
|
+
"esbuild": "^0.19.5",
|
|
251
251
|
"eslint": "^8.51.0",
|
|
252
252
|
"eslint-config-prettier": "^9.0.0",
|
|
253
253
|
"eslint-plugin-jest": "^27.4.2",
|
|
@@ -265,18 +265,18 @@
|
|
|
265
265
|
"jest-fetch-mock": "^3.0.3",
|
|
266
266
|
"jest-puppeteer": "^9.0.1",
|
|
267
267
|
"less": "^4.2.0",
|
|
268
|
-
"partykit": "^0.0.
|
|
269
|
-
"partysocket": "^0.0.
|
|
268
|
+
"partykit": "^0.0.32",
|
|
269
|
+
"partysocket": "^0.0.12",
|
|
270
270
|
"prettier": "^3.0.3",
|
|
271
271
|
"puppeteer": "21.1.1",
|
|
272
272
|
"react": "^18.2.0",
|
|
273
273
|
"react-dom": "^18.2.0",
|
|
274
274
|
"react-test-renderer": "^18.2.0",
|
|
275
|
-
"rollup": "^
|
|
275
|
+
"rollup": "^4.1.4",
|
|
276
276
|
"rollup-plugin-esbuild": "^6.1.0",
|
|
277
277
|
"rollup-plugin-gzip": "^3.1.0",
|
|
278
278
|
"rollup-plugin-preserve-shebang": "^1.0.1",
|
|
279
|
-
"rollup-plugin-prettier": "^4.
|
|
279
|
+
"rollup-plugin-prettier": "^4.1.1",
|
|
280
280
|
"sqlite3": "^5.1.6",
|
|
281
281
|
"tinybase": "file:./",
|
|
282
282
|
"tinydocs": "^0.1.33",
|
|
@@ -286,11 +286,11 @@
|
|
|
286
286
|
"yjs": "^13.6.8"
|
|
287
287
|
},
|
|
288
288
|
"peerDependencies": {
|
|
289
|
-
"@sqlite.org/sqlite-wasm": "^3.43.
|
|
289
|
+
"@sqlite.org/sqlite-wasm": "^3.43.2-build1",
|
|
290
290
|
"@vlcn.io/crsqlite-wasm": "^0.15.2",
|
|
291
291
|
"automerge-repo": "^0.1.0",
|
|
292
|
-
"partykit": "^0.0.
|
|
293
|
-
"partysocket": "^0.0.
|
|
292
|
+
"partykit": "^0.0.31",
|
|
293
|
+
"partysocket": "^0.0.11",
|
|
294
294
|
"prettier": "^3.0.3",
|
|
295
295
|
"react": "^18.2.0",
|
|
296
296
|
"react-dom": "^18.2.0",
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2><p id="copy">Build blisteringly fast web apps that work both online and offline. Manage your state locally, synchronize it to the cloud when you need to, or even make it collaborative. But, most importantly... have fun building stuff again!</p></section><p><a href="https://tinybase.org/guides/releases/#v4-3"><em>NEW!</em> v4.3 release</a> <span id="one-with">"The One With PartyKit"</span></p><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><ul><li>Manage <a href="#start-with-a-simple-key-value-store">key-value data</a>, <a href="#level-up-to-use-tabular-data">tabular data</a> - or both - with optional <a href="#apply-schemas-to-tables-values">schematization</a> to model your app's data structures.</li><li><a href="#register-granular-listeners">Flexibly reactive</a> to reconciled updates, so you only spend rendering cycles on things that change.</li><li><a href="#build-complex-queries-with-tinyql">Powerful query engine</a> to select, join, filter, group, sort and paginate data - reactively - and without SQL.</li><li>Built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, <a href="#model-table-relationships">tabular relationships</a> - and even an <a href="#set-checkpoints-for-an-undo-stack">undo stack</a> for your app state.</li><li>Create <a href="#type-definitions-orm-like-apis">type definitions & ORM-like APIs</a>, from schema or inference. <a href="#an-inspector-for-your-data">Inspect your data</a> (<em>new!</em>) directly in the browser.</li><li>Easily <a href="#persist-to-storage-sqlite-crdts">sync your data</a> to browser <a href="https://tinybase.org/api/persister-browser">storage</a>, <a href="https://tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>, and (<em>new!</em>) <a href="https://tinybase.org/api/persister-partykit-client/">PartyKit</a>.</li><li>Optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and (<em>new!</em>) <a href="#pre-built-reactive-components">pre-built components</a> that let you easily build fully reactive user interfaces.</li><li>Tiny by name, tiny by nature: <a href="#did-we-say-tiny">4.8kB - 9.2kB</a>, zero dependencies. <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</li></ul><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">Tinybase works great on its own, but also plays well with friends!</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&logo=x&logoColor=%23fff&label=Twitter&labelColor=%23333&color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/4.3.
|
|
1
|
+
<section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2><p id="copy">Build blisteringly fast web apps that work both online and offline. Manage your state locally, synchronize it to the cloud when you need to, or even make it collaborative. But, most importantly... have fun building stuff again!</p></section><p><a href="https://tinybase.org/guides/releases/#v4-3"><em>NEW!</em> v4.3 release</a> <span id="one-with">"The One With PartyKit"</span></p><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><ul><li>Manage <a href="#start-with-a-simple-key-value-store">key-value data</a>, <a href="#level-up-to-use-tabular-data">tabular data</a> - or both - with optional <a href="#apply-schemas-to-tables-values">schematization</a> to model your app's data structures.</li><li><a href="#register-granular-listeners">Flexibly reactive</a> to reconciled updates, so you only spend rendering cycles on things that change.</li><li><a href="#build-complex-queries-with-tinyql">Powerful query engine</a> to select, join, filter, group, sort and paginate data - reactively - and without SQL.</li><li>Built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, <a href="#model-table-relationships">tabular relationships</a> - and even an <a href="#set-checkpoints-for-an-undo-stack">undo stack</a> for your app state.</li><li>Create <a href="#type-definitions-orm-like-apis">type definitions & ORM-like APIs</a>, from schema or inference. <a href="#an-inspector-for-your-data">Inspect your data</a> (<em>new!</em>) directly in the browser.</li><li>Easily <a href="#persist-to-storage-sqlite-crdts">sync your data</a> to browser <a href="https://tinybase.org/api/persister-browser">storage</a>, <a href="https://tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>, and (<em>new!</em>) <a href="https://tinybase.org/api/persister-partykit-client/">PartyKit</a>.</li><li>Optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and (<em>new!</em>) <a href="#pre-built-reactive-components">pre-built components</a> that let you easily build fully reactive user interfaces.</li><li>Tiny by name, tiny by nature: <a href="#did-we-say-tiny">4.8kB - 9.2kB</a>, zero dependencies. <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</li></ul><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">Tinybase works great on its own, but also plays well with friends!</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&logo=x&logoColor=%23fff&label=Twitter&labelColor=%23333&color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/4.3.16" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
4
|
const store = createStore()
|
|
@@ -247,4 +247,4 @@ export const createShop: typeof createShopDecl = () => {
|
|
|
247
247
|
};
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>4.8kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>9.2kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>3.9kB</em>, the auxiliary <a href="https://tinybase.org/api/tools/"><code>tools</code></a> module is <em>10.5kB</em>, and everything is super fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">store</a></th><td>4.8kB</td><td>11.4kB</td><td>48.6kB</td><td>220.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>15.2kB</td><td>30.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.8kB</td><td>17.0kB</td><td>35.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships/">relationships</a></th><td>1.9kB</td><td>3.7kB</td><td>17.1kB</td><td>44.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries/">queries</a></th><td>2.8kB</td><td>5.7kB</td><td>25.6kB</td><td>127.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.5kB</td><td>3.1kB</td><td>12.4kB</td><td>33.3kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters/">persisters</a></th><td>0.8kB</td><td>1.5kB</td><td>5.
|
|
250
|
+
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>4.8kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>9.2kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>3.9kB</em>, the auxiliary <a href="https://tinybase.org/api/tools/"><code>tools</code></a> module is <em>10.5kB</em>, and everything is super fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">store</a></th><td>4.8kB</td><td>11.4kB</td><td>48.6kB</td><td>220.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>15.2kB</td><td>30.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.8kB</td><td>17.0kB</td><td>35.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships/">relationships</a></th><td>1.9kB</td><td>3.7kB</td><td>17.1kB</td><td>44.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries/">queries</a></th><td>2.8kB</td><td>5.7kB</td><td>25.6kB</td><td>127.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.5kB</td><td>3.1kB</td><td>12.4kB</td><td>33.3kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters/">persisters</a></th><td>0.8kB</td><td>1.5kB</td><td>5.2kB</td><td>43.5kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/common/">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>9.2kB</td><td>22.6kB</td><td>97.6kB</td><td>0.3kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible for you to get your TinyBase-powered app up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>1,883</td><td>1,883</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,038</td><td>2,038</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>812</td><td>812</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>692</td><td>692</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">3,401</td></tr><tr><th class="right">Assertions</th><td colspan="3">15,302</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img title="cancelself" src="https://github.com/cancelself.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img title="arpitBhalla" src="https://github.com/arpitBhalla.png?size=48" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/Apocalypsor" target="_blank"><img title="Apocalypsor" src="https://github.com/Apocalypsor.png?size=48" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img title="brentvatne" src="https://github.com/brentvatne.png?size=48" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img title="circadian-risk" src="https://github.com/circadian-risk.png?size=48" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img title="cubecull" src="https://github.com/cubecull.png?size=48" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img title="erwinkn" src="https://github.com/erwinkn.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img title="ezra-en" src="https://github.com/ezra-en.png?size=48" width="48" height="48"></a><a href="https://github.com/fdfontes" target="_blank"><img title="fdfontes" src="https://github.com/fdfontes.png?size=48" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img title="flaming-codes" src="https://github.com/flaming-codes.png?size=48" width="48" height="48"></a><a href="https://github.com/generates" target="_blank"><img title="generates" src="https://github.com/generates.png?size=48" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img title="Giulio987" src="https://github.com/Giulio987.png?size=48" width="48" height="48"></a><a href="https://github.com/jaysc" target="_blank"><img title="jaysc" src="https://github.com/jaysc.png?size=48" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img title="Kayoo-asso" src="https://github.com/Kayoo-asso.png?size=48" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img title="kotofurumiya" src="https://github.com/kotofurumiya.png?size=48" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img title="learn-anything" src="https://github.com/learn-anything.png?size=48" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img title="marksteve" src="https://github.com/marksteve.png?size=48" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img title="miking-the-viking" src="https://github.com/miking-the-viking.png?size=48" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img title="nikitavoloboev" src="https://github.com/nikitavoloboev.png?size=48" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img title="shaneosullivan" src="https://github.com/shaneosullivan.png?size=48" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img title="SuperSonicHub1" src="https://github.com/SuperSonicHub1.png?size=48" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img title="threepointone" src="https://github.com/threepointone.png?size=48" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img title="uptonking" src="https://github.com/uptonking.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a></section><hr><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://tinybase.org/youtube.webp"></a></section>
|