@kepler.gl/actions 3.3.0-alpha.1 → 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 +46 -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 +15 -0
  26. package/dist/vis-state-actions.d.ts +269 -7
  27. package/package.json +24 -18
  28. package/dist/action-types.js +0 -205
  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 -388
  37. package/dist/vis-state-actions.js +0 -1263
@@ -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
+ }>;
@@ -328,6 +328,21 @@ export type SetLocaleUpdaterAction = {
328
328
  export declare const setLocale: (locale: SetLocaleUpdaterAction['payload']['locale']) => Merge<SetLocaleUpdaterAction, {
329
329
  type: typeof ActionTypes.SET_LOCALE;
330
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
+ }>;
331
346
  /** TOGGLE_PANEL_LIST_VIEW */
332
347
  export type TogglePanelListViewAction = {
333
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, AnnotationPropsPartial, 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
  };
@@ -518,6 +564,123 @@ export type UpdateDatasetColorUpdater = {
518
564
  export declare function updateTableColor(dataId: string, newColor: RGBColor): Merge<UpdateDatasetColorUpdater, {
519
565
  type: typeof ActionTypes.UPDATE_TABLE_COLOR;
520
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
+ }>;
521
684
  export type SortTableColumnUpdaterAction = {
522
685
  dataId: string;
523
686
  column: string;
@@ -579,8 +742,50 @@ export type SetColumnDisplayFormatUpdaterAction = {
579
742
  export declare function setColumnDisplayFormat(dataId: SetColumnDisplayFormatUpdaterAction['dataId'], formats: SetColumnDisplayFormatUpdaterAction['formats']): Merge<SetColumnDisplayFormatUpdaterAction, {
580
743
  type: typeof ActionTypes.SET_COLUMN_DISPLAY_FORMAT;
581
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
+ }>;
582
786
  export type AddDataToMapUpdaterOptions = {
583
787
  centerMap?: boolean;
788
+ padding?: ViewportPadding;
584
789
  readOnly?: boolean;
585
790
  keepExistingConfig?: boolean;
586
791
  };
@@ -597,6 +802,8 @@ export type UpdateVisDataUpdaterAction = {
597
802
  * @param {object} options
598
803
  * @param options.centerMap `default: true` if `centerMap` is set to `true` kepler.gl will
599
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}`.
600
807
  * @param options.readOnly `default: false` if `readOnly` is set to `true`
601
808
  * the left setting panel will be hidden
602
809
  * @param config this object will contain the full kepler.gl instance configuration {mapState, mapStyle, visState}
@@ -642,6 +849,30 @@ export declare function updateDatasetProps(dataId: string, props: {
642
849
  }): Merge<UpdateDatasetPropsUpdaterAction, {
643
850
  type: typeof ActionTypes.UPDATE_DATASET_PROPS;
644
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
+ }>;
645
876
  export type ToggleFilterAnimationUpdaterAction = {
646
877
  idx: number;
647
878
  };
@@ -927,6 +1158,21 @@ export declare function loadFilesErr(fileName: string, error: any): Merge<LoadFi
927
1158
  export type SetFeaturesUpdaterAction = {
928
1159
  features: Feature[];
929
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
+ }>;
930
1176
  /**
931
1177
  * Store features to state
932
1178
  * @memberof visStateActions
@@ -993,16 +1239,16 @@ export declare function deleteFeature(feature: Feature): Merge<DeleteFeatureUpda
993
1239
  export type SetEditorModeUpdaterAction = {
994
1240
  mode: string;
995
1241
  };
996
- /** Set the map mode
1242
+ /** Set the Draw on Map editor mode.
997
1243
  * @memberof visStateActions
998
- * @param mode one of EDITOR_MODES
1244
+ * @param mode one of `EDITOR_MODES`: `EDIT`, `DRAW_POINT`, `DRAW_LINESTRING`, `DRAW_POLYGON`, `DRAW_RECTANGLE`, `DRAW_CIRCLE`
999
1245
  * @returns action
1000
1246
  * @public
1001
1247
  * @example
1002
- * import {setMapMode} from '@kepler.gl/actions';
1248
+ * import {setEditorMode} from '@kepler.gl/actions';
1003
1249
  * import {EDITOR_MODES} from '@kepler.gl/constants';
1004
1250
  *
1005
- * this.props.dispatch(setMapMode(EDITOR_MODES.DRAW_POLYGON));
1251
+ * this.props.dispatch(setEditorMode(EDITOR_MODES.DRAW_LINESTRING));
1006
1252
  */
1007
1253
  export declare function setEditorMode(mode: string): Merge<SetEditorModeUpdaterAction, {
1008
1254
  type: typeof ActionTypes.SET_EDITOR_MODE;
@@ -1029,6 +1275,22 @@ export type ToggleEditorVisibilityUpdaterAction = void;
1029
1275
  export declare function toggleEditorVisibility(): Merge<ToggleEditorVisibilityUpdaterAction, {
1030
1276
  type: typeof ActionTypes.TOGGLE_EDITOR_VISIBILITY;
1031
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
+ }>;
1032
1294
  type FileContent = {
1033
1295
  fileName: string;
1034
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.1",
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
31
  "@deck.gl/core": "^9.3.1",
34
- "@kepler.gl/cloud-providers": "3.3.0-alpha.1",
35
- "@kepler.gl/constants": "3.3.0-alpha.1",
36
- "@kepler.gl/layers": "3.3.0-alpha.1",
37
- "@kepler.gl/processors": "3.3.0-alpha.1",
38
- "@kepler.gl/table": "3.3.0-alpha.1",
39
- "@kepler.gl/types": "3.3.0-alpha.1",
40
- "@kepler.gl/utils": "3.3.0-alpha.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.23",
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": {
@@ -65,5 +62,14 @@
65
62
  "node": "20.19.3",
66
63
  "yarn": "4.4.0"
67
64
  },
68
- "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
+ }
69
75
  }