@kepler.gl/reducers 3.0.0-alpha.0 → 3.0.0-alpha.2

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 (42) hide show
  1. package/dist/combined-updaters.d.ts +30 -1
  2. package/dist/combined-updaters.js +235 -24
  3. package/dist/composer-helpers.d.ts +7 -4
  4. package/dist/composer-helpers.js +17 -28
  5. package/dist/composers.d.ts +6 -0
  6. package/dist/composers.js +2 -22
  7. package/dist/core.d.ts +1 -1
  8. package/dist/core.js +15 -25
  9. package/dist/data-utils.js +5 -23
  10. package/dist/export-utils.js +1 -21
  11. package/dist/index.d.ts +2 -3
  12. package/dist/index.js +36 -35
  13. package/dist/interaction-utils.d.ts +1 -5
  14. package/dist/interaction-utils.js +11 -31
  15. package/dist/layer-utils.d.ts +39 -10
  16. package/dist/layer-utils.js +112 -57
  17. package/dist/map-state-updaters.d.ts +33 -2
  18. package/dist/map-state-updaters.js +277 -38
  19. package/dist/map-state.d.ts +74 -2
  20. package/dist/map-state.js +2 -22
  21. package/dist/map-style-updaters.d.ts +30 -17
  22. package/dist/map-style-updaters.js +303 -104
  23. package/dist/map-style.js +2 -22
  24. package/dist/merger-handler.d.ts +10 -0
  25. package/dist/merger-handler.js +123 -0
  26. package/dist/middleware.js +6 -22
  27. package/dist/provider-state-updaters.d.ts +0 -7
  28. package/dist/provider-state-updaters.js +2 -92
  29. package/dist/provider-state.js +2 -22
  30. package/dist/root.d.ts +1 -8
  31. package/dist/root.js +24 -30
  32. package/dist/ui-state-updaters.d.ts +9 -2
  33. package/dist/ui-state-updaters.js +87 -82
  34. package/dist/ui-state.js +2 -22
  35. package/dist/vis-state-merger.d.ts +51 -13
  36. package/dist/vis-state-merger.js +411 -131
  37. package/dist/vis-state-selectors.js +8 -24
  38. package/dist/vis-state-updaters.d.ts +136 -10
  39. package/dist/vis-state-updaters.js +965 -283
  40. package/dist/vis-state.d.ts +210 -2
  41. package/dist/vis-state.js +2 -22
  42. package/package.json +23 -20
@@ -11,10 +11,14 @@ export declare type MapStyle = {
11
11
  mapStylesReplaceDefault: boolean;
12
12
  inputStyle: InputStyle;
13
13
  threeDBuildingColor: RGBColor;
14
+ backgroundColor: RGBColor;
14
15
  custom3DBuildingColor: boolean;
15
16
  bottomMapStyle: any;
16
17
  topMapStyle: any;
17
18
  initialState?: MapStyle;
19
+ isLoading: {
20
+ [key: string]: boolean;
21
+ };
18
22
  };
19
23
  /**
20
24
  * Default initial `mapStyle`
@@ -29,6 +33,7 @@ export declare type MapStyle = {
29
33
  * @Property mapStylesReplaceDefault - Default: `false`
30
34
  * @property inputStyle - Default: `{}`
31
35
  * @property threeDBuildingColor - Default: `[r, g, b]`
36
+ * @property backgroundColor - Default: `[r, g, b]`
32
37
  * @public
33
38
  */
34
39
  export declare const INITIAL_MAP_STYLE: MapStyle;
@@ -71,6 +76,11 @@ export declare function getMapStyles({ styleType, visibleLayerGroups, topLayerGr
71
76
  } | null;
72
77
  editable: number;
73
78
  };
