@octostar/map-component 0.1.15 → 0.1.17

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.
Files changed (51) hide show
  1. package/dist/index.cjs +0 -4
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.mjs +0 -4
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/types/components/action-panel.d.ts +8 -0
  6. package/dist/types/components/action-panel.d.ts.map +1 -0
  7. package/dist/types/components/cluster-pie-chart.d.ts +16 -0
  8. package/dist/types/components/cluster-pie-chart.d.ts.map +1 -0
  9. package/dist/types/components/color-picker-popover.d.ts +9 -0
  10. package/dist/types/components/color-picker-popover.d.ts.map +1 -0
  11. package/dist/types/components/debug-sidebar.d.ts +14 -0
  12. package/dist/types/components/debug-sidebar.d.ts.map +1 -0
  13. package/dist/types/components/demos/feature-editor-demo.d.ts +2 -0
  14. package/dist/types/components/demos/feature-editor-demo.d.ts.map +1 -0
  15. package/dist/types/components/demos/point-editor-demo.d.ts +2 -0
  16. package/dist/types/components/demos/point-editor-demo.d.ts.map +1 -0
  17. package/dist/types/components/demos/search-filter-demo.d.ts +2 -0
  18. package/dist/types/components/demos/search-filter-demo.d.ts.map +1 -0
  19. package/dist/types/components/demos/standalone-demo.d.ts +2 -0
  20. package/dist/types/components/demos/standalone-demo.d.ts.map +1 -0
  21. package/dist/types/components/drawing-toolbar.d.ts +56 -0
  22. package/dist/types/components/drawing-toolbar.d.ts.map +1 -0
  23. package/dist/types/components/icon-picker.d.ts +20 -0
  24. package/dist/types/components/icon-picker.d.ts.map +1 -0
  25. package/dist/types/components/layers-panel.d.ts +124 -0
  26. package/dist/types/components/layers-panel.d.ts.map +1 -0
  27. package/dist/types/components/map-drop-zone.d.ts +7 -0
  28. package/dist/types/components/map-drop-zone.d.ts.map +1 -0
  29. package/dist/types/components/map-editor-canvas.d.ts +5 -0
  30. package/dist/types/components/map-editor-canvas.d.ts.map +1 -0
  31. package/dist/types/components/properties-panel.d.ts +32 -0
  32. package/dist/types/components/properties-panel.d.ts.map +1 -0
  33. package/dist/types/components/status-indicator.d.ts +10 -0
  34. package/dist/types/components/status-indicator.d.ts.map +1 -0
  35. package/dist/types/components/timebar.d.ts +15 -0
  36. package/dist/types/components/timebar.d.ts.map +1 -0
  37. package/dist/types/hooks/toast-context.d.ts +7 -0
  38. package/dist/types/hooks/toast-context.d.ts.map +1 -0
  39. package/dist/types/hooks/use-toast.d.ts +5 -0
  40. package/dist/types/hooks/use-toast.d.ts.map +1 -0
  41. package/dist/types/index.d.ts +28 -0
  42. package/dist/types/index.d.ts.map +1 -0
  43. package/dist/types/lib/map-editor-api.d.ts +547 -0
  44. package/dist/types/lib/map-editor-api.d.ts.map +1 -0
  45. package/dist/types/lib/queryClient.d.ts +9 -0
  46. package/dist/types/lib/queryClient.d.ts.map +1 -0
  47. package/dist/types/lib/timeline-store.d.ts +37 -0
  48. package/dist/types/lib/timeline-store.d.ts.map +1 -0
  49. package/dist/types/lib/utils.d.ts +3 -0
  50. package/dist/types/lib/utils.d.ts.map +1 -0
  51. package/package.json +1 -1
