@kepler.gl/actions 3.3.0-alpha.0 → 3.3.0-alpha.10

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 (37) hide show
  1. package/dist/action-types.d.ts +58 -0
  2. package/dist/action-wrapper.d.ts +22 -17
  3. package/dist/actions.d.ts +7 -0
  4. package/dist/cjs/action-types.js +228 -0
  5. package/dist/cjs/action-wrapper.js +177 -0
  6. package/dist/cjs/actions.js +193 -0
  7. package/dist/cjs/identity-actions.js +86 -0
  8. package/dist/cjs/index.js +182 -0
  9. package/dist/cjs/map-state-actions.js +158 -0
  10. package/dist/cjs/map-style-actions.js +211 -0
  11. package/dist/cjs/provider-actions.js +99 -0
  12. package/dist/cjs/ui-state-actions.js +404 -0
  13. package/dist/cjs/vis-state-actions.js +1511 -0
  14. package/dist/esm/action-types.js +222 -0
  15. package/dist/esm/action-wrapper.js +171 -0
  16. package/dist/esm/actions.js +186 -0
  17. package/dist/esm/identity-actions.js +79 -0
  18. package/dist/esm/index.js +27 -0
  19. package/dist/esm/map-state-actions.js +151 -0
  20. package/dist/esm/map-style-actions.js +204 -0
  21. package/dist/esm/provider-actions.js +93 -0
  22. package/dist/esm/ui-state-actions.js +398 -0
  23. package/dist/esm/vis-state-actions.js +1409 -0
  24. package/dist/map-state-actions.d.ts +68 -2
  25. package/dist/ui-state-actions.d.ts +29 -1
  26. package/dist/vis-state-actions.d.ts +350 -7
  27. package/package.json +30 -22
  28. package/dist/action-types.js +0 -198
  29. package/dist/action-wrapper.js +0 -174
  30. package/dist/actions.js +0 -187
  31. package/dist/identity-actions.js +0 -86
  32. package/dist/index.js +0 -183
  33. package/dist/map-state-actions.js +0 -105
  34. package/dist/map-style-actions.js +0 -211
  35. package/dist/provider-actions.js +0 -99
  36. package/dist/ui-state-actions.js +0 -374
  37. package/dist/vis-state-actions.js +0 -1173
@@ -1,5 +1,6 @@
1
1
  import { default as ActionTypes } from './action-types';
2
- import { Bounds, Merge, Viewport } from '@kepler.gl/types';
2
+ import { Bounds, Merge, Viewport, ViewportPadding } from '@kepler.gl/types';
3
+ import { MapSplitMode, MapViewMode, GlobeConfig } from '@kepler.gl/constants';
3
4
  export type TogglePerspectiveUpdaterAction = void;
4
5
  /**
5
6
  *
@@ -15,17 +16,22 @@ export declare const togglePerspective: () => Merge<TogglePerspectiveUpdaterActi
15
16
  }>;
16
17
  export type FitBoundsUpdaterAction = {
17
18
  payload: Bounds;
19
+ meta?: {
20
+ padding?: ViewportPadding;
21
+ };
18
22
  };
19
23
  /**
20
24
  * Fit map viewport to bounds
21
25
  * @memberof mapStateActions
22
26
  * @param {Array<Number>} bounds as `[lngMin, latMin, lngMax, latMax]`
27
+ * @param {Number|Object} [padding] padding in pixels around the bounds. Can be a number or `{top, bottom, left, right}`.
23
28
  * @public
24
29
  * @example
25
30
  * import {fitBounds} from '@kepler.gl/actions';
26
31
  * this.props.dispatch(fitBounds([-122.23, 37.127, -122.11, 37.456]));
32
+ * this.props.dispatch(fitBounds([-122.23, 37.127, -122.11, 37.456], {left: 300}));
27
33
  */