79
+ /**
80
+ * @memberof mapStyleUpdaters
81
+ * @public
82
+ */
83
+ export declare const requestMapStylesUpdater: (state: MapStyle, { payload: { mapStyles, onSuccess } }: MapStyleActions.RequestMapStylesUpdaterAction) => MapStyle;
74
84
  /**
75
85
  * Propagate `mapStyle` reducer with `mapboxApiAccessToken` and `mapStylesReplaceDefault`.
76
86
  * if mapStylesReplaceDefault is true mapStyles is emptied; loadMapStylesUpdater() will
@@ -94,7 +104,7 @@ export declare const mapConfigChangeUpdater: (state: MapStyle, action: MapStyleA
94
104
  * @memberof mapStyleUpdaters
95
105
  * @public
96
106
  */
97
- export declare const mapStyleChangeUpdater: (state: MapStyle, { payload: styleType }: MapStyleActions.MapStyleChangeUpdaterAction) => MapStyle;
107
+ export declare const mapStyleChangeUpdater: (state: MapStyle, { payload: { styleType, onSuccess } }: MapStyleActions.MapStyleChangeUpdaterAction) => MapStyle;
98
108
  /**
99
109
  * Callback when load map style success
100
110
  * @memberof mapStyleUpdaters
@@ -106,12 +116,7 @@ export declare const loadMapStylesUpdater: (state: MapStyle, action: MapStyleAct
106
116
  * @memberof mapStyleUpdaters
107
117
  * @public
108
118
  */
109
- export declare const loadMapStyleErrUpdater: (state: MapStyle, action: MapStyleActions.LoadMapStyleErrUpdaterAction) => MapStyle;
110
- /**
111
- * @memberof mapStyleUpdaters
112
- * @public
113
- */
114
- export declare const requestMapStylesUpdater: (state: MapStyle, { payload: mapStyles }: MapStyleActions.RequestMapStylesUpdaterAction) => MapStyle;
119
+ export declare const loadMapStyleErrUpdater: (state: MapStyle, { payload: { ids, error } }: MapStyleActions.LoadMapStyleErrUpdaterAction) => MapStyle;
115
120
  /**
116
121
  * Load map style object when pass in saved map config
117
122
  * @memberof mapStyleUpdaters
@@ -151,23 +156,31 @@ export declare const inputMapStyleUpdater: (state: MapStyle, { payload: { inputS
151
156
  * @memberof mapStyleUpdaters
152
157
  */
153
158
  export declare const addCustomMapStyleUpdater: (state: MapStyle) => MapStyle;
159
+ /**
160
+ * Edit map style from user input to reducer.
161
+ * This action is called when user clicks confirm after editing an existing custom style in the custom map style dialog.
162
+ * It should not be called from outside kepler.gl without a valid `inputStyle` in the `mapStyle` reducer.
163
+ * @memberof mapStyleUpdaters
164
+ */
165
+ export declare const editCustomMapStyleUpdater: (state: MapStyle) => MapStyle;
166
+ /**
167
+ * Remove a custom map style from `state.mapStyle.mapStyles`.
168
+ * @memberof mapStyleUpdaters
169
+ */
170
+ export declare const removeCustomMapStyleUpdater: (state: MapStyle, action: MapStyleActions.RemoveCustomMapStyleUpdaterAction) => MapStyle;
154
171
  /**
155
172
  * Updates 3d building color
156
173
  * @memberof mapStyleUpdaters
157
174
  */
158
175
  export declare const set3dBuildingColorUpdater: (state: MapStyle, { payload: color }: MapStyleActions.Set3dBuildingColorUpdaterAction) => MapStyle;
176
+ /**
177
+ * Updates background color
178
+ * @memberof mapStyleUpdaters
179
+ */
180
+ export declare const setBackgroundColorUpdater: (state: MapStyle, { payload: color }: MapStyleActions.SetBackgroundColorUpdaterAction) => MapStyle;
159
181
  /**
160
182
  * Return the initial input style
161
183
  * @return Object
162
184
  */
163
- export declare function getInitialInputStyle(): {
164
- accessToken: null;
165
- error: boolean;
166
- isValid: boolean;
167
- label: null;
168
- style: null;
169
- url: null;
170
- icon: null;
171
- custom: boolean;
172
- };
185
+ export declare function getInitialInputStyle(): InputStyle;
173
186
  export {};