@protobase/ui 0.12.22 → 0.13.0
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/dist/app/displays/card-layout.js +19 -0
- package/dist/app/displays/cards-display.js +16 -11
- package/dist/app/displays/list-cards.js +50 -0
- package/dist/app/displays/list-displays.js +4 -3
- package/dist/app/displays/map-display.js +3 -3
- package/dist/app/displays/virtual-cards.js +138 -0
- package/dist/app/embedded-list/embedded-columns.js +52 -0
- package/dist/app/embedded-list/embedded-display.js +26 -0
- package/dist/app/embedded-list/embedded-list.js +155 -0
- package/dist/app/embedded-list/use-embedded-display.js +23 -0
- package/dist/app/embedded-list/use-embedded-rows.js +33 -0
- package/dist/app/list-page.js +14 -5
- package/dist/app/list-scroll.js +25 -0
- package/dist/app/pages/blocks/table.js +21 -41
- package/dist/app/record-page.js +2 -1
- package/dist/app/related-section.js +30 -52
- package/dist/app/router.js +1 -0
- package/dist/data-grid/data-grid.js +19 -39
- package/dist/data-grid/geometry.js +7 -9
- package/dist/data-grid/use-grid-scroll.js +8 -1
- package/dist/data-grid/use-virtual-rows.js +31 -0
- package/dist/live/columns-from-model.js +6 -4
- package/dist/live/grid-loader.js +26 -10
- package/dist/package.js +1 -1
- package/dist/record-view/section.js +24 -17
- package/dist/shell/assets/app-DLjaMVJD.js +66 -0
- package/dist/shell/assets/index-BYPphaEm.css +2 -0
- package/dist/shell/assets/{index-B8MhIaLr.js → index-D7IcSr6n.js} +3 -3
- package/dist/shell/assets/maplibre-gl-Bt-3iOM-.js +1 -0
- package/dist/shell/assets/record-map-DL4b9dZO.js +814 -0
- package/dist/shell/assets/records-map-D0EOO5kZ.js +1 -0
- package/dist/shell/assets/shared-protobase-ui-B8UXOIeW.js +1 -0
- package/dist/shell/index.html +5 -5
- package/dist/shell/protobase.shell.json +1 -1
- package/package.json +4 -5
- package/dist/app/pages/record-table.js +0 -114
- package/dist/app/pages/use-relation-labels.js +0 -30
- package/dist/shell/assets/app-BYw-8qpE.js +0 -66
- package/dist/shell/assets/index-CdSIk0BQ.css +0 -2
- package/dist/shell/assets/navigation-control-CGS0pamh.js +0 -814
- package/dist/shell/assets/record-map-9Y3IL_dg.js +0 -1
- package/dist/shell/assets/records-map-DXIWowJ3.js +0 -1
- package/dist/shell/assets/shared-protobase-ui-Bol6wL_S.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./navigation-control-CGS0pamh.js";import{t as c}from"./jsx-runtime-NZYk81nU.js";var l=e(c(),1),u=`/assets/maplibre-gl-worker-Bh1S--WG.js`,d=Uint8Array,f=Uint16Array,p=Int32Array,ee=new d([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),te=new d([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ne=new d([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m=function(e,t){for(var n=new f(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new p(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},h=m(ee,2),re=h.b,g=h.r;re[28]=258,g[258]=28;var _=m(te,0),ie=_.b;_.r;for(var v=new f(32768),y=0;y<32768;++y){var b=(y&43690)>>1|(y&21845)<<1;b=(b&52428)>>2|(b&13107)<<2,b=(b&61680)>>4|(b&3855)<<4,v[y]=((b&65280)>>8|(b&255)<<8)>>1}for(var x=(function(e,t,n){for(var r=e.length,i=0,a=new f(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new f(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new f(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)s[v[d]>>c]=l}else for(s=new f(r),i=0;i<r;++i)e[i]&&(s[i]=v[o[e[i]-1]++]>>15-e[i]);return s}),S=new d(288),y=0;y<144;++y)S[y]=8;for(var y=144;y<256;++y)S[y]=9;for(var y=256;y<280;++y)S[y]=7;for(var y=280;y<288;++y)S[y]=8;for(var C=new d(32),y=0;y<32;++y)C[y]=5;var ae=x(S,9,1),oe=x(C,5,1),w=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},T=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},E=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},se=function(e){return(e+7)/8|0},ce=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new d(e.subarray(t,n))},D=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],O=function(e,t,n){var r=Error(t||D[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,O),!n)throw r;return r},k=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new d(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new d(i*3));var l=function(e){var t=n.length;if(e>t){var r=new d(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,f=t.p||0,p=t.b||0,m=t.l,h=t.d,g=t.m,_=t.n,v=i*8;do{if(!m){u=T(e,f,1);var y=T(e,f+1,3);if(f+=3,!y){var b=se(f)+4,S=e[b-4]|e[b-3]<<8,C=b+S;if(C>i){c&&O(0);break}s&&l(p+S),n.set(e.subarray(b,C),p),t.b=p+=S,t.p=f=C*8,t.f=u;continue}if(y==1)m=ae,h=oe,g=9,_=5;else if(y==2){var D=T(e,f,31)+257,k=T(e,f+10,15)+4,A=D+T(e,f+5,31)+1;f+=14;for(var j=new d(A),M=new d(19),N=0;N<k;++N)M[ne[N]]=T(e,f+N*3,7);f+=k*3;for(var P=w(M),le=(1<<P)-1,ue=x(M,P,1),N=0;N<A;){var F=ue[T(e,f,le)];f+=F&15;var b=F>>4;if(b<16)j[N++]=b;else{var I=0,R=0;for(b==16?(R=3+T(e,f,3),f+=2,I=j[N-1]):b==17?(R=3+T(e,f,7),f+=3):b==18&&(R=11+T(e,f,127),f+=7);R--;)j[N++]=I}}var z=j.subarray(0,D),B=j.subarray(D);g=w(z),_=w(B),m=x(z,g,1),h=x(B,_,1)}else O(1);if(f>v){c&&O(0);break}}s&&l(p+131072);for(var V=(1<<g)-1,de=(1<<_)-1,H=f;;H=f){var I=m[E(e,f)&V],U=I>>4;if(f+=I&15,f>v){c&&O(0);break}if(I||O(2),U<256)n[p++]=U;else if(U==256){H=f,m=null;break}else{var W=U-254;if(U>264){var N=U-257,G=ee[N];W=T(e,f,(1<<G)-1)+re[N],f+=G}var K=h[E(e,f)&de],q=K>>4;K||O(3),f+=K&15;var B=ie[q];if(q>3){var G=te[q];B+=E(e,f)&(1<<G)-1,f+=G}if(f>v){c&&O(0);break}s&&l(p+131072);var J=p+W;if(p<B){var Y=a-B,fe=Math.min(B,J);for(Y+p<0&&O(3);p<fe;++p)n[p]=r[Y+p]}for(;p<J;++p)n[p]=n[p-B]}}t.l=m,t.p=H,t.b=p,t.f=u,m&&(u=1,t.m=g,t.d=h,t.n=_)}while(!u);return p!=n.length&&o?ce(n,0,p):n.subarray(0,p)},A=new d(0),j=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&O(6,`invalid gzip data`);var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},M=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},N=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&O(6,`invalid zlib data`),(e[1]>>5&1)==+!t&&O(6,`invalid zlib data: `+(e[1]&32?`need`:`unexpected`)+` dictionary`),(e[1]>>3&4)+2};function P(e,t){return k(e,{i:2},t&&t.out,t&&t.dictionary)}function le(e,t){var n=j(e);return n+8>e.length&&O(6,`invalid gzip data`),k(e.subarray(n,-8),{i:2},t&&t.out||new d(M(e)),t&&t.dictionary)}function ue(e,t){return k(e.subarray(N(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}function F(e,t){return e[0]==31&&e[1]==139&&e[2]==8?le(e,t):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?P(e,t):ue(e,t)}var I=typeof TextDecoder<`u`&&new TextDecoder;try{I.decode(A,{stream:!0})}catch{}var R=Object.defineProperty,z=Math.pow,B=(e,t)=>R(e,`name`,{value:t,configurable:!0}),V=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});B((e,t)=>{let n=!1,r=``;return new(L.GridLayer.extend({createTile:B((t,i)=>{let a=document.createElement(`img`),o=new AbortController,s=o.signal;return a.cancel=()=>{o.abort()},n||=(e.getHeader().then(e=>{e.tileType===1||e.tileType===6?console.error(`Error: archive contains vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details.`):e.tileType===2?r=`image/png`:e.tileType===3?r=`image/jpeg`:e.tileType===4?r=`image/webp`:e.tileType===5&&(r=`image/avif`)}),!0),e.getZxy(t.z,t.x,t.y,s).then(e=>{if(e){let t=new Blob([e.data],{type:r}),n=window.URL.createObjectURL(t);a.src=n}else a.style.display=`none`;a.cancel=void 0,i(void 0,a)}).catch(e=>{if(e.name!==`AbortError`)throw e}),a},`createTile`),_removeTile:B(function(e){let t=this._tiles[e];t&&(t.el.cancel&&t.el.cancel(),t.el.src&&window.URL.revokeObjectURL(t.el.src),t.el.width=0,t.el.height=0,t.el.deleted=!0,L.DomUtil.remove(t.el),delete this._tiles[e],this.fire(`tileunload`,{tile:t.el,coords:this._keyToTileCoords(e)}))},`_removeTile`)}))(t)},`leafletRasterLayer`);var de=B(e=>(t,n)=>{if(n instanceof AbortController)return e(t,n);let r=new AbortController;return e(t,r).then(e=>n(void 0,e.data,e.cacheControl||``,e.expires||``),e=>n(e)).catch(e=>n(e)),{cancel:B(()=>r.abort(),`cancel`)}},`v3compat`),H=class{constructor(e){this.tilev4=B((e,t)=>V(this,null,function*(){if(e.type===`json`){let n=e.url.substr(10),r=this.tiles.get(n);if(r||(r=new De(n),this.tiles.set(n,r)),this.metadata){let n=yield r.getTileJson(e.url);return t.signal.throwIfAborted(),{data:n}}let i=yield r.getHeader();return t.signal.throwIfAborted(),(i.minLon>=i.maxLon||i.minLat>=i.maxLat)&&console.error(`Bounds of PMTiles archive ${i.minLon},${i.minLat},${i.maxLon},${i.maxLat} are not valid.`),{data:{tiles:[`${e.url}/{z}/{x}/{y}`],minzoom:i.minZoom,maxzoom:i.maxZoom,bounds:[i.minLon,i.minLat,i.maxLon,i.maxLat]}}}let n=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),r=e.url.match(n);if(!r)throw Error(`Invalid PMTiles protocol URL`);let i=r[1],a=this.tiles.get(i);a||(a=new De(i),this.tiles.set(i,a));let o=r[2],s=r[3],c=r[4],l=yield a?.getZxy(+o,+s,+c,t.signal);if(t.signal.throwIfAborted(),l)return{data:new Uint8Array(l.data),cacheControl:l.cacheControl,expires:l.expires};let u=yield a.getHeader();if(u.tileType===1||u.tileType===6){if(this.errorOnMissingTile)throw Error(`Tile not found.`);return{data:new Uint8Array}}return{data:null}}),`tilev4`),this.tile=de(this.tilev4),this.tiles=new Map,this.metadata=e?.metadata||!1,this.errorOnMissingTile=e?.errorOnMissingTile||!1}add(e){this.tiles.set(e.source.getKey(),e)}get(e){return this.tiles.get(e)}};B(H,`Protocol`);var U=H;function W(e,t){return(t>>>0)*4294967296+(e>>>0)}B(W,`toNum`);function G(e,t){let n=t.buf,r=n[t.pos++],i=(r&112)>>4;if(r<128||(r=n[t.pos++],i|=(r&127)<<3,r<128)||(r=n[t.pos++],i|=(r&127)<<10,r<128)||(r=n[t.pos++],i|=(r&127)<<17,r<128)||(r=n[t.pos++],i|=(r&127)<<24,r<128)||(r=n[t.pos++],i|=(r&1)<<31,r<128))return W(e,i);throw Error(`Expected varint not more than 10 bytes`)}B(G,`readVarintRemainder`);function K(e){let t=e.buf,n=t[e.pos++],r=n&127;return n<128||(n=t[e.pos++],r|=(n&127)<<7,n<128)||(n=t[e.pos++],r|=(n&127)<<14,n<128)||(n=t[e.pos++],r|=(n&127)<<21,n<128)?r:(n=t[e.pos],r|=(n&15)<<28,G(r,e))}B(K,`readVarint`);function q(e,t,n,r,i){return i===0?r===0?[n,t]:[e-1-n,e-1-t]:[t,n]}B(q,`rotate`);function J(e,t,n){if(e>26)throw Error(`Tile zoom level exceeds max safe number limit (26)`);if(t>=1<<e||n>=1<<e)throw Error(`tile x/y outside zoom level bounds`);let r=((1<<e)*(1<<e)-1)/3,i=e-1,[a,o]=[t,n];for(let e=1<<i;e>0;e>>=1){let t=a&e,n=o&e;r+=(3*t^n)*(1<<i),[a,o]=q(e,a,o,t,n),i--}return r}B(J,`zxyToTileId`);function Y(e){let t=3*e+1;return t<4294967296?31-Math.clz32(t):63-Math.clz32(t/4294967296)}B(Y,`tileIdToZ`);function fe(e){let t=Y(e)>>1;if(t>26)throw Error(`Tile zoom level exceeds max safe number limit (26)`);let n=e-((1<<t)*(1<<t)-1)/3,r=0,i=0,a=1<<t;for(let e=1;e<a;e<<=1){let t=e&n/2,a=e&(n^t);[r,i]=q(e,r,i,t,a),n/=2,r+=t,i+=a}return[t,r,i]}B(fe,`tileIdToZxy`);var pe=(e=>(e[e.Unknown=0]=`Unknown`,e[e.None=1]=`None`,e[e.Gzip=2]=`Gzip`,e[e.Brotli=3]=`Brotli`,e[e.Zstd=4]=`Zstd`,e))(pe||{});function X(e,t){return V(this,null,function*(){if(t===1||t===0)return e;if(t===2){if(globalThis.DecompressionStream===void 0)return F(new Uint8Array(e));let t=new Response(e).body;if(!t)throw Error(`Failed to read response stream`);let n=t.pipeThrough(new globalThis.DecompressionStream(`gzip`));return new Response(n).arrayBuffer()}throw Error(`Compression method not supported`)})}B(X,`defaultDecompress`);var me=(e=>(e[e.Unknown=0]=`Unknown`,e[e.Mvt=1]=`Mvt`,e[e.Png=2]=`Png`,e[e.Jpeg=3]=`Jpeg`,e[e.Webp=4]=`Webp`,e[e.Avif=5]=`Avif`,e[e.Mlt=6]=`Mlt`,e))(me||{});function he(e){return e===1?`.mvt`:e===2?`.png`:e===3?`.jpg`:e===4?`.webp`:e===5?`.avif`:e===6?`.mlt`:``}B(he,`tileTypeExt`);var ge=127;function _e(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=r+n>>1,a=t-e[i].tileId;if(a>0)n=i+1;else if(a<0)r=i-1;else return e[i]}return r>=0&&(e[r].runLength===0||t-e[r].tileId<e[r].runLength)?e[r]:null}B(_e,`findTile`),B(class{constructor(e){this.file=e}getKey(){return this.file.name}getBytes(e,t){return V(this,null,function*(){return{data:yield this.file.slice(e,e+t).arrayBuffer()}})}},`FileSource`);var ve=class{constructor(e,t=new Headers,n=void 0){this.url=e,this.customHeaders=t,this.credentials=n,this.mustReload=!1;let r=``;`navigator`in globalThis&&(r=globalThis.navigator?.userAgent??``);let i=r.indexOf(`Windows`)>-1,a=/Chrome|Chromium|Edg|OPR|Brave/.test(r);this.chromeWindowsNoCache=!1,i&&a&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(e){this.customHeaders=e}getBytes(e,t,n,r){return V(this,null,function*(){let i,a;n?a=n:(i=new AbortController,a=i.signal);let o=new Headers(this.customHeaders);o.set(`range`,`bytes=${e}-${e+t-1}`);let s;this.mustReload?s=`reload`:this.chromeWindowsNoCache&&(s=`no-store`);let c=yield fetch(this.url,{signal:a,cache:s,headers:o,credentials:this.credentials});if(e===0&&c.status===416){let e=c.headers.get(`Content-Range`);if(!e||!e.startsWith(`bytes */`))throw Error(`Missing content-length on 416 response`);let t=+e.substr(8);o.set(`range`,`bytes=0-${t-1}`),c=yield fetch(this.url,{signal:a,cache:`reload`,headers:o,credentials:this.credentials})}let l=c.headers.get(`Etag`);if(l!=null&&l.startsWith(`W/`)&&(l=null),c.status===416||r&&l&&l!==r)throw this.mustReload=!0,new $(`Server returned non-matching ETag ${r} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(c.status>=300)throw Error(`Bad response code: ${c.status}`);let u=c.headers.get(`Content-Length`);if(c.status===200&&(!u||+u>t))throw i&&i.abort(),Error(`Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.`);return{data:yield c.arrayBuffer(),etag:l||void 0,cacheControl:c.headers.get(`Cache-Control`)||void 0,expires:c.headers.get(`Expires`)||void 0}})}};B(ve,`FetchSource`);var ye=ve;function Z(e,t){let n=e.getUint32(t+4,!0),r=e.getUint32(t+0,!0);return n*z(2,32)+r}B(Z,`getUint64`);function be(e,t){let n=new DataView(e),r=n.getUint8(7);if(r>3)throw Error(`Archive is spec version ${r} but this library supports up to spec version 3`);return{specVersion:r,rootDirectoryOffset:Z(n,8),rootDirectoryLength:Z(n,16),jsonMetadataOffset:Z(n,24),jsonMetadataLength:Z(n,32),leafDirectoryOffset:Z(n,40),leafDirectoryLength:Z(n,48),tileDataOffset:Z(n,56),tileDataLength:Z(n,64),numAddressedTiles:Z(n,72),numTileEntries:Z(n,80),numTileContents:Z(n,88),clustered:n.getUint8(96)===1,internalCompression:n.getUint8(97),tileCompression:n.getUint8(98),tileType:n.getUint8(99),minZoom:n.getUint8(100),maxZoom:n.getUint8(101),minLon:n.getInt32(102,!0)/1e7,minLat:n.getInt32(106,!0)/1e7,maxLon:n.getInt32(110,!0)/1e7,maxLat:n.getInt32(114,!0)/1e7,centerZoom:n.getUint8(118),centerLon:n.getInt32(119,!0)/1e7,centerLat:n.getInt32(123,!0)/1e7,etag:t}}B(be,`bytesToHeader`);function Q(e){let t={buf:new Uint8Array(e),pos:0},n=K(t),r=[],i=0;for(let e=0;e<n;e++){let e=K(t);r.push({tileId:i+e,offset:0,length:0,runLength:1}),i+=e}for(let e=0;e<n;e++)r[e].runLength=K(t);for(let e=0;e<n;e++)r[e].length=K(t);for(let e=0;e<n;e++){let n=K(t);n===0&&e>0?r[e].offset=r[e-1].offset+r[e-1].length:r[e].offset=n-1}return r}B(Q,`deserializeIndex`);var xe=class extends Error{};B(xe,`EtagMismatch`);var $=xe;function Se(e,t){return V(this,null,function*(){let n=yield e.getBytes(0,16384);if(new DataView(n.data).getUint16(0,!0)!==19792)throw Error(`Wrong magic number for PMTiles archive`);let r=be(n.data.slice(0,ge),n.etag),i=n.data.slice(r.rootDirectoryOffset,r.rootDirectoryOffset+r.rootDirectoryLength),a=`${e.getKey()}|${r.etag||``}|${r.rootDirectoryOffset}|${r.rootDirectoryLength}`,o=Q(yield t(i,r.internalCompression));return[r,[a,o.length,o]]})}B(Se,`getHeaderAndRoot`);function Ce(e,t,n,r,i,a){return V(this,null,function*(){let o=Q(yield t((yield e.getBytes(n,r,a,i.etag)).data,i.internalCompression));if(o.length===0)throw Error(`Empty directory is invalid`);return o})}B(Ce,`getDirectory`),B(class{constructor(e=100,t=!0,n=X){this.cache=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=n}getHeader(e){return V(this,null,function*(){let t=e.getKey(),n=this.cache.get(t);if(n)return n.lastUsed=this.counter++,n.data;let r=yield Se(e,this.decompress);return r[1]&&this.cache.set(r[1][0],{lastUsed:this.counter++,data:r[1][2]}),this.cache.set(t,{lastUsed:this.counter++,data:r[0]}),this.prune(),r[0]})}getDirectory(e,t,n,r,i){return V(this,null,function*(){let a=`${e.getKey()}|${r.etag||``}|${t}|${n}`,o=this.cache.get(a);if(o)return o.lastUsed=this.counter++,o.data;let s=yield Ce(e,this.decompress,t,n,r,i);return this.cache.set(a,{lastUsed:this.counter++,data:s}),this.prune(),s})}prune(){if(this.cache.size>this.maxCacheEntries){let e=1/0,t;this.cache.forEach((n,r)=>{n.lastUsed<e&&(e=n.lastUsed,t=r)}),t&&this.cache.delete(t)}}invalidate(e){return V(this,null,function*(){this.cache.delete(e.getKey())})}},`ResolvedValueCache`);var we=class{constructor(e=100,t=!0,n=X){this.cache=new Map,this.invalidations=new Map,this.pendingFetches=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=n}getHeader(e){return V(this,null,function*(){let t=e.getKey(),n=this.cache.get(t);if(n)return n.lastUsed=this.counter++,yield n.data;let r=new Promise((t,n)=>{Se(e,this.decompress).then(e=>{e[1]&&this.cache.set(e[1][0],{lastUsed:this.counter++,data:Promise.resolve(e[1][2])}),t(e[0]),this.prune()}).catch(e=>{n(e)})});return this.cache.set(t,{lastUsed:this.counter++,data:r}),r})}trackSignal(e,t,n){t.refs++,n.addEventListener(`abort`,()=>{--t.refs<=0&&this.pendingFetches.get(e)===t&&(t.controller.abort(),this.cache.delete(e),this.pendingFetches.delete(e))},{once:!0})}getDirectory(e,t,n,r,i){return V(this,null,function*(){let a=`${e.getKey()}|${r.etag||``}|${t}|${n}`,o=this.cache.get(a);if(o){o.lastUsed=this.counter++;let e=this.pendingFetches.get(a);return e&&this.trackSignal(a,e,i??new AbortController().signal),yield o.data}let s=new AbortController,c={controller:s,refs:0};this.trackSignal(a,c,i??new AbortController().signal),this.pendingFetches.set(a,c);let l=new Promise((i,o)=>{Ce(e,this.decompress,t,n,r,s.signal).then(e=>{this.pendingFetches.delete(a),i(e),this.prune()}).catch(e=>{o(e)})});return this.cache.set(a,{lastUsed:this.counter++,data:l}),l})}prune(){if(this.cache.size>=this.maxCacheEntries){let e=1/0,t;this.cache.forEach((n,r)=>{n.lastUsed<e&&(e=n.lastUsed,t=r)}),t&&this.cache.delete(t)}}invalidate(e){return V(this,null,function*(){let t=e.getKey();if(this.invalidations.get(t))return yield this.invalidations.get(t);this.cache.delete(e.getKey());let n=new Promise((n,r)=>{this.getHeader(e).then(e=>{n(),this.invalidations.delete(t)}).catch(e=>{r(e)})});this.invalidations.set(t,n)})}};B(we,`SharedPromiseCache`);var Te=we,Ee=class{constructor(e,t,n){this.source=typeof e==`string`?new ye(e):e,this.decompress=n||X,this.cache=t||new Te}getHeader(){return V(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(e,t,n,r){return V(this,null,function*(){let i=J(e,t,n),a=yield this.cache.getHeader(this.source);if(r?.throwIfAborted(),e<a.minZoom||e>a.maxZoom)return;let o=a.rootDirectoryOffset,s=a.rootDirectoryLength;for(let e=0;e<=3;e++){let e=yield this.cache.getDirectory(this.source,o,s,a,r);r?.throwIfAborted();let t=_e(e,i);if(t){if(t.runLength>0){let e=yield this.source.getBytes(a.tileDataOffset+t.offset,t.length,r,a.etag);return{data:yield this.decompress(e.data,a.tileCompression),cacheControl:e.cacheControl,expires:e.expires}}o=a.leafDirectoryOffset+t.offset,s=t.length}else return}throw Error(`Maximum directory depth exceeded`)})}getZxy(e,t,n,r){return V(this,null,function*(){try{return yield this.getZxyAttempt(e,t,n,r)}catch(i){if(i instanceof $)return this.cache.invalidate(this.source),yield this.getZxyAttempt(e,t,n,r);throw i}})}getMetadataAttempt(){return V(this,null,function*(){let e=yield this.cache.getHeader(this.source),t=yield this.source.getBytes(e.jsonMetadataOffset,e.jsonMetadataLength,void 0,e.etag),n=yield this.decompress(t.data,e.internalCompression),r=new TextDecoder(`utf-8`);return JSON.parse(r.decode(n))})}getMetadata(){return V(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(e){if(e instanceof $)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw e}})}getTileJson(e){return V(this,null,function*(){let t=yield this.getHeader(),n=yield this.getMetadata();return{tilejson:`3.0.0`,scheme:`xyz`,tiles:[`${e}/{z}/{x}/{y}${he(t.tileType)}`],vector_layers:n.vector_layers,attribution:n.attribution,description:n.description,name:n.name,version:n.version,bounds:[t.minLon,t.minLat,t.maxLon,t.maxLat],center:[t.centerLon,t.centerLat,t.centerZoom],minzoom:t.minZoom,maxzoom:t.maxZoom}})}};B(Ee,`PMTiles`);var De=Ee;t(u),n(`pmtiles`,new U().tile);var Oe=({style:e,position:t,zoom:n})=>(0,l.jsxs)(a,{mapLib:i,mapStyle:e,initialViewState:{...t,zoom:n},cooperativeGestures:!0,style:{width:`100%`,height:`100%`},children:[(0,l.jsx)(s,{showCompass:!1}),(0,l.jsx)(r,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,children:(0,l.jsx)(o,{"aria-hidden":!0,className:`size-8 fill-primary text-primary-foreground drop-shadow`,strokeWidth:1.5})})]});export{Oe as RecordMap};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{W as t,g as n,h as r}from"./app-BYw-8qpE.js";import{t as i}from"./react-Cvdyeg_0.js";import{n as a,o,r as s,s as c,t as l}from"./navigation-control-CGS0pamh.js";import{t as u}from"./jsx-runtime-NZYk81nU.js";var d=e(i(),1),f=e(u(),1),p=28,m={padding:48,maxZoom:15,duration:0},h=32,g=({style:e,points:i,selected:u,covered:g,onSelect:_,onClear:v,markerLabel:y})=>{let b=(0,d.useRef)(null),[x,S]=(0,d.useState)([]),C=new globalThis.Map(i.map(e=>[e.key,e])),w=i.map(e=>e.key).join(`,`),T=n(i),E=()=>{let e=b.current?.getMap();e&&S(r(i.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),p))};(0,d.useEffect)(()=>{let e=b.current?.getMap();e&&(T&&e.fitBounds(T,m),E())},[w]);let D=x.find(e=>u!==void 0&&e.keys.some(e=>u.includes(e)))?.at;return(0,d.useEffect)(()=>{let e=b.current?.getMap(),t=D===void 0?void 0:C.get(D);if(!e||!t||g===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-g;n>h&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(h-g)/2],duration:300})},[D,g]),(0,f.jsxs)(s,{ref:b,mapLib:o,mapStyle:e,initialViewState:T?{bounds:T,fitBoundsOptions:m}:{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:E,onZoomEnd:E,onClick:v,children:[(0,f.jsx)(l,{showCompass:!1}),x.map(e=>{let n=C.get(e.at);if(!n)return null;let r=u!==void 0&&e.keys.some(e=>u.includes(e));return(0,f.jsx)(a,{latitude:n.latitude,longitude:n.longitude,anchor:`bottom`,style:{zIndex:+!!r},children:(0,f.jsxs)(`button`,{type:`button`,"aria-label":y(e.keys),"aria-pressed":r,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),_(e.keys)},children:[(0,f.jsx)(c,{"aria-hidden":!0,className:t(`size-8 drop-shadow`,r?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:1.5}),e.keys.length>1&&(0,f.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{g as RecordsMap};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,B as n,C as r,D as i,E as a,F as o,H as s,I as c,K as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,U as v,V as y,_ as b,a as x,b as S,c as C,d as w,f as T,i as E,j as D,k as O,l as k,m as A,n as j,o as M,p as N,r as P,s as F,t as I,u as L,v as R,w as z,x as B,y as V}from"./app-BYw-8qpE.js";import{t as H}from"./jsx-runtime-NZYk81nU.js";var U=e(H(),1),W=({row:e,resource:t,recordKey:n,...r})=>{let i=A(),a=k(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,U.jsx)(b,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})};export{d as ActionCard,y as ApiProvider,I as App,b as AppLink,r as AssistantDock,c as ChatMessage,o as ChatThread,t as CompactTable,m as Composer,i as DiffView,D as FieldList,_ as PartView,W as RecordLink,f as SidePanel,a as StepList,u as definePlugin,h as defineUi,p as diffStats,j as isConflict,C as mergeUi,O as parseDiff,x as pluginApi,M as protobaseVersion,l as uiFromModule,B as useApiToken,R as useAppAddress,g as useAssistant,S as useAssistantClient,z as useBackendData,s as useClient,L as useFacets,w as useHistogram,k as useLayoutRecord,E as useList,N as useListDisplay,V as useMeta,F as usePlugin,n as useRecord,v as useResourceClient,T as useSeries,P as useUpdateRecord};
|