UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

803 lines (759 loc) 89.5 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.toggleSplitMapUpdater = exports.toggleSidePanelUpdater = exports.toggleSidePanelCloseButtonUpdater = exports.togglePanelListViewUpdater = exports.toggleModalUpdater = exports.toggleMapControlUpdater = exports.startExportingImageUpdater = exports.showExportDropdownUpdater = exports.showDatasetTableUpdater = exports.setUserMapboxAccessTokenUpdater = exports.setMapControlVisibilityUpdater = exports.setMapControlSettingsUpdater = exports.setLocaleUpdater = exports.setExportSelectedDatasetUpdater = exports.setExportMapHTMLModeUpdater = exports.setExportMapFormatUpdater = exports.setExportImageSettingUpdater = exports.setExportImageErrorUpdater = exports.setExportImageDataUriUpdater = exports.setExportFilteredUpdater = exports.setExportDataUpdater = exports.setExportDataTypeUpdater = exports.removeNotificationUpdater = exports.openDeleteModalUpdater = exports.loadFilesUpdater = exports.loadFilesSuccessUpdater = exports.loadFilesErrUpdater = exports.initUiStateUpdater = exports.hideExportDropdownUpdater = exports.cleanupExportImageUpdater = exports.addNotificationUpdater = exports.INITIAL_UI_STATE = exports.DEFAULT_NOTIFICATIONS = exports.DEFAULT_MODAL = exports.DEFAULT_MAP_CONTROLS = exports.DEFAULT_LOAD_FILES = exports.DEFAULT_EXPORT_MAP = exports.DEFAULT_EXPORT_JSON = exports.DEFAULT_EXPORT_IMAGE = exports.DEFAULT_EXPORT_HTML = exports.DEFAULT_EXPORT_DATA = exports.DEFAULT_ACTIVE_SIDE_PANEL = void 0; var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _constants = require("@kepler.gl/constants"); var _localization = require("@kepler.gl/localization"); var _utils = require("@kepler.gl/utils"); var _composerHelpers = require("./composer-helpers"); function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var DEFAULT_ACTIVE_SIDE_PANEL = exports.DEFAULT_ACTIVE_SIDE_PANEL = 'layer'; var DEFAULT_MODAL = exports.DEFAULT_MODAL = _constants.ADD_DATA_ID; /** * Updaters for `uiState` reducer. Can be used in your root reducer to directly modify kepler.gl's state. * Read more about [Using updaters](../advanced-usage/using-updaters.md) * * @public * @example * * import keplerGlReducer, {uiStateUpdaters} from '@kepler.gl/reducers'; * // Root Reducer * const reducers = combineReducers({ * keplerGl: keplerGlReducer, * app: appReducer * }); * * const composedReducer = (state, action) => { * switch (action.type) { * // click button to close side panel * case 'CLICK_BUTTON': * return { * ...state, * keplerGl: { * ...state.keplerGl, * foo: { * ...state.keplerGl.foo, * uiState: uiStateUpdaters.toggleSidePanelUpdater( * uiState, {payload: null} * ) * } * } * }; * } * return reducers(state, action); * }; * * export default composedReducer; */ /* eslint-disable @typescript-eslint/no-unused-vars */ // @ts-ignore var uiStateUpdaters = null; /* eslint-enable @typescript-eslint/no-unused-vars */ var DEFAULT_MAP_CONTROLS_FEATURES = { show: true, active: false, disableClose: false, // defines which map index users are interacting with (through map controls) activeMapIndex: 0 }; var DEFAULT_MAP_LEGEND_CONTROL = _objectSpread(_objectSpread({}, DEFAULT_MAP_CONTROLS_FEATURES), {}, { disableEdit: false }); /** * A list of map control visibility and whether is it active. * @memberof uiStateUpdaters * @constant * @property visibleLayers Default: `{show: true, active: false}` * @property mapLegend Default: `{show: true, active: false}` * @property toggle3d Default: `{show: true}` * @property splitMap Default: `{show: true}` * @property mapDraw Default: `{show: true, active: false}` * @property mapLocale Default: `{show: false, active: false}` * @public */ var DEFAULT_MAP_CONTROLS = exports.DEFAULT_MAP_CONTROLS = Object.keys(_constants.MAP_CONTROLS).reduce(function (_final, current) { return _objectSpread(_objectSpread({}, _final), {}, (0, _defineProperty2["default"])({}, current, current === _constants.MAP_CONTROLS.mapLegend ? DEFAULT_MAP_LEGEND_CONTROL : DEFAULT_MAP_CONTROLS_FEATURES)); }, {}); /** * Default image export config * @memberof uiStateUpdaters * @constant * @property ratio Default: `'SCREEN'`, * @property resolution Default: `'ONE_X'`, * @property legend Default: `false`, * @property mapH Default: 0, * @property mapW Default: 0, * @property imageSize Default: {zoomOffset: 0, scale: 1, imageW: 0, imageH: 0}, * @property imageDataUri Default: `''`, * @property exporting Default: `false` * @property error Default: `false` * @property escapeXhtmlForWebpack Default: `true` * @public */ var DEFAULT_EXPORT_IMAGE = exports.DEFAULT_EXPORT_IMAGE = { // user options ratio: _constants.EXPORT_IMG_RATIOS.SCREEN, resolution: _constants.RESOLUTIONS.ONE_X, legend: false, mapH: 0, mapW: 0, imageSize: { zoomOffset: 0, scale: 1, imageW: 0, imageH: 0 }, // when this is set to true, the mock map viewport will move to the center of data center: false, // exporting state imageDataUri: '', // exporting: used to attach plot-container to dom exporting: false, // processing: used as loading indicator when export image is being produced processing: false, error: false, // whether to apply fix for uglify error in dom-to-image (should be true for webpack builds) escapeXhtmlForWebpack: true }; var DEFAULT_LOAD_FILES = exports.DEFAULT_LOAD_FILES = { fileLoading: false }; /** * Default initial `exportData` settings * @memberof uiStateUpdaters * @constant * @property selectedDataset Default: `''`, * @property dataType Default: `'csv'`, * @property filtered Default: `true`, * @public */ var DEFAULT_EXPORT_DATA = exports.DEFAULT_EXPORT_DATA = { selectedDataset: '', dataType: _constants.EXPORT_DATA_TYPE.CSV, filtered: true }; /** * @constant */ var DEFAULT_NOTIFICATIONS = exports.DEFAULT_NOTIFICATIONS = []; /** * @constant * @property exportMapboxAccessToken - Default: null, this is used when we provide a default mapbox token for users to take advantage of * @property userMapboxToken - Default: '', mapbox token provided by user through input field * @property mode - Default: 'READ', read only or editable * @public */ var DEFAULT_EXPORT_HTML = exports.DEFAULT_EXPORT_HTML = { exportMapboxAccessToken: null, userMapboxToken: '', mode: _constants.EXPORT_HTML_MAP_MODES.READ }; /** * @constant * @property hasData - Default: 'true', * @public */ var DEFAULT_EXPORT_JSON = exports.DEFAULT_EXPORT_JSON = { hasData: true }; /** * Export Map Config * @constant * @property HTML - Default: 'DEFAULT_EXPORT_HTML', * @property JSON - Default: 'DEFAULT_EXPORT_JSON', * @property format - Default: 'HTML', * @public */ var DEFAULT_EXPORT_MAP = exports.DEFAULT_EXPORT_MAP = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _constants.EXPORT_MAP_FORMATS.HTML, DEFAULT_EXPORT_HTML), _constants.EXPORT_MAP_FORMATS.JSON, DEFAULT_EXPORT_JSON), "format", _constants.EXPORT_MAP_FORMATS.HTML); /** * Default initial `uiState` * @memberof uiStateUpdaters * @constant * @property readOnly Default: `false` * @property activeSidePanel Default: `'layer'` * @property currentModal Default: `'addData'` * @property datasetKeyToRemove Default: `null` * @property visibleDropdown Default: `null` * @property exportImage Default: [`DEFAULT_EXPORT_IMAGE`](#default_export_image) * @property exportData Default: [`DEFAULT_EXPORT_DATA`](#default_export_data) * @property exportMap Default: [`DEFAULT_EXPORT_MAP`](#default_export_map) * @property mapControls Default: [`DEFAULT_MAP_CONTROLS`](#default_map_controls) * @property notifications Default: `[]` * @property notifications Default: `[]` * @property loadFiles * @property isSidePanelCloseButtonVisible Default: `true` * @public */ var INITIAL_UI_STATE = exports.INITIAL_UI_STATE = { readOnly: false, activeSidePanel: DEFAULT_ACTIVE_SIDE_PANEL, currentModal: DEFAULT_MODAL, datasetKeyToRemove: null, visibleDropdown: null, // export image modal ui exportImage: DEFAULT_EXPORT_IMAGE, // export data modal ui exportData: DEFAULT_EXPORT_DATA, // html export exportMap: DEFAULT_EXPORT_MAP, // map control panels mapControls: DEFAULT_MAP_CONTROLS, // ui notifications notifications: DEFAULT_NOTIFICATIONS, // load files loadFiles: DEFAULT_LOAD_FILES, // Locale of the UI locale: _localization.LOCALE_CODES.en, layerPanelListView: 'list', filterPanelListView: 'list', isSidePanelCloseButtonVisible: true }; /* Updaters */ /** * @memberof uiStateUpdaters */ var initUiStateUpdater = exports.initUiStateUpdater = function initUiStateUpdater(state, action) { return _objectSpread(_objectSpread({}, state), (action.payload || {}).initialUiState); }; /** * Toggle active side panel * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload id of side panel to be shown, one of `layer`, `filter`, `interaction`, `map`. close side panel if `null` * @returns nextState * @public */ var toggleSidePanelUpdater = exports.toggleSidePanelUpdater = function toggleSidePanelUpdater(state, _ref) { var id = _ref.payload; return id === state.activeSidePanel ? state : _objectSpread(_objectSpread({}, state), {}, { activeSidePanel: id }); }; /** * Show and hide modal dialog * @memberof uiStateUpdaters * @param state `uiState` * @param action * @paramaction.payload id of modal to be shown, null to hide modals. One of: * - [`DATA_TABLE_ID`](../constants/default-settings.md#data_table_id) * - [`DELETE_DATA_ID`](../constants/default-settings.md#delete_data_id) * - [`ADD_DATA_ID`](../constants/default-settings.md#add_data_id) * - [`EXPORT_IMAGE_ID`](../constants/default-settings.md#export_image_id) * - [`EXPORT_DATA_ID`](../constants/default-settings.md#export_data_id) * - [`ADD_MAP_STYLE_ID`](../constants/default-settings.md#add_map_style_id) * @returns nextState * @public */ var toggleModalUpdater = exports.toggleModalUpdater = function toggleModalUpdater(state, _ref2) { var id = _ref2.payload; return _objectSpread(_objectSpread({}, state), {}, { currentModal: id }); }; /** * Hide and show side panel header dropdown, activated by clicking the share link on top of the side panel * @memberof uiStateUpdaters * @public */ var showExportDropdownUpdater = exports.showExportDropdownUpdater = function showExportDropdownUpdater(state, _ref3) { var id = _ref3.payload; return _objectSpread(_objectSpread({}, state), {}, { visibleDropdown: id }); }; /** * Hide side panel header dropdown, activated by clicking the share link on top of the side panel * @memberof uiStateUpdaters * @public */ var hideExportDropdownUpdater = exports.hideExportDropdownUpdater = function hideExportDropdownUpdater(state) { return _objectSpread(_objectSpread({}, state), {}, { visibleDropdown: null }); }; /** * Toggle side panel close button on top left of the side panel * @memberof uiStateUpdaters * @public */ var toggleSidePanelCloseButtonUpdater = exports.toggleSidePanelCloseButtonUpdater = function toggleSidePanelCloseButtonUpdater(state, _ref4) { var show = _ref4.payload.show; return _objectSpread(_objectSpread({}, state), {}, { isSidePanelCloseButtonVisible: show }); }; /** * Toggle active map control panel * @memberof uiStateUpdaters * @param state `uiState` * @param action action * @param action.payload map control panel id, one of the keys of: [`DEFAULT_MAP_CONTROLS`](#default_map_controls) * @returns nextState * @public */ var toggleMapControlUpdater = exports.toggleMapControlUpdater = function toggleMapControlUpdater(state, _ref5) { var _state$mapControls$pa, _state$mapControls$dr; var _ref5$payload = _ref5.payload, panelId = _ref5$payload.panelId, _ref5$payload$index = _ref5$payload.index, index = _ref5$payload$index === void 0 ? 0 : _ref5$payload$index; var updatedState = state; // The effect panel and ai assistant panel can not be active at the same time // so we need to deactivate the other panel when one is activated var panelToDeactivate = panelId === _constants.MAP_CONTROLS.effect ? _constants.MAP_CONTROLS.aiAssistant : panelId === _constants.MAP_CONTROLS.aiAssistant ? _constants.MAP_CONTROLS.effect : null; // To to toggle the mapDraw and mapLocal dropdowns // We have to deactivate the other active dropdown var dropdownToDeactivate = panelId === _constants.MAP_CONTROLS.mapDraw ? _constants.MAP_CONTROLS.mapLocale : panelId === _constants.MAP_CONTROLS.mapLocale ? _constants.MAP_CONTROLS.mapDraw : null; // If we need to deactivate a competing panel and it's currently active if (panelToDeactivate && (_state$mapControls$pa = state.mapControls[panelToDeactivate]) !== null && _state$mapControls$pa !== void 0 && _state$mapControls$pa.active) { updatedState = _objectSpread(_objectSpread({}, state), {}, { mapControls: _objectSpread(_objectSpread({}, updatedState.mapControls), {}, (0, _defineProperty2["default"])({}, panelToDeactivate, _objectSpread(_objectSpread({}, updatedState.mapControls[panelToDeactivate]), {}, { active: false }))) }); } // If we need to deactivate a competing dropdown and it's currently active if (dropdownToDeactivate && (_state$mapControls$dr = state.mapControls[dropdownToDeactivate]) !== null && _state$mapControls$dr !== void 0 && _state$mapControls$dr.active) { updatedState = _objectSpread(_objectSpread({}, state), {}, { mapControls: _objectSpread(_objectSpread({}, updatedState.mapControls), {}, (0, _defineProperty2["default"])({}, dropdownToDeactivate, _objectSpread(_objectSpread({}, updatedState.mapControls[dropdownToDeactivate]), {}, { active: false }))) }); } return _objectSpread(_objectSpread({}, updatedState), {}, { mapControls: _objectSpread(_objectSpread({}, updatedState.mapControls), {}, (0, _defineProperty2["default"])({}, panelId, _objectSpread(_objectSpread({}, updatedState.mapControls[panelId]), {}, { active: !updatedState.mapControls[panelId].active, activeMapIndex: index }))) }); }; /** * Toggle map control visibility * @memberof uiStateUpdaters * @param state `uiState` * @param action action * @param action.payload map control panel id, one of the keys of: [`DEFAULT_MAP_CONTROLS`](#default_map_controls) * @returns nextState * @public */ var setMapControlVisibilityUpdater = exports.setMapControlVisibilityUpdater = function setMapControlVisibilityUpdater(state, _ref6) { var _state$mapControls; var _ref6$payload = _ref6.payload, panelId = _ref6$payload.panelId, show = _ref6$payload.show; if (!((_state$mapControls = state.mapControls) !== null && _state$mapControls !== void 0 && _state$mapControls[panelId])) { return state; } return _objectSpread(_objectSpread({}, state), {}, { mapControls: _objectSpread(_objectSpread({}, state.mapControls), {}, (0, _defineProperty2["default"])({}, panelId, _objectSpread(_objectSpread({}, state.mapControls[panelId]), {}, { show: Boolean(show) }))) }); }; /** * Toggle map control settings * @memberof uiStateUpdaters * @param state `uiState` * @param action action * @param action.payload map control panel id, one of the keys of: [`DEFAULT_MAP_CONTROLS`](#default_map_controls) * @returns nextState * @public */ var setMapControlSettingsUpdater = exports.setMapControlSettingsUpdater = function setMapControlSettingsUpdater(state, _ref7) { var _state$mapControls2; var _ref7$payload = _ref7.payload, panelId = _ref7$payload.panelId, settings = _ref7$payload.settings; var mapControl = (_state$mapControls2 = state.mapControls) === null || _state$mapControls2 === void 0 ? void 0 : _state$mapControls2[panelId]; if (!mapControl) { return state; } return _objectSpread(_objectSpread({}, state), {}, { mapControls: _objectSpread(_objectSpread({}, state.mapControls), {}, (0, _defineProperty2["default"])({}, panelId, _objectSpread(_objectSpread({}, mapControl), {}, { settings: _objectSpread(_objectSpread({}, mapControl.settings), settings) }))) }); }; /** * Toggle active map control panel * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload dataset id * @returns nextState * @public */ var openDeleteModalUpdater = exports.openDeleteModalUpdater = function openDeleteModalUpdater(state, _ref8) { var datasetKeyToRemove = _ref8.payload; return _objectSpread(_objectSpread({}, state), {}, { currentModal: _constants.DELETE_DATA_ID, datasetKeyToRemove: datasetKeyToRemove }); }; /** * Set `exportImage.legend` to `true` or `false` * @memberof uiStateUpdaters * @param state `uiState` * @returns nextState * @public */ var setExportImageSettingUpdater = exports.setExportImageSettingUpdater = function setExportImageSettingUpdater(state, _ref9) { var newSetting = _ref9.payload; var updated = _objectSpread(_objectSpread({}, state.exportImage), newSetting); var imageSize = (0, _utils.calculateExportImageSize)(updated) || state.exportImage.imageSize; return _objectSpread(_objectSpread({}, state), {}, { exportImage: _objectSpread(_objectSpread({}, updated), {}, { // @ts-expect-error // TODO: calculateExportImageSize does not return imageSize.zoomOffset, // do we need take this value from current state, or return defaul value = 0 imageSize: imageSize }) }); }; /** * Set `exportImage.setExportImageDataUri` to a image dataUri * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload export image data uri * @returns nextState * @public */ var setExportImageDataUriUpdater = exports.setExportImageDataUriUpdater = function setExportImageDataUriUpdater(state, _ref10) { var dataUri = _ref10.payload; if (dataUri === state.exportImage.imageDataUri) { return state; } return _objectSpread(_objectSpread({}, state), {}, { exportImage: _objectSpread(_objectSpread({}, state.exportImage), {}, { processing: false, imageDataUri: dataUri }) }); }; /** * @memberof uiStateUpdaters * @public */ var setExportImageErrorUpdater = exports.setExportImageErrorUpdater = function setExportImageErrorUpdater(state, _ref11) { var error = _ref11.payload; return _objectSpread(_objectSpread({}, state), {}, { exportImage: _objectSpread(_objectSpread({}, state.exportImage), {}, { processing: false, error: error }) }); }; /** * Delete cached export image * @memberof uiStateUpdaters * @public */ var cleanupExportImageUpdater = exports.cleanupExportImageUpdater = function cleanupExportImageUpdater(state) { return _objectSpread(_objectSpread({}, state), {}, { exportImage: _objectSpread(_objectSpread({}, state.exportImage), {}, { exporting: false, imageDataUri: '', error: false, processing: false, center: false }) }); }; /** * Start image exporting flow * @memberof uiStateUpdaters * @param state * @param options * @returns {UiState} * @public */ var startExportingImageUpdater = exports.startExportingImageUpdater = function startExportingImageUpdater(state, _ref12) { var _ref12$payload = _ref12.payload, options = _ref12$payload === void 0 ? {} : _ref12$payload; var imageSettings = _objectSpread(_objectSpread({}, options), {}, { exporting: true }); return (0, _composerHelpers.compose_)([cleanupExportImageUpdater, (0, _composerHelpers.apply_)(setExportImageSettingUpdater, (0, _composerHelpers.payload_)(imageSettings))])(state); }; /** * Set selected dataset for export * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload dataset id * @returns nextState * @public */ var setExportSelectedDatasetUpdater = exports.setExportSelectedDatasetUpdater = function setExportSelectedDatasetUpdater(state, _ref13) { var dataset = _ref13.payload; return _objectSpread(_objectSpread({}, state), {}, { exportData: _objectSpread(_objectSpread({}, state.exportData), {}, { selectedDataset: dataset }) }); }; /** * Set data format for exporting data * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload one of `'text/csv'` * @returns nextState * @public */ var setExportDataTypeUpdater = exports.setExportDataTypeUpdater = function setExportDataTypeUpdater(state, _ref14) { var dataType = _ref14.payload; return _objectSpread(_objectSpread({}, state), {}, { exportData: _objectSpread(_objectSpread({}, state.exportData), {}, { dataType: dataType }) }); }; /** * Whether to export filtered data, `true` or `false` * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload * @returns nextState * @public */ var setExportFilteredUpdater = exports.setExportFilteredUpdater = function setExportFilteredUpdater(state, _ref15) { var filtered = _ref15.payload; return _objectSpread(_objectSpread({}, state), {}, { exportData: _objectSpread(_objectSpread({}, state.exportData), {}, { filtered: filtered }) }); }; /** * Whether to including data in map config, toggle between `true` or `false` * @memberof uiStateUpdaters * @param state `uiState` * @returns nextState * @public */ var setExportDataUpdater = exports.setExportDataUpdater = function setExportDataUpdater(state) { return _objectSpread(_objectSpread({}, state), {}, { exportMap: _objectSpread(_objectSpread({}, state.exportMap), {}, (0, _defineProperty2["default"])({}, _constants.EXPORT_MAP_FORMATS.JSON, _objectSpread(_objectSpread({}, state.exportMap[_constants.EXPORT_MAP_FORMATS.JSON]), {}, { hasData: !state.exportMap[_constants.EXPORT_MAP_FORMATS.JSON].hasData }))) }); }; /** * whether to export a mapbox access to HTML single page * @param state - `uiState` * @param action * @param action.payload * @returns nextState * @public */ var setUserMapboxAccessTokenUpdater = exports.setUserMapboxAccessTokenUpdater = function setUserMapboxAccessTokenUpdater(state, _ref16) { var userMapboxToken = _ref16.payload; return _objectSpread(_objectSpread({}, state), {}, { exportMap: _objectSpread(_objectSpread({}, state.exportMap), {}, (0, _defineProperty2["default"])({}, _constants.EXPORT_MAP_FORMATS.HTML, _objectSpread(_objectSpread({}, state.exportMap[_constants.EXPORT_MAP_FORMATS.HTML]), {}, { userMapboxToken: userMapboxToken }))) }); }; /** * Sets the export map format * @param state - `uiState` * @param action * @param action.payload format to use to export the map into * @return nextState */ var setExportMapFormatUpdater = exports.setExportMapFormatUpdater = function setExportMapFormatUpdater(state, _ref17) { var format = _ref17.payload; return _objectSpread(_objectSpread({}, state), {}, { exportMap: _objectSpread(_objectSpread({}, state.exportMap), {}, { // @ts-expect-error format: format }) }); }; /** * Set the export html map mode * @param state - `uiState` * @param action * @param action.payload to be set (available modes: EXPORT_HTML_MAP_MODES) * @return nextState */ var setExportMapHTMLModeUpdater = exports.setExportMapHTMLModeUpdater = function setExportMapHTMLModeUpdater(state, _ref18) { var mode = _ref18.payload; return _objectSpread(_objectSpread({}, state), {}, { exportMap: _objectSpread(_objectSpread({}, state.exportMap), {}, (0, _defineProperty2["default"])({}, _constants.EXPORT_MAP_FORMATS.HTML, _objectSpread(_objectSpread({}, state.exportMap[_constants.EXPORT_MAP_FORMATS.HTML]), {}, { mode: mode }))) }); }; /** * Adds a new notification. * Updates a notification in case of matching ids. * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload Params of a notification * @returns nextState * @public */ var addNotificationUpdater = exports.addNotificationUpdater = function addNotificationUpdater(state, _ref19) { var payload = _ref19.payload; var oldNotifications = state.notifications || []; // @ts-expect-error var payloadId = payload === null || payload === void 0 ? void 0 : payload.id; var notificationToUpdate = payloadId ? oldNotifications.find(function (n) { return n.id === payloadId; }) : null; var notifications; if (notificationToUpdate) { notifications = oldNotifications.map(function (n) { return n.id === payloadId ? (0, _utils.createNotification)(_objectSpread(_objectSpread({}, payload), {}, { count: n.count + 1 })) : n; }); } else { notifications = [].concat((0, _toConsumableArray2["default"])(oldNotifications), [(0, _utils.createNotification)(payload)]); } return _objectSpread(_objectSpread({}, state), {}, { notifications: notifications }); }; /** * Remove a notification * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload id of the notification to be removed * @returns nextState * @public */ var removeNotificationUpdater = exports.removeNotificationUpdater = function removeNotificationUpdater(state, _ref20) { var id = _ref20.payload; return _objectSpread(_objectSpread({}, state), {}, { notifications: state.notifications.filter(function (n) { return n.id !== id; }) }); }; /** * Fired when file loading begin * @memberof uiStateUpdaters * @param state `uiState` * @returns nextState * @public */ var loadFilesUpdater = exports.loadFilesUpdater = function loadFilesUpdater(state) { return _objectSpread(_objectSpread({}, state), {}, { loadFiles: _objectSpread(_objectSpread({}, state.loadFiles), {}, { fileLoading: true }) }); }; /** * Handles loading file success and set fileLoading property to false * @memberof uiStateUpdaters * @param state `uiState` * @returns nextState */ var loadFilesSuccessUpdater = exports.loadFilesSuccessUpdater = function loadFilesSuccessUpdater(state) { return _objectSpread(_objectSpread({}, state), {}, { loadFiles: _objectSpread(_objectSpread({}, state.loadFiles), {}, { fileLoading: false }) }); }; /** * Handles load file error and set fileLoading property to false * @memberof uiStateUpdaters * @param state * @param action * @param action.error * @returns nextState * @public */ var loadFilesErrUpdater = exports.loadFilesErrUpdater = function loadFilesErrUpdater(state, _ref21) { var error = _ref21.error; return addNotificationUpdater(_objectSpread(_objectSpread({}, state), {}, { loadFiles: _objectSpread(_objectSpread({}, state.loadFiles), {}, { fileLoading: false }) }), { payload: (0, _utils.errorNotification)({ message: (error || {}).message || 'Failed to upload files', topic: _constants.DEFAULT_NOTIFICATION_TOPICS.global }) }); }; /** * Handles toggle map split and reset all map control index to 0 * @memberof uiStateUpdaters * @param state * @returns nextState * @public */ var toggleSplitMapUpdater = exports.toggleSplitMapUpdater = function toggleSplitMapUpdater(state) { return _objectSpread(_objectSpread({}, state), {}, { mapControls: Object.entries(state.mapControls).reduce(function (acc, entry) { return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2["default"])({}, entry[0], _objectSpread(_objectSpread({}, entry[1]), {}, { activeMapIndex: 0 }))); }, {}) }); }; /** * Toggle modal data * @memberof uiStateUpdaters * @param state * @returns nextState * @public */ var showDatasetTableUpdater = exports.showDatasetTableUpdater = function showDatasetTableUpdater(state) { return toggleModalUpdater(state, { payload: _constants.DATA_TABLE_ID }); }; /** * Set the locale of the UI * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload * @param action.payload.locale locale * @returns nextState * @public */ var setLocaleUpdater = exports.setLocaleUpdater = function setLocaleUpdater(state, _ref22) { var locale = _ref22.payload.locale; return _objectSpread(_objectSpread({}, state), {}, { locale: locale }); }; /** * Toggle layer panel list view * @memberof uiStateUpdaters * @param state `uiState` * @param action * @param action.payload layer panel listView value. Can be 'list' or 'sortByDataset' * @returns nextState * @public */ var togglePanelListViewUpdater = exports.togglePanelListViewUpdater = function togglePanelListViewUpdater(state, _ref23) { var _ref23$payload = _ref23.payload, panelId = _ref23$payload.panelId, listView = _ref23$payload.listView; var stateProp = panelId === 'layer' ? 'layerPanelListView' : panelId === 'filter' ? 'filterPanelListView' : null; if (!stateProp || state[stateProp] === listView) { return state; } return _objectSpread(_objectSpread({}, state), {}, (0, _defineProperty2["default"])({}, stateProp, listView)); }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfY29uc3RhbnRzIiwicmVxdWlyZSIsIl9sb2NhbGl6YXRpb24iLCJfdXRpbHMiLCJfY29tcG9zZXJIZWxwZXJzIiwib3duS2V5cyIsImUiLCJyIiwidCIsIk9iamVjdCIsImtleXMiLCJnZXRPd25Qcm9wZXJ0eVN5bWJvbHMiLCJvIiwiZmlsdGVyIiwiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yIiwiZW51bWVyYWJsZSIsInB1c2giLCJhcHBseSIsIl9vYmplY3RTcHJlYWQiLCJhcmd1bWVudHMiLCJsZW5ndGgiLCJmb3JFYWNoIiwiX2RlZmluZVByb3BlcnR5MiIsImdldE93blByb3BlcnR5RGVzY3JpcHRvcnMiLCJkZWZpbmVQcm9wZXJ0aWVzIiwiZGVmaW5lUHJvcGVydHkiLCJERUZBVUxUX0FDVElWRV9TSURFX1BBTkVMIiwiZXhwb3J0cyIsIkRFRkFVTFRfTU9EQUwiLCJBRERfREFUQV9JRCIsInVpU3RhdGVVcGRhdGVycyIsIkRFRkFVTFRfTUFQX0NPTlRST0xTX0ZFQVRVUkVTIiwic2hvdyIsImFjdGl2ZSIsImRpc2FibGVDbG9zZSIsImFjdGl2ZU1hcEluZGV4IiwiREVGQVVMVF9NQVBfTEVHRU5EX0NPTlRST0wiLCJkaXNhYmxlRWRpdCIsIkRFRkFVTFRfTUFQX0NP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