@@ -0,0 +1,547 @@
1
+ import type { Layer } from '@/components/layers-panel';
2
+ /**
3
+ * Information about the current map viewport
4
+ */
5
+ export interface ViewportInfo {
6
+ /** Center coordinates [lng, lat] */
7
+ center: [number, number];
8
+ /** Current zoom level */
9
+ zoom: number;
10
+ /** Bounding box: [minLng, minLat, maxLng, maxLat] */
11
+ bounds: [number, number, number, number];
12
+ /**
13
+ * Normalized query bounds (clamped to valid ranges and handling anti-meridian).
14
+ * More suitable for backend queries than raw bounds.
15
+ */
16
+ queryBounds: {
17
+ minLng: number;
18
+ maxLng: number;
19
+ minLat: number;
20
+ maxLat: number;
21
+ };
22
+ }
23
+ /**
24
+ * Definition for a raster tile basemap (e.g., local tile server, OSM, etc.)
25
+ */
26
+ export interface RasterBasemapDefinition {
27
+ type: 'raster';
28
+ /** Tile URL template with {z}, {x}, {y} placeholders */
29
+ tiles: string[];
30
+ /** Tile size in pixels (default: 256) */
31
+ tileSize?: number;
32
+ /** Minimum zoom level (default: 0) */
33
+ minzoom?: number;
34
+ /** Maximum zoom level (default: 22) */
35
+ maxzoom?: number;
36
+ /** Attribution text */
37
+ attribution?: string;
38
+ /** Display name for the basemap switcher */
39
+ name?: string;
40
+ }
41
+ /**
42
+ * Definition for a vector tile basemap with a style JSON
43
+ */
44
+ export interface VectorBasemapDefinition {
45
+ type: 'vector';
46
+ /** URL to the style JSON, or an inline style object */
47
+ style: string | object;
48
+ /** Optional local glyph URL template (for offline text rendering) */
49
+ glyphs?: string;
50
+ /** Optional local sprite URL (for offline icons) */
51
+ sprite?: string;
52
+ /** Display name for the basemap switcher */
53
+ name?: string;
54
+ }
55
+ /**
56
+ * Union type for all basemap definitions
57
+ */
58
+ export type BasemapDefinition = RasterBasemapDefinition | VectorBasemapDefinition;
59
+ /**
60
+ * Parameters passed to the search engine callback
61
+ */
62
+ export interface SearchEngineParams {
63
+ /** Current map viewport information including bounds */
64
+ viewport: ViewportInfo;
65
+ /** ID of the currently active editable layer, or null if none */
66
+ activeLayerId: string | null;
67
+ /** Optional search query string (for text-based searches) */
68
+ searchQuery?: string;
69
+ /** Additional context that can be passed through */
70
+ context?: Record<string, unknown>;
71
+ }
72
+ /**
73
+ * Callback type for external search engine integration.
74
+ * Implement this to connect the map to your database or API.
75
+ * Return a FeatureCollection to add features to the active layer,
76
+ * or null to cancel/abort the operation.
77
+ */
78
+ export type SearchEngineCallback = (params: SearchEngineParams) => Promise<GeoJSON.FeatureCollection | null>;
79
+ /**
80
+ * Result from a geocoder search
81
+ */
82
+ export interface GeocoderResult {
83
+ /** Latitude of the found location */
84
+ lat: number;
85
+ /** Longitude of the found location */
86
+ lon: number;
87
+ /** Display name of the location */
88
+ displayName: string;
89
+ }
90
+ /**
91
+ * Provider for custom geocoding implementation.
92
+ * Use this when your geocoder is an internal API rather than a URL endpoint.
93
+ * Return a result or null if not found.
94
+ */
95
+ export type GeocoderProvider = (query: string) => Promise<GeocoderResult | null>;
96
+ /**
97
+ * Entity type definition for the type picker
98
+ */
99
+ export interface EntityType {
100
+ /** Unique identifier for the type */
101
+ id: string;
102
+ /** Display name */
103
+ label: string;
104
+ /** Icon name (lucide icon name or custom) */
105
+ icon?: string;
106
+ }
107
+ /**
108
+ * Callback type for providing custom entity cards in the properties panel.
109
+ * Called for each selected feature to render a custom card.
110
+ * Return a React node to display, or null to show nothing.
111
+ */
112
+ export type EntityCardProvider = (feature: GeoJSON.Feature) => React.ReactNode;
113
+ /**
114
+ * Callback type for providing custom HTML content in hover tooltips.
115
+ * Called when the user hovers over a feature on the map.
116
+ * Return an HTML string to display, or null to skip the tooltip.
117
+ */
118
+ export type TooltipProvider = (feature: GeoJSON.Feature) => string | null;
119
+ /**
120
+ * Callback type for providing a custom type picker.
121
+ * Called when the user clicks the "..." button next to the entity type.
122
+ * @param currentType - The current entity type (from feature.properties.entityType)
123
+ * @param onSelect - Callback to call when user selects a type
124
+ * @returns A React node (dropdown, modal, etc.) or null
125
+ */
126
+ export type TypePickerProvider = (currentType: string | undefined, onSelect: (type: EntityType) => void) => React.ReactNode;
127
+ /**
128
+ * Result returned from a feature save operation
129
+ */
130
+ export interface FeatureSaveResult {
131
+ /** New ID to assign to the feature (replaces the internal ID) */
132
+ id: string;
133
+ /** Workspace folder path or identifier */
134
+ workspace: string;
135
+ /** Source name for the feature */
136
+ sourceName: string;
137
+ }
138
+ /**
139
+ * Context passed to the feature save provider
140
+ */
141
+ export interface FeatureSaveContext {
142
+ /** The feature being saved */
143
+ feature: GeoJSON.Feature;
144
+ /** Layer information */
145
+ layer: {
146
+ id: string;
147
+ name: string;
148
+ };
149
+ /** Current workspace if previously saved */
150
+ currentWorkspace?: string;
151
+ /** Current source name if previously saved */
152
+ currentSourceName?: string;
153
+ }
154
+ /**
155
+ * Callback type for providing a custom feature save UI.
156
+ * Called when the user clicks the Save button for an unsaved feature.
157
+ * Return a FeatureSaveResult to complete the save, or null to cancel.
158
+ */
159
+ export type FeatureSaveProvider = (context: FeatureSaveContext) => Promise<FeatureSaveResult | null>;
160
+ /**
161
+ * Context passed to the context menu provider when user right-clicks on features
162
+ */
163
+ export interface ContextMenuContext {
164
+ /** Array of currently selected GeoJSON features */
165
+ selectedFeatures: GeoJSON.Feature[];
166
+ /** Layer information for each selected feature (keyed by feature ID) */
167
+ featureLayers: Record<string, {
168
+ layerId: string;
169
+ layerName: string;
170
+ }>;
171
+ /** Coordinates where the user right-clicked [lng, lat] */
172
+ clickCoords: [number, number];
173
+ /** Current map viewport information */
174
+ viewport: ViewportInfo;
175
+ /** Whether edit mode is currently enabled */
176
+ isEditMode: boolean;
177
+ /** ID of the currently active editable layer, or null */
178
+ activeLayerId: string | null;
179
+ /** The original mouse event */
180
+ event: MouseEvent;
181
+ }
182
+ /**
183
+ * A single menu item to display in the context menu
184
+ */
185
+ export interface ContextMenuItem {
186
+ /** Unique identifier for this menu item */
187
+ id: string;
188
+ /** Display label */
189
+ label: string;
190
+ /** Optional icon name (lucide icon) */
191
+ icon?: string;
192
+ /** Whether the item is disabled */
193
+ disabled?: boolean;
194
+ /** Whether this is a destructive action (renders in red) */
195
+ destructive?: boolean;
196
+ /** Callback when item is selected */
197
+ onSelect: () => void;
198
+ }
199
+ /**
200
+ * Callback type for providing custom context menu items.
201
+ * Called when user right-clicks on the map with features selected.
202
+ * Return an array of menu items to display, or null/empty array for no menu.
203
+ */
204
+ export type ContextMenuProvider = (context: ContextMenuContext) => ContextMenuItem[] | null;
205
+ /**
206
+ * Built-in basemap style identifiers
207
+ */
208
+ export type BuiltInBasemapStyle = 'streets' | 'satellite' | 'dark';
209
+ export interface MapEditorHandle {
210
+ flyTo: (coords: [number, number], zoom?: number) => void;
211
+ fitToData: (layerIds?: string[]) => void;
212
+ centerOnFeature: (featureId: string) => void;
213
+ listLayers: () => Layer[];
214
+ addLayer: (name: string, geojson?: GeoJSON.FeatureCollection, options?: {
215
+ readOnly?: boolean;
216
+ skipFit?: boolean;
217
+ fitPadding?: number;
218
+ }) => string;
219
+ removeLayer: (layerId: string) => boolean;
220
+ setLayerVisibility: (layerId: string, visible: boolean) => void;
221
+ addFeatures: (layerId: string, features: GeoJSON.Feature[]) => string[];
222
+ removeFeatures: (featureIds: string[]) => void;
223
+ selectFeatures: (featureIds: string[]) => void;
224
+ clearSelection: () => void;
225
+ getSelectedFeatures: () => GeoJSON.Feature[];
226
+ setEditMode: (enabled: boolean) => void;
227
+ isEditModeEnabled: () => boolean;
228
+ setTimelineEnabled: (enabled: boolean) => void;
229
+ setTimelineRange: (start: Date, end: Date) => void;
230
+ exportGeoJSON: (layerIds?: string[]) => GeoJSON.FeatureCollection;
231
+ importGeoJSON: (layerId: string, geojson: GeoJSON.FeatureCollection) => string[];
232
+ /** Returns the ID of the currently active editable layer, or null if none is selected */
233
+ getActiveEditableLayerId: () => string | null;
234
+ /** Returns true if there is an active editable layer that can receive new features */
235
+ canAddFeatures: () => boolean;
236
+ /** Register a custom basemap at runtime */
237
+ registerBasemap: (id: string, definition: BasemapDefinition) => void;
238
+ /** Unregister a custom basemap */
239
+ unregisterBasemap: (id: string) => boolean;
240
+ /** Switch to a specific basemap by ID (built-in or custom) */
241
+ setBasemap: (id: string) => void;
242
+ /** Get the current active basemap ID */
243
+ getBasemap: () => string;
244
+ /** List all available basemap IDs (built-in + custom) */
245
+ listBasemaps: () => string[];
246
+ /** Set the active drawing mode programmatically */
247
+ setDrawingMode: (mode: 'simple_select' | 'draw_point' | 'draw_line_string' | 'draw_polygon') => void;
248
+ /** Get the current drawing mode */
249
+ getDrawingMode: () => string;
250
+ /**
251
+ * Update features in a read-only layer without disrupting editing context.
252
+ * This is useful for data layers that need to refresh based on viewport changes.
253
+ * Returns true if successful, false if the layer doesn't exist or isn't read-only.
254
+ */
255
+ updateReadOnlyLayer: (layerId: string, features: GeoJSON.Feature[]) => boolean;
256
+ /**
257
+ * Create or update a named read-only layer atomically.
258
+ * If a layer with the same name already exists, its features are replaced in place.
259
+ * If not, a new read-only layer is created. Returns the layer ID.
260
+ */
261
+ setLayerData: (name: string, geojson: GeoJSON.FeatureCollection, options?: {
262
+ fitPadding?: number;
263
+ }) => string;
264
+ /**
265
+ * Get the current map viewport synchronously.
266
+ * Returns null if the map is not yet loaded.
267
+ * Useful for external code that needs to read the current view state.
268
+ */
269
+ getViewport: () => ViewportInfo | null;
270
+ /**
271
+ * Get features for a specific layer by ID.
272
+ * Returns an array of GeoJSON features, or an empty array if the layer doesn't exist.
273
+ */
274
+ getLayerData: (layerId: string) => GeoJSON.Feature[];
275
+ /**
276
+ * Get the current timeline filter range.
277
+ * Returns null for start/end if no filter is active.
278
+ */
279
+ getTimelineRange: () => {
280
+ start: Date | null;
281
+ end: Date | null;
282
+ };
283
+ /**
284
+ * Get the total count of unsaved features across all layers.
285
+ * Returns 0 if no unsaved features exist.
286
+ */
287
+ getMapUnsavedCount: () => number;
288
+ }
289
+ export interface MapEditorConfig {
290
+ enableDrawing?: boolean;
291
+ enableLayers?: boolean;
292
+ enableTimeline?: boolean;
293
+ enableMeasurement?: boolean;
294
+ enableSelection?: boolean;
295
+ /** Hide specific drawing tools from the toolbar */
296
+ hiddenDrawingTools?: ('point' | 'line' | 'polygon' | 'text' | 'arrow' | 'circle')[];
297
+ showDebugSidebar?: boolean;
298
+ initialCenter?: [number, number];
299
+ initialZoom?: number;
300
+ /** Initial drawing mode to activate when the map loads */
301
+ initialDrawingMode?: 'simple_select' | 'draw_point' | 'draw_line_string' | 'draw_polygon';
302
+ /** Initial basemap style - can be a built-in style or a custom basemap ID */
303
+ baseMapStyle?: BuiltInBasemapStyle | string;
304
+ /**
305
+ * Custom basemaps to register on initialization.
306
+ * Keys are basemap IDs, values are basemap definitions.
307
+ * Example for a local tile server:
308
+ * {
309
+ * 'local-osm': {
310
+ * type: 'raster',
311
+ * tiles: ['http://localhost:8080/{z}/{x}/{y}.png'],
312
+ * tileSize: 256,
313
+ * name: 'Local OSM'
314
+ * }
315
+ * }
316
+ */
317
+ customBasemaps?: Record<string, BasemapDefinition>;
318
+ /**
319
+ * Order of basemaps in the style switcher UI.
320
+ * Built-in styles are: 'streets', 'satellite', 'dark'
321
+ * If not specified, built-in styles appear first, then custom basemaps in registration order.
322
+ */
323
+ basemapOrder?: string[];
324
+ /**
325
+ * Custom geocoding service URL. Should accept ?q={query}&format=json&limit=1 parameters
326
+ * and return Nominatim-compatible JSON response.
327
+ * Default: 'https://nominatim.openstreetmap.org/search'
328
+ */
329
+ geocodingUrl?: string;
330
+ /**
331
+ * Custom geocoder provider function. Use instead of geocodingUrl when your geocoding
332
+ * logic is an internal API or custom implementation rather than a URL endpoint.
333
+ * Takes priority over geocodingUrl if both are provided.
334
+ */
335
+ geocoderProvider?: GeocoderProvider;
336
+ onFeatureSelect?: (features: GeoJSON.Feature[]) => void;
337
+ onFeatureCreate?: (feature: GeoJSON.Feature) => void;
338
+ onFeatureUpdate?: (feature: GeoJSON.Feature) => void;
339
+ onFeatureDelete?: (featureIds: string[]) => void;
340
+ onLayerChange?: (layers: Layer[]) => void;
341
+ /** Called when the active editing layer changes */
342
+ onActiveEditingLayerChange?: (layerId: string | null, canAddFeatures: boolean) => void;
343
+ onTimelineChange?: (start: Date | null, end: Date | null) => void;
344
+ /** Called when the map is fully loaded and ready for programmatic control */
345
+ onMapReady?: () => void;
346
+ /** Called when a rectangle/polygon selection is completed, returning the selection geometry */
347
+ onSelectionComplete?: (geometry: GeoJSON.Polygon) => void;
348
+ /** If true, keep the selection rectangle/polygon visible on the map after selection completes */
349
+ persistSelection?: boolean;
350
+ /**
351
+ * Called when the map viewport changes (pan/zoom). Useful for external systems
352
+ * that need to react to viewport changes (e.g., big data aggregation layers).
353
+ * Fires on moveend/zoomend events.
354
+ */
355
+ onViewportChange?: (viewport: ViewportInfo) => void;
356
+ /** Default selection mode when enableSelection is true. Defaults to 'click'. */
357
+ defaultSelectionMode?: 'click' | 'rectangle' | 'polygon' | 'circle';
358
+ /** Hide specific selection tools from the toolbar */
359
+ hiddenSelectionTools?: ('click' | 'rectangle' | 'polygon' | 'circle')[];
360
+ /**
361
+ * When true, show each selection tool as its own button in the toolbar
362
+ * instead of grouping them in a dropdown menu.
363
+ */
364
+ expandSelectionTools?: boolean;
365
+ /**
366
+ * Show a dedicated "Filter" button in the toolbar that activates
367
+ * rectangle selection mode for geo-filtering. Useful in search/viewer
368
+ * contexts where selection and filtering are separate concerns.
369
+ */
370
+ showFilterTool?: boolean;
371
+ /**
372
+ * Whether selection tool should be active (drawing) on initial load.
373
+ * If false, selection tools are visible in toolbar but not activated.
374
+ * Defaults to true for backward compatibility.
375
+ */
376
+ initialSelectionActive?: boolean;
377
+ /**
378
+ * Whether to show the status panel (feature count, selection count).
379
+ * Defaults to true. Set to false for filter-only modes where feature counts are not meaningful.
380
+ */
381
+ showStatusPanel?: boolean;
382
+ /**
383
+ * Show a "Clear Filter" button in the toolbar when true.
384
+ * Useful for persistent selection modes to indicate an active filter.
385
+ */
386
+ showClearFilter?: boolean;
387
+ /** Callback when the Clear Filter button is clicked */
388
+ onClearFilter?: () => void;
389
+ /** Show a dedicated "Go To / Drop to Address" button in the toolbar */
390
+ showGoToButton?: boolean;
391
+ /** Callback when user searches for a location and wants to drop a point there */
392
+ onDropPoint?: (coords: [number, number], name?: string) => void;
393
+ /**
394
+ * External search engine callback for loading data from a database or API.
395
+ * When provided, a "Search and add..." option appears in the add menu.
396
+ * The callback receives the current viewport and active layer info,
397
+ * and should return a FeatureCollection to add to the active layer.
398
+ *
399
+ * Example implementation:
400
+ * ```typescript
401
+ * onSearchEngineRequest={async (params) => {
402
+ * const { viewport, activeLayerId } = params;
403
+ * const results = await myApi.searchInBounds(viewport.queryBounds);
404
+ * return {
405
+ * type: 'FeatureCollection',
406
+ * features: results.map(r => ({
407
+ * type: 'Feature',
408
+ * geometry: { type: 'Point', coordinates: [r.lng, r.lat] },
409
+ * properties: { name: r.name }
410
+ * }))
411
+ * };
412
+ * }}
413
+ * ```
414
+ */
415
+ onSearchEngineRequest?: SearchEngineCallback;
416
+ /**
417
+ * Callback for loading GeoJSON from a workspace (external file system or API).
418
+ * When provided, "Load from workspace" menu item appears in the layer dropdown.
419
+ * The callback receives the layer ID and should return a FeatureCollection to import,
420
+ * or null to cancel.
421
+ */
422
+ onWorkspaceLoad?: (layerId: string) => Promise<GeoJSON.FeatureCollection | null>;
423
+ /**
424
+ * Callback for saving GeoJSON to a workspace (external file system or API).
425
+ * When provided, "Save to workspace" menu item appears in the layer dropdown.
426
+ * The callback receives the layer ID and the GeoJSON FeatureCollection to save.
427
+ */
428
+ onWorkspaceSave?: (layerId: string, geojson: GeoJSON.FeatureCollection) => Promise<void>;
429
+ /**
430
+ * External provider for rendering entity cards in the Properties panel.
431
+ * When provided, the Properties panel shows tabs: "Entity Cards (N)" and "Properties".
432
+ * The callback receives a GeoJSON feature and returns React content to render.
433
+ */
434
+ entityCardProvider?: EntityCardProvider;
435
+ /**
436
+ * External provider for type picker UI in the Properties panel.
437
+ * When provided, a "..." button appears next to the "type" property
438
+ * that triggers this callback with the current feature and an update handler.
439
+ */
440
+ typePickerProvider?: TypePickerProvider;
441
+ /**
442
+ * Context menu provider for custom right-click menus on features.
443
+ * Called when user right-clicks with features selected.
444
+ * Return an array of menu items to display, or null/empty for no menu.
445
+ *
446
+ * Example:
447
+ * ```typescript
448
+ * contextMenuProvider={(context) => {
449
+ * const { selectedFeatures, featureLayers, clickCoords, isEditMode } = context;
450
+ * return [
451
+ * { id: 'view', label: 'View Details', onSelect: () => showDetails(selectedFeatures) },
452
+ * { id: 'delete', label: 'Delete', destructive: true, disabled: !isEditMode, onSelect: () => deleteFeatures() },
453
+ * ];
454
+ * }}
455
+ * ```
456
+ */
457
+ contextMenuProvider?: ContextMenuProvider;
458
+ /**
459
+ * Provider for saving individual features to an external workspace.
460
+ * When provided, unsaved features show a "Save" button in the Properties panel.
461
+ * The callback receives the feature and layer info, and should return
462
+ * the new ID, workspace, and source name to assign to the feature.
463
+ * Return null to cancel the save operation.
464
+ */
465
+ featureSaveProvider?: FeatureSaveProvider;
466
+ /**
467
+ * Custom tooltip provider for hover tooltips on map features.
468
+ * When provided, overrides the default tooltip HTML with your own.
469
+ * Return an HTML string to display, or null to skip the tooltip.
470
+ */
471
+ tooltipProvider?: TooltipProvider;
472
+ /**
473
+ * Custom glyphs URL for font files. Used for offline/air-gapped deployments.
474
+ * Default is local fonts bundled with the application: '/fonts/{fontstack}/{range}.pbf'
475
+ * The template must include {fontstack} and {range} placeholders.
476
+ * Set to external URL like 'https://fonts.openmaptiles.org/{fontstack}/{range}.pbf' for online use.
477
+ */
478
+ glyphsUrl?: string;
479
+ /**
480
+ * GeoJSON Polygon to render as a filter overlay on the map.
481
+ * When set, draws a semi-transparent filled polygon with a dashed border.
482
+ * Pass null/undefined to remove the overlay.
483
+ */
484
+ filterGeometry?: GeoJSON.Polygon | null;
485
+ /**
486
+ * Enable/disable satellite basemap layer. Default: true.
487
+ * Set to false for air-gapped deployments without satellite imagery access.
488
+ */
489
+ enableSatellite?: boolean;
490
+ /**
491
+ * Enable/disable 3D terrain features. Default: true.
492
+ * Set to false for air-gapped deployments without terrain DEM access.
493
+ */
494
+ enableTerrain?: boolean;
495
+ /**
496
+ * Enable/disable 3D terrain hill-shading and altitude features. Default: true.
497
+ * Requires enableTerrain to also be true.
498
+ */
499
+ enable3D?: boolean;
500
+ /**
501
+ * Hide the basemap style switcher (Streets, Satellite, Dark, Terrain, 3D buttons).
502
+ * Default: false.
503
+ * When true, the map uses only the style specified by baseMapStyle (default: 'streets')
504
+ * or custom basemaps. Useful for air-gapped deployments where external tile providers
505
+ * are not available and only a local tile server is used.
506
+ */
507
+ hideBasemapSwitcher?: boolean;
508
+ /**
509
+ * Indicates that feature persistence is handled externally (e.g., by a parent component
510
+ * via onFeatureCreate/onFeatureUpdate callbacks). When true:
511
+ * - Features are NOT marked with the _unsaved flag when created or edited
512
+ * - "Unsaved" badges are hidden in the layers panel
513
+ *
514
+ * Use this in embedding scenarios where the parent component manages data persistence,
515
+ * such as the Feature Editor pattern where coordinates stream to an external form.
516
+ * Default: false
517
+ */
518
+ externalPersistence?: boolean;
519
+ /**
520
+ * Enable keyboard shortcuts for drawing tools and selection modes.
521
+ * When true, shortcuts are scoped to the map container (requires focus via click).
522
+ * When false, all keyboard handlers are disabled and shortcut hints are hidden from the UI.
523
+ * Default: true.
524
+ */
525
+ enableKeyboardShortcuts?: boolean;
526
+ /**
527
+ * Whether to show the properties panel when a feature is selected.
528
+ * Default: true.
529
+ */
530
+ enableProperties?: boolean;
531
+ /**
532
+ * Optional callback for showing toast notifications.
533
+ * When provided, the map component delegates all toast calls to this function
534
+ * instead of using its own internal Ant Design-based toast.
535
+ * This avoids cross-bundle Ant Design context issues when the map component
536
+ * is consumed as an npm package.
537
+ */
538
+ toastProvider?: (options: {
539
+ title?: string;
540
+ description?: string;
541
+ variant?: 'default' | 'destructive';
542
+ }) => void;
543
+ }
544
+ export interface MapEditorProps extends MapEditorConfig {
545
+ className?: string;
546
+ }
547
+ //# sourceMappingURL=map-editor-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-editor-api.d.ts","sourceRoot":"","sources":["../../../client/src/lib/map-editor-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC;;;OAGG;IACH,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;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,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;KAAE,KAAK,IAAI,CAAC;CAClH;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,9 @@
1
+ import { QueryClient, QueryFunction } from "@tanstack/react-query";
2
+ export declare function apiRequest(method: string, url: string, data?: unknown | undefined): Promise<Response>;
3
+ type UnauthorizedBehavior = "returnNull" | "throw";
4
+ export declare const getQueryFn: <T>(options: {
5
+ on401: UnauthorizedBehavior;
6
+ }) => QueryFunction<T>;
7
+ export declare const queryClient: QueryClient;
8
+ export {};
9
+ //# sourceMappingURL=queryClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryClient.d.ts","sourceRoot":"","sources":["../../../client/src/lib/queryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AASnE,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GACzB,OAAO,CAAC,QAAQ,CAAC,CAUnB;AAED,KAAK,oBAAoB,GAAG,YAAY,GAAG,OAAO,CAAC;AACnD,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE;IACpC,KAAK,EAAE,oBAAoB,CAAC;CAC7B,KAAK,aAAa,CAAC,CAAC,CAalB,CAAC;AAEJ,eAAO,MAAM,WAAW,aAatB,CAAC"}
@@ -0,0 +1,37 @@
1
+ export interface TemporalFeature {
2
+ id: string;
3
+ startDate: Date | null;
4
+ endDate: Date | null;
5
+ layerId: string;
6
+ }
7
+ export interface TimelineState {
8
+ isEnabled: boolean;
9
+ hasTemporalData: boolean;
10
+ temporalFeatures: TemporalFeature[];
11
+ untimedFeatureIds: string[];
12
+ globalMinDate: Date | null;
13
+ globalMaxDate: Date | null;
14
+ rangeStart: Date | null;
15
+ rangeEnd: Date | null;
16
+ isPlaying: boolean;
17
+ playbackSpeed: number;
18
+ histogramBins: {
19
+ start: Date;
20
+ end: Date;
21
+ count: number;
22
+ }[];
23
+ setEnabled: (enabled: boolean) => void;
24
+ setTemporalFeatures: (features: TemporalFeature[], untimedIds: string[]) => void;
25
+ setRange: (start: Date | null, end: Date | null) => void;
26
+ setPlaying: (playing: boolean) => void;
27
+ setPlaybackSpeed: (speed: number) => void;
28
+ advancePlayhead: () => boolean;
29
+ reset: () => void;
30
+ }
31
+ export declare function normalizeTemporalProperties(properties: Record<string, unknown>): {
32
+ startDate: Date | null;
33
+ endDate: Date | null;
34
+ };
35
+ export declare function isFeatureInRange(feature: TemporalFeature, rangeStart: Date | null, rangeEnd: Date | null): boolean;
36
+ export declare const useTimelineStore: import("zustand").UseBoundStore<import("zustand").StoreApi<TimelineState>>;
37
+ //# sourceMappingURL=timeline-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-store.d.ts","sourceRoot":"","sources":["../../../client/src/lib/timeline-store.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;C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xB,UAAU,EAAE,IAAI,GAAG,IAAI,EACvB,QAAQ,EAAE,IAAI,GAAG,IAAI,GACpB,OAAO,CAQT;AAgDD,eAAO,MAAM,gBAAgB,4EA2H1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../client/src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octostar/map-component",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "description": "MapLibre-based map editor component",