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

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 (49) hide show
  1. package/package.json +26 -20
  2. package/dist/combined-updaters.d.ts +0 -79
  3. package/dist/combined-updaters.js +0 -423
  4. package/dist/composer-helpers.d.ts +0 -24
  5. package/dist/composer-helpers.js +0 -122
  6. package/dist/composers.d.ts +0 -18
  7. package/dist/composers.js +0 -27
  8. package/dist/core.d.ts +0 -64
  9. package/dist/core.js +0 -139
  10. package/dist/data-utils.d.ts +0 -8
  11. package/dist/data-utils.js +0 -42
  12. package/dist/export-utils.d.ts +0 -21
  13. package/dist/export-utils.js +0 -104
  14. package/dist/index.d.ts +0 -35
  15. package/dist/index.js +0 -373
  16. package/dist/interaction-utils.d.ts +0 -31
  17. package/dist/interaction-utils.js +0 -129
  18. package/dist/layer-utils.d.ts +0 -95
  19. package/dist/layer-utils.js +0 -344
  20. package/dist/map-state-updaters.d.ts +0 -93
  21. package/dist/map-state-updaters.js +0 -489
  22. package/dist/map-state.d.ts +0 -75
  23. package/dist/map-state.js +0 -47
  24. package/dist/map-style-updaters.d.ts +0 -186
  25. package/dist/map-style-updaters.js +0 -737
  26. package/dist/map-style.d.ts +0 -4
  27. package/dist/map-style.js +0 -46
  28. package/dist/merger-handler.d.ts +0 -10
  29. package/dist/merger-handler.js +0 -123
  30. package/dist/middleware.d.ts +0 -8
  31. package/dist/middleware.js +0 -30
  32. package/dist/provider-state-updaters.d.ts +0 -35
  33. package/dist/provider-state-updaters.js +0 -422
  34. package/dist/provider-state.d.ts +0 -4
  35. package/dist/provider-state.js +0 -46
  36. package/dist/root.d.ts +0 -24
  37. package/dist/root.js +0 -229
  38. package/dist/ui-state-updaters.d.ts +0 -362
  39. package/dist/ui-state-updaters.js +0 -871
  40. package/dist/ui-state.d.ts +0 -3
  41. package/dist/ui-state.js +0 -48
  42. package/dist/vis-state-merger.d.ts +0 -140
  43. package/dist/vis-state-merger.js +0 -915
  44. package/dist/vis-state-selectors.d.ts +0 -2
  45. package/dist/vis-state-selectors.js +0 -37
  46. package/dist/vis-state-updaters.d.ts +0 -545
  47. package/dist/vis-state-updaters.js +0 -3154
  48. package/dist/vis-state.d.ts +0 -211
  49. package/dist/vis-state.js +0 -46
