UNPKG

kepler.gl

Version:

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

120 lines (117 loc) 24.7 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _react = _interopRequireWildcard(require("react")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _reactIntl = require("react-intl"); var _actions = require("@kepler.gl/actions"); var _constants = require("@kepler.gl/constants"); var _reducers = require("@kepler.gl/reducers"); var _injector = require("../injector"); var _sidePanelTitle = _interopRequireDefault(require("./side-panel-title")); var _effectList = _interopRequireDefault(require("./effect-list")); var _effectTypeSelector = _interopRequireDefault(require("./effect-type-selector")); var _templateObject, _templateObject2, _templateObject3, _templateObject4; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } 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; } var StyledEffectPanelContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n pointer-events: none !important; /* prevent padding from blocking input */\n flex-grow: 1;\n justify-content: space-between;\n overflow: hidden;\n\n & > * {\n /* all children should allow input */\n pointer-events: all;\n }\n"]))); // top right position absolute var StyledEffectPanel = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n top: 0;\n background-color: ", ";\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n overflow: hidden;\n"])), function (props) { return props.theme.sidePanelBg; }); var StyledEffectPanelHeader = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n padding: ", ";\n border-bottom: 1px solid ", ";\n min-width: ", "px;\n"])), function (_ref) { var theme = _ref.theme; return "".concat(theme.effectPanelPaddingTop, "px ").concat(theme.effectPanelPaddingSide, "px 4px ").concat(theme.effectPanelPaddingSide, "px"); }, function (props) { return props.theme.borderColor; }, function (_ref2) { var theme = _ref2.theme; return theme.effectPanelWidth; }); var StyledEffectPanelContent = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n padding: ", ";\n overflow: overlay;\n display: flex;\n flex-direction: column;\n"])), function (props) { return props.theme.sidePanelScrollBar; }, function (props) { return props.extended ? '32px' : '10px 0px 10px 0px'; }); EffectManagerFactory.deps = [_effectList["default"], _sidePanelTitle["default"], _effectTypeSelector["default"]]; function EffectManagerFactory(EffectList, SidePanelTitle, EffectTypeSelector) { var EffectManager = function EffectManager(props) { var intl = props.intl, visStateActions = props.visStateActions, visState = props.visState, children = props.children; var effects = visState.effects, effectOrder = visState.effectOrder; var visStateAddEffect = visStateActions.addEffect; var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2["default"])(_useState, 2), typeSelectorOpened = _useState2[0], setTypeSelectorOpened = _useState2[1]; // Prevent shadow effect from being added multiple times var effectOptions = (0, _react.useMemo)(function () { var hasShadow = effects.some(function (effect) { return effect.type === _constants.LIGHT_AND_SHADOW_EFFECT.type; }); return _constants.EFFECT_DESCRIPTIONS.map(function (desc) { return _objectSpread(_objectSpread({}, desc), {}, { disabled: Boolean(hasShadow && desc.type === _constants.LIGHT_AND_SHADOW_EFFECT.type) }); }); }, [effects]); var onAddEffect = (0, _react.useCallback)(function (type) { visStateAddEffect({ type: type }); }, [visStateAddEffect]); var onTypeSelectOpen = (0, _react.useCallback)(function () { setTypeSelectorOpened(true); }, []); var onTypeSelectClose = (0, _react.useCallback)(function () { setTypeSelectorOpened(false); }, []); return /*#__PURE__*/_react["default"].createElement(StyledEffectPanelContainer, { className: "effect-manager" }, /*#__PURE__*/_react["default"].createElement(StyledEffectPanel, null, /*#__PURE__*/_react["default"].createElement(StyledEffectPanelHeader, { className: "effect-panel-header" }, /*#__PURE__*/_react["default"].createElement(SidePanelTitle, { className: "effect-manager-title", title: intl.formatMessage({ id: 'effectManager.effects' }) }, /*#__PURE__*/_react["default"].createElement(EffectTypeSelector, { options: effectOptions, onSelect: onAddEffect, onOpen: onTypeSelectOpen, onBlur: onTypeSelectClose }))), /*#__PURE__*/_react["default"].createElement(StyledEffectPanelContent, { extended: typeSelectorOpened && effects.length === 0 }, /*#__PURE__*/_react["default"].createElement(EffectList, { effects: effects, effectOrder: effectOrder, visStateActions: visStateActions, isSortable: true }))), children); }; return (0, _injector.withState)([_reducers.visStateLens], function (state) { return state; }, { visStateActions: { addEffect: _actions.addEffect, updateEffect: _actions.updateEffect, removeEffect: _actions.removeEffect, reorderEffect: _actions.reorderEffect } })((0, _reactIntl.injectIntl)(EffectManager)); } var _default = exports["default"] = EffectManagerFactory; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVXaWxkY2FyZCIsInJlcXVpcmUiLCJfc3R5bGVkQ29tcG9uZW50cyIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJfcmVhY3RJbnRsIiwiX2FjdGlvbnMiLCJfY29uc3RhbnRzIiwiX3JlZHVjZXJzIiwiX2luamVjdG9yIiwiX3NpZGVQYW5lbFRpdGxlIiwiX2VmZmVjdExpc3QiLCJfZWZmZWN0VHlwZVNlbGVjdG9yIiwiX3RlbXBsYXRlT2JqZWN0IiwiX3RlbXBsYXRlT2JqZWN0MiIsIl90ZW1wbGF0ZU9iamVjdDMiLCJfdGVtcGxhdGVPYmplY3Q0IiwiX2dldFJlcXVpcmVXaWxkY2FyZENhY2hlIiwiZSIsIldlYWtNYXAiLCJyIiwidCIsIl9fZXNNb2R1bGUiLCJfdHlwZW9mIiwiaGFzIiwiZ2V0IiwibiIsIl9fcHJvdG9fXyIsImEiLCJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsInUiLCJoYXNPd25Qcm9wZXJ0eSIsImNhbGwiLCJpIiwic2V0Iiwib3duS2V5cyIsImtleXMiLCJnZXRPd25Qcm9wZXJ0eVN5bWJvbHMiLCJvIiwiZmlsdGVyIiwiZW51bWVyYWJsZSIsInB1c2giLCJhcHBseSIsIl9vYmplY3RTcHJlYWQiLCJhcmd1bWVudHMiLCJsZW5ndGgiLCJmb3JFYWNoIiwiX2RlZmluZVByb3BlcnR5MiIsImdldE93blByb3BlcnR5RGVzY3JpcH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