28
- export declare const fitBounds: (payload: Bounds) => Merge<FitBoundsUpdaterAction, {
34
+ export declare const fitBounds: (bounds: Bounds, padding?: ViewportPadding) => Merge<FitBoundsUpdaterAction, {
29
35
  type: typeof ActionTypes.FIT_BOUNDS;
30
36
  }>;
31
37
  export type UpdateMapUpdaterAction = {
@@ -89,3 +95,63 @@ export declare const toggleSplitMapViewport: (payload: {
89
95
  }) => Merge<ToggleSplitMapViewportUpdaterAction, {
90
96
  type: typeof ActionTypes.TOGGLE_SPLIT_MAP_VIEWPORT;
91
97
  }>;
98
+ export type SetMapViewModeUpdaterAction = {
99
+ payload: {
100
+ mapViewMode: MapViewMode;
101
+ };
102
+ };
103
+ /**
104
+ * Set map view mode (2D, 3D, or Globe)
105
+ * @memberof mapStateActions
106
+ * @param mapViewMode - One of MapViewMode values
107
+ * @public
108
+ */
109
+ export declare const setMapViewMode: (mapViewMode: MapViewMode) => Merge<SetMapViewModeUpdaterAction, {
110
+ type: typeof ActionTypes.SET_MAP_VIEW_MODE;
111
+ }>;
112
+ export type GlobeConfigChangeUpdaterAction = {
113
+ payload: Partial<GlobeConfig>;
114
+ };
115
+ /**
116
+ * Update globe configuration
117
+ * @memberof mapStateActions
118
+ * @param config - Partial globe config to merge
119
+ * @public
120
+ */
121
+ export declare const globeConfigChange: (config: Partial<GlobeConfig>) => Merge<GlobeConfigChangeUpdaterAction, {
122
+ type: typeof ActionTypes.GLOBE_CONFIG_CHANGE;
123
+ }>;
124
+ export type SetMapSplitModeUpdaterAction = {
125
+ payload: {
126
+ mapSplitMode: MapSplitMode;
127
+ };
128
+ };
129
+ /**
130
+ * Set map split mode (single, dual, or swipe)
131
+ * @memberof mapStateActions
132
+ * @param {Object} payload
133
+ * @param {MapSplitMode} payload.mapSplitMode The split mode to set
134
+ * @public
135
+ */
136
+ export declare const setMapSplitMode: (payload: {
137
+ mapSplitMode: MapSplitMode;
138
+ }) => Merge<SetMapSplitModeUpdaterAction, {
139
+ type: typeof ActionTypes.SET_MAP_SPLIT_MODE;
140
+ }>;
141
+ export type SetSwipeComparePercentageUpdaterAction = {
142
+ payload: {
143
+ percentage: number;
144
+ };
145
+ };
146
+ /**
147
+ * Set the swipe compare divider position
148
+ * @memberof mapStateActions
149
+ * @param {Object} payload
150
+ * @param {number} payload.percentage The percentage position (0-100)
151
+ * @public
152
+ */
153
+ export declare const setSwipeComparePercentage: (payload: {
154
+ percentage: number;
155
+ }) => Merge<SetSwipeComparePercentageUpdaterAction, {
156
+ type: typeof ActionTypes.SET_SWIPE_COMPARE_PERCENTAGE;
157
+ }>;
@@ -1,5 +1,5 @@
1
1
  import { default as ActionTypes } from './action-types';
2
- import { Merge, ExportImage } from '@kepler.gl/types';
2
+ import { Merge, ExportImage, ExportVideo } from '@kepler.gl/types';
3
3
  /** TOGGLE_SIDE_PANEL */
4
4
  export type ToggleSidePanelUpdaterAction = {
5
5
  payload: string | null;
@@ -215,6 +215,19 @@ export declare const setExportImageError: (error: SetExportImageErrorUpdaterActi
215
215
  export declare const cleanupExportImage: () => {
216
216
  type: typeof ActionTypes.CLEANUP_EXPORT_IMAGE;
217
217
  };
218
+ /** SET_EXPORT_VIDEO_SETTING */
219
+ export type SetExportVideoSettingUpdaterAction = {
220
+ payload: Partial<ExportVideo>;
221
+ };
222
+ /**
223
+ * Set `exportVideo` settings: mediaType, cameraPreset, fileName, resolution, durationMs
224
+ * @memberof uiStateActions
225
+ * @param newSetting - {mediaType: 'webm'}
226
+ * @public
227
+ */
228
+ export declare const setExportVideoSetting: (newSetting: SetExportVideoSettingUpdaterAction['payload']) => Merge<SetExportVideoSettingUpdaterAction, {
229
+ type: typeof ActionTypes.SET_EXPORT_VIDEO_SETTING;
230
+ }>;
218
231
  /** SET_EXPORT_SELECTED_DATASET */
219
232
  export type SetExportSelectedDatasetUpdaterAction = {
220
233
  payload: string;
@@ -315,6 +328,21 @@ export type SetLocaleUpdaterAction = {
315
328
  export declare const setLocale: (locale: SetLocaleUpdaterAction['payload']['locale']) => Merge<SetLocaleUpdaterAction, {
316
329
  type: typeof ActionTypes.SET_LOCALE;
317
330
  }>;
331
+ /** SET_THEME */
332
+ export type SetThemeUpdaterAction = {
333
+ payload: {
334
+ theme: string;
335
+ };
336
+ };
337
+ /**
338
+ * Set UI `theme` value (`light` or `dark`)
339
+ * @memberof uiStateActions
340
+ * @param theme - theme of the UI
341
+ * @public
342
+ */
343
+ export declare const setTheme: (theme: SetThemeUpdaterAction['payload']['theme']) => Merge<SetThemeUpdaterAction, {
344
+ type: typeof ActionTypes.SET_THEME;
345
+ }>;
318
346
  /** TOGGLE_PANEL_LIST_VIEW */
319
347
  export type TogglePanelListViewAction = {
320
348
  payload: {
@@ -2,7 +2,7 @@ import { default as ActionTypes } from './action-types';
2
2
  import { FileCacheItem } from '@kepler.gl/processors';
3
3
  import { Layer, LayerBaseConfig } from '@kepler.gl/layers';
4
4
  import { KeplerTable } from '@kepler.gl/table';
5
- import { AddDataToMapPayload, ValueOf, Merge, PickInfo, RGBColor, NestedPartial, LayerVisConfig, ColorUI, Feature, FeatureSelectionContext, InteractionConfig, Filter, ParsedConfig, ParsedLayer, EffectPropsPartial, SyncTimelineMode, AnimationConfig, FilterAnimationConfig } from '@kepler.gl/types';
5
+ import { AddDataToMapPayload, ViewportPadding, ValueOf, Merge, PickInfo, RGBColor, NestedPartial, LayerVisConfig, ColorUI, Feature, FeatureSelectionContext, InteractionConfig, Filter, ParsedConfig, ParsedLayer, EffectPropsPartial, AnnotationPropsPartial, SyncTimelineMode, AnimationConfig, FilterAnimationConfig, LayerOrder, LayerOrderGroup, ProtoDataset } from '@kepler.gl/types';
6
6
  export type ApplyLayerConfigUpdaterAction = {
7
7
  oldLayerId: string;
8
8
  newLayerConfig: ParsedLayer;
@@ -299,7 +299,7 @@ export declare function addLayer(config?: object, datasetId?: string): Merge<Add
299
299
  type: typeof ActionTypes.ADD_LAYER;
300
300
  }>;
301
301
  export type ReorderLayerUpdaterAction = {
302
- order: string[];
302
+ order: LayerOrder;
303
303
  };
304
304
  /**
305
305
  * Reorder layer, order is an array of layer indexes, index 0 will be the one at the bottom
@@ -313,9 +313,55 @@ export type ReorderLayerUpdaterAction = {
313
313
  * `layers[1]` will be at the bottom, `layers[13]` will be at the top.
314
314
  * this.props.dispatch(reorderLayer([`layers[1].id`, `layers[0].id`, `layers[2].id`, `layers[3].id`]));
315
315
  */
316
- export declare function reorderLayer(order: string[]): Merge<ReorderLayerUpdaterAction, {
316
+ export declare function reorderLayer(order: LayerOrder): Merge<ReorderLayerUpdaterAction, {
317
317
  type: typeof ActionTypes.REORDER_LAYER;
318
318
  }>;
319
+ export type AddLayerGroupUpdaterAction = {
320
+ id?: string;
321
+ label?: string;
322
+ isVisible?: boolean;
323
+ layerOrder?: string[];
324
+ isIncludedInLegend?: boolean;
325
+ };
326
+ export declare function addLayerGroup(payload: AddLayerGroupUpdaterAction): Merge<AddLayerGroupUpdaterAction, {
327
+ type: typeof ActionTypes.ADD_LAYER_GROUP;
328
+ }>;
329
+ export type RemoveLayerGroupUpdaterAction = {
330
+ id: string;
331
+ };
332
+ export declare function removeLayerGroup(payload: RemoveLayerGroupUpdaterAction): Merge<RemoveLayerGroupUpdaterAction, {
333
+ type: typeof ActionTypes.REMOVE_LAYER_GROUP;
334
+ }>;
335
+ export type UpdateLayerGroupUpdaterAction = {
336
+ id: string;
337
+ options: Partial<Omit<LayerOrderGroup, 'id'>>;
338
+ };
339
+ export declare function updateLayerGroup(payload: UpdateLayerGroupUpdaterAction): Merge<UpdateLayerGroupUpdaterAction, {
340
+ type: typeof ActionTypes.UPDATE_LAYER_GROUP;
341
+ }>;
342
+ export type AddLayerToLayerGroupUpdaterAction = {
343
+ layerGroupId: string;
344
+ layerId: string;
345
+ };
346
+ export declare function addLayerToLayerGroup(payload: AddLayerToLayerGroupUpdaterAction): Merge<AddLayerToLayerGroupUpdaterAction, {
347
+ type: typeof ActionTypes.ADD_LAYER_TO_LAYER_GROUP;
348
+ }>;
349
+ export type RemoveLayerFromLayerGroupUpdaterAction = {
350
+ layerGroupId: string;
351
+ layerId: string;
352
+ };
353
+ export declare function removeLayerFromLayerGroup(payload: RemoveLayerFromLayerGroupUpdaterAction): Merge<RemoveLayerFromLayerGroupUpdaterAction, {
354
+ type: typeof ActionTypes.REMOVE_LAYER_FROM_LAYER_GROUP;
355
+ }>;
356
+ export type SwapLayerOrderEntriesUpdaterAction = {
357
+ originLayerId: string;
358
+ destinationLayerId?: string;
359
+ originLayerGroupId?: string;
360
+ destinationLayerGroupId?: string;
361
+ };
362
+ export declare function swapLayerOrderEntries(payload: SwapLayerOrderEntriesUpdaterAction): Merge<SwapLayerOrderEntriesUpdaterAction, {
363
+ type: typeof ActionTypes.SWAP_LAYER_ORDER_ENTRIES;
364
+ }>;
319
365
  export type RemoveFilterUpdaterAction = {
320
366
  idx: number;
321
367
  };
@@ -408,6 +454,75 @@ export type UpdateEffectUpdaterAction = {
408
454
  export declare function updateEffect(id: string, props: EffectPropsPartial): Merge<UpdateEffectUpdaterAction, {
409
455
  type: typeof ActionTypes.UPDATE_EFFECT;
410
456
  }>;
457
+ export type AddAnnotationUpdaterAction = {
458
+ config?: AnnotationPropsPartial;
459
+ };
460
+ /**
461
+ * Add a new annotation
462
+ * @memberof visStateActions
463
+ * @param config - new annotation config
464
+ * @returns action
465
+ * @public
466
+ */
467
+ export declare function addAnnotation(config?: AnnotationPropsPartial): Merge<AddAnnotationUpdaterAction, {
468
+ type: typeof ActionTypes.ADD_ANNOTATION;
469
+ }>;
470
+ export type RemoveAnnotationUpdaterAction = {
471
+ id: string;
472
+ };
473
+ /**
474
+ * Remove an annotation
475
+ * @memberof visStateActions
476
+ * @param id id of the annotation to be removed
477
+ * @returns action
478
+ * @public
479
+ */
480
+ export declare function removeAnnotation(id: string): Merge<RemoveAnnotationUpdaterAction, {
481
+ type: typeof ActionTypes.REMOVE_ANNOTATION;
482
+ }>;
483
+ export type UpdateAnnotationUpdaterAction = {
484
+ id: string;
485
+ config: AnnotationPropsPartial;
486
+ };
487
+ /**
488
+ * Update an annotation
489
+ * @memberof visStateActions
490
+ * @param id id of the annotation to be updated
491
+ * @param config partial annotation config to merge
492
+ * @returns action
493
+ * @public
494
+ */
495
+ export declare function updateAnnotation(id: string, config: AnnotationPropsPartial): Merge<UpdateAnnotationUpdaterAction, {
496
+ type: typeof ActionTypes.UPDATE_ANNOTATION;
497
+ }>;
498
+ export type DuplicateAnnotationUpdaterAction = {
499
+ id: string;
500
+ };
501
+ /**
502
+ * Duplicate an annotation
503
+ * @memberof visStateActions
504
+ * @param id id of the annotation to be duplicated
505
+ * @returns action
506
+ * @public
507
+ */
508
+ export declare function duplicateAnnotation(id: string): Merge<DuplicateAnnotationUpdaterAction, {
509
+ type: typeof ActionTypes.DUPLICATE_ANNOTATION;
510
+ }>;
511
+ export type SetSelectedAnnotationUpdaterAction = {
512
+ id: string | null;
513
+ isEditingText?: boolean;
514
+ };
515
+ /**
516
+ * Set the selected annotation
517
+ * @memberof visStateActions
518
+ * @param id id of annotation to select, or null to deselect
519
+ * @param isEditingText whether the text of the annotation is being edited
520
+ * @returns action
521
+ * @public
522
+ */
523
+ export declare function setSelectedAnnotation(id: string | null, isEditingText?: boolean): Merge<SetSelectedAnnotationUpdaterAction, {
524
+ type: typeof ActionTypes.SET_SELECTED_ANNOTATION;
525
+ }>;
411
526
  export type RemoveDatasetUpdaterAction = {
412
527
  dataId: string;
413
528
  };
@@ -449,6 +564,123 @@ export type UpdateDatasetColorUpdater = {
449
564
  export declare function updateTableColor(dataId: string, newColor: RGBColor): Merge<UpdateDatasetColorUpdater, {
450
565
  type: typeof ActionTypes.UPDATE_TABLE_COLOR;
451
566
  }>;
567
+ export type RefreshDatasetUpdaterAction = {
568
+ dataId: string;
569
+ };
570
+ /**
571
+ * Re-fetch an externally hosted dataset from its source URL.
572
+ * @memberof visStateActions
573
+ * @param dataId dataset id
574
+ * @returns action
575
+ * @public
576
+ */
577
+ export declare function refreshDataset(dataId: string): Merge<RefreshDatasetUpdaterAction, {
578
+ type: typeof ActionTypes.REFRESH_DATASET;
579
+ }>;
580
+ export type RefreshDatasetSuccessUpdaterAction = {
581
+ dataId: string;
582
+ result: {
583
+ data: ProtoDataset['data'] | null;
584
+ notModified: boolean;
585
+ etag?: string;
586
+ lastModified?: string;
587
+ size?: number;
588
+ };
589
+ };
590
+ /**
591
+ * Apply a successful remote dataset refresh.
592
+ * @memberof visStateActions
593
+ * @returns action
594
+ */
595
+ export declare function refreshDatasetSuccess(dataId: string, result: RefreshDatasetSuccessUpdaterAction['result']): Merge<RefreshDatasetSuccessUpdaterAction, {
596
+ type: typeof ActionTypes.REFRESH_DATASET_SUCCESS;
597
+ }>;
598
+ export type RefreshDatasetErrorUpdaterAction = {
599
+ dataId: string;
600
+ error: Error;
601
+ };
602
+ /**
603
+ * Record a failed remote dataset refresh.
604
+ * @memberof visStateActions
605
+ * @returns action
606
+ */
607
+ export declare function refreshDatasetError(dataId: string, error: Error): Merge<RefreshDatasetErrorUpdaterAction, {
608
+ type: typeof ActionTypes.REFRESH_DATASET_ERROR;
609
+ }>;
610
+ export type RefreshDatasetProgressUpdaterAction = {
611
+ dataId: string;
612
+ percent: number;
613
+ };
614
+ /**
615
+ * Update download progress for an in-flight remote dataset refresh (0–100).
616
+ * @memberof visStateActions
617
+ * @returns action
618
+ */
619
+ export declare function refreshDatasetProgress(dataId: string, percent: number): Merge<RefreshDatasetProgressUpdaterAction, {
620
+ type: typeof ActionTypes.REFRESH_DATASET_PROGRESS;
621
+ }>;
622
+ /**
623
+ * One dataset row: a column-ordered array (same as `ProtoDataset.data.rows`)
624
+ * or a field-name record. Missing keys become `null`.
625
+ */
626
+ export type DatasetRow = any[] | Record<string, unknown>;
627
+ export type AddToDatasetOptions = {
628
+ /**
629
+ * Field name used as a unique key. Matching rows are replaced in place;
630
+ * keys that are not in the table are appended. Last incoming row wins when
631
+ * the same key appears twice. Row tables only — Arrow/DuckDB no-op with a warning.
632
+ */
633
+ upsertBy?: string;
634
+ };
635
+ export type AddToDatasetUpdaterAction = {
636
+ dataId: string;
637
+ rows: DatasetRow | DatasetRow[];
638
+ options?: AddToDatasetOptions;
639
+ };
640
+ /**
641
+ * Append rows to an existing in-memory row dataset without `addDataToMap`.
642
+ * Keeps layer identity and style. Pass `options.upsertBy` to replace rows that
643
+ * share that key and append the rest.
644
+ *
645
+ * Not implemented for Arrow or DuckDB tables (no INSERT / concat yet); those
646
+ * calls warn and leave the table unchanged. Use `addDataToMap` with
647
+ * `keepExistingConfig` for a full replace.
648
+ * @memberof visStateActions
649
+ * @param dataId dataset id
650
+ * @param rows one row or an array of rows (arrays in field order, or objects keyed by field name)
651
+ * @param options optional `{upsertBy}` field name
652
+ * @returns action
653
+ * @public
654
+ */
655
+ export declare function addToDataset(dataId: string, rows: DatasetRow | DatasetRow[], options?: AddToDatasetOptions): Merge<AddToDatasetUpdaterAction, {
656
+ type: typeof ActionTypes.ADD_TO_DATASET;
657
+ }>;
658
+ export type RemoveFromDatasetByField = {
659
+ field: string;
660
+ values: unknown | unknown[];
661
+ };
662
+ export type RemoveFromDatasetUpdaterAction = {
663
+ dataId: string;
664
+ rowIndexes?: number | number[];
665
+ byField?: RemoveFromDatasetByField;
666
+ };
667
+ /**
668
+ * Delete rows from an existing in-memory row dataset without restyling layers.
669
+ * The second argument is either row indexes or `{field, values}` to match a
670
+ * column (e.g. an id). Out-of-range indexes are a no-op for the whole action.
671
+ *
672
+ * Not implemented for Arrow or DuckDB tables; those calls warn and leave the
673
+ * table unchanged. For a full table replace use `addDataToMap` with
674
+ * `keepExistingConfig`.
675
+ * @memberof visStateActions
676
+ * @param dataId dataset id
677
+ * @param rowIndexesOrMatcher one index, an array of indexes, or `{field, values}`
678
+ * @returns action
679
+ * @public
680
+ */
681
+ export declare function removeFromDataset(dataId: string, rowIndexesOrMatcher: number | number[] | RemoveFromDatasetByField): Merge<RemoveFromDatasetUpdaterAction, {
682
+ type: typeof ActionTypes.REMOVE_FROM_DATASET;
683
+ }>;
452
684
  export type SortTableColumnUpdaterAction = {
453
685
  dataId: string;
454
686
  column: string;
@@ -510,8 +742,50 @@ export type SetColumnDisplayFormatUpdaterAction = {
510
742
  export declare function setColumnDisplayFormat(dataId: SetColumnDisplayFormatUpdaterAction['dataId'], formats: SetColumnDisplayFormatUpdaterAction['formats']): Merge<SetColumnDisplayFormatUpdaterAction, {
511
743
  type: typeof ActionTypes.SET_COLUMN_DISPLAY_FORMAT;
512
744
  }>;
745
+ export type LoadColumnStatsUpdaterAction = {
746
+ dataId: string;
747
+ fieldName: string | string[];
748
+ };
749
+ /**
750
+ * Lazily compute column statistics for the data table header.
751
+ * @param dataId
752
+ * @param fieldName one or more field names
753
+ * @returns action
754
+ * @public
755
+ */
756
+ export declare function loadColumnStats(dataId: string, fieldName: string | string[]): Merge<LoadColumnStatsUpdaterAction, {
757
+ type: typeof ActionTypes.LOAD_COLUMN_STATS;
758
+ }>;
759
+ export type LoadColumnStatsSuccessUpdaterAction = {
760
+ dataId: string;
761
+ fieldName: string;
762
+ result: any;
763
+ filterProps?: any;
764
+ };
765
+ /**
766
+ * Column statistics finished loading
767
+ * @returns action
768
+ * @public
769
+ */
770
+ export declare function loadColumnStatsSuccess(dataId: string, fieldName: string, result: any, filterProps?: any): Merge<LoadColumnStatsSuccessUpdaterAction, {
771
+ type: typeof ActionTypes.LOAD_COLUMN_STATS_SUCCESS;
772
+ }>;
773
+ export type LoadColumnStatsErrorUpdaterAction = {
774
+ dataId: string;
775
+ fieldName: string;
776
+ error: Error;
777
+ };
778
+ /**
779
+ * Column statistics failed to load
780
+ * @returns action
781
+ * @public
782
+ */
783
+ export declare function loadColumnStatsError(dataId: string, fieldName: string, error: Error): Merge<LoadColumnStatsErrorUpdaterAction, {
784
+ type: typeof ActionTypes.LOAD_COLUMN_STATS_ERROR;
785
+ }>;
513
786
  export type AddDataToMapUpdaterOptions = {
514
787
  centerMap?: boolean;
788
+ padding?: ViewportPadding;
515
789
  readOnly?: boolean;
516
790
  keepExistingConfig?: boolean;
517
791
  };
@@ -528,6 +802,8 @@ export type UpdateVisDataUpdaterAction = {
528
802
  * @param {object} options
529
803
  * @param options.centerMap `default: true` if `centerMap` is set to `true` kepler.gl will
530
804
  * place the map view within the data points boundaries
805
+ * @param options.padding padding in pixels applied when `centerMap` is true so data is not hidden
806
+ * under the side panel or other UI. Can be a number or `{top, bottom, left, right}`.
531
807
  * @param options.readOnly `default: false` if `readOnly` is set to `true`
532
808
  * the left setting panel will be hidden
533
809
  * @param config this object will contain the full kepler.gl instance configuration {mapState, mapStyle, visState}
@@ -573,6 +849,30 @@ export declare function updateDatasetProps(dataId: string, props: {
573
849
  }): Merge<UpdateDatasetPropsUpdaterAction, {
574
850
  type: typeof ActionTypes.UPDATE_DATASET_PROPS;
575
851
  }>;
852
+ export type UpdateDatasetUpdaterAction = {
853
+ dataId: string;
854
+ /** New column data + field descriptors, e.g. `{cols, fields, arrowTable}` (same shape `KeplerTable.importData` accepts). */
855
+ data: ProtoDataset['data'];
856
+ /**
857
+ * Optional old → new column-name map, used to carry layers/filters/tooltips
858
+ * across a rename (name-based reconciliation alone would treat a renamed
859
+ * column as removed).
860
+ */
861
+ renames?: Record<string, string>;
862
+ };
863
+ /**
864
+ * Update an existing dataset's schema (columns + fields) in place.
865
+ * Unlike `addDataToMap`, this keeps the dataset `id`/`label`/`color`/`metadata`
866
+ * and reconciles layers, filters and tooltip config that referenced the old
867
+ * columns. Used by the AI assistant's `map.add-column` command.
868
+ * @param dataId - ***required** Id of the dataset to update
869
+ * @param data - ***required** New column data + field descriptors
870
+ * @param renames - (Optional) old column name → new column name, so layers/filters follow a rename
871
+ * @returns action
872
+ */
873
+ export declare function updateDataset(dataId: string, data: ProtoDataset['data'], renames?: Record<string, string>): Merge<UpdateDatasetUpdaterAction, {
874
+ type: typeof ActionTypes.UPDATE_DATASET;
875
+ }>;
576
876
  export type ToggleFilterAnimationUpdaterAction = {
577
877
  idx: number;
578
878
  };
@@ -858,6 +1158,21 @@ export declare function loadFilesErr(fileName: string, error: any): Merge<LoadFi
858
1158
  export type SetFeaturesUpdaterAction = {
859
1159
  features: Feature[];
860
1160
  };
1161
+ export type SetEditorFeaturePropertiesUpdaterAction = {
1162
+ feature: Feature;
1163
+ properties: Record<string, unknown>;
1164
+ };
1165
+ /**
1166
+ * Set user-facing GeoJSON properties on a Draw on Map sketch.
1167
+ * Editor-only keys such as `filterId` and `isClosed` are preserved.
1168
+ * @memberof visStateActions
1169
+ * @param feature
1170
+ * @param properties
1171
+ * @returns action
1172
+ */
1173
+ export declare function setEditorFeatureProperties(feature: Feature, properties: Record<string, unknown>): Merge<SetEditorFeaturePropertiesUpdaterAction, {
1174
+ type: typeof ActionTypes.SET_EDITOR_FEATURE_PROPERTIES;
1175
+ }>;
861
1176
  /**
862
1177
  * Store features to state
863
1178
  * @memberof visStateActions
@@ -882,6 +1197,18 @@ export type SetPolygonFilterLayerUpdaterAction = {
882
1197
  export declare function setPolygonFilterLayer(layer: Layer, feature: Feature): Merge<SetPolygonFilterLayerUpdaterAction, {
883
1198
  type: typeof ActionTypes.SET_POLYGON_FILTER_LAYER;
884
1199
  }>;
1200
+ export type SetPolygonFilterAllLayersUpdaterAction = {
1201
+ feature: Feature;
1202
+ };
1203
+ /**
1204
+ * Apply the provided feature as a polygon filter to all layers.
1205
+ * @memberof visStateActions
1206
+ * @param feature
1207
+ * @returns action
1208
+ */
1209
+ export declare function setPolygonFilterAllLayers(feature: Feature): Merge<SetPolygonFilterAllLayersUpdaterAction, {
1210
+ type: typeof ActionTypes.SET_POLYGON_FILTER_ALL_LAYERS;
1211
+ }>;
885
1212
  export type SetSelectedFeatureUpdaterAction = {
886
1213
  feature: Feature | null;
887
1214
  selectionContext?: FeatureSelectionContext;
@@ -912,16 +1239,16 @@ export declare function deleteFeature(feature: Feature): Merge<DeleteFeatureUpda
912
1239
  export type SetEditorModeUpdaterAction = {
913
1240
  mode: string;
914
1241
  };
915
- /** Set the map mode
1242
+ /** Set the Draw on Map editor mode.
916
1243
  * @memberof visStateActions
917
- * @param mode one of EDITOR_MODES
1244
+ * @param mode one of `EDITOR_MODES`: `EDIT`, `DRAW_POINT`, `DRAW_LINESTRING`, `DRAW_POLYGON`, `DRAW_RECTANGLE`, `DRAW_CIRCLE`
918
1245
  * @returns action
919
1246
  * @public
920
1247
  * @example
921
- * import {setMapMode} from '@kepler.gl/actions';
1248
+ * import {setEditorMode} from '@kepler.gl/actions';
922
1249
  * import {EDITOR_MODES} from '@kepler.gl/constants';
923
1250
  *
924
- * this.props.dispatch(setMapMode(EDITOR_MODES.DRAW_POLYGON));
1251
+ * this.props.dispatch(setEditorMode(EDITOR_MODES.DRAW_LINESTRING));
925
1252
  */
926
1253
  export declare function setEditorMode(mode: string): Merge<SetEditorModeUpdaterAction, {
927
1254
  type: typeof ActionTypes.SET_EDITOR_MODE;
@@ -948,6 +1275,22 @@ export type ToggleEditorVisibilityUpdaterAction = void;
948
1275
  export declare function toggleEditorVisibility(): Merge<ToggleEditorVisibilityUpdaterAction, {
949
1276
  type: typeof ActionTypes.TOGGLE_EDITOR_VISIBILITY;
950
1277
  }>;
1278
+ export type ConvertEditorFeaturesToLayerUpdaterAction = void;
1279
+ /**
1280
+ * Convert editor sketch features into a GeoJSON dataset and layer, then clear the sketches.
1281
+ * The new dataset/layer is labeled `Drawn Geometry` plus a two-digit number.
1282
+ * No-ops when `enableDrawOnMapSketches` is false in application config.
1283
+ * @memberof visStateActions
1284
+ * @return action
1285
+ * @public
1286
+ * @example
1287
+ * import {convertEditorFeaturesToLayer} from '@kepler.gl/actions';
1288
+ *
1289
+ * this.props.dispatch(convertEditorFeaturesToLayer());
1290
+ */
1291
+ export declare function convertEditorFeaturesToLayer(): Merge<ConvertEditorFeaturesToLayerUpdaterAction, {
1292
+ type: typeof ActionTypes.CONVERT_EDITOR_FEATURES_TO_LAYER;
1293
+ }>;
951
1294
  type FileContent = {
952
1295
  fileName: string;
953
1296
  header: string[];
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@kepler.gl/actions",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.3.0-alpha.0",
4
+ "version": "3.3.0-alpha.10",
5
5
  "description": "kepler.gl constants used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
- "main": "dist/index.js",
7
+ "main": "dist/cjs/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "keywords": [
10
10
  "babel",
@@ -19,33 +19,30 @@
19
19
  "url": "https://github.com/keplergl/kepler.gl.git"
20
20
  },
21
21
  "scripts": {
22
- "build": "rm -fr dist && babel src --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
23
- "build:umd": "NODE_OPTIONS=--openssl-legacy-provider webpack --config ./webpack/umd.js --progress --env.prod",
22
+ "build": "rm -fr dist && babel src --out-dir dist/cjs --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts' && BABEL_ENV=esm babel src --out-dir dist/esm --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'",
24
23
  "build:types": "tsc --project ./tsconfig.production.json",
25
24
  "prepublishOnly": "babel-node ../../scripts/license-header/bin --license ../../FILE-HEADER && yarn build && yarn build:types",
26
- "stab": "mkdir -p dist && touch dist/index.js"
25
+ "stab": "mkdir -p dist/cjs dist/esm && touch dist/cjs/index.js dist/esm/index.js"
27
26
  },
28
27
  "files": [
29
- "dist",
30
- "umd"
28
+ "dist"
31
29
  ],
32
30
  "dependencies": {
33
- "@deck.gl/core": "^9.2.11",
34
- "@kepler.gl/cloud-providers": "3.3.0-alpha.0",
35
- "@kepler.gl/constants": "3.3.0-alpha.0",
36
- "@kepler.gl/layers": "3.3.0-alpha.0",
37
- "@kepler.gl/processors": "3.3.0-alpha.0",
38
- "@kepler.gl/table": "3.3.0-alpha.0",
39
- "@kepler.gl/types": "3.3.0-alpha.0",
40
- "@kepler.gl/utils": "3.3.0-alpha.0",
31
+ "@deck.gl/core": "^9.3.1",
32
+ "@kepler.gl/cloud-providers": "3.3.0-alpha.10",
33
+ "@kepler.gl/constants": "3.3.0-alpha.10",
34
+ "@kepler.gl/layers": "3.3.0-alpha.10",
35
+ "@kepler.gl/processors": "3.3.0-alpha.10",
36
+ "@kepler.gl/table": "3.3.0-alpha.10",
37
+ "@kepler.gl/types": "3.3.0-alpha.10",
38
+ "@kepler.gl/utils": "3.3.0-alpha.10",
41
39
  "@reduxjs/toolkit": "^1.7.2",
42
- "@types/lodash": "4.17.5",
43
40
  "@types/react-redux": "^7.1.23",
44
41
  "@types/redux-actions": "^2.6.2",
45
- "lodash": "4.17.21",
42
+ "es-toolkit": "^1.39.10",
46
43
  "react-palm": "^3.3.8",
47
44
  "react-redux": "^8.0.5",
48
- "redux": "^4.2.1",
45
+ "redux": "^5.0.0",
49
46
  "redux-actions": "^2.2.1"
50
47
  },
51
48
  "nyc": {
@@ -54,14 +51,25 @@
54
51
  },
55
52
  "maintainers": [
56
53
  "Shan He <heshan0131@gmail.com>",
57
- "Giuseppe Macri <gmacri@uber.com>"
54
+ "Giuseppe Macri <gmacri@uber.com>",
55
+ "Igor Dykhta <dikhta.igor@gmail.com>",
56
+ "Xun Li <lixun910@gmail.com>"
58
57
  ],
59
58
  "engines": {
60
- "node": ">=18"
59
+ "node": ">=20"
61
60
  },
62
61
  "volta": {
63
- "node": "18.18.2",
62
+ "node": "20.19.3",
64
63
  "yarn": "4.4.0"
65
64
  },
66
- "packageManager": "yarn@4.4.0"
65
+ "packageManager": "yarn@4.4.0",
66
+ "module": "dist/esm/index.js",
67
+ "exports": {
68
+ ".": {
69
+ "types": "./dist/index.d.ts",
70
+ "import": "./dist/esm/index.js",
71
+ "require": "./dist/cjs/index.js",
72
+ "default": "./dist/cjs/index.js"
73
+ }
74
+ }
67
75
  }