@feltmaps/js-sdk 1.5.0-next.18 → 1.5.0-next.19

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/client.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var n in r)c(e,n,{get:r[n],enumerable:!0})},f=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of V(r))!b.call(e,a)&&a!==n&&c(e,a,{get:()=>r[a],enumerable:!(s=S(r,a))||s.enumerable});return e};var x=e=>f(c({},"__esModule",{value:!0}),e);var k={};I(k,{Felt:()=>G});module.exports=x(k);function o(e,r){return n=>{let s=new MessageChannel,a=n.handler,i="options"in n?n.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:i?{eventName:r,id:m,options:i}:{eventName:r,id:m}},"*",[s.port2]),s.port1.onmessage=y=>{u(y)||a(y.data)},()=>{s.port1.onmessage=null,s.port1.close(),s.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,r,n){return async s=>{let a=new MessageChannel,i=s&&n?await n(s):s;return e.postMessage({type:r,params:i},"*",[a.port2]),new Promise((m,y)=>{a.port1.onmessage=g=>{u(g)?y(new Error(g.data.__error__)):m(g.data),a.port1.close(),a.port2.close()}})}}function u(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var C=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:o(e,"onElementChange"),onElementCreate:o(e,"onElementCreate"),onElementCreateEnd:o(e,"onElementCreateEnd"),onElementDelete:o(e,"onElementDelete"),onElementGroupChange:o(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var L=e=>({onPointerClick:o(e,"onPointerClick"),onPointerMove:o(e,"onPointerMove")});var h=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:o(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",async r=>"url"in r||"arrayBuffer"in r?r:{...r,arrayBuffer:await r.file.arrayBuffer()}),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:o(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:o(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:o(e,"onLayerFiltersChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getLayerSchema:t(e,"getLayerSchema")});var T=e=>({getMapDetails:t(e,"getMapDetails")});var P=e=>({onSelectionChange:o(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var E=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:o(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:o(e,"onToolSettingsChange")});var v=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var M=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:o(e,"onViewportMove"),onViewportMoveEnd:o(e,"onViewportMoveEnd"),onMapIdle:o(e,"onMapIdle")});function F(e){return{iframe:null,...M(e),...v(e),...h(e),...C(e),...P(e),...L(e),...E(e),...T(e)}}var G={embed(e,r,n){let s={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},a=n?.origin??s.origin,i=new URL(`${a}/embed/map/${r}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},y={...s.uiControls,...n?.uiControls};for(let[p,d]of K(y))d!=null&&i.searchParams.set(m[p],d?"1":"0");if(n?.token&&i.searchParams.set("token",n.token),n?.initialViewport){let p=n.initialViewport;i.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let g=e.tagName==="IFRAME",l=g?e:e.ownerDocument.createElement("iframe");return l.src=i.toString(),g||(l.style.width="100%",l.style.height="100%",l.style.border="none",l.style.margin="0",e.appendChild(l)),l.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{l.addEventListener("load",()=>{l.contentWindow==null?d(new Error("Failed to load Felt map")):p(l.contentWindow)},{once:!0})}).then(G.connect).then(p=>(Object.defineProperties(p,{iframe:{value:l,writable:!1,configurable:!1}}),p))},connect(e){let r=F(e);return new Promise((n,s)=>{let a=setTimeout(()=>{s(new Error("Failed to load Felt map")),clearInterval(m)},5e3),i=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[i.port2])},100);i.port1.onmessage=y=>{y.data===!0&&(clearInterval(m),clearTimeout(a),i.port1.close(),i.port2.close(),n(r))}})}},K=Object.entries;0&&(module.exports={Felt});
1
+ "use strict";var c=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var I=(e,n)=>{for(var r in n)c(e,r,{get:n[r],enumerable:!0})},x=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of S(n))!b.call(e,a)&&a!==r&&c(e,a,{get:()=>n[a],enumerable:!(s=V(n,a))||s.enumerable});return e};var f=e=>x(c({},"__esModule",{value:!0}),e);var k={};I(k,{Felt:()=>G});module.exports=f(k);function o(e,n){return r=>{let s=new MessageChannel,a=r.handler,i="options"in r?r.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:i?{eventName:n,id:m,options:i}:{eventName:n,id:m}},"*",[s.port2]),s.port1.onmessage=y=>{u(y)||a(y.data)},()=>{s.port1.onmessage=null,s.port1.close(),s.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,n,r){return async s=>{let a=new MessageChannel,i=s&&r?await r(s):s;return e.postMessage({type:n,params:i},"*",[a.port2]),new Promise((m,y)=>{a.port1.onmessage=g=>{u(g)?y(new Error(g.data.__error__)):m(g.data),a.port1.close(),a.port2.close()}})}}function u(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var C=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:o(e,"onElementChange"),onElementCreate:o(e,"onElementCreate"),onElementCreateEnd:o(e,"onElementCreateEnd"),onElementDelete:o(e,"onElementDelete"),onElementGroupChange:o(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var L=e=>({onPointerClick:o(e,"onPointerClick"),onPointerMove:o(e,"onPointerMove")});var h=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:o(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",async n=>{let{source:r}=n;return r.type==="geoJsonFile"?{...n,data:await r.file.arrayBuffer()}:n}),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:o(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:o(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:o(e,"onLayerFiltersChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getLayerSchema:t(e,"getLayerSchema")});var T=e=>({getMapDetails:t(e,"getMapDetails")});var P=e=>({onSelectionChange:o(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var E=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:o(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:o(e,"onToolSettingsChange")});var v=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var M=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:o(e,"onViewportMove"),onViewportMoveEnd:o(e,"onViewportMoveEnd"),onMapIdle:o(e,"onMapIdle")});function F(e){return{iframe:null,...M(e),...v(e),...h(e),...C(e),...P(e),...L(e),...E(e),...T(e)}}var G={embed(e,n,r){let s={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},a=r?.origin??s.origin,i=new URL(`${a}/embed/map/${n}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},y={...s.uiControls,...r?.uiControls};for(let[p,d]of K(y))d!=null&&i.searchParams.set(m[p],d?"1":"0");if(r?.token&&i.searchParams.set("token",r.token),r?.initialViewport){let p=r.initialViewport;i.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let g=e.tagName==="IFRAME",l=g?e:e.ownerDocument.createElement("iframe");return l.src=i.toString(),g||(l.style.width="100%",l.style.height="100%",l.style.border="none",l.style.margin="0",e.appendChild(l)),l.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{l.addEventListener("load",()=>{l.contentWindow==null?d(new Error("Failed to load Felt map")):p(l.contentWindow)},{once:!0})}).then(G.connect).then(p=>(Object.defineProperties(p,{iframe:{value:l,writable:!1,configurable:!1}}),p))},connect(e){let n=F(e);return new Promise((r,s)=>{let a=setTimeout(()=>{s(new Error("Failed to load Felt map")),clearInterval(m)},5e3),i=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[i.port2])},100);i.port1.onmessage=y=>{y.data===!0&&(clearInterval(m),clearTimeout(a),i.port1.close(),i.port2.close(),r(n))}})}},K=Object.entries;0&&(module.exports={Felt});
package/dist/client.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as Element, G as GeoJsonGeometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, f as ElementCreate, g as ElementUpdate, L as Layer, h as GetLayersConstraint, i as LayerChangeCallbackParams, j as GeoJsonArrayBufferSource, k as GeoJsonFileSource, l as GeoJsonUrlSource, m as LayerGroup, n as GetLayerGroupsConstraint, o as LayerGroupChangeCallbackParams, p as LegendItemIdentifier, q as LegendItem, r as LegendItemsConstraint, s as LegendItemChangeCallbackParams, t as LayerFilters, F as Filters, u as GetRenderedFeaturesConstraint, v as LayerFeature, w as GeoJsonFeature, x as GetLayerCategoriesParams, y as GetLayerCategoriesGroup, z as GetLayerHistogramParams, A as GetLayerHistogramBin, B as AggregationMethod, C as GetLayerCalculationParams, D as LayerSchema, M as MapInteractionEvent, H as MapDetails, I as EntityNode, J as FeatureSelection, T as ToolType, K as InputToolSettings, N as ConfigurableToolType, O as ToolSettingsMap, P as ToolSettingsChangeEvent, Q as zInfer, R as SortConfig, V as ViewportState, U as SetViewportCenterZoomParams, W as ViewportConstraints, X as ViewportFitBoundsParams, Y as ViewportCenterZoom } from './types-Cy5ifEPb.cjs';
2
- export { aC as AggregationConfig, Z as CircleElementCreate, _ as CircleElementRead, $ as CircleElementUpdate, aX as CircleToolSettings, aG as ElementGroupNode, aH as ElementNode, ap as EphemeralLayerSource, aI as FeatureNode, aL as FeltBoundary, aM as FeltZoom, az as FilterExpression, aA as FilterLogicGate, aB as FilterTernary, aN as GeoJsonProperties, aD as GeometryFilter, a0 as HighlighterElementCreate, a1 as HighlighterElementRead, a2 as HighlighterElementUpdate, aY as HighlighterToolSettings, a3 as ImageElementCreate, a4 as ImageElementRead, a5 as ImageElementUpdate, aO as LatLng, aJ as LayerGroupNode, aK as LayerNode, aq as LayerProcessingStatus, as as LayerSchemaAttribute, at as LayerSchemaBooleanAttribute, au as LayerSchemaCommonAttribute, av as LayerSchemaDateAttribute, aw as LayerSchemaDateTimeAttribute, ax as LayerSchemaNumericAttribute, ay as LayerSchemaTextAttribute, aP as LineStringGeometry, aZ as LineToolSettings, a6 as LinkElementRead, aQ as LngLatTuple, a7 as MarkerElementCreate, a8 as MarkerElementRead, a9 as MarkerElementUpdate, a_ as MarkerToolSettings, aE as MultiAggregationConfig, aR as MultiLineStringGeometry, aS as MultiPointGeometry, aT as MultiPolygonGeometry, aa as NoteElementCreate, ab as NoteElementRead, ac as NoteElementUpdate, a$ as NoteToolSettings, ad as PathElementCreate, ae as PathElementRead, af as PathElementUpdate, b0 as PinToolSettings, ag as PlaceElementCreate, ah as PlaceElementRead, ai as PlaceElementUpdate, b1 as PlaceFrame, b2 as PlaceSymbol, aU as PointGeometry, aj as PolygonElementCreate, ak as PolygonElementRead, al as PolygonElementUpdate, aV as PolygonGeometry, b3 as PolygonToolSettings, ar as RasterValue, b4 as RouteToolSettings, aW as SortDirection, am as TextElementCreate, an as TextElementRead, ao as TextElementUpdate, b5 as TextToolSettings, aF as ValueConfiguration } from './types-Cy5ifEPb.cjs';
1
+ import { E as Element, G as GeoJsonGeometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, f as ElementCreate, g as ElementUpdate, L as Layer, h as GetLayersConstraint, i as LayerChangeCallbackParams, C as CreateLayersFromGeoJsonParams, j as LayerGroup, k as GetLayerGroupsConstraint, l as LayerGroupChangeCallbackParams, m as LegendItemIdentifier, n as LegendItem, o as LegendItemsConstraint, p as LegendItemChangeCallbackParams, q as LayerFilters, F as Filters, r as GetRenderedFeaturesConstraint, s as LayerFeature, t as GeoJsonFeature, u as GetLayerCategoriesParams, v as GetLayerCategoriesGroup, w as GetLayerHistogramParams, x as GetLayerHistogramBin, A as AggregationMethod, y as GetLayerCalculationParams, z as LayerSchema, M as MapInteractionEvent, B as MapDetails, D as EntityNode, H as FeatureSelection, T as ToolType, I as InputToolSettings, J as ConfigurableToolType, K as ToolSettingsMap, N as ToolSettingsChangeEvent, O as zInfer, P as SortConfig, V as ViewportState, Q as SetViewportCenterZoomParams, R as ViewportConstraints, U as ViewportFitBoundsParams, W as ViewportCenterZoom } from './types-BQxcl9Qq.cjs';
2
+ export { aJ as AggregationConfig, X as CircleElementCreate, Y as CircleElementRead, Z as CircleElementUpdate, b2 as CircleToolSettings, an as DataOnlyLayer, aN as ElementGroupNode, aO as ElementNode, aP as FeatureNode, aS as FeltBoundary, ao as FeltTiledVectorSource, aT as FeltZoom, aG as FilterExpression, aH as FilterLogicGate, aI as FilterTernary, ap as GeoJsonDataVectorSource, aq as GeoJsonFileVectorSource, aU as GeoJsonProperties, ar as GeoJsonUrlVectorSource, aK as GeometryFilter, _ as HighlighterElementCreate, $ as HighlighterElementRead, a0 as HighlighterElementUpdate, b3 as HighlighterToolSettings, a1 as ImageElementCreate, a2 as ImageElementRead, a3 as ImageElementUpdate, aV as LatLng, as as LayerCommon, aQ as LayerGroupNode, aR as LayerNode, at as LayerProcessingStatus, az as LayerSchemaAttribute, aA as LayerSchemaBooleanAttribute, aB as LayerSchemaCommonAttribute, aC as LayerSchemaDateAttribute, aD as LayerSchemaDateTimeAttribute, aE as LayerSchemaNumericAttribute, aF as LayerSchemaTextAttribute, aW as LineStringGeometry, b4 as LineToolSettings, a4 as LinkElementRead, aX as LngLatTuple, a5 as MarkerElementCreate, a6 as MarkerElementRead, a7 as MarkerElementUpdate, b5 as MarkerToolSettings, aL as MultiAggregationConfig, aY as MultiLineStringGeometry, aZ as MultiPointGeometry, a_ as MultiPolygonGeometry, a8 as NoteElementCreate, a9 as NoteElementRead, aa as NoteElementUpdate, b6 as NoteToolSettings, ab as PathElementCreate, ac as PathElementRead, ad as PathElementUpdate, b7 as PinToolSettings, ae as PlaceElementCreate, af as PlaceElementRead, ag as PlaceElementUpdate, b8 as PlaceFrame, b9 as PlaceSymbol, a$ as PointGeometry, ah as PolygonElementCreate, ai as PolygonElementRead, aj as PolygonElementUpdate, b0 as PolygonGeometry, ba as PolygonToolSettings, au as RasterBand, av as RasterLayer, aw as RasterLayerSource, ax as RasterValue, bb as RouteToolSettings, b1 as SortDirection, ak as TextElementCreate, al as TextElementRead, am as TextElementUpdate, bc as TextToolSettings, aM as ValueConfiguration, ay as VectorLayer } from './types-BQxcl9Qq.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -455,19 +455,22 @@ interface LayersController {
455
455
  * @example