package/dist/map-state.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = exports.mapStateReducerFactory = void 0;
11
-
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
-
14
- var _reduxActions = require("redux-actions");
15
-
16
- var _actions = require("@kepler.gl/actions");
17
-
18
- var mapStateUpdaters = _interopRequireWildcard(require("./map-state-updaters"));
19
-
20
- var _actionHandler;
21
-
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
23
-
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25
-
26
- /**
27
- * Important: Do not rename `actionHandler` or the assignment pattern of property value.
28
- * It is used to generate documentation
29
- */
30
- var actionHandler = (_actionHandler = {}, (0, _defineProperty2["default"])(_actionHandler, _actions.ActionTypes.UPDATE_MAP, mapStateUpdaters.updateMapUpdater), (0, _defineProperty2["default"])(_actionHandler, _actions.ActionTypes.FIT_BOUNDS, mapStateUpdaters.fitBoundsUpdater), (0, _defineProperty2["default"])(_actionHandler, _actions.ActionTypes.TOGGLE_PERSPECTIVE, mapStateUpdaters.togglePerspectiveUpdater), (0, _defineProperty2["default"])(_actionHandler, _actions.ActionTypes.RECEIVE_MAP_CONFIG, mapStateUpdaters.receiveMapConfigUpdater), (0, _defineProperty2["default"])(_actionHandler, _actions.ActionTypes.RESET_MAP_CONFIG, mapStateUpdaters.resetMapConfigUpdater), (0, _defineProperty2["default"])(_actionHandler, _actions.ActionTypes.TOGGLE_SPLIT_MAP, mapStateUpdaters.toggleSplitMapUpdater), (0, _defineProperty2["default"])(_actionHandler, _actions.ActionTypes.TOGGLE_SPLIT_MAP_VIEWPORT, mapStateUpdaters.toggleSplitMapViewportUpdater), _actionHandler);
31
- /* Reducer */
32
-
33
- var mapStateReducerFactory = function mapStateReducerFactory() {
34
- var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35
- return (// @ts-expect-error
36
- (0, _reduxActions.handleActions)(actionHandler, _objectSpread(_objectSpread(_objectSpread({}, mapStateUpdaters.INITIAL_MAP_STATE), initialState), {}, {
37
- initialState: initialState
38
- }))
39
- );
40
- };
41
-
42
- exports.mapStateReducerFactory = mapStateReducerFactory;
43
-
44
- var _default = mapStateReducerFactory();
45
-
46
- exports["default"] = _default;
47
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tYXAtc3RhdGUudHMiXSwibmFtZXMiOlsiYWN0aW9uSGFuZGxlciIsIkFjdGlvblR5cGVzIiwiVVBEQVRFX01BUCIsIm1hcFN0YXRlVXBkYXRlcnMiLCJ1cGRhdGVNYXBVcGRhdGVyIiwiRklUX0JPVU5EUyIsImZpdEJvdW5kc1VwZGF0ZXIiLCJUT0dH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b25UeXBlcy5SRUNFSVZFX01BUF9DT05GSUddOiBtYXBTdGF0ZVVwZGF0ZXJzLnJlY2VpdmVNYXBDb25maWdVcGRhdGVyLFxuICBbQWN0aW9uVHlwZXMuUkVTRVRfTUFQX0NPTkZJR106IG1hcFN0YXRlVXBkYXRlcnMucmVzZXRNYXBDb25maWdVcGRhdGVyLFxuICBbQWN0aW9uVHlwZXMuVE9HR0xFX1NQTElUX01BUF06IG1hcFN0YXRlVXBkYXRlcnMudG9nZ2xlU3BsaXRNYXBVcGRhdGVyLFxuICBbQWN0aW9uVHlwZXMuVE9HR0xFX1NQTElUX01BUF9WSUVXUE9SVF06IG1hcFN0YXRlVXBkYXRlcnMudG9nZ2xlU3BsaXRNYXBWaWV3cG9ydFVwZGF0ZXJcbn07XG5cbi8qIFJlZHVjZXIgKi9cbmV4cG9ydCBjb25zdCBtYXBTdGF0ZVJlZHVjZXJGYWN0b3J5ID0gKGluaXRpYWxTdGF0ZSA9IHt9KSA9PlxuICAvLyBAdHMtZXhwZWN0LWVycm9yXG4gIGhhbmRsZUFjdGlvbnMoYWN0aW9uSGFuZGxlciwge1xuICAgIC4uLm1hcFN0YXRlVXBkYXRlcnMuSU5JVElBTF9NQVBfU1RBVEUsXG4gICAgLi4uaW5pdGlhbFN0YXRlLFxuICAgIGluaXRpYWxTdGF0ZVxuICB9KTtcblxuZXhwb3J0IGRlZmF1bHQgbWFwU3RhdGVSZWR1Y2VyRmFjdG9yeSgpO1xuIl19
@@ -1,186 +0,0 @@
1
- import { RGBColor, LayerGroup, MapStyles, InputStyle, VisibleLayerGroups } from '@kepler.gl/types';
2
- import { ActionTypes, ReceiveMapConfigPayload, KeplerGlInitPayload, MapStyleActions } from '@kepler.gl/actions';
3
- export declare type MapboxStyleUrl = string;
4
- export declare type MapStyle = {
5
- styleType: string;
6
- visibleLayerGroups: VisibleLayerGroups;
7
- topLayerGroups: VisibleLayerGroups;
8
- mapStyles: MapStyles;
9
- mapboxApiAccessToken: string | null;
10
- mapboxApiUrl: string;
11
- mapStylesReplaceDefault: boolean;
12
- inputStyle: InputStyle;
13
- threeDBuildingColor: RGBColor;
14
- backgroundColor: RGBColor;
15
- custom3DBuildingColor: boolean;
16
- bottomMapStyle: any;
17
- topMapStyle: any;
18
- initialState?: MapStyle;
19
- isLoading: {
20
- [key: string]: boolean;
21
- };
22
- };
23
- /**
24
- * Default initial `mapStyle`
25
- * @memberof mapStyleUpdaters
26
- * @constant
27
- * @property styleType - Default: `'dark'`
28
- * @property visibleLayerGroups - Default: `{}`
29
- * @property topLayerGroups - Default: `{}`
30
- * @property mapStyles - mapping from style key to style object
31
- * @property mapboxApiAccessToken - Default: `null`
32
- * @Property mapboxApiUrl - Default null
33
- * @Property mapStylesReplaceDefault - Default: `false`
34
- * @property inputStyle - Default: `{}`
35
- * @property threeDBuildingColor - Default: `[r, g, b]`
36
- * @property backgroundColor - Default: `[r, g, b]`
37
- * @public
38
- */
39
- export declare const INITIAL_MAP_STYLE: MapStyle;
40
- interface GetMapStylesParam {
41
- styleType: string;
42
- visibleLayerGroups: {
43
- [id: string]: LayerGroup | boolean;
44
- };
45
- topLayerGroups: {
46
- [id: string]: LayerGroup | boolean;
47
- };
48
- mapStyles: {
49
- [id: string]: any;
50
- };
51
- }
52
- /**
53
- * Create two map styles from preset map style, one for top map one for bottom
54
- *
55
- * @param {string} styleType - current map style
56
- * @param {Object} visibleLayerGroups - visible layers of bottom map
57
- * @param {Object} topLayerGroups - visible layers of top map
58
- * @param {Object} mapStyles - a dictionary of all map styles
59
- * @returns {Object} bottomMapStyle | topMapStyle | isRaster
60
- */
61
- export declare function getMapStyles({ styleType, visibleLayerGroups, topLayerGroups, mapStyles }: GetMapStylesParam): {
62
- bottomMapStyle?: undefined;
63
- topMapStyle?: undefined;
64
- editable?: undefined;
65
- } | {
66
- bottomMapStyle: any;
67
- topMapStyle: {
68
- layers: any;
69
- constructor?: Function | undefined;
70
- toString?: (() => string) | undefined;
71
- toLocaleString?: (() => string) | undefined;
72
- valueOf?: (() => Object) | undefined;
73
- hasOwnProperty?: ((v: PropertyKey) => boolean) | undefined;
74
- isPrototypeOf?: ((v: Object) => boolean) | undefined;
75
- propertyIsEnumerable?: ((v: PropertyKey) => boolean) | undefined;
76
- } | null;
77
- editable: number;
78
- };
79
- /**
80
- * @memberof mapStyleUpdaters
81
- * @public
82
- */
83
- export declare const requestMapStylesUpdater: (state: MapStyle, { payload: { mapStyles, onSuccess } }: MapStyleActions.RequestMapStylesUpdaterAction) => MapStyle;
84
- /**
85
- * Propagate `mapStyle` reducer with `mapboxApiAccessToken` and `mapStylesReplaceDefault`.
86
- * if mapStylesReplaceDefault is true mapStyles is emptied; loadMapStylesUpdater() will
87
- * populate mapStyles.
88
- *
89
- * @memberof mapStyleUpdaters
90
- * @public
91
- */
92
- export declare const initMapStyleUpdater: (state: MapStyle, { payload }: {
93
- type?: "@@kepler.gl/INIT" | undefined;
94
- payload: KeplerGlInitPayload;
95
- }) => MapStyle;
96
- /**
97
- * Update `visibleLayerGroups`to change layer group visibility
98
- * @memberof mapStyleUpdaters
99
- * @public
100
- */
101
- export declare const mapConfigChangeUpdater: (state: MapStyle, action: MapStyleActions.MapConfigChangeUpdaterAction) => MapStyle;
102
- /**
103
- * Change to another map style. The selected style should already been loaded into `mapStyle.mapStyles`
104
- * @memberof mapStyleUpdaters
105
- * @public
106
- */
107
- export declare const mapStyleChangeUpdater: (state: MapStyle, { payload: { styleType, onSuccess } }: MapStyleActions.MapStyleChangeUpdaterAction) => MapStyle;
108
- /**
109
- * Callback when load map style success
110
- * @memberof mapStyleUpdaters
111
- * @public
112
- */
113
- export declare const loadMapStylesUpdater: (state: MapStyle, action: MapStyleActions.LoadMapStylesUpdaterAction) => MapStyle;
114
- /**
115
- * Callback when load map style error
116
- * @memberof mapStyleUpdaters
117
- * @public
118
- */
119
- export declare const loadMapStyleErrUpdater: (state: MapStyle, { payload: { ids, error } }: MapStyleActions.LoadMapStyleErrUpdaterAction) => MapStyle;
120
- /**
121
- * Load map style object when pass in saved map config
122
- * @memberof mapStyleUpdaters
123
- * @param state `mapStyle`
124
- * @param action
125
- * @param action.payload saved map config `{mapStyle, visState, mapState}`
126
- * @returns nextState or `react-pam` tasks to load map style object
127
- */
128
- export declare const receiveMapConfigUpdater: (state: MapStyle, { payload: { config } }: {
129
- type?: typeof ActionTypes.RECEIVE_MAP_CONFIG;
130
- payload: ReceiveMapConfigPayload;
131
- }) => MapStyle;
132
- /**
133
- * Reset map style config to initial state
134
- * @memberof mapStyleUpdaters
135
- * @param state `mapStyle`
136
- * @returns nextState
137
- * @public
138
- */
139
- export declare const resetMapConfigMapStyleUpdater: (state: MapStyle) => MapStyle;
140
- /**
141
- * Callback when a custom map style object is received
142
- * @memberof mapStyleUpdaters
143
- * @public
144
- */
145
- export declare const loadCustomMapStyleUpdater: (state: MapStyle, { payload: { icon, style, error } }: MapStyleActions.LoadCustomMapStyleUpdaterAction) => MapStyle;
146
- /**
147
- * Input a custom map style object
148
- * @memberof mapStyleUpdaters
149
- * @public
150
- */
151
- export declare const inputMapStyleUpdater: (state: MapStyle, { payload: { inputStyle, mapState } }: MapStyleActions.InputMapStyleUpdaterAction) => MapStyle;
152
- /**
153
- * Add map style from user input to reducer and set it to current style
154
- * This action is called when user click confirm after putting in a valid style url in the custom map style dialog.
155
- * It should not be called from outside kepler.gl without a valid `inputStyle` in the `mapStyle` reducer.
156
- * @memberof mapStyleUpdaters
157
- */
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;
171
- /**
172
- * Updates 3d building color
173
- * @memberof mapStyleUpdaters
174
- */
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;
181
- /**
182
- * Return the initial input style
183
- * @return Object
184
- */
185
- export declare function getInitialInputStyle(): InputStyle;
186
- export {};