@feltmaps/js-sdk 1.5.0-next.3 → 1.5.0-next.5

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/handler.js CHANGED
@@ -1 +1 @@
1
- "use strict";var Z=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var _e=(o,i)=>{for(var C in i)Z(o,C,{get:i[C],enumerable:!0})},Qe=(o,i,C,T)=>{if(i&&typeof i=="object"||typeof i=="function")for(let b of De(i))!Ke.call(o,b)&&b!==C&&Z(o,b,{get:()=>i[b],enumerable:!(T=We(i,b))||T.enumerable});return o};var $e=o=>Qe(Z({},"__esModule",{value:!0}),o);var zo={};_e(zo,{createMessageHandler:()=>bo});module.exports=$e(zo);var m=require("zod");var x=require("zod");var u=require("zod");function t(o,i){return u.z.strictObject({type:u.z.literal(o),params:i})}function I(o,i){return u.z.strictObject({eventName:u.z.literal(o),id:u.z.string(),options:i})}function d(o){return u.z.strictObject({eventName:u.z.literal(o),id:u.z.string()})}var n=require("zod"),v=n.z.number(),V=n.z.number(),U=n.z.object({latitude:V,longitude:v}),P=n.z.tuple([v,V]),me=n.z.object({type:n.z.literal("Point"),coordinates:P}),Je=n.z.object({type:n.z.literal("LineString"),coordinates:n.z.array(P)}),L=n.z.object({type:n.z.literal("MultiLineString"),coordinates:n.z.array(Je.shape.coordinates)}),ce=n.z.number().min(1).max(23),k=n.z.tuple([v,V,v,V]),E=n.z.object({show:n.z.array(n.z.string()).optional(),hide:n.z.array(n.z.string()).optional()});var e=require("zod");var y=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.union([e.z.string(),e.z.null()]),description:e.z.union([e.z.string(),e.z.null()]),attributes:e.z.record(e.z.string(),e.z.unknown())}),R=e.z.object({imageUrl:e.z.string().nullable()}),B=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),Xe=e.z.enum(["meter","kilometer","foot","mile"]),H=y.extend(R.shape).extend({type:e.z.literal("Place"),coordinates:me.shape.coordinates,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),A=y.extend(R.shape).extend(B.shape).extend({type:e.z.literal("Path"),coordinates:L.shape.coordinates,distanceMarker:e.z.boolean(),endCaps:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable()}),W=y.extend(R.shape).extend(B.shape).extend({type:e.z.literal("Polygon"),coordinates:L.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),D=y.extend(R.shape).extend(B.shape).extend({type:e.z.literal("Circle"),coordinates:P,radius:e.z.number(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:Xe.nullable(),fillOpacity:e.z.number().min(0).max(1),radiusMarker:e.z.boolean()}),K=y.extend({type:e.z.literal("Marker"),coordinates:L.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100)}),_=y.extend({type:e.z.literal("Highlighter"),coordinates:L.shape.coordinates,opacity:e.z.number().min(0).max(1)}),de=e.z.object({position:P,rotation:e.z.number(),scale:e.z.number(),coordinates:L.shape.coordinates}),ye=e.z.object({text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),Q=y.extend(de.shape).extend(ye.shape).extend({type:e.z.literal("Text")}),$=y.extend(de.shape).extend(ye.shape).extend({type:e.z.literal("Note"),widthMultiplier:e.z.number().min(0)}),J=y.extend({type:e.z.literal("Image"),coordinates:L.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}),Ye=y.extend({type:e.z.literal("Link"),coordinates:L.shape.coordinates,url:e.z.string()}),h={type:!0,coordinates:!0},f={id:!0},X=H.partial().required(h).omit(f),O=A.partial().required(h).omit(f),Y=W.partial().required(h).omit(f),ee=D.partial().required(h).required({radius:!0}).omit(f),te=K.partial().required(h).omit(f),oe=_.partial().required(h).omit(f),re=Q.partial().required(h).required({text:!0}).omit(f).omit({coordinates:!0,name:!0}),ne=$.partial().required(h).required({text:!0}).omit(f).omit({coordinates:!0,name:!0}),et=J.partial().required(h).required({imageUrl:!0}).omit(f),ge=e.z.discriminatedUnion("type",[X,O,Y,ee,te,oe,et,re,ne]),Vo=H.omit({coordinates:!0}),Uo=A.omit({coordinates:!0}),Ro=W.omit({coordinates:!0}),Oo=D.omit({coordinates:!0}),No=K.omit({coordinates:!0}),jo=_.omit({coordinates:!0}),qo=Q.omit({coordinates:!0}),Zo=$.omit({coordinates:!0}),Bo=J.omit({coordinates:!0}),Ho=Ye.omit({coordinates:!0}),S={type:!0,id:!0},tt=H.partial().required(S),ot=A.partial().required(S),rt=W.partial().required(S),nt=D.partial().required(S),at=K.partial().required(S),it=_.partial().required(S),st=Q.partial().required(S),lt=$.partial().required(S),pt=J.partial().required(S),ue=e.z.discriminatedUnion("type",[tt,ot,rt,nt,at,it,st,lt,pt]),he=e.z.object({ids:e.z.array(e.z.string()).optional()}),fe=e.z.object({ids:e.z.array(e.z.string()).optional()});var mt=t("getElement",x.z.string()),ct=t("getElementGeometry",x.z.string()),dt=t("getElements",he.optional()),yt=t("getElementGroup",x.z.string()),gt=t("getElementGroups",fe.optional()),ut=t("setElementGroupVisibility",E),ht=I("onElementChange",x.z.object({id:x.z.string()})),ft=I("onElementGroupChange",x.z.object({id:x.z.string()})),St=t("createElement",ge),xt=t("updateElement",ue),Mt=t("deleteElement",x.z.string()),Se={methods:[mt,ct,dt,yt,gt,ut,St,xt,Mt],listeners:[ht,ft]};var bt=d("onPointerClick"),Lt=d("onPointerMove"),xe={methods:null,listeners:[bt,Lt]};var s=require("zod");var r=require("zod"),Ct=r.z.enum(["in","ni"]),It=r.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Jo=r.z.enum(["and","or"]),Me=r.z.union([r.z.number(),r.z.string(),r.z.boolean(),r.z.null()]),be=r.z.string().or(r.z.null()),Et=r.z.tuple([be,Ct,r.z.array(Me).or(r.z.null())]),Tt=r.z.tuple([be,It,Me]),ae=r.z.union([Et,Tt]),ie=r.z.tuple([r.z.lazy(()=>r.z.union([ie,ae,r.z.null(),r.z.boolean()])),r.z.enum(["and","or"]),r.z.lazy(()=>r.z.union([ie,ae,r.z.null(),r.z.boolean()]))]),Le=r.z.union([ie,ae,r.z.null(),r.z.boolean()]);var a=require("zod");var er=a.z.enum(["processing","completed","failed","incomplete"]),Ce=a.z.object({ids:a.z.array(a.z.string()).optional()}),Ie=a.z.object({ids:a.z.array(a.z.string()).optional()}),G=a.z.object({id:a.z.string(),layerId:a.z.string()}),Ee=a.z.object({ids:G.array().optional(),layerIds:a.z.string().array().optional()}),Te=a.z.object({layerIds:a.z.array(a.z.string()).optional(),areaQuery:a.z.union([a.z.object({coordinates:U}),a.z.object({boundary:k})]).optional()});var Gt=t("getLayer",s.z.string()),zt=t("getLayers",Ce.optional()),Pt=t("setLayerVisibility",E),kt=I("onLayerChange",s.z.object({id:s.z.string()})),Ft=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),wt=t("setLayerLegendVisibility",E),vt=t("getLayerGroup",s.z.string()),Vt=t("getLayerGroups",Ie.optional()),Ut=t("setLayerGroupVisibility",E),Rt=t("setLayerGroupLegendVisibility",E),Ot=I("onLayerGroupChange",s.z.object({id:s.z.string()})),Nt=t("getLegendItem",G),jt=t("getLegendItems",Ee.optional()),qt=I("onLegendItemChange",G),Zt=t("setLegendItemVisibility",s.z.object({show:G.array().optional(),hide:G.array().optional()})),Bt=t("getLayerFilters",s.z.string()),Ht=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:Le,note:s.z.string().optional()})),At=t("getRenderedFeatures",Te.optional()),Ge={methods:[Gt,zt,Pt,Ft,wt,vt,Vt,Ut,Rt,Nt,jt,Zt,Bt,Ht,At],listeners:[kt,Ot,qt]};var F=require("zod");var M=require("zod"),ze=M.z.object({id:M.z.string().or(M.z.number()),layerId:M.z.string(),showPopup:M.z.boolean().optional(),fitViewport:M.z.boolean().or(M.z.object({maxZoom:M.z.number()})).optional()});var Wt=t("getSelection",F.z.undefined()),Dt=d("onSelectionChange"),Kt=t("selectFeature",ze),_t=t("clearSelection",F.z.object({features:F.z.boolean().optional(),elements:F.z.boolean().optional()}).optional()),Pe={methods:[Wt,Kt,_t],listeners:[Dt]};var Ve=require("zod");var l=require("zod");var ke=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Fe=l.z.enum([...ke,"link"]),we=l.z.enum(ke),Qt=X.pick({color:!0,symbol:!0,frame:!0}).required(),$t=O.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Jt=O.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Xt=Y.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Yt=ee.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),eo=te.pick({color:!0,opacity:!0,size:!0}).required(),to=oe.pick({color:!0,opacity:!0}).extend({size:l.z.number().min(0).max(200)}).required(),oo=re.pick({color:!0,align:!0,style:!0}).required(),ro=ne.pick({color:!0,align:!0,style:!0}).required(),ve=l.z.discriminatedUnion("tool",[Qt.partial().extend({tool:l.z.literal("pin")}),$t.partial().extend({tool:l.z.literal("line")}),Jt.partial().extend({tool:l.z.literal("route")}),Xt.partial().extend({tool:l.z.literal("polygon")}),Yt.partial().extend({tool:l.z.literal("circle")}),eo.partial().extend({tool:l.z.literal("marker")}),to.partial().extend({tool:l.z.literal("highlighter")}),oo.partial().extend({tool:l.z.literal("text")}),ro.partial().extend({tool:l.z.literal("note")})]);var no=t("setTool",Fe.nullable()),ao=t("getTool",Ve.z.undefined()),io=d("onToolChange"),so=t("setToolSettings",ve),lo=t("getToolSettings",we),po=d("onToolSettingsChange"),Ue={methods:[no,ao,so,lo],listeners:[io,po]};var p=require("zod"),Re=p.z.object({showLegend:p.z.boolean().optional(),cooperativeGestures:p.z.boolean().optional(),fullScreenButton:p.z.boolean().optional(),geolocation:p.z.boolean().optional(),zoomControls:p.z.boolean().optional(),scaleBar:p.z.boolean().optional()}),Oe=p.z.object({featureSelectPanel:p.z.boolean().optional(),featureHoverPanel:p.z.boolean().optional(),elementSelectPanel:p.z.boolean().optional(),linkClickOpen:p.z.boolean().optional(),imageLightboxOpen:p.z.boolean().optional()});var mo=t("updateUiControls",Re),co=t("setOnMapInteractionsUi",Oe),Ne={methods:[mo,co],listeners:null};var se=require("zod");var w=require("zod");var N=w.z.object({center:U,zoom:ce}),je=w.z.object({center:N.shape.center.optional(),zoom:N.shape.zoom.optional()}),qe=w.z.object({minZoom:N.shape.zoom.nullish(),maxZoom:N.shape.zoom.nullish(),bounds:k.nullish()}).nullable(),Ze=w.z.object({bounds:k});var yo=t("getViewport",se.z.undefined()),go=t("setViewport",je),uo=t("getViewportConstraints",se.z.undefined()),ho=t("setViewportConstraints",qe),fo=t("fitViewportToBounds",Ze),So=d("onViewportMove"),xo=d("onViewportMoveEnd"),Mo=d("onMapIdle"),Be={methods:[go,yo,uo,ho,fo],listeners:[So,xo,Mo]};var le=[Ne,Be,Ge,Se,Pe,xe,Ue];function bo(o,i,C){let T=new Map;async function b(g){if(!Go.safeParse(g.data).success){C?.onUnknownMessage?.(g.data);return}let pe=Ae.safeParse(g.data);if(!pe.success){C?.onInvalidMessage?.(g.data);return}let{data:c}=pe;if(c.type==="felt.ready")g.ports[0]?.postMessage(!0);else if(c.type==="felt.addListener"){if(c.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let z="options"in c.event?{options:"options"in c.event?c.event.options:void 0,handler:q=>{g.ports[0]?.postMessage(q)}}:{handler:q=>{g.ports[0]?.postMessage(q)}},j=i.listeners[c.event.eventName](z);T.set(c.event.id,j)}else if(c.type==="felt.removeListener")T.get(c.id)?.(),T.delete(c.id);else try{let z=i.methods[c.type],j=await z(c.params);g.ports[0]?.postMessage(j)}catch(z){g.ports[0]?.postMessage({__error__:Lo(z)})}}return o.addEventListener("message",b),()=>{o.removeEventListener("message",b)}}function Lo(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}var He={methods:le.map(o=>o.methods??[]).flat(),listeners:le.map(o=>o.listeners??[]).flat()},Co=m.z.discriminatedUnion("eventName",[m.z.strictObject({eventName:m.z.literal("")}),...He.listeners]),Io=m.z.strictObject({type:m.z.literal("felt.addListener"),event:Co}),Eo=m.z.strictObject({type:m.z.literal("felt.removeListener"),id:m.z.string()}),To=m.z.strictObject({type:m.z.literal("felt.ready")}),Ae=m.z.discriminatedUnion("type",[To,Io,Eo,...He.methods]),Go=m.z.object({type:m.z.enum(Ae.options.map(o=>o.shape.type.value))});0&&(module.exports={createMessageHandler});
1
+ "use strict";var Z=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Qe=Object.prototype.hasOwnProperty;var $e=(o,i)=>{for(var I in i)Z(o,I,{get:i[I],enumerable:!0})},Je=(o,i,I,T)=>{if(i&&typeof i=="object"||typeof i=="function")for(let b of _e(i))!Qe.call(o,b)&&b!==I&&Z(o,b,{get:()=>i[b],enumerable:!(T=Ke(i,b))||T.enumerable});return o};var Xe=o=>Je(Z({},"__esModule",{value:!0}),o);var Vo={};$e(Vo,{createMessageHandler:()=>To});module.exports=Xe(Vo);var c=require("zod");var y=require("zod");var h=require("zod");function t(o,i){return h.z.strictObject({type:h.z.literal(o),params:i})}function L(o,i){return h.z.strictObject({eventName:h.z.literal(o),id:h.z.string(),options:i})}function l(o){return h.z.strictObject({eventName:h.z.literal(o),id:h.z.string()})}var r=require("zod"),V=r.z.number(),v=r.z.number(),O=r.z.object({latitude:v,longitude:V}),P=r.z.tuple([V,v]),me=r.z.object({type:r.z.literal("Point"),coordinates:P}),Ye=r.z.object({type:r.z.literal("LineString"),coordinates:r.z.array(P)}),C=r.z.object({type:r.z.literal("MultiLineString"),coordinates:r.z.array(Ye.shape.coordinates)}),ce=r.z.number().min(1).max(23),k=r.z.tuple([V,v,V,v]),E=r.z.object({show:r.z.array(r.z.string()).optional(),hide:r.z.array(r.z.string()).optional()});var e=require("zod");var g=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.union([e.z.string(),e.z.null()]),description:e.z.union([e.z.string(),e.z.null()]),attributes:e.z.record(e.z.string(),e.z.unknown())}),U=e.z.object({imageUrl:e.z.string().nullable()}),B=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),et=e.z.enum(["meter","kilometer","foot","mile"]),H=g.extend(U.shape).extend({type:e.z.literal("Place"),coordinates:me.shape.coordinates,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),A=g.extend(U.shape).extend(B.shape).extend({type:e.z.literal("Path"),coordinates:C.shape.coordinates,distanceMarker:e.z.boolean(),endCaps:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable()}),D=g.extend(U.shape).extend(B.shape).extend({type:e.z.literal("Polygon"),coordinates:C.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),W=g.extend(U.shape).extend(B.shape).extend({type:e.z.literal("Circle"),coordinates:P,radius:e.z.number(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:et.nullable(),fillOpacity:e.z.number().min(0).max(1),radiusMarker:e.z.boolean()}),K=g.extend({type:e.z.literal("Marker"),coordinates:C.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),_=g.extend({type:e.z.literal("Highlighter"),coordinates:C.shape.coordinates,opacity:e.z.number().min(0).max(1)}),de=e.z.object({position:P,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),coordinates:C.shape.coordinates}),ye=e.z.object({text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),Q=g.extend(de.shape).extend(ye.shape).extend({type:e.z.literal("Text")}),$=g.extend(de.shape).extend(ye.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),J=g.extend({type:e.z.literal("Image"),coordinates:C.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),tt=g.extend({type:e.z.literal("Link"),coordinates:C.shape.coordinates,url:e.z.string()}),f={type:!0,coordinates:!0},S={id:!0},X=H.partial().required(f).omit(S),R=A.partial().required(f).omit(S),Y=D.partial().required(f).omit(S),ee=W.partial().required(f).required({radius:!0}).omit(S),te=K.partial().required(f).omit(S),oe=_.partial().required(f).omit(S),ne=Q.partial().required(f).required({text:!0}).omit(S).omit({coordinates:!0,name:!0}),re=$.partial().required(f).required({text:!0}).omit(S).omit({coordinates:!0,name:!0}),ot=J.partial().required(f).required({imageUrl:!0}).omit(S),ge=e.z.discriminatedUnion("type",[X,R,Y,ee,te,oe,ot,ne,re]),jo=H.omit({coordinates:!0}),qo=A.omit({coordinates:!0}),Zo=D.omit({coordinates:!0}),Bo=W.omit({coordinates:!0}),Ho=K.omit({coordinates:!0}),Ao=_.omit({coordinates:!0}),Do=Q.omit({coordinates:!0}),Wo=$.omit({coordinates:!0}),Ko=J.omit({coordinates:!0}),_o=tt.omit({coordinates:!0}),x={type:!0,id:!0},nt=H.partial().required(x),rt=A.partial().required(x),at=D.partial().required(x),it=W.partial().required(x),st=K.partial().required(x),lt=_.partial().required(x),pt=Q.partial().required(x).omit({coordinates:!0,name:!0}),mt=$.partial().required(x).omit({coordinates:!0,name:!0}),ct=J.partial().required(x),ue=e.z.discriminatedUnion("type",[nt,rt,at,it,st,lt,pt,mt,ct]),he=e.z.object({ids:e.z.array(e.z.string()).optional()}),fe=e.z.object({ids:e.z.array(e.z.string()).optional()});var dt=t("getElement",y.z.string()),yt=t("getElementGeometry",y.z.string()),gt=t("getElements",he.optional()),ut=t("getElementGroup",y.z.string()),ht=t("getElementGroups",fe.optional()),ft=t("setElementGroupVisibility",E),St=L("onElementChange",y.z.object({id:y.z.string()})),xt=l("onElementCreate"),Mt=L("onElementDelete",y.z.object({id:y.z.string()})),bt=L("onElementGroupChange",y.z.object({id:y.z.string()})),Lt=t("createElement",ge),Ct=t("updateElement",ue),It=t("deleteElement",y.z.string()),Se={methods:[dt,yt,gt,ut,ht,ft,Lt,Ct,It],listeners:[St,xt,Mt,bt]};var Et=l("onPointerClick"),Tt=l("onPointerMove"),xe={methods:null,listeners:[Et,Tt]};var s=require("zod");var n=require("zod"),Gt=n.z.enum(["in","ni"]),zt=n.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),on=n.z.enum(["and","or"]),Me=n.z.union([n.z.number(),n.z.string(),n.z.boolean(),n.z.null()]),be=n.z.string().or(n.z.null()),Pt=n.z.tuple([be,Gt,n.z.array(Me).or(n.z.null())]),kt=n.z.tuple([be,zt,Me]),ae=n.z.union([Pt,kt]),ie=n.z.tuple([n.z.lazy(()=>n.z.union([ie,ae,n.z.null(),n.z.boolean()])),n.z.enum(["and","or"]),n.z.lazy(()=>n.z.union([ie,ae,n.z.null(),n.z.boolean()]))]),Le=n.z.union([ie,ae,n.z.null(),n.z.boolean()]);var a=require("zod");var an=a.z.enum(["processing","completed","failed","incomplete"]),Ce=a.z.object({ids:a.z.array(a.z.string()).optional()}),Ie=a.z.object({ids:a.z.array(a.z.string()).optional()}),G=a.z.object({id:a.z.string(),layerId:a.z.string()}),Ee=a.z.object({ids:G.array().optional(),layerIds:a.z.string().array().optional()}),Te=a.z.object({layerIds:a.z.array(a.z.string()).optional(),areaQuery:a.z.union([a.z.object({coordinates:O}),a.z.object({boundary:k})]).optional()});var Ft=t("getLayer",s.z.string()),wt=t("getLayers",Ce.optional()),Vt=t("setLayerVisibility",E),vt=L("onLayerChange",s.z.object({id:s.z.string()})),Ot=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),Ut=t("setLayerLegendVisibility",E),Rt=t("getLayerGroup",s.z.string()),Nt=t("getLayerGroups",Ie.optional()),jt=t("setLayerGroupVisibility",E),qt=t("setLayerGroupLegendVisibility",E),Zt=L("onLayerGroupChange",s.z.object({id:s.z.string()})),Bt=t("getLegendItem",G),Ht=t("getLegendItems",Ee.optional()),At=L("onLegendItemChange",G),Dt=t("setLegendItemVisibility",s.z.object({show:G.array().optional(),hide:G.array().optional()})),Wt=t("getLayerFilters",s.z.string()),Kt=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:Le,note:s.z.string().optional()})),_t=t("getRenderedFeatures",Te.optional()),Ge={methods:[Ft,wt,Vt,Ot,Ut,Rt,Nt,jt,qt,Bt,Ht,Dt,Wt,Kt,_t],listeners:[vt,Zt,At]};var ze=require("zod");var Qt=t("getMapDetails",ze.z.undefined()),Pe={methods:[Qt],listeners:[]};var F=require("zod");var M=require("zod"),ke=M.z.object({id:M.z.string().or(M.z.number()),layerId:M.z.string(),showPopup:M.z.boolean().optional(),fitViewport:M.z.boolean().or(M.z.object({maxZoom:M.z.number()})).optional()});var $t=t("getSelection",F.z.undefined()),Jt=l("onSelectionChange"),Xt=t("selectFeature",ke),Yt=t("clearSelection",F.z.object({features:F.z.boolean().optional(),elements:F.z.boolean().optional()}).optional()),Fe={methods:[$t,Xt,Yt],listeners:[Jt]};var Ue=require("zod");var p=require("zod");var we=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Ve=p.z.enum([...we,"link"]),ve=p.z.enum(we),eo=X.pick({color:!0,symbol:!0,frame:!0}).required(),to=R.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),oo=R.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),no=Y.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),ro=ee.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),ao=te.pick({color:!0,opacity:!0,size:!0}).required(),io=oe.pick({color:!0,opacity:!0}).extend({size:p.z.number().min(0).max(200)}).required(),so=ne.pick({color:!0,align:!0,style:!0}).required(),lo=re.pick({color:!0,align:!0,style:!0}).required(),Oe=p.z.discriminatedUnion("tool",[eo.partial().extend({tool:p.z.literal("pin")}),to.partial().extend({tool:p.z.literal("line")}),oo.partial().extend({tool:p.z.literal("route")}),no.partial().extend({tool:p.z.literal("polygon")}),ro.partial().extend({tool:p.z.literal("circle")}),ao.partial().extend({tool:p.z.literal("marker")}),io.partial().extend({tool:p.z.literal("highlighter")}),so.partial().extend({tool:p.z.literal("text")}),lo.partial().extend({tool:p.z.literal("note")})]);var po=t("setTool",Ve.nullable()),mo=t("getTool",Ue.z.undefined()),co=l("onToolChange"),yo=t("setToolSettings",Oe),go=t("getToolSettings",ve),uo=l("onToolSettingsChange"),Re={methods:[po,mo,yo,go],listeners:[co,uo]};var m=require("zod"),Ne=m.z.object({showLegend:m.z.boolean().optional(),cooperativeGestures:m.z.boolean().optional(),fullScreenButton:m.z.boolean().optional(),geolocation:m.z.boolean().optional(),zoomControls:m.z.boolean().optional(),scaleBar:m.z.boolean().optional()}),je=m.z.object({featureSelectPanel:m.z.boolean().optional(),featureHoverPanel:m.z.boolean().optional(),elementSelectPanel:m.z.boolean().optional(),linkClickOpen:m.z.boolean().optional(),imageLightboxOpen:m.z.boolean().optional()});var ho=t("updateUiControls",Ne),fo=t("setOnMapInteractionsUi",je),qe={methods:[ho,fo],listeners:null};var se=require("zod");var w=require("zod");var N=w.z.object({center:O,zoom:ce}),Ze=w.z.object({center:N.shape.center.optional(),zoom:N.shape.zoom.optional()}),Be=w.z.object({minZoom:N.shape.zoom.nullish(),maxZoom:N.shape.zoom.nullish(),bounds:k.nullish()}).nullable(),He=w.z.object({bounds:k});var So=t("getViewport",se.z.undefined()),xo=t("setViewport",Ze),Mo=t("getViewportConstraints",se.z.undefined()),bo=t("setViewportConstraints",Be),Lo=t("fitViewportToBounds",He),Co=l("onViewportMove"),Io=l("onViewportMoveEnd"),Eo=l("onMapIdle"),Ae={methods:[xo,So,Mo,bo,Lo],listeners:[Co,Io,Eo]};var le=[qe,Ae,Ge,Se,Fe,xe,Re,Pe];function To(o,i,I){let T=new Map;async function b(u){if(!wo.safeParse(u.data).success){I?.onUnknownMessage?.(u.data);return}let pe=We.safeParse(u.data);if(!pe.success){I?.onInvalidMessage?.(u.data);return}let{data:d}=pe;if(d.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(d.type==="felt.addListener"){if(d.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let z="options"in d.event?{options:"options"in d.event?d.event.options:void 0,handler:q=>{u.ports[0]?.postMessage(q)}}:{handler:q=>{u.ports[0]?.postMessage(q)}},j=i.listeners[d.event.eventName](z);T.set(d.event.id,j)}else if(d.type==="felt.removeListener")T.get(d.id)?.(),T.delete(d.id);else try{let z=i.methods[d.type],j=await z(d.params);u.ports[0]?.postMessage(j)}catch(z){u.ports[0]?.postMessage({__error__:Go(z)})}}return o.addEventListener("message",b),()=>{o.removeEventListener("message",b)}}function Go(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}var De={methods:le.map(o=>o.methods??[]).flat(),listeners:le.map(o=>o.listeners??[]).flat()},zo=c.z.discriminatedUnion("eventName",[c.z.strictObject({eventName:c.z.literal("")}),...De.listeners]),Po=c.z.strictObject({type:c.z.literal("felt.addListener"),event:zo}),ko=c.z.strictObject({type:c.z.literal("felt.removeListener"),id:c.z.string()}),Fo=c.z.strictObject({type:c.z.literal("felt.ready")}),We=c.z.discriminatedUnion("type",[Fo,Po,ko,...De.methods]),wo=c.z.object({type:c.z.enum(We.options.map(o=>o.shape.type.value))});0&&(module.exports={createMessageHandler});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feltmaps/js-sdk",
3
- "version": "1.5.0-next.3",
3
+ "version": "1.5.0-next.5",
4
4
  "description": "An SDK for Felt maps",
5
5
  "keywords": [
6
6
  "felt",
@@ -207,6 +207,7 @@ declare const MarkerCreateSchema: z.ZodObject<Omit<{
207
207
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
208
208
  opacity: z.ZodOptional<z.ZodNumber>;
209
209
  size: z.ZodOptional<z.ZodNumber>;
210
+ zoom: z.ZodOptional<z.ZodNumber>;
210
211
  }, "id">, "strip", z.ZodTypeAny, {
211
212
  type: "Marker";
212
213
  coordinates: [number, number][][];
@@ -217,6 +218,7 @@ declare const MarkerCreateSchema: z.ZodObject<Omit<{
217
218
  attributes?: Record<string, unknown> | undefined;
218
219
  opacity?: number | undefined;
219
220
  size?: number | undefined;
221
+ zoom?: number | undefined;
220
222
  }, {
221
223
  type: "Marker";
222
224
  coordinates: [number, number][][];
@@ -227,6 +229,7 @@ declare const MarkerCreateSchema: z.ZodObject<Omit<{
227
229
  attributes?: Record<string, unknown> | undefined;
228
230
  opacity?: number | undefined;
229
231
  size?: number | undefined;
232
+ zoom?: number | undefined;
230
233
  }>;
231
234
  declare const HighlighterCreateSchema: z.ZodObject<Omit<{
232
235
  type: z.ZodLiteral<"Highlighter">;
@@ -266,6 +269,7 @@ declare const TextCreateSchema: z.ZodObject<Omit<Omit<{
266
269
  name: z.ZodOptional<z.ZodString>;
267
270
  description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
268
271
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
272
+ zoom: z.ZodOptional<z.ZodNumber>;
269
273
  position: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
270
274
  rotation: z.ZodOptional<z.ZodNumber>;
271
275
  scale: z.ZodOptional<z.ZodNumber>;
@@ -279,6 +283,7 @@ declare const TextCreateSchema: z.ZodObject<Omit<Omit<{
279
283
  color?: string | undefined;
280
284
  description?: string | null | undefined;
281
285
  attributes?: Record<string, unknown> | undefined;
286
+ zoom?: number | undefined;
282
287
  position?: [number, number] | undefined;
283
288
  rotation?: number | undefined;
284
289
  scale?: number | undefined;
@@ -291,6 +296,7 @@ declare const TextCreateSchema: z.ZodObject<Omit<Omit<{
291
296
  color?: string | undefined;
292
297
  description?: string | null | undefined;
293
298
  attributes?: Record<string, unknown> | undefined;
299
+ zoom?: number | undefined;
294
300
  position?: [number, number] | undefined;
295
301
  rotation?: number | undefined;
296
302
  scale?: number | undefined;
@@ -306,13 +312,14 @@ declare const NoteCreateSchema: z.ZodObject<Omit<Omit<{
306
312
  name: z.ZodOptional<z.ZodString>;
307
313
  description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
308
314
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
315
+ zoom: z.ZodOptional<z.ZodNumber>;
309
316
  position: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
310
317
  rotation: z.ZodOptional<z.ZodNumber>;
311
318
  scale: z.ZodOptional<z.ZodNumber>;
312
319
  text: z.ZodString;
313
320
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
314
321
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
315
- widthMultiplier: z.ZodOptional<z.ZodNumber>;
322
+ widthScale: z.ZodOptional<z.ZodNumber>;
316
323
  }, "id">, "coordinates" | "name">, "strip", z.ZodTypeAny, {
317
324
  type: "Note";
318
325
  text: string;
@@ -320,12 +327,13 @@ declare const NoteCreateSchema: z.ZodObject<Omit<Omit<{
320
327
  color?: string | undefined;
321
328
  description?: string | null | undefined;
322
329
  attributes?: Record<string, unknown> | undefined;
330
+ zoom?: number | undefined;
323
331
  position?: [number, number] | undefined;
324
332
  rotation?: number | undefined;
325
333
  scale?: number | undefined;
326
334
  align?: "left" | "center" | "right" | undefined;
327
335
  style?: "italic" | "light" | "regular" | "caps" | undefined;
328
- widthMultiplier?: number | undefined;
336
+ widthScale?: number | undefined;
329
337
  }, {
330
338
  type: "Note";
331
339
  text: string;
@@ -333,19 +341,19 @@ declare const NoteCreateSchema: z.ZodObject<Omit<Omit<{
333
341
  color?: string | undefined;
334
342
  description?: string | null | undefined;
335
343
  attributes?: Record<string, unknown> | undefined;
344
+ zoom?: number | undefined;
336
345
  position?: [number, number] | undefined;
337
346
  rotation?: number | undefined;
338
347
  scale?: number | undefined;
339
348
  align?: "left" | "center" | "right" | undefined;
340
349
  style?: "italic" | "light" | "regular" | "caps" | undefined;
341
- widthMultiplier?: number | undefined;
350
+ widthScale?: number | undefined;
342
351
  }>;
343
352
  declare const ImageCreateSchema: z.ZodObject<Omit<{
344
353
  type: z.ZodLiteral<"Image">;
345
354
  coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
346
355
  id: z.ZodOptional<z.ZodString>;
347
356
  groupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
- color: z.ZodOptional<z.ZodString>;
349
357
  name: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
350
358
  description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
351
359
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -356,7 +364,6 @@ declare const ImageCreateSchema: z.ZodObject<Omit<{
356
364
  coordinates: [number, number][][];
357
365
  imageUrl: string;
358
366
  groupId?: string | null | undefined;
359
- color?: string | undefined;
360
367
  name?: string | null | undefined;
361
368
  description?: string | null | undefined;
362
369
  attributes?: Record<string, unknown> | undefined;
@@ -366,7 +373,6 @@ declare const ImageCreateSchema: z.ZodObject<Omit<{
366
373
  coordinates: [number, number][][];
367
374
  imageUrl: string;
368
375
  groupId?: string | null | undefined;
369
- color?: string | undefined;
370
376
  name?: string | null | undefined;
371
377
  description?: string | null | undefined;
372
378
  attributes?: Record<string, unknown> | undefined;
@@ -577,6 +583,7 @@ declare const MarkerReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
577
583
  coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
578
584
  opacity: z.ZodNumber;
579
585
  size: z.ZodNumber;
586
+ zoom: z.ZodNumber;
580
587
  }>, "coordinates">, "strip", z.ZodTypeAny, {
581
588
  type: "Marker";
582
589
  id: string;
@@ -587,6 +594,7 @@ declare const MarkerReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
587
594
  attributes: Record<string, unknown>;
588
595
  opacity: number;
589
596
  size: number;
597
+ zoom: number;
590
598
  }, {
591
599
  type: "Marker";
592
600
  id: string;
@@ -597,6 +605,7 @@ declare const MarkerReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
597
605
  attributes: Record<string, unknown>;
598
606
  opacity: number;
599
607
  size: number;
608
+ zoom: number;
600
609
  }>;
601
610
  declare const HighlighterReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
602
611
  id: z.ZodString;
@@ -639,6 +648,7 @@ declare const TextReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
639
648
  position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
640
649
  rotation: z.ZodNumber;
641
650
  scale: z.ZodNumber;
651
+ zoom: z.ZodNumber;
642
652
  coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
643
653
  }>, {
644
654
  text: z.ZodString;
@@ -655,6 +665,7 @@ declare const TextReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
655
665
  name: string;
656
666
  description: string | null;
657
667
  attributes: Record<string, unknown>;
668
+ zoom: number;
658
669
  position: [number, number];
659
670
  rotation: number;
660
671
  scale: number;
@@ -669,6 +680,7 @@ declare const TextReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
669
680
  name: string;
670
681
  description: string | null;
671
682
  attributes: Record<string, unknown>;
683
+ zoom: number;
672
684
  position: [number, number];
673
685
  rotation: number;
674
686
  scale: number;
@@ -687,6 +699,7 @@ declare const NoteReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
687
699
  position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
688
700
  rotation: z.ZodNumber;
689
701
  scale: z.ZodNumber;
702
+ zoom: z.ZodNumber;
690
703
  coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
691
704
  }>, {
692
705
  text: z.ZodString;
@@ -695,7 +708,7 @@ declare const NoteReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
695
708
  name: z.ZodString;
696
709
  }>, {
697
710
  type: z.ZodLiteral<"Note">;
698
- widthMultiplier: z.ZodNumber;
711
+ widthScale: z.ZodNumber;
699
712
  }>, "coordinates">, "strip", z.ZodTypeAny, {
700
713
  type: "Note";
701
714
  id: string;
@@ -704,13 +717,14 @@ declare const NoteReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
704
717
  name: string;
705
718
  description: string | null;
706
719
  attributes: Record<string, unknown>;
720
+ zoom: number;
707
721
  position: [number, number];
708
722
  rotation: number;
709
723
  scale: number;
710
724
  text: string;
711
725
  align: "left" | "center" | "right";
712
726
  style: "italic" | "light" | "regular" | "caps";
713
- widthMultiplier: number;
727
+ widthScale: number;
714
728
  }, {
715
729
  type: "Note";
716
730
  id: string;
@@ -719,15 +733,16 @@ declare const NoteReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<z.object
719
733
  name: string;
720
734
  description: string | null;
721
735
  attributes: Record<string, unknown>;
736
+ zoom: number;
722
737
  position: [number, number];
723
738
  rotation: number;
724
739
  scale: number;
725
740
  text: string;
726
741
  align: "left" | "center" | "right";
727
742
  style: "italic" | "light" | "regular" | "caps";
728
- widthMultiplier: number;
743
+ widthScale: number;
729
744
  }>;
730
- declare const ImageReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
745
+ declare const ImageReadSchema: z.ZodObject<Omit<Omit<z.objectUtil.extendShape<{
731
746
  id: z.ZodString;
732
747
  groupId: z.ZodNullable<z.ZodString>;
733
748
  color: z.ZodString;
@@ -739,11 +754,10 @@ declare const ImageReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
739
754
  coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">;
740
755
  imageUrl: z.ZodString;
741
756
  opacity: z.ZodNumber;
742
- }>, "coordinates">, "strip", z.ZodTypeAny, {
757
+ }>, "color">, "coordinates">, "strip", z.ZodTypeAny, {
743
758
  type: "Image";
744
759
  id: string;
745
760
  groupId: string | null;
746
- color: string;
747
761
  name: string | null;
748
762
  description: string | null;
749
763
  attributes: Record<string, unknown>;
@@ -753,7 +767,6 @@ declare const ImageReadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
753
767
  type: "Image";
754
768
  id: string;
755
769
  groupId: string | null;
756
- color: string;
757
770
  name: string | null;
758
771
  description: string | null;
759
772
  attributes: Record<string, unknown>;
@@ -991,6 +1004,7 @@ declare const MarkerUpdateSchema: z.ZodObject<{
991
1004
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
992
1005
  opacity: z.ZodOptional<z.ZodNumber>;
993
1006
  size: z.ZodOptional<z.ZodNumber>;
1007
+ zoom: z.ZodOptional<z.ZodNumber>;
994
1008
  }, "strip", z.ZodTypeAny, {
995
1009
  type: "Marker";
996
1010
  id: string;
@@ -1002,6 +1016,7 @@ declare const MarkerUpdateSchema: z.ZodObject<{
1002
1016
  attributes?: Record<string, unknown> | undefined;
1003
1017
  opacity?: number | undefined;
1004
1018
  size?: number | undefined;
1019
+ zoom?: number | undefined;
1005
1020
  }, {
1006
1021
  type: "Marker";
1007
1022
  id: string;
@@ -1013,6 +1028,7 @@ declare const MarkerUpdateSchema: z.ZodObject<{
1013
1028
  attributes?: Record<string, unknown> | undefined;
1014
1029
  opacity?: number | undefined;
1015
1030
  size?: number | undefined;
1031
+ zoom?: number | undefined;
1016
1032
  }>;
1017
1033
  declare const HighlighterUpdateSchema: z.ZodObject<{
1018
1034
  type: z.ZodLiteral<"Highlighter">;
@@ -1045,7 +1061,7 @@ declare const HighlighterUpdateSchema: z.ZodObject<{
1045
1061
  attributes?: Record<string, unknown> | undefined;
1046
1062
  opacity?: number | undefined;
1047
1063
  }>;
1048
- declare const TextUpdateSchema: z.ZodObject<{
1064
+ declare const TextUpdateSchema: z.ZodObject<Omit<{
1049
1065
  type: z.ZodLiteral<"Text">;
1050
1066
  coordinates: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">>;
1051
1067
  id: z.ZodString;
@@ -1054,21 +1070,21 @@ declare const TextUpdateSchema: z.ZodObject<{
1054
1070
  name: z.ZodOptional<z.ZodString>;
1055
1071
  description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1056
1072
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1073
+ zoom: z.ZodOptional<z.ZodNumber>;
1057
1074
  position: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1058
1075
  rotation: z.ZodOptional<z.ZodNumber>;
1059
1076
  scale: z.ZodOptional<z.ZodNumber>;
1060
1077
  text: z.ZodOptional<z.ZodString>;
1061
1078
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
1062
1079
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
1063
- }, "strip", z.ZodTypeAny, {
1080
+ }, "coordinates" | "name">, "strip", z.ZodTypeAny, {
1064
1081
  type: "Text";
1065
1082
  id: string;
1066
- coordinates?: [number, number][][] | undefined;
1067
1083
  groupId?: string | null | undefined;
1068
1084
  color?: string | undefined;
1069
- name?: string | undefined;
1070
1085
  description?: string | null | undefined;
1071
1086
  attributes?: Record<string, unknown> | undefined;
1087
+ zoom?: number | undefined;
1072
1088
  position?: [number, number] | undefined;
1073
1089
  rotation?: number | undefined;
1074
1090
  scale?: number | undefined;
@@ -1078,12 +1094,11 @@ declare const TextUpdateSchema: z.ZodObject<{
1078
1094
  }, {
1079
1095
  type: "Text";
1080
1096
  id: string;
1081
- coordinates?: [number, number][][] | undefined;
1082
1097
  groupId?: string | null | undefined;
1083
1098
  color?: string | undefined;
1084
- name?: string | undefined;
1085
1099
  description?: string | null | undefined;
1086
1100
  attributes?: Record<string, unknown> | undefined;
1101
+ zoom?: number | undefined;
1087
1102
  position?: [number, number] | undefined;
1088
1103
  rotation?: number | undefined;
1089
1104
  scale?: number | undefined;
@@ -1091,7 +1106,7 @@ declare const TextUpdateSchema: z.ZodObject<{
1091
1106
  align?: "left" | "center" | "right" | undefined;
1092
1107
  style?: "italic" | "light" | "regular" | "caps" | undefined;
1093
1108
  }>;
1094
- declare const NoteUpdateSchema: z.ZodObject<{
1109
+ declare const NoteUpdateSchema: z.ZodObject<Omit<{
1095
1110
  type: z.ZodLiteral<"Note">;
1096
1111
  coordinates: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">>;
1097
1112
  id: z.ZodString;
@@ -1100,52 +1115,50 @@ declare const NoteUpdateSchema: z.ZodObject<{
1100
1115
  name: z.ZodOptional<z.ZodString>;
1101
1116
  description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1102
1117
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1118
+ zoom: z.ZodOptional<z.ZodNumber>;
1103
1119
  position: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1104
1120
  rotation: z.ZodOptional<z.ZodNumber>;
1105
1121
  scale: z.ZodOptional<z.ZodNumber>;
1106
1122
  text: z.ZodOptional<z.ZodString>;
1107
1123
  align: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
1108
1124
  style: z.ZodOptional<z.ZodEnum<["italic", "light", "regular", "caps"]>>;
1109
- widthMultiplier: z.ZodOptional<z.ZodNumber>;
1110
- }, "strip", z.ZodTypeAny, {
1125
+ widthScale: z.ZodOptional<z.ZodNumber>;
1126
+ }, "coordinates" | "name">, "strip", z.ZodTypeAny, {
1111
1127
  type: "Note";
1112
1128
  id: string;
1113
- coordinates?: [number, number][][] | undefined;
1114
1129
  groupId?: string | null | undefined;
1115
1130
  color?: string | undefined;
1116
- name?: string | undefined;
1117
1131
  description?: string | null | undefined;
1118
1132
  attributes?: Record<string, unknown> | undefined;
1133
+ zoom?: number | undefined;
1119
1134
  position?: [number, number] | undefined;
1120
1135
  rotation?: number | undefined;
1121
1136
  scale?: number | undefined;
1122
1137
  text?: string | undefined;
1123
1138
  align?: "left" | "center" | "right" | undefined;
1124
1139
  style?: "italic" | "light" | "regular" | "caps" | undefined;
1125
- widthMultiplier?: number | undefined;
1140
+ widthScale?: number | undefined;
1126
1141
  }, {
1127
1142
  type: "Note";
1128
1143
  id: string;
1129
- coordinates?: [number, number][][] | undefined;
1130
1144
  groupId?: string | null | undefined;
1131
1145
  color?: string | undefined;
1132
- name?: string | undefined;
1133
1146
  description?: string | null | undefined;
1134
1147
  attributes?: Record<string, unknown> | undefined;
1148
+ zoom?: number | undefined;
1135
1149
  position?: [number, number] | undefined;
1136
1150
  rotation?: number | undefined;
1137
1151
  scale?: number | undefined;
1138
1152
  text?: string | undefined;
1139
1153
  align?: "left" | "center" | "right" | undefined;
1140
1154
  style?: "italic" | "light" | "regular" | "caps" | undefined;
1141
- widthMultiplier?: number | undefined;
1155
+ widthScale?: number | undefined;
1142
1156
  }>;
1143
1157
  declare const ImageUpdateSchema: z.ZodObject<{
1144
1158
  type: z.ZodLiteral<"Image">;
1145
1159
  coordinates: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, "many">>;
1146
1160
  id: z.ZodString;
1147
1161
  groupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1148
- color: z.ZodOptional<z.ZodString>;
1149
1162
  name: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1150
1163
  description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1151
1164
  attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1156,7 +1169,6 @@ declare const ImageUpdateSchema: z.ZodObject<{
1156
1169
  id: string;
1157
1170
  coordinates?: [number, number][][] | undefined;
1158
1171
  groupId?: string | null | undefined;
1159
- color?: string | undefined;
1160
1172
  name?: string | null | undefined;
1161
1173
  description?: string | null | undefined;
1162
1174
  attributes?: Record<string, unknown> | undefined;
@@ -1167,7 +1179,6 @@ declare const ImageUpdateSchema: z.ZodObject<{
1167
1179
  id: string;
1168
1180
  coordinates?: [number, number][][] | undefined;
1169
1181
  groupId?: string | null | undefined;
1170
- color?: string | undefined;
1171
1182
  name?: string | null | undefined;
1172
1183
  description?: string | null | undefined;
1173
1184
  attributes?: Record<string, unknown> | undefined;
@@ -1952,6 +1963,26 @@ interface MapInteractionEvent {
1952
1963
  rasterValues: Array<RasterValue>;
1953
1964
  }
1954
1965
 
1966
+ /**
1967
+ * The details of a map.
1968
+ *
1969
+ * @group Types
1970
+ */
1971
+ type MapDetails = {
1972
+ /**
1973
+ * The id of the map.
1974
+ */
1975
+ id: string;
1976
+ /**
1977
+ * The title of the map.
1978
+ */
1979
+ title: string;
1980
+ /**
1981
+ * The description of the map.
1982
+ */
1983
+ description: string | null;
1984
+ };
1985
+
1955
1986
  /**
1956
1987
  * A reference to any kind of entity in the map.
1957
1988
  *
@@ -2296,17 +2327,17 @@ declare const ViewportCenterZoomSchema: z.ZodObject<{
2296
2327
  }>;
2297
2328
  zoom: z.ZodNumber;
2298
2329
  }, "strip", z.ZodTypeAny, {
2330
+ zoom: number;
2299
2331
  center: {
2300
2332
  latitude: number;
2301
2333
  longitude: number;
2302
2334
  };
2303
- zoom: number;
2304
2335
  }, {
2336
+ zoom: number;
2305
2337
  center: {
2306
2338
  latitude: number;
2307
2339
  longitude: number;
2308
2340
  };
2309
- zoom: number;
2310
2341
  }>;
2311
2342
  /**
2312
2343
  * The current state of the viewport, including the derived bounds.
@@ -2356,17 +2387,17 @@ declare const SetViewportCenterZoomParamsSchema: z.ZodObject<{
2356
2387
  }>>;
2357
2388
  zoom: z.ZodOptional<z.ZodNumber>;
2358
2389
  }, "strip", z.ZodTypeAny, {
2390
+ zoom?: number | undefined;
2359
2391
  center?: {
2360
2392
  latitude: number;
2361
2393
  longitude: number;
2362
2394
  } | undefined;
2363
- zoom?: number | undefined;
2364
2395
  }, {
2396
+ zoom?: number | undefined;
2365
2397
  center?: {
2366
2398
  latitude: number;
2367
2399
  longitude: number;
2368
2400
  } | undefined;
2369
- zoom?: number | undefined;
2370
2401
  }>;
2371
2402
  /**
2372
2403
  * The constraints for the viewport. Used to ensure that the viewport stays
@@ -2415,4 +2446,4 @@ declare const ViewportFitBoundsParamsSchema: z.ZodObject<{
2415
2446
  bounds: [number, number, number, number];
2416
2447
  }>;
2417
2448
 
2418
- export type { NoteElementUpdate as $, ViewportFitBoundsParams as A, ViewportCenterZoom as B, ConfigurableToolType as C, CircleElementCreate as D, Element as E, Filters as F, Geometry as G, CircleElementRead as H, InputToolSettings as I, CircleElementUpdate as J, HighlighterElementCreate as K, Layer as L, MapInteractionEvent as M, HighlighterElementRead as N, HighlighterElementUpdate as O, ImageElementCreate as P, ImageElementRead as Q, ImageElementUpdate as R, SetVisibilityRequest as S, ToolType as T, LinkElementRead as U, ViewportState as V, MarkerElementCreate as W, MarkerElementRead as X, MarkerElementUpdate as Y, NoteElementCreate as Z, NoteElementRead as _, GetElementsConstraint as a, PathElementCreate as a0, PathElementRead as a1, PathElementUpdate as a2, PlaceElementCreate as a3, PlaceElementRead as a4, PlaceElementUpdate as a5, PolygonElementCreate as a6, PolygonElementRead as a7, PolygonElementUpdate as a8, TextElementCreate as a9, PinToolSettings as aA, PlaceFrame as aB, PlaceSymbol as aC, PolygonToolSettings as aD, RouteToolSettings as aE, TextToolSettings as aF, UnionToIntersection as aG, PromiseOrNot as aH, TextElementRead as aa, TextElementUpdate as ab, LayerProcessingStatus as ac, RasterValue as ad, FilterExpression as ae, FilterLogicGate as af, FilterTernary as ag, ElementGroupNode as ah, ElementNode as ai, FeatureNode as aj, LayerGroupNode as ak, LayerNode as al, FeltBoundary as am, FeltZoom as an, LatLng as ao, LineStringGeometry as ap, LngLatTuple as aq, MultiLineStringGeometry as ar, MultiPolygonGeometry as as, PointGeometry as at, PolygonGeometry as au, CircleToolSettings as av, HighlighterToolSettings as aw, LineToolSettings as ax, MarkerToolSettings as ay, NoteToolSettings as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, EntityNode as t, FeatureSelection as u, ToolSettingsMap as v, ToolSettingsChangeEvent as w, SetViewportCenterZoomParams as x, ViewportConstraints as y, zInfer as z };
2449
+ export type { NoteElementRead as $, ViewportConstraints as A, ViewportFitBoundsParams as B, ConfigurableToolType as C, ViewportCenterZoom as D, Element as E, Filters as F, Geometry as G, CircleElementCreate as H, InputToolSettings as I, CircleElementRead as J, CircleElementUpdate as K, Layer as L, MapInteractionEvent as M, HighlighterElementCreate as N, HighlighterElementRead as O, HighlighterElementUpdate as P, ImageElementCreate as Q, ImageElementRead as R, SetVisibilityRequest as S, ToolType as T, ImageElementUpdate as U, ViewportState as V, LinkElementRead as W, MarkerElementCreate as X, MarkerElementRead as Y, MarkerElementUpdate as Z, NoteElementCreate as _, GetElementsConstraint as a, NoteElementUpdate as a0, PathElementCreate as a1, PathElementRead as a2, PathElementUpdate as a3, PlaceElementCreate as a4, PlaceElementRead as a5, PlaceElementUpdate as a6, PolygonElementCreate as a7, PolygonElementRead as a8, PolygonElementUpdate as a9, NoteToolSettings as aA, PinToolSettings as aB, PlaceFrame as aC, PlaceSymbol as aD, PolygonToolSettings as aE, RouteToolSettings as aF, TextToolSettings as aG, UnionToIntersection as aH, PromiseOrNot as aI, TextElementCreate as aa, TextElementRead as ab, TextElementUpdate as ac, LayerProcessingStatus as ad, RasterValue as ae, FilterExpression as af, FilterLogicGate as ag, FilterTernary as ah, ElementGroupNode as ai, ElementNode as aj, FeatureNode as ak, LayerGroupNode as al, LayerNode as am, FeltBoundary as an, FeltZoom as ao, LatLng as ap, LineStringGeometry as aq, LngLatTuple as ar, MultiLineStringGeometry as as, MultiPolygonGeometry as at, PointGeometry as au, PolygonGeometry as av, CircleToolSettings as aw, HighlighterToolSettings as ax, LineToolSettings as ay, MarkerToolSettings as az, ElementGroup as b, GetElementGroupsConstraint as c, ElementChangeCallbackParams as d, ElementGroupChangeCallbackParams as e, ElementCreate as f, ElementUpdate as g, GetLayersConstraint as h, LayerChangeCallbackParams as i, LayerGroup as j, GetLayerGroupsConstraint as k, LayerGroupChangeCallbackParams as l, LegendItemIdentifier as m, LegendItem as n, LegendItemsConstraint as o, LegendItemChangeCallbackParams as p, LayerFilters as q, GetRenderedFeaturesConstraint as r, Feature as s, MapDetails as t, EntityNode as u, FeatureSelection as v, ToolSettingsMap as w, ToolSettingsChangeEvent as x, SetViewportCenterZoomParams as y, zInfer as z };