456
456
  * ```typescript
457
457
  * const layerFromFile = await felt.createLayersFromGeoJson({
458
- * name: "Parcels", file: someFile,
458
+ * source: {
459
+ * type: "geoJsonFile",
460
+ * file: someFile,
461
+ * },
462
+ * name: "Parcels",
459
463
  * });
460
464
  *
461
465
  * const layerFromUrl = await felt.createLayersFromGeoJson({
462
- * name: "Parcels", url: "https://example.com/parcels.geojson",
463
- * });
466
+ * source: {
467
+ * sourceType: "geoJsonUrl",
468
+ * url: "https://example.com/parcels.geojson",
469
+ * },
470
+ * name: "Parcels",
464
471
  * ```
465
472
  */
466
- createLayersFromGeoJson(
467
- /**
468
- * The source that you want to add to the map. These can be GeoJSON files or URLs.
469
- */
470
- source: GeoJsonArrayBufferSource | GeoJsonFileSource | GeoJsonUrlSource): Promise<{
473
+ createLayersFromGeoJson(params: CreateLayersFromGeoJsonParams): Promise<{
471
474
  /**
472
475
  * The layer group that was created containing the created layers.
473
476
  */
@@ -1776,4 +1779,4 @@ declare const Felt: {
1776
1779
  connect(feltWindow: Pick<Window, "postMessage">): Promise<FeltController>;
1777
1780
  };
1778
1781
 
1779
- export { AggregationMethod, ConfigurableToolType, Element, ElementChangeCallbackParams, ElementCreate, ElementGroup, ElementGroupChangeCallbackParams, ElementUpdate, type ElementsController, EntityNode, FeatureSelection, Felt, type FeltController, type FeltEmbedOptions, Filters, GeoJsonArrayBufferSource, GeoJsonFeature, GeoJsonFileSource, GeoJsonGeometry, GeoJsonUrlSource, GetElementGroupsConstraint, GetElementsConstraint, GetLayerCalculationParams, GetLayerCategoriesGroup, GetLayerCategoriesParams, GetLayerGroupsConstraint, GetLayerHistogramBin, GetLayerHistogramParams, GetLayersConstraint, GetRenderedFeaturesConstraint, InputToolSettings, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFeature, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, LayerSchema, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapDetails, MapInteractionEvent, type MiscController, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, SortConfig, ToolSettingsChangeEvent, ToolSettingsMap, ToolType, type ToolsController, type UiController, type UiControlsOptions, ViewportCenterZoom, ViewportConstraints, type ViewportController, ViewportFitBoundsParams, ViewportState };
1782
+ export { AggregationMethod, ConfigurableToolType, CreateLayersFromGeoJsonParams, Element, ElementChangeCallbackParams, ElementCreate, ElementGroup, ElementGroupChangeCallbackParams, ElementUpdate, type ElementsController, EntityNode, FeatureSelection, Felt, type FeltController, type FeltEmbedOptions, Filters, GeoJsonFeature, GeoJsonGeometry, GetElementGroupsConstraint, GetElementsConstraint, GetLayerCalculationParams, GetLayerCategoriesGroup, GetLayerCategoriesParams, GetLayerGroupsConstraint, GetLayerHistogramBin, GetLayerHistogramParams, GetLayersConstraint, GetRenderedFeaturesConstraint, InputToolSettings, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFeature, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, LayerSchema, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapDetails, MapInteractionEvent, type MiscController, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, SortConfig, ToolSettingsChangeEvent, ToolSettingsMap, ToolType, type ToolsController, type UiController, type UiControlsOptions, ViewportCenterZoom, ViewportConstraints, type ViewportController, ViewportFitBoundsParams, ViewportState };
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as Element, G as GeoJsonGeometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, f as ElementCreate, g as ElementUpdate, L as Layer, h as GetLayersConstraint, i as LayerChangeCallbackParams, j as GeoJsonArrayBufferSource, k as GeoJsonFileSource, l as GeoJsonUrlSource, m as LayerGroup, n as GetLayerGroupsConstraint, o as LayerGroupChangeCallbackParams, p as LegendItemIdentifier, q as LegendItem, r as LegendItemsConstraint, s as LegendItemChangeCallbackParams, t as LayerFilters, F as Filters, u as GetRenderedFeaturesConstraint, v as LayerFeature, w as GeoJsonFeature, x as GetLayerCategoriesParams, y as GetLayerCategoriesGroup, z as GetLayerHistogramParams, A as GetLayerHistogramBin, B as AggregationMethod, C as GetLayerCalculationParams, D as LayerSchema, M as MapInteractionEvent, H as MapDetails, I as EntityNode, J as FeatureSelection, T as ToolType, K as InputToolSettings, N as ConfigurableToolType, O as ToolSettingsMap, P as ToolSettingsChangeEvent, Q as zInfer, R as SortConfig, V as ViewportState, U as SetViewportCenterZoomParams, W as ViewportConstraints, X as ViewportFitBoundsParams, Y as ViewportCenterZoom } from './types-Cy5ifEPb.js';
2
- export { aC as AggregationConfig, Z as CircleElementCreate, _ as CircleElementRead, $ as CircleElementUpdate, aX as CircleToolSettings, aG as ElementGroupNode, aH as ElementNode, ap as EphemeralLayerSource, aI as FeatureNode, aL as FeltBoundary, aM as FeltZoom, az as FilterExpression, aA as FilterLogicGate, aB as FilterTernary, aN as GeoJsonProperties, aD as GeometryFilter, a0 as HighlighterElementCreate, a1 as HighlighterElementRead, a2 as HighlighterElementUpdate, aY as HighlighterToolSettings, a3 as ImageElementCreate, a4 as ImageElementRead, a5 as ImageElementUpdate, aO as LatLng, aJ as LayerGroupNode, aK as LayerNode, aq as LayerProcessingStatus, as as LayerSchemaAttribute, at as LayerSchemaBooleanAttribute, au as LayerSchemaCommonAttribute, av as LayerSchemaDateAttribute, aw as LayerSchemaDateTimeAttribute, ax as LayerSchemaNumericAttribute, ay as LayerSchemaTextAttribute, aP as LineStringGeometry, aZ as LineToolSettings, a6 as LinkElementRead, aQ as LngLatTuple, a7 as MarkerElementCreate, a8 as MarkerElementRead, a9 as MarkerElementUpdate, a_ as MarkerToolSettings, aE as MultiAggregationConfig, aR as MultiLineStringGeometry, aS as MultiPointGeometry, aT as MultiPolygonGeometry, aa as NoteElementCreate, ab as NoteElementRead, ac as NoteElementUpdate, a$ as NoteToolSettings, ad as PathElementCreate, ae as PathElementRead, af as PathElementUpdate, b0 as PinToolSettings, ag as PlaceElementCreate, ah as PlaceElementRead, ai as PlaceElementUpdate, b1 as PlaceFrame, b2 as PlaceSymbol, aU as PointGeometry, aj as PolygonElementCreate, ak as PolygonElementRead, al as PolygonElementUpdate, aV as PolygonGeometry, b3 as PolygonToolSettings, ar as RasterValue, b4 as RouteToolSettings, aW as SortDirection, am as TextElementCreate, an as TextElementRead, ao as TextElementUpdate, b5 as TextToolSettings, aF as ValueConfiguration } from './types-Cy5ifEPb.js';
1
+ import { E as Element, G as GeoJsonGeometry, a as GetElementsConstraint, b as ElementGroup, c as GetElementGroupsConstraint, S as SetVisibilityRequest, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, f as ElementCreate, g as ElementUpdate, L as Layer, h as GetLayersConstraint, i as LayerChangeCallbackParams, C as CreateLayersFromGeoJsonParams, j as LayerGroup, k as GetLayerGroupsConstraint, l as LayerGroupChangeCallbackParams, m as LegendItemIdentifier, n as LegendItem, o as LegendItemsConstraint, p as LegendItemChangeCallbackParams, q as LayerFilters, F as Filters, r as GetRenderedFeaturesConstraint, s as LayerFeature, t as GeoJsonFeature, u as GetLayerCategoriesParams, v as GetLayerCategoriesGroup, w as GetLayerHistogramParams, x as GetLayerHistogramBin, A as AggregationMethod, y as GetLayerCalculationParams, z as LayerSchema, M as MapInteractionEvent, B as MapDetails, D as EntityNode, H as FeatureSelection, T as ToolType, I as InputToolSettings, J as ConfigurableToolType, K as ToolSettingsMap, N as ToolSettingsChangeEvent, O as zInfer, P as SortConfig, V as ViewportState, Q as SetViewportCenterZoomParams, R as ViewportConstraints, U as ViewportFitBoundsParams, W as ViewportCenterZoom } from './types-BQxcl9Qq.js';
2
+ export { aJ as AggregationConfig, X as CircleElementCreate, Y as CircleElementRead, Z as CircleElementUpdate, b2 as CircleToolSettings, an as DataOnlyLayer, aN as ElementGroupNode, aO as ElementNode, aP as FeatureNode, aS as FeltBoundary, ao as FeltTiledVectorSource, aT as FeltZoom, aG as FilterExpression, aH as FilterLogicGate, aI as FilterTernary, ap as GeoJsonDataVectorSource, aq as GeoJsonFileVectorSource, aU as GeoJsonProperties, ar as GeoJsonUrlVectorSource, aK as GeometryFilter, _ as HighlighterElementCreate, $ as HighlighterElementRead, a0 as HighlighterElementUpdate, b3 as HighlighterToolSettings, a1 as ImageElementCreate, a2 as ImageElementRead, a3 as ImageElementUpdate, aV as LatLng, as as LayerCommon, aQ as LayerGroupNode, aR as LayerNode, at as LayerProcessingStatus, az as LayerSchemaAttribute, aA as LayerSchemaBooleanAttribute, aB as LayerSchemaCommonAttribute, aC as LayerSchemaDateAttribute, aD as LayerSchemaDateTimeAttribute, aE as LayerSchemaNumericAttribute, aF as LayerSchemaTextAttribute, aW as LineStringGeometry, b4 as LineToolSettings, a4 as LinkElementRead, aX as LngLatTuple, a5 as MarkerElementCreate, a6 as MarkerElementRead, a7 as MarkerElementUpdate, b5 as MarkerToolSettings, aL as MultiAggregationConfig, aY as MultiLineStringGeometry, aZ as MultiPointGeometry, a_ as MultiPolygonGeometry, a8 as NoteElementCreate, a9 as NoteElementRead, aa as NoteElementUpdate, b6 as NoteToolSettings, ab as PathElementCreate, ac as PathElementRead, ad as PathElementUpdate, b7 as PinToolSettings, ae as PlaceElementCreate, af as PlaceElementRead, ag as PlaceElementUpdate, b8 as PlaceFrame, b9 as PlaceSymbol, a$ as PointGeometry, ah as PolygonElementCreate, ai as PolygonElementRead, aj as PolygonElementUpdate, b0 as PolygonGeometry, ba as PolygonToolSettings, au as RasterBand, av as RasterLayer, aw as RasterLayerSource, ax as RasterValue, bb as RouteToolSettings, b1 as SortDirection, ak as TextElementCreate, al as TextElementRead, am as TextElementUpdate, bc as TextToolSettings, aM as ValueConfiguration, ay as VectorLayer } from './types-BQxcl9Qq.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -455,19 +455,22 @@ interface LayersController {
455
455
  * @example
456
456
  * ```typescript
457
457
  * const layerFromFile = await felt.createLayersFromGeoJson({
458
- * name: "Parcels", file: someFile,
458
+ * source: {
459
+ * type: "geoJsonFile",
460
+ * file: someFile,
461
+ * },
462
+ * name: "Parcels",
459
463
  * });
460
464
  *
461
465
  * const layerFromUrl = await felt.createLayersFromGeoJson({
462
- * name: "Parcels", url: "https://example.com/parcels.geojson",
463
- * });
466
+ * source: {
467
+ * sourceType: "geoJsonUrl",
468
+ * url: "https://example.com/parcels.geojson",
469
+ * },
470
+ * name: "Parcels",
464
471
  * ```
465
472
  */
466
- createLayersFromGeoJson(
467
- /**
468
- * The source that you want to add to the map. These can be GeoJSON files or URLs.
469
- */
470
- source: GeoJsonArrayBufferSource | GeoJsonFileSource | GeoJsonUrlSource): Promise<{
473
+ createLayersFromGeoJson(params: CreateLayersFromGeoJsonParams): Promise<{
471
474
  /**
472
475
  * The layer group that was created containing the created layers.
473
476
  */
@@ -1776,4 +1779,4 @@ declare const Felt: {
1776
1779
  connect(feltWindow: Pick<Window, "postMessage">): Promise<FeltController>;
1777
1780
  };
1778
1781
 
1779
- export { AggregationMethod, ConfigurableToolType, Element, ElementChangeCallbackParams, ElementCreate, ElementGroup, ElementGroupChangeCallbackParams, ElementUpdate, type ElementsController, EntityNode, FeatureSelection, Felt, type FeltController, type FeltEmbedOptions, Filters, GeoJsonArrayBufferSource, GeoJsonFeature, GeoJsonFileSource, GeoJsonGeometry, GeoJsonUrlSource, GetElementGroupsConstraint, GetElementsConstraint, GetLayerCalculationParams, GetLayerCategoriesGroup, GetLayerCategoriesParams, GetLayerGroupsConstraint, GetLayerHistogramBin, GetLayerHistogramParams, GetLayersConstraint, GetRenderedFeaturesConstraint, InputToolSettings, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFeature, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, LayerSchema, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapDetails, MapInteractionEvent, type MiscController, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, SortConfig, ToolSettingsChangeEvent, ToolSettingsMap, ToolType, type ToolsController, type UiController, type UiControlsOptions, ViewportCenterZoom, ViewportConstraints, type ViewportController, ViewportFitBoundsParams, ViewportState };
1782
+ export { AggregationMethod, ConfigurableToolType, CreateLayersFromGeoJsonParams, Element, ElementChangeCallbackParams, ElementCreate, ElementGroup, ElementGroupChangeCallbackParams, ElementUpdate, type ElementsController, EntityNode, FeatureSelection, Felt, type FeltController, type FeltEmbedOptions, Filters, GeoJsonFeature, GeoJsonGeometry, GetElementGroupsConstraint, GetElementsConstraint, GetLayerCalculationParams, GetLayerCategoriesGroup, GetLayerCategoriesParams, GetLayerGroupsConstraint, GetLayerHistogramBin, GetLayerHistogramParams, GetLayersConstraint, GetRenderedFeaturesConstraint, InputToolSettings, type InteractionsController, Layer, LayerChangeCallbackParams, LayerFeature, LayerFilters, LayerGroup, LayerGroupChangeCallbackParams, LayerSchema, type LayersController, LegendItem, LegendItemChangeCallbackParams, LegendItemIdentifier, LegendItemsConstraint, MapDetails, MapInteractionEvent, type MiscController, type UiOnMapInteractionsOptions as OnMapInteractionsOptions, type SelectionController, SetViewportCenterZoomParams, SetVisibilityRequest, SortConfig, ToolSettingsChangeEvent, ToolSettingsMap, ToolType, type ToolsController, type UiController, type UiControlsOptions, ViewportCenterZoom, ViewportConstraints, type ViewportController, ViewportFitBoundsParams, ViewportState };
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- function r(e,n){return o=>{let s=new MessageChannel,l=o.handler,a="options"in o?o.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:a?{eventName:n,id:m,options:a}:{eventName:n,id:m}},"*",[s.port2]),s.port1.onmessage=y=>{c(y)||l(y.data)},()=>{s.port1.onmessage=null,s.port1.close(),s.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,n,o){return async s=>{let l=new MessageChannel,a=s&&o?await o(s):s;return e.postMessage({type:n,params:a},"*",[l.port2]),new Promise((m,y)=>{l.port1.onmessage=g=>{c(g)?y(new Error(g.data.__error__)):m(g.data),l.port1.close(),l.port2.close()}})}}function c(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var u=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementCreate:r(e,"onElementCreate"),onElementCreateEnd:r(e,"onElementCreateEnd"),onElementDelete:r(e,"onElementDelete"),onElementGroupChange:r(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var C=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var L=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:r(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",async n=>"url"in n||"arrayBuffer"in n?n:{...n,arrayBuffer:await n.file.arrayBuffer()}),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:r(e,"onLayerFiltersChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getLayerSchema:t(e,"getLayerSchema")});var h=e=>({getMapDetails:t(e,"getMapDetails")});var T=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var P=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:r(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:r(e,"onToolSettingsChange")});var E=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var v=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function M(e){return{iframe:null,...v(e),...E(e),...L(e),...u(e),...T(e),...C(e),...P(e),...h(e)}}var F={embed(e,n,o){let s={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},l=o?.origin??s.origin,a=new URL(`${l}/embed/map/${n}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},y={...s.uiControls,...o?.uiControls};for(let[p,d]of G(y))d!=null&&a.searchParams.set(m[p],d?"1":"0");if(o?.token&&a.searchParams.set("token",o.token),o?.initialViewport){let p=o.initialViewport;a.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let g=e.tagName==="IFRAME",i=g?e:e.ownerDocument.createElement("iframe");return i.src=a.toString(),g||(i.style.width="100%",i.style.height="100%",i.style.border="none",i.style.margin="0",e.appendChild(i)),i.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{i.addEventListener("load",()=>{i.contentWindow==null?d(new Error("Failed to load Felt map")):p(i.contentWindow)},{once:!0})}).then(F.connect).then(p=>(Object.defineProperties(p,{iframe:{value:i,writable:!1,configurable:!1}}),p))},connect(e){let n=M(e);return new Promise((o,s)=>{let l=setTimeout(()=>{s(new Error("Failed to load Felt map")),clearInterval(m)},5e3),a=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[a.port2])},100);a.port1.onmessage=y=>{y.data===!0&&(clearInterval(m),clearTimeout(l),a.port1.close(),a.port2.close(),o(n))}})}},G=Object.entries;export{F as Felt};
1
+ function r(e,a){return o=>{let n=new MessageChannel,l=o.handler,s="options"in o?o.options:void 0,m=crypto.randomUUID();return e.postMessage({type:"felt.addListener",event:s?{eventName:a,id:m,options:s}:{eventName:a,id:m}},"*",[n.port2]),n.port1.onmessage=y=>{c(y)||l(y.data)},()=>{n.port1.onmessage=null,n.port1.close(),n.port2.close(),e.postMessage({type:"felt.removeListener",id:m},"*")}}}function t(e,a,o){return async n=>{let l=new MessageChannel,s=n&&o?await o(n):n;return e.postMessage({type:a,params:s},"*",[l.port2]),new Promise((m,y)=>{l.port1.onmessage=g=>{c(g)?y(new Error(g.data.__error__)):m(g.data),l.port1.close(),l.port2.close()}})}}function c(e){return e.data&&typeof e.data=="object"&&"__error__"in e.data}var u=e=>({getElement:t(e,"getElement"),getElementGeometry:t(e,"getElementGeometry"),getElements:t(e,"getElements"),setElementGroupVisibility:t(e,"setElementGroupVisibility"),getElementGroup:t(e,"getElementGroup"),getElementGroups:t(e,"getElementGroups"),onElementChange:r(e,"onElementChange"),onElementCreate:r(e,"onElementCreate"),onElementCreateEnd:r(e,"onElementCreateEnd"),onElementDelete:r(e,"onElementDelete"),onElementGroupChange:r(e,"onElementGroupChange"),createElement:t(e,"createElement"),updateElement:t(e,"updateElement"),deleteElement:t(e,"deleteElement")});var C=e=>({onPointerClick:r(e,"onPointerClick"),onPointerMove:r(e,"onPointerMove")});var L=e=>({getLayer:t(e,"getLayer"),getLayers:t(e,"getLayers"),setLayerVisibility:t(e,"setLayerVisibility"),setLayerStyle:t(e,"setLayerStyle"),setLayerLegendVisibility:t(e,"setLayerLegendVisibility"),onLayerChange:r(e,"onLayerChange"),createLayersFromGeoJson:t(e,"createLayersFromGeoJson",async a=>{let{source:o}=a;return o.type==="geoJsonFile"?{...a,data:await o.file.arrayBuffer()}:a}),deleteLayer:t(e,"deleteLayer"),getLayerGroup:t(e,"getLayerGroup"),getLayerGroups:t(e,"getLayerGroups"),setLayerGroupVisibility:t(e,"setLayerGroupVisibility"),setLayerGroupLegendVisibility:t(e,"setLayerGroupLegendVisibility"),onLayerGroupChange:r(e,"onLayerGroupChange"),getLegendItem:t(e,"getLegendItem"),getLegendItems:t(e,"getLegendItems"),setLegendItemVisibility:t(e,"setLegendItemVisibility"),onLegendItemChange:r(e,"onLegendItemChange"),getLayerFilters:t(e,"getLayerFilters"),setLayerFilters:t(e,"setLayerFilters"),onLayerFiltersChange:r(e,"onLayerFiltersChange"),getRenderedFeatures:t(e,"getRenderedFeatures"),getFeature:t(e,"getFeature"),getGeoJsonFeature:t(e,"getGeoJsonFeature"),getCategoryData:t(e,"getCategoryData"),getHistogramData:t(e,"getHistogramData"),getAggregates:t(e,"getAggregates"),getLayerSchema:t(e,"getLayerSchema")});var h=e=>({getMapDetails:t(e,"getMapDetails")});var T=e=>({onSelectionChange:r(e,"onSelectionChange"),getSelection:t(e,"getSelection"),selectFeature:t(e,"selectFeature"),clearSelection:t(e,"clearSelection")});var P=e=>({setTool:t(e,"setTool"),getTool:t(e,"getTool"),onToolChange:r(e,"onToolChange"),setToolSettings:t(e,"setToolSettings"),getToolSettings:t(e,"getToolSettings"),onToolSettingsChange:r(e,"onToolSettingsChange")});var E=e=>({updateUiControls:t(e,"updateUiControls"),setOnMapInteractionsUi:t(e,"setOnMapInteractionsUi"),showLayerDataTable:t(e,"showLayerDataTable"),hideLayerDataTable:t(e,"hideLayerDataTable")});var v=e=>({getViewport:t(e,"getViewport"),setViewport:t(e,"setViewport"),getViewportConstraints:t(e,"getViewportConstraints"),setViewportConstraints:t(e,"setViewportConstraints"),fitViewportToBounds:t(e,"fitViewportToBounds"),onViewportMove:r(e,"onViewportMove"),onViewportMoveEnd:r(e,"onViewportMoveEnd"),onMapIdle:r(e,"onMapIdle")});function M(e){return{iframe:null,...v(e),...E(e),...L(e),...u(e),...T(e),...C(e),...P(e),...h(e)}}var F={embed(e,a,o){let n={uiControls:{showLegend:!0,cooperativeGestures:!0,fullScreenButton:!0,geolocation:!1,zoomControls:!0,scaleBar:!0},initialViewport:void 0,origin:"https://felt.com"},l=o?.origin??n.origin,s=new URL(`${l}/embed/map/${a}`),m={showLegend:"legend",cooperativeGestures:"cooperativeGestures",fullScreenButton:"link",geolocation:"geolocation",zoomControls:"zoomControls",scaleBar:"scaleBar"},y={...n.uiControls,...o?.uiControls};for(let[p,d]of G(y))d!=null&&s.searchParams.set(m[p],d?"1":"0");if(o?.token&&s.searchParams.set("token",o.token),o?.initialViewport){let p=o.initialViewport;s.searchParams.set("loc",`${p.center.latitude},${p.center.longitude},${p.zoom}z`)}let g=e.tagName==="IFRAME",i=g?e:e.ownerDocument.createElement("iframe");return i.src=s.toString(),g||(i.style.width="100%",i.style.height="100%",i.style.border="none",i.style.margin="0",e.appendChild(i)),i.referrerPolicy="strict-origin-when-cross-origin",new Promise((p,d)=>{i.addEventListener("load",()=>{i.contentWindow==null?d(new Error("Failed to load Felt map")):p(i.contentWindow)},{once:!0})}).then(F.connect).then(p=>(Object.defineProperties(p,{iframe:{value:i,writable:!1,configurable:!1}}),p))},connect(e){let a=M(e);return new Promise((o,n)=>{let l=setTimeout(()=>{n(new Error("Failed to load Felt map")),clearInterval(m)},5e3),s=new MessageChannel,m=setInterval(()=>{e.postMessage({type:"felt.ready"},"*",[s.port2])},100);s.port1.onmessage=y=>{y.data===!0&&(clearInterval(m),clearTimeout(l),s.port1.close(),s.port2.close(),o(a))}})}},G=Object.entries;export{F as Felt};
package/dist/handler.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var re=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var st=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var pt=(o,l)=>{for(var G in l)re(o,G,{get:l[G],enumerable:!0})},mt=(o,l,G,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let b of st(l))!lt.call(o,b)&&b!==G&&re(o,b,{get:()=>l[b],enumerable:!(z=it(l,b))||z.enumerable});return o};var ct=o=>mt(re({},"__esModule",{value:!0}),o);var gr={};pt(gr,{createMessageHandler:()=>ir});module.exports=ct(gr);var y=require("zod");var d=require("zod");var f=require("zod");function t(o,l){return f.z.strictObject({type:f.z.literal(o),params:l})}function S(o,l){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string(),options:l})}function p(o){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string()})}var i=require("zod"),B=i.z.number(),D=i.z.number(),Z=i.z.object({latitude:D,longitude:B}),C=i.z.tuple([B,D]),P=i.z.object({type:i.z.literal("Polygon"),coordinates:i.z.array(i.z.array(C).min(4).refine(o=>o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1],"The last point of each ring must be identical to the first"))}),J=i.z.object({type:i.z.literal("MultiPolygon"),coordinates:i.z.array(P.shape.coordinates)}),yt=i.z.object({type:i.z.literal("LineString"),coordinates:i.z.array(C).min(2)}),w=i.z.object({type:i.z.literal("MultiLineString"),coordinates:i.z.array(yt.shape.coordinates)}),fe=i.z.number().min(1).max(23),I=i.z.tuple([B,D,B,D]),T=i.z.object({show:i.z.array(i.z.string()).optional(),hide:i.z.array(i.z.string()).optional()}),gt=i.z.enum(["asc","desc"]),Se=i.z.object({attribute:i.z.string(),direction:gt});var e=require("zod");var h=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ne=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),dt=e.z.enum(["meter","kilometer","foot","mile"]),q=h.extend($.shape).extend({type:e.z.literal("Place"),coordinates:C,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),V=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Path"),coordinates:w.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),O=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Polygon"),coordinates:P.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),W=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Circle"),center:C,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:dt.nullable(),fillOpacity:e.z.number().min(0).max(1)}),U=h.extend({type:e.z.literal("Marker"),coordinates:w.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)}),R=h.extend({type:e.z.literal("Highlighter"),coordinates:J.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),xe=e.z.object({position:C,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),coordinates:P.shape.coordinates}),Le=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()}),_=h.extend(xe.shape).extend(Le.shape).extend({type:e.z.literal("Text")}),Q=h.extend(xe.shape).extend(Le.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),N=h.extend({type:e.z.literal("Image"),coordinates:w.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),ut=h.extend({type:e.z.literal("Link"),coordinates:w.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},x={id:!0},ae=q.partial().extend(q.pick(F).shape).omit(x),K=V.partial().extend(V.pick(F).shape).omit(x),ie=O.partial().extend(O.pick(F).shape).omit(x),se=W.partial().extend(W.pick({type:!0,center:!0,radius:!0}).shape).omit(x),le=U.partial().extend(U.pick(F).shape).omit(x),pe=R.partial().extend(R.pick(F).shape).omit(x),me=_.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ce=Q.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),ht=N.partial().extend(N.pick({...F,imageUrl:!0}).shape).omit(x),Me=e.z.discriminatedUnion("type",[ae,K,ie,se,le,pe,ht,me,ce]);var xr=V.omit({coordinates:!0}),Lr=O.omit({coordinates:!0});var Mr=U.omit({coordinates:!0}),br=R.omit({coordinates:!0}),Cr=_.omit({coordinates:!0}),Gr=Q.omit({coordinates:!0}),Ir=N.omit({coordinates:!0}),Tr=ut.omit({coordinates:!0}),L={type:!0,id:!0},ft=q.partial().extend(q.pick(L).shape),St=V.partial().extend(V.pick(L).shape),xt=O.partial().extend(O.pick(L).shape),Lt=W.partial().extend(W.pick(L).shape),Mt=U.partial().extend(U.pick(L).shape),bt=R.partial().extend(R.pick(L).shape),Ct=_.partial().extend(_.pick(L).shape).omit({coordinates:!0,name:!0}),Gt=Q.partial().extend(Q.pick(L).shape).omit({coordinates:!0,name:!0}),It=N.partial().extend(N.pick(L).shape),be=e.z.discriminatedUnion("type",[ft,St,xt,Lt,Mt,bt,Ct,Gt,It]),Ce=e.z.object({ids:e.z.array(e.z.string()).optional()}),Ge=e.z.object({ids:e.z.array(e.z.string()).optional()});var Tt=t("getElement",d.z.string()),Et=t("getElementGeometry",d.z.string()),zt=t("getElements",Ce.optional()),Pt=t("getElementGroup",d.z.string()),Ft=t("getElementGroups",Ge.optional()),kt=t("setElementGroupVisibility",T),vt=S("onElementChange",d.z.object({id:d.z.string()})),wt=p("onElementCreate"),Vt=p("onElementCreateEnd"),Ot=S("onElementDelete",d.z.object({id:d.z.string()})),Ut=S("onElementGroupChange",d.z.object({id:d.z.string()})),Rt=t("createElement",Me),Nt=t("updateElement",be),jt=t("deleteElement",d.z.string()),Ie={methods:[Tt,Et,zt,Pt,Ft,kt,Rt,Nt,jt],listeners:[vt,wt,Vt,Ot,Ut]};var At=p("onPointerClick"),Ht=p("onPointerMove"),Te={methods:null,listeners:[At,Ht]};var s=require("zod");var n=require("zod"),Bt=n.z.enum(["in","ni"]),Dt=n.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Vr=n.z.enum(["and","or"]),Ee=n.z.union([n.z.number(),n.z.string(),n.z.boolean(),n.z.null()]),ze=n.z.string().or(n.z.null()),Zt=n.z.tuple([ze,Bt,n.z.array(Ee).or(n.z.null())]),Jt=n.z.tuple([ze,Dt,Ee]),ye=n.z.union([Zt,Jt]),ge=n.z.tuple([n.z.lazy(()=>n.z.union([ge,ye,n.z.null(),n.z.boolean()])),n.z.enum(["and","or"]),n.z.lazy(()=>n.z.union([ge,ye,n.z.null(),n.z.boolean()]))]),E=n.z.union([ge,ye,n.z.null(),n.z.boolean()]);var r=require("zod");var Pe=r.z.enum(["avg","max","min","sum","median"]),qt=r.z.object({method:Pe,attribute:r.z.string()}),Wt=r.z.object({methods:r.z.array(r.z.union([Pe,r.z.literal("count")])),attribute:r.z.string().optional()}),X=r.z.union([I,P,J,r.z.array(C)]),Fe=r.z.object({boundary:X.optional(),filters:E.optional(),aggregation:qt.optional()}),ke=r.z.object({layerId:r.z.string(),attribute:r.z.string(),limit:r.z.number().optional(),boundary:X.optional(),filters:E.optional(),values:Fe.optional()}),Nr=r.z.object({key:r.z.union([r.z.number(),r.z.string(),r.z.boolean()]),value:r.z.number().nullable()}),_t=r.z.object({type:r.z.literal("equal-intervals"),count:r.z.number()}),Qt=r.z.object({type:r.z.literal("time-interval"),interval:r.z.enum(["hour","day","week","month","year"])}),ve=r.z.object({layerId:r.z.string(),attribute:r.z.string(),steps:r.z.union([_t,Qt,r.z.array(r.z.number())]),boundary:X.optional(),filters:E.optional(),values:Fe.optional()}),jr=r.z.object({min:r.z.number(),max:r.z.number(),value:r.z.number()}),we=r.z.object({layerId:r.z.string(),boundary:X.optional(),filters:E.optional(),aggregation:Wt});var a=require("zod");var Br=a.z.enum(["processing","completed","failed","incomplete"]),Ve=a.z.object({ids:a.z.array(a.z.string()).optional()}),Oe=a.z.object({ids:a.z.array(a.z.string()).optional()}),k=a.z.object({id:a.z.string(),layerId:a.z.string()}),Ue=a.z.object({ids:k.array().optional(),layerIds:a.z.string().array().optional()}),Re=a.z.object({layerIds:a.z.array(a.z.string()).optional(),areaQuery:a.z.union([a.z.object({coordinates:Z}),a.z.object({boundary:I})]).optional()}),$t=a.z.object({Point:a.z.object({}).passthrough().optional(),Line:a.z.object({}).passthrough().optional(),Polygon:a.z.object({}).passthrough().optional()}),de=a.z.object({name:a.z.string(),geometryStyles:$t.optional()}),Kt=de.extend({file:a.z.instanceof(File)}),Xt=de.extend({url:a.z.string().url()}),Yt=de.extend({arrayBuffer:a.z.instanceof(ArrayBuffer)}),Ne=a.z.union([Yt,Kt,Xt]);var eo=t("getLayer",s.z.string()),to=t("getLayers",Ve.optional()),oo=t("setLayerVisibility",T),ro=S("onLayerChange",s.z.object({id:s.z.string()})),no=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),ao=t("setLayerLegendVisibility",T),io=t("createLayersFromGeoJson",Ne),so=t("deleteLayer",s.z.string()),lo=t("getLayerGroup",s.z.string()),po=t("getLayerGroups",Oe.optional()),mo=t("setLayerGroupVisibility",T),co=t("setLayerGroupLegendVisibility",T),yo=S("onLayerGroupChange",s.z.object({id:s.z.string()})),go=t("getLegendItem",k),uo=t("getLegendItems",Ue.optional()),ho=S("onLegendItemChange",k),fo=t("setLegendItemVisibility",s.z.object({show:k.array().optional(),hide:k.array().optional()})),So=t("getLayerFilters",s.z.string()),xo=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:E,note:s.z.string().optional()})),Lo=S("onLayerFiltersChange",s.z.object({layerId:s.z.string()})),Mo=t("getRenderedFeatures",Re.optional()),bo=t("getFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Co=t("getGeoJsonFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Go=t("getCategoryData",ke),Io=t("getHistogramData",ve),To=t("getAggregates",we),Eo=t("getLayerSchema",s.z.string()),je={methods:[eo,to,oo,no,ao,io,so,lo,po,mo,co,go,uo,fo,So,xo,Mo,bo,Co,Go,Io,To,Eo],listeners:[ro,yo,ho,Lo]};var Ae=require("zod");var zo=t("getMapDetails",Ae.z.undefined()),He={methods:[zo],listeners:[]};var j=require("zod");var M=require("zod"),Be=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 Po=t("getSelection",j.z.undefined()),Fo=p("onSelectionChange"),ko=t("selectFeature",Be),vo=t("clearSelection",j.z.object({features:j.z.boolean().optional(),elements:j.z.boolean().optional()}).optional()),De={methods:[Po,ko,vo],listeners:[Fo]};var _e=require("zod");var m=require("zod");var Ze=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Je=m.z.enum([...Ze,"link"]),qe=m.z.enum(Ze),wo=ae.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Vo=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Oo=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Uo=ie.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Ro=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),No=le.pick({color:!0,opacity:!0,size:!0}).required(),jo=pe.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),Ao=me.pick({color:!0,align:!0,style:!0}).required(),Ho=ce.pick({color:!0,align:!0,style:!0}).required(),We=m.z.discriminatedUnion("tool",[wo.partial().extend({tool:m.z.literal("pin")}),Vo.partial().extend({tool:m.z.literal("line")}),Oo.partial().extend({tool:m.z.literal("route")}),Uo.partial().extend({tool:m.z.literal("polygon")}),Ro.partial().extend({tool:m.z.literal("circle")}),No.partial().extend({tool:m.z.literal("marker")}),jo.partial().extend({tool:m.z.literal("highlighter")}),Ao.partial().extend({tool:m.z.literal("text")}),Ho.partial().extend({tool:m.z.literal("note")})]);var Bo=t("setTool",Je.nullable()),Do=t("getTool",_e.z.undefined()),Zo=p("onToolChange"),Jo=t("setToolSettings",We),qo=t("getToolSettings",qe),Wo=p("onToolSettingsChange"),Qe={methods:[Bo,Do,Jo,qo],listeners:[Zo,Wo]};var Y=require("zod");var c=require("zod"),$e=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Ke=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var _o=t("updateUiControls",$e),Qo=t("setOnMapInteractionsUi",Ke),$o=t("showLayerDataTable",Y.z.object({layerId:Y.z.string(),sorting:Se.optional()}).optional()),Ko=t("hideLayerDataTable",Y.z.undefined()),Xe={methods:[_o,Qo,$o,Ko],listeners:null};var ue=require("zod");var A=require("zod");var ee=A.z.object({center:Z,zoom:fe}),Ye=A.z.object({center:ee.shape.center.optional(),zoom:ee.shape.zoom.optional()}),et=A.z.object({minZoom:ee.shape.zoom.nullish(),maxZoom:ee.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),tt=A.z.object({bounds:I});var Xo=t("getViewport",ue.z.undefined()),Yo=t("setViewport",Ye),er=t("getViewportConstraints",ue.z.undefined()),tr=t("setViewportConstraints",et),or=t("fitViewportToBounds",tt),rr=p("onViewportMove"),nr=p("onViewportMoveEnd"),ar=p("onMapIdle"),ot={methods:[Yo,Xo,er,tr,or],listeners:[rr,nr,ar]};var he=[Xe,ot,je,Ie,De,Te,Qe,He];function ir(o,l,G){let z=new Map;async function b(u){if(!cr.safeParse(u.data).success){G?.onUnknownMessage?.(u.data);return}let H=at.safeParse(u.data);if(!H.success){G?.onInvalidMessage?.(u.data,H.error),u.ports[0]?.postMessage(rt(H.error.message));return}let{data:g}=H;if(g.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let v="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:oe=>{u.ports[0]?.postMessage(oe)}}:{handler:oe=>{u.ports[0]?.postMessage(oe)}},te=l.listeners[g.event.eventName](v);z.set(g.event.id,te)}else if(g.type==="felt.removeListener")z.get(g.id)?.(),z.delete(g.id);else try{let v=l.methods[g.type],te=await v(g.params);u.ports[0]?.postMessage(te)}catch(v){u.ports[0]?.postMessage(rt(v))}}return o.addEventListener("message",b),()=>{o.removeEventListener("message",b)}}var nt={methods:he.map(o=>o.methods??[]).flat(),listeners:he.map(o=>o.listeners??[]).flat()},sr=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...nt.listeners]),lr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:sr}),pr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),mr=y.z.strictObject({type:y.z.literal("felt.ready")}),at=y.z.discriminatedUnion("type",[mr,lr,pr,...nt.methods]),cr=y.z.object({type:y.z.enum(at.options.map(o=>o.shape.type.value))});function rt(o){return{__error__:yr(o)}}function yr(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}0&&(module.exports={createMessageHandler});
1
+ "use strict";var re=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var st=Object.prototype.hasOwnProperty;var lt=(o,l)=>{for(var G in l)re(o,G,{get:l[G],enumerable:!0})},pt=(o,l,G,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let M of it(l))!st.call(o,M)&&M!==G&&re(o,M,{get:()=>l[M],enumerable:!(z=at(l,M))||z.enumerable});return o};var mt=o=>pt(re({},"__esModule",{value:!0}),o);var yr={};lt(yr,{createMessageHandler:()=>ar});module.exports=mt(yr);var y=require("zod");var d=require("zod");var f=require("zod");function t(o,l){return f.z.strictObject({type:f.z.literal(o),params:l})}function S(o,l){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string(),options:l})}function p(o){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string()})}var i=require("zod"),H=i.z.number(),J=i.z.number(),B=i.z.object({latitude:J,longitude:H}),C=i.z.tuple([H,J]),P=i.z.object({type:i.z.literal("Polygon"),coordinates:i.z.array(i.z.array(C).min(4).refine(o=>o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1],"The last point of each ring must be identical to the first"))}),Z=i.z.object({type:i.z.literal("MultiPolygon"),coordinates:i.z.array(P.shape.coordinates)}),ct=i.z.object({type:i.z.literal("LineString"),coordinates:i.z.array(C).min(2)}),v=i.z.object({type:i.z.literal("MultiLineString"),coordinates:i.z.array(ct.shape.coordinates)}),he=i.z.number().min(1).max(23),I=i.z.tuple([H,J,H,J]),T=i.z.object({show:i.z.array(i.z.string()).optional(),hide:i.z.array(i.z.string()).optional()}),yt=i.z.enum(["asc","desc"]),fe=i.z.object({attribute:i.z.string(),direction:yt});var e=require("zod");var h=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ne=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),gt=e.z.enum(["meter","kilometer","foot","mile"]),q=h.extend($.shape).extend({type:e.z.literal("Place"),coordinates:C,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),w=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Path"),coordinates:v.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),O=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Polygon"),coordinates:P.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),W=h.extend($.shape).extend(ne.shape).extend({type:e.z.literal("Circle"),center:C,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:gt.nullable(),fillOpacity:e.z.number().min(0).max(1)}),U=h.extend({type:e.z.literal("Marker"),coordinates:v.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)}),j=h.extend({type:e.z.literal("Highlighter"),coordinates:Z.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:C,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),coordinates:P.shape.coordinates}),xe=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()}),_=h.extend(Se.shape).extend(xe.shape).extend({type:e.z.literal("Text")}),Q=h.extend(Se.shape).extend(xe.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),R=h.extend({type:e.z.literal("Image"),coordinates:v.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),dt=h.extend({type:e.z.literal("Link"),coordinates:v.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},x={id:!0},ae=q.partial().extend(q.pick(F).shape).omit(x),K=w.partial().extend(w.pick(F).shape).omit(x),ie=O.partial().extend(O.pick(F).shape).omit(x),se=W.partial().extend(W.pick({type:!0,center:!0,radius:!0}).shape).omit(x),le=U.partial().extend(U.pick(F).shape).omit(x),pe=j.partial().extend(j.pick(F).shape).omit(x),me=_.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ce=Q.partial().omit({...x,coordinates:!0,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),ut=R.partial().extend(R.pick({...F,imageUrl:!0}).shape).omit(x),Le=e.z.discriminatedUnion("type",[ae,K,ie,se,le,pe,ut,me,ce]);var Sr=w.omit({coordinates:!0}),xr=O.omit({coordinates:!0});var Lr=U.omit({coordinates:!0}),br=j.omit({coordinates:!0}),Mr=_.omit({coordinates:!0}),Cr=Q.omit({coordinates:!0}),Gr=R.omit({coordinates:!0}),Ir=dt.omit({coordinates:!0}),L={type:!0,id:!0},ht=q.partial().extend(q.pick(L).shape),ft=w.partial().extend(w.pick(L).shape),St=O.partial().extend(O.pick(L).shape),xt=W.partial().extend(W.pick(L).shape),Lt=U.partial().extend(U.pick(L).shape),bt=j.partial().extend(j.pick(L).shape),Mt=_.partial().extend(_.pick(L).shape).omit({coordinates:!0,name:!0}),Ct=Q.partial().extend(Q.pick(L).shape).omit({coordinates:!0,name:!0}),Gt=R.partial().extend(R.pick(L).shape),be=e.z.discriminatedUnion("type",[ht,ft,St,xt,Lt,bt,Mt,Ct,Gt]),Me=e.z.object({ids:e.z.array(e.z.string()).optional()}),Ce=e.z.object({ids:e.z.array(e.z.string()).optional()});var It=t("getElement",d.z.string()),Tt=t("getElementGeometry",d.z.string()),Et=t("getElements",Me.optional()),zt=t("getElementGroup",d.z.string()),Pt=t("getElementGroups",Ce.optional()),Ft=t("setElementGroupVisibility",T),kt=S("onElementChange",d.z.object({id:d.z.string()})),Vt=p("onElementCreate"),vt=p("onElementCreateEnd"),wt=S("onElementDelete",d.z.object({id:d.z.string()})),Ot=S("onElementGroupChange",d.z.object({id:d.z.string()})),Ut=t("createElement",Le),jt=t("updateElement",be),Rt=t("deleteElement",d.z.string()),Ge={methods:[It,Tt,Et,zt,Pt,Ft,Ut,jt,Rt],listeners:[kt,Vt,vt,wt,Ot]};var Nt=p("onPointerClick"),At=p("onPointerMove"),Ie={methods:null,listeners:[Nt,At]};var s=require("zod");var a=require("zod"),Dt=a.z.enum(["in","ni"]),Ht=a.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),vr=a.z.enum(["and","or"]),Te=a.z.union([a.z.number(),a.z.string(),a.z.boolean(),a.z.null()]),Ee=a.z.string().or(a.z.null()),Jt=a.z.tuple([Ee,Dt,a.z.array(Te).or(a.z.null())]),Bt=a.z.tuple([Ee,Ht,Te]),ye=a.z.union([Jt,Bt]),ge=a.z.tuple([a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()])),a.z.enum(["and","or"]),a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()]))]),E=a.z.union([ge,ye,a.z.null(),a.z.boolean()]);var r=require("zod");var ze=r.z.enum(["avg","max","min","sum","median"]),Zt=r.z.object({method:ze,attribute:r.z.string()}),qt=r.z.object({methods:r.z.array(r.z.union([ze,r.z.literal("count")])),attribute:r.z.string().optional()}),X=r.z.union([I,P,Z,r.z.array(C)]),Pe=r.z.object({boundary:X.optional(),filters:E.optional(),aggregation:Zt.optional()}),Fe=r.z.object({layerId:r.z.string(),attribute:r.z.string(),limit:r.z.number().optional(),boundary:X.optional(),filters:E.optional(),values:Pe.optional()}),jr=r.z.object({key:r.z.union([r.z.number(),r.z.string(),r.z.boolean()]),value:r.z.number().nullable()}),Wt=r.z.object({type:r.z.literal("equal-intervals"),count:r.z.number()}),_t=r.z.object({type:r.z.literal("time-interval"),interval:r.z.enum(["hour","day","week","month","year"])}),ke=r.z.object({layerId:r.z.string(),attribute:r.z.string(),steps:r.z.union([Wt,_t,r.z.array(r.z.number())]),boundary:X.optional(),filters:E.optional(),values:Pe.optional()}),Rr=r.z.object({min:r.z.number(),max:r.z.number(),value:r.z.number()}),Ve=r.z.object({layerId:r.z.string(),boundary:X.optional(),filters:E.optional(),aggregation:qt});var n=require("zod");var Dr=n.z.enum(["processing","completed","failed","incomplete"]),Qt=n.z.object({type:n.z.literal("geoJsonUrl"),url:n.z.string().url()}),$t=n.z.object({type:n.z.literal("geoJsonData"),data:n.z.object({}).passthrough()}),Kt=n.z.object({type:n.z.literal("geoJsonFile"),file:n.z.instanceof(File)}),ve=n.z.object({ids:n.z.array(n.z.string()).optional()}),we=n.z.object({ids:n.z.array(n.z.string()).optional()}),k=n.z.object({id:n.z.string(),layerId:n.z.string()}),Oe=n.z.object({ids:k.array().optional(),layerIds:n.z.string().array().optional()}),Ue=n.z.object({layerIds:n.z.array(n.z.string()).optional(),areaQuery:n.z.union([n.z.object({coordinates:B}),n.z.object({boundary:I})]).optional()}),Xt=n.z.object({Point:n.z.object({}).passthrough().optional(),Line:n.z.object({}).passthrough().optional(),Polygon:n.z.object({}).passthrough().optional()}),je=n.z.object({source:n.z.union([Qt,$t,Kt]),name:n.z.string(),geometryStyles:Xt.optional()});var Yt=t("getLayer",s.z.string()),eo=t("getLayers",ve.optional()),to=t("setLayerVisibility",T),oo=S("onLayerChange",s.z.object({id:s.z.string()})),ro=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",T),ao=t("createLayersFromGeoJson",je),io=t("deleteLayer",s.z.string()),so=t("getLayerGroup",s.z.string()),lo=t("getLayerGroups",we.optional()),po=t("setLayerGroupVisibility",T),mo=t("setLayerGroupLegendVisibility",T),co=S("onLayerGroupChange",s.z.object({id:s.z.string()})),yo=t("getLegendItem",k),go=t("getLegendItems",Oe.optional()),uo=S("onLegendItemChange",k),ho=t("setLegendItemVisibility",s.z.object({show:k.array().optional(),hide:k.array().optional()})),fo=t("getLayerFilters",s.z.string()),So=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:E,note:s.z.string().optional()})),xo=S("onLayerFiltersChange",s.z.object({layerId:s.z.string()})),Lo=t("getRenderedFeatures",Ue.optional()),bo=t("getFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Mo=t("getGeoJsonFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Co=t("getCategoryData",Fe),Go=t("getHistogramData",ke),Io=t("getAggregates",Ve),To=t("getLayerSchema",s.z.string()),Re={methods:[Yt,eo,to,ro,no,ao,io,so,lo,po,mo,yo,go,ho,fo,So,Lo,bo,Mo,Co,Go,Io,To],listeners:[oo,co,uo,xo]};var Ne=require("zod");var Eo=t("getMapDetails",Ne.z.undefined()),Ae={methods:[Eo],listeners:[]};var N=require("zod");var b=require("zod"),De=b.z.object({id:b.z.string().or(b.z.number()),layerId:b.z.string(),showPopup:b.z.boolean().optional(),fitViewport:b.z.boolean().or(b.z.object({maxZoom:b.z.number()})).optional()});var zo=t("getSelection",N.z.undefined()),Po=p("onSelectionChange"),Fo=t("selectFeature",De),ko=t("clearSelection",N.z.object({features:N.z.boolean().optional(),elements:N.z.boolean().optional()}).optional()),He={methods:[zo,Fo,ko],listeners:[Po]};var We=require("zod");var m=require("zod");var Je=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Be=m.z.enum([...Je,"link"]),Ze=m.z.enum(Je),Vo=ae.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),vo=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),wo=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Oo=ie.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Uo=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),jo=le.pick({color:!0,opacity:!0,size:!0}).required(),Ro=pe.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),No=me.pick({color:!0,align:!0,style:!0}).required(),Ao=ce.pick({color:!0,align:!0,style:!0}).required(),qe=m.z.discriminatedUnion("tool",[Vo.partial().extend({tool:m.z.literal("pin")}),vo.partial().extend({tool:m.z.literal("line")}),wo.partial().extend({tool:m.z.literal("route")}),Oo.partial().extend({tool:m.z.literal("polygon")}),Uo.partial().extend({tool:m.z.literal("circle")}),jo.partial().extend({tool:m.z.literal("marker")}),Ro.partial().extend({tool:m.z.literal("highlighter")}),No.partial().extend({tool:m.z.literal("text")}),Ao.partial().extend({tool:m.z.literal("note")})]);var Do=t("setTool",Be.nullable()),Ho=t("getTool",We.z.undefined()),Jo=p("onToolChange"),Bo=t("setToolSettings",qe),Zo=t("getToolSettings",Ze),qo=p("onToolSettingsChange"),_e={methods:[Do,Ho,Bo,Zo],listeners:[Jo,qo]};var Y=require("zod");var c=require("zod"),Qe=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),$e=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var Wo=t("updateUiControls",Qe),_o=t("setOnMapInteractionsUi",$e),Qo=t("showLayerDataTable",Y.z.object({layerId:Y.z.string(),sorting:fe.optional()}).optional()),$o=t("hideLayerDataTable",Y.z.undefined()),Ke={methods:[Wo,_o,Qo,$o],listeners:null};var de=require("zod");var A=require("zod");var ee=A.z.object({center:B,zoom:he}),Xe=A.z.object({center:ee.shape.center.optional(),zoom:ee.shape.zoom.optional()}),Ye=A.z.object({minZoom:ee.shape.zoom.nullish(),maxZoom:ee.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),et=A.z.object({bounds:I});var Ko=t("getViewport",de.z.undefined()),Xo=t("setViewport",Xe),Yo=t("getViewportConstraints",de.z.undefined()),er=t("setViewportConstraints",Ye),tr=t("fitViewportToBounds",et),or=p("onViewportMove"),rr=p("onViewportMoveEnd"),nr=p("onMapIdle"),tt={methods:[Xo,Ko,Yo,er,tr],listeners:[or,rr,nr]};var ue=[Ke,tt,Re,Ge,He,Ie,_e,Ae];function ar(o,l,G){let z=new Map;async function M(u){if(!mr.safeParse(u.data).success){G?.onUnknownMessage?.(u.data);return}let D=nt.safeParse(u.data);if(!D.success){G?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(ot(D.error.message));return}let{data:g}=D;if(g.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let V="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:oe=>{u.ports[0]?.postMessage(oe)}}:{handler:oe=>{u.ports[0]?.postMessage(oe)}},te=l.listeners[g.event.eventName](V);z.set(g.event.id,te)}else if(g.type==="felt.removeListener")z.get(g.id)?.(),z.delete(g.id);else try{let V=l.methods[g.type],te=await V(g.params);u.ports[0]?.postMessage(te)}catch(V){u.ports[0]?.postMessage(ot(V))}}return o.addEventListener("message",M),()=>{o.removeEventListener("message",M)}}var rt={methods:ue.map(o=>o.methods??[]).flat(),listeners:ue.map(o=>o.listeners??[]).flat()},ir=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...rt.listeners]),sr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:ir}),lr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),pr=y.z.strictObject({type:y.z.literal("felt.ready")}),nt=y.z.discriminatedUnion("type",[pr,sr,lr,...rt.methods]),mr=y.z.object({type:y.z.enum(nt.options.map(o=>o.shape.type.value))});function ot(o){return{__error__:cr(o)}}function cr(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}0&&(module.exports={createMessageHandler});
@@ -1,5 +1,5 @@
1
1
  import { z, ZodError } from 'zod';
2
- import { Q as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, m as LayerGroup, q as LegendItem, t as LayerFilters, v as LayerFeature, w as GeoJsonFeature, y as GetLayerCategoriesGroup, A as GetLayerHistogramBin, B as AggregationMethod, D as LayerSchema, i as LayerChangeCallbackParams, o as LayerGroupChangeCallbackParams, s as LegendItemChangeCallbackParams, aB as FilterTernary, H as MapDetails, I as EntityNode, T as ToolType, O as ToolSettingsMap, P as ToolSettingsChangeEvent, V as ViewportState, W as ViewportConstraints, b6 as UnionToIntersection, b7 as PromiseOrNot } from './types-Cy5ifEPb.cjs';
2
+ import { O as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, j as LayerGroup, n as LegendItem, q as LayerFilters, s as LayerFeature, t as GeoJsonFeature, v as GetLayerCategoriesGroup, x as GetLayerHistogramBin, A as AggregationMethod, z as LayerSchema, i as LayerChangeCallbackParams, l as LayerGroupChangeCallbackParams, p as LegendItemChangeCallbackParams, aI as FilterTernary, B as MapDetails, D as EntityNode, T as ToolType, K as ToolSettingsMap, N as ToolSettingsChangeEvent, V as ViewportState, R as ViewportConstraints, bd as UnionToIntersection, be as PromiseOrNot } from './types-BQxcl9Qq.cjs';
3
3
 
4
4
  type Method<TRequest extends {
5
5
  type: string;
@@ -1964,73 +1964,39 @@ declare const SetLayerLegendVisibilityMessage: z.ZodObject<{
1964
1964
  }>;
1965
1965
  declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
1966
1966
  type: z.ZodLiteral<"createLayersFromGeoJson">;
1967
- params: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1968
- name: z.ZodString;
1969
- geometryStyles: z.ZodOptional<z.ZodObject<{
1970
- Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1971
- Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1972
- Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1967
+ params: z.ZodObject<{
1968
+ source: z.ZodUnion<[z.ZodObject<{
1969
+ type: z.ZodLiteral<"geoJsonUrl">;
1970
+ url: z.ZodString;
1973
1971
  }, "strip", z.ZodTypeAny, {
1974
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1975
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1976
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1972
+ type: "geoJsonUrl";
1973
+ url: string;
1977
1974
  }, {
1978
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1979
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1980
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1981
- }>>;
1982
- }, {
1983
- arrayBuffer: z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>;
1984
- }>, "strip", z.ZodTypeAny, {
1985
- name: string;
1986
- arrayBuffer: ArrayBuffer;
1987
- geometryStyles?: {
1988
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1989
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1990
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1991
- } | undefined;
1992
- }, {
1993
- name: string;
1994
- arrayBuffer: ArrayBuffer;
1995
- geometryStyles?: {
1996
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1997
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1998
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1999
- } | undefined;
2000
- }>, z.ZodObject<z.objectUtil.extendShape<{
2001
- name: z.ZodString;
2002
- geometryStyles: z.ZodOptional<z.ZodObject<{
2003
- Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2004
- Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2005
- Polygon: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1975
+ type: "geoJsonUrl";
1976
+ url: string;
1977
+ }>, z.ZodObject<{
1978
+ type: z.ZodLiteral<"geoJsonData">;
1979
+ data: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
2006
1980
  }, "strip", z.ZodTypeAny, {
2007
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2008
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2009
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1981
+ type: "geoJsonData";
1982
+ data: {} & {
1983
+ [k: string]: unknown;
1984
+ };
2010
1985
  }, {
2011
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2012
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2013
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2014
- }>>;
2015
- }, {
2016
- file: z.ZodType<File, z.ZodTypeDef, File>;
2017
- }>, "strip", z.ZodTypeAny, {
2018
- name: string;
2019
- file: File;
2020
- geometryStyles?: {
2021
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2022
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2023
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2024
- } | undefined;
2025
- }, {
2026
- name: string;
2027
- file: File;
2028
- geometryStyles?: {
2029
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2030
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2031
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2032
- } | undefined;
2033
- }>, z.ZodObject<z.objectUtil.extendShape<{
1986
+ type: "geoJsonData";
1987
+ data: {} & {
1988
+ [k: string]: unknown;
1989
+ };
1990
+ }>, z.ZodObject<{
1991
+ type: z.ZodLiteral<"geoJsonFile">;
1992
+ file: z.ZodType<File, z.ZodTypeDef, File>;
1993
+ }, "strip", z.ZodTypeAny, {
1994
+ type: "geoJsonFile";
1995
+ file: File;
1996
+ }, {
1997
+ type: "geoJsonFile";
1998
+ file: File;
1999
+ }>]>;
2034
2000
  name: z.ZodString;
2035
2001
  geometryStyles: z.ZodOptional<z.ZodObject<{
2036
2002
  Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
@@ -2045,11 +2011,20 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2045
2011
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2046
2012
  Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2047
2013
  }>>;
2048
- }, {
2049
- url: z.ZodString;
2050
- }>, "strip", z.ZodTypeAny, {
2014
+ }, "strip", z.ZodTypeAny, {
2051
2015
  name: string;
2052
- url: string;
2016
+ source: {
2017
+ type: "geoJsonUrl";
2018
+ url: string;
2019
+ } | {
2020
+ type: "geoJsonData";
2021
+ data: {} & {
2022
+ [k: string]: unknown;
2023
+ };
2024
+ } | {
2025
+ type: "geoJsonFile";
2026
+ file: File;
2027
+ };
2053
2028
  geometryStyles?: {
2054
2029
  Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2055
2030
  Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2057,33 +2032,39 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2057
2032
  } | undefined;
2058
2033
  }, {
2059
2034
  name: string;
2060
- url: string;
2035
+ source: {
2036
+ type: "geoJsonUrl";
2037
+ url: string;
2038
+ } | {
2039
+ type: "geoJsonData";
2040
+ data: {} & {
2041
+ [k: string]: unknown;
2042
+ };
2043
+ } | {
2044
+ type: "geoJsonFile";
2045
+ file: File;
2046
+ };
2061
2047
  geometryStyles?: {
2062
2048
  Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2063
2049
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2064
2050
  Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2065
2051
  } | undefined;
2066
- }>]>;
2052
+ }>;
2067
2053
  }, z.UnknownKeysParam, z.ZodTypeAny, {
2068
2054
  params: {
2069
2055
  name: string;
2070
- arrayBuffer: ArrayBuffer;
2071
- geometryStyles?: {
2072
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2073
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2074
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2075
- } | undefined;
2076
- } | {
2077
- name: string;
2078
- file: File;
2079
- geometryStyles?: {
2080
- Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2081
- Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2082
- Line?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2083
- } | undefined;
2084
- } | {
2085
- name: string;
2086
- url: string;
2056
+ source: {
2057
+ type: "geoJsonUrl";
2058
+ url: string;
2059
+ } | {
2060
+ type: "geoJsonData";
2061
+ data: {} & {
2062
+ [k: string]: unknown;
2063
+ };
2064
+ } | {
2065
+ type: "geoJsonFile";
2066
+ file: File;
2067
+ };
2087
2068
  geometryStyles?: {
2088
2069
  Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2089
2070
  Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2094,23 +2075,18 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2094
2075
  }, {
2095
2076
  params: {
2096
2077
  name: string;
2097
- arrayBuffer: ArrayBuffer;
2098
- geometryStyles?: {
2099
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2100
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2101
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2102
- } | undefined;
2103
- } | {
2104
- name: string;
2105
- file: File;
2106
- geometryStyles?: {
2107
- Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2108
- Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2109
- Line?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2110
- } | undefined;
2111
- } | {
2112
- name: string;
2113
- url: string;
2078
+ source: {
2079
+ type: "geoJsonUrl";
2080
+ url: string;
2081
+ } | {
2082
+ type: "geoJsonData";
2083
+ data: {} & {
2084
+ [k: string]: unknown;
2085
+ };
2086
+ } | {
2087
+ type: "geoJsonFile";
2088
+ file: File;
2089
+ };
2114
2090
  geometryStyles?: {
2115
2091
  Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2116
2092
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;