From e107d8764fccbdd9584c5a16e046786f4cf097d2 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 8 Nov 2018 17:51:18 +0900 Subject: [PATCH 01/69] update react and create context --- package.json | 17 ++++++----- src/components/fields/TraceSelector.js | 1 - src/context/index.js | 42 ++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 src/context/index.js diff --git a/package.json b/package.json index 1681a2786..4f3ae96fe 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "fs": "^0.0.1-security", "gl": "^4.0.4", "glob": "^7.1.2", - "jest": "^23.5.0", + "jest": "^23.6.0", "jest-cli": "^23.5.0", "mkdirp": "^0.5.1", "node-sass": "^4.7.2", @@ -63,12 +63,13 @@ "postcss-combine-duplicated-selectors": "^6.0.2", "postcss-custom-properties": "^6.3.1", "postcss-remove-root": "^0.0.2", - "prettier": "1.14.2", - "react": "^16.0.0", + "prettier": "^1.14.2", + "react": "^16.6.0", "react-ace": "^6.1.4", - "react-dom": "^16.0.0", - "react-hot-loader": "^4.0.0-beta.21", + "react-dom": "^16.6.0", + "react-hot-loader": "^4.3.12", "react-inspector": "^2.2.2", + "react-percy": "^0.3.0", "react-test-renderer": "^16.2.0", "rimraf": "2.6.2", "sass-loader": "^7.1.0", @@ -77,8 +78,8 @@ "webpack-dev-server": "^2.11.1" }, "peerDependencies": { - "react": ">15", - "react-dom": ">15" + "react": ">16.6.0", + "react-dom": ">16.6.0" }, "homepage": "https://plotly.github.io/react-chart-editor/", "jest": { @@ -125,4 +126,4 @@ "watch": "babel src --watch --out-dir lib --source-maps | node-sass -w src/styles/main.scss lib/react-chart-editor.css", "watch-test": "jest --watch" } -} \ No newline at end of file +} diff --git a/src/components/fields/TraceSelector.js b/src/components/fields/TraceSelector.js index 00270429c..0305cac42 100644 --- a/src/components/fields/TraceSelector.js +++ b/src/components/fields/TraceSelector.js @@ -15,7 +15,6 @@ import {CogIcon} from 'plotly-icons'; class TraceSelector extends Component { constructor(props, context) { super(props, context); - this.updatePlot = this.updatePlot.bind(this); this.setGl = this.setGl.bind(this); this.glEnabled = this.glEnabled.bind(this); diff --git a/src/context/index.js b/src/context/index.js new file mode 100644 index 000000000..8b68cbe39 --- /dev/null +++ b/src/context/index.js @@ -0,0 +1,42 @@ +import {createContext} from 'react'; +const EditorControlsContext = createContext({}); +const PanelMenuWrapperContext = createContext({}); +const ModalProviderContext = createContext({}); +const PlotlyFoldContext = createContext({}); +const PlotlyPanelContext = createContext({}); +const ConnectAggregationToTransformContext = createContext({}); +const ConnectAnnotationToLayoutContext = createContext({}); +const ConnectAxesToLayoutContext = createContext({}); +const ConnectCartesianSubplotToLayoutContext = createContext({}); +const ConnectImageToLayoutContext = createContext({}); +const ConnectLayoutToPlotContext = createContext({}); +const ConnectNonCartesianSubplotToLayoutContext = createContext({}); +const ConnectRangeSelectorToAxisContext = createContext({}); +const ConnectShapeToLayoutContext = createContext({}); +const ConnectSliderToLayoutContext = createContext({}); +const ConnectToContainerContext = createContext({}); +const ConnectTraceToPlotContext = createContext({}); +const ConnectTransformToTraceContext = createContext({}); +const ConnectUpdateMenuToLayoutContext = createContext({}); + +export { + EditorControlsContext, + PanelMenuWrapperContext, + ModalProviderContext, + PlotlyFoldContext, + PlotlyPanelContext, + ConnectAggregationToTransformContext, + ConnectAnnotationToLayoutContext, + ConnectAxesToLayoutContext, + ConnectCartesianSubplotToLayoutContext, + ConnectImageToLayoutContext, + ConnectLayoutToPlotContext, + ConnectNonCartesianSubplotToLayoutContext, + ConnectRangeSelectorToAxisContext, + ConnectShapeToLayoutContext, + ConnectSliderToLayoutContext, + ConnectToContainerContext, + ConnectTraceToPlotContext, + ConnectTransformToTraceContext, + ConnectUpdateMenuToLayoutContext, +}; From fbbcfbbf209eed97b336cc03add49a3b7aa1e970 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 8 Nov 2018 19:35:03 +0900 Subject: [PATCH 02/69] add Provider --- package.json | 1 + src/EditorControls.js | 60 +++++++++++++++---- src/components/PanelMenuWrapper.js | 33 ++++++---- src/components/containers/ModalProvider.js | 22 +++++-- src/components/containers/PlotlyFold.js | 19 ++++-- src/components/containers/PlotlyPanel.js | 33 ++++++---- src/lib/connectAggregationToTransform.js | 17 +++++- src/lib/connectAnnotationToLayout.js | 18 +++++- src/lib/connectAxesToLayout.js | 23 ++++++- src/lib/connectCartesianSubplotToLayout.js | 22 ++++++- src/lib/connectImageToLayout.js | 18 +++++- src/lib/connectLayoutToPlot.js | 33 +++++++++- src/lib/connectNonCartesianSubplotToLayout.js | 19 +++++- src/lib/connectRangeSelectorToAxis.js | 20 ++++++- src/lib/connectShapeToLayout.js | 18 +++++- src/lib/connectSliderToLayout.js | 17 +++++- src/lib/connectToContainer.js | 14 ++++- src/lib/connectTraceToPlot.js | 11 +++- src/lib/connectTransformToTrace.js | 18 +++++- src/lib/connectUpdateMenuToLayout.js | 17 +++++- 20 files changed, 375 insertions(+), 58 deletions(-) diff --git a/package.json b/package.json index 4f3ae96fe..c9a789413 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,7 @@ "start": "webpack-dev-server --hot", "test": "npm run test:lint && npm run test:pretty && npm run test:js", "test:js": "jest --setupTestFrameworkScriptFile=raf/polyfill", + "test:jswatch": "jest --watchAll --setupTestFrameworkScriptFile=raf/polyfill", "test:lint": "eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:pretty": "prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:percy": "react-percy", diff --git a/src/EditorControls.js b/src/EditorControls.js index b8de22231..3cb2d064f 100644 --- a/src/EditorControls.js +++ b/src/EditorControls.js @@ -18,6 +18,7 @@ import nestedProperty from 'plotly.js/src/lib/nested_property'; import {categoryLayout, traceTypes} from 'lib/traceTypes'; import {ModalProvider} from 'components/containers'; import {DEFAULT_FONTS} from 'lib/constants'; +import {EditorControlsContext} from './context'; class EditorControls extends Component { constructor(props, context) { @@ -62,6 +63,37 @@ class EditorControls extends Component { }; } + provideValue() { + const gd = this.props.graphDiv || {}; + return { + advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, + config: gd._context, + srcConverters: this.props.srcConverters, + data: gd.data, + dataSources: this.props.dataSources, + dataSourceOptions: this.props.dataSourceOptions, + dataSourceValueRenderer: this.props.dataSourceValueRenderer, + dataSourceOptionRenderer: this.props.dataSourceOptionRenderer, + dictionaries: this.props.dictionaries || {}, + localize: this.localize, + frames: gd._transitionData ? gd._transitionData._frames : [], + fullData: gd._fullData, + fullLayout: gd._fullLayout, + graphDiv: gd, + layout: gd.layout, + locale: this.props.locale, + onUpdate: this.handleUpdate.bind(this), + plotSchema: this.plotSchema, + plotly: this.props.plotly, + traceTypesConfig: this.props.traceTypesConfig, + showFieldTooltips: this.props.showFieldTooltips, + glByDefault: this.props.glByDefault, + mapBoxAccess: this.props.mapBoxAccess, + fontOptions: this.props.fontOptions, + chartHelp: this.props.chartHelp, + }; + } + handleUpdate({type, payload}) { const {graphDiv} = this.props; @@ -295,19 +327,21 @@ class EditorControls extends Component { render() { return ( -
- - {this.props.graphDiv && - this.props.graphDiv._fullLayout && - (this.props.children ? this.props.children : )} - -
+ +
+ + {this.props.graphDiv && + this.props.graphDiv._fullLayout && + (this.props.children ? this.props.children : )} + +
+
); } } diff --git a/src/components/PanelMenuWrapper.js b/src/components/PanelMenuWrapper.js index a9996ff95..607db79c3 100644 --- a/src/components/PanelMenuWrapper.js +++ b/src/components/PanelMenuWrapper.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React, {cloneElement, Component} from 'react'; import SidebarGroup from './sidebar/SidebarGroup'; import {bem} from 'lib'; +import {PanelMenuWrapperContext} from '../context'; class PanelsWithSidebar extends Component { constructor(props) { @@ -29,6 +30,12 @@ class PanelsWithSidebar extends Component { }; } + provideValue() { + return { + setPanel: this.setPanel, + }; + } + renderSection(section, i) { if (section.type && (section.type.plotly_editor_traits || {}).sidebar_element) { return cloneElement(section, {key: i}); @@ -83,18 +90,20 @@ class PanelsWithSidebar extends Component { const menuOpts = this.computeMenuOptions(this.props); return ( -
-
{menuOpts.map(this.renderSection)}
- {React.Children.map( - this.props.children, - (child, i) => - child === null || - this.state.group !== child.props.group || - this.state.panel !== child.props.name - ? null - : cloneElement(child, {key: i}) - )} -
+ +
+
{menuOpts.map(this.renderSection)}
+ {React.Children.map( + this.props.children, + (child, i) => + child === null || + this.state.group !== child.props.group || + this.state.panel !== child.props.name + ? null + : cloneElement(child, {key: i}) + )} +
+
); } } diff --git a/src/components/containers/ModalProvider.js b/src/components/containers/ModalProvider.js index 6cbb13958..a2fabc5bb 100644 --- a/src/components/containers/ModalProvider.js +++ b/src/components/containers/ModalProvider.js @@ -1,5 +1,6 @@ import React, {Fragment} from 'react'; import PropTypes from 'prop-types'; +import {ModalProviderContext} from '../../context'; class ModalProvider extends React.Component { constructor(props) { @@ -70,13 +71,26 @@ class ModalProvider extends React.Component { }; } + provideValue() { + return { + openModal: (c, p) => this.openModal(c, p), + closeModal: () => this.closeModal(), + handleClose: () => this.handleClose(), + isAnimatingOut: this.state.isAnimatingOut, + }; + } + render() { const {component: Component, componentProps, isAnimatingOut} = this.state; return ( - - {this.props.children} - {this.state.open ? : null} - + + + {this.props.children} + {this.state.open ? ( + + ) : null} + + ); } } diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index 87a500778..0c167d48f 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -4,6 +4,7 @@ import React, {Component} from 'react'; import classnames from 'classnames'; import {CloseIcon, AngleDownIcon} from 'plotly-icons'; import {unpackPlotProps, containerConnectedContextTypes, striptags} from 'lib'; +import {PlotlyFoldContext} from '../../context'; export class Fold extends Component { constructor() { @@ -17,9 +18,15 @@ export class Fold extends Component { }; } + provideValue() { + return { + foldInfo: this.props.foldInfo ? this.props.foldInfo : null, + }; + } + render() { if (!this.foldVisible && !this.props.messageIfEmpty) { - return null; + return ; } const {deleteContainer} = this.context; const { @@ -97,10 +104,12 @@ export class Fold extends Component { const classes = className ? ' ' + className : ''; return ( -
- {foldHeader} - {foldContent} -
+ +
+ {foldHeader} + {foldContent} +
+
); } } diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index 2281dd718..7a22588db 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -5,6 +5,7 @@ import React, {Component, cloneElement} from 'react'; import update from 'immutability-helper'; import {bem} from 'lib'; import {EmbedIconIcon} from 'plotly-icons'; +import {PlotlyPanelContext} from '../../context'; class PanelErrorImpl extends Component { render() { @@ -41,6 +42,12 @@ export class Panel extends Component { }; } + provideValue() { + return { + deleteContainer: this.props.deleteAction ? this.props.deleteAction : null, + }; + } + componentDidCatch() { this.setState({hasError: true}); } @@ -88,7 +95,11 @@ export class Panel extends Component { const {individualFoldStates, hasError} = this.state; if (hasError) { - return ; + return ( + + + + ); } const newChildren = React.Children.map(this.props.children, (child, index) => { @@ -103,15 +114,17 @@ export class Panel extends Component { }); return ( -
- 1} - toggleFolds={this.toggleFolds} - hasOpen={individualFoldStates.some(s => s === false)} - /> -
{newChildren}
-
+ +
+ 1} + toggleFolds={this.toggleFolds} + hasOpen={individualFoldStates.some(s => s === false)} + /> +
{newChildren}
+
+
); } } diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index 9a1df3de8..e6056d59f 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; +import {ConnectAggregationToTransformContext} from '../context'; export default function connectAggregationToTransform(WrappedComponent) { class AggregationConnectedComponent extends Component { @@ -35,6 +36,16 @@ export default function connectAggregationToTransform(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject ? null : this.context.getValObject(`aggregations[].${attr}`), + updateContainer: this.updateAggregation, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateAggregation(update) { const newUpdate = {}; const path = `aggregations[${this.props.aggregationIndex}]`; @@ -47,7 +58,11 @@ export default function connectAggregationToTransform(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectAnnotationToLayout.js b/src/lib/connectAnnotationToLayout.js index ea3f282be..8874787b5 100644 --- a/src/lib/connectAnnotationToLayout.js +++ b/src/lib/connectAnnotationToLayout.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {ConnectAnnotationToLayoutContext} from '../context'; export default function connectAnnotationToLayout(WrappedComponent) { class AnnotationConnectedComponent extends Component { @@ -38,6 +39,17 @@ export default function connectAnnotationToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject ? null : this.context.getValObject(`annotations[].${attr}`), + updateContainer: this.updateAnnotation, + deleteContainer: this.deleteAnnotation, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateAnnotation(update) { const newUpdate = {}; const {annotationIndex} = this.props; @@ -58,7 +70,11 @@ export default function connectAnnotationToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index f60e52d1f..261bd1dd2 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {capitalize, getAllAxes, getDisplayName, getAxisTitle} from '../lib'; +import {ConnectAxesToLayoutContext} from '../context'; function computeAxesOptions(axes, props, context) { const _ = context.localize; @@ -104,6 +105,22 @@ export default function connectAxesToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject + ? null + : this.context.getValObject(`${this.state.axesTarget}.${attr}`), + axesOptions: this.axesOptions, + axesTarget: this.state.axesTarget, + axesTargetHandler: this.axesTargetHandler, + container: this.container, + defaultContainer: this.defaultContainer, + fullContainer: this.fullContainer, + updateContainer: this.updateContainer, + }; + } + axesTargetHandler(axesTarget) { this.setState({axesTarget}); } @@ -137,7 +154,11 @@ export default function connectAxesToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectCartesianSubplotToLayout.js b/src/lib/connectCartesianSubplotToLayout.js index eab68ddb1..1c6df7187 100644 --- a/src/lib/connectCartesianSubplotToLayout.js +++ b/src/lib/connectCartesianSubplotToLayout.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; +import {ConnectCartesianSubplotToLayoutContext} from '../context'; export default function connectCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { @@ -52,6 +53,21 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject + ? null + : this.context.getValObject( + attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis) + ), + updateContainer: this.updateSubplot, + deleteContainer: this.deleteSubplot, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateSubplot(update) { const newUpdate = {}; for (const key in update) { @@ -62,7 +78,11 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectImageToLayout.js b/src/lib/connectImageToLayout.js index f2517a15f..bb455fdf8 100644 --- a/src/lib/connectImageToLayout.js +++ b/src/lib/connectImageToLayout.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {ConnectImageToLayoutContext} from '../context'; export default function connectImageToLayout(WrappedComponent) { class ImageConnectedComponent extends Component { @@ -38,6 +39,17 @@ export default function connectImageToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`), + updateContainer: this.updateImage, + deleteContainer: this.deleteImage, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateImage(update) { const newUpdate = {}; const {imageIndex} = this.props; @@ -58,7 +70,11 @@ export default function connectImageToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectLayoutToPlot.js b/src/lib/connectLayoutToPlot.js index 276f2ddde..18b782eb9 100644 --- a/src/lib/connectLayoutToPlot.js +++ b/src/lib/connectLayoutToPlot.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {ConnectLayoutToPlotContext} from '../context'; export default function connectLayoutToPlot(WrappedComponent) { class LayoutConnectedComponent extends Component { @@ -32,8 +33,38 @@ export default function connectLayoutToPlot(WrappedComponent) { }; } + provideValue() { + const {layout, fullLayout, plotly, onUpdate} = this.context; + + const updateContainer = update => { + if (!onUpdate) { + return; + } + onUpdate({ + type: EDITOR_ACTIONS.UPDATE_LAYOUT, + payload: { + update, + }, + }); + }; + + return { + getValObject: attr => + !plotly + ? null + : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts), + updateContainer, + container: layout, + fullContainer: fullLayout, + }; + } + render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectNonCartesianSubplotToLayout.js b/src/lib/connectNonCartesianSubplotToLayout.js index db29cb198..dd022942f 100644 --- a/src/lib/connectNonCartesianSubplotToLayout.js +++ b/src/lib/connectNonCartesianSubplotToLayout.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; +import {ConnectNonCartesianSubplotToLayoutContext} from '../context'; export default function connectNonCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { @@ -43,6 +44,18 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject + ? null + : this.context.getValObject(`${this.props.subplot}.${attr}`), + updateContainer: this.updateSubplot, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateSubplot(update) { const newUpdate = {}; for (const key in update) { @@ -52,7 +65,11 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectRangeSelectorToAxis.js b/src/lib/connectRangeSelectorToAxis.js index 977a84de9..698cf5398 100644 --- a/src/lib/connectRangeSelectorToAxis.js +++ b/src/lib/connectRangeSelectorToAxis.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {ConnectRangeSelectorToAxisContext} from '../context'; export default function connectRangeSelectorToAxis(WrappedComponent) { class RangeSelectorConnectedComponent extends Component { @@ -42,6 +43,19 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject + ? null + : this.context.getValObject(`rangeselector.buttons[].${attr}`), + updateContainer: this.updateRangeselector, + deleteContainer: this.deleteRangeselector, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateRangeselector(update) { const newUpdate = {}; const {rangeselectorIndex} = this.props; @@ -65,7 +79,11 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectShapeToLayout.js b/src/lib/connectShapeToLayout.js index d093686a9..46fa1be06 100644 --- a/src/lib/connectShapeToLayout.js +++ b/src/lib/connectShapeToLayout.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {ConnectShapeToLayoutContext} from '../context'; export default function connectShapeToLayout(WrappedComponent) { class ShapeConnectedComponent extends Component { @@ -38,6 +39,17 @@ export default function connectShapeToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`), + updateContainer: this.updateShape, + deleteContainer: this.deleteShape, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateShape(update) { const newUpdate = {}; const {shapeIndex} = this.props; @@ -58,7 +70,11 @@ export default function connectShapeToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectSliderToLayout.js b/src/lib/connectSliderToLayout.js index d42a7bde3..12523da2a 100644 --- a/src/lib/connectSliderToLayout.js +++ b/src/lib/connectSliderToLayout.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; +import {ConnectSliderToLayoutContext} from '../context'; export default function connectSliderToLayout(WrappedComponent) { class SliderConnectedComponent extends Component { @@ -34,6 +35,16 @@ export default function connectSliderToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`), + updateContainer: this.updateSlider, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateSlider(update) { const newUpdate = {}; const {sliderIndex} = this.props; @@ -45,7 +56,11 @@ export default function connectSliderToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index 0a5fedee5..d59c11d26 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import unpackPlotProps from './unpackPlotProps'; import {getDisplayName} from '../lib'; +import {ConnectToContainerContext} from '../context'; export const containerConnectedContextTypes = { localize: PropTypes.func, @@ -56,6 +57,13 @@ export default function connectToContainer(WrappedComponent, config = {}) { }; } + provideValue() { + return { + description: this.plotProps.description, + attr: this.attr, + }; + } + render() { // Merge plotprops onto props so leaf components only need worry about // props. However pass plotProps as a specific prop in case inner component @@ -63,7 +71,11 @@ export default function connectToContainer(WrappedComponent, config = {}) { // component can skip computation as it can see plotProps is already defined. const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, this.props); if (props.isVisible) { - return ; + return ( + + + + ); } return null; diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index af621122c..e7bfb8367 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -10,6 +10,7 @@ import { } from '../lib'; import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {EDITOR_ACTIONS, SUBPLOT_TO_ATTR} from 'lib/constants'; +import {ConnectTraceToPlotContext} from '../context'; export default function connectTraceToPlot(WrappedComponent) { class TraceConnectedComponent extends Component { @@ -76,6 +77,10 @@ export default function connectTraceToPlot(WrappedComponent) { return this.childContext; } + provideValue() { + return this.childContext; + } + updateTrace(update) { if (this.context.onUpdate) { const splitTraceGroup = this.props.fullDataArrayPosition @@ -178,7 +183,11 @@ export default function connectTraceToPlot(WrappedComponent) { } render() { - return ; + return ( + + ; + + ); } } diff --git a/src/lib/connectTransformToTrace.js b/src/lib/connectTransformToTrace.js index a24b16b41..b02b84f53 100644 --- a/src/lib/connectTransformToTrace.js +++ b/src/lib/connectTransformToTrace.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {ConnectTransformToTraceContext} from '../context'; export default function connectTransformToTrace(WrappedComponent) { class TransformConnectedComponent extends Component { @@ -38,6 +39,17 @@ export default function connectTransformToTrace(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`), + updateContainer: this.updateTransform, + deleteContainer: this.deleteTransform, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateTransform(update) { const newUpdate = {}; const {transformIndex} = this.props; @@ -61,7 +73,11 @@ export default function connectTransformToTrace(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } diff --git a/src/lib/connectUpdateMenuToLayout.js b/src/lib/connectUpdateMenuToLayout.js index 9b1229dd7..5ae7b95a4 100644 --- a/src/lib/connectUpdateMenuToLayout.js +++ b/src/lib/connectUpdateMenuToLayout.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; +import {ConnectUpdateMenuToLayoutContext} from '../context'; export default function connectUpdateMenuToLayout(WrappedComponent) { class UpdateMenuConnectedComponent extends Component { @@ -34,6 +35,16 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { }; } + provideValue() { + return { + getValObject: attr => + !this.context.getValObject ? null : this.context.getValObject(`updatemenus[].${attr}`), + updateContainer: this.updateUpdateMenu, + container: this.container, + fullContainer: this.fullContainer, + }; + } + updateUpdateMenu(update) { const newUpdate = {}; const {updateMenuIndex} = this.props; @@ -45,7 +56,11 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { } render() { - return ; + return ( + + + + ); } } From f059bf567d74a91487458339b05ae6fed810df1f Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 11 Nov 2018 20:26:03 +0900 Subject: [PATCH 03/69] remove provider --- src/context/index.js | 52 +++++++++---------- src/lib/connectAggregationToTransform.js | 7 +-- src/lib/connectAnnotationToLayout.js | 7 +-- src/lib/connectAxesToLayout.js | 7 +-- src/lib/connectCartesianSubplotToLayout.js | 7 +-- src/lib/connectImageToLayout.js | 7 +-- src/lib/connectLayoutToPlot.js | 7 +-- src/lib/connectNonCartesianSubplotToLayout.js | 7 +-- src/lib/connectRangeSelectorToAxis.js | 7 +-- src/lib/connectShapeToLayout.js | 7 +-- src/lib/connectSliderToLayout.js | 7 +-- src/lib/connectToContainer.js | 7 +-- src/lib/connectTransformToTrace.js | 7 +-- src/lib/connectUpdateMenuToLayout.js | 7 +-- 14 files changed, 39 insertions(+), 104 deletions(-) diff --git a/src/context/index.js b/src/context/index.js index 8b68cbe39..312d60220 100644 --- a/src/context/index.js +++ b/src/context/index.js @@ -4,20 +4,20 @@ const PanelMenuWrapperContext = createContext({}); const ModalProviderContext = createContext({}); const PlotlyFoldContext = createContext({}); const PlotlyPanelContext = createContext({}); -const ConnectAggregationToTransformContext = createContext({}); -const ConnectAnnotationToLayoutContext = createContext({}); -const ConnectAxesToLayoutContext = createContext({}); -const ConnectCartesianSubplotToLayoutContext = createContext({}); -const ConnectImageToLayoutContext = createContext({}); -const ConnectLayoutToPlotContext = createContext({}); -const ConnectNonCartesianSubplotToLayoutContext = createContext({}); -const ConnectRangeSelectorToAxisContext = createContext({}); -const ConnectShapeToLayoutContext = createContext({}); -const ConnectSliderToLayoutContext = createContext({}); -const ConnectToContainerContext = createContext({}); +// const ConnectAggregationToTransformContext = createContext({}); +// const ConnectAnnotationToLayoutContext = createContext({}); +// const ConnectAxesToLayoutContext = createContext({}); +// const ConnectCartesianSubplotToLayoutContext = createContext({}); +// const ConnectImageToLayoutContext = createContext({}); +// const ConnectLayoutToPlotContext = createContext({}); +// const ConnectNonCartesianSubplotToLayoutContext = createContext({}); +// const ConnectRangeSelectorToAxisContext = createContext({}); +// const ConnectShapeToLayoutContext = createContext({}); +// const ConnectSliderToLayoutContext = createContext({}); +// const ConnectToContainerContext = createContext({}); const ConnectTraceToPlotContext = createContext({}); -const ConnectTransformToTraceContext = createContext({}); -const ConnectUpdateMenuToLayoutContext = createContext({}); +// const ConnectTransformToTraceContext = createContext({}); +// const ConnectUpdateMenuToLayoutContext = createContext({}); export { EditorControlsContext, @@ -25,18 +25,18 @@ export { ModalProviderContext, PlotlyFoldContext, PlotlyPanelContext, - ConnectAggregationToTransformContext, - ConnectAnnotationToLayoutContext, - ConnectAxesToLayoutContext, - ConnectCartesianSubplotToLayoutContext, - ConnectImageToLayoutContext, - ConnectLayoutToPlotContext, - ConnectNonCartesianSubplotToLayoutContext, - ConnectRangeSelectorToAxisContext, - ConnectShapeToLayoutContext, - ConnectSliderToLayoutContext, - ConnectToContainerContext, + // ConnectAggregationToTransformContext, + // ConnectAnnotationToLayoutContext, + // ConnectAxesToLayoutContext, + // ConnectCartesianSubplotToLayoutContext, + // ConnectImageToLayoutContext, + // ConnectLayoutToPlotContext, + // ConnectNonCartesianSubplotToLayoutContext, + // ConnectRangeSelectorToAxisContext, + // ConnectShapeToLayoutContext, + // ConnectSliderToLayoutContext, + // ConnectToContainerContext, ConnectTraceToPlotContext, - ConnectTransformToTraceContext, - ConnectUpdateMenuToLayoutContext, + // ConnectTransformToTraceContext, + // ConnectUpdateMenuToLayoutContext, }; diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index e6056d59f..3aab86b0e 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; -import {ConnectAggregationToTransformContext} from '../context'; export default function connectAggregationToTransform(WrappedComponent) { class AggregationConnectedComponent extends Component { @@ -58,11 +57,7 @@ export default function connectAggregationToTransform(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectAnnotationToLayout.js b/src/lib/connectAnnotationToLayout.js index 8874787b5..b87a0889d 100644 --- a/src/lib/connectAnnotationToLayout.js +++ b/src/lib/connectAnnotationToLayout.js @@ -2,7 +2,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; -import {ConnectAnnotationToLayoutContext} from '../context'; export default function connectAnnotationToLayout(WrappedComponent) { class AnnotationConnectedComponent extends Component { @@ -70,11 +69,7 @@ export default function connectAnnotationToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index 261bd1dd2..c1dd4c1f4 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {capitalize, getAllAxes, getDisplayName, getAxisTitle} from '../lib'; -import {ConnectAxesToLayoutContext} from '../context'; function computeAxesOptions(axes, props, context) { const _ = context.localize; @@ -154,11 +153,7 @@ export default function connectAxesToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectCartesianSubplotToLayout.js b/src/lib/connectCartesianSubplotToLayout.js index 1c6df7187..0fb56e022 100644 --- a/src/lib/connectCartesianSubplotToLayout.js +++ b/src/lib/connectCartesianSubplotToLayout.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; -import {ConnectCartesianSubplotToLayoutContext} from '../context'; export default function connectCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { @@ -78,11 +77,7 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectImageToLayout.js b/src/lib/connectImageToLayout.js index bb455fdf8..a68b00ea8 100644 --- a/src/lib/connectImageToLayout.js +++ b/src/lib/connectImageToLayout.js @@ -2,7 +2,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; -import {ConnectImageToLayoutContext} from '../context'; export default function connectImageToLayout(WrappedComponent) { class ImageConnectedComponent extends Component { @@ -70,11 +69,7 @@ export default function connectImageToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectLayoutToPlot.js b/src/lib/connectLayoutToPlot.js index 18b782eb9..0296c2015 100644 --- a/src/lib/connectLayoutToPlot.js +++ b/src/lib/connectLayoutToPlot.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; -import {ConnectLayoutToPlotContext} from '../context'; export default function connectLayoutToPlot(WrappedComponent) { class LayoutConnectedComponent extends Component { @@ -60,11 +59,7 @@ export default function connectLayoutToPlot(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectNonCartesianSubplotToLayout.js b/src/lib/connectNonCartesianSubplotToLayout.js index dd022942f..f1c91630d 100644 --- a/src/lib/connectNonCartesianSubplotToLayout.js +++ b/src/lib/connectNonCartesianSubplotToLayout.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; -import {ConnectNonCartesianSubplotToLayoutContext} from '../context'; export default function connectNonCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { @@ -65,11 +64,7 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectRangeSelectorToAxis.js b/src/lib/connectRangeSelectorToAxis.js index 698cf5398..8e891c9f3 100644 --- a/src/lib/connectRangeSelectorToAxis.js +++ b/src/lib/connectRangeSelectorToAxis.js @@ -2,7 +2,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; -import {ConnectRangeSelectorToAxisContext} from '../context'; export default function connectRangeSelectorToAxis(WrappedComponent) { class RangeSelectorConnectedComponent extends Component { @@ -79,11 +78,7 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectShapeToLayout.js b/src/lib/connectShapeToLayout.js index 46fa1be06..441ffe7a8 100644 --- a/src/lib/connectShapeToLayout.js +++ b/src/lib/connectShapeToLayout.js @@ -2,7 +2,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; -import {ConnectShapeToLayoutContext} from '../context'; export default function connectShapeToLayout(WrappedComponent) { class ShapeConnectedComponent extends Component { @@ -70,11 +69,7 @@ export default function connectShapeToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectSliderToLayout.js b/src/lib/connectSliderToLayout.js index 12523da2a..4c1d582b2 100644 --- a/src/lib/connectSliderToLayout.js +++ b/src/lib/connectSliderToLayout.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; -import {ConnectSliderToLayoutContext} from '../context'; export default function connectSliderToLayout(WrappedComponent) { class SliderConnectedComponent extends Component { @@ -56,11 +55,7 @@ export default function connectSliderToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index d59c11d26..51ee0322b 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -2,7 +2,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import unpackPlotProps from './unpackPlotProps'; import {getDisplayName} from '../lib'; -import {ConnectToContainerContext} from '../context'; export const containerConnectedContextTypes = { localize: PropTypes.func, @@ -71,11 +70,7 @@ export default function connectToContainer(WrappedComponent, config = {}) { // component can skip computation as it can see plotProps is already defined. const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, this.props); if (props.isVisible) { - return ( - - - - ); + return ; } return null; diff --git a/src/lib/connectTransformToTrace.js b/src/lib/connectTransformToTrace.js index b02b84f53..10a7d9372 100644 --- a/src/lib/connectTransformToTrace.js +++ b/src/lib/connectTransformToTrace.js @@ -2,7 +2,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; -import {ConnectTransformToTraceContext} from '../context'; export default function connectTransformToTrace(WrappedComponent) { class TransformConnectedComponent extends Component { @@ -73,11 +72,7 @@ export default function connectTransformToTrace(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } diff --git a/src/lib/connectUpdateMenuToLayout.js b/src/lib/connectUpdateMenuToLayout.js index 5ae7b95a4..05adffe73 100644 --- a/src/lib/connectUpdateMenuToLayout.js +++ b/src/lib/connectUpdateMenuToLayout.js @@ -1,7 +1,6 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; -import {ConnectUpdateMenuToLayoutContext} from '../context'; export default function connectUpdateMenuToLayout(WrappedComponent) { class UpdateMenuConnectedComponent extends Component { @@ -56,11 +55,7 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { } render() { - return ( - - - - ); + return ; } } From 175ca3e60bfa140b7e2a95eddc3c71c38f451ff0 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 11 Nov 2018 21:41:22 +0900 Subject: [PATCH 04/69] connect To ContextType --- src/DefaultEditor.js | 8 +- .../containers/AnnotationAccordion.js | 6 +- src/components/containers/ImageAccordion.js | 6 +- src/components/containers/Modal.js | 6 +- .../containers/RangeSelectorAccordion.js | 6 +- src/components/containers/ShapeAccordion.js | 6 +- src/components/containers/SliderAccordion.js | 6 +- src/components/containers/SubplotAccordion.js | 8 +- src/components/containers/TraceAccordion.js | 7 +- .../containers/TraceRequiredPanel.js | 25 +- .../containers/UpdateMenuAccordion.js | 6 +- src/components/fields/AxesCreator.js | 30 +- src/components/fields/ErrorBars.js | 7 +- src/components/fields/GroupCreator.js | 7 +- src/components/fields/SubplotCreator.js | 30 +- src/components/fields/TextEditor.js | 5 +- src/components/fields/TraceSelector.js | 37 +- src/components/fields/UpdateMenuButtons.js | 5 +- src/components/widgets/ColorscalePicker.js | 5 +- src/components/widgets/Dropdown.js | 5 +- src/components/widgets/Dropzone.js | 5 +- src/components/widgets/TraceTypeSelector.js | 9 +- .../widgets/text_editors/MultiFormat.js | 5 +- .../text_editors/RichText/LinkEditor.js | 5 +- src/default_panels/GraphCreatePanel.js | 275 ++-- src/default_panels/GraphSubplotsPanel.js | 408 +++--- src/default_panels/GraphTransformsPanel.js | 53 +- src/default_panels/StyleColorbarsPanel.js | 505 +++---- src/default_panels/StyleImagesPanel.js | 117 +- src/default_panels/StyleLayoutPanel.js | 247 ++-- src/default_panels/StyleLegendPanel.js | 141 +- src/default_panels/StyleNotesPanel.js | 119 +- src/default_panels/StyleShapesPanel.js | 79 +- src/default_panels/StyleSlidersPanel.js | 143 +- src/default_panels/StyleTracesPanel.js | 1222 +++++++++-------- src/default_panels/StyleUpdateMenusPanel.js | 119 +- src/index.js | 12 + src/lib/connectTraceToPlot.js | 7 +- 38 files changed, 1879 insertions(+), 1813 deletions(-) diff --git a/src/DefaultEditor.js b/src/DefaultEditor.js index 35ab1241c..e6475af8d 100644 --- a/src/DefaultEditor.js +++ b/src/DefaultEditor.js @@ -19,6 +19,7 @@ import { import {traceHasColorbar} from './default_panels/StyleColorbarsPanel'; import Logo from './components/widgets/Logo'; import {TRANSFORMABLE_TRACES} from './lib/constants'; +import {EditorControlsContext} from './context'; class DefaultEditor extends Component { constructor(props, context) { @@ -97,11 +98,6 @@ DefaultEditor.propTypes = { logoSrc: PropTypes.string, }; -DefaultEditor.contextTypes = { - localize: PropTypes.func, - fullData: PropTypes.array, - fullLayout: PropTypes.object, - layout: PropTypes.object, -}; +DefaultEditor.contextType = EditorControlsContext; export default DefaultEditor; diff --git a/src/components/containers/AnnotationAccordion.js b/src/components/containers/AnnotationAccordion.js index 0b6a15e33..545d00941 100644 --- a/src/components/containers/AnnotationAccordion.js +++ b/src/components/containers/AnnotationAccordion.js @@ -4,6 +4,7 @@ import {PanelMessage} from './PanelEmpty'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectAnnotationToLayout} from 'lib'; +import {EditorControlsContext} from '../../context'; const AnnotationFold = connectAnnotationToLayout(PlotlyFold); @@ -61,10 +62,7 @@ class AnnotationAccordion extends Component { } } -AnnotationAccordion.contextTypes = { - layout: PropTypes.object, - localize: PropTypes.func, -}; +AnnotationAccordion.contextType = EditorControlsContext; AnnotationAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/containers/ImageAccordion.js b/src/components/containers/ImageAccordion.js index b2d70c7cc..9217f3af0 100644 --- a/src/components/containers/ImageAccordion.js +++ b/src/components/containers/ImageAccordion.js @@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectImageToLayout} from 'lib'; import {PanelMessage} from './PanelEmpty'; +import {EditorControlsContext} from '../../context'; const ImageFold = connectImageToLayout(PlotlyFold); @@ -66,10 +67,7 @@ class ImageAccordion extends Component { } } -ImageAccordion.contextTypes = { - layout: PropTypes.object, - localize: PropTypes.func, -}; +ImageAccordion.contextType = EditorControlsContext; ImageAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/containers/Modal.js b/src/components/containers/Modal.js index 356842dc4..268304cc9 100644 --- a/src/components/containers/Modal.js +++ b/src/components/containers/Modal.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {CloseIcon} from 'plotly-icons'; +import {ModalProviderContext} from '../../context'; const ModalHeader = ({title, handleClose}) => (
@@ -68,10 +69,7 @@ Modal.propTypes = { title: PropTypes.node, }; -Modal.contextTypes = { - handleClose: PropTypes.func, - isAnimatingOut: PropTypes.bool, -}; +Modal.contextType = ModalProviderContext; export default Modal; diff --git a/src/components/containers/RangeSelectorAccordion.js b/src/components/containers/RangeSelectorAccordion.js index 940799ec1..2f188550c 100644 --- a/src/components/containers/RangeSelectorAccordion.js +++ b/src/components/containers/RangeSelectorAccordion.js @@ -3,6 +3,7 @@ import PlotlyPanel from './PlotlyPanel'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectRangeSelectorToAxis} from 'lib'; +import {EditorControlsContext} from '../../context'; const RangeSelectorFold = connectRangeSelectorToAxis(PlotlyFold); @@ -54,10 +55,7 @@ class RangeSelectorAccordion extends Component { } } -RangeSelectorAccordion.contextTypes = { - fullContainer: PropTypes.object, - localize: PropTypes.func, -}; +RangeSelectorAccordion.contextType = EditorControlsContext; RangeSelectorAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/containers/ShapeAccordion.js b/src/components/containers/ShapeAccordion.js index 0947eff99..58b5b4916 100644 --- a/src/components/containers/ShapeAccordion.js +++ b/src/components/containers/ShapeAccordion.js @@ -5,6 +5,7 @@ import React, {Component} from 'react'; import {connectShapeToLayout} from 'lib'; import {COLORS} from 'lib/constants'; import {PanelMessage} from './PanelEmpty'; +import {EditorControlsContext} from '../../context'; const ShapeFold = connectShapeToLayout(PlotlyFold); @@ -66,10 +67,7 @@ class ShapeAccordion extends Component { } } -ShapeAccordion.contextTypes = { - layout: PropTypes.object, - localize: PropTypes.func, -}; +ShapeAccordion.contextType = EditorControlsContext; ShapeAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/containers/SliderAccordion.js b/src/components/containers/SliderAccordion.js index ef87cbb1f..e87b47e34 100644 --- a/src/components/containers/SliderAccordion.js +++ b/src/components/containers/SliderAccordion.js @@ -3,6 +3,7 @@ import TraceRequiredPanel from './TraceRequiredPanel'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectSliderToLayout} from 'lib'; +import {EditorControlsContext} from '../../context'; const SliderFold = connectSliderToLayout(PlotlyFold); @@ -26,10 +27,7 @@ class SliderAccordion extends Component { } } -SliderAccordion.contextTypes = { - layout: PropTypes.object, - localize: PropTypes.func, -}; +SliderAccordion.contextType = EditorControlsContext; SliderAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/containers/SubplotAccordion.js b/src/components/containers/SubplotAccordion.js index e7f3924fd..f2e5326ab 100644 --- a/src/components/containers/SubplotAccordion.js +++ b/src/components/containers/SubplotAccordion.js @@ -9,6 +9,7 @@ import { getSubplotTitle, } from 'lib'; import {TRACE_TO_AXIS, SUBPLOT_TO_ATTR} from 'lib/constants'; +import {EditorControlsContext} from '../../context'; const TraceFold = connectTraceToPlot(PlotlyFold); const NonCartesianSubplotFold = connectNonCartesianSubplotToLayout(PlotlyFold); @@ -143,12 +144,7 @@ class SubplotAccordion extends Component { } } -SubplotAccordion.contextTypes = { - fullData: PropTypes.array, - data: PropTypes.array, - layout: PropTypes.object, - localize: PropTypes.func, -}; +SubplotAccordion.contextType = EditorControlsContext; SubplotAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/containers/TraceAccordion.js b/src/components/containers/TraceAccordion.js index 062523521..ca52b8bf4 100644 --- a/src/components/containers/TraceAccordion.js +++ b/src/components/containers/TraceAccordion.js @@ -8,6 +8,7 @@ import {connectTraceToPlot, plotlyTraceToCustomTrace} from 'lib'; import {Tab, Tabs, TabList, TabPanel} from 'react-tabs'; import {traceTypes} from 'lib/traceTypes'; import {PanelMessage} from './PanelEmpty'; +import {EditorControlsContext} from '../../context'; const TraceFold = connectTraceToPlot(PlotlyFold); @@ -181,11 +182,7 @@ class TraceAccordion extends Component { } } -TraceAccordion.contextTypes = { - fullData: PropTypes.array, - data: PropTypes.array, - localize: PropTypes.func, -}; +TraceAccordion.contextType = EditorControlsContext; TraceAccordion.propTypes = { canAdd: PropTypes.bool, diff --git a/src/components/containers/TraceRequiredPanel.js b/src/components/containers/TraceRequiredPanel.js index e5f538e3b..745062e0e 100644 --- a/src/components/containers/TraceRequiredPanel.js +++ b/src/components/containers/TraceRequiredPanel.js @@ -2,6 +2,7 @@ import PanelEmpty from './PanelEmpty'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {LayoutPanel} from './derived'; +import {EditorControlsContext, ModalProviderContext} from '../../context'; class TraceRequiredPanel extends Component { hasTrace() { @@ -19,13 +20,17 @@ class TraceRequiredPanel extends Component { return this.hasTrace() ? ( {children} ) : ( - -

- {_('Go to the ')} - this.context.setPanel('Structure', 'Traces')}>{_('Traces')} - {_(' panel under Structure to define traces.')} -

-
+ + {({setPanel}) => ( + +

+ {_('Go to the ')} + setPanel('Structure', 'Traces')}>{_('Traces')} + {_(' panel under Structure to define traces.')} +

+
+ )} +
); } } @@ -39,10 +44,6 @@ TraceRequiredPanel.defaultProps = { visible: true, }; -TraceRequiredPanel.contextTypes = { - fullData: PropTypes.array, - localize: PropTypes.func, - setPanel: PropTypes.func, -}; +TraceRequiredPanel.contextType = EditorControlsContext; export default TraceRequiredPanel; diff --git a/src/components/containers/UpdateMenuAccordion.js b/src/components/containers/UpdateMenuAccordion.js index 735c1e9fb..84e7c7339 100644 --- a/src/components/containers/UpdateMenuAccordion.js +++ b/src/components/containers/UpdateMenuAccordion.js @@ -3,6 +3,7 @@ import TraceRequiredPanel from './TraceRequiredPanel'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectUpdateMenuToLayout} from 'lib'; +import {EditorControlsContext} from '../../context'; const UpdateMenuFold = connectUpdateMenuToLayout(PlotlyFold); @@ -36,10 +37,7 @@ class UpdateMenuAccordion extends Component { } } -UpdateMenuAccordion.contextTypes = { - fullLayout: PropTypes.object, - localize: PropTypes.func, -}; +UpdateMenuAccordion.contextType = EditorControlsContext; UpdateMenuAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/fields/AxesCreator.js b/src/components/fields/AxesCreator.js index 13e19d816..a1d8b09ee 100644 --- a/src/components/fields/AxesCreator.js +++ b/src/components/fields/AxesCreator.js @@ -7,6 +7,7 @@ import Button from '../widgets/Button'; import {PlusIcon} from 'plotly-icons'; import {connectToContainer, traceTypeToAxisType, getAxisTitle, axisIdToAxisName} from 'lib'; import {PlotlySection} from 'components'; +import {EditorControlsContext, ModalProviderContext} from '../../context'; class UnconnectedAxisCreator extends Component { canAddAxis() { @@ -104,12 +105,7 @@ UnconnectedAxisCreator.propTypes = { updateContainer: PropTypes.func, }; -UnconnectedAxisCreator.contextTypes = { - fullLayout: PropTypes.object, - data: PropTypes.array, - fullData: PropTypes.array, - onUpdate: PropTypes.func, -}; +UnconnectedAxisCreator.contextType = EditorControlsContext; const AxisCreator = connectToContainer(UnconnectedAxisCreator); @@ -149,11 +145,15 @@ class UnconnectedAxesCreator extends Component { return ( {controls} - - {_('You can style and position your axes in the ')} - this.context.setPanel('Structure', 'Subplots')}>{_('Subplots')} - {_(' panel.')} - + + {({setPanel}) => ( + + {_('You can style and position your axes in the ')} + setPanel('Structure', 'Subplots')}>{_('Subplots')} + {_(' panel.')} + + )} + ); } @@ -164,13 +164,7 @@ UnconnectedAxesCreator.propTypes = { fullContainer: PropTypes.object, }; -UnconnectedAxesCreator.contextTypes = { - data: PropTypes.array, - fullData: PropTypes.array, - fullLayout: PropTypes.object, - localize: PropTypes.func, - setPanel: PropTypes.func, -}; +UnconnectedAxesCreator.contextType = EditorControlsContext; export default connectToContainer(UnconnectedAxesCreator, { modifyPlotProps: (props, context, plotProps) => { diff --git a/src/components/fields/ErrorBars.js b/src/components/fields/ErrorBars.js index 9095851c2..54bab2abc 100644 --- a/src/components/fields/ErrorBars.js +++ b/src/components/fields/ErrorBars.js @@ -4,6 +4,7 @@ import {DataSelector, Radio, Numeric, MultiColorPicker} from '../index'; import RadioBlocks from '../widgets/RadioBlocks'; import Field from './Field'; import {connectToContainer} from 'lib'; +import {EditorControlsContext} from '../../context'; class ErrorBars extends Component { constructor(props, context) { @@ -157,7 +158,7 @@ class ErrorBars extends Component { render() { return ( - + Field {this.renderModeSelector()} {this.renderErrorBarControls()} @@ -171,8 +172,6 @@ ErrorBars.propTypes = { updatePlot: PropTypes.func, }; -ErrorBars.contextTypes = { - localize: PropTypes.func, -}; +ErrorBars.contextType = EditorControlsContext; export default connectToContainer(ErrorBars); diff --git a/src/components/fields/GroupCreator.js b/src/components/fields/GroupCreator.js index e7fb7ff25..c4a279679 100644 --- a/src/components/fields/GroupCreator.js +++ b/src/components/fields/GroupCreator.js @@ -6,6 +6,7 @@ import PropTypes from 'prop-types'; import Button from '../widgets/Button'; import {PlusIcon} from 'plotly-icons'; import {MULTI_VALUED} from 'lib/constants'; +import {EditorControlsContext} from '../../context'; class UnconnectedGroupCreator extends Component { getAllGroups() { @@ -75,10 +76,6 @@ UnconnectedGroupCreator.propTypes = { ...Field.propTypes, }; -UnconnectedGroupCreator.contextTypes = { - localize: PropTypes.func, - data: PropTypes.array, - fullData: PropTypes.array, -}; +UnconnectedGroupCreator.contextType = EditorControlsContext; export default connectToContainer(UnconnectedGroupCreator); diff --git a/src/components/fields/SubplotCreator.js b/src/components/fields/SubplotCreator.js index 45e4bd186..09e87b1cb 100644 --- a/src/components/fields/SubplotCreator.js +++ b/src/components/fields/SubplotCreator.js @@ -7,6 +7,7 @@ import Button from '../widgets/Button'; import {PlusIcon} from 'plotly-icons'; import {connectToContainer, traceTypeToAxisType, getSubplotTitle} from 'lib'; import {PlotlySection} from 'components'; +import {EditorControlsContext, ModalProviderContext} from '../../context'; class UnconnectedSingleSubplotCreator extends Component { canAddSubplot() { @@ -91,12 +92,7 @@ UnconnectedSingleSubplotCreator.propTypes = { updateContainer: PropTypes.func, }; -UnconnectedSingleSubplotCreator.contextTypes = { - fullLayout: PropTypes.object, - data: PropTypes.array, - fullData: PropTypes.array, - onUpdate: PropTypes.func, -}; +UnconnectedSingleSubplotCreator.contextType = EditorControlsContext; const SingleSubplotCreator = connectToContainer(UnconnectedSingleSubplotCreator); @@ -130,11 +126,15 @@ class UnconnectedSubplotCreator extends Component { label={SUBPLOT_TO_ATTR[subplotType].layout} options={getOptions(subplotType)} /> - - {_('You can style and position your subplots in the ')} - this.context.setPanel('Structure', 'Subplots')}>{_('Subplots')} - {_(' panel.')} - + + {({setPanel}) => ( + + {_('You can style and position your subplots in the ')} + setPanel('Structure', 'Subplots')}>{_('Subplots')} + {_(' panel.')} + + )} + ); } @@ -145,13 +145,7 @@ UnconnectedSubplotCreator.propTypes = { fullContainer: PropTypes.object, }; -UnconnectedSubplotCreator.contextTypes = { - data: PropTypes.array, - fullData: PropTypes.array, - fullLayout: PropTypes.object, - localize: PropTypes.func, - setPanel: PropTypes.func, -}; +UnconnectedSubplotCreator.contextType = EditorControlsContext; export default connectToContainer(UnconnectedSubplotCreator, { modifyPlotProps: (props, context, plotProps) => { diff --git a/src/components/fields/TextEditor.js b/src/components/fields/TextEditor.js index a85008401..4231c245b 100644 --- a/src/components/fields/TextEditor.js +++ b/src/components/fields/TextEditor.js @@ -6,6 +6,7 @@ import LaTeX from '../widgets/text_editors/LaTeX'; import RichText from '../widgets/text_editors/RichText'; import MultiFormat from '../widgets/text_editors/MultiFormat'; import HTML from '../widgets/text_editors/HTML'; +import {EditorControlsContext} from '../../context'; class UnconnectedTextEditor extends Component { render() { @@ -60,9 +61,7 @@ UnconnectedTextEditor.propTypes = { updatePlot: PropTypes.func, }; -UnconnectedTextEditor.contextTypes = { - localize: PropTypes.func, -}; +UnconnectedTextEditor.contextType = EditorControlsContext; export default connectToContainer(UnconnectedTextEditor, { modifyPlotProps: (props, context, plotProps) => { diff --git a/src/components/fields/TraceSelector.js b/src/components/fields/TraceSelector.js index 0305cac42..e40298842 100644 --- a/src/components/fields/TraceSelector.js +++ b/src/components/fields/TraceSelector.js @@ -11,6 +11,7 @@ import {TRACES_WITH_GL} from 'lib/constants'; import {TraceTypeSelector, TraceTypeSelectorButton, RadioBlocks} from 'components/widgets'; import Field from './Field'; import {CogIcon} from 'plotly-icons'; +import {EditorControlsContext, ModalProviderContext} from '../../context'; class TraceSelector extends Component { constructor(props, context) { @@ -111,17 +112,21 @@ class TraceSelector extends Component { alignItems: 'center', }} > - - this.context.openModal(TraceTypeSelector, { - ...props, - traceTypesConfig: this.context.traceTypesConfig, - glByDefault: this.context.glByDefault, - }) - } - /> + + {({openModal}) => ( + + openModal(TraceTypeSelector, { + ...props, + traceTypesConfig: this.context.traceTypesConfig, + glByDefault: this.context.glByDefault, + }) + } + /> + )} + {!TRACES_WITH_GL.includes(this.props.container.type) ? ( '' ) : ( @@ -148,15 +153,7 @@ class TraceSelector extends Component { } } -TraceSelector.contextTypes = { - openModal: PropTypes.func, - advancedTraceTypeSelector: PropTypes.bool, - traceTypesConfig: PropTypes.object, - plotSchema: PropTypes.object, - config: PropTypes.object, - localize: PropTypes.func, - glByDefault: PropTypes.bool, -}; +TraceSelector.contextType = EditorControlsContext; TraceSelector.propTypes = { container: PropTypes.object.isRequired, diff --git a/src/components/fields/UpdateMenuButtons.js b/src/components/fields/UpdateMenuButtons.js index 3edf503b5..1682242f7 100644 --- a/src/components/fields/UpdateMenuButtons.js +++ b/src/components/fields/UpdateMenuButtons.js @@ -3,6 +3,7 @@ import React, {Component} from 'react'; import {Dropdown, TextEditor} from '../index'; import Field from './Field'; import {connectToContainer} from 'lib'; +import {EditorControlsContext} from '../../context'; class UpdateMenuButtons extends Component { constructor(props, context) { @@ -45,8 +46,6 @@ UpdateMenuButtons.propTypes = { updatePlot: PropTypes.func, }; -UpdateMenuButtons.contextTypes = { - localize: PropTypes.func, -}; +UpdateMenuButtons.contextType = EditorControlsContext; export default connectToContainer(UpdateMenuButtons); diff --git a/src/components/widgets/ColorscalePicker.js b/src/components/widgets/ColorscalePicker.js index 5d40b917b..5255aac96 100644 --- a/src/components/widgets/ColorscalePicker.js +++ b/src/components/widgets/ColorscalePicker.js @@ -3,6 +3,7 @@ import Dropdown from './Dropdown'; import Info from '../fields/Info'; import PropTypes from 'prop-types'; import React, {Component, Fragment} from 'react'; +import {EditorControlsContext} from '../../context'; class Scale extends Component { constructor(props) { @@ -81,8 +82,6 @@ Scale.propTypes = { initialCategory: PropTypes.string, }; -Scale.contextTypes = { - localize: PropTypes.func, -}; +Scale.contextType = EditorControlsContext; export default Scale; diff --git a/src/components/widgets/Dropdown.js b/src/components/widgets/Dropdown.js index 3de20f193..2b1a49eec 100644 --- a/src/components/widgets/Dropdown.js +++ b/src/components/widgets/Dropdown.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import Select from 'react-select'; import classnames from 'classnames'; +import {EditorControlsContext} from '../../context'; class Dropdown extends Component { constructor(props) { @@ -111,8 +112,6 @@ Dropdown.propTypes = { width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; -Dropdown.contextTypes = { - localize: PropTypes.func, -}; +Dropdown.contextType = EditorControlsContext; export default Dropdown; diff --git a/src/components/widgets/Dropzone.js b/src/components/widgets/Dropzone.js index 4fa9da2ae..9fac8d18f 100644 --- a/src/components/widgets/Dropzone.js +++ b/src/components/widgets/Dropzone.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import Drop from 'react-dropzone'; +import {EditorControlsContext} from '../../context'; class Dropzone extends Component { constructor(props, context) { @@ -154,8 +155,6 @@ Dropzone.propTypes = { value: PropTypes.any, }; -Dropzone.contextTypes = { - localize: PropTypes.func, -}; +Dropzone.contextType = EditorControlsContext; export default Dropzone; diff --git a/src/components/widgets/TraceTypeSelector.js b/src/components/widgets/TraceTypeSelector.js index d249d19b2..e69a99e77 100644 --- a/src/components/widgets/TraceTypeSelector.js +++ b/src/components/widgets/TraceTypeSelector.js @@ -4,6 +4,7 @@ import {SearchIcon, ThumnailViewIcon, GraphIcon} from 'plotly-icons'; import Modal from 'components/containers/Modal'; import {traceTypeToPlotlyInitFigure, renderTraceIcon, plotlyTraceToCustomTrace} from 'lib'; import {TRACES_WITH_GL} from 'lib/constants'; +import {EditorControlsContext} from '../../context'; const renderActionItems = (actionItems, item) => actionItems @@ -60,9 +61,7 @@ Item.propTypes = { actions: PropTypes.func, showActions: PropTypes.bool, }; -Item.contextTypes = { - localize: PropTypes.func, -}; +Item.contextType = EditorControlsContext; class TraceTypeSelector extends Component { constructor(props) { @@ -269,8 +268,6 @@ TraceTypeSelectorButton.propTypes = { container: PropTypes.object, traceTypesConfig: PropTypes.object.isRequired, }; -TraceTypeSelectorButton.contextTypes = { - localize: PropTypes.func, -}; +TraceTypeSelectorButton.contextType = EditorControlsContext; export default TraceTypeSelector; diff --git a/src/components/widgets/text_editors/MultiFormat.js b/src/components/widgets/text_editors/MultiFormat.js index 9b02f354e..ac265dd76 100644 --- a/src/components/widgets/text_editors/MultiFormat.js +++ b/src/components/widgets/text_editors/MultiFormat.js @@ -6,6 +6,7 @@ import RichTextEditor from './RichText'; import {isLaTeXExpr, htmlToLaTeX, laTeXToHTML, hasTextExpression} from './convertFormats'; import classnames from 'classnames'; import Button from 'components/widgets/Button'; +import {EditorControlsContext} from '../../../context'; class MultiFormatTextEditor extends Component { constructor(props, context) { @@ -278,8 +279,6 @@ MultiFormatTextEditor.defaultProps = { value: '', }; -MultiFormatTextEditor.contextTypes = { - localize: PropTypes.func, -}; +MultiFormatTextEditor.contextType = EditorControlsContext; export default MultiFormatTextEditor; diff --git a/src/components/widgets/text_editors/RichText/LinkEditor.js b/src/components/widgets/text_editors/RichText/LinkEditor.js index 6b0b2cebd..bf1956a9b 100644 --- a/src/components/widgets/text_editors/RichText/LinkEditor.js +++ b/src/components/widgets/text_editors/RichText/LinkEditor.js @@ -7,6 +7,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {RETURN_KEY, ESCAPE_KEY} from 'lib/constants'; import {findDOMNode} from 'react-dom'; +import {EditorControlsContext} from '../../../../context'; class LinkEditor extends Component { constructor(props) { @@ -128,8 +129,6 @@ LinkEditor.defaultProps = { }, }; -LinkEditor.contextTypes = { - localize: PropTypes.func.isRequired, -}; +LinkEditor.contextType = EditorControlsContext; export default LinkEditor; diff --git a/src/default_panels/GraphCreatePanel.js b/src/default_panels/GraphCreatePanel.js index 6cfd2df5a..23a4415d3 100644 --- a/src/default_panels/GraphCreatePanel.js +++ b/src/default_panels/GraphCreatePanel.js @@ -17,148 +17,163 @@ import { HistogramInfoHorizontal, Histogram2d, } from '../components/fields/derived'; +import {EditorControlsContext, ModalProviderContext} from '../context'; -const GraphCreatePanel = (props, {localize: _, setPanel}) => { +const GraphCreatePanel = () => { return ( - - !(t.transforms && t.transforms.some(tr => ['fit', 'moving-average'].includes(tr.type))) - } - > - + + {({localize: _}) => ( + + {({setPanel}) => ( + + !( + t.transforms && + t.transforms.some(tr => ['fit', 'moving-average'].includes(tr.type)) + ) + } + > + - + - - + + - - - - - - {_( - 'Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the ' - )} - setPanel('Style', 'Traces')}>{_('Traces')} - {_( - ' panel under Style. If Y values are omitted, the histogram function defaults to Count.' - )} - - - {_( - 'Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the ' - )} - setPanel('Style', 'Traces')}>{_('Traces')} - {_( - ' under Style panel. If X values are omitted, the histogram function defaults to Count.' - )} - - - {_( - 'Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the ' - )} - setPanel('Style', 'Traces')}>{_('Traces')} - {_( - ' under Style panel. If Z values are omitted, the histogram function defaults to Count.' - )} - - - - - - - - - - - - - - - - - - - + + + + + + {_( + 'Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the ' + )} + setPanel('Style', 'Traces')}>{_('Traces')} + {_( + ' panel under Style. If Y values are omitted, the histogram function defaults to Count.' + )} + + + {_( + 'Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the ' + )} + setPanel('Style', 'Traces')}>{_('Traces')} + {_( + ' under Style panel. If X values are omitted, the histogram function defaults to Count.' + )} + + + {_( + 'Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the ' + )} + setPanel('Style', 'Traces')}>{_('Traces')} + {_( + ' under Style panel. If Z values are omitted, the histogram function defaults to Count.' + )} + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - - - + + + + + + + + )} + + )} + ); }; export default GraphCreatePanel; -GraphCreatePanel.contextTypes = { - localize: PropTypes.func, - setPanel: PropTypes.func, -}; +// GraphCreatePanel.contextTypes = { +// localize: PropTypes.func, +// setPanel: PropTypes.func, +// }; diff --git a/src/default_panels/GraphSubplotsPanel.js b/src/default_panels/GraphSubplotsPanel.js index 473ac788d..80a8fe44b 100644 --- a/src/default_panels/GraphSubplotsPanel.js +++ b/src/default_panels/GraphSubplotsPanel.js @@ -16,220 +16,228 @@ import { NumericFraction, } from '../components'; import {TRACE_TO_AXIS} from '../lib/constants'; +import {EditorControlsContext} from '../context'; -const GraphSubplotsPanel = (props, {localize: _}) => ( - - - - - +const GraphSubplotsPanel = () => ( + + {({localize: _}) => ( + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - + + + - - - - + + + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - - - + + + - - - - - - + + + + + + + )} + ); -GraphSubplotsPanel.contextTypes = { - localize: PropTypes.func, -}; +// GraphSubplotsPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default GraphSubplotsPanel; diff --git a/src/default_panels/GraphTransformsPanel.js b/src/default_panels/GraphTransformsPanel.js index 38592174e..717dceed5 100644 --- a/src/default_panels/GraphTransformsPanel.js +++ b/src/default_panels/GraphTransformsPanel.js @@ -14,6 +14,7 @@ import {connectAggregationToTransform} from '../lib'; import {TRANSFORMABLE_TRACES} from 'lib/constants'; const AggregationSection = connectAggregationToTransform(PlotlySection); +import {EditorControlsContext} from '../context'; export class Aggregations extends Component { render() { @@ -64,37 +65,41 @@ Aggregations.contextTypes = { localize: PropTypes.func, }; -const GraphTransformsPanel = (props, {localize: _}) => { +const GraphTransformsPanel = () => { return ( - TRANSFORMABLE_TRACES.includes(t.type)}> - - + + {({localize: _}) => ( + TRANSFORMABLE_TRACES.includes(t.type)}> + + - + - - - + + + - + - - - + + + + )} + ); }; -GraphTransformsPanel.contextTypes = { - localize: PropTypes.func, -}; +// GraphTransformsPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default GraphTransformsPanel; diff --git a/src/default_panels/StyleColorbarsPanel.js b/src/default_panels/StyleColorbarsPanel.js index ae3527834..b8431e003 100644 --- a/src/default_panels/StyleColorbarsPanel.js +++ b/src/default_panels/StyleColorbarsPanel.js @@ -15,256 +15,291 @@ import { ColorPicker, VisibilitySelect, } from '../components'; +import {EditorControlsContext} from '../context'; export const traceHasColorbar = (trace, fullTrace) => (fullTrace.marker && fullTrace.marker.showscale !== undefined) || // eslint-disable-line no-undefined fullTrace.showscale !== undefined; // eslint-disable-line no-undefined -const StyleColorBarsPanel = (props, {localize: _}) => { +const StyleColorBarsPanel = () => { return ( - - {['', 'marker.'].map(prefix => { - return ( - - - - + + {({localize: _}) => ( + + {['', 'marker.'].map(prefix => { + return ( + + + + - - - - - - - - + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - ); - })} - + + + + + + + + + + + + + + + + + + + ); + })} + + )} + ); }; -StyleColorBarsPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleColorBarsPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleColorBarsPanel; diff --git a/src/default_panels/StyleImagesPanel.js b/src/default_panels/StyleImagesPanel.js index e7feae8be..b1b748a33 100644 --- a/src/default_panels/StyleImagesPanel.js +++ b/src/default_panels/StyleImagesPanel.js @@ -9,67 +9,72 @@ import { PositioningRef, Dropdown, } from '../components'; +import {EditorControlsContext} from '../context'; -const StyleImagesPanel = (props, {localize: _}) => ( - - +const StyleImagesPanel = () => ( + + {({localize: _}) => ( + + - + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + + )} + ); -StyleImagesPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleImagesPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleImagesPanel; diff --git a/src/default_panels/StyleLayoutPanel.js b/src/default_panels/StyleLayoutPanel.js index 040816ceb..34d56a519 100644 --- a/src/default_panels/StyleLayoutPanel.js +++ b/src/default_panels/StyleLayoutPanel.js @@ -16,132 +16,137 @@ import { Radio, } from '../components'; import {HoverColor} from '../components/fields/derived'; +import {EditorControlsContext} from '../context'; -const StyleLayoutPanel = (props, {localize: _}) => ( - - - - - - - - - - +const StyleLayoutPanel = () => ( + + {({localize: _}) => ( + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} + ); -StyleLayoutPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleLayoutPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleLayoutPanel; diff --git a/src/default_panels/StyleLegendPanel.js b/src/default_panels/StyleLegendPanel.js index b650789f0..03f502678 100644 --- a/src/default_panels/StyleLegendPanel.js +++ b/src/default_panels/StyleLegendPanel.js @@ -10,76 +10,81 @@ import { Dropdown, TraceRequiredPanel, } from '../components'; +import {EditorControlsContext} from '../context'; -const StyleLegendPanel = (props, {localize: _}) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const StyleLegendPanel = () => ( + + {({localize: _}) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} + ); -StyleLegendPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleLegendPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleLegendPanel; diff --git a/src/default_panels/StyleNotesPanel.js b/src/default_panels/StyleNotesPanel.js index 1eef7af10..e493a6a9b 100644 --- a/src/default_panels/StyleNotesPanel.js +++ b/src/default_panels/StyleNotesPanel.js @@ -14,65 +14,70 @@ import { TextEditor, PlotlySection, } from '../components'; +import {EditorControlsContext} from '../context'; -const StyleNotesPanel = (props, {localize: _}) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const StyleNotesPanel = () => ( + + {({localize: _}) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} + ); -StyleNotesPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleNotesPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleNotesPanel; diff --git a/src/default_panels/StyleShapesPanel.js b/src/default_panels/StyleShapesPanel.js index ff6ca1335..f4e2bb870 100644 --- a/src/default_panels/StyleShapesPanel.js +++ b/src/default_panels/StyleShapesPanel.js @@ -11,47 +11,52 @@ import { ColorPicker, LineDashSelector, } from '../components'; +import {EditorControlsContext} from '../context'; -const StyleShapesPanel = (props, {localize: _}) => ( - - - +const StyleShapesPanel = () => ( + + {({localize: _}) => ( + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + )} + ); -StyleShapesPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleShapesPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleShapesPanel; diff --git a/src/default_panels/StyleSlidersPanel.js b/src/default_panels/StyleSlidersPanel.js index 1791acb02..b7e557457 100644 --- a/src/default_panels/StyleSlidersPanel.js +++ b/src/default_panels/StyleSlidersPanel.js @@ -9,77 +9,82 @@ import { Dropdown, SliderAccordion, } from '../components'; +import {EditorControlsContext} from '../context'; -const StyleSlidersPanel = (props, {localize: _}) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const StyleSlidersPanel = () => ( + + {({localize: _}) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} + ); -StyleSlidersPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleSlidersPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleSlidersPanel; diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index c42329f05..f934185ba 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -39,622 +39,636 @@ import { TextInfo, HoveronDropdown, } from '../components/fields/derived'; +import {EditorControlsContext} from '../context'; -const StyleTracesPanel = (props, {localize: _}) => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const StyleTracesPanel = () => ( + + {({localize: _}) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - - - - + + + + + )} + ); -StyleTracesPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleTracesPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleTracesPanel; diff --git a/src/default_panels/StyleUpdateMenusPanel.js b/src/default_panels/StyleUpdateMenusPanel.js index f8d1bb00d..203e288ed 100644 --- a/src/default_panels/StyleUpdateMenusPanel.js +++ b/src/default_panels/StyleUpdateMenusPanel.js @@ -10,67 +10,72 @@ import { VisibilitySelect, Radio, } from '../components'; +import {EditorControlsContext} from '../context'; -const StyleUpdateMenusPanel = (props, {localize: _}) => ( - - - - - - - - - - - - - - - - - +const StyleUpdateMenusPanel = () => ( + + {({localize: _}) => ( + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + )} + ); -StyleUpdateMenusPanel.contextTypes = { - localize: PropTypes.func, -}; +// StyleUpdateMenusPanel.contextTypes = { +// localize: PropTypes.func, +// }; export default StyleUpdateMenusPanel; diff --git a/src/index.js b/src/index.js index f53cee550..a29cbca25 100644 --- a/src/index.js +++ b/src/index.js @@ -20,6 +20,13 @@ import { walkObject, } from './lib'; import {EDITOR_ACTIONS} from './lib/constants'; +import { + EditorControlsContext, + PanelMenuWrapperContext, + ModalProviderContext, + PlotlyFoldContext, + PlotlyPanelContext, +} from './context'; import { AnnotationAccordion, @@ -179,6 +186,11 @@ export { EditorControls, DefaultEditor, RectanglePositioner, + EditorControlsContext, + PanelMenuWrapperContext, + ModalProviderContext, + PlotlyFoldContext, + PlotlyPanelContext, }; export default PlotlyEditor; diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index e7bfb8367..4d58ef80e 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -10,7 +10,6 @@ import { } from '../lib'; import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {EDITOR_ACTIONS, SUBPLOT_TO_ATTR} from 'lib/constants'; -import {ConnectTraceToPlotContext} from '../context'; export default function connectTraceToPlot(WrappedComponent) { class TraceConnectedComponent extends Component { @@ -183,11 +182,7 @@ export default function connectTraceToPlot(WrappedComponent) { } render() { - return ( - - ; - - ); + return ; } } From 58ca319881433dc9751b2d0b564c2fb819e43ab6 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 11 Nov 2018 21:59:23 +0900 Subject: [PATCH 05/69] fix eslint --- src/components/fields/ErrorBars.js | 3 ++- src/default_panels/GraphCreatePanel.js | 2 +- src/default_panels/GraphSubplotsPanel.js | 2 +- src/default_panels/StyleColorbarsPanel.js | 2 +- src/default_panels/StyleImagesPanel.js | 2 +- src/default_panels/StyleLayoutPanel.js | 2 +- src/default_panels/StyleLegendPanel.js | 2 +- src/default_panels/StyleNotesPanel.js | 2 +- src/default_panels/StyleShapesPanel.js | 2 +- src/default_panels/StyleSlidersPanel.js | 2 +- src/default_panels/StyleTracesPanel.js | 2 +- src/default_panels/StyleUpdateMenusPanel.js | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/fields/ErrorBars.js b/src/components/fields/ErrorBars.js index 54bab2abc..b630cd871 100644 --- a/src/components/fields/ErrorBars.js +++ b/src/components/fields/ErrorBars.js @@ -158,7 +158,8 @@ class ErrorBars extends Component { render() { return ( - Field + + Field {this.renderModeSelector()} {this.renderErrorBarControls()} diff --git a/src/default_panels/GraphCreatePanel.js b/src/default_panels/GraphCreatePanel.js index 23a4415d3..320bebea8 100644 --- a/src/default_panels/GraphCreatePanel.js +++ b/src/default_panels/GraphCreatePanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { DataSelector, Dropdown, diff --git a/src/default_panels/GraphSubplotsPanel.js b/src/default_panels/GraphSubplotsPanel.js index 80a8fe44b..09a7f471c 100644 --- a/src/default_panels/GraphSubplotsPanel.js +++ b/src/default_panels/GraphSubplotsPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { SubplotAccordion, RectanglePositioner, diff --git a/src/default_panels/StyleColorbarsPanel.js b/src/default_panels/StyleColorbarsPanel.js index b8431e003..b0196f168 100644 --- a/src/default_panels/StyleColorbarsPanel.js +++ b/src/default_panels/StyleColorbarsPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { Radio, diff --git a/src/default_panels/StyleImagesPanel.js b/src/default_panels/StyleImagesPanel.js index b1b748a33..915cf164f 100644 --- a/src/default_panels/StyleImagesPanel.js +++ b/src/default_panels/StyleImagesPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { ImageAccordion, Radio, diff --git a/src/default_panels/StyleLayoutPanel.js b/src/default_panels/StyleLayoutPanel.js index 34d56a519..f409e1186 100644 --- a/src/default_panels/StyleLayoutPanel.js +++ b/src/default_panels/StyleLayoutPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { ColorPicker, ColorwayPicker, diff --git a/src/default_panels/StyleLegendPanel.js b/src/default_panels/StyleLegendPanel.js index 03f502678..2780084b3 100644 --- a/src/default_panels/StyleLegendPanel.js +++ b/src/default_panels/StyleLegendPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { ColorPicker, FontSelector, diff --git a/src/default_panels/StyleNotesPanel.js b/src/default_panels/StyleNotesPanel.js index e493a6a9b..83eb24c50 100644 --- a/src/default_panels/StyleNotesPanel.js +++ b/src/default_panels/StyleNotesPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { AnnotationArrowRef, AnnotationRef, diff --git a/src/default_panels/StyleShapesPanel.js b/src/default_panels/StyleShapesPanel.js index f4e2bb870..b8b74c23c 100644 --- a/src/default_panels/StyleShapesPanel.js +++ b/src/default_panels/StyleShapesPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { ShapeAccordion, Radio, diff --git a/src/default_panels/StyleSlidersPanel.js b/src/default_panels/StyleSlidersPanel.js index b7e557457..19a5490d3 100644 --- a/src/default_panels/StyleSlidersPanel.js +++ b/src/default_panels/StyleSlidersPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { ColorPicker, FontSelector, diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index f934185ba..ece23680f 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { Flaglist, diff --git a/src/default_panels/StyleUpdateMenusPanel.js b/src/default_panels/StyleUpdateMenusPanel.js index 203e288ed..311f3cfd1 100644 --- a/src/default_panels/StyleUpdateMenusPanel.js +++ b/src/default_panels/StyleUpdateMenusPanel.js @@ -1,5 +1,5 @@ import React from 'react'; -import PropTypes from 'prop-types'; +// import PropTypes from 'prop-types'; import { ColorPicker, FontSelector, From abb529c789f10dcb1f6191b13330bbcd6ee2c09a Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 11 Nov 2018 22:16:08 +0900 Subject: [PATCH 06/69] remove test:jswatch --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index c9a789413..4f3ae96fe 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,6 @@ "start": "webpack-dev-server --hot", "test": "npm run test:lint && npm run test:pretty && npm run test:js", "test:js": "jest --setupTestFrameworkScriptFile=raf/polyfill", - "test:jswatch": "jest --watchAll --setupTestFrameworkScriptFile=raf/polyfill", "test:lint": "eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:pretty": "prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:percy": "react-percy", From a63e23441fddff95d902e36c977b2b25305216f6 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 11 Nov 2018 22:40:52 +0900 Subject: [PATCH 07/69] change peerDependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 95ff2be4f..4aeba9a8b 100644 --- a/package.json +++ b/package.json @@ -78,8 +78,8 @@ "webpack-dev-server": "^2.11.1" }, "peerDependencies": { - "react": ">16.6.0", - "react-dom": ">16.6.0" + "react": ">=16.6.0", + "react-dom": ">=16.6.0" }, "homepage": "https://plotly.github.io/react-chart-editor/", "jest": { From f7239bc1995a7383abc0c20e9488270d85ec8968 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 11 Nov 2018 23:17:23 +0900 Subject: [PATCH 08/69] update webpack 4 and webpack-dev-server v3 --- package.json | 7 ++++--- webpack.config.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4aeba9a8b..017e3655f 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "fast-isnumeric": "^1.1.1", "immutability-helper": "^2.7.1", "plotly-icons": "1.2.2", - "plotly.js": "1.42.1", + "plotly.js": "^1.42.5", "prop-types": "^15.5.10", "raf": "^3.4.0", "react-color": "^2.13.8", @@ -74,8 +74,9 @@ "rimraf": "2.6.2", "sass-loader": "^7.1.0", "style-loader": "^0.23.0", - "webpack": "^3.10.0", - "webpack-dev-server": "^2.11.1" + "webpack": "^4.25.1", + "webpack-cli": "^3.1.2", + "webpack-dev-server": "^3.1.10" }, "peerDependencies": { "react": ">=16.6.0", diff --git a/webpack.config.js b/webpack.config.js index f540c3f3f..a77f24a12 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ const webpack = require('webpack'); module.exports = { + mode: 'development', entry: ['babel-polyfill', 'react-hot-loader/patch', './dev/index.js'], output: { filename: 'bundle.js', From ff83b6fc9d12256192d63d34b6609f1a5728d8b2 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 00:13:58 +0900 Subject: [PATCH 09/69] make:lib --- .../combined-translation-keys.txt | 958 +++++++++--------- scripts/translationKeys/translation-keys.txt | 958 +++++++++--------- 2 files changed, 958 insertions(+), 958 deletions(-) diff --git a/scripts/translationKeys/combined-translation-keys.txt b/scripts/translationKeys/combined-translation-keys.txt index 897d95718..708e04ea4 100644 --- a/scripts/translationKeys/combined-translation-keys.txt +++ b/scripts/translationKeys/combined-translation-keys.txt @@ -1,14 +1,14 @@ # // react-chart-editor: /default_panels/StyleAxesPanel.js:210 $ // react-chart-editor: /default_panels/StyleAxesPanel.js:209 % // react-chart-editor: /components/fields/derived.js:509 -1 234,56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:35 -1 234.56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:34 -1,234.56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:33 -1.234,56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:36 +1 234,56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:38 +1 234.56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:37 +1,234.56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:36 +1.234,56 // react-chart-editor: /default_panels/StyleLayoutPanel.js:39 135 // react-chart-editor: /default_panels/StyleAxesPanel.js:162 180 // react-chart-editor: /default_panels/StyleAxesPanel.js:163 -1:110,000,000 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:211 -1:50,000,000 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:211 +1:110,000,000 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:215 +1:50,000,000 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:216 2D Contour Histogram // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:33 2D Histogram // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:29 3D // react-chart-editor: /lib/traceTypes.js:33 @@ -21,123 +21,123 @@ $ 90 // react-chart-editor: /default_panels/StyleAxesPanel.js:161 @ // react-chart-editor: /default_panels/StyleAxesPanel.js:211 A // react-chart-editor: /components/fields/derived.js:551 -Above // react-chart-editor: /default_panels/StyleImagesPanel.js:35 +Above // react-chart-editor: /default_panels/StyleImagesPanel.js:38 Active Color // react-chart-editor: /default_panels/StyleAxesPanel.js:348 -Active Icon Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:58 -Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest. // react-chart-editor: /components/containers/ShapeAccordion.js:58 +Active Icon Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:61 +Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest. // react-chart-editor: /components/containers/ShapeAccordion.js:59 Advanced (d3-format) // react-chart-editor: /components/fields/derived.js:152 Advanced (d3-time-format) // react-chart-editor: /components/fields/derived.js:146 -Africa // react-chart-editor: /default_panels/GraphSubplotsPanel.js:104 +Africa // react-chart-editor: /default_panels/GraphSubplotsPanel.js:107 Aggregate // react-chart-editor: /components/containers/TransformAccordion.js:23 -Aggregations // react-chart-editor: /default_panels/GraphTransformsPanel.js:29 -Aitoff // react-chart-editor: /default_panels/GraphSubplotsPanel.js:138 -Albers USA // react-chart-editor: /default_panels/GraphSubplotsPanel.js:119 +Aggregations // react-chart-editor: /default_panels/GraphTransformsPanel.js:30 +Aitoff // react-chart-editor: /default_panels/GraphSubplotsPanel.js:141 +Albers USA // react-chart-editor: /default_panels/GraphSubplotsPanel.js:122 All // react-chart-editor: /default_panels/StyleAxesPanel.js:196 All points in a trace are colored in the same color. // react-chart-editor: /components/fields/MarkerColor.js:168 All traces will be colored in the the same color. // react-chart-editor: /components/fields/MarkerColor.js:110 All will be colored in the same color. // react-chart-editor: /components/fields/MultiColorPicker.js:89 -Ambient // react-chart-editor: /default_panels/StyleTracesPanel.js:518 -Anchor // react-chart-editor: /default_panels/StyleColorbarsPanel.js:85 +Ambient // react-chart-editor: /default_panels/StyleTracesPanel.js:530 +Anchor // react-chart-editor: /default_panels/StyleColorbarsPanel.js:94 Anchor Point // react-chart-editor: /default_panels/StyleAxesPanel.js:354 -Anchor to // react-chart-editor: /default_panels/GraphSubplotsPanel.js:31 +Anchor to // react-chart-editor: /default_panels/GraphSubplotsPanel.js:34 Angle // react-chart-editor: /default_panels/StyleAxesPanel.js:155 -Annotation // react-chart-editor: /components/containers/AnnotationAccordion.js:27 +Annotation // react-chart-editor: /components/containers/AnnotationAccordion.js:28 AnnotationArrowRef must be given either "axref" or "ayref" as attrs. Instead was given // react-chart-editor: /components/fields/derived.js:332 AnnotationRef must be given either "xref" or "yref" as attrs. Instead was given // react-chart-editor: /components/fields/derived.js:379 -Annotations are text and arrows you can use to point out specific parts of your figure. // react-chart-editor: /components/containers/AnnotationAccordion.js:53 -Any // react-chart-editor: /default_panels/StyleLayoutPanel.js:97 -Area // react-chart-editor: /default_panels/StyleTracesPanel.js:263 -Arrow // react-chart-editor: /default_panels/StyleNotesPanel.js:27 -Arrowhead // react-chart-editor: /default_panels/StyleNotesPanel.js:34 -Ascending // react-chart-editor: /default_panels/GraphTransformsPanel.js:85 -Asia // react-chart-editor: /default_panels/GraphSubplotsPanel.js:103 -Aspect Ratio // react-chart-editor: /default_panels/GraphSubplotsPanel.js:39 -Asymmetric // react-chart-editor: /components/fields/ErrorBars.js:78 +Annotations are text and arrows you can use to point out specific parts of your figure. // react-chart-editor: /components/containers/AnnotationAccordion.js:54 +Any // react-chart-editor: /default_panels/StyleLayoutPanel.js:100 +Area // react-chart-editor: /default_panels/StyleTracesPanel.js:269 +Arrow // react-chart-editor: /default_panels/StyleNotesPanel.js:30 +Arrowhead // react-chart-editor: /default_panels/StyleNotesPanel.js:37 +Ascending // react-chart-editor: /default_panels/GraphTransformsPanel.js:88 +Asia // react-chart-editor: /default_panels/GraphSubplotsPanel.js:106 +Aspect Ratio // react-chart-editor: /default_panels/GraphSubplotsPanel.js:42 +Asymmetric // react-chart-editor: /components/fields/ErrorBars.js:79 Atlas Map // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:73 Auto // react-chart-editor: /components/fields/derived.js:494 Auto margins // react-chart-editor: /default_panels/StyleAxesPanel.js:147 Autoscale // plotly.js: components/modebar/buttons.js:150 -Average // react-chart-editor: /default_panels/GraphTransformsPanel.js:40 && react-chart-editor: /components/fields/derived.js:133 -Axes // react-chart-editor: /DefaultEditor.js:81 -Axes to Use // react-chart-editor: /components/fields/AxesCreator.js:150 +Average // react-chart-editor: /default_panels/GraphTransformsPanel.js:41 && react-chart-editor: /components/fields/derived.js:133 +Axes // react-chart-editor: /DefaultEditor.js:82 +Axes to Use // react-chart-editor: /components/fields/AxesCreator.js:146 AxesSelector must be nested within a connectAxesToPlot component // react-chart-editor: /components/fields/AxesSelector.js:13 -Axis // react-chart-editor: /components/fields/AxesCreator.js:142 +Axis // react-chart-editor: /components/fields/AxesCreator.js:138 Axis Background // react-chart-editor: /default_panels/StyleAxesPanel.js:128 Axis Line // react-chart-editor: /default_panels/StyleAxesPanel.js:80 Axis to Style // react-chart-editor: /components/fields/AxesSelector.js:44 -Azimuthal Equal Area // react-chart-editor: /default_panels/GraphSubplotsPanel.js:125 -Azimuthal Equidistant // react-chart-editor: /default_panels/GraphSubplotsPanel.js:127 +Azimuthal Equal Area // react-chart-editor: /default_panels/GraphSubplotsPanel.js:128 +Azimuthal Equidistant // react-chart-editor: /default_panels/GraphSubplotsPanel.js:130 B // react-chart-editor: /components/fields/derived.js:552 -Background // react-chart-editor: /default_panels/StyleSlidersPanel.js:19 +Background // react-chart-editor: /default_panels/StyleSlidersPanel.js:22 Background Color // react-chart-editor: /default_panels/StyleAxesPanel.js:300 Backward // react-chart-editor: /default_panels/StyleAxesPanel.js:337 -Bandwidth // react-chart-editor: /default_panels/StyleTracesPanel.js:571 +Bandwidth // react-chart-editor: /default_panels/StyleTracesPanel.js:583 Bar // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:17 -Bar Mode // react-chart-editor: /default_panels/GraphSubplotsPanel.js:65 -Bar Options // react-chart-editor: /default_panels/GraphSubplotsPanel.js:63 -Bar Padding // react-chart-editor: /default_panels/GraphSubplotsPanel.js:69 -Bar Position // react-chart-editor: /default_panels/StyleTracesPanel.js:206 -Bar Size and Spacing // react-chart-editor: /default_panels/StyleTracesPanel.js:273 -Bar Width // react-chart-editor: /default_panels/StyleTracesPanel.js:299 +Bar Mode // react-chart-editor: /default_panels/GraphSubplotsPanel.js:68 +Bar Options // react-chart-editor: /default_panels/GraphSubplotsPanel.js:66 +Bar Padding // react-chart-editor: /default_panels/GraphSubplotsPanel.js:72 +Bar Position // react-chart-editor: /default_panels/StyleTracesPanel.js:212 +Bar Size and Spacing // react-chart-editor: /default_panels/StyleTracesPanel.js:279 +Bar Width // react-chart-editor: /default_panels/StyleTracesPanel.js:305 Bars // react-chart-editor: /components/containers/TraceMarkerSection.js:19 -Base // react-chart-editor: /default_panels/StyleTracesPanel.js:207 -Base Colors // react-chart-editor: /default_panels/StyleLayoutPanel.js:25 -Basic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:77 -Bearing // react-chart-editor: /default_panels/GraphSubplotsPanel.js:91 -Below // react-chart-editor: /default_panels/StyleImagesPanel.js:35 -Binning // react-chart-editor: /default_panels/StyleTracesPanel.js:195 -Blank // react-chart-editor: /default_panels/StyleTracesPanel.js:427 -Border // react-chart-editor: /default_panels/StyleSlidersPanel.js:23 -Border Color // react-chart-editor: /default_panels/GraphSubplotsPanel.js:150 -Border Width // react-chart-editor: /default_panels/GraphSubplotsPanel.js:149 -Borders and Background // react-chart-editor: /default_panels/StyleColorbarsPanel.js:247 -Both // react-chart-editor: /default_panels/StyleTracesPanel.js:577 +Base // react-chart-editor: /default_panels/StyleTracesPanel.js:213 +Base Colors // react-chart-editor: /default_panels/StyleLayoutPanel.js:28 +Basic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:80 +Bearing // react-chart-editor: /default_panels/GraphSubplotsPanel.js:94 +Below // react-chart-editor: /default_panels/StyleImagesPanel.js:38 +Binning // react-chart-editor: /default_panels/StyleTracesPanel.js:201 +Blank // react-chart-editor: /default_panels/StyleTracesPanel.js:439 +Border // react-chart-editor: /default_panels/StyleSlidersPanel.js:26 +Border Color // react-chart-editor: /default_panels/GraphSubplotsPanel.js:153 +Border Width // react-chart-editor: /default_panels/GraphSubplotsPanel.js:152 +Borders and Background // react-chart-editor: /default_panels/StyleColorbarsPanel.js:268 +Both // react-chart-editor: /default_panels/StyleTracesPanel.js:589 Bottom // react-chart-editor: /components/fields/derived.js:96 Bottom Center // react-chart-editor: /components/fields/derived.js:487 Bottom Left // react-chart-editor: /components/fields/derived.js:486 Bottom Right // react-chart-editor: /components/fields/derived.js:488 -Boundaries // react-chart-editor: /default_panels/GraphSubplotsPanel.js:22 -Box // react-chart-editor: /default_panels/StyleTracesPanel.js:593 -Box Fill Color // react-chart-editor: /default_panels/StyleTracesPanel.js:599 -Box Line Color // react-chart-editor: /default_panels/StyleTracesPanel.js:601 -Box Line Width // react-chart-editor: /default_panels/StyleTracesPanel.js:600 -Box Mean // react-chart-editor: /default_panels/StyleTracesPanel.js:583 -Box Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:306 -Box Padding // react-chart-editor: /default_panels/StyleTracesPanel.js:311 +Boundaries // react-chart-editor: /default_panels/GraphSubplotsPanel.js:25 +Box // react-chart-editor: /default_panels/StyleTracesPanel.js:605 +Box Fill Color // react-chart-editor: /default_panels/StyleTracesPanel.js:611 +Box Line Color // react-chart-editor: /default_panels/StyleTracesPanel.js:613 +Box Line Width // react-chart-editor: /default_panels/StyleTracesPanel.js:612 +Box Mean // react-chart-editor: /default_panels/StyleTracesPanel.js:595 +Box Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:312 +Box Padding // react-chart-editor: /default_panels/StyleTracesPanel.js:320 Box Select // plotly.js: components/modebar/buttons.js:114 -Box Size and Spacing // react-chart-editor: /default_panels/StyleTracesPanel.js:303 -Box Width // react-chart-editor: /default_panels/StyleTracesPanel.js:310 +Box Size and Spacing // react-chart-editor: /default_panels/StyleTracesPanel.js:309 +Box Width // react-chart-editor: /default_panels/StyleTracesPanel.js:319 Boxes // react-chart-editor: /components/fields/derived.js:629 Boxes and Points // react-chart-editor: /components/fields/derived.js:631 -Button // react-chart-editor: /components/containers/RangeSelectorAccordion.js:38 -Button Labels // react-chart-editor: /default_panels/StyleUpdateMenusPanel.js:21 -Buttons // react-chart-editor: /components/containers/UpdateMenuAccordion.js:22 -By // react-chart-editor: /default_panels/GraphTransformsPanel.js:76 -By Type // react-chart-editor: /components/containers/TraceAccordion.js:166 +Button // react-chart-editor: /components/containers/RangeSelectorAccordion.js:39 +Button Labels // react-chart-editor: /default_panels/StyleUpdateMenusPanel.js:24 +Buttons // react-chart-editor: /components/containers/UpdateMenuAccordion.js:23 +By // react-chart-editor: /default_panels/GraphTransformsPanel.js:79 +By Type // react-chart-editor: /components/containers/TraceAccordion.js:167 C // react-chart-editor: /components/fields/derived.js:553 -Call out your data. // react-chart-editor: /components/containers/AnnotationAccordion.js:50 +Call out your data. // react-chart-editor: /components/containers/AnnotationAccordion.js:51 Candlestick // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:121 Canvas // react-chart-editor: /components/fields/derived.js:388 Carpet // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:105 Carpet Contour // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:113 Carpet Scatter // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:109 Categorical // react-chart-editor: /default_panels/StyleAxesPanel.js:50 -Cell Options // react-chart-editor: /default_panels/GraphCreatePanel.js:135 -Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:162 +Cell Options // react-chart-editor: /default_panels/GraphCreatePanel.js:146 +Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:168 Center // react-chart-editor: /default_panels/StyleAxesPanel.js:360 -Center Latitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:88 -Center Longitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:89 -Center of Mass // react-chart-editor: /default_panels/StyleTracesPanel.js:70 -Change // react-chart-editor: /default_panels/GraphTransformsPanel.js:49 -Charts like this by Plotly users. // react-chart-editor: /components/widgets/TraceTypeSelector.js:107 +Center Latitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:91 +Center Longitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:92 +Center of Mass // react-chart-editor: /default_panels/StyleTracesPanel.js:76 +Change // react-chart-editor: /default_panels/GraphTransformsPanel.js:50 +Charts like this by Plotly users. // react-chart-editor: /components/widgets/TraceTypeSelector.js:106 Choropleth // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:77 -Click // react-chart-editor: /default_panels/StyleLayoutPanel.js:105 -Click Event // react-chart-editor: /default_panels/StyleLayoutPanel.js:110 -Click on the + button above to add a shape. // react-chart-editor: /components/containers/ShapeAccordion.js:61 -Click on the + button above to add a trace. // react-chart-editor: /components/containers/TraceAccordion.js:127 +Click // react-chart-editor: /default_panels/StyleLayoutPanel.js:108 +Click Event // react-chart-editor: /default_panels/StyleLayoutPanel.js:113 +Click on the + button above to add a shape. // react-chart-editor: /components/containers/ShapeAccordion.js:62 +Click on the + button above to add a trace. // react-chart-editor: /components/containers/TraceAccordion.js:128 Click on the + button above to add a transform. // react-chart-editor: /components/containers/TransformAccordion.js:128 -Click on the + button above to add an annotation. // react-chart-editor: /components/containers/AnnotationAccordion.js:56 -Click on the + button above to add an image. // react-chart-editor: /components/containers/ImageAccordion.js:61 +Click on the + button above to add an annotation. // react-chart-editor: /components/containers/AnnotationAccordion.js:57 +Click on the + button above to add an image. // react-chart-editor: /components/containers/ImageAccordion.js:62 Click to enter Colorscale title // plotly.js: plots/plots.js:329 Click to enter Component A title // plotly.js: plots/ternary/ternary.js:424 Click to enter Component B title // plotly.js: plots/ternary/ternary.js:439 @@ -147,618 +147,618 @@ Click to enter X axis title Click to enter Y axis title // plotly.js: plots/plots.js:328 Click to enter radial axis title // plotly.js: plots/polar/polar.js:483 Clockwise // react-chart-editor: /components/fields/derived.js:102 -Close // react-chart-editor: /default_panels/GraphCreatePanel.js:98 +Close // react-chart-editor: /default_panels/GraphCreatePanel.js:106 Closest // react-chart-editor: /components/fields/derived.js:661 -Coastlines // react-chart-editor: /default_panels/GraphSubplotsPanel.js:160 +Coastlines // react-chart-editor: /default_panels/GraphSubplotsPanel.js:163 Collapse All // react-chart-editor: /components/containers/PanelHeader.js:35 -Color // react-chart-editor: /components/fields/ErrorBars.js:102 +Color // react-chart-editor: /components/fields/ErrorBars.js:103 Color Bar // react-chart-editor: /components/fields/MarkerColor.js:188 -Color Bar Container // react-chart-editor: /default_panels/StyleColorbarsPanel.js:252 -Color Bars // react-chart-editor: /DefaultEditor.js:83 -Coloring // react-chart-editor: /default_panels/StyleTracesPanel.js:340 -Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:79 -Colorscale // react-chart-editor: /default_panels/StyleTracesPanel.js:420 +Color Bar Container // react-chart-editor: /default_panels/StyleColorbarsPanel.js:277 +Color Bars // react-chart-editor: /DefaultEditor.js:84 +Coloring // react-chart-editor: /default_panels/StyleTracesPanel.js:352 +Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:85 +Colorscale // react-chart-editor: /default_panels/StyleTracesPanel.js:432 Colorscale Direction // react-chart-editor: /components/fields/MarkerColor.js:183 Colorscale Range // react-chart-editor: /components/fields/MarkerColor.js:193 -Column Options // react-chart-editor: /default_panels/GraphCreatePanel.js:141 -Columns // react-chart-editor: /default_panels/GraphCreatePanel.js:109 +Column Options // react-chart-editor: /default_panels/GraphCreatePanel.js:152 +Columns // react-chart-editor: /default_panels/GraphCreatePanel.js:117 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // react-chart-editor: /lib/constants.js:24 Compare data on hover // plotly.js: components/modebar/buttons.js:178 Cone // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:65 -Cone Anchor // react-chart-editor: /default_panels/StyleTracesPanel.js:65 -Cones & Streamtubes // react-chart-editor: /default_panels/StyleTracesPanel.js:57 -Conic Conformal // react-chart-editor: /default_panels/GraphSubplotsPanel.js:131 -Conic Equal Area // react-chart-editor: /default_panels/GraphSubplotsPanel.js:130 -Conic Equidistant // react-chart-editor: /default_panels/GraphSubplotsPanel.js:132 -Connect // react-chart-editor: /default_panels/StyleTracesPanel.js:427 -Connect Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:425 -Constant // react-chart-editor: /components/fields/ErrorBars.js:116 -Constraint // react-chart-editor: /default_panels/StyleTracesPanel.js:336 -Contain // react-chart-editor: /default_panels/StyleImagesPanel.js:26 -Continue // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:192 -Continuing will convert your LaTeX expression into raw text. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:111 -Continuing will convert your note to LaTeX-style text. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:106 -Continuing will remove your expression. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:116 +Cone Anchor // react-chart-editor: /default_panels/StyleTracesPanel.js:71 +Cones & Streamtubes // react-chart-editor: /default_panels/StyleTracesPanel.js:60 +Conic Conformal // react-chart-editor: /default_panels/GraphSubplotsPanel.js:134 +Conic Equal Area // react-chart-editor: /default_panels/GraphSubplotsPanel.js:133 +Conic Equidistant // react-chart-editor: /default_panels/GraphSubplotsPanel.js:135 +Connect // react-chart-editor: /default_panels/StyleTracesPanel.js:439 +Connect Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:437 +Constant // react-chart-editor: /components/fields/ErrorBars.js:117 +Constraint // react-chart-editor: /default_panels/StyleTracesPanel.js:348 +Contain // react-chart-editor: /default_panels/StyleImagesPanel.js:29 +Continue // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:193 +Continuing will convert your LaTeX expression into raw text. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:112 +Continuing will convert your note to LaTeX-style text. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:107 +Continuing will remove your expression. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:117 Contour // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:41 -Contour Color // react-chart-editor: /default_panels/StyleTracesPanel.js:625 -Contour Labels // react-chart-editor: /default_panels/StyleTracesPanel.js:356 -Contour Lines // react-chart-editor: /default_panels/StyleTracesPanel.js:351 -Contour Width // react-chart-editor: /default_panels/StyleTracesPanel.js:626 -Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:330 -Copy Y Style // react-chart-editor: /components/fields/ErrorBars.js:93 -Copy Z Style // react-chart-editor: /components/fields/ErrorBars.js:98 -Count // react-chart-editor: /default_panels/GraphTransformsPanel.js:38 && react-chart-editor: /components/fields/derived.js:131 +Contour Color // react-chart-editor: /default_panels/StyleTracesPanel.js:637 +Contour Labels // react-chart-editor: /default_panels/StyleTracesPanel.js:368 +Contour Lines // react-chart-editor: /default_panels/StyleTracesPanel.js:363 +Contour Width // react-chart-editor: /default_panels/StyleTracesPanel.js:638 +Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:342 +Copy Y Style // react-chart-editor: /components/fields/ErrorBars.js:94 +Copy Z Style // react-chart-editor: /components/fields/ErrorBars.js:99 +Count // react-chart-editor: /default_panels/GraphTransformsPanel.js:39 && react-chart-editor: /components/fields/derived.js:131 Counter Clockwise // react-chart-editor: /default_panels/StyleAxesPanel.js:73 Counterclockwise // react-chart-editor: /components/fields/derived.js:103 Country Abbreviations (ISO-3) // react-chart-editor: /components/fields/LocationSelector.js:32 -Country Borders // react-chart-editor: /default_panels/GraphSubplotsPanel.js:144 +Country Borders // react-chart-editor: /default_panels/GraphSubplotsPanel.js:147 Country Names // react-chart-editor: /components/fields/LocationSelector.js:31 -Crossbar Width // react-chart-editor: /components/fields/ErrorBars.js:104 -Cube // react-chart-editor: /default_panels/GraphSubplotsPanel.js:44 -Cumulative // react-chart-editor: /default_panels/StyleTracesPanel.js:119 -Current Bin // react-chart-editor: /default_panels/StyleTracesPanel.js:134 +Crossbar Width // react-chart-editor: /components/fields/ErrorBars.js:105 +Cube // react-chart-editor: /default_panels/GraphSubplotsPanel.js:47 +Cumulative // react-chart-editor: /default_panels/StyleTracesPanel.js:125 +Current Bin // react-chart-editor: /default_panels/StyleTracesPanel.js:140 Custom // react-chart-editor: /components/fields/MarkerColor.js:195 -Custom Data // react-chart-editor: /components/fields/ErrorBars.js:123 -Dark // react-chart-editor: /default_panels/GraphSubplotsPanel.js:80 -Data // react-chart-editor: /components/fields/ErrorBars.js:118 +Custom Data // react-chart-editor: /components/fields/ErrorBars.js:124 +Dark // react-chart-editor: /default_panels/GraphSubplotsPanel.js:83 +Data // react-chart-editor: /components/fields/ErrorBars.js:119 Date // react-chart-editor: /default_panels/StyleAxesPanel.js:49 Day // react-chart-editor: /default_panels/StyleAxesPanel.js:324 -Decreasing // react-chart-editor: /default_panels/StyleTracesPanel.js:130 -Decreasing Trace Styles // react-chart-editor: /default_panels/StyleTracesPanel.js:543 +Decreasing // react-chart-editor: /default_panels/StyleTracesPanel.js:136 +Decreasing Trace Styles // react-chart-editor: /default_panels/StyleTracesPanel.js:555 Default // react-chart-editor: /components/fields/derived.js:145 -Defaults // react-chart-editor: /default_panels/StyleLayoutPanel.js:22 -Degrees // react-chart-editor: /default_panels/GraphCreatePanel.js:118 -Density // react-chart-editor: /default_panels/StyleTracesPanel.js:113 -Descending // react-chart-editor: /default_panels/GraphTransformsPanel.js:86 -Diagonal // react-chart-editor: /default_panels/StyleLayoutPanel.js:100 -Diameter // react-chart-editor: /default_panels/StyleTracesPanel.js:263 -Diffuse // react-chart-editor: /default_panels/StyleTracesPanel.js:519 +Defaults // react-chart-editor: /default_panels/StyleLayoutPanel.js:25 +Degrees // react-chart-editor: /default_panels/GraphCreatePanel.js:129 +Density // react-chart-editor: /default_panels/StyleTracesPanel.js:119 +Descending // react-chart-editor: /default_panels/GraphTransformsPanel.js:89 +Diagonal // react-chart-editor: /default_panels/StyleLayoutPanel.js:103 +Diameter // react-chart-editor: /default_panels/StyleTracesPanel.js:269 +Diffuse // react-chart-editor: /default_panels/StyleTracesPanel.js:531 Direction // react-chart-editor: /default_panels/StyleAxesPanel.js:69 Disable // react-chart-editor: /components/fields/derived.js:664 -Disabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:73 -Display // react-chart-editor: /default_panels/StyleTracesPanel.js:180 +Disabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:76 +Display // react-chart-editor: /default_panels/StyleTracesPanel.js:186 Distributions // react-chart-editor: /lib/traceTypes.js:21 Divergence // react-chart-editor: /components/fields/derived.js:574 Double-click on legend to isolate one trace // plotly.js: components/legend/handle_click.js:89 Double-click to zoom back out // plotly.js: plots/cartesian/dragbox.js:1034 Download plot // plotly.js: components/modebar/buttons.js:55 Download plot as a png // plotly.js: components/modebar/buttons.js:54 -Drag // react-chart-editor: /default_panels/StyleLayoutPanel.js:79 -Drop the // react-chart-editor: /components/widgets/Dropzone.js:46 -Dropdown // react-chart-editor: /components/containers/UpdateMenuAccordion.js:21 +Drag // react-chart-editor: /default_panels/StyleLayoutPanel.js:82 +Drop the // react-chart-editor: /components/widgets/Dropzone.js:47 +Dropdown // react-chart-editor: /components/containers/UpdateMenuAccordion.js:22 E+6 // react-chart-editor: /default_panels/StyleAxesPanel.js:185 Each point in a trace is colored according to data. // react-chart-editor: /components/fields/MarkerColor.js:169 Each trace will be colored according to the selected colorscale. // react-chart-editor: /components/fields/MarkerColor.js:109 Each will be colored according to the selected colors. // react-chart-editor: /components/fields/MultiColorPicker.js:85 -Eckert 4 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:124 +Eckert 4 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:127 Edit in Chart Studio // plotly.js: components/modebar/buttons.js:87 -Edit in HTML // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:29 -Edit in Rich Text // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:224 -Ellipse // react-chart-editor: /default_panels/StyleShapesPanel.js:26 -Embed images in your figure to make the data more readable or to brand your content. // react-chart-editor: /components/containers/ImageAccordion.js:58 +Edit in HTML // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:30 +Edit in Rich Text // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:225 +Ellipse // react-chart-editor: /default_panels/StyleShapesPanel.js:29 +Embed images in your figure to make the data more readable or to brand your content. // react-chart-editor: /components/containers/ImageAccordion.js:59 Enable // react-chart-editor: /default_panels/StyleAxesPanel.js:65 -Enabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:73 -End Point // react-chart-editor: /default_panels/StyleShapesPanel.js:33 -Enter LaTeX formatted text // react-chart-editor: /components/fields/TextEditor.js:35 -Enter Link URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:89 -Enter html formatted text // react-chart-editor: /components/fields/TextEditor.js:40 -Equirectangular // react-chart-editor: /default_panels/GraphSubplotsPanel.js:115 -Error (+) // react-chart-editor: /components/fields/ErrorBars.js:146 -Error (-) // react-chart-editor: /components/fields/ErrorBars.js:147 -Error Bars X // react-chart-editor: /default_panels/StyleTracesPanel.js:635 -Error Bars Y // react-chart-editor: /default_panels/StyleTracesPanel.js:643 -Error Bars Z // react-chart-editor: /default_panels/StyleTracesPanel.js:650 -Error Type // react-chart-editor: /components/fields/ErrorBars.js:112 -Europe // react-chart-editor: /default_panels/GraphSubplotsPanel.js:102 +Enabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:76 +End Point // react-chart-editor: /default_panels/StyleShapesPanel.js:36 +Enter LaTeX formatted text // react-chart-editor: /components/fields/TextEditor.js:36 +Enter Link URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:90 +Enter html formatted text // react-chart-editor: /components/fields/TextEditor.js:41 +Equirectangular // react-chart-editor: /default_panels/GraphSubplotsPanel.js:118 +Error (+) // react-chart-editor: /components/fields/ErrorBars.js:147 +Error (-) // react-chart-editor: /components/fields/ErrorBars.js:148 +Error Bars X // react-chart-editor: /default_panels/StyleTracesPanel.js:647 +Error Bars Y // react-chart-editor: /default_panels/StyleTracesPanel.js:655 +Error Bars Z // react-chart-editor: /default_panels/StyleTracesPanel.js:662 +Error Type // react-chart-editor: /components/fields/ErrorBars.js:113 +Europe // react-chart-editor: /default_panels/GraphSubplotsPanel.js:105 Every label // react-chart-editor: /default_panels/StyleAxesPanel.js:222 Exclude // react-chart-editor: /components/fields/FilterOperation.js:30 Exclude Range // react-chart-editor: /components/fields/FilterOperation.js:79 Exclude Values // react-chart-editor: /components/fields/FilterOperation.js:87 Expand All // react-chart-editor: /components/containers/PanelHeader.js:40 Exponents // react-chart-editor: /default_panels/StyleAxesPanel.js:179 -Extended Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:81 -Face Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:524 -Facecolor // react-chart-editor: /default_panels/GraphCreatePanel.js:148 +Extended Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:87 +Face Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:536 +Facecolor // react-chart-editor: /default_panels/GraphCreatePanel.js:159 False // react-chart-editor: /default_panels/StyleAxesPanel.js:149 -File loaded! // react-chart-editor: /components/widgets/Dropzone.js:31 -Fill // react-chart-editor: /default_panels/StyleImagesPanel.js:27 -Fill Color // react-chart-editor: /default_panels/GraphCreatePanel.js:130 -Fill to // react-chart-editor: /default_panels/StyleTracesPanel.js:431 -Filled Area // react-chart-editor: /default_panels/StyleTracesPanel.js:430 +File loaded! // react-chart-editor: /components/widgets/Dropzone.js:32 +Fill // react-chart-editor: /default_panels/StyleImagesPanel.js:30 +Fill Color // react-chart-editor: /default_panels/GraphCreatePanel.js:141 +Fill to // react-chart-editor: /default_panels/StyleTracesPanel.js:443 +Filled Area // react-chart-editor: /default_panels/StyleTracesPanel.js:442 Fills // react-chart-editor: /components/fields/derived.js:644 Filter // react-chart-editor: /components/containers/TransformAccordion.js:21 Finance // react-chart-editor: /lib/traceTypes.js:17 -First // react-chart-editor: /default_panels/GraphTransformsPanel.js:47 +First // react-chart-editor: /default_panels/GraphTransformsPanel.js:48 First label // react-chart-editor: /default_panels/StyleAxesPanel.js:223 -Fixed Width // react-chart-editor: /default_panels/StyleLayoutPanel.js:69 -Fixed height // react-chart-editor: /default_panels/StyleLayoutPanel.js:70 -Flatshading // react-chart-editor: /default_panels/StyleTracesPanel.js:191 -Font // react-chart-editor: /default_panels/StyleSlidersPanel.js:27 -Font Color // react-chart-editor: /default_panels/GraphCreatePanel.js:131 -Font Size // react-chart-editor: /default_panels/GraphCreatePanel.js:132 -Fraction // react-chart-editor: /default_panels/StyleTracesPanel.js:294 -Fraction of Plot // react-chart-editor: /default_panels/StyleColorbarsPanel.js:62 -Fraction of canvas // react-chart-editor: /default_panels/StyleSlidersPanel.js:38 +Fixed Width // react-chart-editor: /default_panels/StyleLayoutPanel.js:72 +Fixed height // react-chart-editor: /default_panels/StyleLayoutPanel.js:73 +Flatshading // react-chart-editor: /default_panels/StyleTracesPanel.js:197 +Font // react-chart-editor: /default_panels/StyleSlidersPanel.js:30 +Font Color // react-chart-editor: /default_panels/GraphCreatePanel.js:142 +Font Size // react-chart-editor: /default_panels/GraphCreatePanel.js:143 +Fraction // react-chart-editor: /default_panels/StyleTracesPanel.js:300 +Fraction of Plot // react-chart-editor: /default_panels/StyleColorbarsPanel.js:71 +Fraction of canvas // react-chart-editor: /default_panels/StyleSlidersPanel.js:41 Free // react-chart-editor: /components/fields/derived.js:33 -Fresnel // react-chart-editor: /default_panels/StyleTracesPanel.js:522 -Gap Between Groups // react-chart-editor: /default_panels/StyleLegendPanel.js:75 -Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:374 -Gaps Between Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:498 -Gaps in Data // react-chart-editor: /default_panels/StyleTracesPanel.js:507 -General // react-chart-editor: /DefaultEditor.js:79 +Fresnel // react-chart-editor: /default_panels/StyleTracesPanel.js:534 +Gap Between Groups // react-chart-editor: /default_panels/StyleLegendPanel.js:78 +Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:386 +Gaps Between Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:510 +Gaps in Data // react-chart-editor: /default_panels/StyleTracesPanel.js:519 +General // react-chart-editor: /DefaultEditor.js:80 Geo // react-chart-editor: /lib/constants.js:101 -Gnomonic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:133 -Go back // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:185 -Go to the // react-chart-editor: /components/containers/TraceRequiredPanel.js:24 -Gradians // react-chart-editor: /default_panels/GraphCreatePanel.js:119 +Gnomonic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:136 +Go back // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:186 +Go to the // react-chart-editor: /components/containers/TraceRequiredPanel.js:27 +Gradians // react-chart-editor: /default_panels/GraphCreatePanel.js:130 Grid Lines // react-chart-editor: /default_panels/StyleAxesPanel.js:98 Grid Spacing // react-chart-editor: /default_panels/StyleAxesPanel.js:109 -Group // react-chart-editor: /default_panels/StyleTracesPanel.js:54 -Grouped // react-chart-editor: /default_panels/StyleLegendPanel.js:71 -Half // react-chart-editor: /default_panels/StyleTracesPanel.js:139 -Hammer // react-chart-editor: /default_panels/GraphSubplotsPanel.js:136 -Hard // react-chart-editor: /default_panels/StyleTracesPanel.js:567 -Header // react-chart-editor: /default_panels/StyleTracesPanel.js:144 -Header Options // react-chart-editor: /default_panels/GraphCreatePanel.js:129 -Headers // react-chart-editor: /default_panels/GraphCreatePanel.js:108 -Heads up! // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:169 -Heatmap // react-chart-editor: /default_panels/StyleTracesPanel.js:344 +Group // react-chart-editor: /default_panels/StyleTracesPanel.js:57 +Grouped // react-chart-editor: /default_panels/StyleLegendPanel.js:74 +Half // react-chart-editor: /default_panels/StyleTracesPanel.js:145 +Hammer // react-chart-editor: /default_panels/GraphSubplotsPanel.js:139 +Hard // react-chart-editor: /default_panels/StyleTracesPanel.js:579 +Header // react-chart-editor: /default_panels/StyleTracesPanel.js:150 +Header Options // react-chart-editor: /default_panels/GraphCreatePanel.js:140 +Headers // react-chart-editor: /default_panels/GraphCreatePanel.js:116 +Heads up! // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:170 +Heatmap // react-chart-editor: /default_panels/StyleTracesPanel.js:356 Heatmap GL // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:89 Height // react-chart-editor: /default_panels/StyleAxesPanel.js:299 Hide // react-chart-editor: /components/fields/MarkerColor.js:190 -High // react-chart-editor: /default_panels/GraphCreatePanel.js:96 +High // react-chart-editor: /default_panels/GraphCreatePanel.js:104 Histogram // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:25 -Histogram Function // react-chart-editor: /default_panels/StyleTracesPanel.js:106 -Histogram Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:108 -Hole // react-chart-editor: /default_panels/GraphSubplotsPanel.js:226 -Hole Size // react-chart-editor: /default_panels/StyleTracesPanel.js:227 -Horizontal // react-chart-editor: /default_panels/GraphCreatePanel.js:63 -Horizontal Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:30 -Horizontal Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:499 -Horizontal Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:503 +Histogram Function // react-chart-editor: /default_panels/StyleTracesPanel.js:112 +Histogram Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:114 +Hole // react-chart-editor: /default_panels/GraphSubplotsPanel.js:232 +Hole Size // react-chart-editor: /default_panels/StyleTracesPanel.js:233 +Horizontal // react-chart-editor: /default_panels/GraphCreatePanel.js:71 +Horizontal Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:33 +Horizontal Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:511 +Horizontal Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:515 Horizontal Positioning // react-chart-editor: /default_panels/StyleAxesPanel.js:352 Hour // react-chart-editor: /default_panels/StyleAxesPanel.js:325 -Hover // react-chart-editor: /default_panels/StyleLayoutPanel.js:115 -Hover Action // react-chart-editor: /default_panels/StyleTracesPanel.js:630 -Hover on // react-chart-editor: /default_panels/StyleTracesPanel.js:631 -I (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:92 +Hover // react-chart-editor: /default_panels/StyleLayoutPanel.js:118 +Hover Action // react-chart-editor: /default_panels/StyleTracesPanel.js:642 +Hover on // react-chart-editor: /default_panels/StyleTracesPanel.js:643 +I (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:100 IE only supports svg. Changing format to svg. // plotly.js: components/modebar/buttons.js:65 -Icon Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:57 -Image // react-chart-editor: /components/containers/ImageAccordion.js:21 -Images // react-chart-editor: /DefaultEditor.js:86 +Icon Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:60 +Image // react-chart-editor: /components/containers/ImageAccordion.js:22 +Images // react-chart-editor: /DefaultEditor.js:87 Include // react-chart-editor: /components/fields/FilterOperation.js:29 Include Range // react-chart-editor: /components/fields/FilterOperation.js:75 Include Values // react-chart-editor: /components/fields/FilterOperation.js:83 -Increasing // react-chart-editor: /default_panels/StyleTracesPanel.js:129 -Increasing Trace Styles // react-chart-editor: /default_panels/StyleTracesPanel.js:531 -Individually // react-chart-editor: /components/containers/TraceAccordion.js:165 +Increasing // react-chart-editor: /default_panels/StyleTracesPanel.js:135 +Increasing Trace Styles // react-chart-editor: /default_panels/StyleTracesPanel.js:543 +Individually // react-chart-editor: /components/containers/TraceAccordion.js:166 Inequality // react-chart-editor: /components/fields/FilterOperation.js:71 -Infer Zero // react-chart-editor: /default_panels/StyleTracesPanel.js:377 +Infer Zero // react-chart-editor: /default_panels/StyleTracesPanel.js:389 Inside // react-chart-editor: /components/fields/derived.js:492 -Intensity // react-chart-editor: /default_panels/GraphCreatePanel.js:147 -Interactions // react-chart-editor: /default_panels/StyleLayoutPanel.js:78 -Interpolate // react-chart-editor: /default_panels/StyleTracesPanel.js:378 -Interpolate Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:512 -J (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:93 -Jitter // react-chart-editor: /default_panels/StyleTracesPanel.js:249 -K (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:94 +Intensity // react-chart-editor: /default_panels/GraphCreatePanel.js:158 +Interactions // react-chart-editor: /default_panels/StyleLayoutPanel.js:81 +Interpolate // react-chart-editor: /default_panels/StyleTracesPanel.js:390 +Interpolate Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:524 +J (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:101 +Jitter // react-chart-editor: /default_panels/StyleTracesPanel.js:255 +K (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:102 KDE // react-chart-editor: /components/fields/derived.js:637 -Kavrayskiy 7 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:123 -LaTeX // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:24 -LaTeX is a math typesetting language that doesn't work with rich text. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:105 +Kavrayskiy 7 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:126 +LaTeX // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:25 +LaTeX is a math typesetting language that doesn't work with rich text. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:106 Label // react-chart-editor: /components/fields/derived.js:507 Label Format // react-chart-editor: /default_panels/StyleAxesPanel.js:168 -Label Prefix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:156 -Label Suffix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:182 -Labels // react-chart-editor: /default_panels/GraphCreatePanel.js:34 -Lakes // react-chart-editor: /default_panels/GraphSubplotsPanel.js:182 -Land // react-chart-editor: /default_panels/GraphSubplotsPanel.js:175 -Lasso // react-chart-editor: /default_panels/StyleLayoutPanel.js:87 +Label Prefix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:171 +Label Suffix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:197 +Labels // react-chart-editor: /default_panels/GraphCreatePanel.js:42 +Lakes // react-chart-editor: /default_panels/GraphSubplotsPanel.js:185 +Land // react-chart-editor: /default_panels/GraphSubplotsPanel.js:178 +Lasso // react-chart-editor: /default_panels/StyleLayoutPanel.js:90 Lasso Select // plotly.js: components/modebar/buttons.js:123 -Last // react-chart-editor: /default_panels/GraphTransformsPanel.js:48 +Last // react-chart-editor: /default_panels/GraphTransformsPanel.js:49 Last label // react-chart-editor: /default_panels/StyleAxesPanel.js:224 Lat/Lon // react-chart-editor: /components/fields/LocationSelector.js:99 Latitude // react-chart-editor: /components/fields/derived.js:545 -Layout // react-chart-editor: /default_panels/StyleLayoutPanel.js:61 +Layout // react-chart-editor: /default_panels/StyleLayoutPanel.js:64 Left // react-chart-editor: /components/fields/derived.js:91 -Legend // react-chart-editor: /default_panels/StyleLegendPanel.js:16 -Legend Box // react-chart-editor: /default_panels/StyleLegendPanel.js:26 -Legend Group // react-chart-editor: /default_panels/StyleTracesPanel.js:54 +Legend // react-chart-editor: /default_panels/StyleLegendPanel.js:19 +Legend Box // react-chart-editor: /default_panels/StyleLegendPanel.js:29 +Legend Group // react-chart-editor: /default_panels/StyleTracesPanel.js:57 Length // react-chart-editor: /default_panels/StyleAxesPanel.js:278 -Length Mode // react-chart-editor: /default_panels/StyleSlidersPanel.js:35 -Levels // react-chart-editor: /default_panels/StyleTracesPanel.js:335 -Light // react-chart-editor: /default_panels/GraphSubplotsPanel.js:79 -Light Position // react-chart-editor: /default_panels/StyleTracesPanel.js:526 -Lighting // react-chart-editor: /default_panels/StyleTracesPanel.js:517 -Line // react-chart-editor: /default_panels/StyleShapesPanel.js:24 -Line Color // react-chart-editor: /default_panels/StyleTracesPanel.js:534 -Line Width // react-chart-editor: /default_panels/StyleNotesPanel.js:32 +Length Mode // react-chart-editor: /default_panels/StyleSlidersPanel.js:38 +Levels // react-chart-editor: /default_panels/StyleTracesPanel.js:347 +Light // react-chart-editor: /default_panels/GraphSubplotsPanel.js:82 +Light Position // react-chart-editor: /default_panels/StyleTracesPanel.js:538 +Lighting // react-chart-editor: /default_panels/StyleTracesPanel.js:529 +Line // react-chart-editor: /default_panels/StyleShapesPanel.js:27 +Line Color // react-chart-editor: /default_panels/StyleTracesPanel.js:546 +Line Width // react-chart-editor: /default_panels/StyleNotesPanel.js:35 Linear // react-chart-editor: /default_panels/StyleAxesPanel.js:47 Lines // react-chart-editor: /default_panels/StyleAxesPanel.js:79 -Lines, Rectangles and Ellipses. // react-chart-editor: /components/containers/ShapeAccordion.js:55 -Loading... // react-chart-editor: /components/widgets/Dropzone.js:110 +Lines, Rectangles and Ellipses. // react-chart-editor: /components/containers/ShapeAccordion.js:56 +Loading... // react-chart-editor: /components/widgets/Dropzone.js:111 Location // react-chart-editor: /components/fields/derived.js:540 Location Format // react-chart-editor: /components/fields/LocationSelector.js:27 Locations // react-chart-editor: /components/fields/LocationSelector.js:25 Log // react-chart-editor: /default_panels/StyleAxesPanel.js:48 -Logos, watermarks and more. // react-chart-editor: /components/containers/ImageAccordion.js:55 +Logos, watermarks and more. // react-chart-editor: /components/containers/ImageAccordion.js:56 Longitude // react-chart-editor: /components/fields/derived.js:545 -Looks like there aren't any traces defined yet. // react-chart-editor: /components/containers/TraceRequiredPanel.js:22 -Low // react-chart-editor: /default_panels/GraphCreatePanel.js:97 +Looks like there aren't any traces defined yet. // react-chart-editor: /components/containers/TraceRequiredPanel.js:25 +Low // react-chart-editor: /default_panels/GraphCreatePanel.js:105 Lower < Target < Upper // react-chart-editor: /components/fields/FilterOperation.js:19 Lower < Target ≤ Upper // react-chart-editor: /components/fields/FilterOperation.js:21 Lower Bound // react-chart-editor: /components/fields/FilterOperation.js:169 Lower ≤ Target < Upper // react-chart-editor: /components/fields/FilterOperation.js:20 Lower ≤ Target ≤ Upper // react-chart-editor: /components/fields/FilterOperation.js:18 -Manual // react-chart-editor: /default_panels/GraphSubplotsPanel.js:46 -Map Frame // react-chart-editor: /default_panels/GraphSubplotsPanel.js:198 -Map Options // react-chart-editor: /default_panels/GraphSubplotsPanel.js:207 -Map Positioning // react-chart-editor: /default_panels/GraphSubplotsPanel.js:87 -Map Projection // react-chart-editor: /default_panels/GraphSubplotsPanel.js:95 -Map Style // react-chart-editor: /default_panels/GraphSubplotsPanel.js:72 +Manual // react-chart-editor: /default_panels/GraphSubplotsPanel.js:49 +Map Frame // react-chart-editor: /default_panels/GraphSubplotsPanel.js:201 +Map Options // react-chart-editor: /default_panels/GraphSubplotsPanel.js:210 +Map Positioning // react-chart-editor: /default_panels/GraphSubplotsPanel.js:90 +Map Projection // react-chart-editor: /default_panels/GraphSubplotsPanel.js:98 +Map Style // react-chart-editor: /default_panels/GraphSubplotsPanel.js:75 Mapbox // react-chart-editor: /lib/constants.js:102 -Mapbox Style // react-chart-editor: /default_panels/GraphSubplotsPanel.js:74 +Mapbox Style // react-chart-editor: /default_panels/GraphSubplotsPanel.js:77 Maps // react-chart-editor: /lib/traceTypes.js:25 -Margin Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:24 +Margin Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:27 Max // react-chart-editor: /components/fields/MarkerColor.js:200 -Max Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:369 -Max Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:365 +Max Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:381 +Max Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:377 Max Number of Labels // react-chart-editor: /default_panels/StyleAxesPanel.js:261 Max Number of Lines // react-chart-editor: /default_panels/StyleAxesPanel.js:116 Max Number of Markers // react-chart-editor: /default_panels/StyleAxesPanel.js:289 -Max Number of Points // react-chart-editor: /default_panels/StyleTracesPanel.js:269 -Max Tube segments // react-chart-editor: /default_panels/StyleTracesPanel.js:74 -Max X Bins // react-chart-editor: /default_panels/StyleTracesPanel.js:199 -Max Y Bins // react-chart-editor: /default_panels/StyleTracesPanel.js:204 +Max Number of Points // react-chart-editor: /default_panels/StyleTracesPanel.js:275 +Max Tube segments // react-chart-editor: /default_panels/StyleTracesPanel.js:80 +Max X Bins // react-chart-editor: /default_panels/StyleTracesPanel.js:205 +Max Y Bins // react-chart-editor: /default_panels/StyleTracesPanel.js:210 Maximum // react-chart-editor: /components/fields/derived.js:135 -Mean // react-chart-editor: /default_panels/StyleTracesPanel.js:587 -Mean & SD // react-chart-editor: /default_panels/StyleTracesPanel.js:588 -Meanline // react-chart-editor: /default_panels/StyleTracesPanel.js:603 -Meanline Color // react-chart-editor: /default_panels/StyleTracesPanel.js:609 -Meanline Width // react-chart-editor: /default_panels/StyleTracesPanel.js:608 -Median // react-chart-editor: /default_panels/GraphTransformsPanel.js:41 -Menus // react-chart-editor: /DefaultEditor.js:88 -Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:116 +Mean // react-chart-editor: /default_panels/StyleTracesPanel.js:599 +Mean & SD // react-chart-editor: /default_panels/StyleTracesPanel.js:600 +Meanline // react-chart-editor: /default_panels/StyleTracesPanel.js:615 +Meanline Color // react-chart-editor: /default_panels/StyleTracesPanel.js:621 +Meanline Width // react-chart-editor: /default_panels/StyleTracesPanel.js:620 +Median // react-chart-editor: /default_panels/GraphTransformsPanel.js:42 +Menus // react-chart-editor: /DefaultEditor.js:89 +Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:119 Middle // react-chart-editor: /default_panels/StyleAxesPanel.js:374 Middle Center // react-chart-editor: /components/fields/derived.js:484 Middle Left // react-chart-editor: /components/fields/derived.js:483 Middle Right // react-chart-editor: /components/fields/derived.js:485 -Miller // react-chart-editor: /default_panels/GraphSubplotsPanel.js:122 +Miller // react-chart-editor: /default_panels/GraphSubplotsPanel.js:125 Min // react-chart-editor: /components/fields/MarkerColor.js:199 -Min Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:368 +Min Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:380 Minimum // react-chart-editor: /components/fields/derived.js:134 -Minimum Size // react-chart-editor: /default_panels/StyleTracesPanel.js:265 +Minimum Size // react-chart-editor: /default_panels/StyleTracesPanel.js:271 Minute // react-chart-editor: /default_panels/StyleAxesPanel.js:326 Mirror Axis // react-chart-editor: /default_panels/StyleAxesPanel.js:92 -Mode // react-chart-editor: /default_panels/GraphTransformsPanel.js:42 -Modebar // react-chart-editor: /default_panels/StyleLayoutPanel.js:51 -Mollweide // react-chart-editor: /default_panels/GraphSubplotsPanel.js:135 +Mode // react-chart-editor: /default_panels/GraphTransformsPanel.js:43 +Modebar // react-chart-editor: /default_panels/StyleLayoutPanel.js:54 +Mollweide // react-chart-editor: /default_panels/GraphSubplotsPanel.js:138 Month // react-chart-editor: /default_panels/StyleAxesPanel.js:323 Multiple // react-chart-editor: /components/fields/MultiColorPicker.js:77 Multiple Values // react-chart-editor: /lib/constants.js:18 -Name // react-chart-editor: /default_panels/StyleTracesPanel.js:45 -Natural Earth // react-chart-editor: /default_panels/GraphSubplotsPanel.js:118 -Negative // react-chart-editor: /default_panels/StyleTracesPanel.js:579 -No // react-chart-editor: /components/fields/ErrorBars.js:95 -No Results // react-chart-editor: /components/widgets/Dropdown.js:75 +Name // react-chart-editor: /default_panels/StyleTracesPanel.js:48 +Natural Earth // react-chart-editor: /default_panels/GraphSubplotsPanel.js:121 +Negative // react-chart-editor: /default_panels/StyleTracesPanel.js:591 +No // react-chart-editor: /components/fields/ErrorBars.js:96 +No Results // react-chart-editor: /components/widgets/Dropdown.js:76 None // react-chart-editor: /components/fields/derived.js:59 -None label // react-chart-editor: /default_panels/StyleColorbarsPanel.js:177 +None label // react-chart-editor: /default_panels/StyleColorbarsPanel.js:192 Norm // react-chart-editor: /components/fields/derived.js:573 Normal // react-chart-editor: /components/fields/MarkerColor.js:185 -Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:290 -North America // react-chart-editor: /default_panels/GraphSubplotsPanel.js:105 -Note Text // react-chart-editor: /default_panels/StyleNotesPanel.js:20 -Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:85 -Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:76 -Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:67 -Number format // react-chart-editor: /default_panels/StyleLayoutPanel.js:30 -Number of Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:361 -Number of Occurences // react-chart-editor: /default_panels/StyleTracesPanel.js:110 +Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:296 +North America // react-chart-editor: /default_panels/GraphSubplotsPanel.js:108 +Note Text // react-chart-editor: /default_panels/StyleNotesPanel.js:23 +Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:93 +Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:84 +Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:75 +Number format // react-chart-editor: /default_panels/StyleLayoutPanel.js:33 +Number of Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:373 +Number of Occurences // react-chart-editor: /default_panels/StyleTracesPanel.js:116 OHLC // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:117 -Oceans // react-chart-editor: /default_panels/GraphSubplotsPanel.js:168 +Oceans // react-chart-editor: /default_panels/GraphSubplotsPanel.js:171 Off // react-chart-editor: /components/fields/RectanglePositioner.js:87 -Offset // react-chart-editor: /default_panels/StyleTracesPanel.js:208 +Offset // react-chart-editor: /default_panels/StyleTracesPanel.js:214 On // react-chart-editor: /components/fields/RectanglePositioner.js:87 -On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:611 -Opacity // react-chart-editor: /default_panels/StyleShapesPanel.js:48 -Open // react-chart-editor: /default_panels/GraphCreatePanel.js:95 -Operator // react-chart-editor: /default_panels/GraphTransformsPanel.js:79 -Options // react-chart-editor: /default_panels/GraphCreatePanel.js:146 -Orbit // react-chart-editor: /default_panels/StyleLayoutPanel.js:88 +On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:623 +Opacity // react-chart-editor: /default_panels/StyleShapesPanel.js:51 +Open // react-chart-editor: /default_panels/GraphCreatePanel.js:103 +Operator // react-chart-editor: /default_panels/GraphTransformsPanel.js:82 +Options // react-chart-editor: /default_panels/GraphCreatePanel.js:157 +Orbit // react-chart-editor: /default_panels/StyleLayoutPanel.js:91 Orbital rotation // plotly.js: components/modebar/buttons.js:287 -Order // react-chart-editor: /default_panels/GraphCreatePanel.js:143 -Orientation // react-chart-editor: /default_panels/GraphCreatePanel.js:61 -Orthographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:117 -Outdoors // react-chart-editor: /default_panels/GraphSubplotsPanel.js:78 -Outliers // react-chart-editor: /default_panels/StyleTracesPanel.js:232 +Order // react-chart-editor: /default_panels/GraphCreatePanel.js:154 +Orientation // react-chart-editor: /default_panels/GraphCreatePanel.js:69 +Orthographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:120 +Outdoors // react-chart-editor: /default_panels/GraphSubplotsPanel.js:81 +Outliers // react-chart-editor: /default_panels/StyleTracesPanel.js:238 Outside // react-chart-editor: /components/fields/derived.js:493 -Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:67 -Padding // react-chart-editor: /default_panels/StyleColorbarsPanel.js:111 -Pan // plotly.js: components/modebar/buttons.js:105 && react-chart-editor: /default_panels/StyleLayoutPanel.js:86 +Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:70 +Padding // react-chart-editor: /default_panels/StyleColorbarsPanel.js:120 +Pan // plotly.js: components/modebar/buttons.js:105 && react-chart-editor: /default_panels/StyleLayoutPanel.js:89 Parallel Coordinates // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:93 Percent // react-chart-editor: /components/fields/derived.js:561 -Pie // react-chart-editor: /components/containers/SubplotAccordion.js:132 -Pie Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:77 +Pie // react-chart-editor: /components/containers/SubplotAccordion.js:133 +Pie Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:83 Pie Segments // react-chart-editor: /components/containers/TraceMarkerSection.js:21 -Pie Title // react-chart-editor: /default_panels/StyleTracesPanel.js:87 -Pitch // react-chart-editor: /default_panels/GraphSubplotsPanel.js:92 -Pixels // react-chart-editor: /default_panels/StyleColorbarsPanel.js:63 -Plot Background // react-chart-editor: /default_panels/GraphSubplotsPanel.js:60 +Pie Title // react-chart-editor: /default_panels/StyleTracesPanel.js:93 +Pitch // react-chart-editor: /default_panels/GraphSubplotsPanel.js:95 +Pixels // react-chart-editor: /default_panels/StyleColorbarsPanel.js:72 +Plot Background // react-chart-editor: /default_panels/GraphSubplotsPanel.js:63 Point Cloud // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:85 -Point Opacity // react-chart-editor: /default_panels/StyleTracesPanel.js:252 +Point Opacity // react-chart-editor: /default_panels/StyleTracesPanel.js:258 Points // react-chart-editor: /components/containers/TraceMarkerSection.js:23 Points and Fills // react-chart-editor: /components/fields/derived.js:645 Polar // react-chart-editor: /lib/constants.js:103 Polar Bar // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:133 Polar Scatter // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:125 Polar Scatter GL // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:129 -Polar Sector // react-chart-editor: /default_panels/GraphSubplotsPanel.js:223 +Polar Sector // react-chart-editor: /default_panels/GraphSubplotsPanel.js:229 Position // react-chart-editor: /default_panels/StyleAxesPanel.js:90 -Positive // react-chart-editor: /default_panels/StyleTracesPanel.js:578 +Positive // react-chart-editor: /default_panels/StyleTracesPanel.js:590 Prefix // react-chart-editor: /default_panels/StyleAxesPanel.js:204 Previous X // react-chart-editor: /components/fields/derived.js:597 Previous Y // react-chart-editor: /components/fields/derived.js:596 -Probability // react-chart-editor: /default_panels/StyleTracesPanel.js:112 -Probability Density // react-chart-editor: /default_panels/StyleTracesPanel.js:114 +Probability // react-chart-editor: /default_panels/StyleTracesPanel.js:118 +Probability Density // react-chart-editor: /default_panels/StyleTracesPanel.js:120 Produced with Plotly // plotly.js: components/modebar/modebar.js:304 -Projection // react-chart-editor: /default_panels/GraphSubplotsPanel.js:111 -Pull // react-chart-editor: /default_panels/StyleTracesPanel.js:228 +Projection // react-chart-editor: /default_panels/GraphSubplotsPanel.js:114 +Pull // react-chart-editor: /default_panels/StyleTracesPanel.js:234 R // react-chart-editor: /components/fields/derived.js:556 -RMS // react-chart-editor: /default_panels/GraphTransformsPanel.js:43 -Radians // react-chart-editor: /default_panels/GraphCreatePanel.js:117 -Radius // react-chart-editor: /default_panels/GraphCreatePanel.js:112 -Range // react-chart-editor: /default_panels/GraphTransformsPanel.js:50 +RMS // react-chart-editor: /default_panels/GraphTransformsPanel.js:44 +Radians // react-chart-editor: /default_panels/GraphCreatePanel.js:128 +Radius // react-chart-editor: /default_panels/GraphCreatePanel.js:123 +Range // react-chart-editor: /default_panels/GraphTransformsPanel.js:51 Range Slider // react-chart-editor: /default_panels/StyleAxesPanel.js:294 -Rectangle // react-chart-editor: /default_panels/StyleShapesPanel.js:25 +Rectangle // react-chart-editor: /default_panels/StyleShapesPanel.js:28 Reference // react-chart-editor: /components/fields/FilterOperation.js:167 -Region // react-chart-editor: /default_panels/GraphSubplotsPanel.js:97 -Relative // react-chart-editor: /default_panels/StyleTracesPanel.js:285 -Relative To // react-chart-editor: /default_panels/StyleImagesPanel.js:51 -Relative to // react-chart-editor: /default_panels/StyleShapesPanel.js:31 -Relative to Grid // react-chart-editor: /default_panels/StyleImagesPanel.js:33 -Rendering // react-chart-editor: /components/fields/TraceSelector.js:136 +Region // react-chart-editor: /default_panels/GraphSubplotsPanel.js:100 +Relative // react-chart-editor: /default_panels/StyleTracesPanel.js:291 +Relative To // react-chart-editor: /default_panels/StyleImagesPanel.js:54 +Relative to // react-chart-editor: /default_panels/StyleShapesPanel.js:34 +Relative to Grid // react-chart-editor: /default_panels/StyleImagesPanel.js:36 +Rendering // react-chart-editor: /components/fields/TraceSelector.js:140 Reset // plotly.js: components/modebar/buttons.js:443 Reset axes // plotly.js: components/modebar/buttons.js:159 Reset camera to default // plotly.js: components/modebar/buttons.js:325 Reset camera to last save // plotly.js: components/modebar/buttons.js:333 Reset view // plotly.js: components/modebar/buttons.js:592 Reset views // plotly.js: components/modebar/buttons.js:540 -Resolution // react-chart-editor: /default_panels/GraphSubplotsPanel.js:209 +Resolution // react-chart-editor: /default_panels/GraphSubplotsPanel.js:212 Reversed // react-chart-editor: /components/fields/MarkerColor.js:185 -Reversed and Grouped // react-chart-editor: /default_panels/StyleLegendPanel.js:72 -Rich Text // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:19 -Rich text is incompatible with LaTeX. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:110 +Reversed and Grouped // react-chart-editor: /default_panels/StyleLegendPanel.js:75 +Rich Text // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:20 +Rich text is incompatible with LaTeX. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:111 Right // react-chart-editor: /components/fields/derived.js:91 -Rivers // react-chart-editor: /default_panels/GraphSubplotsPanel.js:189 -Robinson // react-chart-editor: /default_panels/GraphSubplotsPanel.js:121 -Roll // react-chart-editor: /default_panels/GraphSubplotsPanel.js:216 -Rotation // react-chart-editor: /default_panels/StyleTracesPanel.js:226 -Roughness // react-chart-editor: /default_panels/StyleTracesPanel.js:521 +Rivers // react-chart-editor: /default_panels/GraphSubplotsPanel.js:192 +Robinson // react-chart-editor: /default_panels/GraphSubplotsPanel.js:124 +Roll // react-chart-editor: /default_panels/GraphSubplotsPanel.js:222 +Rotation // react-chart-editor: /default_panels/StyleTracesPanel.js:232 +Roughness // react-chart-editor: /default_panels/StyleTracesPanel.js:533 SVG // react-chart-editor: /components/fields/TraceSelector.js:101 Sankey // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:97 -Satellite // react-chart-editor: /default_panels/GraphSubplotsPanel.js:81 +Satellite // react-chart-editor: /default_panels/GraphSubplotsPanel.js:84 Satellite Map // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:155 -Satellite with Streets // react-chart-editor: /default_panels/GraphSubplotsPanel.js:82 -Scale // react-chart-editor: /default_panels/GraphSubplotsPanel.js:213 -Scale Group // react-chart-editor: /default_panels/StyleTracesPanel.js:556 -Scale Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:558 -Scaling // react-chart-editor: /default_panels/StyleTracesPanel.js:555 +Satellite with Streets // react-chart-editor: /default_panels/GraphSubplotsPanel.js:85 +Scale // react-chart-editor: /default_panels/GraphSubplotsPanel.js:219 +Scale Group // react-chart-editor: /default_panels/StyleTracesPanel.js:568 +Scale Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:570 +Scaling // react-chart-editor: /default_panels/StyleTracesPanel.js:567 Scatter // react-chart-editor: /components/fields/TraceSelector.js:48 Scatter GL // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:81 Scene // react-chart-editor: /lib/constants.js:99 Second // react-chart-editor: /default_panels/StyleAxesPanel.js:327 -See a basic example. // react-chart-editor: /components/widgets/TraceTypeSelector.js:129 -Select // react-chart-editor: /default_panels/StyleLayoutPanel.js:85 -Select Data Point // react-chart-editor: /default_panels/StyleLayoutPanel.js:111 -Select Direction // react-chart-editor: /default_panels/StyleLayoutPanel.js:94 -Select Trace Type // react-chart-editor: /components/widgets/TraceTypeSelector.js:220 -Select a Colorscale Type // react-chart-editor: /components/widgets/ColorscalePicker.js:54 -Select an Option // react-chart-editor: /components/widgets/Dropdown.js:66 +See a basic example. // react-chart-editor: /components/widgets/TraceTypeSelector.js:128 +Select // react-chart-editor: /default_panels/StyleLayoutPanel.js:88 +Select Data Point // react-chart-editor: /default_panels/StyleLayoutPanel.js:114 +Select Direction // react-chart-editor: /default_panels/StyleLayoutPanel.js:97 +Select Trace Type // react-chart-editor: /components/widgets/TraceTypeSelector.js:219 +Select a Colorscale Type // react-chart-editor: /components/widgets/ColorscalePicker.js:55 +Select an Option // react-chart-editor: /components/widgets/Dropdown.js:67 Separate Thousands // react-chart-editor: /default_panels/StyleAxesPanel.js:174 -Shape // react-chart-editor: /components/containers/ShapeAccordion.js:22 -Shapes // react-chart-editor: /DefaultEditor.js:85 +Shape // react-chart-editor: /components/containers/ShapeAccordion.js:23 +Shapes // react-chart-editor: /DefaultEditor.js:86 Show // react-chart-editor: /components/fields/MarkerColor.js:190 -Show All // react-chart-editor: /default_panels/StyleTracesPanel.js:231 -Show Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:620 +Show All // react-chart-editor: /default_panels/StyleTracesPanel.js:237 +Show Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:632 Show Exponents // react-chart-editor: /default_panels/StyleAxesPanel.js:192 Show Prefix // react-chart-editor: /default_panels/StyleAxesPanel.js:219 Show Sides // react-chart-editor: /default_panels/StyleAxesPanel.js:398 Show Suffix // react-chart-editor: /default_panels/StyleAxesPanel.js:243 Show closest data on hover // plotly.js: components/modebar/buttons.js:168 -Show in Legend // react-chart-editor: /default_panels/StyleTracesPanel.js:49 -Side // react-chart-editor: /default_panels/GraphSubplotsPanel.js:32 +Show in Legend // react-chart-editor: /default_panels/StyleTracesPanel.js:52 +Side // react-chart-editor: /default_panels/GraphSubplotsPanel.js:35 Simple // react-chart-editor: /components/fields/derived.js:151 Single // react-chart-editor: /components/fields/MultiColorPicker.js:76 -Sinusoidal // react-chart-editor: /default_panels/GraphSubplotsPanel.js:139 -Size // react-chart-editor: /default_panels/StyleColorbarsPanel.js:56 -Size Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:60 -Size Scale // react-chart-editor: /default_panels/StyleTracesPanel.js:255 -Size and Positioning // react-chart-editor: /default_panels/StyleColorbarsPanel.js:55 -Slider // react-chart-editor: /components/containers/SliderAccordion.js:20 -Sliders // react-chart-editor: /DefaultEditor.js:87 -Smoothing // react-chart-editor: /default_panels/StyleTracesPanel.js:423 +Sinusoidal // react-chart-editor: /default_panels/GraphSubplotsPanel.js:142 +Size // react-chart-editor: /default_panels/StyleColorbarsPanel.js:65 +Size Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:63 +Size Scale // react-chart-editor: /default_panels/StyleTracesPanel.js:261 +Size and Positioning // react-chart-editor: /default_panels/StyleColorbarsPanel.js:64 +Slider // react-chart-editor: /components/containers/SliderAccordion.js:21 +Sliders // react-chart-editor: /DefaultEditor.js:88 +Smoothing // react-chart-editor: /default_panels/StyleTracesPanel.js:435 Snap to Grid // react-chart-editor: /components/fields/RectanglePositioner.js:82 Snapshot succeeded // plotly.js: components/modebar/buttons.js:77 -Soft // react-chart-editor: /default_panels/StyleTracesPanel.js:566 +Soft // react-chart-editor: /default_panels/StyleTracesPanel.js:578 Sorry, there was a problem downloading your snapshot! // plotly.js: components/modebar/buttons.js:80 Sort // react-chart-editor: /components/containers/TransformAccordion.js:24 -Sorted // react-chart-editor: /default_panels/StyleTracesPanel.js:216 -South America // react-chart-editor: /default_panels/GraphSubplotsPanel.js:106 -Span // react-chart-editor: /default_panels/StyleTracesPanel.js:572 -Span Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:563 +Sorted // react-chart-editor: /default_panels/StyleTracesPanel.js:222 +South America // react-chart-editor: /default_panels/GraphSubplotsPanel.js:109 +Span // react-chart-editor: /default_panels/StyleTracesPanel.js:584 +Span Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:575 Specialized // react-chart-editor: /lib/traceTypes.js:29 -Specular // react-chart-editor: /default_panels/StyleTracesPanel.js:520 +Specular // react-chart-editor: /default_panels/StyleTracesPanel.js:532 Spike Lines // react-chart-editor: /default_panels/StyleAxesPanel.js:383 Split // react-chart-editor: /components/containers/TransformAccordion.js:22 -Split labels // react-chart-editor: /default_panels/StyleTracesPanel.js:614 -Stack // react-chart-editor: /default_panels/GraphSubplotsPanel.js:67 -Stacking // react-chart-editor: /default_panels/StyleTracesPanel.js:371 -Standard Deviation // react-chart-editor: /default_panels/GraphTransformsPanel.js:44 -Start Point // react-chart-editor: /default_panels/StyleShapesPanel.js:32 +Split labels // react-chart-editor: /default_panels/StyleTracesPanel.js:626 +Stack // react-chart-editor: /default_panels/GraphSubplotsPanel.js:70 +Stacking // react-chart-editor: /default_panels/StyleTracesPanel.js:383 +Standard Deviation // react-chart-editor: /default_panels/GraphTransformsPanel.js:45 +Start Point // react-chart-editor: /default_panels/StyleShapesPanel.js:35 Step // react-chart-editor: /default_panels/StyleAxesPanel.js:318 Step Offset // react-chart-editor: /default_panels/StyleAxesPanel.js:114 Step Size // react-chart-editor: /default_panels/StyleAxesPanel.js:115 Stepmode // react-chart-editor: /default_panels/StyleAxesPanel.js:332 -Stereographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:134 +Stereographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:137 Streamtube // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:69 -Stretch // react-chart-editor: /default_panels/StyleImagesPanel.js:28 -Structure // react-chart-editor: /DefaultEditor.js:74 +Stretch // react-chart-editor: /default_panels/StyleImagesPanel.js:31 +Structure // react-chart-editor: /DefaultEditor.js:75 Style // react-chart-editor: /default_panels/StyleAxesPanel.js:346 -Sub-Country Unit Borders // react-chart-editor: /default_panels/GraphSubplotsPanel.js:152 -Subplots // react-chart-editor: /components/fields/AxesCreator.js:154 -Subplots to Use // react-chart-editor: /components/fields/SubplotCreator.js:126 +Sub-Country Unit Borders // react-chart-editor: /default_panels/GraphSubplotsPanel.js:155 +Subplots // react-chart-editor: /components/fields/AxesCreator.js:152 +Subplots to Use // react-chart-editor: /components/fields/SubplotCreator.js:122 Suffix // react-chart-editor: /default_panels/StyleAxesPanel.js:229 -Sum // react-chart-editor: /default_panels/GraphSubplotsPanel.js:220 && react-chart-editor: /components/fields/derived.js:132 -Supported formats are: // react-chart-editor: /components/widgets/Dropzone.js:53 +Sum // react-chart-editor: /default_panels/GraphSubplotsPanel.js:226 && react-chart-editor: /components/fields/derived.js:132 +Supported formats are: // react-chart-editor: /components/widgets/Dropzone.js:54 Surface // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:57 -Suspected Outliers // react-chart-editor: /default_panels/StyleTracesPanel.js:233 -Symbol // react-chart-editor: /default_panels/StyleTracesPanel.js:266 -Symmetric // react-chart-editor: /components/fields/ErrorBars.js:77 -Table // react-chart-editor: /components/containers/SubplotAccordion.js:133 -Tail // react-chart-editor: /default_panels/StyleTracesPanel.js:68 +Suspected Outliers // react-chart-editor: /default_panels/StyleTracesPanel.js:239 +Symbol // react-chart-editor: /default_panels/StyleTracesPanel.js:272 +Symmetric // react-chart-editor: /components/fields/ErrorBars.js:78 +Table // react-chart-editor: /components/containers/SubplotAccordion.js:134 +Tail // react-chart-editor: /default_panels/StyleTracesPanel.js:74 Taking snapshot - this may take a few seconds // plotly.js: components/modebar/buttons.js:62 -Target // react-chart-editor: /default_panels/GraphTransformsPanel.js:78 +Target // react-chart-editor: /default_panels/GraphTransformsPanel.js:81 Target < Reference // react-chart-editor: /components/fields/FilterOperation.js:11 Target = Reference // react-chart-editor: /components/fields/FilterOperation.js:13 Target > Reference // react-chart-editor: /components/fields/FilterOperation.js:14 Target ≠ Reference // react-chart-editor: /components/fields/FilterOperation.js:10 Target ≤ Reference // react-chart-editor: /components/fields/FilterOperation.js:12 Target ≥ Reference // react-chart-editor: /components/fields/FilterOperation.js:15 -Ternary // react-chart-editor: /default_panels/GraphSubplotsPanel.js:219 +Ternary // react-chart-editor: /default_panels/GraphSubplotsPanel.js:225 Ternary Scatter // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:45 Text // react-chart-editor: /components/fields/derived.js:513 -Text Alignment // react-chart-editor: /default_panels/StyleTracesPanel.js:150 -Text Attributes // react-chart-editor: /default_panels/StyleTracesPanel.js:434 -Text Position // react-chart-editor: /default_panels/StyleTracesPanel.js:455 +Text Alignment // react-chart-editor: /default_panels/StyleTracesPanel.js:156 +Text Attributes // react-chart-editor: /default_panels/StyleTracesPanel.js:446 +Text Position // react-chart-editor: /default_panels/StyleTracesPanel.js:467 Theta // react-chart-editor: /components/fields/derived.js:556 -Theta Unit // react-chart-editor: /default_panels/GraphCreatePanel.js:115 -Thickness // react-chart-editor: /components/fields/ErrorBars.js:103 +Theta Unit // react-chart-editor: /default_panels/GraphCreatePanel.js:126 +Thickness // react-chart-editor: /components/fields/ErrorBars.js:104 This input has multiple values associated with it. Changing this setting will override these custom inputs. // react-chart-editor: /lib/constants.js:20 -This panel could not be displayed due to an error. // react-chart-editor: /components/containers/PlotlyPanel.js:15 +This panel could not be displayed due to an error. // react-chart-editor: /components/containers/PlotlyPanel.js:16 Tick Labels // react-chart-editor: /default_panels/StyleAxesPanel.js:137 Tick Markers // react-chart-editor: /default_panels/StyleAxesPanel.js:265 Tick Spacing // react-chart-editor: /default_panels/StyleAxesPanel.js:254 -Tick spacing // react-chart-editor: /default_panels/StyleColorbarsPanel.js:211 -Ticks // react-chart-editor: /default_panels/StyleColorbarsPanel.js:219 +Tick spacing // react-chart-editor: /default_panels/StyleColorbarsPanel.js:226 +Ticks // react-chart-editor: /default_panels/StyleColorbarsPanel.js:237 Timescale Buttons // react-chart-editor: /default_panels/StyleAxesPanel.js:306 Timeseries // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:144 -Tip // react-chart-editor: /default_panels/StyleTracesPanel.js:67 -Title // react-chart-editor: /default_panels/StyleColorbarsPanel.js:35 +Tip // react-chart-editor: /default_panels/StyleTracesPanel.js:73 +Title // react-chart-editor: /default_panels/StyleColorbarsPanel.js:38 Titles // react-chart-editor: /default_panels/StyleAxesPanel.js:31 To Date // react-chart-editor: /default_panels/StyleAxesPanel.js:336 To Next // react-chart-editor: /components/fields/derived.js:608 To Self // react-chart-editor: /components/fields/derived.js:607 -To upload multiple files, create multiple files and upload them individually. // react-chart-editor: /components/widgets/Dropzone.js:103 +To upload multiple files, create multiple files and upload them individually. // react-chart-editor: /components/widgets/Dropzone.js:104 Toggle Spike Lines // plotly.js: components/modebar/buttons.js:559 Toggle show closest data on hover // plotly.js: components/modebar/buttons.js:364 Top // react-chart-editor: /components/fields/derived.js:96 Top Center // react-chart-editor: /components/fields/derived.js:481 Top Left // react-chart-editor: /components/fields/derived.js:480 Top Right // react-chart-editor: /components/fields/derived.js:482 -Trace // react-chart-editor: /components/containers/TraceAccordion.js:138 -Trace Opacity // react-chart-editor: /default_panels/StyleTracesPanel.js:46 -Trace Order // react-chart-editor: /default_panels/StyleLegendPanel.js:65 +Trace // react-chart-editor: /components/containers/TraceAccordion.js:139 +Trace Opacity // react-chart-editor: /default_panels/StyleTracesPanel.js:49 +Trace Order // react-chart-editor: /default_panels/StyleLegendPanel.js:68 Trace name // react-chart-editor: /components/fields/derived.js:582 -Trace your data. // react-chart-editor: /components/containers/TraceAccordion.js:118 -Traces // react-chart-editor: /components/containers/TraceRequiredPanel.js:25 -Traces of various types like bar and line are the building blocks of your figure. // react-chart-editor: /components/containers/TraceAccordion.js:120 +Trace your data. // react-chart-editor: /components/containers/TraceAccordion.js:119 +Traces // react-chart-editor: /components/containers/TraceRequiredPanel.js:28 +Traces of various types like bar and line are the building blocks of your figure. // react-chart-editor: /components/containers/TraceAccordion.js:121 Transform // react-chart-editor: /components/containers/TransformAccordion.js:66 -Transforms // react-chart-editor: /DefaultEditor.js:77 -Transpose // react-chart-editor: /default_panels/GraphCreatePanel.js:151 -Transverse Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:137 +Transforms // react-chart-editor: /DefaultEditor.js:78 +Transpose // react-chart-editor: /default_panels/GraphCreatePanel.js:162 +Transverse Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:140 True // react-chart-editor: /default_panels/StyleAxesPanel.js:149 -Try again with a // react-chart-editor: /components/widgets/Dropzone.js:129 -Try again with a supported file format: // react-chart-editor: /components/widgets/Dropzone.js:73 -Turntable // react-chart-editor: /default_panels/StyleLayoutPanel.js:89 +Try again with a // react-chart-editor: /components/widgets/Dropzone.js:130 +Try again with a supported file format: // react-chart-editor: /components/widgets/Dropzone.js:74 +Turntable // react-chart-editor: /default_panels/StyleLayoutPanel.js:92 Turntable rotation // plotly.js: components/modebar/buttons.js:296 -Type // react-chart-editor: /default_panels/GraphCreatePanel.js:29 +Type // react-chart-editor: /default_panels/GraphCreatePanel.js:37 Typeface // react-chart-editor: /default_panels/StyleAxesPanel.js:35 U // react-chart-editor: /components/fields/derived.js:570 -URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:90 -USA // react-chart-editor: /default_panels/GraphSubplotsPanel.js:101 +URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:91 +USA // react-chart-editor: /default_panels/GraphSubplotsPanel.js:104 USA State Abbreviations (e.g. NY) // react-chart-editor: /components/fields/LocationSelector.js:34 -Unsorted // react-chart-editor: /default_panels/StyleTracesPanel.js:216 +Unsorted // react-chart-editor: /default_panels/StyleTracesPanel.js:222 Upper Bound // react-chart-editor: /components/fields/FilterOperation.js:187 V // react-chart-editor: /components/fields/derived.js:571 Value // react-chart-editor: /components/fields/derived.js:508 -Value (-) // react-chart-editor: /components/fields/ErrorBars.js:143 +Value (-) // react-chart-editor: /components/fields/ErrorBars.js:144 Values // react-chart-editor: /components/fields/derived.js:540 -Values Shown On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:612 +Values Shown On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:624 Variable // react-chart-editor: /components/fields/MarkerColor.js:156 -Vertex Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:523 -Vertexcolor // react-chart-editor: /default_panels/GraphCreatePanel.js:149 -Vertical // react-chart-editor: /default_panels/GraphCreatePanel.js:63 -Vertical Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:36 -Vertical Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:500 -Vertical Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:504 +Vertex Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:535 +Vertexcolor // react-chart-editor: /default_panels/GraphCreatePanel.js:160 +Vertical // react-chart-editor: /default_panels/GraphCreatePanel.js:71 +Vertical Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:39 +Vertical Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:512 +Vertical Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:516 Vertical Positioning // react-chart-editor: /default_panels/StyleAxesPanel.js:366 -View tutorials on this chart type. // react-chart-editor: /components/widgets/TraceTypeSelector.js:121 +View tutorials on this chart type. // react-chart-editor: /components/widgets/TraceTypeSelector.js:120 Violin // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:49 -Violin Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:317 -Violin Padding // react-chart-editor: /default_panels/StyleTracesPanel.js:322 -Violin Size and Spacing // react-chart-editor: /default_panels/StyleTracesPanel.js:314 -Violin Width // react-chart-editor: /default_panels/StyleTracesPanel.js:321 +Violin Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:326 +Violin Padding // react-chart-editor: /default_panels/StyleTracesPanel.js:334 +Violin Size and Spacing // react-chart-editor: /default_panels/StyleTracesPanel.js:323 +Violin Width // react-chart-editor: /default_panels/StyleTracesPanel.js:333 Violins // react-chart-editor: /components/fields/derived.js:635 Violins and Points // react-chart-editor: /components/fields/derived.js:638 Violins, Points and KDE // react-chart-editor: /components/fields/derived.js:639 -Visible Sides // react-chart-editor: /default_panels/StyleTracesPanel.js:575 +Visible Sides // react-chart-editor: /default_panels/StyleTracesPanel.js:587 W // react-chart-editor: /components/fields/derived.js:572 WebGL // react-chart-editor: /components/fields/TraceSelector.js:101 -Well this is embarrassing. // react-chart-editor: /components/containers/PlotlyPanel.js:14 -Whisker Width // react-chart-editor: /default_panels/StyleTracesPanel.js:326 -Width // react-chart-editor: /default_panels/GraphCreatePanel.js:142 -Winkel Tripel // react-chart-editor: /default_panels/GraphSubplotsPanel.js:120 -World // react-chart-editor: /default_panels/GraphSubplotsPanel.js:100 +Well this is embarrassing. // react-chart-editor: /components/containers/PlotlyPanel.js:15 +Whisker Width // react-chart-editor: /default_panels/StyleTracesPanel.js:338 +Width // react-chart-editor: /default_panels/GraphCreatePanel.js:153 +Winkel Tripel // react-chart-editor: /default_panels/GraphSubplotsPanel.js:123 +World // react-chart-editor: /default_panels/GraphSubplotsPanel.js:103 X // react-chart-editor: /components/fields/derived.js:523 X = 0 // react-chart-editor: /components/fields/derived.js:595 -X Anchor // react-chart-editor: /default_panels/GraphSubplotsPanel.js:30 +X Anchor // react-chart-editor: /default_panels/GraphSubplotsPanel.js:33 X Axis // react-chart-editor: /components/fields/derived.js:662 -X Bin End // react-chart-editor: /default_panels/StyleTracesPanel.js:197 -X Bin Size // react-chart-editor: /default_panels/StyleTracesPanel.js:198 -X Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:196 -X Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:36 -X Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:23 -X Values // react-chart-editor: /default_panels/GraphCreatePanel.js:38 -X Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:38 -X start // react-chart-editor: /default_panels/GraphCreatePanel.js:105 +X Bin End // react-chart-editor: /default_panels/StyleTracesPanel.js:203 +X Bin Size // react-chart-editor: /default_panels/StyleTracesPanel.js:204 +X Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:202 +X Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:39 +X Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:26 +X Values // react-chart-editor: /default_panels/GraphCreatePanel.js:46 +X Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:41 +X start // react-chart-editor: /default_panels/GraphCreatePanel.js:113 Y // react-chart-editor: /components/fields/derived.js:523 Y = 0 // react-chart-editor: /components/fields/derived.js:594 -Y Anchor // react-chart-editor: /default_panels/GraphSubplotsPanel.js:34 +Y Anchor // react-chart-editor: /default_panels/GraphSubplotsPanel.js:37 Y Axis // react-chart-editor: /components/fields/derived.js:663 -Y Bin End // react-chart-editor: /default_panels/StyleTracesPanel.js:202 -Y Bin Size // react-chart-editor: /default_panels/StyleTracesPanel.js:203 -Y Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:201 -Y Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:37 -Y Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:24 -Y Values // react-chart-editor: /default_panels/GraphCreatePanel.js:46 -Y Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:39 -Y start // react-chart-editor: /default_panels/GraphCreatePanel.js:106 +Y Bin End // react-chart-editor: /default_panels/StyleTracesPanel.js:208 +Y Bin Size // react-chart-editor: /default_panels/StyleTracesPanel.js:209 +Y Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:207 +Y Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:40 +Y Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:27 +Y Values // react-chart-editor: /default_panels/GraphCreatePanel.js:54 +Y Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:42 +Y start // react-chart-editor: /default_panels/GraphCreatePanel.js:114 Year // react-chart-editor: /default_panels/StyleAxesPanel.js:322 -Yes // react-chart-editor: /components/fields/ErrorBars.js:95 -Yikes! An error occurred while parsing this file. // react-chart-editor: /components/widgets/Dropzone.js:72 -Yikes! This doesn't look like a valid // react-chart-editor: /components/widgets/Dropzone.js:127 -Yikes! You can only upload one file at a time. // react-chart-editor: /components/widgets/Dropzone.js:101 -You can add as many as you like, mixing and matching types and arranging them into subplots. // react-chart-editor: /components/containers/TraceAccordion.js:124 -You can style and position your axes in the // react-chart-editor: /components/fields/AxesCreator.js:153 -You can style and position your subplots in the // react-chart-editor: /components/fields/SubplotCreator.js:134 -You need to provide a component for the modal to open! // react-chart-editor: /components/containers/ModalProvider.js:33 +Yes // react-chart-editor: /components/fields/ErrorBars.js:96 +Yikes! An error occurred while parsing this file. // react-chart-editor: /components/widgets/Dropzone.js:73 +Yikes! This doesn't look like a valid // react-chart-editor: /components/widgets/Dropzone.js:128 +Yikes! You can only upload one file at a time. // react-chart-editor: /components/widgets/Dropzone.js:102 +You can add as many as you like, mixing and matching types and arranging them into subplots. // react-chart-editor: /components/containers/TraceAccordion.js:125 +You can style and position your axes in the // react-chart-editor: /components/fields/AxesCreator.js:151 +You can style and position your subplots in the // react-chart-editor: /components/fields/SubplotCreator.js:132 +You need to provide a component for the modal to open! // react-chart-editor: /components/containers/ModalProvider.js:34 Z // react-chart-editor: /components/fields/derived.js:538 -Z Values // react-chart-editor: /default_panels/GraphCreatePanel.js:55 -Z start // react-chart-editor: /default_panels/GraphCreatePanel.js:107 +Z Values // react-chart-editor: /default_panels/GraphCreatePanel.js:63 +Z start // react-chart-editor: /default_panels/GraphCreatePanel.js:115 Zero Line // react-chart-editor: /default_panels/StyleAxesPanel.js:119 -Zoom // plotly.js: components/modebar/buttons.js:96 && react-chart-editor: /default_panels/StyleLayoutPanel.js:84 +Zoom // plotly.js: components/modebar/buttons.js:96 && react-chart-editor: /default_panels/StyleLayoutPanel.js:87 Zoom Interactivity // react-chart-editor: /default_panels/StyleAxesPanel.js:62 -Zoom Level // react-chart-editor: /default_panels/GraphSubplotsPanel.js:90 +Zoom Level // react-chart-editor: /default_panels/GraphSubplotsPanel.js:93 Zoom in // plotly.js: components/modebar/buttons.js:132 Zoom out // plotly.js: components/modebar/buttons.js:141 ^ // react-chart-editor: /default_panels/StyleAxesPanel.js:235 -absolute // react-chart-editor: /default_panels/StyleTracesPanel.js:61 +absolute // react-chart-editor: /default_panels/StyleTracesPanel.js:66 according to axis // react-chart-editor: /components/fields/derived.js:354 close: // plotly.js: traces/ohlc/calc.js:103 e+6 // react-chart-editor: /default_panels/StyleAxesPanel.js:184 high: // plotly.js: traces/ohlc/calc.js:101 -image // react-chart-editor: /default_panels/StyleImagesPanel.js:20 -image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp // react-chart-editor: /components/widgets/Dropzone.js:15 +image // react-chart-editor: /default_panels/StyleImagesPanel.js:23 +image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp // react-chart-editor: /components/widgets/Dropzone.js:16 in pixels // react-chart-editor: /components/fields/derived.js:343 incoming flow count: // plotly.js: traces/sankey/plot.js:146 k/M/B // react-chart-editor: /default_panels/StyleAxesPanel.js:188 @@ -773,27 +773,27 @@ mean ± σ: mean: // plotly.js: traces/box/calc.js:140 median: // plotly.js: traces/box/calc.js:135 min: // plotly.js: traces/box/calc.js:136 -new text // plotly.js: plots/plots.js:330 && react-chart-editor: /components/containers/AnnotationAccordion.js:37 +new text // plotly.js: plots/plots.js:330 && react-chart-editor: /components/containers/AnnotationAccordion.js:38 open: // plotly.js: traces/ohlc/calc.js:100 outgoing flow count: // plotly.js: traces/sankey/plot.js:147 -panel under Structure to define traces. // react-chart-editor: /components/containers/TraceRequiredPanel.js:26 -panel under Style. If Y values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:71 -panel. // react-chart-editor: /components/fields/AxesCreator.js:155 +panel under Structure to define traces. // react-chart-editor: /components/containers/TraceRequiredPanel.js:29 +panel under Style. If Y values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:79 +panel. // react-chart-editor: /components/fields/AxesCreator.js:153 q1: // plotly.js: traces/box/calc.js:137 q3: // plotly.js: traces/box/calc.js:138 -scaled // react-chart-editor: /default_panels/StyleTracesPanel.js:61 +scaled // react-chart-editor: /default_panels/StyleTracesPanel.js:65 source: // plotly.js: traces/sankey/plot.js:144 target: // plotly.js: traces/sankey/plot.js:145 -to upload here or click to choose a file from your computer. // react-chart-editor: /components/widgets/Dropzone.js:48 -to us. // react-chart-editor: /components/widgets/Dropzone.js:127 +to upload here or click to choose a file from your computer. // react-chart-editor: /components/widgets/Dropzone.js:49 +to us. // react-chart-editor: /components/widgets/Dropzone.js:128 trace // plotly.js: plots/plots.js:332 transforms allow you to create multiple traces from one source trace, so as to style them differently. // react-chart-editor: /components/containers/TransformAccordion.js:112 transforms allow you to filter data out from a trace. // react-chart-editor: /components/containers/TransformAccordion.js:107 transforms allow you to sort a trace, so as to control marker overlay or line connection order. // react-chart-editor: /components/containers/TransformAccordion.js:124 transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // react-chart-editor: /components/containers/TransformAccordion.js:118 -under Style panel. If X values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:80 -under Style panel. If Z values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:89 +under Style panel. If X values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:88 +under Style panel. If Z values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:97 upper fence: // plotly.js: traces/box/calc.js:142 x // react-chart-editor: /default_panels/StyleAxesPanel.js:208 x10^6 // react-chart-editor: /default_panels/StyleAxesPanel.js:186 -√ // react-chart-editor: /components/fields/ErrorBars.js:117 \ No newline at end of file +√ // react-chart-editor: /components/fields/ErrorBars.js:118 \ No newline at end of file diff --git a/scripts/translationKeys/translation-keys.txt b/scripts/translationKeys/translation-keys.txt index 294788d50..3f3e02feb 100644 --- a/scripts/translationKeys/translation-keys.txt +++ b/scripts/translationKeys/translation-keys.txt @@ -1,26 +1,26 @@ - Axis // /components/fields/AxesCreator.js:142 - panel under Structure to define traces. // /components/containers/TraceRequiredPanel.js:26 - panel under Style. If Y values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:71 - panel. // /components/fields/AxesCreator.js:155 - to upload here or click to choose a file from your computer. // /components/widgets/Dropzone.js:48 - to us. // /components/widgets/Dropzone.js:127 + Axis // /components/fields/AxesCreator.js:138 + panel under Structure to define traces. // /components/containers/TraceRequiredPanel.js:29 + panel under Style. If Y values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:79 + panel. // /components/fields/AxesCreator.js:153 + to upload here or click to choose a file from your computer. // /components/widgets/Dropzone.js:49 + to us. // /components/widgets/Dropzone.js:128 transforms allow you to create multiple traces from one source trace, so as to style them differently. // /components/containers/TransformAccordion.js:112 transforms allow you to filter data out from a trace. // /components/containers/TransformAccordion.js:107 transforms allow you to sort a trace, so as to control marker overlay or line connection order. // /components/containers/TransformAccordion.js:124 transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // /components/containers/TransformAccordion.js:118 - under Style panel. If X values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:80 - under Style panel. If Z values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:89 + under Style panel. If X values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:88 + under Style panel. If Z values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:97 # // /default_panels/StyleAxesPanel.js:210 $ // /default_panels/StyleAxesPanel.js:209 % // /components/fields/derived.js:509 -1 234,56 // /default_panels/StyleLayoutPanel.js:35 -1 234.56 // /default_panels/StyleLayoutPanel.js:34 -1,234.56 // /default_panels/StyleLayoutPanel.js:33 -1.234,56 // /default_panels/StyleLayoutPanel.js:36 +1 234,56 // /default_panels/StyleLayoutPanel.js:38 +1 234.56 // /default_panels/StyleLayoutPanel.js:37 +1,234.56 // /default_panels/StyleLayoutPanel.js:36 +1.234,56 // /default_panels/StyleLayoutPanel.js:39 135 // /default_panels/StyleAxesPanel.js:162 180 // /default_panels/StyleAxesPanel.js:163 -1:110,000,000 // /default_panels/GraphSubplotsPanel.js:211 -1:50,000,000 // /default_panels/GraphSubplotsPanel.js:211 +1:110,000,000 // /default_panels/GraphSubplotsPanel.js:215 +1:50,000,000 // /default_panels/GraphSubplotsPanel.js:216 2D Contour Histogram // /lib/computeTraceOptionsFromSchema.js:33 2D Histogram // /lib/computeTraceOptionsFromSchema.js:29 3D // /lib/traceTypes.js:33 @@ -33,714 +33,714 @@ $ 90 // /default_panels/StyleAxesPanel.js:161 @ // /default_panels/StyleAxesPanel.js:211 A // /components/fields/derived.js:551 -Above // /default_panels/StyleImagesPanel.js:35 +Above // /default_panels/StyleImagesPanel.js:38 Active Color // /default_panels/StyleAxesPanel.js:348 -Active Icon Color // /default_panels/StyleLayoutPanel.js:58 -Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest. // /components/containers/ShapeAccordion.js:58 +Active Icon Color // /default_panels/StyleLayoutPanel.js:61 +Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest. // /components/containers/ShapeAccordion.js:59 Advanced (d3-format) // /components/fields/derived.js:152 Advanced (d3-time-format) // /components/fields/derived.js:146 -Africa // /default_panels/GraphSubplotsPanel.js:104 +Africa // /default_panels/GraphSubplotsPanel.js:107 Aggregate // /components/containers/TransformAccordion.js:23 -Aggregations // /default_panels/GraphTransformsPanel.js:29 -Aitoff // /default_panels/GraphSubplotsPanel.js:138 -Albers USA // /default_panels/GraphSubplotsPanel.js:119 +Aggregations // /default_panels/GraphTransformsPanel.js:30 +Aitoff // /default_panels/GraphSubplotsPanel.js:141 +Albers USA // /default_panels/GraphSubplotsPanel.js:122 All // /default_panels/StyleAxesPanel.js:196 All points in a trace are colored in the same color. // /components/fields/MarkerColor.js:168 All traces will be colored in the the same color. // /components/fields/MarkerColor.js:110 All will be colored in the same color. // /components/fields/MultiColorPicker.js:89 -Ambient // /default_panels/StyleTracesPanel.js:518 -Anchor // /default_panels/StyleColorbarsPanel.js:85 +Ambient // /default_panels/StyleTracesPanel.js:530 +Anchor // /default_panels/StyleColorbarsPanel.js:94 Anchor Point // /default_panels/StyleAxesPanel.js:354 -Anchor to // /default_panels/GraphSubplotsPanel.js:31 +Anchor to // /default_panels/GraphSubplotsPanel.js:34 Angle // /default_panels/StyleAxesPanel.js:155 -Annotation // /components/containers/AnnotationAccordion.js:27 +Annotation // /components/containers/AnnotationAccordion.js:28 AnnotationArrowRef must be given either "axref" or "ayref" as attrs. Instead was given // /components/fields/derived.js:332 AnnotationRef must be given either "xref" or "yref" as attrs. Instead was given // /components/fields/derived.js:379 -Annotations are text and arrows you can use to point out specific parts of your figure. // /components/containers/AnnotationAccordion.js:53 -Any // /default_panels/StyleLayoutPanel.js:97 -Area // /default_panels/StyleTracesPanel.js:263 -Arrow // /default_panels/StyleNotesPanel.js:27 -Arrowhead // /default_panels/StyleNotesPanel.js:34 -Ascending // /default_panels/GraphTransformsPanel.js:85 -Asia // /default_panels/GraphSubplotsPanel.js:103 -Aspect Ratio // /default_panels/GraphSubplotsPanel.js:39 -Asymmetric // /components/fields/ErrorBars.js:78 +Annotations are text and arrows you can use to point out specific parts of your figure. // /components/containers/AnnotationAccordion.js:54 +Any // /default_panels/StyleLayoutPanel.js:100 +Area // /default_panels/StyleTracesPanel.js:269 +Arrow // /default_panels/StyleNotesPanel.js:30 +Arrowhead // /default_panels/StyleNotesPanel.js:37 +Ascending // /default_panels/GraphTransformsPanel.js:88 +Asia // /default_panels/GraphSubplotsPanel.js:106 +Aspect Ratio // /default_panels/GraphSubplotsPanel.js:42 +Asymmetric // /components/fields/ErrorBars.js:79 Atlas Map // /lib/computeTraceOptionsFromSchema.js:73 Auto // /components/fields/derived.js:494 Auto margins // /default_panels/StyleAxesPanel.js:147 -Average // /default_panels/GraphTransformsPanel.js:40 +Average // /default_panels/GraphTransformsPanel.js:41 Average // /components/fields/derived.js:133 -Axes // /DefaultEditor.js:81 -Axes to Use // /components/fields/AxesCreator.js:150 +Axes // /DefaultEditor.js:82 +Axes to Use // /components/fields/AxesCreator.js:146 AxesSelector must be nested within a connectAxesToPlot component // /components/fields/AxesSelector.js:13 Axis Background // /default_panels/StyleAxesPanel.js:128 Axis Line // /default_panels/StyleAxesPanel.js:80 Axis to Style // /components/fields/AxesSelector.js:44 -Azimuthal Equal Area // /default_panels/GraphSubplotsPanel.js:125 -Azimuthal Equidistant // /default_panels/GraphSubplotsPanel.js:127 +Azimuthal Equal Area // /default_panels/GraphSubplotsPanel.js:128 +Azimuthal Equidistant // /default_panels/GraphSubplotsPanel.js:130 B // /components/fields/derived.js:552 -Background // /default_panels/StyleSlidersPanel.js:19 +Background // /default_panels/StyleSlidersPanel.js:22 Background Color // /default_panels/StyleAxesPanel.js:300 Backward // /default_panels/StyleAxesPanel.js:337 -Bandwidth // /default_panels/StyleTracesPanel.js:571 +Bandwidth // /default_panels/StyleTracesPanel.js:583 Bar // /lib/computeTraceOptionsFromSchema.js:17 -Bar Mode // /default_panels/GraphSubplotsPanel.js:65 -Bar Options // /default_panels/GraphSubplotsPanel.js:63 -Bar Padding // /default_panels/GraphSubplotsPanel.js:69 -Bar Position // /default_panels/StyleTracesPanel.js:206 -Bar Size and Spacing // /default_panels/StyleTracesPanel.js:273 -Bar Width // /default_panels/StyleTracesPanel.js:299 +Bar Mode // /default_panels/GraphSubplotsPanel.js:68 +Bar Options // /default_panels/GraphSubplotsPanel.js:66 +Bar Padding // /default_panels/GraphSubplotsPanel.js:72 +Bar Position // /default_panels/StyleTracesPanel.js:212 +Bar Size and Spacing // /default_panels/StyleTracesPanel.js:279 +Bar Width // /default_panels/StyleTracesPanel.js:305 Bars // /components/containers/TraceMarkerSection.js:19 -Base // /default_panels/StyleTracesPanel.js:207 -Base Colors // /default_panels/StyleLayoutPanel.js:25 -Basic // /default_panels/GraphSubplotsPanel.js:77 -Bearing // /default_panels/GraphSubplotsPanel.js:91 -Below // /default_panels/StyleImagesPanel.js:35 -Binning // /default_panels/StyleTracesPanel.js:195 -Blank // /default_panels/StyleTracesPanel.js:427 -Border // /default_panels/StyleSlidersPanel.js:23 -Border Color // /default_panels/GraphSubplotsPanel.js:150 -Border Width // /default_panels/GraphSubplotsPanel.js:149 -Borders and Background // /default_panels/StyleColorbarsPanel.js:247 -Both // /default_panels/StyleTracesPanel.js:577 +Base // /default_panels/StyleTracesPanel.js:213 +Base Colors // /default_panels/StyleLayoutPanel.js:28 +Basic // /default_panels/GraphSubplotsPanel.js:80 +Bearing // /default_panels/GraphSubplotsPanel.js:94 +Below // /default_panels/StyleImagesPanel.js:38 +Binning // /default_panels/StyleTracesPanel.js:201 +Blank // /default_panels/StyleTracesPanel.js:439 +Border // /default_panels/StyleSlidersPanel.js:26 +Border Color // /default_panels/GraphSubplotsPanel.js:153 +Border Width // /default_panels/GraphSubplotsPanel.js:152 +Borders and Background // /default_panels/StyleColorbarsPanel.js:268 +Both // /default_panels/StyleTracesPanel.js:589 Bottom // /components/fields/derived.js:96 Bottom Center // /components/fields/derived.js:487 Bottom Left // /components/fields/derived.js:486 Bottom Right // /components/fields/derived.js:488 -Boundaries // /default_panels/GraphSubplotsPanel.js:22 -Box // /default_panels/StyleTracesPanel.js:593 -Box Fill Color // /default_panels/StyleTracesPanel.js:599 -Box Line Color // /default_panels/StyleTracesPanel.js:601 -Box Line Width // /default_panels/StyleTracesPanel.js:600 -Box Mean // /default_panels/StyleTracesPanel.js:583 -Box Mode // /default_panels/StyleTracesPanel.js:306 -Box Padding // /default_panels/StyleTracesPanel.js:311 -Box Size and Spacing // /default_panels/StyleTracesPanel.js:303 -Box Width // /default_panels/StyleTracesPanel.js:310 +Boundaries // /default_panels/GraphSubplotsPanel.js:25 +Box // /default_panels/StyleTracesPanel.js:605 +Box Fill Color // /default_panels/StyleTracesPanel.js:611 +Box Line Color // /default_panels/StyleTracesPanel.js:613 +Box Line Width // /default_panels/StyleTracesPanel.js:612 +Box Mean // /default_panels/StyleTracesPanel.js:595 +Box Mode // /default_panels/StyleTracesPanel.js:312 +Box Padding // /default_panels/StyleTracesPanel.js:320 +Box Size and Spacing // /default_panels/StyleTracesPanel.js:309 +Box Width // /default_panels/StyleTracesPanel.js:319 Boxes // /components/fields/derived.js:629 Boxes and Points // /components/fields/derived.js:631 -Button // /components/containers/RangeSelectorAccordion.js:38 -Button Labels // /default_panels/StyleUpdateMenusPanel.js:21 -Buttons // /components/containers/UpdateMenuAccordion.js:22 -By // /default_panels/GraphTransformsPanel.js:76 -By Type // /components/containers/TraceAccordion.js:166 +Button // /components/containers/RangeSelectorAccordion.js:39 +Button Labels // /default_panels/StyleUpdateMenusPanel.js:24 +Buttons // /components/containers/UpdateMenuAccordion.js:23 +By // /default_panels/GraphTransformsPanel.js:79 +By Type // /components/containers/TraceAccordion.js:167 C // /components/fields/derived.js:553 -Call out your data. // /components/containers/AnnotationAccordion.js:50 +Call out your data. // /components/containers/AnnotationAccordion.js:51 Candlestick // /lib/computeTraceOptionsFromSchema.js:121 Canvas // /components/fields/derived.js:388 Carpet // /lib/computeTraceOptionsFromSchema.js:105 Carpet Contour // /lib/computeTraceOptionsFromSchema.js:113 Carpet Scatter // /lib/computeTraceOptionsFromSchema.js:109 Categorical // /default_panels/StyleAxesPanel.js:50 -Cell Options // /default_panels/GraphCreatePanel.js:135 -Cells // /default_panels/StyleTracesPanel.js:162 +Cell Options // /default_panels/GraphCreatePanel.js:146 +Cells // /default_panels/StyleTracesPanel.js:168 Center // /default_panels/StyleAxesPanel.js:360 -Center Latitude // /default_panels/GraphSubplotsPanel.js:88 -Center Longitude // /default_panels/GraphSubplotsPanel.js:89 -Center of Mass // /default_panels/StyleTracesPanel.js:70 -Change // /default_panels/GraphTransformsPanel.js:49 -Charts like this by Plotly users. // /components/widgets/TraceTypeSelector.js:107 +Center Latitude // /default_panels/GraphSubplotsPanel.js:91 +Center Longitude // /default_panels/GraphSubplotsPanel.js:92 +Center of Mass // /default_panels/StyleTracesPanel.js:76 +Change // /default_panels/GraphTransformsPanel.js:50 +Charts like this by Plotly users. // /components/widgets/TraceTypeSelector.js:106 Choropleth // /lib/computeTraceOptionsFromSchema.js:77 -Click // /default_panels/StyleLayoutPanel.js:105 -Click Event // /default_panels/StyleLayoutPanel.js:110 -Click on the + button above to add a shape. // /components/containers/ShapeAccordion.js:61 -Click on the + button above to add a trace. // /components/containers/TraceAccordion.js:127 +Click // /default_panels/StyleLayoutPanel.js:108 +Click Event // /default_panels/StyleLayoutPanel.js:113 +Click on the + button above to add a shape. // /components/containers/ShapeAccordion.js:62 +Click on the + button above to add a trace. // /components/containers/TraceAccordion.js:128 Click on the + button above to add a transform. // /components/containers/TransformAccordion.js:128 -Click on the + button above to add an annotation. // /components/containers/AnnotationAccordion.js:56 -Click on the + button above to add an image. // /components/containers/ImageAccordion.js:61 +Click on the + button above to add an annotation. // /components/containers/AnnotationAccordion.js:57 +Click on the + button above to add an image. // /components/containers/ImageAccordion.js:62 Clockwise // /components/fields/derived.js:102 -Close // /default_panels/GraphCreatePanel.js:98 +Close // /default_panels/GraphCreatePanel.js:106 Closest // /components/fields/derived.js:661 -Coastlines // /default_panels/GraphSubplotsPanel.js:160 +Coastlines // /default_panels/GraphSubplotsPanel.js:163 Collapse All // /components/containers/PanelHeader.js:35 -Color // /components/fields/ErrorBars.js:102 +Color // /components/fields/ErrorBars.js:103 Color Bar // /components/fields/MarkerColor.js:188 -Color Bar Container // /default_panels/StyleColorbarsPanel.js:252 -Color Bars // /DefaultEditor.js:83 -Coloring // /default_panels/StyleTracesPanel.js:340 -Colors // /default_panels/StyleTracesPanel.js:79 -Colorscale // /default_panels/StyleTracesPanel.js:420 +Color Bar Container // /default_panels/StyleColorbarsPanel.js:277 +Color Bars // /DefaultEditor.js:84 +Coloring // /default_panels/StyleTracesPanel.js:352 +Colors // /default_panels/StyleTracesPanel.js:85 +Colorscale // /default_panels/StyleTracesPanel.js:432 Colorscale Direction // /components/fields/MarkerColor.js:183 Colorscale Range // /components/fields/MarkerColor.js:193 -Column Options // /default_panels/GraphCreatePanel.js:141 -Columns // /default_panels/GraphCreatePanel.js:109 +Column Options // /default_panels/GraphCreatePanel.js:152 +Columns // /default_panels/GraphCreatePanel.js:117 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // /lib/constants.js:24 Cone // /lib/computeTraceOptionsFromSchema.js:65 -Cone Anchor // /default_panels/StyleTracesPanel.js:65 -Cones & Streamtubes // /default_panels/StyleTracesPanel.js:57 -Conic Conformal // /default_panels/GraphSubplotsPanel.js:131 -Conic Equal Area // /default_panels/GraphSubplotsPanel.js:130 -Conic Equidistant // /default_panels/GraphSubplotsPanel.js:132 -Connect // /default_panels/StyleTracesPanel.js:427 -Connect Gaps // /default_panels/StyleTracesPanel.js:425 -Constant // /components/fields/ErrorBars.js:116 -Constraint // /default_panels/StyleTracesPanel.js:336 -Contain // /default_panels/StyleImagesPanel.js:26 -Continue // /components/widgets/text_editors/MultiFormat.js:192 -Continuing will convert your LaTeX expression into raw text. // /components/widgets/text_editors/MultiFormat.js:111 -Continuing will convert your note to LaTeX-style text. // /components/widgets/text_editors/MultiFormat.js:106 -Continuing will remove your expression. // /components/widgets/text_editors/MultiFormat.js:116 +Cone Anchor // /default_panels/StyleTracesPanel.js:71 +Cones & Streamtubes // /default_panels/StyleTracesPanel.js:60 +Conic Conformal // /default_panels/GraphSubplotsPanel.js:134 +Conic Equal Area // /default_panels/GraphSubplotsPanel.js:133 +Conic Equidistant // /default_panels/GraphSubplotsPanel.js:135 +Connect // /default_panels/StyleTracesPanel.js:439 +Connect Gaps // /default_panels/StyleTracesPanel.js:437 +Constant // /components/fields/ErrorBars.js:117 +Constraint // /default_panels/StyleTracesPanel.js:348 +Contain // /default_panels/StyleImagesPanel.js:29 +Continue // /components/widgets/text_editors/MultiFormat.js:193 +Continuing will convert your LaTeX expression into raw text. // /components/widgets/text_editors/MultiFormat.js:112 +Continuing will convert your note to LaTeX-style text. // /components/widgets/text_editors/MultiFormat.js:107 +Continuing will remove your expression. // /components/widgets/text_editors/MultiFormat.js:117 Contour // /lib/computeTraceOptionsFromSchema.js:41 -Contour Color // /default_panels/StyleTracesPanel.js:625 -Contour Labels // /default_panels/StyleTracesPanel.js:356 -Contour Lines // /default_panels/StyleTracesPanel.js:351 -Contour Width // /default_panels/StyleTracesPanel.js:626 -Contours // /default_panels/StyleTracesPanel.js:330 -Copy Y Style // /components/fields/ErrorBars.js:93 -Copy Z Style // /components/fields/ErrorBars.js:98 -Count // /default_panels/GraphTransformsPanel.js:38 +Contour Color // /default_panels/StyleTracesPanel.js:637 +Contour Labels // /default_panels/StyleTracesPanel.js:368 +Contour Lines // /default_panels/StyleTracesPanel.js:363 +Contour Width // /default_panels/StyleTracesPanel.js:638 +Contours // /default_panels/StyleTracesPanel.js:342 +Copy Y Style // /components/fields/ErrorBars.js:94 +Copy Z Style // /components/fields/ErrorBars.js:99 +Count // /default_panels/GraphTransformsPanel.js:39 Count // /components/fields/derived.js:131 Counter Clockwise // /default_panels/StyleAxesPanel.js:73 Counterclockwise // /components/fields/derived.js:103 Country Abbreviations (ISO-3) // /components/fields/LocationSelector.js:32 -Country Borders // /default_panels/GraphSubplotsPanel.js:144 +Country Borders // /default_panels/GraphSubplotsPanel.js:147 Country Names // /components/fields/LocationSelector.js:31 -Crossbar Width // /components/fields/ErrorBars.js:104 -Cube // /default_panels/GraphSubplotsPanel.js:44 -Cumulative // /default_panels/StyleTracesPanel.js:119 -Current Bin // /default_panels/StyleTracesPanel.js:134 +Crossbar Width // /components/fields/ErrorBars.js:105 +Cube // /default_panels/GraphSubplotsPanel.js:47 +Cumulative // /default_panels/StyleTracesPanel.js:125 +Current Bin // /default_panels/StyleTracesPanel.js:140 Custom // /components/fields/MarkerColor.js:195 -Custom Data // /components/fields/ErrorBars.js:123 -Dark // /default_panels/GraphSubplotsPanel.js:80 -Data // /components/fields/ErrorBars.js:118 +Custom Data // /components/fields/ErrorBars.js:124 +Dark // /default_panels/GraphSubplotsPanel.js:83 +Data // /components/fields/ErrorBars.js:119 Date // /default_panels/StyleAxesPanel.js:49 Day // /default_panels/StyleAxesPanel.js:324 -Decreasing // /default_panels/StyleTracesPanel.js:130 -Decreasing Trace Styles // /default_panels/StyleTracesPanel.js:543 +Decreasing // /default_panels/StyleTracesPanel.js:136 +Decreasing Trace Styles // /default_panels/StyleTracesPanel.js:555 Default // /components/fields/derived.js:145 -Defaults // /default_panels/StyleLayoutPanel.js:22 -Degrees // /default_panels/GraphCreatePanel.js:118 -Density // /default_panels/StyleTracesPanel.js:113 -Descending // /default_panels/GraphTransformsPanel.js:86 -Diagonal // /default_panels/StyleLayoutPanel.js:100 -Diameter // /default_panels/StyleTracesPanel.js:263 -Diffuse // /default_panels/StyleTracesPanel.js:519 +Defaults // /default_panels/StyleLayoutPanel.js:25 +Degrees // /default_panels/GraphCreatePanel.js:129 +Density // /default_panels/StyleTracesPanel.js:119 +Descending // /default_panels/GraphTransformsPanel.js:89 +Diagonal // /default_panels/StyleLayoutPanel.js:103 +Diameter // /default_panels/StyleTracesPanel.js:269 +Diffuse // /default_panels/StyleTracesPanel.js:531 Direction // /default_panels/StyleAxesPanel.js:69 Disable // /components/fields/derived.js:664 -Disabled // /default_panels/GraphTransformsPanel.js:73 -Display // /default_panels/StyleTracesPanel.js:180 +Disabled // /default_panels/GraphTransformsPanel.js:76 +Display // /default_panels/StyleTracesPanel.js:186 Distributions // /lib/traceTypes.js:21 Divergence // /components/fields/derived.js:574 -Drag // /default_panels/StyleLayoutPanel.js:79 -Drop the // /components/widgets/Dropzone.js:46 -Dropdown // /components/containers/UpdateMenuAccordion.js:21 +Drag // /default_panels/StyleLayoutPanel.js:82 +Drop the // /components/widgets/Dropzone.js:47 +Dropdown // /components/containers/UpdateMenuAccordion.js:22 E+6 // /default_panels/StyleAxesPanel.js:185 Each point in a trace is colored according to data. // /components/fields/MarkerColor.js:169 Each trace will be colored according to the selected colorscale. // /components/fields/MarkerColor.js:109 Each will be colored according to the selected colors. // /components/fields/MultiColorPicker.js:85 -Eckert 4 // /default_panels/GraphSubplotsPanel.js:124 -Edit in HTML // /components/widgets/text_editors/MultiFormat.js:29 -Edit in Rich Text // /components/widgets/text_editors/MultiFormat.js:224 -Ellipse // /default_panels/StyleShapesPanel.js:26 -Embed images in your figure to make the data more readable or to brand your content. // /components/containers/ImageAccordion.js:58 +Eckert 4 // /default_panels/GraphSubplotsPanel.js:127 +Edit in HTML // /components/widgets/text_editors/MultiFormat.js:30 +Edit in Rich Text // /components/widgets/text_editors/MultiFormat.js:225 +Ellipse // /default_panels/StyleShapesPanel.js:29 +Embed images in your figure to make the data more readable or to brand your content. // /components/containers/ImageAccordion.js:59 Enable // /default_panels/StyleAxesPanel.js:65 -Enabled // /default_panels/GraphTransformsPanel.js:73 -End Point // /default_panels/StyleShapesPanel.js:33 -Enter LaTeX formatted text // /components/fields/TextEditor.js:35 -Enter Link URL // /components/widgets/text_editors/RichText/LinkEditor.js:89 -Enter html formatted text // /components/fields/TextEditor.js:40 -Equirectangular // /default_panels/GraphSubplotsPanel.js:115 -Error (+) // /components/fields/ErrorBars.js:146 -Error (-) // /components/fields/ErrorBars.js:147 -Error Bars X // /default_panels/StyleTracesPanel.js:635 -Error Bars Y // /default_panels/StyleTracesPanel.js:643 -Error Bars Z // /default_panels/StyleTracesPanel.js:650 -Error Type // /components/fields/ErrorBars.js:112 -Europe // /default_panels/GraphSubplotsPanel.js:102 +Enabled // /default_panels/GraphTransformsPanel.js:76 +End Point // /default_panels/StyleShapesPanel.js:36 +Enter LaTeX formatted text // /components/fields/TextEditor.js:36 +Enter Link URL // /components/widgets/text_editors/RichText/LinkEditor.js:90 +Enter html formatted text // /components/fields/TextEditor.js:41 +Equirectangular // /default_panels/GraphSubplotsPanel.js:118 +Error (+) // /components/fields/ErrorBars.js:147 +Error (-) // /components/fields/ErrorBars.js:148 +Error Bars X // /default_panels/StyleTracesPanel.js:647 +Error Bars Y // /default_panels/StyleTracesPanel.js:655 +Error Bars Z // /default_panels/StyleTracesPanel.js:662 +Error Type // /components/fields/ErrorBars.js:113 +Europe // /default_panels/GraphSubplotsPanel.js:105 Every label // /default_panels/StyleAxesPanel.js:222 Exclude // /components/fields/FilterOperation.js:30 Exclude Range // /components/fields/FilterOperation.js:79 Exclude Values // /components/fields/FilterOperation.js:87 Expand All // /components/containers/PanelHeader.js:40 Exponents // /default_panels/StyleAxesPanel.js:179 -Extended Colors // /default_panels/StyleTracesPanel.js:81 -Face Normal // /default_panels/StyleTracesPanel.js:524 -Facecolor // /default_panels/GraphCreatePanel.js:148 +Extended Colors // /default_panels/StyleTracesPanel.js:87 +Face Normal // /default_panels/StyleTracesPanel.js:536 +Facecolor // /default_panels/GraphCreatePanel.js:159 False // /default_panels/StyleAxesPanel.js:149 -File loaded! // /components/widgets/Dropzone.js:31 -Fill // /default_panels/StyleImagesPanel.js:27 -Fill Color // /default_panels/GraphCreatePanel.js:130 -Fill to // /default_panels/StyleTracesPanel.js:431 -Filled Area // /default_panels/StyleTracesPanel.js:430 +File loaded! // /components/widgets/Dropzone.js:32 +Fill // /default_panels/StyleImagesPanel.js:30 +Fill Color // /default_panels/GraphCreatePanel.js:141 +Fill to // /default_panels/StyleTracesPanel.js:443 +Filled Area // /default_panels/StyleTracesPanel.js:442 Fills // /components/fields/derived.js:644 Filter // /components/containers/TransformAccordion.js:21 Finance // /lib/traceTypes.js:17 -First // /default_panels/GraphTransformsPanel.js:47 +First // /default_panels/GraphTransformsPanel.js:48 First label // /default_panels/StyleAxesPanel.js:223 -Fixed Width // /default_panels/StyleLayoutPanel.js:69 -Fixed height // /default_panels/StyleLayoutPanel.js:70 -Flatshading // /default_panels/StyleTracesPanel.js:191 -Font // /default_panels/StyleSlidersPanel.js:27 -Font Color // /default_panels/GraphCreatePanel.js:131 -Font Size // /default_panels/GraphCreatePanel.js:132 -Fraction // /default_panels/StyleTracesPanel.js:294 -Fraction of Plot // /default_panels/StyleColorbarsPanel.js:62 -Fraction of canvas // /default_panels/StyleSlidersPanel.js:38 +Fixed Width // /default_panels/StyleLayoutPanel.js:72 +Fixed height // /default_panels/StyleLayoutPanel.js:73 +Flatshading // /default_panels/StyleTracesPanel.js:197 +Font // /default_panels/StyleSlidersPanel.js:30 +Font Color // /default_panels/GraphCreatePanel.js:142 +Font Size // /default_panels/GraphCreatePanel.js:143 +Fraction // /default_panels/StyleTracesPanel.js:300 +Fraction of Plot // /default_panels/StyleColorbarsPanel.js:71 +Fraction of canvas // /default_panels/StyleSlidersPanel.js:41 Free // /components/fields/derived.js:33 -Fresnel // /default_panels/StyleTracesPanel.js:522 -Gap Between Groups // /default_panels/StyleLegendPanel.js:75 -Gaps // /default_panels/StyleTracesPanel.js:374 -Gaps Between Cells // /default_panels/StyleTracesPanel.js:498 -Gaps in Data // /default_panels/StyleTracesPanel.js:507 -General // /DefaultEditor.js:79 +Fresnel // /default_panels/StyleTracesPanel.js:534 +Gap Between Groups // /default_panels/StyleLegendPanel.js:78 +Gaps // /default_panels/StyleTracesPanel.js:386 +Gaps Between Cells // /default_panels/StyleTracesPanel.js:510 +Gaps in Data // /default_panels/StyleTracesPanel.js:519 +General // /DefaultEditor.js:80 Geo // /lib/constants.js:101 -Gnomonic // /default_panels/GraphSubplotsPanel.js:133 -Go back // /components/widgets/text_editors/MultiFormat.js:185 -Go to the // /components/containers/TraceRequiredPanel.js:24 -Gradians // /default_panels/GraphCreatePanel.js:119 +Gnomonic // /default_panels/GraphSubplotsPanel.js:136 +Go back // /components/widgets/text_editors/MultiFormat.js:186 +Go to the // /components/containers/TraceRequiredPanel.js:27 +Gradians // /default_panels/GraphCreatePanel.js:130 Grid Lines // /default_panels/StyleAxesPanel.js:98 Grid Spacing // /default_panels/StyleAxesPanel.js:109 -Group // /default_panels/StyleTracesPanel.js:54 -Grouped // /default_panels/StyleLegendPanel.js:71 -Half // /default_panels/StyleTracesPanel.js:139 -Hammer // /default_panels/GraphSubplotsPanel.js:136 -Hard // /default_panels/StyleTracesPanel.js:567 -Header // /default_panels/StyleTracesPanel.js:144 -Header Options // /default_panels/GraphCreatePanel.js:129 -Headers // /default_panels/GraphCreatePanel.js:108 -Heads up! // /components/widgets/text_editors/MultiFormat.js:169 -Heatmap // /default_panels/StyleTracesPanel.js:344 +Group // /default_panels/StyleTracesPanel.js:57 +Grouped // /default_panels/StyleLegendPanel.js:74 +Half // /default_panels/StyleTracesPanel.js:145 +Hammer // /default_panels/GraphSubplotsPanel.js:139 +Hard // /default_panels/StyleTracesPanel.js:579 +Header // /default_panels/StyleTracesPanel.js:150 +Header Options // /default_panels/GraphCreatePanel.js:140 +Headers // /default_panels/GraphCreatePanel.js:116 +Heads up! // /components/widgets/text_editors/MultiFormat.js:170 +Heatmap // /default_panels/StyleTracesPanel.js:356 Heatmap GL // /lib/computeTraceOptionsFromSchema.js:89 Height // /default_panels/StyleAxesPanel.js:299 Hide // /components/fields/MarkerColor.js:190 -High // /default_panels/GraphCreatePanel.js:96 +High // /default_panels/GraphCreatePanel.js:104 Histogram // /lib/computeTraceOptionsFromSchema.js:25 -Histogram Function // /default_panels/StyleTracesPanel.js:106 -Histogram Normalization // /default_panels/StyleTracesPanel.js:108 -Hole // /default_panels/GraphSubplotsPanel.js:226 -Hole Size // /default_panels/StyleTracesPanel.js:227 -Horizontal // /default_panels/GraphCreatePanel.js:63 -Horizontal Boundaries // /default_panels/StyleShapesPanel.js:30 -Horizontal Gap // /default_panels/StyleTracesPanel.js:499 -Horizontal Gaps // /default_panels/StyleTracesPanel.js:503 +Histogram Function // /default_panels/StyleTracesPanel.js:112 +Histogram Normalization // /default_panels/StyleTracesPanel.js:114 +Hole // /default_panels/GraphSubplotsPanel.js:232 +Hole Size // /default_panels/StyleTracesPanel.js:233 +Horizontal // /default_panels/GraphCreatePanel.js:71 +Horizontal Boundaries // /default_panels/StyleShapesPanel.js:33 +Horizontal Gap // /default_panels/StyleTracesPanel.js:511 +Horizontal Gaps // /default_panels/StyleTracesPanel.js:515 Horizontal Positioning // /default_panels/StyleAxesPanel.js:352 Hour // /default_panels/StyleAxesPanel.js:325 -Hover // /default_panels/StyleLayoutPanel.js:115 -Hover Action // /default_panels/StyleTracesPanel.js:630 -Hover on // /default_panels/StyleTracesPanel.js:631 -I (Optional) // /default_panels/GraphCreatePanel.js:92 -Icon Color // /default_panels/StyleLayoutPanel.js:57 -Image // /components/containers/ImageAccordion.js:21 -Images // /DefaultEditor.js:86 +Hover // /default_panels/StyleLayoutPanel.js:118 +Hover Action // /default_panels/StyleTracesPanel.js:642 +Hover on // /default_panels/StyleTracesPanel.js:643 +I (Optional) // /default_panels/GraphCreatePanel.js:100 +Icon Color // /default_panels/StyleLayoutPanel.js:60 +Image // /components/containers/ImageAccordion.js:22 +Images // /DefaultEditor.js:87 Include // /components/fields/FilterOperation.js:29 Include Range // /components/fields/FilterOperation.js:75 Include Values // /components/fields/FilterOperation.js:83 -Increasing // /default_panels/StyleTracesPanel.js:129 -Increasing Trace Styles // /default_panels/StyleTracesPanel.js:531 -Individually // /components/containers/TraceAccordion.js:165 +Increasing // /default_panels/StyleTracesPanel.js:135 +Increasing Trace Styles // /default_panels/StyleTracesPanel.js:543 +Individually // /components/containers/TraceAccordion.js:166 Inequality // /components/fields/FilterOperation.js:71 -Infer Zero // /default_panels/StyleTracesPanel.js:377 +Infer Zero // /default_panels/StyleTracesPanel.js:389 Inside // /components/fields/derived.js:492 -Intensity // /default_panels/GraphCreatePanel.js:147 -Interactions // /default_panels/StyleLayoutPanel.js:78 -Interpolate // /default_panels/StyleTracesPanel.js:378 -Interpolate Gaps // /default_panels/StyleTracesPanel.js:512 -J (Optional) // /default_panels/GraphCreatePanel.js:93 -Jitter // /default_panels/StyleTracesPanel.js:249 -K (Optional) // /default_panels/GraphCreatePanel.js:94 +Intensity // /default_panels/GraphCreatePanel.js:158 +Interactions // /default_panels/StyleLayoutPanel.js:81 +Interpolate // /default_panels/StyleTracesPanel.js:390 +Interpolate Gaps // /default_panels/StyleTracesPanel.js:524 +J (Optional) // /default_panels/GraphCreatePanel.js:101 +Jitter // /default_panels/StyleTracesPanel.js:255 +K (Optional) // /default_panels/GraphCreatePanel.js:102 KDE // /components/fields/derived.js:637 -Kavrayskiy 7 // /default_panels/GraphSubplotsPanel.js:123 -LaTeX // /components/widgets/text_editors/MultiFormat.js:24 -LaTeX is a math typesetting language that doesn't work with rich text. // /components/widgets/text_editors/MultiFormat.js:105 +Kavrayskiy 7 // /default_panels/GraphSubplotsPanel.js:126 +LaTeX // /components/widgets/text_editors/MultiFormat.js:25 +LaTeX is a math typesetting language that doesn't work with rich text. // /components/widgets/text_editors/MultiFormat.js:106 Label // /components/fields/derived.js:507 Label Format // /default_panels/StyleAxesPanel.js:168 -Label Prefix // /default_panels/StyleColorbarsPanel.js:156 -Label Suffix // /default_panels/StyleColorbarsPanel.js:182 -Labels // /default_panels/GraphCreatePanel.js:34 -Lakes // /default_panels/GraphSubplotsPanel.js:182 -Land // /default_panels/GraphSubplotsPanel.js:175 -Lasso // /default_panels/StyleLayoutPanel.js:87 -Last // /default_panels/GraphTransformsPanel.js:48 +Label Prefix // /default_panels/StyleColorbarsPanel.js:171 +Label Suffix // /default_panels/StyleColorbarsPanel.js:197 +Labels // /default_panels/GraphCreatePanel.js:42 +Lakes // /default_panels/GraphSubplotsPanel.js:185 +Land // /default_panels/GraphSubplotsPanel.js:178 +Lasso // /default_panels/StyleLayoutPanel.js:90 +Last // /default_panels/GraphTransformsPanel.js:49 Last label // /default_panels/StyleAxesPanel.js:224 Lat/Lon // /components/fields/LocationSelector.js:99 Latitude // /components/fields/derived.js:545 -Layout // /default_panels/StyleLayoutPanel.js:61 +Layout // /default_panels/StyleLayoutPanel.js:64 Left // /components/fields/derived.js:91 -Legend // /default_panels/StyleLegendPanel.js:16 -Legend Box // /default_panels/StyleLegendPanel.js:26 -Legend Group // /default_panels/StyleTracesPanel.js:54 +Legend // /default_panels/StyleLegendPanel.js:19 +Legend Box // /default_panels/StyleLegendPanel.js:29 +Legend Group // /default_panels/StyleTracesPanel.js:57 Length // /default_panels/StyleAxesPanel.js:278 -Length Mode // /default_panels/StyleSlidersPanel.js:35 -Levels // /default_panels/StyleTracesPanel.js:335 -Light // /default_panels/GraphSubplotsPanel.js:79 -Light Position // /default_panels/StyleTracesPanel.js:526 -Lighting // /default_panels/StyleTracesPanel.js:517 -Line // /default_panels/StyleShapesPanel.js:24 -Line Color // /default_panels/StyleTracesPanel.js:534 -Line Width // /default_panels/StyleNotesPanel.js:32 +Length Mode // /default_panels/StyleSlidersPanel.js:38 +Levels // /default_panels/StyleTracesPanel.js:347 +Light // /default_panels/GraphSubplotsPanel.js:82 +Light Position // /default_panels/StyleTracesPanel.js:538 +Lighting // /default_panels/StyleTracesPanel.js:529 +Line // /default_panels/StyleShapesPanel.js:27 +Line Color // /default_panels/StyleTracesPanel.js:546 +Line Width // /default_panels/StyleNotesPanel.js:35 Linear // /default_panels/StyleAxesPanel.js:47 Lines // /default_panels/StyleAxesPanel.js:79 -Lines, Rectangles and Ellipses. // /components/containers/ShapeAccordion.js:55 -Loading... // /components/widgets/Dropzone.js:110 +Lines, Rectangles and Ellipses. // /components/containers/ShapeAccordion.js:56 +Loading... // /components/widgets/Dropzone.js:111 Location // /components/fields/derived.js:540 Location Format // /components/fields/LocationSelector.js:27 Locations // /components/fields/LocationSelector.js:25 Log // /default_panels/StyleAxesPanel.js:48 -Logos, watermarks and more. // /components/containers/ImageAccordion.js:55 +Logos, watermarks and more. // /components/containers/ImageAccordion.js:56 Longitude // /components/fields/derived.js:545 -Looks like there aren't any traces defined yet. // /components/containers/TraceRequiredPanel.js:22 -Low // /default_panels/GraphCreatePanel.js:97 +Looks like there aren't any traces defined yet. // /components/containers/TraceRequiredPanel.js:25 +Low // /default_panels/GraphCreatePanel.js:105 Lower < Target < Upper // /components/fields/FilterOperation.js:19 Lower < Target ≤ Upper // /components/fields/FilterOperation.js:21 Lower Bound // /components/fields/FilterOperation.js:169 Lower ≤ Target < Upper // /components/fields/FilterOperation.js:20 Lower ≤ Target ≤ Upper // /components/fields/FilterOperation.js:18 -Manual // /default_panels/GraphSubplotsPanel.js:46 -Map Frame // /default_panels/GraphSubplotsPanel.js:198 -Map Options // /default_panels/GraphSubplotsPanel.js:207 -Map Positioning // /default_panels/GraphSubplotsPanel.js:87 -Map Projection // /default_panels/GraphSubplotsPanel.js:95 -Map Style // /default_panels/GraphSubplotsPanel.js:72 +Manual // /default_panels/GraphSubplotsPanel.js:49 +Map Frame // /default_panels/GraphSubplotsPanel.js:201 +Map Options // /default_panels/GraphSubplotsPanel.js:210 +Map Positioning // /default_panels/GraphSubplotsPanel.js:90 +Map Projection // /default_panels/GraphSubplotsPanel.js:98 +Map Style // /default_panels/GraphSubplotsPanel.js:75 Mapbox // /lib/constants.js:102 -Mapbox Style // /default_panels/GraphSubplotsPanel.js:74 +Mapbox Style // /default_panels/GraphSubplotsPanel.js:77 Maps // /lib/traceTypes.js:25 -Margin Color // /default_panels/StyleLayoutPanel.js:24 +Margin Color // /default_panels/StyleLayoutPanel.js:27 Max // /components/fields/MarkerColor.js:200 -Max Contour // /default_panels/StyleTracesPanel.js:369 -Max Contours // /default_panels/StyleTracesPanel.js:365 +Max Contour // /default_panels/StyleTracesPanel.js:381 +Max Contours // /default_panels/StyleTracesPanel.js:377 Max Number of Labels // /default_panels/StyleAxesPanel.js:261 Max Number of Lines // /default_panels/StyleAxesPanel.js:116 Max Number of Markers // /default_panels/StyleAxesPanel.js:289 -Max Number of Points // /default_panels/StyleTracesPanel.js:269 -Max Tube segments // /default_panels/StyleTracesPanel.js:74 -Max X Bins // /default_panels/StyleTracesPanel.js:199 -Max Y Bins // /default_panels/StyleTracesPanel.js:204 +Max Number of Points // /default_panels/StyleTracesPanel.js:275 +Max Tube segments // /default_panels/StyleTracesPanel.js:80 +Max X Bins // /default_panels/StyleTracesPanel.js:205 +Max Y Bins // /default_panels/StyleTracesPanel.js:210 Maximum // /components/fields/derived.js:135 -Mean // /default_panels/StyleTracesPanel.js:587 -Mean & SD // /default_panels/StyleTracesPanel.js:588 -Meanline // /default_panels/StyleTracesPanel.js:603 -Meanline Color // /default_panels/StyleTracesPanel.js:609 -Meanline Width // /default_panels/StyleTracesPanel.js:608 -Median // /default_panels/GraphTransformsPanel.js:41 -Menus // /DefaultEditor.js:88 -Mercator // /default_panels/GraphSubplotsPanel.js:116 +Mean // /default_panels/StyleTracesPanel.js:599 +Mean & SD // /default_panels/StyleTracesPanel.js:600 +Meanline // /default_panels/StyleTracesPanel.js:615 +Meanline Color // /default_panels/StyleTracesPanel.js:621 +Meanline Width // /default_panels/StyleTracesPanel.js:620 +Median // /default_panels/GraphTransformsPanel.js:42 +Menus // /DefaultEditor.js:89 +Mercator // /default_panels/GraphSubplotsPanel.js:119 Middle // /default_panels/StyleAxesPanel.js:374 Middle Center // /components/fields/derived.js:484 Middle Left // /components/fields/derived.js:483 Middle Right // /components/fields/derived.js:485 -Miller // /default_panels/GraphSubplotsPanel.js:122 +Miller // /default_panels/GraphSubplotsPanel.js:125 Min // /components/fields/MarkerColor.js:199 -Min Contour // /default_panels/StyleTracesPanel.js:368 +Min Contour // /default_panels/StyleTracesPanel.js:380 Minimum // /components/fields/derived.js:134 -Minimum Size // /default_panels/StyleTracesPanel.js:265 +Minimum Size // /default_panels/StyleTracesPanel.js:271 Minute // /default_panels/StyleAxesPanel.js:326 Mirror Axis // /default_panels/StyleAxesPanel.js:92 -Mode // /default_panels/GraphTransformsPanel.js:42 -Modebar // /default_panels/StyleLayoutPanel.js:51 -Mollweide // /default_panels/GraphSubplotsPanel.js:135 +Mode // /default_panels/GraphTransformsPanel.js:43 +Modebar // /default_panels/StyleLayoutPanel.js:54 +Mollweide // /default_panels/GraphSubplotsPanel.js:138 Month // /default_panels/StyleAxesPanel.js:323 Multiple // /components/fields/MultiColorPicker.js:77 Multiple Values // /lib/constants.js:18 -Name // /default_panels/StyleTracesPanel.js:45 -Natural Earth // /default_panels/GraphSubplotsPanel.js:118 -Negative // /default_panels/StyleTracesPanel.js:579 -No // /components/fields/ErrorBars.js:95 -No Results // /components/widgets/Dropdown.js:75 +Name // /default_panels/StyleTracesPanel.js:48 +Natural Earth // /default_panels/GraphSubplotsPanel.js:121 +Negative // /default_panels/StyleTracesPanel.js:591 +No // /components/fields/ErrorBars.js:96 +No Results // /components/widgets/Dropdown.js:76 None // /components/fields/derived.js:59 -None label // /default_panels/StyleColorbarsPanel.js:177 +None label // /default_panels/StyleColorbarsPanel.js:192 Norm // /components/fields/derived.js:573 Normal // /components/fields/MarkerColor.js:185 -Normalization // /default_panels/StyleTracesPanel.js:290 -North America // /default_panels/GraphSubplotsPanel.js:105 -Note Text // /default_panels/StyleNotesPanel.js:20 -Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:85 -Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:76 -Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:67 -Number format // /default_panels/StyleLayoutPanel.js:30 -Number of Contours // /default_panels/StyleTracesPanel.js:361 -Number of Occurences // /default_panels/StyleTracesPanel.js:110 +Normalization // /default_panels/StyleTracesPanel.js:296 +North America // /default_panels/GraphSubplotsPanel.js:108 +Note Text // /default_panels/StyleNotesPanel.js:23 +Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:93 +Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:84 +Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:75 +Number format // /default_panels/StyleLayoutPanel.js:33 +Number of Contours // /default_panels/StyleTracesPanel.js:373 +Number of Occurences // /default_panels/StyleTracesPanel.js:116 OHLC // /lib/computeTraceOptionsFromSchema.js:117 -Oceans // /default_panels/GraphSubplotsPanel.js:168 +Oceans // /default_panels/GraphSubplotsPanel.js:171 Off // /components/fields/RectanglePositioner.js:87 -Offset // /default_panels/StyleTracesPanel.js:208 +Offset // /default_panels/StyleTracesPanel.js:214 On // /components/fields/RectanglePositioner.js:87 -On Hover // /default_panels/StyleTracesPanel.js:611 -Opacity // /default_panels/StyleShapesPanel.js:48 -Open // /default_panels/GraphCreatePanel.js:95 -Operator // /default_panels/GraphTransformsPanel.js:79 -Options // /default_panels/GraphCreatePanel.js:146 -Orbit // /default_panels/StyleLayoutPanel.js:88 -Order // /default_panels/GraphCreatePanel.js:143 -Orientation // /default_panels/GraphCreatePanel.js:61 -Orthographic // /default_panels/GraphSubplotsPanel.js:117 -Outdoors // /default_panels/GraphSubplotsPanel.js:78 -Outliers // /default_panels/StyleTracesPanel.js:232 +On Hover // /default_panels/StyleTracesPanel.js:623 +Opacity // /default_panels/StyleShapesPanel.js:51 +Open // /default_panels/GraphCreatePanel.js:103 +Operator // /default_panels/GraphTransformsPanel.js:82 +Options // /default_panels/GraphCreatePanel.js:157 +Orbit // /default_panels/StyleLayoutPanel.js:91 +Order // /default_panels/GraphCreatePanel.js:154 +Orientation // /default_panels/GraphCreatePanel.js:69 +Orthographic // /default_panels/GraphSubplotsPanel.js:120 +Outdoors // /default_panels/GraphSubplotsPanel.js:81 +Outliers // /default_panels/StyleTracesPanel.js:238 Outside // /components/fields/derived.js:493 -Overlay // /default_panels/GraphSubplotsPanel.js:67 -Padding // /default_panels/StyleColorbarsPanel.js:111 -Pan // /default_panels/StyleLayoutPanel.js:86 +Overlay // /default_panels/GraphSubplotsPanel.js:70 +Padding // /default_panels/StyleColorbarsPanel.js:120 +Pan // /default_panels/StyleLayoutPanel.js:89 Parallel Coordinates // /lib/computeTraceOptionsFromSchema.js:93 Percent // /components/fields/derived.js:561 -Pie // /components/containers/SubplotAccordion.js:132 -Pie Colors // /default_panels/StyleTracesPanel.js:77 +Pie // /components/containers/SubplotAccordion.js:133 +Pie Colors // /default_panels/StyleTracesPanel.js:83 Pie Segments // /components/containers/TraceMarkerSection.js:21 -Pie Title // /default_panels/StyleTracesPanel.js:87 -Pitch // /default_panels/GraphSubplotsPanel.js:92 -Pixels // /default_panels/StyleColorbarsPanel.js:63 -Plot Background // /default_panels/GraphSubplotsPanel.js:60 +Pie Title // /default_panels/StyleTracesPanel.js:93 +Pitch // /default_panels/GraphSubplotsPanel.js:95 +Pixels // /default_panels/StyleColorbarsPanel.js:72 +Plot Background // /default_panels/GraphSubplotsPanel.js:63 Point Cloud // /lib/computeTraceOptionsFromSchema.js:85 -Point Opacity // /default_panels/StyleTracesPanel.js:252 +Point Opacity // /default_panels/StyleTracesPanel.js:258 Points // /components/containers/TraceMarkerSection.js:23 Points and Fills // /components/fields/derived.js:645 Polar // /lib/constants.js:103 Polar Bar // /lib/computeTraceOptionsFromSchema.js:133 Polar Scatter // /lib/computeTraceOptionsFromSchema.js:125 Polar Scatter GL // /lib/computeTraceOptionsFromSchema.js:129 -Polar Sector // /default_panels/GraphSubplotsPanel.js:223 +Polar Sector // /default_panels/GraphSubplotsPanel.js:229 Position // /default_panels/StyleAxesPanel.js:90 -Positive // /default_panels/StyleTracesPanel.js:578 +Positive // /default_panels/StyleTracesPanel.js:590 Prefix // /default_panels/StyleAxesPanel.js:204 Previous X // /components/fields/derived.js:597 Previous Y // /components/fields/derived.js:596 -Probability // /default_panels/StyleTracesPanel.js:112 -Probability Density // /default_panels/StyleTracesPanel.js:114 -Projection // /default_panels/GraphSubplotsPanel.js:111 -Pull // /default_panels/StyleTracesPanel.js:228 +Probability // /default_panels/StyleTracesPanel.js:118 +Probability Density // /default_panels/StyleTracesPanel.js:120 +Projection // /default_panels/GraphSubplotsPanel.js:114 +Pull // /default_panels/StyleTracesPanel.js:234 R // /components/fields/derived.js:556 -RMS // /default_panels/GraphTransformsPanel.js:43 -Radians // /default_panels/GraphCreatePanel.js:117 -Radius // /default_panels/GraphCreatePanel.js:112 -Range // /default_panels/GraphTransformsPanel.js:50 +RMS // /default_panels/GraphTransformsPanel.js:44 +Radians // /default_panels/GraphCreatePanel.js:128 +Radius // /default_panels/GraphCreatePanel.js:123 +Range // /default_panels/GraphTransformsPanel.js:51 Range Slider // /default_panels/StyleAxesPanel.js:294 -Rectangle // /default_panels/StyleShapesPanel.js:25 +Rectangle // /default_panels/StyleShapesPanel.js:28 Reference // /components/fields/FilterOperation.js:167 -Region // /default_panels/GraphSubplotsPanel.js:97 -Relative // /default_panels/StyleTracesPanel.js:285 -Relative To // /default_panels/StyleImagesPanel.js:51 -Relative to // /default_panels/StyleShapesPanel.js:31 -Relative to Grid // /default_panels/StyleImagesPanel.js:33 -Rendering // /components/fields/TraceSelector.js:136 -Resolution // /default_panels/GraphSubplotsPanel.js:209 +Region // /default_panels/GraphSubplotsPanel.js:100 +Relative // /default_panels/StyleTracesPanel.js:291 +Relative To // /default_panels/StyleImagesPanel.js:54 +Relative to // /default_panels/StyleShapesPanel.js:34 +Relative to Grid // /default_panels/StyleImagesPanel.js:36 +Rendering // /components/fields/TraceSelector.js:140 +Resolution // /default_panels/GraphSubplotsPanel.js:212 Reversed // /components/fields/MarkerColor.js:185 -Reversed and Grouped // /default_panels/StyleLegendPanel.js:72 -Rich Text // /components/widgets/text_editors/MultiFormat.js:19 -Rich text is incompatible with LaTeX. // /components/widgets/text_editors/MultiFormat.js:110 +Reversed and Grouped // /default_panels/StyleLegendPanel.js:75 +Rich Text // /components/widgets/text_editors/MultiFormat.js:20 +Rich text is incompatible with LaTeX. // /components/widgets/text_editors/MultiFormat.js:111 Right // /components/fields/derived.js:91 -Rivers // /default_panels/GraphSubplotsPanel.js:189 -Robinson // /default_panels/GraphSubplotsPanel.js:121 -Roll // /default_panels/GraphSubplotsPanel.js:216 -Rotation // /default_panels/StyleTracesPanel.js:226 -Roughness // /default_panels/StyleTracesPanel.js:521 +Rivers // /default_panels/GraphSubplotsPanel.js:192 +Robinson // /default_panels/GraphSubplotsPanel.js:124 +Roll // /default_panels/GraphSubplotsPanel.js:222 +Rotation // /default_panels/StyleTracesPanel.js:232 +Roughness // /default_panels/StyleTracesPanel.js:533 SVG // /components/fields/TraceSelector.js:101 Sankey // /lib/computeTraceOptionsFromSchema.js:97 -Satellite // /default_panels/GraphSubplotsPanel.js:81 +Satellite // /default_panels/GraphSubplotsPanel.js:84 Satellite Map // /lib/computeTraceOptionsFromSchema.js:155 -Satellite with Streets // /default_panels/GraphSubplotsPanel.js:82 -Scale // /default_panels/GraphSubplotsPanel.js:213 -Scale Group // /default_panels/StyleTracesPanel.js:556 -Scale Mode // /default_panels/StyleTracesPanel.js:558 -Scaling // /default_panels/StyleTracesPanel.js:555 +Satellite with Streets // /default_panels/GraphSubplotsPanel.js:85 +Scale // /default_panels/GraphSubplotsPanel.js:219 +Scale Group // /default_panels/StyleTracesPanel.js:568 +Scale Mode // /default_panels/StyleTracesPanel.js:570 +Scaling // /default_panels/StyleTracesPanel.js:567 Scatter // /components/fields/TraceSelector.js:48 Scatter GL // /lib/computeTraceOptionsFromSchema.js:81 Scene // /lib/constants.js:99 Second // /default_panels/StyleAxesPanel.js:327 -See a basic example. // /components/widgets/TraceTypeSelector.js:129 -Select // /default_panels/StyleLayoutPanel.js:85 -Select Data Point // /default_panels/StyleLayoutPanel.js:111 -Select Direction // /default_panels/StyleLayoutPanel.js:94 -Select Trace Type // /components/widgets/TraceTypeSelector.js:220 -Select a Colorscale Type // /components/widgets/ColorscalePicker.js:54 -Select an Option // /components/widgets/Dropdown.js:66 +See a basic example. // /components/widgets/TraceTypeSelector.js:128 +Select // /default_panels/StyleLayoutPanel.js:88 +Select Data Point // /default_panels/StyleLayoutPanel.js:114 +Select Direction // /default_panels/StyleLayoutPanel.js:97 +Select Trace Type // /components/widgets/TraceTypeSelector.js:219 +Select a Colorscale Type // /components/widgets/ColorscalePicker.js:55 +Select an Option // /components/widgets/Dropdown.js:67 Separate Thousands // /default_panels/StyleAxesPanel.js:174 -Shape // /components/containers/ShapeAccordion.js:22 -Shapes // /DefaultEditor.js:85 +Shape // /components/containers/ShapeAccordion.js:23 +Shapes // /DefaultEditor.js:86 Show // /components/fields/MarkerColor.js:190 -Show All // /default_panels/StyleTracesPanel.js:231 -Show Contour // /default_panels/StyleTracesPanel.js:620 +Show All // /default_panels/StyleTracesPanel.js:237 +Show Contour // /default_panels/StyleTracesPanel.js:632 Show Exponents // /default_panels/StyleAxesPanel.js:192 Show Prefix // /default_panels/StyleAxesPanel.js:219 Show Sides // /default_panels/StyleAxesPanel.js:398 Show Suffix // /default_panels/StyleAxesPanel.js:243 -Show in Legend // /default_panels/StyleTracesPanel.js:49 -Side // /default_panels/GraphSubplotsPanel.js:32 +Show in Legend // /default_panels/StyleTracesPanel.js:52 +Side // /default_panels/GraphSubplotsPanel.js:35 Simple // /components/fields/derived.js:151 Single // /components/fields/MultiColorPicker.js:76 -Sinusoidal // /default_panels/GraphSubplotsPanel.js:139 -Size // /default_panels/StyleColorbarsPanel.js:56 -Size Mode // /default_panels/StyleTracesPanel.js:60 -Size Scale // /default_panels/StyleTracesPanel.js:255 -Size and Positioning // /default_panels/StyleColorbarsPanel.js:55 -Slider // /components/containers/SliderAccordion.js:20 -Sliders // /DefaultEditor.js:87 -Smoothing // /default_panels/StyleTracesPanel.js:423 +Sinusoidal // /default_panels/GraphSubplotsPanel.js:142 +Size // /default_panels/StyleColorbarsPanel.js:65 +Size Mode // /default_panels/StyleTracesPanel.js:63 +Size Scale // /default_panels/StyleTracesPanel.js:261 +Size and Positioning // /default_panels/StyleColorbarsPanel.js:64 +Slider // /components/containers/SliderAccordion.js:21 +Sliders // /DefaultEditor.js:88 +Smoothing // /default_panels/StyleTracesPanel.js:435 Snap to Grid // /components/fields/RectanglePositioner.js:82 -Soft // /default_panels/StyleTracesPanel.js:566 +Soft // /default_panels/StyleTracesPanel.js:578 Sort // /components/containers/TransformAccordion.js:24 -Sorted // /default_panels/StyleTracesPanel.js:216 -South America // /default_panels/GraphSubplotsPanel.js:106 -Span // /default_panels/StyleTracesPanel.js:572 -Span Mode // /default_panels/StyleTracesPanel.js:563 +Sorted // /default_panels/StyleTracesPanel.js:222 +South America // /default_panels/GraphSubplotsPanel.js:109 +Span // /default_panels/StyleTracesPanel.js:584 +Span Mode // /default_panels/StyleTracesPanel.js:575 Specialized // /lib/traceTypes.js:29 -Specular // /default_panels/StyleTracesPanel.js:520 +Specular // /default_panels/StyleTracesPanel.js:532 Spike Lines // /default_panels/StyleAxesPanel.js:383 Split // /components/containers/TransformAccordion.js:22 -Split labels // /default_panels/StyleTracesPanel.js:614 -Stack // /default_panels/GraphSubplotsPanel.js:67 -Stacking // /default_panels/StyleTracesPanel.js:371 -Standard Deviation // /default_panels/GraphTransformsPanel.js:44 -Start Point // /default_panels/StyleShapesPanel.js:32 +Split labels // /default_panels/StyleTracesPanel.js:626 +Stack // /default_panels/GraphSubplotsPanel.js:70 +Stacking // /default_panels/StyleTracesPanel.js:383 +Standard Deviation // /default_panels/GraphTransformsPanel.js:45 +Start Point // /default_panels/StyleShapesPanel.js:35 Step // /default_panels/StyleAxesPanel.js:318 Step Offset // /default_panels/StyleAxesPanel.js:114 Step Size // /default_panels/StyleAxesPanel.js:115 Stepmode // /default_panels/StyleAxesPanel.js:332 -Stereographic // /default_panels/GraphSubplotsPanel.js:134 +Stereographic // /default_panels/GraphSubplotsPanel.js:137 Streamtube // /lib/computeTraceOptionsFromSchema.js:69 -Stretch // /default_panels/StyleImagesPanel.js:28 -Structure // /DefaultEditor.js:74 +Stretch // /default_panels/StyleImagesPanel.js:31 +Structure // /DefaultEditor.js:75 Style // /default_panels/StyleAxesPanel.js:346 -Sub-Country Unit Borders // /default_panels/GraphSubplotsPanel.js:152 -Subplots // /components/fields/AxesCreator.js:154 -Subplots to Use // /components/fields/SubplotCreator.js:126 +Sub-Country Unit Borders // /default_panels/GraphSubplotsPanel.js:155 +Subplots // /components/fields/AxesCreator.js:152 +Subplots to Use // /components/fields/SubplotCreator.js:122 Suffix // /default_panels/StyleAxesPanel.js:229 -Sum // /default_panels/GraphSubplotsPanel.js:220 +Sum // /default_panels/GraphSubplotsPanel.js:226 Sum // /components/fields/derived.js:132 -Supported formats are: // /components/widgets/Dropzone.js:53 +Supported formats are: // /components/widgets/Dropzone.js:54 Surface // /lib/computeTraceOptionsFromSchema.js:57 -Suspected Outliers // /default_panels/StyleTracesPanel.js:233 -Symbol // /default_panels/StyleTracesPanel.js:266 -Symmetric // /components/fields/ErrorBars.js:77 -Table // /components/containers/SubplotAccordion.js:133 -Tail // /default_panels/StyleTracesPanel.js:68 -Target // /default_panels/GraphTransformsPanel.js:78 +Suspected Outliers // /default_panels/StyleTracesPanel.js:239 +Symbol // /default_panels/StyleTracesPanel.js:272 +Symmetric // /components/fields/ErrorBars.js:78 +Table // /components/containers/SubplotAccordion.js:134 +Tail // /default_panels/StyleTracesPanel.js:74 +Target // /default_panels/GraphTransformsPanel.js:81 Target < Reference // /components/fields/FilterOperation.js:11 Target = Reference // /components/fields/FilterOperation.js:13 Target > Reference // /components/fields/FilterOperation.js:14 Target ≠ Reference // /components/fields/FilterOperation.js:10 Target ≤ Reference // /components/fields/FilterOperation.js:12 Target ≥ Reference // /components/fields/FilterOperation.js:15 -Ternary // /default_panels/GraphSubplotsPanel.js:219 +Ternary // /default_panels/GraphSubplotsPanel.js:225 Ternary Scatter // /lib/computeTraceOptionsFromSchema.js:45 Text // /components/fields/derived.js:513 -Text Alignment // /default_panels/StyleTracesPanel.js:150 -Text Attributes // /default_panels/StyleTracesPanel.js:434 -Text Position // /default_panels/StyleTracesPanel.js:455 +Text Alignment // /default_panels/StyleTracesPanel.js:156 +Text Attributes // /default_panels/StyleTracesPanel.js:446 +Text Position // /default_panels/StyleTracesPanel.js:467 Theta // /components/fields/derived.js:556 -Theta Unit // /default_panels/GraphCreatePanel.js:115 -Thickness // /components/fields/ErrorBars.js:103 +Theta Unit // /default_panels/GraphCreatePanel.js:126 +Thickness // /components/fields/ErrorBars.js:104 This input has multiple values associated with it. Changing this setting will override these custom inputs. // /lib/constants.js:20 -This panel could not be displayed due to an error. // /components/containers/PlotlyPanel.js:15 +This panel could not be displayed due to an error. // /components/containers/PlotlyPanel.js:16 Tick Labels // /default_panels/StyleAxesPanel.js:137 Tick Markers // /default_panels/StyleAxesPanel.js:265 Tick Spacing // /default_panels/StyleAxesPanel.js:254 -Tick spacing // /default_panels/StyleColorbarsPanel.js:211 -Ticks // /default_panels/StyleColorbarsPanel.js:219 +Tick spacing // /default_panels/StyleColorbarsPanel.js:226 +Ticks // /default_panels/StyleColorbarsPanel.js:237 Timescale Buttons // /default_panels/StyleAxesPanel.js:306 Timeseries // /lib/computeTraceOptionsFromSchema.js:144 -Tip // /default_panels/StyleTracesPanel.js:67 -Title // /default_panels/StyleColorbarsPanel.js:35 +Tip // /default_panels/StyleTracesPanel.js:73 +Title // /default_panels/StyleColorbarsPanel.js:38 Titles // /default_panels/StyleAxesPanel.js:31 To Date // /default_panels/StyleAxesPanel.js:336 To Next // /components/fields/derived.js:608 To Self // /components/fields/derived.js:607 -To upload multiple files, create multiple files and upload them individually. // /components/widgets/Dropzone.js:103 +To upload multiple files, create multiple files and upload them individually. // /components/widgets/Dropzone.js:104 Top // /components/fields/derived.js:96 Top Center // /components/fields/derived.js:481 Top Left // /components/fields/derived.js:480 Top Right // /components/fields/derived.js:482 -Trace // /components/containers/TraceAccordion.js:138 -Trace Opacity // /default_panels/StyleTracesPanel.js:46 -Trace Order // /default_panels/StyleLegendPanel.js:65 +Trace // /components/containers/TraceAccordion.js:139 +Trace Opacity // /default_panels/StyleTracesPanel.js:49 +Trace Order // /default_panels/StyleLegendPanel.js:68 Trace name // /components/fields/derived.js:582 -Trace your data. // /components/containers/TraceAccordion.js:118 -Traces // /components/containers/TraceRequiredPanel.js:25 -Traces of various types like bar and line are the building blocks of your figure. // /components/containers/TraceAccordion.js:120 +Trace your data. // /components/containers/TraceAccordion.js:119 +Traces // /components/containers/TraceRequiredPanel.js:28 +Traces of various types like bar and line are the building blocks of your figure. // /components/containers/TraceAccordion.js:121 Transform // /components/containers/TransformAccordion.js:66 -Transforms // /DefaultEditor.js:77 -Transpose // /default_panels/GraphCreatePanel.js:151 -Transverse Mercator // /default_panels/GraphSubplotsPanel.js:137 +Transforms // /DefaultEditor.js:78 +Transpose // /default_panels/GraphCreatePanel.js:162 +Transverse Mercator // /default_panels/GraphSubplotsPanel.js:140 True // /default_panels/StyleAxesPanel.js:149 -Try again with a // /components/widgets/Dropzone.js:129 -Try again with a supported file format: // /components/widgets/Dropzone.js:73 -Turntable // /default_panels/StyleLayoutPanel.js:89 -Type // /default_panels/GraphCreatePanel.js:29 +Try again with a // /components/widgets/Dropzone.js:130 +Try again with a supported file format: // /components/widgets/Dropzone.js:74 +Turntable // /default_panels/StyleLayoutPanel.js:92 +Type // /default_panels/GraphCreatePanel.js:37 Typeface // /default_panels/StyleAxesPanel.js:35 U // /components/fields/derived.js:570 -URL // /components/widgets/text_editors/RichText/LinkEditor.js:90 -USA // /default_panels/GraphSubplotsPanel.js:101 +URL // /components/widgets/text_editors/RichText/LinkEditor.js:91 +USA // /default_panels/GraphSubplotsPanel.js:104 USA State Abbreviations (e.g. NY) // /components/fields/LocationSelector.js:34 -Unsorted // /default_panels/StyleTracesPanel.js:216 +Unsorted // /default_panels/StyleTracesPanel.js:222 Upper Bound // /components/fields/FilterOperation.js:187 V // /components/fields/derived.js:571 Value // /components/fields/derived.js:508 -Value (-) // /components/fields/ErrorBars.js:143 +Value (-) // /components/fields/ErrorBars.js:144 Values // /components/fields/derived.js:540 -Values Shown On Hover // /default_panels/StyleTracesPanel.js:612 +Values Shown On Hover // /default_panels/StyleTracesPanel.js:624 Variable // /components/fields/MarkerColor.js:156 -Vertex Normal // /default_panels/StyleTracesPanel.js:523 -Vertexcolor // /default_panels/GraphCreatePanel.js:149 -Vertical // /default_panels/GraphCreatePanel.js:63 -Vertical Boundaries // /default_panels/StyleShapesPanel.js:36 -Vertical Gap // /default_panels/StyleTracesPanel.js:500 -Vertical Gaps // /default_panels/StyleTracesPanel.js:504 +Vertex Normal // /default_panels/StyleTracesPanel.js:535 +Vertexcolor // /default_panels/GraphCreatePanel.js:160 +Vertical // /default_panels/GraphCreatePanel.js:71 +Vertical Boundaries // /default_panels/StyleShapesPanel.js:39 +Vertical Gap // /default_panels/StyleTracesPanel.js:512 +Vertical Gaps // /default_panels/StyleTracesPanel.js:516 Vertical Positioning // /default_panels/StyleAxesPanel.js:366 -View tutorials on this chart type. // /components/widgets/TraceTypeSelector.js:121 +View tutorials on this chart type. // /components/widgets/TraceTypeSelector.js:120 Violin // /lib/computeTraceOptionsFromSchema.js:49 -Violin Mode // /default_panels/StyleTracesPanel.js:317 -Violin Padding // /default_panels/StyleTracesPanel.js:322 -Violin Size and Spacing // /default_panels/StyleTracesPanel.js:314 -Violin Width // /default_panels/StyleTracesPanel.js:321 +Violin Mode // /default_panels/StyleTracesPanel.js:326 +Violin Padding // /default_panels/StyleTracesPanel.js:334 +Violin Size and Spacing // /default_panels/StyleTracesPanel.js:323 +Violin Width // /default_panels/StyleTracesPanel.js:333 Violins // /components/fields/derived.js:635 Violins and Points // /components/fields/derived.js:638 Violins, Points and KDE // /components/fields/derived.js:639 -Visible Sides // /default_panels/StyleTracesPanel.js:575 +Visible Sides // /default_panels/StyleTracesPanel.js:587 W // /components/fields/derived.js:572 WebGL // /components/fields/TraceSelector.js:101 -Well this is embarrassing. // /components/containers/PlotlyPanel.js:14 -Whisker Width // /default_panels/StyleTracesPanel.js:326 -Width // /default_panels/GraphCreatePanel.js:142 -Winkel Tripel // /default_panels/GraphSubplotsPanel.js:120 -World // /default_panels/GraphSubplotsPanel.js:100 +Well this is embarrassing. // /components/containers/PlotlyPanel.js:15 +Whisker Width // /default_panels/StyleTracesPanel.js:338 +Width // /default_panels/GraphCreatePanel.js:153 +Winkel Tripel // /default_panels/GraphSubplotsPanel.js:123 +World // /default_panels/GraphSubplotsPanel.js:103 X // /components/fields/derived.js:523 X = 0 // /components/fields/derived.js:595 -X Anchor // /default_panels/GraphSubplotsPanel.js:30 +X Anchor // /default_panels/GraphSubplotsPanel.js:33 X Axis // /components/fields/derived.js:662 -X Bin End // /default_panels/StyleTracesPanel.js:197 -X Bin Size // /default_panels/StyleTracesPanel.js:198 -X Bin Start // /default_panels/StyleTracesPanel.js:196 -X Offset // /default_panels/StyleNotesPanel.js:36 -X Overlay // /default_panels/GraphSubplotsPanel.js:23 -X Values // /default_panels/GraphCreatePanel.js:38 -X Vector // /default_panels/StyleNotesPanel.js:38 -X start // /default_panels/GraphCreatePanel.js:105 +X Bin End // /default_panels/StyleTracesPanel.js:203 +X Bin Size // /default_panels/StyleTracesPanel.js:204 +X Bin Start // /default_panels/StyleTracesPanel.js:202 +X Offset // /default_panels/StyleNotesPanel.js:39 +X Overlay // /default_panels/GraphSubplotsPanel.js:26 +X Values // /default_panels/GraphCreatePanel.js:46 +X Vector // /default_panels/StyleNotesPanel.js:41 +X start // /default_panels/GraphCreatePanel.js:113 Y // /components/fields/derived.js:523 Y = 0 // /components/fields/derived.js:594 -Y Anchor // /default_panels/GraphSubplotsPanel.js:34 +Y Anchor // /default_panels/GraphSubplotsPanel.js:37 Y Axis // /components/fields/derived.js:663 -Y Bin End // /default_panels/StyleTracesPanel.js:202 -Y Bin Size // /default_panels/StyleTracesPanel.js:203 -Y Bin Start // /default_panels/StyleTracesPanel.js:201 -Y Offset // /default_panels/StyleNotesPanel.js:37 -Y Overlay // /default_panels/GraphSubplotsPanel.js:24 -Y Values // /default_panels/GraphCreatePanel.js:46 -Y Vector // /default_panels/StyleNotesPanel.js:39 -Y start // /default_panels/GraphCreatePanel.js:106 +Y Bin End // /default_panels/StyleTracesPanel.js:208 +Y Bin Size // /default_panels/StyleTracesPanel.js:209 +Y Bin Start // /default_panels/StyleTracesPanel.js:207 +Y Offset // /default_panels/StyleNotesPanel.js:40 +Y Overlay // /default_panels/GraphSubplotsPanel.js:27 +Y Values // /default_panels/GraphCreatePanel.js:54 +Y Vector // /default_panels/StyleNotesPanel.js:42 +Y start // /default_panels/GraphCreatePanel.js:114 Year // /default_panels/StyleAxesPanel.js:322 -Yes // /components/fields/ErrorBars.js:95 -Yikes! An error occurred while parsing this file. // /components/widgets/Dropzone.js:72 -Yikes! This doesn't look like a valid // /components/widgets/Dropzone.js:127 -Yikes! You can only upload one file at a time. // /components/widgets/Dropzone.js:101 -You can add as many as you like, mixing and matching types and arranging them into subplots. // /components/containers/TraceAccordion.js:124 -You can style and position your axes in the // /components/fields/AxesCreator.js:153 -You can style and position your subplots in the // /components/fields/SubplotCreator.js:134 -You need to provide a component for the modal to open! // /components/containers/ModalProvider.js:33 +Yes // /components/fields/ErrorBars.js:96 +Yikes! An error occurred while parsing this file. // /components/widgets/Dropzone.js:73 +Yikes! This doesn't look like a valid // /components/widgets/Dropzone.js:128 +Yikes! You can only upload one file at a time. // /components/widgets/Dropzone.js:102 +You can add as many as you like, mixing and matching types and arranging them into subplots. // /components/containers/TraceAccordion.js:125 +You can style and position your axes in the // /components/fields/AxesCreator.js:151 +You can style and position your subplots in the // /components/fields/SubplotCreator.js:132 +You need to provide a component for the modal to open! // /components/containers/ModalProvider.js:34 Z // /components/fields/derived.js:538 -Z Values // /default_panels/GraphCreatePanel.js:55 -Z start // /default_panels/GraphCreatePanel.js:107 +Z Values // /default_panels/GraphCreatePanel.js:63 +Z start // /default_panels/GraphCreatePanel.js:115 Zero Line // /default_panels/StyleAxesPanel.js:119 -Zoom // /default_panels/StyleLayoutPanel.js:84 +Zoom // /default_panels/StyleLayoutPanel.js:87 Zoom Interactivity // /default_panels/StyleAxesPanel.js:62 -Zoom Level // /default_panels/GraphSubplotsPanel.js:90 +Zoom Level // /default_panels/GraphSubplotsPanel.js:93 ^ // /default_panels/StyleAxesPanel.js:235 -absolute // /default_panels/StyleTracesPanel.js:61 +absolute // /default_panels/StyleTracesPanel.js:66 according to axis // /components/fields/derived.js:354 e+6 // /default_panels/StyleAxesPanel.js:184 -image // /default_panels/StyleImagesPanel.js:20 -image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp // /components/widgets/Dropzone.js:15 +image // /default_panels/StyleImagesPanel.js:23 +image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp // /components/widgets/Dropzone.js:16 in pixels // /components/fields/derived.js:343 k/M/B // /default_panels/StyleAxesPanel.js:188 k/M/G // /default_panels/StyleAxesPanel.js:187 -new text // /components/containers/AnnotationAccordion.js:37 -scaled // /default_panels/StyleTracesPanel.js:61 +new text // /components/containers/AnnotationAccordion.js:38 +scaled // /default_panels/StyleTracesPanel.js:65 x // /default_panels/StyleAxesPanel.js:208 x10^6 // /default_panels/StyleAxesPanel.js:186 -√ // /components/fields/ErrorBars.js:117 \ No newline at end of file +√ // /components/fields/ErrorBars.js:118 \ No newline at end of file From a529a8eefda189dc1a906e63d299eecfd613d73f Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 00:19:41 +0900 Subject: [PATCH 10/69] temporary change main point --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 017e3655f..90ad35516 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "widgets" ], "license": "MIT", - "main": "lib/index.js", + "main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/plotly/react-chart-editor.git" From 5a146052d4f8054310f0b72300e3131ffb9756a2 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 00:28:20 +0900 Subject: [PATCH 11/69] add make files --- .gitignore | 2 +- lib/DefaultEditor.js | 136 + lib/DefaultEditor.js.map | 1 + lib/EditorControls.js | 432 +++ lib/EditorControls.js.map | 1 + lib/PlotlyEditor.js | 145 + lib/PlotlyEditor.js.map | 1 + lib/__percy__/panels.percy.js | 82 + lib/__percy__/panels.percy.js.map | 1 + lib/components/PanelMenuWrapper.js | 175 ++ lib/components/PanelMenuWrapper.js.map | 1 + .../containers/AnnotationAccordion.js | 124 + .../containers/AnnotationAccordion.js.map | 1 + lib/components/containers/AxesFold.js | 71 + lib/components/containers/AxesFold.js.map | 1 + lib/components/containers/FoldEmpty.js | 79 + lib/components/containers/FoldEmpty.js.map | 1 + lib/components/containers/ImageAccordion.js | 129 + .../containers/ImageAccordion.js.map | 1 + lib/components/containers/MenuPanel.js | 137 + lib/components/containers/MenuPanel.js.map | 1 + lib/components/containers/Modal.js | 147 + lib/components/containers/Modal.js.map | 1 + lib/components/containers/ModalBox.js | 76 + lib/components/containers/ModalBox.js.map | 1 + lib/components/containers/ModalProvider.js | 180 ++ .../containers/ModalProvider.js.map | 1 + lib/components/containers/PanelEmpty.js | 113 + lib/components/containers/PanelEmpty.js.map | 1 + lib/components/containers/PanelHeader.js | 158 + lib/components/containers/PanelHeader.js.map | 1 + lib/components/containers/PlotlyFold.js | 259 ++ lib/components/containers/PlotlyFold.js.map | 1 + lib/components/containers/PlotlyPanel.js | 261 ++ lib/components/containers/PlotlyPanel.js.map | 1 + lib/components/containers/PlotlySection.js | 132 + .../containers/PlotlySection.js.map | 1 + .../containers/RangeSelectorAccordion.js | 110 + .../containers/RangeSelectorAccordion.js.map | 1 + lib/components/containers/ShapeAccordion.js | 130 + .../containers/ShapeAccordion.js.map | 1 + .../containers/SingleSidebarItem.js | 56 + .../containers/SingleSidebarItem.js.map | 1 + lib/components/containers/SliderAccordion.js | 84 + .../containers/SliderAccordion.js.map | 1 + lib/components/containers/SubplotAccordion.js | 202 ++ .../containers/SubplotAccordion.js.map | 1 + lib/components/containers/TraceAccordion.js | 312 ++ .../containers/TraceAccordion.js.map | 1 + .../containers/TraceMarkerSection.js | 84 + .../containers/TraceMarkerSection.js.map | 1 + .../containers/TraceRequiredPanel.js | 110 + .../containers/TraceRequiredPanel.js.map | 1 + .../containers/TransformAccordion.js | 223 ++ .../containers/TransformAccordion.js.map | 1 + .../containers/UpdateMenuAccordion.js | 94 + .../containers/UpdateMenuAccordion.js.map | 1 + lib/components/containers/derived.js | 67 + lib/components/containers/derived.js.map | 1 + lib/components/containers/index.js | 119 + lib/components/containers/index.js.map | 1 + lib/components/fields/ArrowSelector.js | 63 + lib/components/fields/ArrowSelector.js.map | 1 + lib/components/fields/AxesCreator.js | 256 ++ lib/components/fields/AxesCreator.js.map | 1 + lib/components/fields/AxesSelector.js | 122 + lib/components/fields/AxesSelector.js.map | 1 + lib/components/fields/AxisRangeValue.js | 71 + lib/components/fields/AxisRangeValue.js.map | 1 + lib/components/fields/ColorPicker.js | 103 + lib/components/fields/ColorPicker.js.map | 1 + lib/components/fields/ColorscalePicker.js | 99 + lib/components/fields/ColorscalePicker.js.map | 1 + lib/components/fields/ColorwayPicker.js | 70 + lib/components/fields/ColorwayPicker.js.map | 1 + lib/components/fields/DataSelector.js | 182 ++ lib/components/fields/DataSelector.js.map | 1 + lib/components/fields/Dropdown.js | 88 + lib/components/fields/Dropdown.js.map | 1 + lib/components/fields/DropdownCustom.js | 150 + lib/components/fields/DropdownCustom.js.map | 1 + lib/components/fields/Dropzone.js | 71 + lib/components/fields/Dropzone.js.map | 1 + lib/components/fields/DualNumeric.js | 149 + lib/components/fields/DualNumeric.js.map | 1 + lib/components/fields/ErrorBars.js | 207 ++ lib/components/fields/ErrorBars.js.map | 1 + lib/components/fields/Field.js | 199 ++ lib/components/fields/Field.js.map | 1 + lib/components/fields/FilterOperation.js | 273 ++ lib/components/fields/FilterOperation.js.map | 1 + lib/components/fields/Flaglist.js | 72 + lib/components/fields/Flaglist.js.map | 1 + lib/components/fields/FontSelector.js | 54 + lib/components/fields/FontSelector.js.map | 1 + lib/components/fields/GroupCreator.js | 154 + lib/components/fields/GroupCreator.js.map | 1 + lib/components/fields/Info.js | 62 + lib/components/fields/Info.js.map | 1 + lib/components/fields/LineSelectors.js | 154 + lib/components/fields/LineSelectors.js.map | 1 + lib/components/fields/LocationSelector.js | 186 ++ lib/components/fields/LocationSelector.js.map | 1 + lib/components/fields/MarkerColor.js | 265 ++ lib/components/fields/MarkerColor.js.map | 1 + lib/components/fields/MarkerSize.js | 141 + lib/components/fields/MarkerSize.js.map | 1 + lib/components/fields/MultiColorPicker.js | 223 ++ lib/components/fields/MultiColorPicker.js.map | 1 + lib/components/fields/Numeric.js | 94 + lib/components/fields/Numeric.js.map | 1 + lib/components/fields/PieColorscalePicker.js | 105 + .../fields/PieColorscalePicker.js.map | 1 + lib/components/fields/Radio.js | 79 + lib/components/fields/Radio.js.map | 1 + lib/components/fields/RectanglePositioner.js | 245 ++ .../fields/RectanglePositioner.js.map | 1 + lib/components/fields/SubplotCreator.js | 240 ++ lib/components/fields/SubplotCreator.js.map | 1 + lib/components/fields/SymbolSelector.js | 367 +++ lib/components/fields/SymbolSelector.js.map | 1 + lib/components/fields/Text.js | 83 + lib/components/fields/Text.js.map | 1 + lib/components/fields/TextEditor.js | 128 + lib/components/fields/TextEditor.js.map | 1 + lib/components/fields/TraceSelector.js | 220 ++ lib/components/fields/TraceSelector.js.map | 1 + lib/components/fields/UpdateMenuButtons.js | 93 + .../fields/UpdateMenuButtons.js.map | 1 + lib/components/fields/VisibilitySelect.js | 130 + lib/components/fields/VisibilitySelect.js.map | 1 + lib/components/fields/derived.js | 617 ++++ lib/components/fields/derived.js.map | 1 + lib/components/fields/index.js | 203 ++ lib/components/fields/index.js.map | 1 + lib/components/index.js | 104 + lib/components/index.js.map | 1 + lib/components/sidebar/SidebarGroup.js | 123 + lib/components/sidebar/SidebarGroup.js.map | 1 + lib/components/sidebar/SidebarItem.js | 71 + lib/components/sidebar/SidebarItem.js.map | 1 + lib/components/widgets/Button.js | 98 + lib/components/widgets/Button.js.map | 1 + lib/components/widgets/CheckboxGroup.js | 134 + lib/components/widgets/CheckboxGroup.js.map | 1 + lib/components/widgets/ColorPicker.js | 190 ++ lib/components/widgets/ColorPicker.js.map | 1 + lib/components/widgets/ColorscalePicker.js | 141 + .../widgets/ColorscalePicker.js.map | 1 + lib/components/widgets/Dropdown.js | 164 + lib/components/widgets/Dropdown.js.map | 1 + lib/components/widgets/Dropzone.js | 222 ++ lib/components/widgets/Dropzone.js.map | 1 + lib/components/widgets/EditableText.js | 162 + lib/components/widgets/EditableText.js.map | 1 + .../widgets/FlaglistCheckboxGroup.js | 162 + .../widgets/FlaglistCheckboxGroup.js.map | 1 + lib/components/widgets/Logo.js | 52 + lib/components/widgets/Logo.js.map | 1 + lib/components/widgets/NumericInput.js | 255 ++ lib/components/widgets/NumericInput.js.map | 1 + lib/components/widgets/RadioBlocks.js | 128 + lib/components/widgets/RadioBlocks.js.map | 1 + lib/components/widgets/SymbolSelector.js | 197 ++ lib/components/widgets/SymbolSelector.js.map | 1 + lib/components/widgets/TextArea.js | 95 + lib/components/widgets/TextArea.js.map | 1 + lib/components/widgets/TextInput.js | 83 + lib/components/widgets/TextInput.js.map | 1 + lib/components/widgets/TraceTypeSelector.js | 370 +++ .../widgets/TraceTypeSelector.js.map | 1 + lib/components/widgets/index.js | 26 + lib/components/widgets/index.js.map | 1 + lib/components/widgets/text_editors/HTML.js | 65 + .../widgets/text_editors/HTML.js.map | 1 + lib/components/widgets/text_editors/LaTeX.js | 132 + .../widgets/text_editors/LaTeX.js.map | 1 + .../widgets/text_editors/MultiFormat.js | 379 +++ .../widgets/text_editors/MultiFormat.js.map | 1 + .../text_editors/RichText/DraftCommands.js | 210 ++ .../RichText/DraftCommands.js.map | 1 + .../text_editors/RichText/LinkDecorator.js | 39 + .../RichText/LinkDecorator.js.map | 1 + .../text_editors/RichText/LinkEditor.js | 197 ++ .../text_editors/RichText/LinkEditor.js.map | 1 + .../text_editors/RichText/StyleButton.js | 95 + .../text_editors/RichText/StyleButton.js.map | 1 + .../text_editors/RichText/StyleButtonGroup.js | 97 + .../RichText/StyleButtonGroup.js.map | 1 + .../text_editors/RichText/configuration.js | 110 + .../RichText/configuration.js.map | 1 + .../widgets/text_editors/RichText/debounce.js | 25 + .../text_editors/RichText/debounce.js.map | 1 + .../RichText/decoratorStrategies.js | 31 + .../RichText/decoratorStrategies.js.map | 1 + .../RichText/getSelectionCoordinates.js | 23 + .../RichText/getSelectionCoordinates.js.map | 1 + .../widgets/text_editors/RichText/index.js | 431 +++ .../text_editors/RichText/index.js.map | 1 + .../widgets/text_editors/convertFormats.js | 97 + .../text_editors/convertFormats.js.map | 1 + lib/context/index.js | 36 + lib/context/index.js.map | 1 + lib/default_panels/GraphCreatePanel.js | 191 ++ lib/default_panels/GraphCreatePanel.js.map | 1 + lib/default_panels/GraphSubplotsPanel.js | 232 ++ lib/default_panels/GraphSubplotsPanel.js.map | 1 + lib/default_panels/GraphTransformsPanel.js | 125 + .../GraphTransformsPanel.js.map | 1 + lib/default_panels/StyleAxesPanel.js | 397 +++ lib/default_panels/StyleAxesPanel.js.map | 1 + lib/default_panels/StyleColorbarsPanel.js | 267 ++ lib/default_panels/StyleColorbarsPanel.js.map | 1 + lib/default_panels/StyleImagesPanel.js | 79 + lib/default_panels/StyleImagesPanel.js.map | 1 + lib/default_panels/StyleLayoutPanel.js | 157 + lib/default_panels/StyleLayoutPanel.js.map | 1 + lib/default_panels/StyleLegendPanel.js | 98 + lib/default_panels/StyleLegendPanel.js.map | 1 + lib/default_panels/StyleNotesPanel.js | 86 + lib/default_panels/StyleNotesPanel.js.map | 1 + lib/default_panels/StyleShapesPanel.js | 72 + lib/default_panels/StyleShapesPanel.js.map | 1 + lib/default_panels/StyleSlidersPanel.js | 105 + lib/default_panels/StyleSlidersPanel.js.map | 1 + lib/default_panels/StyleTracesPanel.js | 621 ++++ lib/default_panels/StyleTracesPanel.js.map | 1 + lib/default_panels/StyleUpdateMenusPanel.js | 96 + .../StyleUpdateMenusPanel.js.map | 1 + lib/default_panels/index.js | 75 + lib/default_panels/index.js.map | 1 + lib/index.js | 123 + lib/index.js.map | 1 + lib/lib/bem.js | 53 + lib/lib/bem.js.map | 1 + lib/lib/computeTraceOptionsFromSchema.js | 137 + lib/lib/computeTraceOptionsFromSchema.js.map | 1 + lib/lib/connectAggregationToTransform.js | 140 + lib/lib/connectAggregationToTransform.js.map | 1 + lib/lib/connectAnnotationToLayout.js | 155 + lib/lib/connectAnnotationToLayout.js.map | 1 + lib/lib/connectAxesToLayout.js | 235 ++ lib/lib/connectAxesToLayout.js.map | 1 + lib/lib/connectCartesianSubplotToLayout.js | 159 + .../connectCartesianSubplotToLayout.js.map | 1 + lib/lib/connectImageToLayout.js | 155 + lib/lib/connectImageToLayout.js.map | 1 + lib/lib/connectLayoutToPlot.js | 139 + lib/lib/connectLayoutToPlot.js.map | 1 + lib/lib/connectNonCartesianSubplotToLayout.js | 148 + .../connectNonCartesianSubplotToLayout.js.map | 1 + lib/lib/connectRangeSelectorToAxis.js | 158 + lib/lib/connectRangeSelectorToAxis.js.map | 1 + lib/lib/connectShapeToLayout.js | 155 + lib/lib/connectShapeToLayout.js.map | 1 + lib/lib/connectSliderToLayout.js | 138 + lib/lib/connectSliderToLayout.js.map | 1 + lib/lib/connectToContainer.js | 150 + lib/lib/connectToContainer.js.map | 1 + lib/lib/connectTraceToPlot.js | 260 ++ lib/lib/connectTraceToPlot.js.map | 1 + lib/lib/connectTransformToTrace.js | 158 + lib/lib/connectTransformToTrace.js.map | 1 + lib/lib/connectUpdateMenuToLayout.js | 138 + lib/lib/connectUpdateMenuToLayout.js.map | 1 + lib/lib/constants.js | 112 + lib/lib/constants.js.map | 1 + lib/lib/customTraceType.js | 109 + lib/lib/customTraceType.js.map | 1 + lib/lib/dereference.js | 60 + lib/lib/dereference.js.map | 1 + lib/lib/getAllAxes.js | 114 + lib/lib/getAllAxes.js.map | 1 + lib/lib/index.js | 313 ++ lib/lib/index.js.map | 1 + lib/lib/localize.js | 77 + lib/lib/localize.js.map | 1 + lib/lib/multiValues.js | 95 + lib/lib/multiValues.js.map | 1 + lib/lib/sortMenu.js | 91 + lib/lib/sortMenu.js.map | 1 + lib/lib/strings.js | 55 + lib/lib/strings.js.map | 1 + lib/lib/striptags.js | 249 ++ lib/lib/striptags.js.map | 1 + lib/lib/test-utils.js | 170 + lib/lib/test-utils.js.map | 1 + lib/lib/traceTypes.js | 192 ++ lib/lib/traceTypes.js.map | 1 + lib/lib/unpackPlotProps.js | 98 + lib/lib/unpackPlotProps.js.map | 1 + lib/lib/walkObject.js | 186 ++ lib/lib/walkObject.js.map | 1 + lib/locales/en.js | 9 + lib/locales/en.js.map | 1 + lib/locales/index.js | 21 + lib/locales/index.js.map | 1 + lib/locales/xx.js | 214 ++ lib/locales/xx.js.map | 1 + lib/react-chart-editor.css | 2746 +++++++++++++++++ lib/react-chart-editor.ie.css | 2746 +++++++++++++++++ lib/react-chart-editor.ie.min.css | 1 + lib/react-chart-editor.min.css | 1 + lib/shame.js | 238 ++ lib/shame.js.map | 1 + package.json | 2 +- react-chart-editor.iml | 15 + 307 files changed, 28455 insertions(+), 2 deletions(-) create mode 100644 lib/DefaultEditor.js create mode 100644 lib/DefaultEditor.js.map create mode 100644 lib/EditorControls.js create mode 100644 lib/EditorControls.js.map create mode 100644 lib/PlotlyEditor.js create mode 100644 lib/PlotlyEditor.js.map create mode 100644 lib/__percy__/panels.percy.js create mode 100644 lib/__percy__/panels.percy.js.map create mode 100644 lib/components/PanelMenuWrapper.js create mode 100644 lib/components/PanelMenuWrapper.js.map create mode 100644 lib/components/containers/AnnotationAccordion.js create mode 100644 lib/components/containers/AnnotationAccordion.js.map create mode 100644 lib/components/containers/AxesFold.js create mode 100644 lib/components/containers/AxesFold.js.map create mode 100644 lib/components/containers/FoldEmpty.js create mode 100644 lib/components/containers/FoldEmpty.js.map create mode 100644 lib/components/containers/ImageAccordion.js create mode 100644 lib/components/containers/ImageAccordion.js.map create mode 100644 lib/components/containers/MenuPanel.js create mode 100644 lib/components/containers/MenuPanel.js.map create mode 100644 lib/components/containers/Modal.js create mode 100644 lib/components/containers/Modal.js.map create mode 100644 lib/components/containers/ModalBox.js create mode 100644 lib/components/containers/ModalBox.js.map create mode 100644 lib/components/containers/ModalProvider.js create mode 100644 lib/components/containers/ModalProvider.js.map create mode 100644 lib/components/containers/PanelEmpty.js create mode 100644 lib/components/containers/PanelEmpty.js.map create mode 100644 lib/components/containers/PanelHeader.js create mode 100644 lib/components/containers/PanelHeader.js.map create mode 100644 lib/components/containers/PlotlyFold.js create mode 100644 lib/components/containers/PlotlyFold.js.map create mode 100644 lib/components/containers/PlotlyPanel.js create mode 100644 lib/components/containers/PlotlyPanel.js.map create mode 100644 lib/components/containers/PlotlySection.js create mode 100644 lib/components/containers/PlotlySection.js.map create mode 100644 lib/components/containers/RangeSelectorAccordion.js create mode 100644 lib/components/containers/RangeSelectorAccordion.js.map create mode 100644 lib/components/containers/ShapeAccordion.js create mode 100644 lib/components/containers/ShapeAccordion.js.map create mode 100644 lib/components/containers/SingleSidebarItem.js create mode 100644 lib/components/containers/SingleSidebarItem.js.map create mode 100644 lib/components/containers/SliderAccordion.js create mode 100644 lib/components/containers/SliderAccordion.js.map create mode 100644 lib/components/containers/SubplotAccordion.js create mode 100644 lib/components/containers/SubplotAccordion.js.map create mode 100644 lib/components/containers/TraceAccordion.js create mode 100644 lib/components/containers/TraceAccordion.js.map create mode 100644 lib/components/containers/TraceMarkerSection.js create mode 100644 lib/components/containers/TraceMarkerSection.js.map create mode 100644 lib/components/containers/TraceRequiredPanel.js create mode 100644 lib/components/containers/TraceRequiredPanel.js.map create mode 100644 lib/components/containers/TransformAccordion.js create mode 100644 lib/components/containers/TransformAccordion.js.map create mode 100644 lib/components/containers/UpdateMenuAccordion.js create mode 100644 lib/components/containers/UpdateMenuAccordion.js.map create mode 100644 lib/components/containers/derived.js create mode 100644 lib/components/containers/derived.js.map create mode 100644 lib/components/containers/index.js create mode 100644 lib/components/containers/index.js.map create mode 100644 lib/components/fields/ArrowSelector.js create mode 100644 lib/components/fields/ArrowSelector.js.map create mode 100644 lib/components/fields/AxesCreator.js create mode 100644 lib/components/fields/AxesCreator.js.map create mode 100644 lib/components/fields/AxesSelector.js create mode 100644 lib/components/fields/AxesSelector.js.map create mode 100644 lib/components/fields/AxisRangeValue.js create mode 100644 lib/components/fields/AxisRangeValue.js.map create mode 100644 lib/components/fields/ColorPicker.js create mode 100644 lib/components/fields/ColorPicker.js.map create mode 100644 lib/components/fields/ColorscalePicker.js create mode 100644 lib/components/fields/ColorscalePicker.js.map create mode 100644 lib/components/fields/ColorwayPicker.js create mode 100644 lib/components/fields/ColorwayPicker.js.map create mode 100644 lib/components/fields/DataSelector.js create mode 100644 lib/components/fields/DataSelector.js.map create mode 100644 lib/components/fields/Dropdown.js create mode 100644 lib/components/fields/Dropdown.js.map create mode 100644 lib/components/fields/DropdownCustom.js create mode 100644 lib/components/fields/DropdownCustom.js.map create mode 100644 lib/components/fields/Dropzone.js create mode 100644 lib/components/fields/Dropzone.js.map create mode 100644 lib/components/fields/DualNumeric.js create mode 100644 lib/components/fields/DualNumeric.js.map create mode 100644 lib/components/fields/ErrorBars.js create mode 100644 lib/components/fields/ErrorBars.js.map create mode 100644 lib/components/fields/Field.js create mode 100644 lib/components/fields/Field.js.map create mode 100644 lib/components/fields/FilterOperation.js create mode 100644 lib/components/fields/FilterOperation.js.map create mode 100644 lib/components/fields/Flaglist.js create mode 100644 lib/components/fields/Flaglist.js.map create mode 100644 lib/components/fields/FontSelector.js create mode 100644 lib/components/fields/FontSelector.js.map create mode 100644 lib/components/fields/GroupCreator.js create mode 100644 lib/components/fields/GroupCreator.js.map create mode 100644 lib/components/fields/Info.js create mode 100644 lib/components/fields/Info.js.map create mode 100644 lib/components/fields/LineSelectors.js create mode 100644 lib/components/fields/LineSelectors.js.map create mode 100644 lib/components/fields/LocationSelector.js create mode 100644 lib/components/fields/LocationSelector.js.map create mode 100644 lib/components/fields/MarkerColor.js create mode 100644 lib/components/fields/MarkerColor.js.map create mode 100644 lib/components/fields/MarkerSize.js create mode 100644 lib/components/fields/MarkerSize.js.map create mode 100644 lib/components/fields/MultiColorPicker.js create mode 100644 lib/components/fields/MultiColorPicker.js.map create mode 100644 lib/components/fields/Numeric.js create mode 100644 lib/components/fields/Numeric.js.map create mode 100644 lib/components/fields/PieColorscalePicker.js create mode 100644 lib/components/fields/PieColorscalePicker.js.map create mode 100644 lib/components/fields/Radio.js create mode 100644 lib/components/fields/Radio.js.map create mode 100644 lib/components/fields/RectanglePositioner.js create mode 100644 lib/components/fields/RectanglePositioner.js.map create mode 100644 lib/components/fields/SubplotCreator.js create mode 100644 lib/components/fields/SubplotCreator.js.map create mode 100644 lib/components/fields/SymbolSelector.js create mode 100644 lib/components/fields/SymbolSelector.js.map create mode 100644 lib/components/fields/Text.js create mode 100644 lib/components/fields/Text.js.map create mode 100644 lib/components/fields/TextEditor.js create mode 100644 lib/components/fields/TextEditor.js.map create mode 100644 lib/components/fields/TraceSelector.js create mode 100644 lib/components/fields/TraceSelector.js.map create mode 100644 lib/components/fields/UpdateMenuButtons.js create mode 100644 lib/components/fields/UpdateMenuButtons.js.map create mode 100644 lib/components/fields/VisibilitySelect.js create mode 100644 lib/components/fields/VisibilitySelect.js.map create mode 100644 lib/components/fields/derived.js create mode 100644 lib/components/fields/derived.js.map create mode 100644 lib/components/fields/index.js create mode 100644 lib/components/fields/index.js.map create mode 100644 lib/components/index.js create mode 100644 lib/components/index.js.map create mode 100644 lib/components/sidebar/SidebarGroup.js create mode 100644 lib/components/sidebar/SidebarGroup.js.map create mode 100644 lib/components/sidebar/SidebarItem.js create mode 100644 lib/components/sidebar/SidebarItem.js.map create mode 100644 lib/components/widgets/Button.js create mode 100644 lib/components/widgets/Button.js.map create mode 100644 lib/components/widgets/CheckboxGroup.js create mode 100644 lib/components/widgets/CheckboxGroup.js.map create mode 100644 lib/components/widgets/ColorPicker.js create mode 100644 lib/components/widgets/ColorPicker.js.map create mode 100644 lib/components/widgets/ColorscalePicker.js create mode 100644 lib/components/widgets/ColorscalePicker.js.map create mode 100644 lib/components/widgets/Dropdown.js create mode 100644 lib/components/widgets/Dropdown.js.map create mode 100644 lib/components/widgets/Dropzone.js create mode 100644 lib/components/widgets/Dropzone.js.map create mode 100644 lib/components/widgets/EditableText.js create mode 100644 lib/components/widgets/EditableText.js.map create mode 100644 lib/components/widgets/FlaglistCheckboxGroup.js create mode 100644 lib/components/widgets/FlaglistCheckboxGroup.js.map create mode 100644 lib/components/widgets/Logo.js create mode 100644 lib/components/widgets/Logo.js.map create mode 100644 lib/components/widgets/NumericInput.js create mode 100644 lib/components/widgets/NumericInput.js.map create mode 100644 lib/components/widgets/RadioBlocks.js create mode 100644 lib/components/widgets/RadioBlocks.js.map create mode 100644 lib/components/widgets/SymbolSelector.js create mode 100644 lib/components/widgets/SymbolSelector.js.map create mode 100644 lib/components/widgets/TextArea.js create mode 100644 lib/components/widgets/TextArea.js.map create mode 100644 lib/components/widgets/TextInput.js create mode 100644 lib/components/widgets/TextInput.js.map create mode 100644 lib/components/widgets/TraceTypeSelector.js create mode 100644 lib/components/widgets/TraceTypeSelector.js.map create mode 100644 lib/components/widgets/index.js create mode 100644 lib/components/widgets/index.js.map create mode 100644 lib/components/widgets/text_editors/HTML.js create mode 100644 lib/components/widgets/text_editors/HTML.js.map create mode 100644 lib/components/widgets/text_editors/LaTeX.js create mode 100644 lib/components/widgets/text_editors/LaTeX.js.map create mode 100644 lib/components/widgets/text_editors/MultiFormat.js create mode 100644 lib/components/widgets/text_editors/MultiFormat.js.map create mode 100644 lib/components/widgets/text_editors/RichText/DraftCommands.js create mode 100644 lib/components/widgets/text_editors/RichText/DraftCommands.js.map create mode 100644 lib/components/widgets/text_editors/RichText/LinkDecorator.js create mode 100644 lib/components/widgets/text_editors/RichText/LinkDecorator.js.map create mode 100644 lib/components/widgets/text_editors/RichText/LinkEditor.js create mode 100644 lib/components/widgets/text_editors/RichText/LinkEditor.js.map create mode 100644 lib/components/widgets/text_editors/RichText/StyleButton.js create mode 100644 lib/components/widgets/text_editors/RichText/StyleButton.js.map create mode 100644 lib/components/widgets/text_editors/RichText/StyleButtonGroup.js create mode 100644 lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map create mode 100644 lib/components/widgets/text_editors/RichText/configuration.js create mode 100644 lib/components/widgets/text_editors/RichText/configuration.js.map create mode 100644 lib/components/widgets/text_editors/RichText/debounce.js create mode 100644 lib/components/widgets/text_editors/RichText/debounce.js.map create mode 100644 lib/components/widgets/text_editors/RichText/decoratorStrategies.js create mode 100644 lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map create mode 100644 lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js create mode 100644 lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map create mode 100644 lib/components/widgets/text_editors/RichText/index.js create mode 100644 lib/components/widgets/text_editors/RichText/index.js.map create mode 100644 lib/components/widgets/text_editors/convertFormats.js create mode 100644 lib/components/widgets/text_editors/convertFormats.js.map create mode 100644 lib/context/index.js create mode 100644 lib/context/index.js.map create mode 100644 lib/default_panels/GraphCreatePanel.js create mode 100644 lib/default_panels/GraphCreatePanel.js.map create mode 100644 lib/default_panels/GraphSubplotsPanel.js create mode 100644 lib/default_panels/GraphSubplotsPanel.js.map create mode 100644 lib/default_panels/GraphTransformsPanel.js create mode 100644 lib/default_panels/GraphTransformsPanel.js.map create mode 100644 lib/default_panels/StyleAxesPanel.js create mode 100644 lib/default_panels/StyleAxesPanel.js.map create mode 100644 lib/default_panels/StyleColorbarsPanel.js create mode 100644 lib/default_panels/StyleColorbarsPanel.js.map create mode 100644 lib/default_panels/StyleImagesPanel.js create mode 100644 lib/default_panels/StyleImagesPanel.js.map create mode 100644 lib/default_panels/StyleLayoutPanel.js create mode 100644 lib/default_panels/StyleLayoutPanel.js.map create mode 100644 lib/default_panels/StyleLegendPanel.js create mode 100644 lib/default_panels/StyleLegendPanel.js.map create mode 100644 lib/default_panels/StyleNotesPanel.js create mode 100644 lib/default_panels/StyleNotesPanel.js.map create mode 100644 lib/default_panels/StyleShapesPanel.js create mode 100644 lib/default_panels/StyleShapesPanel.js.map create mode 100644 lib/default_panels/StyleSlidersPanel.js create mode 100644 lib/default_panels/StyleSlidersPanel.js.map create mode 100644 lib/default_panels/StyleTracesPanel.js create mode 100644 lib/default_panels/StyleTracesPanel.js.map create mode 100644 lib/default_panels/StyleUpdateMenusPanel.js create mode 100644 lib/default_panels/StyleUpdateMenusPanel.js.map create mode 100644 lib/default_panels/index.js create mode 100644 lib/default_panels/index.js.map create mode 100644 lib/index.js create mode 100644 lib/index.js.map create mode 100644 lib/lib/bem.js create mode 100644 lib/lib/bem.js.map create mode 100644 lib/lib/computeTraceOptionsFromSchema.js create mode 100644 lib/lib/computeTraceOptionsFromSchema.js.map create mode 100644 lib/lib/connectAggregationToTransform.js create mode 100644 lib/lib/connectAggregationToTransform.js.map create mode 100644 lib/lib/connectAnnotationToLayout.js create mode 100644 lib/lib/connectAnnotationToLayout.js.map create mode 100644 lib/lib/connectAxesToLayout.js create mode 100644 lib/lib/connectAxesToLayout.js.map create mode 100644 lib/lib/connectCartesianSubplotToLayout.js create mode 100644 lib/lib/connectCartesianSubplotToLayout.js.map create mode 100644 lib/lib/connectImageToLayout.js create mode 100644 lib/lib/connectImageToLayout.js.map create mode 100644 lib/lib/connectLayoutToPlot.js create mode 100644 lib/lib/connectLayoutToPlot.js.map create mode 100644 lib/lib/connectNonCartesianSubplotToLayout.js create mode 100644 lib/lib/connectNonCartesianSubplotToLayout.js.map create mode 100644 lib/lib/connectRangeSelectorToAxis.js create mode 100644 lib/lib/connectRangeSelectorToAxis.js.map create mode 100644 lib/lib/connectShapeToLayout.js create mode 100644 lib/lib/connectShapeToLayout.js.map create mode 100644 lib/lib/connectSliderToLayout.js create mode 100644 lib/lib/connectSliderToLayout.js.map create mode 100644 lib/lib/connectToContainer.js create mode 100644 lib/lib/connectToContainer.js.map create mode 100644 lib/lib/connectTraceToPlot.js create mode 100644 lib/lib/connectTraceToPlot.js.map create mode 100644 lib/lib/connectTransformToTrace.js create mode 100644 lib/lib/connectTransformToTrace.js.map create mode 100644 lib/lib/connectUpdateMenuToLayout.js create mode 100644 lib/lib/connectUpdateMenuToLayout.js.map create mode 100644 lib/lib/constants.js create mode 100644 lib/lib/constants.js.map create mode 100644 lib/lib/customTraceType.js create mode 100644 lib/lib/customTraceType.js.map create mode 100644 lib/lib/dereference.js create mode 100644 lib/lib/dereference.js.map create mode 100644 lib/lib/getAllAxes.js create mode 100644 lib/lib/getAllAxes.js.map create mode 100644 lib/lib/index.js create mode 100644 lib/lib/index.js.map create mode 100644 lib/lib/localize.js create mode 100644 lib/lib/localize.js.map create mode 100644 lib/lib/multiValues.js create mode 100644 lib/lib/multiValues.js.map create mode 100644 lib/lib/sortMenu.js create mode 100644 lib/lib/sortMenu.js.map create mode 100644 lib/lib/strings.js create mode 100644 lib/lib/strings.js.map create mode 100644 lib/lib/striptags.js create mode 100644 lib/lib/striptags.js.map create mode 100644 lib/lib/test-utils.js create mode 100644 lib/lib/test-utils.js.map create mode 100644 lib/lib/traceTypes.js create mode 100644 lib/lib/traceTypes.js.map create mode 100644 lib/lib/unpackPlotProps.js create mode 100644 lib/lib/unpackPlotProps.js.map create mode 100644 lib/lib/walkObject.js create mode 100644 lib/lib/walkObject.js.map create mode 100644 lib/locales/en.js create mode 100644 lib/locales/en.js.map create mode 100644 lib/locales/index.js create mode 100644 lib/locales/index.js.map create mode 100644 lib/locales/xx.js create mode 100644 lib/locales/xx.js.map create mode 100644 lib/react-chart-editor.css create mode 100644 lib/react-chart-editor.ie.css create mode 100644 lib/react-chart-editor.ie.min.css create mode 100644 lib/react-chart-editor.min.css create mode 100644 lib/shame.js create mode 100644 lib/shame.js.map create mode 100644 react-chart-editor.iml diff --git a/.gitignore b/.gitignore index 716f439b9..153fc08e8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ npm-debug.log* example/dist -lib +# lib !src/lib accessTokens.js diff --git a/lib/DefaultEditor.js b/lib/DefaultEditor.js new file mode 100644 index 000000000..b529a971a --- /dev/null +++ b/lib/DefaultEditor.js @@ -0,0 +1,136 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _components = require('./components'); + +var _default_panels = require('./default_panels'); + +var _StyleColorbarsPanel = require('./default_panels/StyleColorbarsPanel'); + +var _Logo = require('./components/widgets/Logo'); + +var _Logo2 = _interopRequireDefault(_Logo); + +var _constants = require('./lib/constants'); + +var _context = require('./context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var DefaultEditor = function (_Component) { + _inherits(DefaultEditor, _Component); + + function DefaultEditor(props, context) { + _classCallCheck(this, DefaultEditor); + + var _this = _possibleConstructorReturn(this, (DefaultEditor.__proto__ || Object.getPrototypeOf(DefaultEditor)).call(this, props, context)); + + _this.hasTransforms = _this.hasTransforms.bind(_this); + _this.hasAxes = _this.hasAxes.bind(_this); + _this.hasMenus = _this.hasMenus.bind(_this); + _this.hasSliders = _this.hasSliders.bind(_this); + _this.hasColorbars = _this.hasColorbars.bind(_this); + return _this; + } + + _createClass(DefaultEditor, [{ + key: 'hasTransforms', + value: function hasTransforms() { + return this.context.fullData.some(function (d) { + return _constants.TRANSFORMABLE_TRACES.includes(d.type); + }); + } + }, { + key: 'hasAxes', + value: function hasAxes() { + var _this2 = this; + + return Object.keys(this.context.fullLayout._subplots).filter(function (type) { + return !['cartesian', 'mapbox'].includes(type) && _this2.context.fullLayout._subplots[type].length > 0; + }).length > 0; + } + }, { + key: 'hasMenus', + value: function hasMenus() { + var _context$fullLayout$u = this.context.fullLayout.updatemenus, + updatemenus = _context$fullLayout$u === undefined ? [] : _context$fullLayout$u; + + + return updatemenus.length > 0; + } + }, { + key: 'hasSliders', + value: function hasSliders() { + var _context$layout$slide = this.context.layout.sliders, + sliders = _context$layout$slide === undefined ? [] : _context$layout$slide; + + + return sliders.length > 0; + } + }, { + key: 'hasColorbars', + value: function hasColorbars() { + return this.context.fullData.some(function (d) { + return (0, _StyleColorbarsPanel.traceHasColorbar)({}, d); + }); + } + }, { + key: 'render', + value: function render() { + var _ = this.context.localize; + var logo = this.props.logoSrc && _react2.default.createElement(_Logo2.default, { src: this.props.logoSrc }); + + return _react2.default.createElement( + _components.PanelMenuWrapper, + { menuPanelOrder: this.props.menuPanelOrder }, + logo ? logo : null, + _react2.default.createElement(_default_panels.GraphCreatePanel, { group: _('Structure'), name: _('Traces') }), + _react2.default.createElement(_default_panels.GraphSubplotsPanel, { group: _('Structure'), name: _('Subplots') }), + this.hasTransforms() && _react2.default.createElement(_default_panels.GraphTransformsPanel, { group: _('Structure'), name: _('Transforms') }), + _react2.default.createElement(_default_panels.StyleLayoutPanel, { group: _('Style'), name: _('General') }), + _react2.default.createElement(_default_panels.StyleTracesPanel, { group: _('Style'), name: _('Traces') }), + this.hasAxes() && _react2.default.createElement(_default_panels.StyleAxesPanel, { group: _('Style'), name: _('Axes') }), + _react2.default.createElement(_default_panels.StyleLegendPanel, { group: _('Style'), name: _('Legend') }), + this.hasColorbars() && _react2.default.createElement(_default_panels.StyleColorbarsPanel, { group: _('Style'), name: _('Color Bars') }), + _react2.default.createElement(_default_panels.StyleNotesPanel, { group: _('Style'), name: _('Annotation') }), + _react2.default.createElement(_default_panels.StyleShapesPanel, { group: _('Style'), name: _('Shapes') }), + _react2.default.createElement(_default_panels.StyleImagesPanel, { group: _('Style'), name: _('Images') }), + this.hasSliders() && _react2.default.createElement(_default_panels.StyleSlidersPanel, { group: _('Style'), name: _('Sliders') }), + this.hasMenus() && _react2.default.createElement(_default_panels.StyleUpdateMenusPanel, { group: _('Style'), name: _('Menus') }), + this.props.children ? this.props.children : null + ); + } + }]); + + return DefaultEditor; +}(_react.Component); + +DefaultEditor.propTypes = { + children: _propTypes2.default.node, + logoSrc: _propTypes2.default.string, + menuPanelOrder: _propTypes2.default.array +}; + +DefaultEditor.contextType = _context.EditorControlsContext; + +exports.default = DefaultEditor; +//# sourceMappingURL=DefaultEditor.js.map \ No newline at end of file diff --git a/lib/DefaultEditor.js.map b/lib/DefaultEditor.js.map new file mode 100644 index 000000000..86ea34927 --- /dev/null +++ b/lib/DefaultEditor.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/DefaultEditor.js"],"names":["DefaultEditor","props","context","hasTransforms","bind","hasAxes","hasMenus","hasSliders","hasColorbars","fullData","some","TRANSFORMABLE_TRACES","includes","d","type","Object","keys","fullLayout","_subplots","filter","length","updatemenus","layout","sliders","_","localize","logo","logoSrc","menuPanelOrder","children","Component","propTypes","PropTypes","node","string","array","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;AAeA;;AACA;;;;AACA;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,8HACpBD,KADoB,EACbC,OADa;;AAE1B,UAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBC,IAAnB,OAArB;AACA,UAAKC,OAAL,GAAe,MAAKA,OAAL,CAAaD,IAAb,OAAf;AACA,UAAKE,QAAL,GAAgB,MAAKA,QAAL,CAAcF,IAAd,OAAhB;AACA,UAAKG,UAAL,GAAkB,MAAKA,UAAL,CAAgBH,IAAhB,OAAlB;AACA,UAAKI,YAAL,GAAoB,MAAKA,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QAAL,MAAmB,8BAAC,qCAAD,IAAuB,OAAOkB,EAAE,OAAF,CAA9B,EAA0C,MAAMA,EAAE,OAAF,CAAhD,GAhBtB;AAiBG,aAAKvB,KAAL,CAAW4B,QAAX,GAAsB,KAAK5B,KAAL,CAAW4B,QAAjC,GAA4C;AAjB/C,OADF;AAqBD;;;;EArEyBC,gB;;AAwE5B9B,cAAc+B,SAAd,GAA0B;AACxBF,YAAUG,oBAAUC,IADI;AAExBN,WAASK,oBAAUE,MAFK;AAGxBN,kBAAgBI,oBAAUG;AAHF,CAA1B;;AAMAnC,cAAcoC,WAAd,GAA4BC,8BAA5B;;kBAEerC,a","file":"DefaultEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {PanelMenuWrapper} from './components';\nimport {\n GraphCreatePanel,\n GraphTransformsPanel,\n GraphSubplotsPanel,\n StyleLayoutPanel,\n StyleAxesPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleSlidersPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n StyleColorbarsPanel,\n StyleUpdateMenusPanel,\n} from './default_panels';\nimport {traceHasColorbar} from './default_panels/StyleColorbarsPanel';\nimport Logo from './components/widgets/Logo';\nimport {TRANSFORMABLE_TRACES} from './lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass DefaultEditor extends Component {\n constructor(props, context) {\n super(props, context);\n this.hasTransforms = this.hasTransforms.bind(this);\n this.hasAxes = this.hasAxes.bind(this);\n this.hasMenus = this.hasMenus.bind(this);\n this.hasSliders = this.hasSliders.bind(this);\n this.hasColorbars = this.hasColorbars.bind(this);\n }\n\n hasTransforms() {\n return this.context.fullData.some(d => TRANSFORMABLE_TRACES.includes(d.type));\n }\n\n hasAxes() {\n return (\n Object.keys(this.context.fullLayout._subplots).filter(\n type =>\n !['cartesian', 'mapbox'].includes(type) &&\n this.context.fullLayout._subplots[type].length > 0\n ).length > 0\n );\n }\n\n hasMenus() {\n const {\n fullLayout: {updatemenus = []},\n } = this.context;\n\n return updatemenus.length > 0;\n }\n\n hasSliders() {\n const {\n layout: {sliders = []},\n } = this.context;\n\n return sliders.length > 0;\n }\n\n hasColorbars() {\n return this.context.fullData.some(d => traceHasColorbar({}, d));\n }\n\n render() {\n const _ = this.context.localize;\n const logo = this.props.logoSrc && ;\n\n return (\n \n {logo ? logo : null}\n \n \n {this.hasTransforms() && (\n \n )}\n \n \n {this.hasAxes() && }\n \n {this.hasColorbars() && }\n \n \n \n {this.hasSliders() && }\n {this.hasMenus() && }\n {this.props.children ? this.props.children : null}\n \n );\n }\n}\n\nDefaultEditor.propTypes = {\n children: PropTypes.node,\n logoSrc: PropTypes.string,\n menuPanelOrder: PropTypes.array,\n};\n\nDefaultEditor.contextType = EditorControlsContext;\n\nexport default DefaultEditor;\n"]} \ No newline at end of file diff --git a/lib/EditorControls.js b/lib/EditorControls.js new file mode 100644 index 000000000..969d84dfb --- /dev/null +++ b/lib/EditorControls.js @@ -0,0 +1,432 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _DefaultEditor = require('./DefaultEditor'); + +var _DefaultEditor2 = _interopRequireDefault(_DefaultEditor); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('./lib'); + +var _shame = require('./shame'); + +var _constants = require('./lib/constants'); + +var _fastIsnumeric = require('fast-isnumeric'); + +var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); + +var _nested_property = require('plotly.js/src/lib/nested_property'); + +var _nested_property2 = _interopRequireDefault(_nested_property); + +var _traceTypes = require('./lib/traceTypes'); + +var _containers = require('./components/containers'); + +var _context = require('./context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var EditorControls = function (_Component) { + _inherits(EditorControls, _Component); + + function EditorControls(props, context) { + _classCallCheck(this, EditorControls); + + var _this = _possibleConstructorReturn(this, (EditorControls.__proto__ || Object.getPrototypeOf(EditorControls)).call(this, props, context)); + + _this.localize = function (key) { + return (0, _lib.localizeString)(_this.props.dictionaries || {}, _this.props.locale, key); + }; + + // we only need to compute this once. + if (_this.props.plotly) { + _this.plotSchema = _this.props.plotly.PlotSchema.get(); + } + return _this; + } + + _createClass(EditorControls, [{ + key: 'getChildContext', + value: function getChildContext() { + var gd = this.props.graphDiv || {}; + return { + advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, + config: gd._context, + srcConverters: this.props.srcConverters, + data: gd.data, + dataSources: this.props.dataSources, + dataSourceOptions: this.props.dataSourceOptions, + dataSourceValueRenderer: this.props.dataSourceValueRenderer, + dataSourceOptionRenderer: this.props.dataSourceOptionRenderer, + dictionaries: this.props.dictionaries || {}, + localize: this.localize, + frames: gd._transitionData ? gd._transitionData._frames : [], + fullData: gd._fullData, + fullLayout: gd._fullLayout, + graphDiv: gd, + layout: gd.layout, + locale: this.props.locale, + onUpdate: this.handleUpdate.bind(this), + plotSchema: this.plotSchema, + plotly: this.props.plotly, + traceTypesConfig: this.props.traceTypesConfig, + showFieldTooltips: this.props.showFieldTooltips, + glByDefault: this.props.glByDefault, + mapBoxAccess: this.props.mapBoxAccess, + fontOptions: this.props.fontOptions, + chartHelp: this.props.chartHelp + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var gd = this.props.graphDiv || {}; + return { + advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, + config: gd._context, + srcConverters: this.props.srcConverters, + data: gd.data, + dataSources: this.props.dataSources, + dataSourceOptions: this.props.dataSourceOptions, + dataSourceValueRenderer: this.props.dataSourceValueRenderer, + dataSourceOptionRenderer: this.props.dataSourceOptionRenderer, + dictionaries: this.props.dictionaries || {}, + localize: this.localize, + frames: gd._transitionData ? gd._transitionData._frames : [], + fullData: gd._fullData, + fullLayout: gd._fullLayout, + graphDiv: gd, + layout: gd.layout, + locale: this.props.locale, + onUpdate: this.handleUpdate.bind(this), + plotSchema: this.plotSchema, + plotly: this.props.plotly, + traceTypesConfig: this.props.traceTypesConfig, + showFieldTooltips: this.props.showFieldTooltips, + glByDefault: this.props.glByDefault, + mapBoxAccess: this.props.mapBoxAccess, + fontOptions: this.props.fontOptions, + chartHelp: this.props.chartHelp + }; + } + }, { + key: 'handleUpdate', + value: function handleUpdate(_ref) { + var type = _ref.type, + payload = _ref.payload; + var graphDiv = this.props.graphDiv; + + + switch (type) { + case _constants.EDITOR_ACTIONS.UPDATE_TRACES: + if (this.props.beforeUpdateTraces) { + this.props.beforeUpdateTraces(payload); + } + + (0, _shame.shamefullyAdjustSizeref)(graphDiv, payload); + (0, _shame.shamefullyClearAxisTypes)(graphDiv, payload); + (0, _shame.shamefullyAdjustAxisRef)(graphDiv, payload); + (0, _shame.shamefullyAddTableColumns)(graphDiv, payload); + (0, _shame.shamefullyAdjustSplitStyleTargetContainers)(graphDiv, payload); + + for (var i = 0; i < payload.traceIndexes.length; i++) { + var _loop = function _loop(attr) { + var traceIndex = payload.traceIndexes[i]; + var splitTraceGroup = payload.splitTraceGroup ? payload.splitTraceGroup.toString() : null; + + var props = [(0, _nested_property2.default)(graphDiv.data[traceIndex], attr)]; + var value = payload.update[attr]; + + if (splitTraceGroup) { + props = (0, _shame.shamefullyCreateSplitStyleProps)(graphDiv, attr, traceIndex, splitTraceGroup); + } + + props.forEach(function (p) { + if (value !== void 0) { + p.set(value); + } + }); + }; + + for (var attr in payload.update) { + _loop(attr); + } + } + + if (this.props.afterUpdateTraces) { + this.props.afterUpdateTraces(payload); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); + } + break; + + case _constants.EDITOR_ACTIONS.UPDATE_LAYOUT: + (0, _shame.shamefullyAdjustGeo)(graphDiv, payload); + + if (this.props.beforeUpdateLayout) { + this.props.beforeUpdateLayout(payload); + } + for (var attr in payload.update) { + var prop = (0, _nested_property2.default)(graphDiv.layout, attr); + var _value = payload.update[attr]; + if (_value !== void 0) { + prop.set(_value); + } + } + if (this.props.afterUpdateLayout) { + this.props.afterUpdateLayout(payload); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); + } + break; + + case _constants.EDITOR_ACTIONS.ADD_TRACE: + if (this.props.beforeAddTrace) { + this.props.beforeAddTrace(payload); + } + + // can't use default prop because plotly.js mutates it: + // https://github.com/plotly/react-chart-editor/issues/509 + if (graphDiv.data.length === 0) { + graphDiv.data.push(this.props.makeDefaultTrace ? this.props.makeDefaultTrace() : { + type: 'scatter' + (this.props.glByDefault ? 'gl' : ''), + mode: 'markers' + }); + } else { + var prevTrace = graphDiv.data[graphDiv.data.length - 1]; + var prevTraceType = (0, _lib.plotlyTraceToCustomTrace)(prevTrace); + graphDiv.data.push((0, _lib.traceTypeToPlotlyInitFigure)(prevTraceType, prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : '')); + } + + if (this.props.afterAddTrace) { + this.props.afterAddTrace(payload); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); + } + break; + + case _constants.EDITOR_ACTIONS.DELETE_TRACE: + if (payload.traceIndexes && payload.traceIndexes.length) { + if (this.props.beforeDeleteTrace) { + this.props.beforeDeleteTrace(payload); + } + + (0, _shame.shamefullyAdjustAxisRef)(graphDiv, payload); + (0, _shame.shamefullyDeleteRelatedAnalysisTransforms)(graphDiv, payload); + + graphDiv.data.splice(payload.traceIndexes[0], 1); + if (this.props.afterDeleteTrace) { + this.props.afterDeleteTrace(payload); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); + } + } + break; + + case _constants.EDITOR_ACTIONS.DELETE_ANNOTATION: + if ((0, _fastIsnumeric2.default)(payload.annotationIndex)) { + if (this.props.beforeDeleteAnnotation) { + this.props.beforeDeleteAnnotation(payload); + } + graphDiv.layout.annotations.splice(payload.annotationIndex, 1); + if (this.props.afterDeleteAnnotation) { + this.props.afterDeleteAnnotation(payload); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); + } + } + break; + + case _constants.EDITOR_ACTIONS.DELETE_SHAPE: + if ((0, _fastIsnumeric2.default)(payload.shapeIndex)) { + if (this.props.beforeDeleteShape) { + this.props.beforeDeleteShape(payload); + } + graphDiv.layout.shapes.splice(payload.shapeIndex, 1); + if (this.props.afterDeleteShape) { + this.props.afterDeleteShape(payload); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); + } + } + break; + + case _constants.EDITOR_ACTIONS.DELETE_IMAGE: + if ((0, _fastIsnumeric2.default)(payload.imageIndex)) { + if (this.props.beforeDeleteImage) { + this.props.beforeDeleteImage(payload); + } + graphDiv.layout.images.splice(payload.imageIndex, 1); + if (this.props.afterDeleteImage) { + this.props.afterDeleteImage(payload); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); + } + } + break; + + case _constants.EDITOR_ACTIONS.DELETE_RANGESELECTOR: + if ((0, _fastIsnumeric2.default)(payload.rangeselectorIndex)) { + graphDiv.layout[payload.axisId].rangeselector.buttons.splice(payload.rangeselectorIndex, 1); + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); + } + } + break; + + case _constants.EDITOR_ACTIONS.DELETE_TRANSFORM: + if ((0, _fastIsnumeric2.default)(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) { + if (graphDiv.data[payload.traceIndex].transforms.length === 1) { + delete graphDiv.data[payload.traceIndex].transforms; + } else { + graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1); + } + if (this.props.onUpdate) { + this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); + } + } + break; + + default: + throw new Error(this.localize('must specify an action type to handleEditorUpdate')); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + _context.EditorControlsContext.Provider, + { value: this.provideValue() }, + _react2.default.createElement( + 'div', + { + className: (0, _lib.bem)('editor_controls') + ' plotly-editor--theme-provider' + ('' + (this.props.className ? ' ' + this.props.className : '')) + }, + _react2.default.createElement( + _containers.ModalProvider, + null, + this.props.graphDiv && this.props.graphDiv._fullLayout && (this.props.children ? this.props.children : _react2.default.createElement(_DefaultEditor2.default, null)) + ) + ) + ); + } + }]); + + return EditorControls; +}(_react.Component); + +EditorControls.propTypes = { + advancedTraceTypeSelector: _propTypes2.default.bool, + afterAddTrace: _propTypes2.default.func, + afterDeleteAnnotation: _propTypes2.default.func, + afterDeleteShape: _propTypes2.default.func, + afterDeleteImage: _propTypes2.default.func, + afterDeleteTrace: _propTypes2.default.func, + afterUpdateLayout: _propTypes2.default.func, + afterUpdateTraces: _propTypes2.default.func, + beforeAddTrace: _propTypes2.default.func, + beforeDeleteAnnotation: _propTypes2.default.func, + beforeDeleteShape: _propTypes2.default.func, + beforeDeleteImage: _propTypes2.default.func, + beforeDeleteTrace: _propTypes2.default.func, + beforeUpdateLayout: _propTypes2.default.func, + beforeUpdateTraces: _propTypes2.default.func, + children: _propTypes2.default.node, + className: _propTypes2.default.string, + srcConverters: _propTypes2.default.shape({ + toSrc: _propTypes2.default.func.isRequired, + fromSrc: _propTypes2.default.func.isRequired + }), + dataSourceOptionRenderer: _propTypes2.default.func, + dataSourceOptions: _propTypes2.default.array, + dataSources: _propTypes2.default.object, + dataSourceValueRenderer: _propTypes2.default.func, + dictionaries: _propTypes2.default.object, + graphDiv: _propTypes2.default.object, + locale: _propTypes2.default.string, + onUpdate: _propTypes2.default.func, + plotly: _propTypes2.default.object, + showFieldTooltips: _propTypes2.default.bool, + traceTypesConfig: _propTypes2.default.object, + makeDefaultTrace: _propTypes2.default.func, + glByDefault: _propTypes2.default.bool, + mapBoxAccess: _propTypes2.default.bool, + fontOptions: _propTypes2.default.array, + chartHelp: _propTypes2.default.object +}; + +EditorControls.defaultProps = { + showFieldTooltips: false, + locale: 'en', + traceTypesConfig: { + categories: function categories(_) { + return (0, _traceTypes.categoryLayout)(_); + }, + traces: function traces(_) { + return (0, _traceTypes.traceTypes)(_); + }, + complex: true + }, + fontOptions: _constants.DEFAULT_FONTS +}; + +EditorControls.childContextTypes = { + advancedTraceTypeSelector: _propTypes2.default.bool, + config: _propTypes2.default.object, + srcConverters: _propTypes2.default.shape({ + toSrc: _propTypes2.default.func.isRequired, + fromSrc: _propTypes2.default.func.isRequired + }), + data: _propTypes2.default.array, + dataSourceOptionRenderer: _propTypes2.default.func, + dataSourceOptions: _propTypes2.default.array, + dataSources: _propTypes2.default.object, + dataSourceValueRenderer: _propTypes2.default.func, + dictionaries: _propTypes2.default.object, + frames: _propTypes2.default.array, + fullData: _propTypes2.default.array, + fullLayout: _propTypes2.default.object, + graphDiv: _propTypes2.default.any, + layout: _propTypes2.default.object, + locale: _propTypes2.default.string, + localize: _propTypes2.default.func, + onUpdate: _propTypes2.default.func, + plotly: _propTypes2.default.object, + plotSchema: _propTypes2.default.object, + traceTypesConfig: _propTypes2.default.object, + showFieldTooltips: _propTypes2.default.bool, + glByDefault: _propTypes2.default.bool, + mapBoxAccess: _propTypes2.default.bool, + fontOptions: _propTypes2.default.array, + chartHelp: _propTypes2.default.object +}; + +exports.default = EditorControls; +//# sourceMappingURL=EditorControls.js.map \ No newline at end of file diff --git a/lib/EditorControls.js.map b/lib/EditorControls.js.map new file mode 100644 index 000000000..845984f0b --- /dev/null +++ b/lib/EditorControls.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","type","payload","EDITOR_ACTIONS","UPDATE_TRACES","beforeUpdateTraces","i","traceIndexes","length","attr","traceIndex","splitTraceGroup","toString","value","update","forEach","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAUA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;;;;;;;;;IAEMA,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAG1B,UAAKC,QAAL,GAAgB;AAAA,aAAO,yBAAe,MAAKF,KAAL,CAAWG,YAAX,IAA2B,EAA1C,EAA8C,MAAKH,KAAL,CAAWI,MAAzD,EAAiEC,GAAjE,CAAP;AAAA,KAAhB;;AAEA;AACA,QAAI,MAAKL,KAAL,CAAWM,MAAf,EAAuB;AACrB,YAAKC,UAAL,GAAkB,MAAKP,KAAL,CAAWM,MAAX,CAAkBE,UAAlB,CAA6BC,GAA7B,EAAlB;AACD;AARyB;AAS3B;;;;sCAEiB;AAChB,UAAMC,KAAK,KAAKV,KAAL,CAAWW,QAAX,IAAuB,EAAlC;AACA,aAAO;AACLC,mCAA2B,KAAKZ,KAAL,CAAWY,yBADjC;AAELC,gBAAQH,GAAGI,QAFN;AAGLC,uBAAe,KAAKf,KAAL,CAAWe,aAHrB;AAILC,cAAMN,GAAGM,IAJJ;AAKLC,qBAAa,KAAKjB,KAAL,CAAWiB,WALnB;AAMLC,2BAAmB,KAAKlB,KAAL,CAAWkB,iBANzB;AAOLC,iCAAyB,KAAKnB,KAAL,CAAWmB,uBAP/B;AAQLC,kCAA0B,KAAKpB,KAAL,CAAWoB,wBARhC;AASLjB,sBAAc,KAAKH,KAAL,CAAWG,YAAX,IAA2B,EATpC;AAULD,kBAAU,KAAKA,QAVV;AAWLmB,gBAAQX,GAAGY,eAAH,GAAqBZ,GAAGY,eAAH,CAAmBC,OAAxC,GAAkD,EAXrD;AAYLC,kBAAUd,GAA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,UADO;AAE7BC,aAASR,oBAAUE,IAAV,CAAeK;AAFK,GAAhB,CAHkB;AAOjChG,QAAMyF,oBAAUS,KAPiB;AAQjC9F,4BAA0BqF,oBAAUE,IARH;AASjCzF,qBAAmBuF,oBAAUS,KATI;AAUjCjG,eAAawF,oBAAUU,MAVU;AAWjChG,2BAAyBsF,oBAAUE,IAXF;AAYjCxG,gBAAcsG,oBAAUU,MAZS;AAajC9F,UAAQoF,oBAAUS,KAbe;AAcjC1F,YAAUiF,oBAAUS,KAda;AAejCxF,cAAY+E,oBAAUU,MAfW;AAgBjCxG,YAAU8F,oBAAUkB,GAhBa;AAiBjC/F,UAAQ6E,oBAAUU,MAjBe;AAkBjC/G,UAAQqG,oBAAUI,MAlBe;AAmBjC3G,YAAUuG,oBAAUE,IAnBa;AAoBjC9E,YAAU4E,oBAAUE,IApBa;AAqBjCrG,UAAQmG,oBAAUU,MArBe;AAsBjC5G,cAAYkG,oBAAUU,MAtBW;AAuBjCnF,oBAAkByE,oBAAUU,MAvBK;AAwBjClF,qBAAmBwE,oBAAUC,IAxBI;AAyBjCxE,eAAauE,oBAAUC,IAzBU;AA0BjCvE,gBAAcsE,oBAAUC,IA1BS;AA2BjCtE,eAAaqE,oBAAUS,KA3BU;AA4BjC7E,aAAWoE,oBAAUU;AA5BY,CAAnC;;kBA+BepH,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? this.props.children : )}\n \n
\n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file diff --git a/lib/PlotlyEditor.js b/lib/PlotlyEditor.js new file mode 100644 index 000000000..5907f9321 --- /dev/null +++ b/lib/PlotlyEditor.js @@ -0,0 +1,145 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _factory = require('react-plotly.js/factory'); + +var _factory2 = _interopRequireDefault(_factory); + +var _EditorControls = require('./EditorControls'); + +var _EditorControls2 = _interopRequireDefault(_EditorControls); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _constants = require('./lib/constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var PlotlyEditor = function (_Component) { + _inherits(PlotlyEditor, _Component); + + function PlotlyEditor(props) { + _classCallCheck(this, PlotlyEditor); + + var _this = _possibleConstructorReturn(this, (PlotlyEditor.__proto__ || Object.getPrototypeOf(PlotlyEditor)).call(this)); + + _this.state = { graphDiv: {} }; + _this.PlotComponent = (0, _factory2.default)(props.plotly); + _this.handleRender = _this.handleRender.bind(_this); + return _this; + } + + _createClass(PlotlyEditor, [{ + key: 'handleRender', + value: function handleRender(fig, graphDiv) { + this.setState({ graphDiv: graphDiv }); + if (this.props.onRender) { + this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + 'div', + { className: 'plotly_editor' }, + !this.props.hideControls && _react2.default.createElement( + _EditorControls2.default, + { + graphDiv: this.state.graphDiv, + dataSources: this.props.dataSources, + dataSourceOptions: this.props.dataSourceOptions, + plotly: this.props.plotly, + onUpdate: this.props.onUpdate, + advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, + locale: this.props.locale, + traceTypesConfig: this.props.traceTypesConfig, + dictionaries: this.props.dictionaries, + showFieldTooltips: this.props.showFieldTooltips, + srcConverters: this.props.srcConverters, + makeDefaultTrace: this.props.makeDefaultTrace, + glByDefault: this.props.glByDefault, + mapBoxAccess: Boolean(this.props.config && this.props.config.mapboxAccessToken), + fontOptions: this.props.fontOptions, + chartHelp: this.props.chartHelp + }, + this.props.children + ), + _react2.default.createElement( + 'div', + { className: 'plotly_editor_plot', style: { width: '100%', height: '100%' } }, + _react2.default.createElement(this.PlotComponent, { + data: this.props.data, + layout: this.props.layout, + frames: this.props.frames, + config: this.props.config, + useResizeHandler: this.props.useResizeHandler, + debug: this.props.debug, + onInitialized: this.handleRender, + onUpdate: this.handleRender, + style: { width: '100%', height: '100%' }, + divId: this.props.divId + }) + ) + ); + } + }]); + + return PlotlyEditor; +}(_react.Component); + +PlotlyEditor.propTypes = { + children: _propTypes2.default.any, + layout: _propTypes2.default.object, + data: _propTypes2.default.array, + config: _propTypes2.default.object, + dataSourceOptions: _propTypes2.default.array, + dataSources: _propTypes2.default.object, + frames: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + onRender: _propTypes2.default.func, + plotly: _propTypes2.default.object, + useResizeHandler: _propTypes2.default.bool, + debug: _propTypes2.default.bool, + advancedTraceTypeSelector: _propTypes2.default.bool, + locale: _propTypes2.default.string, + traceTypesConfig: _propTypes2.default.object, + dictionaries: _propTypes2.default.object, + divId: _propTypes2.default.string, + hideControls: _propTypes2.default.bool, + showFieldTooltips: _propTypes2.default.bool, + srcConverters: _propTypes2.default.shape({ + toSrc: _propTypes2.default.func.isRequired, + fromSrc: _propTypes2.default.func.isRequired + }), + makeDefaultTrace: _propTypes2.default.func, + glByDefault: _propTypes2.default.bool, + fontOptions: _propTypes2.default.array, + chartHelp: _propTypes2.default.object +}; + +PlotlyEditor.defaultProps = { + hideControls: false, + showFieldTooltips: false, + fontOptions: _constants.DEFAULT_FONTS +}; + +exports.default = PlotlyEditor; +//# sourceMappingURL=PlotlyEditor.js.map \ No newline at end of file diff --git a/lib/PlotlyEditor.js.map b/lib/PlotlyEditor.js.map new file mode 100644 index 000000000..37874bc97 --- /dev/null +++ b/lib/PlotlyEditor.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/PlotlyEditor.js"],"names":["PlotlyEditor","props","state","graphDiv","PlotComponent","plotly","handleRender","bind","fig","setState","onRender","data","layout","_transitionData","_frames","hideControls","dataSources","dataSourceOptions","onUpdate","advancedTraceTypeSelector","locale","traceTypesConfig","dictionaries","showFieldTooltips","srcConverters","makeDefaultTrace","glByDefault","Boolean","config","mapboxAccessToken","fontOptions","chartHelp","children","width","height","frames","useResizeHandler","debug","divId","Component","propTypes","PropTypes","any","object","array","func","bool","string","shape","toSrc","isRequired","fromSrc","defaultProps","DEFAULT_FONTS"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Y;;;AACJ,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AAEjB,UAAKC,KAAL,GAAa,EAACC,UAAU,EAAX,EAAb;AACA,UAAKC,aAAL,GAAqB,uBAAoBH,MAAMI,MAA1B,CAArB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAJiB;AAKlB;;;;iCAEYC,G,EAAKL,Q,EAAU;AAC1B,WAAKM,QAAL,CAAc,EAACN,kBAAD,EAAd;AACA,UAAI,KAAKF,KAAL,CAAWS,QAAf,EAAyB;AACvB,aAAKT,KAAL,CAAWS,QAAX,CAAoBP,SAASQ,IAA7B,EAAmCR,SAASS,MAA5C,EAAoDT,SAASU,eAAT,CAAyBC,OAA7E;AACD;AACF;;;6BAEQ;AACP,aACE;AAAA;AAAA,UAAK,WAAU,eAAf;AACG,SAAC,KAAKb,KAAL,CAAWc,YAAZ,IACC;AAAC,kCAAD;AAAA;AACE,sBAAU,KAAKb,KAAL,CAAWC,QADvB;AAEE,yBAAa,KAAKF,KAAL,CAAWe,WAF1B;AAGE,+BAAmB,KAAKf,KAAL,CAAWgB,iBAHhC;AAIE,oBAAQ,KAAKhB,KAAL,CAAWI,MAJrB;A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,SAAb,GAAyB;AACvBR,YAAUS,oBAAUC,GADG;AAEvB9B,UAAQ6B,oBAAUE,MAFK;AAGvBhC,QAAM8B,oBAAUG,KAHO;AAIvBhB,UAAQa,oBAAUE,MAJK;AAKvB1B,qBAAmBwB,oBAAUG,KALN;AAMvB5B,eAAayB,oBAAUE,MANA;AAOvBR,UAAQM,oBAAUG,KAPK;AAQvB1B,YAAUuB,oBAAUI,IARG;AASvBnC,YAAU+B,oBAAUI,IATG;AAUvBxC,UAAQoC,oBAAUE,MAVK;AAWvBP,oBAAkBK,oBAAUK,IAXL;AAYvBT,SAAOI,oBAAUK,IAZM;AAavB3B,6BAA2BsB,oBAAUK,IAbd;AAcvB1B,UAAQqB,oBAAUM,MAdK;AAevB1B,oBAAkBoB,oBAAUE,MAfL;AAgBvBrB,gBAAcmB,oBAAUE,MAhBD;AAiBvBL,SAAOG,oBAAUM,MAjBM;AAkBvBhC,gBAAc0B,oBAAUK,IAlBD;AAmBvBvB,qBAAmBkB,oBAAUK,IAnBN;AAoBvBtB,iBAAeiB,oBAAUO,KAAV,CAAgB;AAC7BC,WAAOR,oBAAUI,IAAV,CAAeK,UADO;AAE7BC,aAASV,oBAAUI,IAAV,CAAeK;AAFK,GAAhB,CApBQ;AAwBvBzB,oBAAkBgB,oBAAUI,IAxBL;AAyBvBnB,eAAae,oBAAUK,IAzBA;AA0BvBhB,eAAaW,oBAAUG,KA1BA;AA2BvBb,aAAWU,oBAAUE;AA3BE,CAAzB;;AA8BA3C,aAAaoD,YAAb,GAA4B;AAC1BrC,gBAAc,KADY;AAE1BQ,qBAAmB,KAFO;AAG1BO,eAAauB;AAHa,CAA5B;;kBAMerD,Y","file":"PlotlyEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport createPlotComponent from 'react-plotly.js/factory';\nimport EditorControls from './EditorControls';\nimport PropTypes from 'prop-types';\nimport {DEFAULT_FONTS} from 'lib/constants';\n\nclass PlotlyEditor extends Component {\n constructor(props) {\n super();\n this.state = {graphDiv: {}};\n this.PlotComponent = createPlotComponent(props.plotly);\n this.handleRender = this.handleRender.bind(this);\n }\n\n handleRender(fig, graphDiv) {\n this.setState({graphDiv});\n if (this.props.onRender) {\n this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n render() {\n return (\n
\n {!this.props.hideControls && (\n \n {this.props.children}\n \n )}\n
\n \n
\n
\n );\n }\n}\n\nPlotlyEditor.propTypes = {\n children: PropTypes.any,\n layout: PropTypes.object,\n data: PropTypes.array,\n config: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n frames: PropTypes.array,\n onUpdate: PropTypes.func,\n onRender: PropTypes.func,\n plotly: PropTypes.object,\n useResizeHandler: PropTypes.bool,\n debug: PropTypes.bool,\n advancedTraceTypeSelector: PropTypes.bool,\n locale: PropTypes.string,\n traceTypesConfig: PropTypes.object,\n dictionaries: PropTypes.object,\n divId: PropTypes.string,\n hideControls: PropTypes.bool,\n showFieldTooltips: PropTypes.bool,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nPlotlyEditor.defaultProps = {\n hideControls: false,\n showFieldTooltips: false,\n fontOptions: DEFAULT_FONTS,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file diff --git a/lib/__percy__/panels.percy.js b/lib/__percy__/panels.percy.js new file mode 100644 index 000000000..8df54b5c2 --- /dev/null +++ b/lib/__percy__/panels.percy.js @@ -0,0 +1,82 @@ +'use strict'; + +var _testUtils = require('../lib/test-utils'); + +var _components = require('../components'); + +var _percy = require('../../dev/percy'); + +var mocks = _interopRequireWildcard(_percy); + +var _default_panels = require('../default_panels/'); + +var panels = _interopRequireWildcard(_default_panels); + +require('../../dev/styles.css'); + +require('../styles/main.scss'); + +require('./percy.css'); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +/** + * To add more Percy tests - add a mock file to /dev/percy, add it to /dev/percy/index.js + * To specify which panels to test with the mock, add entry to panelsToTest, else all panels will be tested + */ +var panelsToTest = { + bar: ['GraphCreatePanel', 'StyleTracesPanel'], + box: ['GraphCreatePanel', 'StyleTracesPanel'], + pie: ['GraphCreatePanel', 'StyleTracesPanel'], + histogram: ['GraphCreatePanel', 'StyleTracesPanel'], + histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'], + violin: ['GraphCreatePanel', 'StyleTracesPanel'] +}; + +window.URL.createObjectURL = function () { + return null; +}; + +var panelFixture = function panelFixture(Panel, group, name, figure) { + var gd = (0, _testUtils.setupGraphDiv)(figure); + gd._context = _testUtils.plotly.setPlotConfig(); + gd._context.setBackground = function () { + return null; + }; + + return React.createElement( + 'div', + { className: 'plotly_editor' }, + React.createElement( + _testUtils.TestEditor, + { + plotly: _testUtils.plotly, + graphDiv: gd, + dataSources: _testUtils.fixtures.scatter().dataSources, + dataSourceOptions: _testUtils.fixtures.scatter().dataSourceOptions + }, + React.createElement( + _components.PanelMenuWrapper, + null, + React.createElement(Panel, { group: group, name: name }) + ) + ) + ); +}; + +var snapshotWidth = 500; + +Object.keys(mocks).forEach(function (m) { + var selectedPanels = panelsToTest[m] ? panelsToTest[m] : Object.keys(panels); + + selectedPanels.forEach(function (p) { + var words = p.split(/(?=[A-Z])/); + var panelGroup = words[0]; + var panelName = words.slice(1, -1).join(' '); + + percySnapshot(m + '_' + p, { widths: [snapshotWidth] }, function () { + return panelFixture(panels[p], panelGroup, panelName, mocks[m]); + }); + }); +}); +//# sourceMappingURL=panels.percy.js.map \ No newline at end of file diff --git a/lib/__percy__/panels.percy.js.map b/lib/__percy__/panels.percy.js.map new file mode 100644 index 000000000..aacaf7863 --- /dev/null +++ b/lib/__percy__/panels.percy.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/__percy__/panels.percy.js"],"names":["mocks","panels","panelsToTest","bar","box","pie","histogram","histogram2d","violin","window","URL","createObjectURL","panelFixture","Panel","group","name","figure","gd","_context","plotly","setPlotConfig","setBackground","fixtures","scatter","dataSources","dataSourceOptions","snapshotWidth","Object","keys","forEach","selectedPanels","m","words","p","split","panelGroup","panelName","slice","join","percySnapshot","widths"],"mappings":";;AAAA;;AAEA;;AAEA;;IAAYA,K;;AACZ;;IAAYC,M;;AAEZ;;AACA;;AACA;;;;AAEA;;;;AAIA,IAAMC,eAAe;AACnBC,OAAK,CAAC,kBAAD,EAAqB,kBAArB,CADc;AAEnBC,OAAK,CAAC,kBAAD,EAAqB,kBAArB,CAFc;AAGnBC,OAAK,CAAC,kBAAD,EAAqB,kBAArB,CAHc;AAInBC,aAAW,CAAC,kBAAD,EAAqB,kBAArB,CAJQ;AAKnBC,eAAa,CAAC,kBAAD,EAAqB,kBAArB,CALM;AAMnBC,UAAQ,CAAC,kBAAD,EAAqB,kBAArB;AANW,CAArB;;AASAC,OAAOC,GAAP,CAAWC,eAAX,GAA6B,YAAW;AACtC,SAAO,IAAP;AACD,CAFD;;AAIA,IAAMC,eAAe,SAAfA,YAAe,CAACC,KAAD,EAAQC,KAAR,EAAeC,IAAf,EAAqBC,MAArB,EAAgC;AACnD,MAAMC,KAAK,8BAAcD,MAAd,CAAX;AACAC,KAAGC,QAAH,GAAcC,kBAAOC,aAAP,EAAd;AACAH,KAAGC,QAAH,CAAYG,aAAZ,GAA4B,YAAM;AAChC,WAAO,IAAP;AACD,GAFD;;AAIA,SACE;AAAA;AAAA,MAAK,WAAU,eAAf;AACE;AAAC,2BAAD;AAAA;AACE,gBAAQF,iBADV;AAEE,kBAAUF,EAFZ;AAGE,qBAAaK,oBAASC,OAAT,GAAmBC,WAHlC;AAIE,2BAAmBF,oBAASC,OAAT,GAAmBE;AAJxC;AAME;AAAC,oCAAD;AAAA;AACE,4BAAC,KAAD,IAAO,OAAOX,KAAd,EAAqB,MAAMC,IAA3B;AADF;AANF;AADF,GADF;AAcD,CArBD;;AAuBA,IAAMW,gBAAgB,GAAtB;;AAEAC,OAAOC,IAAP,CAAY5B,KAAZ,EAAmB6B,OAAnB,CAA2B,aAAK;AAC9B,MAAMC,iBAAiB5B,aAAa6B,CAAb,IAAkB7B,aAAa6B,CAAb,CAAlB,GAAoCJ,OAAOC,IAAP,CAAY3B,MAAZ,CAA3D;;AAEA6B,iBAAeD,OAAf,CAAuB,aAAK;AAC1B,QAAMG,QAAQC,EAAEC,KAAF,CAAQ,WAAR,CAAd;AACA,QAAMC,aAAaH,MAAM,CAAN,CAAnB;AACA,QAAMI,YAAYJ,MAAMK,KAAN,CAAY,CAAZ,EAAe,CAAC,CAAhB,EAAmBC,IAAnB,CAAwB,GAAxB,CAAlB;;AAEAC,kBAAiBR,CAAjB,SAAsBE,CAAtB,EAA2B,EAACO,QAAQ,CAACd,aAAD,CAAT,EAA3B,EAAsD;AAAA,aACpDd,aAAaX,OAAOgC,CAAP,CAAb,EAAwBE,UAAxB,EAAoCC,SAApC,EAA+CpC,MAAM+B,CAAN,CAA/C,CADoD;AAAA,KAAtD;AAGD,GARD;AASD,CAZD","file":"panels.percy.js","sourcesContent":["import {TestEditor, setupGraphDiv, fixtures, plotly} from 'lib/test-utils';\n\nimport {PanelMenuWrapper} from '../components';\n\nimport * as mocks from '../../dev/percy';\nimport * as panels from '../default_panels/';\n\nimport '../../dev/styles.css';\nimport '../styles/main.scss';\nimport './percy.css';\n\n/**\n * To add more Percy tests - add a mock file to /dev/percy, add it to /dev/percy/index.js\n * To specify which panels to test with the mock, add entry to panelsToTest, else all panels will be tested\n */\nconst panelsToTest = {\n bar: ['GraphCreatePanel', 'StyleTracesPanel'],\n box: ['GraphCreatePanel', 'StyleTracesPanel'],\n pie: ['GraphCreatePanel', 'StyleTracesPanel'],\n histogram: ['GraphCreatePanel', 'StyleTracesPanel'],\n histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'],\n violin: ['GraphCreatePanel', 'StyleTracesPanel'],\n};\n\nwindow.URL.createObjectURL = function() {\n return null;\n};\n\nconst panelFixture = (Panel, group, name, figure) => {\n const gd = setupGraphDiv(figure);\n gd._context = plotly.setPlotConfig();\n gd._context.setBackground = () => {\n return null;\n };\n\n return (\n
\n \n \n \n \n \n
\n );\n};\n\nconst snapshotWidth = 500;\n\nObject.keys(mocks).forEach(m => {\n const selectedPanels = panelsToTest[m] ? panelsToTest[m] : Object.keys(panels);\n\n selectedPanels.forEach(p => {\n const words = p.split(/(?=[A-Z])/);\n const panelGroup = words[0];\n const panelName = words.slice(1, -1).join(' ');\n\n percySnapshot(`${m}_${p}`, {widths: [snapshotWidth]}, () =>\n panelFixture(panels[p], panelGroup, panelName, mocks[m])\n );\n });\n});\n"]} \ No newline at end of file diff --git a/lib/components/PanelMenuWrapper.js b/lib/components/PanelMenuWrapper.js new file mode 100644 index 000000000..1d208183c --- /dev/null +++ b/lib/components/PanelMenuWrapper.js @@ -0,0 +1,175 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _SidebarGroup = require('./sidebar/SidebarGroup'); + +var _SidebarGroup2 = _interopRequireDefault(_SidebarGroup); + +var _lib = require('../lib'); + +var _sortMenu = require('../lib/sortMenu'); + +var _sortMenu2 = _interopRequireDefault(_sortMenu); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var PanelsWithSidebar = function (_Component) { + _inherits(PanelsWithSidebar, _Component); + + function PanelsWithSidebar(props) { + _classCallCheck(this, PanelsWithSidebar); + + var _this = _possibleConstructorReturn(this, (PanelsWithSidebar.__proto__ || Object.getPrototypeOf(PanelsWithSidebar)).call(this, props)); + + var opts = _this.computeMenuOptions(props); + var firstSidebarGroup = opts.filter(function (o) { + return o.panels; + })[0]; + + _this.state = { + group: firstSidebarGroup.name, + panel: firstSidebarGroup.panels[0] + }; + + _this.setPanel = _this.setPanel.bind(_this); + _this.renderSection = _this.renderSection.bind(_this); + return _this; + } + + _createClass(PanelsWithSidebar, [{ + key: 'setPanel', + value: function setPanel(group, panel) { + this.setState({ group: group, panel: panel }); + } + }, { + key: 'getChildContext', + value: function getChildContext() { + return { + setPanel: this.setPanel + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + return { + setPanel: this.setPanel + }; + } + }, { + key: 'renderSection', + value: function renderSection(section, i) { + if (section.type && (section.type.plotly_editor_traits || {}).sidebar_element) { + return (0, _react.cloneElement)(section, { key: i }); + } + return _react2.default.createElement(_SidebarGroup2.default, { + key: i, + selectedGroup: this.state.group, + selectedPanel: this.state.panel, + group: section.name, + panels: section.panels, + onChangeGroup: this.setPanel + }); + } + }, { + key: 'computeMenuOptions', + value: function computeMenuOptions(props) { + var children = props.children, + menuPanelOrder = props.menuPanelOrder; + + var sections = []; + var groupLookup = {}; + var groupIndex = void 0; + var panels = _react2.default.Children.toArray(children); + + if (menuPanelOrder) { + (0, _sortMenu2.default)(panels, menuPanelOrder); + } + + panels.forEach(function (child) { + if (!child) { + return; + } + var group = child.props.group; + var name = child.props.name; + + if (group && name) { + var obj = void 0; + if (groupLookup.hasOwnProperty(group)) { + groupIndex = groupLookup[group]; + obj = sections[groupIndex]; + } else { + groupLookup[group] = sections.length; + obj = { name: group, panels: [] }; + sections.push(obj); + } + obj.panels.push(name); + } + + if ((child.type.plotly_editor_traits || {}).sidebar_element) { + sections.push(child); + } + }); + + return sections; + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var menuOpts = this.computeMenuOptions(this.props); + + return _react2.default.createElement( + _context.PanelMenuWrapperContext.Provider, + { value: this.provideValue() }, + _react2.default.createElement( + 'div', + { className: (0, _lib.bem)('editor_controls', 'wrapper') }, + _react2.default.createElement( + 'div', + { className: (0, _lib.bem)('sidebar') }, + menuOpts.map(this.renderSection) + ), + _react2.default.Children.map(this.props.children, function (child, i) { + return child === null || _this2.state.group !== child.props.group || _this2.state.panel !== child.props.name ? null : (0, _react.cloneElement)(child, { key: i }); + }) + ) + ); + } + }]); + + return PanelsWithSidebar; +}(_react.Component); + +PanelsWithSidebar.propTypes = { + children: _propTypes2.default.node, + menuPanelOrder: _propTypes2.default.array +}; + +PanelsWithSidebar.childContextTypes = { + setPanel: _propTypes2.default.func +}; + +exports.default = PanelsWithSidebar; +//# sourceMappingURL=PanelMenuWrapper.js.map \ No newline at end of file diff --git a/lib/components/PanelMenuWrapper.js.map b/lib/components/PanelMenuWrapper.js.map new file mode 100644 index 000000000..247b8b863 --- /dev/null +++ b/lib/components/PanelMenuWrapper.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/components/PanelMenuWrapper.js"],"names":["PanelsWithSidebar","props","opts","computeMenuOptions","firstSidebarGroup","filter","o","panels","state","group","name","panel","setPanel","bind","renderSection","setState","section","i","type","plotly_editor_traits","sidebar_element","key","children","menuPanelOrder","sections","groupLookup","groupIndex","React","Children","toArray","forEach","child","obj","hasOwnProperty","length","push","menuOpts","provideValue","map","Component","propTypes","PropTypes","node","array","childContextTypes","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;;;;;;;IAEMA,iB;;;AACJ,6BAAYC,KAAZ,EAAmB;AAAA;;AAAA,sIACXA,KADW;;AAGjB,QAAMC,OAAO,MAAKC,kBAAL,CAAwBF,KAAxB,CAAb;AACA,QAAMG,oBAAoBF,KAAKG,MAAL,CAAY;AAAA,aAAKC,EAAEC,MAAP;AAAA,KAAZ,EAA2B,CAA3B,CAA1B;;AAEA,UAAKC,KAAL,GAAa;AACXC,aAAOL,kBAAkBM,IADd;AAEXC,aAAOP,kBAAkBG,MAAlB,CAAyB,CAAzB;AAFI,KAAb;;AAKA,UAAKK,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AACA,UAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBD,IAAnB,OAArB;AAZiB;AAalB;;;;6BAEQJ,K,EAAOE,K,EAAO;AACrB,WAAKI,QAAL,CAAc,EAACN,YAAD,EAAQE,YAAR,EAAd;AACD;;;sCAEiB;AAChB,aAAO;AACLC,kBAAU,KAAKA;AADV,OAAP;AAGD;;;mCAEc;AACb,aAAO;AACLA,kBAAU,KAAKA;AADV,OAAP;AAGD;;;kCAEaI,O,EAASC,C,EAAG;AACxB,UAAID,QAAQE,IAAR,IAAgB,CAACF,QAAQE,IAAR,CAAaC,oBAAb,IAAqC,EAAtC,EAA0CC,eAA9D,EAA+E;AAC7E,eAAO,yBAAaJ,OAAb,EAAsB,EAACK,KAAKJ,CAAN,EAAtB,CAAP;AACD;AACD,aACE,8BAAC,sBAAD;AACE,aAAKA,CADP;AAEE,uBAAe,KAAKT,KAAL,CAAWC,KAF5B;AAGE,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KjC,kBAAL,CAAwB,KAAKF,KAA7B,CAAjB;;AAEA,aACE;AAAC,wCAAD,CAAyB,QAAzB;AAAA,UAAkC,OAAO,KAAKoC,YAAL,EAAzC;AACE;AAAA;AAAA,YAAK,WAAW,cAAI,iBAAJ,EAAuB,SAAvB,CAAhB;AACE;AAAA;AAAA,cAAK,WAAW,cAAI,SAAJ,CAAhB;AAAiCD,qBAASE,GAAT,CAAa,KAAKxB,aAAlB;AAAjC,WADF;AAEGa,0BAAMC,QAAN,CAAeU,GAAf,CACC,KAAKrC,KAAL,CAAWqB,QADZ,EAEC,UAACS,KAAD,EAAQd,CAAR;AAAA,mBACEc,UAAU,IAAV,IACA,OAAKvB,KAAL,CAAWC,KAAX,KAAqBsB,MAAM9B,KAAN,CAAYQ,KADjC,IAEA,OAAKD,KAAL,CAAWG,KAAX,KAAqBoB,MAAM9B,KAAN,CAAYS,IAFjC,GAGI,IAHJ,GAII,yBAAaqB,KAAb,EAAoB,EAACV,KAAKJ,CAAN,EAApB,CALN;AAAA,WAFD;AAFH;AADF,OADF;AAgBD;;;;EA1G6BsB,gB;;AA6GhCvC,kBAAkBwC,SAAlB,GAA8B;AAC5BlB,YAAUmB,oBAAUC,IADQ;AAE5BnB,kBAAgBkB,oBAAUE;AAFE,CAA9B;;AAKA3C,kBAAkB4C,iBAAlB,GAAsC;AACpChC,YAAU6B,oBAAUI;AADgB,CAAtC;;kBAIe7C,iB","file":"PanelMenuWrapper.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {cloneElement, Component} from 'react';\nimport SidebarGroup from './sidebar/SidebarGroup';\nimport {bem} from 'lib';\nimport sortMenu from 'lib/sortMenu';\nimport {PanelMenuWrapperContext} from '../context';\n\nclass PanelsWithSidebar extends Component {\n constructor(props) {\n super(props);\n\n const opts = this.computeMenuOptions(props);\n const firstSidebarGroup = opts.filter(o => o.panels)[0];\n\n this.state = {\n group: firstSidebarGroup.name,\n panel: firstSidebarGroup.panels[0],\n };\n\n this.setPanel = this.setPanel.bind(this);\n this.renderSection = this.renderSection.bind(this);\n }\n\n setPanel(group, panel) {\n this.setState({group, panel});\n }\n\n getChildContext() {\n return {\n setPanel: this.setPanel,\n };\n }\n\n provideValue() {\n return {\n setPanel: this.setPanel,\n };\n }\n\n renderSection(section, i) {\n if (section.type && (section.type.plotly_editor_traits || {}).sidebar_element) {\n return cloneElement(section, {key: i});\n }\n return (\n \n );\n }\n\n computeMenuOptions(props) {\n const {children, menuPanelOrder} = props;\n const sections = [];\n const groupLookup = {};\n let groupIndex;\n const panels = React.Children.toArray(children);\n\n if (menuPanelOrder) {\n sortMenu(panels, menuPanelOrder);\n }\n\n panels.forEach(child => {\n if (!child) {\n return;\n }\n const group = child.props.group;\n const name = child.props.name;\n\n if (group && name) {\n let obj;\n if (groupLookup.hasOwnProperty(group)) {\n groupIndex = groupLookup[group];\n obj = sections[groupIndex];\n } else {\n groupLookup[group] = sections.length;\n obj = {name: group, panels: []};\n sections.push(obj);\n }\n obj.panels.push(name);\n }\n\n if ((child.type.plotly_editor_traits || {}).sidebar_element) {\n sections.push(child);\n }\n });\n\n return sections;\n }\n\n render() {\n const menuOpts = this.computeMenuOptions(this.props);\n\n return (\n \n
\n
{menuOpts.map(this.renderSection)}
\n {React.Children.map(\n this.props.children,\n (child, i) =>\n child === null ||\n this.state.group !== child.props.group ||\n this.state.panel !== child.props.name\n ? null\n : cloneElement(child, {key: i})\n )}\n
\n
\n );\n }\n}\n\nPanelsWithSidebar.propTypes = {\n children: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n};\n\nPanelsWithSidebar.childContextTypes = {\n setPanel: PropTypes.func,\n};\n\nexport default PanelsWithSidebar;\n"]} \ No newline at end of file diff --git a/lib/components/containers/AnnotationAccordion.js b/lib/components/containers/AnnotationAccordion.js new file mode 100644 index 000000000..a57077f07 --- /dev/null +++ b/lib/components/containers/AnnotationAccordion.js @@ -0,0 +1,124 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _derived = require('./derived'); + +var _PanelEmpty = require('./PanelEmpty'); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _context2 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var AnnotationFold = (0, _lib.connectAnnotationToLayout)(_PlotlyFold2.default); + +var AnnotationAccordion = function (_Component) { + _inherits(AnnotationAccordion, _Component); + + function AnnotationAccordion() { + _classCallCheck(this, AnnotationAccordion); + + return _possibleConstructorReturn(this, (AnnotationAccordion.__proto__ || Object.getPrototypeOf(AnnotationAccordion)).apply(this, arguments)); + } + + _createClass(AnnotationAccordion, [{ + key: 'render', + value: function render() { + var _context = this.context, + _context$layout$annot = _context.layout.annotations, + annotations = _context$layout$annot === undefined ? [] : _context$layout$annot, + _ = _context.localize; + var _props = this.props, + canAdd = _props.canAdd, + children = _props.children; + + + var content = annotations.length && annotations.map(function (ann, i) { + return _react2.default.createElement( + AnnotationFold, + { key: i, annotationIndex: i, name: ann.text, canDelete: canAdd }, + children + ); + }); + + var addAction = { + label: _('Annotation'), + handler: function handler(_ref) { + var layout = _ref.layout, + updateContainer = _ref.updateContainer; + + var annotationIndex = void 0; + if (Array.isArray(layout.annotations)) { + annotationIndex = layout.annotations.length; + } else { + annotationIndex = 0; + } + + var key = 'annotations[' + annotationIndex + ']'; + var value = { text: _('new text') }; + + if (updateContainer) { + updateContainer(_defineProperty({}, key, value)); + } + } + }; + + return _react2.default.createElement( + _derived.LayoutPanel, + { addAction: canAdd ? addAction : null }, + content ? content : _react2.default.createElement( + _PanelEmpty.PanelMessage, + { heading: _('Call out your data.') }, + _react2.default.createElement( + 'p', + null, + _('Annotations are text and arrows you can use to point out specific parts of your figure.') + ), + _react2.default.createElement( + 'p', + null, + _('Click on the + button above to add an annotation.') + ) + ) + ); + } + }]); + + return AnnotationAccordion; +}(_react.Component); + +AnnotationAccordion.contextType = _context2.EditorControlsContext; + +AnnotationAccordion.propTypes = { + children: _propTypes2.default.node, + canAdd: _propTypes2.default.bool +}; + +exports.default = AnnotationAccordion; +//# sourceMappingURL=AnnotationAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/AnnotationAccordion.js.map b/lib/components/containers/AnnotationAccordion.js.map new file mode 100644 index 000000000..a7ee33a43 --- /dev/null +++ b/lib/components/containers/AnnotationAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/AnnotationAccordion.js"],"names":["AnnotationFold","PlotlyFold","AnnotationAccordion","context","layout","annotations","_","localize","props","canAdd","children","content","length","map","ann","i","text","addAction","label","handler","updateContainer","annotationIndex","Array","isArray","key","value","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,iBAAiB,oCAA0BC,oBAA1B,CAAvB;;IAEMC,mB;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,MAFK,CAEIC,WAFJ;AAAA,UAEIA,WAFJ,yCAEkB,EAFlB;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,mBAKoB,KAAKC,KALzB;AAAA,UAKAC,MALA,UAKAA,MALA;AAAA,UAKQC,QALR,UAKQA,QALR;;;AAOP,UAAMC,UACJN,YAAYO,MAAZ,IACAP,YAAYQ,GAAZ,CAAgB,UAACC,GAAD,EAAMC,CAAN;AAAA,eACd;AAAC,wBAAD;AAAA,YAAgB,KAAKA,CAArB,EAAwB,iBAAiBA,CAAzC,EAA4C,MAAMD,IAAIE,IAAtD,EAA4D,WAAWP,MAAvE;AACGC;AADH,SADc;AAAA,OAAhB,CAFF;;AAQA,UAAMO,YAAY;AAChBC,eAAOZ,EAAE,YAAF,CADS;AAEhBa,iBAAS,uBAA+B;AAAA,cAA7Bf,MAA6B,QAA7BA,MAA6B;AAAA,cAArBgB,eAAqB,QAArBA,eAAqB;;AACtC,cAAIC,wBAAJ;AACA,cAAIC,MAAMC,OAAN,CAAcnB,OAAOC,WAArB,CAAJ,EAAuC;AACrCgB,8BAAkBjB,OAAOC,WAAP,CAAmBO,MAArC;AACD,WAFD,MAEO;AACLS,8BAAkB,CAAlB;AACD;;AAED,cAAMG,uBAAqBH,eAArB,MAAN;AACA,cAAMI,QAAQ,EAACT,MAAMV,EAAE,UAAF,CAAP,EAAd;;AAEA,cAAIc,eAAJ,EAAqB;AACnBA,gDAAkBI,GAAlB,EAAwBC,KAAxB;AACD;AACF;AAhBe,OAAlB;;AAmBA,aACE;AAAC,4BAAD;AAAA,UAAa,WAAWhB,SAASQ,SAAT,GAAqB,IAA7C;AACGN,kBACCA,OADD,GAGC;AAAC,kCAAD;AAAA,YAAc,SAASL,EAAE,qBAAF,CAAvB;AACE;AAAA;AAAA;AACGA,cACC,yFADD;AADH,WADF;AAME;AAAA;AAAA;AAAIA,cAAE,mDAAF;AAAJ;AANF;AAJJ,OADF;AAgBD;;;;EAnD+BoB,gB;;AAsDlCxB,oBAAoByB,WAApB,GAAkCC,+BAAlC;;AAEA1B,oBAAoB2B,SAApB,GAAgC;AAC9BnB,YAAUoB,oBAAUC,IADU;AAE9BtB,UAAQqB,oBAAUE;AAFY,CAAhC;;kBAKe9B,mB","file":"AnnotationAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport {LayoutPanel} from './derived';\nimport {PanelMessage} from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectAnnotationToLayout} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst AnnotationFold = connectAnnotationToLayout(PlotlyFold);\n\nclass AnnotationAccordion extends Component {\n render() {\n const {\n layout: {annotations = []},\n localize: _,\n } = this.context;\n const {canAdd, children} = this.props;\n\n const content =\n annotations.length &&\n annotations.map((ann, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Annotation'),\n handler: ({layout, updateContainer}) => {\n let annotationIndex;\n if (Array.isArray(layout.annotations)) {\n annotationIndex = layout.annotations.length;\n } else {\n annotationIndex = 0;\n }\n\n const key = `annotations[${annotationIndex}]`;\n const value = {text: _('new text')};\n\n if (updateContainer) {\n updateContainer({[key]: value});\n }\n },\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n

\n {_(\n 'Annotations are text and arrows you can use to point out specific parts of your figure.'\n )}\n

\n

{_('Click on the + button above to add an annotation.')}

\n
\n )}\n
\n );\n }\n}\n\nAnnotationAccordion.contextType = EditorControlsContext;\n\nAnnotationAccordion.propTypes = {\n children: PropTypes.node,\n canAdd: PropTypes.bool,\n};\n\nexport default AnnotationAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/AxesFold.js b/lib/components/containers/AxesFold.js new file mode 100644 index 000000000..5b61dbc47 --- /dev/null +++ b/lib/components/containers/AxesFold.js @@ -0,0 +1,71 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _AxesSelector = require('../fields/AxesSelector'); + +var _AxesSelector2 = _interopRequireDefault(_AxesSelector); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var AxesFold = function (_Component) { + _inherits(AxesFold, _Component); + + function AxesFold() { + _classCallCheck(this, AxesFold); + + return _possibleConstructorReturn(this, (AxesFold.__proto__ || Object.getPrototypeOf(AxesFold)).apply(this, arguments)); + } + + _createClass(AxesFold, [{ + key: 'render', + value: function render() { + var _props = this.props, + children = _props.children, + options = _props.options; + + return options.length && children ? _react2.default.createElement( + _PlotlyFold2.default, + this.props, + options.length === 1 ? null : _react2.default.createElement(_AxesSelector2.default, { axesOptions: options }), + children + ) : null; + } + }]); + + return AxesFold; +}(_react.Component); + +AxesFold.propTypes = { + children: _propTypes2.default.any, + options: _propTypes2.default.array +}; + +AxesFold.plotly_editor_traits = { foldable: true }; + +exports.default = (0, _lib.connectAxesToLayout)(AxesFold); +//# sourceMappingURL=AxesFold.js.map \ No newline at end of file diff --git a/lib/components/containers/AxesFold.js.map b/lib/components/containers/AxesFold.js.map new file mode 100644 index 000000000..cb19f66fe --- /dev/null +++ b/lib/components/containers/AxesFold.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/AxesFold.js"],"names":["AxesFold","props","children","options","length","Component","propTypes","PropTypes","any","array","plotly_editor_traits","foldable"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Q;;;;;;;;;;;6BACK;AAAA,mBACqB,KAAKC,KAD1B;AAAA,UACAC,QADA,UACAA,QADA;AAAA,UACUC,OADV,UACUA,OADV;;AAEP,aAAOA,QAAQC,MAAR,IAAkBF,QAAlB,GACL;AAAC,4BAAD;AAAgB,aAAKD,KAArB;AACGE,gBAAQC,MAAR,KAAmB,CAAnB,GAAuB,IAAvB,GAA8B,8BAAC,sBAAD,IAAc,aAAaD,OAA3B,GADjC;AAEGD;AAFH,OADK,GAKH,IALJ;AAMD;;;;EAToBG,gB;;AAYvBL,SAASM,SAAT,GAAqB;AACnBJ,YAAUK,oBAAUC,GADD;AAEnBL,WAASI,oBAAUE;AAFA,CAArB;;AAKAT,SAASU,oBAAT,GAAgC,EAACC,UAAU,IAAX,EAAhC;;kBAEe,8BAAoBX,QAApB,C","file":"AxesFold.js","sourcesContent":["import AxesSelector from '../fields/AxesSelector';\nimport PlotlyFold from './PlotlyFold';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectAxesToLayout} from 'lib';\n\nclass AxesFold extends Component {\n render() {\n const {children, options} = this.props;\n return options.length && children ? (\n \n {options.length === 1 ? null : }\n {children}\n \n ) : null;\n }\n}\n\nAxesFold.propTypes = {\n children: PropTypes.any,\n options: PropTypes.array,\n};\n\nAxesFold.plotly_editor_traits = {foldable: true};\n\nexport default connectAxesToLayout(AxesFold);\n"]} \ No newline at end of file diff --git a/lib/components/containers/FoldEmpty.js b/lib/components/containers/FoldEmpty.js new file mode 100644 index 000000000..962fc48ad --- /dev/null +++ b/lib/components/containers/FoldEmpty.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var FoldEmpty = function (_Component) { + _inherits(FoldEmpty, _Component); + + function FoldEmpty() { + _classCallCheck(this, FoldEmpty); + + return _possibleConstructorReturn(this, (FoldEmpty.__proto__ || Object.getPrototypeOf(FoldEmpty)).apply(this, arguments)); + } + + _createClass(FoldEmpty, [{ + key: 'render', + value: function render() { + var _props = this.props, + children = _props.children, + Icon = _props.icon, + messagePrimary = _props.messagePrimary, + messageSecondary = _props.messageSecondary; + + + return _react2.default.createElement( + 'div', + { className: 'fold__content__empty' }, + Icon ? _react2.default.createElement( + 'div', + { className: 'fold__content__empty__icon' }, + _react2.default.createElement(Icon, null) + ) : null, + messagePrimary ? _react2.default.createElement( + 'div', + { className: 'fold__content__empty__message__primary' }, + messagePrimary + ) : null, + messageSecondary ? _react2.default.createElement( + 'div', + { className: 'fold__content__empty__message__secondary' }, + messageSecondary + ) : null, + children ? children : null + ); + } + }]); + + return FoldEmpty; +}(_react.Component); + +exports.default = FoldEmpty; + + +FoldEmpty.propTypes = { + messagePrimary: _propTypes2.default.string, + messageSecondary: _propTypes2.default.string, + children: _propTypes2.default.node, + icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) +}; +//# sourceMappingURL=FoldEmpty.js.map \ No newline at end of file diff --git a/lib/components/containers/FoldEmpty.js.map b/lib/components/containers/FoldEmpty.js.map new file mode 100644 index 000000000..d19b2b15e --- /dev/null +++ b/lib/components/containers/FoldEmpty.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/FoldEmpty.js"],"names":["FoldEmpty","props","children","Icon","icon","messagePrimary","messageSecondary","Component","propTypes","PropTypes","string","node","oneOfType","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,S;;;;;;;;;;;6BACV;AAAA,mBAC0D,KAAKC,KAD/D;AAAA,UACAC,QADA,UACAA,QADA;AAAA,UACgBC,IADhB,UACUC,IADV;AAAA,UACsBC,cADtB,UACsBA,cADtB;AAAA,UACsCC,gBADtC,UACsCA,gBADtC;;;AAGP,aACE;AAAA;AAAA,UAAK,WAAU,sBAAf;AACGH,eACC;AAAA;AAAA,YAAK,WAAU,4BAAf;AACE,wCAAC,IAAD;AADF,SADD,GAIG,IALN;AAMGE,yBACC;AAAA;AAAA,YAAK,WAAU,wCAAf;AAAyDA;AAAzD,SADD,GAEG,IARN;AASGC,2BACC;AAAA;AAAA,YAAK,WAAU,0CAAf;AAA2DA;AAA3D,SADD,GAEG,IAXN;AAYGJ,mBAAWA,QAAX,GAAsB;AAZzB,OADF;AAgBD;;;;EApBoCK,gB;;kBAAlBP,S;;;AAuBrBA,UAAUQ,SAAV,GAAsB;AACpBH,kBAAgBI,oBAAUC,MADN;AAEpBJ,oBAAkBG,oBAAUC,MAFR;AAGpBR,YAAUO,oBAAUE,IAHA;AAIpBP,QAAMK,oBAAUG,SAAV,CAAoB,CAACH,oBAAUE,IAAX,EAAiBF,oBAAUI,IAA3B,CAApB;AAJc,CAAtB","file":"FoldEmpty.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nexport default class FoldEmpty extends Component {\n render() {\n const {children, icon: Icon, messagePrimary, messageSecondary} = this.props;\n\n return (\n
\n {Icon ? (\n
\n \n
\n ) : null}\n {messagePrimary ? (\n
{messagePrimary}
\n ) : null}\n {messageSecondary ? (\n
{messageSecondary}
\n ) : null}\n {children ? children : null}\n
\n );\n }\n}\n\nFoldEmpty.propTypes = {\n messagePrimary: PropTypes.string,\n messageSecondary: PropTypes.string,\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/ImageAccordion.js b/lib/components/containers/ImageAccordion.js new file mode 100644 index 000000000..b7e0973c2 --- /dev/null +++ b/lib/components/containers/ImageAccordion.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _derived = require('./derived'); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _PanelEmpty = require('./PanelEmpty'); + +var _context2 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ImageFold = (0, _lib.connectImageToLayout)(_PlotlyFold2.default); + +var ImageAccordion = function (_Component) { + _inherits(ImageAccordion, _Component); + + function ImageAccordion() { + _classCallCheck(this, ImageAccordion); + + return _possibleConstructorReturn(this, (ImageAccordion.__proto__ || Object.getPrototypeOf(ImageAccordion)).apply(this, arguments)); + } + + _createClass(ImageAccordion, [{ + key: 'render', + value: function render() { + var _context = this.context, + _context$layout$image = _context.layout.images, + images = _context$layout$image === undefined ? [] : _context$layout$image, + _ = _context.localize; + var _props = this.props, + canAdd = _props.canAdd, + children = _props.children; + + + var content = images.length && images.map(function (img, i) { + return _react2.default.createElement( + ImageFold, + { key: i, imageIndex: i, name: _('Image') + ' ' + (i + 1), canDelete: canAdd }, + children + ); + }); + + var addAction = { + label: _('Image'), + handler: function handler(_ref) { + var layout = _ref.layout, + updateContainer = _ref.updateContainer; + + var imageIndex = void 0; + if (Array.isArray(layout.images)) { + imageIndex = layout.images.length; + } else { + imageIndex = 0; + } + + var key = 'images[' + imageIndex + ']'; + var value = { + sizex: 0.1, + sizey: 0.1, + x: 0.5, + y: 0.5 + }; + + if (updateContainer) { + updateContainer(_defineProperty({}, key, value)); + } + } + }; + + return _react2.default.createElement( + _derived.LayoutPanel, + { addAction: canAdd ? addAction : null }, + content ? content : _react2.default.createElement( + _PanelEmpty.PanelMessage, + { heading: _('Logos, watermarks and more.') }, + _react2.default.createElement( + 'p', + null, + _('Embed images in your figure to make the data more readable or to brand your content.') + ), + _react2.default.createElement( + 'p', + null, + _('Click on the + button above to add an image.') + ) + ) + ); + } + }]); + + return ImageAccordion; +}(_react.Component); + +ImageAccordion.contextType = _context2.EditorControlsContext; + +ImageAccordion.propTypes = { + children: _propTypes2.default.node, + canAdd: _propTypes2.default.bool +}; + +exports.default = ImageAccordion; +//# sourceMappingURL=ImageAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/ImageAccordion.js.map b/lib/components/containers/ImageAccordion.js.map new file mode 100644 index 000000000..0160d8456 --- /dev/null +++ b/lib/components/containers/ImageAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/ImageAccordion.js"],"names":["ImageFold","PlotlyFold","ImageAccordion","context","layout","images","_","localize","props","canAdd","children","content","length","map","img","i","addAction","label","handler","updateContainer","imageIndex","Array","isArray","key","value","sizex","sizey","x","y","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,YAAY,+BAAqBC,oBAArB,CAAlB;;IAEMC,c;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,MAFK,CAEIC,MAFJ;AAAA,UAEIA,MAFJ,yCAEa,EAFb;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,mBAKoB,KAAKC,KALzB;AAAA,UAKAC,MALA,UAKAA,MALA;AAAA,UAKQC,QALR,UAKQA,QALR;;;AAOP,UAAMC,UACJN,OAAOO,MAAP,IACAP,OAAOQ,GAAP,CAAW,UAACC,GAAD,EAAMC,CAAN;AAAA,eACT;AAAC,mBAAD;AAAA,YAAW,KAAKA,CAAhB,EAAmB,YAAYA,CAA/B,EAAkC,MAAST,EAAE,OAAF,CAAT,UAAuBS,IAAI,CAA3B,CAAlC,EAAkE,WAAWN,MAA7E;AACGC;AADH,SADS;AAAA,OAAX,CAFF;;AAQA,UAAMM,YAAY;AAChBC,eAAOX,EAAE,OAAF,CADS;AAEhBY,iBAAS,uBAA+B;AAAA,cAA7Bd,MAA6B,QAA7BA,MAA6B;AAAA,cAArBe,eAAqB,QAArBA,eAAqB;;AACtC,cAAIC,mBAAJ;AACA,cAAIC,MAAMC,OAAN,CAAclB,OAAOC,MAArB,CAAJ,EAAkC;AAChCe,yBAAahB,OAAOC,MAAP,CAAcO,MAA3B;AACD,WAFD,MAEO;AACLQ,yBAAa,CAAb;AACD;;AAED,cAAMG,kBAAgBH,UAAhB,MAAN;AACA,cAAMI,QAAQ;AACZC,mBAAO,GADK;AAEZC,mBAAO,GAFK;AAGZC,eAAG,GAHS;AAIZC,eAAG;AAJS,WAAd;;AAOA,cAAIT,eAAJ,EAAqB;AACnBA,gDAAkBI,GAAlB,EAAwBC,KAAxB;AACD;AACF;AArBe,OAAlB;;AAwBA,aACE;AAAC,4BAAD;AAAA,UAAa,WAAWf,SAASO,SAAT,GAAqB,IAA7C;AACGL,kBACCA,OADD,GAGC;AAAC,kCAAD;AAAA,YAAc,SAASL,EAAE,6BAAF,CAAvB;AACE;AAAA;AAAA;AACGA,cACC,sFADD;AADH,WADF;AAME;AAAA;AAAA;AAAIA,cAAE,8CAAF;AAAJ;AANF;AAJJ,OADF;AAgBD;;;;EAxD0BuB,gB;;AA2D7B3B,eAAe4B,WAAf,GAA6BC,+BAA7B;;AAEA7B,eAAe8B,SAAf,GAA2B;AACzBtB,YAAUuB,oBAAUC,IADK;AAEzBzB,UAAQwB,oBAAUE;AAFO,CAA3B;;kBAKejC,c","file":"ImageAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport {LayoutPanel} from './derived';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectImageToLayout} from 'lib';\nimport {PanelMessage} from './PanelEmpty';\nimport {EditorControlsContext} from '../../context';\n\nconst ImageFold = connectImageToLayout(PlotlyFold);\n\nclass ImageAccordion extends Component {\n render() {\n const {\n layout: {images = []},\n localize: _,\n } = this.context;\n const {canAdd, children} = this.props;\n\n const content =\n images.length &&\n images.map((img, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Image'),\n handler: ({layout, updateContainer}) => {\n let imageIndex;\n if (Array.isArray(layout.images)) {\n imageIndex = layout.images.length;\n } else {\n imageIndex = 0;\n }\n\n const key = `images[${imageIndex}]`;\n const value = {\n sizex: 0.1,\n sizey: 0.1,\n x: 0.5,\n y: 0.5,\n };\n\n if (updateContainer) {\n updateContainer({[key]: value});\n }\n },\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n

\n {_(\n 'Embed images in your figure to make the data more readable or to brand your content.'\n )}\n

\n

{_('Click on the + button above to add an image.')}

\n
\n )}\n
\n );\n }\n}\n\nImageAccordion.contextType = EditorControlsContext;\n\nImageAccordion.propTypes = {\n children: PropTypes.node,\n canAdd: PropTypes.bool,\n};\n\nexport default ImageAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/MenuPanel.js b/lib/components/containers/MenuPanel.js new file mode 100644 index 000000000..52412656a --- /dev/null +++ b/lib/components/containers/MenuPanel.js @@ -0,0 +1,137 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _ModalBox = require('./ModalBox'); + +var _ModalBox2 = _interopRequireDefault(_ModalBox); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _plotlyIcons = require('plotly-icons'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var MenuPanel = function (_Component) { + _inherits(MenuPanel, _Component); + + function MenuPanel() { + _classCallCheck(this, MenuPanel); + + var _this = _possibleConstructorReturn(this, (MenuPanel.__proto__ || Object.getPrototypeOf(MenuPanel)).call(this)); + + _this.state = { isOpen: false }; + + _this.togglePanel = _this.togglePanel.bind(_this); + return _this; + } + + _createClass(MenuPanel, [{ + key: 'getIcon', + value: function getIcon() { + var _props = this.props, + question = _props.question, + Icon = _props.icon; + + if (question) { + return { + icon: _react2.default.createElement(_plotlyIcons.QuestionIcon, { className: 'menupanel__icon' }), + spanClass: 'menupanel__icon-span menupanel__icon-span--question' + }; + } + if (Icon) { + return { + icon: _react2.default.createElement(Icon, { className: 'menupanel__icon' }), + spanClass: 'menupanel__icon-span' + }; + } + return { + icon: _react2.default.createElement(_plotlyIcons.CogIcon, { className: 'menupanel__icon' }), + spanClass: 'menupanel__icon-span menupanel__icon-span--cog' + }; + } + }, { + key: 'togglePanel', + value: function togglePanel() { + this.setState({ isOpen: !this.state.isOpen }); + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + show = _props2.show, + ownline = _props2.ownline, + label = _props2.label, + children = _props2.children; + + var isOpen = show || this.state.isOpen; + + var containerClass = (0, _classnames2.default)('menupanel', { + 'menupanel--ownline': ownline + }); + + var _getIcon = this.getIcon(), + icon = _getIcon.icon, + spanClass = _getIcon.spanClass; + + return _react2.default.createElement( + 'div', + { className: containerClass }, + _react2.default.createElement( + 'div', + { className: spanClass }, + _react2.default.createElement( + 'div', + { className: 'menupanel__label' }, + label + ), + _react2.default.createElement( + 'div', + { className: 'menupanel__icon__wrapper', onClick: this.togglePanel }, + icon + ) + ), + isOpen && _react2.default.createElement( + _ModalBox2.default, + { onClose: this.togglePanel }, + children + ) + ); + } + }]); + + return MenuPanel; +}(_react.Component); + +exports.default = MenuPanel; + + +MenuPanel.propTypes = { + children: _propTypes2.default.node, + icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), + label: _propTypes2.default.string, + ownline: _propTypes2.default.bool, + question: _propTypes2.default.bool, + show: _propTypes2.default.bool +}; +//# sourceMappingURL=MenuPanel.js.map \ No newline at end of file diff --git a/lib/components/containers/MenuPanel.js.map b/lib/components/containers/MenuPanel.js.map new file mode 100644 index 000000000..56acaf624 --- /dev/null +++ b/lib/components/containers/MenuPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/MenuPanel.js"],"names":["MenuPanel","state","isOpen","togglePanel","bind","props","question","Icon","icon","spanClass","setState","show","ownline","label","children","containerClass","getIcon","Component","propTypes","PropTypes","node","oneOfType","func","string","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEqBA,S;;;AACnB,uBAAc;AAAA;;AAAA;;AAEZ,UAAKC,KAAL,GAAa,EAACC,QAAQ,KAAT,EAAb;;AAEA,UAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AAJY;AAKb;;;;8BAES;AAAA,mBACuB,KAAKC,KAD5B;AAAA,UACDC,QADC,UACDA,QADC;AAAA,UACeC,IADf,UACSC,IADT;;AAER,UAAIF,QAAJ,EAAc;AACZ,eAAO;AACLE,gBAAM,8BAAC,yBAAD,IAAc,WAAU,iBAAxB,GADD;AAELC;AAFK,SAAP;AAID;AACD,UAAIF,IAAJ,EAAU;AACR,eAAO;AACLC,gBAAM,8BAAC,IAAD,IAAM,WAAU,iBAAhB,GADD;AAELC;AAFK,SAAP;AAID;AACD,aAAO;AACLD,cAAM,8BAAC,oBAAD,IAAS,WAAU,iBAAnB,GADD;AAELC,mBAAW;AAFN,OAAP;AAID;;;kCAEa;AACZ,WAAKC,QAAL,CAAc,EAACR,QAAQ,CAAC,KAAKD,KAAL,CAAWC,MAArB,EAAd;AACD;;;6BAEQ;AAAA,oBACkC,KAAKG,KADvC;AAAA,UACAM,IADA,WACAA,IADA;AAAA,UACMC,OADN,WACMA,OADN;AAAA,UACeC,KADf,WACeA,KADf;AAAA,UACsBC,QADtB,WACsBA,QADtB;;AAEP,UAAMZ,SAASS,QAAQ,KAAKV,KAAL,CAAWC,MAAlC;;AAEA,UAAMa,iBAAiB,0BAAW,WAAX,EAAwB;AAC7C,8BAAsBH;AADuB,OAAxB,CAAvB;;AAJO,qBAQmB,KAAKI,OAAL,EARnB;AAAA,UAQAR,IARA,YAQAA,IARA;AAAA,UAQMC,SARN,YAQMA,SARN;;AAUP,aACE;AAAA;AAAA,UAAK,WAAWM,cAAhB;AACE;AAAA;AAAA,YAAK,WAAWN,SAAhB;AACE;AAAA;AAAA,cAAK,WAAU,kBAAf;AAAmCI;AAAnC,WADF;AAEE;AAAA;AAAA,cAAK,WAAU,0BAAf,EAA0C,SAAS,KAAKV,WAAxD;AACGK;AADH;AAFF,SADF;AAOGN,kBAAU;AAAC,4BAAD;AAAA,YAAU,SAAS,KAAKC,WAAxB;AAAsCW;AAAtC;AAPb,OADF;AAWD;;;;EArDoCG,gB;;kBAAlBjB,S;;;AAwDrBA,UAAUkB,SAAV,GAAsB;AACpBJ,YAAUK,oBAAUC,IADA;AAEpBZ,QAAMW,oBAAUE,SAAV,CAAoB,CAACF,oBAAUC,IAAX,EAAiBD,oBAAUG,IAA3B,CAApB,CAFc;AAGpBT,SAAOM,oBAAUI,MAHG;AAIpBX,WAASO,oBAAUK,IAJC;AAKpBlB,YAAUa,oBAAUK,IALA;AAMpBb,QAAMQ,oBAAUK;AANI,CAAtB","file":"MenuPanel.js","sourcesContent":["import ModalBox from './ModalBox';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport classnames from 'classnames';\nimport {QuestionIcon, CogIcon} from 'plotly-icons';\n\nexport default class MenuPanel extends Component {\n constructor() {\n super();\n this.state = {isOpen: false};\n\n this.togglePanel = this.togglePanel.bind(this);\n }\n\n getIcon() {\n const {question, icon: Icon} = this.props;\n if (question) {\n return {\n icon: ,\n spanClass: `menupanel__icon-span menupanel__icon-span--question`,\n };\n }\n if (Icon) {\n return {\n icon: ,\n spanClass: `menupanel__icon-span`,\n };\n }\n return {\n icon: ,\n spanClass: 'menupanel__icon-span menupanel__icon-span--cog',\n };\n }\n\n togglePanel() {\n this.setState({isOpen: !this.state.isOpen});\n }\n\n render() {\n const {show, ownline, label, children} = this.props;\n const isOpen = show || this.state.isOpen;\n\n const containerClass = classnames('menupanel', {\n 'menupanel--ownline': ownline,\n });\n\n const {icon, spanClass} = this.getIcon();\n\n return (\n
\n
\n
{label}
\n
\n {icon}\n
\n
\n {isOpen && {children}}\n
\n );\n }\n}\n\nMenuPanel.propTypes = {\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n label: PropTypes.string,\n ownline: PropTypes.bool,\n question: PropTypes.bool,\n show: PropTypes.bool,\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/Modal.js b/lib/components/containers/Modal.js new file mode 100644 index 000000000..45359b0d3 --- /dev/null +++ b/lib/components/containers/Modal.js @@ -0,0 +1,147 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ModalContent = exports.ModalHeader = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _plotlyIcons = require('plotly-icons'); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ModalHeader = function ModalHeader(_ref) { + var title = _ref.title, + handleClose = _ref.handleClose; + return _react2.default.createElement( + 'div', + { className: 'modal__header' }, + title ? _react2.default.createElement( + 'div', + { className: 'modal__header__title' }, + title + ) : null, + handleClose ? _react2.default.createElement( + 'div', + { className: 'modal__header__close', onClick: handleClose ? function () { + return handleClose(); + } : null }, + _react2.default.createElement(_plotlyIcons.CloseIcon, null) + ) : null + ); +}; + +var ModalContent = function ModalContent(_ref2) { + var children = _ref2.children; + return _react2.default.createElement( + 'div', + { className: 'modal__content' }, + children + ); +}; + +var Modal = function (_Component) { + _inherits(Modal, _Component); + + function Modal(props) { + _classCallCheck(this, Modal); + + var _this = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, props)); + + _this.escFunction = _this.escFunction.bind(_this); + return _this; + } + + _createClass(Modal, [{ + key: 'escFunction', + value: function escFunction(event) { + var escKeyCode = 27; + if (event.keyCode === escKeyCode) { + this.context.handleClose(); + } + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + document.addEventListener('keydown', this.escFunction, false); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + document.removeEventListener('keydown', this.escFunction, false); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _props = this.props, + children = _props.children, + title = _props.title; + + var classes = 'modal'; + if (this.context.isAnimatingOut) { + classes += ' modal--animate-out'; + } + return _react2.default.createElement( + 'div', + { className: classes }, + _react2.default.createElement( + 'div', + { className: 'modal__card' }, + _react2.default.createElement(ModalHeader, { title: title, handleClose: function handleClose() { + return _this2.context.handleClose(); + } }), + _react2.default.createElement( + ModalContent, + null, + children + ) + ), + _react2.default.createElement('div', { className: 'modal__backdrop', onClick: function onClick() { + return _this2.context.handleClose(); + } }) + ); + } + }]); + + return Modal; +}(_react.Component); + +ModalHeader.propTypes = { + title: _propTypes2.default.node, + handleClose: _propTypes2.default.func.isRequired +}; + +ModalContent.propTypes = { + children: _propTypes2.default.node.isRequired +}; + +Modal.propTypes = { + children: _propTypes2.default.node.isRequired, + title: _propTypes2.default.node +}; + +Modal.contextType = _context.ModalProviderContext; + +exports.default = Modal; +exports.ModalHeader = ModalHeader; +exports.ModalContent = ModalContent; +//# sourceMappingURL=Modal.js.map \ No newline at end of file diff --git a/lib/components/containers/Modal.js.map b/lib/components/containers/Modal.js.map new file mode 100644 index 000000000..c1c99e8f8 --- /dev/null +++ b/lib/components/containers/Modal.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/Modal.js"],"names":["ModalHeader","title","handleClose","ModalContent","children","Modal","props","escFunction","bind","event","escKeyCode","keyCode","context","document","addEventListener","removeEventListener","classes","isAnimatingOut","Component","propTypes","PropTypes","node","func","isRequired","contextType","ModalProviderContext"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,cAAc,SAAdA,WAAc;AAAA,MAAEC,KAAF,QAAEA,KAAF;AAAA,MAASC,WAAT,QAASA,WAAT;AAAA,SAClB;AAAA;AAAA,MAAK,WAAU,eAAf;AACGD,YAAQ;AAAA;AAAA,QAAK,WAAU,sBAAf;AAAuCA;AAAvC,KAAR,GAA8D,IADjE;AAEGC,kBACC;AAAA;AAAA,QAAK,WAAU,sBAAf,EAAsC,SAASA,cAAc;AAAA,iBAAMA,aAAN;AAAA,SAAd,GAAoC,IAAnF;AACE,oCAAC,sBAAD;AADF,KADD,GAIG;AANN,GADkB;AAAA,CAApB;;AAWA,IAAMC,eAAe,SAAfA,YAAe;AAAA,MAAEC,QAAF,SAAEA,QAAF;AAAA,SAAgB;AAAA;AAAA,MAAK,WAA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,oBAAUC,IAAV,CAAeE;AADF,CAAzB;;AAIAlB,MAAMc,SAAN,GAAkB;AAChBf,YAAUgB,oBAAUC,IAAV,CAAeE,UADT;AAEhBtB,SAAOmB,oBAAUC;AAFD,CAAlB;;AAKAhB,MAAMmB,WAAN,GAAoBC,6BAApB;;kBAEepB,K;QAEPL,W,GAAAA,W;QAAaG,Y,GAAAA,Y","file":"Modal.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {CloseIcon} from 'plotly-icons';\nimport {ModalProviderContext} from '../../context';\n\nconst ModalHeader = ({title, handleClose}) => (\n
\n {title ?
{title}
: null}\n {handleClose ? (\n
handleClose() : null}>\n \n
\n ) : null}\n
\n);\n\nconst ModalContent = ({children}) =>
{children}
;\n\nclass Modal extends Component {\n constructor(props) {\n super(props);\n this.escFunction = this.escFunction.bind(this);\n }\n\n escFunction(event) {\n const escKeyCode = 27;\n if (event.keyCode === escKeyCode) {\n this.context.handleClose();\n }\n }\n\n componentDidMount() {\n document.addEventListener('keydown', this.escFunction, false);\n }\n\n componentWillUnmount() {\n document.removeEventListener('keydown', this.escFunction, false);\n }\n\n render() {\n const {children, title} = this.props;\n let classes = 'modal';\n if (this.context.isAnimatingOut) {\n classes += ' modal--animate-out';\n }\n return (\n
\n
\n this.context.handleClose()} />\n {children}\n
\n
this.context.handleClose()} />\n
\n );\n }\n}\n\nModalHeader.propTypes = {\n title: PropTypes.node,\n handleClose: PropTypes.func.isRequired,\n};\n\nModalContent.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nModal.propTypes = {\n children: PropTypes.node.isRequired,\n title: PropTypes.node,\n};\n\nModal.contextType = ModalProviderContext;\n\nexport default Modal;\n\nexport {ModalHeader, ModalContent};\n"]} \ No newline at end of file diff --git a/lib/components/containers/ModalBox.js b/lib/components/containers/ModalBox.js new file mode 100644 index 000000000..8ddb13de9 --- /dev/null +++ b/lib/components/containers/ModalBox.js @@ -0,0 +1,76 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ModalBox = function (_Component) { + _inherits(ModalBox, _Component); + + function ModalBox() { + _classCallCheck(this, ModalBox); + + return _possibleConstructorReturn(this, (ModalBox.__proto__ || Object.getPrototypeOf(ModalBox)).apply(this, arguments)); + } + + _createClass(ModalBox, [{ + key: 'render', + value: function render() { + var _props = this.props, + backgroundDark = _props.backgroundDark, + children = _props.children, + onClose = _props.onClose, + relative = _props.relative; + + var modalboxClass = (0, _classnames2.default)('modalbox', { + 'modalbox--dark': backgroundDark, + 'modalbox--relative': relative + }); + return _react2.default.createElement( + 'div', + { className: modalboxClass }, + _react2.default.createElement('div', { className: 'modalbox__cover', onClick: onClose }), + _react2.default.createElement( + 'div', + { className: 'modalbox__content' }, + children + ) + ); + } + }]); + + return ModalBox; +}(_react.Component); + +exports.default = ModalBox; + + +ModalBox.propTypes = { + backgroundDark: _propTypes2.default.bool, + relative: _propTypes2.default.bool, + children: _propTypes2.default.node, + onClose: _propTypes2.default.func +}; +//# sourceMappingURL=ModalBox.js.map \ No newline at end of file diff --git a/lib/components/containers/ModalBox.js.map b/lib/components/containers/ModalBox.js.map new file mode 100644 index 000000000..ca47756c2 --- /dev/null +++ b/lib/components/containers/ModalBox.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/ModalBox.js"],"names":["ModalBox","props","backgroundDark","children","onClose","relative","modalboxClass","Component","propTypes","PropTypes","bool","node","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEqBA,Q;;;;;;;;;;;6BACV;AAAA,mBAC+C,KAAKC,KADpD;AAAA,UACAC,cADA,UACAA,cADA;AAAA,UACgBC,QADhB,UACgBA,QADhB;AAAA,UAC0BC,OAD1B,UAC0BA,OAD1B;AAAA,UACmCC,QADnC,UACmCA,QADnC;;AAEP,UAAMC,gBAAgB,0BAAW,UAAX,EAAuB;AAC3C,0BAAkBJ,cADyB;AAE3C,8BAAsBG;AAFqB,OAAvB,CAAtB;AAIA,aACE;AAAA;AAAA,UAAK,WAAWC,aAAhB;AACE,+CAAK,WAAU,iBAAf,EAAiC,SAASF,OAA1C,GADF;AAEE;AAAA;AAAA,YAAK,WAAU,mBAAf;AAAoCD;AAApC;AAFF,OADF;AAMD;;;;EAbmCI,gB;;kBAAjBP,Q;;;AAgBrBA,SAASQ,SAAT,GAAqB;AACnBN,kBAAgBO,oBAAUC,IADP;AAEnBL,YAAUI,oBAAUC,IAFD;AAGnBP,YAAUM,oBAAUE,IAHD;AAInBP,WAASK,oBAAUG;AAJA,CAArB","file":"ModalBox.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nexport default class ModalBox extends Component {\n render() {\n const {backgroundDark, children, onClose, relative} = this.props;\n const modalboxClass = classnames('modalbox', {\n 'modalbox--dark': backgroundDark,\n 'modalbox--relative': relative,\n });\n return (\n
\n
\n
{children}
\n
\n );\n }\n}\n\nModalBox.propTypes = {\n backgroundDark: PropTypes.bool,\n relative: PropTypes.bool,\n children: PropTypes.node,\n onClose: PropTypes.func,\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/ModalProvider.js b/lib/components/containers/ModalProvider.js new file mode 100644 index 000000000..def4ddac6 --- /dev/null +++ b/lib/components/containers/ModalProvider.js @@ -0,0 +1,180 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ModalProvider = function (_React$Component) { + _inherits(ModalProvider, _React$Component); + + function ModalProvider(props) { + _classCallCheck(this, ModalProvider); + + var _this = _possibleConstructorReturn(this, (ModalProvider.__proto__ || Object.getPrototypeOf(ModalProvider)).call(this, props)); + + _this.state = { + component: null, + componentProps: {}, + open: false, + isAnimatingOut: false + }; + return _this; + } + + _createClass(ModalProvider, [{ + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var body = document.body; + var open = this.state.open; + + // Toggle scroll on document body if modal is open + + var hasClass = body.classList.contains('no-scroll'); + + if (open && !hasClass) { + body.classList.add('no-scroll'); + } + if (!open && hasClass) { + body.classList.remove('no-scroll'); + } + } + }, { + key: 'openModal', + value: function openModal(component, componentProps) { + var _ = this.context.localize; + + if (!component) { + throw Error(_('You need to provide a component for the modal to open!')); + } + var open = this.state.open; + + + if (!open) { + this.setState({ + component: component, + componentProps: componentProps, + open: true + }); + } + } + }, { + key: 'closeModal', + value: function closeModal() { + var open = this.state.open; + + if (open) { + this.setState({ + open: false, + component: null + }); + } + } + }, { + key: 'handleClose', + value: function handleClose() { + var _this2 = this; + + this.setState({ isAnimatingOut: true }); + var animationDuration = 600; + setTimeout(function () { + _this2.setState({ isAnimatingOut: false }); + _this2.closeModal(); + }, animationDuration); + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this3 = this; + + return { + openModal: function openModal(c, p) { + return _this3.openModal(c, p); + }, + closeModal: function closeModal() { + return _this3.closeModal(); + }, + handleClose: function handleClose() { + return _this3.handleClose(); + }, + isAnimatingOut: this.state.isAnimatingOut + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this4 = this; + + return { + openModal: function openModal(c, p) { + return _this4.openModal(c, p); + }, + closeModal: function closeModal() { + return _this4.closeModal(); + }, + handleClose: function handleClose() { + return _this4.handleClose(); + }, + isAnimatingOut: this.state.isAnimatingOut + }; + } + }, { + key: 'render', + value: function render() { + var _state = this.state, + Component = _state.component, + componentProps = _state.componentProps, + isAnimatingOut = _state.isAnimatingOut; + + return _react2.default.createElement( + _context.ModalProviderContext.Provider, + { value: this.provideValue() }, + _react2.default.createElement( + _react.Fragment, + null, + this.props.children, + this.state.open ? _react2.default.createElement(Component, _extends({ isAnimatingOut: isAnimatingOut }, componentProps)) : null + ) + ); + } + }]); + + return ModalProvider; +}(_react2.default.Component); + +ModalProvider.propTypes = { + children: _propTypes2.default.node +}; +ModalProvider.contextTypes = { + localize: _propTypes2.default.func +}; +ModalProvider.childContextTypes = { + openModal: _propTypes2.default.func, + closeModal: _propTypes2.default.func, + handleClose: _propTypes2.default.func, + isAnimatingOut: _propTypes2.default.bool +}; + +exports.default = ModalProvider; +//# sourceMappingURL=ModalProvider.js.map \ No newline at end of file diff --git a/lib/components/containers/ModalProvider.js.map b/lib/components/containers/ModalProvider.js.map new file mode 100644 index 000000000..256d13d13 --- /dev/null +++ b/lib/components/containers/ModalProvider.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/ModalProvider.js"],"names":["ModalProvider","props","state","component","componentProps","open","isAnimatingOut","body","document","hasClass","classList","contains","add","remove","_","context","localize","Error","setState","animationDuration","setTimeout","closeModal","openModal","c","p","handleClose","Component","provideValue","children","React","propTypes","PropTypes","node","contextTypes","func","childContextTypes","bool"],"mappings":";;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,iBAAW,IADA;AAEXC,sBAAgB,EAFL;AAGXC,YAAM,KAHK;AAIXC,sBAAgB;AAJL,KAAb;AAFiB;AAQlB;;;;yCAEoB;AACnB,UAAMC,OAAOC,SAASD,IAAtB;AADmB,UA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'prop-types';\nimport {ModalProviderContext} from '../../context';\n\nclass ModalProvider extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n component: null,\n componentProps: {},\n open: false,\n isAnimatingOut: false,\n };\n }\n\n componentDidUpdate() {\n const body = document.body;\n const {open} = this.state;\n\n // Toggle scroll on document body if modal is open\n const hasClass = body.classList.contains('no-scroll');\n\n if (open && !hasClass) {\n body.classList.add('no-scroll');\n }\n if (!open && hasClass) {\n body.classList.remove('no-scroll');\n }\n }\n\n openModal(component, componentProps) {\n const {localize: _} = this.context;\n if (!component) {\n throw Error(_('You need to provide a component for the modal to open!'));\n }\n const {open} = this.state;\n\n if (!open) {\n this.setState({\n component: component,\n componentProps: componentProps,\n open: true,\n });\n }\n }\n\n closeModal() {\n const {open} = this.state;\n if (open) {\n this.setState({\n open: false,\n component: null,\n });\n }\n }\n handleClose() {\n this.setState({isAnimatingOut: true});\n const animationDuration = 600;\n setTimeout(() => {\n this.setState({isAnimatingOut: false});\n this.closeModal();\n }, animationDuration);\n }\n\n getChildContext() {\n return {\n openModal: (c, p) => this.openModal(c, p),\n closeModal: () => this.closeModal(),\n handleClose: () => this.handleClose(),\n isAnimatingOut: this.state.isAnimatingOut,\n };\n }\n\n provideValue() {\n return {\n openModal: (c, p) => this.openModal(c, p),\n closeModal: () => this.closeModal(),\n handleClose: () => this.handleClose(),\n isAnimatingOut: this.state.isAnimatingOut,\n };\n }\n\n render() {\n const {component: Component, componentProps, isAnimatingOut} = this.state;\n return (\n \n \n {this.props.children}\n {this.state.open ? (\n \n ) : null}\n \n \n );\n }\n}\n\nModalProvider.propTypes = {\n children: PropTypes.node,\n};\nModalProvider.contextTypes = {\n localize: PropTypes.func,\n};\nModalProvider.childContextTypes = {\n openModal: PropTypes.func,\n closeModal: PropTypes.func,\n handleClose: PropTypes.func,\n isAnimatingOut: PropTypes.bool,\n};\n\nexport default ModalProvider;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PanelEmpty.js b/lib/components/containers/PanelEmpty.js new file mode 100644 index 000000000..d7ed01c56 --- /dev/null +++ b/lib/components/containers/PanelEmpty.js @@ -0,0 +1,113 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PanelMessage = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _plotlyIcons = require('plotly-icons'); + +var _lib = require('../../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var PanelMessage = exports.PanelMessage = function (_Component) { + _inherits(PanelMessage, _Component); + + function PanelMessage() { + _classCallCheck(this, PanelMessage); + + return _possibleConstructorReturn(this, (PanelMessage.__proto__ || Object.getPrototypeOf(PanelMessage)).apply(this, arguments)); + } + + _createClass(PanelMessage, [{ + key: 'render', + value: function render() { + var _props = this.props, + children = _props.children, + Icon = _props.icon; + + var heading = this.props.heading || ''; + + return _react2.default.createElement( + 'div', + { className: 'panel__empty__message' }, + Boolean(Icon) && _react2.default.createElement( + 'div', + { className: 'panel__empty__message__icon' }, + _react2.default.createElement(Icon, null) + ), + Boolean(heading) && _react2.default.createElement( + 'div', + { className: 'panel__empty__message__heading' }, + heading + ), + _react2.default.createElement( + 'div', + { className: 'panel__empty__message__content' }, + children + ) + ); + } + }]); + + return PanelMessage; +}(_react.Component); + +PanelMessage.defaultProps = { + icon: _plotlyIcons.ChartLineIcon +}; + +PanelMessage.propTypes = { + heading: _propTypes2.default.string, + children: _propTypes2.default.node, + icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) +}; + +var PanelEmpty = function (_Component2) { + _inherits(PanelEmpty, _Component2); + + function PanelEmpty() { + _classCallCheck(this, PanelEmpty); + + return _possibleConstructorReturn(this, (PanelEmpty.__proto__ || Object.getPrototypeOf(PanelEmpty)).apply(this, arguments)); + } + + _createClass(PanelEmpty, [{ + key: 'render', + value: function render() { + return _react2.default.createElement( + 'div', + { className: (0, _lib.bem)('panel', 'empty') }, + _react2.default.createElement(PanelMessage, this.props) + ); + } + }]); + + return PanelEmpty; +}(_react.Component); + +PanelEmpty.propTypes = { + heading: _propTypes2.default.string, + children: _propTypes2.default.node, + icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) +}; + +exports.default = PanelEmpty; +//# sourceMappingURL=PanelEmpty.js.map \ No newline at end of file diff --git a/lib/components/containers/PanelEmpty.js.map b/lib/components/containers/PanelEmpty.js.map new file mode 100644 index 000000000..c5d4c84a8 --- /dev/null +++ b/lib/components/containers/PanelEmpty.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/PanelEmpty.js"],"names":["PanelMessage","props","children","Icon","icon","heading","Boolean","Component","defaultProps","ChartLineIcon","propTypes","PropTypes","string","node","oneOfType","func","PanelEmpty"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;IAEaA,Y,WAAAA,Y;;;;;;;;;;;6BACF;AAAA,mBACwB,KAAKC,KAD7B;AAAA,UACAC,QADA,UACAA,QADA;AAAA,UACgBC,IADhB,UACUC,IADV;;AAEP,UAAMC,UAAU,KAAKJ,KAAL,CAAWI,OAAX,IAAsB,EAAtC;;AAEA,aACE;AAAA;AAAA,UAAK,WAAU,uBAAf;AACGC,gBAAQH,IAAR,KACC;AAAA;AAAA,YAAK,WAAU,6BAAf;AACE,wCAAC,IAAD;AADF,SAFJ;AAMGG,gBAAQD,OAAR,KAAoB;AAAA;AAAA,YAAK,WAAU,gCAAf;AAAiDA;AAAjD,SANvB;AAOE;AAAA;AAAA,YAAK,WAAU,gCAAf;AAAiDH;AAAjD;AAPF,OADF;AAWD;;;;EAhB+BK,gB;;AAmBlCP,aAAaQ,YAAb,GAA4B;AAC1BJ,QAAMK;AADoB,CAA5B;;AAIAT,aAAaU,SAAb,GAAyB;AACvBL,WAASM,oBAAUC,MADI;AAEvBV,YAAUS,oBAAUE,IAFG;AAGvBT,QAAMO,oBAAUG,SAAV,CAAoB,CAACH,oBAAUE,IAAX,EAAiBF,oBAAUI,IAA3B,CAApB;AAHiB,CAAzB;;IAMMC,U;;;;;;;;;;;6BACK;AACP,aACE;AAAA;AAAA,UAAK,WAAW,cAAI,OAAJ,EAAa,OAAb,CAAhB;AACE,sCAAC,YAAD,EAAkB,KAAKf,KAAvB;AADF,OADF;AAKD;;;;EAPsBM,gB;;AAUzBS,WAAWN,SAAX,GAAuB;AACrBL,WAASM,oBAAUC,MADE;AAErBV,YAAUS,oBAAUE,IAFC;AAGrBT,QAAMO,oBAAUG,SAAV,CAAoB,CAACH,oBAAUE,IAAX,EAAiBF,oBAAUI,IAA3B,CAApB;AAHe,CAAvB;;kBAMeC,U","file":"PanelEmpty.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {ChartLineIcon} from 'plotly-icons';\nimport {bem} from 'lib';\n\nexport class PanelMessage extends Component {\n render() {\n const {children, icon: Icon} = this.props;\n const heading = this.props.heading || '';\n\n return (\n
\n {Boolean(Icon) && (\n
\n \n
\n )}\n {Boolean(heading) &&
{heading}
}\n
{children}
\n
\n );\n }\n}\n\nPanelMessage.defaultProps = {\n icon: ChartLineIcon,\n};\n\nPanelMessage.propTypes = {\n heading: PropTypes.string,\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n};\n\nclass PanelEmpty extends Component {\n render() {\n return (\n
\n \n
\n );\n }\n}\n\nPanelEmpty.propTypes = {\n heading: PropTypes.string,\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n};\n\nexport default PanelEmpty;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PanelHeader.js b/lib/components/containers/PanelHeader.js new file mode 100644 index 000000000..23693d2ac --- /dev/null +++ b/lib/components/containers/PanelHeader.js @@ -0,0 +1,158 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Button = require('../widgets/Button'); + +var _Button2 = _interopRequireDefault(_Button); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _plotlyIcons = require('plotly-icons'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var PanelHeader = function (_Component) { + _inherits(PanelHeader, _Component); + + function PanelHeader() { + _classCallCheck(this, PanelHeader); + + var _this = _possibleConstructorReturn(this, (PanelHeader.__proto__ || Object.getPrototypeOf(PanelHeader)).call(this)); + + _this.state = { addPanelOpen: false }; + + _this.togglePanel = _this.togglePanel.bind(_this); + return _this; + } + + _createClass(PanelHeader, [{ + key: 'togglePanel', + value: function togglePanel() { + this.setState({ addPanelOpen: !this.state.addPanelOpen }); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _ = this.context.localize; + var _props = this.props, + children = _props.children, + addAction = _props.addAction, + allowCollapse = _props.allowCollapse, + toggleFolds = _props.toggleFolds, + hasOpen = _props.hasOpen; + + // dropdown is styled with same styles as react-select component - see _dropdown.scss + + var icon = _react2.default.createElement(_plotlyIcons.PlusIcon, null); + return !children && !addAction && !allowCollapse ? null : _react2.default.createElement( + 'div', + { className: 'panel__header' }, + children && children.length ? _react2.default.createElement( + 'div', + { className: 'panel__header__content' }, + children + ) : null, + _react2.default.createElement( + 'div', + { className: 'panel__header__actions__container' }, + allowCollapse ? _react2.default.createElement( + 'div', + { className: 'panel__header__collapse', onClick: toggleFolds }, + hasOpen ? _react2.default.createElement( + 'span', + null, + _react2.default.createElement(_plotlyIcons.ResizeDownIcon, null), + _('Collapse All') + ) : _react2.default.createElement( + 'span', + null, + _react2.default.createElement(_plotlyIcons.ResizeUpIcon, null), + _('Expand All') + ) + ) : null, + addAction ? _react2.default.createElement( + 'div', + { className: 'panel__header__action dropdown-container' }, + _react2.default.createElement(_Button2.default, { + variant: 'primary', + className: 'js-add-button', + onClick: Array.isArray(addAction.handler) ? this.togglePanel : function () { + return addAction.handler(_this2.context); + }, + icon: icon, + label: addAction.label + }), + this.state.addPanelOpen && _react2.default.createElement( + 'div', + { className: 'Select' }, + _react2.default.createElement( + 'div', + { className: 'Select-menu-outer' }, + _react2.default.createElement( + 'div', + { className: 'Select-menu' }, + addAction.handler.map(function (_ref) { + var label = _ref.label, + handler = _ref.handler; + return _react2.default.createElement( + 'div', + { + className: 'Select-option', + key: label, + onClick: function onClick() { + handler(_this2.context); + _this2.togglePanel(); + } + }, + label + ); + }) + ) + ) + ) + ) : null + ) + ); + } + }]); + + return PanelHeader; +}(_react.Component); + +PanelHeader.contextTypes = { + layout: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + localize: _propTypes2.default.func +}; + +PanelHeader.propTypes = { + addAction: _propTypes2.default.object, + allowCollapse: _propTypes2.default.bool, + children: _propTypes2.default.node, + hasOpen: _propTypes2.default.bool, + toggleFolds: _propTypes2.default.func +}; + +exports.default = PanelHeader; +//# sourceMappingURL=PanelHeader.js.map \ No newline at end of file diff --git a/lib/components/containers/PanelHeader.js.map b/lib/components/containers/PanelHeader.js.map new file mode 100644 index 000000000..778663ad0 --- /dev/null +++ b/lib/components/containers/PanelHeader.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/PanelHeader.js"],"names":["PanelHeader","state","addPanelOpen","togglePanel","bind","setState","_","context","localize","props","children","addAction","allowCollapse","toggleFolds","hasOpen","icon","length","Array","isArray","handler","label","map","Component","contextTypes","layout","PropTypes","object","fullContainer","onUpdate","func","updateContainer","propTypes","bool","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,W;;;AACJ,yBAAc;AAAA;;AAAA;;AAEZ,UAAKC,KAAL,GAAa,EAACC,cAAc,KAAf,EAAb;;AAEA,UAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,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AL,CAAWC,YAAX,IACC;AAAA;AAAA,gBAAK,WAAU,QAAf;AACE;AAAA;AAAA,kBAAK,WAAU,mBAAf;AACE;AAAA;AAAA,oBAAK,WAAU,aAAf;AACGS,4BAAUQ,OAAV,CAAkBE,GAAlB,CAAsB;AAAA,wBAAED,KAAF,QAAEA,KAAF;AAAA,wBAASD,OAAT,QAASA,OAAT;AAAA,2BACrB;AAAA;AAAA;AACE,mCAAU,eADZ;AAEE,6BAAKC,KAFP;AAGE,iCAAS,mBAAM;AACbD,kCAAQ,OAAKZ,OAAb;AACA,iCAAKJ,WAAL;AACD;AANH;AAQGiB;AARH,qBADqB;AAAA,mBAAtB;AADH;AADF;AADF;AAbJ,WADD,GAkCG;AAnDN;AAJF,OADF;AA4DD;;;;EA9EuBE,gB;;AAiF1BtB,YAAYuB,YAAZ,GAA2B;AACzBC,UAAQC,oBAAUC,MADO;AAEzBC,iBAAeF,oBAAUC,MAFA;AAGzBE,YAAUH,oBAAUI,IAHK;AAIzBC,mBAAiBL,oBAAUI,IAJF;AAKzBrB,YAAUiB,oBAAUI;AALK,CAA3B;;AAQA7B,YAAY+B,SAAZ,GAAwB;AACtBpB,aAAWc,oBAAUC,MADC;AAEtBd,iBAAea,oBAAUO,IAFH;AAGtBtB,YAAUe,oBAAUQ,IAHE;AAItBnB,WAASW,oBAAUO,IAJG;AAKtBnB,eAAaY,oBAAUI;AALD,CAAxB;;kBAQe7B,W","file":"PanelHeader.js","sourcesContent":["import Button from 'components/widgets/Button';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {PlusIcon, ResizeUpIcon, ResizeDownIcon} from 'plotly-icons';\n\nclass PanelHeader extends Component {\n constructor() {\n super();\n this.state = {addPanelOpen: false};\n\n this.togglePanel = this.togglePanel.bind(this);\n }\n\n togglePanel() {\n this.setState({addPanelOpen: !this.state.addPanelOpen});\n }\n\n render() {\n const {localize: _} = this.context;\n const {children, addAction, allowCollapse, toggleFolds, hasOpen} = this.props;\n\n // dropdown is styled with same styles as react-select component - see _dropdown.scss\n const icon = ;\n return !children && !addAction && !allowCollapse ? null : (\n
\n {children && children.length ? (\n
{children}
\n ) : null}\n
\n {allowCollapse ? (\n
\n {hasOpen ? (\n \n \n {_('Collapse All')}\n \n ) : (\n \n \n {_('Expand All')}\n \n )}\n
\n ) : null}\n\n {addAction ? (\n
\n addAction.handler(this.context)\n }\n icon={icon}\n label={addAction.label}\n />\n {this.state.addPanelOpen && (\n
\n
\n
\n {addAction.handler.map(({label, handler}) => (\n {\n handler(this.context);\n this.togglePanel();\n }}\n >\n {label}\n
\n ))}\n
\n
\n
\n )}\n
\n ) : null}\n
\n
\n );\n }\n}\n\nPanelHeader.contextTypes = {\n layout: PropTypes.object,\n fullContainer: PropTypes.object,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n localize: PropTypes.func,\n};\n\nPanelHeader.propTypes = {\n addAction: PropTypes.object,\n allowCollapse: PropTypes.bool,\n children: PropTypes.node,\n hasOpen: PropTypes.bool,\n toggleFolds: PropTypes.func,\n};\n\nexport default PanelHeader;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PlotlyFold.js b/lib/components/containers/PlotlyFold.js new file mode 100644 index 000000000..d8fa6ca04 --- /dev/null +++ b/lib/components/containers/PlotlyFold.js @@ -0,0 +1,259 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Fold = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _FoldEmpty = require('./FoldEmpty'); + +var _FoldEmpty2 = _interopRequireDefault(_FoldEmpty); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _plotlyIcons = require('plotly-icons'); + +var _lib = require('../../lib'); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Fold = exports.Fold = function (_Component) { + _inherits(Fold, _Component); + + function Fold() { + _classCallCheck(this, Fold); + + var _this = _possibleConstructorReturn(this, (Fold.__proto__ || Object.getPrototypeOf(Fold)).call(this)); + + _this.foldVisible = true; + return _this; + } + + _createClass(Fold, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + foldInfo: this.props.foldInfo ? this.props.foldInfo : null + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + return { + foldInfo: this.props.foldInfo ? this.props.foldInfo : null + }; + } + }, { + key: 'render', + value: function render() { + if (!this.foldVisible && !this.props.messageIfEmpty) { + return _react2.default.createElement(_context.PlotlyFoldContext.Provider, { value: this.getChildContext() }); + } + var deleteContainer = this.context.deleteContainer; + var _props = this.props, + canDelete = _props.canDelete, + children = _props.children, + className = _props.className, + folded = _props.folded, + foldInfo = _props.foldInfo, + toggleFold = _props.toggleFold, + hideHeader = _props.hideHeader, + Icon = _props.icon, + messageIfEmpty = _props.messageIfEmpty, + name = _props.name; + + + var contentClass = (0, _classnames2.default)('fold__content', { + 'fold__content--noheader': hideHeader + }); + + var headerClass = (0, _classnames2.default)('fold__top', { + 'fold__top--open': !folded + }); + + var arrowClass = (0, _classnames2.default)('fold__top__arrow', { + 'fold__top__arrow--open': !folded + }); + + var arrowIcon = _react2.default.createElement( + 'div', + { className: arrowClass }, + _react2.default.createElement( + 'div', + { className: 'fold__top__arrow__wrapper' }, + _react2.default.createElement(_plotlyIcons.AngleDownIcon, null) + ) + ); + + var icon = Icon ? _react2.default.createElement(Icon, { className: 'fold__top__icon' }) : null; + + var deleteButton = canDelete && typeof deleteContainer === 'function' ? _react2.default.createElement( + 'div', + { + className: 'fold__top__delete js-fold__delete', + onClick: function onClick(e) { + e.stopPropagation(); + deleteContainer(foldInfo); + } + }, + _react2.default.createElement(_plotlyIcons.CloseIcon, null) + ) : null; + + var foldHeader = !hideHeader && _react2.default.createElement( + 'div', + { className: headerClass, onClick: toggleFold }, + _react2.default.createElement( + 'div', + { className: 'fold__top__arrow-title' }, + arrowIcon, + icon, + _react2.default.createElement( + 'div', + { className: 'fold__top__title' }, + (0, _lib.striptags)(name) + ) + ), + deleteButton + ); + + var foldContent = null; + if (!folded) { + if (this.foldVisible) { + foldContent = _react2.default.createElement( + 'div', + { className: contentClass }, + children + ); + } else { + foldContent = _react2.default.createElement( + 'div', + { className: contentClass }, + _react2.default.createElement(_FoldEmpty2.default, { icon: Icon, messagePrimary: messageIfEmpty }) + ); + } + } + + var classes = className ? ' ' + className : ''; + + return _react2.default.createElement( + _context.PlotlyFoldContext.Provider, + { value: this.provideValue() }, + _react2.default.createElement( + 'div', + { className: 'fold' + classes }, + foldHeader, + foldContent + ) + ); + } + }]); + + return Fold; +}(_react.Component); + +Fold.plotly_editor_traits = { foldable: true }; + +Fold.propTypes = { + canDelete: _propTypes2.default.bool, + children: _propTypes2.default.node, + className: _propTypes2.default.string, + folded: _propTypes2.default.bool, + foldInfo: _propTypes2.default.object, + toggleFold: _propTypes2.default.func, + hideHeader: _propTypes2.default.bool, + icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), + messageIfEmpty: _propTypes2.default.string, + name: _propTypes2.default.string +}; + +Fold.contextTypes = { + deleteContainer: _propTypes2.default.func +}; + +Fold.childContextTypes = { + foldInfo: _propTypes2.default.object +}; + +var PlotlyFold = function (_Fold) { + _inherits(PlotlyFold, _Fold); + + function PlotlyFold(props, context) { + _classCallCheck(this, PlotlyFold); + + var _this2 = _possibleConstructorReturn(this, (PlotlyFold.__proto__ || Object.getPrototypeOf(PlotlyFold)).call(this, props, context)); + + _this2.foldVisible = false; + _this2.determineVisibility(props, context); + return _this2; + } + + _createClass(PlotlyFold, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.determineVisibility(nextProps, nextContext); + } + }, { + key: 'determineVisibility', + value: function determineVisibility(nextProps, nextContext) { + var _this3 = this; + + this.foldVisible = false; + + _react2.default.Children.forEach(nextProps.children, function (child) { + if (!child || _this3.foldVisible) { + return; + } + + if (child.props.attr) { + // attr components force fold open if they are visible + var plotProps = (0, _lib.unpackPlotProps)(child.props, nextContext); + if (child.type.modifyPlotProps) { + child.type.modifyPlotProps(child.props, nextContext, plotProps); + } + + _this3.foldVisible = _this3.foldVisible || plotProps.isVisible; + return; + } + + if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) { + // non-attr components force visibility (unless they don't via traits) + _this3.foldVisible = true; + return; + } + }); + } + }]); + + return PlotlyFold; +}(Fold); + +PlotlyFold.plotly_editor_traits = { + foldable: true +}; + +PlotlyFold.contextTypes = Object.assign({ + deleteContainer: _propTypes2.default.func +}, _lib.containerConnectedContextTypes); + +exports.default = PlotlyFold; +//# sourceMappingURL=PlotlyFold.js.map \ No newline at end of file diff --git a/lib/components/containers/PlotlyFold.js.map b/lib/components/containers/PlotlyFold.js.map new file mode 100644 index 000000000..f30999fee --- /dev/null +++ b/lib/components/containers/PlotlyFold.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/PlotlyFold.js"],"names":["Fold","foldVisible","foldInfo","props","messageIfEmpty","getChildContext","deleteContainer","context","canDelete","children","className","folded","toggleFold","hideHeader","Icon","icon","name","contentClass","headerClass","arrowClass","arrowIcon","deleteButton","e","stopPropagation","foldHeader","foldContent","classes","provideValue","Component","plotly_editor_traits","foldable","propTypes","PropTypes","bool","node","string","object","func","oneOfType","contextTypes","childContextTypes","PlotlyFold","determineVisibility","nextProps","nextContext","React","Children","forEach","child","attr","plotProps","type","modifyPlotProps","isVisible","no_visibility_forcing","Object","assign","containerConnectedContextTypes"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;IAEaA,I,WAAAA,I;;;AACX,kBAAc;AAAA;;AAAA;;AAEZ,UAAKC,WAAL,GAAmB,IAAnB;AAFY;AAGb;;;;sCAEiB;AAChB,aAAO;AACLC,kBAAU,KAAKC,KAAL,CAAWD,QAAX,GAAsB,KAAKC,KAAL,CAAWD,QAAjC,GAA4C;AADjD,OAAP;AAGD;;;mCAEc;AACb,aAAO;AACLA,kBAAU,KAAKC,KAAL,CAAWD,QAAX,GAAsB,KAAKC,KAAL,CAAWD,QAAjC,GAA4C;AADjD,OAAP;AAGD;;;6BAEQ;AACP,UAAI,CAAC,KAAKD,WAAN,IAAqB,CAAC,KAAKE,KAAL,CAAWC,cAArC,EAAqD;AACnD,eAAO,8BAAC,0BAAD,CAAmB,QAAnB,IAA4B,OAAO,KAAKC,eAAL,EAAnC,GAAP;AACD;AAHM,UAIAC,eAJA,GAImB,KAAKC,OAJxB,CAIAD,eAJA;AAAA,mBAgBH,KAAKH,KAhBF;AAAA,UAMLK,SANK,UAMLA,SANK;AAAA,UAOLC,QAPK,UAOLA,QAPK;AAAA,UAQLC,SARK,UAQLA,SARK;AAAA,UASLC,MATK,UASLA,MATK;AAAA,UAULT,QAVK,UAULA,QAVK;AAAA,UAWLU,UAXK,UAWLA,UAXK;AAAA,UAYLC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;;;wCAEmBD,S,EAAWC,W,EAAa;AAAA;;AAC1C,WAAK3C,WAAL,GAAmB,KAAnB;;AAEA4C,sBAAMC,QAAN,CAAeC,OAAf,CAAuBJ,UAAUlC,QAAjC,EAA2C,iBAAS;AAClD,YAAI,CAACuC,KAAD,IAAU,OAAK/C,WAAnB,EAAgC;AAC9B;AACD;;AAED,YAAI+C,MAAM7C,KAAN,CAAY8C,IAAhB,EAAsB;AACpB;AACA,cAAMC,YAAY,0BAAgBF,MAAM7C,KAAtB,EAA6ByC,WAA7B,CAAlB;AACA,cAAII,MAAMG,IAAN,CAAWC,eAAf,EAAgC;AAC9BJ,kBAAMG,IAAN,CAAWC,eAAX,CAA2BJ,MAAM7C,KAAjC,EAAwCyC,WAAxC,EAAqDM,SAArD;AACD;;AAED,iBAAKjD,WAAL,GAAmB,OAAKA,WAAL,IAAoBiD,UAAUG,SAAjD;AACA;AACD;;AAED,YAAI,CAAC,CAACL,MAAMG,IAAN,CAAWtB,oBAAX,IAAmC,EAApC,EAAwCyB,qBAA7C,EAAoE;AAClE;AACA,iBAAKrD,WAAL,GAAmB,IAAnB;AACA;AACD;AACF,OArBD;AAsBD;;;;EArCsBD,I;;AAwCzByC,WAAWZ,oBAAX,GAAkC;AAChCC,YAAU;AADsB,CAAlC;;AAIAW,WAAWF,YAAX,GAA0BgB,OAAOC,MAAP,CACxB;AACElD,mBAAiB0B,oBAAUK;AAD7B,CADwB,EAIxBoB,mCAJwB,CAA1B;;kBAOehB,U","file":"PlotlyFold.js","sourcesContent":["import FoldEmpty from './FoldEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport classnames from 'classnames';\nimport {CloseIcon, AngleDownIcon} from 'plotly-icons';\nimport {unpackPlotProps, containerConnectedContextTypes, striptags} from 'lib';\nimport {PlotlyFoldContext} from '../../context';\n\nexport class Fold extends Component {\n constructor() {\n super();\n this.foldVisible = true;\n }\n\n getChildContext() {\n return {\n foldInfo: this.props.foldInfo ? this.props.foldInfo : null,\n };\n }\n\n provideValue() {\n return {\n foldInfo: this.props.foldInfo ? this.props.foldInfo : null,\n };\n }\n\n render() {\n if (!this.foldVisible && !this.props.messageIfEmpty) {\n return ;\n }\n const {deleteContainer} = this.context;\n const {\n canDelete,\n children,\n className,\n folded,\n foldInfo,\n toggleFold,\n hideHeader,\n icon: Icon,\n messageIfEmpty,\n name,\n } = this.props;\n\n const contentClass = classnames('fold__content', {\n 'fold__content--noheader': hideHeader,\n });\n\n const headerClass = classnames('fold__top', {\n 'fold__top--open': !folded,\n });\n\n const arrowClass = classnames('fold__top__arrow', {\n 'fold__top__arrow--open': !folded,\n });\n\n const arrowIcon = (\n
\n
\n \n
\n
\n );\n\n const icon = Icon ? : null;\n\n const deleteButton =\n canDelete && typeof deleteContainer === 'function' ? (\n {\n e.stopPropagation();\n deleteContainer(foldInfo);\n }}\n >\n \n
\n ) : null;\n\n const foldHeader = !hideHeader && (\n
\n
\n {arrowIcon}\n {icon}\n
{striptags(name)}
\n
\n {deleteButton}\n
\n );\n\n let foldContent = null;\n if (!folded) {\n if (this.foldVisible) {\n foldContent =
{children}
;\n } else {\n foldContent = (\n
\n \n
\n );\n }\n }\n\n const classes = className ? ' ' + className : '';\n\n return (\n \n
\n {foldHeader}\n {foldContent}\n
\n
\n );\n }\n}\n\nFold.plotly_editor_traits = {foldable: true};\n\nFold.propTypes = {\n canDelete: PropTypes.bool,\n children: PropTypes.node,\n className: PropTypes.string,\n folded: PropTypes.bool,\n foldInfo: PropTypes.object,\n toggleFold: PropTypes.func,\n hideHeader: PropTypes.bool,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n messageIfEmpty: PropTypes.string,\n name: PropTypes.string,\n};\n\nFold.contextTypes = {\n deleteContainer: PropTypes.func,\n};\n\nFold.childContextTypes = {\n foldInfo: PropTypes.object,\n};\n\nclass PlotlyFold extends Fold {\n constructor(props, context) {\n super(props, context);\n\n this.foldVisible = false;\n this.determineVisibility(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.determineVisibility(nextProps, nextContext);\n }\n\n determineVisibility(nextProps, nextContext) {\n this.foldVisible = false;\n\n React.Children.forEach(nextProps.children, child => {\n if (!child || this.foldVisible) {\n return;\n }\n\n if (child.props.attr) {\n // attr components force fold open if they are visible\n const plotProps = unpackPlotProps(child.props, nextContext);\n if (child.type.modifyPlotProps) {\n child.type.modifyPlotProps(child.props, nextContext, plotProps);\n }\n\n this.foldVisible = this.foldVisible || plotProps.isVisible;\n return;\n }\n\n if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) {\n // non-attr components force visibility (unless they don't via traits)\n this.foldVisible = true;\n return;\n }\n });\n }\n}\n\nPlotlyFold.plotly_editor_traits = {\n foldable: true,\n};\n\nPlotlyFold.contextTypes = Object.assign(\n {\n deleteContainer: PropTypes.func,\n },\n containerConnectedContextTypes\n);\n\nexport default PlotlyFold;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PlotlyPanel.js b/lib/components/containers/PlotlyPanel.js new file mode 100644 index 000000000..38c6a5571 --- /dev/null +++ b/lib/components/containers/PlotlyPanel.js @@ -0,0 +1,261 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Panel = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PanelHeader = require('./PanelHeader'); + +var _PanelHeader2 = _interopRequireDefault(_PanelHeader); + +var _PanelEmpty = require('./PanelEmpty'); + +var _PanelEmpty2 = _interopRequireDefault(_PanelEmpty); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _immutabilityHelper = require('immutability-helper'); + +var _immutabilityHelper2 = _interopRequireDefault(_immutabilityHelper); + +var _lib = require('../../lib'); + +var _plotlyIcons = require('plotly-icons'); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var PanelErrorImpl = function (_Component) { + _inherits(PanelErrorImpl, _Component); + + function PanelErrorImpl() { + _classCallCheck(this, PanelErrorImpl); + + return _possibleConstructorReturn(this, (PanelErrorImpl.__proto__ || Object.getPrototypeOf(PanelErrorImpl)).apply(this, arguments)); + } + + _createClass(PanelErrorImpl, [{ + key: 'render', + value: function render() { + var _ = this.context.localize; + + + return _react2.default.createElement( + _PanelEmpty2.default, + { icon: _plotlyIcons.EmbedIconIcon, heading: _('Well this is embarrassing.') }, + _react2.default.createElement( + 'p', + null, + _('This panel could not be displayed due to an error.') + ) + ); + } + }]); + + return PanelErrorImpl; +}(_react.Component); + +PanelErrorImpl.contextTypes = { + localize: _propTypes2.default.func +}; + +var PanelError = PanelErrorImpl; + +var Panel = exports.Panel = function (_Component2) { + _inherits(Panel, _Component2); + + function Panel(props) { + _classCallCheck(this, Panel); + + var _this2 = _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).call(this, props)); + + _this2.state = { + individualFoldStates: [], + hasError: false + }; + _this2.toggleFolds = _this2.toggleFolds.bind(_this2); + _this2.toggleFold = _this2.toggleFold.bind(_this2); + return _this2; + } + + _createClass(Panel, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + deleteContainer: this.props.deleteAction ? this.props.deleteAction : null + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + return { + deleteContainer: this.props.deleteAction ? this.props.deleteAction : null + }; + } + }, { + key: 'componentDidCatch', + value: function componentDidCatch() { + this.setState({ hasError: true }); + } + }, { + key: 'toggleFolds', + value: function toggleFolds() { + var individualFoldStates = this.state.individualFoldStates; + + var hasOpen = individualFoldStates.length > 0 && individualFoldStates.some(function (s) { + return s !== true; + }); + this.setState({ + individualFoldStates: individualFoldStates.map(function () { + return hasOpen; + }) + }); + } + }, { + key: 'toggleFold', + value: function toggleFold(index) { + this.setState((0, _immutabilityHelper2.default)(this.state, { individualFoldStates: { $toggle: [index] } })); + } + }, { + key: 'calculateFolds', + value: function calculateFolds() { + // to get proper number of child folds and initialize component state + var numFolds = 0; + + _react2.default.Children.forEach(this.props.children, function (child) { + if ((child && child.type && child.type.plotly_editor_traits || {}).foldable) { + numFolds++; + } + }); + + if (this.state.individualFoldStates.length !== numFolds) { + var newFoldStates = new Array(numFolds).fill(false); + this.setState({ + individualFoldStates: this.props.addAction ? newFoldStates.map(function (e, i) { + return i !== numFolds - 1; + }) : newFoldStates + }); + } + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + this.calculateFolds(); + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this.calculateFolds(); + } + }, { + key: 'render', + value: function render() { + var _this3 = this; + + var _state = this.state, + individualFoldStates = _state.individualFoldStates, + hasError = _state.hasError; + + + if (hasError) { + return _react2.default.createElement( + _context.PlotlyPanelContext.Provider, + { value: this.provideValue() }, + _react2.default.createElement(PanelError, null) + ); + } + + var newChildren = _react2.default.Children.map(this.props.children, function (child, index) { + if ((child && child.type && child.type.plotly_editor_traits || {}).foldable) { + return (0, _react.cloneElement)(child, { + key: index, + folded: individualFoldStates[index] || false, + toggleFold: function toggleFold() { + return _this3.toggleFold(index); + } + }); + } + return child; + }); + + return _react2.default.createElement( + _context.PlotlyPanelContext.Provider, + { value: this.provideValue() }, + _react2.default.createElement( + 'div', + { className: 'panel' + (this.props.noPadding ? ' panel--no-padding' : '') }, + _react2.default.createElement(_PanelHeader2.default, { + addAction: this.props.addAction, + allowCollapse: this.props.showExpandCollapse && individualFoldStates.length > 1, + toggleFolds: this.toggleFolds, + hasOpen: individualFoldStates.some(function (s) { + return s === false; + }) + }), + _react2.default.createElement( + 'div', + { className: (0, _lib.bem)('panel', 'content') }, + newChildren + ) + ) + ); + } + }]); + + return Panel; +}(_react.Component); + +Panel.propTypes = { + addAction: _propTypes2.default.object, + children: _propTypes2.default.node, + deleteAction: _propTypes2.default.func, + noPadding: _propTypes2.default.bool, + showExpandCollapse: _propTypes2.default.bool +}; + +Panel.defaultProps = { + showExpandCollapse: true +}; + +Panel.contextTypes = { + localize: _propTypes2.default.func +}; + +Panel.childContextTypes = { + deleteContainer: _propTypes2.default.func +}; + +var PlotlyPanel = function (_Panel) { + _inherits(PlotlyPanel, _Panel); + + function PlotlyPanel() { + _classCallCheck(this, PlotlyPanel); + + return _possibleConstructorReturn(this, (PlotlyPanel.__proto__ || Object.getPrototypeOf(PlotlyPanel)).apply(this, arguments)); + } + + return PlotlyPanel; +}(Panel); + +PlotlyPanel.plotly_editor_traits = { + no_visibility_forcing: true +}; + +exports.default = PlotlyPanel; +//# sourceMappingURL=PlotlyPanel.js.map \ No newline at end of file diff --git a/lib/components/containers/PlotlyPanel.js.map b/lib/components/containers/PlotlyPanel.js.map new file mode 100644 index 000000000..6e5ba16bc --- /dev/null +++ b/lib/components/containers/PlotlyPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/PlotlyPanel.js"],"names":["PanelErrorImpl","_","context","localize","EmbedIconIcon","Component","contextTypes","PropTypes","func","PanelError","Panel","props","state","individualFoldStates","hasError","toggleFolds","bind","toggleFold","deleteContainer","deleteAction","setState","hasOpen","length","some","s","map","index","$toggle","numFolds","React","Children","forEach","children","child","type","plotly_editor_traits","foldable","newFoldStates","Array","fill","addAction","e","i","calculateFolds","provideValue","newChildren","key","folded","noPadding","showExpandCollapse","propTypes","object","node","bool","defaultProps","childContextTypes","PlotlyPanel","no_visibility_forcing"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;IAEMA,c;;;;;;;;;;;6BACK;AAAA,UACUC,CADV,GACe,KAAKC,OADpB,CACAC,QADA;;;AAGP,aACE;AAAC,4BAAD;AAAA,UAAY,MAAMC,0BAAlB,EAAiC,SAASH,EAAE,4BAAF,CAA1C;AACE;AAAA;AAAA;AAAIA,YAAE,oDAAF;AAAJ;AADF,OADF;AAKD;;;;EAT0BI,gB;;AAY7BL,eAAeM,YAAf,GAA8B;AAC5BH,YAAUI,oBAAUC;AADQ,CAA9B;;AAIA,IAAMC,aAAaT,cAAnB;;IAEaU,K,WAAAA,K;;;AACX,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA,+GACXA,KADW;;AAEjB,WAAKC,KAAL,GAAa;AACXC,4BAAsB,EADX;AAEXC,gBAAU;AAFC,KAAb;AAIA,WAAKC,WAAL,GAAmB,OAAKA,WAAL,CAAiBC,IAAjB,QAAnB;AACA,WAAKC,UAAL,GAAkB,OAAKA,UAAL,CAAgBD,IAAhB,QAAlB;AAPiB;AAQlB;;;;sCAEiB;AAChB,aAAO;AACLE,yBAAiB,KAAKP,KAAL,CAAWQ,YAAX,GAA0B,KAAKR,KAAL,CAAWQ,YAArC,GAAoD;AADhE,OAAP;AAGD;;;mCAEc;AACb,aAAO;AACLD,yBAAiB,KAAKP,KAAL,CAAWQ,YAAX,GAA0B,KAAKR,KAAL,CAAWQ,YAArC,GAAoD;AADhE,OAAP;AAGD;;;wCAEmB;AAClB,WAAKC,QAAL,CAAc,EAACN,UAAU,IAAX,EAAd;AACD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V,aAAWjC,oBAAU4C,MADL;AAEhBnB,YAAUzB,oBAAU6C,IAFJ;AAGhBjC,gBAAcZ,oBAAUC,IAHR;AAIhBwC,aAAWzC,oBAAU8C,IAJL;AAKhBJ,sBAAoB1C,oBAAU8C;AALd,CAAlB;;AAQA3C,MAAM4C,YAAN,GAAqB;AACnBL,sBAAoB;AADD,CAArB;;AAIAvC,MAAMJ,YAAN,GAAqB;AACnBH,YAAUI,oBAAUC;AADD,CAArB;;AAIAE,MAAM6C,iBAAN,GAA0B;AACxBrC,mBAAiBX,oBAAUC;AADH,CAA1B;;IAIMgD,W;;;;;;;;;;EAAoB9C,K;;AAE1B8C,YAAYrB,oBAAZ,GAAmC;AACjCsB,yBAAuB;AADU,CAAnC;;kBAIeD,W","file":"PlotlyPanel.js","sourcesContent":["import PanelHeader from './PanelHeader';\nimport PanelEmpty from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component, cloneElement} from 'react';\nimport update from 'immutability-helper';\nimport {bem} from 'lib';\nimport {EmbedIconIcon} from 'plotly-icons';\nimport {PlotlyPanelContext} from '../../context';\n\nclass PanelErrorImpl extends Component {\n render() {\n const {localize: _} = this.context;\n\n return (\n \n

{_('This panel could not be displayed due to an error.')}

\n
\n );\n }\n}\n\nPanelErrorImpl.contextTypes = {\n localize: PropTypes.func,\n};\n\nconst PanelError = PanelErrorImpl;\n\nexport class Panel extends Component {\n constructor(props) {\n super(props);\n this.state = {\n individualFoldStates: [],\n hasError: false,\n };\n this.toggleFolds = this.toggleFolds.bind(this);\n this.toggleFold = this.toggleFold.bind(this);\n }\n\n getChildContext() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n provideValue() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n componentDidCatch() {\n this.setState({hasError: true});\n }\n\n toggleFolds() {\n const {individualFoldStates} = this.state;\n const hasOpen = individualFoldStates.length > 0 && individualFoldStates.some(s => s !== true);\n this.setState({\n individualFoldStates: individualFoldStates.map(() => hasOpen),\n });\n }\n\n toggleFold(index) {\n this.setState(update(this.state, {individualFoldStates: {$toggle: [index]}}));\n }\n\n calculateFolds() {\n // to get proper number of child folds and initialize component state\n let numFolds = 0;\n\n React.Children.forEach(this.props.children, child => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n numFolds++;\n }\n });\n\n if (this.state.individualFoldStates.length !== numFolds) {\n const newFoldStates = new Array(numFolds).fill(false);\n this.setState({\n individualFoldStates: this.props.addAction\n ? newFoldStates.map((e, i) => i !== numFolds - 1)\n : newFoldStates,\n });\n }\n }\n\n componentDidUpdate() {\n this.calculateFolds();\n }\n componentDidMount() {\n this.calculateFolds();\n }\n\n render() {\n const {individualFoldStates, hasError} = this.state;\n\n if (hasError) {\n return (\n \n \n \n );\n }\n\n const newChildren = React.Children.map(this.props.children, (child, index) => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n return cloneElement(child, {\n key: index,\n folded: individualFoldStates[index] || false,\n toggleFold: () => this.toggleFold(index),\n });\n }\n return child;\n });\n\n return (\n \n
\n 1}\n toggleFolds={this.toggleFolds}\n hasOpen={individualFoldStates.some(s => s === false)}\n />\n
{newChildren}
\n
\n
\n );\n }\n}\n\nPanel.propTypes = {\n addAction: PropTypes.object,\n children: PropTypes.node,\n deleteAction: PropTypes.func,\n noPadding: PropTypes.bool,\n showExpandCollapse: PropTypes.bool,\n};\n\nPanel.defaultProps = {\n showExpandCollapse: true,\n};\n\nPanel.contextTypes = {\n localize: PropTypes.func,\n};\n\nPanel.childContextTypes = {\n deleteContainer: PropTypes.func,\n};\n\nclass PlotlyPanel extends Panel {}\n\nPlotlyPanel.plotly_editor_traits = {\n no_visibility_forcing: true,\n};\n\nexport default PlotlyPanel;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PlotlySection.js b/lib/components/containers/PlotlySection.js new file mode 100644 index 000000000..521baa484 --- /dev/null +++ b/lib/components/containers/PlotlySection.js @@ -0,0 +1,132 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Section = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Section = exports.Section = function (_Component) { + _inherits(Section, _Component); + + function Section() { + _classCallCheck(this, Section); + + var _this = _possibleConstructorReturn(this, (Section.__proto__ || Object.getPrototypeOf(Section)).call(this)); + + _this.sectionVisible = true; + return _this; + } + + _createClass(Section, [{ + key: 'render', + value: function render() { + if (!this.sectionVisible) { + return null; + } + + return _react2.default.createElement( + 'div', + { className: 'section' }, + this.props.name ? _react2.default.createElement( + 'div', + { className: 'section__heading' }, + _react2.default.createElement( + 'div', + { className: 'section__heading__text' }, + this.props.name + ) + ) : null, + this.props.children + ); + } + }]); + + return Section; +}(_react.Component); + +Section.plotly_editor_traits = { no_visibility_forcing: false }; +Section.propTypes = { + children: _propTypes2.default.node, + name: _propTypes2.default.string, + attr: _propTypes2.default.string +}; + +var PlotlySection = function (_Section) { + _inherits(PlotlySection, _Section); + + function PlotlySection(props, context) { + _classCallCheck(this, PlotlySection); + + var _this2 = _possibleConstructorReturn(this, (PlotlySection.__proto__ || Object.getPrototypeOf(PlotlySection)).call(this, props, context)); + + _this2.determineVisibility(props, context); + return _this2; + } + + _createClass(PlotlySection, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.determineVisibility(nextProps, nextContext); + } + }, { + key: 'determineVisibility', + value: function determineVisibility(nextProps, nextContext) { + var _this3 = this; + + var _unpackPlotProps = (0, _lib.unpackPlotProps)(nextProps, nextContext), + isVisible = _unpackPlotProps.isVisible; + + this.sectionVisible = Boolean(isVisible); + + _react2.default.Children.forEach(nextProps.children, function (child) { + if (!child || _this3.sectionVisible) { + return; + } + + if (child.props.attr) { + var plotProps = (0, _lib.unpackPlotProps)(child.props, nextContext); + if (child.type.modifyPlotProps) { + child.type.modifyPlotProps(child.props, nextContext, plotProps); + } + _this3.sectionVisible = _this3.sectionVisible || plotProps.isVisible; + return; + } + + if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) { + // non-attr components force visibility (unless they don't via traits) + _this3.sectionVisible = true; + return; + } + }); + } + }]); + + return PlotlySection; +}(Section); + +exports.default = PlotlySection; + + +PlotlySection.plotly_editor_traits = { no_visibility_forcing: true }; +PlotlySection.contextTypes = _lib.containerConnectedContextTypes; +//# sourceMappingURL=PlotlySection.js.map \ No newline at end of file diff --git a/lib/components/containers/PlotlySection.js.map b/lib/components/containers/PlotlySection.js.map new file mode 100644 index 000000000..ea92564fa --- /dev/null +++ b/lib/components/containers/PlotlySection.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/PlotlySection.js"],"names":["Section","sectionVisible","props","name","children","Component","plotly_editor_traits","no_visibility_forcing","propTypes","PropTypes","node","string","attr","PlotlySection","context","determineVisibility","nextProps","nextContext","isVisible","Boolean","React","Children","forEach","child","plotProps","type","modifyPlotProps","contextTypes","containerConnectedContextTypes"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;IAEaA,O,WAAAA,O;;;AACX,qBAAc;AAAA;;AAAA;;AAEZ,UAAKC,cAAL,GAAsB,IAAtB;AAFY;AAGb;;;;6BAEQ;AACP,UAAI,CAAC,KAAKA,cAAV,EAA0B;AACxB,eAAO,IAAP;AACD;;AAED,aACE;AAAA;AAAA,UAAK,WAAU,SAAf;AACG,aAAKC,KAAL,CAAWC,IAAX,GACC;AAAA;AAAA,YAAK,WAAU,kBAAf;AACE;AAAA;AAAA,cAAK,WAAU,wBAAf;AAAyC,iBAAKD,KAAL,CAAWC;AAApD;AADF,SADD,GAIG,IALN;AAMG,aAAKD,KAAL,CAAWE;AANd,OADF;AAUD;;;;EArB0BC,gB;;AAwB7BL,QAAQM,oBAAR,GAA+B,EAACC,uBAAuB,KAAxB,EAA/B;AACAP,QAAQQ,SAAR,GAAoB;AAClBJ,YAAUK,oBAAUC,IADF;AAElBP,QAAMM,oBAAUE,MAFE;AAGlBC,QAAMH,oBAAUE;AAHE,CAApB;;IAMqBE,a;;;AACnB,yBAAYX,KAAZ,EAAmBY,OAAnB,EAA4B;AAAA;;AAAA,+HACpBZ,KADoB,EACbY,OADa;;AAE1B,WAAKC,mBAAL,CAAyBb,KAAzB,EAAgCY,OAAhC;AAF0B;AAG3B;;;;8CAEyBE,S,EAAWC,W,EAAa;AAChD,WAAKF,mBAAL,CAAyBC,SAAzB,EAAoCC,WAApC;AACD;;;wCAEmBD,S,EAAWC,W,EAAa;AAAA;;AAAA,6BACtB,0BAAgBD,SAAhB,EAA2BC,WAA3B,CADsB;AAAA,UACnCC,SADmC,oBACnCA,SADmC;;AAE1C,WAAKjB,cAAL,GAAsBkB,QAAQD,SAAR,CAAtB;;AAEAE,sBAAMC,QAAN,CAAeC,OAAf,CAAuBN,UAAUZ,QAAjC,EAA2C,iBAAS;AAClD,YAAI,CAACmB,KAAD,IAAU,OAAKtB,cAAnB,EAAmC;AACjC;AACD;;AAED,YAAIsB,MAAMrB,KAAN,CAAYU,IAAhB,EAAsB;AACpB,cAAMY,YAAY,0BAAgBD,MAAMrB,KAAtB,EAA6Be,WAA7B,CAAlB;AACA,cAAIM,MAAME,IAAN,CAAWC,eAAf,EAAgC;AAC9BH,kBAAME,IAAN,CAAWC,eAAX,CAA2BH,MAAMrB,KAAjC,EAAwCe,WAAxC,EAAqDO,SAArD;AACD;AACD,iBAAKvB,cAAL,GAAsB,OAAKA,cAAL,IAAuBuB,UAAUN,SAAvD;AACA;AACD;;AAED,YAAI,CAAC,CAACK,MAAME,IAAN,CAAWnB,oBAAX,IAAmC,EAApC,EAAwCC,qBAA7C,EAAoE;AAClE;AACA,iBAAKN,cAAL,GAAsB,IAAtB;AACA;AACD;AACF,OAnBD;AAoBD;;;;EAlCwCD,O;;kBAAtBa,a;;;AAqCrBA,cAAcP,oBAAd,GAAqC,EAACC,uBAAuB,IAAxB,EAArC;AACAM,cAAcc,YAAd,GAA6BC,mCAA7B","file":"PlotlySection.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {containerConnectedContextTypes, unpackPlotProps} from '../../lib';\n\nexport class Section extends Component {\n constructor() {\n super();\n this.sectionVisible = true;\n }\n\n render() {\n if (!this.sectionVisible) {\n return null;\n }\n\n return (\n
\n {this.props.name ? (\n
\n
{this.props.name}
\n
\n ) : null}\n {this.props.children}\n
\n );\n }\n}\n\nSection.plotly_editor_traits = {no_visibility_forcing: false};\nSection.propTypes = {\n children: PropTypes.node,\n name: PropTypes.string,\n attr: PropTypes.string,\n};\n\nexport default class PlotlySection extends Section {\n constructor(props, context) {\n super(props, context);\n this.determineVisibility(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.determineVisibility(nextProps, nextContext);\n }\n\n determineVisibility(nextProps, nextContext) {\n const {isVisible} = unpackPlotProps(nextProps, nextContext);\n this.sectionVisible = Boolean(isVisible);\n\n React.Children.forEach(nextProps.children, child => {\n if (!child || this.sectionVisible) {\n return;\n }\n\n if (child.props.attr) {\n const plotProps = unpackPlotProps(child.props, nextContext);\n if (child.type.modifyPlotProps) {\n child.type.modifyPlotProps(child.props, nextContext, plotProps);\n }\n this.sectionVisible = this.sectionVisible || plotProps.isVisible;\n return;\n }\n\n if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) {\n // non-attr components force visibility (unless they don't via traits)\n this.sectionVisible = true;\n return;\n }\n });\n }\n}\n\nPlotlySection.plotly_editor_traits = {no_visibility_forcing: true};\nPlotlySection.contextTypes = containerConnectedContextTypes;\n"]} \ No newline at end of file diff --git a/lib/components/containers/RangeSelectorAccordion.js b/lib/components/containers/RangeSelectorAccordion.js new file mode 100644 index 000000000..fbe997f52 --- /dev/null +++ b/lib/components/containers/RangeSelectorAccordion.js @@ -0,0 +1,110 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _PlotlyPanel = require('./PlotlyPanel'); + +var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _context2 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var RangeSelectorFold = (0, _lib.connectRangeSelectorToAxis)(_PlotlyFold2.default); + +var RangeSelectorAccordion = function (_Component) { + _inherits(RangeSelectorAccordion, _Component); + + function RangeSelectorAccordion() { + _classCallCheck(this, RangeSelectorAccordion); + + return _possibleConstructorReturn(this, (RangeSelectorAccordion.__proto__ || Object.getPrototypeOf(RangeSelectorAccordion)).apply(this, arguments)); + } + + _createClass(RangeSelectorAccordion, [{ + key: 'render', + value: function render() { + if (!this.context.fullContainer || !this.context.fullContainer.rangeselector || !this.context.fullContainer.rangeselector.visible || + // next line checks for "all" case + this.context.fullContainer._axisGroup === 0) { + return null; + } + + var _context = this.context, + _context$fullContaine = _context.fullContainer.rangeselector.buttons, + buttons = _context$fullContaine === undefined ? [] : _context$fullContaine, + _ = _context.localize; + var children = this.props.children; + + + var content = buttons.length && buttons.map(function (btn, i) { + return _react2.default.createElement( + RangeSelectorFold, + { key: i, rangeselectorIndex: i, name: btn.label, canDelete: true }, + children + ); + }); + + var addAction = { + label: _('Button'), + handler: function handler(context) { + var fullContainer = context.fullContainer, + updateContainer = context.updateContainer; + + if (updateContainer) { + var rangeselectorIndex = Array.isArray(fullContainer.rangeselector.buttons) ? fullContainer.rangeselector.buttons.length : 0; + + updateContainer(_defineProperty({}, 'rangeselector.buttons[' + rangeselectorIndex + ']', {})); + } + } + }; + + return _react2.default.createElement( + _PlotlyPanel2.default, + { addAction: addAction }, + content ? content : null + ); + } + }]); + + return RangeSelectorAccordion; +}(_react.Component); + +RangeSelectorAccordion.contextType = _context2.EditorControlsContext; + +RangeSelectorAccordion.propTypes = { + children: _propTypes2.default.node +}; + +RangeSelectorAccordion.plotly_editor_traits = { + no_visibility_forcing: true +}; + +exports.default = RangeSelectorAccordion; +//# sourceMappingURL=RangeSelectorAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/RangeSelectorAccordion.js.map b/lib/components/containers/RangeSelectorAccordion.js.map new file mode 100644 index 000000000..e435cb0da --- /dev/null +++ b/lib/components/containers/RangeSelectorAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/RangeSelectorAccordion.js"],"names":["RangeSelectorFold","PlotlyFold","RangeSelectorAccordion","context","fullContainer","rangeselector","visible","_axisGroup","buttons","_","localize","children","props","content","length","map","btn","i","label","addAction","handler","updateContainer","rangeselectorIndex","Array","isArray","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","plotly_editor_traits","no_visibility_forcing"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,oBAAoB,qCAA2BC,oBAA3B,CAA1B;;IAEMC,sB;;;;;;;;;;;6BACK;AACP,UACE,CAAC,KAAKC,OAAL,CAAaC,aAAd,IACA,CAAC,KAAKD,OAAL,CAAaC,aAAb,CAA2BC,aAD5B,IAEA,CAAC,KAAKF,OAAL,CAAaC,aAAb,CAA2BC,aAA3B,CAAyCC,OAF1C;AAGA;AACA,WAAKH,OAAL,CAAaC,aAAb,CAA2BG,UAA3B,KAA0C,CAL5C,EAME;AACA,eAAO,IAAP;AACD;;AATM,qBAgBH,KAAKJ,OAhBF;AAAA,2CAYLC,aAZK,CAaHC,aAbG,CAaaG,OAbb;AAAA,UAaaA,OAbb,yCAauB,EAbvB;AAAA,UAeKC,CAfL,YAeLC,QAfK;AAAA,UAiBAC,QAjBA,GAiBY,KAAKC,KAjBjB,CAiBAD,QAjBA;;;AAmBP,UAAME,UACJL,QAAQM,MAAR,IACAN,QAAQO,GAAR,CAAY,UAACC,GAAD,EAAMC,CAAN;AAAA,eACV;AAAC,2BAAD;AAAA,YAAmB,KAAKA,CAAxB,EAA2B,oBAAoBA,CAA/C,EAAkD,MAAMD,IAAIE,KAA5D,EAAmE,WAAW,IAA9E;AACGP;AADH,SADU;AAAA,OAAZ,CAFF;;AAQA,UAAMQ,YAAY;AAChBD,eAAOT,EAAE,QAAF,CADS;AAEhBW,iBAAS,0BAAW;AAAA,cACXhB,aADW,GACuBD,OADvB,CACXC,aADW;AAAA,cACIiB,eADJ,GACuBlB,OADvB,CACIkB,eADJ;;AAElB,cAAIA,eAAJ,EAAqB;AACnB,gBAAMC,qBAAqBC,MAAMC,OAAN,CAAcpB,cAAcC,aAAd,CAA4BG,OAA1C,IACvBJ,cAAcC,aAAd,CAA4BG,OAA5B,CAAoCM,MADb,GAEvB,CAFJ;;AAIAO,2EAC4BC,kBAD5B,QACoD,EADpD;AAGD;AACF;AAbe,OAAlB;;AAgBA,aAAO;AAAC,6BAAD;AAAA,UAAa,WAAWH,SAAxB;AAAoCN,kBAAUA,OAAV,GAAoB;AAAxD,OAAP;AACD;;;;EA7CkCY,gB;;AAgDrCvB,uBAAuBwB,WAAvB,GAAqCC,+BAArC;;AAEAzB,uBAAuB0B,SAAvB,GAAmC;AACjCjB,YAAUkB,oBAAUC;AADa,CAAnC;;AAIA5B,uBAAuB6B,oBAAvB,GAA8C;AAC5CC,yBAAuB;AADqB,CAA9C;;kBAIe9B,sB","file":"RangeSelectorAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport PlotlyPanel from './PlotlyPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectRangeSelectorToAxis} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst RangeSelectorFold = connectRangeSelectorToAxis(PlotlyFold);\n\nclass RangeSelectorAccordion extends Component {\n render() {\n if (\n !this.context.fullContainer ||\n !this.context.fullContainer.rangeselector ||\n !this.context.fullContainer.rangeselector.visible ||\n // next line checks for \"all\" case\n this.context.fullContainer._axisGroup === 0\n ) {\n return null;\n }\n\n const {\n fullContainer: {\n rangeselector: {buttons = []},\n },\n localize: _,\n } = this.context;\n const {children} = this.props;\n\n const content =\n buttons.length &&\n buttons.map((btn, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Button'),\n handler: context => {\n const {fullContainer, updateContainer} = context;\n if (updateContainer) {\n const rangeselectorIndex = Array.isArray(fullContainer.rangeselector.buttons)\n ? fullContainer.rangeselector.buttons.length\n : 0;\n\n updateContainer({\n [`rangeselector.buttons[${rangeselectorIndex}]`]: {},\n });\n }\n },\n };\n\n return {content ? content : null};\n }\n}\n\nRangeSelectorAccordion.contextType = EditorControlsContext;\n\nRangeSelectorAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nRangeSelectorAccordion.plotly_editor_traits = {\n no_visibility_forcing: true,\n};\n\nexport default RangeSelectorAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/ShapeAccordion.js b/lib/components/containers/ShapeAccordion.js new file mode 100644 index 000000000..55350be6e --- /dev/null +++ b/lib/components/containers/ShapeAccordion.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _derived = require('./derived'); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _constants = require('../../lib/constants'); + +var _PanelEmpty = require('./PanelEmpty'); + +var _context2 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ShapeFold = (0, _lib.connectShapeToLayout)(_PlotlyFold2.default); + +var ShapeAccordion = function (_Component) { + _inherits(ShapeAccordion, _Component); + + function ShapeAccordion() { + _classCallCheck(this, ShapeAccordion); + + return _possibleConstructorReturn(this, (ShapeAccordion.__proto__ || Object.getPrototypeOf(ShapeAccordion)).apply(this, arguments)); + } + + _createClass(ShapeAccordion, [{ + key: 'render', + value: function render() { + var _context = this.context, + _context$layout$shape = _context.layout.shapes, + shapes = _context$layout$shape === undefined ? [] : _context$layout$shape, + _ = _context.localize; + var _props = this.props, + canAdd = _props.canAdd, + children = _props.children; + + + var content = shapes.length && shapes.map(function (shp, i) { + return _react2.default.createElement( + ShapeFold, + { key: i, shapeIndex: i, name: _('Shape') + ' ' + (i + 1), canDelete: canAdd }, + children + ); + }); + + var addAction = { + label: _('Shape'), + handler: function handler(_ref) { + var layout = _ref.layout, + updateContainer = _ref.updateContainer; + + var shapeIndex = void 0; + if (Array.isArray(layout.shapes)) { + shapeIndex = layout.shapes.length; + } else { + shapeIndex = 0; + } + + var key = 'shapes[' + shapeIndex + ']'; + var value = { + line: { color: _constants.COLORS.charcoal }, + fillcolor: _constants.COLORS.middleGray, + opacity: 0.3 + }; + + if (updateContainer) { + updateContainer(_defineProperty({}, key, value)); + } + } + }; + + return _react2.default.createElement( + _derived.LayoutPanel, + { addAction: canAdd ? addAction : null }, + content ? content : _react2.default.createElement( + _PanelEmpty.PanelMessage, + { heading: _('Lines, Rectangles and Ellipses.') }, + _react2.default.createElement( + 'p', + null, + _('Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest.') + ), + _react2.default.createElement( + 'p', + null, + _('Click on the + button above to add a shape.') + ) + ) + ); + } + }]); + + return ShapeAccordion; +}(_react.Component); + +ShapeAccordion.contextType = _context2.EditorControlsContext; + +ShapeAccordion.propTypes = { + children: _propTypes2.default.node, + canAdd: _propTypes2.default.bool +}; + +exports.default = ShapeAccordion; +//# sourceMappingURL=ShapeAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/ShapeAccordion.js.map b/lib/components/containers/ShapeAccordion.js.map new file mode 100644 index 000000000..fcd364f53 --- /dev/null +++ b/lib/components/containers/ShapeAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/ShapeAccordion.js"],"names":["ShapeFold","PlotlyFold","ShapeAccordion","context","layout","shapes","_","localize","props","canAdd","children","content","length","map","shp","i","addAction","label","handler","updateContainer","shapeIndex","Array","isArray","key","value","line","color","COLORS","charcoal","fillcolor","middleGray","opacity","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;AACA;;;;AACA;;;;AACA;;AACA;;AAC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CA,OADD,GAGC;AAAC,kCAAD;AAAA,YAAc,SAASL,EAAE,iCAAF,CAAvB;AACE;AAAA;AAAA;AACGA,cACC,kGADD;AADH,WADF;AAME;AAAA;AAAA;AAAIA,cAAE,6CAAF;AAAJ;AANF;AAJJ,OADF;AAgBD;;;;EAvD0B0B,gB;;AA0D7B9B,eAAe+B,WAAf,GAA6BC,+BAA7B;;AAEAhC,eAAeiC,SAAf,GAA2B;AACzBzB,YAAU0B,oBAAUC,IADK;AAEzB5B,UAAQ2B,oBAAUE;AAFO,CAA3B;;kBAKepC,c","file":"ShapeAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport {LayoutPanel} from './derived';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectShapeToLayout} from 'lib';\nimport {COLORS} from 'lib/constants';\nimport {PanelMessage} from './PanelEmpty';\nimport {EditorControlsContext} from '../../context';\n\nconst ShapeFold = connectShapeToLayout(PlotlyFold);\n\nclass ShapeAccordion extends Component {\n render() {\n const {\n layout: {shapes = []},\n localize: _,\n } = this.context;\n const {canAdd, children} = this.props;\n\n const content =\n shapes.length &&\n shapes.map((shp, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Shape'),\n handler: ({layout, updateContainer}) => {\n let shapeIndex;\n if (Array.isArray(layout.shapes)) {\n shapeIndex = layout.shapes.length;\n } else {\n shapeIndex = 0;\n }\n\n const key = `shapes[${shapeIndex}]`;\n const value = {\n line: {color: COLORS.charcoal},\n fillcolor: COLORS.middleGray,\n opacity: 0.3,\n };\n\n if (updateContainer) {\n updateContainer({[key]: value});\n }\n },\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n

\n {_(\n 'Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest.'\n )}\n

\n

{_('Click on the + button above to add a shape.')}

\n
\n )}\n
\n );\n }\n}\n\nShapeAccordion.contextType = EditorControlsContext;\n\nShapeAccordion.propTypes = {\n children: PropTypes.node,\n canAdd: PropTypes.bool,\n};\n\nexport default ShapeAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/SingleSidebarItem.js b/lib/components/containers/SingleSidebarItem.js new file mode 100644 index 000000000..cbc3c8faa --- /dev/null +++ b/lib/components/containers/SingleSidebarItem.js @@ -0,0 +1,56 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var SingleSidebarItem = function (_Component) { + _inherits(SingleSidebarItem, _Component); + + function SingleSidebarItem() { + _classCallCheck(this, SingleSidebarItem); + + return _possibleConstructorReturn(this, (SingleSidebarItem.__proto__ || Object.getPrototypeOf(SingleSidebarItem)).apply(this, arguments)); + } + + _createClass(SingleSidebarItem, [{ + key: 'render', + value: function render() { + return this.props.children ? _react2.default.createElement( + 'div', + { className: 'sidebar__item--single' }, + this.props.children + ) : null; + } + }]); + + return SingleSidebarItem; +}(_react.Component); + +exports.default = SingleSidebarItem; + + +SingleSidebarItem.plotly_editor_traits = { sidebar_element: true }; + +SingleSidebarItem.propTypes = { + children: _propTypes2.default.any +}; +//# sourceMappingURL=SingleSidebarItem.js.map \ No newline at end of file diff --git a/lib/components/containers/SingleSidebarItem.js.map b/lib/components/containers/SingleSidebarItem.js.map new file mode 100644 index 000000000..0a6496c58 --- /dev/null +++ b/lib/components/containers/SingleSidebarItem.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/SingleSidebarItem.js"],"names":["SingleSidebarItem","props","children","Component","plotly_editor_traits","sidebar_element","propTypes","PropTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,iB;;;;;;;;;;;6BACV;AACP,aAAO,KAAKC,KAAL,CAAWC,QAAX,GACL;AAAA;AAAA,UAAK,WAAU,uBAAf;AAAwC,aAAKD,KAAL,CAAWC;AAAnD,OADK,GAEH,IAFJ;AAGD;;;;EAL4CC,gB;;kBAA1BH,iB;;;AAQrBA,kBAAkBI,oBAAlB,GAAyC,EAACC,iBAAiB,IAAlB,EAAzC;;AAEAL,kBAAkBM,SAAlB,GAA8B;AAC5BJ,YAAUK,oBAAUC;AADQ,CAA9B","file":"SingleSidebarItem.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nexport default class SingleSidebarItem extends Component {\n render() {\n return this.props.children ? (\n
{this.props.children}
\n ) : null;\n }\n}\n\nSingleSidebarItem.plotly_editor_traits = {sidebar_element: true};\n\nSingleSidebarItem.propTypes = {\n children: PropTypes.any,\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/SliderAccordion.js b/lib/components/containers/SliderAccordion.js new file mode 100644 index 000000000..803fe9a3c --- /dev/null +++ b/lib/components/containers/SliderAccordion.js @@ -0,0 +1,84 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _TraceRequiredPanel = require('./TraceRequiredPanel'); + +var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _context2 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var SliderFold = (0, _lib.connectSliderToLayout)(_PlotlyFold2.default); + +var SliderAccordion = function (_Component) { + _inherits(SliderAccordion, _Component); + + function SliderAccordion() { + _classCallCheck(this, SliderAccordion); + + return _possibleConstructorReturn(this, (SliderAccordion.__proto__ || Object.getPrototypeOf(SliderAccordion)).apply(this, arguments)); + } + + _createClass(SliderAccordion, [{ + key: 'render', + value: function render() { + var _context = this.context, + _context$layout$slide = _context.layout.sliders, + sliders = _context$layout$slide === undefined ? [] : _context$layout$slide, + _ = _context.localize; + var children = this.props.children; + + + var content = sliders.length > 0 && sliders.map(function (sli, i) { + return _react2.default.createElement( + SliderFold, + { key: i, sliderIndex: i, name: _('Slider') + (' ' + (i + 1)) }, + children + ); + }); + + return _react2.default.createElement( + _TraceRequiredPanel2.default, + null, + content ? content : null + ); + } + }]); + + return SliderAccordion; +}(_react.Component); + +SliderAccordion.contextType = _context2.EditorControlsContext; + +SliderAccordion.propTypes = { + children: _propTypes2.default.node +}; + +exports.default = SliderAccordion; +//# sourceMappingURL=SliderAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/SliderAccordion.js.map b/lib/components/containers/SliderAccordion.js.map new file mode 100644 index 000000000..0400537e6 --- /dev/null +++ b/lib/components/containers/SliderAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/SliderAccordion.js"],"names":["SliderFold","PlotlyFold","SliderAccordion","context","layout","sliders","_","localize","children","props","content","length","map","sli","i","Component","contextType","EditorControlsContext","propTypes","PropTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,aAAa,gCAAsBC,oBAAtB,CAAnB;;IAEMC,e;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,MAFK,CAEIC,OAFJ;AAAA,UAEIA,OAFJ,yCAEc,EAFd;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,UAKAC,QALA,GAKY,KAAKC,KALjB,CAKAD,QALA;;;AAOP,UAAME,UACJL,QAAQM,MAAR,GAAiB,CAAjB,IACAN,QAAQO,GAAR,CAAY,UAACC,GAAD,EAAMC,CAAN;AAAA,eACV;AAAC,oBAAD;AAAA,YAAY,KAAKA,CAAjB,EAAoB,aAAaA,CAAjC,EAAoC,MAAMR,EAAE,QAAF,YAAkBQ,IAAI,CAAtB,EAA1C;AACGN;AADH,SADU;AAAA,OAAZ,CAFF;;AAQA,aAAO;AAAC,oCAAD;AAAA;AAAqBE,kBAAUA,OAAV,GAAoB;AAAzC,OAAP;AACD;;;;EAjB2BK,gB;;AAoB9Bb,gBAAgBc,WAAhB,GAA8BC,+BAA9B;;AAEAf,gBAAgBgB,SAAhB,GAA4B;AAC1BV,YAAUW,oBAAUC;AADM,CAA5B;;kBAIelB,e","file":"SliderAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectSliderToLayout} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst SliderFold = connectSliderToLayout(PlotlyFold);\n\nclass SliderAccordion extends Component {\n render() {\n const {\n layout: {sliders = []},\n localize: _,\n } = this.context;\n const {children} = this.props;\n\n const content =\n sliders.length > 0 &&\n sliders.map((sli, i) => (\n \n {children}\n \n ));\n\n return {content ? content : null};\n }\n}\n\nSliderAccordion.contextType = EditorControlsContext;\n\nSliderAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default SliderAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/SubplotAccordion.js b/lib/components/containers/SubplotAccordion.js new file mode 100644 index 000000000..d641d84f3 --- /dev/null +++ b/lib/components/containers/SubplotAccordion.js @@ -0,0 +1,202 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _TraceRequiredPanel = require('./TraceRequiredPanel'); + +var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _constants = require('../../lib/constants'); + +var _context2 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TraceFold = (0, _lib.connectTraceToPlot)(_PlotlyFold2.default); +var NonCartesianSubplotFold = (0, _lib.connectNonCartesianSubplotToLayout)(_PlotlyFold2.default); +var CartesianSubplotFold = (0, _lib.connectCartesianSubplotToLayout)(_PlotlyFold2.default); + +var SubplotAccordion = function (_Component) { + _inherits(SubplotAccordion, _Component); + + function SubplotAccordion() { + _classCallCheck(this, SubplotAccordion); + + return _possibleConstructorReturn(this, (SubplotAccordion.__proto__ || Object.getPrototypeOf(SubplotAccordion)).apply(this, arguments)); + } + + _createClass(SubplotAccordion, [{ + key: 'render', + value: function render() { + var _context = this.context, + _context$data = _context.data, + data = _context$data === undefined ? [] : _context$data, + _context$layout = _context.layout, + layout = _context$layout === undefined ? {} : _context$layout, + _ = _context.localize; + var children = this.props.children; + + var subplotFolds = []; + + var allCartesianAxisCombinations = data.reduce(function (acc, curVal, inx) { + if (_constants.TRACE_TO_AXIS.cartesian.some(function (c) { + return c === curVal.type; + })) { + var xaxis = 'xaxis' + (curVal.xaxis ? curVal.xaxis.substring(1) : ''); + var yaxis = 'yaxis' + (curVal.yaxis ? curVal.yaxis.substring(1) : ''); + + var existingComboIndex = acc.findIndex(function (t) { + return t.xaxis === xaxis && t.yaxis === yaxis; + }); + if (existingComboIndex === -1) { + acc.push({ + xaxis: xaxis, + yaxis: yaxis, + xaxisName: curVal.xaxis ? (0, _lib.getSubplotTitle)(curVal.xaxis, 'x', _) : 'X 1', + yaxisName: curVal.yaxis ? (0, _lib.getSubplotTitle)(curVal.yaxis, 'y', _) : 'Y 1', + index: [inx] + }); + } else { + acc[existingComboIndex].index.push(inx); + } + } + return acc; + }, []); + + allCartesianAxisCombinations.forEach(function (d) { + return subplotFolds[d.index[0]] = _react2.default.createElement( + CartesianSubplotFold, + { + key: d.index[0], + traceIndexes: d.index, + canDelete: false, + xaxis: d.xaxis, + yaxis: d.yaxis, + name: d.xaxisName + ' | ' + d.yaxisName + }, + children + ); + }); + + // For each key in layout, find all traces that belong to this subplot. + // E.g. if layout attr is 'ternary', find all traces that are of type + // that has subplot ternary, if layout attr is 'ternary2', find traces + // of right type that have attr 'subplot': 'ternary' in their data. + + /** + Example: + { + "data": [ + { + "type": "scatterternary", + "mode": "markers", + }, + { + "type": "scatterternary", + "mode": "markers", + "subplot": "ternary2" + } + ], + "layout": { + "ternary": {}, + "ternary2": {}, + }, + } + */ + + Object.keys(layout).forEach(function (layoutKey) { + var traceIndexes = []; + var subplotName = void 0; + if (['geo', 'mapbox', 'polar', 'gl3d', 'ternary'].some(function (subplotType) { + subplotName = (0, _lib.getSubplotTitle)(layoutKey, subplotType, _); + var trIndex = _constants.SUBPLOT_TO_ATTR[subplotType].layout === layoutKey ? data.findIndex(function (trace) { + return _constants.TRACE_TO_AXIS[subplotType].some(function (tt) { + return tt === trace.type; + }); + }) : data.findIndex(function (trace) { + return trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === layoutKey; + }); + if (trIndex !== -1) { + traceIndexes.push(trIndex); + } + return layoutKey.startsWith(_constants.SUBPLOT_TO_ATTR[subplotType].layout); + })) { + subplotFolds[traceIndexes[0]] = _react2.default.createElement( + NonCartesianSubplotFold, + { + key: layoutKey, + traceIndexes: traceIndexes, + canDelete: false, + subplot: layoutKey, + name: subplotName + }, + children + ); + } + }); + + var pieCounter = 0; + var tableCounter = 0; + data.forEach(function (d, i) { + if (d.type === 'pie' && d.values || d.type === 'table') { + if (d.type === 'pie') { + pieCounter++; + } else if (d.type === 'table') { + tableCounter++; + } + subplotFolds[i] = _react2.default.createElement( + TraceFold, + { + key: i, + traceIndexes: [i], + canDelete: false, + name: d.type === 'pie' ? _('Pie') + ' ' + (pieCounter > 1 ? pieCounter : '') : _('Table') + ' ' + (tableCounter > 1 ? tableCounter : '') + }, + children + ); + } + }); + + return _react2.default.createElement( + _TraceRequiredPanel2.default, + null, + subplotFolds + ); + } + }]); + + return SubplotAccordion; +}(_react.Component); + +SubplotAccordion.contextType = _context2.EditorControlsContext; + +SubplotAccordion.propTypes = { + children: _propTypes2.default.node +}; + +exports.default = SubplotAccordion; +//# sourceMappingURL=SubplotAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/SubplotAccordion.js.map b/lib/components/containers/SubplotAccordion.js.map new file mode 100644 index 000000000..8f96534a1 --- /dev/null +++ b/lib/components/containers/SubplotAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/SubplotAccordion.js"],"names":["TraceFold","PlotlyFold","NonCartesianSubplotFold","CartesianSubplotFold","SubplotAccordion","context","data","layout","_","localize","children","props","subplotFolds","allCartesianAxisCombinations","reduce","acc","curVal","inx","TRACE_TO_AXIS","cartesian","some","c","type","xaxis","substring","yaxis","existingComboIndex","findIndex","t","push","xaxisName","yaxisName","index","forEach","d","Object","keys","traceIndexes","subplotName","layoutKey","subplotType","trIndex","SUBPLOT_TO_ATTR","tt","trace","startsWith","pieCounter","tableCounter","i","values","Component","contextType","EditorControlsContext","propTypes","PropTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AAMA;;AACA;;;;;;;;;;AAEA,IAAMA,YAAY,6BAAmBC,oBAAnB,CAAlB;AACA,IAAMC,0BAA0B,6CAAmCD,oBAAnC,CAAhC;AACA,IAAME,uBAAuB,0CAAgCF,oBAAhC,CAA7B;;IAEMG,gB;;;;;;;;;;;6BACK;AAAA,qBACuC,KAAKC,OAD5C;AAAA,mCACAC,IADA;AAAA,UACAA,IADA,iCACO,EADP;AAAA,qCACWC,MADX;AAAA,UACWA,MADX,mCACoB,EADpB;AAAA,UACkCC,CADlC,YACwBC,QADxB;AAAA,UAEAC,QAFA,GAEY,KAAKC,KAFjB,CAEAD,QAFA;;AAGP,UAAME,eAAe,EAArB;;AAEA,UAAMC,+BAA+BP,KAAKQ,MAAL,CAAY,UAACC,GAAD,EAAMC,MAAN,EAAcC,GAAd,EAAsB;AACrE,YAAIC,yBAAcC,SAAd,CAAwBC,IAAxB,CAA6B;AAAA,iBAAKC,MAAML,OAAOM,IAAlB;AAAA,SAA7B,CAAJ,EAA0D;AACxD,cAAMC,QAAQ,WAAWP,OAAOO,KAAP,GAAeP,OAAOO,KAAP,CAAaC,SAAb,CAAuB,CAAvB,CAAf,GAA2C,EAAtD,CAAd;AACA,cAAMC,QAAQ,WAAWT,OAAOS,KAAP,GAAeT,OAAOS,KAAP,CAAaD,SAAb,CAAuB,CAAvB,CAAf,GAA2C,EAAtD,CAAd;;AAEA,cAAME,qBAAqBX,IAAIY,SAAJ,CAAc;AAAA,mBAAKC,EAAEL,KAAF,KAAYA,KAAZ,IAAqBK,EAAEH,KAAF,KAAYA,KAAtC;AAAA,WAAd,CAA3B;AACA,cAAIC,uBAAuB,CAAC,CAA5B,EAA+B;AAC7BX,gBAAIc,IAAJ,CAAS;AACPN,qBAAOA,KADA;AAEPE,qBAAOA,KAFA;AAGPK,yBAAW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UGrC;AAVH,WADF;AAcD;AACF,OAtBD;;AAwBA,aAAO;AAAC,oCAAD;AAAA;AAAqBE;AAArB,OAAP;AACD;;;;EA9H4BsC,gB;;AAiI/B9C,iBAAiB+C,WAAjB,GAA+BC,+BAA/B;;AAEAhD,iBAAiBiD,SAAjB,GAA6B;AAC3B3C,YAAU4C,oBAAUC;AADO,CAA7B;;kBAIenD,gB","file":"SubplotAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {\n connectTraceToPlot,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n getSubplotTitle,\n} from 'lib';\nimport {TRACE_TO_AXIS, SUBPLOT_TO_ATTR} from 'lib/constants';\nimport {EditorControlsContext} from '../../context';\n\nconst TraceFold = connectTraceToPlot(PlotlyFold);\nconst NonCartesianSubplotFold = connectNonCartesianSubplotToLayout(PlotlyFold);\nconst CartesianSubplotFold = connectCartesianSubplotToLayout(PlotlyFold);\n\nclass SubplotAccordion extends Component {\n render() {\n const {data = [], layout = {}, localize: _} = this.context;\n const {children} = this.props;\n const subplotFolds = [];\n\n const allCartesianAxisCombinations = data.reduce((acc, curVal, inx) => {\n if (TRACE_TO_AXIS.cartesian.some(c => c === curVal.type)) {\n const xaxis = 'xaxis' + (curVal.xaxis ? curVal.xaxis.substring(1) : '');\n const yaxis = 'yaxis' + (curVal.yaxis ? curVal.yaxis.substring(1) : '');\n\n const existingComboIndex = acc.findIndex(t => t.xaxis === xaxis && t.yaxis === yaxis);\n if (existingComboIndex === -1) {\n acc.push({\n xaxis: xaxis,\n yaxis: yaxis,\n xaxisName: curVal.xaxis ? getSubplotTitle(curVal.xaxis, 'x', _) : 'X 1',\n yaxisName: curVal.yaxis ? getSubplotTitle(curVal.yaxis, 'y', _) : 'Y 1',\n index: [inx],\n });\n } else {\n acc[existingComboIndex].index.push(inx);\n }\n }\n return acc;\n }, []);\n\n allCartesianAxisCombinations.forEach(\n d =>\n (subplotFolds[d.index[0]] = (\n \n {children}\n \n ))\n );\n\n // For each key in layout, find all traces that belong to this subplot.\n // E.g. if layout attr is 'ternary', find all traces that are of type\n // that has subplot ternary, if layout attr is 'ternary2', find traces\n // of right type that have attr 'subplot': 'ternary' in their data.\n\n /**\n Example: \n {\n \"data\": [\n {\n \"type\": \"scatterternary\",\n \"mode\": \"markers\",\n },\n {\n \"type\": \"scatterternary\",\n \"mode\": \"markers\",\n \"subplot\": \"ternary2\"\n }\n ],\n \"layout\": {\n \"ternary\": {},\n \"ternary2\": {},\n },\n }\n */\n\n Object.keys(layout).forEach(layoutKey => {\n const traceIndexes = [];\n let subplotName;\n if (\n ['geo', 'mapbox', 'polar', 'gl3d', 'ternary'].some(subplotType => {\n subplotName = getSubplotTitle(layoutKey, subplotType, _);\n const trIndex =\n SUBPLOT_TO_ATTR[subplotType].layout === layoutKey\n ? data.findIndex(trace => TRACE_TO_AXIS[subplotType].some(tt => tt === trace.type))\n : data.findIndex(trace => trace[SUBPLOT_TO_ATTR[subplotType].data] === layoutKey);\n if (trIndex !== -1) {\n traceIndexes.push(trIndex);\n }\n return layoutKey.startsWith(SUBPLOT_TO_ATTR[subplotType].layout);\n })\n ) {\n subplotFolds[traceIndexes[0]] = (\n \n {children}\n \n );\n }\n });\n\n let pieCounter = 0;\n let tableCounter = 0;\n data.forEach((d, i) => {\n if ((d.type === 'pie' && d.values) || d.type === 'table') {\n if (d.type === 'pie') {\n pieCounter++;\n } else if (d.type === 'table') {\n tableCounter++;\n }\n subplotFolds[i] = (\n 1 ? pieCounter : ''}`\n : `${_('Table')} ${tableCounter > 1 ? tableCounter : ''}`\n }\n >\n {children}\n \n );\n }\n });\n\n return {subplotFolds};\n }\n}\n\nSubplotAccordion.contextType = EditorControlsContext;\n\nSubplotAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default SubplotAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TraceAccordion.js b/lib/components/containers/TraceAccordion.js new file mode 100644 index 000000000..1edf7d4c4 --- /dev/null +++ b/lib/components/containers/TraceAccordion.js @@ -0,0 +1,312 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _TraceRequiredPanel = require('./TraceRequiredPanel'); + +var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); + +var _PlotlyPanel = require('./PlotlyPanel'); + +var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _constants = require('../../lib/constants'); + +var _lib = require('../../lib'); + +var _reactTabs = require('react-tabs'); + +var _traceTypes = require('../../lib/traceTypes'); + +var _PanelEmpty = require('./PanelEmpty'); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TraceFold = (0, _lib.connectTraceToPlot)(_PlotlyFold2.default); + +var TraceAccordion = function (_Component) { + _inherits(TraceAccordion, _Component); + + function TraceAccordion(props, context) { + _classCallCheck(this, TraceAccordion); + + var _this = _possibleConstructorReturn(this, (TraceAccordion.__proto__ || Object.getPrototypeOf(TraceAccordion)).call(this, props, context)); + + _this.setLocals(props, context); + return _this; + } + + _createClass(TraceAccordion, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var _this2 = this; + + var base = props.canGroup ? context.fullData : context.data; + var traceFilterCondition = this.props.traceFilterCondition || function () { + return true; + }; + + this.filteredTracesDataIndexes = []; + this.filteredTraces = []; + + if (base && base.length && context.fullData.length) { + this.filteredTraces = base.filter(function (t, i) { + var fullTrace = props.canGroup ? t : context.fullData.filter(function (tr) { + return tr.index === i; + })[0]; + + if (fullTrace) { + var trace = context.data[fullTrace.index]; + if (traceFilterCondition(trace, fullTrace)) { + _this2.filteredTracesDataIndexes.push(fullTrace.index); + return true; + } + } + + return false; + }); + } + } + }, { + key: 'renderGroupedTraceFolds', + value: function renderGroupedTraceFolds() { + var _this3 = this; + + if (!this.filteredTraces.length || this.filteredTraces.length <= 1) { + return null; + } + + var _ = this.context.localize; + + var dataArrayPositionsByTraceType = {}; + var fullDataArrayPositionsByTraceType = {}; + + this.filteredTraces.forEach(function (trace) { + var traceType = (0, _lib.plotlyTraceToCustomTrace)(trace); + if (!dataArrayPositionsByTraceType[traceType]) { + dataArrayPositionsByTraceType[traceType] = []; + } + + if (!fullDataArrayPositionsByTraceType[traceType]) { + fullDataArrayPositionsByTraceType[traceType] = []; + } + + dataArrayPositionsByTraceType[traceType].push(trace.index); + // _expandedIndex is the trace's index in the fullData array + fullDataArrayPositionsByTraceType[traceType].push(trace._expandedIndex); + }); + + return Object.keys(fullDataArrayPositionsByTraceType).map(function (type, index) { + return _react2.default.createElement( + TraceFold, + { + key: index, + traceIndexes: dataArrayPositionsByTraceType[type], + name: (0, _traceTypes.traceTypes)(_).find(function (t) { + return t.value === type; + }).label, + fullDataArrayPosition: fullDataArrayPositionsByTraceType[type] + }, + _this3.props.children + ); + }); + } + }, { + key: 'renderUngroupedTraceFolds', + value: function renderUngroupedTraceFolds() { + var _this4 = this; + + if (this.filteredTraces.length) { + return this.filteredTraces.map(function (d, i) { + return _react2.default.createElement( + TraceFold, + { + key: i, + traceIndexes: [d.index], + canDelete: _this4.props.canAdd, + fullDataArrayPosition: [d._expandedIndex] + }, + _this4.props.children + ); + }); + } + return null; + } + }, { + key: 'renderTraceFolds', + value: function renderTraceFolds() { + var _this5 = this; + + if (this.filteredTraces.length) { + return this.filteredTraces.map(function (d, i) { + return _react2.default.createElement( + TraceFold, + { + key: i, + traceIndexes: [_this5.filteredTracesDataIndexes[i]], + canDelete: _this5.props.canAdd + }, + _this5.props.children + ); + }); + } + return null; + } + }, { + key: 'renderTracePanelHelp', + value: function renderTracePanelHelp() { + var _ = this.context.localize; + return _react2.default.createElement( + _PanelEmpty.PanelMessage, + { heading: _('Trace your data.') }, + _react2.default.createElement( + 'p', + null, + _('Traces of various types like bar and line are the building blocks of your figure.') + ), + _react2.default.createElement( + 'p', + null, + _('You can add as many as you like, mixing and matching types and arranging them into subplots.') + ), + _react2.default.createElement( + 'p', + null, + _('Click on the + button above to add a trace.') + ) + ); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + canAdd = _props.canAdd, + canGroup = _props.canGroup; + + var _ = this.context.localize; + + if (canAdd) { + var addAction = { + label: _('Trace'), + handler: function handler(_ref) { + var onUpdate = _ref.onUpdate; + + if (onUpdate) { + onUpdate({ + type: _constants.EDITOR_ACTIONS.ADD_TRACE + }); + } + } + }; + var traceFolds = this.renderTraceFolds(); + return _react2.default.createElement( + _PlotlyPanel2.default, + { addAction: addAction }, + traceFolds ? traceFolds : this.renderTracePanelHelp() + ); + } + + if (canGroup) { + if (this.filteredTraces.length === 1) { + return _react2.default.createElement( + _TraceRequiredPanel2.default, + null, + this.renderUngroupedTraceFolds() + ); + } + + if (this.filteredTraces.length > 1) { + return _react2.default.createElement( + _TraceRequiredPanel2.default, + { noPadding: true }, + _react2.default.createElement( + _reactTabs.Tabs, + null, + _react2.default.createElement( + _reactTabs.TabList, + null, + _react2.default.createElement( + _reactTabs.Tab, + null, + _('Individually') + ), + _react2.default.createElement( + _reactTabs.Tab, + null, + _('By Type') + ) + ), + _react2.default.createElement( + _reactTabs.TabPanel, + null, + _react2.default.createElement( + _PlotlyPanel2.default, + null, + this.renderUngroupedTraceFolds() + ) + ), + _react2.default.createElement( + _reactTabs.TabPanel, + null, + _react2.default.createElement( + _PlotlyPanel2.default, + null, + this.renderGroupedTraceFolds() + ) + ) + ) + ); + } + } + + return _react2.default.createElement( + _TraceRequiredPanel2.default, + null, + this.renderTraceFolds() + ); + } + }]); + + return TraceAccordion; +}(_react.Component); + +TraceAccordion.contextType = _context.EditorControlsContext; + +TraceAccordion.propTypes = { + canAdd: _propTypes2.default.bool, + canGroup: _propTypes2.default.bool, + children: _propTypes2.default.node, + traceFilterCondition: _propTypes2.default.func +}; + +exports.default = TraceAccordion; +//# sourceMappingURL=TraceAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/TraceAccordion.js.map b/lib/components/containers/TraceAccordion.js.map new file mode 100644 index 000000000..91910dce5 --- /dev/null +++ b/lib/components/containers/TraceAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/TraceAccordion.js"],"names":["TraceFold","PlotlyFold","TraceAccordion","props","context","setLocals","nextProps","nextContext","base","canGroup","fullData","data","traceFilterCondition","filteredTracesDataIndexes","filteredTraces","length","filter","t","i","fullTrace","tr","index","trace","push","_","localize","dataArrayPositionsByTraceType","fullDataArrayPositionsByTraceType","forEach","traceType","_expandedIndex","Object","keys","map","type","find","value","label","children","d","canAdd","addAction","handler","onUpdate","EDITOR_ACTIONS","ADD_TRACE","traceFolds","renderTraceFolds","renderTracePanelHelp","renderUngroupedTraceFolds","renderGroupedTraceFolds","Component","contextType","EditorControlsContext","propTypes","PropTypes","bool","node","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,YAAY,6BAAmBC,oBAAnB,CAAlB;;IAEMC,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAE1B,UAAKC,SAAL,CAAeF,KAAf,EAAsBC,OAAtB;AAF0B;AAG3B;;;;8CAEyBE,S,EAAWC,W,EAAa;AAChD,WAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;;;8BAESJ,K,EAAOC,O,EAAS;AAAA;;AACxB,UAAMI,OAAOL,MAAMM,QAAN,GAAiBL,QAAQM,QAAzB,GAAoCN,QAAQO,IAAzD;AACA,UAAMC,uBAAuB,KAAKT,KAAL,CAAWS,oBAAX,IAAoC;AAAA,eAAM,IAAN;AAAA,OAAjE;;AAEA,WAAKC,yBAAL,GAAiC,EAAjC;AACA,WAAKC,cAAL,GAAsB,EAAtB;;AAEA,UAAIN,QAAQA,KAAKO,MAAb,IAAuBX,QAAQM,QAAR,CAAiBK,MAA5C,EAAoD;AAClD,aAAKD,cAAL,GAAsBN,KAAKQ,MAAL,CAAY,UAACC,CAAD,EAAIC,CAAJ,EAAU;AAC1C,cAAMC,YAAYhB,MAAMM,QAAN,GAAiBQ,CAAjB,GAAqBb,QAAQM,QAAR,CAAiBM,MAAjB,CAAwB;AAAA,mBAAMI,GAAGC,KAAH,KAAaH,CAAnB;AAAA,WAAxB,EAA8C,CAA9C,CAAvC;;AAEA,cAAIC,SAAJ,EAAe;AACb,gBAAMG,QAAQlB,QAAQO,IAAR,CAAa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,GAA2B;AACzBd,UAAQe,oBAAUC,IADO;AAEzB/C,YAAU8C,oBAAUC,IAFK;AAGzBlB,YAAUiB,oBAAUE,IAHK;AAIzB7C,wBAAsB2C,oBAAUG;AAJP,CAA3B;;kBAOexD,c","file":"TraceAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PlotlyPanel from './PlotlyPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {EDITOR_ACTIONS} from 'lib/constants';\nimport {connectTraceToPlot, plotlyTraceToCustomTrace} from 'lib';\nimport {Tab, Tabs, TabList, TabPanel} from 'react-tabs';\nimport {traceTypes} from 'lib/traceTypes';\nimport {PanelMessage} from './PanelEmpty';\nimport {EditorControlsContext} from '../../context';\n\nconst TraceFold = connectTraceToPlot(PlotlyFold);\n\nclass TraceAccordion extends Component {\n constructor(props, context) {\n super(props, context);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const base = props.canGroup ? context.fullData : context.data;\n const traceFilterCondition = this.props.traceFilterCondition || (() => true);\n\n this.filteredTracesDataIndexes = [];\n this.filteredTraces = [];\n\n if (base && base.length && context.fullData.length) {\n this.filteredTraces = base.filter((t, i) => {\n const fullTrace = props.canGroup ? t : context.fullData.filter(tr => tr.index === i)[0];\n\n if (fullTrace) {\n const trace = context.data[fullTrace.index];\n if (traceFilterCondition(trace, fullTrace)) {\n this.filteredTracesDataIndexes.push(fullTrace.index);\n return true;\n }\n }\n\n return false;\n });\n }\n }\n\n renderGroupedTraceFolds() {\n if (!this.filteredTraces.length || this.filteredTraces.length <= 1) {\n return null;\n }\n\n const {localize: _} = this.context;\n const dataArrayPositionsByTraceType = {};\n const fullDataArrayPositionsByTraceType = {};\n\n this.filteredTraces.forEach(trace => {\n const traceType = plotlyTraceToCustomTrace(trace);\n if (!dataArrayPositionsByTraceType[traceType]) {\n dataArrayPositionsByTraceType[traceType] = [];\n }\n\n if (!fullDataArrayPositionsByTraceType[traceType]) {\n fullDataArrayPositionsByTraceType[traceType] = [];\n }\n\n dataArrayPositionsByTraceType[traceType].push(trace.index);\n // _expandedIndex is the trace's index in the fullData array\n fullDataArrayPositionsByTraceType[traceType].push(trace._expandedIndex);\n });\n\n return Object.keys(fullDataArrayPositionsByTraceType).map((type, index) => (\n t.value === type).label}\n fullDataArrayPosition={fullDataArrayPositionsByTraceType[type]}\n >\n {this.props.children}\n \n ));\n }\n\n renderUngroupedTraceFolds() {\n if (this.filteredTraces.length) {\n return this.filteredTraces.map((d, i) => (\n \n {this.props.children}\n \n ));\n }\n return null;\n }\n\n renderTraceFolds() {\n if (this.filteredTraces.length) {\n return this.filteredTraces.map((d, i) => (\n \n {this.props.children}\n \n ));\n }\n return null;\n }\n\n renderTracePanelHelp() {\n const _ = this.context.localize;\n return (\n \n

\n {_('Traces of various types like bar and line are the building blocks of your figure.')}\n

\n

\n {_(\n 'You can add as many as you like, mixing and matching types and arranging them into subplots.'\n )}\n

\n

{_('Click on the + button above to add a trace.')}

\n
\n );\n }\n\n render() {\n const {canAdd, canGroup} = this.props;\n const _ = this.context.localize;\n\n if (canAdd) {\n const addAction = {\n label: _('Trace'),\n handler: ({onUpdate}) => {\n if (onUpdate) {\n onUpdate({\n type: EDITOR_ACTIONS.ADD_TRACE,\n });\n }\n },\n };\n const traceFolds = this.renderTraceFolds();\n return (\n \n {traceFolds ? traceFolds : this.renderTracePanelHelp()}\n \n );\n }\n\n if (canGroup) {\n if (this.filteredTraces.length === 1) {\n return {this.renderUngroupedTraceFolds()};\n }\n\n if (this.filteredTraces.length > 1) {\n return (\n \n \n \n {_('Individually')}\n {_('By Type')}\n \n \n {this.renderUngroupedTraceFolds()}\n \n \n {this.renderGroupedTraceFolds()}\n \n \n \n );\n }\n }\n\n return {this.renderTraceFolds()};\n }\n}\n\nTraceAccordion.contextType = EditorControlsContext;\n\nTraceAccordion.propTypes = {\n canAdd: PropTypes.bool,\n canGroup: PropTypes.bool,\n children: PropTypes.node,\n traceFilterCondition: PropTypes.func,\n};\n\nexport default TraceAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TraceMarkerSection.js b/lib/components/containers/TraceMarkerSection.js new file mode 100644 index 000000000..6d3a60b31 --- /dev/null +++ b/lib/components/containers/TraceMarkerSection.js @@ -0,0 +1,84 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlySection = require('./PlotlySection'); + +var _PlotlySection2 = _interopRequireDefault(_PlotlySection); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TraceMarkerSection = function (_Component) { + _inherits(TraceMarkerSection, _Component); + + function TraceMarkerSection(props, context) { + _classCallCheck(this, TraceMarkerSection); + + var _this = _possibleConstructorReturn(this, (TraceMarkerSection.__proto__ || Object.getPrototypeOf(TraceMarkerSection)).call(this, props, context)); + + _this.setLocals(context); + return _this; + } + + _createClass(TraceMarkerSection, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(context) { + var _ = this.context.localize; + var traceType = context.fullContainer.type; + if (['bar', 'histogram'].includes(traceType)) { + this.name = _('Bars'); + } else if (traceType === 'pie') { + this.name = _('Pie Segments'); + } else { + this.name = _('Points'); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + _PlotlySection2.default, + { name: this.name }, + this.props.children + ); + } + }]); + + return TraceMarkerSection; +}(_react.Component); + +TraceMarkerSection.propTypes = { + children: _propTypes2.default.node, + name: _propTypes2.default.string +}; + +TraceMarkerSection.contextTypes = { + fullContainer: _propTypes2.default.object, + localize: _propTypes2.default.func +}; + +exports.default = TraceMarkerSection; +//# sourceMappingURL=TraceMarkerSection.js.map \ No newline at end of file diff --git a/lib/components/containers/TraceMarkerSection.js.map b/lib/components/containers/TraceMarkerSection.js.map new file mode 100644 index 000000000..72e9e31d8 --- /dev/null +++ b/lib/components/containers/TraceMarkerSection.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/TraceMarkerSection.js"],"names":["TraceMarkerSection","props","context","setLocals","nextProps","nextContext","_","localize","traceType","fullContainer","type","includes","name","children","Component","propTypes","PropTypes","node","string","contextTypes","object","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,kB;;;AACJ,8BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,wIACpBD,KADoB,EACbC,OADa;;AAE1B,UAAKC,SAAL,CAAeD,OAAf;AAF0B;AAG3B;;;;8CAEyBE,S,EAAWC,W,EAAa;AAChD,WAAKF,SAAL,CAAeE,WAAf;AACD;;;8BAESH,O,EAAS;AACjB,UAAMI,IAAI,KAAKJ,OAAL,CAAaK,QAAvB;AACA,UAAMC,YAAYN,QAAQO,aAAR,CAAsBC,IAAxC;AACA,UAAI,CAAC,KAAD,EAAQ,WAAR,EAAqBC,QAArB,CAA8BH,SAA9B,CAAJ,EAA8C;AAC5C,aAAKI,IAAL,GAAYN,EAAE,MAAF,CAAZ;AACD,OAFD,MAEO,IAAIE,cAAc,KAAlB,EAAyB;AAC9B,aAAKI,IAAL,GAAYN,EAAE,cAAF,CAAZ;AACD,OAFM,MAEA;AACL,aAAKM,IAAL,GAAYN,EAAE,QAAF,CAAZ;AACD;AACF;;;6BAEQ;AACP,aAAO;AAAC,+BAAD;AAAA,UAAe,MAAM,KAAKM,IAA1B;AAAiC,aAAKX,KAAL,CAAWY;AAA5C,OAAP;AACD;;;;EAxB8BC,gB;;AA2BjCd,mBAAmBe,SAAnB,GAA+B;AAC7BF,YAAUG,oBAAUC,IADS;AAE7BL,QAAMI,oBAAUE;AAFa,CAA/B;;AAKAlB,mBAAmBmB,YAAnB,GAAkC;AAChCV,iBAAeO,oBAAUI,MADO;AAEhCb,YAAUS,oBAAUK;AAFY,CAAlC;;kBAKerB,kB","file":"TraceMarkerSection.js","sourcesContent":["import PlotlySection from './PlotlySection';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nclass TraceMarkerSection extends Component {\n constructor(props, context) {\n super(props, context);\n this.setLocals(context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextContext);\n }\n\n setLocals(context) {\n const _ = this.context.localize;\n const traceType = context.fullContainer.type;\n if (['bar', 'histogram'].includes(traceType)) {\n this.name = _('Bars');\n } else if (traceType === 'pie') {\n this.name = _('Pie Segments');\n } else {\n this.name = _('Points');\n }\n }\n\n render() {\n return {this.props.children};\n }\n}\n\nTraceMarkerSection.propTypes = {\n children: PropTypes.node,\n name: PropTypes.string,\n};\n\nTraceMarkerSection.contextTypes = {\n fullContainer: PropTypes.object,\n localize: PropTypes.func,\n};\n\nexport default TraceMarkerSection;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TraceRequiredPanel.js b/lib/components/containers/TraceRequiredPanel.js new file mode 100644 index 000000000..46e0dca70 --- /dev/null +++ b/lib/components/containers/TraceRequiredPanel.js @@ -0,0 +1,110 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PanelEmpty = require('./PanelEmpty'); + +var _PanelEmpty2 = _interopRequireDefault(_PanelEmpty); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _derived = require('./derived'); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TraceRequiredPanel = function (_Component) { + _inherits(TraceRequiredPanel, _Component); + + function TraceRequiredPanel() { + _classCallCheck(this, TraceRequiredPanel); + + return _possibleConstructorReturn(this, (TraceRequiredPanel.__proto__ || Object.getPrototypeOf(TraceRequiredPanel)).apply(this, arguments)); + } + + _createClass(TraceRequiredPanel, [{ + key: 'hasTrace', + value: function hasTrace() { + return this.context.fullData.filter(function (trace) { + return trace.visible; + }).length > 0; + } + }, { + key: 'render', + value: function render() { + var _ = this.context.localize; + + var _props = this.props, + children = _props.children, + rest = _objectWithoutProperties(_props, ['children']); + + if (!this.props.visible) { + return null; + } + + return this.hasTrace() ? _react2.default.createElement( + _derived.LayoutPanel, + rest, + children + ) : _react2.default.createElement( + _context.ModalProviderContext.Consumer, + null, + function (_ref) { + var setPanel = _ref.setPanel; + return _react2.default.createElement( + _PanelEmpty2.default, + { heading: _("Looks like there aren't any traces defined yet.") }, + _react2.default.createElement( + 'p', + null, + _('Go to the '), + _react2.default.createElement( + 'a', + { onClick: function onClick() { + return setPanel('Structure', 'Traces'); + } }, + _('Traces') + ), + _(' panel under Structure to define traces.') + ) + ); + } + ); + } + }]); + + return TraceRequiredPanel; +}(_react.Component); + +TraceRequiredPanel.propTypes = { + children: _propTypes2.default.node, + visible: _propTypes2.default.bool +}; + +TraceRequiredPanel.defaultProps = { + visible: true +}; + +TraceRequiredPanel.contextType = _context.EditorControlsContext; + +exports.default = TraceRequiredPanel; +//# sourceMappingURL=TraceRequiredPanel.js.map \ No newline at end of file diff --git a/lib/components/containers/TraceRequiredPanel.js.map b/lib/components/containers/TraceRequiredPanel.js.map new file mode 100644 index 000000000..a43fd4687 --- /dev/null +++ b/lib/components/containers/TraceRequiredPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/TraceRequiredPanel.js"],"names":["TraceRequiredPanel","context","fullData","filter","trace","visible","length","_","localize","props","children","rest","hasTrace","setPanel","Component","propTypes","PropTypes","node","bool","defaultProps","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;IAEMA,kB;;;;;;;;;;;+BACO;AACT,aAAO,KAAKC,OAAL,CAAaC,QAAb,CAAsBC,MAAtB,CAA6B;AAAA,eAASC,MAAMC,OAAf;AAAA,OAA7B,EAAqDC,MAArD,GAA8D,CAArE;AACD;;;6BAEQ;AAAA,UACUC,CADV,GACe,KAAKN,OADpB,CACAO,QADA;;AAAA,mBAEqB,KAAKC,KAF1B;AAAA,UAEAC,QAFA,UAEAA,QAFA;AAAA,UAEaC,IAFb;;AAIP,UAAI,CAAC,KAAKF,KAAL,CAAWJ,OAAhB,EAAyB;AACvB,eAAO,IAAP;AACD;;AAED,aAAO,KAAKO,QAAL,KACL;AAAC,4BAAD;AAAiBD,YAAjB;AAAwBD;AAAxB,OADK,GAGL;AAAC,qCAAD,CAAsB,QAAtB;AAAA;AACG;AAAA,cAAEG,QAAF,QAAEA,QAAF;AAAA,iBACC;AAAC,gCAAD;AAAA,cAAY,SAASN,EAAE,iDAAF,CAArB;AACE;AAAA;AAAA;AACGA,gBAAE,YAAF,CADH;AAEE;AAAA;AAAA,kBAAG,SAAS;AAAA,2BAAMM,SAAS,WAAT,EAAsB,QAAtB,CAAN;AAAA,mBAAZ;AAAoDN,kBAAE,QAAF;AAApD,eAFF;AAGGA,gBAAE,0CAAF;AAHH;AADF,WADD;AAAA;AADH,OAHF;AAeD;;;;EA5B8BO,gB;;AA+BjCd,mBAAmBe,SAAnB,GAA+B;AAC7BL,YAAUM,oBAAUC,IADS;AAE7BZ,WAASW,oBAAUE;AAFU,CAA/B;;AAKAlB,mBAAmBmB,YAAnB,GAAkC;AAChCd,WAAS;AADuB,CAAlC;;AAIAL,mBAAmBoB,WAAnB,GAAiCC,8BAAjC;;kBAEerB,kB","file":"TraceRequiredPanel.js","sourcesContent":["import PanelEmpty from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {LayoutPanel} from './derived';\nimport {EditorControlsContext, ModalProviderContext} from '../../context';\n\nclass TraceRequiredPanel extends Component {\n hasTrace() {\n return this.context.fullData.filter(trace => trace.visible).length > 0;\n }\n\n render() {\n const {localize: _} = this.context;\n const {children, ...rest} = this.props;\n\n if (!this.props.visible) {\n return null;\n }\n\n return this.hasTrace() ? (\n {children}\n ) : (\n \n {({setPanel}) => (\n \n

\n {_('Go to the ')}\n setPanel('Structure', 'Traces')}>{_('Traces')}\n {_(' panel under Structure to define traces.')}\n

\n
\n )}\n
\n );\n }\n}\n\nTraceRequiredPanel.propTypes = {\n children: PropTypes.node,\n visible: PropTypes.bool,\n};\n\nTraceRequiredPanel.defaultProps = {\n visible: true,\n};\n\nTraceRequiredPanel.contextType = EditorControlsContext;\n\nexport default TraceRequiredPanel;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TransformAccordion.js b/lib/components/containers/TransformAccordion.js new file mode 100644 index 000000000..2af171a20 --- /dev/null +++ b/lib/components/containers/TransformAccordion.js @@ -0,0 +1,223 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _PlotlyPanel = require('./PlotlyPanel'); + +var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _PanelEmpty = require('./PanelEmpty'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TransformFold = (0, _lib.connectTransformToTrace)(_PlotlyFold2.default); + +var TransformAccordion = function (_Component) { + _inherits(TransformAccordion, _Component); + + function TransformAccordion() { + _classCallCheck(this, TransformAccordion); + + return _possibleConstructorReturn(this, (TransformAccordion.__proto__ || Object.getPrototypeOf(TransformAccordion)).apply(this, arguments)); + } + + _createClass(TransformAccordion, [{ + key: 'render', + value: function render() { + var _context = this.context, + _context$fullContaine = _context.fullContainer.transforms, + transforms = _context$fullContaine === undefined ? [] : _context$fullContaine, + _ = _context.localize, + container = _context.container, + dataSourceOptions = _context.dataSourceOptions; + var children = this.props.children; + + + var transformTypes = [{ label: _('Filter'), type: 'filter' }, { label: _('Split'), type: 'groupby' }, { label: _('Aggregate'), type: 'aggregate' }, { label: _('Sort'), type: 'sort' }]; + + var transformBy = container.transforms && container.transforms.map(function (tr) { + var foldNameSuffix = ''; + if (tr.groupssrc) { + var groupssrc = dataSourceOptions && dataSourceOptions.find(function (d) { + return d.value === tr.groupssrc; + }); + foldNameSuffix = ': ' + (groupssrc && groupssrc.label ? groupssrc.label : tr.groupssrc); + } else if (tr.targetsrc) { + var targetsrc = dataSourceOptions && dataSourceOptions.find(function (d) { + return d.value === tr.targetsrc; + }); + foldNameSuffix = ': ' + (targetsrc && targetsrc.label ? targetsrc.label : tr.targetsrc); + } + return foldNameSuffix; + }); + + var filteredTransforms = transforms.filter(function (_ref) { + var type = _ref.type; + return Boolean(type); + }); + var content = filteredTransforms.length && filteredTransforms.map(function (tr, i) { + return _react2.default.createElement( + TransformFold, + { + key: i, + transformIndex: i, + name: '' + transformTypes.filter(function (_ref2) { + var type = _ref2.type; + return type === tr.type; + })[0].label + (transformBy && transformBy[i]), + canDelete: true + }, + children + ); + }); + + // cannot have 2 Split transforms on one trace: + // https://github.com/plotly/plotly.js/issues/1742 + var addActionOptions = container.transforms && container.transforms.some(function (t) { + return t.type === 'groupby'; + }) ? transformTypes.filter(function (t) { + return t.type !== 'groupby'; + }) : transformTypes; + + var addAction = { + label: _('Transform'), + handler: addActionOptions.map(function (_ref3) { + var label = _ref3.label, + type = _ref3.type; + + return { + label: label, + handler: function handler(context) { + var fullContainer = context.fullContainer, + updateContainer = context.updateContainer; + + if (updateContainer) { + var transformIndex = Array.isArray(fullContainer.transforms) ? fullContainer.transforms.length : 0; + var key = 'transforms[' + transformIndex + ']'; + + var payload = { type: type }; + if (type === 'filter') { + payload.target = []; + payload.targetsrc = null; + } else { + payload.groupssrc = null; + payload.groups = null; + } + + if (type === 'groupby') { + payload.styles = []; + } + + updateContainer(_defineProperty({}, key, payload)); + } + } + }; + }) + }; + + return _react2.default.createElement( + _PlotlyPanel2.default, + { addAction: addAction }, + content ? content : _react2.default.createElement( + _PanelEmpty.PanelMessage, + { icon: null }, + _react2.default.createElement( + 'div', + { style: { textAlign: 'left' } }, + _react2.default.createElement( + 'p', + null, + _react2.default.createElement( + 'strong', + null, + _('Filter') + ), + ' ', + _(' transforms allow you to filter data out from a trace.') + ), + _react2.default.createElement( + 'p', + null, + _react2.default.createElement( + 'strong', + null, + _('Split') + ), + ' ', + _(' transforms allow you to create multiple traces from one source trace, so as to style them differently.') + ), + _react2.default.createElement( + 'p', + null, + _react2.default.createElement( + 'strong', + null, + _('Aggregate') + ), + ' ', + _(' transforms allow you to summarize a trace using an aggregate function like "average" or "minimum".') + ), + _react2.default.createElement( + 'p', + null, + _react2.default.createElement( + 'strong', + null, + _('Sort') + ), + ' ', + _(' transforms allow you to sort a trace, so as to control marker overlay or line connection order.') + ) + ), + _react2.default.createElement( + 'p', + null, + _('Click on the + button above to add a transform.') + ) + ) + ); + } + }]); + + return TransformAccordion; +}(_react.Component); + +TransformAccordion.contextTypes = { + fullContainer: _propTypes2.default.object, + localize: _propTypes2.default.func, + container: _propTypes2.default.object, + dataSourceOptions: _propTypes2.default.array +}; + +TransformAccordion.propTypes = { + children: _propTypes2.default.node +}; + +exports.default = TransformAccordion; +//# sourceMappingURL=TransformAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/TransformAccordion.js.map b/lib/components/containers/TransformAccordion.js.map new file mode 100644 index 000000000..729073630 --- /dev/null +++ b/lib/components/containers/TransformAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/TransformAccordion.js"],"names":["TransformFold","PlotlyFold","TransformAccordion","context","fullContainer","transforms","_","localize","container","dataSourceOptions","children","props","transformTypes","label","type","transformBy","map","foldNameSuffix","tr","groupssrc","find","d","value","targetsrc","filteredTransforms","filter","Boolean","content","length","i","addActionOptions","some","t","addAction","handler","updateContainer","transformIndex","Array","isArray","key","payload","target","groups","styles","textAlign","Component","contextTypes","PropTypes","object","func","array","propTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,gBAAgB,kCAAwBC,oBAAxB,CAAtB;;IAEMC,kB;;;;;;;;;;;6BACK;AAAA,qBAMH,KAAKC,OANF;AAAA,2CAELC,aAFK,CAEWC,UAFX;AAAA,UAEWA,UAFX,yCAEwB,EAFxB;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,UAILC,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AIelD,kB","file":"TransformAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport PlotlyPanel from './PlotlyPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectTransformToTrace} from 'lib';\nimport {PanelMessage} from './PanelEmpty';\n\nconst TransformFold = connectTransformToTrace(PlotlyFold);\n\nclass TransformAccordion extends Component {\n render() {\n const {\n fullContainer: {transforms = []},\n localize: _,\n container,\n dataSourceOptions,\n } = this.context;\n const {children} = this.props;\n\n const transformTypes = [\n {label: _('Filter'), type: 'filter'},\n {label: _('Split'), type: 'groupby'},\n {label: _('Aggregate'), type: 'aggregate'},\n {label: _('Sort'), type: 'sort'},\n ];\n\n const transformBy =\n container.transforms &&\n container.transforms.map(tr => {\n let foldNameSuffix = '';\n if (tr.groupssrc) {\n const groupssrc =\n dataSourceOptions && dataSourceOptions.find(d => d.value === tr.groupssrc);\n foldNameSuffix = `: ${groupssrc && groupssrc.label ? groupssrc.label : tr.groupssrc}`;\n } else if (tr.targetsrc) {\n const targetsrc =\n dataSourceOptions && dataSourceOptions.find(d => d.value === tr.targetsrc);\n foldNameSuffix = `: ${targetsrc && targetsrc.label ? targetsrc.label : tr.targetsrc}`;\n }\n return foldNameSuffix;\n });\n\n const filteredTransforms = transforms.filter(({type}) => Boolean(type));\n const content =\n filteredTransforms.length &&\n filteredTransforms.map((tr, i) => (\n type === tr.type)[0].label}${transformBy &&\n transformBy[i]}`}\n canDelete={true}\n >\n {children}\n \n ));\n\n // cannot have 2 Split transforms on one trace:\n // https://github.com/plotly/plotly.js/issues/1742\n const addActionOptions =\n container.transforms && container.transforms.some(t => t.type === 'groupby')\n ? transformTypes.filter(t => t.type !== 'groupby')\n : transformTypes;\n\n const addAction = {\n label: _('Transform'),\n handler: addActionOptions.map(({label, type}) => {\n return {\n label,\n handler: context => {\n const {fullContainer, updateContainer} = context;\n if (updateContainer) {\n const transformIndex = Array.isArray(fullContainer.transforms)\n ? fullContainer.transforms.length\n : 0;\n const key = `transforms[${transformIndex}]`;\n\n const payload = {type};\n if (type === 'filter') {\n payload.target = [];\n payload.targetsrc = null;\n } else {\n payload.groupssrc = null;\n payload.groups = null;\n }\n\n if (type === 'groupby') {\n payload.styles = [];\n }\n\n updateContainer({[key]: payload});\n }\n },\n };\n }),\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n
\n

\n {_('Filter')}{' '}\n {_(' transforms allow you to filter data out from a trace.')}\n

\n

\n {_('Split')}{' '}\n {_(\n ' transforms allow you to create multiple traces from one source trace, so as to style them differently.'\n )}\n

\n

\n {_('Aggregate')}{' '}\n {_(\n ' transforms allow you to summarize a trace using an aggregate function like \"average\" or \"minimum\".'\n )}\n

\n

\n {_('Sort')}{' '}\n {_(\n ' transforms allow you to sort a trace, so as to control marker overlay or line connection order.'\n )}\n

\n
\n

{_('Click on the + button above to add a transform.')}

\n
\n )}\n
\n );\n }\n}\n\nTransformAccordion.contextTypes = {\n fullContainer: PropTypes.object,\n localize: PropTypes.func,\n container: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n};\n\nTransformAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default TransformAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/UpdateMenuAccordion.js b/lib/components/containers/UpdateMenuAccordion.js new file mode 100644 index 000000000..dd83a904f --- /dev/null +++ b/lib/components/containers/UpdateMenuAccordion.js @@ -0,0 +1,94 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _TraceRequiredPanel = require('./TraceRequiredPanel'); + +var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _lib = require('../../lib'); + +var _context2 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var UpdateMenuFold = (0, _lib.connectUpdateMenuToLayout)(_PlotlyFold2.default); + +var UpdateMenuAccordion = function (_Component) { + _inherits(UpdateMenuAccordion, _Component); + + function UpdateMenuAccordion() { + _classCallCheck(this, UpdateMenuAccordion); + + return _possibleConstructorReturn(this, (UpdateMenuAccordion.__proto__ || Object.getPrototypeOf(UpdateMenuAccordion)).apply(this, arguments)); + } + + _createClass(UpdateMenuAccordion, [{ + key: 'render', + value: function render() { + var _context = this.context, + _context$fullLayout$u = _context.fullLayout.updatemenus, + updatemenus = _context$fullLayout$u === undefined ? [] : _context$fullLayout$u, + _ = _context.localize; + var children = this.props.children; + + + var content = updatemenus.length > 0 && updatemenus.map(function (upd, i) { + var localizedType = { + dropdown: _('Dropdown'), + buttons: _('Buttons') + }; + var menuType = localizedType[upd.type] || localizedType.dropdown; + var activeBtn = upd.buttons.filter(function (b) { + return b._index === upd.active; + })[0]; + var foldName = menuType + (activeBtn ? ': ' + activeBtn.label : ''); + + return _react2.default.createElement( + UpdateMenuFold, + { key: i, updateMenuIndex: i, name: foldName }, + children + ); + }); + + return _react2.default.createElement( + _TraceRequiredPanel2.default, + null, + content ? content : null + ); + } + }]); + + return UpdateMenuAccordion; +}(_react.Component); + +UpdateMenuAccordion.contextType = _context2.EditorControlsContext; + +UpdateMenuAccordion.propTypes = { + children: _propTypes2.default.node +}; + +exports.default = UpdateMenuAccordion; +//# sourceMappingURL=UpdateMenuAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/UpdateMenuAccordion.js.map b/lib/components/containers/UpdateMenuAccordion.js.map new file mode 100644 index 000000000..47f00f125 --- /dev/null +++ b/lib/components/containers/UpdateMenuAccordion.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/UpdateMenuAccordion.js"],"names":["UpdateMenuFold","PlotlyFold","UpdateMenuAccordion","context","fullLayout","updatemenus","_","localize","children","props","content","length","map","upd","i","localizedType","dropdown","buttons","menuType","type","activeBtn","filter","b","_index","active","foldName","label","Component","contextType","EditorControlsContext","propTypes","PropTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,oCAA0BC,oBAA1B,CAAvB;;IAEMC,mB;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,UAFK,CAEQC,WAFR;AAAA,UAEQA,WAFR,yCAEsB,EAFtB;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,UAKAC,QALA,GAKY,KAAKC,KALjB,CAKAD,QALA;;;AAOP,UAAME,UACJL,YAAYM,MAAZ,GAAqB,CAArB,IACAN,YAAYO,GAAZ,CAAgB,UAACC,GAAD,EAAMC,CAAN,EAAY;AAC1B,YAAMC,gBAAgB;AACpBC,oBAAUV,EAAE,UAAF,CADU;AAEpBW,mBAASX,EAAE,SAAF;AAFW,SAAtB;AAIA,YAAMY,WAAWH,cAAcF,IAAIM,IAAlB,KAA2BJ,cAAcC,QAA1D;AACA,YAAMI,YAAYP,IAAII,OAAJ,CAAYI,MAAZ,CAAmB;AAAA,iBAAKC,EAAEC,MAAF,KAAaV,IAAIW,MAAtB;AAAA,SAAnB,EAAiD,CAAjD,CAAlB;AACA,YAAMC,WAAWP,YAAYE,YAAY,OAAOA,UAAUM,KAA7B,GAAqC,EAAjD,CAAjB;;AAEA,eACE;AAAC,wBAAD;AAAA,YAAgB,KAAKZ,CAArB,EAAwB,iBAAiBA,CAAzC,EAA4C,MAAMW,QAAlD;AACGjB;AADH,SADF;AAKD,OAdD,CAFF;;AAkBA,aAAO;AAAC,oCAAD;AAAA;AAAqBE,kBAAUA,OAAV,GAAoB;AAAzC,OAAP;AACD;;;;EA3B+BiB,gB;;AA8BlCzB,oBAAoB0B,WAApB,GAAkCC,+BAAlC;;AAEA3B,oBAAoB4B,SAApB,GAAgC;AAC9BtB,YAAUuB,oBAAUC;AADU,CAAhC;;kBAIe9B,mB","file":"UpdateMenuAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectUpdateMenuToLayout} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst UpdateMenuFold = connectUpdateMenuToLayout(PlotlyFold);\n\nclass UpdateMenuAccordion extends Component {\n render() {\n const {\n fullLayout: {updatemenus = []},\n localize: _,\n } = this.context;\n const {children} = this.props;\n\n const content =\n updatemenus.length > 0 &&\n updatemenus.map((upd, i) => {\n const localizedType = {\n dropdown: _('Dropdown'),\n buttons: _('Buttons'),\n };\n const menuType = localizedType[upd.type] || localizedType.dropdown;\n const activeBtn = upd.buttons.filter(b => b._index === upd.active)[0];\n const foldName = menuType + (activeBtn ? ': ' + activeBtn.label : '');\n\n return (\n \n {children}\n \n );\n });\n\n return {content ? content : null};\n }\n}\n\nUpdateMenuAccordion.contextType = EditorControlsContext;\n\nUpdateMenuAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default UpdateMenuAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/derived.js b/lib/components/containers/derived.js new file mode 100644 index 000000000..3dc3bee87 --- /dev/null +++ b/lib/components/containers/derived.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TraceTypeSection = exports.LayoutSection = exports.LayoutPanel = undefined; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _PlotlyPanel = require('./PlotlyPanel'); + +var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); + +var _PlotlySection = require('./PlotlySection'); + +var _PlotlySection2 = _interopRequireDefault(_PlotlySection); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var LayoutPanel = (0, _lib.connectLayoutToPlot)(_PlotlyPanel2.default); +var LayoutSection = (0, _lib.connectLayoutToPlot)(_PlotlySection2.default); + +var TraceTypeSection = function TraceTypeSection(props, context) { + var fullContainer = context.fullContainer, + fullData = context.fullData; + var mode = props.mode, + traceTypes = props.traceTypes; + + + var ifConnectedToTrace = mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type); + + var ifConnectedToLayout = mode === 'layout' && fullData && fullData.some(function (t) { + return traceTypes.includes(t.type); + }); + + if (ifConnectedToTrace || ifConnectedToLayout) { + return _react2.default.createElement(_PlotlySection2.default, props); + } + + return null; +}; + +TraceTypeSection.contextTypes = _lib.containerConnectedContextTypes; +TraceTypeSection.propTypes = { + children: _propTypes2.default.node, + name: _propTypes2.default.string, + traceTypes: _propTypes2.default.array, + mode: _propTypes2.default.string +}; + +TraceTypeSection.defaultProps = { + traceTypes: [], + mode: 'layout' +}; + +exports.LayoutPanel = LayoutPanel; +exports.LayoutSection = LayoutSection; +exports.TraceTypeSection = TraceTypeSection; +//# sourceMappingURL=derived.js.map \ No newline at end of file diff --git a/lib/components/containers/derived.js.map b/lib/components/containers/derived.js.map new file mode 100644 index 000000000..9bc93de60 --- /dev/null +++ b/lib/components/containers/derived.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/derived.js"],"names":["LayoutPanel","PlotlyPanel","LayoutSection","PlotlySection","TraceTypeSection","props","context","fullContainer","fullData","mode","traceTypes","ifConnectedToTrace","includes","type","ifConnectedToLayout","some","t","contextTypes","containerConnectedContextTypes","propTypes","children","PropTypes","node","name","string","array","defaultProps"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA;;;;AAEA,IAAMA,cAAc,8BAAoBC,qBAApB,CAApB;AACA,IAAMC,gBAAgB,8BAAoBC,uBAApB,CAAtB;;AAEA,IAAMC,mBAAmB,SAAnBA,gBAAmB,CAACC,KAAD,EAAQC,OAAR,EAAoB;AAAA,MACpCC,aADoC,GACTD,OADS,CACpCC,aADoC;AAAA,MACrBC,QADqB,GACTF,OADS,CACrBE,QADqB;AAAA,MAEpCC,IAFoC,GAEhBJ,KAFgB,CAEpCI,IAFoC;AAAA,MAE9BC,UAF8B,GAEhBL,KAFgB,CAE9BK,UAF8B;;;AAI3C,MAAMC,qBACJF,SAAS,OAAT,IAAoBF,aAApB,IAAqCG,WAAWE,QAAX,CAAoBL,cAAcM,IAAlC,CADvC;;AAGA,MAAMC,sBACJL,SAAS,QAAT,IAAqBD,QAArB,IAAiCA,SAASO,IAAT,CAAc;AAAA,WAAKL,WAAWE,QAAX,CAAoBI,EAAEH,IAAtB,CAAL;AAAA,GAAd,CADnC;;AAGA,MAAIF,sBAAsBG,mBAA1B,EAA+C;AAC7C,WAAO,8BAAC,uBAAD,EAAmBT,KAAnB,CAAP;AACD;;AAED,SAAO,IAAP;AACD,CAfD;;AAiBAD,iBAAiBa,YAAjB,GAAgCC,mCAAhC;AACAd,iBAAiBe,SAAjB,GAA6B;AAC3BC,YAAUC,oBAAUC,IADO;AAE3BC,QAAMF,oBAAUG,MAFW;AAG3Bd,cAAYW,oBAAUI,KAHK;AAI3BhB,QAAMY,oBAAUG;AAJW,CAA7B;;AAOApB,iBAAiBsB,YAAjB,GAAgC;AAC9BhB,cAAY,EADkB;AAE9BD,QAAM;AAFwB,CAAhC;;QAKQT,W,GAAAA,W;QAAaE,a,GAAAA,a;QAAeE,gB,GAAAA,gB","file":"derived.js","sourcesContent":["import React from 'react';\nimport PlotlyPanel from './PlotlyPanel';\nimport PlotlySection from './PlotlySection';\nimport PropTypes from 'prop-types';\n\nimport {connectLayoutToPlot, containerConnectedContextTypes} from 'lib';\n\nconst LayoutPanel = connectLayoutToPlot(PlotlyPanel);\nconst LayoutSection = connectLayoutToPlot(PlotlySection);\n\nconst TraceTypeSection = (props, context) => {\n const {fullContainer, fullData} = context;\n const {mode, traceTypes} = props;\n\n const ifConnectedToTrace =\n mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type);\n\n const ifConnectedToLayout =\n mode === 'layout' && fullData && fullData.some(t => traceTypes.includes(t.type));\n\n if (ifConnectedToTrace || ifConnectedToLayout) {\n return ;\n }\n\n return null;\n};\n\nTraceTypeSection.contextTypes = containerConnectedContextTypes;\nTraceTypeSection.propTypes = {\n children: PropTypes.node,\n name: PropTypes.string,\n traceTypes: PropTypes.array,\n mode: PropTypes.string,\n};\n\nTraceTypeSection.defaultProps = {\n traceTypes: [],\n mode: 'layout',\n};\n\nexport {LayoutPanel, LayoutSection, TraceTypeSection};\n"]} \ No newline at end of file diff --git a/lib/components/containers/index.js b/lib/components/containers/index.js new file mode 100644 index 000000000..009464cc4 --- /dev/null +++ b/lib/components/containers/index.js @@ -0,0 +1,119 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PanelMessage = exports.ModalProvider = exports.Modal = exports.TraceTypeSection = exports.SingleSidebarItem = exports.AxesFold = exports.LayoutSection = exports.LayoutPanel = exports.TraceRequiredPanel = exports.TraceMarkerSection = exports.TransformAccordion = exports.TraceAccordion = exports.SubplotAccordion = exports.Section = exports.PlotlySection = exports.PanelEmpty = exports.Panel = exports.PlotlyPanel = exports.Fold = exports.PlotlyFold = exports.MenuPanel = exports.RangeSelectorAccordion = exports.UpdateMenuAccordion = exports.ImageAccordion = exports.SliderAccordion = exports.ShapeAccordion = exports.AnnotationAccordion = undefined; + +var _AnnotationAccordion = require('./AnnotationAccordion'); + +var _AnnotationAccordion2 = _interopRequireDefault(_AnnotationAccordion); + +var _ShapeAccordion = require('./ShapeAccordion'); + +var _ShapeAccordion2 = _interopRequireDefault(_ShapeAccordion); + +var _SliderAccordion = require('./SliderAccordion'); + +var _SliderAccordion2 = _interopRequireDefault(_SliderAccordion); + +var _ImageAccordion = require('./ImageAccordion'); + +var _ImageAccordion2 = _interopRequireDefault(_ImageAccordion); + +var _UpdateMenuAccordion = require('./UpdateMenuAccordion'); + +var _UpdateMenuAccordion2 = _interopRequireDefault(_UpdateMenuAccordion); + +var _RangeSelectorAccordion = require('./RangeSelectorAccordion'); + +var _RangeSelectorAccordion2 = _interopRequireDefault(_RangeSelectorAccordion); + +var _AxesFold = require('./AxesFold'); + +var _AxesFold2 = _interopRequireDefault(_AxesFold); + +var _PlotlyFold = require('./PlotlyFold'); + +var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); + +var _MenuPanel = require('./MenuPanel'); + +var _MenuPanel2 = _interopRequireDefault(_MenuPanel); + +var _PlotlyPanel = require('./PlotlyPanel'); + +var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); + +var _PlotlySection = require('./PlotlySection'); + +var _PlotlySection2 = _interopRequireDefault(_PlotlySection); + +var _PanelEmpty = require('./PanelEmpty'); + +var _PanelEmpty2 = _interopRequireDefault(_PanelEmpty); + +var _SubplotAccordion = require('./SubplotAccordion'); + +var _SubplotAccordion2 = _interopRequireDefault(_SubplotAccordion); + +var _TraceAccordion = require('./TraceAccordion'); + +var _TraceAccordion2 = _interopRequireDefault(_TraceAccordion); + +var _TransformAccordion = require('./TransformAccordion'); + +var _TransformAccordion2 = _interopRequireDefault(_TransformAccordion); + +var _TraceMarkerSection = require('./TraceMarkerSection'); + +var _TraceMarkerSection2 = _interopRequireDefault(_TraceMarkerSection); + +var _derived = require('./derived'); + +var _TraceRequiredPanel = require('./TraceRequiredPanel'); + +var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); + +var _SingleSidebarItem = require('./SingleSidebarItem'); + +var _SingleSidebarItem2 = _interopRequireDefault(_SingleSidebarItem); + +var _ModalProvider = require('./ModalProvider'); + +var _ModalProvider2 = _interopRequireDefault(_ModalProvider); + +var _Modal = require('./Modal'); + +var _Modal2 = _interopRequireDefault(_Modal); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.AnnotationAccordion = _AnnotationAccordion2.default; +exports.ShapeAccordion = _ShapeAccordion2.default; +exports.SliderAccordion = _SliderAccordion2.default; +exports.ImageAccordion = _ImageAccordion2.default; +exports.UpdateMenuAccordion = _UpdateMenuAccordion2.default; +exports.RangeSelectorAccordion = _RangeSelectorAccordion2.default; +exports.MenuPanel = _MenuPanel2.default; +exports.PlotlyFold = _PlotlyFold2.default; +exports.Fold = _PlotlyFold.Fold; +exports.PlotlyPanel = _PlotlyPanel2.default; +exports.Panel = _PlotlyPanel.Panel; +exports.PanelEmpty = _PanelEmpty2.default; +exports.PlotlySection = _PlotlySection2.default; +exports.Section = _PlotlySection.Section; +exports.SubplotAccordion = _SubplotAccordion2.default; +exports.TraceAccordion = _TraceAccordion2.default; +exports.TransformAccordion = _TransformAccordion2.default; +exports.TraceMarkerSection = _TraceMarkerSection2.default; +exports.TraceRequiredPanel = _TraceRequiredPanel2.default; +exports.LayoutPanel = _derived.LayoutPanel; +exports.LayoutSection = _derived.LayoutSection; +exports.AxesFold = _AxesFold2.default; +exports.SingleSidebarItem = _SingleSidebarItem2.default; +exports.TraceTypeSection = _derived.TraceTypeSection; +exports.Modal = _Modal2.default; +exports.ModalProvider = _ModalProvider2.default; +exports.PanelMessage = _PanelEmpty.PanelMessage; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/components/containers/index.js.map b/lib/components/containers/index.js.map new file mode 100644 index 000000000..791b9563a --- /dev/null +++ b/lib/components/containers/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/containers/index.js"],"names":["AnnotationAccordion","ShapeAccordion","SliderAccordion","ImageAccordion","UpdateMenuAccordion","RangeSelectorAccordion","MenuPanel","PlotlyFold","Fold","PlotlyPanel","Panel","PanelEmpty","PlotlySection","Section","SubplotAccordion","TraceAccordion","TransformAccordion","TraceMarkerSection","TraceRequiredPanel","LayoutPanel","LayoutSection","AxesFold","SingleSidebarItem","TraceTypeSection","Modal","ModalProvider","PanelMessage"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;QAGEA,mB,GAAAA,6B;QACAC,c,GAAAA,wB;QACAC,e,GAAAA,yB;QACAC,c,GAAAA,wB;QACAC,mB,GAAAA,6B;QACAC,sB,GAAAA,gC;QACAC,S,GAAAA,mB;QACAC,U,GAAAA,oB;QACAC,I,GAAAA,gB;QACAC,W,GAAAA,qB;QACAC,K,GAAAA,kB;QACAC,U,GAAAA,oB;QACAC,a,GAAAA,uB;QACAC,O,GAAAA,sB;QACAC,gB,GAAAA,0B;QACAC,c,GAAAA,wB;QACAC,kB,GAAAA,4B;QACAC,kB,GAAAA,4B;QACAC,kB,GAAAA,4B;QACAC,W,GAAAA,oB;QACAC,a,GAAAA,sB;QACAC,Q,GAAAA,kB;QACAC,iB,GAAAA,2B;QACAC,gB,GAAAA,yB;QACAC,K,GAAAA,e;QACAC,a,GAAAA,uB;QACAC,Y,GAAAA,wB","file":"index.js","sourcesContent":["import AnnotationAccordion from './AnnotationAccordion';\nimport ShapeAccordion from './ShapeAccordion';\nimport SliderAccordion from './SliderAccordion';\nimport ImageAccordion from './ImageAccordion';\nimport UpdateMenuAccordion from './UpdateMenuAccordion';\nimport RangeSelectorAccordion from './RangeSelectorAccordion';\nimport AxesFold from './AxesFold';\nimport PlotlyFold, {Fold} from './PlotlyFold';\nimport MenuPanel from './MenuPanel';\nimport PlotlyPanel, {Panel} from './PlotlyPanel';\nimport PlotlySection, {Section} from './PlotlySection';\nimport PanelEmpty, {PanelMessage} from './PanelEmpty';\nimport SubplotAccordion from './SubplotAccordion';\nimport TraceAccordion from './TraceAccordion';\nimport TransformAccordion from './TransformAccordion';\nimport TraceMarkerSection from './TraceMarkerSection';\nimport {LayoutPanel, LayoutSection, TraceTypeSection} from './derived';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport SingleSidebarItem from './SingleSidebarItem';\nimport ModalProvider from './ModalProvider';\nimport Modal from './Modal';\n\nexport {\n AnnotationAccordion,\n ShapeAccordion,\n SliderAccordion,\n ImageAccordion,\n UpdateMenuAccordion,\n RangeSelectorAccordion,\n MenuPanel,\n PlotlyFold,\n Fold,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PlotlySection,\n Section,\n SubplotAccordion,\n TraceAccordion,\n TransformAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n LayoutPanel,\n LayoutSection,\n AxesFold,\n SingleSidebarItem,\n TraceTypeSection,\n Modal,\n ModalProvider,\n PanelMessage,\n};\n"]} \ No newline at end of file diff --git a/lib/components/fields/ArrowSelector.js b/lib/components/fields/ArrowSelector.js new file mode 100644 index 000000000..2b4d1ce3e --- /dev/null +++ b/lib/components/fields/ArrowSelector.js @@ -0,0 +1,63 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _Dropdown = require('./Dropdown'); + +var _Dropdown2 = _interopRequireDefault(_Dropdown); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _arrow_paths = require('plotly.js/src/components/annotations/arrow_paths'); + +var _arrow_paths2 = _interopRequireDefault(_arrow_paths); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var ARROW_OPTIONS = _arrow_paths2.default.map(function (_ref, index) { + var path = _ref.path; + + var label = _react2.default.createElement( + 'svg', + { width: '40', height: '20', style: { position: 'relative', top: '5px' } }, + _react2.default.createElement('line', { + stroke: 'rgb(68, 68, 68)', + style: { fill: 'none' }, + x1: '5', + y1: '10', + x2: '23.8', + y2: '10', + strokeWidth: '2' + }), + _react2.default.createElement('path', { + d: path, + transform: 'translate(23.8,10)rotate(360)scale(2)', + style: { fill: 'rgb(68, 68, 68)', opacity: 1, strokeWidth: 0 } + }) + ); + + return { + label: label, + value: index, + key: 'arrow' + index + }; +}); + +var ArrowSelector = function ArrowSelector(props) { + return _react2.default.createElement(_Dropdown2.default, _extends({}, props, { options: ARROW_OPTIONS })); +}; + +ArrowSelector.propTypes = _extends({}, _Dropdown2.default.propTypes); + +ArrowSelector.defaultProps = { + clearable: false +}; + +exports.default = ArrowSelector; +//# sourceMappingURL=ArrowSelector.js.map \ No newline at end of file diff --git a/lib/components/fields/ArrowSelector.js.map b/lib/components/fields/ArrowSelector.js.map new file mode 100644 index 000000000..dcd2fd1f6 --- /dev/null +++ b/lib/components/fields/ArrowSelector.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/fields/ArrowSelector.js"],"names":["ARROW_OPTIONS","ARROW_PATHS","map","index","path","label","position","top","fill","opacity","strokeWidth","value","key","ArrowSelector","props","propTypes","Dropdown","defaultProps","clearable"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;AAEA,IAAMA,gBAAgBC,sBAAYC,GAAZ,CAAgB,gBAASC,KAAT,EAAmB;AAAA,MAAjBC,IAAiB,QAAjBA,IAAiB;;AACvD,MAAMC,QACJ;AAAA;AAAA,MAAK,OAAM,IAAX,EAAgB,QAAO,IAAvB,EAA4B,OAAO,EAACC,UAAU,UAAX,EAAuBC,KAAK,KAA5B,EAAnC;AACE;AACE,cAAO,iBADT;AAEE,aAAO,EAACC,MAAM,MAAP,EAFT;AAGE,UAAG,GAHL;AAIE,UAAG,IAJL;AAKE,UAAG,MALL;AAME,UAAG,IANL;AAOE,mBAAY;AAPd,MADF;AAUE;AACE,SAAGJ,IADL;AAEE,iBAAU,uCAFZ;AAGE,aAAO,EAACI,MAAM,iBAAP,EAA0BC,SAAS,CAAnC,EAAsCC,aAAa,CAAnD;AAHT;AAVF,GADF;;AAmBA,SAAO;AACLL,gBADK;AAELM,WAAOR,KAFF;AAGLS,SAAK,UAAUT;AAHV,GAAP;AAKD,CAzBqB,CAAtB;;AA2BA,IAAMU,gBAAgB,SAAhBA,aAAgB,QAAS;AAC7B,SAAO,8BAAC,kBAAD,eAAcC,KAAd,IAAqB,SAASd,aAA9B,IAAP;AACD,CAFD;;AAIAa,cAAcE,SAAd,gBACKC,mBAASD,SADd;;AAIAF,cAAcI,YAAd,GAA6B;AAC3BC,aAAW;AADgB,CAA7B;;kBAIeL,a","file":"ArrowSelector.js","sourcesContent":["import Dropdown from './Dropdown';\nimport React from 'react';\nimport ARROW_PATHS from 'plotly.js/src/components/annotations/arrow_paths';\n\nconst ARROW_OPTIONS = ARROW_PATHS.map(({path}, index) => {\n const label = (\n \n \n \n \n );\n\n return {\n label,\n value: index,\n key: 'arrow' + index,\n };\n});\n\nconst ArrowSelector = props => {\n return ;\n};\n\nArrowSelector.propTypes = {\n ...Dropdown.propTypes,\n};\n\nArrowSelector.defaultProps = {\n clearable: false,\n};\n\nexport default ArrowSelector;\n"]} \ No newline at end of file diff --git a/lib/components/fields/AxesCreator.js b/lib/components/fields/AxesCreator.js new file mode 100644 index 000000000..adbee7895 --- /dev/null +++ b/lib/components/fields/AxesCreator.js @@ -0,0 +1,256 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Dropdown = require('./Dropdown'); + +var _Dropdown2 = _interopRequireDefault(_Dropdown); + +var _Info = require('./Info'); + +var _Info2 = _interopRequireDefault(_Info); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _constants = require('../../lib/constants'); + +var _Button = require('../widgets/Button'); + +var _Button2 = _interopRequireDefault(_Button); + +var _plotlyIcons = require('plotly-icons'); + +var _lib = require('../../lib'); + +var _2 = require('./..'); + +var _context3 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var UnconnectedAxisCreator = function (_Component) { + _inherits(UnconnectedAxisCreator, _Component); + + function UnconnectedAxisCreator() { + _classCallCheck(this, UnconnectedAxisCreator); + + return _possibleConstructorReturn(this, (UnconnectedAxisCreator.__proto__ || Object.getPrototypeOf(UnconnectedAxisCreator)).apply(this, arguments)); + } + + _createClass(UnconnectedAxisCreator, [{ + key: 'canAddAxis', + value: function canAddAxis() { + var _this2 = this; + + var currentAxisId = this.props.fullContainer[this.props.attr]; + var currentTraceIndex = this.props.fullContainer.index; + return this.context.fullData.some(function (d) { + return d.index !== currentTraceIndex && d[_this2.props.attr] === currentAxisId; + }); + } + }, { + key: 'addAndUpdateAxis', + value: function addAndUpdateAxis() { + var _update; + + var _props = this.props, + attr = _props.attr, + updateContainer = _props.updateContainer; + var _context = this.context, + onUpdate = _context.onUpdate, + subplots = _context.fullLayout._subplots; + + var lastAxisNumber = Number(subplots[attr][subplots[attr].length - 1].charAt(1)) || 1; + + updateContainer(_defineProperty({}, attr, attr.charAt(0) + (lastAxisNumber + 1))); + + var side = null; + if (attr === 'yaxis') { + side = 'right'; + } else if (attr === 'xaxis') { + side = 'top'; + } + + onUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT, + payload: { + update: (_update = {}, _defineProperty(_update, attr + (lastAxisNumber + 1) + '.side', side), _defineProperty(_update, attr + (lastAxisNumber + 1) + '.overlaying', !(attr === 'yaxis' || attr === 'xaxis') ? null : subplots[attr][subplots[attr].length - 1]), _update) + } + }); + } + }, { + key: 'updateAxis', + value: function updateAxis(update) { + var _this3 = this; + + var currentAxisId = this.props.fullContainer[this.props.attr]; + var axesToBeGarbageCollected = []; + + // When we select another axis, make sure no unused axes are left + if (currentAxisId !== update && !this.context.fullData.some(function (trace) { + return trace[_this3.props.attr] === currentAxisId && trace.index !== _this3.props.fullContainer.index; + })) { + axesToBeGarbageCollected.push(currentAxisId); + } + + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, + payload: { + axesToBeGarbageCollected: axesToBeGarbageCollected, + update: _defineProperty({}, this.props.attr, update), + traceIndexes: [this.props.fullContainer.index] + } + }); + } + }, { + key: 'render', + value: function render() { + var _this4 = this; + + var icon = _react2.default.createElement(_plotlyIcons.PlusIcon, null); + var extraComponent = this.canAddAxis() ? _react2.default.createElement(_Button2.default, { variant: 'no-text', icon: icon, onClick: function onClick() { + return _this4.addAndUpdateAxis(); + } }) : _react2.default.createElement(_Button2.default, { variant: 'no-text--disabled', icon: icon, onClick: function onClick() {} }); + + return _react2.default.createElement(_Dropdown2.default, { + label: this.props.label, + attr: this.props.attr, + clearable: false, + options: this.props.options, + updatePlot: function updatePlot(u) { + return _this4.updateAxis(u); + }, + extraComponent: extraComponent + }); + } + }]); + + return UnconnectedAxisCreator; +}(_react.Component); + +UnconnectedAxisCreator.propTypes = { + attr: _propTypes2.default.string, + label: _propTypes2.default.string, + options: _propTypes2.default.array, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + updateContainer: _propTypes2.default.func +}; + +UnconnectedAxisCreator.contextType = _context3.EditorControlsContext; + +var AxisCreator = (0, _lib.connectToContainer)(UnconnectedAxisCreator); + +var UnconnectedAxesCreator = function (_Component2) { + _inherits(UnconnectedAxesCreator, _Component2); + + function UnconnectedAxesCreator() { + _classCallCheck(this, UnconnectedAxesCreator); + + return _possibleConstructorReturn(this, (UnconnectedAxesCreator.__proto__ || Object.getPrototypeOf(UnconnectedAxesCreator)).apply(this, arguments)); + } + + _createClass(UnconnectedAxesCreator, [{ + key: 'render', + value: function render() { + var axisType = (0, _lib.traceTypeToAxisType)(this.props.container.type); + var isFirstTraceOfAxisType = this.context.data.filter(function (d) { + return (0, _lib.traceTypeToAxisType)(d.type) === axisType; + }).length === 1; + + if (isFirstTraceOfAxisType) { + return null; + } + + var _context2 = this.context, + fullLayout = _context2.fullLayout, + _ = _context2.localize; + + var controls = []; + + function getOptions(axisType) { + return fullLayout._subplots[axisType].map(function (axisId) { + return { + label: (0, _lib.getAxisTitle)(fullLayout[(0, _lib.axisIdToAxisName)(axisId)]), + value: axisId + }; + }); + } + + if (axisType === 'cartesian') { + ['xaxis', 'yaxis'].forEach(function (type, index) { + controls.push(_react2.default.createElement(AxisCreator, { + key: index, + attr: type, + label: type.charAt(0).toUpperCase() + _(' Axis'), + options: getOptions(type) + })); + }); + } + + return _react2.default.createElement( + _2.PlotlySection, + { name: _('Axes to Use') }, + controls, + _react2.default.createElement( + _context3.ModalProviderContext.Consumer, + null, + function (_ref) { + var setPanel = _ref.setPanel; + return _react2.default.createElement( + _Info2.default, + null, + _('You can style and position your axes in the '), + _react2.default.createElement( + 'a', + { onClick: function onClick() { + return setPanel('Structure', 'Subplots'); + } }, + _('Subplots') + ), + _(' panel.') + ); + } + ) + ); + } + }]); + + return UnconnectedAxesCreator; +}(_react.Component); + +UnconnectedAxesCreator.propTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object +}; + +UnconnectedAxesCreator.contextType = _context3.EditorControlsContext; + +exports.default = (0, _lib.connectToContainer)(UnconnectedAxesCreator, { + modifyPlotProps: function modifyPlotProps(props, context, plotProps) { + var data = context.data; + var fullContainer = plotProps.fullContainer; + + + plotProps.isVisible = data.length > 1 && data[fullContainer.index] && (0, _lib.traceTypeToAxisType)(data[fullContainer.index].type) === 'cartesian'; + } +}); +//# sourceMappingURL=AxesCreator.js.map \ No newline at end of file diff --git a/lib/components/fields/AxesCreator.js.map b/lib/components/fields/AxesCreator.js.map new file mode 100644 index 000000000..645e9a4eb --- /dev/null +++ b/lib/components/fields/AxesCreator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/fields/AxesCreator.js"],"names":["UnconnectedAxisCreator","currentAxisId","props","fullContainer","attr","currentTraceIndex","index","context","fullData","some","d","updateContainer","onUpdate","subplots","fullLayout","_subplots","lastAxisNumber","Number","length","charAt","side","type","EDITOR_ACTIONS","UPDATE_LAYOUT","payload","update","axesToBeGarbageCollected","trace","push","UPDATE_TRACES","traceIndexes","icon","extraComponent","canAddAxis","addAndUpdateAxis","label","options","updateAxis","u","Component","propTypes","PropTypes","string","array","container","object","func","contextType","EditorControlsContext","AxisCreator","UnconnectedAxesCreator","axisType","isFirstTraceOfAxisType","data","filter","_","localize","controls","getOptions","map","axisId","value","forEach","toUpperCase","setPanel","modifyPlotProps","plotProps","isVisible"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;IAEMA,sB;;;;;;;;;;;iCACS;AAAA;;AACX,UAAMC,gBAAgB,KAAKC,KAAL,CAAWC,aAAX,CAAyB,KAAKD,KAAL,CAAWE,IAApC,CAAtB;AACA,UAAMC,oBAAoB,KAAKH,KAAL,CAAWC,aAAX,CAAyBG,KAAnD;AACA,aAAO,KAAKC,OAAL,CAAaC,QAAb,CAAsBC,IAAtB,CACL;AAAA,eAAKC,EAAEJ,KAAF,KAAYD,iBAAZ,IAAiCK,EAAE,OAAKR,KAAL,CAAWE,IAAb,MAAuBH,aAA7D;AAAA,OADK,CAAP;AAGD;;;uCAEkB;AAAA;;AAAA,mBACe,KAAKC,KADpB;AAAA,UACVE,IADU,UACVA,IADU;AAAA,UACJO,eADI,UACJA,eADI;AAAA,qBAKb,KAAKJ,OALQ;AAAA,UAGfK,QAHe,YAGfA,QAHe;AAAA,UAISC,QAJT,YAIfC,UAJe,CAIFC,SAJE;;AAMjB,UAAMC,iBAAiBC,OAAOJ,SAAST,IAAT,EAAeS,SAAST,IAAT,EAAec,MAAf,GAAwB,CAAvC,EAA0CC,MAA1C,CAAiD,CAAjD,CAAP,KAA+D,CAAtF;;AAEAR,0CACGP,IADH,EACUA,KAAKe,MAAL,CAAY,CAAZ,KAAkBH,iBAAiB,CAAnC,CADV;;AAIA,UAAII,OAAO,IAAX;AACA,UAAIhB,SAAS,OAAb,EAAsB;AACpBgB,eAAO,OAAP;AACD,OAFD,MAEO,IAAIhB,SAAS,OAAb,EAAsB;AAC3BgB,eAAO,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ADuC;AAAA,QAEvClD,aAFuC,GAEtB+D,SAFsB,CAEvC/D,aAFuC;;;AAI9C+D,cAAUC,SAAV,GACEd,KAAKnC,MAAL,GAAc,CAAd,IACAmC,KAAKlD,cAAcG,KAAnB,CADA,IAEA,8BAAoB+C,KAAKlD,cAAcG,KAAnB,EAA0Be,IAA9C,MAAwD,WAH1D;AAID;AATuD,CAA3C,C","file":"AxesCreator.js","sourcesContent":["import Dropdown from './Dropdown';\nimport Info from './Info';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {EDITOR_ACTIONS} from 'lib/constants';\nimport Button from '../widgets/Button';\nimport {PlusIcon} from 'plotly-icons';\nimport {connectToContainer, traceTypeToAxisType, getAxisTitle, axisIdToAxisName} from 'lib';\nimport {PlotlySection} from 'components';\nimport {EditorControlsContext, ModalProviderContext} from '../../context';\n\nclass UnconnectedAxisCreator extends Component {\n canAddAxis() {\n const currentAxisId = this.props.fullContainer[this.props.attr];\n const currentTraceIndex = this.props.fullContainer.index;\n return this.context.fullData.some(\n d => d.index !== currentTraceIndex && d[this.props.attr] === currentAxisId\n );\n }\n\n addAndUpdateAxis() {\n const {attr, updateContainer} = this.props;\n const {\n onUpdate,\n fullLayout: {_subplots: subplots},\n } = this.context;\n const lastAxisNumber = Number(subplots[attr][subplots[attr].length - 1].charAt(1)) || 1;\n\n updateContainer({\n [attr]: attr.charAt(0) + (lastAxisNumber + 1),\n });\n\n let side = null;\n if (attr === 'yaxis') {\n side = 'right';\n } else if (attr === 'xaxis') {\n side = 'top';\n }\n\n onUpdate({\n type: EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update: {\n [`${attr + (lastAxisNumber + 1)}.side`]: side,\n [`${attr + (lastAxisNumber + 1)}.overlaying`]: !(attr === 'yaxis' || attr === 'xaxis')\n ? null\n : subplots[attr][subplots[attr].length - 1],\n },\n },\n });\n }\n\n updateAxis(update) {\n const currentAxisId = this.props.fullContainer[this.props.attr];\n const axesToBeGarbageCollected = [];\n\n // When we select another axis, make sure no unused axes are left\n if (\n currentAxisId !== update &&\n !this.context.fullData.some(\n trace =>\n trace[this.props.attr] === currentAxisId && trace.index !== this.props.fullContainer.index\n )\n ) {\n axesToBeGarbageCollected.push(currentAxisId);\n }\n\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n axesToBeGarbageCollected,\n update: {[this.props.attr]: update},\n traceIndexes: [this.props.fullContainer.index],\n },\n });\n }\n\n render() {\n const icon = ;\n const extraComponent = this.canAddAxis() ? (\n \n );\n }\n}\n\nButton.propTypes = {\n children: PropTypes.node,\n className: PropTypes.any,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n label: PropTypes.any,\n variant: PropTypes.string,\n};\n\nexport default Button;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/CheckboxGroup.js b/lib/components/widgets/CheckboxGroup.js new file mode 100644 index 000000000..9496abf74 --- /dev/null +++ b/lib/components/widgets/CheckboxGroup.js @@ -0,0 +1,134 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _plotlyIcons = require('plotly-icons'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var CheckboxGroup = function (_Component) { + _inherits(CheckboxGroup, _Component); + + function CheckboxGroup(props) { + _classCallCheck(this, CheckboxGroup); + + var _this = _possibleConstructorReturn(this, (CheckboxGroup.__proto__ || Object.getPrototypeOf(CheckboxGroup)).call(this, props)); + + _this.state = { options: _this.props.options }; + _this.handleChange = _this.handleChange.bind(_this); + return _this; + } + + _createClass(CheckboxGroup, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + this.setState({ options: nextProps.options }); + } + }, { + key: 'handleChange', + value: function handleChange(i) { + var newOptions = this.props.options.slice(); + newOptions[i] = Object.assign(newOptions[i], { + checked: !newOptions[i].checked + }); + this.props.onChange(newOptions); + } + }, { + key: 'renderOptions', + value: function renderOptions() { + var _this2 = this; + + return this.state.options.map(function (option, i) { + var checkClass = (0, _classnames2.default)(['checkbox__check', 'icon'], { + 'checkbox__check--checked': option.checked + }); + + var itemClass = (0, _classnames2.default)('checkbox__item', { + 'checkbox__item--vertical': _this2.props.orientation === 'vertical', + 'checkbox__item--horizontal': _this2.props.orientation === 'horizontal' + }); + + return _react2.default.createElement( + 'div', + { key: i, className: itemClass }, + _react2.default.createElement( + 'div', + { + className: 'checkbox__box' + (option.checked ? ' checkbox__box--checked' : ''), + onClick: function onClick() { + return _this2.handleChange(i); + } + }, + option.checked && _react2.default.createElement( + 'div', + { className: checkClass }, + _react2.default.createElement(_plotlyIcons.CheckIcon, null) + ) + ), + _react2.default.createElement( + 'div', + { className: 'checkbox__label', onClick: function onClick() { + return _this2.handleChange(i); + } }, + option.label + ) + ); + }); + } + }, { + key: 'render', + value: function render() { + var boxClass = (0, _classnames2.default)('checkbox__group', this.props.className, { + checkbox__group_horizontal: this.props.orientation === 'horizontal' + }); + + return _react2.default.createElement( + 'div', + { className: boxClass }, + this.renderOptions() + ); + } + }]); + + return CheckboxGroup; +}(_react.Component); + +CheckboxGroup.propTypes = { + options: _propTypes2.default.arrayOf(_propTypes2.default.shape({ + label: _propTypes2.default.string.isRequired, + value: _propTypes2.default.string.isRequired, + checked: _propTypes2.default.bool.isRequired + })).isRequired, + onChange: _propTypes2.default.func, + className: _propTypes2.default.string, + orientation: _propTypes2.default.string +}; + +CheckboxGroup.defaultProps = { + className: '' +}; + +exports.default = CheckboxGroup; +//# sourceMappingURL=CheckboxGroup.js.map \ No newline at end of file diff --git a/lib/components/widgets/CheckboxGroup.js.map b/lib/components/widgets/CheckboxGroup.js.map new file mode 100644 index 000000000..f057a3c4f --- /dev/null +++ b/lib/components/widgets/CheckboxGroup.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/CheckboxGroup.js"],"names":["CheckboxGroup","props","state","options","handleChange","bind","nextProps","setState","i","newOptions","slice","Object","assign","checked","onChange","map","option","checkClass","itemClass","orientation","label","boxClass","className","checkbox__group_horizontal","renderOptions","Component","propTypes","PropTypes","arrayOf","shape","string","isRequired","value","bool","func","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa,EAACC,SAAS,MAAKF,KAAL,CAAWE,OAArB,EAAb;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAHiB;AAIlB;;;;8CAEyBC,S,EAAW;AACnC,WAAKC,QAAL,CAAc,EAACJ,SAASG,UAAUH,OAApB,EAAd;AACD;;;iCA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D;AACnEC,oCAA4B,KAAKtB,KAAL,CAAWkB,WAAX,KAA2B;AADY,OAApD,CAAjB;;AAIA,aAAO;AAAA;AAAA,UAAK,WAAWE,QAAhB;AAA2B,aAAKG,aAAL;AAA3B,OAAP;AACD;;;;EAxDyBC,gB;;AA2D5BzB,cAAc0B,SAAd,GAA0B;AACxBvB,WAASwB,oBAAUC,OAAV,CACPD,oBAAUE,KAAV,CAAgB;AACdT,WAAOO,oBAAUG,MAAV,CAAiBC,UADV;AAEdC,WAAOL,oBAAUG,MAAV,CAAiBC,UAFV;AAGdlB,aAASc,oBAAUM,IAAV,CAAeF;AAHV,GAAhB,CADO,EAMPA,UAPsB;AAQxBjB,YAAUa,oBAAUO,IARI;AASxBZ,aAAWK,oBAAUG,MATG;AAUxBX,eAAaQ,oBAAUG;AAVC,CAA1B;;AAaA9B,cAAcmC,YAAd,GAA6B;AAC3Bb,aAAW;AADgB,CAA7B;;kBAIetB,a","file":"CheckboxGroup.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {CheckIcon} from 'plotly-icons';\n\nclass CheckboxGroup extends Component {\n constructor(props) {\n super(props);\n this.state = {options: this.props.options};\n this.handleChange = this.handleChange.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState({options: nextProps.options});\n }\n\n handleChange(i) {\n var newOptions = this.props.options.slice();\n newOptions[i] = Object.assign(newOptions[i], {\n checked: !newOptions[i].checked,\n });\n this.props.onChange(newOptions);\n }\n\n renderOptions() {\n return this.state.options.map((option, i) => {\n const checkClass = classnames(['checkbox__check', 'icon'], {\n 'checkbox__check--checked': option.checked,\n });\n\n const itemClass = classnames('checkbox__item', {\n 'checkbox__item--vertical': this.props.orientation === 'vertical',\n 'checkbox__item--horizontal': this.props.orientation === 'horizontal',\n });\n\n return (\n
\n this.handleChange(i)}\n >\n {option.checked && (\n
\n \n
\n )}\n
\n
this.handleChange(i)}>\n {option.label}\n
\n \n );\n });\n }\n\n render() {\n const boxClass = classnames('checkbox__group', this.props.className, {\n checkbox__group_horizontal: this.props.orientation === 'horizontal',\n });\n\n return
{this.renderOptions()}
;\n }\n}\n\nCheckboxGroup.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired,\n checked: PropTypes.bool.isRequired,\n })\n ).isRequired,\n onChange: PropTypes.func,\n className: PropTypes.string,\n orientation: PropTypes.string,\n};\n\nCheckboxGroup.defaultProps = {\n className: '',\n};\n\nexport default CheckboxGroup;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/ColorPicker.js b/lib/components/widgets/ColorPicker.js new file mode 100644 index 000000000..dc7651638 --- /dev/null +++ b/lib/components/widgets/ColorPicker.js @@ -0,0 +1,190 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _SketchFields = require('react-color/lib/components/sketch/SketchFields'); + +var _SketchFields2 = _interopRequireDefault(_SketchFields); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _tinycolor = require('tinycolor2'); + +var _tinycolor2 = _interopRequireDefault(_tinycolor); + +var _common = require('react-color/lib/components/common'); + +var _reactColor = require('react-color'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +// Utility functions for converting ColorPicker color objects or raw strings +// into TinyColor objects. +var extractRGB = function extractRGB(c) { + return c.rgb || c; +}; +var getColorSource = function getColorSource(c) { + return c.source === 'hex' ? c.hex : extractRGB(c); +}; +var toTinyColor = function toTinyColor(c) { + return (0, _tinycolor2.default)(getColorSource(c)); +}; + +var Custom = function (_Component) { + _inherits(Custom, _Component); + + function Custom() { + _classCallCheck(this, Custom); + + return _possibleConstructorReturn(this, (Custom.__proto__ || Object.getPrototypeOf(Custom)).apply(this, arguments)); + } + + _createClass(Custom, [{ + key: 'render', + value: function render() { + var onChangeComplete = this.props.onChangeComplete; + + + return _react2.default.createElement( + 'div', + { className: 'colorpicker__outer' }, + _react2.default.createElement( + 'div', + { className: 'colorpicker__controls +flex' }, + _react2.default.createElement( + 'div', + { className: 'colorpicker__sliders' }, + _react2.default.createElement( + 'div', + { className: 'colorpicker__slider' }, + _react2.default.createElement(_common.Hue, this.props) + ) + ) + ), + _react2.default.createElement( + 'div', + { className: 'colorpicker__saturation' }, + _react2.default.createElement(_common.Saturation, this.props) + ), + _react2.default.createElement( + 'div', + { className: 'colorpicker__custom-input' }, + _react2.default.createElement(_SketchFields2.default, _extends({}, this.props, { onChange: onChangeComplete })) + ) + ); + } + }]); + + return Custom; +}(_react.Component); + +Custom.propTypes = { + rgb: _propTypes2.default.object, + onChangeComplete: _propTypes2.default.func +}; + +var CustomColorPicker = (0, _reactColor.CustomPicker)(Custom); + +var ColorPicker = function (_Component2) { + _inherits(ColorPicker, _Component2); + + function ColorPicker(props) { + _classCallCheck(this, ColorPicker); + + var _this2 = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, props)); + + _this2.state = { + isVisible: false + }; + + _this2.onSelectedColorChange = _this2.onSelectedColorChange.bind(_this2); + _this2.toggleVisible = _this2.toggleVisible.bind(_this2); + return _this2; + } + + _createClass(ColorPicker, [{ + key: 'onSelectedColorChange', + value: function onSelectedColorChange(newColor) { + // We use our own toTinyColor because this value is a ColorPicker + // color value which is an object that needs unpacking. We also handle + // the case where a color string is passed in (just in case). + var color = toTinyColor(newColor); + + // relayout call only wants a RGB String + this.props.onColorChange(color.toRgbString()); + } + }, { + key: 'toggleVisible', + value: function toggleVisible() { + this.setState({ isVisible: !this.state.isVisible }); + } + }, { + key: 'render', + value: function render() { + // We use tinycolor here instead of our own toTinyColor as + // tinycolor handles `null` values and other weirdness we may + // expect from user data. + var selectedColor = (0, _tinycolor2.default)(this.props.selectedColor); + var colorText = selectedColor.toHexString(); + + // Convert rgba to rgb if necessary + var rgbString = selectedColor._a !== 0 ? selectedColor.toRgbString() : 'rgb(' + selectedColor._r + ',' + selectedColor._g + ',' + selectedColor._b + ')'; + + // We need inline style here to assign the background color + // dynamically. + var swatchStyle = { backgroundColor: rgbString }; + + return _react2.default.createElement( + _react.Fragment, + null, + _react2.default.createElement( + 'div', + { className: 'colorpicker__container' }, + _react2.default.createElement( + 'div', + { className: 'colorpicker' }, + _react2.default.createElement('div', { + className: 'colorpicker__swatch +cursor-clickable', + style: swatchStyle, + onClick: this.toggleVisible + }) + ), + _react2.default.createElement( + 'div', + { className: 'colorpicker__selected-color +hover-grey', onClick: this.toggleVisible }, + colorText + ) + ), + this.state.isVisible && _react2.default.createElement(CustomColorPicker, { color: rgbString, onChangeComplete: this.onSelectedColorChange }) + ); + } + }]); + + return ColorPicker; +}(_react.Component); + +ColorPicker.propTypes = { + onColorChange: _propTypes2.default.func.isRequired, + selectedColor: _propTypes2.default.string +}; + +exports.default = ColorPicker; +//# sourceMappingURL=ColorPicker.js.map \ No newline at end of file diff --git a/lib/components/widgets/ColorPicker.js.map b/lib/components/widgets/ColorPicker.js.map new file mode 100644 index 000000000..572d1e0bf --- /dev/null +++ b/lib/components/widgets/ColorPicker.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/ColorPicker.js"],"names":["extractRGB","c","rgb","getColorSource","source","hex","toTinyColor","Custom","onChangeComplete","props","Component","propTypes","PropTypes","object","func","CustomColorPicker","ColorPicker","state","isVisible","onSelectedColorChange","bind","toggleVisible","newColor","color","onColorChange","toRgbString","setState","selectedColor","colorText","toHexString","rgbString","_a","_r","_g","_b","swatchStyle","backgroundColor","isRequired","string"],"mappings":";;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA;AACA;AACA,IAAMA,aAAa,SAAbA,UAAa;AAAA,SAAKC,EAAEC,GAAF,IAASD,CAAd;AAAA,CAAnB;AACA,IAAME,iBAAiB,SAAjBA,cAAiB;AAAA,SAAMF,EAAEG,MAAF,KAAa,KAAb,GAAqBH,EAAEI,GAAvB,GAA6BL,WAAWC,CAAX,CAAnC;AAAA,CAAvB;AACA,IAAMK,cAAc,SAAdA,WAAc;AAAA,SAAK,yBAAUH,eAAeF,CAAf,CAAV,CAAL;AAAA,CAApB;;IAEMM,M;;;;;;;;;;;6BACK;AAAA,UACAC,gBADA,GACoB,KAAKC,KADzB,CACAD,gBADA;;;AAGP,aACE;AAAA;AAAA,UAAK,WAAU,oBAAf;AACE;AAAA;AAAA,YAAK,WAAU,6BAAf;AACE;AAAA;AAAA,cAAK,WAAU,sBAAf;AACE;AAAA;AAAA,gBAAK,WAAU,qBAAf;AACE,4CAAC,WAAD,EAAS,KAAKC,KAAd;AADF;AADF;AADF,SADF;AAQE;AAAA;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AAAA;AAAA,YAAK,WAAU,wBAAf;AACE;AAAA;AAAA,cAAK,WAAU,aAAf;AACE;AACE,yBAAU,uCADZ;AAEE,qBAAOK,WAFT;AAGE,uBAAS,KAAKd;AAHhB;AADF,WADF;AASE;AAAA;AAAA,cAAK,WAAU,yCAAf,EAAyD,SAAS,KAAKA,aAAvE;AACGO;AADH;AATF,SADF;AAeG,aAAKX,KAAL,CAAWC,SAAX,IACC,8BAAC,iBAAD,IAAmB,OAAOY,SAA1B,EAAqC,kBAAkB,KAAKX,qBAA5D;AAhBJ,OADF;AAqBD;;;;EAhEuBT,gB;;AAmE1BM,YAAYL,SAAZ,GAAwB;AACtBa,iBAAeZ,oBAAUE,IAAV,CAAeuB,UADR;AAEtBV,iBAAef,oBAAU0B;AAFH,CAAxB;;kBAKetB,W","file":"ColorPicker.js","sourcesContent":["import Fields from 'react-color/lib/components/sketch/SketchFields';\nimport React, {Component, Fragment} from 'react';\nimport PropTypes from 'prop-types';\nimport tinycolor from 'tinycolor2';\nimport {Hue, Saturation} from 'react-color/lib/components/common';\nimport {CustomPicker as customPicker} from 'react-color';\n\n// Utility functions for converting ColorPicker color objects or raw strings\n// into TinyColor objects.\nconst extractRGB = c => c.rgb || c;\nconst getColorSource = c => (c.source === 'hex' ? c.hex : extractRGB(c));\nconst toTinyColor = c => tinycolor(getColorSource(c));\n\nclass Custom extends Component {\n render() {\n const {onChangeComplete} = this.props;\n\n return (\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n );\n }\n}\n\nCustom.propTypes = {\n rgb: PropTypes.object,\n onChangeComplete: PropTypes.func,\n};\n\nconst CustomColorPicker = customPicker(Custom);\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n isVisible: false,\n };\n\n this.onSelectedColorChange = this.onSelectedColorChange.bind(this);\n this.toggleVisible = this.toggleVisible.bind(this);\n }\n\n onSelectedColorChange(newColor) {\n // We use our own toTinyColor because this value is a ColorPicker\n // color value which is an object that needs unpacking. We also handle\n // the case where a color string is passed in (just in case).\n const color = toTinyColor(newColor);\n\n // relayout call only wants a RGB String\n this.props.onColorChange(color.toRgbString());\n }\n\n toggleVisible() {\n this.setState({isVisible: !this.state.isVisible});\n }\n\n render() {\n // We use tinycolor here instead of our own toTinyColor as\n // tinycolor handles `null` values and other weirdness we may\n // expect from user data.\n const selectedColor = tinycolor(this.props.selectedColor);\n const colorText = selectedColor.toHexString();\n\n // Convert rgba to rgb if necessary\n const rgbString =\n selectedColor._a !== 0\n ? selectedColor.toRgbString()\n : `rgb(${selectedColor._r},${selectedColor._g},${selectedColor._b})`;\n\n // We need inline style here to assign the background color\n // dynamically.\n const swatchStyle = {backgroundColor: rgbString};\n\n return (\n \n
\n
\n \n
\n\n
\n {colorText}\n
\n
\n\n {this.state.isVisible && (\n \n )}\n
\n );\n }\n}\n\nColorPicker.propTypes = {\n onColorChange: PropTypes.func.isRequired,\n selectedColor: PropTypes.string,\n};\n\nexport default ColorPicker;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/ColorscalePicker.js b/lib/components/widgets/ColorscalePicker.js new file mode 100644 index 000000000..6d52b3fff --- /dev/null +++ b/lib/components/widgets/ColorscalePicker.js @@ -0,0 +1,141 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _reactColorscales = require('react-colorscales'); + +var _reactColorscales2 = _interopRequireDefault(_reactColorscales); + +var _Dropdown = require('./Dropdown'); + +var _Dropdown2 = _interopRequireDefault(_Dropdown); + +var _Info = require('../fields/Info'); + +var _Info2 = _interopRequireDefault(_Info); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Scale = function (_Component) { + _inherits(Scale, _Component); + + function Scale(props) { + _classCallCheck(this, Scale); + + var _this = _possibleConstructorReturn(this, (Scale.__proto__ || Object.getPrototypeOf(Scale)).call(this, props)); + + _this.state = { + selectedColorscaleType: props.initialCategory || 'sequential', + showColorscalePicker: false + }; + + _this.onChange = _this.onChange.bind(_this); + _this.onClick = _this.onClick.bind(_this); + return _this; + } + + _createClass(Scale, [{ + key: 'onClick', + value: function onClick() { + this.setState({ + showColorscalePicker: !this.state.showColorscalePicker + }); + } + }, { + key: 'onChange', + value: function onChange(selectedColorscaleType) { + this.setState({ selectedColorscaleType: selectedColorscaleType }); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + onColorscaleChange = _props.onColorscaleChange, + selected = _props.selected; + var _state = this.state, + selectedColorscaleType = _state.selectedColorscaleType, + showColorscalePicker = _state.showColorscalePicker; + + var description = _reactColorscales.COLOR_PICKER_CONSTANTS.COLORSCALE_DESCRIPTIONS[selectedColorscaleType]; + var colorscaleOptions = _reactColorscales.COLOR_PICKER_CONSTANTS.COLORSCALE_TYPES.filter(function (type) { + return type !== 'custom'; + }).map(function (type) { + return { + label: type + ' scales', + value: type + }; + }); + var _ = this.context.localize; + + return _react2.default.createElement( + 'div', + { className: 'customPickerContainer__outer' }, + _react2.default.createElement(_reactColorscales.Colorscale, { colorscale: selected, onClick: this.onClick }), + showColorscalePicker ? _react2.default.createElement( + 'div', + { className: 'customPickerContainer' }, + _react2.default.createElement(_Dropdown2.default, { + options: colorscaleOptions, + value: selectedColorscaleType, + onChange: this.onChange, + clearable: false, + searchable: false, + placeholder: _('Select a Colorscale Type') + }), + description ? _react2.default.createElement( + _react.Fragment, + null, + _react2.default.createElement(_reactColorscales2.default, { + onChange: onColorscaleChange, + colorscale: selected, + width: 215, + colorscaleType: this.state.selectedColorscaleType, + onColorscaleTypeChange: this.onColorscaleTypeChange, + disableSwatchControls: true, + scaleLength: 7 + }), + _react2.default.createElement( + _Info2.default, + null, + description + ) + ) : null + ) : null + ); + } + }]); + + return Scale; +}(_react.Component); + +Scale.propTypes = { + onColorscaleChange: _propTypes2.default.func, + selected: _propTypes2.default.array, + label: _propTypes2.default.string, + initialCategory: _propTypes2.default.string +}; + +Scale.contextType = _context.EditorControlsContext; + +exports.default = Scale; +//# sourceMappingURL=ColorscalePicker.js.map \ No newline at end of file diff --git a/lib/components/widgets/ColorscalePicker.js.map b/lib/components/widgets/ColorscalePicker.js.map new file mode 100644 index 000000000..6b650726e --- /dev/null +++ b/lib/components/widgets/ColorscalePicker.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/ColorscalePicker.js"],"names":["Scale","props","state","selectedColorscaleType","initialCategory","showColorscalePicker","onChange","bind","onClick","setState","onColorscaleChange","selected","description","COLOR_PICKER_CONSTANTS","COLORSCALE_DESCRIPTIONS","colorscaleOptions","COLORSCALE_TYPES","filter","type","map","label","value","_","context","localize","onColorscaleTypeChange","Component","propTypes","PropTypes","func","array","string","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;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AKG,QAHjB;AAIE,uBAAW,KAJb;AAKE,wBAAY,KALd;AAME,yBAAagB,EAAE,0BAAF;AANf,YADF;AASGV,wBACC;AAAC,2BAAD;AAAA;AACE,0CAAC,0BAAD;AACE,wBAAUF,kBADZ;AAEE,0BAAYC,QAFd;AAGE,qBAAO,GAHT;AAIE,8BAAgB,KAAKT,KAAL,CAAWC,sBAJ7B;AAKE,sCAAwB,KAAKsB,sBAL/B;AAME,yCANF;AAOE,2BAAa;AAPf,cADF;AAUE;AAAC,4BAAD;AAAA;AAAOb;AAAP;AAVF,WADD,GAaG;AAtBN,SADD,GAyBG;AA5BN,OADF;AAgCD;;;;EAnEiBc,gB;;AAsEpB1B,MAAM2B,SAAN,GAAkB;AAChBjB,sBAAoBkB,oBAAUC,IADd;AAEhBlB,YAAUiB,oBAAUE,KAFJ;AAGhBV,SAAOQ,oBAAUG,MAHD;AAIhB3B,mBAAiBwB,oBAAUG;AAJX,CAAlB;;AAOA/B,MAAMgC,WAAN,GAAoBC,8BAApB;;kBAEejC,K","file":"ColorscalePicker.js","sourcesContent":["import ColorscalePicker, {Colorscale, COLOR_PICKER_CONSTANTS} from 'react-colorscales';\nimport Dropdown from './Dropdown';\nimport Info from '../fields/Info';\nimport PropTypes from 'prop-types';\nimport React, {Component, Fragment} from 'react';\nimport {EditorControlsContext} from '../../context';\n\nclass Scale extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n selectedColorscaleType: props.initialCategory || 'sequential',\n showColorscalePicker: false,\n };\n\n this.onChange = this.onChange.bind(this);\n this.onClick = this.onClick.bind(this);\n }\n\n onClick() {\n this.setState({\n showColorscalePicker: !this.state.showColorscalePicker,\n });\n }\n\n onChange(selectedColorscaleType) {\n this.setState({selectedColorscaleType});\n }\n\n render() {\n const {onColorscaleChange, selected} = this.props;\n const {selectedColorscaleType, showColorscalePicker} = this.state;\n const description = COLOR_PICKER_CONSTANTS.COLORSCALE_DESCRIPTIONS[selectedColorscaleType];\n const colorscaleOptions = COLOR_PICKER_CONSTANTS.COLORSCALE_TYPES.filter(\n type => type !== 'custom'\n ).map(type => ({\n label: type + ' scales',\n value: type,\n }));\n const _ = this.context.localize;\n\n return (\n
\n \n\n {showColorscalePicker ? (\n
\n \n {description ? (\n \n \n {description}\n \n ) : null}\n
\n ) : null}\n
\n );\n }\n}\n\nScale.propTypes = {\n onColorscaleChange: PropTypes.func,\n selected: PropTypes.array,\n label: PropTypes.string,\n initialCategory: PropTypes.string,\n};\n\nScale.contextType = EditorControlsContext;\n\nexport default Scale;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/Dropdown.js b/lib/components/widgets/Dropdown.js new file mode 100644 index 000000000..36aa2f08b --- /dev/null +++ b/lib/components/widgets/Dropdown.js @@ -0,0 +1,164 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _reactSelect = require('react-select'); + +var _reactSelect2 = _interopRequireDefault(_reactSelect); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Dropdown = function (_Component) { + _inherits(Dropdown, _Component); + + function Dropdown(props) { + _classCallCheck(this, Dropdown); + + var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props)); + + _this.onChange = _this.onChange.bind(_this); + return _this; + } + + _createClass(Dropdown, [{ + key: 'onChange', + value: function onChange(selection) { + var _props = this.props, + multi = _props.multi, + onChange = _props.onChange, + valueKey = _props.valueKey; + + + if (!selection) { + return onChange(null); + } else if (multi) { + return onChange(selection.map(function (s) { + return s[valueKey]; + })); + } + + return onChange(selection[valueKey]); + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + backspaceToRemoveMessage = _props2.backspaceToRemoveMessage, + minWidth = _props2.minWidth, + placeholder = _props2.placeholder, + clearable = _props2.clearable, + value = _props2.value, + options = _props2.options, + searchable = _props2.searchable, + multi = _props2.multi, + optionRenderer = _props2.optionRenderer, + valueRenderer = _props2.valueRenderer, + noResultsText = _props2.noResultsText, + valueKey = _props2.valueKey, + disabled = _props2.disabled, + className = _props2.className, + width = _props2.width; + var _ = this.context.localize; + + + var dropdownStyle = { minWidth: minWidth }; + if (width) { + dropdownStyle.width = width; + } + + var opts = options.slice(); + for (var i = 0; i < opts.length; i++) { + if (typeof opts[i] === 'string') { + opts[i] = _defineProperty({ label: opts[i] }, valueKey, opts[i]); + } + } + + var dropdownContainerClass = (0, _classnames2.default)('dropdown-container', { + 'dropdown--dark': this.props.backgroundDark + }); + + return _react2.default.createElement( + 'div', + { className: dropdownContainerClass, style: dropdownStyle }, + _react2.default.createElement(_reactSelect2.default, { + backspaceToRemoveMessage: backspaceToRemoveMessage, + placeholder: placeholder || _('Select an Option'), + clearable: clearable, + value: value, + options: opts, + searchable: searchable, + onChange: this.onChange, + multi: multi, + optionRenderer: optionRenderer, + valueRenderer: valueRenderer, + noResultsText: noResultsText || _('No Results'), + valueKey: valueKey, + disabled: disabled, + className: className + }) + ); + } + }]); + + return Dropdown; +}(_react.Component); + +Dropdown.defaultProps = { + clearable: true, + multi: false, + searchable: false, + minWidth: '120px', + valueKey: 'value', + disabled: false +}; + +Dropdown.propTypes = { + backspaceToRemoveMessage: _propTypes2.default.string, + backgroundDark: _propTypes2.default.bool, + clearable: _propTypes2.default.bool, + onChange: _propTypes2.default.func.isRequired, + options: _propTypes2.default.array.isRequired, + placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), + searchable: _propTypes2.default.bool, + minWidth: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), + valueKey: _propTypes2.default.string, + value: _propTypes2.default.any, + multi: _propTypes2.default.bool, + optionRenderer: _propTypes2.default.func, + valueRenderer: _propTypes2.default.func, + noResultsText: _propTypes2.default.string, + disabled: _propTypes2.default.bool, + className: _propTypes2.default.string, + width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]) +}; + +Dropdown.contextType = _context.EditorControlsContext; + +exports.default = Dropdown; +//# sourceMappingURL=Dropdown.js.map \ No newline at end of file diff --git a/lib/components/widgets/Dropdown.js.map b/lib/components/widgets/Dropdown.js.map new file mode 100644 index 000000000..40d031c80 --- /dev/null +++ b/lib/components/widgets/Dropdown.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/Dropdown.js"],"names":["Dropdown","props","onChange","bind","selection","multi","valueKey","map","s","backspaceToRemoveMessage","minWidth","placeholder","clearable","value","options","searchable","optionRenderer","valueRenderer","noResultsText","disabled","className","width","_","context","localize","dropdownStyle","opts","slice","i","length","label","dropdownContainerClass","backgroundDark","Component","defaultProps","propTypes","PropTypes","string","bool","func","isRequired","array","oneOfType","object","number","any","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,Q;;;AACJ,oBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oHACXA,KADW;;AAGjB,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AAHiB;AAIlB;;;;6BAEQC,S,EAAW;AAAA,mBACkB,KAAKH,KADvB;AAAA,UACXI,KADW,UACXA,KADW;AAAA,UACJH,QADI,UACJA,QADI;AAAA,UACMI,QADN,UACMA,QADN;;;AAGlB,UAAI,CAACF,SAAL,EAAgB;AACd,eAAOF,SAAS,IAAT,CAAP;AACD,OAFD,MAEO,IAAIG,KAAJ,EAAW;AAChB,eAAOH,SAASE,UAAUG,GAAV,CAAc;AAAA,iBAAKC,EAAEF,QAAF,CAAL;AAAA,SAAd,CAAT,CAAP;AACD;;AAED,aAAOJ,SAASE,UAAUE,QAAV,CAAT,CAAP;AACD;;;6BAEQ;AAAA,oBAiBH,KAAKL,KAjBF;AAAA,UAELQ,wBAFK,WAELA,wBAFK;AAAA,UAGLC,QAHK,WAGLA,QAHK;AAAA,UAILC,WAJK,WAILA,WAJK;AAAA,UAKLC,SALK,WAKLA,SALK;AAAA,UAMLC,KANK,WAMLA,KANK;AAAA,UAOLC,OAPK,WAOLA,OAPK;AAAA,UAQLC,UARK,WAQLA,UARK;AAAA,UASLV,KATK,WASLA,KATK;AAAA,UAULW,cAVK,WAULA,cAVK;AAAA,UAWLC,aAXK,WAWLA,aAXK;AAAA,UAYLC,aAZK,WAYLA,aAZK;AAAA,UAaLZ,QAbK,WAaLA,QAbK;AAAA,UAcLa,QAdK,WAcLA,QAdK;AAAA,UAeLC,SAfK,WAeLA,SAfK;AAAA,UAgBLC,KAhBK,WAgBLA,KAhBK;AAAA,UAmBUC,CAnBV,GAmB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nBL,kBAAgBI,oBAAUE,IAFP;AAGnB1B,aAAWwB,oBAAUE,IAHF;AAInBpC,YAAUkC,oBAAUG,IAAV,CAAeC,UAJN;AAKnB1B,WAASsB,oBAAUK,KAAV,CAAgBD,UALN;AAMnB7B,eAAayB,oBAAUM,SAAV,CAAoB,CAACN,oBAAUC,MAAX,EAAmBD,oBAAUO,MAA7B,CAApB,CANM;AAOnB5B,cAAYqB,oBAAUE,IAPH;AAQnB5B,YAAU0B,oBAAUM,SAAV,CAAoB,CAACN,oBAAUC,MAAX,EAAmBD,oBAAUQ,MAA7B,CAApB,CARS;AASnBtC,YAAU8B,oBAAUC,MATD;AAUnBxB,SAAOuB,oBAAUS,GAVE;AAWnBxC,SAAO+B,oBAAUE,IAXE;AAYnBtB,kBAAgBoB,oBAAUG,IAZP;AAanBtB,iBAAemB,oBAAUG,IAbN;AAcnBrB,iBAAekB,oBAAUC,MAdN;AAenBlB,YAAUiB,oBAAUE,IAfD;AAgBnBlB,aAAWgB,oBAAUC,MAhBF;AAiBnBhB,SAAOe,oBAAUM,SAAV,CAAoB,CAACN,oBAAUC,MAAX,EAAmBD,oBAAUQ,MAA7B,CAApB;AAjBY,CAArB;;AAoBA5C,SAAS8C,WAAT,GAAuBC,8BAAvB;;kBAEe/C,Q","file":"Dropdown.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport Select from 'react-select';\nimport classnames from 'classnames';\nimport {EditorControlsContext} from '../../context';\n\nclass Dropdown extends Component {\n constructor(props) {\n super(props);\n\n this.onChange = this.onChange.bind(this);\n }\n\n onChange(selection) {\n const {multi, onChange, valueKey} = this.props;\n\n if (!selection) {\n return onChange(null);\n } else if (multi) {\n return onChange(selection.map(s => s[valueKey]));\n }\n\n return onChange(selection[valueKey]);\n }\n\n render() {\n const {\n backspaceToRemoveMessage,\n minWidth,\n placeholder,\n clearable,\n value,\n options,\n searchable,\n multi,\n optionRenderer,\n valueRenderer,\n noResultsText,\n valueKey,\n disabled,\n className,\n width,\n } = this.props;\n\n const {localize: _} = this.context;\n\n const dropdownStyle = {minWidth};\n if (width) {\n dropdownStyle.width = width;\n }\n\n const opts = options.slice();\n for (let i = 0; i < opts.length; i++) {\n if (typeof opts[i] === 'string') {\n opts[i] = {label: opts[i], [valueKey]: opts[i]};\n }\n }\n\n const dropdownContainerClass = classnames('dropdown-container', {\n 'dropdown--dark': this.props.backgroundDark,\n });\n\n return (\n
\n \n
\n );\n }\n}\n\nDropdown.defaultProps = {\n clearable: true,\n multi: false,\n searchable: false,\n minWidth: '120px',\n valueKey: 'value',\n disabled: false,\n};\n\nDropdown.propTypes = {\n backspaceToRemoveMessage: PropTypes.string,\n backgroundDark: PropTypes.bool,\n clearable: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n options: PropTypes.array.isRequired,\n placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n searchable: PropTypes.bool,\n minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n valueKey: PropTypes.string,\n value: PropTypes.any,\n multi: PropTypes.bool,\n optionRenderer: PropTypes.func,\n valueRenderer: PropTypes.func,\n noResultsText: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n};\n\nDropdown.contextType = EditorControlsContext;\n\nexport default Dropdown;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/Dropzone.js b/lib/components/widgets/Dropzone.js new file mode 100644 index 000000000..55c3366e7 --- /dev/null +++ b/lib/components/widgets/Dropzone.js @@ -0,0 +1,222 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _reactDropzone = require('react-dropzone'); + +var _reactDropzone2 = _interopRequireDefault(_reactDropzone); + +var _context = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Dropzone = function (_Component) { + _inherits(Dropzone, _Component); + + function Dropzone(props, context) { + _classCallCheck(this, Dropzone); + + var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context)); + + var _ = context.localize; + + _this.state = { + content: '' + }; + + _this.validFiletypes = { + image: _('image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp') + }; + + _this.onDrop = _this.onDrop.bind(_this); + _this.renderSuccess = _this.renderSuccess.bind(_this); + return _this; + } + + _createClass(Dropzone, [{ + key: 'renderSuccess', + value: function renderSuccess(value) { + var _ = this.context.localize; + + if (this.props.fileType === 'image') { + return _react2.default.createElement('div', { className: 'dropzone-container__image', style: { backgroundImage: 'url(' + value + ')' } }); + } + + return _react2.default.createElement( + 'div', + { className: 'dropzone-container__message' }, + _('File loaded!') + ); + } + }, { + key: 'componentWillMount', + value: function componentWillMount() { + var _ = this.context.localize; + + if (this.props.value && this.props.value !== '') { + this.setState({ content: this.renderSuccess(this.props.value) }); + return; + } + + this.setState({ + content: _react2.default.createElement( + 'div', + { className: 'dropzone-container__message' }, + _react2.default.createElement( + 'p', + null, + _('Drop the ') + this.props.fileType + _(' to upload here or click to choose a file from your computer.') + ), + this.props.fileType === 'image' ? _react2.default.createElement( + 'p', + null, + _('Supported formats are: ') + this.validFiletypes[this.props.fileType].split('image/').join('') + '.' + ) : null + ) + }); + } + }, { + key: 'onLoad', + value: function onLoad(e) { + var _ = this.context.localize; + var supportedFileTypes = this.props.fileType === 'image' ? this.validFiletypes[this.props.fileType].split('image/').join('') : this.validFiletypes[this.props.fileType]; + + var parsingError = _react2.default.createElement( + 'div', + { className: 'dropzone-container__message' }, + _react2.default.createElement( + 'p', + null, + _('Yikes! An error occurred while parsing this file.') + ), + _react2.default.createElement( + 'p', + null, + _('Try again with a supported file format: ') + supportedFileTypes + '.' + ) + ); + + if (this.props.fileType === 'image') { + try { + this.props.onUpdate(e.target.result); + this.setState({ + content: this.renderSuccess(e.target.result) + }); + } catch (error) { + console.warn(error); // eslint-disable-line + this.setState({ + content: parsingError + }); + } + } + } + }, { + key: 'onDrop', + value: function onDrop(accepted, rejected) { + var _this2 = this; + + var _ = this.context.localize; + var reader = new FileReader(); + + if (accepted.length) { + if (accepted.length > 1) { + this.setState({ + content: _react2.default.createElement( + 'div', + { className: 'dropzone-container__message' }, + _react2.default.createElement( + 'p', + null, + _('Yikes! You can only upload one file at a time.') + ), + _react2.default.createElement( + 'p', + null, + _('To upload multiple files, create multiple files and upload them individually.') + ) + ) + }); + return; + } + this.setState({ content: _('Loading...') }); + reader.onload = function (e) { + return _this2.onLoad(e); + }; + if (this.props.fileType === 'image') { + reader.readAsDataURL(accepted[0]); + } + } + + if (rejected.length) { + var supportedFileTypes = this.props.fileType === 'image' ? this.validFiletypes[this.props.fileType].split('image/').join('') : this.validFiletypes[this.props.fileType]; + + this.setState({ + content: _react2.default.createElement( + 'div', + { className: 'dropzone-container__message' }, + _react2.default.createElement( + 'p', + null, + _("Yikes! This doesn't look like a valid ") + this.props.fileType + _(' to us. ') + ), + _react2.default.createElement( + 'p', + null, + _('Try again with a ') + supportedFileTypes + ' file.' + ) + ) + }); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + _reactDropzone2.default, + { + accept: this.validFiletypes[this.props.fileType], + onDrop: this.onDrop, + className: 'dropzone-container', + activeClassName: 'dropzone-container--active', + rejectClassName: 'dropzone-container--rejected' + }, + _react2.default.createElement( + 'div', + { className: 'dropzone-container__content' }, + this.state.content + ) + ); + } + }]); + + return Dropzone; +}(_react.Component); + +Dropzone.propTypes = { + fileType: _propTypes2.default.string.isRequired, + onUpdate: _propTypes2.default.func, + value: _propTypes2.default.any +}; + +Dropzone.contextType = _context.EditorControlsContext; + +exports.default = Dropzone; +//# sourceMappingURL=Dropzone.js.map \ No newline at end of file diff --git a/lib/components/widgets/Dropzone.js.map b/lib/components/widgets/Dropzone.js.map new file mode 100644 index 000000000..9dea0315e --- /dev/null +++ b/lib/components/widgets/Dropzone.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/Dropzone.js"],"names":["Dropzone","props","context","_","localize","state","content","validFiletypes","image","onDrop","bind","renderSuccess","value","fileType","backgroundImage","setState","split","join","e","supportedFileTypes","parsingError","onUpdate","target","result","error","console","warn","accepted","rejected","reader","FileReader","length","onload","onLoad","readAsDataURL","Component","propTypes","PropTypes","string","isRequired","func","any","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Q;;;AACJ,oBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oHACpBD,KADoB,EACbC,OADa;;AAE1B,QAAMC,IAAID,QAAQE,QAAlB;;AAEA,UAAKC,KAAL,GAAa;AACXC,eAAS;AADE,KAAb;;AAIA,UAAKC,cAAL,GAAsB;AACpBC,aAAOL,EAAE,+EAAF;A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T,GAAuBC,8BAAvB;;kBAEe3C,Q","file":"Dropzone.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport Drop from 'react-dropzone';\nimport {EditorControlsContext} from '../../context';\n\nclass Dropzone extends Component {\n constructor(props, context) {\n super(props, context);\n const _ = context.localize;\n\n this.state = {\n content: '',\n };\n\n this.validFiletypes = {\n image: _('image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp'),\n };\n\n this.onDrop = this.onDrop.bind(this);\n this.renderSuccess = this.renderSuccess.bind(this);\n }\n\n renderSuccess(value) {\n const _ = this.context.localize;\n\n if (this.props.fileType === 'image') {\n return (\n
\n );\n }\n\n return
{_('File loaded!')}
;\n }\n\n componentWillMount() {\n const _ = this.context.localize;\n\n if (this.props.value && this.props.value !== '') {\n this.setState({content: this.renderSuccess(this.props.value)});\n return;\n }\n\n this.setState({\n content: (\n
\n

\n {_('Drop the ') +\n this.props.fileType +\n _(' to upload here or click to choose a file from your computer.')}\n

\n\n {this.props.fileType === 'image' ? (\n

\n {_('Supported formats are: ') +\n this.validFiletypes[this.props.fileType].split('image/').join('') +\n '.'}\n

\n ) : null}\n
\n ),\n });\n }\n\n onLoad(e) {\n const _ = this.context.localize;\n const supportedFileTypes =\n this.props.fileType === 'image'\n ? this.validFiletypes[this.props.fileType].split('image/').join('')\n : this.validFiletypes[this.props.fileType];\n\n const parsingError = (\n
\n

{_('Yikes! An error occurred while parsing this file.')}

\n

{_('Try again with a supported file format: ') + supportedFileTypes + '.'}

\n
\n );\n\n if (this.props.fileType === 'image') {\n try {\n this.props.onUpdate(e.target.result);\n this.setState({\n content: this.renderSuccess(e.target.result),\n });\n } catch (error) {\n console.warn(error); // eslint-disable-line\n this.setState({\n content: parsingError,\n });\n }\n }\n }\n\n onDrop(accepted, rejected) {\n const _ = this.context.localize;\n const reader = new FileReader();\n\n if (accepted.length) {\n if (accepted.length > 1) {\n this.setState({\n content: (\n
\n

{_('Yikes! You can only upload one file at a time.')}

\n

\n {_('To upload multiple files, create multiple files and upload them individually.')}\n

\n
\n ),\n });\n return;\n }\n this.setState({content: _('Loading...')});\n reader.onload = e => this.onLoad(e);\n if (this.props.fileType === 'image') {\n reader.readAsDataURL(accepted[0]);\n }\n }\n\n if (rejected.length) {\n const supportedFileTypes =\n this.props.fileType === 'image'\n ? this.validFiletypes[this.props.fileType].split('image/').join('')\n : this.validFiletypes[this.props.fileType];\n\n this.setState({\n content: (\n
\n

\n {_(\"Yikes! This doesn't look like a valid \") + this.props.fileType + _(' to us. ')}\n

\n

{_('Try again with a ') + supportedFileTypes + ' file.'}

\n
\n ),\n });\n }\n }\n\n render() {\n return (\n \n
{this.state.content}
\n \n );\n }\n}\n\nDropzone.propTypes = {\n fileType: PropTypes.string.isRequired,\n onUpdate: PropTypes.func,\n value: PropTypes.any,\n};\n\nDropzone.contextType = EditorControlsContext;\n\nexport default Dropzone;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/EditableText.js b/lib/components/widgets/EditableText.js new file mode 100644 index 000000000..5674c61d6 --- /dev/null +++ b/lib/components/widgets/EditableText.js @@ -0,0 +1,162 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ENTER_KEYCODE = 13; + +// A generic component to handle text that can be edited when the user +// clicks on it. + +var EditableText = function (_Component) { + _inherits(EditableText, _Component); + + function EditableText(props) { + _classCallCheck(this, EditableText); + + var _this = _possibleConstructorReturn(this, (EditableText.__proto__ || Object.getPrototypeOf(EditableText)).call(this, props)); + + _this.handleFocus = _this.handleFocus.bind(_this); + _this.handleChange = _this.handleChange.bind(_this); + _this.handleUpdate = _this.handleUpdate.bind(_this); + _this.handleKeyPress = _this.handleKeyPress.bind(_this); + _this.handleWheel = _this.handleWheel.bind(_this); + _this.getRef = _this.getRef.bind(_this); + return _this; + } + + _createClass(EditableText, [{ + key: 'getRef', + value: function getRef(c) { + this._ref = c; + } + + // Selects/highlights all of the text in the filename input + + }, { + key: 'handleFocus', + value: function handleFocus(event) { + event.target.select(); + } + }, { + key: 'handleChange', + value: function handleChange(event) { + var onChange = this.props.onChange; + + + if (onChange) { + onChange(event.target.value); + } + } + }, { + key: 'handleUpdate', + value: function handleUpdate(event) { + var onUpdate = this.props.onUpdate; + + + if (onUpdate) { + onUpdate(event.target.value); + } + } + }, { + key: 'handleKeyPress', + value: function handleKeyPress(event) { + // This will force handleUpdate to be called via the input's onBlur + if ((event.keyCode || event.which) === ENTER_KEYCODE) { + this._ref.blur(); + } + } + }, { + key: 'handleWheel', + value: function handleWheel(event) { + if (this.props.onWheel && document.activeElement === this._ref) { + this.props.onWheel(event); + } + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + type = _props.type, + className = _props.className, + text = _props.text, + disable = _props.disable, + autoFocus = _props.autoFocus, + onKeyDown = _props.onKeyDown, + placeholder = _props.placeholder, + readOnly = _props.readOnly, + size = _props.size; + + return _react2.default.createElement('input', { + ref: this.getRef, + type: type, + className: className || '', + value: text, + onFocus: this.handleFocus, + onChange: this.handleChange, + onBlur: this.handleUpdate, + disabled: disable, + autoFocus: autoFocus, + onKeyPress: this.handleKeyPress, + onKeyDown: onKeyDown, + onWheel: this.handleWheel, + placeholder: placeholder, + readOnly: readOnly, + size: size + }); + } + }]); + + return EditableText; +}(_react.Component); + +EditableText.propTypes = { + // Called with input value on changes (as the user types) + onChange: _propTypes2.default.func, + + // Called with input value on blur (and enter if no onEnter is given) + onUpdate: _propTypes2.default.func, + + // Called on input keyDown events + onKeyDown: _propTypes2.default.func, + + onWheel: _propTypes2.default.func, + // Input value property ... + text: _propTypes2.default.any, + + // Input properties + placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), + className: _propTypes2.default.string, + disable: _propTypes2.default.bool, + autoFocus: _propTypes2.default.bool, + readOnly: _propTypes2.default.bool, + type: _propTypes2.default.oneOf(['text', 'password']), + size: _propTypes2.default.number +}; + +EditableText.defaultProps = { + readOnly: false, + type: 'text' +}; + +exports.default = EditableText; +//# sourceMappingURL=EditableText.js.map \ No newline at end of file diff --git a/lib/components/widgets/EditableText.js.map b/lib/components/widgets/EditableText.js.map new file mode 100644 index 000000000..169695097 --- /dev/null +++ b/lib/components/widgets/EditableText.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/EditableText.js"],"names":["ENTER_KEYCODE","EditableText","props","handleFocus","bind","handleChange","handleUpdate","handleKeyPress","handleWheel","getRef","c","_ref","event","target","select","onChange","value","onUpdate","keyCode","which","blur","onWheel","document","activeElement","type","className","text","disable","autoFocus","onKeyDown","placeholder","readOnly","size","Component","propTypes","PropTypes","func","any","oneOfType","string","number","bool","oneOf","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;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UK;AArBO,CAAzB;;AAwBAvC,aAAa0C,YAAb,GAA4B;AAC1BZ,YAAU,KADgB;AAE1BP,QAAM;AAFoB,CAA5B;;kBAKevB,Y","file":"EditableText.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nconst ENTER_KEYCODE = 13;\n\n// A generic component to handle text that can be edited when the user\n// clicks on it.\nclass EditableText extends Component {\n constructor(props) {\n super(props);\n\n this.handleFocus = this.handleFocus.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.handleUpdate = this.handleUpdate.bind(this);\n this.handleKeyPress = this.handleKeyPress.bind(this);\n this.handleWheel = this.handleWheel.bind(this);\n this.getRef = this.getRef.bind(this);\n }\n\n getRef(c) {\n this._ref = c;\n }\n\n // Selects/highlights all of the text in the filename input\n handleFocus(event) {\n event.target.select();\n }\n\n handleChange(event) {\n const {onChange} = this.props;\n\n if (onChange) {\n onChange(event.target.value);\n }\n }\n\n handleUpdate(event) {\n const {onUpdate} = this.props;\n\n if (onUpdate) {\n onUpdate(event.target.value);\n }\n }\n\n handleKeyPress(event) {\n // This will force handleUpdate to be called via the input's onBlur\n if ((event.keyCode || event.which) === ENTER_KEYCODE) {\n this._ref.blur();\n }\n }\n\n handleWheel(event) {\n if (this.props.onWheel && document.activeElement === this._ref) {\n this.props.onWheel(event);\n }\n }\n\n render() {\n const {\n type,\n className,\n text,\n disable,\n autoFocus,\n onKeyDown,\n placeholder,\n readOnly,\n size,\n } = this.props;\n return (\n \n );\n }\n}\n\nEditableText.propTypes = {\n // Called with input value on changes (as the user types)\n onChange: PropTypes.func,\n\n // Called with input value on blur (and enter if no onEnter is given)\n onUpdate: PropTypes.func,\n\n // Called on input keyDown events\n onKeyDown: PropTypes.func,\n\n onWheel: PropTypes.func,\n // Input value property ...\n text: PropTypes.any,\n\n // Input properties\n placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n className: PropTypes.string,\n disable: PropTypes.bool,\n autoFocus: PropTypes.bool,\n readOnly: PropTypes.bool,\n type: PropTypes.oneOf(['text', 'password']),\n size: PropTypes.number,\n};\n\nEditableText.defaultProps = {\n readOnly: false,\n type: 'text',\n};\n\nexport default EditableText;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/FlaglistCheckboxGroup.js b/lib/components/widgets/FlaglistCheckboxGroup.js new file mode 100644 index 000000000..93031c4a8 --- /dev/null +++ b/lib/components/widgets/FlaglistCheckboxGroup.js @@ -0,0 +1,162 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _CheckboxGroup = require('./CheckboxGroup'); + +var _CheckboxGroup2 = _interopRequireDefault(_CheckboxGroup); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +// Component handles activeOption with shape "x+y+z" +// and ties it to the CheckboxGroup Component +var FlaglistCheckboxGroup = function (_Component) { + _inherits(FlaglistCheckboxGroup, _Component); + + function FlaglistCheckboxGroup(props) { + _classCallCheck(this, FlaglistCheckboxGroup); + + var _this = _possibleConstructorReturn(this, (FlaglistCheckboxGroup.__proto__ || Object.getPrototypeOf(FlaglistCheckboxGroup)).call(this, props)); + + var currentActiveOption = void 0; + if (props.activeOption !== null) { + currentActiveOption = props.activeOption; + } else { + currentActiveOption = ''; + } + + _this.state = { + activeOption: _this.parseFlags(currentActiveOption) + }; + + _this.handleChange = _this.handleChange.bind(_this); + return _this; + } + + // convert plotly.js's "all" or "none" option in its `flaglist` type + // to a series of options separated by `+` that our component can handle + + + _createClass(FlaglistCheckboxGroup, [{ + key: 'parseFlags', + value: function parseFlags(option) { + var activeOption = void 0; + if (option === 'all') { + activeOption = this.props.options.map(function (o) { + return o.value; + }).join('+'); + } else if (option === 'none') { + activeOption = ''; + } else { + activeOption = option; + } + return activeOption; + } + + // Sync local state to parent props. + + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + this.setState({ activeOption: this.parseFlags(nextProps.activeOption) }); + } + + // Called whenever a checkbox is changed, this updates the local + // state to reflect the new activeOptions and then called props.onChange with + // the new options. + + }, { + key: 'handleChange', + value: function handleChange(newOptions) { + var newActiveOptions = ''; + + newOptions.map(function (option) { + if (option.checked === true) { + newActiveOptions += option.value + '+'; + } + }); + + newActiveOptions = newActiveOptions.slice(0, -1); + + if (newActiveOptions.length === 0) { + newActiveOptions = 'none'; + } + + this.setState({ activeOption: newActiveOptions }); + this.props.onChange(newActiveOptions); + } + + // Turns the activeOptions "e.g "x+y+z" into an array that + // the CheckboxGroup component can handle + + }, { + key: 'renderCheckedOption', + value: function renderCheckedOption() { + var activeOptions = typeof this.state.activeOption === 'string' ? this.state.activeOption.split('+') : [this.state.activeOption]; + var allOptions = this.props.options; + var newOptions = []; + + allOptions.map(function (option) { + var currentChecked = void 0; + + if (activeOptions.indexOf(option.value) > -1) { + currentChecked = true; + } else { + currentChecked = false; + } + + newOptions.push({ + label: option.label, + value: option.value, + checked: currentChecked + }); + }); + + return newOptions; + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(_CheckboxGroup2.default, { + options: this.renderCheckedOption(), + onChange: this.handleChange, + className: this.props.className, + orientation: this.props.orientation + }); + } + }]); + + return FlaglistCheckboxGroup; +}(_react.Component); + +FlaglistCheckboxGroup.propTypes = { + options: _propTypes2.default.arrayOf(_propTypes2.default.shape({ + value: _propTypes2.default.any.isRequired, + label: _propTypes2.default.string.isRequired + })).isRequired, + activeOption: _propTypes2.default.any, + onChange: _propTypes2.default.func, + className: _propTypes2.default.string, + orientation: _propTypes2.default.string +}; + +exports.default = FlaglistCheckboxGroup; +//# sourceMappingURL=FlaglistCheckboxGroup.js.map \ No newline at end of file diff --git a/lib/components/widgets/FlaglistCheckboxGroup.js.map b/lib/components/widgets/FlaglistCheckboxGroup.js.map new file mode 100644 index 000000000..9de34adab --- /dev/null +++ b/lib/components/widgets/FlaglistCheckboxGroup.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/FlaglistCheckboxGroup.js"],"names":["FlaglistCheckboxGroup","props","currentActiveOption","activeOption","state","parseFlags","handleChange","bind","option","options","map","o","value","join","nextProps","setState","newOptions","newActiveOptions","checked","slice","length","onChange","activeOptions","split","allOptions","currentChecked","indexOf","push","label","renderCheckedOption","className","orientation","Component","propTypes","PropTypes","arrayOf","shape","any","isRequired","string","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;AAEA;AACA;IACMA,qB;;;AACJ,iCAAYC,KAAZ,EAAmB;AAAA;;AAAA,8IACXA,KADW;;AAGjB,QAAIC,4BAAJ;AACA,QAAID,MAAME,YAAN,KAAuB,IAA3B,EAAiC;AAC/BD,4BAAsBD,MAAME,YAA5B;AACD,KAFD,MAEO;AACLD,4BAAsB,EAAtB;AACD;;AAED,UAAKE,KAAL,GAAa;AACXD,oBAAc,MAA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C,KAAKnB,KAAL,CAAWD,YAAZ,CAHN;AAIA,UAAMqB,aAAa,KAAKvB,KAAL,CAAWQ,OAA9B;AACA,UAAMO,aAAa,EAAnB;;AAEAQ,iBAAWd,GAAX,CAAe,kBAAU;AACvB,YAAIe,uBAAJ;;AAEA,YAAIH,cAAcI,OAAd,CAAsBlB,OAAOI,KAA7B,IAAsC,CAAC,CAA3C,EAA8C;AAC5Ca,2BAAiB,IAAjB;AACD,SAFD,MAEO;AACLA,2BAAiB,KAAjB;AACD;;AAEDT,mBAAWW,IAAX,CAAgB;AACdC,iBAAOpB,OAAOoB,KADA;AAEdhB,iBAAOJ,OAAOI,KAFA;AAGdM,mBAASO;AAHK,SAAhB;AAKD,OAdD;;AAgBA,aAAOT,UAAP;AACD;;;6BAEQ;AACP,aACE,8BAAC,uBAAD;AACE,iBAAS,KAAKa,mBAAL,EADX;AAEE,kBAAU,KAAKvB,YAFjB;AAGE,mBAAW,KAAKL,KAAL,CAAW6B,SAHxB;AAIE,qBAAa,KAAK7B,KAAL,CAAW8B;AAJ1B,QADF;AAQD;;;;EAjGiCC,gB;;AAoGpChC,sBAAsBiC,SAAtB,GAAkC;AAChCxB,WAASyB,oBAAUC,OAAV,CACPD,oBAAUE,KAAV,CAAgB;AACdxB,WAAOsB,oBAAUG,GAAV,CAAcC,UADP;AAEdV,WAAOM,oBAAUK,MAAV,CAAiBD;AAFV,GAAhB,CADO,EAKPA,UAN8B;AAOhCnC,gBAAc+B,oBAAUG,GAPQ;AAQhChB,YAAUa,oBAAUM,IARY;AAShCV,aAAWI,oBAAUK,MATW;AAUhCR,eAAaG,oBAAUK;AAVS,CAAlC;;kBAaevC,qB","file":"FlaglistCheckboxGroup.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport CheckboxGroup from './CheckboxGroup';\n\n// Component handles activeOption with shape \"x+y+z\"\n// and ties it to the CheckboxGroup Component\nclass FlaglistCheckboxGroup extends Component {\n constructor(props) {\n super(props);\n\n let currentActiveOption;\n if (props.activeOption !== null) {\n currentActiveOption = props.activeOption;\n } else {\n currentActiveOption = '';\n }\n\n this.state = {\n activeOption: this.parseFlags(currentActiveOption),\n };\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n // convert plotly.js's \"all\" or \"none\" option in its `flaglist` type\n // to a series of options separated by `+` that our component can handle\n parseFlags(option) {\n let activeOption;\n if (option === 'all') {\n activeOption = this.props.options.map(o => o.value).join('+');\n } else if (option === 'none') {\n activeOption = '';\n } else {\n activeOption = option;\n }\n return activeOption;\n }\n\n // Sync local state to parent props.\n componentWillReceiveProps(nextProps) {\n this.setState({activeOption: this.parseFlags(nextProps.activeOption)});\n }\n\n // Called whenever a checkbox is changed, this updates the local\n // state to reflect the new activeOptions and then called props.onChange with\n // the new options.\n handleChange(newOptions) {\n let newActiveOptions = '';\n\n newOptions.map(option => {\n if (option.checked === true) {\n newActiveOptions += option.value + '+';\n }\n });\n\n newActiveOptions = newActiveOptions.slice(0, -1);\n\n if (newActiveOptions.length === 0) {\n newActiveOptions = 'none';\n }\n\n this.setState({activeOption: newActiveOptions});\n this.props.onChange(newActiveOptions);\n }\n\n // Turns the activeOptions \"e.g \"x+y+z\" into an array that\n // the CheckboxGroup component can handle\n renderCheckedOption() {\n const activeOptions =\n typeof this.state.activeOption === 'string'\n ? this.state.activeOption.split('+')\n : [this.state.activeOption];\n const allOptions = this.props.options;\n const newOptions = [];\n\n allOptions.map(option => {\n let currentChecked;\n\n if (activeOptions.indexOf(option.value) > -1) {\n currentChecked = true;\n } else {\n currentChecked = false;\n }\n\n newOptions.push({\n label: option.label,\n value: option.value,\n checked: currentChecked,\n });\n });\n\n return newOptions;\n }\n\n render() {\n return (\n \n );\n }\n}\n\nFlaglistCheckboxGroup.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.any.isRequired,\n label: PropTypes.string.isRequired,\n })\n ).isRequired,\n activeOption: PropTypes.any,\n onChange: PropTypes.func,\n className: PropTypes.string,\n orientation: PropTypes.string,\n};\n\nexport default FlaglistCheckboxGroup;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/Logo.js b/lib/components/widgets/Logo.js new file mode 100644 index 000000000..0461143db --- /dev/null +++ b/lib/components/widgets/Logo.js @@ -0,0 +1,52 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Logo = function (_Component) { + _inherits(Logo, _Component); + + function Logo() { + _classCallCheck(this, Logo); + + return _possibleConstructorReturn(this, (Logo.__proto__ || Object.getPrototypeOf(Logo)).apply(this, arguments)); + } + + _createClass(Logo, [{ + key: 'render', + value: function render() { + return _react2.default.createElement('img', { className: 'sidebar__logo', src: this.props.src }); + } + }]); + + return Logo; +}(_react.Component); + +exports.default = Logo; + + +Logo.plotly_editor_traits = { sidebar_element: true }; + +Logo.propTypes = { + src: _propTypes2.default.string +}; +//# sourceMappingURL=Logo.js.map \ No newline at end of file diff --git a/lib/components/widgets/Logo.js.map b/lib/components/widgets/Logo.js.map new file mode 100644 index 000000000..3815f3120 --- /dev/null +++ b/lib/components/widgets/Logo.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/Logo.js"],"names":["Logo","props","src","Component","plotly_editor_traits","sidebar_element","propTypes","PropTypes","string"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,I;;;;;;;;;;;6BACV;AACP,aAAO,uCAAK,WAAU,eAAf,EAA+B,KAAK,KAAKC,KAAL,CAAWC,GAA/C,GAAP;AACD;;;;EAH+BC,gB;;kBAAbH,I;;;AAMrBA,KAAKI,oBAAL,GAA4B,EAACC,iBAAiB,IAAlB,EAA5B;;AAEAL,KAAKM,SAAL,GAAiB;AACfJ,OAAKK,oBAAUC;AADA,CAAjB","file":"Logo.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nexport default class Logo extends Component {\n render() {\n return ;\n }\n}\n\nLogo.plotly_editor_traits = {sidebar_element: true};\n\nLogo.propTypes = {\n src: PropTypes.string,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/NumericInput.js b/lib/components/widgets/NumericInput.js new file mode 100644 index 000000000..36c9c69f8 --- /dev/null +++ b/lib/components/widgets/NumericInput.js @@ -0,0 +1,255 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DOWN_ARROW = exports.UP_ARROW = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _EditableText = require('./EditableText'); + +var _EditableText2 = _interopRequireDefault(_EditableText); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _fastIsnumeric = require('fast-isnumeric'); + +var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); + +var _reactRangeslider = require('react-rangeslider'); + +var _reactRangeslider2 = _interopRequireDefault(_reactRangeslider); + +var _plotlyIcons = require('plotly-icons'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var UP_ARROW = exports.UP_ARROW = 38; +var DOWN_ARROW = exports.DOWN_ARROW = 40; + +var NumericInput = function (_Component) { + _inherits(NumericInput, _Component); + + function NumericInput(props) { + _classCallCheck(this, NumericInput); + + var _this = _possibleConstructorReturn(this, (NumericInput.__proto__ || Object.getPrototypeOf(NumericInput)).call(this, props)); + + _this.state = { value: props.value }; + _this.onChange = _this.onChange.bind(_this); + _this.updateValue = _this.updateValue.bind(_this); + _this.onKeyDown = _this.onKeyDown.bind(_this); + _this.onWheel = _this.onWheel.bind(_this); + return _this; + } + + _createClass(NumericInput, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (nextProps.value !== this.state.value) { + this.setState({ value: nextProps.value }); + } + } + }, { + key: 'onKeyDown', + value: function onKeyDown(e) { + switch (e.keyCode) { + case UP_ARROW: + this.incrementValue('increase'); + break; + case DOWN_ARROW: + this.incrementValue('decrease'); + break; + default: + break; + } + } + }, { + key: 'onWheel', + value: function onWheel(e) { + e.stopPropagation(); + e.preventDefault(); + if (e.deltaY > 0) { + this.incrementValue('increase'); + } else { + this.incrementValue('decrease'); + } + } + }, { + key: 'onChange', + value: function onChange(value) { + this.setState({ value: value }); + } + }, { + key: 'updateValue', + value: function updateValue(newValue) { + var _props = this.props, + max = _props.max, + min = _props.min, + integerOnly = _props.integerOnly, + propsValue = _props.value; + + var updatedValue = newValue; + + // When the user blurs on non-numeric data reset the component + // to the last known good value (this.props.value). + if (!(0, _fastIsnumeric2.default)(updatedValue)) { + this.setState({ value: propsValue }); + return; + } + + updatedValue = Number(updatedValue); + if (integerOnly) { + updatedValue = Math.floor(updatedValue); + } + + if ((0, _fastIsnumeric2.default)(min)) { + updatedValue = Math.max(min, updatedValue); + } + + if ((0, _fastIsnumeric2.default)(max)) { + updatedValue = Math.min(max, updatedValue); + } + + this.props.onUpdate(updatedValue); + } + }, { + key: 'incrementValue', + value: function incrementValue(direction) { + var _props2 = this.props, + defaultValue = _props2.defaultValue, + min = _props2.min, + _props2$step = _props2.step, + step = _props2$step === undefined ? 1 : _props2$step, + _props2$stepmode = _props2.stepmode, + stepmode = _props2$stepmode === undefined ? 'absolute' : _props2$stepmode; + var value = this.state.value; + + + var valueUpdate = void 0; + if ((0, _fastIsnumeric2.default)(value)) { + var x = parseFloat(value); + var absMode = stepmode === 'absolute'; + if (direction === 'increase') { + valueUpdate = absMode ? x + step : x * (1 + step); + } else { + valueUpdate = absMode ? x - step : x / (1 + step); + } + } else { + // if we are multi-valued and the user is incrementing or decrementing + // update with some sane value so we can "break" out of multi-valued mode. + if ((0, _fastIsnumeric2.default)(defaultValue)) { + valueUpdate = defaultValue; + } else { + // TODO smarter handling depending if user decrements or increments? + valueUpdate = min || 0; + } + } + + // incrementers blur the line between blur and onChange. + this.updateValue(valueUpdate); + } + }, { + key: 'renderArrows', + value: function renderArrows() { + if (!this.props.showArrows || this.props.showSlider) { + return null; + } + + return _react2.default.createElement( + 'div', + { className: 'numeric-input__caret-box' }, + _react2.default.createElement( + 'div', + { + className: 'numeric-input__caret js-numeric-increase', + onClick: this.incrementValue.bind(this, 'increase') + }, + _react2.default.createElement(_plotlyIcons.CarretUpIcon, { className: 'numeric-top-caret-modifier' }) + ), + _react2.default.createElement( + 'div', + { + className: 'numeric-input__caret js-numeric-decrease', + onClick: this.incrementValue.bind(this, 'decrease') + }, + _react2.default.createElement(_plotlyIcons.CarretDownIcon, { className: 'numeric-bottom-caret-modifier' }) + ) + ); + } + }, { + key: 'renderSlider', + value: function renderSlider() { + if (!this.props.showSlider) { + return null; + } + + return _react2.default.createElement(_reactRangeslider2.default, { + min: this.props.min, + max: this.props.max, + step: this.props.step, + value: parseFloat(this.state.value), + onChange: this.updateValue, + tooltip: false + }); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + 'div', + { className: 'numeric-input__wrapper' }, + _react2.default.createElement(_EditableText2.default, { + className: 'numeric-input__number ' + this.props.editableClassName, + placeholder: this.props.placeholder, + text: this.state.value, + type: 'text', + onChange: this.onChange, + onUpdate: this.updateValue, + onKeyDown: this.onKeyDown, + onWheel: this.onWheel + }), + this.renderArrows(), + this.renderSlider() + ); + } + }]); + + return NumericInput; +}(_react.Component); + +exports.default = NumericInput; + + +NumericInput.propTypes = { + defaultValue: _propTypes2.default.any, + editableClassName: _propTypes2.default.string, + integerOnly: _propTypes2.default.bool, + max: _propTypes2.default.number, + min: _propTypes2.default.number, + onUpdate: _propTypes2.default.func.isRequired, + placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), + showArrows: _propTypes2.default.bool, + showSlider: _propTypes2.default.bool, + step: _propTypes2.default.number, + stepmode: _propTypes2.default.string, + value: _propTypes2.default.any +}; + +NumericInput.defaultProps = { + showArrows: true +}; +//# sourceMappingURL=NumericInput.js.map \ No newline at end of file diff --git a/lib/components/widgets/NumericInput.js.map b/lib/components/widgets/NumericInput.js.map new file mode 100644 index 000000000..c6ef06913 --- /dev/null +++ b/lib/components/widgets/NumericInput.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/NumericInput.js"],"names":["UP_ARROW","DOWN_ARROW","NumericInput","props","state","value","onChange","bind","updateValue","onKeyDown","onWheel","nextProps","setState","e","keyCode","incrementValue","stopPropagation","preventDefault","deltaY","newValue","max","min","integerOnly","propsValue","updatedValue","Number","Math","floor","onUpdate","direction","defaultValue","step","stepmode","valueUpdate","x","parseFloat","absMode","showArrows","showSlider","editableClassName","placeholder","renderArrows","renderSlider","Component","propTypes","PropTypes","any","string","bool","number","func","isRequired","oneOfType","defaultProps"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;AAEO,IAAMA,8BAAW,EAAjB;AACA,IAAMC,kCAAa,EAAnB;;IAEcC,Y;;;AACnB,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA,4HACXA,KADW;;AAGjB,UAAKC,KAAL,GAAa,EAACC,OAAOF,MAAME,KAAd,EAAb;AACA,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AACA,UAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBD,IAAjB,OAAnB;AACA,UAAKE,SAAL,GAAiB,MAAKA,SAAL,CAAeF,IAAf,OAAjB;AACA,UAAKG,OAAL,GAAe,MAAKA,OAAL,CAAaH,IAAb,OAAf;AAPiB;AAQlB;;;;8CAEyBI,S,EAAW;AACnC,UAAIA,UAAUN,KAAV,KAAoB,KAAKD,KAAL,CAAWC,KAAnC,EAA0C;AACxC,aAAKO,QAAL,CAAc,EAACP,OAAOM,UAAUN,KAAlB,EAAd;AACD;AACF;;;8BAESQ,C,EAAG;AACX,cAAQA,E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;AAC1BhB,cAAY;AADc,CAA5B","file":"NumericInput.js","sourcesContent":["import EditableText from './EditableText';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport isNumeric from 'fast-isnumeric';\nimport Slider from 'react-rangeslider';\nimport {CarretDownIcon, CarretUpIcon} from 'plotly-icons';\n\nexport const UP_ARROW = 38;\nexport const DOWN_ARROW = 40;\n\nexport default class NumericInput extends Component {\n constructor(props) {\n super(props);\n\n this.state = {value: props.value};\n this.onChange = this.onChange.bind(this);\n this.updateValue = this.updateValue.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onWheel = this.onWheel.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.state.value) {\n this.setState({value: nextProps.value});\n }\n }\n\n onKeyDown(e) {\n switch (e.keyCode) {\n case UP_ARROW:\n this.incrementValue('increase');\n break;\n case DOWN_ARROW:\n this.incrementValue('decrease');\n break;\n default:\n break;\n }\n }\n\n onWheel(e) {\n e.stopPropagation();\n e.preventDefault();\n if (e.deltaY > 0) {\n this.incrementValue('increase');\n } else {\n this.incrementValue('decrease');\n }\n }\n\n onChange(value) {\n this.setState({value});\n }\n\n updateValue(newValue) {\n const {max, min, integerOnly, value: propsValue} = this.props;\n let updatedValue = newValue;\n\n // When the user blurs on non-numeric data reset the component\n // to the last known good value (this.props.value).\n if (!isNumeric(updatedValue)) {\n this.setState({value: propsValue});\n return;\n }\n\n updatedValue = Number(updatedValue);\n if (integerOnly) {\n updatedValue = Math.floor(updatedValue);\n }\n\n if (isNumeric(min)) {\n updatedValue = Math.max(min, updatedValue);\n }\n\n if (isNumeric(max)) {\n updatedValue = Math.min(max, updatedValue);\n }\n\n this.props.onUpdate(updatedValue);\n }\n\n incrementValue(direction) {\n const {defaultValue, min, step = 1, stepmode = 'absolute'} = this.props;\n const {value} = this.state;\n\n let valueUpdate;\n if (isNumeric(value)) {\n const x = parseFloat(value);\n const absMode = stepmode === 'absolute';\n if (direction === 'increase') {\n valueUpdate = absMode ? x + step : x * (1 + step);\n } else {\n valueUpdate = absMode ? x - step : x / (1 + step);\n }\n } else {\n // if we are multi-valued and the user is incrementing or decrementing\n // update with some sane value so we can \"break\" out of multi-valued mode.\n if (isNumeric(defaultValue)) {\n valueUpdate = defaultValue;\n } else {\n // TODO smarter handling depending if user decrements or increments?\n valueUpdate = min || 0;\n }\n }\n\n // incrementers blur the line between blur and onChange.\n this.updateValue(valueUpdate);\n }\n\n renderArrows() {\n if (!this.props.showArrows || this.props.showSlider) {\n return null;\n }\n\n return (\n
\n \n \n
\n \n \n
\n \n );\n }\n\n renderSlider() {\n if (!this.props.showSlider) {\n return null;\n }\n\n return (\n \n );\n }\n\n render() {\n return (\n
\n \n {this.renderArrows()}\n {this.renderSlider()}\n
\n );\n }\n}\n\nNumericInput.propTypes = {\n defaultValue: PropTypes.any,\n editableClassName: PropTypes.string,\n integerOnly: PropTypes.bool,\n max: PropTypes.number,\n min: PropTypes.number,\n onUpdate: PropTypes.func.isRequired,\n placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showArrows: PropTypes.bool,\n showSlider: PropTypes.bool,\n step: PropTypes.number,\n stepmode: PropTypes.string,\n value: PropTypes.any,\n};\n\nNumericInput.defaultProps = {\n showArrows: true,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/RadioBlocks.js b/lib/components/widgets/RadioBlocks.js new file mode 100644 index 000000000..7e5585165 --- /dev/null +++ b/lib/components/widgets/RadioBlocks.js @@ -0,0 +1,128 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var RadioBlocks = function (_Component) { + _inherits(RadioBlocks, _Component); + + function RadioBlocks(props) { + _classCallCheck(this, RadioBlocks); + + var _this = _possibleConstructorReturn(this, (RadioBlocks.__proto__ || Object.getPrototypeOf(RadioBlocks)).call(this, props)); + + _this.state = { activeOption: _this.props.activeOption }; + _this.handleChange = _this.handleChange.bind(_this); + _this.renderOption = _this.renderOption.bind(_this); + return _this; + } + + _createClass(RadioBlocks, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + // Reset the value to the graph's actual value + if (nextProps.activeOption !== this.state.activeOption) { + this.setState({ + activeOption: nextProps.activeOption + }); + } + } + }, { + key: 'handleChange', + value: function handleChange(newValue) { + this.setState({ activeOption: newValue }); + this.props.onOptionChange(newValue); + } + }, { + key: 'renderOption', + value: function renderOption(optionName) { + var _this2 = this; + + var label = optionName.label, + value = optionName.value, + Icon = optionName.icon; + + var defaultActive = this.state.activeOption === value; + + var optionClass = (0, _classnames2.default)('radio-block__option', { + 'radio-block__option--active': defaultActive + }); + + return _react2.default.createElement( + 'div', + { + className: optionClass, + key: value, + checked: defaultActive, + onClick: function onClick() { + return _this2.handleChange(value); + } + }, + Icon ? _react2.default.createElement(Icon, { className: 'radio-block__icon' }) : null, + label ? _react2.default.createElement( + 'span', + null, + label + ) : null + ); + } + }, { + key: 'render', + value: function render() { + var optionList = this.props.options.map(this.renderOption); + + var groupClass = (0, _classnames2.default)('radio-block', 'radio-block__group', { + 'radio-block__group--center': this.props.alignment === 'center' + }); + + return _react2.default.createElement( + 'div', + { className: groupClass }, + optionList + ); + } + }]); + + return RadioBlocks; +}(_react.Component); + +RadioBlocks.propTypes = { + options: _propTypes2.default.arrayOf(_propTypes2.default.shape({ + value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool, _propTypes2.default.number]).isRequired, + label: _propTypes2.default.string, + icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), + disabled: _propTypes2.default.bool + })), + onOptionChange: _propTypes2.default.func.isRequired, + activeOption: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool, _propTypes2.default.number]), + radioClassName: _propTypes2.default.string, + + // One of right, left, center + alignment: _propTypes2.default.string +}; + +exports.default = RadioBlocks; +//# sourceMappingURL=RadioBlocks.js.map \ No newline at end of file diff --git a/lib/components/widgets/RadioBlocks.js.map b/lib/components/widgets/RadioBlocks.js.map new file mode 100644 index 000000000..3bbe9c122 --- /dev/null +++ b/lib/components/widgets/RadioBlocks.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/RadioBlocks.js"],"names":["RadioBlocks","props","state","activeOption","handleChange","bind","renderOption","nextProps","setState","newValue","onOptionChange","optionName","label","value","Icon","icon","defaultActive","optionClass","optionList","options","map","groupClass","alignment","Component","propTypes","PropTypes","arrayOf","shape","oneOfType","string","bool","number","isRequired","node","func","disabled","radioClassName"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,W;;;AACJ,uBAAYC,KAAZ,E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Me,aAAa,0BAAW,aAAX,EAA0B,oBAA1B,EAAgD;AACjE,sCAA8B,KAAKpB,KAAL,CAAWqB,SAAX,KAAyB;AADU,OAAhD,CAAnB;;AAIA,aAAO;AAAA;AAAA,UAAK,WAAWD,UAAhB;AAA6BH;AAA7B,OAAP;AACD;;;;EAnDuBK,gB;;AAsD1BvB,YAAYwB,SAAZ,GAAwB;AACtBL,WAASM,oBAAUC,OAAV,CACPD,oBAAUE,KAAV,CAAgB;AACdd,WAAOY,oBAAUG,SAAV,CAAoB,CAACH,oBAAUI,MAAX,EAAmBJ,oBAAUK,IAA7B,EAAmCL,oBAAUM,MAA7C,CAApB,EAA0EC,UADnE;AAEdpB,WAAOa,oBAAUI,MAFH;AAGdd,UAAMU,oBAAUG,SAAV,CAAoB,CAACH,oBAAUQ,IAAX,EAAiBR,oBAAUS,IAA3B,CAApB,CAHQ;AAIdC,cAAUV,oBAAUK;AAJN,GAAhB,CADO,CADa;AAStBpB,kBAAgBe,oBAAUS,IAAV,CAAeF,UATT;AAUtB7B,gBAAcsB,oBAAUG,SAAV,CAAoB,CAACH,oBAAUI,MAAX,EAAmBJ,oBAAUK,IAA7B,EAAmCL,oBAAUM,MAA7C,CAApB,CAVQ;AAWtBK,kBAAgBX,oBAAUI,MAXJ;;AAatB;AACAP,aAAWG,oBAAUI;AAdC,CAAxB;;kBAiBe7B,W","file":"RadioBlocks.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nclass RadioBlocks extends Component {\n constructor(props) {\n super(props);\n this.state = {activeOption: this.props.activeOption};\n this.handleChange = this.handleChange.bind(this);\n this.renderOption = this.renderOption.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n // Reset the value to the graph's actual value\n if (nextProps.activeOption !== this.state.activeOption) {\n this.setState({\n activeOption: nextProps.activeOption,\n });\n }\n }\n\n handleChange(newValue) {\n this.setState({activeOption: newValue});\n this.props.onOptionChange(newValue);\n }\n\n renderOption(optionName) {\n const {label, value, icon: Icon} = optionName;\n const defaultActive = this.state.activeOption === value;\n\n const optionClass = classnames('radio-block__option', {\n 'radio-block__option--active': defaultActive,\n });\n\n return (\n this.handleChange(value)}\n >\n {Icon ? : null}\n {label ? {label} : null}\n \n );\n }\n\n render() {\n const optionList = this.props.options.map(this.renderOption);\n\n const groupClass = classnames('radio-block', 'radio-block__group', {\n 'radio-block__group--center': this.props.alignment === 'center',\n });\n\n return
{optionList}
;\n }\n}\n\nRadioBlocks.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]).isRequired,\n label: PropTypes.string,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n disabled: PropTypes.bool,\n })\n ),\n onOptionChange: PropTypes.func.isRequired,\n activeOption: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]),\n radioClassName: PropTypes.string,\n\n // One of right, left, center\n alignment: PropTypes.string,\n};\n\nexport default RadioBlocks;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/SymbolSelector.js b/lib/components/widgets/SymbolSelector.js new file mode 100644 index 000000000..3dda9a4a6 --- /dev/null +++ b/lib/components/widgets/SymbolSelector.js @@ -0,0 +1,197 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _plotlyIcons = require('plotly-icons'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var SymbolSelector = function (_Component) { + _inherits(SymbolSelector, _Component); + + function SymbolSelector(props) { + _classCallCheck(this, SymbolSelector); + + var _this = _possibleConstructorReturn(this, (SymbolSelector.__proto__ || Object.getPrototypeOf(SymbolSelector)).call(this, props)); + + _this.state = { + isOpen: false + }; + _this.togglePanel = _this.togglePanel.bind(_this); + return _this; + } + + _createClass(SymbolSelector, [{ + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps, nextState) { + var _props = this.props, + markerColor = _props.markerColor, + borderColor = _props.borderColor; + var nextMarkerColor = nextProps.markerColor, + nextBorderColor = nextProps.borderColor; + + + return this.props.value !== nextProps.value || this.state.isOpen !== nextState.isOpen || markerColor !== nextMarkerColor || borderColor !== nextBorderColor; + } + }, { + key: 'togglePanel', + value: function togglePanel() { + this.setState({ isOpen: !this.state.isOpen }); + } + }, { + key: 'renderActiveOption', + value: function renderActiveOption() { + var _props2 = this.props, + markerColor = _props2.markerColor, + borderColor = _props2.borderColor, + symbolOptions = _props2.symbolOptions, + value = _props2.value; + + var currentSymbol = symbolOptions.find(function (symbol) { + return symbol.value === value; + }); + if (!currentSymbol) { + return _react2.default.createElement( + 'span', + { + style: { + paddingTop: '5px', + paddingLeft: '15px' + } + }, + '-' + ); + } + + var symbolStyle = { + stroke: currentSymbol.fill === 'none' ? markerColor : borderColor, + strokeOpacity: '1', + strokeWidth: '2px', + fill: currentSymbol.fill === 'none' ? 'none' : markerColor + }; + + return _react2.default.createElement( + 'span', + null, + _react2.default.createElement( + 'svg', + { width: '18', height: '18' }, + _react2.default.createElement( + 'g', + { transform: 'translate(8,8)' }, + _react2.default.createElement('path', { d: currentSymbol.label, style: symbolStyle }) + ) + ) + ); + } + }, { + key: 'renderOptions', + value: function renderOptions() { + var _this2 = this; + + var _props3 = this.props, + markerColor = _props3.markerColor, + borderColor = _props3.borderColor, + symbolOptions = _props3.symbolOptions; + + return symbolOptions.map(function (option) { + var fill = option.fill, + value = option.value, + label = option.label; + + + var symbolStyle = { + stroke: fill === 'none' ? markerColor : borderColor, + strokeOpacity: '1', + strokeWidth: '2px', + fill: fill === 'none' ? 'none' : markerColor + }; + return _react2.default.createElement( + 'div', + { + className: 'symbol-selector__item', + key: value, + onClick: function onClick() { + return _this2.props.onChange(value); + } + }, + _react2.default.createElement( + 'svg', + { width: '28', height: '28', className: 'symbol-selector__symbol', 'data-value': value }, + _react2.default.createElement( + 'g', + { transform: 'translate(14,14)' }, + _react2.default.createElement('path', { d: label, style: symbolStyle }) + ) + ) + ); + }); + } + }, { + key: 'render', + value: function render() { + var isOpen = this.state.isOpen; + + var toggleClass = (0, _classnames2.default)('symbol-selector__toggle', { + 'symbol-selector__toggle--dark': this.props.backgroundDark + }); + + return _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'div', + { className: toggleClass, onClick: this.togglePanel }, + _react2.default.createElement( + 'span', + { className: 'symbol-selector__toggle_option' }, + this.renderActiveOption() + ), + _react2.default.createElement( + 'span', + null, + _react2.default.createElement(_plotlyIcons.CarretDownIcon, { className: 'symbol-selector__toggle__caret' }) + ) + ), + isOpen && this.renderOptions() + ); + } + }]); + + return SymbolSelector; +}(_react.Component); + +exports.default = SymbolSelector; + + +SymbolSelector.propTypes = { + backgroundDark: _propTypes2.default.bool, + markerColor: _propTypes2.default.string, + borderColor: _propTypes2.default.string, + value: _propTypes2.default.string, + onChange: _propTypes2.default.func, + symbolOptions: _propTypes2.default.array +}; +//# sourceMappingURL=SymbolSelector.js.map \ No newline at end of file diff --git a/lib/components/widgets/SymbolSelector.js.map b/lib/components/widgets/SymbolSelector.js.map new file mode 100644 index 000000000..1c97e75f1 --- /dev/null +++ b/lib/components/widgets/SymbolSelector.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/SymbolSelector.js"],"names":["SymbolSelector","props","state","isOpen","togglePanel","bind","nextProps","nextState","markerColor","borderColor","nextMarkerColor","nextBorderColor","value","setState","symbolOptions","currentSymbol","find","symbol","paddingTop","paddingLeft","symbolStyle","stroke","fill","strokeOpacity","strokeWidth","label","map","option","onChange","toggleClass","backgroundDark","renderActiveOption","renderOptions","Component","propTypes","PropTypes","bool","string","func","array"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEqBA,c;;;AACnB,0BAAYC,KAAZ,EAAmB;AAAA;;AAAA,gIACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,cAAQ;AADG,KAAb;AAGA,UAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AALiB;AAMlB;;;;0CAEqBC,S,EAAWC,S,EAAW;AAAA,mBACP,KAAKN,KADE;AAAA,UACnCO,WADmC,UACnCA,WADmC;AAAA,UACtBC,WADsB,UACtBA,WADsB;AAAA,UAEtBC,eAFsB,GAE2BJ,SAF3B,CAEnCE,WAFmC;AAAA,UAEQG,eAFR,GAE2BL,SAF3B,CAELG,WAFK;;;AAI1C,aACE,KAAKR,KAAL,CAAWW,KAAX,KAAqBN,UAAUM,KAA/B,IACA,KAAKV,KAAL,CAAWC,MAAX,KAAsBI,UAAUJ,MADhC,IAEAK,gBAAgBE,eAFhB,IAGAD,gBAAgBE,eAJlB;AAMD;;;kCAEa;AACZ,WAA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js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {CarretDownIcon} from 'plotly-icons';\n\nexport default class SymbolSelector extends Component {\n constructor(props) {\n super(props);\n this.state = {\n isOpen: false,\n };\n this.togglePanel = this.togglePanel.bind(this);\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n const {markerColor, borderColor} = this.props;\n const {markerColor: nextMarkerColor, borderColor: nextBorderColor} = nextProps;\n\n return (\n this.props.value !== nextProps.value ||\n this.state.isOpen !== nextState.isOpen ||\n markerColor !== nextMarkerColor ||\n borderColor !== nextBorderColor\n );\n }\n\n togglePanel() {\n this.setState({isOpen: !this.state.isOpen});\n }\n\n renderActiveOption() {\n const {markerColor, borderColor, symbolOptions, value} = this.props;\n const currentSymbol = symbolOptions.find(symbol => symbol.value === value);\n if (!currentSymbol) {\n return (\n \n {'-'}\n \n );\n }\n\n const symbolStyle = {\n stroke: currentSymbol.fill === 'none' ? markerColor : borderColor,\n strokeOpacity: '1',\n strokeWidth: '2px',\n fill: currentSymbol.fill === 'none' ? 'none' : markerColor,\n };\n\n return (\n \n \n \n \n \n \n \n );\n }\n\n renderOptions() {\n const {markerColor, borderColor, symbolOptions} = this.props;\n return symbolOptions.map(option => {\n const {fill, value, label} = option;\n\n const symbolStyle = {\n stroke: fill === 'none' ? markerColor : borderColor,\n strokeOpacity: '1',\n strokeWidth: '2px',\n fill: fill === 'none' ? 'none' : markerColor,\n };\n return (\n this.props.onChange(value)}\n >\n \n \n \n \n \n \n );\n });\n }\n\n render() {\n const {isOpen} = this.state;\n const toggleClass = classnames('symbol-selector__toggle', {\n 'symbol-selector__toggle--dark': this.props.backgroundDark,\n });\n\n return (\n
\n
\n {this.renderActiveOption()}\n \n \n \n
\n {isOpen && this.renderOptions()}\n
\n );\n }\n}\n\nSymbolSelector.propTypes = {\n backgroundDark: PropTypes.bool,\n markerColor: PropTypes.string,\n borderColor: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n symbolOptions: PropTypes.array,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/TextArea.js b/lib/components/widgets/TextArea.js new file mode 100644 index 000000000..6ff703db9 --- /dev/null +++ b/lib/components/widgets/TextArea.js @@ -0,0 +1,95 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TextArea = function (_Component) { + _inherits(TextArea, _Component); + + function TextArea(props) { + _classCallCheck(this, TextArea); + + var _this = _possibleConstructorReturn(this, (TextArea.__proto__ || Object.getPrototypeOf(TextArea)).call(this, props)); + + _this.state = { + value: _this.props.value + }; + + _this.onChange = _this.onChange.bind(_this); + return _this; + } + + _createClass(TextArea, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + // Reset the value to the graph's actual value + if (nextProps.value !== this.state.value) { + this.setState({ + value: nextProps.value + }); + } + } + }, { + key: 'onChange', + value: function onChange(e) { + var newValue = e.target.value; + this.setState({ value: newValue }); + this.props.onChange(newValue); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement( + 'span', + null, + _react2.default.createElement('textarea', { + value: this.state.value, + rows: this.props.visibleRows, + cols: this.props.areaWidth, + placeholder: this.props.placeholder, + onChange: this.onChange, + className: this.props.textareaClass + }) + ); + } + }]); + + return TextArea; +}(_react.Component); + +exports.default = TextArea; + + +TextArea.propTypes = { + value: _propTypes2.default.string.isRequired, + onChange: _propTypes2.default.func.isRequired, + placeholder: _propTypes2.default.string.isRequired, + visibleRows: _propTypes2.default.number, + areaWidth: _propTypes2.default.number, + textareaClass: _propTypes2.default.string +}; + +TextArea.defaultProps = { + visibleRows: 10, + areaWidth: 30 +}; +//# sourceMappingURL=TextArea.js.map \ No newline at end of file diff --git a/lib/components/widgets/TextArea.js.map b/lib/components/widgets/TextArea.js.map new file mode 100644 index 000000000..99cac19e9 --- /dev/null +++ b/lib/components/widgets/TextArea.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/TextArea.js"],"names":["TextArea","props","state","value","onChange","bind","nextProps","setState","e","newValue","target","visibleRows","areaWidth","placeholder","textareaClass","Component","propTypes","PropTypes","string","isRequired","func","number","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,Q;;;AACnB,oBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oHACXA,KADW;;AAGjB,UAAKC,KAAL,GAAa;AACXC,aAAO,MAAKF,KAAL,CAAWE;AADP,KAAb;;AAIA,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AAPiB;AAQlB;;;;8CAEyBC,S,EAAW;AACnC;AACA,UAAIA,UAAUH,KAAV,KAAoB,KAAKD,KAAL,CAAWC,KAAnC,EAA0C;AACxC,aAAKI,QAAL,CAAc;AACZJ,iBAAOG,UAAUH;AADL,SAAd;AAGD;AACF;;;6BAEQK,C,EAAG;AACV,UAAMC,WAAWD,EAAEE,MAAF,CAASP,KAA1B;AACA,WAAKI,QAAL,CAAc,EAACJ,OAAOM,QAAR,EAAd;AACA,WAAKR,KAAL,CAAWG,QAAX,CAAoBK,QAApB;AACD;;;6BAEQ;AACP,aACE;AAAA;AAAA;AACE;AACE,iBAAO,KAAKP,KAAL,CAAWC,KADpB;AAEE,gBAAM,KAAKF,KAAL,CAAWU,WAFnB;AAGE,gBAAM,KAAKV,KAAL,CAAWW,SAHnB;AAIE,uBAAa,KAAKX,KAAL,CAAWY,WAJ1B;AAKE,oBAAU,KAAKT,QALjB;AAME,qBAAW,KAAKH,KAAL,CAAWa;AANxB;AADF,OADF;AAYD;;;;EAvCmCC,gB;;kBAAjBf,Q;;;AA0CrBA,SAASgB,SAAT,GAAqB;AACnBb,SAAOc,oBAAUC,MAAV,CAAiBC,UADL;AAEnBf,YAAUa,oBAAUG,IAAV,CAAeD,UAFN;AAGnBN,eAAaI,oBAAUC,MAAV,CAAiBC,UAHX;AAInBR,eAAaM,oBAAUI,MAJJ;AAKnBT,aAAWK,oBAAUI,MALF;AAMnBP,iBAAeG,oBAAUC;AANN,CAArB;;AASAlB,SAASsB,YAAT,GAAwB;AACtBX,eAAa,EADS;AAEtBC,aAAW;AAFW,CAAxB","file":"TextArea.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class TextArea extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n value: this.props.value,\n };\n\n this.onChange = this.onChange.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n // Reset the value to the graph's actual value\n if (nextProps.value !== this.state.value) {\n this.setState({\n value: nextProps.value,\n });\n }\n }\n\n onChange(e) {\n const newValue = e.target.value;\n this.setState({value: newValue});\n this.props.onChange(newValue);\n }\n\n render() {\n return (\n \n \n \n );\n }\n}\n\nTextArea.propTypes = {\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string.isRequired,\n visibleRows: PropTypes.number,\n areaWidth: PropTypes.number,\n textareaClass: PropTypes.string,\n};\n\nTextArea.defaultProps = {\n visibleRows: 10,\n areaWidth: 30,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/TextInput.js b/lib/components/widgets/TextInput.js new file mode 100644 index 000000000..f374245d0 --- /dev/null +++ b/lib/components/widgets/TextInput.js @@ -0,0 +1,83 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _EditableText = require('./EditableText'); + +var _EditableText2 = _interopRequireDefault(_EditableText); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TextInput = function (_Component) { + _inherits(TextInput, _Component); + + function TextInput(props) { + _classCallCheck(this, TextInput); + + var _this = _possibleConstructorReturn(this, (TextInput.__proto__ || Object.getPrototypeOf(TextInput)).call(this, props)); + + _this.state = { value: props.value }; + return _this; + } + + _createClass(TextInput, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (nextProps.value !== this.state.value) { + this.setState({ value: nextProps.value }); + } + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + return _react2.default.createElement(_EditableText2.default, { + className: 'text-input ' + this.props.editableClassName, + placeholder: this.props.placeholder, + text: this.state.value, + type: 'text', + onChange: function onChange(value) { + if (_this2.props.onChange) { + _this2.props.onChange(value); + } + _this2.setState({ value: value }); + }, + onUpdate: this.props.onUpdate + }); + } + }]); + + return TextInput; +}(_react.Component); + +exports.default = TextInput; + + +TextInput.propTypes = { + defaultValue: _propTypes2.default.any, + editableClassName: _propTypes2.default.string, + onUpdate: _propTypes2.default.func.isRequired, + onChange: _propTypes2.default.func, + placeholder: _propTypes2.default.string, + value: _propTypes2.default.any +}; +//# sourceMappingURL=TextInput.js.map \ No newline at end of file diff --git a/lib/components/widgets/TextInput.js.map b/lib/components/widgets/TextInput.js.map new file mode 100644 index 000000000..2a16c0453 --- /dev/null +++ b/lib/components/widgets/TextInput.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/TextInput.js"],"names":["TextInput","props","state","value","nextProps","setState","editableClassName","placeholder","onChange","onUpdate","Component","propTypes","defaultValue","PropTypes","any","string","func","isRequired"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEqBA,S;;;AACnB,qBAAYC,KAAZ,EAAmB;AAAA;;AAAA,sHACXA,KADW;;AAGjB,UAAKC,KAAL,GAAa,EAACC,OAAOF,MAAME,KAAd,EAAb;AAHiB;AAIlB;;;;8CAEyBC,S,EAAW;AACnC,UAAIA,UAAUD,KAAV,KAAoB,KAAKD,KAAL,CAAWC,KAAnC,EAA0C;AACxC,aAAKE,QAAL,CAAc,EAACF,OAAOC,UAAUD,KAAlB,EAAd;AACD;AACF;;;6BAEQ;AAAA;;AACP,aACE,8BAAC,sBAAD;AACE,mCAAyB,KAAKF,KAAL,CAAWK,iBADtC;AAEE,qBAAa,KAAKL,KAAL,CAAWM,WAF1B;AAGE,cAAM,KAAKL,KAAL,CAAWC,KAHnB;AAIE,cAAK,MAJP;AAKE,kBAAU,yBAAS;AACjB,cAAI,OAAKF,KAAL,CAAWO,QAAf,EAAyB;AACvB,mBAAKP,KAAL,CAAWO,QAAX,CAAoBL,KAApB;AACD;AACD,iBAAKE,QAAL,CAAc,EAACF,YAAD,EAAd;AACD,SAVH;AAWE,kBAAU,KAAKF,KAAL,CAAWQ;AAXvB,QADF;AAeD;;;;EA7BoCC,gB;;kBAAlBV,S;;;AAgCrBA,UAAUW,SAAV,GAAsB;AACpBC,gBAAcC,oBAAUC,GADJ;AAEpBR,qBAAmBO,oBAAUE,MAFT;AAGpBN,YAAUI,oBAAUG,IAAV,CAAeC,UAHL;AAIpBT,YAAUK,oBAAUG,IAJA;AAKpBT,eAAaM,oBAAUE,MALH;AAMpBZ,SAAOU,oBAAUC;AANG,CAAtB","file":"TextInput.js","sourcesContent":["import EditableText from './EditableText';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class TextInput extends Component {\n constructor(props) {\n super(props);\n\n this.state = {value: props.value};\n }\n\n componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.state.value) {\n this.setState({value: nextProps.value});\n }\n }\n\n render() {\n return (\n {\n if (this.props.onChange) {\n this.props.onChange(value);\n }\n this.setState({value});\n }}\n onUpdate={this.props.onUpdate}\n />\n );\n }\n}\n\nTextInput.propTypes = {\n defaultValue: PropTypes.any,\n editableClassName: PropTypes.string,\n onUpdate: PropTypes.func.isRequired,\n onChange: PropTypes.func,\n placeholder: PropTypes.string,\n value: PropTypes.any,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/TraceTypeSelector.js b/lib/components/widgets/TraceTypeSelector.js new file mode 100644 index 000000000..1b18cbd4d --- /dev/null +++ b/lib/components/widgets/TraceTypeSelector.js @@ -0,0 +1,370 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TraceTypeSelectorButton = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _plotlyIcons = require('plotly-icons'); + +var _Modal = require('../containers/Modal'); + +var _Modal2 = _interopRequireDefault(_Modal); + +var _lib = require('../../lib'); + +var _constants = require('../../lib/constants'); + +var _context3 = require('../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var renderActionItems = function renderActionItems(actionItems, item) { + return actionItems ? actionItems(item).map(function (action, i) { + return !action.onClick ? null : _react2.default.createElement( + 'a', + { + className: 'trace-item__actions__item', + key: i, + 'aria-label': action.label, + 'data-microtip-position': 'top-left', + role: 'tooltip', + onClick: action.onClick, + target: '_blank' + }, + action.icon + ); + }) : null; +}; + +var Item = function Item(_ref) { + var item = _ref.item, + active = _ref.active, + handleClick = _ref.handleClick, + actions = _ref.actions, + showActions = _ref.showActions, + complex = _ref.complex; + var label = item.label, + value = item.value, + icon = item.icon; + + var SimpleIcon = (0, _lib.renderTraceIcon)(icon ? icon : value); + var ComplexIcon = (0, _lib.renderTraceIcon)(icon ? icon : value, 'TraceType'); + + return _react2.default.createElement( + 'div', + { className: 'trace-item' + (active ? ' trace-item--active' : ''), onClick: handleClick }, + _react2.default.createElement( + 'div', + { className: 'trace-item__actions' }, + actions && showActions ? renderActionItems(actions, item) : null + ), + _react2.default.createElement( + 'div', + { className: 'trace-item__image' }, + !complex && _react2.default.createElement( + 'div', + { className: 'trace-item__image__svg' }, + _react2.default.createElement(SimpleIcon, null) + ), + complex && _react2.default.createElement( + 'div', + { className: 'trace-item__image__wrapper' }, + _react2.default.createElement(ComplexIcon, null) + ) + ), + _react2.default.createElement( + 'div', + { className: 'trace-item__label' }, + label + ) + ); +}; + +Item.propTypes = { + item: _propTypes2.default.object, + active: _propTypes2.default.bool, + complex: _propTypes2.default.bool, + handleClick: _propTypes2.default.func, + actions: _propTypes2.default.func, + showActions: _propTypes2.default.bool +}; +Item.contextType = _context3.EditorControlsContext; + +var TraceTypeSelector = function (_Component) { + _inherits(TraceTypeSelector, _Component); + + function TraceTypeSelector(props) { + _classCallCheck(this, TraceTypeSelector); + + var _this = _possibleConstructorReturn(this, (TraceTypeSelector.__proto__ || Object.getPrototypeOf(TraceTypeSelector)).call(this, props)); + + _this.selectAndClose = _this.selectAndClose.bind(_this); + _this.actions = _this.actions.bind(_this); + _this.renderCategories = _this.renderCategories.bind(_this); + _this.renderGrid = _this.renderGrid.bind(_this); + _this.renderSingleBlock = _this.renderSingleBlock.bind(_this); + return _this; + } + + _createClass(TraceTypeSelector, [{ + key: 'selectAndClose', + value: function selectAndClose(value) { + var _props = this.props, + updateContainer = _props.updateContainer, + glByDefault = _props.glByDefault, + type = _props.fullContainer.type; + + var computedValue = (0, _lib.traceTypeToPlotlyInitFigure)(value); + if ((type && type.endsWith('gl') || !_constants.TRACES_WITH_GL.includes(type) && glByDefault) && _constants.TRACES_WITH_GL.includes(computedValue.type) && !computedValue.type.endsWith('gl')) { + computedValue.type += 'gl'; + } + updateContainer(computedValue); + this.context.handleClose(); + } + }, { + key: 'actions', + value: function actions(_ref2) { + var _this2 = this; + + var value = _ref2.value; + var _context = this.context, + _ = _context.localize, + chartHelp = _context.chartHelp; + + + var onClick = function onClick(e, func) { + e.stopPropagation(); + func(); + _this2.context.handleClose(); + }; + + return [{ + label: _('Charts like this by Plotly users.'), + onClick: chartHelp[value] && chartHelp[value].feedQuery && function (e) { + return onClick(e, function () { + return window.open('https://plot.ly/feed/?q=' + (chartHelp[value] ? chartHelp[value].feedQuery : value), '_blank'); + }); + }, + icon: _react2.default.createElement(_plotlyIcons.SearchIcon, null) + }, { + label: _('View tutorials on this chart type.'), + onClick: chartHelp[value] && chartHelp[value].helpDoc && function (e) { + return onClick(e, function () { + return window.open(chartHelp[value].helpDoc, '_blank'); + }); + }, + icon: _react2.default.createElement(_plotlyIcons.ThumnailViewIcon, null) + }, { + label: _('See a basic example.'), + onClick: chartHelp[value] && chartHelp[value].examplePlot && function (e) { + return onClick(e, chartHelp[value].examplePlot); + }, + icon: _react2.default.createElement(_plotlyIcons.GraphIcon, null) + }]; + } + }, { + key: 'renderCategories', + value: function renderCategories() { + var _this3 = this; + + var fullValue = this.props.fullValue; + var _context2 = this.context, + mapBoxAccess = _context2.mapBoxAccess, + _ = _context2.localize, + chartHelp = _context2.chartHelp; + var _props$traceTypesConf = this.props.traceTypesConfig, + traces = _props$traceTypesConf.traces, + categories = _props$traceTypesConf.categories, + complex = _props$traceTypesConf.complex; + + + return categories(_).map(function (category, i) { + var items = traces(_).filter(function (_ref3) { + var value = _ref3.category.value; + return value === category.value; + }).filter(function (i) { + return i.value !== 'scattergl' && i.value !== 'scatterpolargl'; + }); + + if (!mapBoxAccess) { + items = items.filter(function (i) { + return i.value !== 'scattermapbox'; + }); + } + + var MAX_ITEMS = 4; + + var columnClasses = items.length > MAX_ITEMS && !category.maxColumns || category.maxColumns && category.maxColumns > 1 ? 'trace-grid__column trace-grid__column--double' : 'trace-grid__column'; + + return _react2.default.createElement( + 'div', + { className: columnClasses, key: i }, + _react2.default.createElement( + 'div', + { className: 'trace-grid__column__header' }, + category.label + ), + _react2.default.createElement( + 'div', + { className: 'trace-grid__column__items' }, + items.map(function (item) { + return _react2.default.createElement(Item, { + complex: complex, + key: item.value, + active: fullValue === item.value, + item: item, + actions: _this3.actions, + handleClick: function handleClick() { + return _this3.selectAndClose(item.value); + }, + showActions: Boolean(chartHelp) + }); + }) + ) + ); + }); + } + }, { + key: 'renderGrid', + value: function renderGrid() { + return _react2.default.createElement( + 'div', + { className: 'trace-grid' }, + this.renderCategories() + ); + } + }, { + key: 'renderSingleBlock', + value: function renderSingleBlock() { + var _this4 = this; + + var fullValue = this.props.fullValue; + var _ = this.context.localize; + var _props$traceTypesConf2 = this.props.traceTypesConfig, + traces = _props$traceTypesConf2.traces, + complex = _props$traceTypesConf2.complex; + + + return _react2.default.createElement( + 'div', + { className: 'trace-grid-single-block' }, + traces(_).map(function (item) { + return _react2.default.createElement(Item, { + key: item.value, + complex: complex, + active: fullValue === item.value, + item: item, + actions: _this4.actions, + showActions: false, + handleClick: function handleClick() { + return _this4.selectAndClose(item.value); + }, + style: { display: 'inline-block' } + }); + }) + ); + } + }, { + key: 'render', + value: function render() { + var _ = this.context.localize; + var categories = this.props.traceTypesConfig.categories; + + + return _react2.default.createElement( + _Modal2.default, + { title: _('Select Trace Type') }, + categories ? this.renderGrid() : this.renderSingleBlock() + ); + } + }]); + + return TraceTypeSelector; +}(_react.Component); + +TraceTypeSelector.propTypes = { + updateContainer: _propTypes2.default.func, + fullValue: _propTypes2.default.string, + fullContainer: _propTypes2.default.object, + glByDefault: _propTypes2.default.bool, + traceTypesConfig: _propTypes2.default.object +}; +TraceTypeSelector.contextTypes = { + handleClose: _propTypes2.default.func, + localize: _propTypes2.default.func, + mapBoxAccess: _propTypes2.default.bool, + chartHelp: _propTypes2.default.object +}; + +var TraceTypeSelectorButton = exports.TraceTypeSelectorButton = function (_Component2) { + _inherits(TraceTypeSelectorButton, _Component2); + + function TraceTypeSelectorButton() { + _classCallCheck(this, TraceTypeSelectorButton); + + return _possibleConstructorReturn(this, (TraceTypeSelectorButton.__proto__ || Object.getPrototypeOf(TraceTypeSelectorButton)).apply(this, arguments)); + } + + _createClass(TraceTypeSelectorButton, [{ + key: 'render', + value: function render() { + var _props2 = this.props, + handleClick = _props2.handleClick, + container = _props2.container, + traces = _props2.traceTypesConfig.traces; + var _ = this.context.localize; + + + var inferredType = (0, _lib.plotlyTraceToCustomTrace)(container); + + var _traces$find = traces(_).find(function (type) { + return type.value === inferredType; + }), + label = _traces$find.label, + icon = _traces$find.icon, + value = _traces$find.value; + + var Icon = (0, _lib.renderTraceIcon)(icon ? icon : value); + + return _react2.default.createElement( + 'div', + { className: 'trace-type-select-button', onClick: handleClick ? handleClick : null }, + _react2.default.createElement( + 'div', + { className: 'trace-type-select-button__icon' }, + _react2.default.createElement(Icon, null) + ), + label + ); + } + }]); + + return TraceTypeSelectorButton; +}(_react.Component); + +TraceTypeSelectorButton.propTypes = { + handleClick: _propTypes2.default.func.isRequired, + container: _propTypes2.default.object, + traceTypesConfig: _propTypes2.default.object.isRequired +}; +TraceTypeSelectorButton.contextType = _context3.EditorControlsContext; + +exports.default = TraceTypeSelector; +//# sourceMappingURL=TraceTypeSelector.js.map \ No newline at end of file diff --git a/lib/components/widgets/TraceTypeSelector.js.map b/lib/components/widgets/TraceTypeSelector.js.map new file mode 100644 index 000000000..a343b7ab7 --- /dev/null +++ b/lib/components/widgets/TraceTypeSelector.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/TraceTypeSelector.js"],"names":["renderActionItems","actionItems","item","map","action","i","onClick","label","icon","Item","active","handleClick","actions","showActions","complex","value","SimpleIcon","ComplexIcon","propTypes","PropTypes","object","bool","func","contextType","EditorControlsContext","TraceTypeSelector","props","selectAndClose","bind","renderCategories","renderGrid","renderSingleBlock","updateContainer","glByDefault","type","fullContainer","computedValue","endsWith","TRACES_WITH_GL","includes","context","handleClose","_","localize","chartHelp","e","stopPropagation","feedQuery","window","open","helpDoc","examplePlot","fullValue","mapBoxAccess","traceTypesConfig","traces","categories","category","items","filter","MAX_ITEMS","columnClasses","length","maxColumns","Boolean","display","Component","string","contextTypes","TraceTypeSelectorButton","container","inferredType","find","Icon","isRequired"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,oBAAoB,SAApBA,iBAAoB,CAACC,WAAD,EAAcC,IAAd;AAAA,SACxBD,cACIA,YAAYC,IAAZ,EAAkBC,GAAlB,CACE,UAACC,MAAD,EAASC,CAAT;AAAA,WACE,CAACD,OAAOE,OAAR,GAAkB,IAAlB,GACE;AAAA;AAAA;AACE,mBAAU,2BADZ;AAEE,aAAKD,CAFP;AAGE,sBAAYD,OAAOG,KAHrB;AAIE,4CAJF;AAKE,cAAK,SALP;AAME,iBAASH,OAAOE,OANlB;AAOE,gBAAO;AAPT;AASGF,aAAOI;AATV,KAFJ;AAAA,GADF,CADJ,GAiBI,IAlBoB;AAAA,CAA1B;;AAoBA,IAAMC,OAAO,SAAPA,IAAO,OAAgE;AAAA,MAA9DP,IAA8D,QAA9DA,IAA8D;AAAA,MAAxDQ,MAAwD,QAAxDA,MAAwD;AAAA,MAAhDC,WAAgD,QAAhDA,WAAgD;AAAA,MAAnCC,OAAmC,QAAnCA,OAAmC;AAAA,MAA1BC,WAA0B,QAA1BA,WAA0B;AAAA,MAAbC,OAAa,QAAbA,OAAa;AAAA,MACpEP,KADoE,GAC9CL,IAD8C,CACpEK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AELA,WAFK;AAAA,UAGL2D,SAHK,WAGLA,SAHK;AAAA,UAIcf,MAJd,WAILD,gBAJK,CAIcC,MAJd;AAAA,UAOUb,CAPV,GAOe,KAAKF,OAPpB,CAOAG,QAPA;;;AASP,UAAM4B,eAAe,mCAAyBD,SAAzB,CAArB;;AATO,yBAUsBf,OAAOb,CAAP,EAAU8B,IAAV,CAAe;AAAA,eAAQtC,KAAKnB,KAAL,KAAewD,YAAvB;AAAA,OAAf,CAVtB;AAAA,UAUAhE,KAVA,gBAUAA,KAVA;AAAA,UAUOC,IAVP,gBAUOA,IAVP;AAAA,UAUaO,KAVb,gBAUaA,KAVb;;AAYP,UAAM0D,OAAO,0BAAgBjE,OAAOA,IAAP,GAAcO,KAA9B,CAAb;;AAEA,aACE;AAAA;AAAA,UAAK,WAAU,0BAAf,EAA0C,SAASJ,cAAcA,WAAd,GAA4B,IAA/E;AACE;AAAA;AAAA,YAAK,WAAU,gCAAf;AACE,wCAAC,IAAD;AADF,SADF;AAIGJ;AAJH,OADF;AAQD;;;;EAvB0C2D,gB;;AA0B7CG,wBAAwBnD,SAAxB,GAAoC;AAClCP,eAAaQ,oBAAUG,IAAV,CAAeoD,UADM;AAElCJ,aAAWnD,oBAAUC,MAFa;AAGlCkC,oBAAkBnC,oBAAUC,MAAV,CAAiBsD;AAHD,CAApC;AAKAL,wBAAwB9C,WAAxB,GAAsCC,+BAAtC;;kBAEeC,iB","file":"TraceTypeSelector.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SearchIcon, ThumnailViewIcon, GraphIcon} from 'plotly-icons';\nimport Modal from 'components/containers/Modal';\nimport {traceTypeToPlotlyInitFigure, renderTraceIcon, plotlyTraceToCustomTrace} from 'lib';\nimport {TRACES_WITH_GL} from 'lib/constants';\nimport {EditorControlsContext} from '../../context';\n\nconst renderActionItems = (actionItems, item) =>\n actionItems\n ? actionItems(item).map(\n (action, i) =>\n !action.onClick ? null : (\n \n {action.icon}\n \n )\n )\n : null;\n\nconst Item = ({item, active, handleClick, actions, showActions, complex}) => {\n const {label, value, icon} = item;\n const SimpleIcon = renderTraceIcon(icon ? icon : value);\n const ComplexIcon = renderTraceIcon(icon ? icon : value, 'TraceType');\n\n return (\n
\n
\n {actions && showActions ? renderActionItems(actions, item) : null}\n
\n
\n {!complex && (\n
\n \n
\n )}\n {complex && (\n
\n \n
\n )}\n
\n
{label}
\n
\n );\n};\n\nItem.propTypes = {\n item: PropTypes.object,\n active: PropTypes.bool,\n complex: PropTypes.bool,\n handleClick: PropTypes.func,\n actions: PropTypes.func,\n showActions: PropTypes.bool,\n};\nItem.contextType = EditorControlsContext;\n\nclass TraceTypeSelector extends Component {\n constructor(props) {\n super(props);\n\n this.selectAndClose = this.selectAndClose.bind(this);\n this.actions = this.actions.bind(this);\n this.renderCategories = this.renderCategories.bind(this);\n this.renderGrid = this.renderGrid.bind(this);\n this.renderSingleBlock = this.renderSingleBlock.bind(this);\n }\n\n selectAndClose(value) {\n const {\n updateContainer,\n glByDefault,\n fullContainer: {type},\n } = this.props;\n const computedValue = traceTypeToPlotlyInitFigure(value);\n if (\n ((type && type.endsWith('gl')) || (!TRACES_WITH_GL.includes(type) && glByDefault)) &&\n TRACES_WITH_GL.includes(computedValue.type) &&\n !computedValue.type.endsWith('gl')\n ) {\n computedValue.type += 'gl';\n }\n updateContainer(computedValue);\n this.context.handleClose();\n }\n\n actions({value}) {\n const {localize: _, chartHelp} = this.context;\n\n const onClick = (e, func) => {\n e.stopPropagation();\n func();\n this.context.handleClose();\n };\n\n return [\n {\n label: _('Charts like this by Plotly users.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].feedQuery &&\n (e =>\n onClick(e, () =>\n window.open(\n `https://plot.ly/feed/?q=${chartHelp[value] ? chartHelp[value].feedQuery : value}`,\n '_blank'\n )\n )),\n icon: ,\n },\n {\n label: _('View tutorials on this chart type.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].helpDoc &&\n (e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))),\n icon: ,\n },\n {\n label: _('See a basic example.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].examplePlot &&\n (e => onClick(e, chartHelp[value].examplePlot)),\n icon: ,\n },\n ];\n }\n\n renderCategories() {\n const {fullValue} = this.props;\n const {mapBoxAccess, localize: _, chartHelp} = this.context;\n const {\n traceTypesConfig: {traces, categories, complex},\n } = this.props;\n\n return categories(_).map((category, i) => {\n let items = traces(_)\n .filter(({category: {value}}) => value === category.value)\n .filter(i => i.value !== 'scattergl' && i.value !== 'scatterpolargl');\n\n if (!mapBoxAccess) {\n items = items.filter(i => i.value !== 'scattermapbox');\n }\n\n const MAX_ITEMS = 4;\n\n const columnClasses =\n (items.length > MAX_ITEMS && !category.maxColumns) ||\n (category.maxColumns && category.maxColumns > 1)\n ? 'trace-grid__column trace-grid__column--double'\n : 'trace-grid__column';\n\n return (\n
\n
{category.label}
\n
\n {items.map(item => (\n this.selectAndClose(item.value)}\n showActions={Boolean(chartHelp)}\n />\n ))}\n
\n
\n );\n });\n }\n\n renderGrid() {\n return
{this.renderCategories()}
;\n }\n\n renderSingleBlock() {\n const {fullValue} = this.props;\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {traces, complex},\n } = this.props;\n\n return (\n
\n {traces(_).map(item => (\n this.selectAndClose(item.value)}\n style={{display: 'inline-block'}}\n />\n ))}\n
\n );\n }\n\n render() {\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {categories},\n } = this.props;\n\n return (\n \n {categories ? this.renderGrid() : this.renderSingleBlock()}\n \n );\n }\n}\n\nTraceTypeSelector.propTypes = {\n updateContainer: PropTypes.func,\n fullValue: PropTypes.string,\n fullContainer: PropTypes.object,\n glByDefault: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n};\nTraceTypeSelector.contextTypes = {\n handleClose: PropTypes.func,\n localize: PropTypes.func,\n mapBoxAccess: PropTypes.bool,\n chartHelp: PropTypes.object,\n};\n\nexport class TraceTypeSelectorButton extends Component {\n render() {\n const {\n handleClick,\n container,\n traceTypesConfig: {traces},\n } = this.props;\n\n const {localize: _} = this.context;\n\n const inferredType = plotlyTraceToCustomTrace(container);\n const {label, icon, value} = traces(_).find(type => type.value === inferredType);\n\n const Icon = renderTraceIcon(icon ? icon : value);\n\n return (\n
\n
\n \n
\n {label}\n
\n );\n }\n}\n\nTraceTypeSelectorButton.propTypes = {\n handleClick: PropTypes.func.isRequired,\n container: PropTypes.object,\n traceTypesConfig: PropTypes.object.isRequired,\n};\nTraceTypeSelectorButton.contextType = EditorControlsContext;\n\nexport default TraceTypeSelector;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/index.js b/lib/components/widgets/index.js new file mode 100644 index 000000000..ef66f585b --- /dev/null +++ b/lib/components/widgets/index.js @@ -0,0 +1,26 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TraceTypeSelectorButton = exports.TraceTypeSelector = exports.RadioBlocks = exports.Button = undefined; + +var _Button = require('./Button'); + +var _Button2 = _interopRequireDefault(_Button); + +var _RadioBlocks = require('./RadioBlocks'); + +var _RadioBlocks2 = _interopRequireDefault(_RadioBlocks); + +var _TraceTypeSelector = require('./TraceTypeSelector'); + +var _TraceTypeSelector2 = _interopRequireDefault(_TraceTypeSelector); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.Button = _Button2.default; +exports.RadioBlocks = _RadioBlocks2.default; +exports.TraceTypeSelector = _TraceTypeSelector2.default; +exports.TraceTypeSelectorButton = _TraceTypeSelector.TraceTypeSelectorButton; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/components/widgets/index.js.map b/lib/components/widgets/index.js.map new file mode 100644 index 000000000..a4810dfae --- /dev/null +++ b/lib/components/widgets/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/components/widgets/index.js"],"names":["Button","RadioBlocks","TraceTypeSelector","TraceTypeSelectorButton"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;QAEQA,M,GAAAA,gB;QAAQC,W,GAAAA,qB;QAAaC,iB,GAAAA,2B;QAAmBC,uB,GAAAA,0C","file":"index.js","sourcesContent":["import Button from './Button';\nimport RadioBlocks from './RadioBlocks';\nimport TraceTypeSelector, {TraceTypeSelectorButton} from './TraceTypeSelector';\n\nexport {Button, RadioBlocks, TraceTypeSelector, TraceTypeSelectorButton};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/HTML.js b/lib/components/widgets/text_editors/HTML.js new file mode 100644 index 000000000..481cd80a3 --- /dev/null +++ b/lib/components/widgets/text_editors/HTML.js @@ -0,0 +1,65 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _TextArea2 = require('../TextArea'); + +var _TextArea3 = _interopRequireDefault(_TextArea2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var HTML = function (_TextArea) { + _inherits(HTML, _TextArea); + + function HTML() { + _classCallCheck(this, HTML); + + return _possibleConstructorReturn(this, (HTML.__proto__ || Object.getPrototypeOf(HTML)).apply(this, arguments)); + } + + _createClass(HTML, [{ + key: 'render', + value: function render() { + var className = this.props.className; + + var editorClassNames = className ? className : 'text-editor__html'; + return _react2.default.createElement('textarea', { + value: this.state.value, + placeholder: this.props.placeholder, + onChange: this.onChange, + className: editorClassNames + }); + } + }]); + + return HTML; +}(_TextArea3.default); + +HTML.propTypes = { + className: _propTypes2.default.string +}; + +HTML.defaultProps = { + placeholder: '' +}; + +exports.default = HTML; +//# sourceMappingURL=HTML.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/HTML.js.map b/lib/components/widgets/text_editors/HTML.js.map new file mode 100644 index 000000000..a44026cb6 --- /dev/null +++ b/lib/components/widgets/text_editors/HTML.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../src/components/widgets/text_editors/HTML.js"],"names":["HTML","className","props","editorClassNames","state","value","placeholder","onChange","TextArea","propTypes","PropTypes","string","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,I;;;;;;;;;;;6BACK;AAAA,UACAC,SADA,GACa,KAAKC,KADlB,CACAD,SADA;;AAEP,UAAME,mBAAmBF,YAAYA,SAAZ,GAAwB,mBAAjD;AACA,aACE;AACE,eAAO,KAAKG,KAAL,CAAWC,KADpB;AAEE,qBAAa,KAAKH,KAAL,CAAWI,WAF1B;AAGE,kBAAU,KAAKC,QAHjB;AAIE,mBAAWJ;AAJb,QADF;AAQD;;;;EAZgBK,kB;;AAenBR,KAAKS,SAAL,GAAiB;AACfR,aAAWS,oBAAUC;AADN,CAAjB;;AAIAX,KAAKY,YAAL,GAAoB;AAClBN,eAAa;AADK,CAApB;;kBAIeN,I","file":"HTML.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport TextArea from '../TextArea';\n\nclass HTML extends TextArea {\n render() {\n const {className} = this.props;\n const editorClassNames = className ? className : 'text-editor__html';\n return (\n \n );\n }\n}\n\nHTML.propTypes = {\n className: PropTypes.string,\n};\n\nHTML.defaultProps = {\n placeholder: '',\n};\n\nexport default HTML;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/LaTeX.js b/lib/components/widgets/text_editors/LaTeX.js new file mode 100644 index 000000000..9ca89fd51 --- /dev/null +++ b/lib/components/widgets/text_editors/LaTeX.js @@ -0,0 +1,132 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _TextArea2 = require('../TextArea'); + +var _TextArea3 = _interopRequireDefault(_TextArea2); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _convertFormats = require('./convertFormats'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var LaTeX = function (_TextArea) { + _inherits(LaTeX, _TextArea); + + function LaTeX(props) { + _classCallCheck(this, LaTeX); + + // Internally, represesent the LaTeX document without the + // wrapping `$...$` characters. + var _this = _possibleConstructorReturn(this, (LaTeX.__proto__ || Object.getPrototypeOf(LaTeX)).call(this, props)); + + var unwrappedValue = _this.unwrap(props.value); + + _this.state = { + value: unwrappedValue + }; + _this.onChange = _this.onChange.bind(_this); + _this.onBlur = _this.onBlur.bind(_this); + return _this; + } + + _createClass(LaTeX, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + var unwrappedNextValue = this.unwrap(nextProps.value); + + if (unwrappedNextValue !== this.state.value) { + this.setState({ + value: unwrappedNextValue + }); + } + } + + // Return a new value with wrapping `$...$` removed. + + }, { + key: 'unwrap', + value: function unwrap(value) { + if ((0, _convertFormats.isLaTeXExpr)(value)) { + return value.substr(1, value.length - 2); + } + + return value; + } + + // Wrap value in `$...$`. + + }, { + key: 'wrap', + value: function wrap(value) { + if (!(0, _convertFormats.isLaTeXExpr)(value)) { + return '$' + value + '$'; + } + + return value; + } + }, { + key: 'onChange', + value: function onChange(e) { + this.setState({ + value: e.target.value + }); + } + }, { + key: 'onBlur', + value: function onBlur(e) { + var value = this.wrap(e.target.value); + this.props.onChange(value); + } + }, { + key: 'render', + value: function render() { + var className = this.props.className; + + var editorClassNames = className ? className : 'text-editor__latex'; + return _react2.default.createElement('textarea', { + value: this.state.value, + placeholder: this.props.placeholder, + onChange: this.onChange, + onBlur: this.onBlur, + className: editorClassNames + }); + } + }]); + + return LaTeX; +}(_TextArea3.default); + +exports.default = LaTeX; + + +LaTeX.propTypes = { + className: _propTypes2.default.string, + onChange: _propTypes2.default.func.isRequired, + placeholder: _propTypes2.default.string, + value: _propTypes2.default.string +}; + +LaTeX.defaultProps = { + value: '', + placeholder: '' +}; +//# sourceMappingURL=LaTeX.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/LaTeX.js.map b/lib/components/widgets/text_editors/LaTeX.js.map new file mode 100644 index 000000000..ab28ea838 --- /dev/null +++ b/lib/components/widgets/text_editors/LaTeX.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../src/components/widgets/text_editors/LaTeX.js"],"names":["LaTeX","props","unwrappedValue","unwrap","value","state","onChange","bind","onBlur","nextProps","unwrappedNextValue","setState","substr","length","e","target","wrap","className","editorClassNames","placeholder","TextArea","propTypes","PropTypes","string","func","isRequired","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AAEA;;;;;;;;;;IAEqBA,K;;;AACnB,iBAAYC,KAAZ,EAAmB;AAAA;;AAGjB;AACA;AAJiB,8GACXA,KADW;;AAKjB,QAAMC,iBAAiB,MAAKC,MAAL,CAAYF,MAAMG,KAAlB,CAAvB;;AAEA,UAAKC,KAAL,GAAa;AACXD,aAAOF;AADI,KAAb;AAGA,UAAKI,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AACA,UAAKC,MAAL,GAAc,MAAKA,MAAL,CAAYD,IAAZ,OAAd;AAXiB;AAYlB;;;;8CAEyBE,S,EAAW;AACnC,UAAMC,qBAAqB,KAAKP,MAAL,CAAYM,UAAUL,KAAtB,CAA3B;;AAEA,UAAIM,uBAAuB,KAAKL,KAAL,CAAWD,KAAtC,EAA6C;AAC3C,aAAKO,QAAL,CAAc;AACZP,iBAAOM;AADK,SAAd;AAGD;AACF;;AAED;;;;2BACON,K,EAAO;AACZ,UAAI,iCAAUA,KAAV,CAAJ,EAAsB;AACpB,eAAOA,MAAMQ,MAAN,CAAa,CAAb,EAAgBR,MAAMS,MAAN,GAAe,CAA/B,CAAP;AACD;;AAED,aAAOT,KAAP;AACD;;AAED;;;;yBACKA,K,EAAO;AACV,UAAI,CAAC,iCAAUA,KAAV,CAAL,EAAuB;AACrB,qBAAWA,KAAX;AACD;;AAED,aAAOA,KAAP;AACD;;;6BAEQU,C,EAAG;AACV,WAAKH,QAAL,CAAc;AACZP,eAAOU,EAAEC,MAAF,CAASX;AADJ,OAAd;AAGD;;;2BAEMU,C,EAAG;AACR,UAAMV,QAAQ,KAAKY,IAAL,CAAUF,EAAEC,MAAF,CAASX,KAAnB,CAAd;AACA,WAAKH,KAAL,CAAWK,QAAX,CAAoBF,KAApB;AACD;;;6BAEQ;AAAA,UACAa,SADA,GACa,KAAKhB,KADlB,CACAgB,SADA;;AAEP,UAAMC,mBAAmBD,YAAYA,SAAZ,GAAwB,oBAAjD;AACA,aACE;AACE,eAAO,KAAKZ,KAAL,CAAWD,KADpB;AAEE,qBAAa,KAAKH,KAAL,CAAWkB,WAF1B;AAGE,kBAAU,KAAKb,QAHjB;AAIE,gBAAQ,KAAKE,MAJf;AAKE,mBAAWU;AALb,QADF;AASD;;;;EAlEgCE,kB;;kBAAdpB,K;;;AAqErBA,MAAMqB,SAAN,GAAkB;AAChBJ,aAAWK,oBAAUC,MADL;AAEhBjB,YAAUgB,oBAAUE,IAAV,CAAeC,UAFT;AAGhBN,eAAaG,oBAAUC,MAHP;AAIhBnB,SAAOkB,oBAAUC;AAJD,CAAlB;;AAOAvB,MAAM0B,YAAN,GAAqB;AACnBtB,SAAO,EADY;AAEnBe,eAAa;AAFM,CAArB","file":"LaTeX.js","sourcesContent":["import React from 'react';\nimport TextArea from '../TextArea';\nimport PropTypes from 'prop-types';\n\nimport {isLaTeXExpr as isWrapped} from './convertFormats';\n\nexport default class LaTeX extends TextArea {\n constructor(props) {\n super(props);\n\n // Internally, represesent the LaTeX document without the\n // wrapping `$...$` characters.\n const unwrappedValue = this.unwrap(props.value);\n\n this.state = {\n value: unwrappedValue,\n };\n this.onChange = this.onChange.bind(this);\n this.onBlur = this.onBlur.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n const unwrappedNextValue = this.unwrap(nextProps.value);\n\n if (unwrappedNextValue !== this.state.value) {\n this.setState({\n value: unwrappedNextValue,\n });\n }\n }\n\n // Return a new value with wrapping `$...$` removed.\n unwrap(value) {\n if (isWrapped(value)) {\n return value.substr(1, value.length - 2);\n }\n\n return value;\n }\n\n // Wrap value in `$...$`.\n wrap(value) {\n if (!isWrapped(value)) {\n return `$${value}$`;\n }\n\n return value;\n }\n\n onChange(e) {\n this.setState({\n value: e.target.value,\n });\n }\n\n onBlur(e) {\n const value = this.wrap(e.target.value);\n this.props.onChange(value);\n }\n\n render() {\n const {className} = this.props;\n const editorClassNames = className ? className : 'text-editor__latex';\n return (\n \n );\n }\n}\n\nLaTeX.propTypes = {\n className: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n};\n\nLaTeX.defaultProps = {\n value: '',\n placeholder: '',\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/MultiFormat.js b/lib/components/widgets/text_editors/MultiFormat.js new file mode 100644 index 000000000..8b338015e --- /dev/null +++ b/lib/components/widgets/text_editors/MultiFormat.js @@ -0,0 +1,379 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _HTML = require('./HTML'); + +var _HTML2 = _interopRequireDefault(_HTML); + +var _LaTeX = require('./LaTeX'); + +var _LaTeX2 = _interopRequireDefault(_LaTeX); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _RichText = require('./RichText'); + +var _RichText2 = _interopRequireDefault(_RichText); + +var _convertFormats = require('./convertFormats'); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _Button = require('../Button'); + +var _Button2 = _interopRequireDefault(_Button); + +var _context = require('../../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var MultiFormatTextEditor = function (_Component) { + _inherits(MultiFormatTextEditor, _Component); + + function MultiFormatTextEditor(props, context) { + _classCallCheck(this, MultiFormatTextEditor); + + var _this = _possibleConstructorReturn(this, (MultiFormatTextEditor.__proto__ || Object.getPrototypeOf(MultiFormatTextEditor)).call(this, props, context)); + + var _ = context.localize; + + var editors = [{ + key: 'RICH_TEXT', + label: _('Rich Text'), + component: _RichText2.default + }, { + key: 'LATEX', + label: _('LaTeX'), + component: _LaTeX2.default + }, { + key: 'HTML', + label: _('Edit in HTML'), + component: _HTML2.default + }]; + + var startTab = (0, _convertFormats.isLaTeXExpr)(props.value) ? 'LATEX' : 'RICH_TEXT'; + + _this.state = { + /* + * When nextTab is set, we are waiting for confirmation from the + * user before switching to the next tab. + */ + nextTab: null, + currentTab: startTab, + messages: [] + }; + + _this.onModeChange = _this.onModeChange.bind(_this); + _this.editors = editors; + return _this; + } + + /** + * Convert a value to the format expected by the provided editor. + * + * @param {String} value The current value + * @param {String} editor The editor to convert for [RICH_TEXT|LATEX] + * @returns {String} The converted value + */ + + + _createClass(MultiFormatTextEditor, [{ + key: 'convertValue', + value: function convertValue(value, editor) { + var currentTab = this.state.currentTab; + + + if (currentTab === 'RICH_TEXT' && editor === 'LATEX') { + return (0, _convertFormats.htmlToLaTeX)(value); + } + + if (currentTab === 'LATEX' && editor === 'RICH_TEXT') { + return (0, _convertFormats.laTeXToHTML)(value); + } + + if (currentTab === 'HTML' && editor === 'LATEX') { + return (0, _convertFormats.htmlToLaTeX)(value); + } + + /* + * Else we're switching from / to HTML / Rich Text Editor + * no conversion is needed + */ + return value; + } + }, { + key: 'onModeChange', + value: function onModeChange(nextTab) { + var _ = this.context.localize; + var _props = this.props, + defaultValuePattern = _props.defaultValuePattern, + value = _props.value, + onChange = _props.onChange; + var currentTab = this.state.currentTab; + + var trimmedValue = value.trim(); + var trimmedValueLength = trimmedValue.length; + var convertedValue = this.convertValue(trimmedValue, nextTab); + + /* + * Check against default value - we have to compare the plain + * value, not the LaTeX format value with `\text{}` wrapping. + */ + var isDefaultValue = (0, _convertFormats.isLaTeXExpr)(trimmedValue) ? defaultValuePattern.test(convertedValue) : defaultValuePattern.test(trimmedValue); + + var switchingBetweenRichAndHtml = currentTab === 'RICH_TEXT' && nextTab === 'HTML' || currentTab === 'HTML' && nextTab === 'RICH_TEXT'; + + if (!isDefaultValue && trimmedValueLength > 0 && !switchingBetweenRichAndHtml) { + // Show confirmation dialogue and defer tab change. + var messages = void 0; + + if (!(0, _convertFormats.isLaTeXExpr)(value)) { + messages = [_("LaTeX is a math typesetting language that doesn't work with rich text."), _('Continuing will convert your note to LaTeX-style text.')]; + } else if ((0, _convertFormats.hasTextExpression)(value)) { + messages = [_('Rich text is incompatible with LaTeX.'), _('Continuing will convert your LaTeX expression into raw text.')]; + } else { + messages = [_('Rich text is incompatible with LaTeX.'), _('Continuing will remove your expression.')]; + } + + this.setState({ + nextTab: nextTab, + messages: messages + }); + + return; + } + + // Show requested tab immediately. + this.setState({ + currentTab: nextTab + }); + + // Convert the annotation and dispatch onChange action + onChange(convertedValue); + } + }, { + key: 'renderConfirmationPanel', + value: function renderConfirmationPanel(render) { + var _this2 = this; + + if (!render) { + return null; + } + + var _ = this.context.localize; + var messages = this.state.messages; + + + var onCancel = function onCancel() { + _this2.setState({ + nextTab: null + }); + }; + + var onContinue = function onContinue() { + var nextTab = _this2.state.nextTab; + var _props2 = _this2.props, + onChange = _props2.onChange, + value = _props2.value; + + // Set next tab as active + + _this2.setState({ + currentTab: nextTab, + nextTab: null + }); + + // Convert the annotation + var convertedValue = _this2.convertValue(value, nextTab); + onChange(convertedValue); + }; + + return _react2.default.createElement( + 'div', + { className: 'multi-format-editor__confirmation-panel' }, + _react2.default.createElement( + 'div', + { className: 'multi-format-editor__confirmation-panel__content' }, + _react2.default.createElement( + 'h3', + { className: 'multi-format-editor__confirmation-panel__header' }, + _('Heads up!') + ), + _react2.default.createElement( + 'div', + { className: 'multi-format-editor__confirmation-panel__message' }, + _react2.default.createElement( + 'p', + { className: 'multi-format-editor__confirmation-panel__message-primary' }, + messages[0] + ), + _react2.default.createElement( + 'p', + { className: 'multi-format-editor__confirmation-panel__message-secondary' }, + messages[1] + ) + ) + ), + _react2.default.createElement( + 'div', + { className: 'multi-format-editor__confirmation-panel__actions' }, + _react2.default.createElement( + _Button2.default, + { + variant: 'default', + className: 'multi-format-editor__confirmation-panel__cancel-button', + onClick: onCancel + }, + _('Go back') + ), + _react2.default.createElement( + _Button2.default, + { + variant: 'primary', + className: 'multi-format-editor__confirmation-panel__continue-button', + onClick: onContinue + }, + _('Continue') + ) + ) + ); + } + }, { + key: 'renderEditor', + value: function renderEditor(render) { + var _this3 = this; + + if (!render) { + return null; + } + var _ = this.context.localize; + var _props3 = this.props, + onChange = _props3.onChange, + placeholder = _props3.placeholder, + value = _props3.value; + var currentTab = this.state.currentTab; + + + var richTextClassNames = (0, _classnames2.default)('multi-format-editor__tab', 'top-tab', 'left', { + selected: currentTab === 'RICH_TEXT' + }); + var latexClassNames = (0, _classnames2.default)('multi-format-editor__tab', 'top-tab', 'right', { + selected: currentTab === 'LATEX' + }); + var bottomTabClassNames = (0, _classnames2.default)('multi-format-editor__tab', 'bottom-tab'); + + var Editor = this.editors.filter(function (editor) { + return editor.key === currentTab; + })[0].component; + + var ModeTabsText = this.editors.map(function (editor) { + return editor.label; + }); + + var showBottomTab = currentTab === 'HTML' || currentTab === 'RICH_TEXT'; + var BottomTab = currentTab === 'HTML' ? _react2.default.createElement( + 'div', + { className: bottomTabClassNames, onClick: function onClick() { + return _this3.onModeChange('RICH_TEXT'); + } }, + _('Edit in Rich Text') + ) : _react2.default.createElement( + 'div', + { className: bottomTabClassNames, onClick: function onClick() { + return _this3.onModeChange('HTML'); + } }, + _('Edit in HTML') + ); + + return _react2.default.createElement( + 'div', + { className: 'multi-format-editor__root__wrapper' }, + _react2.default.createElement( + 'div', + { className: 'multi-format-editor__tabs' }, + _react2.default.createElement( + 'div', + { className: richTextClassNames, onClick: function onClick() { + return _this3.onModeChange('RICH_TEXT'); + } }, + ModeTabsText[0] + ), + _react2.default.createElement( + 'div', + { className: latexClassNames, onClick: function onClick() { + return _this3.onModeChange('LATEX'); + } }, + ModeTabsText[1] + ) + ), + _react2.default.createElement( + 'div', + { className: 'multi-format-editor__content__wrapper__' + currentTab.toLowerCase() }, + _react2.default.createElement(Editor, { + className: 'multi-format-editor__' + currentTab.toLowerCase(), + onChange: onChange, + placeholder: placeholder, + value: value + }) + ), + showBottomTab ? BottomTab : null + ); + } + }, { + key: 'render', + value: function render() { + /* + * `renderConfirmationPanel` and `renderEditor` are mutually + * exclusive; only one will return a component. + */ + var nextTab = this.state.nextTab; + + var content = this.renderConfirmationPanel(nextTab !== null) || this.renderEditor(nextTab === null); + + return _react2.default.createElement( + 'div', + { className: 'multi-format-editor__root' }, + content + ); + } + }]); + + return MultiFormatTextEditor; +}(_react.Component); + +MultiFormatTextEditor.propTypes = { + defaultValuePattern: _propTypes2.default.instanceOf(RegExp), + onChange: _propTypes2.default.func.isRequired, + placeholder: _propTypes2.default.string, + value: _propTypes2.default.string +}; + +MultiFormatTextEditor.defaultProps = { + defaultValuePattern: /^$/, + placeholder: '', + value: '' +}; + +MultiFormatTextEditor.contextType = _context.EditorControlsContext; + +exports.default = MultiFormatTextEditor; +//# sourceMappingURL=MultiFormat.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/MultiFormat.js.map b/lib/components/widgets/text_editors/MultiFormat.js.map new file mode 100644 index 000000000..396e522b2 --- /dev/null +++ b/lib/components/widgets/text_editors/MultiFormat.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../src/components/widgets/text_editors/MultiFormat.js"],"names":["MultiFormatTextEditor","props","context","_","localize","editors","key","label","component","RichTextEditor","LaTeXEditor","HTMLEditor","startTab","value","state","nextTab","currentTab","messages","onModeChange","bind","editor","defaultValuePattern","onChange","trimmedValue","trim","trimmedValueLength","length","convertedValue","convertValue","isDefaultValue","test","switchingBetweenRichAndHtml","setState","render","onCancel","onContinue","placeholder","richTextClassNames","selected","latexClassNames","bottomTabClassNames","Editor","filter","ModeTabsText","map","showBottomTab","BottomTab","toLowerCase","content","renderConfirmationPanel","renderEditor","Component","propTypes","PropTypes","instanceOf","RegExp","func","isRequired","string","defaultProps","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,qB;;;AACJ,iCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,8IACpBD,KADoB,EACbC,OADa;;AAG1B,QAAMC,IAAID,QAAQE,QAAlB;;AAEA,QAAMC,UAAU,CACd;AACEC,WAAK,WADP;AAEEC,aAAOJ,EAAE,WAAF,CAFT;AAGEK,iBAAWC;AAHb,KADc,EAMd;AACEH,WAAK,OADP;AAEEC,aAAOJ,EAAE,OAAF,CAFT;AAGEK,iBAAWE;AAHb,KANc,EAWd;AACEJ,WAAK,MADP;AAEEC,aAAOJ,EAAE,cAAF,CAFT;AAGEK,iBAAWG;AAHb,KAXc,CAAhB;;AAkBA,QAAMC,WA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Z;AAGE,yBAAac,WAHf;AAIE,mBAAOvB;AAJT;AADF,SATF;AAiBGgC,wBAAgBC,SAAhB,GAA4B;AAjB/B,OADF;AAqBD;;;6BAEQ;AACP;;;;AADO,UAKA/B,OALA,GAKW,KAAKD,KALhB,CAKAC,OALA;;AAMP,UAAMiC,UACJ,KAAKC,uBAAL,CAA6BlC,YAAY,IAAzC,KAAkD,KAAKmC,YAAL,CAAkBnC,YAAY,IAA9B,CADpD;;AAGA,aAAO;AAAA;AAAA,UAAK,WAAU,2BAAf;AAA4CiC;AAA5C,OAAP;AACD;;;;EA/PiCG,gB;;AAkQpCnD,sBAAsBoD,SAAtB,GAAkC;AAChC/B,uBAAqBgC,oBAAUC,UAAV,CAAqBC,MAArB,CADW;AAEhCjC,YAAU+B,oBAAUG,IAAV,CAAeC,UAFO;AAGhCrB,eAAaiB,oBAAUK,MAHS;AAIhC7C,SAAOwC,oBAAUK;AAJe,CAAlC;;AAOA1D,sBAAsB2D,YAAtB,GAAqC;AACnCtC,uBAAqB,IADc;AAEnCe,eAAa,EAFsB;AAGnCvB,SAAO;AAH4B,CAArC;;AAMAb,sBAAsB4D,WAAtB,GAAoCC,8BAApC;;kBAEe7D,qB","file":"MultiFormat.js","sourcesContent":["import HTMLEditor from './HTML';\nimport LaTeXEditor from './LaTeX';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport RichTextEditor from './RichText';\nimport {isLaTeXExpr, htmlToLaTeX, laTeXToHTML, hasTextExpression} from './convertFormats';\nimport classnames from 'classnames';\nimport Button from 'components/widgets/Button';\nimport {EditorControlsContext} from '../../../context';\n\nclass MultiFormatTextEditor extends Component {\n constructor(props, context) {\n super(props, context);\n\n const _ = context.localize;\n\n const editors = [\n {\n key: 'RICH_TEXT',\n label: _('Rich Text'),\n component: RichTextEditor,\n },\n {\n key: 'LATEX',\n label: _('LaTeX'),\n component: LaTeXEditor,\n },\n {\n key: 'HTML',\n label: _('Edit in HTML'),\n component: HTMLEditor,\n },\n ];\n\n const startTab = isLaTeXExpr(props.value) ? 'LATEX' : 'RICH_TEXT';\n\n this.state = {\n /*\n * When nextTab is set, we are waiting for confirmation from the\n * user before switching to the next tab.\n */\n nextTab: null,\n currentTab: startTab,\n messages: [],\n };\n\n this.onModeChange = this.onModeChange.bind(this);\n this.editors = editors;\n }\n\n /**\n * Convert a value to the format expected by the provided editor.\n *\n * @param {String} value The current value\n * @param {String} editor The editor to convert for [RICH_TEXT|LATEX]\n * @returns {String} The converted value\n */\n convertValue(value, editor) {\n const {currentTab} = this.state;\n\n if (currentTab === 'RICH_TEXT' && editor === 'LATEX') {\n return htmlToLaTeX(value);\n }\n\n if (currentTab === 'LATEX' && editor === 'RICH_TEXT') {\n return laTeXToHTML(value);\n }\n\n if (currentTab === 'HTML' && editor === 'LATEX') {\n return htmlToLaTeX(value);\n }\n\n /*\n * Else we're switching from / to HTML / Rich Text Editor\n * no conversion is needed\n */\n return value;\n }\n\n onModeChange(nextTab) {\n const {localize: _} = this.context;\n const {defaultValuePattern, value, onChange} = this.props;\n const {currentTab} = this.state;\n const trimmedValue = value.trim();\n const trimmedValueLength = trimmedValue.length;\n const convertedValue = this.convertValue(trimmedValue, nextTab);\n\n /*\n * Check against default value - we have to compare the plain\n * value, not the LaTeX format value with `\\text{}` wrapping.\n */\n const isDefaultValue = isLaTeXExpr(trimmedValue)\n ? defaultValuePattern.test(convertedValue)\n : defaultValuePattern.test(trimmedValue);\n\n const switchingBetweenRichAndHtml =\n (currentTab === 'RICH_TEXT' && nextTab === 'HTML') ||\n (currentTab === 'HTML' && nextTab === 'RICH_TEXT');\n\n if (!isDefaultValue && trimmedValueLength > 0 && !switchingBetweenRichAndHtml) {\n // Show confirmation dialogue and defer tab change.\n let messages;\n\n if (!isLaTeXExpr(value)) {\n messages = [\n _(\"LaTeX is a math typesetting language that doesn't work with rich text.\"),\n _('Continuing will convert your note to LaTeX-style text.'),\n ];\n } else if (hasTextExpression(value)) {\n messages = [\n _('Rich text is incompatible with LaTeX.'),\n _('Continuing will convert your LaTeX expression into raw text.'),\n ];\n } else {\n messages = [\n _('Rich text is incompatible with LaTeX.'),\n _('Continuing will remove your expression.'),\n ];\n }\n\n this.setState({\n nextTab,\n messages,\n });\n\n return;\n }\n\n // Show requested tab immediately.\n this.setState({\n currentTab: nextTab,\n });\n\n // Convert the annotation and dispatch onChange action\n onChange(convertedValue);\n }\n\n renderConfirmationPanel(render) {\n if (!render) {\n return null;\n }\n\n const {localize: _} = this.context;\n const {messages} = this.state;\n\n const onCancel = () => {\n this.setState({\n nextTab: null,\n });\n };\n\n const onContinue = () => {\n const {nextTab} = this.state;\n const {onChange, value} = this.props;\n\n // Set next tab as active\n this.setState({\n currentTab: nextTab,\n nextTab: null,\n });\n\n // Convert the annotation\n const convertedValue = this.convertValue(value, nextTab);\n onChange(convertedValue);\n };\n\n return (\n
\n
\n

{_('Heads up!')}

\n
\n

\n {messages[0]}\n

\n

\n {messages[1]}\n

\n
\n
\n
\n \n {_('Go back')}\n \n \n {_('Continue')}\n \n
\n
\n );\n }\n\n renderEditor(render) {\n if (!render) {\n return null;\n }\n const {localize: _} = this.context;\n const {onChange, placeholder, value} = this.props;\n\n const {currentTab} = this.state;\n\n const richTextClassNames = classnames('multi-format-editor__tab', 'top-tab', 'left', {\n selected: currentTab === 'RICH_TEXT',\n });\n const latexClassNames = classnames('multi-format-editor__tab', 'top-tab', 'right', {\n selected: currentTab === 'LATEX',\n });\n const bottomTabClassNames = classnames('multi-format-editor__tab', 'bottom-tab');\n\n const Editor = this.editors.filter(editor => editor.key === currentTab)[0].component;\n\n const ModeTabsText = this.editors.map(editor => editor.label);\n\n const showBottomTab = currentTab === 'HTML' || currentTab === 'RICH_TEXT';\n const BottomTab =\n currentTab === 'HTML' ? (\n
this.onModeChange('RICH_TEXT')}>\n {_('Edit in Rich Text')}\n
\n ) : (\n
this.onModeChange('HTML')}>\n {_('Edit in HTML')}\n
\n );\n\n return (\n
\n
\n
this.onModeChange('RICH_TEXT')}>\n {ModeTabsText[0]}\n
\n
this.onModeChange('LATEX')}>\n {ModeTabsText[1]}\n
\n
\n
\n \n
\n {showBottomTab ? BottomTab : null}\n
\n );\n }\n\n render() {\n /*\n * `renderConfirmationPanel` and `renderEditor` are mutually\n * exclusive; only one will return a component.\n */\n const {nextTab} = this.state;\n const content =\n this.renderConfirmationPanel(nextTab !== null) || this.renderEditor(nextTab === null);\n\n return
{content}
;\n }\n}\n\nMultiFormatTextEditor.propTypes = {\n defaultValuePattern: PropTypes.instanceOf(RegExp),\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n};\n\nMultiFormatTextEditor.defaultProps = {\n defaultValuePattern: /^$/,\n placeholder: '',\n value: '',\n};\n\nMultiFormatTextEditor.contextType = EditorControlsContext;\n\nexport default MultiFormatTextEditor;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/DraftCommands.js b/lib/components/widgets/text_editors/RichText/DraftCommands.js new file mode 100644 index 000000000..6acbc8a05 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/DraftCommands.js @@ -0,0 +1,210 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cursorHasLink = cursorHasLink; +exports.getEntityByKey = getEntityByKey; +exports.getEntityKeyAt = getEntityKeyAt; +exports.handleKeyCommand = handleKeyCommand; +exports.insertSoftNewline = insertSoftNewline; +exports.toggleInlineStyle = toggleInlineStyle; +exports.toggleLink = toggleLink; +exports.toggleMutuallyExclusiveStyles = toggleMutuallyExclusiveStyles; + +var _draftJs = require('draft-js'); + +var _DraftModifier = require('draft-js/lib/DraftModifier'); + +var _configuration = require('./configuration'); + +/** + * Check whether the current selection is over a link + * + * @param {EditorState} editorState The DraftJS editor state + * @param {SelectionState} selection A DraftJS selection state + * @returns {Boolean} `true` if selection is over a link + */ +function selectionHasLink(editorState, selection) { + // If nothing is selected, bail early. + if (selection.isCollapsed()) { + return false; + } + + return cursorHasLink(editorState, selection); +} + +/** + * Check whether the cursor position is over a link + * + * @param {EditorState} editorState The DraftJS editor state + * @param {SelectionState} selection A DraftJS selection state + * @returns {Boolean} `true` if cursor is over a link + */ +/* + * This module exports functions that act on a DraftJS EditorState to + * effect commands. + */ + +function cursorHasLink(editorState, selection) { + var entity = getEntityByKey(getEntityKeyAt(editorState, selection)); + + return Boolean(entity && entity.get('type') === _configuration.LINK); +} + +/** + * Get an entity by its key + * Links are represented as DraftJS entities. + * https://facebook.github.io/draft-js/docs/api-reference-entity.html#content + * + * @param {String} entityKey The entity key + * @returns {DraftEntityInstance} The entity for the key, or `null` if not found + */ +function getEntityByKey(entityKey) { + if (!entityKey) { + return null; + } + + return _draftJs.Entity.get(entityKey); +} + +/** + * For a given SelectionState, get the underlying entity key. + * + * @param {EditorState} editorState The DraftJS editor state + * @param {SelectionState} selection The DraftJS selection state + * @returns {String} The entity key, or `null` if not found + */ +function getEntityKeyAt(editorState, selection) { + if (!selection) { + return null; + } + + var blockStartKey = selection.getStartKey(); + var selectionOffset = selection.getStartOffset(); + + var contentState = editorState.getCurrentContent(); + var block = contentState.getBlockForKey(blockStartKey); + + return block.getEntityAt(selectionOffset); +} + +/** + * Handle a keyboard command. + * TODO: add custom CMD-k command for link button. + * https://github.com/plotly/streambed/issues/6384 + * + * @param {EditorState} editorState The DraftJS editor state + * @param {String} command The command string representation + * @returns {EditorState} The new editor state + */ +function handleKeyCommand(editorState, command) { + switch (command) { + case 'split-block': + // Never split editor content into `

` blocks. + return insertSoftNewline(editorState); + case 'bold': + return toggleInlineStyle(editorState, _configuration.BOLD); + case 'italic': + return toggleInlineStyle(editorState, _configuration.ITALIC); + default: + return false; + } +} + +/** + * Insert a soft newline `\n` that converts to `
` in HTML. + * + * @param {EditorState} editorState The DraftJS editor state + * @returns {EditorState} The new editor state + */ +function insertSoftNewline(editorState) { + var newEditorState = editorState; + + // Terminate all current inline styles + var currentStyleSet = newEditorState.getCurrentInlineStyle(); + newEditorState = currentStyleSet.reduce(function (reducedEditorState, style) { + return _draftJs.RichUtils.toggleInlineStyle(reducedEditorState, style); + }, newEditorState); + + // If text is selected, delete text first. + var selectionState = newEditorState.getSelection(); + var selectionStart = selectionState.getStartOffset(); + var selectionEnd = selectionState.getEndOffset(); + + if (selectionEnd - selectionStart !== 0) { + var contentState = (0, _DraftModifier.removeRange)(newEditorState.getCurrentContent(), selectionState, 'back'); + + newEditorState = _draftJs.EditorState.push(newEditorState, contentState, 'backspace-character'); + } + + // Insert a newline + return _draftJs.RichUtils.insertSoftNewline(newEditorState); +} + +/** + * Toggle an inline style on/off + * + * @param {EditorState} editorState The DraftJS editor state + * @param {String} inlineStyle The inline style string representation + * @returns {EditorState} The new editor state + */ +function toggleInlineStyle(editorState, inlineStyle) { + /* + * TODO tech-debt. Link toggles should not go via toggleInlineStyle. + * https://github.com/plotly/streambed/issues/6354 + */ + + if (inlineStyle === _configuration.LINK) { + return toggleLink(editorState); + } + + // and should be mutually exclusive. + var updatedEditorState = toggleMutuallyExclusiveStyles(editorState, inlineStyle); + + // Add the new style. + return _draftJs.RichUtils.toggleInlineStyle(updatedEditorState, inlineStyle); +} + +/** + * Toggle a link on/off + * + * @param {EditorState} editorState The DraftJS editor state + * @returns {EditorState} The new editor state + */ +function toggleLink(editorState) { + var selection = editorState.getSelection(); + + if (selectionHasLink(editorState, selection)) { + // Remove link + return _draftJs.RichUtils.toggleLink(editorState, selection, null); + } + + // Create a link with an empty URL + var entityKey = _draftJs.Entity.create(_configuration.LINK, 'MUTABLE', { url: '' }); + + return _draftJs.RichUtils.toggleLink(editorState, selection, entityKey); +} + +/** + * For the current selection, if a SUPERSCRIPT or SUBSCRIPT style is + * to be applied, un-apply the other style. + * + * @param {EditorState} editorState The DraftJS editor state + * @param {String} inlineStyle Style about to be applied + * @returns {EditorState} The new editor state + */ +function toggleMutuallyExclusiveStyles(editorState, inlineStyle) { + var currentStyleSet = editorState.getCurrentInlineStyle(); + + if (inlineStyle === _configuration.SUBSCRIPT && currentStyleSet.includes(_configuration.SUPERSCRIPT)) { + return _draftJs.RichUtils.toggleInlineStyle(editorState, _configuration.SUPERSCRIPT); + } + + if (inlineStyle === _configuration.SUPERSCRIPT && currentStyleSet.includes(_configuration.SUBSCRIPT)) { + return _draftJs.RichUtils.toggleInlineStyle(editorState, _configuration.SUBSCRIPT); + } + + return editorState; +} +//# sourceMappingURL=DraftCommands.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/DraftCommands.js.map b/lib/components/widgets/text_editors/RichText/DraftCommands.js.map new file mode 100644 index 000000000..0ca147b82 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/DraftCommands.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/DraftCommands.js"],"names":["cursorHasLink","getEntityByKey","getEntityKeyAt","handleKeyCommand","insertSoftNewline","toggleInlineStyle","toggleLink","toggleMutuallyExclusiveStyles","selectionHasLink","editorState","selection","isCollapsed","entity","Boolean","get","LINK","entityKey","Entity","blockStartKey","getStartKey","selectionOffset","getStartOffset","contentState","getCurrentContent","block","getBlockForKey","getEntityAt","command","BOLD","ITALIC","newEditorState","currentStyleSet","getCurrentInlineStyle","reduce","reducedEditorState","style","RichUtils","selectionState","getSelection","selectionStart","selectionEnd","getEndOffset","EditorState","push","inlineStyle","updatedEditorState","create","url","SUBSCRIPT","includes","SUPERSCRIPT"],"mappings":";;;;;QAyCgBA,a,GAAAA,a;QAcAC,c,GAAAA,c;QAeAC,c,GAAAA,c;QAuBAC,gB,GAAAA,gB;QAoBAC,iB,GAAAA,iB;QAgCAC,iB,GAAAA,iB;QAuBAC,U,GAAAA,U;QAsBAC,6B,GAAAA,6B;;AAzLhB;;AASA;;AAEA;;AAEA;;;;;;;AAOA,SAASC,gBAAT,CAA0BC,WAA1B,EAAuCC,SAAvC,EAAkD;AAChD;AACA,MAAIA,UAAUC,WAAV,EAAJ,EAA6B;AAC3B,WAAO,KAAP;AACD;;AAED,SAAOX,cAAcS,WAAd,EAA2BC,SAA3B,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,KAAK,EAAN,EAA/B,CAAlB;;AAEA,SAAOX,mBAAU9B,UAAV,CAAqBG,WAArB,EAAkCC,SAAlC,EAA6CM,SAA7C,CAAP;AACD;;AAED;;;;;;;;AAQO,SAAST,6BAAT,CAAuCE,WAAvC,EAAoDmC,WAApD,EAAiE;AACtE,MAAMb,kBAAkBtB,YAAYuB,qBAAZ,EAAxB;;AAEA,MAAIY,gBAAgBI,wBAAhB,IAA6BjB,gBAAgBkB,QAAhB,CAAyBC,0BAAzB,CAAjC,EAAwE;AACtE,WAAOd,mBAAU/B,iBAAV,CAA4BI,WAA5B,EAAyCyC,0BAAzC,CAAP;AACD;;AAED,MAAIN,gBAAgBM,0BAAhB,IAA+BnB,gBAAgBkB,QAAhB,CAAyBD,wBAAzB,CAAnC,EAAwE;AACtE,WAAOZ,mBAAU/B,iBAAV,CAA4BI,WAA5B,EAAyCuC,wBAAzC,CAAP;AACD;;AAED,SAAOvC,WAAP;AACD","file":"DraftCommands.js","sourcesContent":["/*\n * This module exports functions that act on a DraftJS EditorState to\n * effect commands.\n */\n\nimport {\n EditorState,\n Entity,\n RichUtils,\n\n // Note: disable eslint cause SelectionState is mentioned quite often in JSDoc\n // eslint-disable-next-line no-unused-vars\n SelectionState,\n} from 'draft-js';\nimport {removeRange} from 'draft-js/lib/DraftModifier';\n\nimport {BOLD, ITALIC, SUPERSCRIPT, SUBSCRIPT, LINK} from './configuration';\n\n/**\n * Check whether the current selection is over a link\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection A DraftJS selection state\n * @returns {Boolean} `true` if selection is over a link\n */\nfunction selectionHasLink(editorState, selection) {\n // If nothing is selected, bail early.\n if (selection.isCollapsed()) {\n return false;\n }\n\n return cursorHasLink(editorState, selection);\n}\n\n/**\n * Check whether the cursor position is over a link\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection A DraftJS selection state\n * @returns {Boolean} `true` if cursor is over a link\n */\nexport function cursorHasLink(editorState, selection) {\n const entity = getEntityByKey(getEntityKeyAt(editorState, selection));\n\n return Boolean(entity && entity.get('type') === LINK);\n}\n\n/**\n * Get an entity by its key\n * Links are represented as DraftJS entities.\n * https://facebook.github.io/draft-js/docs/api-reference-entity.html#content\n *\n * @param {String} entityKey The entity key\n * @returns {DraftEntityInstance} The entity for the key, or `null` if not found\n */\nexport function getEntityByKey(entityKey) {\n if (!entityKey) {\n return null;\n }\n\n return Entity.get(entityKey);\n}\n\n/**\n * For a given SelectionState, get the underlying entity key.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection The DraftJS selection state\n * @returns {String} The entity key, or `null` if not found\n */\nexport function getEntityKeyAt(editorState, selection) {\n if (!selection) {\n return null;\n }\n\n const blockStartKey = selection.getStartKey();\n const selectionOffset = selection.getStartOffset();\n\n const contentState = editorState.getCurrentContent();\n const block = contentState.getBlockForKey(blockStartKey);\n\n return block.getEntityAt(selectionOffset);\n}\n\n/**\n * Handle a keyboard command.\n * TODO: add custom CMD-k command for link button.\n * https://github.com/plotly/streambed/issues/6384\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} command The command string representation\n * @returns {EditorState} The new editor state\n */\nexport function handleKeyCommand(editorState, command) {\n switch (command) {\n case 'split-block':\n // Never split editor content into `

` blocks.\n return insertSoftNewline(editorState);\n case 'bold':\n return toggleInlineStyle(editorState, BOLD);\n case 'italic':\n return toggleInlineStyle(editorState, ITALIC);\n default:\n return false;\n }\n}\n\n/**\n * Insert a soft newline `\\n` that converts to `
` in HTML.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @returns {EditorState} The new editor state\n */\nexport function insertSoftNewline(editorState) {\n let newEditorState = editorState;\n\n // Terminate all current inline styles\n const currentStyleSet = newEditorState.getCurrentInlineStyle();\n newEditorState = currentStyleSet.reduce(\n (reducedEditorState, style) => RichUtils.toggleInlineStyle(reducedEditorState, style),\n newEditorState\n );\n\n // If text is selected, delete text first.\n const selectionState = newEditorState.getSelection();\n const selectionStart = selectionState.getStartOffset();\n const selectionEnd = selectionState.getEndOffset();\n\n if (selectionEnd - selectionStart !== 0) {\n const contentState = removeRange(newEditorState.getCurrentContent(), selectionState, 'back');\n\n newEditorState = EditorState.push(newEditorState, contentState, 'backspace-character');\n }\n\n // Insert a newline\n return RichUtils.insertSoftNewline(newEditorState);\n}\n\n/**\n * Toggle an inline style on/off\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} inlineStyle The inline style string representation\n * @returns {EditorState} The new editor state\n */\nexport function toggleInlineStyle(editorState, inlineStyle) {\n /*\n * TODO tech-debt. Link toggles should not go via toggleInlineStyle.\n * https://github.com/plotly/streambed/issues/6354\n */\n\n if (inlineStyle === LINK) {\n return toggleLink(editorState);\n }\n\n // and should be mutually exclusive.\n const updatedEditorState = toggleMutuallyExclusiveStyles(editorState, inlineStyle);\n\n // Add the new style.\n return RichUtils.toggleInlineStyle(updatedEditorState, inlineStyle);\n}\n\n/**\n * Toggle a link on/off\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @returns {EditorState} The new editor state\n */\nexport function toggleLink(editorState) {\n const selection = editorState.getSelection();\n\n if (selectionHasLink(editorState, selection)) {\n // Remove link\n return RichUtils.toggleLink(editorState, selection, null);\n }\n\n // Create a link with an empty URL\n const entityKey = Entity.create(LINK, 'MUTABLE', {url: ''});\n\n return RichUtils.toggleLink(editorState, selection, entityKey);\n}\n\n/**\n * For the current selection, if a SUPERSCRIPT or SUBSCRIPT style is\n * to be applied, un-apply the other style.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} inlineStyle Style about to be applied\n * @returns {EditorState} The new editor state\n */\nexport function toggleMutuallyExclusiveStyles(editorState, inlineStyle) {\n const currentStyleSet = editorState.getCurrentInlineStyle();\n\n if (inlineStyle === SUBSCRIPT && currentStyleSet.includes(SUPERSCRIPT)) {\n return RichUtils.toggleInlineStyle(editorState, SUPERSCRIPT);\n }\n\n if (inlineStyle === SUPERSCRIPT && currentStyleSet.includes(SUBSCRIPT)) {\n return RichUtils.toggleInlineStyle(editorState, SUBSCRIPT);\n }\n\n return editorState;\n}\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkDecorator.js b/lib/components/widgets/text_editors/RichText/LinkDecorator.js new file mode 100644 index 000000000..77ab0cd44 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/LinkDecorator.js @@ -0,0 +1,39 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* + * A DecoratorComponent is used by `draft-js` to render rich content + * beyond inline styles. This Decorator renders LINK entities. + * + * See + * https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#decorator-components + */ + +var LinkDecorator = function LinkDecorator(props) { + return _react2.default.createElement( + 'a', + { href: '#', style: props.style }, + props.children + ); +}; + +LinkDecorator.propTypes = { + style: _propTypes2.default.object.isRequired, + children: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.element]).isRequired +}; + +exports.default = LinkDecorator; +//# sourceMappingURL=LinkDecorator.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkDecorator.js.map b/lib/components/widgets/text_editors/RichText/LinkDecorator.js.map new file mode 100644 index 000000000..d1c84c7d6 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/LinkDecorator.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/LinkDecorator.js"],"names":["LinkDecorator","props","style","children","propTypes","PropTypes","object","isRequired","oneOfType","array","element"],"mappings":";;;;;;AAQA;;;;AACA;;;;;;AATA;;;;;;;;AAWA,IAAMA,gBAAgB,SAAhBA,aAAgB,QAAS;AAC7B,SACE;AAAA;AAAA,MAAG,MAAK,GAAR,EAAY,OAAOC,MAAMC,KAAzB;AACGD,UAAME;AADT,GADF;AAKD,CAND;;AAQAH,cAAcI,SAAd,GAA0B;AACxBF,SAAOG,oBAAUC,MAAV,CAAiBC,UADA;AAExBJ,YAAUE,oBAAUG,SAAV,CAAoB,CAACH,oBAAUI,KAAX,EAAkBJ,oBAAUK,OAA5B,CAApB,EAA0DH;AAF5C,CAA1B;;kBAKeP,a","file":"LinkDecorator.js","sourcesContent":["/*\n * A DecoratorComponent is used by `draft-js` to render rich content\n * beyond inline styles. This Decorator renders LINK entities.\n *\n * See\n * https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#decorator-components\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst LinkDecorator = props => {\n return (\n \n {props.children}\n \n );\n};\n\nLinkDecorator.propTypes = {\n style: PropTypes.object.isRequired,\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.element]).isRequired,\n};\n\nexport default LinkDecorator;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkEditor.js b/lib/components/widgets/text_editors/RichText/LinkEditor.js new file mode 100644 index 000000000..cfb6df266 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/LinkEditor.js @@ -0,0 +1,197 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _constants = require('../../../../lib/constants'); + +var _reactDom = require('react-dom'); + +var _context = require('../../../../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* + * The LinkEditor is a simple UI component that floats below a selected link + * in the RichTextEditor, and lets the user enter a URL. + */ + +var LinkEditor = function (_Component) { + _inherits(LinkEditor, _Component); + + function LinkEditor(props) { + _classCallCheck(this, LinkEditor); + + var _this = _possibleConstructorReturn(this, (LinkEditor.__proto__ || Object.getPrototypeOf(LinkEditor)).call(this, props)); + + _this.state = { + // Use cached position to maintain position during times of focus. + position: _this.getUpdatedPosition(props), + originalLinkURL: props.linkURL + }; + return _this; + } + + _createClass(LinkEditor, [{ + key: 'componentDidMount', + value: function componentDidMount() { + // Focus the input field if the URL value is empty + if (this.props.linkURL.trim() === '') { + (0, _reactDom.findDOMNode)(this.input).focus(); + } + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + var props = this.props; + + // Update position if we are editing a new link + + if (nextProps.linkID !== props.linkID) { + this.setState({ + position: this.getUpdatedPosition(props) + }); + } + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + // Cursor dissappears when component rerenders, to make sure it's present + // we're using setSelection range to make it appear at the end of text: + // https://github.com/plotly/streambed/issues/9964 + (0, _reactDom.findDOMNode)(this.input).setSelectionRange(this.props.linkURL.length, this.props.linkURL.length); + } + }, { + key: 'getUpdatedPosition', + value: function getUpdatedPosition(props) { + var _props$coordinates = props.coordinates, + x = _props$coordinates.x, + y = _props$coordinates.y; + + + return { x: x, y: y }; + } + }, { + key: 'onInputChange', + value: function onInputChange(urlValue) { + var _props = this.props, + linkID = _props.linkID, + onURLChange = _props.onURLChange; + + // Call back to parent + + onURLChange(linkID, urlValue); + } + }, { + key: 'onInputKeyDown', + value: function onInputKeyDown(ev) { + /* + * `KeyboardEvent.key` enjoys excellent cross-browser support. + * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key + */ + var key = ev.key; + + + if (key === _constants.RETURN_KEY) { + // Save changes + ev.preventDefault(); + + this.props.onClose(this.props.linkID); + } + + if (key === _constants.ESCAPE_KEY) { + // Cancel changes + ev.preventDefault(); + + // Restore original URL + this.onInputChange(this.state.originalLinkURL); + + this.props.onClose(this.props.linkID); + } + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _ = this.context.localize; + var position = this.state.position; + var _props2 = this.props, + onBlur = _props2.onBlur, + onFocus = _props2.onFocus, + linkURL = _props2.linkURL; + + var placeholderText = _('Enter Link URL'); + var urlText = _('URL'); + // TODO: add close button + return _react2.default.createElement( + 'div', + { className: 'rich-text-editor__link-editor', style: { left: position.x, top: position.y } }, + _react2.default.createElement( + 'span', + { className: 'rich-text-editor__link-editor__label' }, + urlText + ), + _react2.default.createElement('input', { + className: 'rich-text-editor__link-editor__input', + onBlur: onBlur, + onFocus: onFocus, + onChange: function onChange(ev) { + return _this2.onInputChange(ev.target.value); + }, + onKeyDown: function onKeyDown(ev) { + return _this2.onInputKeyDown(ev); + }, + ref: function ref(input) { + return _this2.input = input; + }, + value: linkURL, + placeholder: placeholderText + }) + ); + } + }]); + + return LinkEditor; +}(_react.Component); + +LinkEditor.propTypes = { + linkID: _propTypes2.default.string.isRequired, + linkURL: _propTypes2.default.string.isRequired, + onBlur: _propTypes2.default.func.isRequired, + onFocus: _propTypes2.default.func.isRequired, + onClose: _propTypes2.default.func.isRequired, + onURLChange: _propTypes2.default.func.isRequired, + + coordinates: _propTypes2.default.shape({ + x: _propTypes2.default.number, + y: _propTypes2.default.number + }) +}; + +LinkEditor.defaultProps = { + coordinates: { + x: 0, + y: 0 + } +}; + +LinkEditor.contextType = _context.EditorControlsContext; + +exports.default = LinkEditor; +//# sourceMappingURL=LinkEditor.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkEditor.js.map b/lib/components/widgets/text_editors/RichText/LinkEditor.js.map new file mode 100644 index 000000000..ff86a903b --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/LinkEditor.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/LinkEditor.js"],"names":["LinkEditor","props","state","position","getUpdatedPosition","originalLinkURL","linkURL","trim","input","focus","nextProps","linkID","setState","setSelectionRange","length","coordinates","x","y","urlValue","onURLChange","ev","key","RETURN_KEY","preventDefault","onClose","ESCAPE_KEY","onInputChange","_","context","localize","onBlur","onFocus","placeholderText","urlText","left","top","target","value","onInputKeyDown","Component","propTypes","PropTypes","string","isRequired","func","shape","number","defaultProps","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAKA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;+eATA;;;;;IAWMA,U;;;AACJ,sBAAYC,KAAZ,EAAmB;AAAA;;AAAA,wHACXA,KADW;;AAGjB,UAAKC,KAAL,GAAa;AACX;AACAC,gBAAU,MAAKC,kBAAL,CAAwBH,KAAxB,CAFC;AAGXI,uBAAiBJ,MAAMK;AAHZ,KAAb;AAHiB;AAQlB;;;;wCAEmB;AAClB;AACA,UAAI,KAAKL,KAAL,CAAWK,OAAX,CAAmBC,IAAnB,OAA8B,EAAlC,EAAsC;AACpC,mCAAY,KAAKC,KAAjB,EAAwBC,KAAxB;AACD;AACF;;;8CAEyBC,S,EAAW;AAAA,UAC5BT,KAD4B,GACnB,IADmB,CAC5BA,KAD4B;;AAGnC;;AACA,UAAIS,UAAUC,MAAV,KAAqBV,MAAMU,MAA/B,EAAuC;AACrC,aAAKC,QAAL,CAAc;AACZT,oBAAU,KAAKC,kBAAL,C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selected link\n * in the RichTextEditor, and lets the user enter a URL.\n */\n\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {RETURN_KEY, ESCAPE_KEY} from 'lib/constants';\nimport {findDOMNode} from 'react-dom';\nimport {EditorControlsContext} from '../../../../context';\n\nclass LinkEditor extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n // Use cached position to maintain position during times of focus.\n position: this.getUpdatedPosition(props),\n originalLinkURL: props.linkURL,\n };\n }\n\n componentDidMount() {\n // Focus the input field if the URL value is empty\n if (this.props.linkURL.trim() === '') {\n findDOMNode(this.input).focus();\n }\n }\n\n componentWillReceiveProps(nextProps) {\n const {props} = this;\n\n // Update position if we are editing a new link\n if (nextProps.linkID !== props.linkID) {\n this.setState({\n position: this.getUpdatedPosition(props),\n });\n }\n }\n\n componentDidUpdate() {\n // Cursor dissappears when component rerenders, to make sure it's present\n // we're using setSelection range to make it appear at the end of text:\n // https://github.com/plotly/streambed/issues/9964\n findDOMNode(this.input).setSelectionRange(this.props.linkURL.length, this.props.linkURL.length);\n }\n\n getUpdatedPosition(props) {\n const {x, y} = props.coordinates;\n\n return {x, y};\n }\n\n onInputChange(urlValue) {\n const {linkID, onURLChange} = this.props;\n\n // Call back to parent\n onURLChange(linkID, urlValue);\n }\n\n onInputKeyDown(ev) {\n /*\n * `KeyboardEvent.key` enjoys excellent cross-browser support.\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n */\n const {key} = ev;\n\n if (key === RETURN_KEY) {\n // Save changes\n ev.preventDefault();\n\n this.props.onClose(this.props.linkID);\n }\n\n if (key === ESCAPE_KEY) {\n // Cancel changes\n ev.preventDefault();\n\n // Restore original URL\n this.onInputChange(this.state.originalLinkURL);\n\n this.props.onClose(this.props.linkID);\n }\n }\n\n render() {\n const {localize: _} = this.context;\n const {position} = this.state;\n const {onBlur, onFocus, linkURL} = this.props;\n const placeholderText = _('Enter Link URL');\n const urlText = _('URL');\n // TODO: add close button\n return (\n

\n {urlText}\n this.onInputChange(ev.target.value)}\n onKeyDown={ev => this.onInputKeyDown(ev)}\n ref={input => (this.input = input)}\n value={linkURL}\n placeholder={placeholderText}\n />\n
\n );\n }\n}\n\nLinkEditor.propTypes = {\n linkID: PropTypes.string.isRequired,\n linkURL: PropTypes.string.isRequired,\n onBlur: PropTypes.func.isRequired,\n onFocus: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n onURLChange: PropTypes.func.isRequired,\n\n coordinates: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number,\n }),\n};\n\nLinkEditor.defaultProps = {\n coordinates: {\n x: 0,\n y: 0,\n },\n};\n\nLinkEditor.contextType = EditorControlsContext;\n\nexport default LinkEditor;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButton.js b/lib/components/widgets/text_editors/RichText/StyleButton.js new file mode 100644 index 000000000..40eb7d012 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/StyleButton.js @@ -0,0 +1,95 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _classnames = require('classnames'); + +var _classnames2 = _interopRequireDefault(_classnames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var StyleButton = function (_Component) { + _inherits(StyleButton, _Component); + + function StyleButton(props) { + _classCallCheck(this, StyleButton); + + var _this = _possibleConstructorReturn(this, (StyleButton.__proto__ || Object.getPrototypeOf(StyleButton)).call(this, props)); + + _this.onToggle = _this.onToggle.bind(_this); + return _this; + } + + _createClass(StyleButton, [{ + key: 'onToggle', + value: function onToggle(ev) { + // Prevent focus moving from editor to button + ev.preventDefault(); + this.props.onToggle(this.props.value); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + active = _props.active, + label = _props.label, + value = _props.value; + + + var className = (0, _classnames2.default)('rich-text-editor__styleButton', 'rich-text-editor__styleButton__' + value, { + 'rich-text-editor__styleButton--active': active + }); + + return _react2.default.createElement( + 'span', + { className: 'rich-text-editor__styleButton__wrapper' }, + _react2.default.createElement( + 'span', + { + className: className, + onMouseDown: this.onToggle, + 'data-role': 'button', + 'data-pressed': active + }, + label + ) + ); + } + }]); + + return StyleButton; +}(_react.Component); + +StyleButton.propTypes = { + active: _propTypes2.default.bool, + + // A (styled) React element to display as label + label: _propTypes2.default.element.isRequired, + + // Callback for clicks + onToggle: _propTypes2.default.func.isRequired, + + // The value passed to `onToggle` when clicked + value: _propTypes2.default.string.isRequired +}; + +exports.default = StyleButton; +//# sourceMappingURL=StyleButton.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButton.js.map b/lib/components/widgets/text_editors/RichText/StyleButton.js.map new file mode 100644 index 000000000..d5a2d0c5f --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/StyleButton.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/StyleButton.js"],"names":["StyleButton","props","onToggle","bind","ev","preventDefault","value","active","label","className","Component","propTypes","PropTypes","bool","element","isRequired","func","string"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,W;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA,0HACXA,KADW;;AAGjB,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AAHiB;AAIlB;;;;6BAEQC,E,EAAI;AACX;AACAA,SAAGC,cAAH;AACA,WAAKJ,KAAL,CAAWC,QAAX,CAAoB,KAAKD,KAAL,CAAWK,KAA/B;AACD;;;6BAEQ;AAAA,mBACwB,KAAKL,KAD7B;AAAA,UACAM,MADA,UACAA,MADA;AAAA,UACQC,KADR,UACQA,KADR;AAAA,UACeF,KADf,UACeA,KADf;;;AAGP,UAAMG,YAAY,0BAChB,+BADgB,sCAEkBH,KAFlB,EAGhB;AACE,iDAAyCC;AAD3C,OAHgB,CAAlB;;AAQA,aACE;AAAA;AAAA,UAAM,WAAU,wCAAhB;AACE;AAAA;AAAA;AACE,uBAAWE,SADb;AAEE,yBAAa,KAAKP,QAFpB;AAGE,yBAAU,QAHZ;AAIE,4BAAcK;AAJhB;AAMGC;AANH;AADF,OADF;AAYD;;;;EApCuBE,gB;;AAuC1BV,YAAYW,SAAZ,GAAwB;AACtBJ,UAAQK,oBAAUC,IADI;;AAGtB;AACAL,SAAOI,oBAAUE,OAAV,CAAkBC,UAJH;;AAMtB;AACAb,YAAUU,oBAAUI,IAAV,CAAeD,UAPH;;AAStB;AACAT,SAAOM,oBAAUK,MAAV,CAAiBF;AAVF,CAAxB;;kBAaef,W","file":"StyleButton.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nclass StyleButton extends Component {\n constructor(props) {\n super(props);\n\n this.onToggle = this.onToggle.bind(this);\n }\n\n onToggle(ev) {\n // Prevent focus moving from editor to button\n ev.preventDefault();\n this.props.onToggle(this.props.value);\n }\n\n render() {\n const {active, label, value} = this.props;\n\n const className = classnames(\n 'rich-text-editor__styleButton',\n `rich-text-editor__styleButton__${value}`,\n {\n 'rich-text-editor__styleButton--active': active,\n }\n );\n\n return (\n \n \n {label}\n \n \n );\n }\n}\n\nStyleButton.propTypes = {\n active: PropTypes.bool,\n\n // A (styled) React element to display as label\n label: PropTypes.element.isRequired,\n\n // Callback for clicks\n onToggle: PropTypes.func.isRequired,\n\n // The value passed to `onToggle` when clicked\n value: PropTypes.string.isRequired,\n};\n\nexport default StyleButton;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js b/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js new file mode 100644 index 000000000..3865d8591 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js @@ -0,0 +1,97 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _StyleButton = require('./StyleButton'); + +var _StyleButton2 = _interopRequireDefault(_StyleButton); + +var _configuration = require('./configuration'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var StyleButtonGroup = function (_Component) { + _inherits(StyleButtonGroup, _Component); + + function StyleButtonGroup() { + _classCallCheck(this, StyleButtonGroup); + + return _possibleConstructorReturn(this, (StyleButtonGroup.__proto__ || Object.getPrototypeOf(StyleButtonGroup)).apply(this, arguments)); + } + + _createClass(StyleButtonGroup, [{ + key: 'render', + value: function render() { + var _props = this.props, + currentStyle = _props.currentStyle, + linkIsSelected = _props.linkIsSelected, + styles = _props.styles, + onToggle = _props.onToggle; + + + var isActive = function isActive(currentStyle, value) { + if (value === _configuration.LINK) { + return linkIsSelected; + } + + if (typeof currentStyle.has === 'function') { + return currentStyle.has(value); + } + + return Boolean(currentStyle.value); + }; + + return _react2.default.createElement( + 'div', + { className: 'rich-text-editor__controls' }, + styles.map(function (_ref) { + var label = _ref.label, + value = _ref.value; + return _react2.default.createElement(_StyleButton2.default, { + key: value, + active: isActive(currentStyle, value), + label: label, + onToggle: onToggle, + value: value + }); + }) + ); + } + }]); + + return StyleButtonGroup; +}(_react.Component); + +StyleButtonGroup.propTypes = { + onToggle: _propTypes2.default.func.isRequired, + styles: _propTypes2.default.arrayOf(_propTypes2.default.shape({ + label: _propTypes2.default.element.isRequired, + value: _propTypes2.default.string.isRequired + })).isRequired, + + // A draft-js DraftInlineStyle instance + // https://facebook.github.io/draft-js/docs/api-reference-editor-state.html#getcurrentinlinestyle + currentStyle: _propTypes2.default.object, + linkIsSelected: _propTypes2.default.bool +}; + +exports.default = StyleButtonGroup; +//# sourceMappingURL=StyleButtonGroup.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map b/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map new file mode 100644 index 000000000..67beb58fb --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/StyleButtonGroup.js"],"names":["StyleButtonGroup","props","currentStyle","linkIsSelected","styles","onToggle","isActive","value","LINK","has","Boolean","map","label","Component","propTypes","PropTypes","func","isRequired","arrayOf","shape","element","string","object","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,gB;;;;;;;;;;;6BACK;AAAA,mBACkD,KAAKC,KADvD;AAAA,UACAC,YADA,UACAA,YADA;AAAA,UACcC,cADd,UACcA,cADd;AAAA,UAC8BC,MAD9B,UAC8BA,MAD9B;AAAA,UACsCC,QADtC,UACsCA,QADtC;;;AAGP,UAAMC,WAAW,SAAXA,QAAW,CAACJ,YAAD,EAAeK,KAAf,EAAyB;AACxC,YAAIA,UAAUC,mBAAd,EAAoB;AAClB,iBAAOL,cAAP;AACD;;AAED,YAAI,OAAOD,aAAaO,GAApB,KAA4B,UAAhC,EAA4C;AAC1C,iBAAOP,aAAaO,GAAb,CAAiBF,KAAjB,CAAP;AACD;;AAED,eAAOG,QAAQR,aAAaK,KAArB,CAAP;AACD,OAVD;;AAYA,aACE;AAAA;AAAA,UAAK,WAAU,4BAAf;AACGH,eAAOO,GAAP,CAAW;AAAA,cAAEC,KAAF,QAAEA,KAAF;AAAA,cAASL,KAAT,QAASA,KAAT;AAAA,iBACV,8BAAC,qBAAD;AACE,iBAAKA,KADP;AAEE,oBAAQD,SAASJ,YAAT,EAAuBK,KAAvB,CAFV;AAGE,mBAAOK,KAHT;AAIE,sBAAUP,QAJZ;AAKE,mBAAOE;AALT,YADU;AAAA,SAAX;AADH,OADF;AAaD;;;;EA7B4BM,gB;;AAgC/Bb,iBAAiBc,SAAjB,GAA6B;AAC3BT,YAAUU,oBAAUC,IAAV,CAAeC,UADE;AAE3Bb,UAAQW,oBAAUG,OAAV,CACNH,oBAAUI,KAAV,CAAgB;AACdP,WAAOG,oBAAUK,OAAV,CAAkBH,UADX;AAEdV,WAAOQ,oBAAUM,MAAV,CAAiBJ;AAFV,GAAhB,CADM,EAKNA,UAPyB;;AAS3B;AACA;AACAf,gBAAca,oBAAUO,MAXG;AAY3BnB,kBAAgBY,oBAAUQ;AAZC,CAA7B;;kBAeevB,gB","file":"StyleButtonGroup.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport StyleButton from './StyleButton';\nimport {LINK} from './configuration';\n\nclass StyleButtonGroup extends Component {\n render() {\n const {currentStyle, linkIsSelected, styles, onToggle} = this.props;\n\n const isActive = (currentStyle, value) => {\n if (value === LINK) {\n return linkIsSelected;\n }\n\n if (typeof currentStyle.has === 'function') {\n return currentStyle.has(value);\n }\n\n return Boolean(currentStyle.value);\n };\n\n return (\n
\n {styles.map(({label, value}) => (\n \n ))}\n
\n );\n }\n}\n\nStyleButtonGroup.propTypes = {\n onToggle: PropTypes.func.isRequired,\n styles: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.element.isRequired,\n value: PropTypes.string.isRequired,\n })\n ).isRequired,\n\n // A draft-js DraftInlineStyle instance\n // https://facebook.github.io/draft-js/docs/api-reference-editor-state.html#getcurrentinlinestyle\n currentStyle: PropTypes.object,\n linkIsSelected: PropTypes.bool,\n};\n\nexport default StyleButtonGroup;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/configuration.js b/lib/components/widgets/text_editors/RichText/configuration.js new file mode 100644 index 000000000..b498bc912 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/configuration.js @@ -0,0 +1,110 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.INLINE_STYLES = exports.STYLE_MAP = exports.STYLES_TO_HTML_TAGS = exports.ITALIC = exports.BOLD = exports.LINK = exports.SUBSCRIPT = exports.SUPERSCRIPT = undefined; + +var _STYLES_TO_HTML_TAGS, _STYLE_MAP; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _draftJsUtils = require('draft-js-utils'); + +var _plotlyIcons = require('plotly-icons'); + +var _constants = require('../../../../lib/constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var SUPERSCRIPT = exports.SUPERSCRIPT = 'SUPERSCRIPT'; +var SUBSCRIPT = exports.SUBSCRIPT = 'SUBSCRIPT'; +var LINK = exports.LINK = 'LINK'; + +var BOLD = _draftJsUtils.INLINE_STYLE.BOLD, + ITALIC = _draftJsUtils.INLINE_STYLE.ITALIC; +exports.BOLD = BOLD; +exports.ITALIC = ITALIC; +var STYLES_TO_HTML_TAGS = exports.STYLES_TO_HTML_TAGS = (_STYLES_TO_HTML_TAGS = {}, _defineProperty(_STYLES_TO_HTML_TAGS, BOLD, { element: 'b' }), _defineProperty(_STYLES_TO_HTML_TAGS, ITALIC, { element: 'i' }), _defineProperty(_STYLES_TO_HTML_TAGS, SUPERSCRIPT, { element: 'sup' }), _defineProperty(_STYLES_TO_HTML_TAGS, SUBSCRIPT, { element: 'sub' }), _defineProperty(_STYLES_TO_HTML_TAGS, LINK, { element: 'a' }), _STYLES_TO_HTML_TAGS); + +var STYLE_MAP = exports.STYLE_MAP = (_STYLE_MAP = {}, _defineProperty(_STYLE_MAP, BOLD, { + fontWeight: 'bolder' +}), _defineProperty(_STYLE_MAP, ITALIC, { + fontStyle: 'italic' +}), _defineProperty(_STYLE_MAP, SUBSCRIPT, { + /* + * Can't use text-align; IE renders `text-bottom` properly, but + * FF doesn't (same height as `bottom`). Chrome doesn't understand + * `text-align: bottom`. Use relative positioning instead. + */ + lineHeight: 0, + fontSize: '65%', + position: 'relative', + bottom: '-3px' +}), _defineProperty(_STYLE_MAP, SUPERSCRIPT, { + /* + * Can't use text-align; IE renders `text-top` properly, but + * FF doesn't (same height as `top`). Chrome doesn't understand + * `text-align: top`. Use relative positioning instead. + */ + lineHeight: 0, + fontSize: '65%', + position: 'relative', + top: '-5px' +}), _defineProperty(_STYLE_MAP, LINK, { + color: _constants.COLORS.editorLink, + linkDecoration: 'none', + cursor: 'pointer' +}), _STYLE_MAP); + +var INLINE_STYLES = exports.INLINE_STYLES = [{ + label: _react2.default.createElement( + 'span', + { style: STYLE_MAP[BOLD] }, + 'B' + ), + value: BOLD +}, { + label: _react2.default.createElement( + 'span', + { style: STYLE_MAP[ITALIC] }, + 'I' + ), + value: ITALIC +}, { + label: _react2.default.createElement( + 'span', + null, + 'x', + _react2.default.createElement( + 'span', + { style: STYLE_MAP[SUBSCRIPT] }, + '2' + ) + ), + value: SUBSCRIPT +}, { + label: _react2.default.createElement( + 'span', + null, + 'x', + _react2.default.createElement( + 'span', + { style: STYLE_MAP[SUPERSCRIPT] }, + '2' + ) + ), + value: SUPERSCRIPT +}, { + label: _react2.default.createElement( + 'span', + null, + _react2.default.createElement(_plotlyIcons.LinkIcon, { className: 'icon-link' }) + ), + value: LINK +}]; +//# sourceMappingURL=configuration.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/configuration.js.map b/lib/components/widgets/text_editors/RichText/configuration.js.map new file mode 100644 index 000000000..56a8fa285 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/configuration.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/configuration.js"],"names":["SUPERSCRIPT","SUBSCRIPT","LINK","BOLD","INLINE_STYLE","ITALIC","STYLES_TO_HTML_TAGS","element","STYLE_MAP","fontWeight","fontStyle","lineHeight","fontSize","position","bottom","top","color","COLORS","editorLink","linkDecoration","cursor","INLINE_STYLES","label","value"],"mappings":";;;;;;;;;AAAA;;;;AACA;;AACA;;AACA;;;;;;AAEO,IAAM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A,QAAM,OAAOd,UAAUR,WAAV,CAAb;AAAA;AAAA;AADH,GAFJ;AAMEuB,SAAOvB;AANT,CAjB2B,EAyB3B;AACEsB,SACE;AAAA;AAAA;AACE,kCAAC,qBAAD,IAAU,WAAU,WAApB;AADF,GAFJ;AAMEC,SAAOrB;AANT,CAzB2B,CAAtB","file":"configuration.js","sourcesContent":["import React from 'react';\nimport {INLINE_STYLE} from 'draft-js-utils';\nimport {LinkIcon} from 'plotly-icons';\nimport {COLORS} from 'lib/constants';\n\nexport const SUPERSCRIPT = 'SUPERSCRIPT';\nexport const SUBSCRIPT = 'SUBSCRIPT';\nexport const LINK = 'LINK';\n\nexport const {BOLD, ITALIC} = INLINE_STYLE;\n\nexport const STYLES_TO_HTML_TAGS = {\n [BOLD]: {element: 'b'},\n [ITALIC]: {element: 'i'},\n [SUPERSCRIPT]: {element: 'sup'},\n [SUBSCRIPT]: {element: 'sub'},\n [LINK]: {element: 'a'},\n};\n\nexport const STYLE_MAP = {\n [BOLD]: {\n fontWeight: 'bolder',\n },\n [ITALIC]: {\n fontStyle: 'italic',\n },\n [SUBSCRIPT]: {\n /*\n * Can't use text-align; IE renders `text-bottom` properly, but\n * FF doesn't (same height as `bottom`). Chrome doesn't understand\n * `text-align: bottom`. Use relative positioning instead.\n */\n lineHeight: 0,\n fontSize: '65%',\n position: 'relative',\n bottom: '-3px',\n },\n [SUPERSCRIPT]: {\n /*\n * Can't use text-align; IE renders `text-top` properly, but\n * FF doesn't (same height as `top`). Chrome doesn't understand\n * `text-align: top`. Use relative positioning instead.\n */\n lineHeight: 0,\n fontSize: '65%',\n position: 'relative',\n top: '-5px',\n },\n [LINK]: {\n color: COLORS.editorLink,\n linkDecoration: 'none',\n cursor: 'pointer',\n },\n};\n\nexport const INLINE_STYLES = [\n {\n label: B,\n value: BOLD,\n },\n {\n label: I,\n value: ITALIC,\n },\n {\n label: (\n \n x2\n \n ),\n value: SUBSCRIPT,\n },\n {\n label: (\n \n x2\n \n ),\n value: SUPERSCRIPT,\n },\n {\n label: (\n \n \n \n ),\n value: LINK,\n },\n];\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/debounce.js b/lib/components/widgets/text_editors/RichText/debounce.js new file mode 100644 index 000000000..abbe28f2f --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/debounce.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = debounce; +var DEBOUNCE_DELAY = 250; +var timeout = void 0; + +function clearTimeout() { + window.clearTimeout(timeout); + timeout = null; +} + +function debounce(fn, args) { + if (timeout) { + clearTimeout(); + } + + timeout = window.setTimeout(function () { + fn.apply(null, args); + timeout = null; + }, DEBOUNCE_DELAY); +} +//# sourceMappingURL=debounce.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/debounce.js.map b/lib/components/widgets/text_editors/RichText/debounce.js.map new file mode 100644 index 000000000..d77a19602 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/debounce.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/debounce.js"],"names":["debounce","DEBOUNCE_DELAY","timeout","clearTimeout","window","fn","args","setTimeout","apply"],"mappings":";;;;;kBAQwBA,Q;AARxB,IAAMC,iBAAiB,GAAvB;AACA,IAAIC,gBAAJ;;AAEA,SAASC,YAAT,GAAwB;AACtBC,SAAOD,YAAP,CAAoBD,OAApB;AACAA,YAAU,IAAV;AACD;;AAEc,SAASF,QAAT,CAAkBK,EAAlB,EAAsBC,IAAtB,EAA4B;AACzC,MAAIJ,OAAJ,EAAa;AACXC;AACD;;AAEDD,YAAUE,OAAOG,UAAP,CAAkB,YAAM;AAChCF,OAAGG,KAAH,CAAS,IAAT,EAAeF,IAAf;AACAJ,cAAU,IAAV;AACD,GAHS,EAGPD,cAHO,CAAV;AAID","file":"debounce.js","sourcesContent":["const DEBOUNCE_DELAY = 250;\nlet timeout;\n\nfunction clearTimeout() {\n window.clearTimeout(timeout);\n timeout = null;\n}\n\nexport default function debounce(fn, args) {\n if (timeout) {\n clearTimeout();\n }\n\n timeout = window.setTimeout(() => {\n fn.apply(null, args);\n timeout = null;\n }, DEBOUNCE_DELAY);\n}\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/decoratorStrategies.js b/lib/components/widgets/text_editors/RichText/decoratorStrategies.js new file mode 100644 index 000000000..d5b9977c8 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/decoratorStrategies.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findLinkEntities = undefined; + +var _draftJs = require('draft-js'); + +var characterIsLinkEntity = function characterIsLinkEntity(character) { + var entityKey = character.getEntity(); + + if (entityKey === null) { + return false; + } + + var entity = _draftJs.Entity.get(entityKey); + + return entity.getType() === 'LINK'; +}; /* + * A decoratorStrategy is used by `draft-js` to determine how to render + * content beyond inline styles. We use them to render LINK entities. + * + * See https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#content + * and + * https://facebook.github.io/draft-js/docs/advanced-topics-entities.html#content + */ +var findLinkEntities = exports.findLinkEntities = function findLinkEntities(contentBlock, callback) { + contentBlock.findEntityRanges(characterIsLinkEntity, callback); +}; +//# sourceMappingURL=decoratorStrategies.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map b/lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map new file mode 100644 index 000000000..54c1d1ae0 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/decoratorStrategies.js"],"names":["characterIsLinkEntity","entityKey","character","getEntity","entity","Entity","get","getType","findLinkEntities","contentBlock","callback","findEntityRanges"],"mappings":";;;;;;;AAQA;;AAEA,IAAMA,wBAAwB,SAAxBA,qBAAwB,YAAa;AACzC,MAAMC,YAAYC,UAAUC,SAAV,EAAlB;;AAEA,MAAIF,cAAc,IAAlB,EAAwB;AACtB,WAAO,KAAP;AACD;;AAED,MAAMG,SAASC,gBAAOC,GAAP,CAAWL,SAAX,CAAf;;AAEA,SAAOG,OAAOG,OAAP,OAAqB,MAA5B;AACD,CAVD,C,CAVA;;;;;;;;AAsBO,IAAMC,8CAAmB,SAAnBA,gBAAmB,CAACC,YAAD,EAAeC,QAAf,EAA4B;AAC1DD,eAAaE,gBAAb,CAA8BX,qBAA9B,EAAqDU,QAArD;AACD,CAFM","file":"decoratorStrategies.js","sourcesContent":["/*\n * A decoratorStrategy is used by `draft-js` to determine how to render\n * content beyond inline styles. We use them to render LINK entities.\n *\n * See https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#content\n * and\n * https://facebook.github.io/draft-js/docs/advanced-topics-entities.html#content\n */\nimport {Entity} from 'draft-js';\n\nconst characterIsLinkEntity = character => {\n const entityKey = character.getEntity();\n\n if (entityKey === null) {\n return false;\n }\n\n const entity = Entity.get(entityKey);\n\n return entity.getType() === 'LINK';\n};\n\nexport const findLinkEntities = (contentBlock, callback) => {\n contentBlock.findEntityRanges(characterIsLinkEntity, callback);\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js b/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js new file mode 100644 index 000000000..1f98087be --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js @@ -0,0 +1,23 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var getCoordinates = function getCoordinates() { + var coordinates = { x: 0, y: 0 }; + + var rect = document.getElementsByClassName('text-editor')[0].getBoundingClientRect(); + + var LINK_POP_UP_WIDTH = 158.5; + + if (rect) { + // Add to the offset + coordinates.x += rect.width * 0.5 - LINK_POP_UP_WIDTH / 2; + coordinates.y += rect.height * 0.5; + } + + return coordinates; +}; + +exports.default = getCoordinates; +//# sourceMappingURL=getSelectionCoordinates.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map b/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map new file mode 100644 index 000000000..b8b8d8340 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/getSelectionCoordinates.js"],"names":["getCoordinates","coordinates","x","y","rect","document","getElementsByClassName","getBoundingClientRect","LINK_POP_UP_WIDTH","width","height"],"mappings":";;;;;AAAA,IAAMA,iBAAiB,SAAjBA,cAAiB,GAAM;AAC3B,MAAMC,cAAc,EAACC,GAAG,CAAJ,EAAOC,GAAG,CAAV,EAApB;;AAEA,MAAMC,OAAOC,SAASC,sBAAT,CAAgC,aAAhC,EAA+C,CAA/C,EAAkDC,qBAAlD,EAAb;;AAEA,MAAMC,oBAAoB,KAA1B;;AAEA,MAAIJ,IAAJ,EAAU;AACR;AACAH,gBAAYC,CAAZ,IAAiBE,KAAKK,KAAL,GAAa,GAAb,GAAmBD,oBAAoB,CAAxD;AACAP,gBAAYE,CAAZ,IAAiBC,KAAKM,MAAL,GAAc,GAA/B;AACD;;AAED,SAAOT,WAAP;AACD,CAdD;;kBAgBeD,c","file":"getSelectionCoordinates.js","sourcesContent":["const getCoordinates = () => {\n const coordinates = {x: 0, y: 0};\n\n const rect = document.getElementsByClassName('text-editor')[0].getBoundingClientRect();\n\n const LINK_POP_UP_WIDTH = 158.5;\n\n if (rect) {\n // Add to the offset\n coordinates.x += rect.width * 0.5 - LINK_POP_UP_WIDTH / 2;\n coordinates.y += rect.height * 0.5;\n }\n\n return coordinates;\n};\n\nexport default getCoordinates;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/index.js b/lib/components/widgets/text_editors/RichText/index.js new file mode 100644 index 000000000..443500254 --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/index.js @@ -0,0 +1,431 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _draftJs = require('draft-js'); + +var _draftJsExportHtml = require('@plotly/draft-js-export-html'); + +var _draftJsImportHtml = require('draft-js-import-html'); + +var _configuration = require('./configuration'); + +var _LinkDecorator = require('./LinkDecorator'); + +var _LinkDecorator2 = _interopRequireDefault(_LinkDecorator); + +var _LinkEditor = require('./LinkEditor'); + +var _LinkEditor2 = _interopRequireDefault(_LinkEditor); + +var _StyleButtonGroup = require('./StyleButtonGroup'); + +var _StyleButtonGroup2 = _interopRequireDefault(_StyleButtonGroup); + +var _debounce = require('./debounce'); + +var _debounce2 = _interopRequireDefault(_debounce); + +var _DraftCommands = require('./DraftCommands'); + +var _decoratorStrategies = require('./decoratorStrategies'); + +var _getSelectionCoordinates = require('./getSelectionCoordinates'); + +var _getSelectionCoordinates2 = _interopRequireDefault(_getSelectionCoordinates); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +// Constants + + +// Components + + +// Libraries + + +var RichText = function (_Component) { + _inherits(RichText, _Component); + + function RichText(props, context) { + _classCallCheck(this, RichText); + + /* + * Initially set state based on the plotly.js annotation content. + * After this, as long as this component is mounted, it owns the source + * of truth for the annotation value via `this.state.editorState`. + * This state may be updated externally via a prop update. + * See `componentWillReceiveProps`. + */ + var _this = _possibleConstructorReturn(this, (RichText.__proto__ || Object.getPrototypeOf(RichText)).call(this, props, context)); + + _this.state = { + editorState: props.value.toString().trim().length ? _this.createEditorStateFromHTML(props.value) : _draftJs.EditorState.createEmpty(_this.getDecorator()) + }; + + _this.getDecorator = _this.getDecorator.bind(_this); + _this.createEditorStateFromHTML = _this.createEditorStateFromHTML.bind(_this); + _this.getEditorStateAsHTML = _this.getEditorStateAsHTML.bind(_this); + _this.focus = _this.focus.bind(_this); + _this.getParentContainerVerticalOffset = _this.getParentContainerVerticalOffset.bind(_this); + _this.onChange = _this.onChange.bind(_this); + _this.onBlur = _this.onBlur.bind(_this); + _this.onFocus = _this.onFocus.bind(_this); + _this.onLinkEditorBlur = _this.onLinkEditorBlur.bind(_this); + _this.onLinkEditorFocus = _this.onLinkEditorFocus.bind(_this); + _this.onLinkEditorChange = _this.onLinkEditorChange.bind(_this); + _this.onLinkEditorClose = _this.onLinkEditorClose.bind(_this); + _this.onKeyCommand = _this.onKeyCommand.bind(_this); + _this.onReturnPressed = _this.onReturnPressed.bind(_this); + _this.onStyleButtonToggle = _this.onStyleButtonToggle.bind(_this); + _this.renderLinkEditor = _this.renderLinkEditor.bind(_this); + return _this; + } + + _createClass(RichText, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + var _state = this.state, + linkEditorFocus = _state.linkEditorFocus, + editorFocus = _state.editorFocus; + + /* + * Don't worry about what plotly.js thinks the annotation value + * should be while we're using our editor, for these reasons: + * + * 1. The editor should be considered the source of truth, unless the + * user is actually editing the annotation inline, in the chart. + * 2. Sometimes we get updates with stale values. + */ + + if (linkEditorFocus || editorFocus) { + return; + } + + // Sync editor state with plotly annotation value. + var editorState = this.createEditorStateFromHTML(nextProps.value); + + this.setState({ editorState: editorState }); + } + }, { + key: 'shouldComponentUpdate', + value: function shouldComponentUpdate(nextProps, nextState) { + var _props = this.props, + placeholder = _props.placeholder, + value = _props.value; + var _state2 = this.state, + editorState = _state2.editorState, + linkEditorFocus = _state2.linkEditorFocus; + + // If relevant props or state changed, return true. + + if ( + // Always update when user is editing link + linkEditorFocus || placeholder !== nextProps.placeholder || value !== nextProps.value || editorState !== nextState.editorState) { + return true; + } + + // Compare incoming value with HTML representation of state. + return nextProps.value !== this.getEditorStateAsHTML(editorState); + } + }, { + key: 'getDecorator', + value: function getDecorator() { + return new _draftJs.CompositeDecorator([{ + strategy: _decoratorStrategies.findLinkEntities, + component: _LinkDecorator2.default, + + // Props for the LinkDecorator component + props: { + style: _configuration.STYLE_MAP[_configuration.LINK] + } + }]); + } + }, { + key: 'createEditorStateFromHTML', + value: function createEditorStateFromHTML(html) { + var _inlineStyles; + + var contentState = (0, _draftJsImportHtml.stateFromHTML)(html, { + inlineStyles: (_inlineStyles = {}, _defineProperty(_inlineStyles, _configuration.SUPERSCRIPT, { element: 'sup' }), _defineProperty(_inlineStyles, _configuration.SUBSCRIPT, { element: 'sub' }), _inlineStyles), + defaultBlockTag: null + }); + + var decorator = this.getDecorator(); + + /* + * Work around issue described here: + * https://github.com/facebook/draft-js/issues/185 + * #issuecomment-217207612 + */ + + // Parse once to generate entity instances + _draftJs.EditorState.createWithContent(contentState); + + // Now we can add our decorator + return _draftJs.EditorState.createWithContent(contentState, decorator); + } + }, { + key: 'getEditorStateAsHTML', + value: function getEditorStateAsHTML(editorState) { + var contentState = editorState.getCurrentContent(); + + return (0, _draftJsExportHtml.stateToHTML)(contentState, { + defaultBlockTag: null, + inlineStyles: _configuration.STYLES_TO_HTML_TAGS + }); + } + }, { + key: 'focus', + value: function focus() { + this.editorInput.focus(); + } + + // Used to properly calculate user selection coordinates. + + }, { + key: 'getParentContainerVerticalOffset', + value: function getParentContainerVerticalOffset() { + return document.querySelector('.panel').scrollTop; + } + }, { + key: 'onChange', + value: function onChange(editorState) { + var selectedLinkID = this.state.selectedLinkID; + + var selection = editorState.getSelection(); + var entityKey = (0, _DraftCommands.getEntityKeyAt)(editorState, selection); + + var newState = { editorState: editorState }; + + // Update selected link ID + if (!(0, _DraftCommands.cursorHasLink)(editorState, selection)) { + // If a link is no longer selected, clear selected link ID state + Object.assign(newState, { + selectedLinkID: null + }); + } else if (selectedLinkID !== entityKey) { + // If link selection is new / different link selected, update it + Object.assign(newState, { + selectedLinkID: entityKey + }); + } + + // Update internal state + this.setState(newState); + + // Dispatch changes to plotly.js + // TODO consider moving to render (plotly.js is a render target) + var htmlContent = this.getEditorStateAsHTML(editorState); + if (this.props.value !== htmlContent) { + (0, _debounce2.default)(this.props.onChange, [htmlContent]); + } + } + }, { + key: 'onBlur', + value: function onBlur() { + this.setState({ + editorFocus: false + }); + } + }, { + key: 'onFocus', + value: function onFocus() { + this.setState({ + editorFocus: true + }); + } + }, { + key: 'onLinkEditorBlur', + value: function onLinkEditorBlur() { + this.setState({ + linkEditorFocus: false + }); + } + }, { + key: 'onLinkEditorFocus', + value: function onLinkEditorFocus() { + this.setState({ + linkEditorFocus: true + }); + } + }, { + key: 'onLinkEditorChange', + value: function onLinkEditorChange(linkID, urlValue) { + var editorState = this.state.editorState; + + var selectionState = editorState.getSelection(); + + // Update link URL + _draftJs.Entity.replaceData(linkID, { url: urlValue }); + + // Trigger an editor state update + var updatedEditorState = _draftJs.RichUtils.toggleLink(editorState, selectionState, linkID); + + this.onChange(updatedEditorState); + } + + /** + * Will be called by LinkEditor when the user confirms or cancels new URL. + * Will not be called if LinkEditor is closed by moving the cursor off of + * the selected LINK entity. + * + * @param {String} linkID The link entity key related to this LinkEditor + * @returns {undefined} + */ + + }, { + key: 'onLinkEditorClose', + value: function onLinkEditorClose() { + /* + * Focus on editor immediately to avoid error that occurs when + * `selection.extend` is called and another element has focus. + * https://bugzilla.mozilla.org/show_bug.cgi?id=921444 + * https://github.com/facebook/draft-js/blob/342576bf7186d07c82a41d9ca8169130669747d6/src/component/selection/setDraftEditorSelection.js#L128-L134 + */ + this.focus(); + + // Hide the editor. + this.setState({ + linkEditorFocus: false, + selectedLinkID: null + }); + } + }, { + key: 'onKeyCommand', + value: function onKeyCommand(command) { + var newEditorState = (0, _DraftCommands.handleKeyCommand)(this.state.editorState, command); + + if (newEditorState) { + this.onChange(newEditorState); + + // Let draft-js know that keyboard command is handled. + return true; + } + + // Default draft-js implementation + return false; + } + }, { + key: 'onReturnPressed', + value: function onReturnPressed() { + var newEditorState = (0, _DraftCommands.insertSoftNewline)(this.state.editorState); + + // Update internal and external state + this.onChange(newEditorState); + + // Cancel draft-js implementation + return true; + } + }, { + key: 'onStyleButtonToggle', + value: function onStyleButtonToggle(inlineStyle) { + var newEditorState = (0, _DraftCommands.toggleInlineStyle)(this.state.editorState, inlineStyle); + + if (newEditorState) { + this.onChange(newEditorState); + } + } + }, { + key: 'renderLinkEditor', + value: function renderLinkEditor(selectedLinkID) { + if (!selectedLinkID) { + return null; + } + + // All entities are link entities. + var linkEntity = (0, _DraftCommands.getEntityByKey)(selectedLinkID); + var linkURL = linkEntity.getData().url; + + var coordinates = (0, _getSelectionCoordinates2.default)(); + + return _react2.default.createElement(_LinkEditor2.default, { + onFocus: this.onLinkEditorFocus, + onURLChange: this.onLinkEditorChange, + onBlur: this.onLinkEditorBlur, + onClose: this.onLinkEditorClose, + coordinates: coordinates, + linkID: selectedLinkID, + linkURL: linkURL + }); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _state3 = this.state, + editorState = _state3.editorState, + selectedLinkID = _state3.selectedLinkID; + + var linkIsSelected = Boolean(selectedLinkID); + + return _react2.default.createElement( + 'div', + { className: 'rich-text-editor__root' }, + _react2.default.createElement(_StyleButtonGroup2.default, { + styles: _configuration.INLINE_STYLES, + currentStyle: editorState.getCurrentInlineStyle(), + linkIsSelected: linkIsSelected, + onToggle: this.onStyleButtonToggle + }), + _react2.default.createElement( + 'div', + { className: 'rich-text-editor__editor', onClick: this.focus }, + _react2.default.createElement(_draftJs.Editor, { + customStyleMap: _configuration.STYLE_MAP, + editorState: editorState, + handleReturn: this.onReturnPressed, + handleKeyCommand: this.onKeyCommand, + onChange: this.onChange, + onBlur: this.onBlur, + onFocus: this.onFocus, + placeholder: this.props.placeholder, + spellCheck: false, + ref: function ref(input) { + return _this2.editorInput = input; + } + }) + ), + this.renderLinkEditor(selectedLinkID) + ); + } + }]); + + return RichText; +}(_react.Component); + +RichText.propTypes = { + onChange: _propTypes2.default.func.isRequired, + placeholder: _propTypes2.default.string, + value: _propTypes2.default.any +}; + +RichText.defaultProps = { + placeholder: '', + value: '' +}; + +exports.default = RichText; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/index.js.map b/lib/components/widgets/text_editors/RichText/index.js.map new file mode 100644 index 000000000..6e1421baf --- /dev/null +++ b/lib/components/widgets/text_editors/RichText/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/index.js"],"names":["RichText","props","context","state","editorState","value","toString","trim","length","createEditorStateFromHTML","EditorState","createEmpty","getDecorator","bind","getEditorStateAsHTML","focus","getParentContainerVerticalOffset","onChange","onBlur","onFocus","onLinkEditorBlur","onLinkEditorFocus","onLinkEditorChange","onLinkEditorClose","onKeyCommand","onReturnPressed","onStyleButtonToggle","renderLinkEditor","nextProps","linkEditorFocus","editorFocus","setState","nextState","placeholder","CompositeDecorator","strategy","findLinkEntities","component","LinkDecorator","style","STYLE_MAP","LINK","html","contentState","inlineStyles","SUPERSCRIPT","element","SUBSCRIPT","defaultBlockTag","decorator","createWithContent","getCurrentContent","STYLES_TO_HTML_TAGS","editorInput","document","querySelector","scrollTop","selectedLinkID","selection","getSelection","entityKey","newState","Object","assign","htmlContent","linkID","urlValue","selectionState","Entity","replaceData","url","updatedEditorState","RichUtils","toggleLink","command","newEditorState","inlineStyle","linkEntity","linkURL","getData","coordinates","linkIsSelected","Boolean","INLINE_STYLES","getCurrentInlineStyle","input","Component","propTypes","PropTypes","func","isRequired","string","any","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;AACA;;AAGA;;AAUA;;;;AACA;;;;AACA;;;;AAGA;;;;AACA;;AAQA;;AACA;;;;;;;;;;;;;;AA1BA;;;AAUA;;;AAKA;;;IAaMA,Q;;;AACJ,oBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAG1B;;;;;;;AAH0B,oHACpBD,KADoB,EACbC,OADa;;AAU1B,UAAKC,KAAL,GAAa;AACXC,mBAAaH,MAAMI,KAAN,CAAYC,QAAZ,GAAuBC,IAAvB,GAA8BC,MAA9B,GACT,MAAKC,yBAAL,CAA+BR,MAAMI,KAArC,CADS,GAETK,qBAAYC,WAAZ,CAAwB,MAAKC,YAAL,EAAxB;AAHO,KAAb;;AAMA,UAAKA,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AACA,UAAKJ,yBAAL,GAAiC,MAAKA,yBAAL,CAA+BI,IAA/B,OAAjC;AACA,UAAKC,oBAAL,GAA4B,MAAKA,oBAAL,CAA0BD,IAA1B,OAA5B;AACA,UAAKE,KAAL,GAAa,MAAKA,KAAL,CAAWF,IAAX,OAAb;AACA,UAAKG,gCAAL,GAAwC,MAAKA,gCAAL,CAAsCH,IAAtC,OAAxC;AACA,UAAKI,QAAL,GAAgB,MAAKA,QAAL,CAAcJ,IAAd,OAAhB;AACA,UAAKK,MAAL,GAAc,MAAKA,MAAL,CAAYL,IAAZ,OAAd;AACA,UAAKM,OAAL,GAAe,MAAKA,OA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H,cAHlB;AAIE,oBAAU,KAAKvD;AAJjB,UADF;AAOE;AAAA;AAAA,YAAK,WAAU,0BAAf,EAA0C,SAAS,KAAKX,KAAxD;AACE,wCAAC,eAAD;AACE,4BAAgByB,wBADlB;AAEE,yBAAapC,WAFf;AAGE,0BAAc,KAAKqB,eAHrB;AAIE,8BAAkB,KAAKD,YAJzB;AAKE,sBAAU,KAAKP,QALjB;AAME,oBAAQ,KAAKC,MANf;AAOE,qBAAS,KAAKC,OAPhB;AAQE,yBAAa,KAAKlB,KAAL,CAAWgC,WAR1B;AASE,wBAAY,KATd;AAUE,iBAAK;AAAA,qBAAU,OAAKoB,WAAL,GAAmBgC,KAA7B;AAAA;AAVP;AADF,SAPF;AAqBG,aAAK1D,gBAAL,CAAsB8B,cAAtB;AArBH,OADF;AAyBD;;;;EApToB6B,gB;;AAuTvBtF,SAASuF,SAAT,GAAqB;AACnBtE,YAAUuE,oBAAUC,IAAV,CAAeC,UADN;AAEnBzD,eAAauD,oBAAUG,MAFJ;AAGnBtF,SAAOmF,oBAAUI;AAHE,CAArB;;AAMA5F,SAAS6F,YAAT,GAAwB;AACtB5D,eAAa,EADS;AAEtB5B,SAAO;AAFe,CAAxB;;kBAKeL,Q","file":"index.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {CompositeDecorator, Editor, EditorState, Entity, RichUtils} from 'draft-js';\nimport {stateToHTML} from '@plotly/draft-js-export-html';\nimport {stateFromHTML} from 'draft-js-import-html';\n\n// Constants\nimport {\n SUPERSCRIPT,\n SUBSCRIPT,\n LINK,\n STYLES_TO_HTML_TAGS,\n STYLE_MAP,\n INLINE_STYLES,\n} from './configuration';\n\n// Components\nimport LinkDecorator from './LinkDecorator';\nimport LinkEditor from './LinkEditor';\nimport StyleButtonGroup from './StyleButtonGroup';\n\n// Libraries\nimport debounce from './debounce';\nimport {\n getEntityKeyAt,\n getEntityByKey,\n toggleInlineStyle,\n handleKeyCommand,\n insertSoftNewline,\n cursorHasLink,\n} from './DraftCommands';\nimport {findLinkEntities} from './decoratorStrategies';\nimport getCoordinates from './getSelectionCoordinates';\n\nclass RichText extends Component {\n constructor(props, context) {\n super(props, context);\n\n /*\n * Initially set state based on the plotly.js annotation content.\n * After this, as long as this component is mounted, it owns the source\n * of truth for the annotation value via `this.state.editorState`.\n * This state may be updated externally via a prop update.\n * See `componentWillReceiveProps`.\n */\n this.state = {\n editorState: props.value.toString().trim().length\n ? this.createEditorStateFromHTML(props.value)\n : EditorState.createEmpty(this.getDecorator()),\n };\n\n this.getDecorator = this.getDecorator.bind(this);\n this.createEditorStateFromHTML = this.createEditorStateFromHTML.bind(this);\n this.getEditorStateAsHTML = this.getEditorStateAsHTML.bind(this);\n this.focus = this.focus.bind(this);\n this.getParentContainerVerticalOffset = this.getParentContainerVerticalOffset.bind(this);\n this.onChange = this.onChange.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onLinkEditorBlur = this.onLinkEditorBlur.bind(this);\n this.onLinkEditorFocus = this.onLinkEditorFocus.bind(this);\n this.onLinkEditorChange = this.onLinkEditorChange.bind(this);\n this.onLinkEditorClose = this.onLinkEditorClose.bind(this);\n this.onKeyCommand = this.onKeyCommand.bind(this);\n this.onReturnPressed = this.onReturnPressed.bind(this);\n this.onStyleButtonToggle = this.onStyleButtonToggle.bind(this);\n this.renderLinkEditor = this.renderLinkEditor.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n const {linkEditorFocus, editorFocus} = this.state;\n\n /*\n * Don't worry about what plotly.js thinks the annotation value\n * should be while we're using our editor, for these reasons:\n *\n * 1. The editor should be considered the source of truth, unless the\n * user is actually editing the annotation inline, in the chart.\n * 2. Sometimes we get updates with stale values.\n */\n if (linkEditorFocus || editorFocus) {\n return;\n }\n\n // Sync editor state with plotly annotation value.\n const editorState = this.createEditorStateFromHTML(nextProps.value);\n\n this.setState({editorState});\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n const {placeholder, value} = this.props;\n const {editorState, linkEditorFocus} = this.state;\n\n // If relevant props or state changed, return true.\n if (\n // Always update when user is editing link\n linkEditorFocus ||\n placeholder !== nextProps.placeholder ||\n value !== nextProps.value ||\n editorState !== nextState.editorState\n ) {\n return true;\n }\n\n // Compare incoming value with HTML representation of state.\n return nextProps.value !== this.getEditorStateAsHTML(editorState);\n }\n\n getDecorator() {\n return new CompositeDecorator([\n {\n strategy: findLinkEntities,\n component: LinkDecorator,\n\n // Props for the LinkDecorator component\n props: {\n style: STYLE_MAP[LINK],\n },\n },\n ]);\n }\n\n createEditorStateFromHTML(html) {\n const contentState = stateFromHTML(html, {\n inlineStyles: {\n [SUPERSCRIPT]: {element: 'sup'},\n [SUBSCRIPT]: {element: 'sub'},\n },\n defaultBlockTag: null,\n });\n\n const decorator = this.getDecorator();\n\n /*\n * Work around issue described here:\n * https://github.com/facebook/draft-js/issues/185\n * #issuecomment-217207612\n */\n\n // Parse once to generate entity instances\n EditorState.createWithContent(contentState);\n\n // Now we can add our decorator\n return EditorState.createWithContent(contentState, decorator);\n }\n\n getEditorStateAsHTML(editorState) {\n const contentState = editorState.getCurrentContent();\n\n return stateToHTML(contentState, {\n defaultBlockTag: null,\n inlineStyles: STYLES_TO_HTML_TAGS,\n });\n }\n\n focus() {\n this.editorInput.focus();\n }\n\n // Used to properly calculate user selection coordinates.\n getParentContainerVerticalOffset() {\n return document.querySelector('.panel').scrollTop;\n }\n\n onChange(editorState) {\n const {selectedLinkID} = this.state;\n const selection = editorState.getSelection();\n const entityKey = getEntityKeyAt(editorState, selection);\n\n const newState = {editorState};\n\n // Update selected link ID\n if (!cursorHasLink(editorState, selection)) {\n // If a link is no longer selected, clear selected link ID state\n Object.assign(newState, {\n selectedLinkID: null,\n });\n } else if (selectedLinkID !== entityKey) {\n // If link selection is new / different link selected, update it\n Object.assign(newState, {\n selectedLinkID: entityKey,\n });\n }\n\n // Update internal state\n this.setState(newState);\n\n // Dispatch changes to plotly.js\n // TODO consider moving to render (plotly.js is a render target)\n const htmlContent = this.getEditorStateAsHTML(editorState);\n if (this.props.value !== htmlContent) {\n debounce(this.props.onChange, [htmlContent]);\n }\n }\n\n onBlur() {\n this.setState({\n editorFocus: false,\n });\n }\n\n onFocus() {\n this.setState({\n editorFocus: true,\n });\n }\n\n onLinkEditorBlur() {\n this.setState({\n linkEditorFocus: false,\n });\n }\n\n onLinkEditorFocus() {\n this.setState({\n linkEditorFocus: true,\n });\n }\n\n onLinkEditorChange(linkID, urlValue) {\n const {editorState} = this.state;\n const selectionState = editorState.getSelection();\n\n // Update link URL\n Entity.replaceData(linkID, {url: urlValue});\n\n // Trigger an editor state update\n const updatedEditorState = RichUtils.toggleLink(editorState, selectionState, linkID);\n\n this.onChange(updatedEditorState);\n }\n\n /**\n * Will be called by LinkEditor when the user confirms or cancels new URL.\n * Will not be called if LinkEditor is closed by moving the cursor off of\n * the selected LINK entity.\n *\n * @param {String} linkID The link entity key related to this LinkEditor\n * @returns {undefined}\n */\n onLinkEditorClose() {\n /*\n * Focus on editor immediately to avoid error that occurs when\n * `selection.extend` is called and another element has focus.\n * https://bugzilla.mozilla.org/show_bug.cgi?id=921444\n * https://github.com/facebook/draft-js/blob/342576bf7186d07c82a41d9ca8169130669747d6/src/component/selection/setDraftEditorSelection.js#L128-L134\n */\n this.focus();\n\n // Hide the editor.\n this.setState({\n linkEditorFocus: false,\n selectedLinkID: null,\n });\n }\n\n onKeyCommand(command) {\n const newEditorState = handleKeyCommand(this.state.editorState, command);\n\n if (newEditorState) {\n this.onChange(newEditorState);\n\n // Let draft-js know that keyboard command is handled.\n return true;\n }\n\n // Default draft-js implementation\n return false;\n }\n\n onReturnPressed() {\n const newEditorState = insertSoftNewline(this.state.editorState);\n\n // Update internal and external state\n this.onChange(newEditorState);\n\n // Cancel draft-js implementation\n return true;\n }\n\n onStyleButtonToggle(inlineStyle) {\n const newEditorState = toggleInlineStyle(this.state.editorState, inlineStyle);\n\n if (newEditorState) {\n this.onChange(newEditorState);\n }\n }\n\n renderLinkEditor(selectedLinkID) {\n if (!selectedLinkID) {\n return null;\n }\n\n // All entities are link entities.\n const linkEntity = getEntityByKey(selectedLinkID);\n const linkURL = linkEntity.getData().url;\n\n const coordinates = getCoordinates();\n\n return (\n \n );\n }\n\n render() {\n const {editorState, selectedLinkID} = this.state;\n const linkIsSelected = Boolean(selectedLinkID);\n\n return (\n
\n \n
\n (this.editorInput = input)}\n />\n
\n {this.renderLinkEditor(selectedLinkID)}\n
\n );\n }\n}\n\nRichText.propTypes = {\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n value: PropTypes.any,\n};\n\nRichText.defaultProps = {\n placeholder: '',\n value: '',\n};\n\nexport default RichText;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/convertFormats.js b/lib/components/widgets/text_editors/convertFormats.js new file mode 100644 index 000000000..29011a318 --- /dev/null +++ b/lib/components/widgets/text_editors/convertFormats.js @@ -0,0 +1,97 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var getTextBlockRegExp = function getTextBlockRegExp() { + return (/\\text\{([^}]*)}/g + ); +}; + +/** + * To match any character including newline whitespace, use `[\s\S]*` + * instead of `.*`. http://stackoverflow.com/a/1068308 + * + * @returns {RegExp} the regular expression + */ +var getLaTeXWrappedRegExp = function getLaTeXWrappedRegExp() { + return (/^\$[\s\S]*\$$/ + ); +}; + +var stripHTMLTags = function stripHTMLTags(html) { + return html.replace(/<[^>]*>/g, '').trim(); +}; + +var extractTextBlocks = function extractTextBlocks(laTeX) { + var matchObj = void 0; + var matchStr = void 0; + var matches = []; + + // Need to stringify to match literally on `\t`. + var stringifiedLaTeX = JSON.stringify(laTeX); + var regExp = getTextBlockRegExp(); + + /** + * Find multiple matches with the ``//g` flag. + * The `RegExp.prototype.exec` API mutates the RegExp object. + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec#Finding_successive_matches + */ + while ((matchObj = regExp.exec(stringifiedLaTeX)) !== null) { + matchStr = matchObj[1].trim().replace('\\n', ''); + matches.push(matchStr); + } + + return matches.join('
'); +}; + +var wrapLaTeX = function wrapLaTeX(value) { + return value ? '$' + value + '$' : '$$'; +}; + +var wrapText = function wrapText(value) { + return value ? '\\text{' + value + '}' : '\\text{}'; +}; + +// Exports +// ------- + +var isLaTeXExpr = exports.isLaTeXExpr = function isLaTeXExpr(value) { + return getLaTeXWrappedRegExp().test(value); +}; + +var hasTextExpression = exports.hasTextExpression = function hasTextExpression(laTeX) { + var regExp = getTextBlockRegExp(); + var stringifiedLaTeX = JSON.stringify(laTeX); + + return regExp.test(stringifiedLaTeX); +}; + +var htmlToLaTeX = exports.htmlToLaTeX = function htmlToLaTeX(html) { + var breakTag = '
'; + var trimmedHTML = html.trim(); + + // Handle empty input + if (trimmedHTML === '') { + return wrapLaTeX(wrapText()); + } + + // Handle input with only linebreaks + if (trimmedHTML.replace(breakTag, '') === '') { + return wrapLaTeX(wrapText()); + } + + return wrapLaTeX(trimmedHTML.split(breakTag) + + // Ignore empty linebreaks + .map(function (para) { + return para.length ? wrapText(stripHTMLTags(para)) : ''; + }).join('\n')); +}; + +var laTeXToHTML = exports.laTeXToHTML = function laTeXToHTML(laTeX) { + var trimmedLaTeX = laTeX.trim(); + + return extractTextBlocks(trimmedLaTeX); +}; +//# sourceMappingURL=convertFormats.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/convertFormats.js.map b/lib/components/widgets/text_editors/convertFormats.js.map new file mode 100644 index 000000000..f49b57cc2 --- /dev/null +++ b/lib/components/widgets/text_editors/convertFormats.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../../src/components/widgets/text_editors/convertFormats.js"],"names":["getTextBlockRegExp","getLaTeXWrappedRegExp","stripHTMLTags","html","replace","trim","extractTextBlocks","matchObj","matchStr","matches","stringifiedLaTeX","JSON","stringify","laTeX","regExp","exec","push","join","wrapLaTeX","value","wrapText","isLaTeXExpr","test","hasTextExpression","htmlToLaTeX","breakTag","trimmed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EA,SAAOC,OAAOQ,IAAP,CAAYZ,gBAAZ,CAAP;AACD,CALM;;AAOA,IAAMc,oCAAc,SAAdA,WAAc,OAAQ;AACjC,MAAMC,WAAW,MAAjB;AACA,MAAMC,cAAcvB,KAAKE,IAAL,EAApB;;AAEA;AACA,MAAIqB,gBAAgB,EAApB,EAAwB;AACtB,WAAOR,UAAUE,UAAV,CAAP;AACD;;AAED;AACA,MAAIM,YAAYtB,OAAZ,CAAoBqB,QAApB,EAA8B,EAA9B,MAAsC,EAA1C,EAA8C;AAC5C,WAAOP,UAAUE,UAAV,CAAP;AACD;;AAED,SAAOF,UACLQ,YACGC,KADH,CACSF,QADT;;AAGE;AAHF,GAIGG,GAJH,CAIO;AAAA,WAASC,KAAKC,MAAL,GAAcV,SAASlB,cAAc2B,IAAd,CAAT,CAAd,GAA8C,EAAvD;AAAA,GAJP,EAKGZ,IALH,CAKQ,IALR,CADK,CAAP;AAQD,CAtBM;;AAwBA,IAAMc,oCAAc,SAAdA,WAAc,QAAS;AAClC,MAAMC,eAAenB,MAAMR,IAAN,EAArB;;AAEA,SAAOC,kBAAkB0B,YAAlB,CAAP;AACD,CAJM","file":"convertFormats.js","sourcesContent":["const getTextBlockRegExp = () => /\\\\text\\{([^}]*)}/g;\n\n/**\n * To match any character including newline whitespace, use `[\\s\\S]*`\n * instead of `.*`. http://stackoverflow.com/a/1068308\n *\n * @returns {RegExp} the regular expression\n */\nconst getLaTeXWrappedRegExp = () => /^\\$[\\s\\S]*\\$$/;\n\nconst stripHTMLTags = html => html.replace(/<[^>]*>/g, '').trim();\n\nconst extractTextBlocks = laTeX => {\n let matchObj;\n let matchStr;\n const matches = [];\n\n // Need to stringify to match literally on `\\t`.\n const stringifiedLaTeX = JSON.stringify(laTeX);\n const regExp = getTextBlockRegExp();\n\n /**\n * Find multiple matches with the ``//g` flag.\n * The `RegExp.prototype.exec` API mutates the RegExp object.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec#Finding_successive_matches\n */\n while ((matchObj = regExp.exec(stringifiedLaTeX)) !== null) {\n matchStr = matchObj[1].trim().replace('\\\\n', '');\n matches.push(matchStr);\n }\n\n return matches.join('
');\n};\n\nconst wrapLaTeX = value => (value ? `$${value}$` : '$$');\n\nconst wrapText = value => (value ? `\\\\text{${value}}` : '\\\\text{}');\n\n// Exports\n// -------\n\nexport const isLaTeXExpr = value => getLaTeXWrappedRegExp().test(value);\n\nexport const hasTextExpression = laTeX => {\n const regExp = getTextBlockRegExp();\n const stringifiedLaTeX = JSON.stringify(laTeX);\n\n return regExp.test(stringifiedLaTeX);\n};\n\nexport const htmlToLaTeX = html => {\n const breakTag = '
';\n const trimmedHTML = html.trim();\n\n // Handle empty input\n if (trimmedHTML === '') {\n return wrapLaTeX(wrapText());\n }\n\n // Handle input with only linebreaks\n if (trimmedHTML.replace(breakTag, '') === '') {\n return wrapLaTeX(wrapText());\n }\n\n return wrapLaTeX(\n trimmedHTML\n .split(breakTag)\n\n // Ignore empty linebreaks\n .map(para => (para.length ? wrapText(stripHTMLTags(para)) : ''))\n .join('\\n')\n );\n};\n\nexport const laTeXToHTML = laTeX => {\n const trimmedLaTeX = laTeX.trim();\n\n return extractTextBlocks(trimmedLaTeX);\n};\n"]} \ No newline at end of file diff --git a/lib/context/index.js b/lib/context/index.js new file mode 100644 index 000000000..c4fed5620 --- /dev/null +++ b/lib/context/index.js @@ -0,0 +1,36 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ConnectTraceToPlotContext = exports.PlotlyPanelContext = exports.PlotlyFoldContext = exports.ModalProviderContext = exports.PanelMenuWrapperContext = exports.EditorControlsContext = undefined; + +var _react = require('react'); + +var EditorControlsContext = (0, _react.createContext)({}); +var PanelMenuWrapperContext = (0, _react.createContext)({}); +var ModalProviderContext = (0, _react.createContext)({}); +var PlotlyFoldContext = (0, _react.createContext)({}); +var PlotlyPanelContext = (0, _react.createContext)({}); +// const ConnectAggregationToTransformContext = createContext({}); +// const ConnectAnnotationToLayoutContext = createContext({}); +// const ConnectAxesToLayoutContext = createContext({}); +// const ConnectCartesianSubplotToLayoutContext = createContext({}); +// const ConnectImageToLayoutContext = createContext({}); +// const ConnectLayoutToPlotContext = createContext({}); +// const ConnectNonCartesianSubplotToLayoutContext = createContext({}); +// const ConnectRangeSelectorToAxisContext = createContext({}); +// const ConnectShapeToLayoutContext = createContext({}); +// const ConnectSliderToLayoutContext = createContext({}); +// const ConnectToContainerContext = createContext({}); +var ConnectTraceToPlotContext = (0, _react.createContext)({}); +// const ConnectTransformToTraceContext = createContext({}); +// const ConnectUpdateMenuToLayoutContext = createContext({}); + +exports.EditorControlsContext = EditorControlsContext; +exports.PanelMenuWrapperContext = PanelMenuWrapperContext; +exports.ModalProviderContext = ModalProviderContext; +exports.PlotlyFoldContext = PlotlyFoldContext; +exports.PlotlyPanelContext = PlotlyPanelContext; +exports.ConnectTraceToPlotContext = ConnectTraceToPlotContext; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/context/index.js.map b/lib/context/index.js.map new file mode 100644 index 000000000..57781e7ef --- /dev/null +++ b/lib/context/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/context/index.js"],"names":["EditorControlsContext","PanelMenuWrapperContext","ModalProviderContext","PlotlyFoldContext","PlotlyPanelContext","ConnectTraceToPlotContext"],"mappings":";;;;;;;AAAA;;AACA,IAAMA,wBAAwB,0BAAc,EAAd,CAA9B;AACA,IAAMC,0BAA0B,0BAAc,EAAd,CAAhC;AACA,IAAMC,uBAAuB,0BAAc,EAAd,CAA7B;AACA,IAAMC,oBAAoB,0BAAc,EAAd,CAA1B;AACA,IAAMC,qBAAqB,0BAAc,EAAd,CAA3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,4BAA4B,0BAAc,EAAd,CAAlC;AACA;AACA;;QAGEL,qB,GAAAA,qB;QACAC,uB,GAAAA,uB;QACAC,oB,GAAAA,oB;QACAC,iB,GAAAA,iB;QACAC,kB,GAAAA,kB;QAYAC,yB,GAAAA,yB","file":"index.js","sourcesContent":["import {createContext} from 'react';\nconst EditorControlsContext = createContext({});\nconst PanelMenuWrapperContext = createContext({});\nconst ModalProviderContext = createContext({});\nconst PlotlyFoldContext = createContext({});\nconst PlotlyPanelContext = createContext({});\n// const ConnectAggregationToTransformContext = createContext({});\n// const ConnectAnnotationToLayoutContext = createContext({});\n// const ConnectAxesToLayoutContext = createContext({});\n// const ConnectCartesianSubplotToLayoutContext = createContext({});\n// const ConnectImageToLayoutContext = createContext({});\n// const ConnectLayoutToPlotContext = createContext({});\n// const ConnectNonCartesianSubplotToLayoutContext = createContext({});\n// const ConnectRangeSelectorToAxisContext = createContext({});\n// const ConnectShapeToLayoutContext = createContext({});\n// const ConnectSliderToLayoutContext = createContext({});\n// const ConnectToContainerContext = createContext({});\nconst ConnectTraceToPlotContext = createContext({});\n// const ConnectTransformToTraceContext = createContext({});\n// const ConnectUpdateMenuToLayoutContext = createContext({});\n\nexport {\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n // ConnectAggregationToTransformContext,\n // ConnectAnnotationToLayoutContext,\n // ConnectAxesToLayoutContext,\n // ConnectCartesianSubplotToLayoutContext,\n // ConnectImageToLayoutContext,\n // ConnectLayoutToPlotContext,\n // ConnectNonCartesianSubplotToLayoutContext,\n // ConnectRangeSelectorToAxisContext,\n // ConnectShapeToLayoutContext,\n // ConnectSliderToLayoutContext,\n // ConnectToContainerContext,\n ConnectTraceToPlotContext,\n // ConnectTransformToTraceContext,\n // ConnectUpdateMenuToLayoutContext,\n};\n"]} \ No newline at end of file diff --git a/lib/default_panels/GraphCreatePanel.js b/lib/default_panels/GraphCreatePanel.js new file mode 100644 index 000000000..acb3417fc --- /dev/null +++ b/lib/default_panels/GraphCreatePanel.js @@ -0,0 +1,191 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _derived = require('../components/fields/derived'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var GraphCreatePanel = function GraphCreatePanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _context.ModalProviderContext.Consumer, + null, + function (_ref2) { + var setPanel = _ref2.setPanel; + return _react2.default.createElement( + _components.TraceAccordion, + { + canAdd: true, + traceFilterCondition: function traceFilterCondition(t) { + return !(t.transforms && t.transforms.some(function (tr) { + return ['fit', 'moving-average'].includes(tr.type); + })); + } + }, + _react2.default.createElement(_components.TraceSelector, { label: _('Type'), attr: 'type', show: true }), + _react2.default.createElement(_components.LocationSelector, { attr: 'type' }), + _react2.default.createElement(_components.DataSelector, { label: _('Values'), attr: 'values' }), + _react2.default.createElement(_components.DataSelector, { label: _('Labels'), attr: 'labels' }), + _react2.default.createElement(_components.DataSelector, { + label: { + histogram2d: _('X Values'), + histogram: _('X Values'), + '*': _('X') + }, + attr: 'x' + }), + _react2.default.createElement(_components.DataSelector, { + label: { + histogram2d: _('Y Values'), + histogram: _('Y Values'), + '*': _('Y') + }, + attr: 'y' + }), + _react2.default.createElement(_components.DataSelector, { + label: { + choropleth: _('Values'), + histogram2d: _('Z Values'), + '*': _('Z') + }, + attr: 'z' + }), + _react2.default.createElement(_components.Radio, { + label: _('Orientation'), + attr: 'orientation', + options: [{ label: _('Vertical'), value: 'v' }, { label: _('Horizontal'), value: 'h' }] + }), + _react2.default.createElement( + _derived.HistogramInfoVertical, + null, + _('Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the '), + _react2.default.createElement( + 'a', + { onClick: function onClick() { + return setPanel('Style', 'Traces'); + } }, + _('Traces') + ), + _(' panel under Style. If Y values are omitted, the histogram function defaults to Count.') + ), + _react2.default.createElement( + _derived.HistogramInfoHorizontal, + null, + _('Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the '), + _react2.default.createElement( + 'a', + { onClick: function onClick() { + return setPanel('Style', 'Traces'); + } }, + _('Traces') + ), + _(' under Style panel. If X values are omitted, the histogram function defaults to Count.') + ), + _react2.default.createElement( + _derived.Histogram2d, + null, + _('Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the '), + _react2.default.createElement( + 'a', + { onClick: function onClick() { + return setPanel('Style', 'Traces'); + } }, + _('Traces') + ), + _(' under Style panel. If Z values are omitted, the histogram function defaults to Count.') + ), + _react2.default.createElement(_components.DataSelector, { label: _('I (Optional)'), attr: 'i' }), + _react2.default.createElement(_components.DataSelector, { label: _('J (Optional)'), attr: 'j' }), + _react2.default.createElement(_components.DataSelector, { label: _('K (Optional)'), attr: 'k' }), + _react2.default.createElement(_components.DataSelector, { label: _('Open'), attr: 'open' }), + _react2.default.createElement(_components.DataSelector, { label: _('High'), attr: 'high' }), + _react2.default.createElement(_components.DataSelector, { label: _('Low'), attr: 'low' }), + _react2.default.createElement(_components.DataSelector, { label: _('Close'), attr: 'close' }), + _react2.default.createElement(_components.DataSelector, { label: _('A'), attr: 'a' }), + _react2.default.createElement(_components.DataSelector, { label: _('B'), attr: 'b' }), + _react2.default.createElement(_components.DataSelector, { label: _('C'), attr: 'c' }), + _react2.default.createElement(_components.DataSelector, { label: _('U'), attr: 'u' }), + _react2.default.createElement(_components.DataSelector, { label: _('V'), attr: 'v' }), + _react2.default.createElement(_components.DataSelector, { label: _('W'), attr: 'w' }), + _react2.default.createElement(_components.DataSelector, { label: _('X start'), attr: 'starts.x' }), + _react2.default.createElement(_components.DataSelector, { label: _('Y start'), attr: 'starts.y' }), + _react2.default.createElement(_components.DataSelector, { label: _('Z start'), attr: 'starts.z' }), + _react2.default.createElement(_components.DataSelector, { label: _('Headers'), attr: 'header.values' }), + _react2.default.createElement(_components.DataSelector, { label: _('Columns'), attr: 'cells.values' }), + _react2.default.createElement( + _components.TraceTypeSection, + { + traceTypes: ['scatterpolar', 'scatterpolargl', 'barpolar'], + mode: 'trace' + }, + _react2.default.createElement(_components.DataSelector, { label: _('Radius'), attr: 'r' }), + _react2.default.createElement(_components.DataSelector, { label: _('Theta'), attr: 'theta' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Theta Unit'), + options: [{ label: _('Radians'), value: 'radians' }, { label: _('Degrees'), value: 'degrees' }, { label: _('Gradians'), value: 'gradians' }], + attr: 'thetaunit', + clearable: false + }) + ), + _react2.default.createElement(_components.AxesCreator, { attr: 'fake_attr' }), + _react2.default.createElement(_components.SubplotCreator, { attr: 'fake_attr' }), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Header Options') }, + _react2.default.createElement(_components.DataSelector, { label: _('Fill Color'), attr: 'header.fill.color' }), + _react2.default.createElement(_components.DataSelector, { label: _('Font Color'), attr: 'header.font.color' }), + _react2.default.createElement(_components.DataSelector, { label: _('Font Size'), attr: 'header.font.size' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Cell Options') }, + _react2.default.createElement(_components.DataSelector, { label: _('Fill Color'), attr: 'cells.fill.color' }), + _react2.default.createElement(_components.DataSelector, { label: _('Font Color'), attr: 'cells.font.color' }), + _react2.default.createElement(_components.DataSelector, { label: _('Font Size'), attr: 'cells.font.size' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Column Options') }, + _react2.default.createElement(_components.DataSelector, { label: _('Width'), attr: 'columnwidth' }), + _react2.default.createElement(_components.DataSelector, { label: _('Order'), attr: 'columnorder' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Options') }, + _react2.default.createElement(_components.DataSelector, { label: _('Intensity'), attr: 'intensity' }), + _react2.default.createElement(_components.DataSelector, { label: _('Facecolor'), attr: 'facecolor' }), + _react2.default.createElement(_components.DataSelector, { label: _('Vertexcolor'), attr: 'vertexcolor' }), + _react2.default.createElement(_components.Radio, { + label: _('Transpose'), + attr: 'transpose', + options: [{ label: _('No'), value: false }, { label: _('Yes'), value: true }] + }) + ) + ); + } + ); + } + ); +}; +// import PropTypes from 'prop-types'; +exports.default = GraphCreatePanel; +// GraphCreatePanel.contextTypes = { +// localize: PropTypes.func, +// setPanel: PropTypes.func, +// }; +//# sourceMappingURL=GraphCreatePanel.js.map \ No newline at end of file diff --git a/lib/default_panels/GraphCreatePanel.js.map b/lib/default_panels/GraphCreatePanel.js.map new file mode 100644 index 000000000..b746ec2bc --- /dev/null +++ b/lib/default_panels/GraphCreatePanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/GraphCreatePanel.js"],"names":["GraphCreatePanel","_","localize","setPanel","t","transforms","some","includes","tr","type","histogram2d","histogram","choropleth","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAYA;;AAKA;;;;AAEA,IAAMA,mBAAmB,SAAnBA,gBAAmB,GAAM;AAC7B,SACE;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,qCAAD,CAAsB,QAAtB;AAAA;AACG;AAAA,cAAEC,QAAF,SAAEA,QAAF;AAAA,iBACC;AAAC,sCAAD;AAAA;AACE,0BADF;AAEE,oCAAsB;AAAA,uBACpB,EACEC,EAAEC,UAAF,IACAD,EAAEC,UAAF,CAAaC,IAAb,CAAkB;AAAA,yBAAM,CAAC,KAAD,EAAQ,gBAAR,EAA0BC,QAA1B,CAAmCC,GAAGC,IAAtC,CAAN;AAAA,iBAAlB,CAFF,CADoB;AAAA;AAFxB;AASE,0CAAC,yBAAD,IAAe,OAAOR,EAAE,MAAF,CAAtB,EAAiC,MAAK,MAAtC,EAA6C,UAA7C,GATF;AAWE,0CAAC,4BAAD,IAAkB,MAAK,MAAvB,GAXF;AAaE,0CAAC,wBAAD,IAAc,OAAOA,EAAE,QAAF,CAArB,EAAkC,MAAK,QAAvC,GAbF;AAcE,0CAAC,wBAAD,IAAc,OAA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A;AACA","file":"GraphCreatePanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n DataSelector,\n Dropdown,\n Radio,\n PlotlySection,\n AxesCreator,\n SubplotCreator,\n TraceAccordion,\n TraceSelector,\n TraceTypeSection,\n LocationSelector,\n} from '../components';\nimport {\n HistogramInfoVertical,\n HistogramInfoHorizontal,\n Histogram2d,\n} from '../components/fields/derived';\nimport {EditorControlsContext, ModalProviderContext} from '../context';\n\nconst GraphCreatePanel = () => {\n return (\n \n {({localize: _}) => (\n \n {({setPanel}) => (\n \n !(\n t.transforms &&\n t.transforms.some(tr => ['fit', 'moving-average'].includes(tr.type))\n )\n }\n >\n \n\n \n\n \n \n\n \n \n \n \n \n {_(\n 'Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the '\n )}\n setPanel('Style', 'Traces')}>{_('Traces')}\n {_(\n ' panel under Style. If Y values are omitted, the histogram function defaults to Count.'\n )}\n \n \n {_(\n 'Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the '\n )}\n setPanel('Style', 'Traces')}>{_('Traces')}\n {_(\n ' under Style panel. If X values are omitted, the histogram function defaults to Count.'\n )}\n \n \n {_(\n 'Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the '\n )}\n setPanel('Style', 'Traces')}>{_('Traces')}\n {_(\n ' under Style panel. If Z values are omitted, the histogram function defaults to Count.'\n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default GraphCreatePanel;\n// GraphCreatePanel.contextTypes = {\n// localize: PropTypes.func,\n// setPanel: PropTypes.func,\n// };\n"]} \ No newline at end of file diff --git a/lib/default_panels/GraphSubplotsPanel.js b/lib/default_panels/GraphSubplotsPanel.js new file mode 100644 index 000000000..020d44100 --- /dev/null +++ b/lib/default_panels/GraphSubplotsPanel.js @@ -0,0 +1,232 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _constants = require('../lib/constants'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var GraphSubplotsPanel = function GraphSubplotsPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.SubplotAccordion, + null, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Boundaries'), attr: 'xaxis.domain[0]' }, + _react2.default.createElement(_components.AxisOverlayDropdown, { label: _('X Overlay'), attr: 'xaxis.overlaying' }), + _react2.default.createElement(_components.AxisOverlayDropdown, { label: _('Y Overlay'), attr: 'yaxis.overlaying' }) + ), + _react2.default.createElement(_components.RectanglePositioner, { attr: 'domain.x[0]' }), + _react2.default.createElement(_components.RectanglePositioner, { attr: 'xaxis.domain[0]', cartesian: true }), + _react2.default.createElement( + _components.TraceTypeSection, + { name: _('X Anchor'), traceTypes: _constants.TRACE_TO_AXIS.cartesian }, + _react2.default.createElement(_components.AxisAnchorDropdown, { label: _('Anchor to'), attr: 'xaxis.anchor', clearable: false }), + _react2.default.createElement(_components.AxisSide, { label: _('Side'), attr: 'xaxis.side' }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { name: _('Y Anchor'), traceTypes: _constants.TRACE_TO_AXIS.cartesian }, + _react2.default.createElement(_components.AxisAnchorDropdown, { label: _('Anchor to'), attr: 'yaxis.anchor', clearable: false }), + _react2.default.createElement(_components.AxisSide, { label: _('Side'), attr: 'yaxis.side' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Aspect Ratio') }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'aspectmode', + options: [{ label: _('Auto'), value: 'mode' }, { label: _('Cube'), value: 'cube' }, { label: _('Data'), value: 'data' }, { label: _('Manual'), value: 'manual' }], + dropdown: true, + clearable: false, + showOn: 'manual', + defaultOpt: 'mode' + }, + _react2.default.createElement(_components.Numeric, { label: _('X'), attr: 'aspectratio.x', step: 0.1 }), + _react2.default.createElement(_components.Numeric, { label: _('Y'), attr: 'aspectratio.y', step: 0.1 }), + _react2.default.createElement(_components.Numeric, { label: _('Z'), attr: 'aspectratio.z', step: 0.1 }) + ) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Canvas') }, + _react2.default.createElement(_components.ColorPicker, { label: _('Plot Background'), attr: 'bgcolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Bar Options') }, + _react2.default.createElement(_components.Radio, { + label: _('Bar Mode'), + attr: 'barmode', + options: [{ label: _('Stack'), value: 'stack' }, { label: _('Overlay'), value: 'overlay' }] + }), + _react2.default.createElement(_components.NumericFraction, { label: _('Bar Padding'), attr: 'bargap', showSlider: true }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Map Style') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Mapbox Style'), + attr: 'style', + options: [{ label: _('Basic'), value: 'basic' }, { label: _('Outdoors'), value: 'outdoors' }, { label: _('Light'), value: 'light' }, { label: _('Dark'), value: 'dark' }, { label: _('Satellite'), value: 'satellite' }, { label: _('Satellite with Streets'), value: 'satellite-streets' }], + clearable: false + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Map Positioning') }, + _react2.default.createElement(_components.Numeric, { label: _('Center Latitude'), attr: 'center.lat' }), + _react2.default.createElement(_components.Numeric, { label: _('Center Longitude'), attr: 'center.lon' }), + _react2.default.createElement(_components.Numeric, { label: _('Zoom Level'), attr: 'zoom', min: 0 }), + _react2.default.createElement(_components.Numeric, { label: _('Bearing'), attr: 'bearing' }), + _react2.default.createElement(_components.Numeric, { label: _('Pitch'), attr: 'pitch', min: 0 }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Map Projection') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Region'), + attr: 'scope', + options: [{ label: _('World'), value: 'world' }, { label: _('USA'), value: 'usa' }, { label: _('Europe'), value: 'europe' }, { label: _('Asia'), value: 'asia' }, { label: _('Africa'), value: 'africa' }, { label: _('North America'), value: 'north america' }, { label: _('South America'), value: 'south america' }], + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Projection'), + attr: 'projection.type', + clearable: false, + options: [{ label: _('Equirectangular'), value: 'equirectangular' }, { label: _('Mercator'), value: 'mercator' }, { label: _('Orthographic'), value: 'orthographic' }, { label: _('Natural Earth'), value: 'natural earth' }, { label: _('Albers USA'), value: 'albers usa' }, { label: _('Winkel Tripel'), value: 'winkel tripel' }, { label: _('Robinson'), value: 'robinson' }, { label: _('Miller'), value: 'miller' }, { label: _('Kavrayskiy 7'), value: 'kavrayskiy7' }, { label: _('Eckert 4'), value: 'eckert4' }, { label: _('Azimuthal Equal Area'), value: 'azimuthal equal area' }, { + label: _('Azimuthal Equidistant'), + value: 'azimuthal equidistant' + }, { label: _('Conic Equal Area'), value: 'conic equal area' }, { label: _('Conic Conformal'), value: 'conic conformal' }, { label: _('Conic Equidistant'), value: 'conic equidistant' }, { label: _('Gnomonic'), value: 'gnomonic' }, { label: _('Stereographic'), value: 'stereographic' }, { label: _('Mollweide'), value: 'mollweide' }, { label: _('Hammer'), value: 'hammer' }, { label: _('Transverse Mercator'), value: 'transverse mercator' }, { label: _('Aitoff'), value: 'aitoff' }, { label: _('Sinusoidal'), value: 'sinusoidal' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Country Borders'), attr: 'showcountries' }, + _react2.default.createElement(_components.Radio, { + attr: 'showcountries', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'countrywidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'countrycolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Sub-Country Unit Borders'), attr: 'showsubunits' }, + _react2.default.createElement(_components.Radio, { + attr: 'showsubunits', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'subunitwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'subunitcolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Coastlines'), attr: 'showcoastlines' }, + _react2.default.createElement(_components.Radio, { + attr: 'showcoastlines', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'coastlinewidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'coastlinecolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Oceans'), attr: 'showocean' }, + _react2.default.createElement(_components.Radio, { + attr: 'showocean', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'oceancolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Land'), attr: 'showland' }, + _react2.default.createElement(_components.Radio, { + attr: 'showland', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'landcolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Lakes'), attr: 'showlakes' }, + _react2.default.createElement(_components.Radio, { + attr: 'showlakes', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'lakecolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Rivers'), attr: 'showrivers' }, + _react2.default.createElement(_components.Radio, { + attr: 'showrivers', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'riverwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'rivercolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Map Frame'), attr: 'showframe' }, + _react2.default.createElement(_components.Radio, { + attr: 'showframe', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'framewidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'framecolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Map Options') }, + _react2.default.createElement(_components.Radio, { + label: _('Resolution'), + attr: 'resolution', + options: [{ label: _('1:110,000,000'), value: 110 }, { label: _('1:50,000,000'), value: 50 }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Scale'), attr: 'projection.scale', min: 0 }), + _react2.default.createElement(_components.Numeric, { label: _('Latitude'), attr: 'projection.rotation.lon', min: 0 }), + _react2.default.createElement(_components.Numeric, { label: _('Longitude'), attr: 'projection.rotation.lat', min: 0 }), + _react2.default.createElement(_components.Numeric, { label: _('Roll'), attr: 'projection.rotation.roll', min: 0 }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Ternary') }, + _react2.default.createElement(_components.Numeric, { label: _('Sum'), attr: 'sum' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Polar Sector') }, + _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'sector[0]', min: -360, max: 360, showSlider: true }), + _react2.default.createElement(_components.Numeric, { label: _('Max'), attr: 'sector[1]', min: -360, max: 360, showSlider: true }), + _react2.default.createElement(_components.NumericFraction, { label: _('Hole'), attr: 'hole', min: 0, max: 100, showSlider: true }) + ) + ); + } + ); +}; + +// GraphSubplotsPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +// import PropTypes from 'prop-types'; +exports.default = GraphSubplotsPanel; +//# sourceMappingURL=GraphSubplotsPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/GraphSubplotsPanel.js.map b/lib/default_panels/GraphSubplotsPanel.js.map new file mode 100644 index 000000000..92a469866 --- /dev/null +++ b/lib/default_panels/GraphSubplotsPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/GraphSubplotsPanel.js"],"names":["GraphSubplotsPanel","_","localize","TRACE_TO_AXIS","cartesian","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAeA;;AACA;;;;AAEA,IAAMA,qBAAqB,SAArBA,kBAAqB;AAAA,SACzB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,oCAAD;AAAA;AACE;AAAC,mCAAD;AAAA,YAAe,MAAMD,EAAE,YAAF,CAArB,EAAsC,MAAK,iBAA3C;AACE,wCAAC,+BAAD,IAAqB,OAAOA,EAAE,WAAF,CAA5B,EAA4C,MAAK,kBAAjD,GADF;AAEE,wCAAC,+BAAD,IAAqB,OAAOA,EAAE,WAAF,CAA5B,EAA4C,MAAK,kBAAjD;AAFF,SADF;AAME,sCAAC,+BAAD,IAAqB,MAAK,aAA1B,GANF;AAOE,sCAAC,+BAAD,IAAqB,MAAK,iBAA1B,EAA4C,eAA5C,GAPF;AASE;AAAC,sCAAD;AAAA,YAAkB,MAAMA,EAAE,UAAF,CAAxB,EAAuC,YAAYE,yBAAcC,SAAjE;AACE,wCAAC,8BAAD,IAAoB,OAAOH,EAAE,WAAF,CAA3B,EAA2C,MAAK,cAAhD,EAA+D,WAAW,KAA1E,GADF;AAEE,wCAAC,oBAAD,IAAU,OAAOA,EAAE,MAAF,CAAjB,EAA4B,MAAK,YAAjC;AAFF,SATF;AAaE;AAAC,sCAAD;AAAA,YAAkB,MAAMA,EAAE,UAAF,CAAxB,EAAuC,YAAYE,yBAAcC,SAAjE;AACE,wCAAC,8BAAD,IAAoB,OAAOH,EAAE,WAAF,CAA3B,EAA2C,MAAK,cAAhD,EAA+D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AYE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,MAAF,CAAhB,EAA2B,MAAK,0BAAhC,EAA2D,KAAK,CAAhE;AAZF,SA1LF;AAyME;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,SAAF,CAArB;AACE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,KAAF,CAAhB,EAA0B,MAAK,KAA/B;AADF,SAzMF;AA6ME;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,cAAF,CAArB;AACE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,KAAF,CAAhB,EAA0B,MAAK,WAA/B,EAA2C,KAAK,CAAC,GAAjD,EAAsD,KAAK,GAA3D,EAAgE,gBAAhE,GADF;AAEE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,KAAF,CAAhB,EAA0B,MAAK,WAA/B,EAA2C,KAAK,CAAC,GAAjD,EAAsD,KAAK,GAA3D,EAAgE,gBAAhE,GAFF;AAGE,wCAAC,2BAAD,IAAiB,OAAOA,EAAE,MAAF,CAAxB,EAAmC,MAAK,MAAxC,EAA+C,KAAK,CAApD,EAAuD,KAAK,GAA5D,EAAiE,gBAAjE;AAHF;AA7MF,OADD;AAAA;AADH,GADyB;AAAA,CAA3B;;AA0NA;AACA;AACA;;AA/OA;kBAiPeD,kB","file":"GraphSubplotsPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n SubplotAccordion,\n RectanglePositioner,\n AxisOverlayDropdown,\n PlotlySection,\n TraceTypeSection,\n AxisAnchorDropdown,\n AxisSide,\n Dropdown,\n Radio,\n Numeric,\n ColorPicker,\n VisibilitySelect,\n NumericFraction,\n} from '../components';\nimport {TRACE_TO_AXIS} from '../lib/constants';\nimport {EditorControlsContext} from '../context';\n\nconst GraphSubplotsPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n )}\n \n);\n\n// GraphSubplotsPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default GraphSubplotsPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/GraphTransformsPanel.js b/lib/default_panels/GraphTransformsPanel.js new file mode 100644 index 000000000..4c5d9edf0 --- /dev/null +++ b/lib/default_panels/GraphTransformsPanel.js @@ -0,0 +1,125 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Aggregations = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _components = require('../components'); + +var _lib = require('../lib'); + +var _constants = require('../lib/constants'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var AggregationSection = (0, _lib.connectAggregationToTransform)(_components.PlotlySection); + +var Aggregations = exports.Aggregations = function (_Component) { + _inherits(Aggregations, _Component); + + function Aggregations() { + _classCallCheck(this, Aggregations); + + return _possibleConstructorReturn(this, (Aggregations.__proto__ || Object.getPrototypeOf(Aggregations)).apply(this, arguments)); + } + + _createClass(Aggregations, [{ + key: 'render', + value: function render() { + var _context$fullContaine = this.context.fullContainer.aggregations, + aggregations = _context$fullContaine === undefined ? [] : _context$fullContaine; + var _ = this.context.localize; + + if (aggregations.length === 0) { + return null; + } + + return _react2.default.createElement( + _components.PlotlySection, + { name: _('Aggregations'), attr: 'aggregations' }, + aggregations.filter(function (aggr) { + return aggr.target && aggr.target.match(/transforms\[\d*\]\./gi) === null; + }).map(function (_ref, i) { + var target = _ref.target; + return _react2.default.createElement( + AggregationSection, + { show: true, key: i, aggregationIndex: i }, + _react2.default.createElement(_components.Dropdown, { + attr: 'func', + label: target, + options: [{ label: _('Count'), value: 'count' }, { label: _('Sum'), value: 'sum' }, { label: _('Average'), value: 'avg' }, { label: _('Median'), value: 'median' }, { label: _('Mode'), value: 'mode' }, { label: _('RMS'), value: 'rms' }, { label: _('Standard Deviation'), value: 'stddev' }, { label: _('Min'), value: 'min' }, { label: _('Max'), value: 'max' }, { label: _('First'), value: 'first' }, { label: _('Last'), value: 'last' }, { label: _('Change'), value: 'change' }, { label: _('Range'), value: 'range' }], + clearable: false + }) + ); + }) + ); + } + }]); + + return Aggregations; +}(_react.Component); + +Aggregations.plotly_editor_traits = { no_visibility_forcing: true }; +Aggregations.contextTypes = { + fullContainer: _propTypes2.default.object, + localize: _propTypes2.default.func +}; + +var GraphTransformsPanel = function GraphTransformsPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref2) { + var _ = _ref2.localize; + return _react2.default.createElement( + _components.TraceAccordion, + { traceFilterCondition: function traceFilterCondition(t) { + return _constants.TRANSFORMABLE_TRACES.includes(t.type); + } }, + _react2.default.createElement( + _components.TransformAccordion, + null, + _react2.default.createElement(_components.Radio, { + attr: 'enabled', + options: [{ label: _('Enabled'), value: true }, { label: _('Disabled'), value: false }] + }), + _react2.default.createElement(_components.DataSelector, { label: _('By'), attr: 'groups' }), + _react2.default.createElement(_components.DataSelector, { label: _('Target'), attr: 'target' }), + _react2.default.createElement(_components.FilterOperation, { label: _('Operator'), attr: 'operation' }), + _react2.default.createElement(_components.FilterValue, { label: _('Value'), attr: 'value' }), + _react2.default.createElement(_components.Radio, { + attr: 'order', + options: [{ label: _('Ascending'), value: 'ascending' }, { label: _('Descending'), value: 'descending' }] + }), + _react2.default.createElement(Aggregations, null) + ) + ); + } + ); +}; + +// GraphTransformsPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = GraphTransformsPanel; +//# sourceMappingURL=GraphTransformsPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/GraphTransformsPanel.js.map b/lib/default_panels/GraphTransformsPanel.js.map new file mode 100644 index 000000000..901abcd81 --- /dev/null +++ b/lib/default_panels/GraphTransformsPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/GraphTransformsPanel.js"],"names":["AggregationSection","PlotlySection","Aggregations","context","fullContainer","aggregations","_","localize","length","filter","aggr","target","match","map","i","label","value","Component","plotly_editor_traits","no_visibility_forcing","contextTypes","PropTypes","object","func","GraphTransformsPanel","TRANSFORMABLE_TRACES","includes","t","type"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AAUA;;AACA;;AAGA;;;;;;;;;;AADA,IAAMA,qBAAqB,wCAA8BC,yBAA9B,CAA3B;;IAGaC,Y,WAAAA,Y;;;;;;;;;;;6BACF;AAAA,kCAGH,KAAKC,OAHF,CAELC,aAFK,CAEWC,YAFX;AAAA,UAEWA,YAFX,yCAE0B,EAF1B;AAAA,UAIUC,CAJV,GAIe,K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F,CAAR,EAAwBU,OAAO,WAA/B,EADO,EAEP,EAACD,OAAOT,EAAE,YAAF,CAAR,EAAyBU,OAAO,YAAhC,EAFO;AAFX,YAZF;AAoBE,wCAAC,YAAD;AApBF;AADF,OADD;AAAA;AADH,GADF;AA8BD,CA/BD;;AAiCA;AACA;AACA;;kBAEeQ,oB","file":"GraphTransformsPanel.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Radio,\n TransformAccordion,\n TraceAccordion,\n DataSelector,\n Dropdown,\n PlotlySection,\n FilterOperation,\n FilterValue,\n} from '../components';\nimport {connectAggregationToTransform} from '../lib';\nimport {TRANSFORMABLE_TRACES} from 'lib/constants';\n\nconst AggregationSection = connectAggregationToTransform(PlotlySection);\nimport {EditorControlsContext} from '../context';\n\nexport class Aggregations extends Component {\n render() {\n const {\n fullContainer: {aggregations = []},\n } = this.context;\n const {localize: _} = this.context;\n if (aggregations.length === 0) {\n return null;\n }\n\n return (\n \n {aggregations\n .filter(aggr => aggr.target && aggr.target.match(/transforms\\[\\d*\\]\\./gi) === null)\n .map(({target}, i) => (\n \n \n \n ))}\n \n );\n }\n}\n\nAggregations.plotly_editor_traits = {no_visibility_forcing: true};\nAggregations.contextTypes = {\n fullContainer: PropTypes.object,\n localize: PropTypes.func,\n};\n\nconst GraphTransformsPanel = () => {\n return (\n \n {({localize: _}) => (\n TRANSFORMABLE_TRACES.includes(t.type)}>\n \n \n\n \n\n \n \n \n\n \n\n \n \n \n )}\n \n );\n};\n\n// GraphTransformsPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default GraphTransformsPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleAxesPanel.js b/lib/default_panels/StyleAxesPanel.js new file mode 100644 index 000000000..de5ba2b1d --- /dev/null +++ b/lib/default_panels/StyleAxesPanel.js @@ -0,0 +1,397 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _components = require('../components'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var StyleAxesPanel = function (_Component) { + _inherits(StyleAxesPanel, _Component); + + function StyleAxesPanel() { + _classCallCheck(this, StyleAxesPanel); + + return _possibleConstructorReturn(this, (StyleAxesPanel.__proto__ || Object.getPrototypeOf(StyleAxesPanel)).apply(this, arguments)); + } + + _createClass(StyleAxesPanel, [{ + key: 'render', + value: function render() { + var _ = this.context.localize; + + return _react2.default.createElement( + _components.LayoutPanel, + null, + _react2.default.createElement( + _components.AxesFold, + { + name: _('Titles'), + axisFilter: function axisFilter(axis) { + return !(axis._name.includes('angular') || axis._subplot.includes('geo')); + } + }, + _react2.default.createElement(_components.TextEditor, { attr: 'title' }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'titlefont.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'titlefont.size', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'titlefont.color' }) + ), + _react2.default.createElement( + _components.AxesFold, + { name: _('Range') }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Range'), attr: 'autorange' }, + _react2.default.createElement(_components.Dropdown, { + attr: 'type', + label: _('Type'), + clearable: false, + options: [{ label: _('Linear'), value: 'linear' }, { label: _('Log'), value: 'log' }, { label: _('Date'), value: 'date' }, { label: _('Categorical'), value: 'category' }] + }), + _react2.default.createElement(_components.Radio, { + attr: 'autorange', + label: _('Range'), + options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }] + }), + _react2.default.createElement(_components.AxesRange, { label: _('Min'), attr: 'range[0]' }), + _react2.default.createElement(_components.AxesRange, { label: _('Max'), attr: 'range[1]' }), + _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'min' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Zoom Interactivity'), attr: 'fixedrange' }, + _react2.default.createElement(_components.Radio, { + attr: 'fixedrange', + options: [{ label: _('Enable'), value: false }, { label: _('Disable'), value: true }] + }) + ), + _react2.default.createElement(_components.Dropdown, { + label: _('Direction'), + attr: 'direction', + options: [{ label: _('Clockwise'), value: 'clockwise' }, { label: _('Counter Clockwise'), value: 'counterclockwise' }], + clearable: false + }) + ), + _react2.default.createElement( + _components.AxesFold, + { name: _('Lines') }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Axis Line'), attr: 'showline' }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'showline', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true, + defaultOpt: true + }, + _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'linewidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'linecolor' }), + _react2.default.createElement(_components.AxisSide, { label: _('Position'), attr: 'side' }), + _react2.default.createElement(_components.Radio, { + label: _('Mirror Axis'), + attr: 'mirror', + options: [{ label: _('On'), value: 'ticks' }, { label: _('Off'), value: false }] + }) + ) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Grid Lines'), attr: 'showgrid' }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'showgrid', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true, + defaultOpt: true + }, + _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'gridwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'gridcolor' }), + _react2.default.createElement(_components.Radio, { + label: _('Grid Spacing'), + attr: 'tickmode', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }] + }), + _react2.default.createElement(_components.DTicks, { label: _('Step Offset'), attr: 'tick0' }), + _react2.default.createElement(_components.DTicks, { label: _('Step Size'), attr: 'dtick' }), + _react2.default.createElement(_components.NTicks, { label: _('Max Number of Lines'), attr: 'nticks' }) + ) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Zero Line'), attr: 'zeroline' }, + _react2.default.createElement(_components.Radio, { + attr: 'zeroline', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'zerolinewidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'zerolinecolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Axis Background'), attr: 'showbackground' }, + _react2.default.createElement(_components.Radio, { + attr: 'showbackground', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'backgroundcolor' }) + ) + ), + _react2.default.createElement( + _components.AxesFold, + { name: _('Tick Labels'), axisFilter: function axisFilter(axis) { + return !axis._subplot.includes('geo'); + } }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Tick Labels'), attr: 'showticklabels' }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'showticklabels', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true, + defaultOpt: true + }, + _react2.default.createElement(_components.AxisSide, { label: _('Position'), attr: 'side' }), + _react2.default.createElement(_components.Radio, { + label: _('Auto margins'), + attr: 'automargin', + options: [{ label: _('True'), value: true }, { label: _('False'), value: false }] + }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'tickfont.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'tickfont.size', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'tickfont.color' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Angle'), + attr: 'tickangle', + clearable: false, + options: [{ label: _('Auto'), value: 'auto' }, { label: _('45'), value: 45 }, { label: _('90'), value: 90 }, { label: _('135'), value: 135 }, { label: _('180'), value: 180 }] + }), + _react2.default.createElement(_components.TickFormat, { + label: _('Label Format'), + attr: 'tickformat', + dafaultOpt: '', + clearable: false + }), + _react2.default.createElement(_components.Radio, { + label: _('Separate Thousands'), + attr: 'separatethousands', + options: [{ label: _('True'), value: true }, { label: _('False'), value: false }] + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Exponents'), + attr: 'exponentformat', + clearable: false, + options: [{ label: _('None'), value: '000' }, { label: _('e+6'), value: 'e' }, { label: _('E+6'), value: 'E' }, { label: _('x10^6'), value: 'power' }, { label: _('k/M/G'), value: 'SI' }, { label: _('k/M/B'), value: 'B' }] + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Show Exponents'), + attr: 'showexponent', + clearable: false, + options: [{ label: _('All'), value: 'all' }, { label: _('First'), value: 'first' }, { label: _('Last'), value: 'last' }, { label: _('None'), value: 'none' }] + }), + _react2.default.createElement(_components.DropdownCustom, { + label: _('Prefix'), + attr: 'tickprefix', + options: [{ label: _('None'), value: '' }, { label: _('x'), value: 'x' }, { label: _('$'), value: '$' }, { label: _('#'), value: '#' }, { label: _('@'), value: '@' }, { label: _('Custom'), value: 'custom' }], + customOpt: 'custom', + dafaultOpt: '', + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Show Prefix'), + attr: 'showtickprefix', + options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None'), value: 'none' }] + }), + _react2.default.createElement(_components.DropdownCustom, { + label: _('Suffix'), + attr: 'ticksuffix', + options: [{ label: _('None'), value: '' }, { label: _('C'), value: 'C' }, { label: _('%'), value: '%' }, { label: _('^'), value: '^' }, { label: _('Custom'), value: 'custom' }], + customOpt: 'custom', + dafaultOpt: '', + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Show Suffix'), + attr: 'showticksuffix', + options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None'), value: 'none' }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Tick Spacing'), + attr: 'tickmode', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }] + }), + _react2.default.createElement(_components.DTicks, { label: _('Step Offset'), attr: 'tick0' }), + _react2.default.createElement(_components.DTicks, { label: _('Step Size'), attr: 'dtick' }), + _react2.default.createElement(_components.NTicks, { label: _('Max Number of Labels'), attr: 'nticks' }) + ) + ) + ), + _react2.default.createElement( + _components.AxesFold, + { name: _('Tick Markers'), axisFilter: function axisFilter(axis) { + return !axis._subplot.includes('geo'); + } }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Tick Markers'), attr: 'ticks' }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'ticks', + options: [{ label: _('Inside'), value: 'inside' }, { label: _('Outside'), value: 'outside' }, { label: _('Hide'), value: '' }], + showOn: ['inside', 'outside'], + defaultOpt: 'Outside' + }, + _react2.default.createElement(_components.AxisSide, { label: _('Position'), attr: 'side' }), + _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: 'ticklen', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'tickwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'tickcolor' }), + _react2.default.createElement(_components.Radio, { + label: _('Tick Spacing'), + attr: 'tickmode', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }] + }), + _react2.default.createElement(_components.DTicks, { label: _('Step Offset'), attr: 'tick0' }), + _react2.default.createElement(_components.DTicks, { label: _('Step Size'), attr: 'dtick' }), + _react2.default.createElement(_components.NTicks, { label: _('Max Number of Markers'), attr: 'nticks' }) + ) + ) + ), + _react2.default.createElement( + _components.AxesFold, + { name: _('Range Slider'), axisFilter: function axisFilter(axis) { + return axis._subplot.includes('xaxis'); + } }, + _react2.default.createElement(_components.RangesliderVisible, { + attr: 'rangeslider.visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.NumericFraction, { label: _('Height'), attr: 'rangeslider.thickness' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'rangeslider.bgcolor' }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'rangeslider.borderwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'rangeslider.bordercolor' }) + ), + _react2.default.createElement( + _components.AxesFold, + { + name: _('Timescale Buttons'), + axisFilter: function axisFilter(axis) { + return axis._subplot.includes('xaxis') && axis.type === 'date'; + } + }, + _react2.default.createElement(_components.Radio, { + attr: 'rangeselector.visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement( + _components.RangeSelectorAccordion, + null, + _react2.default.createElement(_components.TextEditor, { attr: 'label', label: _('Label'), show: true }), + _react2.default.createElement(_components.Numeric, { label: _('Count'), attr: 'count' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Step'), + attr: 'step', + clearable: false, + options: [{ label: _('Year'), value: 'year' }, { label: _('Month'), value: 'month' }, { label: _('Day'), value: 'day' }, { label: _('Hour'), value: 'hour' }, { label: _('Minute'), value: 'minute' }, { label: _('Second'), value: 'second' }, { label: _('All'), value: 'all' }] + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Stepmode'), + attr: 'stepmode', + clearable: false, + options: [{ label: _('To Date'), value: 'todate' }, { label: _('Backward'), value: 'backward' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Text') }, + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'rangeselector.font.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'rangeselector.font.size', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'rangeselector.font.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Style') }, + _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'rangeselector.bgcolor' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Active Color'), attr: 'rangeselector.activecolor' }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'rangeselector.borderwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'rangeselector.bordercolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'rangeselector.xanchor', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Position'), step: 0.02, attr: 'rangeselector.x' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'rangeselector.yanchor', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Position'), step: 0.02, attr: 'rangeselector.y' }) + ) + ), + _react2.default.createElement( + _components.AxesFold, + { + name: _('Spike Lines'), + axisFilter: function axisFilter(axis) { + return !(axis._subplot.includes('ternary') || axis._subplot.includes('polar') || axis._subplot.includes('geo')); + } + }, + _react2.default.createElement(_components.Radio, { + attr: 'showspikes', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Radio, { + attr: 'spikesides', + label: _('Show Sides'), + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'spikethickness', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'spikecolor' }) + ) + ); + } + }]); + + return StyleAxesPanel; +}(_react.Component); + +StyleAxesPanel.contextTypes = { + fullLayout: _propTypes2.default.object, + localize: _propTypes2.default.func +}; + +exports.default = StyleAxesPanel; +//# sourceMappingURL=StyleAxesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleAxesPanel.js.map b/lib/default_panels/StyleAxesPanel.js.map new file mode 100644 index 000000000..c76abb537 --- /dev/null +++ b/lib/default_panels/StyleAxesPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleAxesPanel.js"],"names":["StyleAxesPanel","_","context","localize","axis","_name","includes","_subplot","label","value","type","Component","contextTypes","fullLayout","PropTypes","object","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;IAsBMA,c;;;;;;;;;;;6BACK;AAAA,UACUC,CADV,GACe,KAAKC,OADpB,CACAC,QADA;;AAEP,aACE;AAAC,+BAAD;AAAA;AACE;AAAC,8BAAD;AAAA;AACE,kBAAMF,EAAE,QAAF,CADR;AAEE,wBAAY;AAAA,qBAAQ,EAAEG,KAAKC,KAAL,CAAWC,QAAX,CAAo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AhD;AAZF;AA7DF,SApRF;AAiWE;AAAC,8BAAD;AAAA;AACE,kBAAMA,EAAE,aAAF,CADR;AAEE,wBAAY;AAAA,qBACV,EACEG,KAAKG,QAAL,CAAcD,QAAd,CAAuB,SAAvB,KACAF,KAAKG,QAAL,CAAcD,QAAd,CAAuB,OAAvB,CADA,IAEAF,KAAKG,QAAL,CAAcD,QAAd,CAAuB,KAAvB,CAHF,CADU;AAAA;AAFd;AAUE,wCAAC,iBAAD;AACE,kBAAK,YADP;AAEE,qBAAS,CAAC,EAACE,OAAOP,EAAE,MAAF,CAAR,EAAmBQ,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOP,EAAE,MAAF,CAAR,EAAmBQ,OAAO,KAA1B,EAAlC;AAFX,YAVF;AAcE,wCAAC,iBAAD;AACE,kBAAK,YADP;AAEE,mBAAOR,EAAE,YAAF,CAFT;AAGE,qBAAS,CAAC,EAACO,OAAOP,EAAE,MAAF,CAAR,EAAmBQ,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOP,EAAE,MAAF,CAAR,EAAmBQ,OAAO,KAA1B,EAAlC;AAHX,YAdF;AAoBE,wCAAC,mBAAD,IAAS,OAAOR,EAAE,WAAF,CAAhB,EAAgC,MAAK,gBAArC,EAAsD,OAAM,IAA5D,GApBF;AAqBE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,YAArC;AArBF;AAjWF,OADF;AA2XD;;;;EA9X0BU,gB;;AAiY7BX,eAAeY,YAAf,GAA8B;AAC5BC,cAAYC,oBAAUC,MADM;AAE5BZ,YAAUW,oBAAUE;AAFQ,CAA9B;;kBAKehB,c","file":"StyleAxesPanel.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {\n AxesRange,\n DTicks,\n NTicks,\n ColorPicker,\n Dropdown,\n FontSelector,\n Numeric,\n NumericFraction,\n Radio,\n TextEditor,\n PlotlySection,\n LayoutPanel,\n AxesFold,\n AxisSide,\n RangesliderVisible,\n RangeSelectorAccordion,\n VisibilitySelect,\n DropdownCustom,\n TickFormat,\n} from '../components';\n\nclass StyleAxesPanel extends Component {\n render() {\n const {localize: _} = this.context;\n return (\n \n !(axis._name.includes('angular') || axis._subplot.includes('geo'))}\n >\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n !axis._subplot.includes('geo')}>\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n\n \n \n \n \n \n \n !axis._subplot.includes('geo')}>\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n axis._subplot.includes('xaxis')}>\n \n \n \n \n \n \n\n axis._subplot.includes('xaxis') && axis.type === 'date'}\n >\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n !(\n axis._subplot.includes('ternary') ||\n axis._subplot.includes('polar') ||\n axis._subplot.includes('geo')\n )\n }\n >\n \n \n\n \n \n \n \n );\n }\n}\n\nStyleAxesPanel.contextTypes = {\n fullLayout: PropTypes.object,\n localize: PropTypes.func,\n};\n\nexport default StyleAxesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleColorbarsPanel.js b/lib/default_panels/StyleColorbarsPanel.js new file mode 100644 index 000000000..0f24254c3 --- /dev/null +++ b/lib/default_panels/StyleColorbarsPanel.js @@ -0,0 +1,267 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.traceHasColorbar = undefined; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types'; + +var traceHasColorbar = exports.traceHasColorbar = function traceHasColorbar(trace, fullTrace) { + return fullTrace.marker && fullTrace.marker.showscale !== undefined || // eslint-disable-line no-undefined + fullTrace.showscale !== undefined; +}; // eslint-disable-line no-undefined + +var StyleColorBarsPanel = function StyleColorBarsPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.TraceAccordion, + { traceFilterCondition: traceHasColorbar }, + ['', 'marker.'].map(function (prefix) { + return _react2.default.createElement( + _components.VisibilitySelect, + { + attr: prefix + 'showscale', + key: 'x' + prefix, + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true + }, + _react2.default.createElement( + _components.PlotlyPanel, + { key: prefix + ' panel' }, + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Title') }, + _react2.default.createElement(_components.TextEditor, { attr: prefix + 'colorbar.title' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Location'), + attr: prefix + 'colorbar.titleside', + options: [{ label: _('Top'), value: 'top' }, { label: _('Right'), value: 'right' }, { label: _('Bottom'), value: 'bottom' }] + }), + _react2.default.createElement(_components.FontSelector, { + label: _('Typeface'), + attr: prefix + 'colorbar.titlefont.family' + }), + _react2.default.createElement(_components.Numeric, { + label: _('Font Size'), + attr: prefix + 'colorbar.titlefont.size', + units: 'px' + }), + _react2.default.createElement(_components.ColorPicker, { + label: _('Font Color'), + attr: prefix + 'colorbar.titlefont.color' + }) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Size and Positioning') }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Size'), attr: prefix + 'colorbar.len' }, + _react2.default.createElement(_components.Numeric, { label: _('Height'), attr: prefix + 'colorbar.len' }), + _react2.default.createElement(_components.Radio, { + attr: prefix + 'colorbar.lenmode', + options: [{ label: _('Fraction of Plot'), value: 'fraction' }, { label: _('Pixels'), value: 'pixels' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: prefix + 'colorbar.thickness' }), + _react2.default.createElement(_components.Radio, { + attr: prefix + 'colorbar.thicknessmode', + options: [{ label: _('Fraction of Plot'), value: 'fraction' }, { label: _('Pixels'), value: 'pixels' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Positioning'), attr: prefix + 'colorbar.x' }, + _react2.default.createElement(_components.Numeric, { + label: _('Position'), + attr: prefix + 'colorbar.x', + showSlider: true, + step: 0.02 + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor'), + attr: prefix + 'colorbar.xanchor', + options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Positioning'), attr: prefix + 'colorbar.y' }, + _react2.default.createElement(_components.Numeric, { + label: _('Position'), + attr: prefix + 'colorbar.y', + showSlider: true, + step: 0.02 + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor'), + attr: prefix + 'colorbar.yanchor', + options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Padding'), attr: prefix + 'colorbar.xpad' }, + _react2.default.createElement(_components.Numeric, { label: _('Vertical'), attr: prefix + 'colorbar.ypad', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Horizontal'), attr: prefix + 'colorbar.xpad', units: 'px' }) + ) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Labels') }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: prefix + 'colorbar.showticklabels', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true, + defaultOpt: true + }, + _react2.default.createElement(_components.FontSelector, { + label: _('Typeface'), + attr: prefix + 'colorbar.tickfont.family' + }), + _react2.default.createElement(_components.Numeric, { + label: _('Font Size'), + attr: prefix + 'colorbar.tickfont.size', + units: 'px' + }), + _react2.default.createElement(_components.ColorPicker, { + label: _('Font Color'), + attr: prefix + 'colorbar.tickfont.color' + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Angle'), + attr: prefix + 'colorbar.tickangle', + clearable: false, + options: [{ label: _('Auto'), value: 'auto' }, { label: _('45'), value: 45 }, { label: _('90'), value: 90 }, { label: _('135'), value: 135 }, { label: _('180'), value: 180 }] + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Exponents'), + attr: prefix + 'colorbar.exponentformat', + clearable: false, + options: [{ label: _('None'), value: '000' }, { label: _('e+6'), value: 'e' }, { label: _('E+6'), value: 'E' }, { label: _('x10^6'), value: 'power' }, { label: _('k/M/G'), value: 'SI' }, { label: _('k/M/B'), value: 'B' }] + }), + _react2.default.createElement(_components.DropdownCustom, { + label: _('Label Prefix'), + attr: prefix + 'colorbar.tickprefix', + options: [{ label: _('None'), value: '' }, { label: _('x'), value: 'x' }, { label: _('$'), value: '$' }, { label: _('#'), value: '#' }, { label: _('@'), value: '@' }, { label: _('Custom'), value: 'custom' }], + customOpt: 'custom', + dafaultOpt: '', + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Show Prefix'), + attr: prefix + 'colorbar.showtickprefix', + options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None label'), value: 'none' }] + }), + _react2.default.createElement(_components.DropdownCustom, { + label: _('Label Suffix'), + attr: prefix + 'colorbar.ticksuffix', + options: [{ label: _('None'), value: '' }, { label: _('C'), value: 'C' }, { label: _('%'), value: '%' }, { label: _('^'), value: '^' }, { label: _('Custom'), value: 'custom' }], + customOpt: 'custom', + dafaultOpt: '', + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Show Suffix'), + attr: prefix + 'colorbar.showticksuffix', + options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None label'), value: 'none' }] + }), + _react2.default.createElement(_components.Radio, { + attr: prefix + 'colorbar.tickmode', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }], + label: _('Tick spacing') + }), + _react2.default.createElement(_components.Numeric, { label: _('Step Offset'), attr: prefix + 'colorbar.tick0' }), + _react2.default.createElement(_components.Numeric, { label: _('Step Size'), attr: prefix + 'colorbar.dtick' }), + _react2.default.createElement(_components.Numeric, { + label: _('Max Number of Labels'), + attr: prefix + 'colorbar.nticks' + }) + ) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Ticks') }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: prefix + 'colorbar.ticks', + options: [{ label: _('Inside'), value: 'inside' }, { label: _('Outside'), value: 'outside' }, { label: _('Hide'), value: '' }], + showOn: ['inside', 'outside'], + defaultOpt: '' + }, + _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: prefix + 'colorbar.ticklen', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: prefix + 'colorbar.tickwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: prefix + 'colorbar.tickcolor' }), + _react2.default.createElement(_components.Radio, { + attr: prefix + 'colorbar.tickmode', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }], + label: _('Tick spacing') + }), + _react2.default.createElement(_components.Numeric, { label: _('Step Offset'), attr: prefix + 'colorbar.tick0' }), + _react2.default.createElement(_components.Numeric, { label: _('Step Size'), attr: prefix + 'colorbar.dtick' }), + _react2.default.createElement(_components.Numeric, { + label: _('Max Number of Labels'), + attr: prefix + 'colorbar.nticks' + }) + ) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Borders and Background') }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Color Bar'), attr: prefix + 'colorbar.outlinewidth' }, + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: prefix + 'colorbar.outlinewidth' }), + _react2.default.createElement(_components.ColorPicker, { + label: _('Border Color'), + attr: prefix + 'colorbar.outlinecolor' + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { + name: _('Color Bar Container'), + attr: prefix + 'colorbar.bgcolor' + }, + _react2.default.createElement(_components.ColorPicker, { + label: _('Background Color'), + attr: prefix + 'colorbar.bgcolor' + }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: prefix + 'colorbar.borderwidth' }), + _react2.default.createElement(_components.ColorPicker, { + label: _('Border Color'), + attr: prefix + 'colorbar.bordercolor' + }) + ) + ) + ) + ); + }) + ); + } + ); +}; + +// StyleColorBarsPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = StyleColorBarsPanel; +//# sourceMappingURL=StyleColorbarsPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleColorbarsPanel.js.map b/lib/default_panels/StyleColorbarsPanel.js.map new file mode 100644 index 000000000..18dac38a0 --- /dev/null +++ b/lib/default_panels/StyleColorbarsPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleColorbarsPanel.js"],"names":["traceHasColorbar","trace","fullTrace","marker","showscale","undefined","StyleColorBarsPanel","_","localize","map","prefix","label","value"],"mappings":";;;;;;;AAAA;;;;AAGA;;AAcA;;;;AAhBA;;AAkBO,IAAMA,8CAAmB,SAAnBA,gBAAmB,CAACC,KAAD,EAAQC,SAAR;AAAA,SAC7BA,UAAUC,MAAV,IAAoBD,UAAUC,MAAV,CAAiBC,SAAjB,KAA+BC,SAApD,IAAkE;AAClEH,YAAUE,SAAV,KAAwBC,SAFM;AAAA,CAAzB,C,CAE8B;;AAErC,IAAMC,sBAAsB,SAAtBA,mBAAsB,GAAM;AAChC,SACE;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,kCAAD;AAAA,UAAgB,sBAAsBR,gBAAtC;AACG,SAAC,EAAD,EAAK,SAAL,EAAgBS,GAAhB,CAAoB,kBAAU;AAC7B,iBACE;AAAC,wCAAD;AAAA;AACE,oBAAMC,SAAS,WADjB;AAEE,mBAAK,MAAMA,MAFb;AAGE,uBAAS,CAAC,E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uBAAD;AACE,2BAAOH,EAAE,cAAF,CADT;AAEE,0BAAMG,SAAS;AAFjB;AATF;AARF;AAvOF;AANF,WADF;AAwQD,SAzQA;AADH,OADD;AAAA;AADH,GADF;AAkRD,CAnRD;;AAqRA;AACA;AACA;;kBAEeJ,mB","file":"StyleColorbarsPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\n\nimport {\n Radio,\n TextEditor,\n TraceAccordion,\n Numeric,\n PlotlyFold,\n PlotlyPanel,\n PlotlySection,\n Dropdown,\n DropdownCustom,\n FontSelector,\n ColorPicker,\n VisibilitySelect,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nexport const traceHasColorbar = (trace, fullTrace) =>\n (fullTrace.marker && fullTrace.marker.showscale !== undefined) || // eslint-disable-line no-undefined\n fullTrace.showscale !== undefined; // eslint-disable-line no-undefined\n\nconst StyleColorBarsPanel = () => {\n return (\n \n {({localize: _}) => (\n \n {['', 'marker.'].map(prefix => {\n return (\n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n );\n })}\n \n )}\n \n );\n};\n\n// StyleColorBarsPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleColorBarsPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleImagesPanel.js b/lib/default_panels/StyleImagesPanel.js new file mode 100644 index 000000000..d58017479 --- /dev/null +++ b/lib/default_panels/StyleImagesPanel.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types'; +var StyleImagesPanel = function StyleImagesPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.ImageAccordion, + { canAdd: true }, + _react2.default.createElement(_components.Radio, { + attr: 'visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Dropzone, { attr: 'source', fileType: _('image'), show: true }), + _react2.default.createElement(_components.Dropdown, { + label: _('Aspect Ratio'), + attr: 'sizing', + options: [{ label: _('Contain'), value: 'contain' }, { label: _('Fill'), value: 'fill' }, { label: _('Stretch'), value: 'stretch' }], + clearable: false + }), + _react2.default.createElement(_components.Radio, { + label: _('Relative to Grid'), + attr: 'layer', + options: [{ label: _('Below'), value: 'below' }, { label: _('Above'), value: 'above' }] + }), + _react2.default.createElement(_components.PositioningNumeric, { attr: 'sizex', label: _('Width') }), + _react2.default.createElement(_components.PositioningNumeric, { attr: 'sizey', label: _('Height') }), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'xanchor', + options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] + }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'x' }), + _react2.default.createElement(_components.PositioningRef, { label: _('Relative To'), attr: 'xref' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'yanchor', + options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] + }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'y' }), + _react2.default.createElement(_components.PositioningRef, { label: _('Relative To'), attr: 'yref' }) + ) + ); + } + ); +}; + +// StyleImagesPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = StyleImagesPanel; +//# sourceMappingURL=StyleImagesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleImagesPanel.js.map b/lib/default_panels/StyleImagesPanel.js.map new file mode 100644 index 000000000..4dfc6b84a --- /dev/null +++ b/lib/default_panels/StyleImagesPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleImagesPanel.js"],"names":["StyleImagesPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AASA;;;;AAVA;AAYA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,kCAAD;AAAA,UAAgB,YAAhB;AACE,sCAAC,iBAAD;AACE,gBAAK,SADP;AAEE,mBAAS,CAAC,EAACC,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC;AAFX,UADF;AAME,sCAAC,oBAAD,IAAU,MAAK,QAAf,EAAwB,UAAUH,EAAE,OAAF,CAAlC,EAA8C,UAA9C,GANF;AAQE,sCAAC,oBAAD;AACE,iBAAOA,EAAE,cAAF,CADT;AAEE,gBAAK,QAFP;AAGE,mBAAS,CACP,EAACE,OAAOF,EAAE,SAAF,CAAR,EAAsBG,OAAO,SAA7B,EADO,EAEP,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,MAA1B,EAFO,EAGP,EAACD,OAAOF,EAAE,SAAF,CAAR,EAAsBG,OAAO,SAA7B,EAHO,CAHX;AAQE,qBAAW;AARb,UARF;AAkBE,sCAAC,iBAAD;AACE,iBAAOH,EAAE,kBAAF,CADT;AAEE,gBAAK,OAFP;AAGE,mBAAS,CAAC,EAACE,OAAOF,EAAE,OAAF,CAAR,EAAoBG,OAAO,OAA3B,EAAD,EAAs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BAAD,IAAgB,OAAOA,EAAE,aAAF,CAAvB,EAAyC,MAAK,MAA9C;AAZF;AAxCF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AA8DA;AACA;AACA;;kBAEeD,gB","file":"StyleImagesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ImageAccordion,\n Radio,\n Dropzone,\n PositioningNumeric,\n PlotlySection,\n PositioningRef,\n Dropdown,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleImagesPanel = () => (\n \n {({localize: _}) => (\n \n \n\n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n )}\n \n);\n\n// StyleImagesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleImagesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleLayoutPanel.js b/lib/default_panels/StyleLayoutPanel.js new file mode 100644 index 000000000..52ff629a3 --- /dev/null +++ b/lib/default_panels/StyleLayoutPanel.js @@ -0,0 +1,157 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _derived = require('../components/fields/derived'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var StyleLayoutPanel = function StyleLayoutPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.LayoutPanel, + null, + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Defaults') }, + _react2.default.createElement(_components.ColorPicker, { label: _('Plot Background'), attr: 'plot_bgcolor' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Margin Color'), attr: 'paper_bgcolor' }), + _react2.default.createElement(_components.ColorwayPicker, { label: _('Base Colors'), attr: 'colorway' }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family', clearable: false }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'font.size', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'font.color' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Number format'), + attr: 'separators', + options: [{ label: _('1,234.56'), value: '.,' }, { label: _('1 234.56'), value: ', ' }, { label: _('1 234,56'), value: ', ' }, { label: _('1.234,56'), value: ',.' }], + clearable: false + }) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Title') }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Title'), attr: 'title' }, + _react2.default.createElement(_components.TextEditor, { attr: 'title' }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'titlefont.family', clearable: false }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'titlefont.size', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'titlefont.color' }) + ) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Modebar') }, + _react2.default.createElement(_components.Radio, { + label: _('Orientation'), + attr: 'modebar.orientation', + options: [{ label: _('Horizontal'), value: 'h' }, { label: _('Vertical'), value: 'v' }] + }), + _react2.default.createElement(_components.ColorPicker, { label: _('Icon Color'), attr: 'modebar.color' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Active Icon Color'), attr: 'modebar.activecolor' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'modebar.bgcolor' }) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Layout') }, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'autosize', + label: _('Size'), + options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }], + showOn: false, + defaultOpt: true + }, + _react2.default.createElement(_components.Numeric, { label: _('Fixed Width'), attr: 'width', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Fixed height'), attr: 'height', units: 'px' }) + ), + _react2.default.createElement(_components.Numeric, { label: _('Top'), attr: 'margin.t', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Bottom'), attr: 'margin.b', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Left'), attr: 'margin.l', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Right'), attr: 'margin.r', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Padding'), attr: 'margin.pad', units: 'px' }) + ), + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Interactions') }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Drag'), attr: 'dragmode' }, + _react2.default.createElement(_components.Dropdown, { + label: _('Mode'), + attr: 'dragmode', + options: [{ label: _('Zoom'), value: 'zoom' }, { label: _('Select'), value: 'select' }, { label: _('Pan'), value: 'pan' }, { label: _('Lasso'), value: 'lasso' }, { label: _('Orbit'), value: 'orbit' }, { label: _('Turntable'), value: 'turntable' }], + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Select Direction'), + attr: 'selectdirection', + options: [{ label: _('Any'), value: 'any' }, { label: _('Horizontal'), value: 'h' }, { label: _('Vertical'), value: 'v' }, { label: _('Diagonal'), value: 'd' }], + clearable: false + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Click'), attr: 'clickmode' }, + _react2.default.createElement(_components.Flaglist, { + label: _('Mode'), + attr: 'clickmode', + options: [{ label: _('Click Event'), value: 'event' }, { label: _('Select Data Point'), value: 'select' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Hover') }, + _react2.default.createElement( + _components.HovermodeDropdown, + { label: _('Mode'), attr: 'hovermode' }, + _react2.default.createElement(_derived.HoverColor, { + label: _('Background Color'), + attr: 'hoverlabel.bgcolor', + defaultColor: '#FFF', + handleEmpty: true + }), + _react2.default.createElement(_derived.HoverColor, { + label: _('Border Color'), + attr: 'hoverlabel.bordercolor', + defaultColor: '#000', + handleEmpty: true + }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'hoverlabel.font.family', clearable: true }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'hoverlabel.font.size' }), + _react2.default.createElement(_derived.HoverColor, { + label: _('Font Color'), + attr: 'hoverlabel.font.color', + defaultColor: '#000', + handleEmpty: true + }) + ) + ) + ) + ); + } + ); +}; + +// StyleLayoutPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +// import PropTypes from 'prop-types'; +exports.default = StyleLayoutPanel; +//# sourceMappingURL=StyleLayoutPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleLayoutPanel.js.map b/lib/default_panels/StyleLayoutPanel.js.map new file mode 100644 index 000000000..548f8cee2 --- /dev/null +++ b/lib/default_panels/StyleLayoutPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleLayoutPanel.js"],"names":["StyleLayoutPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAeA;;AACA;;;;AAEA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,+BAAD;AAAA;AACE;AAAC,gCAAD;AAAA,YAAY,MAAMD,EAAE,UAAF,CAAlB;AACE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,iBAAF,CAApB,EAA0C,MAAK,cAA/C,GADF;AAEE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,cAAF,CAApB,EAAuC,MAAK,eAA5C,GAFF;AAGE,wCAAC,0BAAD,IAAgB,OAAOA,EAAE,aAAF,CAAvB,EAAyC,MAAK,UAA9C,GAHF;AAIE,wCAAC,wBAAD,IAAc,OAAOA,EAAE,UAAF,CAArB,EAAoC,MAAK,aAAzC,EAAuD,WAAW,KAAlE,GAJF;AAKE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,WAAF,CAAhB,EAAgC,MAAK,WAArC,EAAiD,OAAM,IAAvD,GALF;AAME,wCAAC,uBAAD,IAAa,OAAOA,EAAE,YAA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,CAAR,EAAgCG,OAAO,QAAvC,EAFO;AAHX;AADF,WA3BF;AAqCE;AAAC,qCAAD;AAAA,cAAe,MAAMH,EAAE,OAAF,CAArB;AACE;AAAC,2CAAD;AAAA,gBAAmB,OAAOA,EAAE,MAAF,CAA1B,EAAqC,MAAK,WAA1C;AACE,4CAAC,mBAAD;AACE,uBAAOA,EAAE,kBAAF,CADT;AAEE,sBAAK,oBAFP;AAGE,8BAAa,MAHf;AAIE;AAJF,gBADF;AAOE,4CAAC,mBAAD;AACE,uBAAOA,EAAE,cAAF,CADT;AAEE,sBAAK,wBAFP;AAGE,8BAAa,MAHf;AAIE;AAJF,gBAPF;AAaE,4CAAC,wBAAD,IAAc,OAAOA,EAAE,UAAF,CAArB,EAAoC,MAAK,wBAAzC,EAAkE,eAAlE,GAbF;AAcE,4CAAC,mBAAD,IAAS,OAAOA,EAAE,WAAF,CAAhB,EAAgC,MAAK,sBAArC,GAdF;AAeE,4CAAC,mBAAD;AACE,uBAAOA,EAAE,YAAF,CADT;AAEE,sBAAK,uBAFP;AAGE,8BAAa,MAHf;AAIE;AAJF;AAfF;AADF;AArCF;AAzDF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AA+HA;AACA;AACA;;AApJA;kBAsJeD,gB","file":"StyleLayoutPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n ColorwayPicker,\n Dropdown,\n FontSelector,\n PlotlyFold,\n Numeric,\n TextEditor,\n PlotlySection,\n LayoutPanel,\n VisibilitySelect,\n HovermodeDropdown,\n Flaglist,\n Radio,\n} from '../components';\nimport {HoverColor} from '../components/fields/derived';\nimport {EditorControlsContext} from '../context';\n\nconst StyleLayoutPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleLayoutPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleLayoutPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleLegendPanel.js b/lib/default_panels/StyleLegendPanel.js new file mode 100644 index 000000000..0fc3dcdfb --- /dev/null +++ b/lib/default_panels/StyleLegendPanel.js @@ -0,0 +1,98 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types'; +var StyleLegendPanel = function StyleLegendPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.TraceRequiredPanel, + null, + _react2.default.createElement( + _components.PlotlyFold, + { name: _('Legend') }, + _react2.default.createElement(_components.Radio, { + attr: 'showlegend', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Text') }, + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'legend.font.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'legend.font.size', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'legend.font.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Legend Box') }, + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'legend.borderwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'legend.bordercolor' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'legend.bgcolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'legend.xanchor', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Position'), showSlider: true, step: 0.02, attr: 'legend.x' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'legend.yanchor', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Position'), showSlider: true, step: 0.02, attr: 'legend.y' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Orientation') }, + _react2.default.createElement(_components.Radio, { + attr: 'legend.orientation', + options: [{ label: _('Vertical'), value: 'v' }, { label: _('Horizontal'), value: 'h' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Trace Order') }, + _react2.default.createElement(_components.Dropdown, { + attr: 'legend.traceorder', + options: [{ label: _('Normal'), value: 'normal' }, { label: _('Reversed'), value: 'reversed' }, { label: _('Grouped'), value: 'grouped' }, { label: _('Reversed and Grouped'), value: 'reversed+grouped' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Gap Between Groups'), attr: 'legend.tracegroupgap', units: 'px' }) + ) + ) + ); + } + ); +}; + +// StyleLegendPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = StyleLegendPanel; +//# sourceMappingURL=StyleLegendPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleLegendPanel.js.map b/lib/default_panels/StyleLegendPanel.js.map new file mode 100644 index 000000000..f669d1a29 --- /dev/null +++ b/lib/default_panels/StyleLegendPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleLegendPanel.js"],"names":["StyleLegendPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAUA;;;;AAXA;AAaA,IAAMA,m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ACE,oBAAK,mBADP;AAEE,uBAAS,CACP,EAACE,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EADO,EAEP,EAACD,OAAOF,EAAE,UAAF,CAAR,EAAuBG,OAAO,UAA9B,EAFO,EAGP,EAACD,OAAOF,EAAE,SAAF,CAAR,EAAsBG,OAAO,SAA7B,EAHO,EAIP,EAACD,OAAOF,EAAE,sBAAF,CAAR,EAAmCG,OAAO,kBAA1C,EAJO;AAFX,cADF;AAUE,0CAAC,mBAAD,IAAS,OAAOH,EAAE,oBAAF,CAAhB,EAAyC,MAAK,sBAA9C,EAAqE,OAAM,IAA3E;AAVF;AAjDF;AADF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AAuEA;AACA;AACA;;kBAEeD,gB","file":"StyleLegendPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n FontSelector,\n PlotlyFold,\n Numeric,\n Radio,\n PlotlySection,\n Dropdown,\n TraceRequiredPanel,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleLegendPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleLegendPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleLegendPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleNotesPanel.js b/lib/default_panels/StyleNotesPanel.js new file mode 100644 index 000000000..771336693 --- /dev/null +++ b/lib/default_panels/StyleNotesPanel.js @@ -0,0 +1,86 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types'; +var StyleNotesPanel = function StyleNotesPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.AnnotationAccordion, + { canAdd: true }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Note Text'), attr: 'text' }, + _react2.default.createElement(_components.TextEditor, { attr: 'text' }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'font.size', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'font.color' }), + _react2.default.createElement(_components.Numeric, { label: _('Angle'), attr: 'textangle', units: '\xB0' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Arrow') }, + _react2.default.createElement(_components.Radio, { + attr: 'showarrow', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Line Width'), attr: 'arrowwidth', units: 'px' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'arrowcolor' }), + _react2.default.createElement(_components.ArrowSelector, { label: _('Arrowhead'), attr: 'arrowhead' }), + _react2.default.createElement(_components.Numeric, { label: _('Scale'), step: 0.1, attr: 'arrowsize', units: 'px' }), + _react2.default.createElement(_components.AnnotationArrowRef, { label: _('X Offset'), attr: 'axref' }), + _react2.default.createElement(_components.AnnotationArrowRef, { label: _('Y Offset'), attr: 'ayref' }), + _react2.default.createElement(_components.Numeric, { label: _('X Vector'), attr: 'ax' }), + _react2.default.createElement(_components.Numeric, { label: _('Y Vector'), attr: 'ay' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'xanchor', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] + }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'x' }), + _react2.default.createElement(_components.AnnotationRef, { label: _('Relative To'), attr: 'xref' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Positioning') }, + _react2.default.createElement(_components.Dropdown, { + label: _('Anchor Point'), + clearable: false, + attr: 'yanchor', + options: [{ label: _('Auto'), value: 'auto' }, { label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] + }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'y' }), + _react2.default.createElement(_components.AnnotationRef, { label: _('Relative To'), attr: 'yref' }) + ) + ); + } + ); +}; + +// StyleNotesPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = StyleNotesPanel; +//# sourceMappingURL=StyleNotesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleNotesPanel.js.map b/lib/default_panels/StyleNotesPanel.js.map new file mode 100644 index 000000000..1a3ab4a70 --- /dev/null +++ b/lib/default_panels/StyleNotesPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleNotesPanel.js"],"names":["StyleNotesPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAcA;;;;AAfA;AAiBA,IAAMA,kBAAkB,SAAlBA,eAAkB;AAAA,SACtB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,uCAAD;AAAA,UAAqB,YAArB;AACE;AAAC,mCAAD;AAAA,YAAe,MAAMD,EAAE,WAAF,CAArB,EAAqC,MAAK,MAA1C;AACE,wCAAC,sBAAD,IAAY,MAAK,MAAjB,GADF;AAEE,wCAAC,wBAAD,IAAc,OAAOA,EAAE,UAAF,CAArB,EAAoC,MAAK,aAAzC,GAFF;AAGE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,WAAF,CAAhB,EAAgC,MAAK,WAArC,EAAiD,OAAM,IAAvD,GAHF;AAIE,wCAAC,uBAAD,IAAa,OAA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,SAHP;AAIE,qBAAS,CACP,EAACE,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,MAA1B,EADO,EAEP,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,MAA1B,EAFO,EAGP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAHO,EAIP,EAACD,OAAOF,EAAE,OAAF,CAAR,EAAoBG,OAAO,OAA3B,EAJO;AAJX,YADF;AAYE,wCAAC,8BAAD,IAAoB,OAAOH,EAAE,UAAF,CAA3B,EAA0C,MAAK,GAA/C,GAZF;AAaE,wCAAC,yBAAD,IAAe,OAAOA,EAAE,aAAF,CAAtB,EAAwC,MAAK,MAA7C;AAbF,SAtBF;AAqCE;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,sBAAF,CAArB;AACE,wCAAC,oBAAD;AACE,mBAAOA,EAAE,cAAF,CADT;AAEE,uBAAW,KAFb;AAGE,kBAAK,SAHP;AAIE,qBAAS,CACP,EAACE,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,MAA1B,EADO,EAEP,EAACD,OAAOF,EAAE,KAAF,CAAR,EAAkBG,OAAO,KAAzB,EAFO,EAGP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAHO,EAIP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAJO;AAJX,YADF;AAYE,wCAAC,8BAAD,IAAoB,OAAOH,EAAE,UAAF,CAA3B,EAA0C,MAAK,GAA/C,GAZF;AAaE,wCAAC,yBAAD,IAAe,OAAOA,EAAE,aAAF,CAAtB,EAAwC,MAAK,MAA7C;AAbF;AArCF,OADD;AAAA;AADH,GADsB;AAAA,CAAxB;;AA4DA;AACA;AACA;;kBAEeD,e","file":"StyleNotesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n AnnotationArrowRef,\n AnnotationRef,\n AnnotationAccordion,\n ArrowSelector,\n ColorPicker,\n FontSelector,\n Numeric,\n Dropdown,\n PositioningNumeric,\n Radio,\n TextEditor,\n PlotlySection,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleNotesPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleNotesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleNotesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleShapesPanel.js b/lib/default_panels/StyleShapesPanel.js new file mode 100644 index 000000000..1f8fc52e1 --- /dev/null +++ b/lib/default_panels/StyleShapesPanel.js @@ -0,0 +1,72 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types'; +var StyleShapesPanel = function StyleShapesPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.ShapeAccordion, + { canAdd: true }, + _react2.default.createElement(_components.Radio, { + attr: 'visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Radio, { + attr: 'type', + options: [{ label: _('Line'), value: 'line' }, { label: _('Rectangle'), value: 'rect' }, { label: _('Ellipse'), value: 'circle' }] + }), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Boundaries') }, + _react2.default.createElement(_components.PositioningRef, { label: _('Relative to'), attr: 'xref' }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('Start Point'), attr: 'x0' }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('End Point'), attr: 'x1' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Boundaries') }, + _react2.default.createElement(_components.PositioningRef, { label: _('Relative to'), attr: 'yref' }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('Start Point'), attr: 'y0' }), + _react2.default.createElement(_components.PositioningNumeric, { label: _('End Point'), attr: 'y1' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Lines') }, + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'line.width' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'line.color' }), + _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'line.dash' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Fill') }, + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'fillcolor' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Opacity'), attr: 'opacity' }) + ) + ); + } + ); +}; + +// StyleShapesPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = StyleShapesPanel; +//# sourceMappingURL=StyleShapesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleShapesPanel.js.map b/lib/default_panels/StyleShapesPanel.js.map new file mode 100644 index 000000000..d12747e49 --- /dev/null +++ b/lib/default_panels/StyleShapesPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleShapesPanel.js"],"names":["StyleShapesPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAWA;;;;AAZA;AAcA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,kCAAD;AAAA,UAAgB,YAAhB;AACE,sCAAC,iBAAD;AACE,gBAAK,SADP;AAEE,mBAAS,CAAC,EAACC,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC;AAFX,UADF;AAKE,s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AAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,WAArC,GADF;AAEE,wCAAC,2BAAD,IAAiB,OAAOA,EAAE,SAAF,CAAxB,EAAsC,MAAK,SAA3C;AAFF;AA9BF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AA0CA;AACA;AACA;;kBAEeD,gB","file":"StyleShapesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ShapeAccordion,\n Radio,\n PlotlySection,\n PositioningRef,\n PositioningNumeric,\n Numeric,\n NumericFraction,\n ColorPicker,\n LineDashSelector,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleShapesPanel = () => (\n \n {({localize: _}) => (\n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleShapesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleShapesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleSlidersPanel.js b/lib/default_panels/StyleSlidersPanel.js new file mode 100644 index 000000000..534347bdc --- /dev/null +++ b/lib/default_panels/StyleSlidersPanel.js @@ -0,0 +1,105 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types'; +var StyleSlidersPanel = function StyleSlidersPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.SliderAccordion, + null, + _react2.default.createElement(_components.Radio, { + attr: 'visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Background') }, + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bgcolor' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Active Color'), attr: 'activebgcolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Border') }, + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'borderwidth' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bordercolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Font') }, + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'font.size' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'font.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Length'), attr: 'len' }, + _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: 'len', step: 0.02 }), + _react2.default.createElement(_components.Dropdown, { + label: _('Length Mode'), + attr: 'lenmode', + options: [{ label: _('Fraction of canvas'), value: 'fraction' }, { label: _('Pixels'), value: 'pixels' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Positioning'), attr: 'x' }, + _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'x', showSlider: true, step: 0.02 }), + _react2.default.createElement(_components.Radio, { + label: _('Anchor'), + attr: 'xanchor', + options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Positioning'), attr: 'y' }, + _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'y', showSlider: true, step: 0.02 }), + _react2.default.createElement(_components.Radio, { + label: _('Anchor'), + attr: 'yanchor', + options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Padding') }, + _react2.default.createElement(_components.Numeric, { label: _('Top'), attr: 'pad.t', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Bottom'), attr: 'pad.b', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Left'), attr: 'pad.l', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Right'), attr: 'pad.r', units: 'px' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Ticks') }, + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'tickcolor' }), + _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: 'ticklen' }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'tickwidth' }) + ) + ); + } + ); +}; + +// StyleSlidersPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = StyleSlidersPanel; +//# sourceMappingURL=StyleSlidersPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleSlidersPanel.js.map b/lib/default_panels/StyleSlidersPanel.js.map new file mode 100644 index 000000000..827d86727 --- /dev/null +++ b/lib/default_panels/StyleSlidersPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleSlidersPanel.js"],"names":["StyleSlidersPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AASA;;;;AAVA;AAYA,IAAMA,oBAAoB,SAApBA,iBAAoB;AAAA,SACxB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,mCAAD;AAAA;AACE,sCAAC,iBAAD;AACE,gBAAK,SADP;AAEE,mBAAS,CAAC,EAACC,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC;AAFX,UADF;AAKE;AAAC,mCAAD;AAAA,YAAe,MAAMH,EAAE,YAAF,CAArB;AACE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,SAArC,GADF;AAEE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,cAAF,CAApB,E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AOA,EAAE,OAAF,CAApB,EAAgC,MAAK,WAArC,GADF;AAEE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,QAAF,CAAhB,EAA6B,MAAK,SAAlC,GAFF;AAGE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,OAAF,CAAhB,EAA4B,MAAK,WAAjC;AAHF;AA3DF,OADD;AAAA;AADH,GADwB;AAAA,CAA1B;;AAwEA;AACA;AACA;;kBAEeD,iB","file":"StyleSlidersPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n FontSelector,\n Numeric,\n Radio,\n PlotlySection,\n Dropdown,\n SliderAccordion,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleSlidersPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleSlidersPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleSlidersPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleTracesPanel.js b/lib/default_panels/StyleTracesPanel.js new file mode 100644 index 000000000..feca70f93 --- /dev/null +++ b/lib/default_panels/StyleTracesPanel.js @@ -0,0 +1,621 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _derived = require('../components/fields/derived'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var StyleTracesPanel = function StyleTracesPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.TraceAccordion, + { canGroup: true }, + _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'name', richTextOnly: true }), + _react2.default.createElement(_components.NumericFraction, { label: _('Trace Opacity'), attr: 'opacity' }), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Legend') }, + _react2.default.createElement( + _derived.ShowInLegend, + { + label: _('Show in Legend'), + attr: 'showlegend', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true + }, + _react2.default.createElement(_components.GroupCreator, { label: _('Legend Group'), prefix: _('Group'), attr: 'legendgroup' }) + ) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Cones & Streamtubes') }, + _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'sizeref', stepmode: 'relative' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Size Mode'), + options: [{ label: _('scaled'), value: 'scaled' }, { label: _('absolute'), value: 'absolute' }], + attr: 'sizemode' + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Cone Anchor'), + options: [{ label: _('Tip'), value: 'tip' }, { label: _('Tail'), value: 'tail' }, { label: _('Center'), value: 'center' }, { label: _('Center of Mass'), value: 'cm' }], + attr: 'anchor' + }), + _react2.default.createElement(_components.Numeric, { label: _('Max Tube segments'), attr: 'maxdisplayed' }) + ), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Color'), attr: 'color' }), + _react2.default.createElement( + _components.TraceTypeSection, + { name: _('Pie Colors'), traceTypes: ['pie'], mode: 'trace' }, + _react2.default.createElement( + _components.LayoutSection, + { attr: 'name' }, + _react2.default.createElement(_components.ColorwayPicker, { label: _('Colors'), attr: 'piecolorway' }), + _react2.default.createElement(_components.Radio, { + label: _('Extended Colors'), + attr: 'extendpiecolors', + options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] + }) + ) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Pie Title'), attr: 'title' }, + _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'title' }), + _react2.default.createElement(_components.Dropdown, { + label: 'Title Position', + attr: 'titleposition', + options: [{ label: _('Top Left'), value: 'top left' }, { label: _('Top Center'), value: 'top center' }, { label: _('Top Right'), value: 'top right' }, { label: _('Middle Center'), value: 'middle center' }, { label: _('Bottom Left'), value: 'bottom left' }, { label: _('Bottom Center'), value: 'bottom center' }, { label: _('Bottom Right'), value: 'bottom right' }] + }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'titlefont.family', clearable: false }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'titlefont.size', units: 'px' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Values') }, + _react2.default.createElement(_derived.BinningDropdown, { label: _('Histogram Function'), attr: 'histfunc' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Histogram Normalization'), + options: [{ label: _('Number of Occurences'), value: '' }, { label: _('Percent'), value: 'percent' }, { label: _('Probability'), value: 'probability' }, { label: _('Density'), value: 'density' }, { label: _('Probability Density'), value: 'probability density' }], + attr: 'histnorm' + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Cumulative') }, + _react2.default.createElement(_components.Radio, { + label: _('Cumulative'), + attr: 'cumulative.enabled', + options: [{ label: _('Enabled'), value: true }, { label: _('Disabled'), value: false }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Direction'), + attr: 'cumulative.direction', + options: [{ label: _('Increasing'), value: 'increasing' }, { label: _('Decreasing'), value: 'decreasing' }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Current Bin'), + attr: 'cumulative.currentbin', + options: [{ label: _('Include'), value: 'include' }, { label: _('Exclude'), value: 'exclude' }, { label: _('Half'), value: 'half' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Header') }, + _react2.default.createElement(_components.Numeric, { label: _('Height'), attr: 'header.height' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'header.fill.color' }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'header.font.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'header.font.size' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Text Alignment'), + options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }], + attr: 'header.align' + }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Font Color'), attr: 'header.font.color' }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'header.line.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Border Color'), attr: 'header.line.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Cells') }, + _react2.default.createElement(_components.Numeric, { label: _('Height'), attr: 'cells.height' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'cells.fill.color' }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'cells.font.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'cells.font.size' }), + _react2.default.createElement(_components.Dropdown, { + label: _('Text Alignment'), + options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }], + attr: 'cells.align' + }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Font Color'), attr: 'cells.font.color' }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'cells.line.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Border Color'), attr: 'cells.line.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Display') }, + _react2.default.createElement(_components.Flaglist, { + attr: 'mode', + options: [{ label: _('Points'), value: 'markers' }, { label: _('Lines'), value: 'lines' }, { label: _('Text'), value: 'text' }] + }), + _react2.default.createElement(_components.Radio, { + attr: 'flatshading', + label: _('Flatshading'), + options: [{ label: _('Enable'), value: true }, { label: _('Disable'), value: false }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Binning') }, + _react2.default.createElement(_components.Numeric, { label: _('X Bin Start'), attr: 'xbins.start', axis: 'x' }), + _react2.default.createElement(_components.Numeric, { label: _('X Bin End'), attr: 'xbins.end', axis: 'x' }), + _react2.default.createElement(_components.Numeric, { label: _('X Bin Size'), attr: 'xbins.size', axis: 'x' }), + _react2.default.createElement(_components.Numeric, { label: _('Max X Bins'), attr: 'nbinsx' }), + _react2.default.createElement(_components.Numeric, { label: _('Y Bin Start'), attr: 'ybins.start', axis: 'y' }), + _react2.default.createElement(_components.Numeric, { label: _('Y Bin End'), attr: 'ybins.end', axis: 'y' }), + _react2.default.createElement(_components.Numeric, { label: _('Y Bin Size'), attr: 'ybins.size', axis: 'y' }), + _react2.default.createElement(_components.Numeric, { label: _('Max Y Bins'), attr: 'nbinsy' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { label: _('Bar Position') }, + _react2.default.createElement(_components.Numeric, { label: _('Base'), attr: 'base' }), + _react2.default.createElement(_components.Numeric, { label: _('Offset'), attr: 'offset' }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'width' }) + ), + _react2.default.createElement( + _components.TraceMarkerSection, + null, + _react2.default.createElement(_components.Radio, { + label: _('Order'), + attr: 'sort', + options: [{ label: _('Sorted'), value: true }, { label: _('Unsorted'), value: false }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Direction'), + attr: 'direction', + options: [{ label: _('Clockwise'), value: 'clockwise' }, { label: _('Counterclockwise'), value: 'counterclockwise' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Rotation'), attr: 'rotation' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Hole Size'), attr: 'hole' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Pull'), attr: 'pull' }), + _react2.default.createElement(_components.Dropdown, { + options: [{ label: _('Show All'), value: 'all' }, { label: _('Outliers'), value: 'outliers' }, { label: _('Suspected Outliers'), value: 'suspectedoutliers' }, { label: _('Hide'), value: false }], + attr: 'boxpoints', + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + options: [{ label: _('Show All'), value: 'all' }, { label: _('Outliers'), value: 'outliers' }, { label: _('Suspected Outliers'), value: 'suspectedoutliers' }, { label: _('Hide'), value: false }], + attr: 'points', + clearable: false + }), + _react2.default.createElement(_components.NumericFraction, { label: _('Jitter'), attr: 'jitter' }), + _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'pointpos', step: 0.1, showSlider: true }), + _react2.default.createElement(_components.MarkerColor, { suppressMultiValuedMessage: true, label: _('Color'), attr: 'marker.color' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Point Opacity'), attr: 'marker.opacity' }), + _react2.default.createElement(_components.MarkerSize, { label: _('Size'), attr: 'marker.size' }), + _react2.default.createElement(_derived.NumericReciprocal, { + label: _('Size Scale'), + attr: 'marker.sizeref', + step: 0.2, + stepmode: 'relative' + }), + _react2.default.createElement(_components.Radio, { + label: _('Size Mode'), + attr: 'marker.sizemode', + options: [{ label: _('Area'), value: 'area' }, { label: _('Diameter'), value: 'diameter' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Minimum Size'), attr: 'marker.sizemin' }), + _react2.default.createElement(_components.SymbolSelector, { label: _('Symbol'), attr: 'marker.symbol' }), + _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'marker.line.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Border Color'), attr: 'marker.line.color' }), + _react2.default.createElement(_components.Numeric, { label: _('Max Number of Points'), attr: 'marker.maxdisplayed' }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { + name: _('Bar Size and Spacing'), + traceTypes: ['bar', 'histogram'], + mode: 'trace' + }, + _react2.default.createElement( + _components.LayoutSection, + { attr: 'name' }, + _react2.default.createElement(_components.Dropdown, { + label: _('Bar Mode'), + attr: 'barmode', + options: [{ label: _('Overlay'), value: 'overlay' }, { label: _('Group'), value: 'group' }, { label: _('Stack'), value: 'stack' }, { label: _('Relative'), value: 'relative' }], + clearable: false + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Normalization'), + attr: 'barnorm', + options: [{ label: _('None'), value: '' }, { label: _('Fraction'), value: 'fraction' }, { label: _('Percent'), value: 'percent' }], + clearable: false + }), + _react2.default.createElement(_components.NumericFractionInverse, { label: _('Bar Width'), attr: 'bargap' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Bar Padding'), attr: 'bargroupgap' }) + ) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { name: _('Box Size and Spacing'), traceTypes: ['box'], mode: 'trace' }, + _react2.default.createElement( + _components.LayoutSection, + { attr: 'name' }, + _react2.default.createElement(_components.Radio, { + label: _('Box Mode'), + attr: 'boxmode', + options: [{ label: _('Overlay'), value: 'overlay' }, { label: _('Group'), value: 'group' }] + }), + _react2.default.createElement(_components.NumericFractionInverse, { label: _('Box Width'), attr: 'boxgap' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Box Padding'), attr: 'boxgroupgap' }) + ) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { name: _('Violin Size and Spacing'), traceTypes: ['violin'], mode: 'trace' }, + _react2.default.createElement( + _components.LayoutSection, + { attr: 'name' }, + _react2.default.createElement(_components.Radio, { + label: _('Violin Mode'), + attr: 'violinmode', + options: [{ label: _('Overlay'), value: 'overlay' }, { label: _('Group'), value: 'group' }] + }), + _react2.default.createElement(_components.NumericFractionInverse, { label: _('Violin Width'), attr: 'violingap' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Violin Padding'), attr: 'violingroupgap' }) + ) + ), + _react2.default.createElement(_components.NumericFraction, { label: _('Whisker Width'), attr: 'whiskerwidth' }), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Ticks') }, + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'tickwidth' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Contours') }, + _react2.default.createElement(_components.Radio, { + label: _('Type'), + attr: 'contours.type', + options: [{ label: _('Levels'), value: 'levels' }, { label: _('Constraint'), value: 'constraint' }] + }), + _react2.default.createElement(_components.Dropdown, { + label: _('Coloring'), + attr: 'contours.coloring', + options: [{ label: _('Fill'), value: 'fill' }, { label: _('Heatmap'), value: 'heatmap' }, { label: _('Lines'), value: 'lines' }, { label: _('None'), value: 'none' }], + clearable: false + }), + _react2.default.createElement(_components.Radio, { + label: _('Contour Lines'), + attr: 'contours.showlines', + options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Contour Labels'), + attr: 'contours.showlabels', + options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Number of Contours'), + attr: 'autocontour', + options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Max Contours'), attr: 'ncontours' }), + _react2.default.createElement(_components.ContourNumeric, { label: _('Step Size'), attr: 'contours.size' }), + _react2.default.createElement(_components.ContourNumeric, { label: _('Min Contour'), attr: 'contours.start' }), + _react2.default.createElement(_components.ContourNumeric, { label: _('Max Contour'), attr: 'contours.end' }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { name: _('Stacking'), traceTypes: ['scatter'], mode: 'trace' }, + _react2.default.createElement(_components.GroupCreator, { label: _('Group'), prefix: _('Stack'), attr: 'stackgroup' }), + _react2.default.createElement(_components.Radio, { + label: _('Gaps'), + attr: 'stackgaps', + options: [{ label: _('Infer Zero'), value: 'infer zero' }, { label: _('Interpolate'), value: 'interpolate' }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Orientation'), + attr: 'orientation', + options: [{ label: _('Horizontal'), value: 'h' }, { label: _('Vertical'), value: 'v' }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Normalization'), + attr: 'groupnorm', + options: [{ label: _('None'), value: '' }, { label: _('Fraction'), value: 'fraction' }, { label: _('Percent'), value: 'percent' }] + }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { + name: _('Lines'), + traceTypes: ['scatter', 'contour', 'scatterternary', 'scatterpolar', 'scatterpolargl', 'scatter3d', 'scattergl', 'scattergeo', 'scattermapbox', 'box', 'violin'], + mode: 'trace' + }, + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'line.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Color'), attr: 'line.color' }), + _react2.default.createElement(_components.Radio, { + label: _('Color Bar'), + attr: 'line.showscale', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.ColorscalePicker, { label: _('Colorscale'), attr: 'line.colorscale' }), + _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'line.dash' }), + _react2.default.createElement(_components.LineShapeSelector, { label: _('Shape'), attr: 'line.shape' }), + _react2.default.createElement(_components.Numeric, { label: _('Smoothing'), attr: 'line.smoothing', showSlider: true, step: 0.1 }), + _react2.default.createElement(_components.Radio, { + label: _('Connect Gaps'), + attr: 'connectgaps', + options: [{ label: _('Connect'), value: true }, { label: _('Blank'), value: false }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Filled Area') }, + _react2.default.createElement(_components.FillDropdown, { attr: 'fill', label: _('Fill to') }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Color'), attr: 'fillcolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Text Attributes') }, + _react2.default.createElement(_derived.TextInfo, { attr: 'textinfo' }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { + name: _('Text'), + traceTypes: ['scatter', 'scattergl', 'scatterpolar', 'scatterpolargl', 'barpolar', 'pie', 'scatter3d', 'scatterternary', 'bar', 'scattergeo', 'scattermapbox'], + mode: 'trace' + }, + _react2.default.createElement(_components.DataSelector, { label: _('Text'), attr: 'text' }), + _react2.default.createElement(_components.TextPosition, { label: _('Text Position'), attr: 'textposition' }), + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'textfont.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'textfont.size', units: 'px' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Font Color'), attr: 'textfont.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Colorscale') }, + _react2.default.createElement(_components.ColorscalePicker, { label: _('Colorscale'), attr: 'colorscale' }), + _react2.default.createElement(_components.Radio, { + label: _('Color Bar'), + attr: 'showscale', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Orientation'), + attr: 'reversescale', + options: [{ label: _('Normal'), value: false }, { label: _('Reversed'), value: true }] + }), + _react2.default.createElement( + _components.VisibilitySelect, + { + label: _('Range'), + attr: 'zauto', + options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }], + showOn: false, + defaultOpt: true + }, + _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'zmin' }), + _react2.default.createElement(_components.Numeric, { label: _('Max'), attr: 'zmax' }) + ), + _react2.default.createElement( + _components.VisibilitySelect, + { + label: _('Range'), + attr: 'cauto', + options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }], + showOn: false, + defaultOpt: true + }, + _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'cmin' }), + _react2.default.createElement(_components.Numeric, { label: _('Max'), attr: 'cmax' }) + ), + _react2.default.createElement(_components.Radio, { + label: _('Smoothing'), + attr: 'zsmooth', + options: [{ label: _('On'), value: 'best' }, { label: _('Off'), value: false }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Gaps Between Cells') }, + _react2.default.createElement(_components.Numeric, { label: _('Horizontal Gap'), attr: 'xgap' }), + _react2.default.createElement(_components.Numeric, { label: _('Vertical Gap'), attr: 'ygap' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Heatmap') }, + _react2.default.createElement(_components.Numeric, { label: _('Horizontal Gaps'), attr: 'xgap' }), + _react2.default.createElement(_components.Numeric, { label: _('Vertical Gaps'), attr: 'ygap' }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { + name: _('Gaps in Data'), + traceTypes: ['heatmap', 'contour', 'heatmapgl'], + mode: 'trace' + }, + _react2.default.createElement(_components.Radio, { + label: _('Interpolate Gaps'), + attr: 'connectgaps', + options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Lighting') }, + _react2.default.createElement(_components.NumericFraction, { label: _('Ambient'), attr: 'lighting.ambient' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Diffuse'), attr: 'lighting.diffuse' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Specular'), attr: 'lighting.specular' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Roughness'), attr: 'lighting.roughness' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Fresnel'), attr: 'lighting.fresnel' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Vertex Normal'), attr: 'lighting.vertexnormalsepsilon' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Face Normal'), attr: 'lighting.facenormalsepsilon' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Light Position') }, + _react2.default.createElement(_components.NumericFraction, { label: _('X'), attr: 'lightposition.x' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Y'), attr: 'lightposition.y' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Z'), attr: 'lightposition.z' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Increasing Trace Styles') }, + _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'increasing.name', richTextOnly: true }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'increasing.line.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Line Color'), attr: 'increasing.line.color' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'increasing.fillcolor' }), + _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'increasing.line.dash' }), + _react2.default.createElement(_components.Radio, { + label: _('Show in Legend'), + attr: 'increasing.showlegend', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Decreasing Trace Styles') }, + _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'decreasing.name', richTextOnly: true }), + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'decreasing.line.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Line Color'), attr: 'decreasing.line.color' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'decreasing.fillcolor' }), + _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'decreasing.line.dash' }), + _react2.default.createElement(_components.Radio, { + label: _('Show in Legend'), + attr: 'decreasing.showlegend', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Scaling') }, + _react2.default.createElement(_components.GroupCreator, { label: _('Scale Group'), prefix: _('Group'), attr: 'scalegroup' }), + _react2.default.createElement(_components.Radio, { + label: _('Scale Mode'), + attr: 'scalemode', + options: [{ label: _('Width'), value: 'width' }, { label: _('Count'), value: 'count' }] + }), + _react2.default.createElement(_components.Radio, { + label: _('Span Mode'), + attr: 'spanmode', + options: [{ label: _('Soft'), value: 'soft' }, { label: _('Hard'), value: 'hard' }, { label: _('Manual'), value: 'manual' }] + }), + _react2.default.createElement(_components.Numeric, { label: _('Bandwidth'), attr: 'bandwidth' }), + _react2.default.createElement(_components.Numeric, { label: _('Span'), attr: 'span' }), + _react2.default.createElement(_components.Radio, { + attr: 'side', + label: _('Visible Sides'), + options: [{ label: _('Both'), value: 'both' }, { label: _('Positive'), value: 'positive' }, { label: _('Negative'), value: 'negative' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Box Mean') }, + _react2.default.createElement(_components.Radio, { + attr: 'boxmean', + options: [{ label: _('Mean'), value: true }, { label: _('Mean & SD'), value: 'sd' }, { label: _('None'), value: false }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Box') }, + _react2.default.createElement(_components.Radio, { + attr: 'box.visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.NumericFraction, { label: _('Box Width'), attr: 'box.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Box Fill Color'), attr: 'box.color' }), + _react2.default.createElement(_components.NumericFraction, { label: _('Box Line Width'), attr: 'box.line.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Box Line Color'), attr: 'box.line.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Meanline') }, + _react2.default.createElement(_components.Radio, { + attr: 'meanline.visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] + }), + _react2.default.createElement(_components.NumericFraction, { label: _('Meanline Width'), attr: 'meanline.width' }), + _react2.default.createElement(_components.MultiColorPicker, { label: _('Meanline Color'), attr: 'meanline.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('On Hover') }, + _react2.default.createElement(_components.HoverInfo, { attr: 'hoverinfo', label: _('Values Shown On Hover') }), + _react2.default.createElement(_components.Radio, { + label: _('Split labels'), + attr: 'hoverlabel.split', + options: [{ label: _('Yes'), value: true }, { label: _('No'), value: false }] + }), + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'contour.show', + label: _('Show Contour'), + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true, + defaultOpt: false + }, + _react2.default.createElement(_components.MultiColorPicker, { label: _('Contour Color'), attr: 'contour.color' }), + _react2.default.createElement(_components.Numeric, { label: _('Contour Width'), attr: 'contour.width' }) + ) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Hover Action') }, + _react2.default.createElement(_derived.HoveronDropdown, { attr: 'hoveron', label: _('Hover on') }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { + name: _('Error Bars X'), + traceTypes: ['scatter', 'scattergl', 'scatter3d', 'bar'], + mode: 'trace' + }, + _react2.default.createElement(_components.ErrorBars, { attr: 'error_x' }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { + name: _('Error Bars Y'), + traceTypes: ['scatter', 'scattergl', 'scatter3d', 'bar'], + mode: 'trace' + }, + _react2.default.createElement(_components.ErrorBars, { attr: 'error_y' }) + ), + _react2.default.createElement( + _components.TraceTypeSection, + { name: _('Error Bars Z'), traceTypes: ['scatter3d'], mode: 'trace' }, + _react2.default.createElement(_components.ErrorBars, { attr: 'error_z' }) + ) + ); + } + ); +}; + +// StyleTracesPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +// import PropTypes from 'prop-types'; + +exports.default = StyleTracesPanel; +//# sourceMappingURL=StyleTracesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleTracesPanel.js.map b/lib/default_panels/StyleTracesPanel.js.map new file mode 100644 index 000000000..53eec00e9 --- /dev/null +++ b/lib/default_panels/StyleTracesPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleTracesPanel.js"],"names":["StyleTracesPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAGA;;AA+BA;;AAOA;;;;AAEA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,kCAAD;AAAA,UAAgB,cAAhB;AACE,sCAAC,sBAAD,IAAY,OAAOD,EAAE,MAAF,CAAnB,EAA8B,MAAK,MAAnC,EAA0C,kBAA1C,GADF;AAEE,sCAAC,2BAAD,IAAiB,OAAOA,EAAE,eAAF,CAAxB,EAA4C,MAAK,SAAjD,GAFF;AAGE;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,QAAF,CAArB;AACE;AAAC,iCAAD;AAAA;AACE,qBAAOA,EAAE,gBAAF,CADT;AAEE,oBAAK,YAFP;AAGE,uBAAS,CAAC,EAACE,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC,CAHX;AAIE,sBAAQ;AAJV;AAME,0CAAC,wBAAD,IAAc,OAAOH,EAAE,cAAF,CAArB,EAA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CAAzB;;AAknBA;AACA;AACA;;AA9pBA;;kBAgqBeD,gB","file":"StyleTracesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\n\nimport {\n Flaglist,\n ContourNumeric,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n NumericFraction,\n NumericFractionInverse,\n Radio,\n TextEditor,\n PlotlySection,\n LayoutSection,\n SymbolSelector,\n TraceAccordion,\n TraceTypeSection,\n TraceMarkerSection,\n ColorscalePicker,\n ColorwayPicker,\n HoverInfo,\n Dropdown,\n FillDropdown,\n FontSelector,\n TextPosition,\n MarkerSize,\n MarkerColor,\n MultiColorPicker,\n ErrorBars,\n DataSelector,\n VisibilitySelect,\n GroupCreator,\n} from '../components';\nimport {\n BinningDropdown,\n NumericReciprocal,\n ShowInLegend,\n TextInfo,\n HoveronDropdown,\n} from '../components/fields/derived';\nimport {EditorControlsContext} from '../context';\n\nconst StyleTracesPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n )}\n \n);\n\n// StyleTracesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleTracesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleUpdateMenusPanel.js b/lib/default_panels/StyleUpdateMenusPanel.js new file mode 100644 index 000000000..3fe526158 --- /dev/null +++ b/lib/default_panels/StyleUpdateMenusPanel.js @@ -0,0 +1,96 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _components = require('../components'); + +var _context = require('../context'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import PropTypes from 'prop-types'; +var StyleUpdateMenusPanel = function StyleUpdateMenusPanel() { + return _react2.default.createElement( + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize; + return _react2.default.createElement( + _components.UpdateMenuAccordion, + null, + _react2.default.createElement( + _components.VisibilitySelect, + { + attr: 'visible', + options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], + showOn: true + }, + _react2.default.createElement( + _components.PlotlySection, + { name: _('Button Labels') }, + _react2.default.createElement(_components.UpdateMenuButtons, { attr: 'buttons' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Background') }, + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bgcolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Font') }, + _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family' }), + _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'font.size' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'font.color' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Border') }, + _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'borderwidth' }), + _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bordercolor' }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Horizontal Positioning'), attr: 'x' }, + _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'x', showSlider: true, step: 0.02 }), + _react2.default.createElement(_components.Radio, { + label: _('Anchor'), + attr: 'xanchor', + options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Vertical Positioning'), attr: 'y' }, + _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'y', showSlider: true, step: 0.02 }), + _react2.default.createElement(_components.Radio, { + label: _('Anchor'), + attr: 'yanchor', + options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] + }) + ), + _react2.default.createElement( + _components.PlotlySection, + { name: _('Padding') }, + _react2.default.createElement(_components.Numeric, { label: _('Top'), attr: 'pad.t', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Bottom'), attr: 'pad.b', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Left'), attr: 'pad.l', units: 'px' }), + _react2.default.createElement(_components.Numeric, { label: _('Right'), attr: 'pad.r', units: 'px' }) + ) + ) + ); + } + ); +}; + +// StyleUpdateMenusPanel.contextTypes = { +// localize: PropTypes.func, +// }; + +exports.default = StyleUpdateMenusPanel; +//# sourceMappingURL=StyleUpdateMenusPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleUpdateMenusPanel.js.map b/lib/default_panels/StyleUpdateMenusPanel.js.map new file mode 100644 index 000000000..017b89bdf --- /dev/null +++ b/lib/default_panels/StyleUpdateMenusPanel.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/StyleUpdateMenusPanel.js"],"names":["StyleUpdateMenusPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAUA;;;;AAXA;AAaA,IAAMA,wBAAwB,SAAxBA,qBAAwB;AAAA,SAC5B;AAAC,kCAAD,CAAuB,QAAvB;AAAA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AA9CF;AADF,OADD;AAAA;AADH,GAD4B;AAAA,CAA9B;;AA8DA;AACA;AACA;;kBAEeD,qB","file":"StyleUpdateMenusPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n FontSelector,\n Numeric,\n PlotlySection,\n UpdateMenuAccordion,\n UpdateMenuButtons,\n VisibilitySelect,\n Radio,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleUpdateMenusPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleUpdateMenusPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleUpdateMenusPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/index.js b/lib/default_panels/index.js new file mode 100644 index 000000000..9cae79c33 --- /dev/null +++ b/lib/default_panels/index.js @@ -0,0 +1,75 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.GraphSubplotsPanel = exports.StyleUpdateMenusPanel = exports.StyleColorbarsPanel = exports.StyleTracesPanel = exports.StyleImagesPanel = exports.StyleSlidersPanel = exports.StyleShapesPanel = exports.StyleNotesPanel = exports.StyleLegendPanel = exports.StyleAxesPanel = exports.StyleLayoutPanel = exports.GraphTransformsPanel = exports.GraphCreatePanel = undefined; + +var _GraphCreatePanel = require('./GraphCreatePanel'); + +var _GraphCreatePanel2 = _interopRequireDefault(_GraphCreatePanel); + +var _GraphTransformsPanel = require('./GraphTransformsPanel'); + +var _GraphTransformsPanel2 = _interopRequireDefault(_GraphTransformsPanel); + +var _StyleLayoutPanel = require('./StyleLayoutPanel'); + +var _StyleLayoutPanel2 = _interopRequireDefault(_StyleLayoutPanel); + +var _StyleAxesPanel = require('./StyleAxesPanel'); + +var _StyleAxesPanel2 = _interopRequireDefault(_StyleAxesPanel); + +var _StyleLegendPanel = require('./StyleLegendPanel'); + +var _StyleLegendPanel2 = _interopRequireDefault(_StyleLegendPanel); + +var _StyleNotesPanel = require('./StyleNotesPanel'); + +var _StyleNotesPanel2 = _interopRequireDefault(_StyleNotesPanel); + +var _StyleShapesPanel = require('./StyleShapesPanel'); + +var _StyleShapesPanel2 = _interopRequireDefault(_StyleShapesPanel); + +var _StyleSlidersPanel = require('./StyleSlidersPanel'); + +var _StyleSlidersPanel2 = _interopRequireDefault(_StyleSlidersPanel); + +var _StyleImagesPanel = require('./StyleImagesPanel'); + +var _StyleImagesPanel2 = _interopRequireDefault(_StyleImagesPanel); + +var _StyleTracesPanel = require('./StyleTracesPanel'); + +var _StyleTracesPanel2 = _interopRequireDefault(_StyleTracesPanel); + +var _StyleColorbarsPanel = require('./StyleColorbarsPanel'); + +var _StyleColorbarsPanel2 = _interopRequireDefault(_StyleColorbarsPanel); + +var _StyleUpdateMenusPanel = require('./StyleUpdateMenusPanel'); + +var _StyleUpdateMenusPanel2 = _interopRequireDefault(_StyleUpdateMenusPanel); + +var _GraphSubplotsPanel = require('./GraphSubplotsPanel'); + +var _GraphSubplotsPanel2 = _interopRequireDefault(_GraphSubplotsPanel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.GraphCreatePanel = _GraphCreatePanel2.default; +exports.GraphTransformsPanel = _GraphTransformsPanel2.default; +exports.StyleLayoutPanel = _StyleLayoutPanel2.default; +exports.StyleAxesPanel = _StyleAxesPanel2.default; +exports.StyleLegendPanel = _StyleLegendPanel2.default; +exports.StyleNotesPanel = _StyleNotesPanel2.default; +exports.StyleShapesPanel = _StyleShapesPanel2.default; +exports.StyleSlidersPanel = _StyleSlidersPanel2.default; +exports.StyleImagesPanel = _StyleImagesPanel2.default; +exports.StyleTracesPanel = _StyleTracesPanel2.default; +exports.StyleColorbarsPanel = _StyleColorbarsPanel2.default; +exports.StyleUpdateMenusPanel = _StyleUpdateMenusPanel2.default; +exports.GraphSubplotsPanel = _GraphSubplotsPanel2.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/default_panels/index.js.map b/lib/default_panels/index.js.map new file mode 100644 index 000000000..72f862052 --- /dev/null +++ b/lib/default_panels/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/default_panels/index.js"],"names":["GraphCreatePanel","GraphTransformsPanel","StyleLayoutPanel","StyleAxesPanel","StyleLegendPanel","StyleNotesPanel","StyleShapesPanel","StyleSlidersPanel","StyleImagesPanel","StyleTracesPanel","StyleColorbarsPanel","StyleUpdateMenusPanel","GraphSubplotsPanel"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;QAGEA,gB,GAAAA,0B;QACAC,oB,GAAAA,8B;QACAC,gB,GAAAA,0B;QACAC,c,GAAAA,wB;QACAC,gB,GAAAA,0B;QACAC,e,GAAAA,yB;QACAC,gB,GAAAA,0B;QACAC,iB,GAAAA,2B;QACAC,gB,GAAAA,0B;QACAC,gB,GAAAA,0B;QACAC,mB,GAAAA,6B;QACAC,qB,GAAAA,+B;QACAC,kB,GAAAA,4B","file":"index.js","sourcesContent":["import GraphCreatePanel from './GraphCreatePanel';\nimport GraphTransformsPanel from './GraphTransformsPanel';\nimport StyleLayoutPanel from './StyleLayoutPanel';\nimport StyleAxesPanel from './StyleAxesPanel';\nimport StyleLegendPanel from './StyleLegendPanel';\nimport StyleNotesPanel from './StyleNotesPanel';\nimport StyleShapesPanel from './StyleShapesPanel';\nimport StyleSlidersPanel from './StyleSlidersPanel';\nimport StyleImagesPanel from './StyleImagesPanel';\nimport StyleTracesPanel from './StyleTracesPanel';\nimport StyleColorbarsPanel from './StyleColorbarsPanel';\nimport StyleUpdateMenusPanel from './StyleUpdateMenusPanel';\nimport GraphSubplotsPanel from './GraphSubplotsPanel';\n\nexport {\n GraphCreatePanel,\n GraphTransformsPanel,\n StyleLayoutPanel,\n StyleAxesPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleSlidersPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n StyleColorbarsPanel,\n StyleUpdateMenusPanel,\n GraphSubplotsPanel,\n};\n"]} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 000000000..fb8742dc8 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,123 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PlotlyPanelContext = exports.PlotlyFoldContext = exports.ModalProviderContext = exports.PanelMenuWrapperContext = exports.EditorControlsContext = exports.RectanglePositioner = exports.DefaultEditor = exports.EditorControls = exports.walkObject = exports.localizeString = exports.localize = exports.dereference = exports.connectTraceToPlot = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.TraceSelector = exports.TraceRequiredPanel = exports.TraceMarkerSection = exports.TraceAccordion = exports.TextEditor = exports.SymbolSelector = exports.StyleTracesPanel = exports.StyleImagesPanel = exports.StyleShapesPanel = exports.StyleNotesPanel = exports.StyleLegendPanel = exports.StyleLayoutPanel = exports.StyleColorbarsPanel = exports.StyleAxesPanel = exports.GraphTransformsPanel = exports.SingleSidebarItem = exports.Section = exports.PlotlySection = exports.Radio = exports.PanelMenuWrapper = exports.PanelEmpty = exports.Panel = exports.PlotlyPanel = exports.Text = exports.AxisRangeValue = exports.Numeric = exports.LineShapeSelector = exports.LineDashSelector = exports.LayoutSection = exports.LayoutPanel = exports.NumericFractionInverse = exports.PositioningNumeric = exports.NumericFraction = exports.Info = exports.GraphCreatePanel = exports.FontSelector = exports.Fold = exports.PlotlyFold = exports.Flaglist = exports.RangesliderVisible = exports.EDITOR_ACTIONS = exports.Dropzone = exports.Dropdown = exports.DataSelector = exports.ErrorBars = exports.ContourNumeric = exports.PieColorscalePicker = exports.ColorscalePicker = exports.ColorwayPicker = exports.PanelMessage = exports.ColorPicker = exports.Button = exports.AxesSelector = exports.DTicks = exports.NTicks = exports.AxesRange = exports.AxesFold = exports.TransformAccordion = exports.ArrowSelector = exports.PositioningRef = exports.AnnotationRef = exports.AnnotationArrowRef = exports.RangeSelectorAccordion = exports.ImageAccordion = exports.ShapeAccordion = exports.AnnotationAccordion = undefined; + +var _PlotlyEditor = require('./PlotlyEditor'); + +var _PlotlyEditor2 = _interopRequireDefault(_PlotlyEditor); + +var _DefaultEditor = require('./DefaultEditor'); + +var _DefaultEditor2 = _interopRequireDefault(_DefaultEditor); + +var _EditorControls = require('./EditorControls'); + +var _EditorControls2 = _interopRequireDefault(_EditorControls); + +var _lib = require('./lib'); + +var _constants = require('./lib/constants'); + +var _context = require('./context'); + +var _components = require('./components'); + +var _default_panels = require('./default_panels'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.AnnotationAccordion = _components.AnnotationAccordion; +exports.ShapeAccordion = _components.ShapeAccordion; +exports.ImageAccordion = _components.ImageAccordion; +exports.RangeSelectorAccordion = _components.RangeSelectorAccordion; +exports.AnnotationArrowRef = _components.AnnotationArrowRef; +exports.AnnotationRef = _components.AnnotationRef; +exports.PositioningRef = _components.PositioningRef; +exports.ArrowSelector = _components.ArrowSelector; +exports.TransformAccordion = _components.TransformAccordion; +exports.AxesFold = _components.AxesFold; +exports.AxesRange = _components.AxesRange; +exports.NTicks = _components.NTicks; +exports.DTicks = _components.DTicks; +exports.AxesSelector = _components.AxesSelector; +exports.Button = _components.Button; +exports.ColorPicker = _components.ColorPicker; +exports.PanelMessage = _components.PanelMessage; +exports.ColorwayPicker = _components.ColorwayPicker; +exports.ColorscalePicker = _components.ColorscalePicker; +exports.PieColorscalePicker = _components.PieColorscalePicker; +exports.ContourNumeric = _components.ContourNumeric; +exports.ErrorBars = _components.ErrorBars; +exports.DataSelector = _components.DataSelector; +exports.Dropdown = _components.Dropdown; +exports.Dropzone = _components.Dropzone; +exports.EDITOR_ACTIONS = _constants.EDITOR_ACTIONS; +exports.RangesliderVisible = _components.RangesliderVisible; +exports.Flaglist = _components.Flaglist; +exports.PlotlyFold = _components.PlotlyFold; +exports.Fold = _components.Fold; +exports.FontSelector = _components.FontSelector; +exports.GraphCreatePanel = _default_panels.GraphCreatePanel; +exports.Info = _components.Info; +exports.NumericFraction = _components.NumericFraction; +exports.PositioningNumeric = _components.PositioningNumeric; +exports.NumericFractionInverse = _components.NumericFractionInverse; +exports.LayoutPanel = _components.LayoutPanel; +exports.LayoutSection = _components.LayoutSection; +exports.LineDashSelector = _components.LineDashSelector; +exports.LineShapeSelector = _components.LineShapeSelector; +exports.Numeric = _components.Numeric; +exports.AxisRangeValue = _components.AxisRangeValue; +exports.Text = _components.Text; +exports.PlotlyPanel = _components.PlotlyPanel; +exports.Panel = _components.Panel; +exports.PanelEmpty = _components.PanelEmpty; +exports.PanelMenuWrapper = _components.PanelMenuWrapper; +exports.Radio = _components.Radio; +exports.PlotlySection = _components.PlotlySection; +exports.Section = _components.Section; +exports.SingleSidebarItem = _components.SingleSidebarItem; +exports.GraphTransformsPanel = _default_panels.GraphTransformsPanel; +exports.StyleAxesPanel = _default_panels.StyleAxesPanel; +exports.StyleColorbarsPanel = _default_panels.StyleColorbarsPanel; +exports.StyleLayoutPanel = _default_panels.StyleLayoutPanel; +exports.StyleLegendPanel = _default_panels.StyleLegendPanel; +exports.StyleNotesPanel = _default_panels.StyleNotesPanel; +exports.StyleShapesPanel = _default_panels.StyleShapesPanel; +exports.StyleImagesPanel = _default_panels.StyleImagesPanel; +exports.StyleTracesPanel = _default_panels.StyleTracesPanel; +exports.SymbolSelector = _components.SymbolSelector; +exports.TextEditor = _components.TextEditor; +exports.TraceAccordion = _components.TraceAccordion; +exports.TraceMarkerSection = _components.TraceMarkerSection; +exports.TraceRequiredPanel = _components.TraceRequiredPanel; +exports.TraceSelector = _components.TraceSelector; +exports.connectCartesianSubplotToLayout = _lib.connectCartesianSubplotToLayout; +exports.connectNonCartesianSubplotToLayout = _lib.connectNonCartesianSubplotToLayout; +exports.connectAnnotationToLayout = _lib.connectAnnotationToLayout; +exports.connectShapeToLayout = _lib.connectShapeToLayout; +exports.connectImageToLayout = _lib.connectImageToLayout; +exports.connectAxesToLayout = _lib.connectAxesToLayout; +exports.connectTransformToTrace = _lib.connectTransformToTrace; +exports.connectAggregationToTransform = _lib.connectAggregationToTransform; +exports.connectLayoutToPlot = _lib.connectLayoutToPlot; +exports.connectToContainer = _lib.connectToContainer; +exports.connectRangeSelectorToAxis = _lib.connectRangeSelectorToAxis; +exports.connectTraceToPlot = _lib.connectTraceToPlot; +exports.dereference = _lib.dereference; +exports.localize = _lib.localize; +exports.localizeString = _lib.localizeString; +exports.walkObject = _lib.walkObject; +exports.EditorControls = _EditorControls2.default; +exports.DefaultEditor = _DefaultEditor2.default; +exports.RectanglePositioner = _components.RectanglePositioner; +exports.EditorControlsContext = _context.EditorControlsContext; +exports.PanelMenuWrapperContext = _context.PanelMenuWrapperContext; +exports.ModalProviderContext = _context.ModalProviderContext; +exports.PlotlyFoldContext = _context.PlotlyFoldContext; +exports.PlotlyPanelContext = _context.PlotlyPanelContext; +exports.default = _PlotlyEditor2.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map new file mode 100644 index 000000000..c73c80cb7 --- /dev/null +++ b/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.js"],"names":["AnnotationAccordion","ShapeAccordion","ImageAccordion","RangeSelectorAccordion","AnnotationArrowRef","AnnotationRef","PositioningRef","ArrowSelector","TransformAccordion","AxesFold","AxesRange","NTicks","DTicks","AxesSelector","Button","ColorPicker","PanelMessage","ColorwayPicker","ColorscalePicker","PieColorscalePicker","ContourNumeric","ErrorBars","DataSelector","Dropdown","Dropzone","EDITOR_ACTIONS","RangesliderVisible","Flaglist","PlotlyFold","Fold","FontSelector","GraphCreatePanel","Info","NumericFraction","PositioningNumeric","NumericFractionInverse","LayoutPanel","LayoutSection","LineDashSelector","LineShapeSelector","Numeric","AxisRangeValue","Text","PlotlyPanel","Panel","PanelEmpty","PanelMenuWrapper","Radio","PlotlySection","Section","SingleSidebarItem","GraphTransformsPanel","StyleAxesPanel","StyleColorbarsPanel","StyleLayoutPanel","StyleLegendPanel","StyleNotesPanel","StyleShapesPanel","StyleImagesPanel","StyleTracesPanel","SymbolSelector","TextEditor","TraceAccordion","TraceMarkerSection","TraceRequiredPanel","TraceSelector","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectImageToLayout","connectAxesToLayout","connectTransformToTrace","connectAggregationToTransform","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTraceToPlot","dereference","localize","localizeString","walkObject","EditorControls","DefaultEditor","RectanglePositioner","EditorControlsContext","PanelMenuWrapperContext","ModalProviderContext","PlotlyFoldContext","PlotlyPanelContext","PlotlyEditor"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AAkBA;;AACA;;AAQA;;AA2DA;;;;QAcEA,mB,GAAAA,+B;QACAC,c,GAAAA,0B;QACAC,c,GAAAA,0B;QACAC,sB,GAAAA,kC;QACAC,kB,GAAAA,8B;QACAC,a,GAAAA,yB;QACAC,c,GAAAA,0B;QACAC,a,GAAAA,yB;QACAC,kB,GAAAA,8B;QACAC,Q,GAAAA,oB;QACAC,S,GAAAA,qB;QACAC,M,GAAAA,kB;QACAC,M,GAAAA,kB;QACAC,Y,GAAAA,wB;QACAC,M,GAAAA,kB;QACAC,W,GAAAA,uB;QACAC,Y,GAAAA,wB;QACAC,c,GAAAA,0B;QACAC,gB,GAAAA,4B;QACAC,mB,GAAAA,+B;QACAC,c,GAAAA,0B;QACAC,S,GAAAA,qB;QACAC,Y,GAAAA,wB;QACAC,Q,GAAAA,oB;QACAC,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uB,GAAAA,gC;QACAC,oB,GAAAA,6B;QACAC,iB,GAAAA,0B;QACAC,kB,GAAAA,2B;kBAGaC,sB","file":"index.js","sourcesContent":["import PlotlyEditor from './PlotlyEditor';\nimport DefaultEditor from './DefaultEditor';\nimport EditorControls from './EditorControls';\nimport {\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectAggregationToTransform,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectLayoutToPlot,\n connectToContainer,\n connectTraceToPlot,\n connectRangeSelectorToAxis,\n dereference,\n localize,\n localizeString,\n walkObject,\n} from './lib';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport {\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n} from './context';\n\nimport {\n AnnotationAccordion,\n ShapeAccordion,\n RangeSelectorAccordion,\n ImageAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n AxesFold,\n AxesRange,\n TransformAccordion,\n NTicks,\n DTicks,\n AxesSelector,\n PanelMessage,\n Button,\n ColorPicker,\n ColorwayPicker,\n PieColorscalePicker,\n ColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n SymbolSelector,\n TextEditor,\n RangesliderVisible,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n RectanglePositioner,\n} from './components';\n\nimport {\n GraphCreatePanel,\n StyleAxesPanel,\n GraphTransformsPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n} from './default_panels';\n\nexport {\n AnnotationAccordion,\n ShapeAccordion,\n ImageAccordion,\n RangeSelectorAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n TransformAccordion,\n AxesFold,\n AxesRange,\n NTicks,\n DTicks,\n AxesSelector,\n Button,\n ColorPicker,\n PanelMessage,\n ColorwayPicker,\n ColorscalePicker,\n PieColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n EDITOR_ACTIONS,\n RangesliderVisible,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n GraphCreatePanel,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n GraphTransformsPanel,\n StyleAxesPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n SymbolSelector,\n TextEditor,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTraceToPlot,\n dereference,\n localize,\n localizeString,\n walkObject,\n EditorControls,\n DefaultEditor,\n RectanglePositioner,\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file diff --git a/lib/lib/bem.js b/lib/lib/bem.js new file mode 100644 index 000000000..5d62c61ec --- /dev/null +++ b/lib/lib/bem.js @@ -0,0 +1,53 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = bem; + +var _constants = require('./constants'); + +function bem(block, element, modifiers) { + var i = void 0, + modifier = void 0; + var out = []; + + if (!block) { + return _constants.baseClass; + } + if (Array.isArray(block)) { + throw new Error('bem error: Argument `block` cannot be an array'); + } else if (Array.isArray(element)) { + modifiers = element; + element = null; + } + + var className = block; + + if (element && element.length) { + className += '__' + element; + } + + out.push(className); + if (modifiers) { + for (i = 0; i < modifiers.length; i++) { + modifier = modifiers[i]; + if (modifier && modifier.length) { + out.push(className + '--' + modifier); + } + } + } + + return out.join(' '); +} // +// BEM helper +// +// bem() => 'plotly-editor' +// bem('foo') => 'foo' +// bem('foo', 'bar') => 'foo__bar' +// bem('foo', ['mod']) => 'foo foo--mod' +// bem('foo', 'bar', ['mod']) => 'foo__bar foo__bar--mod' +// bem('foo', ['mod1', mod2']) => 'foo foo--mod1 foo--mod2' + +/* eslint-disable no-param-reassign */ +//# sourceMappingURL=bem.js.map \ No newline at end of file diff --git a/lib/lib/bem.js.map b/lib/lib/bem.js.map new file mode 100644 index 000000000..b21f59877 --- /dev/null +++ b/lib/lib/bem.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/bem.js"],"names":["bem","block","element","modifiers","i","modifier","out","baseClass","Array","isArray","Error","className","length","push","join"],"mappings":";;;;;kBAawBA,G;;AAFxB;;AAEe,SAASA,GAAT,CAAaC,KAAb,EAAoBC,OAApB,EAA6BC,SAA7B,EAAwC;AACrD,MAAIC,UAAJ;AAAA,MAAOC,iBAAP;AACA,MAAMC,MAAM,EAAZ;;AAEA,MAAI,CAACL,KAAL,EAAY;AACV,WAAOM,oBAAP;AACD;AACD,MAAIC,MAAMC,OAAN,CAAcR,KAAd,CAAJ,EAA0B;AACxB,UAAM,IAAIS,KAAJ,CAAU,gDAAV,CAAN;AACD,GAFD,MAEO,IAAIF,MAAMC,OAAN,CAAcP,OAAd,CAAJ,EAA4B;AACjCC,gBAAYD,OAAZ;AACAA,cAAU,IAAV;AACD;;AAED,MAAIS,YAAYV,KAAhB;;AAEA,MAAIC,WAAWA,QAAQU,MAAvB,EAA+B;AAC7BD,iBAAa,OAAOT,OAApB;AACD;;AAEDI,MAAIO,IAAJ,CAASF,SAAT;AACA,MAAIR,SAAJ,EAAe;AACb,SAAKC,IAAI,CAAT,EAAYA,IAAID,UAAUS,MAA1B,EAAkCR,GAAlC,EAAuC;AACrCC,iBAAWF,UAAUC,CAAV,CAAX;AACA,UAAIC,YAAYA,SAASO,MAAzB,EAAiC;AAC/BN,YAAIO,IAAJ,CAASF,YAAY,IAAZ,GAAmBN,QAA5B;AACD;AACF;AACF;;AAED,SAAOC,IAAIQ,IAAJ,CAAS,GAAT,CAAP;AACD,C,CA5CD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA","file":"bem.js","sourcesContent":["//\n// BEM helper\n//\n// bem() => 'plotly-editor'\n// bem('foo') => 'foo'\n// bem('foo', 'bar') => 'foo__bar'\n// bem('foo', ['mod']) => 'foo foo--mod'\n// bem('foo', 'bar', ['mod']) => 'foo__bar foo__bar--mod'\n// bem('foo', ['mod1', mod2']) => 'foo foo--mod1 foo--mod2'\n\n/* eslint-disable no-param-reassign */\nimport {baseClass} from './constants';\n\nexport default function bem(block, element, modifiers) {\n let i, modifier;\n const out = [];\n\n if (!block) {\n return baseClass;\n }\n if (Array.isArray(block)) {\n throw new Error('bem error: Argument `block` cannot be an array');\n } else if (Array.isArray(element)) {\n modifiers = element;\n element = null;\n }\n\n let className = block;\n\n if (element && element.length) {\n className += '__' + element;\n }\n\n out.push(className);\n if (modifiers) {\n for (i = 0; i < modifiers.length; i++) {\n modifier = modifiers[i];\n if (modifier && modifier.length) {\n out.push(className + '--' + modifier);\n }\n }\n }\n\n return out.join(' ');\n}\n"]} \ No newline at end of file diff --git a/lib/lib/computeTraceOptionsFromSchema.js b/lib/lib/computeTraceOptionsFromSchema.js new file mode 100644 index 000000000..4f0543c78 --- /dev/null +++ b/lib/lib/computeTraceOptionsFromSchema.js @@ -0,0 +1,137 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +function computeTraceOptionsFromSchema(schema, _, context) { + // Filter out Polar "area" type as it is fairly broken and we want to present + // scatter with fill as an "area" chart type for convenience. + var traceTypes = Object.keys(schema.traces).filter(function (t) { + return !['area', 'scattermapbox'].includes(t); + }); + + var traceOptions = [{ + value: 'scatter', + label: _('Scatter') + }, { + value: 'box', + label: _('Box') + }, { + value: 'bar', + label: _('Bar') + }, { + value: 'heatmap', + label: _('Heatmap') + }, { + value: 'histogram', + label: _('Histogram') + }, { + value: 'histogram2d', + label: _('2D Histogram') + }, { + value: 'histogram2dcontour', + label: _('2D Contour Histogram') + }, { + value: 'pie', + label: _('Pie') + }, { + value: 'contour', + label: _('Contour') + }, { + value: 'scatterternary', + label: _('Ternary Scatter') + }, { + value: 'violin', + label: _('Violin') + }, { + value: 'scatter3d', + label: _('3D Scatter') + }, { + value: 'surface', + label: _('Surface') + }, { + value: 'mesh3d', + label: _('3D Mesh') + }, { + value: 'cone', + label: _('Cone') + }, { + value: 'streamtube', + label: _('Streamtube') + }, { + value: 'scattergeo', + label: _('Atlas Map') + }, { + value: 'choropleth', + label: _('Choropleth') + }, { + value: 'scattergl', + label: _('Scatter GL') + }, { + value: 'pointcloud', + label: _('Point Cloud') + }, { + value: 'heatmapgl', + label: _('Heatmap GL') + }, { + value: 'parcoords', + label: _('Parallel Coordinates') + }, { + value: 'sankey', + label: _('Sankey') + }, { + value: 'table', + label: _('Table') + }, { + value: 'carpet', + label: _('Carpet') + }, { + value: 'scattercarpet', + label: _('Carpet Scatter') + }, { + value: 'contourcarpet', + label: _('Carpet Contour') + }, { + value: 'ohlc', + label: _('OHLC') + }, { + value: 'candlestick', + label: _('Candlestick') + }, { + value: 'scatterpolar', + label: _('Polar Scatter') + }, { + value: 'scatterpolargl', + label: _('Polar Scatter GL') + }, { + value: 'barpolar', + label: _('Polar Bar') + }].filter(function (obj) { + return traceTypes.indexOf(obj.value) !== -1; + }); + + var traceIndex = function traceIndex(traceType) { + return traceOptions.findIndex(function (opt) { + return opt.value === traceType; + }); + }; + + traceOptions.splice(traceIndex('scatter') + 1, 0, { label: _('Line'), value: 'line' }, { label: _('Area'), value: 'area' }, { label: _('Timeseries'), value: 'timeseries' }); + + traceOptions.splice(traceIndex('scatter3d') + 1, 0, { + label: _('3D Line'), + value: 'line3d' + }); + + if (context.config && context.config.mapboxAccessToken) { + traceOptions.push({ + value: 'scattermapbox', + label: _('Satellite Map') + }); + } + + return traceOptions; +} + +exports.computeTraceOptionsFromSchema = computeTraceOptionsFromSchema; +//# sourceMappingURL=computeTraceOptionsFromSchema.js.map \ No newline at end of file diff --git a/lib/lib/computeTraceOptionsFromSchema.js.map b/lib/lib/computeTraceOptionsFromSchema.js.map new file mode 100644 index 000000000..a09fc7ba9 --- /dev/null +++ b/lib/lib/computeTraceOptionsFromSchema.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/computeTraceOptionsFromSchema.js"],"names":["computeTraceOptionsFromSchema","schema","_","context","traceTypes","Object","keys","traces","filter","includes","t","traceOptions","value","label","indexOf","obj","traceIndex","findIndex","opt","traceType","splice","config","mapboxAccessToken","push"],"mappings":";;;;;AAAA,SAASA,6BAAT,CAAuCC,MAAvC,EAA+CC,CAA/C,EAAkDC,OAAlD,EAA2D;AACzD;AACA;AACA,MAAMC,aAAaC,OAAOC,IAAP,CAAYL,OAAOM,MAAnB,EAA2BC,MAA3B,CAAkC;AAAA,WAAK,CAAC,CAAC,MAAD,EAAS,eAAT,EAA0BC,QAA1B,CAAmCC,CAAnC,CAAN;AAAA,GAAlC,CAAnB;;AAEA,MAAMC,eAAe,CACnB;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U,OAAO,MAA1B,EAHF,EAIE,EAACC,OAAOX,EAAE,MAAF,CAAR,EAAmBU,OAAO,MAA1B,EAJF,EAKE,EAACC,OAAOX,EAAE,YAAF,CAAR,EAAyBU,OAAO,YAAhC,EALF;;AAQAD,eAAaS,MAAb,CAAoBJ,WAAW,WAAX,IAA0B,CAA9C,EAAiD,CAAjD,EAAoD;AAClDH,WAAOX,EAAE,SAAF,CAD2C;AAElDU,WAAO;AAF2C,GAApD;;AAKA,MAAIT,QAAQkB,MAAR,IAAkBlB,QAAQkB,MAAR,CAAeC,iBAArC,EAAwD;AACtDX,iBAAaY,IAAb,CAAkB;AAChBX,aAAO,eADS;AAEhBC,aAAOX,EAAE,eAAF;AAFS,KAAlB;AAID;;AAED,SAAOS,YAAP;AACD;;QAEOX,6B,GAAAA,6B","file":"computeTraceOptionsFromSchema.js","sourcesContent":["function computeTraceOptionsFromSchema(schema, _, context) {\n // Filter out Polar \"area\" type as it is fairly broken and we want to present\n // scatter with fill as an \"area\" chart type for convenience.\n const traceTypes = Object.keys(schema.traces).filter(t => !['area', 'scattermapbox'].includes(t));\n\n const traceOptions = [\n {\n value: 'scatter',\n label: _('Scatter'),\n },\n {\n value: 'box',\n label: _('Box'),\n },\n {\n value: 'bar',\n label: _('Bar'),\n },\n {\n value: 'heatmap',\n label: _('Heatmap'),\n },\n {\n value: 'histogram',\n label: _('Histogram'),\n },\n {\n value: 'histogram2d',\n label: _('2D Histogram'),\n },\n {\n value: 'histogram2dcontour',\n label: _('2D Contour Histogram'),\n },\n {\n value: 'pie',\n label: _('Pie'),\n },\n {\n value: 'contour',\n label: _('Contour'),\n },\n {\n value: 'scatterternary',\n label: _('Ternary Scatter'),\n },\n {\n value: 'violin',\n label: _('Violin'),\n },\n {\n value: 'scatter3d',\n label: _('3D Scatter'),\n },\n {\n value: 'surface',\n label: _('Surface'),\n },\n {\n value: 'mesh3d',\n label: _('3D Mesh'),\n },\n {\n value: 'cone',\n label: _('Cone'),\n },\n {\n value: 'streamtube',\n label: _('Streamtube'),\n },\n {\n value: 'scattergeo',\n label: _('Atlas Map'),\n },\n {\n value: 'choropleth',\n label: _('Choropleth'),\n },\n {\n value: 'scattergl',\n label: _('Scatter GL'),\n },\n {\n value: 'pointcloud',\n label: _('Point Cloud'),\n },\n {\n value: 'heatmapgl',\n label: _('Heatmap GL'),\n },\n {\n value: 'parcoords',\n label: _('Parallel Coordinates'),\n },\n {\n value: 'sankey',\n label: _('Sankey'),\n },\n {\n value: 'table',\n label: _('Table'),\n },\n {\n value: 'carpet',\n label: _('Carpet'),\n },\n {\n value: 'scattercarpet',\n label: _('Carpet Scatter'),\n },\n {\n value: 'contourcarpet',\n label: _('Carpet Contour'),\n },\n {\n value: 'ohlc',\n label: _('OHLC'),\n },\n {\n value: 'candlestick',\n label: _('Candlestick'),\n },\n {\n value: 'scatterpolar',\n label: _('Polar Scatter'),\n },\n {\n value: 'scatterpolargl',\n label: _('Polar Scatter GL'),\n },\n {\n value: 'barpolar',\n label: _('Polar Bar'),\n },\n ].filter(obj => traceTypes.indexOf(obj.value) !== -1);\n\n const traceIndex = traceType => traceOptions.findIndex(opt => opt.value === traceType);\n\n traceOptions.splice(\n traceIndex('scatter') + 1,\n 0,\n {label: _('Line'), value: 'line'},\n {label: _('Area'), value: 'area'},\n {label: _('Timeseries'), value: 'timeseries'}\n );\n\n traceOptions.splice(traceIndex('scatter3d') + 1, 0, {\n label: _('3D Line'),\n value: 'line3d',\n });\n\n if (context.config && context.config.mapboxAccessToken) {\n traceOptions.push({\n value: 'scattermapbox',\n label: _('Satellite Map'),\n });\n }\n\n return traceOptions;\n}\n\nexport {computeTraceOptionsFromSchema};\n"]} \ No newline at end of file diff --git a/lib/lib/connectAggregationToTransform.js b/lib/lib/connectAggregationToTransform.js new file mode 100644 index 000000000..c785d4390 --- /dev/null +++ b/lib/lib/connectAggregationToTransform.js @@ -0,0 +1,140 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectAggregationToTransform; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectAggregationToTransform(WrappedComponent) { + var AggregationConnectedComponent = function (_Component) { + _inherits(AggregationConnectedComponent, _Component); + + function AggregationConnectedComponent(props, context) { + _classCallCheck(this, AggregationConnectedComponent); + + var _this = _possibleConstructorReturn(this, (AggregationConnectedComponent.__proto__ || Object.getPrototypeOf(AggregationConnectedComponent)).call(this, props, context)); + + _this.updateAggregation = _this.updateAggregation.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(AggregationConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var aggregationIndex = props.aggregationIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var aggregations = container && container.aggregations || []; + var fullAggregations = fullContainer.aggregations || []; + this.container = aggregations[aggregationIndex]; + this.fullContainer = fullAggregations[aggregationIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('aggregations[].' + attr); + }, + updateContainer: this.updateAggregation, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('aggregations[].' + attr); + }, + updateContainer: this.updateAggregation, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateAggregation', + value: function updateAggregation(update) { + var newUpdate = {}; + var path = 'aggregations[' + this.props.aggregationIndex + ']'; + for (var key in update) { + newUpdate[path + '.' + key] = update[key]; + } + newUpdate[path + '.target'] = this.fullContainer.target; + newUpdate[path + '.enabled'] = true; + this.context.updateContainer(newUpdate); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return AggregationConnectedComponent; + }(_react.Component); + + AggregationConnectedComponent.displayName = 'AggregationConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + AggregationConnectedComponent.propTypes = { + aggregationIndex: _propTypes2.default.number.isRequired + }; + + AggregationConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + AggregationConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return AggregationConnectedComponent; +} +//# sourceMappingURL=connectAggregationToTransform.js.map \ No newline at end of file diff --git a/lib/lib/connectAggregationToTransform.js.map b/lib/lib/connectAggregationToTransform.js.map new file mode 100644 index 000000000..16f4b4090 --- /dev/null +++ b/lib/lib/connectAggregationToTransform.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectAggregationToTransform.js"],"names":["connectAggregationToTransform","WrappedComponent","AggregationConnectedComponent","props","context","updateAggregation","bind","setLocals","nextProps","nextContext","aggregationIndex","container","fullContainer","aggregations","fullAggregations","getValObject","attr","updateContainer","update","newUpdate","path","key","target","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","onUpdate","func","childContextTypes","deleteContainer","plotly_editor_traits"],"mappings":";;;;;;;;kBAIwBA,6B;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,6BAAT,CAAuCC,gBAAvC,EAAyD;AAAA,MAChEC,6BADgE;AAAA;;AAEpE,2CAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gKACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBC,IAAvB,OAAzB;AACA,YAAKC,SAAL,CAAeJ,KAAf,EAAsBC,OAAtB;AAJ0B;AAK3B;;AAPmE;AAAA;AAAA,gDAS1CI,SAT0C,EAS/BC,WAT+B,EASlB;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAXmE;AAAA;AAAA,gCAa1DN,KAb0D,EAanDC,OAbmD,EAa1C;AAAA,YACjBM,gBADiB,GACGP,KADH,CACjBO,gBADiB;AAAA,YAEjBC,SAFiB,GAEWP,OAFX,CAEjBO,SAFiB;AAAA,YAENC,aAFM,GAEWR,OAFX,CAENQ,aAFM;;;AAIxB,YAAMC,eAAgBF,aAAaA,UAAUE,YAAxB,IAAyC,EAA9D;AACA,YAAMC,mBAAmBF,cAAcC,YA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A8BsB,WAA9B,4BAAmE,yBACjEvB,gBADiE,CAAnE;;AAIAC,gCAA8BuB,SAA9B,GAA0C;AACxCf,sBAAkBgB,oBAAUC,MAAV,CAAiBC;AADK,GAA1C;;AAIA1B,gCAA8B2B,YAA9B,GAA6C;AAC3ClB,eAAWe,oBAAUI,MADsB;AAE3ClB,mBAAec,oBAAUI,MAFkB;AAG3CC,UAAML,oBAAUM,KAH2B;AAI3CC,cAAUP,oBAAUQ,IAJuB;AAK3CjB,qBAAiBS,oBAAUQ,IALgB;AAM3CnB,kBAAcW,oBAAUQ;AANmB,GAA7C;;AASAhC,gCAA8BiC,iBAA9B,GAAkD;AAChDlB,qBAAiBS,oBAAUQ,IADqB;AAEhDE,qBAAiBV,oBAAUQ,IAFqB;AAGhDvB,eAAWe,oBAAUI,MAH2B;AAIhDlB,mBAAec,oBAAUI,MAJuB;AAKhDf,kBAAcW,oBAAUQ;AALwB,GAAlD;;AA5EsE,MAoF/DG,oBApF+D,GAoFvCpC,gBApFuC,CAoF/DoC,oBApF+D;;AAqFtEnC,gCAA8BmC,oBAA9B,GAAqDA,oBAArD;;AAEA,SAAOnC,6BAAP;AACD","file":"connectAggregationToTransform.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\n\nexport default function connectAggregationToTransform(WrappedComponent) {\n class AggregationConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.updateAggregation = this.updateAggregation.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {aggregationIndex} = props;\n const {container, fullContainer} = context;\n\n const aggregations = (container && container.aggregations) || [];\n const fullAggregations = fullContainer.aggregations || [];\n this.container = aggregations[aggregationIndex];\n this.fullContainer = fullAggregations[aggregationIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`aggregations[].${attr}`),\n updateContainer: this.updateAggregation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`aggregations[].${attr}`),\n updateContainer: this.updateAggregation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateAggregation(update) {\n const newUpdate = {};\n const path = `aggregations[${this.props.aggregationIndex}]`;\n for (const key in update) {\n newUpdate[`${path}.${key}`] = update[key];\n }\n newUpdate[`${path}.target`] = this.fullContainer.target;\n newUpdate[`${path}.enabled`] = true;\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n AggregationConnectedComponent.displayName = `AggregationConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n AggregationConnectedComponent.propTypes = {\n aggregationIndex: PropTypes.number.isRequired,\n };\n\n AggregationConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n AggregationConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return AggregationConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectAnnotationToLayout.js b/lib/lib/connectAnnotationToLayout.js new file mode 100644 index 000000000..85a2dffbe --- /dev/null +++ b/lib/lib/connectAnnotationToLayout.js @@ -0,0 +1,155 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectAnnotationToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectAnnotationToLayout(WrappedComponent) { + var AnnotationConnectedComponent = function (_Component) { + _inherits(AnnotationConnectedComponent, _Component); + + function AnnotationConnectedComponent(props, context) { + _classCallCheck(this, AnnotationConnectedComponent); + + var _this = _possibleConstructorReturn(this, (AnnotationConnectedComponent.__proto__ || Object.getPrototypeOf(AnnotationConnectedComponent)).call(this, props, context)); + + _this.deleteAnnotation = _this.deleteAnnotation.bind(_this); + _this.updateAnnotation = _this.updateAnnotation.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(AnnotationConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var annotationIndex = props.annotationIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var annotations = container.annotations || []; + var fullAnnotations = fullContainer.annotations || []; + this.container = annotations[annotationIndex]; + this.fullContainer = fullAnnotations[annotationIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('annotations[].' + attr); + }, + updateContainer: this.updateAnnotation, + deleteContainer: this.deleteAnnotation, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('annotations[].' + attr); + }, + updateContainer: this.updateAnnotation, + deleteContainer: this.deleteAnnotation, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateAnnotation', + value: function updateAnnotation(update) { + var newUpdate = {}; + var annotationIndex = this.props.annotationIndex; + + for (var key in update) { + var newkey = 'annotations[' + annotationIndex + '].' + key; + newUpdate[newkey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'deleteAnnotation', + value: function deleteAnnotation() { + if (this.context.onUpdate) { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.DELETE_ANNOTATION, + payload: { annotationIndex: this.props.annotationIndex } + }); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return AnnotationConnectedComponent; + }(_react.Component); + + AnnotationConnectedComponent.displayName = 'AnnotationConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + AnnotationConnectedComponent.propTypes = { + annotationIndex: _propTypes2.default.number.isRequired + }; + + AnnotationConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + AnnotationConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + AnnotationConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return AnnotationConnectedComponent; +} +//# sourceMappingURL=connectAnnotationToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectAnnotationToLayout.js.map b/lib/lib/connectAnnotationToLayout.js.map new file mode 100644 index 000000000..14d377d05 --- /dev/null +++ b/lib/lib/connectAnnotationToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectAnnotationToLayout.js"],"names":["connectAnnotationToLayout","WrappedComponent","AnnotationConnectedComponent","props","context","deleteAnnotation","bind","updateAnnotation","setLocals","nextProps","nextContext","annotationIndex","container","fullContainer","annotations","fullAnnotations","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_ANNOTATION","payload","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,yB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,yBAAT,CAAmCC,gBAAnC,EAAqD;AAAA,MAC5DC,4BAD4D;AAAA;;AAEhE,0CAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,8JACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,gBAAL,GAAwB,MAAKA,gBAAL,CAAsBC,IAAtB,OAAxB;AACA,YAAKC,gBAAL,GAAwB,MAAKA,gBAAL,CAAsBD,IAAtB,OAAxB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR+D;AAAA;AAAA,gDAUtCK,SAVsC,EAU3BC,WAV2B,EAUd;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZ+D;AAAA;AAAA,gCActDP,KAdsD,EAc/CC,OAd+C,EActC;AAAA,YACjBO,eADiB,GACER,KADF,CACj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,aAAKlB,OAAL,CAAac,eAAb,CAA6BG,SAA7B;AACD;AAtD+D;AAAA;AAAA,yCAwD7C;AACjB,YAAI,KAAKjB,OAAL,CAAaoB,QAAjB,EAA2B;AACzB,eAAKpB,OAAL,CAAaoB,QAAb,CAAsB;AACpBC,kBAAMC,0BAAeC,iBADD;AAEpBC,qBAAS,EAACjB,iBAAiB,KAAKR,KAAL,CAAWQ,eAA7B;AAFW,WAAtB;AAID;AACF;AA/D+D;AAAA;AAAA,+BAiEvD;AACP,eAAO,8BAAC,gBAAD,EAAsB,KAAKR,KAA3B,CAAP;AACD;AAnE+D;;AAAA;AAAA,IACvB0B,gBADuB;;AAsElE3B,+BAA6B4B,WAA7B,2BAAiE,yBAC/D7B,gBAD+D,CAAjE;;AAIAC,+BAA6B6B,SAA7B,GAAyC;AACvCpB,qBAAiBqB,oBAAUC,MAAV,CAAiBC;AADK,GAAzC;;AAIAhC,+BAA6BiC,YAA7B,GAA4C;AAC1CvB,eAAWoB,oBAAUI,MADqB;AAE1CvB,mBAAemB,oBAAUI,MAFiB;AAG1CC,UAAML,oBAAUM,KAH0B;AAI1Cd,cAAUQ,oBAAUO,IAJsB;AAK1CrB,qBAAiBc,oBAAUO,IALe;AAM1CvB,kBAAcgB,oBAAUO;AANkB,GAA5C;;AASArC,+BAA6BsC,iBAA7B,GAAiD;AAC/CtB,qBAAiBc,oBAAUO,IADoB;AAE/CpB,qBAAiBa,oBAAUO,IAFoB;AAG/C3B,eAAWoB,oBAAUI,MAH0B;AAI/CvB,mBAAemB,oBAAUI,MAJsB;AAK/CpB,kBAAcgB,oBAAUO;AALuB,GAAjD;;AAvFkE,MA+F3DE,oBA/F2D,GA+FnCxC,gBA/FmC,CA+F3DwC,oBA/F2D;;AAgGlEvC,+BAA6BuC,oBAA7B,GAAoDA,oBAApD;;AAEA,SAAOvC,4BAAP;AACD","file":"connectAnnotationToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectAnnotationToLayout(WrappedComponent) {\n class AnnotationConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteAnnotation = this.deleteAnnotation.bind(this);\n this.updateAnnotation = this.updateAnnotation.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {annotationIndex} = props;\n const {container, fullContainer} = context;\n\n const annotations = container.annotations || [];\n const fullAnnotations = fullContainer.annotations || [];\n this.container = annotations[annotationIndex];\n this.fullContainer = fullAnnotations[annotationIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`annotations[].${attr}`),\n updateContainer: this.updateAnnotation,\n deleteContainer: this.deleteAnnotation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`annotations[].${attr}`),\n updateContainer: this.updateAnnotation,\n deleteContainer: this.deleteAnnotation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateAnnotation(update) {\n const newUpdate = {};\n const {annotationIndex} = this.props;\n for (const key in update) {\n const newkey = `annotations[${annotationIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteAnnotation() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_ANNOTATION,\n payload: {annotationIndex: this.props.annotationIndex},\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n AnnotationConnectedComponent.displayName = `AnnotationConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n AnnotationConnectedComponent.propTypes = {\n annotationIndex: PropTypes.number.isRequired,\n };\n\n AnnotationConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n AnnotationConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n AnnotationConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return AnnotationConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectAxesToLayout.js b/lib/lib/connectAxesToLayout.js new file mode 100644 index 000000000..c3f61aee0 --- /dev/null +++ b/lib/lib/connectAxesToLayout.js @@ -0,0 +1,235 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectAxesToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _nested_property = require('plotly.js/src/lib/nested_property'); + +var _nested_property2 = _interopRequireDefault(_nested_property); + +var _multiValues = require('./multiValues'); + +var _lib = require('../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function computeAxesOptions(axes, props, context) { + var _ = context.localize; + var filteredAxes = axes; + if (props.axisFilter) { + filteredAxes = axes.filter(props.axisFilter); + } + + var options = []; + for (var i = 0; i < filteredAxes.length; i++) { + var ax = filteredAxes[i]; + var label = (0, _lib.capitalize)(ax._name.split('axis')[0]); + var value = (ax._subplot && !ax._subplot.includes('xaxis') && !ax._subplot.includes('yaxis') ? ax._subplot + '.' + ax._name : ax._subplot).trim(); + + options[i] = { + label: label, + value: value, + axisGroup: ax._axisGroup, + title: (0, _lib.getAxisTitle)(ax) + }; + } + + return options.length > 1 ? [{ label: _('All'), value: 'allaxes' }].concat(options) : options; +} + +function connectAxesToLayout(WrappedComponent) { + var AxesConnectedComponent = function (_Component) { + _inherits(AxesConnectedComponent, _Component); + + function AxesConnectedComponent(props, context) { + _classCallCheck(this, AxesConnectedComponent); + + var _this = _possibleConstructorReturn(this, (AxesConnectedComponent.__proto__ || Object.getPrototypeOf(AxesConnectedComponent)).call(this, props, context)); + + _this.axes = (0, _lib.getAllAxes)(context.fullContainer); + _this.axesOptions = computeAxesOptions(_this.axes, props, context); + + // this.axesOptions can be an empty array when we have a filter on an AxesFold + // and no axes correspond to the condition + var defaultAxesTarget = null; + if (_this.axesOptions.length === 1) { + defaultAxesTarget = _this.axesOptions[0].value; + } + if (_this.axesOptions.length > 1) { + defaultAxesTarget = _this.axesOptions[1].value; + } + + _this.state = { + axesTarget: defaultAxesTarget + }; + + _this.axesTargetHandler = _this.axesTargetHandler.bind(_this); + _this.updateContainer = _this.updateContainer.bind(_this); + + _this.setLocals(props, _this.state, context); + return _this; + } + + _createClass(AxesConnectedComponent, [{ + key: 'componentWillUpdate', + value: function componentWillUpdate(nextProps, nextState, nextContext) { + this.axes = (0, _lib.getAllAxes)(nextContext.fullContainer); + this.axesOptions = computeAxesOptions(this.axes, nextProps, nextContext); + // This is not enough, what if plotly.js adds new axes... + this.setLocals(nextProps, nextState, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(nextProps, nextState, nextContext) { + var container = nextContext.container, + fullContainer = nextContext.fullContainer; + var axesTarget = nextState.axesTarget; + + + if (axesTarget === 'allaxes') { + var multiValuedContainer = (0, _multiValues.deepCopyPublic)(this.axes[0]); + this.axes.slice(1).forEach(function (ax) { + return Object.keys(ax).forEach(function (key) { + return (0, _multiValues.setMultiValuedContainer)(multiValuedContainer, (0, _multiValues.deepCopyPublic)(ax), key, { + searchArrays: true + }); + }); + }); + this.fullContainer = multiValuedContainer; + this.defaultContainer = this.axes[0]; + this.container = {}; + } else if (axesTarget) { + this.fullContainer = (0, _nested_property2.default)(fullContainer, axesTarget).get(); + this.container = this.container = (0, _nested_property2.default)(container, axesTarget).get() || {}; + } + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject(_this2.state.axesTarget + '.' + attr); + }, + axesOptions: this.axesOptions, + axesTarget: this.state.axesTarget, + axesTargetHandler: this.axesTargetHandler, + container: this.container, + defaultContainer: this.defaultContainer, + fullContainer: this.fullContainer, + updateContainer: this.updateContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject(_this3.state.axesTarget + '.' + attr); + }, + axesOptions: this.axesOptions, + axesTarget: this.state.axesTarget, + axesTargetHandler: this.axesTargetHandler, + container: this.container, + defaultContainer: this.defaultContainer, + fullContainer: this.fullContainer, + updateContainer: this.updateContainer + }; + } + }, { + key: 'axesTargetHandler', + value: function axesTargetHandler(axesTarget) { + this.setState({ axesTarget: axesTarget }); + } + }, { + key: 'updateContainer', + value: function updateContainer(update) { + var newUpdate = {}; + var axesTarget = this.state.axesTarget; + + + var axes = this.axes; + if (axesTarget !== 'allaxes') { + // only the selected container + axes = [this.fullContainer]; + } + + var keys = Object.keys(update); + for (var i = 0; i < keys.length; i++) { + for (var j = 0; j < axes.length; j++) { + var subplot = axes[j]._subplot; + var axesKey = axes[j]._name; + + if (subplot && !subplot.includes('xaxis') && !subplot.includes('yaxis')) { + axesKey = subplot + '.' + axesKey; + } + + var newkey = axesKey + '.' + keys[i]; + newUpdate[newkey] = update[keys[i]]; + } + } + + this.context.updateContainer(newUpdate); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, _extends({}, this.props, { options: this.axesOptions })); + } + }]); + + return AxesConnectedComponent; + }(_react.Component); + + AxesConnectedComponent.displayName = 'AxesConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + AxesConnectedComponent.contextTypes = { + container: _propTypes2.default.object.isRequired, + fullContainer: _propTypes2.default.object.isRequired, + updateContainer: _propTypes2.default.func, + localize: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + AxesConnectedComponent.childContextTypes = { + axesOptions: _propTypes2.default.array, + axesTarget: _propTypes2.default.string, + axesTargetHandler: _propTypes2.default.func, + container: _propTypes2.default.object, + defaultContainer: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return AxesConnectedComponent; +} +//# sourceMappingURL=connectAxesToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectAxesToLayout.js.map b/lib/lib/connectAxesToLayout.js.map new file mode 100644 index 000000000..292278209 --- /dev/null +++ b/lib/lib/connectAxesToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectAxesToLayout.js"],"names":["connectAxesToLayout","computeAxesOptions","axes","props","context","_","localize","filteredAxes","axisFilter","filter","options","i","length","ax","label","_name","split","value","_subplot","includes","trim","axisGroup","_axisGroup","title","concat","WrappedComponent","AxesConnectedComponent","fullContainer","axesOptions","defaultAxesTarget","state","axesTarget","axesTargetHandler","bind","updateContainer","setLocals","nextProps","nextState","nextContext","container","multiValuedContainer","slice","forEach","Object","keys","key","searchArrays","defaultContainer","get","getValObject","attr","setState","update","newUpdate","j","subplot","axesKey","newkey","Component","displayName","contextTypes","PropTypes","object","isRequired","func","childContextTypes","array","string","plotly_editor_traits"],"mappings":";;;;;;;;;;kBAiCwBA,mB;;AAjCxB;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,SAASC,kBAAT,CAA4BC,IAA5B,EAAkCC,KAAlC,EAAyCC,OAAzC,EAAkD;AAChD,MAAMC,IAAID,QAAQE,QAAlB;AACA,MAAIC,eAAeL,IAAnB;AACA,MAAIC,MAAMK,UAAV,EAAsB;AACpBD,mBAAeL,KAAKO,MAAL,CAAYN,MAAMK,UAAlB,CAAf;AACD;;AAED,MAAME,UAAU,EAAhB;AACA,OAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIJ,aAAaK,MAAjC,EAAyCD,GAAzC,EAA8C;AAC5C,QAAME,KAAKN,aAAaI,CAAb,CAAX;AACA,QAAMG,QAAQ,qBAAWD,GAAGE,KAAH,CAASC,KAAT,CAAe,MAAf,EAAuB,CAAvB,CAAX,CAAd;AACA,QAAMC,QAAQ,CAACJ,GAAGK,QAAH,IAAe,CAACL,GAAGK,QAAH,CAAYC,QAAZ,CAAqB,OAArB,CAAhB,IAAiD,CAACN,GAAGK,QAAH,CAAYC,QAAZ,CAAqB,OAArB,CAAlD,GACXN,GAAGK,QAAH,GAAc,GAAd,GAAoBL,GAAGE,KADZ,GAEXF,GAAGK,QAFO,EAGZE,IAHY,EAAd;;AAKAV,YAAQC,CAAR,IAAa;AACXG,kBADW;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nC,uBAAmB6B,oBAAUG,IAHY;AAIzCzB,eAAWsB,oBAAUC,MAJoB;AAKzCf,sBAAkBc,oBAAUC,MALa;AAMzCnC,mBAAekC,oBAAUC,MANgB;AAOzC5B,qBAAiB2B,oBAAUG,IAPc;AAQzCf,kBAAcY,oBAAUG;AARiB,GAA3C;;AAxI4D,MAmJrDI,oBAnJqD,GAmJ7B3C,gBAnJ6B,CAmJrD2C,oBAnJqD;;AAoJ5D1C,yBAAuB0C,oBAAvB,GAA8CA,oBAA9C;;AAEA,SAAO1C,sBAAP;AACD","file":"connectAxesToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {deepCopyPublic, setMultiValuedContainer} from './multiValues';\nimport {capitalize, getAllAxes, getDisplayName, getAxisTitle} from '../lib';\n\nfunction computeAxesOptions(axes, props, context) {\n const _ = context.localize;\n let filteredAxes = axes;\n if (props.axisFilter) {\n filteredAxes = axes.filter(props.axisFilter);\n }\n\n const options = [];\n for (let i = 0; i < filteredAxes.length; i++) {\n const ax = filteredAxes[i];\n const label = capitalize(ax._name.split('axis')[0]);\n const value = (ax._subplot && !ax._subplot.includes('xaxis') && !ax._subplot.includes('yaxis')\n ? ax._subplot + '.' + ax._name\n : ax._subplot\n ).trim();\n\n options[i] = {\n label,\n value,\n axisGroup: ax._axisGroup,\n title: getAxisTitle(ax),\n };\n }\n\n return options.length > 1 ? [{label: _('All'), value: 'allaxes'}].concat(options) : options;\n}\n\nexport default function connectAxesToLayout(WrappedComponent) {\n class AxesConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.axes = getAllAxes(context.fullContainer);\n this.axesOptions = computeAxesOptions(this.axes, props, context);\n\n // this.axesOptions can be an empty array when we have a filter on an AxesFold\n // and no axes correspond to the condition\n let defaultAxesTarget = null;\n if (this.axesOptions.length === 1) {\n defaultAxesTarget = this.axesOptions[0].value;\n }\n if (this.axesOptions.length > 1) {\n defaultAxesTarget = this.axesOptions[1].value;\n }\n\n this.state = {\n axesTarget: defaultAxesTarget,\n };\n\n this.axesTargetHandler = this.axesTargetHandler.bind(this);\n this.updateContainer = this.updateContainer.bind(this);\n\n this.setLocals(props, this.state, context);\n }\n\n componentWillUpdate(nextProps, nextState, nextContext) {\n this.axes = getAllAxes(nextContext.fullContainer);\n this.axesOptions = computeAxesOptions(this.axes, nextProps, nextContext);\n // This is not enough, what if plotly.js adds new axes...\n this.setLocals(nextProps, nextState, nextContext);\n }\n\n setLocals(nextProps, nextState, nextContext) {\n const {container, fullContainer} = nextContext;\n const {axesTarget} = nextState;\n\n if (axesTarget === 'allaxes') {\n const multiValuedContainer = deepCopyPublic(this.axes[0]);\n this.axes.slice(1).forEach(ax =>\n Object.keys(ax).forEach(key =>\n setMultiValuedContainer(multiValuedContainer, deepCopyPublic(ax), key, {\n searchArrays: true,\n })\n )\n );\n this.fullContainer = multiValuedContainer;\n this.defaultContainer = this.axes[0];\n this.container = {};\n } else if (axesTarget) {\n this.fullContainer = nestedProperty(fullContainer, axesTarget).get();\n this.container = this.container = nestedProperty(container, axesTarget).get() || {};\n }\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.state.axesTarget}.${attr}`),\n axesOptions: this.axesOptions,\n axesTarget: this.state.axesTarget,\n axesTargetHandler: this.axesTargetHandler,\n container: this.container,\n defaultContainer: this.defaultContainer,\n fullContainer: this.fullContainer,\n updateContainer: this.updateContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.state.axesTarget}.${attr}`),\n axesOptions: this.axesOptions,\n axesTarget: this.state.axesTarget,\n axesTargetHandler: this.axesTargetHandler,\n container: this.container,\n defaultContainer: this.defaultContainer,\n fullContainer: this.fullContainer,\n updateContainer: this.updateContainer,\n };\n }\n\n axesTargetHandler(axesTarget) {\n this.setState({axesTarget});\n }\n\n updateContainer(update) {\n const newUpdate = {};\n const {axesTarget} = this.state;\n\n let axes = this.axes;\n if (axesTarget !== 'allaxes') {\n // only the selected container\n axes = [this.fullContainer];\n }\n\n const keys = Object.keys(update);\n for (let i = 0; i < keys.length; i++) {\n for (let j = 0; j < axes.length; j++) {\n const subplot = axes[j]._subplot;\n let axesKey = axes[j]._name;\n\n if (subplot && !subplot.includes('xaxis') && !subplot.includes('yaxis')) {\n axesKey = `${subplot}.${axesKey}`;\n }\n\n const newkey = `${axesKey}.${keys[i]}`;\n newUpdate[newkey] = update[keys[i]];\n }\n }\n\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n AxesConnectedComponent.displayName = `AxesConnected${getDisplayName(WrappedComponent)}`;\n\n AxesConnectedComponent.contextTypes = {\n container: PropTypes.object.isRequired,\n fullContainer: PropTypes.object.isRequired,\n updateContainer: PropTypes.func,\n localize: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n AxesConnectedComponent.childContextTypes = {\n axesOptions: PropTypes.array,\n axesTarget: PropTypes.string,\n axesTargetHandler: PropTypes.func,\n container: PropTypes.object,\n defaultContainer: PropTypes.object,\n fullContainer: PropTypes.object,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return AxesConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectCartesianSubplotToLayout.js b/lib/lib/connectCartesianSubplotToLayout.js new file mode 100644 index 000000000..cae7cd537 --- /dev/null +++ b/lib/lib/connectCartesianSubplotToLayout.js @@ -0,0 +1,159 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectCartesianSubplotToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectCartesianSubplotToLayout(WrappedComponent) { + var SubplotConnectedComponent = function (_Component) { + _inherits(SubplotConnectedComponent, _Component); + + function SubplotConnectedComponent(props, context) { + _classCallCheck(this, SubplotConnectedComponent); + + var _this = _possibleConstructorReturn(this, (SubplotConnectedComponent.__proto__ || Object.getPrototypeOf(SubplotConnectedComponent)).call(this, props, context)); + + _this.updateSubplot = _this.updateSubplot.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(SubplotConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var xaxis = props.xaxis, + yaxis = props.yaxis, + traceIndexes = props.traceIndexes; + var container = context.container, + fullContainer = context.fullContainer, + data = context.data; + + + this.container = { + xaxis: container[xaxis], + yaxis: container[yaxis] + }; + this.fullContainer = { + xaxis: fullContainer[xaxis], + yaxis: fullContainer[yaxis] + }; + + var trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {}; + var fullTrace = (0, _lib.getFullTrace)(props, context); + + if (trace && fullTrace) { + this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace)); + this.name = fullTrace.name; + } + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject(attr.replace('xaxis', _this2.props.xaxis).replace('yaxis', _this2.props.yaxis)); + }, + updateContainer: this.updateSubplot, + deleteContainer: this.deleteSubplot, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject(attr.replace('xaxis', _this3.props.xaxis).replace('yaxis', _this3.props.yaxis)); + }, + updateContainer: this.updateSubplot, + deleteContainer: this.deleteSubplot, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateSubplot', + value: function updateSubplot(update) { + var newUpdate = {}; + for (var key in update) { + var newKey = key.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis); + newUpdate[newKey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, _extends({ name: this.name, icon: this.icon }, this.props)); + } + }]); + + return SubplotConnectedComponent; + }(_react.Component); + + SubplotConnectedComponent.displayName = 'SubplotConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + SubplotConnectedComponent.propTypes = { + xaxis: _propTypes2.default.string.isRequired, + yaxis: _propTypes2.default.string.isRequired + }; + + SubplotConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + fullData: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + SubplotConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return SubplotConnectedComponent; +} +//# sourceMappingURL=connectCartesianSubplotToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectCartesianSubplotToLayout.js.map b/lib/lib/connectCartesianSubplotToLayout.js.map new file mode 100644 index 000000000..1aa70547f --- /dev/null +++ b/lib/lib/connectCartesianSubplotToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectCartesianSubplotToLayout.js"],"names":["connectCartesianSubplotToLayout","WrappedComponent","SubplotConnectedComponent","props","context","updateSubplot","bind","setLocals","nextProps","nextContext","xaxis","yaxis","traceIndexes","container","fullContainer","data","trace","length","fullTrace","icon","name","getValObject","attr","replace","updateContainer","deleteContainer","deleteSubplot","update","newUpdate","key","newKey","Component","displayName","propTypes","PropTypes","string","isRequired","contextTypes","object","array","fullData","onUpdate","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;;;kBAIwBA,+B;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,+BAAT,CAAyCC,gBAAzC,EAA2D;AAAA,MAClEC,yBADkE;AAAA;;AAEtE,uCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,wJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBC,IAAnB,OAArB;AACA,YAAKC,SAAL,CAAeJ,KAAf,EAAsBC,OAAtB;AAJ0B;AAK3B;;AAPqE;AAAA;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A1B,GAAsC;AACpCvB,WAAOwB,oBAAUC,MAAV,CAAiBC,UADY;AAEpCzB,WAAOuB,oBAAUC,MAAV,CAAiBC;AAFY,GAAtC;;AAKAlC,4BAA0BmC,YAA1B,GAAyC;AACvCxB,eAAWqB,oBAAUI,MADkB;AAEvCxB,mBAAeoB,oBAAUI,MAFc;AAGvCvB,UAAMmB,oBAAUK,KAHuB;AAIvCC,cAAUN,oBAAUK,KAJmB;AAKvCE,cAAUP,oBAAUQ,IALmB;AAMvClB,qBAAiBU,oBAAUQ,IANY;AAOvCrB,kBAAca,oBAAUQ;AAPe,GAAzC;;AAUAxC,4BAA0ByC,iBAA1B,GAA8C;AAC5CnB,qBAAiBU,oBAAUQ,IADiB;AAE5CjB,qBAAiBS,oBAAUQ,IAFiB;AAG5C7B,eAAWqB,oBAAUI,MAHuB;AAI5CxB,mBAAeoB,oBAAUI,MAJmB;AAK5CjB,kBAAca,oBAAUQ;AALoB,GAA9C;;AAhGwE,MAwGjEE,oBAxGiE,GAwGzC3C,gBAxGyC,CAwGjE2C,oBAxGiE;;AAyGxE1C,4BAA0B0C,oBAA1B,GAAiDA,oBAAjD;;AAEA,SAAO1C,yBAAP;AACD","file":"connectCartesianSubplotToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib';\n\nexport default function connectCartesianSubplotToLayout(WrappedComponent) {\n class SubplotConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.updateSubplot = this.updateSubplot.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {xaxis, yaxis, traceIndexes} = props;\n const {container, fullContainer, data} = context;\n\n this.container = {\n xaxis: container[xaxis],\n yaxis: container[yaxis],\n };\n this.fullContainer = {\n xaxis: fullContainer[xaxis],\n yaxis: fullContainer[yaxis],\n };\n\n const trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {};\n const fullTrace = getFullTrace(props, context);\n\n if (trace && fullTrace) {\n this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace));\n this.name = fullTrace.name;\n }\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(\n attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis)\n ),\n updateContainer: this.updateSubplot,\n deleteContainer: this.deleteSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(\n attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis)\n ),\n updateContainer: this.updateSubplot,\n deleteContainer: this.deleteSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateSubplot(update) {\n const newUpdate = {};\n for (const key in update) {\n const newKey = key.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis);\n newUpdate[newKey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n SubplotConnectedComponent.displayName = `SubplotConnected${getDisplayName(WrappedComponent)}`;\n\n SubplotConnectedComponent.propTypes = {\n xaxis: PropTypes.string.isRequired,\n yaxis: PropTypes.string.isRequired,\n };\n\n SubplotConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n fullData: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n SubplotConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return SubplotConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectImageToLayout.js b/lib/lib/connectImageToLayout.js new file mode 100644 index 000000000..b0a67e32c --- /dev/null +++ b/lib/lib/connectImageToLayout.js @@ -0,0 +1,155 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectImageToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectImageToLayout(WrappedComponent) { + var ImageConnectedComponent = function (_Component) { + _inherits(ImageConnectedComponent, _Component); + + function ImageConnectedComponent(props, context) { + _classCallCheck(this, ImageConnectedComponent); + + var _this = _possibleConstructorReturn(this, (ImageConnectedComponent.__proto__ || Object.getPrototypeOf(ImageConnectedComponent)).call(this, props, context)); + + _this.deleteImage = _this.deleteImage.bind(_this); + _this.updateImage = _this.updateImage.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(ImageConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var imageIndex = props.imageIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var images = container.images || []; + var fullImages = fullContainer.images || []; + this.container = images[imageIndex]; + this.fullContainer = fullImages[imageIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('images[].' + attr); + }, + updateContainer: this.updateImage, + deleteContainer: this.deleteImage, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('images[].' + attr); + }, + updateContainer: this.updateImage, + deleteContainer: this.deleteImage, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateImage', + value: function updateImage(update) { + var newUpdate = {}; + var imageIndex = this.props.imageIndex; + + for (var key in update) { + var newkey = 'images[' + imageIndex + '].' + key; + newUpdate[newkey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'deleteImage', + value: function deleteImage() { + if (this.context.onUpdate) { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.DELETE_IMAGE, + payload: { imageIndex: this.props.imageIndex } + }); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return ImageConnectedComponent; + }(_react.Component); + + ImageConnectedComponent.displayName = 'ImageConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + ImageConnectedComponent.propTypes = { + imageIndex: _propTypes2.default.number.isRequired + }; + + ImageConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + ImageConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return ImageConnectedComponent; +} +//# sourceMappingURL=connectImageToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectImageToLayout.js.map b/lib/lib/connectImageToLayout.js.map new file mode 100644 index 000000000..80c6380dc --- /dev/null +++ b/lib/lib/connectImageToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectImageToLayout.js"],"names":["connectImageToLayout","WrappedComponent","ImageConnectedComponent","props","context","deleteImage","bind","updateImage","setLocals","nextProps","nextContext","imageIndex","container","fullContainer","images","fullImages","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_IMAGE","payload","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,oB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,oBAAT,CAA8BC,gBAA9B,EAAgD;AAAA,MACvDC,uBADuD;AAAA;;AAE3D,qCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBD,IAAjB,OAAnB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR0D;AAAA;AAAA,gDAUjCK,SAViC,EAU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AxB,GAA+CA,oBAA/C;;AAEA,SAAOvC,uBAAP;AACD","file":"connectImageToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectImageToLayout(WrappedComponent) {\n class ImageConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteImage = this.deleteImage.bind(this);\n this.updateImage = this.updateImage.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {imageIndex} = props;\n const {container, fullContainer} = context;\n\n const images = container.images || [];\n const fullImages = fullContainer.images || [];\n this.container = images[imageIndex];\n this.fullContainer = fullImages[imageIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`),\n updateContainer: this.updateImage,\n deleteContainer: this.deleteImage,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`),\n updateContainer: this.updateImage,\n deleteContainer: this.deleteImage,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateImage(update) {\n const newUpdate = {};\n const {imageIndex} = this.props;\n for (const key in update) {\n const newkey = `images[${imageIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteImage() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_IMAGE,\n payload: {imageIndex: this.props.imageIndex},\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n ImageConnectedComponent.displayName = `ImageConnected${getDisplayName(WrappedComponent)}`;\n\n ImageConnectedComponent.propTypes = {\n imageIndex: PropTypes.number.isRequired,\n };\n\n ImageConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n ImageConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return ImageConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectLayoutToPlot.js b/lib/lib/connectLayoutToPlot.js new file mode 100644 index 000000000..704f4936a --- /dev/null +++ b/lib/lib/connectLayoutToPlot.js @@ -0,0 +1,139 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectLayoutToPlot; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _nested_property = require('plotly.js/src/lib/nested_property'); + +var _nested_property2 = _interopRequireDefault(_nested_property); + +var _lib = require('../lib'); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectLayoutToPlot(WrappedComponent) { + var LayoutConnectedComponent = function (_Component) { + _inherits(LayoutConnectedComponent, _Component); + + function LayoutConnectedComponent() { + _classCallCheck(this, LayoutConnectedComponent); + + return _possibleConstructorReturn(this, (LayoutConnectedComponent.__proto__ || Object.getPrototypeOf(LayoutConnectedComponent)).apply(this, arguments)); + } + + _createClass(LayoutConnectedComponent, [{ + key: 'getChildContext', + value: function getChildContext() { + var _context = this.context, + layout = _context.layout, + fullLayout = _context.fullLayout, + plotly = _context.plotly, + onUpdate = _context.onUpdate; + + + var updateContainer = function updateContainer(update) { + if (!onUpdate) { + return; + } + onUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT, + payload: { + update: update + } + }); + }; + + return { + getValObject: function getValObject(attr) { + return !plotly ? null : plotly.PlotSchema.getLayoutValObject(fullLayout, (0, _nested_property2.default)({}, attr).parts); + }, + updateContainer: updateContainer, + container: layout, + fullContainer: fullLayout + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _context2 = this.context, + layout = _context2.layout, + fullLayout = _context2.fullLayout, + plotly = _context2.plotly, + onUpdate = _context2.onUpdate; + + + var updateContainer = function updateContainer(update) { + if (!onUpdate) { + return; + } + onUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT, + payload: { + update: update + } + }); + }; + + return { + getValObject: function getValObject(attr) { + return !plotly ? null : plotly.PlotSchema.getLayoutValObject(fullLayout, (0, _nested_property2.default)({}, attr).parts); + }, + updateContainer: updateContainer, + container: layout, + fullContainer: fullLayout + }; + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return LayoutConnectedComponent; + }(_react.Component); + + LayoutConnectedComponent.displayName = 'LayoutConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + LayoutConnectedComponent.contextTypes = { + layout: _propTypes2.default.object, + fullLayout: _propTypes2.default.object, + plotly: _propTypes2.default.object, + onUpdate: _propTypes2.default.func + }; + + LayoutConnectedComponent.childContextTypes = { + getValObject: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + LayoutConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return LayoutConnectedComponent; +} +//# sourceMappingURL=connectLayoutToPlot.js.map \ No newline at end of file diff --git a/lib/lib/connectLayoutToPlot.js.map b/lib/lib/connectLayoutToPlot.js.map new file mode 100644 index 000000000..87fd3a834 --- /dev/null +++ b/lib/lib/connectLayoutToPlot.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectLayoutToPlot.js"],"names":["connectLayoutToPlot","WrappedComponent","LayoutConnectedComponent","context","layout","fullLayout","plotly","onUpdate","updateContainer","type","EDITOR_ACTIONS","UPDATE_LAYOUT","payload","update","getValObject","PlotSchema","getLayoutValObject","attr","parts","container","fullContainer","props","Component","displayName","contextTypes","PropTypes","object","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAMwBA,mB;;AANxB;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,mBAAT,CAA6BC,gBAA7B,EAA+C;AAAA,MACtDC,wBADsD;AAAA;;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;AAAA,wCAExC;AAAA,uBAC+B,KAAKC,OADpC;AAAA,YACTC,MADS,YACTA,MADS;AAAA,YACDC,UADC,YACDA,UADC;AAAA,YACWC,MADX,YACWA,MADX;AAAA,YACmBC,QADnB,YACmBA,QADnB;;;AAGhB,YAAMC,kBAAkB,SAAlBA,eAAkB,SAAU;AAChC,cAAI,CAACD,QAAL,EAAe;AACb;AACD;AACDA,mBAAS;AACPE,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AHoB;AAItCnB,cAAUkB,oBAAUE;AAJkB,GAAxC;;AAOAzB,2BAAyB0B,iBAAzB,GAA6C;AAC3Cd,kBAAcW,oBAAUE,IADmB;AAE3CnB,qBAAiBiB,oBAAUE,IAFgB;AAG3CR,eAAWM,oBAAUC,MAHsB;AAI3CN,mBAAeK,oBAAUC;AAJkB,GAA7C;;AApE4D,MA2ErDG,oBA3EqD,GA2E7B5B,gBA3E6B,CA2ErD4B,oBA3EqD;;AA4E5D3B,2BAAyB2B,oBAAzB,GAAgDA,oBAAhD;;AAEA,SAAO3B,wBAAP;AACD","file":"connectLayoutToPlot.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectLayoutToPlot(WrappedComponent) {\n class LayoutConnectedComponent extends Component {\n getChildContext() {\n const {layout, fullLayout, plotly, onUpdate} = this.context;\n\n const updateContainer = update => {\n if (!onUpdate) {\n return;\n }\n onUpdate({\n type: EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update,\n },\n });\n };\n\n return {\n getValObject: attr =>\n !plotly\n ? null\n : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts),\n updateContainer,\n container: layout,\n fullContainer: fullLayout,\n };\n }\n\n provideValue() {\n const {layout, fullLayout, plotly, onUpdate} = this.context;\n\n const updateContainer = update => {\n if (!onUpdate) {\n return;\n }\n onUpdate({\n type: EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update,\n },\n });\n };\n\n return {\n getValObject: attr =>\n !plotly\n ? null\n : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts),\n updateContainer,\n container: layout,\n fullContainer: fullLayout,\n };\n }\n\n render() {\n return ;\n }\n }\n\n LayoutConnectedComponent.displayName = `LayoutConnected${getDisplayName(WrappedComponent)}`;\n\n LayoutConnectedComponent.contextTypes = {\n layout: PropTypes.object,\n fullLayout: PropTypes.object,\n plotly: PropTypes.object,\n onUpdate: PropTypes.func,\n };\n\n LayoutConnectedComponent.childContextTypes = {\n getValObject: PropTypes.func,\n updateContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n LayoutConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return LayoutConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectNonCartesianSubplotToLayout.js b/lib/lib/connectNonCartesianSubplotToLayout.js new file mode 100644 index 000000000..70d574725 --- /dev/null +++ b/lib/lib/connectNonCartesianSubplotToLayout.js @@ -0,0 +1,148 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectNonCartesianSubplotToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectNonCartesianSubplotToLayout(WrappedComponent) { + var SubplotConnectedComponent = function (_Component) { + _inherits(SubplotConnectedComponent, _Component); + + function SubplotConnectedComponent(props, context) { + _classCallCheck(this, SubplotConnectedComponent); + + var _this = _possibleConstructorReturn(this, (SubplotConnectedComponent.__proto__ || Object.getPrototypeOf(SubplotConnectedComponent)).call(this, props, context)); + + _this.updateSubplot = _this.updateSubplot.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(SubplotConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var subplot = props.subplot, + traceIndexes = props.traceIndexes; + var container = context.container, + fullContainer = context.fullContainer, + data = context.data; + + + this.container = container[subplot] || {}; + this.fullContainer = fullContainer[subplot] || {}; + + var trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {}; + var fullTrace = (0, _lib.getFullTrace)(props, context); + + if (trace && fullTrace) { + this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace)); + this.name = fullTrace.name; + } + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject(_this2.props.subplot + '.' + attr); + }, + updateContainer: this.updateSubplot, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject(_this3.props.subplot + '.' + attr); + }, + updateContainer: this.updateSubplot, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateSubplot', + value: function updateSubplot(update) { + var newUpdate = {}; + for (var key in update) { + newUpdate[this.props.subplot + '.' + key] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, _extends({ name: this.name, icon: this.icon }, this.props)); + } + }]); + + return SubplotConnectedComponent; + }(_react.Component); + + SubplotConnectedComponent.displayName = 'SubplotConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + SubplotConnectedComponent.propTypes = { + subplot: _propTypes2.default.string.isRequired + }; + + SubplotConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + fullData: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + SubplotConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return SubplotConnectedComponent; +} +//# sourceMappingURL=connectNonCartesianSubplotToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectNonCartesianSubplotToLayout.js.map b/lib/lib/connectNonCartesianSubplotToLayout.js.map new file mode 100644 index 000000000..97efae896 --- /dev/null +++ b/lib/lib/connectNonCartesianSubplotToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectNonCartesianSubplotToLayout.js"],"names":["connectNonCartesianSubplotToLayout","WrappedComponent","SubplotConnectedComponent","props","context","updateSubplot","bind","setLocals","nextProps","nextContext","subplot","traceIndexes","container","fullContainer","data","trace","length","fullTrace","icon","name","getValObject","attr","updateContainer","update","newUpdate","key","Component","displayName","propTypes","PropTypes","string","isRequired","contextTypes","object","array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YAA1B,GAAyC;AACvCpB,eAAWiB,oBAAUI,MADkB;AAEvCpB,mBAAegB,oBAAUI,MAFc;AAGvCnB,UAAMe,oBAAUK,KAHuB;AAIvCC,cAAUN,oBAAUK,KAJmB;AAKvCE,cAAUP,oBAAUQ,IALmB;AAMvCf,qBAAiBO,oBAAUQ,IANY;AAOvCjB,kBAAcS,oBAAUQ;AAPe,GAAzC;;AAUAnC,4BAA0BoC,iBAA1B,GAA8C;AAC5ChB,qBAAiBO,oBAAUQ,IADiB;AAE5CE,qBAAiBV,oBAAUQ,IAFiB;AAG5CzB,eAAWiB,oBAAUI,MAHuB;AAI5CpB,mBAAegB,oBAAUI,MAJmB;AAK5Cb,kBAAcS,oBAAUQ;AALoB,GAA9C;;AAlF2E,MA0FpEG,oBA1FoE,GA0F5CvC,gBA1F4C,CA0FpEuC,oBA1FoE;;AA2F3EtC,4BAA0BsC,oBAA1B,GAAiDA,oBAAjD;;AAEA,SAAOtC,yBAAP;AACD","file":"connectNonCartesianSubplotToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib';\n\nexport default function connectNonCartesianSubplotToLayout(WrappedComponent) {\n class SubplotConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.updateSubplot = this.updateSubplot.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {subplot, traceIndexes} = props;\n const {container, fullContainer, data} = context;\n\n this.container = container[subplot] || {};\n this.fullContainer = fullContainer[subplot] || {};\n\n const trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {};\n const fullTrace = getFullTrace(props, context);\n\n if (trace && fullTrace) {\n this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace));\n this.name = fullTrace.name;\n }\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.props.subplot}.${attr}`),\n updateContainer: this.updateSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.props.subplot}.${attr}`),\n updateContainer: this.updateSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateSubplot(update) {\n const newUpdate = {};\n for (const key in update) {\n newUpdate[`${this.props.subplot}.${key}`] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n SubplotConnectedComponent.displayName = `SubplotConnected${getDisplayName(WrappedComponent)}`;\n\n SubplotConnectedComponent.propTypes = {\n subplot: PropTypes.string.isRequired,\n };\n\n SubplotConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n fullData: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n SubplotConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return SubplotConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectRangeSelectorToAxis.js b/lib/lib/connectRangeSelectorToAxis.js new file mode 100644 index 000000000..78a529321 --- /dev/null +++ b/lib/lib/connectRangeSelectorToAxis.js @@ -0,0 +1,158 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectRangeSelectorToAxis; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectRangeSelectorToAxis(WrappedComponent) { + var RangeSelectorConnectedComponent = function (_Component) { + _inherits(RangeSelectorConnectedComponent, _Component); + + function RangeSelectorConnectedComponent(props, context) { + _classCallCheck(this, RangeSelectorConnectedComponent); + + var _this = _possibleConstructorReturn(this, (RangeSelectorConnectedComponent.__proto__ || Object.getPrototypeOf(RangeSelectorConnectedComponent)).call(this, props, context)); + + _this.deleteRangeselector = _this.deleteRangeselector.bind(_this); + _this.updateRangeselector = _this.updateRangeselector.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(RangeSelectorConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var rangeselectorIndex = props.rangeselectorIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var rangeselectors = container.rangeselector ? container.rangeselector.buttons || [] : []; + var fullRangeselectors = fullContainer.rangeselector ? fullContainer.rangeselector.buttons || [] : []; + this.container = rangeselectors[rangeselectorIndex]; + this.fullContainer = fullRangeselectors[rangeselectorIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('rangeselector.buttons[].' + attr); + }, + updateContainer: this.updateRangeselector, + deleteContainer: this.deleteRangeselector, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('rangeselector.buttons[].' + attr); + }, + updateContainer: this.updateRangeselector, + deleteContainer: this.deleteRangeselector, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateRangeselector', + value: function updateRangeselector(update) { + var newUpdate = {}; + var rangeselectorIndex = this.props.rangeselectorIndex; + + for (var key in update) { + var newkey = 'rangeselector.buttons[' + rangeselectorIndex + '].' + key; + newUpdate[newkey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'deleteRangeselector', + value: function deleteRangeselector() { + if (this.context.onUpdate) { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.DELETE_RANGESELECTOR, + payload: { + axisId: this.context.fullContainer._name, + rangeselectorIndex: this.props.rangeselectorIndex + } + }); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return RangeSelectorConnectedComponent; + }(_react.Component); + + RangeSelectorConnectedComponent.displayName = 'RangeSelectorConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + RangeSelectorConnectedComponent.propTypes = { + rangeselectorIndex: _propTypes2.default.number.isRequired + }; + + RangeSelectorConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + RangeSelectorConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return RangeSelectorConnectedComponent; +} +//# sourceMappingURL=connectRangeSelectorToAxis.js.map \ No newline at end of file diff --git a/lib/lib/connectRangeSelectorToAxis.js.map b/lib/lib/connectRangeSelectorToAxis.js.map new file mode 100644 index 000000000..f445699c5 --- /dev/null +++ b/lib/lib/connectRangeSelectorToAxis.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectRangeSelectorToAxis.js"],"names":["connectRangeSelectorToAxis","WrappedComponent","RangeSelectorConnectedComponent","props","context","deleteRangeselector","bind","updateRangeselector","setLocals","nextProps","nextContext","rangeselectorIndex","container","fullContainer","rangeselectors","rangeselector","buttons","fullRangeselectors","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_RANGESELECTOR","payload","axisId","_name","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,0B;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,0BAAT,CAAoCC,gBAApC,EAAsD;AAAA,MAC7DC,+BAD6D;AAAA;;AAEjE,6CAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oKACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,mBAAL,GAA2B,MAAKA,mBAAL,CAAyBC,IAAzB,OAA3B;AACA,YAAKC,mBAAL,GAA2B,MAAKA,mBAAL,CAAyBD,IAAzB,OAA3B;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL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;AAElDtB,qBAAiBe,oBAAUO,IAFuB;AAGlD/B,eAAWwB,oBAAUI,MAH6B;AAIlD3B,mBAAeuB,oBAAUI,MAJyB;AAKlDtB,kBAAckB,oBAAUO;AAL0B,GAApD;;AAhGmE,MAwG5DE,oBAxG4D,GAwGpC5C,gBAxGoC,CAwG5D4C,oBAxG4D;;AAyGnE3C,kCAAgC2C,oBAAhC,GAAuDA,oBAAvD;;AAEA,SAAO3C,+BAAP;AACD","file":"connectRangeSelectorToAxis.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectRangeSelectorToAxis(WrappedComponent) {\n class RangeSelectorConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteRangeselector = this.deleteRangeselector.bind(this);\n this.updateRangeselector = this.updateRangeselector.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {rangeselectorIndex} = props;\n const {container, fullContainer} = context;\n\n const rangeselectors = container.rangeselector ? container.rangeselector.buttons || [] : [];\n const fullRangeselectors = fullContainer.rangeselector\n ? fullContainer.rangeselector.buttons || []\n : [];\n this.container = rangeselectors[rangeselectorIndex];\n this.fullContainer = fullRangeselectors[rangeselectorIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`rangeselector.buttons[].${attr}`),\n updateContainer: this.updateRangeselector,\n deleteContainer: this.deleteRangeselector,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`rangeselector.buttons[].${attr}`),\n updateContainer: this.updateRangeselector,\n deleteContainer: this.deleteRangeselector,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateRangeselector(update) {\n const newUpdate = {};\n const {rangeselectorIndex} = this.props;\n for (const key in update) {\n const newkey = `rangeselector.buttons[${rangeselectorIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteRangeselector() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_RANGESELECTOR,\n payload: {\n axisId: this.context.fullContainer._name,\n rangeselectorIndex: this.props.rangeselectorIndex,\n },\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n RangeSelectorConnectedComponent.displayName = `RangeSelectorConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n RangeSelectorConnectedComponent.propTypes = {\n rangeselectorIndex: PropTypes.number.isRequired,\n };\n\n RangeSelectorConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n RangeSelectorConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return RangeSelectorConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectShapeToLayout.js b/lib/lib/connectShapeToLayout.js new file mode 100644 index 000000000..19e768348 --- /dev/null +++ b/lib/lib/connectShapeToLayout.js @@ -0,0 +1,155 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectShapeToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectShapeToLayout(WrappedComponent) { + var ShapeConnectedComponent = function (_Component) { + _inherits(ShapeConnectedComponent, _Component); + + function ShapeConnectedComponent(props, context) { + _classCallCheck(this, ShapeConnectedComponent); + + var _this = _possibleConstructorReturn(this, (ShapeConnectedComponent.__proto__ || Object.getPrototypeOf(ShapeConnectedComponent)).call(this, props, context)); + + _this.deleteShape = _this.deleteShape.bind(_this); + _this.updateShape = _this.updateShape.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(ShapeConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var shapeIndex = props.shapeIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var shapes = container.shapes || []; + var fullShapes = fullContainer.shapes || []; + this.container = shapes[shapeIndex]; + this.fullContainer = fullShapes[shapeIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('shapes[].' + attr); + }, + updateContainer: this.updateShape, + deleteContainer: this.deleteShape, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('shapes[].' + attr); + }, + updateContainer: this.updateShape, + deleteContainer: this.deleteShape, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateShape', + value: function updateShape(update) { + var newUpdate = {}; + var shapeIndex = this.props.shapeIndex; + + for (var key in update) { + var newkey = 'shapes[' + shapeIndex + '].' + key; + newUpdate[newkey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'deleteShape', + value: function deleteShape() { + if (this.context.onUpdate) { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.DELETE_SHAPE, + payload: { shapeIndex: this.props.shapeIndex } + }); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return ShapeConnectedComponent; + }(_react.Component); + + ShapeConnectedComponent.displayName = 'ShapeConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + ShapeConnectedComponent.propTypes = { + shapeIndex: _propTypes2.default.number.isRequired + }; + + ShapeConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + ShapeConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return ShapeConnectedComponent; +} +//# sourceMappingURL=connectShapeToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectShapeToLayout.js.map b/lib/lib/connectShapeToLayout.js.map new file mode 100644 index 000000000..f4912443b --- /dev/null +++ b/lib/lib/connectShapeToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectShapeToLayout.js"],"names":["connectShapeToLayout","WrappedComponent","ShapeConnectedComponent","props","context","deleteShape","bind","updateShape","setLocals","nextProps","nextContext","shapeIndex","container","fullContainer","shapes","fullShapes","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_SHAPE","payload","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,oB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,oBAAT,CAA8BC,gBAA9B,EAAgD;AAAA,MACvDC,uBADuD;AAAA;;AAE3D,qCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBD,IAAjB,OAAnB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR0D;AAAA;AAAA,gDAUjCK,SAViC,EAUtBC,WAVsB,EAUT;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZ0D;AAAA;AAAA,gCAcjDP,KAdiD,EAc1CC,OAd0C,EAcjC;AAAA,YACjBO,UADiB,GACHR,KADG,CACjBQ,UADiB;AAAA,YAEjBC,SAFiB,GAEWR,OAFX,CAEjBQ,SAFiB;AAAA,YAENC,aAFM,GAEWT,OAFX,CAENS,aAFM;;;AAIxB,YAAMC,SAASF,UAAUE,MAAV,IAAoB,EAAnC;AACA,YAAMC,aAAaF,c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D;AAEpBC,qBAAS,EAACjB,YAAY,KAAKR,KAAL,CAAWQ,UAAxB;AAFW,WAAtB;AAID;AACF;AA/D0D;AAAA;AAAA,+BAiElD;AACP,eAAO,8BAAC,gBAAD,EAAsB,KAAKR,KAA3B,CAAP;AACD;AAnE0D;;AAAA;AAAA,IACvB0B,gBADuB;;AAsE7D3B,0BAAwB4B,WAAxB,sBAAuD,yBAAe7B,gBAAf,CAAvD;;AAEAC,0BAAwB6B,SAAxB,GAAoC;AAClCpB,gBAAYqB,oBAAUC,MAAV,CAAiBC;AADK,GAApC;;AAIAhC,0BAAwBiC,YAAxB,GAAuC;AACrCvB,eAAWoB,oBAAUI,MADgB;AAErCvB,mBAAemB,oBAAUI,MAFY;AAGrCC,UAAML,oBAAUM,KAHqB;AAIrCd,cAAUQ,oBAAUO,IAJiB;AAKrCrB,qBAAiBc,oBAAUO,IALU;AAMrCvB,kBAAcgB,oBAAUO;AANa,GAAvC;;AASArC,0BAAwBsC,iBAAxB,GAA4C;AAC1CtB,qBAAiBc,oBAAUO,IADe;AAE1CpB,qBAAiBa,oBAAUO,IAFe;AAG1C3B,eAAWoB,oBAAUI,MAHqB;AAI1CvB,mBAAemB,oBAAUI,MAJiB;AAK1CpB,kBAAcgB,oBAAUO;AALkB,GAA5C;;AArF6D,MA6FtDE,oBA7FsD,GA6F9BxC,gBA7F8B,CA6FtDwC,oBA7FsD;;AA8F7DvC,0BAAwBuC,oBAAxB,GAA+CA,oBAA/C;;AAEA,SAAOvC,uBAAP;AACD","file":"connectShapeToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectShapeToLayout(WrappedComponent) {\n class ShapeConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteShape = this.deleteShape.bind(this);\n this.updateShape = this.updateShape.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {shapeIndex} = props;\n const {container, fullContainer} = context;\n\n const shapes = container.shapes || [];\n const fullShapes = fullContainer.shapes || [];\n this.container = shapes[shapeIndex];\n this.fullContainer = fullShapes[shapeIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`),\n updateContainer: this.updateShape,\n deleteContainer: this.deleteShape,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`),\n updateContainer: this.updateShape,\n deleteContainer: this.deleteShape,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateShape(update) {\n const newUpdate = {};\n const {shapeIndex} = this.props;\n for (const key in update) {\n const newkey = `shapes[${shapeIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteShape() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_SHAPE,\n payload: {shapeIndex: this.props.shapeIndex},\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n ShapeConnectedComponent.displayName = `ShapeConnected${getDisplayName(WrappedComponent)}`;\n\n ShapeConnectedComponent.propTypes = {\n shapeIndex: PropTypes.number.isRequired,\n };\n\n ShapeConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n ShapeConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return ShapeConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectSliderToLayout.js b/lib/lib/connectSliderToLayout.js new file mode 100644 index 000000000..62daf6c33 --- /dev/null +++ b/lib/lib/connectSliderToLayout.js @@ -0,0 +1,138 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectSliderToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectSliderToLayout(WrappedComponent) { + var SliderConnectedComponent = function (_Component) { + _inherits(SliderConnectedComponent, _Component); + + function SliderConnectedComponent(props, context) { + _classCallCheck(this, SliderConnectedComponent); + + var _this = _possibleConstructorReturn(this, (SliderConnectedComponent.__proto__ || Object.getPrototypeOf(SliderConnectedComponent)).call(this, props, context)); + + _this.updateSlider = _this.updateSlider.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(SliderConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var sliderIndex = props.sliderIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var sliders = container.sliders || []; + var fullSliders = fullContainer.sliders || []; + this.container = sliders[sliderIndex]; + this.fullContainer = fullSliders[sliderIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('sliders[].' + attr); + }, + updateContainer: this.updateSlider, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('sliders[].' + attr); + }, + updateContainer: this.updateSlider, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateSlider', + value: function updateSlider(update) { + var newUpdate = {}; + var sliderIndex = this.props.sliderIndex; + + for (var key in update) { + var newkey = 'sliders[' + sliderIndex + '].' + key; + newUpdate[newkey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return SliderConnectedComponent; + }(_react.Component); + + SliderConnectedComponent.displayName = 'SliderConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + SliderConnectedComponent.propTypes = { + sliderIndex: _propTypes2.default.number.isRequired + }; + + SliderConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + SliderConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return SliderConnectedComponent; +} +//# sourceMappingURL=connectSliderToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectSliderToLayout.js.map b/lib/lib/connectSliderToLayout.js.map new file mode 100644 index 000000000..59c1bb506 --- /dev/null +++ b/lib/lib/connectSliderToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectSliderToLayout.js"],"names":["connectSliderToLayout","WrappedComponent","SliderConnectedComponent","props","context","updateSlider","bind","setLocals","nextProps","nextContext","sliderIndex","container","fullContainer","sliders","fullSliders","getValObject","attr","updateContainer","update","newUpdate","key","newkey","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","onUpdate","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAIwBA,qB;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,qBAAT,CAA+BC,gBAA/B,EAAiD;AAAA,MACxDC,wBADwD;AAAA;;AAE5D,sCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,sJACpBD,KADoB,EACbC,OADa;;AAE1B,YAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AACA,YAAKC,SAAL,CAAeJ,KAAf,EAAsBC,OAAtB;AAH0B;AAI3B;;AAN2D;AAAA;AAAA,gDAQlCI,SARkC,EAQvBC,WARuB,EAQV;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAV2D;AAAA;AAAA,gCAYlDN,KAZkD,EAY3CC,OAZ2C,EAYlC;AAAA,YACjBM,WADiB,GACFP,KADE,CACjBO,WADiB;AAAA,YAEjBC,SAFiB,GAEWP,OAFX,CAEjBO,SAFiB;AAAA,YAENC,aAFM,GAEWR,OAFX,CAENQ,aAFM;;;AAIxB,YAAMC,UAAUF,UAAUE,OAAV,IAAqB,EAArC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;;AAEAC,2BAAyBsB,SAAzB,GAAqC;AACnCd,iBAAae,oBAAUC,MAAV,CAAiBC;AADK,GAArC;;AAIAzB,2BAAyB0B,YAAzB,GAAwC;AACtCjB,eAAWc,oBAAUI,MADiB;AAEtCjB,mBAAea,oBAAUI,MAFa;AAGtCC,cAAUL,oBAAUM,IAHkB;AAItCd,qBAAiBQ,oBAAUM,IAJW;AAKtChB,kBAAcU,oBAAUM;AALc,GAAxC;;AAQA7B,2BAAyB8B,iBAAzB,GAA6C;AAC3Cf,qBAAiBQ,oBAAUM,IADgB;AAE3CpB,eAAWc,oBAAUI,MAFsB;AAG3CjB,mBAAea,oBAAUI,MAHkB;AAI3Cd,kBAAcU,oBAAUM;AAJmB,GAA7C;;AAvE8D,MA8EvDE,oBA9EuD,GA8E/BhC,gBA9E+B,CA8EvDgC,oBA9EuD;;AA+E9D/B,2BAAyB+B,oBAAzB,GAAgDA,oBAAhD;;AAEA,SAAO/B,wBAAP;AACD","file":"connectSliderToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\n\nexport default function connectSliderToLayout(WrappedComponent) {\n class SliderConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n this.updateSlider = this.updateSlider.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {sliderIndex} = props;\n const {container, fullContainer} = context;\n\n const sliders = container.sliders || [];\n const fullSliders = fullContainer.sliders || [];\n this.container = sliders[sliderIndex];\n this.fullContainer = fullSliders[sliderIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`),\n updateContainer: this.updateSlider,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`),\n updateContainer: this.updateSlider,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateSlider(update) {\n const newUpdate = {};\n const {sliderIndex} = this.props;\n for (const key in update) {\n const newkey = `sliders[${sliderIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n SliderConnectedComponent.displayName = `SliderConnected${getDisplayName(WrappedComponent)}`;\n\n SliderConnectedComponent.propTypes = {\n sliderIndex: PropTypes.number.isRequired,\n };\n\n SliderConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n SliderConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return SliderConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectToContainer.js b/lib/lib/connectToContainer.js new file mode 100644 index 000000000..bf444699f --- /dev/null +++ b/lib/lib/connectToContainer.js @@ -0,0 +1,150 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.containerConnectedContextTypes = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectToContainer; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _unpackPlotProps = require('./unpackPlotProps'); + +var _unpackPlotProps2 = _interopRequireDefault(_unpackPlotProps); + +var _lib = require('../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var containerConnectedContextTypes = exports.containerConnectedContextTypes = { + localize: _propTypes2.default.func, + container: _propTypes2.default.object, + data: _propTypes2.default.array, + defaultContainer: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + fullData: _propTypes2.default.array, + fullLayout: _propTypes2.default.object, + getValObject: _propTypes2.default.func, + graphDiv: _propTypes2.default.object, + layout: _propTypes2.default.object, + onUpdate: _propTypes2.default.func, + plotly: _propTypes2.default.object, + updateContainer: _propTypes2.default.func, + traceIndexes: _propTypes2.default.array +}; + +function connectToContainer(WrappedComponent) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var ContainerConnectedComponent = function (_Component) { + _inherits(ContainerConnectedComponent, _Component); + + _createClass(ContainerConnectedComponent, null, [{ + key: 'modifyPlotProps', + + // Run the inner modifications first and allow more recent modifyPlotProp + // config function to modify last. + value: function modifyPlotProps(props, context, plotProps) { + if (WrappedComponent.modifyPlotProps) { + WrappedComponent.modifyPlotProps(props, context, plotProps); + } + if (config.modifyPlotProps) { + config.modifyPlotProps(props, context, plotProps); + } + } + }]); + + function ContainerConnectedComponent(props, context) { + _classCallCheck(this, ContainerConnectedComponent); + + var _this = _possibleConstructorReturn(this, (ContainerConnectedComponent.__proto__ || Object.getPrototypeOf(ContainerConnectedComponent)).call(this, props, context)); + + _this.setLocals(props, context); + return _this; + } + + _createClass(ContainerConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + this.plotProps = (0, _unpackPlotProps2.default)(props, context); + this.attr = props.attr; + ContainerConnectedComponent.modifyPlotProps(props, context, this.plotProps); + } + }, { + key: 'getChildContext', + value: function getChildContext() { + return { + description: this.plotProps.description, + attr: this.attr + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + return { + description: this.plotProps.description, + attr: this.attr + }; + } + }, { + key: 'render', + value: function render() { + // Merge plotprops onto props so leaf components only need worry about + // props. However pass plotProps as a specific prop in case inner component + // is also wrapped by a component that `unpackPlotProps`. That way inner + // component can skip computation as it can see plotProps is already defined. + var _Object$assign = Object.assign({}, this.plotProps, this.props), + _Object$assign$plotPr = _Object$assign.plotProps, + plotProps = _Object$assign$plotPr === undefined ? this.plotProps : _Object$assign$plotPr, + props = _objectWithoutProperties(_Object$assign, ['plotProps']); + + if (props.isVisible) { + return _react2.default.createElement(WrappedComponent, _extends({}, props, { plotProps: plotProps })); + } + + return null; + } + }]); + + return ContainerConnectedComponent; + }(_react.Component); + + ContainerConnectedComponent.displayName = 'ContainerConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + ContainerConnectedComponent.contextTypes = containerConnectedContextTypes; + ContainerConnectedComponent.childContextTypes = { + description: _propTypes2.default.string, + attr: _propTypes2.default.string + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return ContainerConnectedComponent; +} +//# sourceMappingURL=connectToContainer.js.map \ No newline at end of file diff --git a/lib/lib/connectToContainer.js.map b/lib/lib/connectToContainer.js.map new file mode 100644 index 000000000..b2ea13f38 --- /dev/null +++ b/lib/lib/connectToContainer.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectToContainer.js"],"names":["connectToContainer","containerConnectedContextTypes","localize","PropTypes","func","container","object","data","array","defaultContainer","fullContainer","fullData","fullLayout","getValObject","graphDiv","layout","onUpdate","plotly","updateContainer","traceIndexes","WrappedComponent","config","ContainerConnectedComponent","props","context","plotProps","modifyPlotProps","setLocals","nextProps","nextContext","attr","description","Object","assign","isVisible","Component","displayName","contextTypes","childContextTypes","string","plotly_editor_traits"],"mappings":";;;;;;;;;;;kBAsBwBA,kB;;AAtBxB;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;AAEO,IAAMC,0EAAiC;AAC5CC,YAAUC,oBAAUC,IADwB;AAE5CC,aAAWF,oBAAUG,MAFuB;AAG5CC,QAAMJ,oBAAUK,KAH4B;AAI5CC,oBAAkBN,oBAAUG,MAJgB;AAK5CI,iBAAeP,oBAAUG,MALmB;AAM5CK,YAAUR,oBAAUK,KANwB;AAO5CI,cAAYT,oBAAUG,MAPsB;AAQ5CO,gBAAcV,oBAAUC,IARoB;AAS5CU,YAAUX,oBAAUG,MATwB;AAU5CS,UAAQZ,oBAAUG,MAV0B;AAW5CU,YAAUb,oBAAUC,IAXwB;AAY5Ca,UAAQd,oBAAUG,MAZ0B;AAa5CY,mBAAiBf,oBAAUC,IAbiB;AAc5Ce,gBAAchB,oBAAUK;AAdoB,CAAvC;;AAiBQ,SAASR,kBAAT,CAA4BoB,gBAA5B,EAA2D;AAAA,MAAbC,MAAa,uEAAJ,EAAI;;AAAA,MAClEC,2BADkE;AAAA;;AAAA;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A;AAAA,YAKAA,SALA,yCAKY,KAAKA,SALjB;AAAA,YAK+BF,KAL/B;;AAMP,YAAIA,MAAMW,SAAV,EAAqB;AACnB,iBAAO,8BAAC,gBAAD,eAAsBX,KAAtB,IAA6B,WAAWE,SAAxC,IAAP;AACD;;AAED,eAAO,IAAP;AACD;AAtDqE;;AAAA;AAAA,IAC9BU,gBAD8B;;AAyDxEb,8BAA4Bc,WAA5B,0BAA+D,yBAAehB,gBAAf,CAA/D;;AAEAE,8BAA4Be,YAA5B,GAA2CpC,8BAA3C;AACAqB,8BAA4BgB,iBAA5B,GAAgD;AAC9CP,iBAAa5B,oBAAUoC,MADuB;AAE9CT,UAAM3B,oBAAUoC;AAF8B,GAAhD;;AA5DwE,MAiEjEC,oBAjEiE,GAiEzCpB,gBAjEyC,CAiEjEoB,oBAjEiE;;AAkExElB,8BAA4BkB,oBAA5B,GAAmDA,oBAAnD;;AAEA,SAAOlB,2BAAP;AACD","file":"connectToContainer.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport unpackPlotProps from './unpackPlotProps';\nimport {getDisplayName} from '../lib';\n\nexport const containerConnectedContextTypes = {\n localize: PropTypes.func,\n container: PropTypes.object,\n data: PropTypes.array,\n defaultContainer: PropTypes.object,\n fullContainer: PropTypes.object,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n getValObject: PropTypes.func,\n graphDiv: PropTypes.object,\n layout: PropTypes.object,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n updateContainer: PropTypes.func,\n traceIndexes: PropTypes.array,\n};\n\nexport default function connectToContainer(WrappedComponent, config = {}) {\n class ContainerConnectedComponent extends Component {\n // Run the inner modifications first and allow more recent modifyPlotProp\n // config function to modify last.\n static modifyPlotProps(props, context, plotProps) {\n if (WrappedComponent.modifyPlotProps) {\n WrappedComponent.modifyPlotProps(props, context, plotProps);\n }\n if (config.modifyPlotProps) {\n config.modifyPlotProps(props, context, plotProps);\n }\n }\n\n constructor(props, context) {\n super(props, context);\n\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n this.plotProps = unpackPlotProps(props, context);\n this.attr = props.attr;\n ContainerConnectedComponent.modifyPlotProps(props, context, this.plotProps);\n }\n\n getChildContext() {\n return {\n description: this.plotProps.description,\n attr: this.attr,\n };\n }\n\n provideValue() {\n return {\n description: this.plotProps.description,\n attr: this.attr,\n };\n }\n\n render() {\n // Merge plotprops onto props so leaf components only need worry about\n // props. However pass plotProps as a specific prop in case inner component\n // is also wrapped by a component that `unpackPlotProps`. That way inner\n // component can skip computation as it can see plotProps is already defined.\n const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, this.props);\n if (props.isVisible) {\n return ;\n }\n\n return null;\n }\n }\n\n ContainerConnectedComponent.displayName = `ContainerConnected${getDisplayName(WrappedComponent)}`;\n\n ContainerConnectedComponent.contextTypes = containerConnectedContextTypes;\n ContainerConnectedComponent.childContextTypes = {\n description: PropTypes.string,\n attr: PropTypes.string,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return ContainerConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectTraceToPlot.js b/lib/lib/connectTraceToPlot.js new file mode 100644 index 000000000..1017078e7 --- /dev/null +++ b/lib/lib/connectTraceToPlot.js @@ -0,0 +1,260 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectTraceToPlot; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _nested_property = require('plotly.js/src/lib/nested_property'); + +var _nested_property2 = _interopRequireDefault(_nested_property); + +var _lib = require('../lib'); + +var _multiValues = require('./multiValues'); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectTraceToPlot(WrappedComponent) { + var TraceConnectedComponent = function (_Component) { + _inherits(TraceConnectedComponent, _Component); + + function TraceConnectedComponent(props, context) { + _classCallCheck(this, TraceConnectedComponent); + + var _this = _possibleConstructorReturn(this, (TraceConnectedComponent.__proto__ || Object.getPrototypeOf(TraceConnectedComponent)).call(this, props, context)); + + _this.deleteTrace = _this.deleteTrace.bind(_this); + _this.updateTrace = _this.updateTrace.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(TraceConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var traceIndexes = props.traceIndexes; + var data = context.data, + fullData = context.fullData, + plotly = context.plotly; + + + var trace = data[traceIndexes[0]]; + var fullTrace = (0, _lib.getFullTrace)(props, context); + + this.childContext = { + getValObject: function getValObject(attr) { + return !plotly ? null : plotly.PlotSchema.getTraceValObject(fullTrace, (0, _nested_property2.default)({}, attr).parts); + }, + updateContainer: this.updateTrace, + deleteContainer: this.deleteTrace, + container: trace, + fullContainer: fullTrace, + traceIndexes: this.props.traceIndexes + }; + + if (traceIndexes.length > 1) { + var multiValuedFullContainer = (0, _multiValues.deepCopyPublic)(fullTrace); + fullData.forEach(function (t) { + return Object.keys(t).forEach(function (key) { + return (0, _multiValues.setMultiValuedContainer)(multiValuedFullContainer, (0, _multiValues.deepCopyPublic)(t), key, { + searchArrays: true + }); + }); + }); + var multiValuedContainer = (0, _multiValues.deepCopyPublic)(trace); + data.forEach(function (t) { + return Object.keys(t).forEach(function (key) { + return (0, _multiValues.setMultiValuedContainer)(multiValuedContainer, (0, _multiValues.deepCopyPublic)(t), key, { + searchArrays: true + }); + }); + }); + this.childContext.fullContainer = multiValuedFullContainer; + this.childContext.defaultContainer = fullTrace; + this.childContext.container = multiValuedContainer; + } + + if (trace && fullTrace) { + this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace)); + this.name = fullTrace.name; + } + } + }, { + key: 'getChildContext', + value: function getChildContext() { + return this.childContext; + } + }, { + key: 'provideValue', + value: function provideValue() { + return this.childContext; + } + }, { + key: 'updateTrace', + value: function updateTrace(update) { + var _this2 = this; + + if (this.context.onUpdate) { + var splitTraceGroup = this.props.fullDataArrayPosition ? this.props.fullDataArrayPosition.map(function (p) { + return _this2.context.fullData[p]._group; + }) : null; + + var containsAnSrc = Object.keys(update).filter(function (a) { + return a.endsWith('src'); + }).length > 0; + + if (Array.isArray(update)) { + update.forEach(function (u, i) { + _this2.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, + payload: { + update: u, + traceIndexes: [_this2.props.traceIndexes[i]], + splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null + } + }); + }); + } else if (splitTraceGroup && !containsAnSrc) { + this.props.traceIndexes.forEach(function (t, i) { + _this2.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, + payload: { + update: update, + traceIndexes: [_this2.props.traceIndexes[i]], + splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null + } + }); + }); + } else { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, + payload: { + update: update, + traceIndexes: this.props.traceIndexes + } + }); + } + } + } + }, { + key: 'deleteTrace', + value: function deleteTrace() { + var _this3 = this; + + var currentTrace = this.context.fullData[this.props.traceIndexes[0]]; + if (!currentTrace && this.context.onUpdate) { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.DELETE_TRACE, + payload: { + traceIndexes: this.props.traceIndexes + } + }); + return; + } + var axesToBeGarbageCollected = []; + var subplotToBeGarbageCollected = null; + var subplotType = (0, _lib.traceTypeToAxisType)(currentTrace.type); + + if (subplotType) { + var subplotNames = subplotType === 'cartesian' ? [currentTrace.xaxis || 'xaxis', currentTrace.yaxis || 'yaxis'] : currentTrace[_constants.SUBPLOT_TO_ATTR[subplotType].data] || _constants.SUBPLOT_TO_ATTR[subplotType].data; + + var isSubplotUsedAnywhereElse = function isSubplotUsedAnywhereElse(subplotType, subplotName) { + return _this3.context.fullData.some(function (trace) { + return (trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === subplotName || ((subplotType === 'xaxis' || subplotType === 'yaxis') && subplotName.charAt(1)) === '' || subplotName.split(subplotType)[1] === '' && trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === null) && trace.index !== _this3.props.traceIndexes[0]; + }); + }; + + // When we delete a subplot, make sure no unused axes/subplots are left + if (subplotType === 'cartesian') { + if (!isSubplotUsedAnywhereElse('xaxis', subplotNames[0])) { + axesToBeGarbageCollected.push(subplotNames[0]); + } + if (!isSubplotUsedAnywhereElse('yaxis', subplotNames[1])) { + axesToBeGarbageCollected.push(subplotNames[1]); + } + } else { + if (!isSubplotUsedAnywhereElse(subplotType, subplotNames)) { + subplotToBeGarbageCollected = subplotNames; + } + } + } + + if (this.context.onUpdate) { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.DELETE_TRACE, + payload: { + axesToBeGarbageCollected: axesToBeGarbageCollected, + subplotToBeGarbageCollected: subplotToBeGarbageCollected, + traceIndexes: this.props.traceIndexes + } + }); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, _extends({ name: this.name, icon: this.icon }, this.props)); + } + }]); + + return TraceConnectedComponent; + }(_react.Component); + + TraceConnectedComponent.displayName = 'TraceConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + TraceConnectedComponent.propTypes = { + traceIndexes: _propTypes2.default.arrayOf(_propTypes2.default.number).isRequired, + fullDataArrayPosition: _propTypes2.default.arrayOf(_propTypes2.default.number) + }; + + TraceConnectedComponent.contextTypes = { + fullData: _propTypes2.default.array, + data: _propTypes2.default.array, + plotly: _propTypes2.default.object, + onUpdate: _propTypes2.default.func + }; + + TraceConnectedComponent.childContextTypes = { + getValObject: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + defaultContainer: _propTypes2.default.object, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + traceIndexes: _propTypes2.default.array + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + TraceConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return TraceConnectedComponent; +} +//# sourceMappingURL=connectTraceToPlot.js.map \ No newline at end of file diff --git a/lib/lib/connectTraceToPlot.js.map b/lib/lib/connectTraceToPlot.js.map new file mode 100644 index 000000000..5c8390aed --- /dev/null +++ b/lib/lib/connectTraceToPlot.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectTraceToPlot.js"],"names":["connectTraceToPlot","WrappedComponent","TraceConnectedComponent","props","context","deleteTrace","bind","updateTrace","setLocals","nextProps","nextContext","traceIndexes","data","fullData","plotly","trace","fullTrace","childContext","getValObject","PlotSchema","getTraceValObject","attr","parts","updateContainer","deleteContainer","container","fullContainer","length","multiValuedFullContainer","forEach","Object","keys","t","key","searchArrays","multiValuedContainer","defaultContainer","icon","name","update","onUpdate","splitTraceGroup","fullDataArrayPosition","map","p","_group","containsAnSrc","filter","a","endsWith","Array","isArray","u","i","type","EDITOR_ACTIONS","UPDATE_TRACES","payload","currentTrace","DELETE_TRACE","axesToBeGarbageCollected","subplotToBeGarbageCollected","subplotType","subplotNames","xaxis","yaxis","SUBPLOT_TO_ATTR","isSubplotUsedAnywhereElse","subplotName","some","charAt","split","index","push","Component","displayName","propTypes","PropTypes","arrayOf","number","isRequired","contextTypes","array","object","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;;;kBAawBA,kB;;AAbxB;;;;AACA;;;;AACA;;;;AACA;;AAOA;;AACA;;;;;;;;;;AAEe,SAASA,kBAAT,CAA4BC,gBAA5B,EAA8C;AAAA,MACrDC,uBADqD;AAAA;;AAEzD,qCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBD,IAAjB,OAAnB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AARwD;AAAA;AAAA,gDAU/BK,SAV+B,EAUpBC,WAVoB,EAUP;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZwD;AAAA;AAAA,gCAc/CP,KAd+C,EAcxCC,OAdwC,EAc/B;AAAA,YACjBO,YADiB,GACDR,KADC,CACjBQ,YADiB;AAAA,YAEjBC,IAFiB,GAESR,OAFT,CAEjBQ,IAFiB;AAAA,YAEXC,QAFW,GAEST,OAFT,CAEXS,QAFW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D,4BAAc,KAAKR,KAAL,CAAWQ;AAHlB;AAFW,WAAtB;AAQD;AACF;AAxKwD;AAAA;AAAA,+BA0KhD;AACP,eAAO,8BAAC,gBAAD,aAAkB,MAAM,KAAK2B,IAA7B,EAAmC,MAAM,KAAKD,IAA9C,IAAwD,KAAKlC,KAA7D,EAAP;AACD;AA5KwD;;AAAA;AAAA,IACrBuE,gBADqB;;AA+K3DxE,0BAAwByE,WAAxB,sBAAuD,yBAAe1E,gBAAf,CAAvD;;AAEAC,0BAAwB0E,SAAxB,GAAoC;AAClCjE,kBAAckE,oBAAUC,OAAV,CAAkBD,oBAAUE,MAA5B,EAAoCC,UADhB;AAElCtC,2BAAuBmC,oBAAUC,OAAV,CAAkBD,oBAAUE,MAA5B;AAFW,GAApC;;AAKA7E,0BAAwB+E,YAAxB,GAAuC;AACrCpE,cAAUgE,oBAAUK,KADiB;AAErCtE,UAAMiE,oBAAUK,KAFqB;AAGrCpE,YAAQ+D,oBAAUM,MAHmB;AAIrC3C,cAAUqC,oBAAUO;AAJiB,GAAvC;;AAOAlF,0BAAwBmF,iBAAxB,GAA4C;AAC1CnE,kBAAc2D,oBAAUO,IADkB;AAE1C7D,qBAAiBsD,oBAAUO,IAFe;AAG1C5D,qBAAiBqD,oBAAUO,IAHe;AAI1ChD,sBAAkByC,oBAAUM,MAJc;AAK1C1D,eAAWoD,oBAAUM,MALqB;AAM1CzD,mBAAemD,oBAAUM,MANiB;AAO1CxE,kBAAckE,oBAAUK;AAPkB,GAA5C;;AA7L2D,MAuMpDI,oBAvMoD,GAuM5BrF,gBAvM4B,CAuMpDqF,oBAvMoD;;AAwM3DpF,0BAAwBoF,oBAAxB,GAA+CA,oBAA/C;;AAEA,SAAOpF,uBAAP;AACD","file":"connectTraceToPlot.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {\n getDisplayName,\n plotlyTraceToCustomTrace,\n renderTraceIcon,\n traceTypeToAxisType,\n getFullTrace,\n} from '../lib';\nimport {deepCopyPublic, setMultiValuedContainer} from './multiValues';\nimport {EDITOR_ACTIONS, SUBPLOT_TO_ATTR} from 'lib/constants';\n\nexport default function connectTraceToPlot(WrappedComponent) {\n class TraceConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteTrace = this.deleteTrace.bind(this);\n this.updateTrace = this.updateTrace.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {traceIndexes} = props;\n const {data, fullData, plotly} = context;\n\n const trace = data[traceIndexes[0]];\n const fullTrace = getFullTrace(props, context);\n\n this.childContext = {\n getValObject: attr =>\n !plotly\n ? null\n : plotly.PlotSchema.getTraceValObject(fullTrace, nestedProperty({}, attr).parts),\n updateContainer: this.updateTrace,\n deleteContainer: this.deleteTrace,\n container: trace,\n fullContainer: fullTrace,\n traceIndexes: this.props.traceIndexes,\n };\n\n if (traceIndexes.length > 1) {\n const multiValuedFullContainer = deepCopyPublic(fullTrace);\n fullData.forEach(t =>\n Object.keys(t).forEach(key =>\n setMultiValuedContainer(multiValuedFullContainer, deepCopyPublic(t), key, {\n searchArrays: true,\n })\n )\n );\n const multiValuedContainer = deepCopyPublic(trace);\n data.forEach(t =>\n Object.keys(t).forEach(key =>\n setMultiValuedContainer(multiValuedContainer, deepCopyPublic(t), key, {\n searchArrays: true,\n })\n )\n );\n this.childContext.fullContainer = multiValuedFullContainer;\n this.childContext.defaultContainer = fullTrace;\n this.childContext.container = multiValuedContainer;\n }\n\n if (trace && fullTrace) {\n this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace));\n this.name = fullTrace.name;\n }\n }\n\n getChildContext() {\n return this.childContext;\n }\n\n provideValue() {\n return this.childContext;\n }\n\n updateTrace(update) {\n if (this.context.onUpdate) {\n const splitTraceGroup = this.props.fullDataArrayPosition\n ? this.props.fullDataArrayPosition.map(p => this.context.fullData[p]._group)\n : null;\n\n const containsAnSrc = Object.keys(update).filter(a => a.endsWith('src')).length > 0;\n\n if (Array.isArray(update)) {\n update.forEach((u, i) => {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update: u,\n traceIndexes: [this.props.traceIndexes[i]],\n splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null,\n },\n });\n });\n } else if (splitTraceGroup && !containsAnSrc) {\n this.props.traceIndexes.forEach((t, i) => {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update,\n traceIndexes: [this.props.traceIndexes[i]],\n splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null,\n },\n });\n });\n } else {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update,\n traceIndexes: this.props.traceIndexes,\n },\n });\n }\n }\n }\n\n deleteTrace() {\n const currentTrace = this.context.fullData[this.props.traceIndexes[0]];\n if (!currentTrace && this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_TRACE,\n payload: {\n traceIndexes: this.props.traceIndexes,\n },\n });\n return;\n }\n const axesToBeGarbageCollected = [];\n let subplotToBeGarbageCollected = null;\n const subplotType = traceTypeToAxisType(currentTrace.type);\n\n if (subplotType) {\n const subplotNames =\n subplotType === 'cartesian'\n ? [currentTrace.xaxis || 'xaxis', currentTrace.yaxis || 'yaxis']\n : currentTrace[SUBPLOT_TO_ATTR[subplotType].data] || SUBPLOT_TO_ATTR[subplotType].data;\n\n const isSubplotUsedAnywhereElse = (subplotType, subplotName) =>\n this.context.fullData.some(\n trace =>\n (trace[SUBPLOT_TO_ATTR[subplotType].data] === subplotName ||\n (((subplotType === 'xaxis' || subplotType === 'yaxis') && subplotName.charAt(1)) ===\n '' ||\n (subplotName.split(subplotType)[1] === '' &&\n trace[SUBPLOT_TO_ATTR[subplotType].data] === null))) &&\n trace.index !== this.props.traceIndexes[0]\n );\n\n // When we delete a subplot, make sure no unused axes/subplots are left\n if (subplotType === 'cartesian') {\n if (!isSubplotUsedAnywhereElse('xaxis', subplotNames[0])) {\n axesToBeGarbageCollected.push(subplotNames[0]);\n }\n if (!isSubplotUsedAnywhereElse('yaxis', subplotNames[1])) {\n axesToBeGarbageCollected.push(subplotNames[1]);\n }\n } else {\n if (!isSubplotUsedAnywhereElse(subplotType, subplotNames)) {\n subplotToBeGarbageCollected = subplotNames;\n }\n }\n }\n\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_TRACE,\n payload: {\n axesToBeGarbageCollected,\n subplotToBeGarbageCollected,\n traceIndexes: this.props.traceIndexes,\n },\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n TraceConnectedComponent.displayName = `TraceConnected${getDisplayName(WrappedComponent)}`;\n\n TraceConnectedComponent.propTypes = {\n traceIndexes: PropTypes.arrayOf(PropTypes.number).isRequired,\n fullDataArrayPosition: PropTypes.arrayOf(PropTypes.number),\n };\n\n TraceConnectedComponent.contextTypes = {\n fullData: PropTypes.array,\n data: PropTypes.array,\n plotly: PropTypes.object,\n onUpdate: PropTypes.func,\n };\n\n TraceConnectedComponent.childContextTypes = {\n getValObject: PropTypes.func,\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n defaultContainer: PropTypes.object,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n traceIndexes: PropTypes.array,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n TraceConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return TraceConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectTransformToTrace.js b/lib/lib/connectTransformToTrace.js new file mode 100644 index 000000000..d1f266989 --- /dev/null +++ b/lib/lib/connectTransformToTrace.js @@ -0,0 +1,158 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectTransformToTrace; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectTransformToTrace(WrappedComponent) { + var TransformConnectedComponent = function (_Component) { + _inherits(TransformConnectedComponent, _Component); + + function TransformConnectedComponent(props, context) { + _classCallCheck(this, TransformConnectedComponent); + + var _this = _possibleConstructorReturn(this, (TransformConnectedComponent.__proto__ || Object.getPrototypeOf(TransformConnectedComponent)).call(this, props, context)); + + _this.deleteTransform = _this.deleteTransform.bind(_this); + _this.updateTransform = _this.updateTransform.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(TransformConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var transformIndex = props.transformIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var transforms = container.transforms || []; + var fullTransforms = fullContainer.transforms || []; + this.container = transforms[transformIndex]; + this.fullContainer = fullTransforms[transformIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('transforms[].' + attr); + }, + updateContainer: this.updateTransform, + deleteContainer: this.deleteTransform, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('transforms[].' + attr); + }, + updateContainer: this.updateTransform, + deleteContainer: this.deleteTransform, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateTransform', + value: function updateTransform(update) { + var newUpdate = {}; + var transformIndex = this.props.transformIndex; + + for (var key in update) { + var newkey = 'transforms[' + transformIndex + '].' + key; + newUpdate[newkey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'deleteTransform', + value: function deleteTransform() { + if (this.context.onUpdate) { + this.context.onUpdate({ + type: _constants.EDITOR_ACTIONS.DELETE_TRANSFORM, + payload: { + traceIndex: this.context.fullContainer.index, + transformIndex: this.props.transformIndex + } + }); + } + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return TransformConnectedComponent; + }(_react.Component); + + TransformConnectedComponent.displayName = 'TransformConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + TransformConnectedComponent.propTypes = { + transformIndex: _propTypes2.default.number.isRequired + }; + + TransformConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + data: _propTypes2.default.array, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + TransformConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + deleteContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return TransformConnectedComponent; +} +//# sourceMappingURL=connectTransformToTrace.js.map \ No newline at end of file diff --git a/lib/lib/connectTransformToTrace.js.map b/lib/lib/connectTransformToTrace.js.map new file mode 100644 index 000000000..24db5e0b1 --- /dev/null +++ b/lib/lib/connectTransformToTrace.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectTransformToTrace.js"],"names":["connectTransformToTrace","WrappedComponent","TransformConnectedComponent","props","context","deleteTransform","bind","updateTransform","setLocals","nextProps","nextContext","transformIndex","container","fullContainer","transforms","fullTransforms","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_TRANSFORM","payload","traceIndex","index","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,uB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,uBAAT,CAAiCC,gBAAjC,EAAmD;AAAA,MAC1DC,2BAD0D;AAAA;;AAE9D,yCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,4JACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,eAAL,GAAuB,MAAKA,eAAL,CAAqBC,IAArB,OAAvB;AACA,YAAKC,eAAL,GAAuB,MAAKA,eAAL,CAAqBD,IAArB,OAAvB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR6D;AAAA;AAAA,gDAUpCK,SAVoC,EAUzBC,WAVyB,EAUZ;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZ6D;AAAA;AAAA,gCAcpDP,KAdoD,EAc7CC,OAd6C,EAcpC;AAAA,Y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formToTrace.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectTransformToTrace(WrappedComponent) {\n class TransformConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteTransform = this.deleteTransform.bind(this);\n this.updateTransform = this.updateTransform.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {transformIndex} = props;\n const {container, fullContainer} = context;\n\n const transforms = container.transforms || [];\n const fullTransforms = fullContainer.transforms || [];\n this.container = transforms[transformIndex];\n this.fullContainer = fullTransforms[transformIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`),\n updateContainer: this.updateTransform,\n deleteContainer: this.deleteTransform,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`),\n updateContainer: this.updateTransform,\n deleteContainer: this.deleteTransform,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateTransform(update) {\n const newUpdate = {};\n const {transformIndex} = this.props;\n for (const key in update) {\n const newkey = `transforms[${transformIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteTransform() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_TRANSFORM,\n payload: {\n traceIndex: this.context.fullContainer.index,\n transformIndex: this.props.transformIndex,\n },\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n TransformConnectedComponent.displayName = `TransformConnected${getDisplayName(WrappedComponent)}`;\n\n TransformConnectedComponent.propTypes = {\n transformIndex: PropTypes.number.isRequired,\n };\n\n TransformConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n TransformConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return TransformConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectUpdateMenuToLayout.js b/lib/lib/connectUpdateMenuToLayout.js new file mode 100644 index 000000000..d755e6476 --- /dev/null +++ b/lib/lib/connectUpdateMenuToLayout.js @@ -0,0 +1,138 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = connectUpdateMenuToLayout; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _lib = require('../lib'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function connectUpdateMenuToLayout(WrappedComponent) { + var UpdateMenuConnectedComponent = function (_Component) { + _inherits(UpdateMenuConnectedComponent, _Component); + + function UpdateMenuConnectedComponent(props, context) { + _classCallCheck(this, UpdateMenuConnectedComponent); + + var _this = _possibleConstructorReturn(this, (UpdateMenuConnectedComponent.__proto__ || Object.getPrototypeOf(UpdateMenuConnectedComponent)).call(this, props, context)); + + _this.updateUpdateMenu = _this.updateUpdateMenu.bind(_this); + _this.setLocals(props, context); + return _this; + } + + _createClass(UpdateMenuConnectedComponent, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); + } + }, { + key: 'setLocals', + value: function setLocals(props, context) { + var updateMenuIndex = props.updateMenuIndex; + var container = context.container, + fullContainer = context.fullContainer; + + + var updatemenus = container.updatemenus || []; + var fullUpdateMenus = fullContainer.updatemenus || []; + this.container = updatemenus[updateMenuIndex]; + this.fullContainer = fullUpdateMenus[updateMenuIndex]; + } + }, { + key: 'getChildContext', + value: function getChildContext() { + var _this2 = this; + + return { + getValObject: function getValObject(attr) { + return !_this2.context.getValObject ? null : _this2.context.getValObject('updatemenus[].' + attr); + }, + updateContainer: this.updateUpdateMenu, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'provideValue', + value: function provideValue() { + var _this3 = this; + + return { + getValObject: function getValObject(attr) { + return !_this3.context.getValObject ? null : _this3.context.getValObject('updatemenus[].' + attr); + }, + updateContainer: this.updateUpdateMenu, + container: this.container, + fullContainer: this.fullContainer + }; + } + }, { + key: 'updateUpdateMenu', + value: function updateUpdateMenu(update) { + var newUpdate = {}; + var updateMenuIndex = this.props.updateMenuIndex; + + for (var key in update) { + var newkey = 'updatemenus[' + updateMenuIndex + '].' + key; + newUpdate[newkey] = update[key]; + } + this.context.updateContainer(newUpdate); + } + }, { + key: 'render', + value: function render() { + return _react2.default.createElement(WrappedComponent, this.props); + } + }]); + + return UpdateMenuConnectedComponent; + }(_react.Component); + + UpdateMenuConnectedComponent.displayName = 'UpdateMenuConnected' + (0, _lib.getDisplayName)(WrappedComponent); + + UpdateMenuConnectedComponent.propTypes = { + updateMenuIndex: _propTypes2.default.number.isRequired + }; + + UpdateMenuConnectedComponent.contextTypes = { + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + onUpdate: _propTypes2.default.func, + updateContainer: _propTypes2.default.func, + getValObject: _propTypes2.default.func + }; + + UpdateMenuConnectedComponent.childContextTypes = { + updateContainer: _propTypes2.default.func, + container: _propTypes2.default.object, + fullContainer: _propTypes2.default.object, + getValObject: _propTypes2.default.func + }; + + var plotly_editor_traits = WrappedComponent.plotly_editor_traits; + + UpdateMenuConnectedComponent.plotly_editor_traits = plotly_editor_traits; + + return UpdateMenuConnectedComponent; +} +//# sourceMappingURL=connectUpdateMenuToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectUpdateMenuToLayout.js.map b/lib/lib/connectUpdateMenuToLayout.js.map new file mode 100644 index 000000000..416d9db04 --- /dev/null +++ b/lib/lib/connectUpdateMenuToLayout.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/connectUpdateMenuToLayout.js"],"names":["connectUpdateMenuToLayout","WrappedComponent","UpdateMenuConnectedComponent","props","context","updateUpdateMenu","bind","setLocals","nextProps","nextContext","updateMenuIndex","container","fullContainer","updatemenus","fullUpdateMenus","getValObject","attr","updateContainer","update","newUpdate","key","newkey","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","onUpdate","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAIwBA,yB;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,yBAAT,CAAmCC,gBAAnC,EAAqD;AAAA,MAC5DC,4BAD4D;AAAA;;AAEhE,0CAAYC,KAAZ,EAAmBC,OAAnB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';\nimport {getDisplayName} from '../lib';\n\nexport default function connectUpdateMenuToLayout(WrappedComponent) {\n class UpdateMenuConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n this.updateUpdateMenu = this.updateUpdateMenu.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {updateMenuIndex} = props;\n const {container, fullContainer} = context;\n\n const updatemenus = container.updatemenus || [];\n const fullUpdateMenus = fullContainer.updatemenus || [];\n this.container = updatemenus[updateMenuIndex];\n this.fullContainer = fullUpdateMenus[updateMenuIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`updatemenus[].${attr}`),\n updateContainer: this.updateUpdateMenu,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`updatemenus[].${attr}`),\n updateContainer: this.updateUpdateMenu,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateUpdateMenu(update) {\n const newUpdate = {};\n const {updateMenuIndex} = this.props;\n for (const key in update) {\n const newkey = `updatemenus[${updateMenuIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n UpdateMenuConnectedComponent.displayName = `UpdateMenuConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n UpdateMenuConnectedComponent.propTypes = {\n updateMenuIndex: PropTypes.number.isRequired,\n };\n\n UpdateMenuConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n UpdateMenuConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n UpdateMenuConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return UpdateMenuConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/constants.js b/lib/lib/constants.js new file mode 100644 index 000000000..f3168d0d4 --- /dev/null +++ b/lib/lib/constants.js @@ -0,0 +1,112 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var baseClass = exports.baseClass = 'plotly-editor'; + +/* + * Control represents multiple settings (like for several axes) + * and the values are different. + * + * Because this is sometimes used in contexts where users can enter freeform + * strings, we include a non-printable character (ESC) so it's not something + * people could type. + */ +var MULTI_VALUED = exports.MULTI_VALUED = '\x1bMIXED_VALUES'; + +// how mixed values are represented in text inputs +var MULTI_VALUED_PLACEHOLDER = exports.MULTI_VALUED_PLACEHOLDER = '---'; + +var getMultiValueText = exports.getMultiValueText = function getMultiValueText(key, _) { + var multiValueText = { + title: _('Multiple Values'), + text: _('This input has multiple values associated with it. ' + 'Changing this setting will override these custom inputs.'), + subText: _("Common Case: An 'All' tab might display this message " + 'because the X and Y tabs contain different settings.') + }; + return multiValueText[key]; +}; + +var EDITOR_ACTIONS = exports.EDITOR_ACTIONS = { + UPDATE_TRACES: 'plotly-editor-update-traces', + ADD_TRACE: 'plotly-editor-add-trace', + DELETE_TRACE: 'plotly-editor-delete-trace', + UPDATE_LAYOUT: 'plotly-editor-update-layout', + DELETE_ANNOTATION: 'plotly-editor-delete-annotation', + DELETE_SHAPE: 'plotly-editor-delete-shape', + DELETE_IMAGE: 'plotly-editor-delete-image', + DELETE_RANGESELECTOR: 'plotly-editor-delete-rangeselector', + DELETE_TRANSFORM: 'plotly-editor-delete-transform' +}; + +var DEFAULT_FONTS = exports.DEFAULT_FONTS = [{ label: 'Sans Serif', value: 'sans-serif' }, { label: 'Serif', value: 'serif' }, { label: 'Monospaced', value: 'monospace' }]; + +var RETURN_KEY = exports.RETURN_KEY = 'Enter'; +var ESCAPE_KEY = exports.ESCAPE_KEY = 'Escape'; +var COMMAND_KEY = exports.COMMAND_KEY = 'Meta'; +var CONTROL_KEY = exports.CONTROL_KEY = 'Control'; + +// matches gd._fullLayout._subplots categories except for xaxis & yaxis which +// are in fact cartesian types +var TRACE_TO_AXIS = exports.TRACE_TO_AXIS = { + cartesian: ['scatter', 'scattergl', 'box', 'violin', 'bar', 'heatmap', 'heatmapgl', 'contour', 'ohlc', 'candlestick', 'histogram', 'histogram2d', 'histogram2dcontour'], + ternary: ['scatterternary'], + gl3d: ['scatter3d', 'surface', 'mesh3d', 'cone', 'streamtube'], + geo: ['scattergeo', 'choropleth'], + mapbox: ['scattermapbox'], + polar: ['scatterpolar', 'scatterpolargl', 'barpolar'] +}; + +// Note: scene, and xaxis/yaxis were added for convenience sake even though they're not subplot types +var SUBPLOT_TO_ATTR = exports.SUBPLOT_TO_ATTR = { + cartesian: { data: ['xaxis', 'yaxis'], layout: ['x', 'y'] }, + xaxis: { data: 'xaxis', layout: 'x' }, + yaxis: { data: 'yaxis', layout: 'y' }, + x: { data: 'xaxis', layout: 'x' }, + y: { data: 'yaxis', layout: 'y' }, + ternary: { data: 'subplot', layout: 'ternary' }, + gl3d: { data: 'scene', layout: 'scene' }, + scene: { data: 'scene', layout: 'scene' }, + geo: { data: 'geo', layout: 'geo' }, + mapbox: { data: 'subplot', layout: 'mapbox' }, + polar: { data: 'subplot', layout: 'polar' } +}; + +var subplotName = exports.subplotName = function subplotName(type, _) { + return { + x: _('X'), + y: _('Y'), + ternary: _('Ternary'), + gl3d: _('Scene'), + scene: _('Scene'), + geo: _('Geo'), + mapbox: _('Mapbox'), + polar: _('Polar') + }[type]; +}; + +var TRANSFORMS_LIST = exports.TRANSFORMS_LIST = ['filter', 'groupby', 'aggregate', 'sort']; + +var TRANSFORMABLE_TRACES = exports.TRANSFORMABLE_TRACES = ['scatter', 'scattergl', 'box', 'violin', 'bar', 'ohlc', 'candlestick', 'histogram', 'histogram2d']; + +var TRACES_WITH_GL = exports.TRACES_WITH_GL = ['scatter', 'scatterpolar', 'scattergl', 'scatterpolargl']; + +var COLORS = exports.COLORS = { + charcoal: '#444444', + white: '#ffffff', + mutedBlue: '#1f77b4', + safetyOrange: '#ff7f0e', + cookedAsparagusGreen: '#2ca02c', + brickRed: '#d62728', + mutedPurple: '#9467bd', + chestnutBrown: '#8c564b', + raspberryYogurtPink: '#e377c2', + middleGray: '#7f7f7f', + curryYellowGreen: '#bcbd22', + blueTeal: '#17becf', + editorLink: '#447bdc', + black: '#000000' +}; + +var DEFAULT_COLORS = exports.DEFAULT_COLORS = [COLORS.charcoal, COLORS.white, COLORS.mutedBlue, COLORS.safetyOrange, COLORS.cookedAsparagusGreen, COLORS.brickRed, COLORS.mutedPurple, COLORS.chestnutBrown, COLORS.raspberryYogurtPink, COLORS.middleGray, COLORS.curryYellowGreen, COLORS.blueTeal]; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/lib/lib/constants.js.map b/lib/lib/constants.js.map new file mode 100644 index 000000000..48812fc95 --- /dev/null +++ b/lib/lib/constants.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/constants.js"],"names":["baseClass","MULTI_VALUED","MULTI_VALUED_PLACEHOLDER","getMultiValueText","key","_","multiValueText","title","text","subText","EDITOR_ACTIONS","UPDATE_TRACES","ADD_TRACE","DELETE_TRACE","UPDATE_LAYOUT","DELETE_ANNOTATION","DELETE_SHAPE","DELETE_IMAGE","DELETE_RANGESELECTOR","DELETE_TRANSFORM","DEFAULT_FONTS","label","value","RETURN_KEY","ESCAPE_KEY","COMMAND_KEY","CONTROL_KEY","TRACE_TO_AXIS","cartesian","ternary","gl3d","geo","mapbox","polar","SUBPLOT_TO_ATTR","data","layout","xaxis","yaxis","x","y","scene","subplotName","type","TRANSFORMS_LIST","TRANSFORMABLE_TRACES","TRACES_WITH_GL","COLORS","charcoal","white","mutedBlue","safetyOrange","cookedAsparagusGreen","brickRed","mutedPurple","chestnutBrown","raspberryYogurtPink","middleGray","curryYellowGreen","blueTeal","editorLink","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B,YAAQ3B,EAAE,QAAF,CAPT;AAQC4B,WAAO5B,EAAE,OAAF;AARR,IASCsC,IATD,CADwB;AAAA,CAApB;;AAYA,IAAMC,4CAAkB,CAAC,QAAD,EAAW,SAAX,EAAsB,WAAtB,EAAmC,MAAnC,CAAxB;;AAEA,IAAMC,sDAAuB,CAClC,SADkC,EAElC,WAFkC,EAGlC,KAHkC,EAIlC,QAJkC,EAKlC,KALkC,EAMlC,MANkC,EAOlC,aAPkC,EAQlC,WARkC,EASlC,aATkC,CAA7B;;AAYA,IAAMC,0CAAiB,CAAC,SAAD,EAAY,cAAZ,EAA4B,WAA5B,EAAyC,gBAAzC,CAAvB;;AAEA,IAAMC,0BAAS;AACpBC,YAAU,SADU;AAEpBC,SAAO,SAFa;AAGpBC,aAAW,SAHS;AAIpBC,gBAAc,SAJM;AAKpBC,wBAAsB,SALF;AAMpBC,YAAU,SANU;AAOpBC,eAAa,SAPO;AAQpBC,iBAAe,SARK;AASpBC,uBAAqB,SATD;AAUpBC,cAAY,SAVQ;AAWpBC,oBAAkB,SAXE;AAYpBC,YAAU,SAZU;AAapBC,cAAY,SAbQ;AAcpBC,SAAO;AAda,CAAf;;AAiBA,IAAMC,0CAAiB,CAC5Bf,OAAOC,QADqB,EAE5BD,OAAOE,KAFqB,EAG5BF,OAAOG,SAHqB,EAI5BH,OAAOI,YAJqB,EAK5BJ,OAAOK,oBALqB,EAM5BL,OAAOM,QANqB,EAO5BN,OAAOO,WAPqB,EAQ5BP,OAAOQ,aARqB,EAS5BR,OAAOS,mBATqB,EAU5BT,OAAOU,UAVqB,EAW5BV,OAAOW,gBAXqB,EAY5BX,OAAOY,QAZqB,CAAvB","file":"constants.js","sourcesContent":["export const baseClass = 'plotly-editor';\n\n/*\n * Control represents multiple settings (like for several axes)\n * and the values are different.\n *\n * Because this is sometimes used in contexts where users can enter freeform\n * strings, we include a non-printable character (ESC) so it's not something\n * people could type.\n */\nexport const MULTI_VALUED = '\\x1bMIXED_VALUES';\n\n// how mixed values are represented in text inputs\nexport const MULTI_VALUED_PLACEHOLDER = '---';\n\nexport const getMultiValueText = (key, _) => {\n const multiValueText = {\n title: _('Multiple Values'),\n text: _(\n 'This input has multiple values associated with it. ' +\n 'Changing this setting will override these custom inputs.'\n ),\n subText: _(\n \"Common Case: An 'All' tab might display this message \" +\n 'because the X and Y tabs contain different settings.'\n ),\n };\n return multiValueText[key];\n};\n\nexport const EDITOR_ACTIONS = {\n UPDATE_TRACES: 'plotly-editor-update-traces',\n ADD_TRACE: 'plotly-editor-add-trace',\n DELETE_TRACE: 'plotly-editor-delete-trace',\n UPDATE_LAYOUT: 'plotly-editor-update-layout',\n DELETE_ANNOTATION: 'plotly-editor-delete-annotation',\n DELETE_SHAPE: 'plotly-editor-delete-shape',\n DELETE_IMAGE: 'plotly-editor-delete-image',\n DELETE_RANGESELECTOR: 'plotly-editor-delete-rangeselector',\n DELETE_TRANSFORM: 'plotly-editor-delete-transform',\n};\n\nexport const DEFAULT_FONTS = [\n {label: 'Sans Serif', value: 'sans-serif'},\n {label: 'Serif', value: 'serif'},\n {label: 'Monospaced', value: 'monospace'},\n];\n\nexport const RETURN_KEY = 'Enter';\nexport const ESCAPE_KEY = 'Escape';\nexport const COMMAND_KEY = 'Meta';\nexport const CONTROL_KEY = 'Control';\n\n// matches gd._fullLayout._subplots categories except for xaxis & yaxis which\n// are in fact cartesian types\nexport const TRACE_TO_AXIS = {\n cartesian: [\n 'scatter',\n 'scattergl',\n 'box',\n 'violin',\n 'bar',\n 'heatmap',\n 'heatmapgl',\n 'contour',\n 'ohlc',\n 'candlestick',\n 'histogram',\n 'histogram2d',\n 'histogram2dcontour',\n ],\n ternary: ['scatterternary'],\n gl3d: ['scatter3d', 'surface', 'mesh3d', 'cone', 'streamtube'],\n geo: ['scattergeo', 'choropleth'],\n mapbox: ['scattermapbox'],\n polar: ['scatterpolar', 'scatterpolargl', 'barpolar'],\n};\n\n// Note: scene, and xaxis/yaxis were added for convenience sake even though they're not subplot types\nexport const SUBPLOT_TO_ATTR = {\n cartesian: {data: ['xaxis', 'yaxis'], layout: ['x', 'y']},\n xaxis: {data: 'xaxis', layout: 'x'},\n yaxis: {data: 'yaxis', layout: 'y'},\n x: {data: 'xaxis', layout: 'x'},\n y: {data: 'yaxis', layout: 'y'},\n ternary: {data: 'subplot', layout: 'ternary'},\n gl3d: {data: 'scene', layout: 'scene'},\n scene: {data: 'scene', layout: 'scene'},\n geo: {data: 'geo', layout: 'geo'},\n mapbox: {data: 'subplot', layout: 'mapbox'},\n polar: {data: 'subplot', layout: 'polar'},\n};\n\nexport const subplotName = (type, _) =>\n ({\n x: _('X'),\n y: _('Y'),\n ternary: _('Ternary'),\n gl3d: _('Scene'),\n scene: _('Scene'),\n geo: _('Geo'),\n mapbox: _('Mapbox'),\n polar: _('Polar'),\n }[type]);\n\nexport const TRANSFORMS_LIST = ['filter', 'groupby', 'aggregate', 'sort'];\n\nexport const TRANSFORMABLE_TRACES = [\n 'scatter',\n 'scattergl',\n 'box',\n 'violin',\n 'bar',\n 'ohlc',\n 'candlestick',\n 'histogram',\n 'histogram2d',\n];\n\nexport const TRACES_WITH_GL = ['scatter', 'scatterpolar', 'scattergl', 'scatterpolargl'];\n\nexport const COLORS = {\n charcoal: '#444444',\n white: '#ffffff',\n mutedBlue: '#1f77b4',\n safetyOrange: '#ff7f0e',\n cookedAsparagusGreen: '#2ca02c',\n brickRed: '#d62728',\n mutedPurple: '#9467bd',\n chestnutBrown: '#8c564b',\n raspberryYogurtPink: '#e377c2',\n middleGray: '#7f7f7f',\n curryYellowGreen: '#bcbd22',\n blueTeal: '#17becf',\n editorLink: '#447bdc',\n black: '#000000',\n};\n\nexport const DEFAULT_COLORS = [\n COLORS.charcoal,\n COLORS.white,\n COLORS.mutedBlue,\n COLORS.safetyOrange,\n COLORS.cookedAsparagusGreen,\n COLORS.brickRed,\n COLORS.mutedPurple,\n COLORS.chestnutBrown,\n COLORS.raspberryYogurtPink,\n COLORS.middleGray,\n COLORS.curryYellowGreen,\n COLORS.blueTeal,\n];\n"]} \ No newline at end of file diff --git a/lib/lib/customTraceType.js b/lib/lib/customTraceType.js new file mode 100644 index 000000000..29efd1b0c --- /dev/null +++ b/lib/lib/customTraceType.js @@ -0,0 +1,109 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +exports.plotlyTraceToCustomTrace = plotlyTraceToCustomTrace; +exports.traceTypeToPlotlyInitFigure = traceTypeToPlotlyInitFigure; + +var _constants = require('./constants'); + +function plotlyTraceToCustomTrace(trace) { + if ((typeof trace === 'undefined' ? 'undefined' : _typeof(trace)) !== 'object') { + throw new Error('trace provided to plotlyTraceToCustomTrace function should be an object, received ' + (typeof trace === 'undefined' ? 'undefined' : _typeof(trace))); + } + + var gl = 'gl'; + var type = trace.type ? trace.type.endsWith(gl) ? trace.type.slice(0, -gl.length) : trace.type : 'scatter'; + + if ((type === 'scatter' || type === 'scattergl') && (![null, undefined, ''].includes(trace.stackgroup) || // eslint-disable-line no-undefined + ['tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'].includes(trace.fill))) { + return 'area'; + } else if ((type === 'scatter' || type === 'scattergl') && (trace.mode === 'lines' || trace.mode === 'lines+markers')) { + return 'line'; + } else if (type === 'scatter3d' && trace.mode === 'lines') { + return 'line3d'; + } + return type; +} + +function traceTypeToPlotlyInitFigure(traceType) { + var gl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var scatterTrace = { type: 'scatter' + gl, mode: 'markers', stackgroup: null }; + + switch (traceType) { + case 'line': + return { type: 'scatter' + gl, mode: 'lines', stackgroup: null }; + case 'scatter': + return scatterTrace; + case undefined: + // eslint-disable-line + return scatterTrace; + case 'area': + return { type: 'scatter' + gl, mode: 'lines', stackgroup: 1 }; + case 'scatterpolar': + return { type: 'scatterpolar' + gl }; + case 'ohlc': + return { + type: 'ohlc', + decreasing: { line: { color: _constants.COLORS.middleGray } }, + increasing: { line: { color: _constants.COLORS.blueTeal } } + }; + case 'candlestick': + return { + type: 'candlestick', + decreasing: { + line: { color: _constants.COLORS.middleGray }, + fillcolor: 'rgba(127, 127, 127, 0.5)' + }, + increasing: { + line: { color: _constants.COLORS.blueTeal }, + fillcolor: 'rgba(23, 190, 207, 0.5)' + } + }; + case 'box': + return { + type: 'box', + boxpoints: false + }; + case 'violin': + return { + type: 'violin', + bandwidth: 0 + }; + case 'line3d': + return { + type: 'scatter3d', + mode: 'lines' + }; + case 'scatter3d': + return { + type: 'scatter3d', + mode: 'markers' + }; + case 'pie': + return { + marker: { + colors: [] + }, + type: 'pie' + }; + case 'bar': + return { + orientation: 'v', + type: 'bar' + }; + case 'cone': + return { + sizeref: 1, + type: 'cone' + }; + default: + return { type: traceType }; + } +} +//# sourceMappingURL=customTraceType.js.map \ No newline at end of file diff --git a/lib/lib/customTraceType.js.map b/lib/lib/customTraceType.js.map new file mode 100644 index 000000000..84211f28d --- /dev/null +++ b/lib/lib/customTraceType.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/customTraceType.js"],"names":["plotlyTraceToCustomTrace","traceTypeToPlotlyInitFigure","trace","Error","gl","type","endsWith","slice","length","undefined","includes","stackgroup","fill","mode","traceType","scatterTrace","decreasing","line","color","COLORS","middleGray","increasing","blueTeal","fillcolor","boxpoints","bandwidth","marker","colors","orientation","sizeref"],"mappings":";;;;;;;;QAEgBA,wB,GAAAA,wB;QA+BAC,2B,GAAAA,2B;;AAjChB;;AAEO,SAASD,wBAAT,CAAkCE,KAAlC,EAAyC;AAC9C,MAAI,QAAOA,KAAP,yCAAOA,KAAP,OAAiB,QAArB,EAA+B;AAC7B,UAAM,IAAIC,KAAJ,gGACwFD,KADxF,yCACwFA,KADxF,GAAN;AAGD;;AAED,MAAME,KAAK,IAAX;AAC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AsCF,YAAY,CAAlD,EAAP;AACF,SAAK,cAAL;AACE,aAAO,EAACN,MAAM,iBAAiBD,EAAxB,EAAP;AACF,SAAK,MAAL;AACE,aAAO;AACLC,cAAM,MADD;AAELW,oBAAY,EAACC,MAAM,EAACC,OAAOC,kBAAOC,UAAf,EAAP,EAFP;AAGLC,oBAAY,EAACJ,MAAM,EAACC,OAAOC,kBAAOG,QAAf,EAAP;AAHP,OAAP;AAKF,SAAK,aAAL;AACE,aAAO;AACLjB,cAAM,aADD;AAELW,oBAAY;AACVC,gBAAM,EAACC,OAAOC,kBAAOC,UAAf,EADI;AAEVG,qBAAW;AAFD,SAFP;AAMLF,oBAAY;AACVJ,gBAAM,EAACC,OAAOC,kBAAOG,QAAf,EADI;AAEVC,qBAAW;AAFD;AANP,OAAP;AAWF,SAAK,KAAL;AACE,aAAO;AACLlB,cAAM,KADD;AAELmB,mBAAW;AAFN,OAAP;AAIF,SAAK,QAAL;AACE,aAAO;AACLnB,cAAM,QADD;AAELoB,mBAAW;AAFN,OAAP;AAIF,SAAK,QAAL;AACE,aAAO;AACLpB,cAAM,WADD;AAELQ,cAAM;AAFD,OAAP;AAIF,SAAK,WAAL;AACE,aAAO;AACLR,cAAM,WADD;AAELQ,cAAM;AAFD,OAAP;AAIF,SAAK,KAAL;AACE,aAAO;AACLa,gBAAQ;AACNC,kBAAQ;AADF,SADH;AAILtB,cAAM;AAJD,OAAP;AAMF,SAAK,KAAL;AACE,aAAO;AACLuB,qBAAa,GADR;AAELvB,cAAM;AAFD,OAAP;AAIF,SAAK,MAAL;AACE,aAAO;AACLwB,iBAAS,CADJ;AAELxB,cAAM;AAFD,OAAP;AAIF;AACE,aAAO,EAACA,MAAMS,SAAP,EAAP;AAnEJ;AAqED","file":"customTraceType.js","sourcesContent":["import {COLORS} from 'lib/constants';\n\nexport function plotlyTraceToCustomTrace(trace) {\n if (typeof trace !== 'object') {\n throw new Error(\n `trace provided to plotlyTraceToCustomTrace function should be an object, received ${typeof trace}`\n );\n }\n\n const gl = 'gl';\n const type = trace.type\n ? trace.type.endsWith(gl)\n ? trace.type.slice(0, -gl.length)\n : trace.type\n : 'scatter';\n\n if (\n (type === 'scatter' || type === 'scattergl') &&\n (![null, undefined, ''].includes(trace.stackgroup) || // eslint-disable-line no-undefined\n ['tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'].includes(trace.fill))\n ) {\n return 'area';\n } else if (\n (type === 'scatter' || type === 'scattergl') &&\n (trace.mode === 'lines' || trace.mode === 'lines+markers')\n ) {\n return 'line';\n } else if (type === 'scatter3d' && trace.mode === 'lines') {\n return 'line3d';\n }\n return type;\n}\n\nexport function traceTypeToPlotlyInitFigure(traceType, gl = '') {\n const scatterTrace = {type: 'scatter' + gl, mode: 'markers', stackgroup: null};\n\n switch (traceType) {\n case 'line':\n return {type: 'scatter' + gl, mode: 'lines', stackgroup: null};\n case 'scatter':\n return scatterTrace;\n case undefined: // eslint-disable-line\n return scatterTrace;\n case 'area':\n return {type: 'scatter' + gl, mode: 'lines', stackgroup: 1};\n case 'scatterpolar':\n return {type: 'scatterpolar' + gl};\n case 'ohlc':\n return {\n type: 'ohlc',\n decreasing: {line: {color: COLORS.middleGray}},\n increasing: {line: {color: COLORS.blueTeal}},\n };\n case 'candlestick':\n return {\n type: 'candlestick',\n decreasing: {\n line: {color: COLORS.middleGray},\n fillcolor: 'rgba(127, 127, 127, 0.5)',\n },\n increasing: {\n line: {color: COLORS.blueTeal},\n fillcolor: 'rgba(23, 190, 207, 0.5)',\n },\n };\n case 'box':\n return {\n type: 'box',\n boxpoints: false,\n };\n case 'violin':\n return {\n type: 'violin',\n bandwidth: 0,\n };\n case 'line3d':\n return {\n type: 'scatter3d',\n mode: 'lines',\n };\n case 'scatter3d':\n return {\n type: 'scatter3d',\n mode: 'markers',\n };\n case 'pie':\n return {\n marker: {\n colors: [],\n },\n type: 'pie',\n };\n case 'bar':\n return {\n orientation: 'v',\n type: 'bar',\n };\n case 'cone':\n return {\n sizeref: 1,\n type: 'cone',\n };\n default:\n return {type: traceType};\n }\n}\n"]} \ No newline at end of file diff --git a/lib/lib/dereference.js b/lib/lib/dereference.js new file mode 100644 index 000000000..5af1a6805 --- /dev/null +++ b/lib/lib/dereference.js @@ -0,0 +1,60 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = dereference; + +var _walkObject = require('./walkObject'); + +var _walkObject2 = _interopRequireDefault(_walkObject); + +var _index = require('./index'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SRC_ATTR_PATTERN = /src$/; + +function dereference(container, dataSources) { + var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { deleteKeys: false }; + + var replacer = function replacer(key, parent, srcPath) { + if (!SRC_ATTR_PATTERN.test(key)) { + return; + } + + var dataKey = key.replace(SRC_ATTR_PATTERN, ''); + var traceType = parent.type; + + var srcRef = config.toSrc ? config.toSrc(parent[key]) : parent[key]; + + // making this into an array to more easily lookup 1d and 2d srcs in dataSourceOptions + if (!Array.isArray(srcRef)) { + srcRef = [srcRef]; + } + + var data = srcRef.map(function (ref) { + if (config.deleteKeys && !(ref in dataSources)) { + delete parent[dataKey]; + } + return dataSources[ref]; + }); + + // remove extra data wrapping + if (srcRef.length === 1) { + data = data[0]; + } + + if (!Array.isArray(data)) { + return; + } + + parent[dataKey] = (0, _index.maybeTransposeData)(data, srcPath, traceType); + }; + + (0, _walkObject2.default)(container, replacer, { + walkArraysMatchingKeys: ['data', 'transforms'], + pathType: 'nestedProperty' + }); +} +//# sourceMappingURL=dereference.js.map \ No newline at end of file diff --git a/lib/lib/dereference.js.map b/lib/lib/dereference.js.map new file mode 100644 index 000000000..6585881ec --- /dev/null +++ b/lib/lib/dereference.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/dereference.js"],"names":["dereference","SRC_ATTR_PATTERN","container","dataSources","config","deleteKeys","replacer","key","parent","srcPath","test","dataKey","replace","traceType","type","srcRef","toSrc","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CAAC,MAAD,EAAS,YAAT,CADM;AAE9BC,cAAU;AAFoB,GAAhC;AAID","file":"dereference.js","sourcesContent":["import walkObject from './walkObject';\nimport {maybeTransposeData} from './index';\n\nconst SRC_ATTR_PATTERN = /src$/;\n\nexport default function dereference(container, dataSources, config = {deleteKeys: false}) {\n const replacer = (key, parent, srcPath) => {\n if (!SRC_ATTR_PATTERN.test(key)) {\n return;\n }\n\n const dataKey = key.replace(SRC_ATTR_PATTERN, '');\n const traceType = parent.type;\n\n let srcRef = config.toSrc ? config.toSrc(parent[key]) : parent[key];\n\n // making this into an array to more easily lookup 1d and 2d srcs in dataSourceOptions\n if (!Array.isArray(srcRef)) {\n srcRef = [srcRef];\n }\n\n let data = srcRef.map(ref => {\n if (config.deleteKeys && !(ref in dataSources)) {\n delete parent[dataKey];\n }\n return dataSources[ref];\n });\n\n // remove extra data wrapping\n if (srcRef.length === 1) {\n data = data[0];\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n parent[dataKey] = maybeTransposeData(data, srcPath, traceType);\n };\n\n walkObject(container, replacer, {\n walkArraysMatchingKeys: ['data', 'transforms'],\n pathType: 'nestedProperty',\n });\n}\n"]} \ No newline at end of file diff --git a/lib/lib/getAllAxes.js b/lib/lib/getAllAxes.js new file mode 100644 index 000000000..e32310077 --- /dev/null +++ b/lib/lib/getAllAxes.js @@ -0,0 +1,114 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getAllAxes; +exports.traceTypeToAxisType = traceTypeToAxisType; +exports.axisIdToAxisName = axisIdToAxisName; +exports.getAxisTitle = getAxisTitle; +exports.getSubplotTitle = getSubplotTitle; + +var _constants = require('./constants'); + +var _2 = require('./'); + +function getAllAxes(fullLayout) { + var axes = []; + // Plotly.js should really have a helper function for this, but until it does.. + if (fullLayout && fullLayout._subplots) { + Object.keys(fullLayout._subplots).filter( + // xaxis and yaxis already included separately in _fullLayout._subplots + function (type) { + return type !== 'cartesian' && fullLayout._subplots[type].length !== 0; + }).forEach(function (type) { + fullLayout._subplots[type].forEach(function (subplot) { + if (['xaxis', 'yaxis'].includes(type)) { + // subplot will look like x2, x45, convert it to xaxis2, xaxis45 + subplot = // eslint-disable-line no-param-reassign + subplot.length > 1 ? subplot.slice(0, 1) + 'axis' + subplot.slice(1) : subplot + 'axis'; + + fullLayout[subplot]._subplot = subplot; + fullLayout[subplot]._axisGroup = type; + axes.push(fullLayout[subplot]); + } else { + Object.keys(fullLayout[subplot]).filter(function (key) { + return key.includes('axis'); + }).forEach(function (axis) { + fullLayout[subplot][axis]._subplot = subplot; + fullLayout[subplot][axis]._axisGroup = type; + + // it should be in plotly.js, but it's not there for geo axes.. + if (!fullLayout[subplot][axis]._name) { + fullLayout[subplot][axis]._name = axis; + } + axes.push(fullLayout[subplot][axis]); + }); + } + }); + }); + } + + return axes; +} + +function traceTypeToAxisType(traceType) { + var subplot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + // plotly.js actually allows traces with no type and just + // defaults them to scatter, so do this here as well. + if (!traceType) { + traceType = 'scatter'; // eslint-disable-line + } + + var category = null; + var traceToAxis = _constants.TRACE_TO_AXIS; + if (subplot) { + Object.assign(traceToAxis, _constants.TRACE_TO_AXIS, { scene: _constants.TRACE_TO_AXIS.gl3d }); + delete traceToAxis.gl3d; + } + + Object.keys(traceToAxis).forEach(function (c) { + if (traceToAxis[c].includes(traceType)) { + category = c; + } + }); + + if (category) { + return category; + } + + if (traceType === 'pie' || traceType === 'table') { + return null; + } + + throw new Error('Sorry, could not find ' + traceType + ' in any category.'); +} + +function axisIdToAxisName(id) { + return id.charAt(0) + 'axis' + id.slice(1); +} + +function getAxisNumber(axis) { + var splitSubplot = axis._subplot ? axis._subplot.split(axis._axisGroup) : []; + return splitSubplot[1] ? Number(splitSubplot[1]) : axis._name.split('axis')[1]; +} + +function getAxisTitle(axis) { + var axisType = (0, _2.capitalize)(axis._name.split('axis')[0]); + var subplotNumber = getAxisNumber(axis) || 1; + + return axis._input && axis._input.title ? (0, _2.striptags)(axisType + ': ' + axis._input.title) : (0, _2.striptags)(axisType + ' ' + subplotNumber); +} + +function getSubplotNumber(subplot, type) { + return Number(subplot.split(type)[1]); +} + +function getSubplotTitle(subplot, type, _) { + var axisName = (0, _constants.subplotName)(type, _); + var subplotNumber = getSubplotNumber(subplot, _constants.SUBPLOT_TO_ATTR[type].layout) || ''; + + return axisName + ' ' + subplotNumber; +} +//# sourceMappingURL=getAllAxes.js.map \ No newline at end of file diff --git a/lib/lib/getAllAxes.js.map b/lib/lib/getAllAxes.js.map new file mode 100644 index 000000000..eac83b7a0 --- /dev/null +++ b/lib/lib/getAllAxes.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/getAllAxes.js"],"names":["getAllAxes","traceTypeToAxisType","axisIdToAxisName","getAxisTitle","getSubplotTitle","fullLayout","axes","_subplots","Object","keys","filter","type","length","forEach","includes","subplot","slice","_subplot","_axisGroup","push","key","axis","_name","traceType","category","traceToAxis","TRACE_TO_AXIS","assign","scene","gl3d","c","Error","id","charAt","getAxisNumber","splitSubplot","split","Number","axisType","subplotNumber","_input","title","getSubplotNumber","_","axisName","SUBPLOT_TO_ATTR","layout"],"mappings":";;;;;kBAGwBA,U;QA0CRC,mB,GAAAA,mB;QA+BAC,gB,GAAAA,gB;QASAC,Y,GAAAA,Y;QAaAC,e,GAAAA,e;;AAlGhB;;AACA;;AAEe,SAASJ,UAAT,CAAoBK,UAApB,EAAgC;AAC7C,MAAMC,OAAO,EAAb;AACA;AACA,MAAID,cAAcA,WAAWE,SAA7B,EAAwC;AACtCC,WAAOC,IAAP,CAAYJ,WAAWE,SAAvB,EACGG,MADH;AAEI;AACA;AAAA,aAAQC,SAAS,WAAT,IAAwBN,WAAWE,SAAX,CAAqBI,IAArB,EAA2BC,MAA3B,KAAsC,CAAtE;AAAA,KAHJ,EAKGC,OALH,CAKW,gBAAQ;AACfR,iBAAWE,SAAX,CAAqBI,IAArB,EAA2BE,OAA3B,CAAmC,mBAA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AAYC,KAAtC,CADG,GAEH,kBAAaH,QAAb,SAAyBC,aAAzB,CAFJ;AAGD;;AAED,SAASG,gBAAT,CAA0B3B,OAA1B,EAAmCJ,IAAnC,EAAyC;AACvC,SAAO0B,OAAOtB,QAAQqB,KAAR,CAAczB,IAAd,EAAoB,CAApB,CAAP,CAAP;AACD;;AAEM,SAASP,eAAT,CAAyBW,OAAzB,EAAkCJ,IAAlC,EAAwCgC,CAAxC,EAA2C;AAChD,MAAMC,WAAW,4BAAYjC,IAAZ,EAAkBgC,CAAlB,CAAjB;AACA,MAAMJ,gBAAgBG,iBAAiB3B,OAAjB,EAA0B8B,2BAAgBlC,IAAhB,EAAsBmC,MAAhD,KAA2D,EAAjF;;AAEA,SAAUF,QAAV,SAAsBL,aAAtB;AACD","file":"getAllAxes.js","sourcesContent":["import {TRACE_TO_AXIS, SUBPLOT_TO_ATTR, subplotName} from 'lib/constants';\nimport {capitalize, striptags} from 'lib';\n\nexport default function getAllAxes(fullLayout) {\n const axes = [];\n // Plotly.js should really have a helper function for this, but until it does..\n if (fullLayout && fullLayout._subplots) {\n Object.keys(fullLayout._subplots)\n .filter(\n // xaxis and yaxis already included separately in _fullLayout._subplots\n type => type !== 'cartesian' && fullLayout._subplots[type].length !== 0\n )\n .forEach(type => {\n fullLayout._subplots[type].forEach(subplot => {\n if (['xaxis', 'yaxis'].includes(type)) {\n // subplot will look like x2, x45, convert it to xaxis2, xaxis45\n subplot = // eslint-disable-line no-param-reassign\n subplot.length > 1\n ? subplot.slice(0, 1) + 'axis' + subplot.slice(1)\n : subplot + 'axis';\n\n fullLayout[subplot]._subplot = subplot;\n fullLayout[subplot]._axisGroup = type;\n axes.push(fullLayout[subplot]);\n } else {\n Object.keys(fullLayout[subplot])\n .filter(key => key.includes('axis'))\n .forEach(axis => {\n fullLayout[subplot][axis]._subplot = subplot;\n fullLayout[subplot][axis]._axisGroup = type;\n\n // it should be in plotly.js, but it's not there for geo axes..\n if (!fullLayout[subplot][axis]._name) {\n fullLayout[subplot][axis]._name = axis;\n }\n axes.push(fullLayout[subplot][axis]);\n });\n }\n });\n });\n }\n\n return axes;\n}\n\nexport function traceTypeToAxisType(traceType, subplot = false) {\n // plotly.js actually allows traces with no type and just\n // defaults them to scatter, so do this here as well.\n if (!traceType) {\n traceType = 'scatter'; // eslint-disable-line\n }\n\n let category = null;\n const traceToAxis = TRACE_TO_AXIS;\n if (subplot) {\n Object.assign(traceToAxis, TRACE_TO_AXIS, {scene: TRACE_TO_AXIS.gl3d});\n delete traceToAxis.gl3d;\n }\n\n Object.keys(traceToAxis).forEach(c => {\n if (traceToAxis[c].includes(traceType)) {\n category = c;\n }\n });\n\n if (category) {\n return category;\n }\n\n if (traceType === 'pie' || traceType === 'table') {\n return null;\n }\n\n throw new Error(`Sorry, could not find ${traceType} in any category.`);\n}\n\nexport function axisIdToAxisName(id) {\n return id.charAt(0) + 'axis' + id.slice(1);\n}\n\nfunction getAxisNumber(axis) {\n const splitSubplot = axis._subplot ? axis._subplot.split(axis._axisGroup) : [];\n return splitSubplot[1] ? Number(splitSubplot[1]) : axis._name.split('axis')[1];\n}\n\nexport function getAxisTitle(axis) {\n const axisType = capitalize(axis._name.split('axis')[0]);\n const subplotNumber = getAxisNumber(axis) || 1;\n\n return axis._input && axis._input.title\n ? striptags(`${axisType}: ${axis._input.title}`)\n : striptags(`${axisType} ${subplotNumber}`);\n}\n\nfunction getSubplotNumber(subplot, type) {\n return Number(subplot.split(type)[1]);\n}\n\nexport function getSubplotTitle(subplot, type, _) {\n const axisName = subplotName(type, _);\n const subplotNumber = getSubplotNumber(subplot, SUBPLOT_TO_ATTR[type].layout) || '';\n\n return `${axisName} ${subplotNumber}`;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/index.js b/lib/lib/index.js new file mode 100644 index 000000000..198ae5483 --- /dev/null +++ b/lib/lib/index.js @@ -0,0 +1,313 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getFullTrace = exports.transpose = exports.traceTypeToAxisType = exports.striptags = exports.tooLight = exports.walkObject = exports.unpackPlotProps = exports.renderTraceIcon = exports.plotlyTraceToCustomTrace = exports.maybeTransposeData = exports.maybeAdjustSrc = exports.localizeString = exports.localize = exports.isPlainObject = exports.getDisplayName = exports.getSubplotTitle = exports.getAxisTitle = exports.getAllAxes = exports.dereference = exports.traceTypeToPlotlyInitFigure = exports.computeTraceOptionsFromSchema = exports.containerConnectedContextTypes = exports.connectTraceToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectUpdateMenuToLayout = exports.connectSliderToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.clamp = exports.pascalCase = exports.camelCase = exports.removeNonWord = exports.upperCase = exports.lowerCase = exports.capitalize = exports.bem = exports.axisIdToAxisName = exports.adjustColorscale = undefined; + +var _bem = require('./bem'); + +var _bem2 = _interopRequireDefault(_bem); + +var _connectCartesianSubplotToLayout = require('./connectCartesianSubplotToLayout'); + +var _connectCartesianSubplotToLayout2 = _interopRequireDefault(_connectCartesianSubplotToLayout); + +var _connectNonCartesianSubplotToLayout = require('./connectNonCartesianSubplotToLayout'); + +var _connectNonCartesianSubplotToLayout2 = _interopRequireDefault(_connectNonCartesianSubplotToLayout); + +var _connectAnnotationToLayout = require('./connectAnnotationToLayout'); + +var _connectAnnotationToLayout2 = _interopRequireDefault(_connectAnnotationToLayout); + +var _connectShapeToLayout = require('./connectShapeToLayout'); + +var _connectShapeToLayout2 = _interopRequireDefault(_connectShapeToLayout); + +var _connectSliderToLayout = require('./connectSliderToLayout'); + +var _connectSliderToLayout2 = _interopRequireDefault(_connectSliderToLayout); + +var _connectImageToLayout = require('./connectImageToLayout'); + +var _connectImageToLayout2 = _interopRequireDefault(_connectImageToLayout); + +var _connectUpdateMenuToLayout = require('./connectUpdateMenuToLayout'); + +var _connectUpdateMenuToLayout2 = _interopRequireDefault(_connectUpdateMenuToLayout); + +var _connectRangeSelectorToAxis = require('./connectRangeSelectorToAxis'); + +var _connectRangeSelectorToAxis2 = _interopRequireDefault(_connectRangeSelectorToAxis); + +var _connectTransformToTrace = require('./connectTransformToTrace'); + +var _connectTransformToTrace2 = _interopRequireDefault(_connectTransformToTrace); + +var _connectAggregationToTransform = require('./connectAggregationToTransform'); + +var _connectAggregationToTransform2 = _interopRequireDefault(_connectAggregationToTransform); + +var _connectAxesToLayout = require('./connectAxesToLayout'); + +var _connectAxesToLayout2 = _interopRequireDefault(_connectAxesToLayout); + +var _connectLayoutToPlot = require('./connectLayoutToPlot'); + +var _connectLayoutToPlot2 = _interopRequireDefault(_connectLayoutToPlot); + +var _connectToContainer = require('./connectToContainer'); + +var _connectToContainer2 = _interopRequireDefault(_connectToContainer); + +var _computeTraceOptionsFromSchema = require('./computeTraceOptionsFromSchema'); + +var _connectTraceToPlot = require('./connectTraceToPlot'); + +var _connectTraceToPlot2 = _interopRequireDefault(_connectTraceToPlot); + +var _dereference = require('./dereference'); + +var _dereference2 = _interopRequireDefault(_dereference); + +var _getAllAxes = require('./getAllAxes'); + +var _getAllAxes2 = _interopRequireDefault(_getAllAxes); + +var _localize = require('./localize'); + +var _localize2 = _interopRequireDefault(_localize); + +var _tinycolor = require('tinycolor2'); + +var _tinycolor2 = _interopRequireDefault(_tinycolor); + +var _unpackPlotProps = require('./unpackPlotProps'); + +var _unpackPlotProps2 = _interopRequireDefault(_unpackPlotProps); + +var _walkObject = require('./walkObject'); + +var _walkObject2 = _interopRequireDefault(_walkObject); + +var _customTraceType = require('./customTraceType'); + +var _plotlyIcons = require('plotly-icons'); + +var PlotlyIcons = _interopRequireWildcard(_plotlyIcons); + +var _striptags = require('./striptags'); + +var _striptags2 = _interopRequireDefault(_striptags); + +var _strings = require('./strings'); + +var _reactColorscales = require('react-colorscales'); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var TOO_LIGHT_FACTOR = 0.8; + +function clamp(value, min, max) { + return Math.max(min, Math.min(max, value)); +} + +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} + +function tooLight(color) { + var hslColor = (0, _tinycolor2.default)(color).toHsl(); + return hslColor.l > TOO_LIGHT_FACTOR; +} + +function renderTraceIcon(trace) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Plot'; + + if (!trace) { + return null; + } + var gl = 'gl'; + var componentName = '' + prefix + (0, _strings.pascalCase)(trace.endsWith(gl) ? trace.slice(0, -gl.length) : trace) + 'Icon'; + + return PlotlyIcons[componentName] ? PlotlyIcons[componentName] : PlotlyIcons.PlotLineIcon; +} + +function transpose(originalArray) { + // if we want to transpose a uni dimensional array + if (originalArray.every(function (a) { + return !Array.isArray(a); + })) { + return originalArray.map(function (a) { + return [a]; + }); + } + + var longestArrayItem = Array.isArray(originalArray[0]) ? originalArray[0].length : 1; + + originalArray.forEach(function (a) { + // if it's not an array, it's a string + var length = Array.isArray(a) ? a.length : 1; + if (length > longestArrayItem) { + longestArrayItem = length; + } + }); + + var newArray = new Array(longestArrayItem); + + for (var outerIndex = 0; outerIndex < originalArray.length; outerIndex++) { + if (!Array.isArray(originalArray[outerIndex])) { + originalArray[outerIndex] = [originalArray[outerIndex]]; + } + + for (var innerIndex = 0; innerIndex < longestArrayItem; innerIndex++) { + // ensure we have an array to push to + if (!Array.isArray(newArray[innerIndex])) { + newArray[innerIndex] = []; + } + + var value = typeof originalArray[outerIndex][innerIndex] !== 'undefined' ? originalArray[outerIndex][innerIndex] : null; + newArray[innerIndex].push(value); + } + } + + return newArray; +} + +var specialTableCase = function specialTableCase(traceType, srcAttributePath) { + /* Just more user friendly + * Table traces have many configuration options, + * The below attributes can be 2d or 1d and will affect the plot differently + * EX: + * header.values = ['Jan', 'Feb', 'Mar'] => will put data in a row + * header.values = [['Jan', 1], ['Feb', 2], ['Mar', 3]] => will create 3 columns + * 1d arrays affect columns + * 2d arrays affect rows within each column + */ + return traceType === 'table' && ['header.valuessrc', 'header.font.colorsrc', 'header.font.sizesrc', 'header.fill.colorsrc', 'columnwidthsrc'].some(function (a) { + return srcAttributePath.endsWith(a); + }); +}; + +function maybeTransposeData(data, srcAttributePath, traceType) { + if (!data || Array.isArray(data) && data.length === 0) { + return null; + } + + var isTransposable2DArray = srcAttributePath.endsWith('zsrc') && ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(traceType); + + if (isTransposable2DArray) { + return transpose(data); + } + + if (specialTableCase(traceType, srcAttributePath) && Array.isArray(data[0]) && data.length === 1) { + return data[0]; + } + + return data; +} + +function maybeAdjustSrc(src, srcAttributePath, traceType, config) { + if (!src || Array.isArray(src) && src.length === 0) { + return null; + } + + if (specialTableCase(traceType, srcAttributePath) && src.length === 1) { + return src[0]; + } + + return config && config.fromSrc ? config.fromSrc(src, traceType) : src; +} + +function adjustColorscale(colorscale, numberOfNeededColors, colorscaleType, config) { + if (config && config.repeat) { + if (numberOfNeededColors < colorscale.length) { + return colorscale.slice(0, numberOfNeededColors); + } + + var repetitions = Math.ceil(numberOfNeededColors / colorscale.length); + var newArray = new Array(repetitions).fill(colorscale); + return newArray.reduce(function (a, b) { + return a.concat(b); + }, []).slice(0, numberOfNeededColors); + } + + return (0, _reactColorscales.getColorscale)(colorscale, numberOfNeededColors, null, null, colorscaleType); +} + +function getFullTrace(props, context) { + var fullTrace = {}; + if (context.fullData && context.data) { + if (props.fullDataArrayPosition) { + // fullDataArrayPosition will be supplied in panels that have the canGroup prop + fullTrace = context.fullData[props.fullDataArrayPosition[0]]; + } else { + // for all other panels, we'll find fullTrace with the data index + fullTrace = context.fullData.filter(function (t) { + return t && props.traceIndexes[0] === t.index; + })[0]; + } + + // For transformed traces, we actually want to read in _fullInput because + // there's original parent information that's more useful to the user there + // This is true except for fit transforms, where reading in fullData is + // what we want + if (fullTrace.transforms && !fullTrace.transforms.some(function (t) { + return ['moving-average', 'fits'].includes(t.type); + }) && !props.fullDataArrayPosition) { + fullTrace = fullTrace._fullInput; + } + } + return fullTrace; +} + +exports.adjustColorscale = adjustColorscale; +exports.axisIdToAxisName = _getAllAxes.axisIdToAxisName; +exports.bem = _bem2.default; +exports.capitalize = _strings.capitalize; +exports.lowerCase = _strings.lowerCase; +exports.upperCase = _strings.upperCase; +exports.removeNonWord = _strings.removeNonWord; +exports.camelCase = _strings.camelCase; +exports.pascalCase = _strings.pascalCase; +exports.clamp = clamp; +exports.connectCartesianSubplotToLayout = _connectCartesianSubplotToLayout2.default; +exports.connectNonCartesianSubplotToLayout = _connectNonCartesianSubplotToLayout2.default; +exports.connectAnnotationToLayout = _connectAnnotationToLayout2.default; +exports.connectShapeToLayout = _connectShapeToLayout2.default; +exports.connectSliderToLayout = _connectSliderToLayout2.default; +exports.connectUpdateMenuToLayout = _connectUpdateMenuToLayout2.default; +exports.connectImageToLayout = _connectImageToLayout2.default; +exports.connectAxesToLayout = _connectAxesToLayout2.default; +exports.connectLayoutToPlot = _connectLayoutToPlot2.default; +exports.connectToContainer = _connectToContainer2.default; +exports.connectRangeSelectorToAxis = _connectRangeSelectorToAxis2.default; +exports.connectTransformToTrace = _connectTransformToTrace2.default; +exports.connectAggregationToTransform = _connectAggregationToTransform2.default; +exports.connectTraceToPlot = _connectTraceToPlot2.default; +exports.containerConnectedContextTypes = _connectToContainer.containerConnectedContextTypes; +exports.computeTraceOptionsFromSchema = _computeTraceOptionsFromSchema.computeTraceOptionsFromSchema; +exports.traceTypeToPlotlyInitFigure = _customTraceType.traceTypeToPlotlyInitFigure; +exports.dereference = _dereference2.default; +exports.getAllAxes = _getAllAxes2.default; +exports.getAxisTitle = _getAllAxes.getAxisTitle; +exports.getSubplotTitle = _getAllAxes.getSubplotTitle; +exports.getDisplayName = getDisplayName; +exports.isPlainObject = _walkObject.isPlainObject; +exports.localize = _localize2.default; +exports.localizeString = _localize.localizeString; +exports.maybeAdjustSrc = maybeAdjustSrc; +exports.maybeTransposeData = maybeTransposeData; +exports.plotlyTraceToCustomTrace = _customTraceType.plotlyTraceToCustomTrace; +exports.renderTraceIcon = renderTraceIcon; +exports.unpackPlotProps = _unpackPlotProps2.default; +exports.walkObject = _walkObject2.default; +exports.tooLight = tooLight; +exports.striptags = _striptags2.default; +exports.traceTypeToAxisType = _getAllAxes.traceTypeToAxisType; +exports.transpose = transpose; +exports.getFullTrace = getFullTrace; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/lib/index.js.map b/lib/lib/index.js.map new file mode 100644 index 000000000..42790de58 --- /dev/null +++ b/lib/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/index.js"],"names":["PlotlyIcons","TOO_LIGHT_FACTOR","clamp","value","min","max","Math","getDisplayName","WrappedComponent","displayName","name","tooLight","color","hslColor","toHsl","l","renderTraceIcon","trace","prefix","gl","componentName","endsWith","slice","length","PlotLineIcon","transpose","originalArray","every","Array","isArray","a","map","longestArrayItem","forEach","newArray","outerIndex","innerIndex","push","specialTableCase","traceType","srcAttributePath","some","maybeTransposeData","data","isTransposable2DArray","includes","maybeAdjustSrc","src","config","fromSrc","adjustColorscale","colorscale","numberOfNeededColors","colorscaleType","repeat","repetitions","ceil","fill","reduce","b","concat","getFullTrace","props","context","fullTrace","fullData","fullDataArrayPosition","filter","t","traceIndexes","index","transforms","type","_fullInput","axisIdToAxisName","bem","capitalize","lowerCase","upperCase","removeNonWord","camelCase","pascalCase","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectSliderToLayout","connectUpdateMenuToLayout","connectImageToLayout","connectAxesToLayout","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTransformToTrace","connectAggregationToTransform","connectTraceToPlot","containerConnectedContextTypes","computeTraceOptionsFromSchema","traceTypeToPlotlyInitFigure","dereference","getAllAxes","getAxisTitle","getSubplotTitle","isPlainObject","localize","localizeString","plotlyTraceToCustomTrace","unpackPlotProps","walkObject","striptags","traceTypeToAxisType"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AAMA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;IAAYA,W;;AACZ;;;;AACA;;AACA;;;;;;AAEA,IAAMC,mBAAmB,GAAzB;;AAEA,SAASC,KAAT,CAAeC,KAAf,EAAsBC,GAAtB,EAA2BC,GAA3B,EAAgC;AAC9B,SAAOC,KAAKD,GAAL,CAASD,GAAT,EAAcE,KAAKF,GAAL,CAASC,GAAT,EAAcF,KAAd,CAAd,CAAP;AACD;;AAED,SAASI,cAAT,CAAwBC,gBAAxB,EAA0C;AACxC,SAAOA,iBAAiBC,WAAjB,IAAgCD,iBAAiBE,IAAjD,IAAyD,WAAhE;AACD;;AAED,SAASC,QAAT,CAAkBC,KAAlB,EAAyB;AACvB,MAAMC,WAAW,yBAAUD,KAAV,EAAiBE,KAAjB,EAAjB;AACA,SAAOD,SAASE,CAAT,GAAad,gBAApB;AACD;;AAED,SAASe,eAAT,CAAyBC,KAAzB,EAAiD;AAAA,MAAjBC,MAAiB,uEAAR,MAAQ;;AAC/C,MAAI,CAACD,KAAL,EAAY;AACV,WAAO,IAAP;AACD;AACD,MAAME,KAAK,IAAX;AACA,MAAMC,qBAAmBF,MAAnB,GAA4B,yBAChCD,MAAMI,QAAN,CAAeF,EAAf,IAAqBF,MAAMK,KAAN,CAAY,CAAZ,EAAe,CAACH,GAAGI,MAAnB,CAArB,GAAkDN,KADlB,CAA5B,SAAN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,yC;QACA1F,e,GAAAA,e;QACA2F,e,GAAAA,yB;QACAC,U,GAAAA,oB;QACAjG,Q,GAAAA,Q;QACAkG,S,GAAAA,mB;QACAC,mB,GAAAA,+B;QACArF,S,GAAAA,S;QACAoC,Y,GAAAA,Y","file":"index.js","sourcesContent":["import bem from './bem';\nimport connectCartesianSubplotToLayout from './connectCartesianSubplotToLayout';\nimport connectNonCartesianSubplotToLayout from './connectNonCartesianSubplotToLayout';\nimport connectAnnotationToLayout from './connectAnnotationToLayout';\nimport connectShapeToLayout from './connectShapeToLayout';\nimport connectSliderToLayout from './connectSliderToLayout';\nimport connectImageToLayout from './connectImageToLayout';\nimport connectUpdateMenuToLayout from './connectUpdateMenuToLayout';\nimport connectRangeSelectorToAxis from './connectRangeSelectorToAxis';\nimport connectTransformToTrace from './connectTransformToTrace';\nimport connectAggregationToTransform from './connectAggregationToTransform';\nimport connectAxesToLayout from './connectAxesToLayout';\nimport connectLayoutToPlot from './connectLayoutToPlot';\nimport connectToContainer, {containerConnectedContextTypes} from './connectToContainer';\nimport {computeTraceOptionsFromSchema} from './computeTraceOptionsFromSchema';\nimport connectTraceToPlot from './connectTraceToPlot';\nimport dereference from './dereference';\nimport getAllAxes, {\n axisIdToAxisName,\n traceTypeToAxisType,\n getAxisTitle,\n getSubplotTitle,\n} from './getAllAxes';\nimport localize, {localizeString} from './localize';\nimport tinyColor from 'tinycolor2';\nimport unpackPlotProps from './unpackPlotProps';\nimport walkObject, {isPlainObject} from './walkObject';\nimport {traceTypeToPlotlyInitFigure, plotlyTraceToCustomTrace} from './customTraceType';\nimport * as PlotlyIcons from 'plotly-icons';\nimport striptags from './striptags';\nimport {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase} from './strings';\nimport {getColorscale} from 'react-colorscales';\n\nconst TOO_LIGHT_FACTOR = 0.8;\n\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nfunction tooLight(color) {\n const hslColor = tinyColor(color).toHsl();\n return hslColor.l > TOO_LIGHT_FACTOR;\n}\n\nfunction renderTraceIcon(trace, prefix = 'Plot') {\n if (!trace) {\n return null;\n }\n const gl = 'gl';\n const componentName = `${prefix}${pascalCase(\n trace.endsWith(gl) ? trace.slice(0, -gl.length) : trace\n )}Icon`;\n\n return PlotlyIcons[componentName] ? PlotlyIcons[componentName] : PlotlyIcons.PlotLineIcon;\n}\n\nfunction transpose(originalArray) {\n // if we want to transpose a uni dimensional array\n if (originalArray.every(a => !Array.isArray(a))) {\n return originalArray.map(a => [a]);\n }\n\n let longestArrayItem = Array.isArray(originalArray[0]) ? originalArray[0].length : 1;\n\n originalArray.forEach(a => {\n // if it's not an array, it's a string\n const length = Array.isArray(a) ? a.length : 1;\n if (length > longestArrayItem) {\n longestArrayItem = length;\n }\n });\n\n const newArray = new Array(longestArrayItem);\n\n for (let outerIndex = 0; outerIndex < originalArray.length; outerIndex++) {\n if (!Array.isArray(originalArray[outerIndex])) {\n originalArray[outerIndex] = [originalArray[outerIndex]];\n }\n\n for (let innerIndex = 0; innerIndex < longestArrayItem; innerIndex++) {\n // ensure we have an array to push to\n if (!Array.isArray(newArray[innerIndex])) {\n newArray[innerIndex] = [];\n }\n\n const value =\n typeof originalArray[outerIndex][innerIndex] !== 'undefined'\n ? originalArray[outerIndex][innerIndex]\n : null;\n newArray[innerIndex].push(value);\n }\n }\n\n return newArray;\n}\n\nconst specialTableCase = (traceType, srcAttributePath) => {\n /* Just more user friendly\n * Table traces have many configuration options,\n * The below attributes can be 2d or 1d and will affect the plot differently\n * EX:\n * header.values = ['Jan', 'Feb', 'Mar'] => will put data in a row\n * header.values = [['Jan', 1], ['Feb', 2], ['Mar', 3]] => will create 3 columns\n * 1d arrays affect columns\n * 2d arrays affect rows within each column\n */\n return (\n traceType === 'table' &&\n [\n 'header.valuessrc',\n 'header.font.colorsrc',\n 'header.font.sizesrc',\n 'header.fill.colorsrc',\n 'columnwidthsrc',\n ].some(a => srcAttributePath.endsWith(a))\n );\n};\n\nfunction maybeTransposeData(data, srcAttributePath, traceType) {\n if (!data || (Array.isArray(data) && data.length === 0)) {\n return null;\n }\n\n const isTransposable2DArray =\n srcAttributePath.endsWith('zsrc') &&\n ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(\n traceType\n );\n\n if (isTransposable2DArray) {\n return transpose(data);\n }\n\n if (\n specialTableCase(traceType, srcAttributePath) &&\n Array.isArray(data[0]) &&\n data.length === 1\n ) {\n return data[0];\n }\n\n return data;\n}\n\nfunction maybeAdjustSrc(src, srcAttributePath, traceType, config) {\n if (!src || (Array.isArray(src) && src.length === 0)) {\n return null;\n }\n\n if (specialTableCase(traceType, srcAttributePath) && src.length === 1) {\n return src[0];\n }\n\n return config && config.fromSrc ? config.fromSrc(src, traceType) : src;\n}\n\nfunction adjustColorscale(colorscale, numberOfNeededColors, colorscaleType, config) {\n if (config && config.repeat) {\n if (numberOfNeededColors < colorscale.length) {\n return colorscale.slice(0, numberOfNeededColors);\n }\n\n const repetitions = Math.ceil(numberOfNeededColors / colorscale.length);\n const newArray = new Array(repetitions).fill(colorscale);\n return newArray\n .reduce((a, b) => {\n return a.concat(b);\n }, [])\n .slice(0, numberOfNeededColors);\n }\n\n return getColorscale(colorscale, numberOfNeededColors, null, null, colorscaleType);\n}\n\nfunction getFullTrace(props, context) {\n let fullTrace = {};\n if (context.fullData && context.data) {\n if (props.fullDataArrayPosition) {\n // fullDataArrayPosition will be supplied in panels that have the canGroup prop\n fullTrace = context.fullData[props.fullDataArrayPosition[0]];\n } else {\n // for all other panels, we'll find fullTrace with the data index\n fullTrace = context.fullData.filter(t => t && props.traceIndexes[0] === t.index)[0];\n }\n\n // For transformed traces, we actually want to read in _fullInput because\n // there's original parent information that's more useful to the user there\n // This is true except for fit transforms, where reading in fullData is\n // what we want\n if (\n fullTrace.transforms &&\n !fullTrace.transforms.some(t => ['moving-average', 'fits'].includes(t.type)) &&\n !props.fullDataArrayPosition\n ) {\n fullTrace = fullTrace._fullInput;\n }\n }\n return fullTrace;\n}\n\nexport {\n adjustColorscale,\n axisIdToAxisName,\n bem,\n capitalize,\n lowerCase,\n upperCase,\n removeNonWord,\n camelCase,\n pascalCase,\n clamp,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectSliderToLayout,\n connectUpdateMenuToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectTraceToPlot,\n containerConnectedContextTypes,\n computeTraceOptionsFromSchema,\n traceTypeToPlotlyInitFigure,\n dereference,\n getAllAxes,\n getAxisTitle,\n getSubplotTitle,\n getDisplayName,\n isPlainObject,\n localize,\n localizeString,\n maybeAdjustSrc,\n maybeTransposeData,\n plotlyTraceToCustomTrace,\n renderTraceIcon,\n unpackPlotProps,\n walkObject,\n tooLight,\n striptags,\n traceTypeToAxisType,\n transpose,\n getFullTrace,\n};\n"]} \ No newline at end of file diff --git a/lib/lib/localize.js b/lib/lib/localize.js new file mode 100644 index 000000000..6ff0820e0 --- /dev/null +++ b/lib/lib/localize.js @@ -0,0 +1,77 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +exports.default = localize; +exports.localizeString = localizeString; + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _ = require('./'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function localize(Comp) { + var LocalizedComponent = function (_Component) { + _inherits(LocalizedComponent, _Component); + + function LocalizedComponent(props, context) { + _classCallCheck(this, LocalizedComponent); + + var _this = _possibleConstructorReturn(this, (LocalizedComponent.__proto__ || Object.getPrototypeOf(LocalizedComponent)).call(this, props, context)); + + var dictionaries = context.dictionaries; + var locale = context.locale; + + _this.localize = function localize(str) { + return localizeString(dictionaries, locale, str); + }; + return _this; + } + + _createClass(LocalizedComponent, [{ + key: 'render', + value: function render() { + return _react2.default.createElement(Comp, _extends({ localize: this.localize }, this.props)); + } + }]); + + return LocalizedComponent; + }(_react.Component); + + LocalizedComponent.displayName = 'Localized' + (0, _.getDisplayName)(Comp); + LocalizedComponent.contextTypes = LocalizedComponent.contextTypes || {}; + LocalizedComponent.contextTypes.dictionaries = _propTypes2.default.object; + LocalizedComponent.contextTypes.locale = _propTypes2.default.string; + + LocalizedComponent.plotly_editor_traits = Comp.plotly_editor_traits; + + return LocalizedComponent; +} + +function localizeString(dictionaries, locale, key) { + var dict = dictionaries[locale]; + if (dict && dict.hasOwnProperty(key)) { + return dict[key]; + } + return key; +} +//# sourceMappingURL=localize.js.map \ No newline at end of file diff --git a/lib/lib/localize.js.map b/lib/lib/localize.js.map new file mode 100644 index 000000000..d6c0e610d --- /dev/null +++ b/lib/lib/localize.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/localize.js"],"names":["localize","localizeString","Comp","LocalizedComponent","props","context","dictionaries","locale","str","Component","displayName","contextTypes","PropTypes","object","string","plotly_editor_traits","key","dict","hasOwnProperty"],"mappings":";;;;;;;;;;kBAIwBA,Q;QA2BRC,c,GAAAA,c;;AA/BhB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASD,QAAT,CAAkBE,IAAlB,EAAwB;AAAA,MAC/BC,kBAD+B;AAAA;;AAEnC,gCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,0IACpBD,KADoB,EACbC,OADa;;AAG1B,UAAMC,eAAeD,QAAQC,YAA7B;AACA,UAAMC,SAASF,QAAQE,MAAvB;;AAEA,YAAKP,QAAL,GAAgB,SAASA,QAAT,CAAkBQ,GAAlB,EAAuB;AACrC,eAAOP,eAAeK,YAAf,EAA6BC,MAA7B,EAAqCC,GAArC,CAAP;AACD,OAFD;AAN0B;AAS3B;;AAXkC;AAAA;AAAA,+BAa1B;AACP,eAAO,8BAAC,IAAD,aAAM,UAAU,KAAKR,QAArB,IAAmC,KAAKI,KAAxC,EAAP;AACD;AAfkC;;AAAA;AAAA,IACJK,gBADI;;AAiBrCN,qBAAmBO,WAAnB,iBAA6C,sBAAeR,IAAf,CAA7C;AACAC,qBAAmBQ,YAAnB,GAAkCR,mBAAmBQ,YAAnB,IAAmC,EAArE;AACAR,qBAAmBQ,YAAnB,CAAgCL,YAAhC,GAA+CM,oBAAUC,MAAzD;AACAV,qBAAmBQ,YAAnB,CAAgCJ,MAAhC,GAAyCK,oBAAUE,MAAnD;;AAEAX,qBAAmBY,oBAAnB,GAA0Cb,KAAKa,oBAA/C;;AAEA,SAAOZ,kBAAP;AACD;;AAEM,SAASF,cAAT,CAAwBK,YAAxB,EAAsCC,MAAtC,EAA8CS,GAA9C,EAAmD;AACxD,MAAMC,OAAOX,aAAaC,MAAb,CAAb;AACA,MAAIU,QAAQA,KAAKC,cAAL,CAAoBF,GAApB,CAAZ,EAAsC;AACpC,WAAOC,KAAKD,GAAL,CAAP;AACD;AACD,SAAOA,GAAP;AACD","file":"localize.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {getDisplayName} from 'lib';\n\nexport default function localize(Comp) {\n class LocalizedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n const dictionaries = context.dictionaries;\n const locale = context.locale;\n\n this.localize = function localize(str) {\n return localizeString(dictionaries, locale, str);\n };\n }\n\n render() {\n return ;\n }\n }\n LocalizedComponent.displayName = `Localized${getDisplayName(Comp)}`;\n LocalizedComponent.contextTypes = LocalizedComponent.contextTypes || {};\n LocalizedComponent.contextTypes.dictionaries = PropTypes.object;\n LocalizedComponent.contextTypes.locale = PropTypes.string;\n\n LocalizedComponent.plotly_editor_traits = Comp.plotly_editor_traits;\n\n return LocalizedComponent;\n}\n\nexport function localizeString(dictionaries, locale, key) {\n const dict = dictionaries[locale];\n if (dict && dict.hasOwnProperty(key)) {\n return dict[key];\n }\n return key;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/multiValues.js b/lib/lib/multiValues.js new file mode 100644 index 000000000..56b2a5864 --- /dev/null +++ b/lib/lib/multiValues.js @@ -0,0 +1,95 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setMultiValuedContainer = exports.deepCopyPublic = undefined; + +var _constants = require('./constants'); + +var _lib = require('../lib'); + +/** + * Deep-copies the value using JSON. Underscored (private) keys are removed. + * @param {*} value Some nested value from the plotDiv object. + * @returns {*} A deepcopy of the value. + */ +function deepCopyPublic(value) { + if (typeof value === 'undefined') { + return value; + } + + var skipPrivateKeys = function skipPrivateKeys(key, value) { + return key.startsWith('_') ? 0 : value; + }; + + return window.JSON.parse(window.JSON.stringify(value, skipPrivateKeys)); +} + +/* + * WARNING: When using this function, make intoObj and fromObject are copies of + * your objects, so that no mutations occur + */ +function setMultiValuedContainer(intoObj, fromObj, key) { + var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + var intoVal = intoObj[key]; + var fromVal = fromObj[key]; + + // don't merge private attrs + if (typeof key === 'string' && key.charAt(0) === '_' && key !== '_group' || typeof intoVal === 'function' || key === 'module') { + return; + } + + // already a mixture of values, can't get any worse + if (intoVal === _constants.MULTI_VALUED) { + return; + } else if (intoVal === void 0) { + // if the original doesn't have the key it's because that key + // doesn't do anything there - so use the new value + // note that if fromObj doesn't have a key in intoObj we will not + // attempt to merge them at all, so this behavior makes the merge + // independent of order. + + // WARNING: Careful that data copies were passed in as args here, as mutation can occur + intoObj[key] = fromVal; + } else if (key === 'colorscale') { + // colorscales are arrays... need to stringify before comparing + // (other vals we don't want to stringify, as differences could + // potentially be real, like 'false' and false) + if (String(intoVal) !== String(fromVal)) { + intoObj[key] = _constants.MULTI_VALUED; + } + } else if (Array.isArray(intoVal)) { + // in data, other arrays are data, which we don't care about + // for styling purposes + if (!config.searchArrays) { + return; + } + if (!Array.isArray(fromVal)) { + intoObj[key] = _constants.MULTI_VALUED; + } else { + // in layout though, we need to recurse into arrays + for (var i = 0; i < fromVal.length; i++) { + setMultiValuedContainer(intoVal, fromVal, i, config); + } + } + } else if ((0, _lib.isPlainObject)(fromVal)) { + // recurse into objects + if (!(0, _lib.isPlainObject)(intoVal)) { + throw new Error('tried to merge object into non-object: ' + key); + } + Object.keys(fromVal).forEach(function (key2) { + setMultiValuedContainer(intoVal, fromVal, key2, config); + }); + } else if ((0, _lib.isPlainObject)(intoVal)) { + throw new Error('tried to merge non-object into object: ' + key); + } else if (intoVal !== fromVal) { + // different non-empty values - + intoObj[key] = _constants.MULTI_VALUED; + } +} + +exports.deepCopyPublic = deepCopyPublic; +exports.setMultiValuedContainer = setMultiValuedContainer; +//# sourceMappingURL=multiValues.js.map \ No newline at end of file diff --git a/lib/lib/multiValues.js.map b/lib/lib/multiValues.js.map new file mode 100644 index 000000000..1c453e7d1 --- /dev/null +++ b/lib/lib/multiValues.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/multiValues.js"],"names":["deepCopyPublic","value","skipPrivateKeys","key","startsWith","window","JSON","parse","stringify","setMultiValuedContainer","intoObj","fromObj","config","intoVal","fromVal","charAt","MULTI_VALUED","String","Array","isArray","searchArrays","i","length","Error","Object","keys","forEach","key2"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;AAKA,SAASA,cAAT,CAAwBC,KAAxB,EAA+B;AAC7B,MAAI,OAAOA,KAAP,KAAiB,WAArB,EAAkC;AAChC,WAAOA,KAAP;AACD;;AAED,MAAMC,kBAAkB,SAAlBA,eAAkB,CAACC,GAAD,EAAMF,KAAN;AAAA,WAAiBE,IAAIC,UAAJ,CAAe,GAAf,IAAsB,CAAtB,GAA0BH,KAA3C;AAAA,GAAxB;;AAEA,SAAOI,OAAOC,IAAP,CAAYC,KAAZ,CAAkBF,OAAOC,IAAP,CAAYE,SAAZ,CAAsBP,KAAtB,EAA6BC,eAA7B,CAAlB,CAAP;AACD;;AAED;;;;AAIA,SAASO,uBAAT,CAAiCC,OAAjC,EAA0CC,OAA1C,EAAmDR,GAAnD,EAAqE;AAAA,MAAbS,MAAa,uEAAJ,EAAI;;AACnE,MAAMC,UAAUH,QAAQP,GAAR,CAAhB;AACA,MAAMW,UAAUH,QAAQR,GAAR,CAAhB;;AAEA;AACA,MACG,OAAOA,GAAP,KAAe,QAAf,IAA2BA,IAAIY,MAAJ,CAAW,CAAX,MAAkB,GAA7C,IAAoDZ,QAAQ,QAA7D,IACA,OAAOU,OAAP,KAAmB,UADnB,IAEAV,QAAQ,QAHV,EAIE;AACA;AACD;;AAED;AACA,MAAIU,YAAYG,uBAAhB,EAA8B;AAC5B;AACD,GAFD,MAEO,I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AA,uB","file":"multiValues.js","sourcesContent":["import {MULTI_VALUED} from './constants';\nimport {isPlainObject} from '../lib';\n\n/**\n * Deep-copies the value using JSON. Underscored (private) keys are removed.\n * @param {*} value Some nested value from the plotDiv object.\n * @returns {*} A deepcopy of the value.\n */\nfunction deepCopyPublic(value) {\n if (typeof value === 'undefined') {\n return value;\n }\n\n const skipPrivateKeys = (key, value) => (key.startsWith('_') ? 0 : value);\n\n return window.JSON.parse(window.JSON.stringify(value, skipPrivateKeys));\n}\n\n/*\n * WARNING: When using this function, make intoObj and fromObject are copies of\n * your objects, so that no mutations occur\n */\nfunction setMultiValuedContainer(intoObj, fromObj, key, config = {}) {\n const intoVal = intoObj[key];\n const fromVal = fromObj[key];\n\n // don't merge private attrs\n if (\n (typeof key === 'string' && key.charAt(0) === '_' && key !== '_group') ||\n typeof intoVal === 'function' ||\n key === 'module'\n ) {\n return;\n }\n\n // already a mixture of values, can't get any worse\n if (intoVal === MULTI_VALUED) {\n return;\n } else if (intoVal === void 0) {\n // if the original doesn't have the key it's because that key\n // doesn't do anything there - so use the new value\n // note that if fromObj doesn't have a key in intoObj we will not\n // attempt to merge them at all, so this behavior makes the merge\n // independent of order.\n\n // WARNING: Careful that data copies were passed in as args here, as mutation can occur\n intoObj[key] = fromVal;\n } else if (key === 'colorscale') {\n // colorscales are arrays... need to stringify before comparing\n // (other vals we don't want to stringify, as differences could\n // potentially be real, like 'false' and false)\n if (String(intoVal) !== String(fromVal)) {\n intoObj[key] = MULTI_VALUED;\n }\n } else if (Array.isArray(intoVal)) {\n // in data, other arrays are data, which we don't care about\n // for styling purposes\n if (!config.searchArrays) {\n return;\n }\n if (!Array.isArray(fromVal)) {\n intoObj[key] = MULTI_VALUED;\n } else {\n // in layout though, we need to recurse into arrays\n for (let i = 0; i < fromVal.length; i++) {\n setMultiValuedContainer(intoVal, fromVal, i, config);\n }\n }\n } else if (isPlainObject(fromVal)) {\n // recurse into objects\n if (!isPlainObject(intoVal)) {\n throw new Error('tried to merge object into non-object: ' + key);\n }\n Object.keys(fromVal).forEach(function(key2) {\n setMultiValuedContainer(intoVal, fromVal, key2, config);\n });\n } else if (isPlainObject(intoVal)) {\n throw new Error('tried to merge non-object into object: ' + key);\n } else if (intoVal !== fromVal) {\n // different non-empty values -\n intoObj[key] = MULTI_VALUED;\n }\n}\n\nexport {deepCopyPublic, setMultiValuedContainer};\n"]} \ No newline at end of file diff --git a/lib/lib/sortMenu.js b/lib/lib/sortMenu.js new file mode 100644 index 000000000..bc5e7b497 --- /dev/null +++ b/lib/lib/sortMenu.js @@ -0,0 +1,91 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = sortMenu; +function getUniqueValues(value, index, self) { + return self.indexOf(value) === index; +} + +function sortAlphabetically(a, b) { + var sortByGroup = a.props.group === b.props.group ? 0 : a.props.group < b.props.group ? -1 : 1; + var sortByName = a.props.name === b.props.name ? 0 : a.props.name < b.props.name ? -1 : 1; + return sortByGroup || sortByName; +} + +function sortMenu(panels, order) { + // validates order, if a desired panel matches no panel in the panels array, + // it is excluded from ordering considerations + + // eslint-disable-next-line + order = order.filter(function (desiredPanel) { + return panels.some(function (actualPanel) { + return actualPanel.props.name === desiredPanel.name && actualPanel.props.group === desiredPanel.group; + }); + }); + + var desiredGroupOrder = order.map(function (panel) { + return panel.group; + }).filter(getUniqueValues); + var desiredNameOrder = order.map(function (panel) { + return panel.name; + }).filter(getUniqueValues); + + panels.sort(function (a, b) { + var panelAHasGroupCustomOrder = desiredGroupOrder.includes(a.props.group); + var panelBHasGroupCustomOrder = desiredGroupOrder.includes(b.props.group); + + // if one of the elements is not in the desiredGroupOrder array, then it goes to the end of the list + if (panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) { + return -1; + } + if (!panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) { + return 1; + } + + // if both elements are not in the desiredGroupOrder array, they get sorted alphabetically, + // by group, then by name + if (!panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) { + return sortAlphabetically(a, b); + } + + // if both elements are in the desiredGroupOrder array, they get sorted according to their order in + // the desiredGroupOrder, then desiredNameOrder arrays. + if (panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) { + var indexOfGroupA = desiredGroupOrder.indexOf(a.props.group); + var indexOfGroupB = desiredGroupOrder.indexOf(b.props.group); + + if (indexOfGroupA < indexOfGroupB) { + return -1; + } + + if (indexOfGroupA > indexOfGroupB) { + return 1; + } + + if (indexOfGroupA === indexOfGroupB) { + var panelAHasNameCustomOrder = desiredNameOrder.includes(a.props.name); + var panelBHasNameCustomOrder = desiredNameOrder.includes(b.props.name); + + if (!panelAHasNameCustomOrder || !panelBHasNameCustomOrder) { + if (panelAHasNameCustomOrder && !panelBHasNameCustomOrder) { + return -1; + } + if (!panelAHasNameCustomOrder && panelBHasNameCustomOrder) { + return 1; + } + if (!panelAHasNameCustomOrder && !panelBHasNameCustomOrder) { + return sortAlphabetically(a, b); + } + } + + if (panelAHasNameCustomOrder && panelBHasNameCustomOrder) { + return desiredNameOrder.indexOf(a.props.name) - desiredNameOrder.indexOf(b.props.name); + } + } + } + return 0; + }); +} +//# sourceMappingURL=sortMenu.js.map \ No newline at end of file diff --git a/lib/lib/sortMenu.js.map b/lib/lib/sortMenu.js.map new file mode 100644 index 000000000..f220fe031 --- /dev/null +++ b/lib/lib/sortMenu.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/sortMenu.js"],"names":["sortMenu","getUniqueValues","value","index","self","indexOf","sortAlphabetically","a","b","sortByGroup","props","group","sortByName","name","panels","order","filter","some","actualPanel","desiredPanel","desiredGroupOrder","map","panel","desiredNameOrder","sort","panelAHasGroupCustomOrder","includes","panelBHasGroupCustomOrder","indexOfGroupA","indexOfGroupB","panelAHasNameCustomOrder","panelBHasNameCustomOrder"],"mappings":";;;;;kBAUwBA,Q;AAVxB,SAASC,eAAT,CAAyBC,KAAzB,EAAgCC,KAAhC,EAAuCC,IAAvC,EAA6C;AAC3C,SAAOA,KAA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4BAA4BC,wBAAhC,EAA0D;AACxD,iBAAOR,iBAAiBlB,OAAjB,CAAyBE,EAAEG,KAAF,CAAQG,IAAjC,IAAyCU,iBAAiBlB,OAAjB,CAAyBG,EAAEE,KAAF,CAAQG,IAAjC,CAAhD;AACD;AACF;AACF;AACD,WAAO,CAAP;AACD,GAtDD;AAuDD","file":"sortMenu.js","sourcesContent":["function getUniqueValues(value, index, self) {\n return self.indexOf(value) === index;\n}\n\nfunction sortAlphabetically(a, b) {\n const sortByGroup = a.props.group === b.props.group ? 0 : a.props.group < b.props.group ? -1 : 1;\n const sortByName = a.props.name === b.props.name ? 0 : a.props.name < b.props.name ? -1 : 1;\n return sortByGroup || sortByName;\n}\n\nexport default function sortMenu(panels, order) {\n // validates order, if a desired panel matches no panel in the panels array,\n // it is excluded from ordering considerations\n\n // eslint-disable-next-line\n order = order.filter(desiredPanel =>\n panels.some(\n actualPanel =>\n actualPanel.props.name === desiredPanel.name &&\n actualPanel.props.group === desiredPanel.group\n )\n );\n\n const desiredGroupOrder = order.map(panel => panel.group).filter(getUniqueValues);\n const desiredNameOrder = order.map(panel => panel.name).filter(getUniqueValues);\n\n panels.sort((a, b) => {\n const panelAHasGroupCustomOrder = desiredGroupOrder.includes(a.props.group);\n const panelBHasGroupCustomOrder = desiredGroupOrder.includes(b.props.group);\n\n // if one of the elements is not in the desiredGroupOrder array, then it goes to the end of the list\n if (panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) {\n return -1;\n }\n if (!panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) {\n return 1;\n }\n\n // if both elements are not in the desiredGroupOrder array, they get sorted alphabetically,\n // by group, then by name\n if (!panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) {\n return sortAlphabetically(a, b);\n }\n\n // if both elements are in the desiredGroupOrder array, they get sorted according to their order in\n // the desiredGroupOrder, then desiredNameOrder arrays.\n if (panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) {\n const indexOfGroupA = desiredGroupOrder.indexOf(a.props.group);\n const indexOfGroupB = desiredGroupOrder.indexOf(b.props.group);\n\n if (indexOfGroupA < indexOfGroupB) {\n return -1;\n }\n\n if (indexOfGroupA > indexOfGroupB) {\n return 1;\n }\n\n if (indexOfGroupA === indexOfGroupB) {\n const panelAHasNameCustomOrder = desiredNameOrder.includes(a.props.name);\n const panelBHasNameCustomOrder = desiredNameOrder.includes(b.props.name);\n\n if (!panelAHasNameCustomOrder || !panelBHasNameCustomOrder) {\n if (panelAHasNameCustomOrder && !panelBHasNameCustomOrder) {\n return -1;\n }\n if (!panelAHasNameCustomOrder && panelBHasNameCustomOrder) {\n return 1;\n }\n if (!panelAHasNameCustomOrder && !panelBHasNameCustomOrder) {\n return sortAlphabetically(a, b);\n }\n }\n\n if (panelAHasNameCustomOrder && panelBHasNameCustomOrder) {\n return desiredNameOrder.indexOf(a.props.name) - desiredNameOrder.indexOf(b.props.name);\n }\n }\n }\n return 0;\n });\n}\n"]} \ No newline at end of file diff --git a/lib/lib/strings.js b/lib/lib/strings.js new file mode 100644 index 000000000..c036a1f6b --- /dev/null +++ b/lib/lib/strings.js @@ -0,0 +1,55 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/*eslint-disable */ + +/** + * Capitalize string + */ +function capitalize(s) { + return !s ? '' : s.charAt(0).toUpperCase() + s.substring(1); +} + +/** + * "Safer" String.toLowerCase() + */ +function lowerCase(str) { + return str.toLowerCase(); +} + +/** + * "Safer" String.toUpperCase() + */ +function upperCase(str) { + return str.toUpperCase(); +} + +/** + * Remove non-word chars. + */ +function removeNonWord(str) { + return str.replace(/[^0-9a-zA-Z\xC0-\xFF \-]/g, ''); +} + +/** + * Convert string to camelCase text. + */ +function camelCase(string) { + return string.replace(/\-/g, ' ').replace(/(\d)(?=(\d{1})+$)/g, '$1 ').replace(/\s[a-z]/g, upperCase).replace(/\s+/g, '').replace(/^[A-Z]/g, lowerCase); +} + +function pascalCase(str) { + return camelCase(str).replace(/^[a-z]/, upperCase); +} + +exports.capitalize = capitalize; +exports.lowerCase = lowerCase; +exports.upperCase = upperCase; +exports.removeNonWord = removeNonWord; +exports.camelCase = camelCase; +exports.pascalCase = pascalCase; + +/* eslint-enable */ +//# sourceMappingURL=strings.js.map \ No newline at end of file diff --git a/lib/lib/strings.js.map b/lib/lib/strings.js.map new file mode 100644 index 000000000..2e009b2d8 --- /dev/null +++ b/lib/lib/strings.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/strings.js"],"names":["capitalize","s","charAt","toUpperCase","substring","lowerCase","str","toLowerCase","upperCase","removeNonWord","replace","camelCase","string","pascalCase"],"mappings":";;;;;AAAA;;AAEA;;;AAGA,SAASA,UAAT,CAAoBC,CAApB,EAAuB;AACrB,SAAO,CAACA,CAAD,GAAK,EAAL,GAAUA,EAAEC,MAAF,CAAS,CAAT,EAAYC,WAAZ,KAA4BF,EAAEG,SAAF,CAAY,CAAZ,CAA7C;AACD;;AAED;;;AAGA,SAASC,SAAT,CAAmBC,GAAnB,EAAwB;AACtB,SAAOA,IAAIC,WAAJ,EAAP;AACD;;AAED;;;AAGA,SAASC,SAAT,CAAmBF,GAAnB,EAAwB;AACtB,SAAOA,IAAIH,WAAJ,EAAP;AACD;;AAED;;;AAGA,SAASM,aAAT,CAAuBH,GAAvB,EAA4B;AAC1B,SAAOA,IAAII,OAAJ,CAAY,2BAAZ,EAAyC,EAAzC,CAAP;AACD;;AAED;;;AAGA,SAASC,SAAT,CAAmBC,MAAnB,EAA2B;AACzB,SAAOA,OACJF,OADI,CACI,KADJ,EACW,GADX,EAEJA,OAFI,CAEI,oBAFJ,EAE0B,KAF1B,EAGJA,OAHI,CAGI,UAHJ,EAGgBF,SAHhB,EAIJE,OAJI,CAII,MAJJ,EAIY,EAJZ,EAKJA,OALI,CAKI,SALJ,EAKeL,SALf,CAAP;AAMD;;AAED,SAASQ,UAAT,CAAoBP,GAApB,EAAyB;AACvB,SAAOK,UAAUL,GAAV,EAAeI,OAAf,CAAuB,QAAvB,EAAiCF,SAAjC,CAAP;AACD;;QAEOR,U,GAAAA,U;QAAYK,S,GAAAA,S;QAAWG,S,GAAAA,S;QAAWC,a,GAAAA,a;QAAeE,S,GAAAA,S;QAAWE,U,GAAAA,U;;AAEpE","file":"strings.js","sourcesContent":["/*eslint-disable */\n\n/**\n * Capitalize string\n */\nfunction capitalize(s) {\n return !s ? '' : s.charAt(0).toUpperCase() + s.substring(1);\n}\n\n/**\n * \"Safer\" String.toLowerCase()\n */\nfunction lowerCase(str) {\n return str.toLowerCase();\n}\n\n/**\n * \"Safer\" String.toUpperCase()\n */\nfunction upperCase(str) {\n return str.toUpperCase();\n}\n\n/**\n * Remove non-word chars.\n */\nfunction removeNonWord(str) {\n return str.replace(/[^0-9a-zA-Z\\xC0-\\xFF \\-]/g, '');\n}\n\n/**\n * Convert string to camelCase text.\n */\nfunction camelCase(string) {\n return string\n .replace(/\\-/g, ' ')\n .replace(/(\\d)(?=(\\d{1})+$)/g, '$1 ')\n .replace(/\\s[a-z]/g, upperCase)\n .replace(/\\s+/g, '')\n .replace(/^[A-Z]/g, lowerCase);\n}\n\nfunction pascalCase(str) {\n return camelCase(str).replace(/^[a-z]/, upperCase);\n}\n\nexport {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase};\n\n/* eslint-enable */\n"]} \ No newline at end of file diff --git a/lib/lib/striptags.js b/lib/lib/striptags.js new file mode 100644 index 000000000..6856df9be --- /dev/null +++ b/lib/lib/striptags.js @@ -0,0 +1,249 @@ +/* eslint-disable */ + +// The MIT License (MIT) +// +// Copyright (c) [2017] [Eric Norris] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +(function (global) { + // minimal symbol polyfill for IE11 and others + if (typeof _Symbol !== 'function') { + var _Symbol = function _Symbol(name) { + return name; + }; + + _Symbol.nonNative = true; + } + + var STATE_PLAINTEXT = _Symbol('plaintext'); + var STATE_HTML = _Symbol('html'); + var STATE_COMMENT = _Symbol('comment'); + + var ALLOWED_TAGS_REGEX = /<(\w*)>/g; + var NORMALIZE_TAG_REGEX = /<\/?([^\s\/>]+)/; + + function striptags(html, allowable_tags, tag_replacement) { + html = html || ''; + allowable_tags = allowable_tags || []; + tag_replacement = tag_replacement || ''; + + var context = init_context(allowable_tags, tag_replacement); + + return striptags_internal(html, context); + } + + function init_striptags_stream(allowable_tags, tag_replacement) { + allowable_tags = allowable_tags || []; + tag_replacement = tag_replacement || ''; + + var context = init_context(allowable_tags, tag_replacement); + + return function striptags_stream(html) { + return striptags_internal(html || '', context); + }; + } + + striptags.init_streaming_mode = init_striptags_stream; + + function init_context(allowable_tags, tag_replacement) { + allowable_tags = parse_allowable_tags(allowable_tags); + + return { + allowable_tags: allowable_tags, + tag_replacement: tag_replacement, + + state: STATE_PLAINTEXT, + tag_buffer: '', + depth: 0, + in_quote_char: '' + }; + } + + function striptags_internal(html, context) { + var allowable_tags = context.allowable_tags; + var tag_replacement = context.tag_replacement; + + var state = context.state; + var tag_buffer = context.tag_buffer; + var depth = context.depth; + var in_quote_char = context.in_quote_char; + var output = ''; + + for (var idx = 0, length = html.length; idx < length; idx++) { + var char = html[idx]; + + if (state === STATE_PLAINTEXT) { + switch (char) { + case '<': + state = STATE_HTML; + tag_buffer += char; + break; + + default: + output += char; + break; + } + } else if (state === STATE_HTML) { + switch (char) { + case '<': + // ignore '<' if inside a quote + if (in_quote_char) { + break; + } + + // we're seeing a nested '<' + depth++; + break; + + case '>': + // ignore '>' if inside a quote + if (in_quote_char) { + break; + } + + // something like this is happening: '<<>>' + if (depth) { + depth--; + + break; + } + + // this is closing the tag in tag_buffer + in_quote_char = ''; + state = STATE_PLAINTEXT; + tag_buffer += '>'; + + if (allowable_tags.has(normalize_tag(tag_buffer))) { + output += tag_buffer; + } else { + output += tag_replacement; + } + + tag_buffer = ''; + break; + + case '"': + case "'": + // catch both single and double quotes + + if (char === in_quote_char) { + in_quote_char = ''; + } else { + in_quote_char = in_quote_char || char; + } + + tag_buffer += char; + break; + + case '-': + if (tag_buffer === '': + if (tag_buffer.slice(-2) == '--') { + // close the comment + state = STATE_PLAINTEXT; + } + + tag_buffer = ''; + break; + + default: + tag_buffer += char; + break; + } + } + } + + // save the context for future iterations + context.state = state; + context.tag_buffer = tag_buffer; + context.depth = depth; + context.in_quote_char = in_quote_char; + + return output; + } + + function parse_allowable_tags(allowable_tags) { + var tag_set = new Set(); + + if (typeof allowable_tags === 'string') { + var match = void 0; + + while (match = ALLOWED_TAGS_REGEX.exec(allowable_tags)) { + tag_set.add(match[1]); + } + } else if (!_Symbol.nonNative && typeof allowable_tags[_Symbol.iterator] === 'function') { + tag_set = new Set(allowable_tags); + } else if (typeof allowable_tags.forEach === 'function') { + // IE11 compatible + allowable_tags.forEach(tag_set.add, tag_set); + } + + return tag_set; + } + + function normalize_tag(tag_buffer) { + var match = NORMALIZE_TAG_REGEX.exec(tag_buffer); + + return match ? match[1].toLowerCase() : null; + } + + if (typeof define === 'function' && define.amd) { + // AMD + define(function module_factory() { + return striptags; + }); + } else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) { + // Node + module.exports = striptags; + } else { + // Browser + global.striptags = striptags; + } +})(undefined); +//# sourceMappingURL=striptags.js.map \ No newline at end of file diff --git a/lib/lib/striptags.js.map b/lib/lib/striptags.js.map new file mode 100644 index 000000000..480528e23 --- /dev/null +++ b/lib/lib/striptags.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/striptags.js"],"names":["global","Symbol","name","nonNative","STATE_PLAINTEXT","STATE_HTML","STATE_COMMENT","ALLOWED_TAGS_REGEX","NORMALIZE_TAG_REGEX","striptags","html","allowable_tags","tag_replacement","context","init_context","striptags_internal","init_striptags_stream","striptags_stream","init_streaming_mode","parse_allowable_tags","state","tag_buffer","depth","in_quote_char","output","idx","length","char","has","normalize_tag","slice","tag_set","Set","match","exec","add","iterator","forEach","toLowerCase","define","amd","module_factory","module","exports"],"mappings":"AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;AAEA,CAAC,UAASA,MAAT,EAAiB;AAChB;AACA,MAAI,OAAOC,OAAP,KAAkB,UAAtB,EAAkC;AAChC,QAAIA,UAAS,SAATA,OAAS,CAASC,IAAT,EAAe;AAC1B,aAAOA,IAAP;AACD,KAFD;;AAIAD,YAAOE,SAAP,GAAmB,IAAnB;AACD;;AAED,MAAMC,kBAAkBH,QAAO,WAAP,CAAxB;AACA,MAAMI,aAAaJ,QAAO,MAAP,CAAnB;AACA,MAAMK,gBAAgBL,QAAO,SAAP,CAAtB;;AAEA,MAAMM,qBAAqB,UAA3B;AACA,MAAMC,sBAAsB,iBAA5B;;AAEA,WAASC,SAAT,CAAmBC,IAAnB,EAAyBC,cAAzB,EAA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AgD;AAC9C;AACAD,WAAO,SAASE,cAAT,GAA0B;AAC/B,aAAOhC,SAAP;AACD,KAFD;AAGD,GALD,MAKO,IAAI,QAAOiC,MAAP,yCAAOA,MAAP,OAAkB,QAAlB,IAA8BA,OAAOC,OAAzC,EAAkD;AACvD;AACAD,WAAOC,OAAP,GAAiBlC,SAAjB;AACD,GAHM,MAGA;AACL;AACAT,WAAOS,SAAP,GAAmBA,SAAnB;AACD;AACF,CA3ND","file":"striptags.js","sourcesContent":["/* eslint-disable */\n\n// The MIT License (MIT)\n//\n// Copyright (c) [2017] [Eric Norris]\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n'use strict';\n\n(function(global) {\n // minimal symbol polyfill for IE11 and others\n if (typeof Symbol !== 'function') {\n var Symbol = function(name) {\n return name;\n };\n\n Symbol.nonNative = true;\n }\n\n const STATE_PLAINTEXT = Symbol('plaintext');\n const STATE_HTML = Symbol('html');\n const STATE_COMMENT = Symbol('comment');\n\n const ALLOWED_TAGS_REGEX = /<(\\w*)>/g;\n const NORMALIZE_TAG_REGEX = /<\\/?([^\\s\\/>]+)/;\n\n function striptags(html, allowable_tags, tag_replacement) {\n html = html || '';\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n\n const context = init_context(allowable_tags, tag_replacement);\n\n return striptags_internal(html, context);\n }\n\n function init_striptags_stream(allowable_tags, tag_replacement) {\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n\n const context = init_context(allowable_tags, tag_replacement);\n\n return function striptags_stream(html) {\n return striptags_internal(html || '', context);\n };\n }\n\n striptags.init_streaming_mode = init_striptags_stream;\n\n function init_context(allowable_tags, tag_replacement) {\n allowable_tags = parse_allowable_tags(allowable_tags);\n\n return {\n allowable_tags: allowable_tags,\n tag_replacement: tag_replacement,\n\n state: STATE_PLAINTEXT,\n tag_buffer: '',\n depth: 0,\n in_quote_char: '',\n };\n }\n\n function striptags_internal(html, context) {\n const allowable_tags = context.allowable_tags;\n const tag_replacement = context.tag_replacement;\n\n let state = context.state;\n let tag_buffer = context.tag_buffer;\n let depth = context.depth;\n let in_quote_char = context.in_quote_char;\n let output = '';\n\n for (let idx = 0, length = html.length; idx < length; idx++) {\n const char = html[idx];\n\n if (state === STATE_PLAINTEXT) {\n switch (char) {\n case '<':\n state = STATE_HTML;\n tag_buffer += char;\n break;\n\n default:\n output += char;\n break;\n }\n } else if (state === STATE_HTML) {\n switch (char) {\n case '<':\n // ignore '<' if inside a quote\n if (in_quote_char) {\n break;\n }\n\n // we're seeing a nested '<'\n depth++;\n break;\n\n case '>':\n // ignore '>' if inside a quote\n if (in_quote_char) {\n break;\n }\n\n // something like this is happening: '<<>>'\n if (depth) {\n depth--;\n\n break;\n }\n\n // this is closing the tag in tag_buffer\n in_quote_char = '';\n state = STATE_PLAINTEXT;\n tag_buffer += '>';\n\n if (allowable_tags.has(normalize_tag(tag_buffer))) {\n output += tag_buffer;\n } else {\n output += tag_replacement;\n }\n\n tag_buffer = '';\n break;\n\n case '\"':\n case \"'\":\n // catch both single and double quotes\n\n if (char === in_quote_char) {\n in_quote_char = '';\n } else {\n in_quote_char = in_quote_char || char;\n }\n\n tag_buffer += char;\n break;\n\n case '-':\n if (tag_buffer === '':\n if (tag_buffer.slice(-2) == '--') {\n // close the comment\n state = STATE_PLAINTEXT;\n }\n\n tag_buffer = '';\n break;\n\n default:\n tag_buffer += char;\n break;\n }\n }\n }\n\n // save the context for future iterations\n context.state = state;\n context.tag_buffer = tag_buffer;\n context.depth = depth;\n context.in_quote_char = in_quote_char;\n\n return output;\n }\n\n function parse_allowable_tags(allowable_tags) {\n let tag_set = new Set();\n\n if (typeof allowable_tags === 'string') {\n let match;\n\n while ((match = ALLOWED_TAGS_REGEX.exec(allowable_tags))) {\n tag_set.add(match[1]);\n }\n } else if (!Symbol.nonNative && typeof allowable_tags[Symbol.iterator] === 'function') {\n tag_set = new Set(allowable_tags);\n } else if (typeof allowable_tags.forEach === 'function') {\n // IE11 compatible\n allowable_tags.forEach(tag_set.add, tag_set);\n }\n\n return tag_set;\n }\n\n function normalize_tag(tag_buffer) {\n const match = NORMALIZE_TAG_REGEX.exec(tag_buffer);\n\n return match ? match[1].toLowerCase() : null;\n }\n\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(function module_factory() {\n return striptags;\n });\n } else if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = striptags;\n } else {\n // Browser\n global.striptags = striptags;\n }\n})(this);\n"]} \ No newline at end of file diff --git a/lib/lib/test-utils.js b/lib/lib/test-utils.js new file mode 100644 index 000000000..461c31ab3 --- /dev/null +++ b/lib/lib/test-utils.js @@ -0,0 +1,170 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setupGraphDiv = exports.shallow = exports.mount = exports.TestEditor = exports.plotly = exports.fixtures = undefined; + +var _plotlyCartesian = require('plotly.js/dist/plotly-cartesian'); + +var _plotlyCartesian2 = _interopRequireDefault(_plotlyCartesian); + +var _extend = require('plotly.js/src/lib/extend'); + +var _EditorControls = require('../EditorControls'); + +var _EditorControls2 = _interopRequireDefault(_EditorControls); + +var _enzyme = require('enzyme'); + +var _lib = require('../lib'); + +var _enzymeAdapterReact = require('enzyme-adapter-react-16'); + +var _enzymeAdapterReact2 = _interopRequireDefault(_enzymeAdapterReact); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _enzyme.configure)({ adapter: new _enzymeAdapterReact2.default() }); + +/* eslint-disable no-magic-numbers */ + +var fixtures = { + scatter: function scatter(config) { + return applyConfig(config, { + dataSources: { + x1: [1, 2, 3], + y1: [2, 3, 4], + y2: [20, 30, 40] + }, + dataSourceOptions: [{ label: 'xCol', value: 'x1' }, { label: 'yCol', value: 'y1' }, { label: 'yCol2', value: 'y2' }], + graphDiv: { + data: [{ + xsrc: 'x1', + ysrc: 'y1', + name: 'yaxis data', + type: 'scatter' + }, { + xsrc: 'x1', + ysrc: 'y2', + name: 'yaxis2 data', + yaxis: 'y2', + type: 'scatter' + }], + layout: { + title: 'Double Y Axis Example', + yaxis: {}, + yaxis2: { + title: 'yaxis2 title', + titlefont: { color: 'rgb(148, 103, 189)' }, + tickfont: { color: 'rgb(148, 103, 189)' }, + overlaying: 'y', + side: 'right' + } + } + } + }); + }, + area: function area(config) { + return applyConfig(config, { + dataSources: { + x1: [1, 2, 3], + y1: [2, 3, 4] + }, + dataSourceOptions: [{ label: 'xCol', value: 'x1' }, { label: 'yCol', value: 'y1' }], + graphDiv: { + data: [{ + type: 'scatter', + mode: 'markers+lines', + stackgroup: 1, + xsrc: 'x1', + ysrc: 'y1' + }], + layout: {} + } + }); + }, + pie: function pie(config) { + return applyConfig(config, { + dataSources: { + x1: [1, 2, 3], + y1: [2, 3, 4] + }, + dataSourceOptions: [{ label: 'xCol', value: 'x1' }, { label: 'yCol', value: 'y1' }], + graphDiv: { + data: [{ type: 'pie', mode: 'markers', labelssrc: 'x1', valuessrc: 'y1' }], + layout: {} + } + }); + } +}; + +function applyConfig() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var _ref = arguments[1]; + var _ref$graphDiv = _ref.graphDiv, + data = _ref$graphDiv.data, + layout = _ref$graphDiv.layout, + dataSourceOptions = _ref.dataSourceOptions, + dataSources = _ref.dataSources; + + if (config.layout) { + (0, _extend.extendDeep)(layout, config.layout); + } + if (config.data) { + (0, _extend.extendDeep)(data, config.data); + } + if (config.deref !== false) { + (0, _lib.dereference)(data, dataSources); + } + + // replace simple graphDiv with properly mocked GD including fullData/fullLayout + var graphDiv = setupGraphDiv({ data: data, layout: layout }); + + return { dataSources: dataSources, dataSourceOptions: dataSourceOptions, graphDiv: graphDiv }; +} + +/* + * JSDOM does not implement full SVG spec. Mock out necessary methods here. + * https://github.com/tmpvar/jsdom/issues/1330 + * Hardcoded return values have been "good enough" for now but feel free to + * extend the API if necessary. + */ +function mockMissingSvgApis() { + var p = document.createElementNS('http://www.w3.org/2000/svg', 'path'); + var proto = Object.getPrototypeOf(p); + if (typeof proto.getTotalLength !== 'function') { + proto.getTotalLength = function () { + return 100; + }; + } + if (typeof proto.getPointAtLength !== 'function') { + proto.getPointAtLength = function () { + return { x: 0, y: 0 }; + }; + } +} + +function newGraphDiv() { + var graphDiv = window.document.createElement('div'); + graphDiv.id = 'graphDiv'; + + return graphDiv; +} + +function setupGraphDiv(figure) { + var gd = newGraphDiv(); + + mockMissingSvgApis(); + + _plotlyCartesian2.default.newPlot(gd, figure); + return gd; +} + +exports.fixtures = fixtures; +exports.plotly = _plotlyCartesian2.default; +exports.TestEditor = _EditorControls2.default; +exports.mount = _enzyme.mount; +exports.shallow = _enzyme.shallow; +exports.setupGraphDiv = setupGraphDiv; +//# sourceMappingURL=test-utils.js.map \ No newline at end of file diff --git a/lib/lib/test-utils.js.map b/lib/lib/test-utils.js.map new file mode 100644 index 000000000..a86d563ec --- /dev/null +++ b/lib/lib/test-utils.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/test-utils.js"],"names":["adapter","Adapter","fixtures","scatter","config","applyConfig","dataSources","x1","y1","y2","dataSourceOptions","label","value","graphDiv","data","xsrc","ysrc","name","type","yaxis","layout","title","yaxis2","titlefont","color","tickfont","overlaying","side","area","mode","stackgroup","pie","labelssrc","valuessrc","deref","setupGraphDiv","mockMissingSvgApis","p","document","createElementNS","proto","Object","getPrototypeOf","getTotalLength","getPointAtLength","x","y","newGraphDiv","window","createElement","id","figure","gd","plotly","newPlot","TestEditor","EditorControls","mount","shallow"],"mappings":";;;;;;;AAAA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;;;;;AAEA,uBAAU,EAACA,SAAS,IAAIC,4BAAJ,EAAV,EAAV;;AAEA;;AAEA,IAAMC,WAAW;AACfC,SADe,mBACPC,MADO,EACC;AACd,WAAOC,YAAYD,MAAZ,EAAoB;AACzBE,mBAAa;AACXC,YAAI,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CADO;AAEXC,YAAI,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAFO;AAGXC,YAAI,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT;AAHO,OADY;AAMzBC,yBAAmB,CACjB,EAACC,OAAO,MAAR,EAAgBC,OAAO,IAAvB,EADiB,EAEjB,EAACD,OAAO,MAAR,EAAgBC,OAAO,IAAvB,EAFiB,EAGjB,EAACD,OAAO,OAAR,EAAiBC,OAAO,IAAxB,EAHiB,CANM;AAWzBC,gBAAU;AACRC,cAAM,CACJ;AACEC,gBAAM,IADR;AAEEC,gBAAM,IAFR;AAGEC,gBAAM,YAHR;AAIEC,gBAAM;AAJR,SADI,EAOJ;AACEH,gBAAM,IADR;AAEEC,gBAAM,IAFR;AAGEC,gBAAM,aAHR;AAIEE,iBAAO,IAJT;AAKED,gBAAM;AALR,SAPI,CADE;AAgBRE,gBAAQ;AACNC,iBAAO,uBADD;AAENF,iBAAO,EAFD;AAGNG,kBAAQ;AACND,mBAAO,cADD;AAENE,uBAAW,EAACC,OAAO,oBAAR,EAFL;AAGNC,sBAAU,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AAX;;AAEAX;;AAEAiB,4BAAOC,OAAP,CAAeF,EAAf,EAAmBD,MAAnB;AACA,SAAOC,EAAP;AACD;;QAEOlD,Q,GAAAA,Q;QAAUmD,M,GAAAA,yB;QAA0BE,U,GAAlBC,wB;QAA8BC,K,GAAAA,a;QAAOC,O,GAAAA,e;QAASvB,a,GAAAA,a","file":"test-utils.js","sourcesContent":["import plotly from 'plotly.js/dist/plotly-cartesian';\nimport {extendDeep} from 'plotly.js/src/lib/extend';\nimport EditorControls from '../EditorControls';\nimport {configure, mount, shallow} from 'enzyme';\nimport {dereference} from '../lib';\nimport Adapter from 'enzyme-adapter-react-16';\n\nconfigure({adapter: new Adapter()});\n\n/* eslint-disable no-magic-numbers */\n\nconst fixtures = {\n scatter(config) {\n return applyConfig(config, {\n dataSources: {\n x1: [1, 2, 3],\n y1: [2, 3, 4],\n y2: [20, 30, 40],\n },\n dataSourceOptions: [\n {label: 'xCol', value: 'x1'},\n {label: 'yCol', value: 'y1'},\n {label: 'yCol2', value: 'y2'},\n ],\n graphDiv: {\n data: [\n {\n xsrc: 'x1',\n ysrc: 'y1',\n name: 'yaxis data',\n type: 'scatter',\n },\n {\n xsrc: 'x1',\n ysrc: 'y2',\n name: 'yaxis2 data',\n yaxis: 'y2',\n type: 'scatter',\n },\n ],\n layout: {\n title: 'Double Y Axis Example',\n yaxis: {},\n yaxis2: {\n title: 'yaxis2 title',\n titlefont: {color: 'rgb(148, 103, 189)'},\n tickfont: {color: 'rgb(148, 103, 189)'},\n overlaying: 'y',\n side: 'right',\n },\n },\n },\n });\n },\n\n area(config) {\n return applyConfig(config, {\n dataSources: {\n x1: [1, 2, 3],\n y1: [2, 3, 4],\n },\n dataSourceOptions: [{label: 'xCol', value: 'x1'}, {label: 'yCol', value: 'y1'}],\n graphDiv: {\n data: [\n {\n type: 'scatter',\n mode: 'markers+lines',\n stackgroup: 1,\n xsrc: 'x1',\n ysrc: 'y1',\n },\n ],\n layout: {},\n },\n });\n },\n\n pie(config) {\n return applyConfig(config, {\n dataSources: {\n x1: [1, 2, 3],\n y1: [2, 3, 4],\n },\n dataSourceOptions: [{label: 'xCol', value: 'x1'}, {label: 'yCol', value: 'y1'}],\n graphDiv: {\n data: [{type: 'pie', mode: 'markers', labelssrc: 'x1', valuessrc: 'y1'}],\n layout: {},\n },\n });\n },\n};\n\nfunction applyConfig(config = {}, {graphDiv: {data, layout}, dataSourceOptions, dataSources}) {\n if (config.layout) {\n extendDeep(layout, config.layout);\n }\n if (config.data) {\n extendDeep(data, config.data);\n }\n if (config.deref !== false) {\n dereference(data, dataSources);\n }\n\n // replace simple graphDiv with properly mocked GD including fullData/fullLayout\n const graphDiv = setupGraphDiv({data, layout});\n\n return {dataSources, dataSourceOptions, graphDiv};\n}\n\n/*\n * JSDOM does not implement full SVG spec. Mock out necessary methods here.\n * https://github.com/tmpvar/jsdom/issues/1330\n * Hardcoded return values have been \"good enough\" for now but feel free to\n * extend the API if necessary.\n */\nfunction mockMissingSvgApis() {\n const p = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n const proto = Object.getPrototypeOf(p);\n if (typeof proto.getTotalLength !== 'function') {\n proto.getTotalLength = () => 100;\n }\n if (typeof proto.getPointAtLength !== 'function') {\n proto.getPointAtLength = () => ({x: 0, y: 0});\n }\n}\n\nfunction newGraphDiv() {\n const graphDiv = window.document.createElement('div');\n graphDiv.id = 'graphDiv';\n\n return graphDiv;\n}\n\nfunction setupGraphDiv(figure) {\n const gd = newGraphDiv();\n\n mockMissingSvgApis();\n\n plotly.newPlot(gd, figure);\n return gd;\n}\n\nexport {fixtures, plotly, EditorControls as TestEditor, mount, shallow, setupGraphDiv};\n"]} \ No newline at end of file diff --git a/lib/lib/traceTypes.js b/lib/lib/traceTypes.js new file mode 100644 index 000000000..fca21aebf --- /dev/null +++ b/lib/lib/traceTypes.js @@ -0,0 +1,192 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Trace type constants + */ + +var chartCategory = exports.chartCategory = function chartCategory(_) { + return { + SIMPLE: { + value: 'SIMPLE', + label: _('Simple') + }, + CHARTS_3D: { + value: 'CHARTS_3D', + label: _('3D charts') + }, + FINANCIAL: { + value: 'FINANCIAL', + label: _('Finance') + }, + DISTRIBUTIONS: { + value: 'DISTRIBUTIONS', + label: _('Distributions') + }, + MAPS: { + value: 'MAPS', + label: _('Maps') + }, + SPECIALIZED: { + value: 'SPECIALIZED', + label: _('Specialized') + }, + THREE_D: { + value: '3D', + label: _('3D'), + maxColumns: 1 + } + }; +}; + +// Layout specification for TraceTypeSelector.js +var categoryLayout = exports.categoryLayout = function categoryLayout(_) { + return [chartCategory(_).SIMPLE, chartCategory(_).DISTRIBUTIONS, chartCategory(_).THREE_D, chartCategory(_).MAPS, chartCategory(_).FINANCIAL, chartCategory(_).SPECIALIZED]; +}; + +var traceTypes = exports.traceTypes = function traceTypes(_) { + return [{ + value: 'scatter', + label: _('Scatter'), + category: chartCategory(_).SIMPLE + }, { + value: 'bar', + label: _('Bar'), + category: chartCategory(_).SIMPLE + }, { + value: 'line', + label: _('Line'), + category: chartCategory(_).SIMPLE + }, { + value: 'area', + label: _('Area'), + category: chartCategory(_).SIMPLE + }, { + value: 'heatmap', + label: _('Heatmap'), + category: chartCategory(_).SIMPLE + }, { + value: 'table', + label: _('Table'), + category: chartCategory(_).SIMPLE + }, { + value: 'contour', + label: _('Contour'), + category: chartCategory(_).SIMPLE + }, { + value: 'pie', + label: _('Pie'), + category: chartCategory(_).SIMPLE + }, { + value: 'scatter3d', + label: _('3D Scatter'), + category: chartCategory(_).THREE_D + }, { + value: 'line3d', + label: _('3D Line'), + category: chartCategory(_).THREE_D + }, { + value: 'surface', + label: _('3D Surface'), + category: chartCategory(_).THREE_D + }, { + value: 'mesh3d', + label: _('3D Mesh'), + category: chartCategory(_).THREE_D + }, { + value: 'cone', + label: _('Cone'), + category: chartCategory(_).THREE_D + }, { + value: 'streamtube', + label: _('Streamtube'), + category: chartCategory(_).THREE_D + }, { + value: 'box', + label: _('Box'), + category: chartCategory(_).DISTRIBUTIONS + }, { + value: 'violin', + label: _('Violin'), + category: chartCategory(_).DISTRIBUTIONS + }, { + value: 'histogram', + label: _('Histogram'), + category: chartCategory(_).DISTRIBUTIONS + }, { + value: 'histogram2d', + label: _('2D Histogram'), + category: chartCategory(_).DISTRIBUTIONS + }, { + value: 'histogram2dcontour', + label: _('2D Contour Histogram'), + category: chartCategory(_).DISTRIBUTIONS + }, { + value: 'choropleth', + label: _('Choropleth'), + category: chartCategory(_).MAPS + }, { + value: 'scattermapbox', + label: _('Satellite Map'), + category: chartCategory(_).MAPS + }, { + value: 'scattergeo', + label: _('Atlas Map'), + category: chartCategory(_).MAPS + }, + // { + // value: 'parcoords', + // label: _('Parallel Coordinates'), + // category: chartCategory(_).SPECIALIZED, + // }, + // { + // value: 'sankey', + // label: _('Sankey'), + // category: chartCategory(_).SPECIALIZED, + // }, + // { + // value: 'carpet', + // label: _('Carpet'), + // category: chartCategory(_).SPECIALIZED, + // }, + { + value: 'scatterpolar', + label: _('Polar Scatter'), + category: chartCategory(_).SPECIALIZED + }, { + value: 'barpolar', + label: _('Polar Bar'), + category: chartCategory(_).SPECIALIZED + }, { + value: 'scatterternary', + label: _('Ternary Scatter'), + category: chartCategory(_).SPECIALIZED + }, { + value: 'candlestick', + label: _('Candlestick'), + category: chartCategory(_).FINANCIAL + }, { + value: 'ohlc', + label: _('OHLC'), + category: chartCategory(_).FINANCIAL + }, + // { + // value: 'pointcloud', + // label: _('Point Cloud'), + // category: chartCategory(_).THREE_D, + // }, + { + value: 'scattergl', + icon: 'scatter', + label: _('Scatter'), + category: chartCategory(_).THREE_D + }, { + value: 'scatterpolargl', + icon: 'scatterpolar', + label: _('Polar Scatter'), + category: chartCategory(_).THREE_D + }]; +}; +//# sourceMappingURL=traceTypes.js.map \ No newline at end of file diff --git a/lib/lib/traceTypes.js.map b/lib/lib/traceTypes.js.map new file mode 100644 index 000000000..238bd9ce0 --- /dev/null +++ b/lib/lib/traceTypes.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/traceTypes.js"],"names":["chartCategory","SIMPLE","value","label","_","CHARTS_3D","FINANCIAL","DISTRIBUTIONS","MAPS","SPECIALIZED","THREE_D","maxColumns","categoryLayout","traceTypes","category","icon"],"mappings":";;;;;AAAA;;;;AAIO,IAAMA,wCAAgB,SAAhBA,aAAgB,IAAK;AAChC,SAAO;AACLC,YAAQ;AACNC,aAAO,QADD;AAENC,aAAOC,EAAE,QAAF;AAFD,KADH;AAKLC,eAAW;AACTH,aAAO,WADE;AAETC,aAAOC,EAAE,WAAF;AAFE,KALN;AASLE,eAAW;AACTJ,aAAO,WADE;AAETC,aAAOC,EAAE,SAAF;AAFE,KATN;AAaLG,mBAAe;AACbL,aAAO,eADM;AAEbC,aAAOC,EAAE,eAAF;AAFM,KAbV;AAiBLI,UAAM;AACJN,aAAO,MADH;AAEJC,aAAOC,EAAE,MAAF;AAFH,KAjBD;AAqBLK,iBAAa;AACXP,aAAO,aADI;AAEXC,aAAOC,EAAE,aAAF;AAFI,KArBR;AAyBLM,aAAS;AACPR,aAAO,IADA;AAEPC,aAAOC,EAAE,IAAF,CAFA;AAGPO,kBAAY;AAHL;AAzBJ,GAAP;AA+BD,CAhCM;;AAkCP;AACO,IAAMC,0CAAiB,SAAjBA,cAAiB;AAAA,SAAK,CACjCZ,cAAcI,CAAd,EAAiBH,MADgB,EAEjCD,cAAcI,CAAd,EAAiBG,aAFgB,EAGjCP,cAAcI,CAAd,EAAiBM,OAHgB,EAIjCV,cAAcI,CAAd,EAAiBI,IAJgB,EAKjCR,cAAcI,CAAd,EAAiBE,SALgB,EAMjCN,cAAcI,CAAd,EAAiBK,WANgB,CAAL;AAAA,CAAvB;;AASA,IAAMI,kCAAa,SAAbA,UAAa;AAAA,SAAK,CAC7B;AACEX,WAAO,SADT;AAEEC,WAAOC,EAAE,SAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBH;AAH7B,GAD6B,EAM7B;A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7B;AACEP,WAAO,UADT;AAEEC,WAAOC,EAAE,WAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBK;AAH7B,GAnI6B,EAwI7B;AACEP,WAAO,gBADT;AAEEC,WAAOC,EAAE,iBAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBK;AAH7B,GAxI6B,EA6I7B;AACEP,WAAO,aADT;AAEEC,WAAOC,EAAE,aAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBE;AAH7B,GA7I6B,EAkJ7B;AACEJ,WAAO,MADT;AAEEC,WAAOC,EAAE,MAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBE;AAH7B,GAlJ6B;AAuJ7B;AACA;AACA;AACA;AACA;AACA;AACEJ,WAAO,WADT;AAEEa,UAAM,SAFR;AAGEZ,WAAOC,EAAE,SAAF,CAHT;AAIEU,cAAUd,cAAcI,CAAd,EAAiBM;AAJ7B,GA5J6B,EAkK7B;AACER,WAAO,gBADT;AAEEa,UAAM,cAFR;AAGEZ,WAAOC,EAAE,eAAF,CAHT;AAIEU,cAAUd,cAAcI,CAAd,EAAiBM;AAJ7B,GAlK6B,CAAL;AAAA,CAAnB","file":"traceTypes.js","sourcesContent":["/**\n * Trace type constants\n */\n\nexport const chartCategory = _ => {\n return {\n SIMPLE: {\n value: 'SIMPLE',\n label: _('Simple'),\n },\n CHARTS_3D: {\n value: 'CHARTS_3D',\n label: _('3D charts'),\n },\n FINANCIAL: {\n value: 'FINANCIAL',\n label: _('Finance'),\n },\n DISTRIBUTIONS: {\n value: 'DISTRIBUTIONS',\n label: _('Distributions'),\n },\n MAPS: {\n value: 'MAPS',\n label: _('Maps'),\n },\n SPECIALIZED: {\n value: 'SPECIALIZED',\n label: _('Specialized'),\n },\n THREE_D: {\n value: '3D',\n label: _('3D'),\n maxColumns: 1,\n },\n };\n};\n\n// Layout specification for TraceTypeSelector.js\nexport const categoryLayout = _ => [\n chartCategory(_).SIMPLE,\n chartCategory(_).DISTRIBUTIONS,\n chartCategory(_).THREE_D,\n chartCategory(_).MAPS,\n chartCategory(_).FINANCIAL,\n chartCategory(_).SPECIALIZED,\n];\n\nexport const traceTypes = _ => [\n {\n value: 'scatter',\n label: _('Scatter'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'bar',\n label: _('Bar'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'line',\n label: _('Line'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'area',\n label: _('Area'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'heatmap',\n label: _('Heatmap'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'table',\n label: _('Table'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'contour',\n label: _('Contour'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'pie',\n label: _('Pie'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'scatter3d',\n label: _('3D Scatter'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'line3d',\n label: _('3D Line'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'surface',\n label: _('3D Surface'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'mesh3d',\n label: _('3D Mesh'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'cone',\n label: _('Cone'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'streamtube',\n label: _('Streamtube'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'box',\n label: _('Box'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'violin',\n label: _('Violin'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'histogram',\n label: _('Histogram'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'histogram2d',\n label: _('2D Histogram'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'histogram2dcontour',\n label: _('2D Contour Histogram'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'choropleth',\n label: _('Choropleth'),\n category: chartCategory(_).MAPS,\n },\n {\n value: 'scattermapbox',\n label: _('Satellite Map'),\n category: chartCategory(_).MAPS,\n },\n {\n value: 'scattergeo',\n label: _('Atlas Map'),\n category: chartCategory(_).MAPS,\n },\n // {\n // value: 'parcoords',\n // label: _('Parallel Coordinates'),\n // category: chartCategory(_).SPECIALIZED,\n // },\n // {\n // value: 'sankey',\n // label: _('Sankey'),\n // category: chartCategory(_).SPECIALIZED,\n // },\n // {\n // value: 'carpet',\n // label: _('Carpet'),\n // category: chartCategory(_).SPECIALIZED,\n // },\n {\n value: 'scatterpolar',\n label: _('Polar Scatter'),\n category: chartCategory(_).SPECIALIZED,\n },\n {\n value: 'barpolar',\n label: _('Polar Bar'),\n category: chartCategory(_).SPECIALIZED,\n },\n {\n value: 'scatterternary',\n label: _('Ternary Scatter'),\n category: chartCategory(_).SPECIALIZED,\n },\n {\n value: 'candlestick',\n label: _('Candlestick'),\n category: chartCategory(_).FINANCIAL,\n },\n {\n value: 'ohlc',\n label: _('OHLC'),\n category: chartCategory(_).FINANCIAL,\n },\n // {\n // value: 'pointcloud',\n // label: _('Point Cloud'),\n // category: chartCategory(_).THREE_D,\n // },\n {\n value: 'scattergl',\n icon: 'scatter',\n label: _('Scatter'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'scatterpolargl',\n icon: 'scatterpolar',\n label: _('Polar Scatter'),\n category: chartCategory(_).THREE_D,\n },\n // {\n // value: 'heatmapgl',\n // icon: 'heatmap',\n // label: _('Heatmap GL'),\n // category: chartCategory(_).THREE_D,\n // },\n];\n"]} \ No newline at end of file diff --git a/lib/lib/unpackPlotProps.js b/lib/lib/unpackPlotProps.js new file mode 100644 index 000000000..259ad82f7 --- /dev/null +++ b/lib/lib/unpackPlotProps.js @@ -0,0 +1,98 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = unpackPlotProps; + +var _nested_property = require('plotly.js/src/lib/nested_property'); + +var _nested_property2 = _interopRequireDefault(_nested_property); + +var _fastIsnumeric = require('fast-isnumeric'); + +var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); + +var _constants = require('./constants'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function unpackPlotProps(props, context) { + var container = context.container, + getValObject = context.getValObject, + defaultContainer = context.defaultContainer, + updateContainer = context.updateContainer; + + + if (!props.attr) { + return {}; + } + + var attrMeta = void 0; + if (getValObject) { + attrMeta = context.getValObject(props.attr) || {}; + } + + var fullContainer = context.fullContainer; + + var fullProperty = (0, _nested_property2.default)(fullContainer, props.attr); + var fullValue = fullProperty.get(); + var multiValued = false; + + // MULTI_VALUED consists of a control sequence that cannot be confused with + // user data. We must transform it into something that can be displayed as + // the screen. + if (fullValue === _constants.MULTI_VALUED) { + fullValue = _constants.MULTI_VALUED_PLACEHOLDER; + multiValued = true; + } + + var isVisible = false; + if (props.show || fullValue !== void 0 && fullValue !== null) { + isVisible = true; + } + + var defaultValue = props.defaultValue; + if (defaultValue === void 0 && defaultContainer) { + defaultValue = (0, _nested_property2.default)(defaultContainer, props.attr).get(); + } + + var min = void 0, + max = void 0, + description = void 0; + if (attrMeta) { + if ((0, _fastIsnumeric2.default)(attrMeta.max)) { + max = attrMeta.max; + } + if ((0, _fastIsnumeric2.default)(attrMeta.min)) { + min = attrMeta.min; + } + + description = attrMeta.description; + } + + var updatePlot = function updatePlot(v) { + if (updateContainer) { + updateContainer(_defineProperty({}, props.attr, v)); + } + }; + + return { + attrMeta: attrMeta, + container: container, + defaultValue: defaultValue, + fullContainer: fullContainer, + fullValue: fullValue, + getValObject: getValObject, + isVisible: isVisible, + max: max, + min: min, + description: description, + multiValued: multiValued, + updateContainer: updateContainer, + updatePlot: updatePlot + }; +} +//# sourceMappingURL=unpackPlotProps.js.map \ No newline at end of file diff --git a/lib/lib/unpackPlotProps.js.map b/lib/lib/unpackPlotProps.js.map new file mode 100644 index 000000000..b3ddf0c36 --- /dev/null +++ b/lib/lib/unpackPlotProps.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/unpackPlotProps.js"],"names":["unpackPlotProps","props","context","container","getValObject","defaultContainer","updateContainer","attr","attrMeta","fullContainer","fullProperty","fullValue","get","multiValued","MULTI_VALUED","MULTI_VALUED_PLACEHOLDER","isVisible","show","defaultValue","min","max","description","updatePlot","v"],"mappings":";;;;;kBAIwBA,e;;AAJxB;;;;AACA;;;;AACA;;;;;;AAEe,SAASA,eAAT,CAAyBC,KAAzB,EAAgCC,OAAhC,EAAyC;AAAA,MAC/CC,SAD+C,GACeD,OADf,CAC/CC,SAD+C;AAAA,MACpCC,YADoC,GACeF,OADf,CACpCE,YADoC;AAAA,MACtBC,gBADsB,GACeH,OADf,CACtBG,gBADsB;AAAA,MACJC,eADI,GACeJ,OADf,CACJI,eADI;;;AAGtD,MAAI,CAACL,MAAMM,IAAX,EAAiB;AACf,WAAO,EAAP;AACD;;AAED,MAAIC,iBAAJ;AACA,MAAIJ,YAAJ,EAAkB;AAChBI,eAAWN,QAAQE,YAAR,CAAqBH,MAAMM,IAA3B,KAAoC,EAA/C;AACD;;AAED,MAAME,gBAAgBP,QAAQO,aAA9B;;AAEA,MAAMC,eAAe,+BAAeD,aAAf,EAA8BR,MAAMM,IAApC,CAArB;AACA,MAAII,YAAYD,aAAaE,GAAb,EAAhB;AACA,MAAIC,cAAc,KAAlB;;AAEA;AACA;AACA;AACA,MAAIF,cAAcG,uBAAlB,EAAgC;AAC9BH,gBAAYI,mCAAZ;AACAF,kBAAc,IAAd;AACD;;AAED,MAAIG,YAAY,KAAhB;AACA,MAAIf,MAAMgB,IAAN,IAAeN,cAAc,KAAK,CAAnB,IAAwBA,cAAc,IAAzD,EAAgE;AAC9DK,gBAAY,IAAZ;AACD;;AAED,MAAIE,eAAejB,MAAMiB,YAAzB;AACA,MAAIA,iBAAiB,KAAK,CAAtB,IAA2Bb,gBAA/B,EAAiD;AAC/Ca,mBAAe,+BAAeb,gBAAf,EAAiCJ,MAAMM,IAAvC,EAA6CK,GAA7C,EAAf;AACD;;AAED,MAAIO,YAAJ;AAAA,MAASC,YAAT;AAAA,MAAcC,oBAAd;AACA,MAAIb,QAAJ,EAAc;AACZ,QAAI,6BAAUA,SAASY,GAAnB,CAAJ,EAA6B;AAC3BA,YAAMZ,SAASY,GAAf;AACD;AACD,QAAI,6BAAUZ,SAASW,GAAnB,CAAJ,EAA6B;AAC3BA,YAAMX,SAASW,GAAf;AACD;;AAEDE,kBAAcb,SAASa,WAAvB;AACD;;AAED,MAAMC,aAAa,SAAbA,UAAa,IAAK;AACtB,QAAIhB,eAAJ,EAAqB;AACnBA,0CAAkBL,MAAMM,IAAxB,EAA+BgB,CAA/B;AACD;AACF,GAJD;;AAMA,SAAO;AACLf,sBADK;AAELL,wBAFK;AAGLe,8BAHK;AAILT,gCAJK;AAKLE,wBALK;AAMLP,8BANK;AAOLY,wBAPK;AAQLI,YARK;AASLD,YATK;AAULE,4BAVK;AAWLR,4BAXK;AAYLP,oCAZK;AAaLgB;AAbK,GAAP;AAeD","file":"unpackPlotProps.js","sourcesContent":["import nestedProperty from 'plotly.js/src/lib/nested_property';\nimport isNumeric from 'fast-isnumeric';\nimport {MULTI_VALUED, MULTI_VALUED_PLACEHOLDER} from './constants';\n\nexport default function unpackPlotProps(props, context) {\n const {container, getValObject, defaultContainer, updateContainer} = context;\n\n if (!props.attr) {\n return {};\n }\n\n let attrMeta;\n if (getValObject) {\n attrMeta = context.getValObject(props.attr) || {};\n }\n\n const fullContainer = context.fullContainer;\n\n const fullProperty = nestedProperty(fullContainer, props.attr);\n let fullValue = fullProperty.get();\n let multiValued = false;\n\n // MULTI_VALUED consists of a control sequence that cannot be confused with\n // user data. We must transform it into something that can be displayed as\n // the screen.\n if (fullValue === MULTI_VALUED) {\n fullValue = MULTI_VALUED_PLACEHOLDER;\n multiValued = true;\n }\n\n let isVisible = false;\n if (props.show || (fullValue !== void 0 && fullValue !== null)) {\n isVisible = true;\n }\n\n let defaultValue = props.defaultValue;\n if (defaultValue === void 0 && defaultContainer) {\n defaultValue = nestedProperty(defaultContainer, props.attr).get();\n }\n\n let min, max, description;\n if (attrMeta) {\n if (isNumeric(attrMeta.max)) {\n max = attrMeta.max;\n }\n if (isNumeric(attrMeta.min)) {\n min = attrMeta.min;\n }\n\n description = attrMeta.description;\n }\n\n const updatePlot = v => {\n if (updateContainer) {\n updateContainer({[props.attr]: v});\n }\n };\n\n return {\n attrMeta,\n container,\n defaultValue,\n fullContainer,\n fullValue,\n getValObject,\n isVisible,\n max,\n min,\n description,\n multiValued,\n updateContainer,\n updatePlot,\n };\n}\n"]} \ No newline at end of file diff --git a/lib/lib/walkObject.js b/lib/lib/walkObject.js new file mode 100644 index 000000000..8c0a610b9 --- /dev/null +++ b/lib/lib/walkObject.js @@ -0,0 +1,186 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +exports.isPlainObject = isPlainObject; +exports.makeAttrSetterPath = makeAttrSetterPath; +exports.default = walkObject; +function isPlainObject(input) { + return input && !Array.isArray(input) && (typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object'; +} + +/* + * Helper function for _walkObject + */ +function doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys) { + if (!Array.isArray(value)) { + return false; + } + + if (walkArrays || walkArraysMatchingKeys && walkArraysMatchingKeys.includes(key)) { + return true; + } + + return false; +} + +/* + * Helper utility for path accumulation in _walkObject. Supports array + * path accumulation and also Plotly.js nestedProperty style. + */ +function getPath() { + var pathType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'array'; + var _path = arguments[1]; + + return { + _path: _path || (pathType === 'array' ? [] : ''), + set: function set(parent, key) { + var nextPath = void 0; + switch (pathType) { + case 'array': + nextPath = this._path.concat([key]); + break; + + case 'nestedProperty': + if (this._path.length === 0) { + nextPath = key; + } else if (Array.isArray(parent)) { + nextPath = this._path + ('[' + key + ']'); + } else { + nextPath = this._path + '.' + key; + } + break; + + default: + throw new Error('unrecognized pathType ' + pathType); + } + + return getPath(pathType, nextPath); + }, + get: function get(parent, key) { + // in array mode we do not return the leaf node key. + if (pathType === 'array') { + return this._path; + } + + // in nestedProperty mode we return full path including final key + return this.set(parent, key)._path; + } + }; +} + +/* + * Helper function that transforms an array of path parts into a single path. + * For example: + * + * ['_fullData', 0, 'transforms', 3, 'type'] => 'transforms[3].type' + * + * Note that it strips out the _fullData part (and also _fullInput) since that's + * usually present in the attribute path but isn't necessary in the attribute + * string since it's usually implicitly applied through the userDataIndex. + */ +function makeAttrSetterPath(parts) { + var path = ''; + + // Truncate the leading parts that aren't intersting when applying changes: + var i0 = 0; + if (parts[i0] === '_fullData') { + i0 += 2; + } + if (parts[i0] === '_fullInput') { + i0++; + } + if (parts[i0] === '_fullLayout') { + i0++; + } + + for (var i = i0; i < parts.length; i++) { + if (typeof parts[i] === 'number' || Array.isArray(parts[i])) { + path += '[' + (Array.isArray(parts[i]) ? parts[i][0] : parts[i]) + ']'; + } else { + path += (i > i0 ? '.' : '') + parts[i]; + } + } + return path; +} + +/** + * The function that walkObject calls at each node. + * + * @callback walkObjectCallback + * @param {string|number} key The current key, which may be nested. + * @param {object} parent The object which owns the 'key' as a prop. + * @param {Array} path The keys that lead to the 'parent' object. + * @returns {boolean} True if the value at 'key' should *not* be traversed into + * if it happens to be an object. I.e., you don't need to + * return anything if you want the default traversal of the + * whole object. + */ + +/** + * Walks through object and recurses if necessary. + * + * @param {object} object The top-level or nested object we're walking through. + * @param {walkObjectCallback} callback Called at each object node. + * @param {Array} path The keys that lead from to top-level object to this one. + * @param {object} config configuration object + * @param {string} config.walkArrays flag allowing array walking + * @param {Array} config.walkArraysMatchingKeys An array of keys permitting + * array walking + * @param {string} config.pathType Either 'array' or 'nestedProperty'. Array + * based paths return string keys in an array up + * until the current key position. + * NestedProperty style returns a single + * concatenated "nestedProperty" style string. + * @returns {void} + * @private + */ +function _walkObject(object, callback, path, config) { + var walkArrays = config.walkArrays, + walkArraysMatchingKeys = config.walkArraysMatchingKeys; + + Object.keys(object).forEach(function (key) { + // Callback can force traversal to stop by returning `true`. + if (callback(key, object, path.get(object, key))) { + return; + } + + var value = object[key]; + if (isPlainObject(value) || doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys)) { + _walkObject(value, callback, path.set(object, key), config); + } + }); +} + +/** + * General function to walk object and call the given callback for each node. + * + * @param {Object|Array} input The object or array we want to walk. + * @param {walkObjectCallback} callback Called at each object node. + * @param {Object} [config] configuration object + * @param {Boolean} [config.walkArrays] flag allowing array walking + * @param {Array} [config.walkArraysMatchingKeys] An array of keys permitting + * array walking + * @param {String} [config.pathType] Either 'array' or 'nestedProperty'. Array + * based paths return string keys in an array + * up until the current key position. + * NestedProperty style returns a single + * concatenated "nestedProperty" style string + * with the current key included in the path. + * Defaults to "array" + * @returns {void} + */ +function walkObject(input, callback) { + var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + if (!isPlainObject(input) && !Array.isArray(input)) { + throw new Error('The input must be an object.'); + } + var path = getPath(config.pathType); + _walkObject(input, callback, path, config); +} +//# sourceMappingURL=walkObject.js.map \ No newline at end of file diff --git a/lib/lib/walkObject.js.map b/lib/lib/walkObject.js.map new file mode 100644 index 000000000..5703f7281 --- /dev/null +++ b/lib/lib/walkObject.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/lib/walkObject.js"],"names":["isPlainObject","makeAttrSetterPath","walkObject","input","Array","isArray","doArrayWalk","key","value","walkArrays","walkArraysMatchingKeys","includes","getPath","pathType","_path","set","parent","nextPath","concat","length","Error","get","parts","path","i0","i","_walkObject","object","callback","config","Object","keys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5CpB,UAD4C,GACNoB,MADM,CAC5CpB,UAD4C;AAAA,MAChCC,sBADgC,GACNmB,MADM,CAChCnB,sBADgC;;AAEnDoB,SAAOC,IAAP,CAAYJ,MAAZ,EAAoBK,OAApB,CAA4B,eAAO;AACjC;AACA,QAAIJ,SAASrB,GAAT,EAAcoB,MAAd,EAAsBJ,KAAKF,GAAL,CAASM,MAAT,EAAiBpB,GAAjB,CAAtB,CAAJ,EAAkD;AAChD;AACD;;AAED,QAAMC,QAAQmB,OAAOpB,GAAP,CAAd;AACA,QAAIP,cAAcQ,KAAd,KAAwBF,YAAYC,GAAZ,EAAiBC,KAAjB,EAAwBC,UAAxB,EAAoCC,sBAApC,CAA5B,EAAyF;AACvFgB,kBAAYlB,KAAZ,EAAmBoB,QAAnB,EAA6BL,KAAKR,GAAL,CAASY,MAAT,EAAiBpB,GAAjB,CAA7B,EAAoDsB,MAApD;AACD;AACF,GAVD;AAWD;;AAED;;;;;;;;;;;;;;;;;;AAkBe,SAAS3B,UAAT,CAAoBC,KAApB,EAA2ByB,QAA3B,EAAkD;AAAA,MAAbC,MAAa,uEAAJ,EAAI;;AAC/D,MAAI,CAAC7B,cAAcG,KAAd,CAAD,IAAyB,CAACC,MAAMC,OAAN,CAAcF,KAAd,CAA9B,EAAoD;AAClD,UAAM,IAAIiB,KAAJ,CAAU,8BAAV,CAAN;AACD;AACD,MAAIG,OAAOX,QAAQiB,OAAOhB,QAAf,CAAX;AACAa,cAAYvB,KAAZ,EAAmByB,QAAnB,EAA6BL,IAA7B,EAAmCM,MAAnC;AACD","file":"walkObject.js","sourcesContent":["export function isPlainObject(input) {\n return input && !Array.isArray(input) && typeof input === 'object';\n}\n\n/*\n * Helper function for _walkObject\n */\nfunction doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys) {\n if (!Array.isArray(value)) {\n return false;\n }\n\n if (walkArrays || (walkArraysMatchingKeys && walkArraysMatchingKeys.includes(key))) {\n return true;\n }\n\n return false;\n}\n\n/*\n * Helper utility for path accumulation in _walkObject. Supports array\n * path accumulation and also Plotly.js nestedProperty style.\n */\nfunction getPath(pathType = 'array', _path) {\n return {\n _path: _path || (pathType === 'array' ? [] : ''),\n set(parent, key) {\n let nextPath;\n switch (pathType) {\n case 'array':\n nextPath = this._path.concat([key]);\n break;\n\n case 'nestedProperty':\n if (this._path.length === 0) {\n nextPath = key;\n } else if (Array.isArray(parent)) {\n nextPath = this._path + `[${key}]`;\n } else {\n nextPath = this._path + '.' + key;\n }\n break;\n\n default:\n throw new Error('unrecognized pathType ' + pathType);\n }\n\n return getPath(pathType, nextPath);\n },\n\n get(parent, key) {\n // in array mode we do not return the leaf node key.\n if (pathType === 'array') {\n return this._path;\n }\n\n // in nestedProperty mode we return full path including final key\n return this.set(parent, key)._path;\n },\n };\n}\n\n/*\n * Helper function that transforms an array of path parts into a single path.\n * For example:\n *\n * ['_fullData', 0, 'transforms', 3, 'type'] => 'transforms[3].type'\n *\n * Note that it strips out the _fullData part (and also _fullInput) since that's\n * usually present in the attribute path but isn't necessary in the attribute\n * string since it's usually implicitly applied through the userDataIndex.\n */\nexport function makeAttrSetterPath(parts) {\n let path = '';\n\n // Truncate the leading parts that aren't intersting when applying changes:\n let i0 = 0;\n if (parts[i0] === '_fullData') {\n i0 += 2;\n }\n if (parts[i0] === '_fullInput') {\n i0++;\n }\n if (parts[i0] === '_fullLayout') {\n i0++;\n }\n\n for (let i = i0; i < parts.length; i++) {\n if (typeof parts[i] === 'number' || Array.isArray(parts[i])) {\n path += '[' + (Array.isArray(parts[i]) ? parts[i][0] : parts[i]) + ']';\n } else {\n path += (i > i0 ? '.' : '') + parts[i];\n }\n }\n return path;\n}\n\n/**\n * The function that walkObject calls at each node.\n *\n * @callback walkObjectCallback\n * @param {string|number} key The current key, which may be nested.\n * @param {object} parent The object which owns the 'key' as a prop.\n * @param {Array} path The keys that lead to the 'parent' object.\n * @returns {boolean} True if the value at 'key' should *not* be traversed into\n * if it happens to be an object. I.e., you don't need to\n * return anything if you want the default traversal of the\n * whole object.\n */\n\n/**\n * Walks through object and recurses if necessary.\n *\n * @param {object} object The top-level or nested object we're walking through.\n * @param {walkObjectCallback} callback Called at each object node.\n * @param {Array} path The keys that lead from to top-level object to this one.\n * @param {object} config configuration object\n * @param {string} config.walkArrays flag allowing array walking\n * @param {Array} config.walkArraysMatchingKeys An array of keys permitting\n * array walking\n * @param {string} config.pathType Either 'array' or 'nestedProperty'. Array\n * based paths return string keys in an array up\n * until the current key position.\n * NestedProperty style returns a single\n * concatenated \"nestedProperty\" style string.\n * @returns {void}\n * @private\n */\nfunction _walkObject(object, callback, path, config) {\n const {walkArrays, walkArraysMatchingKeys} = config;\n Object.keys(object).forEach(key => {\n // Callback can force traversal to stop by returning `true`.\n if (callback(key, object, path.get(object, key))) {\n return;\n }\n\n const value = object[key];\n if (isPlainObject(value) || doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys)) {\n _walkObject(value, callback, path.set(object, key), config);\n }\n });\n}\n\n/**\n * General function to walk object and call the given callback for each node.\n *\n * @param {Object|Array} input The object or array we want to walk.\n * @param {walkObjectCallback} callback Called at each object node.\n * @param {Object} [config] configuration object\n * @param {Boolean} [config.walkArrays] flag allowing array walking\n * @param {Array} [config.walkArraysMatchingKeys] An array of keys permitting\n * array walking\n * @param {String} [config.pathType] Either 'array' or 'nestedProperty'. Array\n * based paths return string keys in an array\n * up until the current key position.\n * NestedProperty style returns a single\n * concatenated \"nestedProperty\" style string\n * with the current key included in the path.\n * Defaults to \"array\"\n * @returns {void}\n */\nexport default function walkObject(input, callback, config = {}) {\n if (!isPlainObject(input) && !Array.isArray(input)) {\n throw new Error('The input must be an object.');\n }\n var path = getPath(config.pathType);\n _walkObject(input, callback, path, config);\n}\n"]} \ No newline at end of file diff --git a/lib/locales/en.js b/lib/locales/en.js new file mode 100644 index 000000000..2d4be0f4c --- /dev/null +++ b/lib/locales/en.js @@ -0,0 +1,9 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + foo: 'bar' +}; +//# sourceMappingURL=en.js.map \ No newline at end of file diff --git a/lib/locales/en.js.map b/lib/locales/en.js.map new file mode 100644 index 000000000..9cb7f6cfc --- /dev/null +++ b/lib/locales/en.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/locales/en.js"],"names":["foo"],"mappings":";;;;;kBAAe;AACbA,OAAK;AADQ,C","file":"en.js","sourcesContent":["export default {\n foo: 'bar',\n};\n"]} \ No newline at end of file diff --git a/lib/locales/index.js b/lib/locales/index.js new file mode 100644 index 000000000..c733f5ad3 --- /dev/null +++ b/lib/locales/index.js @@ -0,0 +1,21 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _en = require('./en'); + +var _en2 = _interopRequireDefault(_en); + +var _xx = require('./xx'); + +var _xx2 = _interopRequireDefault(_xx); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = { + en: _en2.default, + xx: _xx2.default +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/locales/index.js.map b/lib/locales/index.js.map new file mode 100644 index 000000000..b7d4f2027 --- /dev/null +++ b/lib/locales/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/locales/index.js"],"names":["en","xx"],"mappings":";;;;;;AAAA;;;;AACA;;;;;;kBAEe;AACbA,MAAIA,YADS;AAEbC,MAAIA;AAFS,C","file":"index.js","sourcesContent":["import en from './en';\nimport xx from './xx';\n\nexport default {\n en: en,\n xx: xx,\n};\n"]} \ No newline at end of file diff --git a/lib/locales/xx.js b/lib/locales/xx.js new file mode 100644 index 000000000..c206c60ea --- /dev/null +++ b/lib/locales/xx.js @@ -0,0 +1,214 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + '2D Contour Histogram': '⇚⇚⇚⇚2D Contour Histogram⇚⇚⇚⇚', + '2D Histogram': '⇚⇚2D Histogram⇚⇚', + '3D Scatter': '⇚⇚3D Scatter⇚⇚', + All: '⇚All⇚', + 'Anchor Point': '⇚⇚Anchor Point⇚⇚', + Angle: '⇚Angle⇚', + Annotation: '⇚⇚Annotation⇚⇚', + Area: '⇚Area⇚', + Arrow: '⇚Arrow⇚', + Arrowhead: '⇚⇚Arrowhead⇚⇚', + 'Atlas Map': '⇚⇚Atlas Map⇚⇚', + Auto: '⇚Auto⇚', + Autoscale: '⇚⇚Autoscale⇚⇚', + Axes: '⇚Axes⇚', + 'Background Color': '⇚⇚⇚Background Color⇚⇚⇚', + Bar: '⇚Bar⇚', + 'Bar Padding': '⇚⇚Bar Padding⇚⇚', + 'Bar Width': '⇚⇚Bar Width⇚⇚', + Bars: '⇚Bars⇚', + Blank: '⇚Blank⇚', + 'Border Color': '⇚⇚Border Color⇚⇚', + 'Border Width': '⇚⇚Border Width⇚⇚', + Bottom: '⇚Bottom⇚', + Box: '⇚Box⇚', + 'Box Padding': '⇚⇚Box Padding⇚⇚', + 'Box Select': '⇚⇚Box Select⇚⇚', + 'Box Width': '⇚⇚Box Width⇚⇚', + Candlestick: '⇚⇚Candlestick⇚⇚', + Canvas: '⇚Canvas⇚', + Carpet: '⇚Carpet⇚', + 'Carpet Contour': '⇚⇚Carpet Contour⇚⇚', + 'Carpet Scatter': '⇚⇚Carpet Scatter⇚⇚', + Center: '⇚Center⇚', + Choropleth: '⇚⇚Choropleth⇚⇚', + 'Click to enter Colorscale title': '⇚⇚⇚⇚⇚Click to enter Colorscale title⇚⇚⇚⇚⇚', + 'Click to enter Component A title': '⇚⇚⇚⇚⇚⇚Click to enter Component A title⇚⇚⇚⇚⇚⇚', + 'Click to enter Component B title': '⇚⇚⇚⇚⇚⇚Click to enter Component B title⇚⇚⇚⇚⇚⇚', + 'Click to enter Component C title': '⇚⇚⇚⇚⇚⇚Click to enter Component C title⇚⇚⇚⇚⇚⇚', + 'Click to enter Plot title': '⇚⇚⇚⇚Click to enter Plot title⇚⇚⇚⇚', + 'Click to enter X axis title': '⇚⇚⇚⇚⇚Click to enter X axis title⇚⇚⇚⇚⇚', + 'Click to enter Y axis title': '⇚⇚⇚⇚⇚Click to enter Y axis title⇚⇚⇚⇚⇚', + 'Collapse All': '⇚⇚Collapse All⇚⇚', + Color: '⇚Color⇚', + "Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.": "⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚", + 'Compare data on hover': '⇚⇚⇚⇚Compare data on hover⇚⇚⇚⇚', + Connect: '⇚Connect⇚', + 'Connect Gaps': '⇚⇚Connect Gaps⇚⇚', + Continue: '⇚Continue⇚', + 'Continuing will convert your LaTeX expression into raw text.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your LaTeX expression into raw text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', + 'Continuing will convert your note to LaTeX-style text.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your note to LaTeX-style text.⇚⇚⇚⇚⇚⇚⇚⇚⇚', + 'Continuing will remove your expression.': '⇚⇚⇚⇚⇚⇚⇚Continuing will remove your expression.⇚⇚⇚⇚⇚⇚⇚', + Contour: '⇚Contour⇚', + Custom: '⇚Custom⇚', + 'Custom Color': '⇚⇚Custom Color⇚⇚', + 'Default Colors': '⇚⇚Default Colors⇚⇚', + Display: '⇚Display⇚', + 'Double-click on legend to isolate one trace': '⇚⇚⇚⇚⇚⇚⇚⇚Double-click on legend to isolate one trace⇚⇚⇚⇚⇚⇚⇚⇚', + 'Double-click to zoom back out': '⇚⇚⇚⇚⇚Double-click to zoom back out⇚⇚⇚⇚⇚', + 'Download plot as a png': '⇚⇚⇚⇚Download plot as a png⇚⇚⇚⇚', + 'Edit in Chart Studio': '⇚⇚⇚⇚Edit in Chart Studio⇚⇚⇚⇚', + 'Edit in HTML': '⇚⇚Edit in HTML⇚⇚', + 'Edit in Rich Text': '⇚⇚⇚Edit in Rich Text⇚⇚⇚', + 'Enter Link URL': '⇚⇚Enter Link URL⇚⇚', + 'Expand All': '⇚⇚Expand All⇚⇚', + 'Filled Area': '⇚⇚Filled Area⇚⇚', + 'Fixed Height': '⇚⇚Fixed Height⇚⇚', + 'Fixed Width': '⇚⇚Fixed Width⇚⇚', + 'Font Color': '⇚⇚Font Color⇚⇚', + 'Font Size': '⇚⇚Font Size⇚⇚', + 'Global Font': '⇚⇚Global Font⇚⇚', + 'Go back': '⇚Go back⇚', + "Go to the 'Create' tab to define traces.": "⇚⇚⇚⇚⇚⇚⇚Go to the 'Create' tab to define traces.⇚⇚⇚⇚⇚⇚⇚", + 'Heads up!': '⇚⇚Heads up!⇚⇚', + Heatmap: '⇚Heatmap⇚', + 'Heatmap GL': '⇚⇚Heatmap GL⇚⇚', + Hide: '⇚Hide⇚', + Histogram: '⇚⇚Histogram⇚⇚', + Horizontal: '⇚⇚Horizontal⇚⇚', + 'Horizontal Positioning': '⇚⇚⇚⇚Horizontal Positioning⇚⇚⇚⇚', + 'IE only supports svg. Changing format to svg.': '⇚⇚⇚⇚⇚⇚⇚⇚IE only supports svg. Changing format to svg.⇚⇚⇚⇚⇚⇚⇚⇚', + LaTeX: '⇚LaTeX⇚', + "LaTeX is a math typesetting language that doesn't work with rich text.": "⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚LaTeX is a math typesetting language that doesn't work with rich text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚", + 'Lasso Select': '⇚⇚Lasso Select⇚⇚', + Layout: '⇚Layout⇚', + Left: '⇚Left⇚', + Legend: '⇚Legend⇚', + 'Legend Box': '⇚⇚Legend Box⇚⇚', + Line: '⇚Line⇚', + 'Line Color': '⇚⇚Line Color⇚⇚', + 'Line Width': '⇚⇚Line Width⇚⇚', + Linear: '⇚Linear⇚', + Lines: '⇚Lines⇚', + "Looks like there aren't any traces defined yet.": "⇚⇚⇚⇚⇚⇚⇚⇚Looks like there aren't any traces defined yet.⇚⇚⇚⇚⇚⇚⇚⇚", + 'Margin Color': '⇚⇚Margin Color⇚⇚', + 'Margins and Padding': '⇚⇚⇚Margins and Padding⇚⇚⇚', + Max: '⇚Max⇚', + Mesh3d: '⇚Mesh3d⇚', + Middle: '⇚Middle⇚', + Min: '⇚Min⇚', + 'Multiple Values': '⇚⇚⇚Multiple Values⇚⇚⇚', + 'No Results': '⇚⇚No Results⇚⇚', + Normal: '⇚Normal⇚', + 'Note Text': '⇚⇚Note Text⇚⇚', + Notes: '⇚Notes⇚', + OHLC: '⇚OHLC⇚', + Opacity: '⇚Opacity⇚', + 'Orbital rotation': '⇚⇚⇚Orbital rotation⇚⇚⇚', + Orientation: '⇚⇚Orientation⇚⇚', + Padding: '⇚Padding⇚', + Pan: '⇚Pan⇚', + 'Parallel Coordinates': '⇚⇚⇚⇚Parallel Coordinates⇚⇚⇚⇚', + Pie: '⇚Pie⇚', + 'Plot Background': '⇚⇚⇚Plot Background⇚⇚⇚', + 'Point Cloud': '⇚⇚Point Cloud⇚⇚', + Points: '⇚Points⇚', + 'Polar Scatter': '⇚⇚Polar Scatter⇚⇚', + Position: '⇚Position⇚', + Positioning: '⇚⇚Positioning⇚⇚', + 'Produced with Plotly': '⇚⇚⇚⇚Produced with Plotly⇚⇚⇚⇚', + Range: '⇚Range⇚', + 'Relative To': '⇚⇚Relative To⇚⇚', + Reset: '⇚Reset⇚', + 'Reset axes': '⇚⇚Reset axes⇚⇚', + 'Reset camera to default': '⇚⇚⇚⇚Reset camera to default⇚⇚⇚⇚', + 'Reset camera to last save': '⇚⇚⇚⇚Reset camera to last save⇚⇚⇚⇚', + 'Reset view': '⇚⇚Reset view⇚⇚', + 'Reset views': '⇚⇚Reset views⇚⇚', + 'Return to the Graph > Create menu above to add data.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚Return to the Graph > Create menu above to add data.⇚⇚⇚⇚⇚⇚⇚⇚⇚', + Reversed: '⇚Reversed⇚', + 'Rich Text': '⇚⇚Rich Text⇚⇚', + 'Rich text is incompatible with LaTeX.': '⇚⇚⇚⇚⇚⇚Rich text is incompatible with LaTeX.⇚⇚⇚⇚⇚⇚', + Right: '⇚Right⇚', + Sankey: '⇚Sankey⇚', + 'Satellite Map': '⇚⇚Satellite Map⇚⇚', + Scale: '⇚Scale⇚', + Scatter: '⇚Scatter⇚', + 'Scatter GL': '⇚⇚Scatter GL⇚⇚', + 'Select an Option': '⇚⇚⇚Select an Option⇚⇚⇚', + Selection: '⇚⇚Selection⇚⇚', + Shape: '⇚Shape⇚', + Show: '⇚Show⇚', + 'Show closest data on hover': '⇚⇚⇚⇚⇚Show closest data on hover⇚⇚⇚⇚⇚', + Size: '⇚Size⇚', + 'Size and Spacing': '⇚⇚⇚Size and Spacing⇚⇚⇚', + 'Snapshot succeeded': '⇚⇚⇚Snapshot succeeded⇚⇚⇚', + 'Sorry, there was a problem downloading your snapshot!': '⇚⇚⇚⇚⇚⇚⇚⇚⇚Sorry, there was a problem downloading your snapshot!⇚⇚⇚⇚⇚⇚⇚⇚⇚', + Surface: '⇚Surface⇚', + Symbol: '⇚Symbol⇚', + Table: '⇚Table⇚', + 'Taking snapshot - this may take a few seconds': '⇚⇚⇚⇚⇚⇚⇚⇚Taking snapshot - this may take a few seconds⇚⇚⇚⇚⇚⇚⇚⇚', + 'Ternary Scatter': '⇚⇚⇚Ternary Scatter⇚⇚⇚', + Text: '⇚Text⇚', + 'Text Attributes': '⇚⇚⇚Text Attributes⇚⇚⇚', + "The anchor point determines which side of the annotation's positioning coordinates refer to.": "⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The anchor point determines which side of the annotation's positioning coordinates refer to.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚", + 'The positioning inputs are relative to the anchor points on the text box.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The positioning inputs are relative to the anchor points on the text box.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', + 'This input has multiple values associated with it. Changing this setting will override these custom inputs.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚This input has multiple values associated with it. Changing this setting will override these custom inputs.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', + 'This trace does not yet have any data.': '⇚⇚⇚⇚⇚⇚⇚This trace does not yet have any data.⇚⇚⇚⇚⇚⇚⇚', + 'Tick Labels': '⇚⇚Tick Labels⇚⇚', + 'Tick Markers': '⇚⇚Tick Markers⇚⇚', + Title: '⇚Title⇚', + 'Title and Fonts': '⇚⇚⇚Title and Fonts⇚⇚⇚', + Titles: '⇚Titles⇚', + 'Toggle Spike Lines': '⇚⇚⇚Toggle Spike Lines⇚⇚⇚', + 'Toggle show closest data on hover': '⇚⇚⇚⇚⇚⇚Toggle show closest data on hover⇚⇚⇚⇚⇚⇚', + Top: '⇚Top⇚', + Trace: '⇚Trace⇚', + 'Trace Order': '⇚⇚Trace Order⇚⇚', + 'Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', + 'Turntable rotation': '⇚⇚⇚Turntable rotation⇚⇚⇚', + Type: '⇚Type⇚', + Typeface: '⇚Typeface⇚', + URL: '⇚URL⇚', + Vertical: '⇚Vertical⇚', + 'Vertical Positioning': '⇚⇚⇚⇚Vertical Positioning⇚⇚⇚⇚', + Violin: '⇚Violin⇚', + Width: '⇚Width⇚', + 'X Position': '⇚⇚X Position⇚⇚', + 'X Vector': '⇚X Vector⇚', + 'Y Position': '⇚⇚Y Position⇚⇚', + 'Y Vector': '⇚Y Vector⇚', + Zoom: '⇚Zoom⇚', + 'Zoom Interactivity': '⇚⇚⇚Zoom Interactivity⇚⇚⇚', + 'Zoom in': '⇚Zoom in⇚', + 'Zoom out': '⇚Zoom out⇚', + 'close:': '⇚close:⇚', + 'high:': '⇚high:⇚', + 'incoming flow count:': '⇚⇚⇚⇚incoming flow count:⇚⇚⇚⇚', + 'kde:': '⇚kde:⇚', + 'lat:': '⇚lat:⇚', + log: '⇚log⇚', + 'lon:': '⇚lon:⇚', + 'low:': '⇚low:⇚', + 'lower fence:': '⇚⇚lower fence:⇚⇚', + 'max:': '⇚max:⇚', + 'mean ± σ:': '⇚⇚mean ± σ:⇚⇚', + 'mean:': '⇚mean:⇚', + 'median:': '⇚median:⇚', + 'min:': '⇚min:⇚', + 'open:': '⇚open:⇚', + 'outgoing flow count:': '⇚⇚⇚⇚outgoing flow count:⇚⇚⇚⇚', + 'q1:': '⇚q1:⇚', + 'q3:': '⇚q3:⇚', + 'source:': '⇚source:⇚', + 'target:': '⇚target:⇚', + trace: '⇚trace⇚', + 'upper fence:': '⇚⇚upper fence:⇚⇚' +}; +//# sourceMappingURL=xx.js.map \ No newline at end of file diff --git a/lib/locales/xx.js.map b/lib/locales/xx.js.map new file mode 100644 index 000000000..2cb1f9b63 --- /dev/null +++ b/lib/locales/xx.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/locales/xx.js"],"names":["All","Angle","Annotation","Area","Arrow","Arrowhead","Auto","Autoscale","Axes","Bar","Bars","Blank","Bottom","Box","Candlestick","Canvas","Carpet","Center","Choropleth","Color","Connect","Continue","Contour","Custom","Display","Heatmap","Hide","Histogram","Horizontal","LaTeX","Layout","Left","Legend","Line","Linear","Lines","Max","Mesh3d","Middle","Min","Normal","Notes","OHLC","Opacity","Orientation","Padding","Pan","Pie","Points","Position","Positioning","Range","Reset","Reversed","Right","Sankey","Scale","Scatter","Selection","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⇚',\n Angle: '⇚Angle⇚',\n Annotation: '⇚⇚Annotation⇚⇚',\n Area: '⇚Area⇚',\n Arrow: '⇚Arrow⇚',\n Arrowhead: '⇚⇚Arrowhead⇚⇚',\n 'Atlas Map': '⇚⇚Atlas Map⇚⇚',\n Auto: '⇚Auto⇚',\n Autoscale: '⇚⇚Autoscale⇚⇚',\n Axes: '⇚Axes⇚',\n 'Background Color': '⇚⇚⇚Background Color⇚⇚⇚',\n Bar: '⇚Bar⇚',\n 'Bar Padding': '⇚⇚Bar Padding⇚⇚',\n 'Bar Width': '⇚⇚Bar Width⇚⇚',\n Bars: '⇚Bars⇚',\n Blank: '⇚Blank⇚',\n 'Border Color': '⇚⇚Border Color⇚⇚',\n 'Border Width': '⇚⇚Border Width⇚⇚',\n Bottom: '⇚Bottom⇚',\n Box: '⇚Box⇚',\n 'Box Padding': '⇚⇚Box Padding⇚⇚',\n 'Box Select': '⇚⇚Box Select⇚⇚',\n 'Box Width': '⇚⇚Box Width⇚⇚',\n Candlestick: '⇚⇚Candlestick⇚⇚',\n Canvas: '⇚Canvas⇚',\n Carpet: '⇚Carpet⇚',\n 'Carpet Contour': '⇚⇚Carpet Contour⇚⇚',\n 'Carpet Scatter': '⇚⇚Carpet Scatter⇚⇚',\n Center: '⇚Center⇚',\n Choropleth: '⇚⇚Choropleth⇚⇚',\n 'Click to enter Colorscale title': '⇚⇚⇚⇚⇚Click to enter Colorscale title⇚⇚⇚⇚⇚',\n 'Click to enter Component A title': '⇚⇚⇚⇚⇚⇚Click to enter Component A title⇚⇚⇚⇚⇚⇚',\n 'Click to enter Component B title': '⇚⇚⇚⇚⇚⇚Click to enter Component B title⇚⇚⇚⇚⇚⇚',\n 'Click to enter Component C title': '⇚⇚⇚⇚⇚⇚Click to enter Component C title⇚⇚⇚⇚⇚⇚',\n 'Click to enter Plot title': '⇚⇚⇚⇚Click to enter Plot title⇚⇚⇚⇚',\n 'Click to enter X axis title': '⇚⇚⇚⇚⇚Click to enter X axis title⇚⇚⇚⇚⇚',\n 'Click to enter Y axis title': '⇚⇚⇚⇚⇚Click to enter Y axis title⇚⇚⇚⇚⇚',\n 'Collapse All': '⇚⇚Collapse All⇚⇚',\n Color: '⇚Color⇚',\n \"Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'Compare data on hover': '⇚⇚⇚⇚Compare data on hover⇚⇚⇚⇚',\n Connect: '⇚Connect⇚',\n 'Connect Gaps': '⇚⇚Connect Gaps⇚⇚',\n Continue: '⇚Continue⇚',\n 'Continuing will convert your LaTeX expression into raw text.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your LaTeX expression into raw text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Continuing will convert your note to LaTeX-style text.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your note to LaTeX-style text.⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Continuing will remove your expression.':\n '⇚⇚⇚⇚⇚⇚⇚Continuing will remove your expression.⇚⇚⇚⇚⇚⇚⇚',\n Contour: '⇚Contour⇚',\n Custom: '⇚Custom⇚',\n 'Custom Color': '⇚⇚Custom Color⇚⇚',\n 'Default Colors': '⇚⇚Default Colors⇚⇚',\n Display: '⇚Display⇚',\n 'Double-click on legend to isolate one trace':\n '⇚⇚⇚⇚⇚⇚⇚⇚Double-click on legend to isolate one trace⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Double-click to zoom back out': '⇚⇚⇚⇚⇚Double-click to zoom back out⇚⇚⇚⇚⇚',\n 'Download plot as a png': '⇚⇚⇚⇚Download plot as a png⇚⇚⇚⇚',\n 'Edit in Chart Studio': '⇚⇚⇚⇚Edit in Chart Studio⇚⇚⇚⇚',\n 'Edit in HTML': '⇚⇚Edit in HTML⇚⇚',\n 'Edit in Rich Text': '⇚⇚⇚Edit in Rich Text⇚⇚⇚',\n 'Enter Link URL': '⇚⇚Enter Link URL⇚⇚',\n 'Expand All': '⇚⇚Expand All⇚⇚',\n 'Filled Area': '⇚⇚Filled Area⇚⇚',\n 'Fixed Height': '⇚⇚Fixed Height⇚⇚',\n 'Fixed Width': '⇚⇚Fixed Width⇚⇚',\n 'Font Color': '⇚⇚Font Color⇚⇚',\n 'Font Size': '⇚⇚Font Size⇚⇚',\n 'Global Font': '⇚⇚Global Font⇚⇚',\n 'Go back': '⇚Go back⇚',\n \"Go to the 'Create' tab to define traces.\":\n \"⇚⇚⇚⇚⇚⇚⇚Go to the 'Create' tab to define traces.⇚⇚⇚⇚⇚⇚⇚\",\n 'Heads up!': '⇚⇚Heads up!⇚⇚',\n Heatmap: '⇚Heatmap⇚',\n 'Heatmap GL': '⇚⇚Heatmap GL⇚⇚',\n Hide: '⇚Hide⇚',\n Histogram: '⇚⇚Histogram⇚⇚',\n Horizontal: '⇚⇚Horizontal⇚⇚',\n 'Horizontal Positioning': '⇚⇚⇚⇚Horizontal Positioning⇚⇚⇚⇚',\n 'IE only supports svg. Changing format to svg.':\n '⇚⇚⇚⇚⇚⇚⇚⇚IE only supports svg. Changing format to svg.⇚⇚⇚⇚⇚⇚⇚⇚',\n LaTeX: '⇚LaTeX⇚',\n \"LaTeX is a math typesetting language that doesn't work with rich text.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚LaTeX is a math typesetting language that doesn't work with rich text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'Lasso Select': '⇚⇚Lasso Select⇚⇚',\n Layout: '⇚Layout⇚',\n Left: '⇚Left⇚',\n Legend: '⇚Legend⇚',\n 'Legend Box': '⇚⇚Legend Box⇚⇚',\n Line: '⇚Line⇚',\n 'Line Color': '⇚⇚Line Color⇚⇚',\n 'Line Width': '⇚⇚Line Width⇚⇚',\n Linear: '⇚Linear⇚',\n Lines: '⇚Lines⇚',\n \"Looks like there aren't any traces defined yet.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚Looks like there aren't any traces defined yet.⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'Margin Color': '⇚⇚Margin Color⇚⇚',\n 'Margins and Padding': '⇚⇚⇚Margins and Padding⇚⇚⇚',\n Max: '⇚Max⇚',\n Mesh3d: '⇚Mesh3d⇚',\n Middle: '⇚Middle⇚',\n Min: '⇚Min⇚',\n 'Multiple Values': '⇚⇚⇚Multiple Values⇚⇚⇚',\n 'No Results': '⇚⇚No Results⇚⇚',\n Normal: '⇚Normal⇚',\n 'Note Text': '⇚⇚Note Text⇚⇚',\n Notes: '⇚Notes⇚',\n OHLC: '⇚OHLC⇚',\n Opacity: '⇚Opacity⇚',\n 'Orbital rotation': '⇚⇚⇚Orbital rotation⇚⇚⇚',\n Orientation: '⇚⇚Orientation⇚⇚',\n Padding: '⇚Padding⇚',\n Pan: '⇚Pan⇚',\n 'Parallel Coordinates': '⇚⇚⇚⇚Parallel Coordinates⇚⇚⇚⇚',\n Pie: '⇚Pie⇚',\n 'Plot Background': '⇚⇚⇚Plot Background⇚⇚⇚',\n 'Point Cloud': '⇚⇚Point Cloud⇚⇚',\n Points: '⇚Points⇚',\n 'Polar Scatter': '⇚⇚Polar Scatter⇚⇚',\n Position: '⇚Position⇚',\n Positioning: '⇚⇚Positioning⇚⇚',\n 'Produced with Plotly': '⇚⇚⇚⇚Produced with Plotly⇚⇚⇚⇚',\n Range: '⇚Range⇚',\n 'Relative To': '⇚⇚Relative To⇚⇚',\n Reset: '⇚Reset⇚',\n 'Reset axes': '⇚⇚Reset axes⇚⇚',\n 'Reset camera to default': '⇚⇚⇚⇚Reset camera to default⇚⇚⇚⇚',\n 'Reset camera to last save': '⇚⇚⇚⇚Reset camera to last save⇚⇚⇚⇚',\n 'Reset view': '⇚⇚Reset view⇚⇚',\n 'Reset views': '⇚⇚Reset views⇚⇚',\n 'Return to the Graph > Create menu above to add data.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚Return to the Graph > Create menu above to add data.⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n Reversed: '⇚Reversed⇚',\n 'Rich Text': '⇚⇚Rich Text⇚⇚',\n 'Rich text is incompatible with LaTeX.': '⇚⇚⇚⇚⇚⇚Rich text is incompatible with LaTeX.⇚⇚⇚⇚⇚⇚',\n Right: '⇚Right⇚',\n Sankey: '⇚Sankey⇚',\n 'Satellite Map': '⇚⇚Satellite Map⇚⇚',\n Scale: '⇚Scale⇚',\n Scatter: '⇚Scatter⇚',\n 'Scatter GL': '⇚⇚Scatter GL⇚⇚',\n 'Select an Option': '⇚⇚⇚Select an Option⇚⇚⇚',\n Selection: '⇚⇚Selection⇚⇚',\n Shape: '⇚Shape⇚',\n Show: '⇚Show⇚',\n 'Show closest data on hover': '⇚⇚⇚⇚⇚Show closest data on hover⇚⇚⇚⇚⇚',\n Size: '⇚Size⇚',\n 'Size and Spacing': '⇚⇚⇚Size and Spacing⇚⇚⇚',\n 'Snapshot succeeded': '⇚⇚⇚Snapshot succeeded⇚⇚⇚',\n 'Sorry, there was a problem downloading your snapshot!':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚Sorry, there was a problem downloading your snapshot!⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n Surface: '⇚Surface⇚',\n Symbol: '⇚Symbol⇚',\n Table: '⇚Table⇚',\n 'Taking snapshot - this may take a few seconds':\n '⇚⇚⇚⇚⇚⇚⇚⇚Taking snapshot - this may take a few seconds⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Ternary Scatter': '⇚⇚⇚Ternary Scatter⇚⇚⇚',\n Text: '⇚Text⇚',\n 'Text Attributes': '⇚⇚⇚Text Attributes⇚⇚⇚',\n \"The anchor point determines which side of the annotation's positioning coordinates refer to.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The anchor point determines which side of the annotation's positioning coordinates refer to.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'The positioning inputs are relative to the anchor points on the text box.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The positioning inputs are relative to the anchor points on the text box.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'This input has multiple values associated with it. Changing this setting will override these custom inputs.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚This input has multiple values associated with it. Changing this setting will override these custom inputs.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'This trace does not yet have any data.': '⇚⇚⇚⇚⇚⇚⇚This trace does not yet have any data.⇚⇚⇚⇚⇚⇚⇚',\n 'Tick Labels': '⇚⇚Tick Labels⇚⇚',\n 'Tick Markers': '⇚⇚Tick Markers⇚⇚',\n Title: '⇚Title⇚',\n 'Title and Fonts': '⇚⇚⇚Title and Fonts⇚⇚⇚',\n Titles: '⇚Titles⇚',\n 'Toggle Spike Lines': '⇚⇚⇚Toggle Spike Lines⇚⇚⇚',\n 'Toggle show closest data on hover': '⇚⇚⇚⇚⇚⇚Toggle show closest data on hover⇚⇚⇚⇚⇚⇚',\n Top: '⇚Top⇚',\n Trace: '⇚Trace⇚',\n 'Trace Order': '⇚⇚Trace Order⇚⇚',\n 'Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Turntable rotation': '⇚⇚⇚Turntable rotation⇚⇚⇚',\n Type: '⇚Type⇚',\n Typeface: '⇚Typeface⇚',\n URL: '⇚URL⇚',\n Vertical: '⇚Vertical⇚',\n 'Vertical Positioning': '⇚⇚⇚⇚Vertical Positioning⇚⇚⇚⇚',\n Violin: '⇚Violin⇚',\n Width: '⇚Width⇚',\n 'X Position': '⇚⇚X Position⇚⇚',\n 'X Vector': '⇚X Vector⇚',\n 'Y Position': '⇚⇚Y Position⇚⇚',\n 'Y Vector': '⇚Y Vector⇚',\n Zoom: '⇚Zoom⇚',\n 'Zoom Interactivity': '⇚⇚⇚Zoom Interactivity⇚⇚⇚',\n 'Zoom in': '⇚Zoom in⇚',\n 'Zoom out': '⇚Zoom out⇚',\n 'close:': '⇚close:⇚',\n 'high:': '⇚high:⇚',\n 'incoming flow count:': '⇚⇚⇚⇚incoming flow count:⇚⇚⇚⇚',\n 'kde:': '⇚kde:⇚',\n 'lat:': '⇚lat:⇚',\n log: '⇚log⇚',\n 'lon:': '⇚lon:⇚',\n 'low:': '⇚low:⇚',\n 'lower fence:': '⇚⇚lower fence:⇚⇚',\n 'max:': '⇚max:⇚',\n 'mean ± σ:': '⇚⇚mean ± σ:⇚⇚',\n 'mean:': '⇚mean:⇚',\n 'median:': '⇚median:⇚',\n 'min:': '⇚min:⇚',\n 'open:': '⇚open:⇚',\n 'outgoing flow count:': '⇚⇚⇚⇚outgoing flow count:⇚⇚⇚⇚',\n 'q1:': '⇚q1:⇚',\n 'q3:': '⇚q3:⇚',\n 'source:': '⇚source:⇚',\n 'target:': '⇚target:⇚',\n trace: '⇚trace⇚',\n 'upper fence:': '⇚⇚upper fence:⇚⇚',\n};\n"]} \ No newline at end of file diff --git a/lib/react-chart-editor.css b/lib/react-chart-editor.css new file mode 100644 index 000000000..c7bcd618c --- /dev/null +++ b/lib/react-chart-editor.css @@ -0,0 +1,2746 @@ +/* + * Layout + */ +/* + * Typography + */ +/* + * SPACING + */ +/* + * BORDERS + */ +/* + * Typography + */ +/* + * Effects + */ +.\+flex { + display: flex; } + +.\+cursor-clickable { + cursor: pointer; } + +.\+hover-grey:hover { + color: var(--color-text-active); } + +@keyframes fade-in { + from { + opacity: 0; } + to { + opacity: 1; } } + +@keyframes fade-and-slide-in-from-bottom { + from { + opacity: 0; + transform: translateY(20px); } + to { + opacity: 1; + transform: none; } } + +@keyframes fsbr { + from { + opacity: 1; + transform: none; } + to { + opacity: 0; + transform: translateY(20px); } } + +@keyframes fade-out { + from { + opacity: 1; } + to { + opacity: 0; } } + +.animate--fade-in, .editor_controls .modal__backdrop { + opacity: 0; + animation: fade-in 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +.animate--fade-out, .editor_controls .modal--animate-out .modal__backdrop { + opacity: 1; + animation: fade-out 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +.animate--fade-and-slide-in-from-bottom, .editor_controls .modal__card { + opacity: 0; + transform: translateY(20px); + animation: fade-and-slide-in-from-bottom 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +.animate--fsbr, .editor_controls .modal--animate-out .modal__card { + opacity: 1; + transform: none; + animation: fsbr 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +:root { + --env: $ENV; } + +.plotly-editor--theme-provider { + --color-white: #ffffff; + --color-rhino-core: #2a3f5f; + --color-rhino-dark: #506784; + --color-rhino-medium-1: #a2b1c6; + --color-rhino-medium-2: #c8d4e3; + --color-rhino-light-1: #dfe8f3; + --color-rhino-light-2: #ebf0f8; + --color-rhino-light-3: #f3f6fa; + --color-rhino-light-4: #fafbfd; + --color-rhino-light-5: #f8f8f9; + --color-dodger: #119dff; + --color-dodger-shade: #0d76bf; + --color-dodger-shade-mid: #0d76bf; + --color-aqua: #09ffff; + --color-aqua-shade: #19d3f3; + --color-lavender: #e763fa; + --color-lavender-shade: #ab63fa; + --color-lavender-shade-mid: #934bde; + --color-cornflower: #636efa; + --color-emerald: #00cc96; + --color-sienna: #ef553b; + --color-accent: var(--color-dodger); + --color-accent-shade: var(--color-dodger-shade); + --color-accent-shade-mid: var(--color-dodger-shade-mid); + --color-brand: var(--color-dodger); + --color-hightlight-darker: var(--color-gray-blue-pale); + --color-text-base: var(--color-rhino-dark); + --color-text-light: var(--color-rhino-medium-1); + --color-text-dark: var(--color-rhino-core); + --color-text-headings: var(--color-text-dark); + --color-text-section-header: var(--color-text-dark); + --color-text-active: var(--color-rhino-core); + --color-text-placeholder: var(--color-rhino-medium-1); + --color-border-default: var(--color-rhino-medium-2); + --color-border-light: var(--color-rhino-light-1); + --color-border-dark: var(--color-rhino-medium-1); + --color-border-accent: var(--color-accent); + --color-border-accent-shade: var(--color-accent-shade); + --color-background: var(--color-rhino-light-2); + --color-background-base: var(--color-rhino-light-2); + --color-background-light: var(--color-rhino-light-3); + --color-background-medium: var(--color-rhino-light-1); + --color-background-dark: var(--color-rhino-medium-1); + --color-background-top: var(--color-white); + --color-background-inverse: var(--color-rhino-dark); + --color-background-inputs: var(--color-background-top); + --color-button-primary-base-fill: var(--color-accent); + --color-button-primary-base-border: var(--color-accent-shade); + --color-button-primary-base-text: var(--color-white); + --color-button-primary-hover-fill: var(--color-accent-shade-mid); + --color-button-primary-hover-border: var(--color-accent-shade); + --color-button-primary-hover-text: var(--color-white); + --color-button-primary-active-fill: var(--color-accent-shade); + --color-button-primary-active-border: var(--color-accent-shade); + --color-button-primary-active-text: var(--color-white); + --color-button-secondary-base-fill: transparent; + --color-button-secondary-base-border: var(--color-rhino-medium-2); + --color-button-secondary-base-text: var(--color-text-base); + --color-button-secondary-hover-fill: transparent; + --color-button-secondary-hover-border: var(--color-rhino-medium-1); + --color-button-secondary-hover-text: var(--color-text-dark); + --color-button-secondary-active-fill: transparent; + --color-button-secondary-active-border: var(--color-rhino-medium-1); + --color-button-secondary-active-text: var(--color-text-dark); + --color-button-tertiary-base-fill: transparent; + --color-button-tertiary-base-border: transparent; + --color-button-tertiary-base-text: var(--color-text-base); + --color-button-tertiary-hover-fill: transparent; + --color-button-tertiary-hover-border: transparent; + --color-button-tertiary-hover-text: var(--color-text-dark); + --color-button-tertiary-active-fill: transparent; + --color-button-tertiary-active-border: transparent; + --color-button-tertiary-active-text: var(--color-text-dark); + --color-button-default-base-fill: var(--color-background-light); + --color-button-default-base-border: var(--color-border-default); + --color-button-default-base-text: var(--color-text-base); + --color-button-default-hover-fill: var(--color-background-base); + --color-button-default-hover-border: var(--color-border-dark); + --color-button-default-hover-text: var(--color-text-dark); + --color-button-default-active-fill: var(--color-background-dark); + --color-button-default-active-border: var(--color-border-dark); + --color-button-default-active-text: var(--color-text-dark); + --color-button-upgrade-base-fill: var(--color-lavender-shade); + --color-button-upgrade-base-border: var(--color-lavender-shade-dark); + --color-button-upgrade-base-text: var(--color-white); + --color-button-upgrade-hover-fill: var(--color-lavender-shade-mid); + --color-button-upgrade-hover-border: var(--color-lavender-shade-dark); + --color-button-upgrade-hover-text: var(--color-white); + --color-button-upgrade-active-fill: var(--color-lavender-shade-dark); + --color-button-upgrade-active-border: var(--color-lavender-shade-dark); + --color-button-upgrade-active-text: var(--color-white); + --color-button-header-base-fill: transparent; + --color-button-header-base-border: var(--color-dodger); + --color-button-header-base-text: var(--color-dodger); + --color-button-header-hover-fill: transparent; + --color-button-header-hover-border: var(--color-dodger-shade-mid); + --color-button-header-hover-text: var(--color-dodger-shade); + --color-button-header-active-fill: transparent; + --color-button-header-active-border: var(--color-dodger-shade); + --color-button-header-active-text: var(--color-dodger-shade); + --spacing-base-unit: 24px; + --spacing-half-unit: 12px; + --spacing-quarter-unit: 6px; + --spacing-sixth-unit: 4px; + --spacing-eighth-unit: 3px; + --font-size-base: 13px; + --font-size-small: 12px; + --font-size-medium: 14px; + --font-size-large: 14px; + --font-size-heading-base: 24px; + --font-size-heading-small: 18px; + --font-size-heading-large: 28px; + --font-size-h5: 16px; + --font-weight-light: 400; + --font-weight-normal: 500; + --font-weight-semibold: 600; + --font-weight-bold: 700; + --font-leading-body: 1.6; + --font-leading-head: 1.2; + --font-letter-spacing-headings: 0.5px; + --font-family-body: "Open Sans", --apple-default, sans-serif; + --font-family-headings: "Dosis", "Arial", sans-serif; + --border-default: 1px solid var(--color-border-default); + --border-light: 1px solid var(--color-border-light); + --border-dark: 1px solid var(--color-border-dark); + --border-accent: 1px solid var(--color-border-accent); + --border-accent-shade: 1px solid var(--color-border-accent-shade); + --border-radius: 5px; + --border-radius-small: 3px; + --text-shadow-dark-color: rgba(42, 63, 95, 0.7); + --text-shadow-dark-ui: 0 1px 2px var(--text-shadow-dark-color); + --text-shadow-dark-ui-inactive: 0 1px 1px rgba(42, 63, 95, 0.4); + --box-shadow-base-color: rgba(80, 103, 132, 0.2); + --box-shadow-base: 0px 2px 9px var(--box-shadow-base-color); + --scrollbar-track-background: var(--color-background-base); + --scrollbar-thumb-color: var(--color-accent); + --panel-background: var(--color-background-base); + --panel-width: 335px; + --fold-header-text-color-base: var(--color-white); + --fold-header-text-color-closed: var(--color-white); + --fold-header-background-base: var(--color-rhino-dark); + --fold-header-background-closed: var(--color-rhino-core); + --fold-header-border-color-closed: var(--color-rhino-core); + --fold-header-border-color-base: var(--color-rhino-dark); + --sidebar-background: var(--color-background-top); + --sidebar-width: 100px; + --sidebar-group-background-base: var(--sidebar-background); + --sidebar-item-background-base: var(--color-background-light); + --sidebar-item-background-hover: var(--color-background-base); + --sidebar-item-background-active: var(--color-background-medium); + --editor-width: calc( + var(--sidebar-width) + var(--panel-width) + 1px + ); } + +.editor_controls { + position: relative; + width: var(--editor-width); + flex-shrink: 0; + overflow: hidden; + display: flex; + /* TODO: Don't inline Draft.css; load it with `systemjs`. */ + /** + * Draft v0.3.0 + * + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + /** +* Rangeslider +*/ + /** +* Rangeslider - Horizontal slider +*/ + /** +* Rangeslider - Vertical slider +*/ + /** +* Rangeslider - Reverse +*/ + /** +* Rangeslider - Labels +*/ + /* ------------------------------------------------------------------- + Microtip + + Modern, lightweight css-only tooltips + Just 1kb minified and gzipped + + @author Ghosh + @package Microtip + +---------------------------------------------------------------------- + 1. Base Styles + 2. Direction Modifiers + 3. Position Modifiers +--------------------------------------------------------------------*/ + /* ------------------------------------------------ + [1] Base Styles +-------------------------------------------------*/ + /* ------------------------------------------------ + [2] Position Modifiers +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.1] Top Left +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.2] Top Right +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.3] Bottom +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.4] Bottom Left +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.5] Bottom Right +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.6] Left +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.7] Right +-------------------------------------------------*/ + /* ------------------------------------------------ + [3] Size +-------------------------------------------------*/ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-family: var(--font-family-body); } + .editor_controls .sidebar { + user-select: none; + height: 100%; + min-width: var(--sidebar-width); + width: var(--sidebar-width); + max-width: var(--sidebar-width); + text-align: center; + background: var(--sidebar-background); + overflow-y: auto; + overflow-x: hidden; + float: left; + border-right: var(--border-default); + flex-grow: 1; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: none; } + .editor_controls .sidebar::-webkit-scrollbar { + background: white; + width: 0px; } + .editor_controls .sidebar::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .sidebar::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls .sidebar__group { + background-color: var(--sidebar-group-background-base); + cursor: pointer; + width: 100%; } + .editor_controls .sidebar__group__title { + color: var(--color-text-base); + font-size: var(--font-size-medium); + font-weight: var(--font-weight-normal); + padding: var(--spacing-half-unit) 0; + text-transform: capitalize; + text-align: left; + border-bottom: var(--border-light); + display: flex; + position: relative; } + .editor_controls .sidebar__group__title__label { + padding-left: var(--spacing-base-unit); } + .editor_controls .sidebar__group__title__icon { + position: absolute; + transform: scale(0.9) translateX(2px) translateY(-4px); + transform-origin: center center; + opacity: 0.5; + transition: all 0.15s ease-in-out; } + .editor_controls .sidebar__group__title__icon svg path { + fill: currentColor; } + .editor_controls .sidebar__group:hover .sidebar__group__title__icon { + opacity: 1; } + .editor_controls .sidebar__group--is-active { + color: var(--color-text-active); + cursor: default; } + .editor_controls .sidebar__group--is-active .sidebar__group__title__label { + font-weight: var(--font-weight-semibold); + color: var(--color-text-active); } + .editor_controls .sidebar__group--is-active .sidebar__group__title__icon { + opacity: 1; } + .editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path { + fill: var(--color-accent); } + .editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon { + transform: scale(0.9) translateY(-5px) rotate(90deg); + opacity: 1; } + .editor_controls .sidebar__group--is-expanded .sidebar__group__title { + position: relative; + z-index: 4; + box-shadow: var(--box-shadow-base); } + .editor_controls .sidebar__item { + color: var(--color-text-base); + cursor: pointer; + font-size: var(--font-size-medium); + font-weight: var(--font-weight-normal); + line-height: var(--font-size-medium); + text-transform: capitalize; + background-color: var(--sidebar-item-background-base); + padding: 10px; + padding-left: 18px; + padding-right: var(--spacing-quarter-unit); + text-align: left; + border-bottom: var(--border-light); + position: relative; + overflow: hidden; } + .editor_controls .sidebar__item--single { + margin-top: 15px; } + .editor_controls .sidebar__item--single:last-child { + margin-bottom: 15px; } + .editor_controls .sidebar__item::before { + content: ''; + position: absolute; + height: 100%; + top: 0; + left: 0; + width: 5px; + background-color: var(--color-accent); + transform: scaleX(0); + transform-origin: left center; + will-change: transform; + transition: all 0.15s ease-in-out; } + .editor_controls .sidebar__item span { + display: block; + will-change: transform; + transition: all 0.15s ease-in-out; } + .editor_controls .sidebar__item:not(.sidebar__item--is-active):hover { + background-color: var(--sidebar-item-background-hover); } + .editor_controls .sidebar__item--is-active { + color: var(--color-text-active); + font-weight: var(--font-weight-semibold); + cursor: default; } + .editor_controls .sidebar__item--is-active::before { + transform: none; } + .editor_controls .sidebar__item--is-active span { + transform: translateX(5px); } + .editor_controls .sidebar__logo { + height: 50px; + margin: 10px; } + .editor_controls .panel { + flex-grow: 1; + overflow-x: hidden; + overflow-y: auto; + padding: var(--spacing-half-unit); + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: column; + width: 100%; + -webkit-overflow-scrolling: touch; } + .editor_controls .panel::-webkit-scrollbar { + background: white; + width: 5px; } + .editor_controls .panel::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .panel::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls__wrapper > .panel { + background-color: var(--panel-background); + border-right: var(--border-default); + width: calc(var(--panel-width)); } + .editor_controls .panel__content { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .panel__header { + margin-bottom: var(--spacing-half-unit); + display: flex; + flex-shrink: 0; } + .editor_controls .panel__header__content { + flex-grow: 1; } + .editor_controls .panel__header__actions__container { + width: 100%; } + .editor_controls .panel__header__collapse { + font-size: var(--font-size-medium); + float: left; + color: var(--color-text-base); + display: flex; + align-items: center; + height: 100%; + cursor: pointer; } + .editor_controls .panel__header__collapse svg { + width: 16px !important; + height: 16px !important; + fill: var(--color-text-light); + padding-right: 3px; } + .editor_controls .panel__header__action { + float: right; } + .editor_controls .panel__empty { + position: absolute; + top: 0; + right: 0; + width: var(--panel-width); + border-right: var(--border-default); + height: 100%; + padding: var(--spacing-half-unit); + background-color: var(--panel-background); + box-sizing: border-box; + z-index: 1003; + display: flex; } + .editor_controls .panel__empty__message { + text-align: center; } + .editor_controls .panel__empty__message__icon { + padding-top: calc(var(--spacing-base-unit) * 2); + margin-bottom: var(--spacing-half-unit); + opacity: 0.5; } + .editor_controls .panel__empty__message__icon svg { + width: 48px !important; + height: 48px !important; } + .editor_controls .panel__empty__message__icon svg path { + fill: var(--color-text-light); } + .editor_controls .panel__empty__message__heading { + color: var(--color-text-headings); + font-size: var(--font-size-heading-base); + font-weight: var(--font-weight-normal); + line-height: var(--font-leading-head); + font-family: var(--font-family-headings); + letter-spacing: var(--font-letter-spacing-headings); } + .editor_controls .panel__empty__message__content { + font-size: var(--font-size-base); + color: var(--color-text-base); + line-height: var(--font-leading-body); } + .editor_controls .panel--no-padding { + padding: 0; } + .editor_controls .fold .panel { + overflow-x: visible; + overflow-y: visible; } + .editor_controls .fold { + width: 100%; + user-select: none; } + .editor_controls .fold__top { + display: flex; + justify-content: space-between; + clear: both; + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + color: var(--fold-header-text-color-closed); + font-size: var(--font-size-base); + border: 1px solid var(--fold-header-border-color-closed); + background-color: var(--fold-header-background-closed); + height: 15px; + border-radius: var(--border-radius); + text-shadow: var(--text-shadow-dark-ui); + transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; } + .editor_controls .fold__top:hover { + cursor: pointer; + background-color: var(--fold-header-background-closed); } + .editor_controls .fold__top svg { + width: 18px; + height: 18px; + display: block; + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .fold__top svg path { + fill: currentColor; } + .editor_controls .fold__top--open { + color: var(--fold-header-text-color-base); + background-color: var(--fold-header-background-base); + border: 1px solid var(--fold-header-border-color-base); + border-radius: var(--border-radius) var(--border-radius) 0 0; + text-shadow: var(--text-shadow-dark-ui-inactive); } + .editor_controls .fold__top--open svg { + filter: drop-shadow(0 1px 1px rgba(42, 63, 95, 0.4)); } + .editor_controls .fold__top--open:hover { + background-color: var(--fold-header-background-base); } + .editor_controls .fold__top__icon { + display: block; + margin-right: var(--spacing-quarter-unit); + transform: translateY(-1px); } + .editor_controls .fold__top__title { + margin-left: var(--spacing-half-unit)/3; + font-size: var(--font-size-medium); + line-height: var(--font-size-medium); + font-weight: var(--font-weight-semibold); + transform: translateY(1px); + white-space: nowrap; + max-width: 230px; + letter-spacing: 0.2px; + text-overflow: ellipsis; + overflow: hidden; } + .editor_controls .fold__top__arrow { + transform: translateX(-3px) translateY(-1px); } + .editor_controls .fold__top__arrow svg { + will-change: transform; + transition: transform 0.1s ease-in-out; + transform: rotate(-90deg); + font-weight: bold; + transform-origin: center center; } + .editor_controls .fold__top__arrow-title { + display: flex; + flex-grow: 1; } + .editor_controls .fold__top__arrow--open svg { + transform: rotate(0deg); } + .editor_controls .fold__top__delete { + font-size: 18px; + opacity: 0.75; + transform: translateY(-2px); } + .editor_controls .fold__top__delete:hover { + opacity: 1; } + .editor_controls .fold__content { + background: var(--color-background-top); + border: var(--border-default); + border-width: 0 1px 1px 1px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; } + .editor_controls .fold__content__plot { + overflow: hidden; + border-bottom-left-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); } + .editor_controls .fold__content > *:first-child { + border-top: 0; } + .editor_controls .fold__content__empty { + font-family: var(--font-family-headings); + display: flex; + flex-direction: column; + justify-content: center; + padding: 30px 25px; } + .editor_controls .fold__content__empty__icon { + margin: 0 auto; + margin-bottom: 15px; + width: 40px; + height: 40px; + border-radius: 50%; + background-color: var(--color-dodger); + display: flex; + flex-direction: column; + justify-content: center; } + .editor_controls .fold__content__empty__icon svg { + margin: 0 auto !important; + fill: white; + width: 23px; + height: 23px; } + .editor_controls .fold__content__empty__message__primary { + text-align: center; + margin-bottom: 20px; + font-size: 17px; + color: var(--color-text-base); } + .editor_controls .fold__content__empty__message__secondary { + font-family: var(--font-family-body); + font-size: var(--font-size-small); + text-align: center; + color: var(--color-text-base); } + .editor_controls .fold__content--noheader { + border-width: 1px 1px 1px 1px; } + .editor_controls .fold { + margin-bottom: var(--spacing-half-unit); } + .editor_controls .fold .fold:last-child { + margin-bottom: 0; } + .editor_controls .section__heading { + position: relative; + display: flex; + font-size: var(--font-size-base); + color: var(--color-text-section-header); + font-weight: var(--font-weight-semibold); + cursor: default; + background-color: var(--color-background-light); + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + clear: both; + text-transform: capitalize; } + .editor_controls .section:not(:first-child) .section__heading { + border-top: var(--border-light); } + .editor_controls .section:first-child .section__heading { + border-top: 0; } + .editor_controls .menupanel { + padding-top: 0; + display: flex; + justify-content: flex-end; + flex-grow: 1; } + .editor_controls .menupanel--ownline { + padding-top: var(--spacing-quarter-unit); + width: 100%; } + .editor_controls .menupanel__label { + font-weight: var(--font-weight-semibold); + padding-right: var(--spacing-quarter-unit); } + .editor_controls .menupanel__icon { + vertical-align: middle; + width: 15px !important; + height: 15px !important; + fill: var(--color-text-light) !important; + padding-left: var(--spacing-quarter-unit); } + .editor_controls .menupanel__icon svg { + display: block; } + .editor_controls .menupanel__icon:hover { + cursor: pointer; + fill: var(--color-accent) !important; } + .editor_controls .menupanel__icon-span { + font-size: var(--font-size-small); + display: flex; } + .editor_controls .menupanel__icon-span--question { + color: var(--color-text-base); } + .editor_controls .info__title { + color: var(--color-text-headings); + font-size: var(--font-size-heading-small); + font-weight: var(--font-weight-normal); + line-height: var(--font-leading-head); + font-family: var(--font-family-headings); + letter-spacing: var(--font-letter-spacing-headings); + padding: var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); } + .editor_controls .info__text { + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + color: var(--color-text-base); + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + line-height: var(--font-leading-body); } + .editor_controls .info__sub-text { + color: var(--color-text-base); + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + font-style: italic; + line-height: var(--font-leading-body); + padding: var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-half-unit); } + .editor_controls .modalbox { + position: absolute; + border-radius: var(--border-radius); + overflow: hidden; + text-transform: none; + text-align: left; + border: var(--border-default); + align-content: center; + box-shadow: var(--box-shadow-base); + left: calc(var(--spacing-quarter-unit) * -1); + width: calc(100% + var(--spacing-half-unit)); + top: calc(100% + var(--spacing-quarter-unit)); + background-color: var(--color-background-top); + z-index: 9; } + .editor_controls .modalbox__cover { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: -1; } + .editor_controls .modalbox--dark { + background-color: var(--color-background-inverse); } + .editor_controls .modalbox--relative { + position: relative; } + .editor_controls .field .modalbox { + width: 100%; + left: -1px; + top: 100%; } + .editor_controls .modal { + box-sizing: border-box; + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + display: flex; + align-items: flex-start; + overflow-y: auto; + justify-content: center; + z-index: 1003; } + .editor_controls .modal * { + box-sizing: border-box; } + .editor_controls .modal__backdrop { + height: 100%; + width: 100%; + left: 0; + top: 0; + position: fixed; + opacity: 0; + will-change: opacity; } + .editor_controls .modal__backdrop::before { + content: ''; + height: 100%; + width: 100%; + left: 0; + opacity: 0.5; + top: 0; + background: var(--color-background-dark); + position: fixed; } + .editor_controls .modal__card { + background: var(--color-background-top); + border-radius: var(--border-radius); + position: relative; + z-index: 1003; + max-width: calc(100% - var(--spacing-base-unit)); + box-shadow: var(--box-shadow-base); + display: flex; + flex-direction: column; + will-change: opacity, transform; + flex-grow: 0; + margin: 5vh 10vw; } + .editor_controls .modal__header { + display: flex; + justify-content: space-between; + align-items: center; + color: var(--color-text-base); + padding: var(--spacing-half-unit); + font-weight: var(--font-weight-semibold); } + .editor_controls .modal__header__close { + opacity: 0.5; } + .editor_controls .modal__header__close:hover { + cursor: pointer; + opacity: 1; } + .editor_controls .modal__header__close svg { + display: block; } + .editor_controls .modal__header__close svg * { + fill: currentColor; } + .editor_controls .modal__content { + flex-grow: 1; + background-color: var(--color-background-light); + border-bottom-left-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); } + .editor_controls .modal__backdrop { + animation-duration: 1s; + animation-delay: 0s; } + .editor_controls .modal__card { + animation-duration: 0.85s; + animation-delay: 0.1s; } + .editor_controls .modal--animate-out { + pointer-events: none; } + .editor_controls .modal--animate-out .modal__backdrop { + animation-duration: 0.85s; + animation-delay: 0s; } + .editor_controls .modal--animate-out .modal__card { + animation-duration: 0.85s; + animation-delay: 0s; } + .editor_controls .panel .react-tabs { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .panel .react-tabs__tab { + flex-grow: 1; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + padding: var(--spacing-quarter-unit); + color: var(--color-text-base); + font-size: var(--font-size-base); + background: var(--color-background-medium); + border: var(--border-default); + border-bottom: 0; + position: relative; + background: var(--color-background-light); + transition: border-color 0.15s ease-in-out; } + .editor_controls .panel .react-tabs__tab-list { + background: var(--color-background-medium); + margin: 0; + flex-shrink: 0; + list-style: none; + display: flex; + align-items: flex-end; + padding-top: var(--spacing-half-unit); + padding-left: var(--spacing-half-unit); + padding-right: var(--spacing-half-unit); + padding-bottom: 0; + height: 32px; } + .editor_controls .panel .react-tabs__tab:first-of-type { + border-top-left-radius: var(--border-radius); } + .editor_controls .panel .react-tabs__tab:last-of-type { + border-top-right-radius: var(--border-radius); } + .editor_controls .panel .react-tabs__tab:hover { + background-color: var(--color-background-base); + cursor: pointer; } + .editor_controls .panel .react-tabs__tab--selected { + background-color: var(--color-background-base); + pointer-events: none; + margin-top: 0; + color: var(--color-text-active); + border-top-color: var(--color-accent); + border-top-width: 2px; } + .editor_controls .panel .react-tabs__tab--selected::before { + position: absolute; + top: 100%; + width: 100%; + height: 1px; + content: ''; + background-color: var(--color-background-base); + left: 0; + z-index: 4; } + .editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type) { + border-left: 0; } + .editor_controls .panel .react-tabs__tab:last-of-type { + border-left: none; } + .editor_controls .panel .react-tabs__tab-panel { + border-top: var(--border-default); + display: none; } + .editor_controls .panel .react-tabs__tab-panel--selected { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .field { + align-items: flex-start; + border-top: var(--border-light); + color: var(--color-text-base); + display: flex; + font-size: var(--font-size-base); + font-weight: var(--font-weight-normal); + justify-content: flex-start; + line-height: var(--font-size-base); + min-height: 32px; + padding: var(--spacing-quarter-unit) 0; + width: 100%; + position: relative; } + .editor_controls .field__no-title { + width: 100%; + padding: 0 var(--spacing-half-unit); + align-self: center; + line-height: var(--font-leading-body); } + .editor_controls .field__no-title--center { + text-align: center; } + .editor_controls .field__widget { + display: flex; + flex-wrap: wrap; + flex-basis: 0; + padding-right: var(--spacing-half-unit); + padding-left: var(--spacing-half-unit); + align-self: center; } + .editor_controls .field__widget:not(.field__widget--units) { + flex-grow: 1; } + .editor_controls .field__widget--units { + padding-right: 0; } + .editor_controls .field__units { + align-self: center; } + .editor_controls .field__title { + width: 80px; + padding-left: var(--spacing-half-unit); + display: block; + font-size: var(--font-size-small); + line-height: var(--font-leading-body); + color: var(--color-text-base); + padding-top: var(--spacing-quarter-unit); + user-select: none; } + .editor_controls .field__title-text { + text-transform: capitalize; + cursor: default; } + .editor_controls .field__delete { + display: flex; + align-items: center; + justify-content: center; + padding-left: var(--spacing-quarter-unit); + opacity: 0.5; } + .editor_controls .field__delete svg { + display: block; } + .editor_controls .field__delete svg path { + fill: var(--color-text-base); } + .editor_controls .field__delete:hover { + cursor: pointer; + opacity: 1; } + .editor_controls .field__delete:hover svg path { + fill: var(--color-sienna); } + .editor_controls .field .rect, + .editor_controls .field .square { + border-color: var(--color-accent); } + .editor_controls .field .rect-grid { + border-color: var(--panel-background) !important; + float: left; + border-top: 1px solid; + border-left: 1px solid; } + .editor_controls .field .rect-container { + margin: 0 auto; + position: relative; + max-width: 294px; } + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .editor_controls .field__widget { + flex-basis: auto; } } + .editor_controls .field .field { + border-top: none; } + .editor_controls .field .field .field__no-title { + padding: 0; } + .editor_controls .symbol-selector__toggle { + border: var(--border-default); + border-radius: var(--border-radius); + width: 80px; + cursor: pointer; + padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px var(--spacing-quarter-unit); } + .editor_controls .symbol-selector__toggle:before, .editor_controls .symbol-selector__toggle:after { + content: ' '; + display: table; } + .editor_controls .symbol-selector__toggle:after { + clear: both; } + .editor_controls .symbol-selector__toggle--dark { + background-color: var(--color-background-inverse); } + .editor_controls .symbol-selector__toggle__option { + float: left; } + .editor_controls .symbol-selector__toggle__caret { + float: right; + fill: var(--color-text-light); + padding-top: var(--spacing-eighth-unit); + width: 13px !important; + height: 13px !important; } + .editor_controls .symbol-selector__menu { + max-width: 225px; + position: absolute; + z-index: 1003; + border: var(--border-default); + padding: var(--spacing-half-unit); + box-shadow: 2px 2px var(--spacing-half-unit) var(--color-border-light); + border-radius: var(--border-radius-small); + left: var(--spacing-base-unit); } + .editor_controls .symbol-selector__item { + display: inline; } + .editor_controls .symbol-selector__symbol:hover { + background-color: var(--color-border-default); } + .editor_controls button { + display: inline-block; + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + line-height: 1; + letter-spacing: 0.5px; + text-transform: capitalize; + text-align: center; + cursor: pointer; + height: 36px; + outline: none; + user-select: none; + font-size: var(--font-size-medium); + font-weight: var(--font-weight-semibold); + font-family: var(--font-family-body); + border-width: 1px; + border-style: solid; + border-color: transparent; + border-radius: var(--border-radius); + transition: all 0.15s ease-in-out; } + .editor_controls button.button { + padding-left: 0; } + .editor_controls .button__wrapper { + display: flex; + align-items: center; + justify-content: center; + position: relative; + overflow: hidden; } + .editor_controls .button__label { + padding-left: var(--spacing-half-unit); } + .editor_controls .button__icon { + display: flex; + padding-left: var(--spacing-quarter-unit); + will-change: transform; } + .editor_controls .button__icon svg { + transform: scale(0.8); + transform-origin: center center; + display: block; } + .editor_controls .button__icon svg path { + fill: currentColor; } + .editor_controls .button__icon + .button__label { + padding-left: 0; } + .sidebar .button { + width: calc(100% - var(--spacing-base-unit)); + margin-left: var(--spacing-half-unit); + margin-right: var(--spacing-half-unit); } + .editor_controls .button--no-text { + background-color: var(--color-button-default-base-fill); + border-color: var(--color-button-default-base-border); + color: var(--color-button-default-base-text); + padding-right: var(--spacing-quarter-unit); + margin-left: 5px; } + .editor_controls .button--no-text:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-default-hover-fill); + border: 1px solid var(--color-button-default-hover-border); + color: var(--color-button-default-hover-text); } + .editor_controls .button--no-text:active:not(.button--no-text--disabled) { + background-color: var(--color-button-default-active-fill); + border: 1px solid var(--color-button-default-active-border); + color: var(--color-button-default-active-text); } + .editor_controls .button--no-text--disabled { + background-color: var(--color-button-default-base-fill); + border-color: var(--color-button-default-base-border); + color: var(--color-button-default-base-text); + padding-right: var(--spacing-quarter-unit); + margin-left: 5px; + color: #bababa; + cursor: default; } + .editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-default-hover-fill); + border: 1px solid var(--color-button-default-hover-border); + color: var(--color-button-default-hover-text); } + .editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled) { + background-color: var(--color-button-default-active-fill); + border: 1px solid var(--color-button-default-active-border); + color: var(--color-button-default-active-text); } + .editor_controls .button--default { + background-color: var(--color-button-default-base-fill); + border-color: var(--color-button-default-base-border); + color: var(--color-button-default-base-text); } + .editor_controls .button--default:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-default-hover-fill); + border: 1px solid var(--color-button-default-hover-border); + color: var(--color-button-default-hover-text); } + .editor_controls .button--default:active:not(.button--no-text--disabled) { + background-color: var(--color-button-default-active-fill); + border: 1px solid var(--color-button-default-active-border); + color: var(--color-button-default-active-text); } + .editor_controls .button--primary { + background-color: var(--color-button-primary-base-fill); + border-color: var(--color-button-primary-base-border); + color: var(--color-button-primary-base-text); + text-shadow: var(--text-shadow-dark-ui); } + .editor_controls .button--primary svg { + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .button--primary:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-primary-hover-fill); + border: 1px solid var(--color-button-primary-hover-border); + color: var(--color-button-primary-hover-text); } + .editor_controls .button--primary:active:not(.button--no-text--disabled) { + background-color: var(--color-button-primary-active-fill); + border: 1px solid var(--color-button-primary-active-border); + color: var(--color-button-primary-active-text); } + .editor_controls .button--secondary { + background-color: var(--color-button-secondary-base-fill); + border-color: var(--color-button-secondary-base-border); + color: var(--color-button-secondary-base-text); } + .editor_controls .button--secondary:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-secondary-hover-fill); + border: 1px solid var(--color-button-secondary-hover-border); + color: var(--color-button-secondary-hover-text); } + .editor_controls .button--secondary:active:not(.button--no-text--disabled) { + background-color: var(--color-button-secondary-active-fill); + border: 1px solid var(--color-button-secondary-active-border); + color: var(--color-button-secondary-active-text); } + .editor_controls .button--tertiary { + background-color: var(--color-button-tertiary-base-fill); + border-color: var(--color-button-tertiary-base-border); + color: var(--color-button-tertiary-base-text); } + .editor_controls .button--tertiary:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-tertiary-hover-fill); + border: 1px solid var(--color-button-tertiary-hover-border); + color: var(--color-button-tertiary-hover-text); } + .editor_controls .button--tertiary:active:not(.button--no-text--disabled) { + background-color: var(--color-button-tertiary-active-fill); + border: 1px solid var(--color-button-tertiary-active-border); + color: var(--color-button-tertiary-active-text); } + .editor_controls .button--upgrade { + background-color: var(--color-button-upgrade-base-fill); + border-color: var(--color-button-upgrade-base-border); + color: var(--color-button-upgrade-base-text); + text-shadow: var(--text-shadow-dark-ui); } + .editor_controls .button--upgrade svg { + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .button--upgrade:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-upgrade-hover-fill); + border: 1px solid var(--color-button-upgrade-hover-border); + color: var(--color-button-upgrade-hover-text); } + .editor_controls .button--upgrade:active:not(.button--no-text--disabled) { + background-color: var(--color-button-upgrade-active-fill); + border: 1px solid var(--color-button-upgrade-active-border); + color: var(--color-button-upgrade-active-text); } + .editor_controls .button--header { + background-color: var(--color-button-header-base-fill); + border-color: var(--color-button-header-base-border); + color: var(--color-button-header-base-text); } + .editor_controls .button--header:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-header-hover-fill); + border: 1px solid var(--color-button-header-hover-border); + color: var(--color-button-header-hover-text); } + .editor_controls .button--header:active:not(.button--no-text--disabled) { + background-color: var(--color-button-header-active-fill); + border: 1px solid var(--color-button-header-active-border); + color: var(--color-button-header-active-text); } + .editor_controls .checkbox__group { + padding-left: var(--spacing-half-unit); + text-align: left; } + .editor_controls .checkbox__item { + user-select: none; + cursor: default; + padding-top: var(--spacing-eighth-unit); + padding-bottom: var(--spacing-eighth-unit); } + .editor_controls .checkbox__item--vertical { + display: block; + clear: both; } + .editor_controls .checkbox__box { + height: 18px; + width: 18px; + border: var(--border-default); + border-radius: var(--border-radius-small); + cursor: pointer; + display: inline-block; + vertical-align: middle; + text-align: center; + position: relative; } + .editor_controls .checkbox__box:hover { + background: var(--color-background-light); } + .editor_controls .checkbox__box--checked { + border: var(--border-accent-shade); + background: var(--color-accent); } + .editor_controls .checkbox__box--checked:hover { + background: var(--color-accent-shade); } + .editor_controls .checkbox__box--checked + .checkbox__label { + color: var(--color-text-active); } + .editor_controls .checkbox__check { + color: var(--color-text-base); + font-size: var(--spacing-half-unit); + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .checkbox__check svg { + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .checkbox__check svg path { + fill: var(--color-white); } + .editor_controls .checkbox__label { + padding-left: var(--spacing-quarter-unit); + font-size: var(--font-size-base); + color: var(--color-text-base); + display: inline-block; + line-height: 20px; + text-align: left; + vertical-align: middle; + cursor: pointer; } + .editor_controls .colorpicker__saturation, .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider, .editor_controls .colorpicker__controls .colorpicker__active { + position: relative; + overflow: hidden; + border: var(--border-default); + border-radius: var(--border-radius-small); + cursor: pointer; } + .editor_controls .colorpicker { + display: flex; + width: 26px; + height: 26px; + border-radius: 100%; + border: var(--border-default); + padding: var(--spacing-eighth-unit); + /* Saturation wrapper style */ + /* Wrapper style for Hue and Alpha sliders and swatch */ } + .editor_controls .colorpicker__outer { + width: 185px; } + .editor_controls .colorpicker__container { + display: flex; + align-items: center; + line-height: 2; + position: relative; + width: 185px; } + .editor_controls .colorpicker__selected-color { + margin-left: var(--spacing-half-unit); + color: var(--color-text-base); + font-weight: var(--font-weight-semibold); + font-size: var(--font-size-small); + display: inline-block; + vertical-align: middle; + text-transform: uppercase; } + .editor_controls .colorpicker__swatch { + border-radius: 50%; + flex-grow: 1; + width: 100%; + height: 100%; } + .editor_controls .colorpicker__saturation { + height: 100px; } + .editor_controls .colorpicker__custom-input { + padding-top: var(--spacing-eighth-unit); } + .editor_controls .colorpicker__custom-input input { + border: var(--border-default) !important; + box-shadow: none !important; + background-color: var(--color-background-inputs); + color: var(--color-text-dark); } + .editor_controls .colorpicker__custom-input input + span { + color: var(--color-text) !important; } + .editor_controls .colorpicker__controls .colorpicker__sliders { + width: 100%; } + .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider { + margin: auto 0; + height: 10px; + margin: var(--spacing-eighth-unit) 0; } + .editor_controls .colorpicker__controls .colorpicker__active { + height: var(--spacing-base-unit); + width: var(--spacing-base-unit); + margin: var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit); } + .editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: var(--border-radius-small); + border: 1px solid #eee; } + .editor_controls .fold .fold .colorpicker__container { + width: calc( $colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit)); } + .editor_controls .colorscalePickerContainer { + min-width: 215px; + position: relative; + padding: 0; + resize: none; + border: none; + background: none; } + .editor_controls .colorscalePickerContainer::-webkit-scrollbar { + width: 5px; } + .editor_controls .colorscalePickerTopContainer { + display: none; } + .editor_controls .colorscaleDescription { + display: none; } + .editor_controls .colorscalePickerContainer input:focus { + outline: none; } + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .editor_controls .colorscalePickerContainer { + display: inline; } } + .editor_controls .colorscalePickerBottomContainer { + padding-right: 3px; } + .editor_controls .customPickerContainer { + margin-top: var(--spacing-quarter-unit); + text-align: left; } + .editor_controls .customPickerContainer__outer { + width: 215px; + text-align: center; } + .editor_controls .dropdown-container { + /** + * React Select + * ============ + * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/ + * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs + * MIT License: https://github.com/JedWatson/react-select +*/ + flex-grow: 1; } + +@keyframes Select-animation-spin { + to { + transform: rotate(1turn); } } + +@-webkit-keyframes Select-animation-spin { + to { + -webkit-transform: rotate(1turn); } } + .editor_controls .dropdown-container .Select { + position: relative; } + .editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button, + .editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button { + display: none !important; } + .editor_controls .dropdown-container .Select input::-ms-clear { + display: none !important; } + .editor_controls .dropdown-container .Select input::-ms-reveal { + display: none !important; } + .editor_controls .dropdown-container .Select, + .editor_controls .dropdown-container .Select div, + .editor_controls .dropdown-container .Select input, + .editor_controls .dropdown-container .Select span { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + .editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone { + cursor: default; + pointer-events: none; } + .editor_controls .dropdown-container .Select.is-disabled > .Select-control { + background-color: #f9f9f9; } + .editor_controls .dropdown-container .Select.is-disabled > .Select-control:hover { + box-shadow: none; } + .editor_controls .dropdown-container .Select.is-searchable.is-open > .Select-control { + cursor: text; } + .editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open) > .Select-control { + cursor: text; } + .editor_controls .dropdown-container .Select.is-open > .Select-control { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background: #fff; + border-color: #b3b3b3 #ccc #d9d9d9; } + .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-arrow { + top: -2px; + border-color: transparent transparent #999; + border-width: 0 5px 5px; } + .editor_controls .dropdown-container .Select.is-focused > .Select-control { + background: #fff; } + .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { + border-color: #08c #0099e6 #0099e6; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px fade(#08c, 50%); } + .editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single > .Select-control .Select-value { + padding-right: 42px; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { + color: #333; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label { + cursor: pointer; + text-decoration: none; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:hover, .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:hover, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { + color: #08c; + outline: none; + text-decoration: underline; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { + background: #fff; } + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input { + opacity: 0; } + .editor_controls .dropdown-container .Select.is-open .Select-arrow, + .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { + border-top-color: #666; } + .editor_controls .dropdown-container .Select.Select--rtl { + direction: rtl; + text-align: right; } + .editor_controls .dropdown-container .Select-control { + background-color: #fff; + border-color: #d9d9d9 #ccc #b3b3b3; + border-radius: 4px; + border: 1px solid #ccc; + color: #333; + cursor: default; + display: table; + border-spacing: 0; + border-collapse: separate; + height: 36px; + outline: none; + overflow: hidden; + position: relative; + width: 100%; } + .editor_controls .dropdown-container .Select-control:hover { + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); } + .editor_controls .dropdown-container .Select-control .Select-input:focus { + outline: none; + background: #fff; } + .editor_controls .dropdown-container .Select-placeholder, + .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { + bottom: 0; + color: #aaa; + left: 0; + line-height: 34px; + padding-left: 10px; + padding-right: 10px; + position: absolute; + right: 0; + top: 0; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + .editor_controls .dropdown-container .Select-input { + height: 34px; + padding-left: 10px; + padding-right: 10px; + vertical-align: middle; } + .editor_controls .dropdown-container .Select-input > input { + width: 100%; + background: none transparent; + border: 0 none; + box-shadow: none; + cursor: default; + display: inline-block; + font-family: inherit; + font-size: inherit; + margin: 0; + outline: none; + line-height: 17px; + /* For IE 8 compatibility */ + padding: 8px 0 12px; + /* For IE 8 compatibility */ + -webkit-appearance: none; } + .is-focused .editor_controls .dropdown-container .Select-input > input { + cursor: text; } + .editor_controls .dropdown-container .Select-control:not(.is-searchable) > .Select-input { + outline: none; } + .editor_controls .dropdown-container .Select-loading-zone { + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 16px; } + .editor_controls .dropdown-container .Select-loading { + -webkit-animation: Select-animation-spin 400ms infinite linear; + -o-animation: Select-animation-spin 400ms infinite linear; + animation: Select-animation-spin 400ms infinite linear; + width: 16px; + height: 16px; + box-sizing: border-box; + border-radius: 50%; + border: 2px solid #ccc; + border-right-color: #333; + display: inline-block; + position: relative; + vertical-align: middle; } + .editor_controls .dropdown-container .Select-clear-zone { + -webkit-animation: Select-animation-fadeIn 200ms; + -o-animation: Select-animation-fadeIn 200ms; + animation: Select-animation-fadeIn 200ms; + color: #999; + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 17px; } + .editor_controls .dropdown-container .Select-clear-zone:hover { + color: #D0021B; } + .editor_controls .dropdown-container .Select-clear { + display: inline-block; + font-size: 18px; + line-height: 1; } + .editor_controls .dropdown-container .Select--multi .Select-clear-zone { + width: 17px; } + .editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper { + display: inline-block; } + .editor_controls .dropdown-container .Select .Select-aria-only { + position: absolute; + display: inline-block; + height: 1px; + width: 1px; + margin: -1px; + clip: rect(0, 0, 0, 0); + overflow: hidden; + float: left; } + .editor_controls .dropdown-container .Select-arrow-zone { + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 25px; + padding-right: 5px; } + .Select--rtl .editor_controls .dropdown-container .Select-arrow-zone { + padding-right: 0; + padding-left: 5px; } + .editor_controls .dropdown-container .Select-arrow { + border-color: #999 transparent transparent; + border-style: solid; + border-width: 5px 5px 2.5px; + display: inline-block; + height: 0; + width: 0; + position: relative; } + +@-webkit-keyframes Select-animation-fadeIn { + from { + opacity: 0; } + to { + opacity: 1; } } + +@keyframes Select-animation-fadeIn { + from { + opacity: 0; } + to { + opacity: 1; } } + .editor_controls .dropdown-container .Select-menu-outer { + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + background-color: #fff; + border: 1px solid #ccc; + border-top-color: #e6e6e6; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); + box-sizing: border-box; + margin-top: -1px; + max-height: 200px; + position: absolute; + left: 0; + top: 100%; + width: 100%; + z-index: 1000; + -webkit-overflow-scrolling: touch; } + .editor_controls .dropdown-container .Select-menu { + max-height: 198px; + overflow-y: auto; } + .editor_controls .dropdown-container .Select-option { + box-sizing: border-box; + background-color: #fff; + color: #666666; + cursor: pointer; + display: block; + padding: 8px 10px; } + .editor_controls .dropdown-container .Select-option:last-child { + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; } + .editor_controls .dropdown-container .Select-option.is-selected { + background-color: #f5faff; + color: #333; } + .editor_controls .dropdown-container .Select-option.is-focused { + background-color: #f2f9fc; + color: #333; } + .editor_controls .dropdown-container .Select-option.is-disabled { + color: #cccccc; + cursor: default; } + .editor_controls .dropdown-container .Select-noresults { + box-sizing: border-box; + color: #999999; + cursor: default; + display: block; + padding: 8px 10px; } + .editor_controls .dropdown-container .Select--multi .Select-input { + vertical-align: middle; + margin-left: 10px; + padding: 0; } + .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input { + margin-left: 0; + margin-right: 10px; } + .editor_controls .dropdown-container .Select--multi.has-value .Select-input { + margin-left: 5px; } + .editor_controls .dropdown-container .Select--multi .Select-value { + background-color: #f2f9fc; + border-radius: 2px; + border: 1px solid #c9e6f2; + color: #08c; + display: inline-block; + font-size: 0.9em; + margin-left: 5px; + margin-top: 5px; + vertical-align: top; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon, + .editor_controls .dropdown-container .Select--multi .Select-value-label { + display: inline-block; + vertical-align: middle; } + .editor_controls .dropdown-container .Select--multi .Select-value-label { + border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + cursor: default; + padding: 2px 5px; } + .editor_controls .dropdown-container .Select--multi a.Select-value-label { + color: #08c; + cursor: pointer; + text-decoration: none; } + .editor_controls .dropdown-container .Select--multi a.Select-value-label:hover { + text-decoration: underline; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon { + cursor: pointer; + border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-right: 1px solid #c9e6f2; + padding: 1px 5px 3px; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi .Select-value-icon:focus { + background-color: #ddeff7; + color: #0077b3; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon:active { + background-color: #c9e6f2; } + .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value { + margin-left: 0; + margin-right: 5px; } + .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon { + border-right: none; + border-left: 1px solid #c9e6f2; } + .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value { + background-color: #fcfcfc; + border: 1px solid #e3e3e3; + color: #333; } + .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon { + cursor: not-allowed; + border-right: 1px solid #e3e3e3; } + .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active { + background-color: #fcfcfc; } + +@keyframes Select-animation-spin { + to { + transform: rotate(1turn); } } + +@-webkit-keyframes Select-animation-spin { + to { + -webkit-transform: rotate(1turn); } } + .editor_controls .dropdown-container:not(:last-child) { + margin-bottom: var(--spacing-quarter-unit); } + .editor_controls .dropdown-container .Select.is-focused > .Select-control { + background-color: var(--color-background-inputs); } + .editor_controls .dropdown-container .Select.is-focused > .Select-control .Select-input { + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select.is-open > .Select-control { + border-color: var(--color-border-dark); + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-input { + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select:not(.is-open) .Select-control { + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover { + border-color: var(--color-border-dark); } + .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow { + opacity: 1; } + .editor_controls .dropdown-container .Select-control { + background-color: var(--color-background-inputs); + border: var(--border-default); + box-shadow: none !important; + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select-option { + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select-menu-outer { + border: var(--border-default); + border-top-color: var(--color-border-default); + background-color: transparent; + box-shadow: var(--box-shadow-base); } + .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { + border-color: var(--color-border-accent); } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select.is-open .Select-arrow, + .editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { + border-color: transparent transparent var(--color-border-accent) !important; } + .editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow { + border-top-color: var(--color-border-accent) !important; } + .editor_controls .dropdown-container .Select-arrow { + border-color: var(--color-border-default) transparent transparent; } + .editor_controls .dropdown-container .Select-option { + background-color: var(--color-background-inputs); } + .editor_controls .dropdown-container .Select-option.is-selected { + color: var(--color-text-active); + font-weight: var(--font-weight-semibold); + background-color: var(--color-background-light); } + .editor_controls .dropdown-container .Select-option.is-focused { + background-color: var(--color-background-light); + color: var(--color-text-active); } + .editor_controls .dropdown-container .Select-option:hover { + color: var(--color-text-active); + background-color: var(--color-background-light); } + .editor_controls .dropdown-container .Select-placeholder, + .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select-value-label { + color: var(--color-text-base) !important; } + .editor_controls .dropdown-container .Select-placeholder { + color: var(--color-text-placeholder); } + .editor_controls .dropdown-container .dropdown--dark .Select-control { + background-color: var(--color-background-inverse); } + .editor_controls .dropdown-container .dropdown--dark .Select-option { + background-color: var(--color-background-inverse); } + .editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected { + background-color: var(--color-border-default); } + .editor_controls .dropdown-container .dropdown--dark .Select.is-focused { + background-color: var(--color-border-light); } + .editor_controls ::-webkit-input-placeholder { + /* Chrome/Opera/Safari */ + color: var(--color-text-placeholder); } + .editor_controls ::-moz-placeholder { + /* Firefox 19+ */ + color: var(--color-text-placeholder); } + .editor_controls :-ms-input-placeholder { + /* IE 10+ */ + color: var(--color-text-placeholder); } + .editor_controls :-moz-placeholder { + /* Firefox 18- */ + color: var(--color-text-placeholder); } + .editor_controls .numeric-input__wrapper { + line-height: 20px; + max-width: 100%; + flex: 1; + display: flex; + align-items: center; + color: var(--color-text-base); } + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .editor_controls .numeric-input__wrapper { + flex-basis: auto; } } + .editor_controls .numeric-input__number { + display: inline-block; + border: var(--border-default); + background: var(--color-background-inputs); + cursor: text; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; + border-radius: var(--border-radius-small); + padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); + width: 62px; + vertical-align: middle; + font-size: inherit; + color: inherit; + font-family: inherit; } + .editor_controls .numeric-input__caret-box { + display: inline-block; + max-height: 32px; + margin-left: var(--spacing-quarter-unit); + margin-right: var(--spacing-half-unit); + vertical-align: middle; + box-sizing: border-box; } + .editor_controls .numeric-input__caret:first-child { + margin-bottom: 2px; } + .editor_controls .numeric-input__caret { + cursor: pointer; + background-color: var(--color-background-light); + border: var(--border-default); + border-radius: 1px; + line-height: var(--spacing-half-unit); + text-align: center; } + .editor_controls .numeric-top-caret-modifier { + width: 13px !important; + height: 13px !important; + fill: var(--color-text-base) !important; } + .editor_controls .numeric-bottom-caret-modifier { + width: 13px !important; + height: 13px !important; + fill: var(--color-text-base) !important; } + .editor_controls ::-webkit-input-placeholder { + /* Chrome/Opera/Safari */ + color: var(--color-text-placeholder); } + .editor_controls ::-moz-placeholder { + /* Firefox 19+ */ + color: var(--color-text-placeholder); } + .editor_controls :-ms-input-placeholder { + /* IE 10+ */ + color: var(--color-text-placeholder); } + .editor_controls :-moz-placeholder { + /* Firefox 18- */ + color: var(--color-text-placeholder); } + .editor_controls .text-input { + display: inline-block; + border: var(--border-default); + background: var(--color-background-inputs); + cursor: text; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; + border-radius: var(--border-radius-small); + padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); + width: 140px; + vertical-align: middle; + font-size: inherit; + color: inherit; + font-family: inherit; } + .editor_controls .radio-block { + width: 100%; + line-height: var(--font-leading-head); + display: flex; } + .editor_controls .radio-block__option { + flex-grow: 1; + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + background-color: var(--color-background-top); + border: var(--border-default); + display: inline-block; + cursor: pointer; + min-width: 0px; + text-align: center; + font-size: var(--font-size-small); } + .editor_controls .radio-block__option:not(.radio-block__option--active):hover { + background-color: var(--color-background-light); + color: var(--color-text-active); } + .editor_controls .radio-block__option--active { + background-color: var(--color-button-primary-base-fill); + color: var(--color-button-primary-base-text); + border: 1px solid var(--color-button-primary-base-border); + margin-left: -1px; + cursor: default; + text-shadow: var(--text-shadow-dark-ui); + font-weight: var(--font-weight-semibold); } + .editor_controls .radio-block__option--active:not(:first-child), .editor_controls .radio-block__option--active:last-child { + border-left: var(--border-accent-shade) !important; } + .editor_controls .radio-block__option:not(:first-child):not(:last-child) { + border-left: 0; } + .editor_controls .radio-block__option:last-child { + border-top-right-radius: var(--border-radius-small); + border-bottom-right-radius: var(--border-radius-small); + border-left: 0; } + .editor_controls .radio-block__option:first-child { + border-top-left-radius: var(--border-radius-small); + border-bottom-left-radius: var(--border-radius-small); } + .editor_controls .radio-block__option:first-child:not(.radio-block__option--active) { + border-left: var(--border-default); } + .editor_controls .text-editor { + overflow: hidden; + border: var(--border-default); + border-radius: var(--border-radius); + min-height: 155px; + display: flex; + flex-direction: column; + flex-grow: 1; } + .editor_controls .text-editor * { + box-sizing: border-box; } + .editor_controls .text-editor textarea[class='multi-format-editor__latex'] { + height: 155px; + width: 100%; + margin: 10px; + border: var(--border-default); } + .editor_controls .text-editor textarea[class='multi-format-editor__html'] { + height: 145px; + width: 100%; } + .editor_controls .text-editor textarea { + width: 100%; + height: 100%; + border: none; + overflow: auto; + outline: none; + box-shadow: none; + padding: var(--spacing-quarter-unit); + resize: none; + line-height: 24px; + font-size: 13px; + color: var(--color-text-base); + background-color: var(--color-background-inputs); } + .editor_controls .multi-format-editor__root { + display: flex; + overflow: hidden; + height: 205px; } + .editor_controls .multi-format-editor__root__wrapper { + flex-grow: 1; + display: flex; + flex-wrap: wrap; + align-items: stretch; + flex-direction: column; } + .editor_controls .multi-format-editor__tabs { + height: 30px; + display: block; + width: 100%; } + .editor_controls .multi-format-editor__tab { + text-align: center; + height: 30px; + line-height: 28px; + box-sizing: border-box; } + .editor_controls .multi-format-editor__tab.top-tab { + width: 50%; + overflow: hidden; + color: var(--color-text-base); + display: inline-block; } + .editor_controls .multi-format-editor__tab.top-tab.left { + border-top-left-radius: 5px; + border-right: var(--border-default); } + .editor_controls .multi-format-editor__tab.top-tab.right { + border-top-right-radius: 5px; } + .editor_controls .multi-format-editor__tab.top-tab:not(.selected) { + border-bottom: var(--border-default); } + .editor_controls .multi-format-editor__tab.bottom-tab { + border-top: var(--border-default); + width: 100%; + display: block; + color: var(--color-text-base); } + .editor_controls .multi-format-editor__tab.selected { + background: var(--color-background-light); + font-weight: var(--font-weight-semibold); } + .editor_controls .multi-format-editor__tab:hover:not(.selected) { + cursor: pointer; + color: var(--color-text-active); + background-color: var(--color-background-light); } + .editor_controls .multi-format-editor__content__wrapper__rich_text { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .multi-format-editor__content__wrapper__latex { + background-color: var(--color-background-light); + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .multi-format-editor__content__wrapper__html { + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .multi-format-editor__confirmation-panel { + height: 100%; + max-height: 100%; + width: 100%; + text-align: center; + display: flex; + flex-direction: column; + align-items: flex-start; + flex: 1; } + .editor_controls .multi-format-editor__confirmation-panel__header { + color: var(--color-text-section-header); + margin-top: 0; + margin-bottom: 5px; + font-weight: 600; } + .editor_controls .multi-format-editor__confirmation-panel__content { + overflow-y: auto; + display: flex; + flex-direction: column; + -webkit-overflow-scrolling: touch; + padding: var(--spacing-half-unit); } + .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar { + background: white; + width: 5px; } + .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls .multi-format-editor__confirmation-panel__actions { + padding: var(--spacing-half-unit); + width: 100%; + display: flex; + justify-content: center; + align-items: center; + border-top: 1px solid var(--color-border-light); + -webkit-overflow-scrolling: touch; } + .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar { + background: white; + width: 5px; } + .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls .multi-format-editor__confirmation-panel__message { + line-height: 20px; } + .editor_controls .multi-format-editor__confirmation-panel__message-primary { + font-weight: var(--font-weight-semibold); + color: var(--color-text-base); } + .editor_controls .multi-format-editor__confirmation-panel__message-secondary { + color: var(--color-text-base); } + .editor_controls .multi-format-editor__confirmation-panel__continue-button { + margin-left: 10px; } + .editor_controls .rich-text-editor__root { + border-top: none; + width: 100%; + color: var(--color-text-base); + display: flex; + flex-direction: column; + flex-grow: 1; } + .editor_controls .rich-text-editor__editor { + cursor: text; + position: relative; + flex-grow: 1; } + .editor_controls .rich-text-editor__editor > div { + position: absolute; + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + overflow: auto; + flex-grow: 1; + left: 0; + top: 0; } + .editor_controls .rich-text-editor__controls { + display: flex; + justify-content: space-evenly; + background: var(--color-background-light); + font-size: 14px; + padding: 10px 0; + user-select: none; + border-bottom: var(--border-default); } + .editor_controls .rich-text-editor__controls .icon-link { + transform: translateY(3px); + display: inline-block; + fill: var(--color-text-base); + width: 15px !important; + height: 15px !important; } + .editor_controls .rich-text-editor__link-editor { + background-color: var(--color-background-light); + border: var(--border-default); + padding: var(--spacing-half-unit); + position: absolute; + z-index: 1; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; } + .editor_controls .rich-text-editor__link-editor__label { + display: block; } + .editor_controls .rich-text-editor__link-editor__input { + border: var(--border-default); + color: var(--color-text-base); + overflow: scroll; + padding: 0 10px; + width: 100%; + margin-top: 10px; } + .editor_controls .rich-text-editor__styleButton { + color: var(--color-text-base); + cursor: pointer; + display: inline-block; + margin: 0; + min-height: var(--spacing-base-unit); + min-width: var(--spacing-base-unit); + text-align: center; + background-color: transparent; + border: var(--border-default); + border-radius: var(--border-radius-small); + line-height: 20px; + position: relative; } + .editor_controls .rich-text-editor__styleButton__wrapper { + padding: 0 var(--spacing-quarter-unit); } + .editor_controls .rich-text-editor__styleButton--active { + background-color: var(--color-accent); + border: var(--border-accent-shade); + color: var(--color-white); } + .editor_controls .rich-text-editor__styleButton--active:hover { + background-color: var(--color-accent); + border: var(--border-accent-shade); + color: var(--color-white); } + .editor_controls .rich-text-editor__styleButton--active:hover::before { + transform: scaleX(0); } + .editor_controls .rich-text-editor__styleButton::before { + content: ''; + position: absolute; + bottom: -1px; + height: 1px; + width: calc(100% + 2px); + left: -1px; + background: var(--color-accent); + will-change: transform; + transform-origin: center center; + transform: scaleX(0); + transition: all 0.15s ease-in-out; } + .editor_controls .rich-text-editor__styleButton:hover { + color: var(--color-text-active); + background-color: var(--color-background-top); } + .editor_controls .rich-text-editor__styleButton:hover::before { + transform: none; } + .editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root, + .editor_controls .rich-text-editor__editor .public-DraftEditor-content { + padding: var(--spacing-quarter-unit); } + .editor_controls .rich-text-editor__editor .public-DraftEditor-content { + min-height: 100px; } + .editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root { + display: none; } + .editor_controls .rich-text-editor__editor .RichEditor-blockquote { + border-left: 5px solid #eee; + color: #666; + font-style: italic; + margin: 16px 0; + padding: 10px 20px; } + .editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre { + background-color: rgba(0, 0, 0, 0.05); + font-size: 16px; + padding: 20px; } + .editor_controls .DraftEditor-editorContainer, + .editor_controls .DraftEditor-root, + .editor_controls .public-DraftEditor-content { + height: inherit; + text-align: initial; } + .editor_controls .DraftEditor-root { + position: relative; } + .editor_controls .DraftEditor-editorContainer { + background-color: rgba(255, 255, 255, 0); + border-left: 0.1px solid transparent; + position: relative; + z-index: 1; } + .editor_controls .public-DraftEditor-block { + position: relative; } + .editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block { + text-align: left; } + .editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root { + left: 0; + text-align: left; } + .editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block { + text-align: center; } + .editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root { + margin: 0 auto; + text-align: center; + width: 100%; } + .editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block { + text-align: right; } + .editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root { + right: 0; + text-align: right; } + .editor_controls .public-DraftEditorPlaceholder-root { + color: #9197a3; + position: absolute; + z-index: 0; } + .editor_controls .public-DraftEditorPlaceholder-hasFocus { + color: #bdc1c9; } + .editor_controls .DraftEditorPlaceholder-hidden { + display: none; } + .editor_controls .public-DraftStyleDefault-block { + position: relative; + white-space: pre-wrap; } + .editor_controls .public-DraftStyleDefault-ltr { + direction: ltr; + text-align: left; } + .editor_controls .public-DraftStyleDefault-rtl { + direction: rtl; + text-align: right; } + .editor_controls .public-DraftStyleDefault-listLTR { + direction: ltr; } + .editor_controls .public-DraftStyleDefault-listRTL { + direction: rtl; } + .editor_controls .public-DraftStyleDefault-ol, + .editor_controls .public-DraftStyleDefault-ul { + margin: 16px 0; + padding: 0; } + .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR { + margin-left: 1.5em; } + .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL { + margin-right: 1.5em; } + .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR { + margin-left: 3em; } + .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL { + margin-right: 3em; } + .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR { + margin-left: 4.5em; } + .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL { + margin-right: 4.5em; } + .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR { + margin-left: 6em; } + .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL { + margin-right: 6em; } + .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR { + margin-left: 7.5em; } + .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL { + margin-right: 7.5em; } + .editor_controls .public-DraftStyleDefault-unorderedListItem { + list-style-type: square; + position: relative; } + .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0 { + list-style-type: disc; } + .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1 { + list-style-type: circle; } + .editor_controls .public-DraftStyleDefault-orderedListItem { + list-style-type: none; + position: relative; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before { + left: -36px; + position: absolute; + text-align: right; + width: 30px; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before { + position: absolute; + right: -36px; + text-align: left; + width: 30px; } + .editor_controls .public-DraftStyleDefault-orderedListItem:before { + content: counter(ol0) ". "; + counter-increment: ol0; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before { + content: counter(ol1) ". "; + counter-increment: ol1; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before { + content: counter(ol2) ". "; + counter-increment: ol2; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before { + content: counter(ol3) ". "; + counter-increment: ol3; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before { + content: counter(ol4) ". "; + counter-increment: ol4; } + .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset { + counter-reset: ol0; } + .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset { + counter-reset: ol1; } + .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset { + counter-reset: ol2; } + .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset { + counter-reset: ol3; } + .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset { + counter-reset: ol4; } + .editor_controls .rangeslider { + margin: 0 var(--spacing-quarter-unit); + min-width: 60px; + position: relative; + background: var(--color-background-light); + -ms-touch-action: none; + touch-action: none; + border: 1px solid var(--color-border-default); + flex-grow: 1; } + .editor_controls .rangeslider, + .editor_controls .rangeslider .rangeslider__fill { + display: block; } + .editor_controls .rangeslider .rangeslider__handle { + outline: 0; + background: #fff; + border: 1px solid var(--color-border-default); + cursor: pointer; + display: inline-block; + position: absolute; } + .editor_controls .rangeslider .rangeslider__handle .rangeslider__active { + opacity: 1; } + .editor_controls .rangeslider .rangeslider__handle-tooltip { + width: 20px; + height: 20px; + text-align: center; + position: absolute; + background-color: rgba(0, 0, 0, 0.8); + font-weight: normal; + font-size: 14px; + transition: all 100ms ease-in; + border-radius: 4px; + display: inline-block; + color: white; + left: 50%; + transform: translate3d(-50%, 0, 0); } + .editor_controls .rangeslider .rangeslider__handle-tooltip span { + margin-top: 12px; + display: inline-block; + line-height: 100%; } + .editor_controls .rangeslider .rangeslider__handle-tooltip:after { + content: ' '; + position: absolute; + width: 0; + height: 0; } + .editor_controls .rangeslider-horizontal { + height: 6px; + border-radius: 10px; } + .editor_controls .rangeslider-horizontal .rangeslider__fill { + height: 100%; + background-color: var(--color-accent); + border: var(--border-accent); + border-radius: 10px; + transform: translateY(-1px); + top: 0; } + .editor_controls .rangeslider-horizontal .rangeslider__handle { + width: 6.66667px; + height: 30px; + border-radius: 20px; + top: 50%; + transform: translate3d(-50%, -50%, 0); + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .rangeslider-horizontal .rangeslider__handle:after { + content: ' '; + position: absolute; + width: 4px; + height: 20px; + border-radius: 5px; + background-color: var(--color-accent); + display: none; } + .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip { + top: -55px; } + .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after { + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 8px solid rgba(0, 0, 0, 0.8); + left: 50%; + bottom: -8px; + transform: translate3d(-50%, 0, 0); } + .editor_controls .rangeslider-vertical { + margin: 20px auto; + height: 150px; + max-width: 10px; + background-color: transparent; } + .editor_controls .rangeslider-vertical .rangeslider__fill, + .editor_controls .rangeslider-vertical .rangeslider__handle { + position: absolute; } + .editor_controls .rangeslider-vertical .rangeslider__fill { + width: 100%; + background-color: #7cb342; + box-shadow: none; + bottom: 0; } + .editor_controls .rangeslider-vertical .rangeslider__handle { + width: 30px; + height: 10px; + left: -10px; + box-shadow: none; } + .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip { + left: -100%; + top: 50%; + transform: translate3d(-50%, -50%, 0); } + .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after { + border-top: 8px solid transparent; + border-bottom: 8px solid transparent; + border-left: 8px solid rgba(0, 0, 0, 0.8); + left: 100%; + top: 12px; } + .editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill { + right: 0; } + .editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill { + top: 0; + bottom: inherit; } + .editor_controls .rangeslider__labels { + position: relative; } + .rangeslider-vertical .editor_controls .rangeslider__labels { + position: relative; + list-style-type: none; + margin: 0 0 0 24px; + padding: 0; + text-align: left; + width: 250px; + height: 100%; + left: 10px; } + .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item { + position: absolute; + transform: translate3d(0, -50%, 0); } + .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item::before { + content: ''; + width: 10px; + height: 2px; + background: black; + position: absolute; + left: -14px; + top: 50%; + transform: translateY(-50%); + z-index: -1; } + .editor_controls .rangeslider__labels .rangeslider__label-item { + position: absolute; + font-size: 14px; + cursor: pointer; + display: inline-block; + top: 10px; + transform: translate3d(-50%, 0, 0); } + .editor_controls .trace-grid-single-block { + max-width: 460px; + display: flex; + flex-flow: wrap; + padding: var(--spacing-quarter-unit); } + .editor_controls .trace-grid { + display: grid; + grid-template-columns: repeat(4, 1fr); } + @media (max-width: 860px) { + .editor_controls .trace-grid { + grid-template-columns: repeat(2, 1fr); } } + .editor_controls .trace-grid__column { + text-align: center; + display: flex; + align-items: flex-start; + justify-content: flex-start; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; } + .editor_controls .trace-grid__column:nth-of-type(4n + 3) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column:nth-of-type(4n) { + -ms-grid-column: 2; } + .editor_controls .trace-grid__column:nth-of-type(4n + 1) { + -ms-grid-column: 3; } + .editor_controls .trace-grid__column:nth-of-type(4n + 2) { + -ms-grid-column: 4; } + .editor_controls .trace-grid__column:nth-of-type(3), .editor_controls .trace-grid__column:nth-of-type(4), .editor_controls .trace-grid__column:nth-of-type(5), .editor_controls .trace-grid__column:nth-of-type(6) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column:nth-of-type(7), .editor_controls .trace-grid__column:nth-of-type(8), .editor_controls .trace-grid__column:nth-of-type(9), .editor_controls .trace-grid__column:nth-of-type(10) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 1) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 2) { + -ms-grid-column: 2; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(3), .editor_controls .trace-grid__column .trace-item:nth-of-type(4) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(5), .editor_controls .trace-grid__column .trace-item:nth-of-type(6) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(7), .editor_controls .trace-grid__column .trace-item:nth-of-type(8) { + -ms-grid-row: 4; } + .editor_controls .trace-grid__column:not(:first-of-type) { + position: relative; } + .editor_controls .trace-grid__column:not(:first-of-type)::before { + position: absolute; + width: 1px; + border-left: var(--border-light); + height: 100%; + top: 0; + left: 0; + content: ''; } + .editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header { + position: relative; + z-index: 99; } + .editor_controls .trace-grid__column--double { + grid-column: span 2; + flex-grow: 0; } + .editor_controls .trace-grid__column--double:nth-of-type(2n + 1) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column--double:nth-of-type(2n + 2) { + -ms-grid-column: 3; } + .editor_controls .trace-grid__column--double:nth-of-type(5), .editor_controls .trace-grid__column--double:nth-of-type(6) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column--double:nth-of-type(7), .editor_controls .trace-grid__column--double:nth-of-type(8) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 1) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 2) { + -ms-grid-column: 2; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 3) { + -ms-grid-column: 3; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n) { + -ms-grid-column: 4; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(3), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4) { + -ms-grid-row: 1; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(5), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(6), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(7), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(8) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(9), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(10), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(11), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(12) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column--double .trace-grid__column__items { + display: grid; + grid-gap: 0; + grid-template-columns: repeat(4, 1fr); } + .editor_controls .trace-grid__column__items { + display: grid; + grid-gap: 0; + grid-template-columns: repeat(2, 90px); + grid-template-rows: repeat(2, 112px); + flex-grow: 1; + width: 100%; + padding: 0 var(--spacing-half-unit) var(--spacing-half-unit); } + .editor_controls .trace-grid__column__header { + text-transform: capitalize; + font-weight: var(--font-weight-semibold); + color: var(--color-text-base); + text-align: left; + display: flex; + align-items: center; + justify-content: flex-start; + border-top: var(--border-light); + width: 100%; + padding: var(--spacing-half-unit) var(--spacing-base-unit) 0; + box-sizing: border-box; } + .editor_controls .trace-item { + width: 90px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + flex-grow: 0; + margin-top: var(--spacing-half-unit); + color: var(--color-text-base); + transition: all 0.15s ease-in-out; + position: relative; } + .editor_controls .trace-item--active .trace-item__image { + border-color: var(--color-accent); + border-width: 2px; + color: var(--color-accent); } + .editor_controls .trace-item__actions { + position: absolute; + width: calc(100%); + display: flex; + flex-direction: column; + top: 0; + left: var(--spacing-quarter-unit); + justify-content: flex-start; + align-items: flex-end; + z-index: 99; + height: 60px; } + .editor_controls .trace-item__actions:hover .trace-item__actions__item { + transform: translateX(-2px); + opacity: 1; + pointer-events: initial; } + .editor_controls .trace-item__actions__item { + transform: translateX(-10px); + opacity: 0; + pointer-events: none; + color: var(--color-text-light); + transition: all 0.15s ease-in-out; } + .editor_controls .trace-item__actions__item:not(:last-child) { + margin-bottom: var(--spacing-quarter-unit); } + .editor_controls .trace-item__actions__item:hover { + color: var(--color-accent); } + .editor_controls .trace-item__actions__item svg { + display: block; + width: 16px; + height: 16px; + fill: currentColor; } + .editor_controls .trace-item:hover { + cursor: pointer; + color: var(--color-accent); } + .editor_controls .trace-item:hover .trace-item__label { + color: var(--color-accent); } + .editor_controls .trace-item:hover .trace-item__image { + border-color: var(--color-accent); } + .editor_controls .trace-item__image { + position: relative; + z-index: 2; + border: 1px solid var(--color-border-default); + width: 60px; + height: 60px; + border-radius: var(--border-radius); + background: var(--color-background-top); + box-shadow: 0 2px 9px transparent; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.15s ease-in-out; } + .editor_controls .trace-item__image__svg { + width: 100%; + flex-grow: 1; + padding: var(--spacing-quarter-unit); } + .editor_controls .trace-item__image svg { + display: block; } + .editor_controls .trace-item__image img { + display: block; + font-size: 10px; + color: var(--color-text-base); } + .editor_controls .trace-item__image__wrapper { + width: 100%; } + .editor_controls .trace-item__label { + font-weight: var(--font-weight-semibold); + width: 72px; + height: 34px; + margin-top: var(--spacing-quarter-unit); + color: var(--color-text-base); + text-transform: capitalize; + font-size: var(--font-size-small); + text-align: center; } + .editor_controls .trace-type-select-dropdown__wrapper > * > * { + pointer-events: none; } + .editor_controls .trace-type-select-dropdown__wrapper > *:hover { + cursor: pointer; } + .editor_controls .trace-type-select-dropdown__wrapper > *:hover .Select:not(.is-open) .Select-control { + border-color: var(--color-border-dark); } + .editor_controls .trace-type-select-button { + display: flex; + align-items: center; + border: var(--border-default); + width: 100%; + height: 36px; + border-radius: var(--border-radius); + padding: 0 var(--spacing-quarter-unit); } + .editor_controls .trace-type-select-button:hover { + cursor: pointer; + border-color: var(--color-border-dark); } + .editor_controls .trace-type-select-button__icon { + max-width: 20px; + width: 20px; + margin-right: var(--spacing-quarter-unit); } + .editor_controls .trace-type-select-button__icon svg { + max-width: 100%; + display: block; } + .editor_controls .trace-type-select-button__icon svg * { + fill: currentColor; } + .editor_controls .dropzone-container { + flex-grow: 1; + display: flex; + align-items: center; + justify-content: center; + border: 1px dashed var(--color-border-default); + height: 160px; + box-sizing: border-box; + padding: 8px; + border-radius: var(--border-radius); } + .editor_controls .dropzone-container__content { + width: 100%; + height: 100%; + text-align: center; + background-color: var(--color-rhino-light-5); + border-radius: var(--border-radius); + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .dropzone-container__message { + padding: 15px; } + .editor_controls .dropzone-container__image { + width: 100%; + height: 100%; + background-size: contain; + background-position: center; + position: relative; + background-repeat: no-repeat; } + .editor_controls .dropzone-container--active { + border-color: var(--color-dodger); } + .editor_controls .dropzone-container--rejected { + border-color: red; } + .editor_controls [aria-label][role~='tooltip'] { + position: relative; } + .editor_controls [aria-label][role~='tooltip']::before, + .editor_controls [aria-label][role~='tooltip']::after { + transform: translate3d(0, 0, 0); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + display: none; + will-change: transform; + opacity: 0; + pointer-events: none; + transition: all var(--microtip-transition-duration, 0.18s) var(--microtip-transition-easing, ease-in-out) var(--microtip-transition-delay, 0s); + position: absolute; + box-sizing: border-box; + z-index: 10; + transform-origin: top; } + .editor_controls [aria-label][role~='tooltip']::before { + background-size: 100% auto !important; + content: ''; } + .editor_controls [aria-label][role~='tooltip']::after { + background: #506784; + border-radius: 4px; + color: #ffffff; + content: attr(aria-label); + font-size: var(--microtip-font-size, 13px); + font-weight: var(--microtip-font-weight, normal); + text-transform: var(--microtip-text-transform, none); + padding: 0.5em 1em; + white-space: nowrap; + box-sizing: content-box; } + .editor_controls [aria-label][role~='tooltip']:hover::before, + .editor_controls [aria-label][role~='tooltip']:hover::after, + .editor_controls [aria-label][role~='tooltip']:focus::before, + .editor_controls [aria-label][role~='tooltip']:focus::after { + opacity: 1; + pointer-events: auto; + display: block; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 6px; + width: 18px; + margin-bottom: 5px; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { + margin-bottom: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { + transform: translate3d(-50%, 0, 0); + bottom: 100%; + left: 50%; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']:hover::before { + transform: translate3d(-50%, -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { + transform: translate3d(-50%, 0, 0); + bottom: 100%; + left: 50%; } + .editor_controls [role~='tooltip'][data-microtip-position='top']:hover::after { + transform: translate3d(-50%, -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='top-left']::after { + transform: translate3d(calc(-100% + 16px), 0, 0); + bottom: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='top-left']:hover::after { + transform: translate3d(calc(-100% + 16px), -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='top-right']::after { + transform: translate3d(calc(0% + -16px), 0, 0); + bottom: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='top-right']:hover::after { + transform: translate3d(calc(0% + -16px), -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 6px; + width: 18px; + margin-top: 5px; + margin-bottom: 0; } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { + margin-top: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { + transform: translate3d(-50%, -10px, 0); + bottom: auto; + left: 10px; + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']:hover::before { + transform: translate3d(-50%, 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { + transform: translate3d(-50%, -10px, 0); + left: 10px; + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='bottom']:hover::after { + transform: translate3d(-50%, 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']::after { + transform: translate3d(calc(-100% + 16px), -10px, 0); + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']:hover::after { + transform: translate3d(calc(-100% + 16px), 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']::after { + transform: translate3d(calc(0% + -16px), -10px, 0); + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']:hover::after { + transform: translate3d(calc(0% + -16px), 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='left']::before, + .editor_controls [role~='tooltip'][data-microtip-position='left']::after { + bottom: auto; + left: auto; + right: 100%; + top: 50%; + transform: translate3d(10px, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='left']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 18px; + width: 6px; + margin-right: 5px; + margin-bottom: 0; } + .editor_controls [role~='tooltip'][data-microtip-position='left']::after { + margin-right: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::before, + .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::after { + transform: translate3d(0, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='right']::before, + .editor_controls [role~='tooltip'][data-microtip-position='right']::after { + bottom: auto; + left: 100%; + top: 50%; + transform: translate3d(-10px, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='right']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 18px; + width: 6px; + margin-bottom: 0; + margin-left: 5px; } + .editor_controls [role~='tooltip'][data-microtip-position='right']::after { + margin-left: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::before, + .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::after { + transform: translate3d(0, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-size='small']::after { + white-space: initial; + width: 80px; } + .editor_controls [role~='tooltip'][data-microtip-size='medium']::after { + white-space: initial; + width: 140px; } + .editor_controls [role~='tooltip'][data-microtip-size='large']::after { + white-space: initial; + width: 260px; } + .editor_controls__wrapper { + display: flex; + flex-grow: 1; } + .editor_controls a { + color: #0d76bf; + cursor: pointer; } + +.plotly_editor { + display: flex; + /* + We are defining the max height of the app so that the editor knows how big to be + currently the editor will take up whatever space it can if it is not constrained in its parent + */ + flex-grow: 1; + height: 100%; + max-height: 100%; + width: 100%; } + +.plotly_editor_plot { + max-width: 100%; + height: 100%; + max-height: 100%; + overflow: auto; + flex-grow: 1; } diff --git a/lib/react-chart-editor.ie.css b/lib/react-chart-editor.ie.css new file mode 100644 index 000000000..3c347d250 --- /dev/null +++ b/lib/react-chart-editor.ie.css @@ -0,0 +1,2746 @@ +/* + * Layout + */ +/* + * Typography + */ +/* + * SPACING + */ +/* + * BORDERS + */ +/* + * Typography + */ +/* + * Effects + */ +.\+flex { + display: flex; } + +.\+cursor-clickable { + cursor: pointer; } + +.\+hover-grey:hover { + color: var(--color-text-active); } + +@keyframes fade-in { + from { + opacity: 0; } + to { + opacity: 1; } } + +@keyframes fade-and-slide-in-from-bottom { + from { + opacity: 0; + transform: translateY(20px); } + to { + opacity: 1; + transform: none; } } + +@keyframes fsbr { + from { + opacity: 1; + transform: none; } + to { + opacity: 0; + transform: translateY(20px); } } + +@keyframes fade-out { + from { + opacity: 1; } + to { + opacity: 0; } } + +.animate--fade-in, .editor_controls .modal__backdrop { + opacity: 0; + animation: fade-in 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +.animate--fade-out, .editor_controls .modal--animate-out .modal__backdrop { + opacity: 1; + animation: fade-out 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +.animate--fade-and-slide-in-from-bottom, .editor_controls .modal__card { + opacity: 0; + transform: translateY(20px); + animation: fade-and-slide-in-from-bottom 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +.animate--fsbr, .editor_controls .modal--animate-out .modal__card { + opacity: 1; + transform: none; + animation: fsbr 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } + +:root { + --env: $ENV; } + +:root { + --color-white: #ffffff; + --color-rhino-core: #2a3f5f; + --color-rhino-dark: #506784; + --color-rhino-medium-1: #a2b1c6; + --color-rhino-medium-2: #c8d4e3; + --color-rhino-light-1: #dfe8f3; + --color-rhino-light-2: #ebf0f8; + --color-rhino-light-3: #f3f6fa; + --color-rhino-light-4: #fafbfd; + --color-rhino-light-5: #f8f8f9; + --color-dodger: #119dff; + --color-dodger-shade: #0d76bf; + --color-dodger-shade-mid: #0d76bf; + --color-aqua: #09ffff; + --color-aqua-shade: #19d3f3; + --color-lavender: #e763fa; + --color-lavender-shade: #ab63fa; + --color-lavender-shade-mid: #934bde; + --color-cornflower: #636efa; + --color-emerald: #00cc96; + --color-sienna: #ef553b; + --color-accent: var(--color-dodger); + --color-accent-shade: var(--color-dodger-shade); + --color-accent-shade-mid: var(--color-dodger-shade-mid); + --color-brand: var(--color-dodger); + --color-hightlight-darker: var(--color-gray-blue-pale); + --color-text-base: var(--color-rhino-dark); + --color-text-light: var(--color-rhino-medium-1); + --color-text-dark: var(--color-rhino-core); + --color-text-headings: var(--color-text-dark); + --color-text-section-header: var(--color-text-dark); + --color-text-active: var(--color-rhino-core); + --color-text-placeholder: var(--color-rhino-medium-1); + --color-border-default: var(--color-rhino-medium-2); + --color-border-light: var(--color-rhino-light-1); + --color-border-dark: var(--color-rhino-medium-1); + --color-border-accent: var(--color-accent); + --color-border-accent-shade: var(--color-accent-shade); + --color-background: var(--color-rhino-light-2); + --color-background-base: var(--color-rhino-light-2); + --color-background-light: var(--color-rhino-light-3); + --color-background-medium: var(--color-rhino-light-1); + --color-background-dark: var(--color-rhino-medium-1); + --color-background-top: var(--color-white); + --color-background-inverse: var(--color-rhino-dark); + --color-background-inputs: var(--color-background-top); + --color-button-primary-base-fill: var(--color-accent); + --color-button-primary-base-border: var(--color-accent-shade); + --color-button-primary-base-text: var(--color-white); + --color-button-primary-hover-fill: var(--color-accent-shade-mid); + --color-button-primary-hover-border: var(--color-accent-shade); + --color-button-primary-hover-text: var(--color-white); + --color-button-primary-active-fill: var(--color-accent-shade); + --color-button-primary-active-border: var(--color-accent-shade); + --color-button-primary-active-text: var(--color-white); + --color-button-secondary-base-fill: transparent; + --color-button-secondary-base-border: var(--color-rhino-medium-2); + --color-button-secondary-base-text: var(--color-text-base); + --color-button-secondary-hover-fill: transparent; + --color-button-secondary-hover-border: var(--color-rhino-medium-1); + --color-button-secondary-hover-text: var(--color-text-dark); + --color-button-secondary-active-fill: transparent; + --color-button-secondary-active-border: var(--color-rhino-medium-1); + --color-button-secondary-active-text: var(--color-text-dark); + --color-button-tertiary-base-fill: transparent; + --color-button-tertiary-base-border: transparent; + --color-button-tertiary-base-text: var(--color-text-base); + --color-button-tertiary-hover-fill: transparent; + --color-button-tertiary-hover-border: transparent; + --color-button-tertiary-hover-text: var(--color-text-dark); + --color-button-tertiary-active-fill: transparent; + --color-button-tertiary-active-border: transparent; + --color-button-tertiary-active-text: var(--color-text-dark); + --color-button-default-base-fill: var(--color-background-light); + --color-button-default-base-border: var(--color-border-default); + --color-button-default-base-text: var(--color-text-base); + --color-button-default-hover-fill: var(--color-background-base); + --color-button-default-hover-border: var(--color-border-dark); + --color-button-default-hover-text: var(--color-text-dark); + --color-button-default-active-fill: var(--color-background-dark); + --color-button-default-active-border: var(--color-border-dark); + --color-button-default-active-text: var(--color-text-dark); + --color-button-upgrade-base-fill: var(--color-lavender-shade); + --color-button-upgrade-base-border: var(--color-lavender-shade-dark); + --color-button-upgrade-base-text: var(--color-white); + --color-button-upgrade-hover-fill: var(--color-lavender-shade-mid); + --color-button-upgrade-hover-border: var(--color-lavender-shade-dark); + --color-button-upgrade-hover-text: var(--color-white); + --color-button-upgrade-active-fill: var(--color-lavender-shade-dark); + --color-button-upgrade-active-border: var(--color-lavender-shade-dark); + --color-button-upgrade-active-text: var(--color-white); + --color-button-header-base-fill: transparent; + --color-button-header-base-border: var(--color-dodger); + --color-button-header-base-text: var(--color-dodger); + --color-button-header-hover-fill: transparent; + --color-button-header-hover-border: var(--color-dodger-shade-mid); + --color-button-header-hover-text: var(--color-dodger-shade); + --color-button-header-active-fill: transparent; + --color-button-header-active-border: var(--color-dodger-shade); + --color-button-header-active-text: var(--color-dodger-shade); + --spacing-base-unit: 24px; + --spacing-half-unit: 12px; + --spacing-quarter-unit: 6px; + --spacing-sixth-unit: 4px; + --spacing-eighth-unit: 3px; + --font-size-base: 13px; + --font-size-small: 12px; + --font-size-medium: 14px; + --font-size-large: 14px; + --font-size-heading-base: 24px; + --font-size-heading-small: 18px; + --font-size-heading-large: 28px; + --font-size-h5: 16px; + --font-weight-light: 400; + --font-weight-normal: 500; + --font-weight-semibold: 600; + --font-weight-bold: 700; + --font-leading-body: 1.6; + --font-leading-head: 1.2; + --font-letter-spacing-headings: 0.5px; + --font-family-body: "Open Sans", --apple-default, sans-serif; + --font-family-headings: "Dosis", "Arial", sans-serif; + --border-default: 1px solid var(--color-border-default); + --border-light: 1px solid var(--color-border-light); + --border-dark: 1px solid var(--color-border-dark); + --border-accent: 1px solid var(--color-border-accent); + --border-accent-shade: 1px solid var(--color-border-accent-shade); + --border-radius: 5px; + --border-radius-small: 3px; + --text-shadow-dark-color: rgba(42, 63, 95, 0.7); + --text-shadow-dark-ui: 0 1px 2px var(--text-shadow-dark-color); + --text-shadow-dark-ui-inactive: 0 1px 1px rgba(42, 63, 95, 0.4); + --box-shadow-base-color: rgba(80, 103, 132, 0.2); + --box-shadow-base: 0px 2px 9px var(--box-shadow-base-color); + --scrollbar-track-background: var(--color-background-base); + --scrollbar-thumb-color: var(--color-accent); + --panel-background: var(--color-background-base); + --panel-width: 335px; + --fold-header-text-color-base: var(--color-white); + --fold-header-text-color-closed: var(--color-white); + --fold-header-background-base: var(--color-rhino-dark); + --fold-header-background-closed: var(--color-rhino-core); + --fold-header-border-color-closed: var(--color-rhino-core); + --fold-header-border-color-base: var(--color-rhino-dark); + --sidebar-background: var(--color-background-top); + --sidebar-width: 100px; + --sidebar-group-background-base: var(--sidebar-background); + --sidebar-item-background-base: var(--color-background-light); + --sidebar-item-background-hover: var(--color-background-base); + --sidebar-item-background-active: var(--color-background-medium); + --editor-width: calc( + var(--sidebar-width) + var(--panel-width) + 1px + ); } + +.editor_controls { + position: relative; + width: var(--editor-width); + flex-shrink: 0; + overflow: hidden; + display: flex; + /* TODO: Don't inline Draft.css; load it with `systemjs`. */ + /** + * Draft v0.3.0 + * + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + /** +* Rangeslider +*/ + /** +* Rangeslider - Horizontal slider +*/ + /** +* Rangeslider - Vertical slider +*/ + /** +* Rangeslider - Reverse +*/ + /** +* Rangeslider - Labels +*/ + /* ------------------------------------------------------------------- + Microtip + + Modern, lightweight css-only tooltips + Just 1kb minified and gzipped + + @author Ghosh + @package Microtip + +---------------------------------------------------------------------- + 1. Base Styles + 2. Direction Modifiers + 3. Position Modifiers +--------------------------------------------------------------------*/ + /* ------------------------------------------------ + [1] Base Styles +-------------------------------------------------*/ + /* ------------------------------------------------ + [2] Position Modifiers +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.1] Top Left +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.2] Top Right +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.3] Bottom +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.4] Bottom Left +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.5] Bottom Right +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.6] Left +-------------------------------------------------*/ + /* ------------------------------------------------ + [2.7] Right +-------------------------------------------------*/ + /* ------------------------------------------------ + [3] Size +-------------------------------------------------*/ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-family: var(--font-family-body); } + .editor_controls .sidebar { + user-select: none; + height: 100%; + min-width: var(--sidebar-width); + width: var(--sidebar-width); + max-width: var(--sidebar-width); + text-align: center; + background: var(--sidebar-background); + overflow-y: auto; + overflow-x: hidden; + float: left; + border-right: var(--border-default); + flex-grow: 1; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: none; } + .editor_controls .sidebar::-webkit-scrollbar { + background: white; + width: 0px; } + .editor_controls .sidebar::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .sidebar::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls .sidebar__group { + background-color: var(--sidebar-group-background-base); + cursor: pointer; + width: 100%; } + .editor_controls .sidebar__group__title { + color: var(--color-text-base); + font-size: var(--font-size-medium); + font-weight: var(--font-weight-normal); + padding: var(--spacing-half-unit) 0; + text-transform: capitalize; + text-align: left; + border-bottom: var(--border-light); + display: flex; + position: relative; } + .editor_controls .sidebar__group__title__label { + padding-left: var(--spacing-base-unit); } + .editor_controls .sidebar__group__title__icon { + position: absolute; + transform: scale(0.9) translateX(2px) translateY(-4px); + transform-origin: center center; + opacity: 0.5; + transition: all 0.15s ease-in-out; } + .editor_controls .sidebar__group__title__icon svg path { + fill: currentColor; } + .editor_controls .sidebar__group:hover .sidebar__group__title__icon { + opacity: 1; } + .editor_controls .sidebar__group--is-active { + color: var(--color-text-active); + cursor: default; } + .editor_controls .sidebar__group--is-active .sidebar__group__title__label { + font-weight: var(--font-weight-semibold); + color: var(--color-text-active); } + .editor_controls .sidebar__group--is-active .sidebar__group__title__icon { + opacity: 1; } + .editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path { + fill: var(--color-accent); } + .editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon { + transform: scale(0.9) translateY(-5px) rotate(90deg); + opacity: 1; } + .editor_controls .sidebar__group--is-expanded .sidebar__group__title { + position: relative; + z-index: 4; + box-shadow: var(--box-shadow-base); } + .editor_controls .sidebar__item { + color: var(--color-text-base); + cursor: pointer; + font-size: var(--font-size-medium); + font-weight: var(--font-weight-normal); + line-height: var(--font-size-medium); + text-transform: capitalize; + background-color: var(--sidebar-item-background-base); + padding: 10px; + padding-left: 18px; + padding-right: var(--spacing-quarter-unit); + text-align: left; + border-bottom: var(--border-light); + position: relative; + overflow: hidden; } + .editor_controls .sidebar__item--single { + margin-top: 15px; } + .editor_controls .sidebar__item--single:last-child { + margin-bottom: 15px; } + .editor_controls .sidebar__item::before { + content: ''; + position: absolute; + height: 100%; + top: 0; + left: 0; + width: 5px; + background-color: var(--color-accent); + transform: scaleX(0); + transform-origin: left center; + will-change: transform; + transition: all 0.15s ease-in-out; } + .editor_controls .sidebar__item span { + display: block; + will-change: transform; + transition: all 0.15s ease-in-out; } + .editor_controls .sidebar__item:not(.sidebar__item--is-active):hover { + background-color: var(--sidebar-item-background-hover); } + .editor_controls .sidebar__item--is-active { + color: var(--color-text-active); + font-weight: var(--font-weight-semibold); + cursor: default; } + .editor_controls .sidebar__item--is-active::before { + transform: none; } + .editor_controls .sidebar__item--is-active span { + transform: translateX(5px); } + .editor_controls .sidebar__logo { + height: 50px; + margin: 10px; } + .editor_controls .panel { + flex-grow: 1; + overflow-x: hidden; + overflow-y: auto; + padding: var(--spacing-half-unit); + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: column; + width: 100%; + -webkit-overflow-scrolling: touch; } + .editor_controls .panel::-webkit-scrollbar { + background: white; + width: 5px; } + .editor_controls .panel::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .panel::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls__wrapper > .panel { + background-color: var(--panel-background); + border-right: var(--border-default); + width: calc(var(--panel-width)); } + .editor_controls .panel__content { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .panel__header { + margin-bottom: var(--spacing-half-unit); + display: flex; + flex-shrink: 0; } + .editor_controls .panel__header__content { + flex-grow: 1; } + .editor_controls .panel__header__actions__container { + width: 100%; } + .editor_controls .panel__header__collapse { + font-size: var(--font-size-medium); + float: left; + color: var(--color-text-base); + display: flex; + align-items: center; + height: 100%; + cursor: pointer; } + .editor_controls .panel__header__collapse svg { + width: 16px !important; + height: 16px !important; + fill: var(--color-text-light); + padding-right: 3px; } + .editor_controls .panel__header__action { + float: right; } + .editor_controls .panel__empty { + position: absolute; + top: 0; + right: 0; + width: var(--panel-width); + border-right: var(--border-default); + height: 100%; + padding: var(--spacing-half-unit); + background-color: var(--panel-background); + box-sizing: border-box; + z-index: 1003; + display: flex; } + .editor_controls .panel__empty__message { + text-align: center; } + .editor_controls .panel__empty__message__icon { + padding-top: calc(var(--spacing-base-unit) * 2); + margin-bottom: var(--spacing-half-unit); + opacity: 0.5; } + .editor_controls .panel__empty__message__icon svg { + width: 48px !important; + height: 48px !important; } + .editor_controls .panel__empty__message__icon svg path { + fill: var(--color-text-light); } + .editor_controls .panel__empty__message__heading { + color: var(--color-text-headings); + font-size: var(--font-size-heading-base); + font-weight: var(--font-weight-normal); + line-height: var(--font-leading-head); + font-family: var(--font-family-headings); + letter-spacing: var(--font-letter-spacing-headings); } + .editor_controls .panel__empty__message__content { + font-size: var(--font-size-base); + color: var(--color-text-base); + line-height: var(--font-leading-body); } + .editor_controls .panel--no-padding { + padding: 0; } + .editor_controls .fold .panel { + overflow-x: visible; + overflow-y: visible; } + .editor_controls .fold { + width: 100%; + user-select: none; } + .editor_controls .fold__top { + display: flex; + justify-content: space-between; + clear: both; + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + color: var(--fold-header-text-color-closed); + font-size: var(--font-size-base); + border: 1px solid var(--fold-header-border-color-closed); + background-color: var(--fold-header-background-closed); + height: 15px; + border-radius: var(--border-radius); + text-shadow: var(--text-shadow-dark-ui); + transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; } + .editor_controls .fold__top:hover { + cursor: pointer; + background-color: var(--fold-header-background-closed); } + .editor_controls .fold__top svg { + width: 18px; + height: 18px; + display: block; + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .fold__top svg path { + fill: currentColor; } + .editor_controls .fold__top--open { + color: var(--fold-header-text-color-base); + background-color: var(--fold-header-background-base); + border: 1px solid var(--fold-header-border-color-base); + border-radius: var(--border-radius) var(--border-radius) 0 0; + text-shadow: var(--text-shadow-dark-ui-inactive); } + .editor_controls .fold__top--open svg { + filter: drop-shadow(0 1px 1px rgba(42, 63, 95, 0.4)); } + .editor_controls .fold__top--open:hover { + background-color: var(--fold-header-background-base); } + .editor_controls .fold__top__icon { + display: block; + margin-right: var(--spacing-quarter-unit); + transform: translateY(-1px); } + .editor_controls .fold__top__title { + margin-left: var(--spacing-half-unit)/3; + font-size: var(--font-size-medium); + line-height: var(--font-size-medium); + font-weight: var(--font-weight-semibold); + transform: translateY(1px); + white-space: nowrap; + max-width: 230px; + letter-spacing: 0.2px; + text-overflow: ellipsis; + overflow: hidden; } + .editor_controls .fold__top__arrow { + transform: translateX(-3px) translateY(-1px); } + .editor_controls .fold__top__arrow svg { + will-change: transform; + transition: transform 0.1s ease-in-out; + transform: rotate(-90deg); + font-weight: bold; + transform-origin: center center; } + .editor_controls .fold__top__arrow-title { + display: flex; + flex-grow: 1; } + .editor_controls .fold__top__arrow--open svg { + transform: rotate(0deg); } + .editor_controls .fold__top__delete { + font-size: 18px; + opacity: 0.75; + transform: translateY(-2px); } + .editor_controls .fold__top__delete:hover { + opacity: 1; } + .editor_controls .fold__content { + background: var(--color-background-top); + border: var(--border-default); + border-width: 0 1px 1px 1px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; } + .editor_controls .fold__content__plot { + overflow: hidden; + border-bottom-left-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); } + .editor_controls .fold__content > *:first-child { + border-top: 0; } + .editor_controls .fold__content__empty { + font-family: var(--font-family-headings); + display: flex; + flex-direction: column; + justify-content: center; + padding: 30px 25px; } + .editor_controls .fold__content__empty__icon { + margin: 0 auto; + margin-bottom: 15px; + width: 40px; + height: 40px; + border-radius: 50%; + background-color: var(--color-dodger); + display: flex; + flex-direction: column; + justify-content: center; } + .editor_controls .fold__content__empty__icon svg { + margin: 0 auto !important; + fill: white; + width: 23px; + height: 23px; } + .editor_controls .fold__content__empty__message__primary { + text-align: center; + margin-bottom: 20px; + font-size: 17px; + color: var(--color-text-base); } + .editor_controls .fold__content__empty__message__secondary { + font-family: var(--font-family-body); + font-size: var(--font-size-small); + text-align: center; + color: var(--color-text-base); } + .editor_controls .fold__content--noheader { + border-width: 1px 1px 1px 1px; } + .editor_controls .fold { + margin-bottom: var(--spacing-half-unit); } + .editor_controls .fold .fold:last-child { + margin-bottom: 0; } + .editor_controls .section__heading { + position: relative; + display: flex; + font-size: var(--font-size-base); + color: var(--color-text-section-header); + font-weight: var(--font-weight-semibold); + cursor: default; + background-color: var(--color-background-light); + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + clear: both; + text-transform: capitalize; } + .editor_controls .section:not(:first-child) .section__heading { + border-top: var(--border-light); } + .editor_controls .section:first-child .section__heading { + border-top: 0; } + .editor_controls .menupanel { + padding-top: 0; + display: flex; + justify-content: flex-end; + flex-grow: 1; } + .editor_controls .menupanel--ownline { + padding-top: var(--spacing-quarter-unit); + width: 100%; } + .editor_controls .menupanel__label { + font-weight: var(--font-weight-semibold); + padding-right: var(--spacing-quarter-unit); } + .editor_controls .menupanel__icon { + vertical-align: middle; + width: 15px !important; + height: 15px !important; + fill: var(--color-text-light) !important; + padding-left: var(--spacing-quarter-unit); } + .editor_controls .menupanel__icon svg { + display: block; } + .editor_controls .menupanel__icon:hover { + cursor: pointer; + fill: var(--color-accent) !important; } + .editor_controls .menupanel__icon-span { + font-size: var(--font-size-small); + display: flex; } + .editor_controls .menupanel__icon-span--question { + color: var(--color-text-base); } + .editor_controls .info__title { + color: var(--color-text-headings); + font-size: var(--font-size-heading-small); + font-weight: var(--font-weight-normal); + line-height: var(--font-leading-head); + font-family: var(--font-family-headings); + letter-spacing: var(--font-letter-spacing-headings); + padding: var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); } + .editor_controls .info__text { + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + color: var(--color-text-base); + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + line-height: var(--font-leading-body); } + .editor_controls .info__sub-text { + color: var(--color-text-base); + font-size: var(--font-size-small); + font-weight: var(--font-weight-normal); + font-style: italic; + line-height: var(--font-leading-body); + padding: var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-half-unit); } + .editor_controls .modalbox { + position: absolute; + border-radius: var(--border-radius); + overflow: hidden; + text-transform: none; + text-align: left; + border: var(--border-default); + align-content: center; + box-shadow: var(--box-shadow-base); + left: calc(var(--spacing-quarter-unit) * -1); + width: calc(100% + var(--spacing-half-unit)); + top: calc(100% + var(--spacing-quarter-unit)); + background-color: var(--color-background-top); + z-index: 9; } + .editor_controls .modalbox__cover { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: -1; } + .editor_controls .modalbox--dark { + background-color: var(--color-background-inverse); } + .editor_controls .modalbox--relative { + position: relative; } + .editor_controls .field .modalbox { + width: 100%; + left: -1px; + top: 100%; } + .editor_controls .modal { + box-sizing: border-box; + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + display: flex; + align-items: flex-start; + overflow-y: auto; + justify-content: center; + z-index: 1003; } + .editor_controls .modal * { + box-sizing: border-box; } + .editor_controls .modal__backdrop { + height: 100%; + width: 100%; + left: 0; + top: 0; + position: fixed; + opacity: 0; + will-change: opacity; } + .editor_controls .modal__backdrop::before { + content: ''; + height: 100%; + width: 100%; + left: 0; + opacity: 0.5; + top: 0; + background: var(--color-background-dark); + position: fixed; } + .editor_controls .modal__card { + background: var(--color-background-top); + border-radius: var(--border-radius); + position: relative; + z-index: 1003; + max-width: calc(100% - var(--spacing-base-unit)); + box-shadow: var(--box-shadow-base); + display: flex; + flex-direction: column; + will-change: opacity, transform; + flex-grow: 0; + margin: 5vh 10vw; } + .editor_controls .modal__header { + display: flex; + justify-content: space-between; + align-items: center; + color: var(--color-text-base); + padding: var(--spacing-half-unit); + font-weight: var(--font-weight-semibold); } + .editor_controls .modal__header__close { + opacity: 0.5; } + .editor_controls .modal__header__close:hover { + cursor: pointer; + opacity: 1; } + .editor_controls .modal__header__close svg { + display: block; } + .editor_controls .modal__header__close svg * { + fill: currentColor; } + .editor_controls .modal__content { + flex-grow: 1; + background-color: var(--color-background-light); + border-bottom-left-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); } + .editor_controls .modal__backdrop { + animation-duration: 1s; + animation-delay: 0s; } + .editor_controls .modal__card { + animation-duration: 0.85s; + animation-delay: 0.1s; } + .editor_controls .modal--animate-out { + pointer-events: none; } + .editor_controls .modal--animate-out .modal__backdrop { + animation-duration: 0.85s; + animation-delay: 0s; } + .editor_controls .modal--animate-out .modal__card { + animation-duration: 0.85s; + animation-delay: 0s; } + .editor_controls .panel .react-tabs { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .panel .react-tabs__tab { + flex-grow: 1; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + padding: var(--spacing-quarter-unit); + color: var(--color-text-base); + font-size: var(--font-size-base); + background: var(--color-background-medium); + border: var(--border-default); + border-bottom: 0; + position: relative; + background: var(--color-background-light); + transition: border-color 0.15s ease-in-out; } + .editor_controls .panel .react-tabs__tab-list { + background: var(--color-background-medium); + margin: 0; + flex-shrink: 0; + list-style: none; + display: flex; + align-items: flex-end; + padding-top: var(--spacing-half-unit); + padding-left: var(--spacing-half-unit); + padding-right: var(--spacing-half-unit); + padding-bottom: 0; + height: 32px; } + .editor_controls .panel .react-tabs__tab:first-of-type { + border-top-left-radius: var(--border-radius); } + .editor_controls .panel .react-tabs__tab:last-of-type { + border-top-right-radius: var(--border-radius); } + .editor_controls .panel .react-tabs__tab:hover { + background-color: var(--color-background-base); + cursor: pointer; } + .editor_controls .panel .react-tabs__tab--selected { + background-color: var(--color-background-base); + pointer-events: none; + margin-top: 0; + color: var(--color-text-active); + border-top-color: var(--color-accent); + border-top-width: 2px; } + .editor_controls .panel .react-tabs__tab--selected::before { + position: absolute; + top: 100%; + width: 100%; + height: 1px; + content: ''; + background-color: var(--color-background-base); + left: 0; + z-index: 4; } + .editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type) { + border-left: 0; } + .editor_controls .panel .react-tabs__tab:last-of-type { + border-left: none; } + .editor_controls .panel .react-tabs__tab-panel { + border-top: var(--border-default); + display: none; } + .editor_controls .panel .react-tabs__tab-panel--selected { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .field { + align-items: flex-start; + border-top: var(--border-light); + color: var(--color-text-base); + display: flex; + font-size: var(--font-size-base); + font-weight: var(--font-weight-normal); + justify-content: flex-start; + line-height: var(--font-size-base); + min-height: 32px; + padding: var(--spacing-quarter-unit) 0; + width: 100%; + position: relative; } + .editor_controls .field__no-title { + width: 100%; + padding: 0 var(--spacing-half-unit); + align-self: center; + line-height: var(--font-leading-body); } + .editor_controls .field__no-title--center { + text-align: center; } + .editor_controls .field__widget { + display: flex; + flex-wrap: wrap; + flex-basis: 0; + padding-right: var(--spacing-half-unit); + padding-left: var(--spacing-half-unit); + align-self: center; } + .editor_controls .field__widget:not(.field__widget--units) { + flex-grow: 1; } + .editor_controls .field__widget--units { + padding-right: 0; } + .editor_controls .field__units { + align-self: center; } + .editor_controls .field__title { + width: 80px; + padding-left: var(--spacing-half-unit); + display: block; + font-size: var(--font-size-small); + line-height: var(--font-leading-body); + color: var(--color-text-base); + padding-top: var(--spacing-quarter-unit); + user-select: none; } + .editor_controls .field__title-text { + text-transform: capitalize; + cursor: default; } + .editor_controls .field__delete { + display: flex; + align-items: center; + justify-content: center; + padding-left: var(--spacing-quarter-unit); + opacity: 0.5; } + .editor_controls .field__delete svg { + display: block; } + .editor_controls .field__delete svg path { + fill: var(--color-text-base); } + .editor_controls .field__delete:hover { + cursor: pointer; + opacity: 1; } + .editor_controls .field__delete:hover svg path { + fill: var(--color-sienna); } + .editor_controls .field .rect, + .editor_controls .field .square { + border-color: var(--color-accent); } + .editor_controls .field .rect-grid { + border-color: var(--panel-background) !important; + float: left; + border-top: 1px solid; + border-left: 1px solid; } + .editor_controls .field .rect-container { + margin: 0 auto; + position: relative; + max-width: 294px; } + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .editor_controls .field__widget { + flex-basis: auto; } } + .editor_controls .field .field { + border-top: none; } + .editor_controls .field .field .field__no-title { + padding: 0; } + .editor_controls .symbol-selector__toggle { + border: var(--border-default); + border-radius: var(--border-radius); + width: 80px; + cursor: pointer; + padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px var(--spacing-quarter-unit); } + .editor_controls .symbol-selector__toggle:before, .editor_controls .symbol-selector__toggle:after { + content: ' '; + display: table; } + .editor_controls .symbol-selector__toggle:after { + clear: both; } + .editor_controls .symbol-selector__toggle--dark { + background-color: var(--color-background-inverse); } + .editor_controls .symbol-selector__toggle__option { + float: left; } + .editor_controls .symbol-selector__toggle__caret { + float: right; + fill: var(--color-text-light); + padding-top: var(--spacing-eighth-unit); + width: 13px !important; + height: 13px !important; } + .editor_controls .symbol-selector__menu { + max-width: 225px; + position: absolute; + z-index: 1003; + border: var(--border-default); + padding: var(--spacing-half-unit); + box-shadow: 2px 2px var(--spacing-half-unit) var(--color-border-light); + border-radius: var(--border-radius-small); + left: var(--spacing-base-unit); } + .editor_controls .symbol-selector__item { + display: inline; } + .editor_controls .symbol-selector__symbol:hover { + background-color: var(--color-border-default); } + .editor_controls button { + display: inline-block; + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + line-height: 1; + letter-spacing: 0.5px; + text-transform: capitalize; + text-align: center; + cursor: pointer; + height: 36px; + outline: none; + user-select: none; + font-size: var(--font-size-medium); + font-weight: var(--font-weight-semibold); + font-family: var(--font-family-body); + border-width: 1px; + border-style: solid; + border-color: transparent; + border-radius: var(--border-radius); + transition: all 0.15s ease-in-out; } + .editor_controls button.button { + padding-left: 0; } + .editor_controls .button__wrapper { + display: flex; + align-items: center; + justify-content: center; + position: relative; + overflow: hidden; } + .editor_controls .button__label { + padding-left: var(--spacing-half-unit); } + .editor_controls .button__icon { + display: flex; + padding-left: var(--spacing-quarter-unit); + will-change: transform; } + .editor_controls .button__icon svg { + transform: scale(0.8); + transform-origin: center center; + display: block; } + .editor_controls .button__icon svg path { + fill: currentColor; } + .editor_controls .button__icon + .button__label { + padding-left: 0; } + .sidebar .button { + width: calc(100% - var(--spacing-base-unit)); + margin-left: var(--spacing-half-unit); + margin-right: var(--spacing-half-unit); } + .editor_controls .button--no-text { + background-color: var(--color-button-default-base-fill); + border-color: var(--color-button-default-base-border); + color: var(--color-button-default-base-text); + padding-right: var(--spacing-quarter-unit); + margin-left: 5px; } + .editor_controls .button--no-text:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-default-hover-fill); + border: 1px solid var(--color-button-default-hover-border); + color: var(--color-button-default-hover-text); } + .editor_controls .button--no-text:active:not(.button--no-text--disabled) { + background-color: var(--color-button-default-active-fill); + border: 1px solid var(--color-button-default-active-border); + color: var(--color-button-default-active-text); } + .editor_controls .button--no-text--disabled { + background-color: var(--color-button-default-base-fill); + border-color: var(--color-button-default-base-border); + color: var(--color-button-default-base-text); + padding-right: var(--spacing-quarter-unit); + margin-left: 5px; + color: #bababa; + cursor: default; } + .editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-default-hover-fill); + border: 1px solid var(--color-button-default-hover-border); + color: var(--color-button-default-hover-text); } + .editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled) { + background-color: var(--color-button-default-active-fill); + border: 1px solid var(--color-button-default-active-border); + color: var(--color-button-default-active-text); } + .editor_controls .button--default { + background-color: var(--color-button-default-base-fill); + border-color: var(--color-button-default-base-border); + color: var(--color-button-default-base-text); } + .editor_controls .button--default:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-default-hover-fill); + border: 1px solid var(--color-button-default-hover-border); + color: var(--color-button-default-hover-text); } + .editor_controls .button--default:active:not(.button--no-text--disabled) { + background-color: var(--color-button-default-active-fill); + border: 1px solid var(--color-button-default-active-border); + color: var(--color-button-default-active-text); } + .editor_controls .button--primary { + background-color: var(--color-button-primary-base-fill); + border-color: var(--color-button-primary-base-border); + color: var(--color-button-primary-base-text); + text-shadow: var(--text-shadow-dark-ui); } + .editor_controls .button--primary svg { + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .button--primary:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-primary-hover-fill); + border: 1px solid var(--color-button-primary-hover-border); + color: var(--color-button-primary-hover-text); } + .editor_controls .button--primary:active:not(.button--no-text--disabled) { + background-color: var(--color-button-primary-active-fill); + border: 1px solid var(--color-button-primary-active-border); + color: var(--color-button-primary-active-text); } + .editor_controls .button--secondary { + background-color: var(--color-button-secondary-base-fill); + border-color: var(--color-button-secondary-base-border); + color: var(--color-button-secondary-base-text); } + .editor_controls .button--secondary:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-secondary-hover-fill); + border: 1px solid var(--color-button-secondary-hover-border); + color: var(--color-button-secondary-hover-text); } + .editor_controls .button--secondary:active:not(.button--no-text--disabled) { + background-color: var(--color-button-secondary-active-fill); + border: 1px solid var(--color-button-secondary-active-border); + color: var(--color-button-secondary-active-text); } + .editor_controls .button--tertiary { + background-color: var(--color-button-tertiary-base-fill); + border-color: var(--color-button-tertiary-base-border); + color: var(--color-button-tertiary-base-text); } + .editor_controls .button--tertiary:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-tertiary-hover-fill); + border: 1px solid var(--color-button-tertiary-hover-border); + color: var(--color-button-tertiary-hover-text); } + .editor_controls .button--tertiary:active:not(.button--no-text--disabled) { + background-color: var(--color-button-tertiary-active-fill); + border: 1px solid var(--color-button-tertiary-active-border); + color: var(--color-button-tertiary-active-text); } + .editor_controls .button--upgrade { + background-color: var(--color-button-upgrade-base-fill); + border-color: var(--color-button-upgrade-base-border); + color: var(--color-button-upgrade-base-text); + text-shadow: var(--text-shadow-dark-ui); } + .editor_controls .button--upgrade svg { + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .button--upgrade:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-upgrade-hover-fill); + border: 1px solid var(--color-button-upgrade-hover-border); + color: var(--color-button-upgrade-hover-text); } + .editor_controls .button--upgrade:active:not(.button--no-text--disabled) { + background-color: var(--color-button-upgrade-active-fill); + border: 1px solid var(--color-button-upgrade-active-border); + color: var(--color-button-upgrade-active-text); } + .editor_controls .button--header { + background-color: var(--color-button-header-base-fill); + border-color: var(--color-button-header-base-border); + color: var(--color-button-header-base-text); } + .editor_controls .button--header:hover:not(.button--no-text--disabled) { + background-color: var(--color-button-header-hover-fill); + border: 1px solid var(--color-button-header-hover-border); + color: var(--color-button-header-hover-text); } + .editor_controls .button--header:active:not(.button--no-text--disabled) { + background-color: var(--color-button-header-active-fill); + border: 1px solid var(--color-button-header-active-border); + color: var(--color-button-header-active-text); } + .editor_controls .checkbox__group { + padding-left: var(--spacing-half-unit); + text-align: left; } + .editor_controls .checkbox__item { + user-select: none; + cursor: default; + padding-top: var(--spacing-eighth-unit); + padding-bottom: var(--spacing-eighth-unit); } + .editor_controls .checkbox__item--vertical { + display: block; + clear: both; } + .editor_controls .checkbox__box { + height: 18px; + width: 18px; + border: var(--border-default); + border-radius: var(--border-radius-small); + cursor: pointer; + display: inline-block; + vertical-align: middle; + text-align: center; + position: relative; } + .editor_controls .checkbox__box:hover { + background: var(--color-background-light); } + .editor_controls .checkbox__box--checked { + border: var(--border-accent-shade); + background: var(--color-accent); } + .editor_controls .checkbox__box--checked:hover { + background: var(--color-accent-shade); } + .editor_controls .checkbox__box--checked + .checkbox__label { + color: var(--color-text-active); } + .editor_controls .checkbox__check { + color: var(--color-text-base); + font-size: var(--spacing-half-unit); + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .checkbox__check svg { + filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } + .editor_controls .checkbox__check svg path { + fill: var(--color-white); } + .editor_controls .checkbox__label { + padding-left: var(--spacing-quarter-unit); + font-size: var(--font-size-base); + color: var(--color-text-base); + display: inline-block; + line-height: 20px; + text-align: left; + vertical-align: middle; + cursor: pointer; } + .editor_controls .colorpicker__saturation, .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider, .editor_controls .colorpicker__controls .colorpicker__active { + position: relative; + overflow: hidden; + border: var(--border-default); + border-radius: var(--border-radius-small); + cursor: pointer; } + .editor_controls .colorpicker { + display: flex; + width: 26px; + height: 26px; + border-radius: 100%; + border: var(--border-default); + padding: var(--spacing-eighth-unit); + /* Saturation wrapper style */ + /* Wrapper style for Hue and Alpha sliders and swatch */ } + .editor_controls .colorpicker__outer { + width: 185px; } + .editor_controls .colorpicker__container { + display: flex; + align-items: center; + line-height: 2; + position: relative; + width: 185px; } + .editor_controls .colorpicker__selected-color { + margin-left: var(--spacing-half-unit); + color: var(--color-text-base); + font-weight: var(--font-weight-semibold); + font-size: var(--font-size-small); + display: inline-block; + vertical-align: middle; + text-transform: uppercase; } + .editor_controls .colorpicker__swatch { + border-radius: 50%; + flex-grow: 1; + width: 100%; + height: 100%; } + .editor_controls .colorpicker__saturation { + height: 100px; } + .editor_controls .colorpicker__custom-input { + padding-top: var(--spacing-eighth-unit); } + .editor_controls .colorpicker__custom-input input { + border: var(--border-default) !important; + box-shadow: none !important; + background-color: var(--color-background-inputs); + color: var(--color-text-dark); } + .editor_controls .colorpicker__custom-input input + span { + color: var(--color-text) !important; } + .editor_controls .colorpicker__controls .colorpicker__sliders { + width: 100%; } + .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider { + margin: auto 0; + height: 10px; + margin: var(--spacing-eighth-unit) 0; } + .editor_controls .colorpicker__controls .colorpicker__active { + height: var(--spacing-base-unit); + width: var(--spacing-base-unit); + margin: var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit); } + .editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: var(--border-radius-small); + border: 1px solid #eee; } + .editor_controls .fold .fold .colorpicker__container { + width: calc( $colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit)); } + .editor_controls .colorscalePickerContainer { + min-width: 215px; + position: relative; + padding: 0; + resize: none; + border: none; + background: none; } + .editor_controls .colorscalePickerContainer::-webkit-scrollbar { + width: 5px; } + .editor_controls .colorscalePickerTopContainer { + display: none; } + .editor_controls .colorscaleDescription { + display: none; } + .editor_controls .colorscalePickerContainer input:focus { + outline: none; } + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .editor_controls .colorscalePickerContainer { + display: inline; } } + .editor_controls .colorscalePickerBottomContainer { + padding-right: 3px; } + .editor_controls .customPickerContainer { + margin-top: var(--spacing-quarter-unit); + text-align: left; } + .editor_controls .customPickerContainer__outer { + width: 215px; + text-align: center; } + .editor_controls .dropdown-container { + /** + * React Select + * ============ + * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/ + * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs + * MIT License: https://github.com/JedWatson/react-select +*/ + flex-grow: 1; } + +@keyframes Select-animation-spin { + to { + transform: rotate(1turn); } } + +@-webkit-keyframes Select-animation-spin { + to { + -webkit-transform: rotate(1turn); } } + .editor_controls .dropdown-container .Select { + position: relative; } + .editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button, + .editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button { + display: none !important; } + .editor_controls .dropdown-container .Select input::-ms-clear { + display: none !important; } + .editor_controls .dropdown-container .Select input::-ms-reveal { + display: none !important; } + .editor_controls .dropdown-container .Select, + .editor_controls .dropdown-container .Select div, + .editor_controls .dropdown-container .Select input, + .editor_controls .dropdown-container .Select span { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + .editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone { + cursor: default; + pointer-events: none; } + .editor_controls .dropdown-container .Select.is-disabled > .Select-control { + background-color: #f9f9f9; } + .editor_controls .dropdown-container .Select.is-disabled > .Select-control:hover { + box-shadow: none; } + .editor_controls .dropdown-container .Select.is-searchable.is-open > .Select-control { + cursor: text; } + .editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open) > .Select-control { + cursor: text; } + .editor_controls .dropdown-container .Select.is-open > .Select-control { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background: #fff; + border-color: #b3b3b3 #ccc #d9d9d9; } + .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-arrow { + top: -2px; + border-color: transparent transparent #999; + border-width: 0 5px 5px; } + .editor_controls .dropdown-container .Select.is-focused > .Select-control { + background: #fff; } + .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { + border-color: #08c #0099e6 #0099e6; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px fade(#08c, 50%); } + .editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single > .Select-control .Select-value { + padding-right: 42px; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { + color: #333; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label { + cursor: pointer; + text-decoration: none; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:hover, .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:hover, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { + color: #08c; + outline: none; + text-decoration: underline; } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { + background: #fff; } + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input { + opacity: 0; } + .editor_controls .dropdown-container .Select.is-open .Select-arrow, + .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { + border-top-color: #666; } + .editor_controls .dropdown-container .Select.Select--rtl { + direction: rtl; + text-align: right; } + .editor_controls .dropdown-container .Select-control { + background-color: #fff; + border-color: #d9d9d9 #ccc #b3b3b3; + border-radius: 4px; + border: 1px solid #ccc; + color: #333; + cursor: default; + display: table; + border-spacing: 0; + border-collapse: separate; + height: 36px; + outline: none; + overflow: hidden; + position: relative; + width: 100%; } + .editor_controls .dropdown-container .Select-control:hover { + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); } + .editor_controls .dropdown-container .Select-control .Select-input:focus { + outline: none; + background: #fff; } + .editor_controls .dropdown-container .Select-placeholder, + .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { + bottom: 0; + color: #aaa; + left: 0; + line-height: 34px; + padding-left: 10px; + padding-right: 10px; + position: absolute; + right: 0; + top: 0; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + .editor_controls .dropdown-container .Select-input { + height: 34px; + padding-left: 10px; + padding-right: 10px; + vertical-align: middle; } + .editor_controls .dropdown-container .Select-input > input { + width: 100%; + background: none transparent; + border: 0 none; + box-shadow: none; + cursor: default; + display: inline-block; + font-family: inherit; + font-size: inherit; + margin: 0; + outline: none; + line-height: 17px; + /* For IE 8 compatibility */ + padding: 8px 0 12px; + /* For IE 8 compatibility */ + -webkit-appearance: none; } + .is-focused .editor_controls .dropdown-container .Select-input > input { + cursor: text; } + .editor_controls .dropdown-container .Select-control:not(.is-searchable) > .Select-input { + outline: none; } + .editor_controls .dropdown-container .Select-loading-zone { + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 16px; } + .editor_controls .dropdown-container .Select-loading { + -webkit-animation: Select-animation-spin 400ms infinite linear; + -o-animation: Select-animation-spin 400ms infinite linear; + animation: Select-animation-spin 400ms infinite linear; + width: 16px; + height: 16px; + box-sizing: border-box; + border-radius: 50%; + border: 2px solid #ccc; + border-right-color: #333; + display: inline-block; + position: relative; + vertical-align: middle; } + .editor_controls .dropdown-container .Select-clear-zone { + -webkit-animation: Select-animation-fadeIn 200ms; + -o-animation: Select-animation-fadeIn 200ms; + animation: Select-animation-fadeIn 200ms; + color: #999; + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 17px; } + .editor_controls .dropdown-container .Select-clear-zone:hover { + color: #D0021B; } + .editor_controls .dropdown-container .Select-clear { + display: inline-block; + font-size: 18px; + line-height: 1; } + .editor_controls .dropdown-container .Select--multi .Select-clear-zone { + width: 17px; } + .editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper { + display: inline-block; } + .editor_controls .dropdown-container .Select .Select-aria-only { + position: absolute; + display: inline-block; + height: 1px; + width: 1px; + margin: -1px; + clip: rect(0, 0, 0, 0); + overflow: hidden; + float: left; } + .editor_controls .dropdown-container .Select-arrow-zone { + cursor: pointer; + display: table-cell; + position: relative; + text-align: center; + vertical-align: middle; + width: 25px; + padding-right: 5px; } + .Select--rtl .editor_controls .dropdown-container .Select-arrow-zone { + padding-right: 0; + padding-left: 5px; } + .editor_controls .dropdown-container .Select-arrow { + border-color: #999 transparent transparent; + border-style: solid; + border-width: 5px 5px 2.5px; + display: inline-block; + height: 0; + width: 0; + position: relative; } + +@-webkit-keyframes Select-animation-fadeIn { + from { + opacity: 0; } + to { + opacity: 1; } } + +@keyframes Select-animation-fadeIn { + from { + opacity: 0; } + to { + opacity: 1; } } + .editor_controls .dropdown-container .Select-menu-outer { + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + background-color: #fff; + border: 1px solid #ccc; + border-top-color: #e6e6e6; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); + box-sizing: border-box; + margin-top: -1px; + max-height: 200px; + position: absolute; + left: 0; + top: 100%; + width: 100%; + z-index: 1000; + -webkit-overflow-scrolling: touch; } + .editor_controls .dropdown-container .Select-menu { + max-height: 198px; + overflow-y: auto; } + .editor_controls .dropdown-container .Select-option { + box-sizing: border-box; + background-color: #fff; + color: #666666; + cursor: pointer; + display: block; + padding: 8px 10px; } + .editor_controls .dropdown-container .Select-option:last-child { + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; } + .editor_controls .dropdown-container .Select-option.is-selected { + background-color: #f5faff; + color: #333; } + .editor_controls .dropdown-container .Select-option.is-focused { + background-color: #f2f9fc; + color: #333; } + .editor_controls .dropdown-container .Select-option.is-disabled { + color: #cccccc; + cursor: default; } + .editor_controls .dropdown-container .Select-noresults { + box-sizing: border-box; + color: #999999; + cursor: default; + display: block; + padding: 8px 10px; } + .editor_controls .dropdown-container .Select--multi .Select-input { + vertical-align: middle; + margin-left: 10px; + padding: 0; } + .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input { + margin-left: 0; + margin-right: 10px; } + .editor_controls .dropdown-container .Select--multi.has-value .Select-input { + margin-left: 5px; } + .editor_controls .dropdown-container .Select--multi .Select-value { + background-color: #f2f9fc; + border-radius: 2px; + border: 1px solid #c9e6f2; + color: #08c; + display: inline-block; + font-size: 0.9em; + margin-left: 5px; + margin-top: 5px; + vertical-align: top; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon, + .editor_controls .dropdown-container .Select--multi .Select-value-label { + display: inline-block; + vertical-align: middle; } + .editor_controls .dropdown-container .Select--multi .Select-value-label { + border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + cursor: default; + padding: 2px 5px; } + .editor_controls .dropdown-container .Select--multi a.Select-value-label { + color: #08c; + cursor: pointer; + text-decoration: none; } + .editor_controls .dropdown-container .Select--multi a.Select-value-label:hover { + text-decoration: underline; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon { + cursor: pointer; + border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-right: 1px solid #c9e6f2; + padding: 1px 5px 3px; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi .Select-value-icon:focus { + background-color: #ddeff7; + color: #0077b3; } + .editor_controls .dropdown-container .Select--multi .Select-value-icon:active { + background-color: #c9e6f2; } + .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value { + margin-left: 0; + margin-right: 5px; } + .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon { + border-right: none; + border-left: 1px solid #c9e6f2; } + .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value { + background-color: #fcfcfc; + border: 1px solid #e3e3e3; + color: #333; } + .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon { + cursor: not-allowed; + border-right: 1px solid #e3e3e3; } + .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active { + background-color: #fcfcfc; } + +@keyframes Select-animation-spin { + to { + transform: rotate(1turn); } } + +@-webkit-keyframes Select-animation-spin { + to { + -webkit-transform: rotate(1turn); } } + .editor_controls .dropdown-container:not(:last-child) { + margin-bottom: var(--spacing-quarter-unit); } + .editor_controls .dropdown-container .Select.is-focused > .Select-control { + background-color: var(--color-background-inputs); } + .editor_controls .dropdown-container .Select.is-focused > .Select-control .Select-input { + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select.is-open > .Select-control { + border-color: var(--color-border-dark); + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-input { + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select:not(.is-open) .Select-control { + background-color: var(--color-background-inputs) !important; } + .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover { + border-color: var(--color-border-dark); } + .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow { + opacity: 1; } + .editor_controls .dropdown-container .Select-control { + background-color: var(--color-background-inputs); + border: var(--border-default); + box-shadow: none !important; + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select-option { + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select-menu-outer { + border: var(--border-default); + border-top-color: var(--color-border-default); + background-color: transparent; + box-shadow: var(--box-shadow-base); } + .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { + border-color: var(--color-border-accent); } + .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, + .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select.is-open .Select-arrow, + .editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { + border-color: transparent transparent var(--color-border-accent) !important; } + .editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow { + border-top-color: var(--color-border-accent) !important; } + .editor_controls .dropdown-container .Select-arrow { + border-color: var(--color-border-default) transparent transparent; } + .editor_controls .dropdown-container .Select-option { + background-color: var(--color-background-inputs); } + .editor_controls .dropdown-container .Select-option.is-selected { + color: var(--color-text-active); + font-weight: var(--font-weight-semibold); + background-color: var(--color-background-light); } + .editor_controls .dropdown-container .Select-option.is-focused { + background-color: var(--color-background-light); + color: var(--color-text-active); } + .editor_controls .dropdown-container .Select-option:hover { + color: var(--color-text-active); + background-color: var(--color-background-light); } + .editor_controls .dropdown-container .Select-placeholder, + .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { + color: var(--color-text-base); } + .editor_controls .dropdown-container .Select-value-label { + color: var(--color-text-base) !important; } + .editor_controls .dropdown-container .Select-placeholder { + color: var(--color-text-placeholder); } + .editor_controls .dropdown-container .dropdown--dark .Select-control { + background-color: var(--color-background-inverse); } + .editor_controls .dropdown-container .dropdown--dark .Select-option { + background-color: var(--color-background-inverse); } + .editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected { + background-color: var(--color-border-default); } + .editor_controls .dropdown-container .dropdown--dark .Select.is-focused { + background-color: var(--color-border-light); } + .editor_controls ::-webkit-input-placeholder { + /* Chrome/Opera/Safari */ + color: var(--color-text-placeholder); } + .editor_controls ::-moz-placeholder { + /* Firefox 19+ */ + color: var(--color-text-placeholder); } + .editor_controls :-ms-input-placeholder { + /* IE 10+ */ + color: var(--color-text-placeholder); } + .editor_controls :-moz-placeholder { + /* Firefox 18- */ + color: var(--color-text-placeholder); } + .editor_controls .numeric-input__wrapper { + line-height: 20px; + max-width: 100%; + flex: 1; + display: flex; + align-items: center; + color: var(--color-text-base); } + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .editor_controls .numeric-input__wrapper { + flex-basis: auto; } } + .editor_controls .numeric-input__number { + display: inline-block; + border: var(--border-default); + background: var(--color-background-inputs); + cursor: text; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; + border-radius: var(--border-radius-small); + padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); + width: 62px; + vertical-align: middle; + font-size: inherit; + color: inherit; + font-family: inherit; } + .editor_controls .numeric-input__caret-box { + display: inline-block; + max-height: 32px; + margin-left: var(--spacing-quarter-unit); + margin-right: var(--spacing-half-unit); + vertical-align: middle; + box-sizing: border-box; } + .editor_controls .numeric-input__caret:first-child { + margin-bottom: 2px; } + .editor_controls .numeric-input__caret { + cursor: pointer; + background-color: var(--color-background-light); + border: var(--border-default); + border-radius: 1px; + line-height: var(--spacing-half-unit); + text-align: center; } + .editor_controls .numeric-top-caret-modifier { + width: 13px !important; + height: 13px !important; + fill: var(--color-text-base) !important; } + .editor_controls .numeric-bottom-caret-modifier { + width: 13px !important; + height: 13px !important; + fill: var(--color-text-base) !important; } + .editor_controls ::-webkit-input-placeholder { + /* Chrome/Opera/Safari */ + color: var(--color-text-placeholder); } + .editor_controls ::-moz-placeholder { + /* Firefox 19+ */ + color: var(--color-text-placeholder); } + .editor_controls :-ms-input-placeholder { + /* IE 10+ */ + color: var(--color-text-placeholder); } + .editor_controls :-moz-placeholder { + /* Firefox 18- */ + color: var(--color-text-placeholder); } + .editor_controls .text-input { + display: inline-block; + border: var(--border-default); + background: var(--color-background-inputs); + cursor: text; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + text-align: left; + border-radius: var(--border-radius-small); + padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); + width: 140px; + vertical-align: middle; + font-size: inherit; + color: inherit; + font-family: inherit; } + .editor_controls .radio-block { + width: 100%; + line-height: var(--font-leading-head); + display: flex; } + .editor_controls .radio-block__option { + flex-grow: 1; + padding: var(--spacing-quarter-unit) var(--spacing-half-unit); + background-color: var(--color-background-top); + border: var(--border-default); + display: inline-block; + cursor: pointer; + min-width: 0px; + text-align: center; + font-size: var(--font-size-small); } + .editor_controls .radio-block__option:not(.radio-block__option--active):hover { + background-color: var(--color-background-light); + color: var(--color-text-active); } + .editor_controls .radio-block__option--active { + background-color: var(--color-button-primary-base-fill); + color: var(--color-button-primary-base-text); + border: 1px solid var(--color-button-primary-base-border); + margin-left: -1px; + cursor: default; + text-shadow: var(--text-shadow-dark-ui); + font-weight: var(--font-weight-semibold); } + .editor_controls .radio-block__option--active:not(:first-child), .editor_controls .radio-block__option--active:last-child { + border-left: var(--border-accent-shade) !important; } + .editor_controls .radio-block__option:not(:first-child):not(:last-child) { + border-left: 0; } + .editor_controls .radio-block__option:last-child { + border-top-right-radius: var(--border-radius-small); + border-bottom-right-radius: var(--border-radius-small); + border-left: 0; } + .editor_controls .radio-block__option:first-child { + border-top-left-radius: var(--border-radius-small); + border-bottom-left-radius: var(--border-radius-small); } + .editor_controls .radio-block__option:first-child:not(.radio-block__option--active) { + border-left: var(--border-default); } + .editor_controls .text-editor { + overflow: hidden; + border: var(--border-default); + border-radius: var(--border-radius); + min-height: 155px; + display: flex; + flex-direction: column; + flex-grow: 1; } + .editor_controls .text-editor * { + box-sizing: border-box; } + .editor_controls .text-editor textarea[class='multi-format-editor__latex'] { + height: 155px; + width: 100%; + margin: 10px; + border: var(--border-default); } + .editor_controls .text-editor textarea[class='multi-format-editor__html'] { + height: 145px; + width: 100%; } + .editor_controls .text-editor textarea { + width: 100%; + height: 100%; + border: none; + overflow: auto; + outline: none; + box-shadow: none; + padding: var(--spacing-quarter-unit); + resize: none; + line-height: 24px; + font-size: 13px; + color: var(--color-text-base); + background-color: var(--color-background-inputs); } + .editor_controls .multi-format-editor__root { + display: flex; + overflow: hidden; + height: 205px; } + .editor_controls .multi-format-editor__root__wrapper { + flex-grow: 1; + display: flex; + flex-wrap: wrap; + align-items: stretch; + flex-direction: column; } + .editor_controls .multi-format-editor__tabs { + height: 30px; + display: block; + width: 100%; } + .editor_controls .multi-format-editor__tab { + text-align: center; + height: 30px; + line-height: 28px; + box-sizing: border-box; } + .editor_controls .multi-format-editor__tab.top-tab { + width: 50%; + overflow: hidden; + color: var(--color-text-base); + display: inline-block; } + .editor_controls .multi-format-editor__tab.top-tab.left { + border-top-left-radius: 5px; + border-right: var(--border-default); } + .editor_controls .multi-format-editor__tab.top-tab.right { + border-top-right-radius: 5px; } + .editor_controls .multi-format-editor__tab.top-tab:not(.selected) { + border-bottom: var(--border-default); } + .editor_controls .multi-format-editor__tab.bottom-tab { + border-top: var(--border-default); + width: 100%; + display: block; + color: var(--color-text-base); } + .editor_controls .multi-format-editor__tab.selected { + background: var(--color-background-light); + font-weight: var(--font-weight-semibold); } + .editor_controls .multi-format-editor__tab:hover:not(.selected) { + cursor: pointer; + color: var(--color-text-active); + background-color: var(--color-background-light); } + .editor_controls .multi-format-editor__content__wrapper__rich_text { + flex-grow: 1; + display: flex; + flex-direction: column; } + .editor_controls .multi-format-editor__content__wrapper__latex { + background-color: var(--color-background-light); + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .multi-format-editor__content__wrapper__html { + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .multi-format-editor__confirmation-panel { + height: 100%; + max-height: 100%; + width: 100%; + text-align: center; + display: flex; + flex-direction: column; + align-items: flex-start; + flex: 1; } + .editor_controls .multi-format-editor__confirmation-panel__header { + color: var(--color-text-section-header); + margin-top: 0; + margin-bottom: 5px; + font-weight: 600; } + .editor_controls .multi-format-editor__confirmation-panel__content { + overflow-y: auto; + display: flex; + flex-direction: column; + -webkit-overflow-scrolling: touch; + padding: var(--spacing-half-unit); } + .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar { + background: white; + width: 5px; } + .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls .multi-format-editor__confirmation-panel__actions { + padding: var(--spacing-half-unit); + width: 100%; + display: flex; + justify-content: center; + align-items: center; + border-top: 1px solid var(--color-border-light); + -webkit-overflow-scrolling: touch; } + .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar { + background: white; + width: 5px; } + .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track { + box-shadow: none; + background: var(--scrollbar-track-background); } + .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb { + background-color: var(--scrollbar-thumb-color); + border-radius: 10px; } + .editor_controls .multi-format-editor__confirmation-panel__message { + line-height: 20px; } + .editor_controls .multi-format-editor__confirmation-panel__message-primary { + font-weight: var(--font-weight-semibold); + color: var(--color-text-base); } + .editor_controls .multi-format-editor__confirmation-panel__message-secondary { + color: var(--color-text-base); } + .editor_controls .multi-format-editor__confirmation-panel__continue-button { + margin-left: 10px; } + .editor_controls .rich-text-editor__root { + border-top: none; + width: 100%; + color: var(--color-text-base); + display: flex; + flex-direction: column; + flex-grow: 1; } + .editor_controls .rich-text-editor__editor { + cursor: text; + position: relative; + flex-grow: 1; } + .editor_controls .rich-text-editor__editor > div { + position: absolute; + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + overflow: auto; + flex-grow: 1; + left: 0; + top: 0; } + .editor_controls .rich-text-editor__controls { + display: flex; + justify-content: space-evenly; + background: var(--color-background-light); + font-size: 14px; + padding: 10px 0; + user-select: none; + border-bottom: var(--border-default); } + .editor_controls .rich-text-editor__controls .icon-link { + transform: translateY(3px); + display: inline-block; + fill: var(--color-text-base); + width: 15px !important; + height: 15px !important; } + .editor_controls .rich-text-editor__link-editor { + background-color: var(--color-background-light); + border: var(--border-default); + padding: var(--spacing-half-unit); + position: absolute; + z-index: 1; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; } + .editor_controls .rich-text-editor__link-editor__label { + display: block; } + .editor_controls .rich-text-editor__link-editor__input { + border: var(--border-default); + color: var(--color-text-base); + overflow: scroll; + padding: 0 10px; + width: 100%; + margin-top: 10px; } + .editor_controls .rich-text-editor__styleButton { + color: var(--color-text-base); + cursor: pointer; + display: inline-block; + margin: 0; + min-height: var(--spacing-base-unit); + min-width: var(--spacing-base-unit); + text-align: center; + background-color: transparent; + border: var(--border-default); + border-radius: var(--border-radius-small); + line-height: 20px; + position: relative; } + .editor_controls .rich-text-editor__styleButton__wrapper { + padding: 0 var(--spacing-quarter-unit); } + .editor_controls .rich-text-editor__styleButton--active { + background-color: var(--color-accent); + border: var(--border-accent-shade); + color: var(--color-white); } + .editor_controls .rich-text-editor__styleButton--active:hover { + background-color: var(--color-accent); + border: var(--border-accent-shade); + color: var(--color-white); } + .editor_controls .rich-text-editor__styleButton--active:hover::before { + transform: scaleX(0); } + .editor_controls .rich-text-editor__styleButton::before { + content: ''; + position: absolute; + bottom: -1px; + height: 1px; + width: calc(100% + 2px); + left: -1px; + background: var(--color-accent); + will-change: transform; + transform-origin: center center; + transform: scaleX(0); + transition: all 0.15s ease-in-out; } + .editor_controls .rich-text-editor__styleButton:hover { + color: var(--color-text-active); + background-color: var(--color-background-top); } + .editor_controls .rich-text-editor__styleButton:hover::before { + transform: none; } + .editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root, + .editor_controls .rich-text-editor__editor .public-DraftEditor-content { + padding: var(--spacing-quarter-unit); } + .editor_controls .rich-text-editor__editor .public-DraftEditor-content { + min-height: 100px; } + .editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root { + display: none; } + .editor_controls .rich-text-editor__editor .RichEditor-blockquote { + border-left: 5px solid #eee; + color: #666; + font-style: italic; + margin: 16px 0; + padding: 10px 20px; } + .editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre { + background-color: rgba(0, 0, 0, 0.05); + font-size: 16px; + padding: 20px; } + .editor_controls .DraftEditor-editorContainer, + .editor_controls .DraftEditor-root, + .editor_controls .public-DraftEditor-content { + height: inherit; + text-align: initial; } + .editor_controls .DraftEditor-root { + position: relative; } + .editor_controls .DraftEditor-editorContainer { + background-color: rgba(255, 255, 255, 0); + border-left: 0.1px solid transparent; + position: relative; + z-index: 1; } + .editor_controls .public-DraftEditor-block { + position: relative; } + .editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block { + text-align: left; } + .editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root { + left: 0; + text-align: left; } + .editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block { + text-align: center; } + .editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root { + margin: 0 auto; + text-align: center; + width: 100%; } + .editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block { + text-align: right; } + .editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root { + right: 0; + text-align: right; } + .editor_controls .public-DraftEditorPlaceholder-root { + color: #9197a3; + position: absolute; + z-index: 0; } + .editor_controls .public-DraftEditorPlaceholder-hasFocus { + color: #bdc1c9; } + .editor_controls .DraftEditorPlaceholder-hidden { + display: none; } + .editor_controls .public-DraftStyleDefault-block { + position: relative; + white-space: pre-wrap; } + .editor_controls .public-DraftStyleDefault-ltr { + direction: ltr; + text-align: left; } + .editor_controls .public-DraftStyleDefault-rtl { + direction: rtl; + text-align: right; } + .editor_controls .public-DraftStyleDefault-listLTR { + direction: ltr; } + .editor_controls .public-DraftStyleDefault-listRTL { + direction: rtl; } + .editor_controls .public-DraftStyleDefault-ol, + .editor_controls .public-DraftStyleDefault-ul { + margin: 16px 0; + padding: 0; } + .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR { + margin-left: 1.5em; } + .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL { + margin-right: 1.5em; } + .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR { + margin-left: 3em; } + .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL { + margin-right: 3em; } + .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR { + margin-left: 4.5em; } + .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL { + margin-right: 4.5em; } + .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR { + margin-left: 6em; } + .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL { + margin-right: 6em; } + .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR { + margin-left: 7.5em; } + .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL { + margin-right: 7.5em; } + .editor_controls .public-DraftStyleDefault-unorderedListItem { + list-style-type: square; + position: relative; } + .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0 { + list-style-type: disc; } + .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1 { + list-style-type: circle; } + .editor_controls .public-DraftStyleDefault-orderedListItem { + list-style-type: none; + position: relative; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before { + left: -36px; + position: absolute; + text-align: right; + width: 30px; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before { + position: absolute; + right: -36px; + text-align: left; + width: 30px; } + .editor_controls .public-DraftStyleDefault-orderedListItem:before { + content: counter(ol0) ". "; + counter-increment: ol0; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before { + content: counter(ol1) ". "; + counter-increment: ol1; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before { + content: counter(ol2) ". "; + counter-increment: ol2; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before { + content: counter(ol3) ". "; + counter-increment: ol3; } + .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before { + content: counter(ol4) ". "; + counter-increment: ol4; } + .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset { + counter-reset: ol0; } + .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset { + counter-reset: ol1; } + .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset { + counter-reset: ol2; } + .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset { + counter-reset: ol3; } + .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset { + counter-reset: ol4; } + .editor_controls .rangeslider { + margin: 0 var(--spacing-quarter-unit); + min-width: 60px; + position: relative; + background: var(--color-background-light); + -ms-touch-action: none; + touch-action: none; + border: 1px solid var(--color-border-default); + flex-grow: 1; } + .editor_controls .rangeslider, + .editor_controls .rangeslider .rangeslider__fill { + display: block; } + .editor_controls .rangeslider .rangeslider__handle { + outline: 0; + background: #fff; + border: 1px solid var(--color-border-default); + cursor: pointer; + display: inline-block; + position: absolute; } + .editor_controls .rangeslider .rangeslider__handle .rangeslider__active { + opacity: 1; } + .editor_controls .rangeslider .rangeslider__handle-tooltip { + width: 20px; + height: 20px; + text-align: center; + position: absolute; + background-color: rgba(0, 0, 0, 0.8); + font-weight: normal; + font-size: 14px; + transition: all 100ms ease-in; + border-radius: 4px; + display: inline-block; + color: white; + left: 50%; + transform: translate3d(-50%, 0, 0); } + .editor_controls .rangeslider .rangeslider__handle-tooltip span { + margin-top: 12px; + display: inline-block; + line-height: 100%; } + .editor_controls .rangeslider .rangeslider__handle-tooltip:after { + content: ' '; + position: absolute; + width: 0; + height: 0; } + .editor_controls .rangeslider-horizontal { + height: 6px; + border-radius: 10px; } + .editor_controls .rangeslider-horizontal .rangeslider__fill { + height: 100%; + background-color: var(--color-accent); + border: var(--border-accent); + border-radius: 10px; + transform: translateY(-1px); + top: 0; } + .editor_controls .rangeslider-horizontal .rangeslider__handle { + width: 6.66667px; + height: 30px; + border-radius: 20px; + top: 50%; + transform: translate3d(-50%, -50%, 0); + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .rangeslider-horizontal .rangeslider__handle:after { + content: ' '; + position: absolute; + width: 4px; + height: 20px; + border-radius: 5px; + background-color: var(--color-accent); + display: none; } + .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip { + top: -55px; } + .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after { + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 8px solid rgba(0, 0, 0, 0.8); + left: 50%; + bottom: -8px; + transform: translate3d(-50%, 0, 0); } + .editor_controls .rangeslider-vertical { + margin: 20px auto; + height: 150px; + max-width: 10px; + background-color: transparent; } + .editor_controls .rangeslider-vertical .rangeslider__fill, + .editor_controls .rangeslider-vertical .rangeslider__handle { + position: absolute; } + .editor_controls .rangeslider-vertical .rangeslider__fill { + width: 100%; + background-color: #7cb342; + box-shadow: none; + bottom: 0; } + .editor_controls .rangeslider-vertical .rangeslider__handle { + width: 30px; + height: 10px; + left: -10px; + box-shadow: none; } + .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip { + left: -100%; + top: 50%; + transform: translate3d(-50%, -50%, 0); } + .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after { + border-top: 8px solid transparent; + border-bottom: 8px solid transparent; + border-left: 8px solid rgba(0, 0, 0, 0.8); + left: 100%; + top: 12px; } + .editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill { + right: 0; } + .editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill { + top: 0; + bottom: inherit; } + .editor_controls .rangeslider__labels { + position: relative; } + .rangeslider-vertical .editor_controls .rangeslider__labels { + position: relative; + list-style-type: none; + margin: 0 0 0 24px; + padding: 0; + text-align: left; + width: 250px; + height: 100%; + left: 10px; } + .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item { + position: absolute; + transform: translate3d(0, -50%, 0); } + .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item::before { + content: ''; + width: 10px; + height: 2px; + background: black; + position: absolute; + left: -14px; + top: 50%; + transform: translateY(-50%); + z-index: -1; } + .editor_controls .rangeslider__labels .rangeslider__label-item { + position: absolute; + font-size: 14px; + cursor: pointer; + display: inline-block; + top: 10px; + transform: translate3d(-50%, 0, 0); } + .editor_controls .trace-grid-single-block { + max-width: 460px; + display: flex; + flex-flow: wrap; + padding: var(--spacing-quarter-unit); } + .editor_controls .trace-grid { + display: grid; + grid-template-columns: repeat(4, 1fr); } + @media (max-width: 860px) { + .editor_controls .trace-grid { + grid-template-columns: repeat(2, 1fr); } } + .editor_controls .trace-grid__column { + text-align: center; + display: flex; + align-items: flex-start; + justify-content: flex-start; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; } + .editor_controls .trace-grid__column:nth-of-type(4n + 3) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column:nth-of-type(4n) { + -ms-grid-column: 2; } + .editor_controls .trace-grid__column:nth-of-type(4n + 1) { + -ms-grid-column: 3; } + .editor_controls .trace-grid__column:nth-of-type(4n + 2) { + -ms-grid-column: 4; } + .editor_controls .trace-grid__column:nth-of-type(3), .editor_controls .trace-grid__column:nth-of-type(4), .editor_controls .trace-grid__column:nth-of-type(5), .editor_controls .trace-grid__column:nth-of-type(6) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column:nth-of-type(7), .editor_controls .trace-grid__column:nth-of-type(8), .editor_controls .trace-grid__column:nth-of-type(9), .editor_controls .trace-grid__column:nth-of-type(10) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 1) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 2) { + -ms-grid-column: 2; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(3), .editor_controls .trace-grid__column .trace-item:nth-of-type(4) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(5), .editor_controls .trace-grid__column .trace-item:nth-of-type(6) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column .trace-item:nth-of-type(7), .editor_controls .trace-grid__column .trace-item:nth-of-type(8) { + -ms-grid-row: 4; } + .editor_controls .trace-grid__column:not(:first-of-type) { + position: relative; } + .editor_controls .trace-grid__column:not(:first-of-type)::before { + position: absolute; + width: 1px; + border-left: var(--border-light); + height: 100%; + top: 0; + left: 0; + content: ''; } + .editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header { + position: relative; + z-index: 99; } + .editor_controls .trace-grid__column--double { + grid-column: span 2; + flex-grow: 0; } + .editor_controls .trace-grid__column--double:nth-of-type(2n + 1) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column--double:nth-of-type(2n + 2) { + -ms-grid-column: 3; } + .editor_controls .trace-grid__column--double:nth-of-type(5), .editor_controls .trace-grid__column--double:nth-of-type(6) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column--double:nth-of-type(7), .editor_controls .trace-grid__column--double:nth-of-type(8) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 1) { + -ms-grid-column: 1; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 2) { + -ms-grid-column: 2; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 3) { + -ms-grid-column: 3; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n) { + -ms-grid-column: 4; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(3), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4) { + -ms-grid-row: 1; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(5), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(6), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(7), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(8) { + -ms-grid-row: 2; } + .editor_controls .trace-grid__column--double .trace-item:nth-of-type(9), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(10), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(11), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(12) { + -ms-grid-row: 3; } + .editor_controls .trace-grid__column--double .trace-grid__column__items { + display: grid; + grid-gap: 0; + grid-template-columns: repeat(4, 1fr); } + .editor_controls .trace-grid__column__items { + display: grid; + grid-gap: 0; + grid-template-columns: repeat(2, 90px); + grid-template-rows: repeat(2, 112px); + flex-grow: 1; + width: 100%; + padding: 0 var(--spacing-half-unit) var(--spacing-half-unit); } + .editor_controls .trace-grid__column__header { + text-transform: capitalize; + font-weight: var(--font-weight-semibold); + color: var(--color-text-base); + text-align: left; + display: flex; + align-items: center; + justify-content: flex-start; + border-top: var(--border-light); + width: 100%; + padding: var(--spacing-half-unit) var(--spacing-base-unit) 0; + box-sizing: border-box; } + .editor_controls .trace-item { + width: 90px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + flex-grow: 0; + margin-top: var(--spacing-half-unit); + color: var(--color-text-base); + transition: all 0.15s ease-in-out; + position: relative; } + .editor_controls .trace-item--active .trace-item__image { + border-color: var(--color-accent); + border-width: 2px; + color: var(--color-accent); } + .editor_controls .trace-item__actions { + position: absolute; + width: calc(100%); + display: flex; + flex-direction: column; + top: 0; + left: var(--spacing-quarter-unit); + justify-content: flex-start; + align-items: flex-end; + z-index: 99; + height: 60px; } + .editor_controls .trace-item__actions:hover .trace-item__actions__item { + transform: translateX(-2px); + opacity: 1; + pointer-events: initial; } + .editor_controls .trace-item__actions__item { + transform: translateX(-10px); + opacity: 0; + pointer-events: none; + color: var(--color-text-light); + transition: all 0.15s ease-in-out; } + .editor_controls .trace-item__actions__item:not(:last-child) { + margin-bottom: var(--spacing-quarter-unit); } + .editor_controls .trace-item__actions__item:hover { + color: var(--color-accent); } + .editor_controls .trace-item__actions__item svg { + display: block; + width: 16px; + height: 16px; + fill: currentColor; } + .editor_controls .trace-item:hover { + cursor: pointer; + color: var(--color-accent); } + .editor_controls .trace-item:hover .trace-item__label { + color: var(--color-accent); } + .editor_controls .trace-item:hover .trace-item__image { + border-color: var(--color-accent); } + .editor_controls .trace-item__image { + position: relative; + z-index: 2; + border: 1px solid var(--color-border-default); + width: 60px; + height: 60px; + border-radius: var(--border-radius); + background: var(--color-background-top); + box-shadow: 0 2px 9px transparent; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.15s ease-in-out; } + .editor_controls .trace-item__image__svg { + width: 100%; + flex-grow: 1; + padding: var(--spacing-quarter-unit); } + .editor_controls .trace-item__image svg { + display: block; } + .editor_controls .trace-item__image img { + display: block; + font-size: 10px; + color: var(--color-text-base); } + .editor_controls .trace-item__image__wrapper { + width: 100%; } + .editor_controls .trace-item__label { + font-weight: var(--font-weight-semibold); + width: 72px; + height: 34px; + margin-top: var(--spacing-quarter-unit); + color: var(--color-text-base); + text-transform: capitalize; + font-size: var(--font-size-small); + text-align: center; } + .editor_controls .trace-type-select-dropdown__wrapper > * > * { + pointer-events: none; } + .editor_controls .trace-type-select-dropdown__wrapper > *:hover { + cursor: pointer; } + .editor_controls .trace-type-select-dropdown__wrapper > *:hover .Select:not(.is-open) .Select-control { + border-color: var(--color-border-dark); } + .editor_controls .trace-type-select-button { + display: flex; + align-items: center; + border: var(--border-default); + width: 100%; + height: 36px; + border-radius: var(--border-radius); + padding: 0 var(--spacing-quarter-unit); } + .editor_controls .trace-type-select-button:hover { + cursor: pointer; + border-color: var(--color-border-dark); } + .editor_controls .trace-type-select-button__icon { + max-width: 20px; + width: 20px; + margin-right: var(--spacing-quarter-unit); } + .editor_controls .trace-type-select-button__icon svg { + max-width: 100%; + display: block; } + .editor_controls .trace-type-select-button__icon svg * { + fill: currentColor; } + .editor_controls .dropzone-container { + flex-grow: 1; + display: flex; + align-items: center; + justify-content: center; + border: 1px dashed var(--color-border-default); + height: 160px; + box-sizing: border-box; + padding: 8px; + border-radius: var(--border-radius); } + .editor_controls .dropzone-container__content { + width: 100%; + height: 100%; + text-align: center; + background-color: var(--color-rhino-light-5); + border-radius: var(--border-radius); + display: flex; + align-items: center; + justify-content: center; } + .editor_controls .dropzone-container__message { + padding: 15px; } + .editor_controls .dropzone-container__image { + width: 100%; + height: 100%; + background-size: contain; + background-position: center; + position: relative; + background-repeat: no-repeat; } + .editor_controls .dropzone-container--active { + border-color: var(--color-dodger); } + .editor_controls .dropzone-container--rejected { + border-color: red; } + .editor_controls [aria-label][role~='tooltip'] { + position: relative; } + .editor_controls [aria-label][role~='tooltip']::before, + .editor_controls [aria-label][role~='tooltip']::after { + transform: translate3d(0, 0, 0); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + display: none; + will-change: transform; + opacity: 0; + pointer-events: none; + transition: all var(--microtip-transition-duration, 0.18s) var(--microtip-transition-easing, ease-in-out) var(--microtip-transition-delay, 0s); + position: absolute; + box-sizing: border-box; + z-index: 10; + transform-origin: top; } + .editor_controls [aria-label][role~='tooltip']::before { + background-size: 100% auto !important; + content: ''; } + .editor_controls [aria-label][role~='tooltip']::after { + background: #506784; + border-radius: 4px; + color: #ffffff; + content: attr(aria-label); + font-size: var(--microtip-font-size, 13px); + font-weight: var(--microtip-font-weight, normal); + text-transform: var(--microtip-text-transform, none); + padding: 0.5em 1em; + white-space: nowrap; + box-sizing: content-box; } + .editor_controls [aria-label][role~='tooltip']:hover::before, + .editor_controls [aria-label][role~='tooltip']:hover::after, + .editor_controls [aria-label][role~='tooltip']:focus::before, + .editor_controls [aria-label][role~='tooltip']:focus::after { + opacity: 1; + pointer-events: auto; + display: block; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 6px; + width: 18px; + margin-bottom: 5px; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { + margin-bottom: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { + transform: translate3d(-50%, 0, 0); + bottom: 100%; + left: 50%; } + .editor_controls [role~='tooltip'][data-microtip-position|='top']:hover::before { + transform: translate3d(-50%, -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { + transform: translate3d(-50%, 0, 0); + bottom: 100%; + left: 50%; } + .editor_controls [role~='tooltip'][data-microtip-position='top']:hover::after { + transform: translate3d(-50%, -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='top-left']::after { + transform: translate3d(calc(-100% + 16px), 0, 0); + bottom: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='top-left']:hover::after { + transform: translate3d(calc(-100% + 16px), -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='top-right']::after { + transform: translate3d(calc(0% + -16px), 0, 0); + bottom: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='top-right']:hover::after { + transform: translate3d(calc(0% + -16px), -5px, 0); } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 6px; + width: 18px; + margin-top: 5px; + margin-bottom: 0; } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { + margin-top: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { + transform: translate3d(-50%, -10px, 0); + bottom: auto; + left: 10px; + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']:hover::before { + transform: translate3d(-50%, 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { + transform: translate3d(-50%, -10px, 0); + left: 10px; + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='bottom']:hover::after { + transform: translate3d(-50%, 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']::after { + transform: translate3d(calc(-100% + 16px), -10px, 0); + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']:hover::after { + transform: translate3d(calc(-100% + 16px), 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']::after { + transform: translate3d(calc(0% + -16px), -10px, 0); + top: 100%; } + .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']:hover::after { + transform: translate3d(calc(0% + -16px), 0, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='left']::before, + .editor_controls [role~='tooltip'][data-microtip-position='left']::after { + bottom: auto; + left: auto; + right: 100%; + top: 50%; + transform: translate3d(10px, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='left']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 18px; + width: 6px; + margin-right: 5px; + margin-bottom: 0; } + .editor_controls [role~='tooltip'][data-microtip-position='left']::after { + margin-right: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::before, + .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::after { + transform: translate3d(0, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='right']::before, + .editor_controls [role~='tooltip'][data-microtip-position='right']::after { + bottom: auto; + left: 100%; + top: 50%; + transform: translate3d(-10px, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-position='right']::before { + background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; + height: 18px; + width: 6px; + margin-bottom: 0; + margin-left: 5px; } + .editor_controls [role~='tooltip'][data-microtip-position='right']::after { + margin-left: 11px; } + .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::before, + .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::after { + transform: translate3d(0, -50%, 0); } + .editor_controls [role~='tooltip'][data-microtip-size='small']::after { + white-space: initial; + width: 80px; } + .editor_controls [role~='tooltip'][data-microtip-size='medium']::after { + white-space: initial; + width: 140px; } + .editor_controls [role~='tooltip'][data-microtip-size='large']::after { + white-space: initial; + width: 260px; } + .editor_controls__wrapper { + display: flex; + flex-grow: 1; } + .editor_controls a { + color: #0d76bf; + cursor: pointer; } + +.plotly_editor { + display: flex; + /* + We are defining the max height of the app so that the editor knows how big to be + currently the editor will take up whatever space it can if it is not constrained in its parent + */ + flex-grow: 1; + height: 100%; + max-height: 100%; + width: 100%; } + +.plotly_editor_plot { + max-width: 100%; + height: 100%; + max-height: 100%; + overflow: auto; + flex-grow: 1; } diff --git a/lib/react-chart-editor.ie.min.css b/lib/react-chart-editor.ie.min.css new file mode 100644 index 000000000..29fe6c22d --- /dev/null +++ b/lib/react-chart-editor.ie.min.css @@ -0,0 +1 @@ +.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:#2a3f5f}@keyframes a{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}@keyframes b{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(20px)}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;transform:translateY(20px);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;transform:none;animation:b .1s forwards cubic-bezier(.19,1,.22,1)}.editor_controls{position:relative;width:436px;flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Open Sans,--apple-default,sans-serif}.editor_controls .sidebar{-ms-user-select:none;user-select:none;height:100%;min-width:100px;width:100px;max-width:100px;text-align:center;background:#fff;overflow-y:auto;overflow-x:hidden;float:left;border-right:1px solid #c8d4e3;flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .sidebar__group{background-color:#fff;cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:#506784;font-size:14px;font-weight:500;padding:12px 0;text-transform:capitalize;text-align:left;border-bottom:1px solid #dfe8f3;display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:24px}.editor_controls .sidebar__group__title__icon{position:absolute;transform:scale(.9) translateX(2px) translateY(-4px);transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:#2a3f5f;cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:600;color:#2a3f5f}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:#119dff}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .sidebar__item{color:#506784;cursor:pointer;font-size:14px;font-weight:500;line-height:14px;text-transform:capitalize;background-color:#f3f6fa;padding:10px;padding-left:18px;padding-right:6px;text-align:left;border-bottom:1px solid #dfe8f3;position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:#119dff;transform:scaleX(0);transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:#ebf0f8}.editor_controls .sidebar__item--is-active{color:#2a3f5f;font-weight:600;cursor:default}.editor_controls .sidebar__item--is-active:before{transform:none}.editor_controls .sidebar__item--is-active span{transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:12px;box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls__wrapper>.panel{background-color:#ebf0f8;border-right:1px solid #c8d4e3;width:335px}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:12px;display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:14px;float:left;color:#506784;display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:#a2b1c6;padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:335px;border-right:1px solid #c8d4e3;height:100%;padding:12px;background-color:#ebf0f8;box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:48px;margin-bottom:12px;opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:#a2b1c6}.editor_controls .panel__empty__message__heading{color:#2a3f5f;font-size:24px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px}.editor_controls .panel__empty__message__content{font-size:13px;color:#506784;line-height:1.6}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-ms-user-select:none;user-select:none;margin-bottom:12px}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:6px 12px;color:#fff;font-size:13px;border:1px solid #2a3f5f;background-color:#2a3f5f;height:15px;border-radius:5px;text-shadow:0 1px 2px rgba(42,63,95,.7);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out}.editor_controls .fold__top:hover{cursor:pointer;background-color:#2a3f5f}.editor_controls .fold__top svg{width:18px;height:18px;display:block;filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:#fff;background-color:#506784;border:1px solid #506784;border-radius:5px 5px 0 0;text-shadow:0 1px 1px rgba(42,63,95,.4)}.editor_controls .fold__top--open svg{filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:#506784}.editor_controls .fold__top__icon{display:block;margin-right:6px;transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:12px/3;font-size:14px;line-height:14px;font-weight:600;transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:transform .1s ease-in-out;transform:rotate(-90deg);font-weight:700;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:#fff;border:1px solid #c8d4e3;border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:Dosis,Arial,sans-serif;display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:#119dff;display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:#506784}.editor_controls .fold__content__empty__message__secondary{font-family:Open Sans,--apple-default,sans-serif;font-size:12px;text-align:center;color:#506784}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:13px;color:#2a3f5f;font-weight:600;cursor:default;background-color:#f3f6fa;padding:6px 12px;clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:1px solid #dfe8f3}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:6px;width:100%}.editor_controls .menupanel__label{font-weight:600;padding-right:6px}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:#a2b1c6!important;padding-left:6px}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:#119dff!important}.editor_controls .menupanel__icon-span{font-size:12px;display:flex}.editor_controls .menupanel__icon-span--question{color:#506784}.editor_controls .info__title{color:#2a3f5f;font-size:18px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px;padding:12px 12px 6px}.editor_controls .info__text{padding:6px 12px;color:#506784;font-size:12px;font-weight:500;line-height:1.6}.editor_controls .info__sub-text{color:#506784;font-size:12px;font-weight:500;font-style:italic;line-height:1.6;padding:6px 12px 12px}.editor_controls .modalbox{position:absolute;border-radius:5px;overflow:hidden;text-transform:none;text-align:left;border:1px solid #c8d4e3;align-content:center;box-shadow:0 2px 9px rgba(80,103,132,.2);left:-6px;width:calc(100% + 12px);top:calc(100% + 6px);background-color:#fff;z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:#506784}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;animation-duration:1s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:#a2b1c6;position:fixed}.editor_controls .modal__card{background:#fff;border-radius:5px;position:relative;z-index:1003;max-width:calc(100% - 24px);box-shadow:0 2px 9px rgba(80,103,132,.2);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;animation-duration:.85s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:#506784;padding:12px;font-weight:600}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:#f3f6fa;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{animation-duration:.85s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;color:#506784;font-size:13px;background:#dfe8f3;border:1px solid #c8d4e3;border-bottom:0;position:relative;background:#f3f6fa;transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:#dfe8f3;margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:12px 12px 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:5px}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:5px;border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:#ebf0f8;cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:#ebf0f8;pointer-events:none;margin-top:0;color:#2a3f5f;border-top-color:#119dff;border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:#ebf0f8;left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:1px solid #c8d4e3;display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:1px solid #dfe8f3;color:#506784;display:flex;font-size:13px;font-weight:500;justify-content:flex-start;line-height:13px;min-height:32px;padding:6px 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 12px;-ms-grid-row-align:center;align-self:center;line-height:1.6}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:12px;padding-left:12px;align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{-ms-grid-row-align:center;align-self:center}.editor_controls .field__title{width:80px;padding-left:12px;display:block;font-size:12px;line-height:1.6;color:#506784;padding-top:6px;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:6px;opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:#506784}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:#ef553b}.editor_controls .field .rect,.editor_controls .field .square{border-color:#119dff}.editor_controls .field .rect-grid{border-color:#ebf0f8!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:1px solid #c8d4e3;border-radius:5px;width:80px;cursor:pointer;padding:6px 6px 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:#506784}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:#a2b1c6;padding-top:3px;width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:1px solid #c8d4e3;padding:12px;box-shadow:2px 2px 12px #dfe8f3;border-radius:3px;left:24px}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:#c8d4e3}.editor_controls button{display:inline-block;padding:6px 12px;line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-ms-user-select:none;user-select:none;font-size:14px;font-weight:600;font-family:Open Sans,--apple-default,sans-serif;border:1px solid transparent;border-radius:5px;transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:12px}.editor_controls .button__icon{display:flex;padding-left:6px;will-change:transform}.editor_controls .button__icon svg{transform:scale(.8);transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - 24px);margin-left:12px;margin-right:12px}.editor_controls .button--no-text{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--primary{background-color:#119dff;border-color:#0d76bf;color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--primary svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:active:not(.button--no-text--disabled),.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:#0d76bf;border:1px solid #0d76bf;color:#fff}.editor_controls .button--secondary{background-color:transparent;border-color:#c8d4e3;color:#506784}.editor_controls .button--secondary:active:not(.button--no-text--disabled),.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--tertiary{background-color:transparent;border-color:transparent;color:#506784}.editor_controls .button--tertiary:active:not(.button--no-text--disabled),.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid transparent;color:#2a3f5f}.editor_controls .button--upgrade{background-color:#ab63fa;border-color:var(--color-lavender-shade-dark);color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--upgrade svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:#934bde;border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-lavender-shade-dark);border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--header{background-color:transparent;border-color:#119dff;color:#119dff}.editor_controls .button--header:active:not(.button--no-text--disabled),.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #0d76bf;color:#0d76bf}.editor_controls .checkbox__group{padding-left:12px;text-align:left}.editor_controls .checkbox__item{-ms-user-select:none;user-select:none;cursor:default;padding-top:3px;padding-bottom:3px}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:#f3f6fa}.editor_controls .checkbox__box--checked{border:1px solid #0d76bf;background:#119dff}.editor_controls .checkbox__box--checked:hover{background:#0d76bf}.editor_controls .checkbox__box--checked+.checkbox__label{color:#2a3f5f}.editor_controls .checkbox__check{color:#506784;font-size:12px;position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:#fff}.editor_controls .checkbox__label{padding-left:6px;font-size:13px;color:#506784;display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:1px solid #c8d4e3;padding:3px}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:12px;color:#506784;font-weight:600;font-size:12px;display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:3px}.editor_controls .colorpicker__custom-input input{border:1px solid #c8d4e3!important;box-shadow:none!important;background-color:#fff;color:#2a3f5f}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:3px 0}.editor_controls .colorpicker__controls .colorpicker__active{height:24px;width:24px;margin:3px 0 0 12px}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:3px;border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - 12px - 12px)}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:6px;text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:#a2b1c6;background-color:#fff!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:#fff}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:#119dff}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:#506784}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:#fff;border:1px solid #c8d4e3;box-shadow:none!important;color:#506784}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#506784}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:#c8d4e3 transparent transparent}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:1px solid #c8d4e3;border-top-color:#c8d4e3;background-color:transparent;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;color:#666;cursor:pointer;display:block;padding:8px 10px;color:#506784;background-color:#fff}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:#2a3f5f;font-weight:600;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:#f3f6fa;color:#2a3f5f}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:6px}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:#fff!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:#a2b1c6}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent #119dff!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:#119dff!important}.editor_controls .dropdown-container .Select-option:hover{color:#2a3f5f;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-value-label{color:#506784!important}.editor_controls .dropdown-container .Select-placeholder{color:#a2b1c6}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:#506784}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:#c8d4e3}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:#dfe8f3}.editor_controls ::-webkit-input-placeholder{color:#a2b1c6}.editor_controls ::-moz-placeholder{color:#a2b1c6}.editor_controls :-ms-input-placeholder{color:#a2b1c6}.editor_controls :-moz-placeholder{color:#a2b1c6}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:#506784}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:6px;margin-right:12px;vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:#f3f6fa;border:1px solid #c8d4e3;border-radius:1px;line-height:12px;text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:#506784!important}.editor_controls .text-input{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:1.2;display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:6px 12px;background-color:#fff;border:1px solid #c8d4e3;display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:12px}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:#f3f6fa;color:#2a3f5f}.editor_controls .radio-block__option--active{background-color:#119dff;color:#fff;border:1px solid #0d76bf;margin-left:-1px;cursor:default;text-shadow:0 1px 2px rgba(42,63,95,.7);font-weight:600}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:1px solid #0d76bf!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:3px;border-bottom-right-radius:3px;border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:1px solid #c8d4e3}.editor_controls .text-editor{overflow:hidden;border:1px solid #c8d4e3;border-radius:5px;min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:1px solid #c8d4e3}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:6px;resize:none;line-height:24px;font-size:13px;color:#506784;background-color:#fff}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:#506784;display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:1px solid #c8d4e3;width:100%;display:block;color:#506784}.editor_controls .multi-format-editor__tab.selected{background:#f3f6fa;font-weight:600}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:#2a3f5f;background-color:#f3f6fa}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:#f3f6fa;display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:#2a3f5f;margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:12px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:12px;width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid #dfe8f3;-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:600;color:#506784}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:#506784}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:#506784;display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:#f3f6fa;font-size:14px;padding:10px 0;-ms-user-select:none;user-select:none;border-bottom:1px solid #c8d4e3}.editor_controls .rich-text-editor__controls .icon-link{transform:translateY(3px);display:inline-block;fill:#506784;width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:#f3f6fa;border:1px solid #c8d4e3;padding:12px;position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:1px solid #c8d4e3;color:#506784;overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:#506784;cursor:pointer;display:inline-block;margin:0;min-height:24px;min-width:24px;text-align:center;background-color:transparent;border:1px solid #c8d4e3;border-radius:3px;line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 6px}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:#119dff;border:1px solid #0d76bf;color:#fff}.editor_controls .rich-text-editor__styleButton--active:hover:before{transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:#119dff;will-change:transform;transform-origin:center center;transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:#2a3f5f;background-color:#fff}.editor_controls .rich-text-editor__styleButton:hover:before{transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:6px}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 6px;min-width:60px;position:relative;background:#f3f6fa;touch-action:none;border:1px solid #c8d4e3;flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid #c8d4e3;cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:#119dff;border:1px solid #119dff;border-radius:10px;transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:#119dff;display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:6px}.editor_controls .trace-grid{display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:1px solid #dfe8f3;height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{-ms-grid-column-span:2;grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(90px)[2];grid-template-columns:repeat(2,90px);-ms-grid-rows:(112px)[2];grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 12px 12px}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:600;color:#506784;text-align:left;display:flex;align-items:center;justify-content:flex-start;border-top:1px solid #dfe8f3;width:100%;padding:12px 24px 0;box-sizing:border-box}.editor_controls .trace-item{width:90px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-grow:0;margin-top:12px;color:#506784;transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:#119dff;border-width:2px;color:#119dff}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:6px;justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{transform:translateX(-10px);opacity:0;pointer-events:none;color:#a2b1c6;transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:6px}.editor_controls .trace-item__actions__item:hover{color:#119dff}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:#119dff}.editor_controls .trace-item:hover .trace-item__label{color:#119dff}.editor_controls .trace-item:hover .trace-item__image{border-color:#119dff}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid #c8d4e3;width:60px;height:60px;border-radius:5px;background:#fff;box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:6px}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:#506784}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:600;width:72px;height:34px;margin-top:6px;color:#506784;text-transform:capitalize;font-size:12px;text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:#a2b1c6}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:1px solid #c8d4e3;width:100%;height:36px;border-radius:5px;padding:0 6px}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:#a2b1c6}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:6px}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed #c8d4e3;height:160px;box-sizing:border-box;padding:8px;border-radius:5px}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:#f8f8f9;border-radius:5px;display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:#119dff}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{transform:translateZ(0);backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all .18s ease-in-out 0s;position:absolute;box-sizing:border-box;z-index:10;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:13px;font-weight:400;text-transform:none;padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file diff --git a/lib/react-chart-editor.min.css b/lib/react-chart-editor.min.css new file mode 100644 index 000000000..3f75e9764 --- /dev/null +++ b/lib/react-chart-editor.min.css @@ -0,0 +1 @@ +.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:var(--color-text-active)}@-webkit-keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@-webkit-keyframes c{0%{opacity:1}to{opacity:0}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;-webkit-animation:d .1s forwards cubic-bezier(.19,1,.22,1);animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;-webkit-animation:c .1s forwards cubic-bezier(.19,1,.22,1);animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px);-webkit-animation:a .1s forwards cubic-bezier(.19,1,.22,1);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;-webkit-transform:none;transform:none;-webkit-animation:b .1s forwards cubic-bezier(.19,1,.22,1);animation:b .1s forwards cubic-bezier(.19,1,.22,1)}:root{--env:$ENV}.plotly-editor--theme-provider{--color-white:#fff;--color-rhino-core:#2a3f5f;--color-rhino-dark:#506784;--color-rhino-medium-1:#a2b1c6;--color-rhino-medium-2:#c8d4e3;--color-rhino-light-1:#dfe8f3;--color-rhino-light-2:#ebf0f8;--color-rhino-light-3:#f3f6fa;--color-rhino-light-4:#fafbfd;--color-rhino-light-5:#f8f8f9;--color-dodger:#119dff;--color-dodger-shade:#0d76bf;--color-dodger-shade-mid:#0d76bf;--color-aqua:#09ffff;--color-aqua-shade:#19d3f3;--color-lavender:#e763fa;--color-lavender-shade:#ab63fa;--color-lavender-shade-mid:#934bde;--color-cornflower:#636efa;--color-emerald:#00cc96;--color-sienna:#ef553b;--color-accent:var(--color-dodger);--color-accent-shade:var(--color-dodger-shade);--color-accent-shade-mid:var(--color-dodger-shade-mid);--color-brand:var(--color-dodger);--color-hightlight-darker:var(--color-gray-blue-pale);--color-text-base:var(--color-rhino-dark);--color-text-light:var(--color-rhino-medium-1);--color-text-dark:var(--color-rhino-core);--color-text-headings:var(--color-text-dark);--color-text-section-header:var(--color-text-dark);--color-text-active:var(--color-rhino-core);--color-text-placeholder:var(--color-rhino-medium-1);--color-border-default:var(--color-rhino-medium-2);--color-border-light:var(--color-rhino-light-1);--color-border-dark:var(--color-rhino-medium-1);--color-border-accent:var(--color-accent);--color-border-accent-shade:var(--color-accent-shade);--color-background:var(--color-rhino-light-2);--color-background-base:var(--color-rhino-light-2);--color-background-light:var(--color-rhino-light-3);--color-background-medium:var(--color-rhino-light-1);--color-background-dark:var(--color-rhino-medium-1);--color-background-top:var(--color-white);--color-background-inverse:var(--color-rhino-dark);--color-background-inputs:var(--color-background-top);--color-button-primary-base-fill:var(--color-accent);--color-button-primary-base-border:var(--color-accent-shade);--color-button-primary-base-text:var(--color-white);--color-button-primary-hover-fill:var(--color-accent-shade-mid);--color-button-primary-hover-border:var(--color-accent-shade);--color-button-primary-hover-text:var(--color-white);--color-button-primary-active-fill:var(--color-accent-shade);--color-button-primary-active-border:var(--color-accent-shade);--color-button-primary-active-text:var(--color-white);--color-button-secondary-base-fill:transparent;--color-button-secondary-base-border:var(--color-rhino-medium-2);--color-button-secondary-base-text:var(--color-text-base);--color-button-secondary-hover-fill:transparent;--color-button-secondary-hover-border:var(--color-rhino-medium-1);--color-button-secondary-hover-text:var(--color-text-dark);--color-button-secondary-active-fill:transparent;--color-button-secondary-active-border:var(--color-rhino-medium-1);--color-button-secondary-active-text:var(--color-text-dark);--color-button-tertiary-base-fill:transparent;--color-button-tertiary-base-border:transparent;--color-button-tertiary-base-text:var(--color-text-base);--color-button-tertiary-hover-fill:transparent;--color-button-tertiary-hover-border:transparent;--color-button-tertiary-hover-text:var(--color-text-dark);--color-button-tertiary-active-fill:transparent;--color-button-tertiary-active-border:transparent;--color-button-tertiary-active-text:var(--color-text-dark);--color-button-default-base-fill:var(--color-background-light);--color-button-default-base-border:var(--color-border-default);--color-button-default-base-text:var(--color-text-base);--color-button-default-hover-fill:var(--color-background-base);--color-button-default-hover-border:var(--color-border-dark);--color-button-default-hover-text:var(--color-text-dark);--color-button-default-active-fill:var(--color-background-dark);--color-button-default-active-border:var(--color-border-dark);--color-button-default-active-text:var(--color-text-dark);--color-button-upgrade-base-fill:var(--color-lavender-shade);--color-button-upgrade-base-border:var(--color-lavender-shade-dark);--color-button-upgrade-base-text:var(--color-white);--color-button-upgrade-hover-fill:var(--color-lavender-shade-mid);--color-button-upgrade-hover-border:var(--color-lavender-shade-dark);--color-button-upgrade-hover-text:var(--color-white);--color-button-upgrade-active-fill:var(--color-lavender-shade-dark);--color-button-upgrade-active-border:var(--color-lavender-shade-dark);--color-button-upgrade-active-text:var(--color-white);--color-button-header-base-fill:transparent;--color-button-header-base-border:var(--color-dodger);--color-button-header-base-text:var(--color-dodger);--color-button-header-hover-fill:transparent;--color-button-header-hover-border:var(--color-dodger-shade-mid);--color-button-header-hover-text:var(--color-dodger-shade);--color-button-header-active-fill:transparent;--color-button-header-active-border:var(--color-dodger-shade);--color-button-header-active-text:var(--color-dodger-shade);--spacing-base-unit:24px;--spacing-half-unit:12px;--spacing-quarter-unit:6px;--spacing-sixth-unit:4px;--spacing-eighth-unit:3px;--font-size-base:13px;--font-size-small:12px;--font-size-medium:14px;--font-size-large:14px;--font-size-heading-base:24px;--font-size-heading-small:18px;--font-size-heading-large:28px;--font-size-h5:16px;--font-weight-light:400;--font-weight-normal:500;--font-weight-semibold:600;--font-weight-bold:700;--font-leading-body:1.6;--font-leading-head:1.2;--font-letter-spacing-headings:0.5px;--font-family-body:"Open Sans",--apple-default,sans-serif;--font-family-headings:"Dosis","Arial",sans-serif;--border-default:1px solid var(--color-border-default);--border-light:1px solid var(--color-border-light);--border-dark:1px solid var(--color-border-dark);--border-accent:1px solid var(--color-border-accent);--border-accent-shade:1px solid var(--color-border-accent-shade);--border-radius:5px;--border-radius-small:3px;--text-shadow-dark-color:rgba(42,63,95,.7);--text-shadow-dark-ui:0 1px 2px var(--text-shadow-dark-color);--text-shadow-dark-ui-inactive:0 1px 1px rgba(42,63,95,.4);--box-shadow-base-color:rgba(80,103,132,.2);--box-shadow-base:0px 2px 9px var(--box-shadow-base-color);--scrollbar-track-background:var(--color-background-base);--scrollbar-thumb-color:var(--color-accent);--panel-background:var(--color-background-base);--panel-width:335px;--fold-header-text-color-base:var(--color-white);--fold-header-text-color-closed:var(--color-white);--fold-header-background-base:var(--color-rhino-dark);--fold-header-background-closed:var(--color-rhino-core);--fold-header-border-color-closed:var(--color-rhino-core);--fold-header-border-color-base:var(--color-rhino-dark);--sidebar-background:var(--color-background-top);--sidebar-width:100px;--sidebar-group-background-base:var(--sidebar-background);--sidebar-item-background-base:var(--color-background-light);--sidebar-item-background-hover:var(--color-background-base);--sidebar-item-background-active:var(--color-background-medium);--editor-width:calc(var(--sidebar-width) + var(--panel-width) + 1px)}.editor_controls{position:relative;width:var(--editor-width);flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--font-family-body)}.editor_controls .sidebar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:100%;min-width:var(--sidebar-width);width:var(--sidebar-width);max-width:var(--sidebar-width);text-align:center;background:var(--sidebar-background);overflow-y:auto;overflow-x:hidden;float:left;border-right:var(--border-default);flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .sidebar__group{background-color:var(--sidebar-group-background-base);cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:var(--color-text-base);font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);padding:var(--spacing-half-unit) 0;text-transform:capitalize;text-align:left;border-bottom:var(--border-light);display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:var(--spacing-base-unit)}.editor_controls .sidebar__group__title__icon{position:absolute;-webkit-transform:scale(.9) translateX(2px) translateY(-4px);transform:scale(.9) translateX(2px) translateY(-4px);-webkit-transform-origin:center center;transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:var(--color-text-active);cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:var(--font-weight-semibold);color:var(--color-text-active)}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:var(--color-accent)}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{-webkit-transform:scale(.9) translateY(-5px) rotate(90deg);transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:var(--box-shadow-base)}.editor_controls .sidebar__item{color:var(--color-text-base);cursor:pointer;font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);line-height:var(--font-size-medium);text-transform:capitalize;background-color:var(--sidebar-item-background-base);padding:10px;padding-left:18px;padding-right:var(--spacing-quarter-unit);text-align:left;border-bottom:var(--border-light);position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:var(--color-accent);-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:left center;transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:var(--sidebar-item-background-hover)}.editor_controls .sidebar__item--is-active{color:var(--color-text-active);font-weight:var(--font-weight-semibold);cursor:default}.editor_controls .sidebar__item--is-active:before{-webkit-transform:none;transform:none}.editor_controls .sidebar__item--is-active span{-webkit-transform:translateX(5px);transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:var(--spacing-half-unit);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls__wrapper>.panel{background-color:var(--panel-background);border-right:var(--border-default);width:calc(var(--panel-width))}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:var(--spacing-half-unit);display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:var(--font-size-medium);float:left;color:var(--color-text-base);display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:var(--color-text-light);padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:var(--panel-width);border-right:var(--border-default);height:100%;padding:var(--spacing-half-unit);background-color:var(--panel-background);box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:calc(var(--spacing-base-unit) * 2);margin-bottom:var(--spacing-half-unit);opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:var(--color-text-light)}.editor_controls .panel__empty__message__heading{color:var(--color-text-headings);font-size:var(--font-size-heading-base);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings)}.editor_controls .panel__empty__message__content{font-size:var(--font-size-base);color:var(--color-text-base);line-height:var(--font-leading-body)}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-bottom:var(--spacing-half-unit)}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);color:var(--fold-header-text-color-closed);font-size:var(--font-size-base);border:1px solid var(--fold-header-border-color-closed);background-color:var(--fold-header-background-closed);height:15px;border-radius:var(--border-radius);text-shadow:var(--text-shadow-dark-ui);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out}.editor_controls .fold__top:hover{cursor:pointer;background-color:var(--fold-header-background-closed)}.editor_controls .fold__top svg{width:18px;height:18px;display:block;-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:var(--fold-header-text-color-base);background-color:var(--fold-header-background-base);border:1px solid var(--fold-header-border-color-base);border-radius:var(--border-radius) var(--border-radius) 0 0;text-shadow:var(--text-shadow-dark-ui-inactive)}.editor_controls .fold__top--open svg{-webkit-filter:drop-shadow(0 1px 1px rgba(42,63,95,.4));filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:var(--fold-header-background-base)}.editor_controls .fold__top__icon{display:block;margin-right:var(--spacing-quarter-unit);-webkit-transform:translateY(-1px);transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:var(--spacing-half-unit)/3;font-size:var(--font-size-medium);line-height:var(--font-size-medium);font-weight:var(--font-weight-semibold);-webkit-transform:translateY(1px);transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{-webkit-transform:translateX(-3px) translateY(-1px);transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:-webkit-transform .1s ease-in-out;transition:transform .1s ease-in-out;transition:transform .1s ease-in-out,-webkit-transform .1s ease-in-out;-webkit-transform:rotate(-90deg);transform:rotate(-90deg);font-weight:700;-webkit-transform-origin:center center;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;-webkit-transform:translateY(-2px);transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:var(--color-background-top);border:var(--border-default);border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:var(--font-family-headings);display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:var(--color-dodger);display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:var(--color-text-base)}.editor_controls .fold__content__empty__message__secondary{font-family:var(--font-family-body);font-size:var(--font-size-small);text-align:center;color:var(--color-text-base)}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:var(--font-size-base);color:var(--color-text-section-header);font-weight:var(--font-weight-semibold);cursor:default;background-color:var(--color-background-light);padding:var(--spacing-quarter-unit) var(--spacing-half-unit);clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:var(--border-light)}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:var(--spacing-quarter-unit);width:100%}.editor_controls .menupanel__label{font-weight:var(--font-weight-semibold);padding-right:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:var(--color-text-light)!important;padding-left:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:var(--color-accent)!important}.editor_controls .menupanel__icon-span{font-size:var(--font-size-small);display:flex}.editor_controls .menupanel__icon-span--question{color:var(--color-text-base)}.editor_controls .info__title{color:var(--color-text-headings);font-size:var(--font-size-heading-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings);padding:var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit)}.editor_controls .info__text{padding:var(--spacing-quarter-unit) var(--spacing-half-unit)}.editor_controls .info__sub-text,.editor_controls .info__text{color:var(--color-text-base);font-size:var(--font-size-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-body)}.editor_controls .info__sub-text{font-style:italic;padding:var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .modalbox{position:absolute;border-radius:var(--border-radius);overflow:hidden;text-transform:none;text-align:left;border:var(--border-default);align-content:center;box-shadow:var(--box-shadow-base);left:calc(var(--spacing-quarter-unit) * -1);width:calc(100% + var(--spacing-half-unit));top:calc(100% + var(--spacing-quarter-unit));background-color:var(--color-background-top);z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:var(--color-background-inverse)}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:var(--color-background-dark);position:fixed}.editor_controls .modal__card{background:var(--color-background-top);border-radius:var(--border-radius);position:relative;z-index:1003;max-width:calc(100% - var(--spacing-base-unit));box-shadow:var(--box-shadow-base);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:.1s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:var(--color-text-base);padding:var(--spacing-half-unit);font-weight:var(--font-weight-semibold)}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:var(--color-background-light);border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:var(--spacing-quarter-unit);color:var(--color-text-base);font-size:var(--font-size-base);background:var(--color-background-medium);border:var(--border-default);border-bottom:0;position:relative;background:var(--color-background-light);transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:var(--color-background-medium);margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:var(--spacing-half-unit) var(--spacing-half-unit) 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:var(--border-radius)}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:var(--border-radius);border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:var(--color-background-base);cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:var(--color-background-base);pointer-events:none;margin-top:0;color:var(--color-text-active);border-top-color:var(--color-accent);border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:var(--color-background-base);left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:var(--border-default);display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:var(--border-light);color:var(--color-text-base);display:flex;font-size:var(--font-size-base);font-weight:var(--font-weight-normal);justify-content:flex-start;line-height:var(--font-size-base);min-height:32px;padding:var(--spacing-quarter-unit) 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 var(--spacing-half-unit);align-self:center;line-height:var(--font-leading-body)}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:var(--spacing-half-unit);padding-left:var(--spacing-half-unit);align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{align-self:center}.editor_controls .field__title{width:80px;padding-left:var(--spacing-half-unit);display:block;font-size:var(--font-size-small);line-height:var(--font-leading-body);color:var(--color-text-base);padding-top:var(--spacing-quarter-unit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:var(--spacing-quarter-unit);opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:var(--color-text-base)}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:var(--color-sienna)}.editor_controls .field .rect,.editor_controls .field .square{border-color:var(--color-accent)}.editor_controls .field .rect-grid{border-color:var(--panel-background)!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:var(--border-default);border-radius:var(--border-radius);width:80px;cursor:pointer;padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:var(--color-background-inverse)}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:var(--color-text-light);padding-top:var(--spacing-eighth-unit);width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:var(--border-default);padding:var(--spacing-half-unit);box-shadow:2px 2px var(--spacing-half-unit) var(--color-border-light);border-radius:var(--border-radius-small);left:var(--spacing-base-unit)}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:var(--color-border-default)}.editor_controls button{display:inline-block;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:var(--font-size-medium);font-weight:var(--font-weight-semibold);font-family:var(--font-family-body);border:1px solid transparent;border-radius:var(--border-radius);transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:var(--spacing-half-unit)}.editor_controls .button__icon{display:flex;padding-left:var(--spacing-quarter-unit);will-change:transform}.editor_controls .button__icon svg{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - var(--spacing-base-unit));margin-left:var(--spacing-half-unit);margin-right:var(--spacing-half-unit)}.editor_controls .button--no-text{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--no-text--disabled{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--default{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text)}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--primary{background-color:var(--color-button-primary-base-fill);border-color:var(--color-button-primary-base-border);color:var(--color-button-primary-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--primary svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:var(--color-button-primary-hover-fill);border:1px solid var(--color-button-primary-hover-border);color:var(--color-button-primary-hover-text)}.editor_controls .button--primary:active:not(.button--no-text--disabled){background-color:var(--color-button-primary-active-fill);border:1px solid var(--color-button-primary-active-border);color:var(--color-button-primary-active-text)}.editor_controls .button--secondary{background-color:var(--color-button-secondary-base-fill);border-color:var(--color-button-secondary-base-border);color:var(--color-button-secondary-base-text)}.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:var(--color-button-secondary-hover-fill);border:1px solid var(--color-button-secondary-hover-border);color:var(--color-button-secondary-hover-text)}.editor_controls .button--secondary:active:not(.button--no-text--disabled){background-color:var(--color-button-secondary-active-fill);border:1px solid var(--color-button-secondary-active-border);color:var(--color-button-secondary-active-text)}.editor_controls .button--tertiary{background-color:var(--color-button-tertiary-base-fill);border-color:var(--color-button-tertiary-base-border);color:var(--color-button-tertiary-base-text)}.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-hover-fill);border:1px solid var(--color-button-tertiary-hover-border);color:var(--color-button-tertiary-hover-text)}.editor_controls .button--tertiary:active:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-active-fill);border:1px solid var(--color-button-tertiary-active-border);color:var(--color-button-tertiary-active-text)}.editor_controls .button--upgrade{background-color:var(--color-button-upgrade-base-fill);border-color:var(--color-button-upgrade-base-border);color:var(--color-button-upgrade-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--upgrade svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-hover-fill);border:1px solid var(--color-button-upgrade-hover-border);color:var(--color-button-upgrade-hover-text)}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-active-fill);border:1px solid var(--color-button-upgrade-active-border);color:var(--color-button-upgrade-active-text)}.editor_controls .button--header{background-color:var(--color-button-header-base-fill);border-color:var(--color-button-header-base-border);color:var(--color-button-header-base-text)}.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:var(--color-button-header-hover-fill);border:1px solid var(--color-button-header-hover-border);color:var(--color-button-header-hover-text)}.editor_controls .button--header:active:not(.button--no-text--disabled){background-color:var(--color-button-header-active-fill);border:1px solid var(--color-button-header-active-border);color:var(--color-button-header-active-text)}.editor_controls .checkbox__group{padding-left:var(--spacing-half-unit);text-align:left}.editor_controls .checkbox__item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;padding-top:var(--spacing-eighth-unit);padding-bottom:var(--spacing-eighth-unit)}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:var(--color-background-light)}.editor_controls .checkbox__box--checked{border:var(--border-accent-shade);background:var(--color-accent)}.editor_controls .checkbox__box--checked:hover{background:var(--color-accent-shade)}.editor_controls .checkbox__box--checked+.checkbox__label{color:var(--color-text-active)}.editor_controls .checkbox__check{color:var(--color-text-base);font-size:var(--spacing-half-unit);position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:var(--color-white)}.editor_controls .checkbox__label{padding-left:var(--spacing-quarter-unit);font-size:var(--font-size-base);color:var(--color-text-base);display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:var(--border-default);padding:var(--spacing-eighth-unit)}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:var(--spacing-half-unit);color:var(--color-text-base);font-weight:var(--font-weight-semibold);font-size:var(--font-size-small);display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:var(--spacing-eighth-unit)}.editor_controls .colorpicker__custom-input input{border:var(--border-default)!important;box-shadow:none!important;background-color:var(--color-background-inputs);color:var(--color-text-dark)}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:var(--spacing-eighth-unit) 0}.editor_controls .colorpicker__controls .colorpicker__active{height:var(--spacing-base-unit);width:var(--spacing-base-unit);margin:var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit)}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--border-radius-small);border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit))}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:var(--spacing-quarter-unit);text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:var(--color-border-dark);background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:var(--color-border-accent)}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:var(--color-text-base)}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{background-color:#fff;border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:var(--color-background-inputs);border:var(--border-default);box-shadow:none!important;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{-webkit-animation:e .4s infinite linear;animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{-webkit-animation:d .2s;animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:var(--color-border-default) transparent transparent}@-webkit-keyframes d{0%{opacity:0}to{opacity:1}}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:var(--border-default);border-top-color:var(--color-border-default);background-color:transparent;box-shadow:var(--box-shadow-base)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;background-color:#fff;color:#666;cursor:pointer;display:block;padding:8px 10px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:var(--color-text-active);font-weight:var(--font-weight-semibold);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:var(--color-border-dark)}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-option:hover{color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-value-label{color:var(--color-text-base)!important}.editor_controls .dropdown-container .Select-placeholder{color:var(--color-text-placeholder)}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:var(--color-background-inverse)}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:var(--color-border-default)}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:var(--color-border-light)}.editor_controls ::-webkit-input-placeholder{color:var(--color-text-placeholder)}.editor_controls ::-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls :-ms-input-placeholder{color:var(--color-text-placeholder)}.editor_controls :-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:var(--color-text-base)}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:var(--spacing-quarter-unit);margin-right:var(--spacing-half-unit);vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:var(--color-background-light);border:var(--border-default);border-radius:1px;line-height:var(--spacing-half-unit);text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:var(--color-text-base)!important}.editor_controls .text-input{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:var(--font-leading-head);display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);background-color:var(--color-background-top);border:var(--border-default);display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:var(--font-size-small)}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .radio-block__option--active{background-color:var(--color-button-primary-base-fill);color:var(--color-button-primary-base-text);border:1px solid var(--color-button-primary-base-border);margin-left:-1px;cursor:default;text-shadow:var(--text-shadow-dark-ui);font-weight:var(--font-weight-semibold)}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:var(--border-accent-shade)!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:var(--border-radius-small);border-bottom-right-radius:var(--border-radius-small);border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:var(--border-radius-small);border-bottom-left-radius:var(--border-radius-small)}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:var(--border-default)}.editor_controls .text-editor{overflow:hidden;border:var(--border-default);border-radius:var(--border-radius);min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:var(--border-default)}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:var(--spacing-quarter-unit);resize:none;line-height:24px;font-size:13px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:var(--color-text-base);display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:var(--border-default)}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:var(--border-default)}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:var(--border-default);width:100%;display:block;color:var(--color-text-base)}.editor_controls .multi-format-editor__tab.selected{background:var(--color-background-light);font-weight:var(--font-weight-semibold)}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:var(--color-background-light);display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:var(--color-text-section-header);margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:var(--spacing-half-unit)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:var(--spacing-half-unit);width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid var(--color-border-light);-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:var(--font-weight-semibold);color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:var(--color-text-base);display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:var(--color-background-light);font-size:14px;padding:10px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:var(--border-default)}.editor_controls .rich-text-editor__controls .icon-link{-webkit-transform:translateY(3px);transform:translateY(3px);display:inline-block;fill:var(--color-text-base);width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:var(--color-background-light);border:var(--border-default);padding:var(--spacing-half-unit);position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:var(--border-default);color:var(--color-text-base);overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:var(--color-text-base);cursor:pointer;display:inline-block;margin:0;min-height:var(--spacing-base-unit);min-width:var(--spacing-base-unit);text-align:center;background-color:transparent;border:var(--border-default);border-radius:var(--border-radius-small);line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:var(--color-accent);border:var(--border-accent-shade);color:var(--color-white)}.editor_controls .rich-text-editor__styleButton--active:hover:before{-webkit-transform:scaleX(0);transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:var(--color-accent);will-change:transform;-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:scaleX(0);transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:var(--color-text-active);background-color:var(--color-background-top)}.editor_controls .rich-text-editor__styleButton:hover:before{-webkit-transform:none;transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 var(--spacing-quarter-unit);min-width:60px;position:relative;background:var(--color-background-light);touch-action:none;border:1px solid var(--color-border-default);flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid var(--color-border-default);cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:var(--color-accent);border:var(--border-accent);border-radius:10px;-webkit-transform:translateY(-1px);transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:var(--color-accent);display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:var(--spacing-quarter-unit)}.editor_controls .trace-grid{display:grid;grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:var(--border-light);height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(2,90px);grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:var(--font-weight-semibold);text-align:left;border-top:var(--border-light);width:100%;padding:var(--spacing-half-unit) var(--spacing-base-unit) 0;box-sizing:border-box}.editor_controls .trace-grid__column__header,.editor_controls .trace-item{color:var(--color-text-base);display:flex;align-items:center;justify-content:flex-start}.editor_controls .trace-item{width:90px;flex-direction:column;flex-grow:0;margin-top:var(--spacing-half-unit);transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:var(--color-accent);border-width:2px;color:var(--color-accent)}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:var(--spacing-quarter-unit);justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{-webkit-transform:translateX(-10px);transform:translateX(-10px);opacity:0;pointer-events:none;color:var(--color-text-light);transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .trace-item__actions__item:hover{color:var(--color-accent)}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__label{color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__image{border-color:var(--color-accent)}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid var(--color-border-default);width:60px;height:60px;border-radius:var(--border-radius);background:var(--color-background-top);box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:var(--spacing-quarter-unit)}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:var(--color-text-base)}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:var(--font-weight-semibold);width:72px;height:34px;margin-top:var(--spacing-quarter-unit);color:var(--color-text-base);text-transform:capitalize;font-size:var(--font-size-small);text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:var(--border-default);width:100%;height:36px;border-radius:var(--border-radius);padding:0 var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed var(--color-border-default);height:160px;box-sizing:border-box;padding:8px;border-radius:var(--border-radius)}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:var(--color-rhino-light-5);border-radius:var(--border-radius);display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:var(--color-dodger)}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);position:absolute;box-sizing:border-box;z-index:10;-webkit-transform-origin:top;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);text-transform:var(--microtip-text-transform,none);padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{-webkit-transform:translate3d(-50%,-5px,0);transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),-5px,0);transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),-5px,0);transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),-10px,0);transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{-webkit-transform:translate3d(calc(0% + -16px),-10px,0);transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;-webkit-transform:translate3d(10px,-50%,0);transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;-webkit-transform:translate3d(-10px,-50%,0);transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file diff --git a/lib/shame.js b/lib/shame.js new file mode 100644 index 000000000..6d63f79ca --- /dev/null +++ b/lib/shame.js @@ -0,0 +1,238 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shamefullyAdjustSizeref = exports.shamefullyDeleteRelatedAnalysisTransforms = exports.shamefullyCreateSplitStyleProps = exports.shamefullyAdjustSplitStyleTargetContainers = exports.shamefullyAddTableColumns = exports.shamefullyAdjustGeo = exports.shamefullyAdjustAxisRef = exports.shamefullyClearAxisTypes = undefined; + +var _axis_ids = require('plotly.js/src/plots/cartesian/axis_ids'); + +var _nested_property = require('plotly.js/src/lib/nested_property'); + +var _nested_property2 = _interopRequireDefault(_nested_property); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Temporary fix for: +// https://github.com/plotly/react-chart-editor/issues/103 +// We should be able to remove this once the plotly.react method has +// been integrated into react-plotly.js and released: +// https://github.com/plotly/react-plotly.js/issues/2 +/* + * DELETE THIS FILE. EVERYTHING NEEDS TO FIND A HOME. + */ +var shamefullyClearAxisTypes = exports.shamefullyClearAxisTypes = function shamefullyClearAxisTypes(graphDiv, _ref) { + var traceIndexes = _ref.traceIndexes, + update = _ref.update; + + if (!Array.isArray(graphDiv._fullData)) { + return; + } + var hasSrc = false; + for (var key in update) { + if (key.substr(key.length - 3) === 'src') { + hasSrc = true; + } + } + if (hasSrc) { + clearAxisTypes(graphDiv, traceIndexes); + } +}; + +var axLetters = ['x', 'y', 'z']; +function clearAxisTypes(gd, traces) { + for (var i = 0; i < traces.length; i++) { + var trace = gd._fullData[i]; + for (var j = 0; j < 3; j++) { + var type = axLetters[j]; + var ax = (0, _axis_ids.getFromId)(gd, trace[type + 'axis'] || type); + + // Do not clear log type. + // Log type is never an auto result so must have been intentional. + // We are also skipping clearing 3D which could cause bugs with 3D. + if (ax && ax.type !== 'log') { + var axAttr = ax._name; + var typeAttr = axAttr + '.type'; + (0, _nested_property2.default)(gd.layout, typeAttr).set(null); + } + } + } +} + +var shamefullyAdjustAxisRef = exports.shamefullyAdjustAxisRef = function shamefullyAdjustAxisRef(graphDiv, payload) { + if (payload.axesToBeGarbageCollected) { + payload.axesToBeGarbageCollected.forEach(function (a) { + var axis = a.charAt(0); + var axisIdNumber = Number(a.slice(1)); + + (0, _nested_property2.default)(graphDiv.layout, axis + 'axis' + (axisIdNumber || '')).set(null); + Object.keys(graphDiv.layout).filter(function (key) { + return key.startsWith(axis + 'axis'); + }).forEach(function (key) { + if ((0, _nested_property2.default)(graphDiv.layout, key + '.overlaying').get() === a) { + (0, _nested_property2.default)(graphDiv.layout, key + '.overlaying').set(null); + } + }); + }); + } + if (payload.subplotToBeGarbageCollected) { + (0, _nested_property2.default)(graphDiv.layout, payload.subplotToBeGarbageCollected).set(null); + } +}; + +var geoRegex = /^(geo\d*)\./; +var shamefullyAdjustGeo = exports.shamefullyAdjustGeo = function shamefullyAdjustGeo(_ref2, _ref3) { + var layout = _ref2.layout; + var update = _ref3.update; + + Object.keys(update).forEach(function (k) { + var geoMatch = geoRegex.exec(k); + if (geoMatch) { + var geo = geoMatch[1]; + if (update[geo + '.scope']) { + update[geo + '.projection'] = {}; + update[geo + '.center'] = {}; + } + + if ( + // requesting projection change + update[geo + '.projection.type'] && (update[geo + '.projection.type'] === 'albers usa' || layout[geo] && layout[geo].scope === 'usa')) { + update[geo + '.scope'] = {}; + update[geo + '.center'] = {}; + } + } + }); +}; + +var shamefullyAddTableColumns = exports.shamefullyAddTableColumns = function shamefullyAddTableColumns(graphDiv, _ref4) { + var traceIndexes = _ref4.traceIndexes, + update = _ref4.update; + + if (update['cells.values'] && (!graphDiv.data[traceIndexes[0]].header || !graphDiv.data[traceIndexes[0]].header.valuessrc)) { + update['header.values'] = update['cells.valuessrc']; + } else if (update['header.values'] === null) { + update['header.values'] = graphDiv.data[traceIndexes[0]].cells.valuessrc || null; + } else if (update['cells.values'] === null && !graphDiv.data[traceIndexes[0]].header.valuessrc) { + update['header.values'] = null; + } +}; + +var shamefullyAdjustSplitStyleTargetContainers = exports.shamefullyAdjustSplitStyleTargetContainers = function shamefullyAdjustSplitStyleTargetContainers(graphDiv, _ref5) { + var traceIndexes = _ref5.traceIndexes, + update = _ref5.update; + + for (var attr in update) { + if (attr && attr.startsWith('transforms') && attr.endsWith('groups')) { + var transformIndex = parseInt(attr.split('[')[1], 10); + var transform = graphDiv.data[traceIndexes[0]].transforms[transformIndex]; + + if (transform && transform.type === 'groupby' && transform.styles) { + // Create style containers for all groups + if (!transform.styles.length && update[attr]) { + (function () { + var dedupedGroups = []; + update[attr].forEach(function (group) { + if (!dedupedGroups.includes(group)) { + dedupedGroups.push(group); + } + }); + + var styles = dedupedGroups.map(function (groupEl) { + return { + target: groupEl, + value: {} + }; + }); + + update['transforms[' + transformIndex + '].styles'] = styles; + })(); + } + + // When clearing the data selector of groupby transforms, we want to clear + // all the styles we've added + if (transform.styles.length && !update[attr]) { + update['transforms[' + transformIndex + '].styles'] = []; + } + } + } + } +}; + +var shamefullyCreateSplitStyleProps = exports.shamefullyCreateSplitStyleProps = function shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup) { + if (!Array.isArray(splitTraceGroup)) { + splitTraceGroup = [splitTraceGroup]; // eslint-disable-line + } + + var indexOfSplitTransform = null; + + graphDiv.data[traceIndex].transforms.forEach(function (t, i) { + if (t.type === 'groupby') { + indexOfSplitTransform = i; + } + }); + + function getProp(group) { + var indexOfStyleObject = null; + + graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles.forEach(function (s, i) { + if (s.target.toString() === group) { + indexOfStyleObject = i; + } + }); + + var path = graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value; + + attr.split('.').forEach(function (p) { + if (!path[p]) { + path[p] = {}; + } + path = path[p]; + }); + + return (0, _nested_property2.default)(graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value, attr); + } + + return splitTraceGroup.map(function (g) { + return getProp(g); + }); +}; + +var shamefullyDeleteRelatedAnalysisTransforms = exports.shamefullyDeleteRelatedAnalysisTransforms = function shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload) { + var parentTraceDataIndex = payload.traceIndexes[0]; + var parentUid = graphDiv.data[parentTraceDataIndex].uid; + + if (parentUid) { + var relatedAnalysisTraceIndexes = []; + graphDiv.data.forEach(function (d, i) { + if (d.transforms && d.transforms.some(function (transform) { + return ['moving-average', 'fit'].includes(transform.type) && transform.inputUid === parentUid; + })) { + relatedAnalysisTraceIndexes.push(i); + } + }); + + if (relatedAnalysisTraceIndexes.length) { + relatedAnalysisTraceIndexes.forEach(function (i) { + graphDiv.data.splice(i, 1); + }); + } + } +}; + +var shamefullyAdjustSizeref = exports.shamefullyAdjustSizeref = function shamefullyAdjustSizeref(gd, _ref6) { + var update = _ref6.update; + var _update$markerSize = update['marker.size'], + size = _update$markerSize === undefined ? null : _update$markerSize, + _update$markerSizesr = update['marker.sizesrc'], + src = _update$markerSizesr === undefined ? null : _update$markerSizesr; + + if (size && src) { + var DEFAULT_MAX_AREA_PX = 45; + var scaleFactor = DEFAULT_MAX_AREA_PX * DEFAULT_MAX_AREA_PX; + update['marker.sizeref'] = size.reduce(function (a, b) { + return Math.max(a, b); + }) / scaleFactor; + update['marker.sizemode'] = 'area'; + } +}; +//# sourceMappingURL=shame.js.map \ No newline at end of file diff --git a/lib/shame.js.map b/lib/shame.js.map new file mode 100644 index 000000000..f3bca0b47 --- /dev/null +++ b/lib/shame.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/shame.js"],"names":["shamefullyClearAxisTypes","graphDiv","traceIndexes","update","Array","isArray","_fullData","hasSrc","key","substr","length","clearAxisTypes","axLetters","gd","traces","i","trace","j","type","ax","axAttr","_name","typeAttr","layout","set","shamefullyAdjustAxisRef","payload","axesToBeGarbageCollected","forEach","axis","a","charAt","axisIdNumber","Number","slice","Object","keys","filter","startsWith","get","subplotToBeGarbageCollected","geoRegex","shamefullyAdjustGeo","geoMatch","exec","k","geo","scope","shamefullyAddTableColumns","data","header","valuessrc","cells","shamefullyAdjustSplitStyleTargetContainers","attr","endsWith","transformIndex","parseInt","split","transform","transforms","styles","dedupedGroups","includes","group","push","map","target","groupEl","value","shamefullyCreateSplitStyleProps","traceIndex","splitTraceGroup","indexOfSplitTransform","t","getProp","indexOfStyleObject","s","toString","path","p","g","shamefullyDeleteRelatedAnalysisTransforms","parentTraceDataIndex","parentUid","uid","relatedAnalysisTraceIndexes","d","some","inputUid","splice","shamefullyAdjustSizeref","size","src","DEFAULT_MAX_AREA_PX","scaleFactor","reduce","b","Math","max"],"mappings":";;;;;;;AAGA;;AACA;;;;;;AAEA;AACA;AACA;AACA;AACA;AAVA;;;AAWO,IAAMA,8DAA2B,SAA3BA,wBAA2B,CAACC,QAAD,QAAsC;AAAA,MAA1BC,YAA0B,QAA1BA,YAA0B;AAAA,MAAZC,MAAY,QAAZA,MAAY;;AAC5E,MAAI,CAACC,MAAMC,OAAN,CAAcJ,SAASK,SAAvB,CAAL,EAAwC;AACtC;AACD;AACD,MAAIC,SAAS,KAAb;AACA,OAAK,IAAMC,GAAX,IAAkBL,MAAlB,EAA0B;AACxB,QAAIK,IAAIC,MAAJ,CAAWD,IAAIE,MAAJ,GAAa,CAAxB,MAA+B,KAAnC,EAA0C;AACxCH,eAAS,IAAT;AACD;AACF;AACD,MAAIA,MAAJ,EAAY;AACVI,mBAAeV,QAAf,EAAyBC,YAAzB;AACD;AACF,CAbM;;AAeP,IAAMU,YAAY,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAlB;AACA,SAASD,cAAT,CAAwBE,EAAxB,EAA4BC,MAA5B,EAAoC;AAClC,OAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAID,OAAOJ,MAA3B,EAAmCK,GAAnC,EAAwC;AACtC,QAAMC,QAAQH,GAAGP,SAAH,CAAaS,CAAb,CAAd;AACA,SAAK,IAAIE,IAAI,CAAb,EAAgBA,IAAI,CAApB,EAAuBA,GAAvB,EAA4B;AAC1B,UAAMC,OAAON,UAAUK,CAAV,CAAb;AACA,UAAME,KAAK,yBAAUN,EAAV,EAAcG,MAAME,OAAO,MAAb,KAAwBA,IAAtC,CAAX;;AAEA;AACA;AACA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,EAAiB;AACf,QAAMC,sBAAsB,EAA5B;AACA,QAAMC,cAAcD,sBAAsBA,mBAA1C;AACA3F,WAAO,gBAAP,IAA2ByF,KAAKI,MAAL,CAAY,UAAClE,CAAD,EAAImE,CAAJ;AAAA,aAAUC,KAAKC,GAAL,CAASrE,CAAT,EAAYmE,CAAZ,CAAV;AAAA,KAAZ,IAAwCF,WAAnE;AACA5F,WAAO,iBAAP,IAA4B,MAA5B;AACD;AACF,CARM","file":"shame.js","sourcesContent":["/*\n * DELETE THIS FILE. EVERYTHING NEEDS TO FIND A HOME.\n */\nimport {getFromId} from 'plotly.js/src/plots/cartesian/axis_ids';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\n\n// Temporary fix for:\n// https://github.com/plotly/react-chart-editor/issues/103\n// We should be able to remove this once the plotly.react method has\n// been integrated into react-plotly.js and released:\n// https://github.com/plotly/react-plotly.js/issues/2\nexport const shamefullyClearAxisTypes = (graphDiv, {traceIndexes, update}) => {\n if (!Array.isArray(graphDiv._fullData)) {\n return;\n }\n let hasSrc = false;\n for (const key in update) {\n if (key.substr(key.length - 3) === 'src') {\n hasSrc = true;\n }\n }\n if (hasSrc) {\n clearAxisTypes(graphDiv, traceIndexes);\n }\n};\n\nconst axLetters = ['x', 'y', 'z'];\nfunction clearAxisTypes(gd, traces) {\n for (let i = 0; i < traces.length; i++) {\n const trace = gd._fullData[i];\n for (let j = 0; j < 3; j++) {\n const type = axLetters[j];\n const ax = getFromId(gd, trace[type + 'axis'] || type);\n\n // Do not clear log type.\n // Log type is never an auto result so must have been intentional.\n // We are also skipping clearing 3D which could cause bugs with 3D.\n if (ax && ax.type !== 'log') {\n const axAttr = ax._name;\n const typeAttr = axAttr + '.type';\n nestedProperty(gd.layout, typeAttr).set(null);\n }\n }\n }\n}\n\nexport const shamefullyAdjustAxisRef = (graphDiv, payload) => {\n if (payload.axesToBeGarbageCollected) {\n payload.axesToBeGarbageCollected.forEach(a => {\n const axis = a.charAt(0);\n const axisIdNumber = Number(a.slice(1));\n\n nestedProperty(graphDiv.layout, `${axis}axis${axisIdNumber || ''}`).set(null);\n Object.keys(graphDiv.layout)\n .filter(key => key.startsWith(axis + 'axis'))\n .forEach(key => {\n if (nestedProperty(graphDiv.layout, `${key}.overlaying`).get() === a) {\n nestedProperty(graphDiv.layout, `${key}.overlaying`).set(null);\n }\n });\n });\n }\n if (payload.subplotToBeGarbageCollected) {\n nestedProperty(graphDiv.layout, payload.subplotToBeGarbageCollected).set(null);\n }\n};\n\nconst geoRegex = /^(geo\\d*)\\./;\nexport const shamefullyAdjustGeo = ({layout}, {update}) => {\n Object.keys(update).forEach(k => {\n const geoMatch = geoRegex.exec(k);\n if (geoMatch) {\n const geo = geoMatch[1];\n if (update[geo + '.scope']) {\n update[geo + '.projection'] = {};\n update[geo + '.center'] = {};\n }\n\n if (\n // requesting projection change\n update[geo + '.projection.type'] &&\n (update[geo + '.projection.type'] === 'albers usa' ||\n (layout[geo] && layout[geo].scope === 'usa'))\n ) {\n update[geo + '.scope'] = {};\n update[geo + '.center'] = {};\n }\n }\n });\n};\n\nexport const shamefullyAddTableColumns = (graphDiv, {traceIndexes, update}) => {\n if (\n update['cells.values'] &&\n (!graphDiv.data[traceIndexes[0]].header || !graphDiv.data[traceIndexes[0]].header.valuessrc)\n ) {\n update['header.values'] = update['cells.valuessrc'];\n } else if (update['header.values'] === null) {\n update['header.values'] = graphDiv.data[traceIndexes[0]].cells.valuessrc || null;\n } else if (update['cells.values'] === null && !graphDiv.data[traceIndexes[0]].header.valuessrc) {\n update['header.values'] = null;\n }\n};\n\nexport const shamefullyAdjustSplitStyleTargetContainers = (graphDiv, {traceIndexes, update}) => {\n for (const attr in update) {\n if (attr && attr.startsWith('transforms') && attr.endsWith('groups')) {\n const transformIndex = parseInt(attr.split('[')[1], 10);\n const transform = graphDiv.data[traceIndexes[0]].transforms[transformIndex];\n\n if (transform && transform.type === 'groupby' && transform.styles) {\n // Create style containers for all groups\n if (!transform.styles.length && update[attr]) {\n const dedupedGroups = [];\n update[attr].forEach(group => {\n if (!dedupedGroups.includes(group)) {\n dedupedGroups.push(group);\n }\n });\n\n const styles = dedupedGroups.map(groupEl => ({\n target: groupEl,\n value: {},\n }));\n\n update[`transforms[${transformIndex}].styles`] = styles;\n }\n\n // When clearing the data selector of groupby transforms, we want to clear\n // all the styles we've added\n if (transform.styles.length && !update[attr]) {\n update[`transforms[${transformIndex}].styles`] = [];\n }\n }\n }\n }\n};\n\nexport const shamefullyCreateSplitStyleProps = (graphDiv, attr, traceIndex, splitTraceGroup) => {\n if (!Array.isArray(splitTraceGroup)) {\n splitTraceGroup = [splitTraceGroup]; // eslint-disable-line\n }\n\n let indexOfSplitTransform = null;\n\n graphDiv.data[traceIndex].transforms.forEach((t, i) => {\n if (t.type === 'groupby') {\n indexOfSplitTransform = i;\n }\n });\n\n function getProp(group) {\n let indexOfStyleObject = null;\n\n graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles.forEach((s, i) => {\n if (s.target.toString() === group) {\n indexOfStyleObject = i;\n }\n });\n\n let path =\n graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value;\n\n attr.split('.').forEach(p => {\n if (!path[p]) {\n path[p] = {};\n }\n path = path[p];\n });\n\n return nestedProperty(\n graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value,\n attr\n );\n }\n\n return splitTraceGroup.map(g => getProp(g));\n};\n\nexport const shamefullyDeleteRelatedAnalysisTransforms = (graphDiv, payload) => {\n const parentTraceDataIndex = payload.traceIndexes[0];\n const parentUid = graphDiv.data[parentTraceDataIndex].uid;\n\n if (parentUid) {\n const relatedAnalysisTraceIndexes = [];\n graphDiv.data.forEach((d, i) => {\n if (\n d.transforms &&\n d.transforms.some(\n transform =>\n ['moving-average', 'fit'].includes(transform.type) && transform.inputUid === parentUid\n )\n ) {\n relatedAnalysisTraceIndexes.push(i);\n }\n });\n\n if (relatedAnalysisTraceIndexes.length) {\n relatedAnalysisTraceIndexes.forEach(i => {\n graphDiv.data.splice(i, 1);\n });\n }\n }\n};\n\nexport const shamefullyAdjustSizeref = (gd, {update}) => {\n const {'marker.size': size = null, 'marker.sizesrc': src = null} = update;\n if (size && src) {\n const DEFAULT_MAX_AREA_PX = 45;\n const scaleFactor = DEFAULT_MAX_AREA_PX * DEFAULT_MAX_AREA_PX;\n update['marker.sizeref'] = size.reduce((a, b) => Math.max(a, b)) / scaleFactor;\n update['marker.sizemode'] = 'area';\n }\n};\n"]} \ No newline at end of file diff --git a/package.json b/package.json index 90ad35516..017e3655f 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "widgets" ], "license": "MIT", - "main": "src/index.js", + "main": "lib/index.js", "repository": { "type": "git", "url": "https://github.com/plotly/react-chart-editor.git" diff --git a/react-chart-editor.iml b/react-chart-editor.iml new file mode 100644 index 000000000..f9f4fe06b --- /dev/null +++ b/react-chart-editor.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file From eafc0c2205f8da29151d892af5bd0b9300ca0052 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 02:12:51 +0900 Subject: [PATCH 12/69] add index.js --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a29cbca25..61679f9d2 100644 --- a/src/index.js +++ b/src/index.js @@ -19,7 +19,7 @@ import { localizeString, walkObject, } from './lib'; -import {EDITOR_ACTIONS} from './lib/constants'; +import {EDITOR_ACTIONS, TRANSFORMABLE_TRACES} from './lib/constants'; import { EditorControlsContext, PanelMenuWrapperContext, @@ -86,6 +86,7 @@ import { TraceSelector, RectanglePositioner, } from './components'; +import {traceHasColorbar} from './default_panels/StyleColorbarsPanel'; import { GraphCreatePanel, @@ -191,6 +192,8 @@ export { ModalProviderContext, PlotlyFoldContext, PlotlyPanelContext, + traceHasColorbar, + TRANSFORMABLE_TRACES, }; export default PlotlyEditor; From 3df797c1b698a14e2bb8178bf921f2628d8e87a8 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 02:16:05 +0900 Subject: [PATCH 13/69] Remake --- lib/index.js | 6 +++++- lib/index.js.map | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index fb8742dc8..3d2a22e5d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.PlotlyPanelContext = exports.PlotlyFoldContext = exports.ModalProviderContext = exports.PanelMenuWrapperContext = exports.EditorControlsContext = exports.RectanglePositioner = exports.DefaultEditor = exports.EditorControls = exports.walkObject = exports.localizeString = exports.localize = exports.dereference = exports.connectTraceToPlot = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.TraceSelector = exports.TraceRequiredPanel = exports.TraceMarkerSection = exports.TraceAccordion = exports.TextEditor = exports.SymbolSelector = exports.StyleTracesPanel = exports.StyleImagesPanel = exports.StyleShapesPanel = exports.StyleNotesPanel = exports.StyleLegendPanel = exports.StyleLayoutPanel = exports.StyleColorbarsPanel = exports.StyleAxesPanel = exports.GraphTransformsPanel = exports.SingleSidebarItem = exports.Section = exports.PlotlySection = exports.Radio = exports.PanelMenuWrapper = exports.PanelEmpty = exports.Panel = exports.PlotlyPanel = exports.Text = exports.AxisRangeValue = exports.Numeric = exports.LineShapeSelector = exports.LineDashSelector = exports.LayoutSection = exports.LayoutPanel = exports.NumericFractionInverse = exports.PositioningNumeric = exports.NumericFraction = exports.Info = exports.GraphCreatePanel = exports.FontSelector = exports.Fold = exports.PlotlyFold = exports.Flaglist = exports.RangesliderVisible = exports.EDITOR_ACTIONS = exports.Dropzone = exports.Dropdown = exports.DataSelector = exports.ErrorBars = exports.ContourNumeric = exports.PieColorscalePicker = exports.ColorscalePicker = exports.ColorwayPicker = exports.PanelMessage = exports.ColorPicker = exports.Button = exports.AxesSelector = exports.DTicks = exports.NTicks = exports.AxesRange = exports.AxesFold = exports.TransformAccordion = exports.ArrowSelector = exports.PositioningRef = exports.AnnotationRef = exports.AnnotationArrowRef = exports.RangeSelectorAccordion = exports.ImageAccordion = exports.ShapeAccordion = exports.AnnotationAccordion = undefined; +exports.TRANSFORMABLE_TRACES = exports.traceHasColorbar = exports.PlotlyPanelContext = exports.PlotlyFoldContext = exports.ModalProviderContext = exports.PanelMenuWrapperContext = exports.EditorControlsContext = exports.RectanglePositioner = exports.DefaultEditor = exports.EditorControls = exports.walkObject = exports.localizeString = exports.localize = exports.dereference = exports.connectTraceToPlot = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.TraceSelector = exports.TraceRequiredPanel = exports.TraceMarkerSection = exports.TraceAccordion = exports.TextEditor = exports.SymbolSelector = exports.StyleTracesPanel = exports.StyleImagesPanel = exports.StyleShapesPanel = exports.StyleNotesPanel = exports.StyleLegendPanel = exports.StyleLayoutPanel = exports.StyleColorbarsPanel = exports.StyleAxesPanel = exports.GraphTransformsPanel = exports.SingleSidebarItem = exports.Section = exports.PlotlySection = exports.Radio = exports.PanelMenuWrapper = exports.PanelEmpty = exports.Panel = exports.PlotlyPanel = exports.Text = exports.AxisRangeValue = exports.Numeric = exports.LineShapeSelector = exports.LineDashSelector = exports.LayoutSection = exports.LayoutPanel = exports.NumericFractionInverse = exports.PositioningNumeric = exports.NumericFraction = exports.Info = exports.GraphCreatePanel = exports.FontSelector = exports.Fold = exports.PlotlyFold = exports.Flaglist = exports.RangesliderVisible = exports.EDITOR_ACTIONS = exports.Dropzone = exports.Dropdown = exports.DataSelector = exports.ErrorBars = exports.ContourNumeric = exports.PieColorscalePicker = exports.ColorscalePicker = exports.ColorwayPicker = exports.PanelMessage = exports.ColorPicker = exports.Button = exports.AxesSelector = exports.DTicks = exports.NTicks = exports.AxesRange = exports.AxesFold = exports.TransformAccordion = exports.ArrowSelector = exports.PositioningRef = exports.AnnotationRef = exports.AnnotationArrowRef = exports.RangeSelectorAccordion = exports.ImageAccordion = exports.ShapeAccordion = exports.AnnotationAccordion = undefined; var _PlotlyEditor = require('./PlotlyEditor'); @@ -25,6 +25,8 @@ var _context = require('./context'); var _components = require('./components'); +var _StyleColorbarsPanel = require('./default_panels/StyleColorbarsPanel'); + var _default_panels = require('./default_panels'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -119,5 +121,7 @@ exports.PanelMenuWrapperContext = _context.PanelMenuWrapperContext; exports.ModalProviderContext = _context.ModalProviderContext; exports.PlotlyFoldContext = _context.PlotlyFoldContext; exports.PlotlyPanelContext = _context.PlotlyPanelContext; +exports.traceHasColorbar = _StyleColorbarsPanel.traceHasColorbar; +exports.TRANSFORMABLE_TRACES = _constants.TRANSFORMABLE_TRACES; exports.default = _PlotlyEditor2.default; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map index c73c80cb7..4d3330a85 100644 --- a/lib/index.js.map +++ b/lib/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/index.js"],"names":["AnnotationAccordion","ShapeAccordion","ImageAccordion","RangeSelectorAccordion","AnnotationArrowRef","AnnotationRef","PositioningRef","ArrowSelector","TransformAccordion","AxesFold","AxesRange","NTicks","DTicks","AxesSelector","Button","ColorPicker","PanelMessage","ColorwayPicker","ColorscalePicker","PieColorscalePicker","ContourNumeric","ErrorBars","DataSelector","Dropdown","Dropzone","EDITOR_ACTIONS","RangesliderVisible","Flaglist","PlotlyFold","Fold","FontSelector","GraphCreatePanel","Info","NumericFraction","PositioningNumeric","NumericFractionInverse","LayoutPanel","LayoutSection","LineDashSelector","LineShapeSelector","Numeric","AxisRangeValue","Text","PlotlyPanel","Panel","PanelEmpty","PanelMenuWrapper","Radio","PlotlySection","Section","SingleSidebarItem","GraphTransformsPanel","StyleAxesPanel","StyleColorbarsPanel","StyleLayoutPanel","StyleLegendPanel","StyleNotesPanel","StyleShapesPanel","StyleImagesPanel","StyleTracesPanel","SymbolSelector","TextEditor","TraceAccordion","TraceMarkerSection","TraceRequiredPanel","TraceSelector","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectImageToLayout","connectAxesToLayout","connectTransformToTrace","connectAggregationToTransform","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTraceToPlot","dereference","localize","localizeString","walkObject","EditorControls","DefaultEditor","RectanglePositioner","EditorControlsContext","PanelMenuWrapperContext","ModalProviderContext","PlotlyFoldContext","PlotlyPanelContext","PlotlyEditor"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AAkBA;;AACA;;AAQA;;AA2DA;;;;QAcEA,mB,GAAAA,+B;QACAC,c,GAAAA,0B;QACAC,c,GAAAA,0B;QACAC,sB,GAAAA,kC;QACAC,kB,GAAAA,8B;QACAC,a,GAAAA,yB;QACAC,c,GAAAA,0B;QACAC,a,GAAAA,yB;QACAC,kB,GAAAA,8B;QACAC,Q,GAAAA,oB;QACAC,S,GAAAA,qB;QACAC,M,GAAAA,kB;QACAC,M,GAAAA,kB;QACAC,Y,GAAAA,wB;QACAC,M,GAAAA,kB;QACAC,W,GAAAA,uB;QACAC,Y,GAAAA,wB;QACAC,c,GAAAA,0B;QACAC,gB,GAAAA,4B;QACAC,mB,GAAAA,+B;QACAC,c,GAAAA,0B;QACAC,S,GAAAA,qB;QACAC,Y,GAAAA,wB;QACAC,Q,GAAAA,oB;QACAC,Q,GAAAA,oB;QACAC,c,GAAAA,yB;QACAC,kB,GAAAA,8B;QAC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QACAC,kB,GAAAA,2B;kBAGaC,sB","file":"index.js","sourcesContent":["import PlotlyEditor from './PlotlyEditor';\nimport DefaultEditor from './DefaultEditor';\nimport EditorControls from './EditorControls';\nimport {\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectAggregationToTransform,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectLayoutToPlot,\n connectToContainer,\n connectTraceToPlot,\n connectRangeSelectorToAxis,\n dereference,\n localize,\n localizeString,\n walkObject,\n} from './lib';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport {\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n} from './context';\n\nimport {\n AnnotationAccordion,\n ShapeAccordion,\n RangeSelectorAccordion,\n ImageAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n AxesFold,\n AxesRange,\n TransformAccordion,\n NTicks,\n DTicks,\n AxesSelector,\n PanelMessage,\n Button,\n ColorPicker,\n ColorwayPicker,\n PieColorscalePicker,\n ColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n SymbolSelector,\n TextEditor,\n RangesliderVisible,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n RectanglePositioner,\n} from './components';\n\nimport {\n GraphCreatePanel,\n StyleAxesPanel,\n GraphTransformsPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n} from './default_panels';\n\nexport {\n AnnotationAccordion,\n ShapeAccordion,\n ImageAccordion,\n RangeSelectorAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n TransformAccordion,\n AxesFold,\n AxesRange,\n NTicks,\n DTicks,\n AxesSelector,\n Button,\n ColorPicker,\n PanelMessage,\n ColorwayPicker,\n ColorscalePicker,\n PieColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n EDITOR_ACTIONS,\n RangesliderVisible,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n GraphCreatePanel,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n GraphTransformsPanel,\n StyleAxesPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n SymbolSelector,\n TextEditor,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTraceToPlot,\n dereference,\n localize,\n localizeString,\n walkObject,\n EditorControls,\n DefaultEditor,\n RectanglePositioner,\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/index.js"],"names":["AnnotationAccordion","ShapeAccordion","ImageAccordion","RangeSelectorAccordion","AnnotationArrowRef","AnnotationRef","PositioningRef","ArrowSelector","TransformAccordion","AxesFold","AxesRange","NTicks","DTicks","AxesSelector","Button","ColorPicker","PanelMessage","ColorwayPicker","ColorscalePicker","PieColorscalePicker","ContourNumeric","ErrorBars","DataSelector","Dropdown","Dropzone","EDITOR_ACTIONS","RangesliderVisible","Flaglist","PlotlyFold","Fold","FontSelector","GraphCreatePanel","Info","NumericFraction","PositioningNumeric","NumericFractionInverse","LayoutPanel","LayoutSection","LineDashSelector","LineShapeSelector","Numeric","AxisRangeValue","Text","PlotlyPanel","Panel","PanelEmpty","PanelMenuWrapper","Radio","PlotlySection","Section","SingleSidebarItem","GraphTransformsPanel","StyleAxesPanel","StyleColorbarsPanel","StyleLayoutPanel","StyleLegendPanel","StyleNotesPanel","StyleShapesPanel","StyleImagesPanel","StyleTracesPanel","SymbolSelector","TextEditor","TraceAccordion","TraceMarkerSection","TraceRequiredPanel","TraceSelector","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectImageToLayout","connectAxesToLayout","connectTransformToTrace","connectAggregationToTransform","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTraceToPlot","dereference","localize","localizeString","walkObject","EditorControls","DefaultEditor","RectanglePositioner","EditorControlsContext","PanelMenuWrapperContext","ModalProviderContext","PlotlyFoldContext","PlotlyPanelContext","traceHasColorbar","TRANSFORMABLE_TRACES","PlotlyEditor"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AAkBA;;AACA;;AAQA;;AA0DA;;AAEA;;;;QAcEA,mB,GAAAA,+B;QACAC,c,GAAAA,0B;QACAC,c,GAAAA,0B;QACAC,sB,GAAAA,kC;QACAC,kB,GAAAA,8B;QACAC,a,GAAAA,yB;QACAC,c,GAAAA,0B;QACAC,a,GAAAA,yB;QACAC,kB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,GAAAA,yB;QACAC,mB,GAAAA,wB;QACAC,uB,GAAAA,4B;QACAC,6B,GAAAA,kC;QACAC,mB,GAAAA,wB;QACAC,kB,GAAAA,uB;QACAC,0B,GAAAA,+B;QACAC,kB,GAAAA,uB;QACAC,W,GAAAA,gB;QACAC,Q,GAAAA,a;QACAC,c,GAAAA,mB;QACAC,U,GAAAA,e;QACAC,c,GAAAA,wB;QACAC,a,GAAAA,uB;QACAC,mB,GAAAA,+B;QACAC,qB,GAAAA,8B;QACAC,uB,GAAAA,gC;QACAC,oB,GAAAA,6B;QACAC,iB,GAAAA,0B;QACAC,kB,GAAAA,2B;QACAC,gB,GAAAA,qC;QACAC,oB,GAAAA,+B;kBAGaC,sB","file":"index.js","sourcesContent":["import PlotlyEditor from './PlotlyEditor';\nimport DefaultEditor from './DefaultEditor';\nimport EditorControls from './EditorControls';\nimport {\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectAggregationToTransform,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectLayoutToPlot,\n connectToContainer,\n connectTraceToPlot,\n connectRangeSelectorToAxis,\n dereference,\n localize,\n localizeString,\n walkObject,\n} from './lib';\nimport {EDITOR_ACTIONS, TRANSFORMABLE_TRACES} from './lib/constants';\nimport {\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n} from './context';\n\nimport {\n AnnotationAccordion,\n ShapeAccordion,\n RangeSelectorAccordion,\n ImageAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n AxesFold,\n AxesRange,\n TransformAccordion,\n NTicks,\n DTicks,\n AxesSelector,\n PanelMessage,\n Button,\n ColorPicker,\n ColorwayPicker,\n PieColorscalePicker,\n ColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n SymbolSelector,\n TextEditor,\n RangesliderVisible,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n RectanglePositioner,\n} from './components';\nimport {traceHasColorbar} from './default_panels/StyleColorbarsPanel';\n\nimport {\n GraphCreatePanel,\n StyleAxesPanel,\n GraphTransformsPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n} from './default_panels';\n\nexport {\n AnnotationAccordion,\n ShapeAccordion,\n ImageAccordion,\n RangeSelectorAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n TransformAccordion,\n AxesFold,\n AxesRange,\n NTicks,\n DTicks,\n AxesSelector,\n Button,\n ColorPicker,\n PanelMessage,\n ColorwayPicker,\n ColorscalePicker,\n PieColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n EDITOR_ACTIONS,\n RangesliderVisible,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n GraphCreatePanel,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n GraphTransformsPanel,\n StyleAxesPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n SymbolSelector,\n TextEditor,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTraceToPlot,\n dereference,\n localize,\n localizeString,\n walkObject,\n EditorControls,\n DefaultEditor,\n RectanglePositioner,\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n traceHasColorbar,\n TRANSFORMABLE_TRACES,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file From ff7d646a543f5528cb423eac141dba34296e70dc Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 03:18:05 +0900 Subject: [PATCH 14/69] remove context --- src/DefaultEditor.js | 88 ++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/src/DefaultEditor.js b/src/DefaultEditor.js index 7434d8159..63a723631 100644 --- a/src/DefaultEditor.js +++ b/src/DefaultEditor.js @@ -22,8 +22,8 @@ import {TRANSFORMABLE_TRACES} from './lib/constants'; import {EditorControlsContext} from './context'; class DefaultEditor extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.hasTransforms = this.hasTransforms.bind(this); this.hasAxes = this.hasAxes.bind(this); this.hasMenus = this.hasMenus.bind(this); @@ -31,64 +31,72 @@ class DefaultEditor extends Component { this.hasColorbars = this.hasColorbars.bind(this); } - hasTransforms() { - return this.context.fullData.some(d => TRANSFORMABLE_TRACES.includes(d.type)); + hasTransforms(fullData) { + return fullData.some(d => TRANSFORMABLE_TRACES.includes(d.type)); } - hasAxes() { + hasAxes(fullLayout) { return ( - Object.keys(this.context.fullLayout._subplots).filter( - type => - !['cartesian', 'mapbox'].includes(type) && - this.context.fullLayout._subplots[type].length > 0 + Object.keys(fullLayout._subplots).filter( + type => !['cartesian', 'mapbox'].includes(type) && fullLayout._subplots[type].length > 0 ).length > 0 ); } - hasMenus() { - const { - fullLayout: {updatemenus = []}, - } = this.context; + hasMenus(fullLayout) { + const {updatemenus = []} = fullLayout; return updatemenus.length > 0; } - hasSliders() { - const { - layout: {sliders = []}, - } = this.context; + hasSliders(layout) { + const {sliders = []} = layout; + // const { + // layout: {sliders = []}, + // } = this.context; return sliders.length > 0; } - hasColorbars() { - return this.context.fullData.some(d => traceHasColorbar({}, d)); + hasColorbars(fullData) { + return fullData.some(d => traceHasColorbar({}, d)); } render() { - const _ = this.context.localize; const logo = this.props.logoSrc && ; return ( - - {logo ? logo : null} - - - {this.hasTransforms() && ( - - )} - - - {this.hasAxes() && } - - {this.hasColorbars() && } - - - - {this.hasSliders() && } - {this.hasMenus() && } - {this.props.children ? this.props.children : null} - + + {({localize: _, fullData, fullLayout, layout}) => { + return ( + + {logo ? logo : null} + + + {this.hasTransforms(fullData) && ( + + )} + + + {this.hasAxes(fullLayout) && } + + {this.hasColorbars(fullData) && ( + + )} + + + + {this.hasSliders(layout) && ( + + )} + {this.hasMenus(fullLayout) && ( + + )} + {this.props.children ? this.props.children : null} + + ); + }} + ); } } @@ -99,6 +107,6 @@ DefaultEditor.propTypes = { menuPanelOrder: PropTypes.array, }; -DefaultEditor.contextType = EditorControlsContext; +// DefaultEditor.contextType = EditorControlsContext; export default DefaultEditor; From bf76d50ee23c75cf048a37964e47ffd0693c5e1f Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 03:21:20 +0900 Subject: [PATCH 15/69] remake --- lib/DefaultEditor.js | 86 +++++++++++-------- lib/DefaultEditor.js.map | 2 +- .../combined-translation-keys.txt | 16 ++-- scripts/translationKeys/translation-keys.txt | 16 ++-- 4 files changed, 66 insertions(+), 54 deletions(-) diff --git a/lib/DefaultEditor.js b/lib/DefaultEditor.js index b529a971a..443a9a8dc 100644 --- a/lib/DefaultEditor.js +++ b/lib/DefaultEditor.js @@ -39,10 +39,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" var DefaultEditor = function (_Component) { _inherits(DefaultEditor, _Component); - function DefaultEditor(props, context) { + function DefaultEditor(props) { _classCallCheck(this, DefaultEditor); - var _this = _possibleConstructorReturn(this, (DefaultEditor.__proto__ || Object.getPrototypeOf(DefaultEditor)).call(this, props, context)); + var _this = _possibleConstructorReturn(this, (DefaultEditor.__proto__ || Object.getPrototypeOf(DefaultEditor)).call(this, props)); _this.hasTransforms = _this.hasTransforms.bind(_this); _this.hasAxes = _this.hasAxes.bind(_this); @@ -54,69 +54,81 @@ var DefaultEditor = function (_Component) { _createClass(DefaultEditor, [{ key: 'hasTransforms', - value: function hasTransforms() { - return this.context.fullData.some(function (d) { + value: function hasTransforms(fullData) { + return fullData.some(function (d) { return _constants.TRANSFORMABLE_TRACES.includes(d.type); }); } }, { key: 'hasAxes', - value: function hasAxes() { - var _this2 = this; - - return Object.keys(this.context.fullLayout._subplots).filter(function (type) { - return !['cartesian', 'mapbox'].includes(type) && _this2.context.fullLayout._subplots[type].length > 0; + value: function hasAxes(fullLayout) { + return Object.keys(fullLayout._subplots).filter(function (type) { + return !['cartesian', 'mapbox'].includes(type) && fullLayout._subplots[type].length > 0; }).length > 0; } }, { key: 'hasMenus', - value: function hasMenus() { - var _context$fullLayout$u = this.context.fullLayout.updatemenus, - updatemenus = _context$fullLayout$u === undefined ? [] : _context$fullLayout$u; + value: function hasMenus(fullLayout) { + var _fullLayout$updatemen = fullLayout.updatemenus, + updatemenus = _fullLayout$updatemen === undefined ? [] : _fullLayout$updatemen; return updatemenus.length > 0; } }, { key: 'hasSliders', - value: function hasSliders() { - var _context$layout$slide = this.context.layout.sliders, - sliders = _context$layout$slide === undefined ? [] : _context$layout$slide; - + value: function hasSliders(layout) { + var _layout$sliders = layout.sliders, + sliders = _layout$sliders === undefined ? [] : _layout$sliders; + // const { + // layout: {sliders = []}, + // } = this.context; return sliders.length > 0; } }, { key: 'hasColorbars', - value: function hasColorbars() { - return this.context.fullData.some(function (d) { + value: function hasColorbars(fullData) { + return fullData.some(function (d) { return (0, _StyleColorbarsPanel.traceHasColorbar)({}, d); }); } }, { key: 'render', value: function render() { - var _ = this.context.localize; + var _this2 = this; + var logo = this.props.logoSrc && _react2.default.createElement(_Logo2.default, { src: this.props.logoSrc }); return _react2.default.createElement( - _components.PanelMenuWrapper, - { menuPanelOrder: this.props.menuPanelOrder }, - logo ? logo : null, - _react2.default.createElement(_default_panels.GraphCreatePanel, { group: _('Structure'), name: _('Traces') }), - _react2.default.createElement(_default_panels.GraphSubplotsPanel, { group: _('Structure'), name: _('Subplots') }), - this.hasTransforms() && _react2.default.createElement(_default_panels.GraphTransformsPanel, { group: _('Structure'), name: _('Transforms') }), - _react2.default.createElement(_default_panels.StyleLayoutPanel, { group: _('Style'), name: _('General') }), - _react2.default.createElement(_default_panels.StyleTracesPanel, { group: _('Style'), name: _('Traces') }), - this.hasAxes() && _react2.default.createElement(_default_panels.StyleAxesPanel, { group: _('Style'), name: _('Axes') }), - _react2.default.createElement(_default_panels.StyleLegendPanel, { group: _('Style'), name: _('Legend') }), - this.hasColorbars() && _react2.default.createElement(_default_panels.StyleColorbarsPanel, { group: _('Style'), name: _('Color Bars') }), - _react2.default.createElement(_default_panels.StyleNotesPanel, { group: _('Style'), name: _('Annotation') }), - _react2.default.createElement(_default_panels.StyleShapesPanel, { group: _('Style'), name: _('Shapes') }), - _react2.default.createElement(_default_panels.StyleImagesPanel, { group: _('Style'), name: _('Images') }), - this.hasSliders() && _react2.default.createElement(_default_panels.StyleSlidersPanel, { group: _('Style'), name: _('Sliders') }), - this.hasMenus() && _react2.default.createElement(_default_panels.StyleUpdateMenusPanel, { group: _('Style'), name: _('Menus') }), - this.props.children ? this.props.children : null + _context.EditorControlsContext.Consumer, + null, + function (_ref) { + var _ = _ref.localize, + fullData = _ref.fullData, + fullLayout = _ref.fullLayout, + layout = _ref.layout; + + return _react2.default.createElement( + _components.PanelMenuWrapper, + { menuPanelOrder: _this2.props.menuPanelOrder }, + logo ? logo : null, + _react2.default.createElement(_default_panels.GraphCreatePanel, { group: _('Structure'), name: _('Traces') }), + _react2.default.createElement(_default_panels.GraphSubplotsPanel, { group: _('Structure'), name: _('Subplots') }), + _this2.hasTransforms(fullData) && _react2.default.createElement(_default_panels.GraphTransformsPanel, { group: _('Structure'), name: _('Transforms') }), + _react2.default.createElement(_default_panels.StyleLayoutPanel, { group: _('Style'), name: _('General') }), + _react2.default.createElement(_default_panels.StyleTracesPanel, { group: _('Style'), name: _('Traces') }), + _this2.hasAxes(fullLayout) && _react2.default.createElement(_default_panels.StyleAxesPanel, { group: _('Style'), name: _('Axes') }), + _react2.default.createElement(_default_panels.StyleLegendPanel, { group: _('Style'), name: _('Legend') }), + _this2.hasColorbars(fullData) && _react2.default.createElement(_default_panels.StyleColorbarsPanel, { group: _('Style'), name: _('Color Bars') }), + _react2.default.createElement(_default_panels.StyleNotesPanel, { group: _('Style'), name: _('Annotation') }), + _react2.default.createElement(_default_panels.StyleShapesPanel, { group: _('Style'), name: _('Shapes') }), + _react2.default.createElement(_default_panels.StyleImagesPanel, { group: _('Style'), name: _('Images') }), + _this2.hasSliders(layout) && _react2.default.createElement(_default_panels.StyleSlidersPanel, { group: _('Style'), name: _('Sliders') }), + _this2.hasMenus(fullLayout) && _react2.default.createElement(_default_panels.StyleUpdateMenusPanel, { group: _('Style'), name: _('Menus') }), + _this2.props.children ? _this2.props.children : null + ); + } ); } }]); @@ -130,7 +142,7 @@ DefaultEditor.propTypes = { menuPanelOrder: _propTypes2.default.array }; -DefaultEditor.contextType = _context.EditorControlsContext; +// DefaultEditor.contextType = EditorControlsContext; exports.default = DefaultEditor; //# sourceMappingURL=DefaultEditor.js.map \ No newline at end of file diff --git a/lib/DefaultEditor.js.map b/lib/DefaultEditor.js.map index 86ea34927..b660811c4 100644 --- a/lib/DefaultEditor.js.map +++ b/lib/DefaultEditor.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/DefaultEditor.js"],"names":["DefaultEditor","props","context","hasTransforms","bind","hasAxes","hasMenus","hasSliders","hasColorbars","fullData","some","TRANSFORMABLE_TRACES","includes","d","type","Object","keys","fullLayout","_subplots","filter","length","updatemenus","layout","sliders","_","localize","logo","logoSrc","menuPanelOrder","children","Component","propTypes","PropTypes","node","string","array","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;AAeA;;AACA;;;;AACA;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,8HACpBD,KADoB,EACbC,OADa;;AAE1B,UAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBC,IAAnB,OAArB;AACA,UAAKC,OAAL,GAAe,MAAKA,OAAL,CAAaD,IAAb,OAAf;AACA,UAAKE,QAAL,GAAgB,MAAKA,QAAL,CAAcF,IAAd,OAAhB;AACA,UAAKG,UAAL,GAAkB,MAAKA,UAAL,CAAgBH,IAAhB,OAAlB;AACA,UAAKI,YAAL,GAAoB,MAAKA,YAAL,CAAkBJ,IAAlB,OAApB;AAN0B;AAO3B;;;;oCAEe;AACd,aAAO,KAAKF,OAAL,CAAaO,QAAb,CAAsBC,IAAtB,CAA2B;AAAA,eAAKC,gCAAqBC,QAArB,CAA8BC,EAAEC,IAAhC,CAAL;AAAA,OAA3B,CAAP;AACD;;;8BAES;AAAA;;AACR,aACEC,OAAOC,IAAP,CAAY,KAAKd,OAAL,CAAae,UAAb,CAAwBC,SAApC,EAA+CC,MAA/C,CACE;AAAA,eACE,CAAC,CAAC,WAAD,EAAc,QAAd,EAAwBP,QAAxB,CAAiCE,IAAjC,CAAD,IACA,OAAKZ,OAAL,CAAae,UAAb,CAAwBC,SAAxB,CAAkCJ,IAAlC,EAAwCM,MAAxC,GAAiD,CAFnD;AAAA,OADF,EAIEA,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G,aAAKnB,OAAL,MAAkB,8BAAC,8BAAD,IAAgB,OAAOmB,EAAE,OAAF,CAAvB,EAAmC,MAAMA,EAAE,MAAF,CAAzC,GATrB;AAUE,sCAAC,gCAAD,IAAkB,OAAOA,EAAE,OAAF,CAAzB,EAAqC,MAAMA,EAAE,QAAF,CAA3C,GAVF;AAWG,aAAKhB,YAAL,MAAuB,8BAAC,mCAAD,IAAqB,OAAOgB,EAAE,OAAF,CAA5B,EAAwC,MAAMA,EAAE,YAAF,CAA9C,GAX1B;AAYE,sCAAC,+BAAD,IAAiB,OAAOA,EAAE,OAAF,CAAxB,EAAoC,MAAMA,EAAE,YAAF,CAA1C,GAZF;AAaE,sCAAC,gCAAD,IAAkB,OAAOA,EAAE,OAAF,CAAzB,EAAqC,MAAMA,EAAE,QAAF,CAA3C,GAbF;AAcE,sCAAC,gCAAD,IAAkB,OAAOA,EAAE,OAAF,CAAzB,EAAqC,MAAMA,EAAE,QAAF,CAA3C,GAdF;AAeG,aAAKjB,UAAL,MAAqB,8BAAC,iCAAD,IAAmB,OAAOiB,EAAE,OAAF,CAA1B,EAAsC,MAAMA,EAAE,SAAF,CAA5C,GAfxB;AAgBG,aAAKlB,QAAL,MAAmB,8BAAC,qCAAD,IAAuB,OAAOkB,EAAE,OAAF,CAA9B,EAA0C,MAAMA,EAAE,OAAF,CAAhD,GAhBtB;AAiBG,aAAKvB,KAAL,CAAW4B,QAAX,GAAsB,KAAK5B,KAAL,CAAW4B,QAAjC,GAA4C;AAjB/C,OADF;AAqBD;;;;EArEyBC,gB;;AAwE5B9B,cAAc+B,SAAd,GAA0B;AACxBF,YAAUG,oBAAUC,IADI;AAExBN,WAASK,oBAAUE,MAFK;AAGxBN,kBAAgBI,oBAAUG;AAHF,CAA1B;;AAMAnC,cAAcoC,WAAd,GAA4BC,8BAA5B;;kBAEerC,a","file":"DefaultEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {PanelMenuWrapper} from './components';\nimport {\n GraphCreatePanel,\n GraphTransformsPanel,\n GraphSubplotsPanel,\n StyleLayoutPanel,\n StyleAxesPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleSlidersPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n StyleColorbarsPanel,\n StyleUpdateMenusPanel,\n} from './default_panels';\nimport {traceHasColorbar} from './default_panels/StyleColorbarsPanel';\nimport Logo from './components/widgets/Logo';\nimport {TRANSFORMABLE_TRACES} from './lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass DefaultEditor extends Component {\n constructor(props, context) {\n super(props, context);\n this.hasTransforms = this.hasTransforms.bind(this);\n this.hasAxes = this.hasAxes.bind(this);\n this.hasMenus = this.hasMenus.bind(this);\n this.hasSliders = this.hasSliders.bind(this);\n this.hasColorbars = this.hasColorbars.bind(this);\n }\n\n hasTransforms() {\n return this.context.fullData.some(d => TRANSFORMABLE_TRACES.includes(d.type));\n }\n\n hasAxes() {\n return (\n Object.keys(this.context.fullLayout._subplots).filter(\n type =>\n !['cartesian', 'mapbox'].includes(type) &&\n this.context.fullLayout._subplots[type].length > 0\n ).length > 0\n );\n }\n\n hasMenus() {\n const {\n fullLayout: {updatemenus = []},\n } = this.context;\n\n return updatemenus.length > 0;\n }\n\n hasSliders() {\n const {\n layout: {sliders = []},\n } = this.context;\n\n return sliders.length > 0;\n }\n\n hasColorbars() {\n return this.context.fullData.some(d => traceHasColorbar({}, d));\n }\n\n render() {\n const _ = this.context.localize;\n const logo = this.props.logoSrc && ;\n\n return (\n \n {logo ? logo : null}\n \n \n {this.hasTransforms() && (\n \n )}\n \n \n {this.hasAxes() && }\n \n {this.hasColorbars() && }\n \n \n \n {this.hasSliders() && }\n {this.hasMenus() && }\n {this.props.children ? this.props.children : null}\n \n );\n }\n}\n\nDefaultEditor.propTypes = {\n children: PropTypes.node,\n logoSrc: PropTypes.string,\n menuPanelOrder: PropTypes.array,\n};\n\nDefaultEditor.contextType = EditorControlsContext;\n\nexport default DefaultEditor;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/DefaultEditor.js"],"names":["DefaultEditor","props","hasTransforms","bind","hasAxes","hasMenus","hasSliders","hasColorbars","fullData","some","TRANSFORMABLE_TRACES","includes","d","type","fullLayout","Object","keys","_subplots","filter","length","updatemenus","layout","sliders","logo","logoSrc","_","localize","menuPanelOrder","children","Component","propTypes","PropTypes","node","string","array"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;AAeA;;AACA;;;;AACA;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8HACXA,KADW;;AAEjB,UAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBC,IAAnB,OAArB;AACA,UAAKC,OAAL,GAAe,MAAKA,OAAL,CAAaD,IAAb,OAAf;AACA,UAAKE,QAAL,GAAgB,MAAKA,QAAL,CAAcF,IAAd,OAAhB;AACA,UAAKG,UAAL,GAAkB,MAAKA,UAAL,CAAgBH,IAAhB,OAAlB;AACA,UAAKI,YAAL,GAAoB,MAAKA,YAAL,CAAkBJ,IAAlB,OAApB;AANiB;AAOlB;;;;kCAEaK,Q,EAAU;AACtB,aAAOA,SAASC,IAAT,CAAc;AAAA,eAAKC,gCAAqBC,QAArB,CAA8BC,EAAEC,IAAhC,CAAL;AAAA,OAAd,CAAP;AACD;;;4BAEOC,U,EAAY;AAClB,aACEC,OAAOC,IAAP,CAAYF,WAAWG,SAAvB,EAAkCC,MAAlC,CACE;AAAA,eAAQ,CAAC,CAAC,WAAD,EAAc,QAAd,EAAwBP,QAAxB,CAAiCE,IAAjC,CAAD,IAA2CC,WAAWG,SAAX,CAAqBJ,IAArB,EAA2BM,MAA3B,GAAoC,CAAvF;AAAA,OADF,EAEEA,MAFF,GAEW,CAHb;AAKD;;;6BAEQL,U,EAAY;AAAA,kCACQA,UADR,CACZM,WADY;AAAA,UACZA,WADY,yCACE,EADF;;;AAGnB,aAAOA,YAAYD,MAAZ,G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';\nimport PropTypes from 'prop-types';\nimport {PanelMenuWrapper} from './components';\nimport {\n GraphCreatePanel,\n GraphTransformsPanel,\n GraphSubplotsPanel,\n StyleLayoutPanel,\n StyleAxesPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleSlidersPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n StyleColorbarsPanel,\n StyleUpdateMenusPanel,\n} from './default_panels';\nimport {traceHasColorbar} from './default_panels/StyleColorbarsPanel';\nimport Logo from './components/widgets/Logo';\nimport {TRANSFORMABLE_TRACES} from './lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass DefaultEditor extends Component {\n constructor(props) {\n super(props);\n this.hasTransforms = this.hasTransforms.bind(this);\n this.hasAxes = this.hasAxes.bind(this);\n this.hasMenus = this.hasMenus.bind(this);\n this.hasSliders = this.hasSliders.bind(this);\n this.hasColorbars = this.hasColorbars.bind(this);\n }\n\n hasTransforms(fullData) {\n return fullData.some(d => TRANSFORMABLE_TRACES.includes(d.type));\n }\n\n hasAxes(fullLayout) {\n return (\n Object.keys(fullLayout._subplots).filter(\n type => !['cartesian', 'mapbox'].includes(type) && fullLayout._subplots[type].length > 0\n ).length > 0\n );\n }\n\n hasMenus(fullLayout) {\n const {updatemenus = []} = fullLayout;\n\n return updatemenus.length > 0;\n }\n\n hasSliders(layout) {\n const {sliders = []} = layout;\n // const {\n // layout: {sliders = []},\n // } = this.context;\n\n return sliders.length > 0;\n }\n\n hasColorbars(fullData) {\n return fullData.some(d => traceHasColorbar({}, d));\n }\n\n render() {\n const logo = this.props.logoSrc && ;\n\n return (\n \n {({localize: _, fullData, fullLayout, layout}) => {\n return (\n \n {logo ? logo : null}\n \n \n {this.hasTransforms(fullData) && (\n \n )}\n \n \n {this.hasAxes(fullLayout) && }\n \n {this.hasColorbars(fullData) && (\n \n )}\n \n \n \n {this.hasSliders(layout) && (\n \n )}\n {this.hasMenus(fullLayout) && (\n \n )}\n {this.props.children ? this.props.children : null}\n \n );\n }}\n \n );\n }\n}\n\nDefaultEditor.propTypes = {\n children: PropTypes.node,\n logoSrc: PropTypes.string,\n menuPanelOrder: PropTypes.array,\n};\n\n// DefaultEditor.contextType = EditorControlsContext;\n\nexport default DefaultEditor;\n"]} \ No newline at end of file diff --git a/scripts/translationKeys/combined-translation-keys.txt b/scripts/translationKeys/combined-translation-keys.txt index 708e04ea4..cfc8b5167 100644 --- a/scripts/translationKeys/combined-translation-keys.txt +++ b/scripts/translationKeys/combined-translation-keys.txt @@ -58,7 +58,7 @@ Auto Auto margins // react-chart-editor: /default_panels/StyleAxesPanel.js:147 Autoscale // plotly.js: components/modebar/buttons.js:150 Average // react-chart-editor: /default_panels/GraphTransformsPanel.js:41 && react-chart-editor: /components/fields/derived.js:133 -Axes // react-chart-editor: /DefaultEditor.js:82 +Axes // react-chart-editor: /DefaultEditor.js:81 Axes to Use // react-chart-editor: /components/fields/AxesCreator.js:146 AxesSelector must be nested within a connectAxesToPlot component // react-chart-editor: /components/fields/AxesSelector.js:13 Axis // react-chart-editor: /components/fields/AxesCreator.js:138 @@ -285,7 +285,7 @@ Gap Between Groups Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:386 Gaps Between Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:510 Gaps in Data // react-chart-editor: /default_panels/StyleTracesPanel.js:519 -General // react-chart-editor: /DefaultEditor.js:80 +General // react-chart-editor: /DefaultEditor.js:79 Geo // react-chart-editor: /lib/constants.js:101 Gnomonic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:136 Go back // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:186 @@ -325,7 +325,7 @@ I (Optional) IE only supports svg. Changing format to svg. // plotly.js: components/modebar/buttons.js:65 Icon Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:60 Image // react-chart-editor: /components/containers/ImageAccordion.js:22 -Images // react-chart-editor: /DefaultEditor.js:87 +Images // react-chart-editor: /DefaultEditor.js:88 Include // react-chart-editor: /components/fields/FilterOperation.js:29 Include Range // react-chart-editor: /components/fields/FilterOperation.js:75 Include Values // react-chart-editor: /components/fields/FilterOperation.js:83 @@ -417,7 +417,7 @@ Meanline Meanline Color // react-chart-editor: /default_panels/StyleTracesPanel.js:621 Meanline Width // react-chart-editor: /default_panels/StyleTracesPanel.js:620 Median // react-chart-editor: /default_panels/GraphTransformsPanel.js:42 -Menus // react-chart-editor: /DefaultEditor.js:89 +Menus // react-chart-editor: /DefaultEditor.js:93 Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:119 Middle // react-chart-editor: /default_panels/StyleAxesPanel.js:374 Middle Center // react-chart-editor: /components/fields/derived.js:484 @@ -556,7 +556,7 @@ Select a Colorscale Type Select an Option // react-chart-editor: /components/widgets/Dropdown.js:67 Separate Thousands // react-chart-editor: /default_panels/StyleAxesPanel.js:174 Shape // react-chart-editor: /components/containers/ShapeAccordion.js:23 -Shapes // react-chart-editor: /DefaultEditor.js:86 +Shapes // react-chart-editor: /DefaultEditor.js:87 Show // react-chart-editor: /components/fields/MarkerColor.js:190 Show All // react-chart-editor: /default_panels/StyleTracesPanel.js:237 Show Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:632 @@ -575,7 +575,7 @@ Size Mode Size Scale // react-chart-editor: /default_panels/StyleTracesPanel.js:261 Size and Positioning // react-chart-editor: /default_panels/StyleColorbarsPanel.js:64 Slider // react-chart-editor: /components/containers/SliderAccordion.js:21 -Sliders // react-chart-editor: /DefaultEditor.js:88 +Sliders // react-chart-editor: /DefaultEditor.js:90 Smoothing // react-chart-editor: /default_panels/StyleTracesPanel.js:435 Snap to Grid // react-chart-editor: /components/fields/RectanglePositioner.js:82 Snapshot succeeded // plotly.js: components/modebar/buttons.js:77 @@ -602,7 +602,7 @@ Stepmode Stereographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:137 Streamtube // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:69 Stretch // react-chart-editor: /default_panels/StyleImagesPanel.js:31 -Structure // react-chart-editor: /DefaultEditor.js:75 +Structure // react-chart-editor: /DefaultEditor.js:74 Style // react-chart-editor: /default_panels/StyleAxesPanel.js:346 Sub-Country Unit Borders // react-chart-editor: /default_panels/GraphSubplotsPanel.js:155 Subplots // react-chart-editor: /components/fields/AxesCreator.js:152 @@ -663,7 +663,7 @@ Trace your data. Traces // react-chart-editor: /components/containers/TraceRequiredPanel.js:28 Traces of various types like bar and line are the building blocks of your figure. // react-chart-editor: /components/containers/TraceAccordion.js:121 Transform // react-chart-editor: /components/containers/TransformAccordion.js:66 -Transforms // react-chart-editor: /DefaultEditor.js:78 +Transforms // react-chart-editor: /DefaultEditor.js:77 Transpose // react-chart-editor: /default_panels/GraphCreatePanel.js:162 Transverse Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:140 True // react-chart-editor: /default_panels/StyleAxesPanel.js:149 diff --git a/scripts/translationKeys/translation-keys.txt b/scripts/translationKeys/translation-keys.txt index 3f3e02feb..6d614b1c6 100644 --- a/scripts/translationKeys/translation-keys.txt +++ b/scripts/translationKeys/translation-keys.txt @@ -70,7 +70,7 @@ Auto Auto margins // /default_panels/StyleAxesPanel.js:147 Average // /default_panels/GraphTransformsPanel.js:41 Average // /components/fields/derived.js:133 -Axes // /DefaultEditor.js:82 +Axes // /DefaultEditor.js:81 Axes to Use // /components/fields/AxesCreator.js:146 AxesSelector must be nested within a connectAxesToPlot component // /components/fields/AxesSelector.js:13 Axis Background // /default_panels/StyleAxesPanel.js:128 @@ -282,7 +282,7 @@ Gap Between Groups Gaps // /default_panels/StyleTracesPanel.js:386 Gaps Between Cells // /default_panels/StyleTracesPanel.js:510 Gaps in Data // /default_panels/StyleTracesPanel.js:519 -General // /DefaultEditor.js:80 +General // /DefaultEditor.js:79 Geo // /lib/constants.js:101 Gnomonic // /default_panels/GraphSubplotsPanel.js:136 Go back // /components/widgets/text_editors/MultiFormat.js:186 @@ -321,7 +321,7 @@ Hover on I (Optional) // /default_panels/GraphCreatePanel.js:100 Icon Color // /default_panels/StyleLayoutPanel.js:60 Image // /components/containers/ImageAccordion.js:22 -Images // /DefaultEditor.js:87 +Images // /DefaultEditor.js:88 Include // /components/fields/FilterOperation.js:29 Include Range // /components/fields/FilterOperation.js:75 Include Values // /components/fields/FilterOperation.js:83 @@ -412,7 +412,7 @@ Meanline Meanline Color // /default_panels/StyleTracesPanel.js:621 Meanline Width // /default_panels/StyleTracesPanel.js:620 Median // /default_panels/GraphTransformsPanel.js:42 -Menus // /DefaultEditor.js:89 +Menus // /DefaultEditor.js:93 Mercator // /default_panels/GraphSubplotsPanel.js:119 Middle // /default_panels/StyleAxesPanel.js:374 Middle Center // /components/fields/derived.js:484 @@ -543,7 +543,7 @@ Select a Colorscale Type Select an Option // /components/widgets/Dropdown.js:67 Separate Thousands // /default_panels/StyleAxesPanel.js:174 Shape // /components/containers/ShapeAccordion.js:23 -Shapes // /DefaultEditor.js:86 +Shapes // /DefaultEditor.js:87 Show // /components/fields/MarkerColor.js:190 Show All // /default_panels/StyleTracesPanel.js:237 Show Contour // /default_panels/StyleTracesPanel.js:632 @@ -561,7 +561,7 @@ Size Mode Size Scale // /default_panels/StyleTracesPanel.js:261 Size and Positioning // /default_panels/StyleColorbarsPanel.js:64 Slider // /components/containers/SliderAccordion.js:21 -Sliders // /DefaultEditor.js:88 +Sliders // /DefaultEditor.js:90 Smoothing // /default_panels/StyleTracesPanel.js:435 Snap to Grid // /components/fields/RectanglePositioner.js:82 Soft // /default_panels/StyleTracesPanel.js:578 @@ -586,7 +586,7 @@ Stepmode Stereographic // /default_panels/GraphSubplotsPanel.js:137 Streamtube // /lib/computeTraceOptionsFromSchema.js:69 Stretch // /default_panels/StyleImagesPanel.js:31 -Structure // /DefaultEditor.js:75 +Structure // /DefaultEditor.js:74 Style // /default_panels/StyleAxesPanel.js:346 Sub-Country Unit Borders // /default_panels/GraphSubplotsPanel.js:155 Subplots // /components/fields/AxesCreator.js:152 @@ -645,7 +645,7 @@ Trace your data. Traces // /components/containers/TraceRequiredPanel.js:28 Traces of various types like bar and line are the building blocks of your figure. // /components/containers/TraceAccordion.js:121 Transform // /components/containers/TransformAccordion.js:66 -Transforms // /DefaultEditor.js:78 +Transforms // /DefaultEditor.js:77 Transpose // /default_panels/GraphCreatePanel.js:162 Transverse Mercator // /default_panels/GraphSubplotsPanel.js:140 True // /default_panels/StyleAxesPanel.js:149 From 8614ed5638ecececff262140035d316417a322f6 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 03:58:06 +0900 Subject: [PATCH 16/69] remake --- dev/App.js | 262 +++++++++++++++++++++++++------------- lib/EditorControls.js | 10 +- lib/EditorControls.js.map | 2 +- lib/PlotlyEditor.js | 8 +- lib/PlotlyEditor.js.map | 2 +- src/EditorControls.js | 12 +- src/PlotlyEditor.js | 4 + 7 files changed, 206 insertions(+), 94 deletions(-) diff --git a/dev/App.js b/dev/App.js index 1cce7eb11..39e9429a7 100644 --- a/dev/App.js +++ b/dev/App.js @@ -163,6 +163,92 @@ class App extends Component { } render() { + const optionalPanel = [ + +
+ ({ - label: item, - value: i, - }))} - searchable={true} - searchPromptText="Search for a mock" - onChange={option => this.loadMock(option.value)} - noResultsText={'No Results'} - placeholder={'Search for a mock'} - /> -
- - this.setState({json_string})} - value={this.state.json_string} - name="UNIQUE_ID_OF_DIV" - style={{height: '80vh'}} - setOptions={{ - showLineNumbers: false, - tabSize: 2, - }} - commands={[ - { - name: 'save', - bindKey: {win: 'Ctrl-s', mac: 'Command-s'}, - exec: this.loadJSON, - }, - ]} - editorProps={{$blockScrolling: true}} - /> -
- - -
- -
-
- - + optionalPanel={optionalPanel} + menuPanelOrder={menuPanelOrder} + /> + {/**/} + {/**/} + {/*
*/} + {/* ({*/} + {/*label: item,*/} + {/*value: i,*/} + {/*}))}*/} + {/*searchable={true}*/} + {/*searchPromptText="Search for a mock"*/} + {/*onChange={option => this.loadMock(option.value)}*/} + {/*noResultsText={'No Results'}*/} + {/*placeholder={'Search for a mock'}*/} + {/*/>*/} + {/*
*/} + {/**/} + {/*Save*/} + {/**/} + {/* this.setState({json_string})}*/} + {/*value={this.state.json_string}*/} + {/*name="UNIQUE_ID_OF_DIV"*/} + {/*style={{height: '80vh'}}*/} + {/*setOptions={{*/} + {/*showLineNumbers: false,*/} + {/*tabSize: 2,*/} + {/*}}*/} + {/*commands={[*/} + {/*{*/} + {/*name: 'save',*/} + {/*bindKey: {win: 'Ctrl-s', mac: 'Command-s'},*/} + {/*exec: this.loadJSON,*/} + {/*},*/} + {/*]}*/} + {/*editorProps={{$blockScrolling: true}}*/} + {/*/>*/} + {/*
*/} + {/**/} + {/* {*/} + {/*const gd = document.getElementById('gd') || {};*/} + {/*this.setState({*/} + {/*full: {*/} + {/*_fullData: gd._fullData || [],*/} + {/*_fullLayout: gd._fullLayout || {},*/} + {/*},*/} + {/*});*/} + {/*}}*/} + {/*>*/} + {/*Refresh*/} + {/**/} + {/*
*/} + {/**/} + {/*
*/} + {/*
*/} + {/**/} + {/**/} ); } diff --git a/lib/EditorControls.js b/lib/EditorControls.js index 969d84dfb..43104d858 100644 --- a/lib/EditorControls.js +++ b/lib/EditorControls.js @@ -332,7 +332,11 @@ var EditorControls = function (_Component) { _react2.default.createElement( _containers.ModalProvider, null, - this.props.graphDiv && this.props.graphDiv._fullLayout && (this.props.children ? this.props.children : _react2.default.createElement(_DefaultEditor2.default, null)) + this.props.graphDiv && this.props.graphDiv._fullLayout && (this.props.children ? this.props.children : this.props.optionalPanel ? _react2.default.createElement( + _DefaultEditor2.default, + { menuPanelOrder: this.props.menuPanelOrder }, + this.props.optionalPanel + ) : _react2.default.createElement(_DefaultEditor2.default, null)) ) ) ); @@ -379,7 +383,9 @@ EditorControls.propTypes = { glByDefault: _propTypes2.default.bool, mapBoxAccess: _propTypes2.default.bool, fontOptions: _propTypes2.default.array, - chartHelp: _propTypes2.default.object + chartHelp: _propTypes2.default.object, + optionalPanel: _propTypes2.default.node, + menuPanelOrder: _propTypes2.default.array }; EditorControls.defaultProps = { diff --git a/lib/EditorControls.js.map b/lib/EditorControls.js.map index 845984f0b..4bff95157 100644 --- a/lib/EditorControls.js.map +++ b/lib/EditorControls.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","type","payload","EDITOR_ACTIONS","UPDATE_TRACES","beforeUpdateTraces","i","traceIndexes","length","attr","traceIndex","splitTraceGroup","toString","value","update","forEach","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAUA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;;;;;;;;;IAEMA,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAG1B,UAAKC,Q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BAAUU,MAfW;AAgBjCxG,YAAU8F,oBAAUkB,GAhBa;AAiBjC/F,UAAQ6E,oBAAUU,MAjBe;AAkBjC/G,UAAQqG,oBAAUI,MAlBe;AAmBjC3G,YAAUuG,oBAAUE,IAnBa;AAoBjC9E,YAAU4E,oBAAUE,IApBa;AAqBjCrG,UAAQmG,oBAAUU,MArBe;AAsBjC5G,cAAYkG,oBAAUU,MAtBW;AAuBjCnF,oBAAkByE,oBAAUU,MAvBK;AAwBjClF,qBAAmBwE,oBAAUC,IAxBI;AAyBjCxE,eAAauE,oBAAUC,IAzBU;AA0BjCvE,gBAAcsE,oBAAUC,IA1BS;AA2BjCtE,eAAaqE,oBAAUS,KA3BU;AA4BjC7E,aAAWoE,oBAAUU;AA5BY,CAAnC;;kBA+BepH,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? this.props.children : )}\n \n \n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","type","payload","EDITOR_ACTIONS","UPDATE_TRACES","beforeUpdateTraces","i","traceIndexes","length","attr","traceIndex","splitTraceGroup","toString","value","update","forEach","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","optionalPanel","menuPanelOrder","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":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e;AAGjCtG,iBAAe4F,oBAAUK,KAAV,CAAgB;AAC7BC,WAAON,oBAAUE,IAAV,CAAeK,UADO;AAE7BC,aAASR,oBAAUE,IAAV,CAAeK;AAFK,GAAhB,CAHkB;AAOjClG,QAAM2F,oBAAUS,KAPiB;AAQjChG,4BAA0BuF,oBAAUE,IARH;AASjC3F,qBAAmByF,oBAAUS,KATI;AAUjCnG,eAAa0F,oBAAUU,MAVU;AAWjClG,2BAAyBwF,oBAAUE,IAXF;AAYjC1G,gBAAcwG,oBAAUU,MAZS;AAajChG,UAAQsF,oBAAUS,KAbe;AAcjC5F,YAAUmF,oBAAUS,KAda;AAejC1F,cAAYiF,oBAAUU,MAfW;AAgBjC1G,YAAUgG,oBAAUkB,GAhBa;AAiBjCjG,UAAQ+E,oBAAUU,MAjBe;AAkBjCjH,UAAQuG,oBAAUI,MAlBe;AAmBjC7G,YAAUyG,oBAAUE,IAnBa;AAoBjChF,YAAU8E,oBAAUE,IApBa;AAqBjCvG,UAAQqG,oBAAUU,MArBe;AAsBjC9G,cAAYoG,oBAAUU,MAtBW;AAuBjCrF,oBAAkB2E,oBAAUU,MAvBK;AAwBjCpF,qBAAmB0E,oBAAUC,IAxBI;AAyBjC1E,eAAayE,oBAAUC,IAzBU;AA0BjCzE,gBAAcwE,oBAAUC,IA1BS;AA2BjCxE,eAAauE,oBAAUS,KA3BU;AA4BjC/E,aAAWsE,oBAAUU;AA5BY,CAAnC;;kBA+BetH,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? (\n this.props.children\n ) : this.props.optionalPanel ? (\n \n {this.props.optionalPanel}\n \n ) : (\n \n ))}\n \n \n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file diff --git a/lib/PlotlyEditor.js b/lib/PlotlyEditor.js index 5907f9321..558074fc7 100644 --- a/lib/PlotlyEditor.js +++ b/lib/PlotlyEditor.js @@ -78,7 +78,9 @@ var PlotlyEditor = function (_Component) { glByDefault: this.props.glByDefault, mapBoxAccess: Boolean(this.props.config && this.props.config.mapboxAccessToken), fontOptions: this.props.fontOptions, - chartHelp: this.props.chartHelp + chartHelp: this.props.chartHelp, + optionalPanel: this.props.optionalPanel, + menuPanelOrder: this.props.menuPanelOrder }, this.props.children ), @@ -132,7 +134,9 @@ PlotlyEditor.propTypes = { makeDefaultTrace: _propTypes2.default.func, glByDefault: _propTypes2.default.bool, fontOptions: _propTypes2.default.array, - chartHelp: _propTypes2.default.object + chartHelp: _propTypes2.default.object, + optionalPanel: _propTypes2.default.any, + menuPanelOrder: _propTypes2.default.array }; PlotlyEditor.defaultProps = { diff --git a/lib/PlotlyEditor.js.map b/lib/PlotlyEditor.js.map index 37874bc97..e9f41d78a 100644 --- a/lib/PlotlyEditor.js.map +++ b/lib/PlotlyEditor.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/PlotlyEditor.js"],"names":["PlotlyEditor","props","state","graphDiv","PlotComponent","plotly","handleRender","bind","fig","setState","onRender","data","layout","_transitionData","_frames","hideControls","dataSources","dataSourceOptions","onUpdate","advancedTraceTypeSelector","locale","traceTypesConfig","dictionaries","showFieldTooltips","srcConverters","makeDefaultTrace","glByDefault","Boolean","config","mapboxAccessToken","fontOptions","chartHelp","children","width","height","frames","useResizeHandler","debug","divId","Component","propTypes","PropTypes","any","object","array","func","bool","string","shape","toSrc","isRequired","fromSrc","defaultProps","DEFAULT_FONTS"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Y;;;AACJ,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AAEjB,UAAKC,KAAL,GAAa,EAACC,UAAU,EAAX,EAAb;AACA,UAAKC,aAAL,GAAqB,uBAAoBH,MAAMI,MAA1B,CAArB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAJiB;AAKlB;;;;iCAEYC,G,EAAKL,Q,EAAU;AAC1B,WAAKM,QAAL,CAAc,EAACN,kBAAD,EAAd;AACA,UAAI,KAAKF,KAAL,CAAWS,QAAf,EAAyB;AACvB,aAAKT,KAAL,CAAWS,QAAX,CAAoBP,SAASQ,IAA7B,EAAmCR,SAASS,MAA5C,EAAoDT,SAASU,eAAT,CAAyBC,OAA7E;AACD;AACF;;;6BAEQ;AACP,aACE;AAAA;AAAA,UAAK,WAAU,eAAf;AACG,SAAC,KAAKb,KAAL,CAAWc,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Y","file":"PlotlyEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport createPlotComponent from 'react-plotly.js/factory';\nimport EditorControls from './EditorControls';\nimport PropTypes from 'prop-types';\nimport {DEFAULT_FONTS} from 'lib/constants';\n\nclass PlotlyEditor extends Component {\n constructor(props) {\n super();\n this.state = {graphDiv: {}};\n this.PlotComponent = createPlotComponent(props.plotly);\n this.handleRender = this.handleRender.bind(this);\n }\n\n handleRender(fig, graphDiv) {\n this.setState({graphDiv});\n if (this.props.onRender) {\n this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n render() {\n return (\n
\n {!this.props.hideControls && (\n \n {this.props.children}\n \n )}\n
\n \n
\n
\n );\n }\n}\n\nPlotlyEditor.propTypes = {\n children: PropTypes.any,\n layout: PropTypes.object,\n data: PropTypes.array,\n config: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n frames: PropTypes.array,\n onUpdate: PropTypes.func,\n onRender: PropTypes.func,\n plotly: PropTypes.object,\n useResizeHandler: PropTypes.bool,\n debug: PropTypes.bool,\n advancedTraceTypeSelector: PropTypes.bool,\n locale: PropTypes.string,\n traceTypesConfig: PropTypes.object,\n dictionaries: PropTypes.object,\n divId: PropTypes.string,\n hideControls: PropTypes.bool,\n showFieldTooltips: PropTypes.bool,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nPlotlyEditor.defaultProps = {\n hideControls: false,\n showFieldTooltips: false,\n fontOptions: DEFAULT_FONTS,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/PlotlyEditor.js"],"names":["PlotlyEditor","props","state","graphDiv","PlotComponent","plotly","handleRender","bind","fig","setState","onRender","data","layout","_transitionData","_frames","hideControls","dataSources","dataSourceOptions","onUpdate","advancedTraceTypeSelector","locale","traceTypesConfig","dictionaries","showFieldTooltips","srcConverters","makeDefaultTrace","glByDefault","Boolean","config","mapboxAccessToken","fontOptions","chartHelp","optionalPanel","menuPanelOrder","children","width","height","frames","useResizeHandler","debug","divId","Component","propTypes","PropTypes","any","object","array","func","bool","string","shape","toSrc","isRequired","fromSrc","defaultProps","DEFAULT_FONTS"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Y;;;AACJ,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AAEjB,UAAKC,KAAL,GAAa,EAACC,UAAU,EAAX,EAAb;AACA,UAAKC,aAAL,GAAqB,uBAAoBH,MAAMI,MAA1B,CAArB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAJiB;AAKlB;;;;iCAEYC,G,EAAKL,Q,EAAU;AAC1B,WAAKM,QAAL,CAAc,EAACN,kBAAD,EAAd;AACA,UAAI,KAAKF,KAAL,CAAWS,QAAf,EAAyB;AACvB,aAAKT,KAAL,CAAWS,QAAX,CAAoBP,SAASQ,IAA7B,EAAmCR,SAASS,MAA5C,EAAoDT,SAASU,eAAT,CAAyBC,OAA7E;AACD;AACF;;;6BAEQ;AACP,aACE;AAAA;AAAA,UAAK,WAAU,eAAf;AACG,SAAC,KAAKb,KAAL,CAAWc,YAAZ,IACC;AAAC,kCAAD;AAAA;AACE,sBAAU,KAAKb,KAAL,CAAWC,QADvB;AAEE,yBAAa,KAAKF,KAAL,CAAWe,WAF1B;AAGE,+BAAmB,KAAKf,KAAL,CAAWgB,iBAHhC;AAIE,oBAAQ,KAAKhB,KAAL,CAAWI,MAJrB;AAKE,sBAAU,KAAKJ,KAAL,CAAWiB,QALvB;AAME,uCAA2B,KAAKjB,KAAL,CAAWkB,yBANxC;AAOE,oBAAQ,KAAKlB,KAAL,CAAWmB,MAPrB;AAQE,8BAAkB,KAAKnB,K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,oBAAUE,MAFK;AAGvBlC,QAAMgC,oBAAUG,KAHO;AAIvBlB,UAAQe,oBAAUE,MAJK;AAKvB5B,qBAAmB0B,oBAAUG,KALN;AAMvB9B,eAAa2B,oBAAUE,MANA;AAOvBR,UAAQM,oBAAUG,KAPK;AAQvB5B,YAAUyB,oBAAUI,IARG;AASvBrC,YAAUiC,oBAAUI,IATG;AAUvB1C,UAAQsC,oBAAUE,MAVK;AAWvBP,oBAAkBK,oBAAUK,IAXL;AAYvBT,SAAOI,oBAAUK,IAZM;AAavB7B,6BAA2BwB,oBAAUK,IAbd;AAcvB5B,UAAQuB,oBAAUM,MAdK;AAevB5B,oBAAkBsB,oBAAUE,MAfL;AAgBvBvB,gBAAcqB,oBAAUE,MAhBD;AAiBvBL,SAAOG,oBAAUM,MAjBM;AAkBvBlC,gBAAc4B,oBAAUK,IAlBD;AAmBvBzB,qBAAmBoB,oBAAUK,IAnBN;AAoBvBxB,iBAAemB,oBAAUO,KAAV,CAAgB;AAC7BC,WAAOR,oBAAUI,IAAV,CAAeK,UADO;AAE7BC,aAASV,oBAAUI,IAAV,CAAeK;AAFK,GAAhB,CApBQ;AAwBvB3B,oBAAkBkB,oBAAUI,IAxBL;AAyBvBrB,eAAaiB,oBAAUK,IAzBA;AA0BvBlB,eAAaa,oBAAUG,KA1BA;AA2BvBf,aAAWY,oBAAUE,MA3BE;AA4BvBb,iBAAeW,oBAAUC,GA5BF;AA6BvBX,kBAAgBU,oBAAUG;AA7BH,CAAzB;;AAgCA9C,aAAasD,YAAb,GAA4B;AAC1BvC,gBAAc,KADY;AAE1BQ,qBAAmB,KAFO;AAG1BO,eAAayB;AAHa,CAA5B;;kBAMevD,Y","file":"PlotlyEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport createPlotComponent from 'react-plotly.js/factory';\nimport EditorControls from './EditorControls';\nimport PropTypes from 'prop-types';\nimport {DEFAULT_FONTS} from 'lib/constants';\n\nclass PlotlyEditor extends Component {\n constructor(props) {\n super();\n this.state = {graphDiv: {}};\n this.PlotComponent = createPlotComponent(props.plotly);\n this.handleRender = this.handleRender.bind(this);\n }\n\n handleRender(fig, graphDiv) {\n this.setState({graphDiv});\n if (this.props.onRender) {\n this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n render() {\n return (\n
\n {!this.props.hideControls && (\n \n {this.props.children}\n \n )}\n
\n \n
\n
\n );\n }\n}\n\nPlotlyEditor.propTypes = {\n children: PropTypes.any,\n layout: PropTypes.object,\n data: PropTypes.array,\n config: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n frames: PropTypes.array,\n onUpdate: PropTypes.func,\n onRender: PropTypes.func,\n plotly: PropTypes.object,\n useResizeHandler: PropTypes.bool,\n debug: PropTypes.bool,\n advancedTraceTypeSelector: PropTypes.bool,\n locale: PropTypes.string,\n traceTypesConfig: PropTypes.object,\n dictionaries: PropTypes.object,\n divId: PropTypes.string,\n hideControls: PropTypes.bool,\n showFieldTooltips: PropTypes.bool,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.any,\n menuPanelOrder: PropTypes.array,\n};\n\nPlotlyEditor.defaultProps = {\n hideControls: false,\n showFieldTooltips: false,\n fontOptions: DEFAULT_FONTS,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file diff --git a/src/EditorControls.js b/src/EditorControls.js index 3cb2d064f..91d937e55 100644 --- a/src/EditorControls.js +++ b/src/EditorControls.js @@ -338,7 +338,15 @@ class EditorControls extends Component { {this.props.graphDiv && this.props.graphDiv._fullLayout && - (this.props.children ? this.props.children : )} + (this.props.children ? ( + this.props.children + ) : this.props.optionalPanel ? ( + + {this.props.optionalPanel} + + ) : ( + + ))} @@ -384,6 +392,8 @@ EditorControls.propTypes = { mapBoxAccess: PropTypes.bool, fontOptions: PropTypes.array, chartHelp: PropTypes.object, + optionalPanel: PropTypes.node, + menuPanelOrder: PropTypes.array, }; EditorControls.defaultProps = { diff --git a/src/PlotlyEditor.js b/src/PlotlyEditor.js index da25ce3f3..99bcaf253 100644 --- a/src/PlotlyEditor.js +++ b/src/PlotlyEditor.js @@ -40,6 +40,8 @@ class PlotlyEditor extends Component { mapBoxAccess={Boolean(this.props.config && this.props.config.mapboxAccessToken)} fontOptions={this.props.fontOptions} chartHelp={this.props.chartHelp} + optionalPanel={this.props.optionalPanel} + menuPanelOrder={this.props.menuPanelOrder} > {this.props.children} @@ -91,6 +93,8 @@ PlotlyEditor.propTypes = { glByDefault: PropTypes.bool, fontOptions: PropTypes.array, chartHelp: PropTypes.object, + optionalPanel: PropTypes.any, + menuPanelOrder: PropTypes.array, }; PlotlyEditor.defaultProps = { From c861c063c9fb9b8a85c9cb5de8272f40c1b59e61 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 15:10:03 +0900 Subject: [PATCH 17/69] add fold__top box-sizing:content-box --- lib/react-chart-editor.css | 3 ++- lib/react-chart-editor.ie.css | 3 ++- lib/react-chart-editor.ie.min.css | 2 +- lib/react-chart-editor.min.css | 2 +- src/styles/components/containers/_fold.scss | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/react-chart-editor.css b/lib/react-chart-editor.css index c7bcd618c..33a2011f8 100644 --- a/lib/react-chart-editor.css +++ b/lib/react-chart-editor.css @@ -528,7 +528,8 @@ height: 15px; border-radius: var(--border-radius); text-shadow: var(--text-shadow-dark-ui); - transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; } + transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; + box-sizing: content-box; } .editor_controls .fold__top:hover { cursor: pointer; background-color: var(--fold-header-background-closed); } diff --git a/lib/react-chart-editor.ie.css b/lib/react-chart-editor.ie.css index 3c347d250..a7ac7fc78 100644 --- a/lib/react-chart-editor.ie.css +++ b/lib/react-chart-editor.ie.css @@ -528,7 +528,8 @@ height: 15px; border-radius: var(--border-radius); text-shadow: var(--text-shadow-dark-ui); - transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; } + transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; + box-sizing: content-box; } .editor_controls .fold__top:hover { cursor: pointer; background-color: var(--fold-header-background-closed); } diff --git a/lib/react-chart-editor.ie.min.css b/lib/react-chart-editor.ie.min.css index 29fe6c22d..653982c0e 100644 --- a/lib/react-chart-editor.ie.min.css +++ b/lib/react-chart-editor.ie.min.css @@ -1 +1 @@ -.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:#2a3f5f}@keyframes a{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}@keyframes b{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(20px)}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;transform:translateY(20px);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;transform:none;animation:b .1s forwards cubic-bezier(.19,1,.22,1)}.editor_controls{position:relative;width:436px;flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Open Sans,--apple-default,sans-serif}.editor_controls .sidebar{-ms-user-select:none;user-select:none;height:100%;min-width:100px;width:100px;max-width:100px;text-align:center;background:#fff;overflow-y:auto;overflow-x:hidden;float:left;border-right:1px solid #c8d4e3;flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .sidebar__group{background-color:#fff;cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:#506784;font-size:14px;font-weight:500;padding:12px 0;text-transform:capitalize;text-align:left;border-bottom:1px solid #dfe8f3;display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:24px}.editor_controls .sidebar__group__title__icon{position:absolute;transform:scale(.9) translateX(2px) translateY(-4px);transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:#2a3f5f;cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:600;color:#2a3f5f}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:#119dff}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .sidebar__item{color:#506784;cursor:pointer;font-size:14px;font-weight:500;line-height:14px;text-transform:capitalize;background-color:#f3f6fa;padding:10px;padding-left:18px;padding-right:6px;text-align:left;border-bottom:1px solid #dfe8f3;position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:#119dff;transform:scaleX(0);transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:#ebf0f8}.editor_controls .sidebar__item--is-active{color:#2a3f5f;font-weight:600;cursor:default}.editor_controls .sidebar__item--is-active:before{transform:none}.editor_controls .sidebar__item--is-active span{transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:12px;box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls__wrapper>.panel{background-color:#ebf0f8;border-right:1px solid #c8d4e3;width:335px}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:12px;display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:14px;float:left;color:#506784;display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:#a2b1c6;padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:335px;border-right:1px solid #c8d4e3;height:100%;padding:12px;background-color:#ebf0f8;box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:48px;margin-bottom:12px;opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:#a2b1c6}.editor_controls .panel__empty__message__heading{color:#2a3f5f;font-size:24px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px}.editor_controls .panel__empty__message__content{font-size:13px;color:#506784;line-height:1.6}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-ms-user-select:none;user-select:none;margin-bottom:12px}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:6px 12px;color:#fff;font-size:13px;border:1px solid #2a3f5f;background-color:#2a3f5f;height:15px;border-radius:5px;text-shadow:0 1px 2px rgba(42,63,95,.7);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out}.editor_controls .fold__top:hover{cursor:pointer;background-color:#2a3f5f}.editor_controls .fold__top svg{width:18px;height:18px;display:block;filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:#fff;background-color:#506784;border:1px solid #506784;border-radius:5px 5px 0 0;text-shadow:0 1px 1px rgba(42,63,95,.4)}.editor_controls .fold__top--open svg{filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:#506784}.editor_controls .fold__top__icon{display:block;margin-right:6px;transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:12px/3;font-size:14px;line-height:14px;font-weight:600;transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:transform .1s ease-in-out;transform:rotate(-90deg);font-weight:700;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:#fff;border:1px solid #c8d4e3;border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:Dosis,Arial,sans-serif;display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:#119dff;display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:#506784}.editor_controls .fold__content__empty__message__secondary{font-family:Open Sans,--apple-default,sans-serif;font-size:12px;text-align:center;color:#506784}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:13px;color:#2a3f5f;font-weight:600;cursor:default;background-color:#f3f6fa;padding:6px 12px;clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:1px solid #dfe8f3}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:6px;width:100%}.editor_controls .menupanel__label{font-weight:600;padding-right:6px}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:#a2b1c6!important;padding-left:6px}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:#119dff!important}.editor_controls .menupanel__icon-span{font-size:12px;display:flex}.editor_controls .menupanel__icon-span--question{color:#506784}.editor_controls .info__title{color:#2a3f5f;font-size:18px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px;padding:12px 12px 6px}.editor_controls .info__text{padding:6px 12px;color:#506784;font-size:12px;font-weight:500;line-height:1.6}.editor_controls .info__sub-text{color:#506784;font-size:12px;font-weight:500;font-style:italic;line-height:1.6;padding:6px 12px 12px}.editor_controls .modalbox{position:absolute;border-radius:5px;overflow:hidden;text-transform:none;text-align:left;border:1px solid #c8d4e3;align-content:center;box-shadow:0 2px 9px rgba(80,103,132,.2);left:-6px;width:calc(100% + 12px);top:calc(100% + 6px);background-color:#fff;z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:#506784}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;animation-duration:1s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:#a2b1c6;position:fixed}.editor_controls .modal__card{background:#fff;border-radius:5px;position:relative;z-index:1003;max-width:calc(100% - 24px);box-shadow:0 2px 9px rgba(80,103,132,.2);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;animation-duration:.85s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:#506784;padding:12px;font-weight:600}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:#f3f6fa;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{animation-duration:.85s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;color:#506784;font-size:13px;background:#dfe8f3;border:1px solid #c8d4e3;border-bottom:0;position:relative;background:#f3f6fa;transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:#dfe8f3;margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:12px 12px 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:5px}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:5px;border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:#ebf0f8;cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:#ebf0f8;pointer-events:none;margin-top:0;color:#2a3f5f;border-top-color:#119dff;border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:#ebf0f8;left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:1px solid #c8d4e3;display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:1px solid #dfe8f3;color:#506784;display:flex;font-size:13px;font-weight:500;justify-content:flex-start;line-height:13px;min-height:32px;padding:6px 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 12px;-ms-grid-row-align:center;align-self:center;line-height:1.6}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:12px;padding-left:12px;align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{-ms-grid-row-align:center;align-self:center}.editor_controls .field__title{width:80px;padding-left:12px;display:block;font-size:12px;line-height:1.6;color:#506784;padding-top:6px;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:6px;opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:#506784}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:#ef553b}.editor_controls .field .rect,.editor_controls .field .square{border-color:#119dff}.editor_controls .field .rect-grid{border-color:#ebf0f8!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:1px solid #c8d4e3;border-radius:5px;width:80px;cursor:pointer;padding:6px 6px 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:#506784}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:#a2b1c6;padding-top:3px;width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:1px solid #c8d4e3;padding:12px;box-shadow:2px 2px 12px #dfe8f3;border-radius:3px;left:24px}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:#c8d4e3}.editor_controls button{display:inline-block;padding:6px 12px;line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-ms-user-select:none;user-select:none;font-size:14px;font-weight:600;font-family:Open Sans,--apple-default,sans-serif;border:1px solid transparent;border-radius:5px;transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:12px}.editor_controls .button__icon{display:flex;padding-left:6px;will-change:transform}.editor_controls .button__icon svg{transform:scale(.8);transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - 24px);margin-left:12px;margin-right:12px}.editor_controls .button--no-text{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--primary{background-color:#119dff;border-color:#0d76bf;color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--primary svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:active:not(.button--no-text--disabled),.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:#0d76bf;border:1px solid #0d76bf;color:#fff}.editor_controls .button--secondary{background-color:transparent;border-color:#c8d4e3;color:#506784}.editor_controls .button--secondary:active:not(.button--no-text--disabled),.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--tertiary{background-color:transparent;border-color:transparent;color:#506784}.editor_controls .button--tertiary:active:not(.button--no-text--disabled),.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid transparent;color:#2a3f5f}.editor_controls .button--upgrade{background-color:#ab63fa;border-color:var(--color-lavender-shade-dark);color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--upgrade svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:#934bde;border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-lavender-shade-dark);border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--header{background-color:transparent;border-color:#119dff;color:#119dff}.editor_controls .button--header:active:not(.button--no-text--disabled),.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #0d76bf;color:#0d76bf}.editor_controls .checkbox__group{padding-left:12px;text-align:left}.editor_controls .checkbox__item{-ms-user-select:none;user-select:none;cursor:default;padding-top:3px;padding-bottom:3px}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:#f3f6fa}.editor_controls .checkbox__box--checked{border:1px solid #0d76bf;background:#119dff}.editor_controls .checkbox__box--checked:hover{background:#0d76bf}.editor_controls .checkbox__box--checked+.checkbox__label{color:#2a3f5f}.editor_controls .checkbox__check{color:#506784;font-size:12px;position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:#fff}.editor_controls .checkbox__label{padding-left:6px;font-size:13px;color:#506784;display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:1px solid #c8d4e3;padding:3px}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:12px;color:#506784;font-weight:600;font-size:12px;display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:3px}.editor_controls .colorpicker__custom-input input{border:1px solid #c8d4e3!important;box-shadow:none!important;background-color:#fff;color:#2a3f5f}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:3px 0}.editor_controls .colorpicker__controls .colorpicker__active{height:24px;width:24px;margin:3px 0 0 12px}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:3px;border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - 12px - 12px)}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:6px;text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:#a2b1c6;background-color:#fff!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:#fff}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:#119dff}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:#506784}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:#fff;border:1px solid #c8d4e3;box-shadow:none!important;color:#506784}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#506784}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:#c8d4e3 transparent transparent}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:1px solid #c8d4e3;border-top-color:#c8d4e3;background-color:transparent;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;color:#666;cursor:pointer;display:block;padding:8px 10px;color:#506784;background-color:#fff}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:#2a3f5f;font-weight:600;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:#f3f6fa;color:#2a3f5f}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:6px}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:#fff!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:#a2b1c6}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent #119dff!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:#119dff!important}.editor_controls .dropdown-container .Select-option:hover{color:#2a3f5f;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-value-label{color:#506784!important}.editor_controls .dropdown-container .Select-placeholder{color:#a2b1c6}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:#506784}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:#c8d4e3}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:#dfe8f3}.editor_controls ::-webkit-input-placeholder{color:#a2b1c6}.editor_controls ::-moz-placeholder{color:#a2b1c6}.editor_controls :-ms-input-placeholder{color:#a2b1c6}.editor_controls :-moz-placeholder{color:#a2b1c6}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:#506784}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:6px;margin-right:12px;vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:#f3f6fa;border:1px solid #c8d4e3;border-radius:1px;line-height:12px;text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:#506784!important}.editor_controls .text-input{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:1.2;display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:6px 12px;background-color:#fff;border:1px solid #c8d4e3;display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:12px}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:#f3f6fa;color:#2a3f5f}.editor_controls .radio-block__option--active{background-color:#119dff;color:#fff;border:1px solid #0d76bf;margin-left:-1px;cursor:default;text-shadow:0 1px 2px rgba(42,63,95,.7);font-weight:600}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:1px solid #0d76bf!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:3px;border-bottom-right-radius:3px;border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:1px solid #c8d4e3}.editor_controls .text-editor{overflow:hidden;border:1px solid #c8d4e3;border-radius:5px;min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:1px solid #c8d4e3}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:6px;resize:none;line-height:24px;font-size:13px;color:#506784;background-color:#fff}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:#506784;display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:1px solid #c8d4e3;width:100%;display:block;color:#506784}.editor_controls .multi-format-editor__tab.selected{background:#f3f6fa;font-weight:600}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:#2a3f5f;background-color:#f3f6fa}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:#f3f6fa;display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:#2a3f5f;margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:12px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:12px;width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid #dfe8f3;-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:600;color:#506784}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:#506784}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:#506784;display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:#f3f6fa;font-size:14px;padding:10px 0;-ms-user-select:none;user-select:none;border-bottom:1px solid #c8d4e3}.editor_controls .rich-text-editor__controls .icon-link{transform:translateY(3px);display:inline-block;fill:#506784;width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:#f3f6fa;border:1px solid #c8d4e3;padding:12px;position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:1px solid #c8d4e3;color:#506784;overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:#506784;cursor:pointer;display:inline-block;margin:0;min-height:24px;min-width:24px;text-align:center;background-color:transparent;border:1px solid #c8d4e3;border-radius:3px;line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 6px}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:#119dff;border:1px solid #0d76bf;color:#fff}.editor_controls .rich-text-editor__styleButton--active:hover:before{transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:#119dff;will-change:transform;transform-origin:center center;transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:#2a3f5f;background-color:#fff}.editor_controls .rich-text-editor__styleButton:hover:before{transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:6px}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 6px;min-width:60px;position:relative;background:#f3f6fa;touch-action:none;border:1px solid #c8d4e3;flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid #c8d4e3;cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:#119dff;border:1px solid #119dff;border-radius:10px;transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:#119dff;display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:6px}.editor_controls .trace-grid{display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:1px solid #dfe8f3;height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{-ms-grid-column-span:2;grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(90px)[2];grid-template-columns:repeat(2,90px);-ms-grid-rows:(112px)[2];grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 12px 12px}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:600;color:#506784;text-align:left;display:flex;align-items:center;justify-content:flex-start;border-top:1px solid #dfe8f3;width:100%;padding:12px 24px 0;box-sizing:border-box}.editor_controls .trace-item{width:90px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-grow:0;margin-top:12px;color:#506784;transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:#119dff;border-width:2px;color:#119dff}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:6px;justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{transform:translateX(-10px);opacity:0;pointer-events:none;color:#a2b1c6;transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:6px}.editor_controls .trace-item__actions__item:hover{color:#119dff}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:#119dff}.editor_controls .trace-item:hover .trace-item__label{color:#119dff}.editor_controls .trace-item:hover .trace-item__image{border-color:#119dff}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid #c8d4e3;width:60px;height:60px;border-radius:5px;background:#fff;box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:6px}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:#506784}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:600;width:72px;height:34px;margin-top:6px;color:#506784;text-transform:capitalize;font-size:12px;text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:#a2b1c6}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:1px solid #c8d4e3;width:100%;height:36px;border-radius:5px;padding:0 6px}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:#a2b1c6}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:6px}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed #c8d4e3;height:160px;box-sizing:border-box;padding:8px;border-radius:5px}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:#f8f8f9;border-radius:5px;display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:#119dff}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{transform:translateZ(0);backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all .18s ease-in-out 0s;position:absolute;box-sizing:border-box;z-index:10;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:13px;font-weight:400;text-transform:none;padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file +.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:#2a3f5f}@keyframes a{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}@keyframes b{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(20px)}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;transform:translateY(20px);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;transform:none;animation:b .1s forwards cubic-bezier(.19,1,.22,1)}.editor_controls{position:relative;width:436px;flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Open Sans,--apple-default,sans-serif}.editor_controls .sidebar{-ms-user-select:none;user-select:none;height:100%;min-width:100px;width:100px;max-width:100px;text-align:center;background:#fff;overflow-y:auto;overflow-x:hidden;float:left;border-right:1px solid #c8d4e3;flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .sidebar__group{background-color:#fff;cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:#506784;font-size:14px;font-weight:500;padding:12px 0;text-transform:capitalize;text-align:left;border-bottom:1px solid #dfe8f3;display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:24px}.editor_controls .sidebar__group__title__icon{position:absolute;transform:scale(.9) translateX(2px) translateY(-4px);transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:#2a3f5f;cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:600;color:#2a3f5f}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:#119dff}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .sidebar__item{color:#506784;cursor:pointer;font-size:14px;font-weight:500;line-height:14px;text-transform:capitalize;background-color:#f3f6fa;padding:10px;padding-left:18px;padding-right:6px;text-align:left;border-bottom:1px solid #dfe8f3;position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:#119dff;transform:scaleX(0);transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:#ebf0f8}.editor_controls .sidebar__item--is-active{color:#2a3f5f;font-weight:600;cursor:default}.editor_controls .sidebar__item--is-active:before{transform:none}.editor_controls .sidebar__item--is-active span{transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:12px;box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls__wrapper>.panel{background-color:#ebf0f8;border-right:1px solid #c8d4e3;width:335px}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:12px;display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:14px;float:left;color:#506784;display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:#a2b1c6;padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:335px;border-right:1px solid #c8d4e3;height:100%;padding:12px;background-color:#ebf0f8;box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:48px;margin-bottom:12px;opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:#a2b1c6}.editor_controls .panel__empty__message__heading{color:#2a3f5f;font-size:24px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px}.editor_controls .panel__empty__message__content{font-size:13px;color:#506784;line-height:1.6}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-ms-user-select:none;user-select:none;margin-bottom:12px}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:6px 12px;color:#fff;font-size:13px;border:1px solid #2a3f5f;background-color:#2a3f5f;height:15px;border-radius:5px;text-shadow:0 1px 2px rgba(42,63,95,.7);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out;box-sizing:content-box}.editor_controls .fold__top:hover{cursor:pointer;background-color:#2a3f5f}.editor_controls .fold__top svg{width:18px;height:18px;display:block;filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:#fff;background-color:#506784;border:1px solid #506784;border-radius:5px 5px 0 0;text-shadow:0 1px 1px rgba(42,63,95,.4)}.editor_controls .fold__top--open svg{filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:#506784}.editor_controls .fold__top__icon{display:block;margin-right:6px;transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:12px/3;font-size:14px;line-height:14px;font-weight:600;transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:transform .1s ease-in-out;transform:rotate(-90deg);font-weight:700;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:#fff;border:1px solid #c8d4e3;border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:Dosis,Arial,sans-serif;display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:#119dff;display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:#506784}.editor_controls .fold__content__empty__message__secondary{font-family:Open Sans,--apple-default,sans-serif;font-size:12px;text-align:center;color:#506784}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:13px;color:#2a3f5f;font-weight:600;cursor:default;background-color:#f3f6fa;padding:6px 12px;clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:1px solid #dfe8f3}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:6px;width:100%}.editor_controls .menupanel__label{font-weight:600;padding-right:6px}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:#a2b1c6!important;padding-left:6px}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:#119dff!important}.editor_controls .menupanel__icon-span{font-size:12px;display:flex}.editor_controls .menupanel__icon-span--question{color:#506784}.editor_controls .info__title{color:#2a3f5f;font-size:18px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px;padding:12px 12px 6px}.editor_controls .info__text{padding:6px 12px;color:#506784;font-size:12px;font-weight:500;line-height:1.6}.editor_controls .info__sub-text{color:#506784;font-size:12px;font-weight:500;font-style:italic;line-height:1.6;padding:6px 12px 12px}.editor_controls .modalbox{position:absolute;border-radius:5px;overflow:hidden;text-transform:none;text-align:left;border:1px solid #c8d4e3;align-content:center;box-shadow:0 2px 9px rgba(80,103,132,.2);left:-6px;width:calc(100% + 12px);top:calc(100% + 6px);background-color:#fff;z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:#506784}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;animation-duration:1s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:#a2b1c6;position:fixed}.editor_controls .modal__card{background:#fff;border-radius:5px;position:relative;z-index:1003;max-width:calc(100% - 24px);box-shadow:0 2px 9px rgba(80,103,132,.2);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;animation-duration:.85s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:#506784;padding:12px;font-weight:600}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:#f3f6fa;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{animation-duration:.85s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;color:#506784;font-size:13px;background:#dfe8f3;border:1px solid #c8d4e3;border-bottom:0;position:relative;background:#f3f6fa;transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:#dfe8f3;margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:12px 12px 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:5px}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:5px;border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:#ebf0f8;cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:#ebf0f8;pointer-events:none;margin-top:0;color:#2a3f5f;border-top-color:#119dff;border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:#ebf0f8;left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:1px solid #c8d4e3;display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:1px solid #dfe8f3;color:#506784;display:flex;font-size:13px;font-weight:500;justify-content:flex-start;line-height:13px;min-height:32px;padding:6px 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 12px;-ms-grid-row-align:center;align-self:center;line-height:1.6}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:12px;padding-left:12px;align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{-ms-grid-row-align:center;align-self:center}.editor_controls .field__title{width:80px;padding-left:12px;display:block;font-size:12px;line-height:1.6;color:#506784;padding-top:6px;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:6px;opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:#506784}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:#ef553b}.editor_controls .field .rect,.editor_controls .field .square{border-color:#119dff}.editor_controls .field .rect-grid{border-color:#ebf0f8!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:1px solid #c8d4e3;border-radius:5px;width:80px;cursor:pointer;padding:6px 6px 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:#506784}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:#a2b1c6;padding-top:3px;width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:1px solid #c8d4e3;padding:12px;box-shadow:2px 2px 12px #dfe8f3;border-radius:3px;left:24px}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:#c8d4e3}.editor_controls button{display:inline-block;padding:6px 12px;line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-ms-user-select:none;user-select:none;font-size:14px;font-weight:600;font-family:Open Sans,--apple-default,sans-serif;border:1px solid transparent;border-radius:5px;transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:12px}.editor_controls .button__icon{display:flex;padding-left:6px;will-change:transform}.editor_controls .button__icon svg{transform:scale(.8);transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - 24px);margin-left:12px;margin-right:12px}.editor_controls .button--no-text{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--primary{background-color:#119dff;border-color:#0d76bf;color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--primary svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:active:not(.button--no-text--disabled),.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:#0d76bf;border:1px solid #0d76bf;color:#fff}.editor_controls .button--secondary{background-color:transparent;border-color:#c8d4e3;color:#506784}.editor_controls .button--secondary:active:not(.button--no-text--disabled),.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--tertiary{background-color:transparent;border-color:transparent;color:#506784}.editor_controls .button--tertiary:active:not(.button--no-text--disabled),.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid transparent;color:#2a3f5f}.editor_controls .button--upgrade{background-color:#ab63fa;border-color:var(--color-lavender-shade-dark);color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--upgrade svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:#934bde;border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-lavender-shade-dark);border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--header{background-color:transparent;border-color:#119dff;color:#119dff}.editor_controls .button--header:active:not(.button--no-text--disabled),.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #0d76bf;color:#0d76bf}.editor_controls .checkbox__group{padding-left:12px;text-align:left}.editor_controls .checkbox__item{-ms-user-select:none;user-select:none;cursor:default;padding-top:3px;padding-bottom:3px}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:#f3f6fa}.editor_controls .checkbox__box--checked{border:1px solid #0d76bf;background:#119dff}.editor_controls .checkbox__box--checked:hover{background:#0d76bf}.editor_controls .checkbox__box--checked+.checkbox__label{color:#2a3f5f}.editor_controls .checkbox__check{color:#506784;font-size:12px;position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:#fff}.editor_controls .checkbox__label{padding-left:6px;font-size:13px;color:#506784;display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:1px solid #c8d4e3;padding:3px}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:12px;color:#506784;font-weight:600;font-size:12px;display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:3px}.editor_controls .colorpicker__custom-input input{border:1px solid #c8d4e3!important;box-shadow:none!important;background-color:#fff;color:#2a3f5f}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:3px 0}.editor_controls .colorpicker__controls .colorpicker__active{height:24px;width:24px;margin:3px 0 0 12px}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:3px;border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - 12px - 12px)}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:6px;text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:#a2b1c6;background-color:#fff!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:#fff}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:#119dff}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:#506784}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:#fff;border:1px solid #c8d4e3;box-shadow:none!important;color:#506784}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#506784}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:#c8d4e3 transparent transparent}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:1px solid #c8d4e3;border-top-color:#c8d4e3;background-color:transparent;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;color:#666;cursor:pointer;display:block;padding:8px 10px;color:#506784;background-color:#fff}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:#2a3f5f;font-weight:600;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:#f3f6fa;color:#2a3f5f}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:6px}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:#fff!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:#a2b1c6}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent #119dff!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:#119dff!important}.editor_controls .dropdown-container .Select-option:hover{color:#2a3f5f;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-value-label{color:#506784!important}.editor_controls .dropdown-container .Select-placeholder{color:#a2b1c6}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:#506784}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:#c8d4e3}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:#dfe8f3}.editor_controls ::-webkit-input-placeholder{color:#a2b1c6}.editor_controls ::-moz-placeholder{color:#a2b1c6}.editor_controls :-ms-input-placeholder{color:#a2b1c6}.editor_controls :-moz-placeholder{color:#a2b1c6}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:#506784}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:6px;margin-right:12px;vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:#f3f6fa;border:1px solid #c8d4e3;border-radius:1px;line-height:12px;text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:#506784!important}.editor_controls .text-input{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:1.2;display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:6px 12px;background-color:#fff;border:1px solid #c8d4e3;display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:12px}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:#f3f6fa;color:#2a3f5f}.editor_controls .radio-block__option--active{background-color:#119dff;color:#fff;border:1px solid #0d76bf;margin-left:-1px;cursor:default;text-shadow:0 1px 2px rgba(42,63,95,.7);font-weight:600}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:1px solid #0d76bf!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:3px;border-bottom-right-radius:3px;border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:1px solid #c8d4e3}.editor_controls .text-editor{overflow:hidden;border:1px solid #c8d4e3;border-radius:5px;min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:1px solid #c8d4e3}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:6px;resize:none;line-height:24px;font-size:13px;color:#506784;background-color:#fff}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:#506784;display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:1px solid #c8d4e3;width:100%;display:block;color:#506784}.editor_controls .multi-format-editor__tab.selected{background:#f3f6fa;font-weight:600}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:#2a3f5f;background-color:#f3f6fa}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:#f3f6fa;display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:#2a3f5f;margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:12px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:12px;width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid #dfe8f3;-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:600;color:#506784}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:#506784}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:#506784;display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:#f3f6fa;font-size:14px;padding:10px 0;-ms-user-select:none;user-select:none;border-bottom:1px solid #c8d4e3}.editor_controls .rich-text-editor__controls .icon-link{transform:translateY(3px);display:inline-block;fill:#506784;width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:#f3f6fa;border:1px solid #c8d4e3;padding:12px;position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:1px solid #c8d4e3;color:#506784;overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:#506784;cursor:pointer;display:inline-block;margin:0;min-height:24px;min-width:24px;text-align:center;background-color:transparent;border:1px solid #c8d4e3;border-radius:3px;line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 6px}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:#119dff;border:1px solid #0d76bf;color:#fff}.editor_controls .rich-text-editor__styleButton--active:hover:before{transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:#119dff;will-change:transform;transform-origin:center center;transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:#2a3f5f;background-color:#fff}.editor_controls .rich-text-editor__styleButton:hover:before{transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:6px}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 6px;min-width:60px;position:relative;background:#f3f6fa;touch-action:none;border:1px solid #c8d4e3;flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid #c8d4e3;cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:#119dff;border:1px solid #119dff;border-radius:10px;transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:#119dff;display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:6px}.editor_controls .trace-grid{display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:1px solid #dfe8f3;height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{-ms-grid-column-span:2;grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(90px)[2];grid-template-columns:repeat(2,90px);-ms-grid-rows:(112px)[2];grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 12px 12px}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:600;color:#506784;text-align:left;display:flex;align-items:center;justify-content:flex-start;border-top:1px solid #dfe8f3;width:100%;padding:12px 24px 0;box-sizing:border-box}.editor_controls .trace-item{width:90px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-grow:0;margin-top:12px;color:#506784;transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:#119dff;border-width:2px;color:#119dff}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:6px;justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{transform:translateX(-10px);opacity:0;pointer-events:none;color:#a2b1c6;transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:6px}.editor_controls .trace-item__actions__item:hover{color:#119dff}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:#119dff}.editor_controls .trace-item:hover .trace-item__label{color:#119dff}.editor_controls .trace-item:hover .trace-item__image{border-color:#119dff}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid #c8d4e3;width:60px;height:60px;border-radius:5px;background:#fff;box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:6px}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:#506784}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:600;width:72px;height:34px;margin-top:6px;color:#506784;text-transform:capitalize;font-size:12px;text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:#a2b1c6}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:1px solid #c8d4e3;width:100%;height:36px;border-radius:5px;padding:0 6px}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:#a2b1c6}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:6px}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed #c8d4e3;height:160px;box-sizing:border-box;padding:8px;border-radius:5px}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:#f8f8f9;border-radius:5px;display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:#119dff}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{transform:translateZ(0);backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all .18s ease-in-out 0s;position:absolute;box-sizing:border-box;z-index:10;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:13px;font-weight:400;text-transform:none;padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file diff --git a/lib/react-chart-editor.min.css b/lib/react-chart-editor.min.css index 3f75e9764..b331fc19b 100644 --- a/lib/react-chart-editor.min.css +++ b/lib/react-chart-editor.min.css @@ -1 +1 @@ -.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:var(--color-text-active)}@-webkit-keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@-webkit-keyframes c{0%{opacity:1}to{opacity:0}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;-webkit-animation:d .1s forwards cubic-bezier(.19,1,.22,1);animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;-webkit-animation:c .1s forwards cubic-bezier(.19,1,.22,1);animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px);-webkit-animation:a .1s forwards cubic-bezier(.19,1,.22,1);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;-webkit-transform:none;transform:none;-webkit-animation:b .1s forwards cubic-bezier(.19,1,.22,1);animation:b .1s forwards cubic-bezier(.19,1,.22,1)}:root{--env:$ENV}.plotly-editor--theme-provider{--color-white:#fff;--color-rhino-core:#2a3f5f;--color-rhino-dark:#506784;--color-rhino-medium-1:#a2b1c6;--color-rhino-medium-2:#c8d4e3;--color-rhino-light-1:#dfe8f3;--color-rhino-light-2:#ebf0f8;--color-rhino-light-3:#f3f6fa;--color-rhino-light-4:#fafbfd;--color-rhino-light-5:#f8f8f9;--color-dodger:#119dff;--color-dodger-shade:#0d76bf;--color-dodger-shade-mid:#0d76bf;--color-aqua:#09ffff;--color-aqua-shade:#19d3f3;--color-lavender:#e763fa;--color-lavender-shade:#ab63fa;--color-lavender-shade-mid:#934bde;--color-cornflower:#636efa;--color-emerald:#00cc96;--color-sienna:#ef553b;--color-accent:var(--color-dodger);--color-accent-shade:var(--color-dodger-shade);--color-accent-shade-mid:var(--color-dodger-shade-mid);--color-brand:var(--color-dodger);--color-hightlight-darker:var(--color-gray-blue-pale);--color-text-base:var(--color-rhino-dark);--color-text-light:var(--color-rhino-medium-1);--color-text-dark:var(--color-rhino-core);--color-text-headings:var(--color-text-dark);--color-text-section-header:var(--color-text-dark);--color-text-active:var(--color-rhino-core);--color-text-placeholder:var(--color-rhino-medium-1);--color-border-default:var(--color-rhino-medium-2);--color-border-light:var(--color-rhino-light-1);--color-border-dark:var(--color-rhino-medium-1);--color-border-accent:var(--color-accent);--color-border-accent-shade:var(--color-accent-shade);--color-background:var(--color-rhino-light-2);--color-background-base:var(--color-rhino-light-2);--color-background-light:var(--color-rhino-light-3);--color-background-medium:var(--color-rhino-light-1);--color-background-dark:var(--color-rhino-medium-1);--color-background-top:var(--color-white);--color-background-inverse:var(--color-rhino-dark);--color-background-inputs:var(--color-background-top);--color-button-primary-base-fill:var(--color-accent);--color-button-primary-base-border:var(--color-accent-shade);--color-button-primary-base-text:var(--color-white);--color-button-primary-hover-fill:var(--color-accent-shade-mid);--color-button-primary-hover-border:var(--color-accent-shade);--color-button-primary-hover-text:var(--color-white);--color-button-primary-active-fill:var(--color-accent-shade);--color-button-primary-active-border:var(--color-accent-shade);--color-button-primary-active-text:var(--color-white);--color-button-secondary-base-fill:transparent;--color-button-secondary-base-border:var(--color-rhino-medium-2);--color-button-secondary-base-text:var(--color-text-base);--color-button-secondary-hover-fill:transparent;--color-button-secondary-hover-border:var(--color-rhino-medium-1);--color-button-secondary-hover-text:var(--color-text-dark);--color-button-secondary-active-fill:transparent;--color-button-secondary-active-border:var(--color-rhino-medium-1);--color-button-secondary-active-text:var(--color-text-dark);--color-button-tertiary-base-fill:transparent;--color-button-tertiary-base-border:transparent;--color-button-tertiary-base-text:var(--color-text-base);--color-button-tertiary-hover-fill:transparent;--color-button-tertiary-hover-border:transparent;--color-button-tertiary-hover-text:var(--color-text-dark);--color-button-tertiary-active-fill:transparent;--color-button-tertiary-active-border:transparent;--color-button-tertiary-active-text:var(--color-text-dark);--color-button-default-base-fill:var(--color-background-light);--color-button-default-base-border:var(--color-border-default);--color-button-default-base-text:var(--color-text-base);--color-button-default-hover-fill:var(--color-background-base);--color-button-default-hover-border:var(--color-border-dark);--color-button-default-hover-text:var(--color-text-dark);--color-button-default-active-fill:var(--color-background-dark);--color-button-default-active-border:var(--color-border-dark);--color-button-default-active-text:var(--color-text-dark);--color-button-upgrade-base-fill:var(--color-lavender-shade);--color-button-upgrade-base-border:var(--color-lavender-shade-dark);--color-button-upgrade-base-text:var(--color-white);--color-button-upgrade-hover-fill:var(--color-lavender-shade-mid);--color-button-upgrade-hover-border:var(--color-lavender-shade-dark);--color-button-upgrade-hover-text:var(--color-white);--color-button-upgrade-active-fill:var(--color-lavender-shade-dark);--color-button-upgrade-active-border:var(--color-lavender-shade-dark);--color-button-upgrade-active-text:var(--color-white);--color-button-header-base-fill:transparent;--color-button-header-base-border:var(--color-dodger);--color-button-header-base-text:var(--color-dodger);--color-button-header-hover-fill:transparent;--color-button-header-hover-border:var(--color-dodger-shade-mid);--color-button-header-hover-text:var(--color-dodger-shade);--color-button-header-active-fill:transparent;--color-button-header-active-border:var(--color-dodger-shade);--color-button-header-active-text:var(--color-dodger-shade);--spacing-base-unit:24px;--spacing-half-unit:12px;--spacing-quarter-unit:6px;--spacing-sixth-unit:4px;--spacing-eighth-unit:3px;--font-size-base:13px;--font-size-small:12px;--font-size-medium:14px;--font-size-large:14px;--font-size-heading-base:24px;--font-size-heading-small:18px;--font-size-heading-large:28px;--font-size-h5:16px;--font-weight-light:400;--font-weight-normal:500;--font-weight-semibold:600;--font-weight-bold:700;--font-leading-body:1.6;--font-leading-head:1.2;--font-letter-spacing-headings:0.5px;--font-family-body:"Open Sans",--apple-default,sans-serif;--font-family-headings:"Dosis","Arial",sans-serif;--border-default:1px solid var(--color-border-default);--border-light:1px solid var(--color-border-light);--border-dark:1px solid var(--color-border-dark);--border-accent:1px solid var(--color-border-accent);--border-accent-shade:1px solid var(--color-border-accent-shade);--border-radius:5px;--border-radius-small:3px;--text-shadow-dark-color:rgba(42,63,95,.7);--text-shadow-dark-ui:0 1px 2px var(--text-shadow-dark-color);--text-shadow-dark-ui-inactive:0 1px 1px rgba(42,63,95,.4);--box-shadow-base-color:rgba(80,103,132,.2);--box-shadow-base:0px 2px 9px var(--box-shadow-base-color);--scrollbar-track-background:var(--color-background-base);--scrollbar-thumb-color:var(--color-accent);--panel-background:var(--color-background-base);--panel-width:335px;--fold-header-text-color-base:var(--color-white);--fold-header-text-color-closed:var(--color-white);--fold-header-background-base:var(--color-rhino-dark);--fold-header-background-closed:var(--color-rhino-core);--fold-header-border-color-closed:var(--color-rhino-core);--fold-header-border-color-base:var(--color-rhino-dark);--sidebar-background:var(--color-background-top);--sidebar-width:100px;--sidebar-group-background-base:var(--sidebar-background);--sidebar-item-background-base:var(--color-background-light);--sidebar-item-background-hover:var(--color-background-base);--sidebar-item-background-active:var(--color-background-medium);--editor-width:calc(var(--sidebar-width) + var(--panel-width) + 1px)}.editor_controls{position:relative;width:var(--editor-width);flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--font-family-body)}.editor_controls .sidebar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:100%;min-width:var(--sidebar-width);width:var(--sidebar-width);max-width:var(--sidebar-width);text-align:center;background:var(--sidebar-background);overflow-y:auto;overflow-x:hidden;float:left;border-right:var(--border-default);flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .sidebar__group{background-color:var(--sidebar-group-background-base);cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:var(--color-text-base);font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);padding:var(--spacing-half-unit) 0;text-transform:capitalize;text-align:left;border-bottom:var(--border-light);display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:var(--spacing-base-unit)}.editor_controls .sidebar__group__title__icon{position:absolute;-webkit-transform:scale(.9) translateX(2px) translateY(-4px);transform:scale(.9) translateX(2px) translateY(-4px);-webkit-transform-origin:center center;transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:var(--color-text-active);cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:var(--font-weight-semibold);color:var(--color-text-active)}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:var(--color-accent)}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{-webkit-transform:scale(.9) translateY(-5px) rotate(90deg);transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:var(--box-shadow-base)}.editor_controls .sidebar__item{color:var(--color-text-base);cursor:pointer;font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);line-height:var(--font-size-medium);text-transform:capitalize;background-color:var(--sidebar-item-background-base);padding:10px;padding-left:18px;padding-right:var(--spacing-quarter-unit);text-align:left;border-bottom:var(--border-light);position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:var(--color-accent);-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:left center;transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:var(--sidebar-item-background-hover)}.editor_controls .sidebar__item--is-active{color:var(--color-text-active);font-weight:var(--font-weight-semibold);cursor:default}.editor_controls .sidebar__item--is-active:before{-webkit-transform:none;transform:none}.editor_controls .sidebar__item--is-active span{-webkit-transform:translateX(5px);transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:var(--spacing-half-unit);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls__wrapper>.panel{background-color:var(--panel-background);border-right:var(--border-default);width:calc(var(--panel-width))}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:var(--spacing-half-unit);display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:var(--font-size-medium);float:left;color:var(--color-text-base);display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:var(--color-text-light);padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:var(--panel-width);border-right:var(--border-default);height:100%;padding:var(--spacing-half-unit);background-color:var(--panel-background);box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:calc(var(--spacing-base-unit) * 2);margin-bottom:var(--spacing-half-unit);opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:var(--color-text-light)}.editor_controls .panel__empty__message__heading{color:var(--color-text-headings);font-size:var(--font-size-heading-base);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings)}.editor_controls .panel__empty__message__content{font-size:var(--font-size-base);color:var(--color-text-base);line-height:var(--font-leading-body)}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-bottom:var(--spacing-half-unit)}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);color:var(--fold-header-text-color-closed);font-size:var(--font-size-base);border:1px solid var(--fold-header-border-color-closed);background-color:var(--fold-header-background-closed);height:15px;border-radius:var(--border-radius);text-shadow:var(--text-shadow-dark-ui);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out}.editor_controls .fold__top:hover{cursor:pointer;background-color:var(--fold-header-background-closed)}.editor_controls .fold__top svg{width:18px;height:18px;display:block;-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:var(--fold-header-text-color-base);background-color:var(--fold-header-background-base);border:1px solid var(--fold-header-border-color-base);border-radius:var(--border-radius) var(--border-radius) 0 0;text-shadow:var(--text-shadow-dark-ui-inactive)}.editor_controls .fold__top--open svg{-webkit-filter:drop-shadow(0 1px 1px rgba(42,63,95,.4));filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:var(--fold-header-background-base)}.editor_controls .fold__top__icon{display:block;margin-right:var(--spacing-quarter-unit);-webkit-transform:translateY(-1px);transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:var(--spacing-half-unit)/3;font-size:var(--font-size-medium);line-height:var(--font-size-medium);font-weight:var(--font-weight-semibold);-webkit-transform:translateY(1px);transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{-webkit-transform:translateX(-3px) translateY(-1px);transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:-webkit-transform .1s ease-in-out;transition:transform .1s ease-in-out;transition:transform .1s ease-in-out,-webkit-transform .1s ease-in-out;-webkit-transform:rotate(-90deg);transform:rotate(-90deg);font-weight:700;-webkit-transform-origin:center center;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;-webkit-transform:translateY(-2px);transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:var(--color-background-top);border:var(--border-default);border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:var(--font-family-headings);display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:var(--color-dodger);display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:var(--color-text-base)}.editor_controls .fold__content__empty__message__secondary{font-family:var(--font-family-body);font-size:var(--font-size-small);text-align:center;color:var(--color-text-base)}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:var(--font-size-base);color:var(--color-text-section-header);font-weight:var(--font-weight-semibold);cursor:default;background-color:var(--color-background-light);padding:var(--spacing-quarter-unit) var(--spacing-half-unit);clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:var(--border-light)}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:var(--spacing-quarter-unit);width:100%}.editor_controls .menupanel__label{font-weight:var(--font-weight-semibold);padding-right:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:var(--color-text-light)!important;padding-left:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:var(--color-accent)!important}.editor_controls .menupanel__icon-span{font-size:var(--font-size-small);display:flex}.editor_controls .menupanel__icon-span--question{color:var(--color-text-base)}.editor_controls .info__title{color:var(--color-text-headings);font-size:var(--font-size-heading-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings);padding:var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit)}.editor_controls .info__text{padding:var(--spacing-quarter-unit) var(--spacing-half-unit)}.editor_controls .info__sub-text,.editor_controls .info__text{color:var(--color-text-base);font-size:var(--font-size-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-body)}.editor_controls .info__sub-text{font-style:italic;padding:var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .modalbox{position:absolute;border-radius:var(--border-radius);overflow:hidden;text-transform:none;text-align:left;border:var(--border-default);align-content:center;box-shadow:var(--box-shadow-base);left:calc(var(--spacing-quarter-unit) * -1);width:calc(100% + var(--spacing-half-unit));top:calc(100% + var(--spacing-quarter-unit));background-color:var(--color-background-top);z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:var(--color-background-inverse)}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:var(--color-background-dark);position:fixed}.editor_controls .modal__card{background:var(--color-background-top);border-radius:var(--border-radius);position:relative;z-index:1003;max-width:calc(100% - var(--spacing-base-unit));box-shadow:var(--box-shadow-base);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:.1s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:var(--color-text-base);padding:var(--spacing-half-unit);font-weight:var(--font-weight-semibold)}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:var(--color-background-light);border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:var(--spacing-quarter-unit);color:var(--color-text-base);font-size:var(--font-size-base);background:var(--color-background-medium);border:var(--border-default);border-bottom:0;position:relative;background:var(--color-background-light);transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:var(--color-background-medium);margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:var(--spacing-half-unit) var(--spacing-half-unit) 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:var(--border-radius)}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:var(--border-radius);border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:var(--color-background-base);cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:var(--color-background-base);pointer-events:none;margin-top:0;color:var(--color-text-active);border-top-color:var(--color-accent);border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:var(--color-background-base);left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:var(--border-default);display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:var(--border-light);color:var(--color-text-base);display:flex;font-size:var(--font-size-base);font-weight:var(--font-weight-normal);justify-content:flex-start;line-height:var(--font-size-base);min-height:32px;padding:var(--spacing-quarter-unit) 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 var(--spacing-half-unit);align-self:center;line-height:var(--font-leading-body)}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:var(--spacing-half-unit);padding-left:var(--spacing-half-unit);align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{align-self:center}.editor_controls .field__title{width:80px;padding-left:var(--spacing-half-unit);display:block;font-size:var(--font-size-small);line-height:var(--font-leading-body);color:var(--color-text-base);padding-top:var(--spacing-quarter-unit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:var(--spacing-quarter-unit);opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:var(--color-text-base)}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:var(--color-sienna)}.editor_controls .field .rect,.editor_controls .field .square{border-color:var(--color-accent)}.editor_controls .field .rect-grid{border-color:var(--panel-background)!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:var(--border-default);border-radius:var(--border-radius);width:80px;cursor:pointer;padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:var(--color-background-inverse)}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:var(--color-text-light);padding-top:var(--spacing-eighth-unit);width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:var(--border-default);padding:var(--spacing-half-unit);box-shadow:2px 2px var(--spacing-half-unit) var(--color-border-light);border-radius:var(--border-radius-small);left:var(--spacing-base-unit)}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:var(--color-border-default)}.editor_controls button{display:inline-block;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:var(--font-size-medium);font-weight:var(--font-weight-semibold);font-family:var(--font-family-body);border:1px solid transparent;border-radius:var(--border-radius);transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:var(--spacing-half-unit)}.editor_controls .button__icon{display:flex;padding-left:var(--spacing-quarter-unit);will-change:transform}.editor_controls .button__icon svg{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - var(--spacing-base-unit));margin-left:var(--spacing-half-unit);margin-right:var(--spacing-half-unit)}.editor_controls .button--no-text{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--no-text--disabled{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--default{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text)}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--primary{background-color:var(--color-button-primary-base-fill);border-color:var(--color-button-primary-base-border);color:var(--color-button-primary-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--primary svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:var(--color-button-primary-hover-fill);border:1px solid var(--color-button-primary-hover-border);color:var(--color-button-primary-hover-text)}.editor_controls .button--primary:active:not(.button--no-text--disabled){background-color:var(--color-button-primary-active-fill);border:1px solid var(--color-button-primary-active-border);color:var(--color-button-primary-active-text)}.editor_controls .button--secondary{background-color:var(--color-button-secondary-base-fill);border-color:var(--color-button-secondary-base-border);color:var(--color-button-secondary-base-text)}.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:var(--color-button-secondary-hover-fill);border:1px solid var(--color-button-secondary-hover-border);color:var(--color-button-secondary-hover-text)}.editor_controls .button--secondary:active:not(.button--no-text--disabled){background-color:var(--color-button-secondary-active-fill);border:1px solid var(--color-button-secondary-active-border);color:var(--color-button-secondary-active-text)}.editor_controls .button--tertiary{background-color:var(--color-button-tertiary-base-fill);border-color:var(--color-button-tertiary-base-border);color:var(--color-button-tertiary-base-text)}.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-hover-fill);border:1px solid var(--color-button-tertiary-hover-border);color:var(--color-button-tertiary-hover-text)}.editor_controls .button--tertiary:active:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-active-fill);border:1px solid var(--color-button-tertiary-active-border);color:var(--color-button-tertiary-active-text)}.editor_controls .button--upgrade{background-color:var(--color-button-upgrade-base-fill);border-color:var(--color-button-upgrade-base-border);color:var(--color-button-upgrade-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--upgrade svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-hover-fill);border:1px solid var(--color-button-upgrade-hover-border);color:var(--color-button-upgrade-hover-text)}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-active-fill);border:1px solid var(--color-button-upgrade-active-border);color:var(--color-button-upgrade-active-text)}.editor_controls .button--header{background-color:var(--color-button-header-base-fill);border-color:var(--color-button-header-base-border);color:var(--color-button-header-base-text)}.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:var(--color-button-header-hover-fill);border:1px solid var(--color-button-header-hover-border);color:var(--color-button-header-hover-text)}.editor_controls .button--header:active:not(.button--no-text--disabled){background-color:var(--color-button-header-active-fill);border:1px solid var(--color-button-header-active-border);color:var(--color-button-header-active-text)}.editor_controls .checkbox__group{padding-left:var(--spacing-half-unit);text-align:left}.editor_controls .checkbox__item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;padding-top:var(--spacing-eighth-unit);padding-bottom:var(--spacing-eighth-unit)}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:var(--color-background-light)}.editor_controls .checkbox__box--checked{border:var(--border-accent-shade);background:var(--color-accent)}.editor_controls .checkbox__box--checked:hover{background:var(--color-accent-shade)}.editor_controls .checkbox__box--checked+.checkbox__label{color:var(--color-text-active)}.editor_controls .checkbox__check{color:var(--color-text-base);font-size:var(--spacing-half-unit);position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:var(--color-white)}.editor_controls .checkbox__label{padding-left:var(--spacing-quarter-unit);font-size:var(--font-size-base);color:var(--color-text-base);display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:var(--border-default);padding:var(--spacing-eighth-unit)}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:var(--spacing-half-unit);color:var(--color-text-base);font-weight:var(--font-weight-semibold);font-size:var(--font-size-small);display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:var(--spacing-eighth-unit)}.editor_controls .colorpicker__custom-input input{border:var(--border-default)!important;box-shadow:none!important;background-color:var(--color-background-inputs);color:var(--color-text-dark)}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:var(--spacing-eighth-unit) 0}.editor_controls .colorpicker__controls .colorpicker__active{height:var(--spacing-base-unit);width:var(--spacing-base-unit);margin:var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit)}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--border-radius-small);border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit))}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:var(--spacing-quarter-unit);text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:var(--color-border-dark);background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:var(--color-border-accent)}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:var(--color-text-base)}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{background-color:#fff;border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:var(--color-background-inputs);border:var(--border-default);box-shadow:none!important;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{-webkit-animation:e .4s infinite linear;animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{-webkit-animation:d .2s;animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:var(--color-border-default) transparent transparent}@-webkit-keyframes d{0%{opacity:0}to{opacity:1}}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:var(--border-default);border-top-color:var(--color-border-default);background-color:transparent;box-shadow:var(--box-shadow-base)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;background-color:#fff;color:#666;cursor:pointer;display:block;padding:8px 10px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:var(--color-text-active);font-weight:var(--font-weight-semibold);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:var(--color-border-dark)}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-option:hover{color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-value-label{color:var(--color-text-base)!important}.editor_controls .dropdown-container .Select-placeholder{color:var(--color-text-placeholder)}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:var(--color-background-inverse)}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:var(--color-border-default)}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:var(--color-border-light)}.editor_controls ::-webkit-input-placeholder{color:var(--color-text-placeholder)}.editor_controls ::-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls :-ms-input-placeholder{color:var(--color-text-placeholder)}.editor_controls :-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:var(--color-text-base)}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:var(--spacing-quarter-unit);margin-right:var(--spacing-half-unit);vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:var(--color-background-light);border:var(--border-default);border-radius:1px;line-height:var(--spacing-half-unit);text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:var(--color-text-base)!important}.editor_controls .text-input{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:var(--font-leading-head);display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);background-color:var(--color-background-top);border:var(--border-default);display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:var(--font-size-small)}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .radio-block__option--active{background-color:var(--color-button-primary-base-fill);color:var(--color-button-primary-base-text);border:1px solid var(--color-button-primary-base-border);margin-left:-1px;cursor:default;text-shadow:var(--text-shadow-dark-ui);font-weight:var(--font-weight-semibold)}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:var(--border-accent-shade)!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:var(--border-radius-small);border-bottom-right-radius:var(--border-radius-small);border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:var(--border-radius-small);border-bottom-left-radius:var(--border-radius-small)}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:var(--border-default)}.editor_controls .text-editor{overflow:hidden;border:var(--border-default);border-radius:var(--border-radius);min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:var(--border-default)}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:var(--spacing-quarter-unit);resize:none;line-height:24px;font-size:13px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:var(--color-text-base);display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:var(--border-default)}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:var(--border-default)}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:var(--border-default);width:100%;display:block;color:var(--color-text-base)}.editor_controls .multi-format-editor__tab.selected{background:var(--color-background-light);font-weight:var(--font-weight-semibold)}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:var(--color-background-light);display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:var(--color-text-section-header);margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:var(--spacing-half-unit)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:var(--spacing-half-unit);width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid var(--color-border-light);-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:var(--font-weight-semibold);color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:var(--color-text-base);display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:var(--color-background-light);font-size:14px;padding:10px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:var(--border-default)}.editor_controls .rich-text-editor__controls .icon-link{-webkit-transform:translateY(3px);transform:translateY(3px);display:inline-block;fill:var(--color-text-base);width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:var(--color-background-light);border:var(--border-default);padding:var(--spacing-half-unit);position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:var(--border-default);color:var(--color-text-base);overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:var(--color-text-base);cursor:pointer;display:inline-block;margin:0;min-height:var(--spacing-base-unit);min-width:var(--spacing-base-unit);text-align:center;background-color:transparent;border:var(--border-default);border-radius:var(--border-radius-small);line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:var(--color-accent);border:var(--border-accent-shade);color:var(--color-white)}.editor_controls .rich-text-editor__styleButton--active:hover:before{-webkit-transform:scaleX(0);transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:var(--color-accent);will-change:transform;-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:scaleX(0);transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:var(--color-text-active);background-color:var(--color-background-top)}.editor_controls .rich-text-editor__styleButton:hover:before{-webkit-transform:none;transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 var(--spacing-quarter-unit);min-width:60px;position:relative;background:var(--color-background-light);touch-action:none;border:1px solid var(--color-border-default);flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid var(--color-border-default);cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:var(--color-accent);border:var(--border-accent);border-radius:10px;-webkit-transform:translateY(-1px);transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:var(--color-accent);display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:var(--spacing-quarter-unit)}.editor_controls .trace-grid{display:grid;grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:var(--border-light);height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(2,90px);grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:var(--font-weight-semibold);text-align:left;border-top:var(--border-light);width:100%;padding:var(--spacing-half-unit) var(--spacing-base-unit) 0;box-sizing:border-box}.editor_controls .trace-grid__column__header,.editor_controls .trace-item{color:var(--color-text-base);display:flex;align-items:center;justify-content:flex-start}.editor_controls .trace-item{width:90px;flex-direction:column;flex-grow:0;margin-top:var(--spacing-half-unit);transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:var(--color-accent);border-width:2px;color:var(--color-accent)}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:var(--spacing-quarter-unit);justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{-webkit-transform:translateX(-10px);transform:translateX(-10px);opacity:0;pointer-events:none;color:var(--color-text-light);transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .trace-item__actions__item:hover{color:var(--color-accent)}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__label{color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__image{border-color:var(--color-accent)}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid var(--color-border-default);width:60px;height:60px;border-radius:var(--border-radius);background:var(--color-background-top);box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:var(--spacing-quarter-unit)}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:var(--color-text-base)}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:var(--font-weight-semibold);width:72px;height:34px;margin-top:var(--spacing-quarter-unit);color:var(--color-text-base);text-transform:capitalize;font-size:var(--font-size-small);text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:var(--border-default);width:100%;height:36px;border-radius:var(--border-radius);padding:0 var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed var(--color-border-default);height:160px;box-sizing:border-box;padding:8px;border-radius:var(--border-radius)}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:var(--color-rhino-light-5);border-radius:var(--border-radius);display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:var(--color-dodger)}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);position:absolute;box-sizing:border-box;z-index:10;-webkit-transform-origin:top;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);text-transform:var(--microtip-text-transform,none);padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{-webkit-transform:translate3d(-50%,-5px,0);transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),-5px,0);transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),-5px,0);transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),-10px,0);transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{-webkit-transform:translate3d(calc(0% + -16px),-10px,0);transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;-webkit-transform:translate3d(10px,-50%,0);transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;-webkit-transform:translate3d(-10px,-50%,0);transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file +.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:var(--color-text-active)}@-webkit-keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@-webkit-keyframes c{0%{opacity:1}to{opacity:0}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;-webkit-animation:d .1s forwards cubic-bezier(.19,1,.22,1);animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;-webkit-animation:c .1s forwards cubic-bezier(.19,1,.22,1);animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px);-webkit-animation:a .1s forwards cubic-bezier(.19,1,.22,1);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;-webkit-transform:none;transform:none;-webkit-animation:b .1s forwards cubic-bezier(.19,1,.22,1);animation:b .1s forwards cubic-bezier(.19,1,.22,1)}:root{--env:$ENV}.plotly-editor--theme-provider{--color-white:#fff;--color-rhino-core:#2a3f5f;--color-rhino-dark:#506784;--color-rhino-medium-1:#a2b1c6;--color-rhino-medium-2:#c8d4e3;--color-rhino-light-1:#dfe8f3;--color-rhino-light-2:#ebf0f8;--color-rhino-light-3:#f3f6fa;--color-rhino-light-4:#fafbfd;--color-rhino-light-5:#f8f8f9;--color-dodger:#119dff;--color-dodger-shade:#0d76bf;--color-dodger-shade-mid:#0d76bf;--color-aqua:#09ffff;--color-aqua-shade:#19d3f3;--color-lavender:#e763fa;--color-lavender-shade:#ab63fa;--color-lavender-shade-mid:#934bde;--color-cornflower:#636efa;--color-emerald:#00cc96;--color-sienna:#ef553b;--color-accent:var(--color-dodger);--color-accent-shade:var(--color-dodger-shade);--color-accent-shade-mid:var(--color-dodger-shade-mid);--color-brand:var(--color-dodger);--color-hightlight-darker:var(--color-gray-blue-pale);--color-text-base:var(--color-rhino-dark);--color-text-light:var(--color-rhino-medium-1);--color-text-dark:var(--color-rhino-core);--color-text-headings:var(--color-text-dark);--color-text-section-header:var(--color-text-dark);--color-text-active:var(--color-rhino-core);--color-text-placeholder:var(--color-rhino-medium-1);--color-border-default:var(--color-rhino-medium-2);--color-border-light:var(--color-rhino-light-1);--color-border-dark:var(--color-rhino-medium-1);--color-border-accent:var(--color-accent);--color-border-accent-shade:var(--color-accent-shade);--color-background:var(--color-rhino-light-2);--color-background-base:var(--color-rhino-light-2);--color-background-light:var(--color-rhino-light-3);--color-background-medium:var(--color-rhino-light-1);--color-background-dark:var(--color-rhino-medium-1);--color-background-top:var(--color-white);--color-background-inverse:var(--color-rhino-dark);--color-background-inputs:var(--color-background-top);--color-button-primary-base-fill:var(--color-accent);--color-button-primary-base-border:var(--color-accent-shade);--color-button-primary-base-text:var(--color-white);--color-button-primary-hover-fill:var(--color-accent-shade-mid);--color-button-primary-hover-border:var(--color-accent-shade);--color-button-primary-hover-text:var(--color-white);--color-button-primary-active-fill:var(--color-accent-shade);--color-button-primary-active-border:var(--color-accent-shade);--color-button-primary-active-text:var(--color-white);--color-button-secondary-base-fill:transparent;--color-button-secondary-base-border:var(--color-rhino-medium-2);--color-button-secondary-base-text:var(--color-text-base);--color-button-secondary-hover-fill:transparent;--color-button-secondary-hover-border:var(--color-rhino-medium-1);--color-button-secondary-hover-text:var(--color-text-dark);--color-button-secondary-active-fill:transparent;--color-button-secondary-active-border:var(--color-rhino-medium-1);--color-button-secondary-active-text:var(--color-text-dark);--color-button-tertiary-base-fill:transparent;--color-button-tertiary-base-border:transparent;--color-button-tertiary-base-text:var(--color-text-base);--color-button-tertiary-hover-fill:transparent;--color-button-tertiary-hover-border:transparent;--color-button-tertiary-hover-text:var(--color-text-dark);--color-button-tertiary-active-fill:transparent;--color-button-tertiary-active-border:transparent;--color-button-tertiary-active-text:var(--color-text-dark);--color-button-default-base-fill:var(--color-background-light);--color-button-default-base-border:var(--color-border-default);--color-button-default-base-text:var(--color-text-base);--color-button-default-hover-fill:var(--color-background-base);--color-button-default-hover-border:var(--color-border-dark);--color-button-default-hover-text:var(--color-text-dark);--color-button-default-active-fill:var(--color-background-dark);--color-button-default-active-border:var(--color-border-dark);--color-button-default-active-text:var(--color-text-dark);--color-button-upgrade-base-fill:var(--color-lavender-shade);--color-button-upgrade-base-border:var(--color-lavender-shade-dark);--color-button-upgrade-base-text:var(--color-white);--color-button-upgrade-hover-fill:var(--color-lavender-shade-mid);--color-button-upgrade-hover-border:var(--color-lavender-shade-dark);--color-button-upgrade-hover-text:var(--color-white);--color-button-upgrade-active-fill:var(--color-lavender-shade-dark);--color-button-upgrade-active-border:var(--color-lavender-shade-dark);--color-button-upgrade-active-text:var(--color-white);--color-button-header-base-fill:transparent;--color-button-header-base-border:var(--color-dodger);--color-button-header-base-text:var(--color-dodger);--color-button-header-hover-fill:transparent;--color-button-header-hover-border:var(--color-dodger-shade-mid);--color-button-header-hover-text:var(--color-dodger-shade);--color-button-header-active-fill:transparent;--color-button-header-active-border:var(--color-dodger-shade);--color-button-header-active-text:var(--color-dodger-shade);--spacing-base-unit:24px;--spacing-half-unit:12px;--spacing-quarter-unit:6px;--spacing-sixth-unit:4px;--spacing-eighth-unit:3px;--font-size-base:13px;--font-size-small:12px;--font-size-medium:14px;--font-size-large:14px;--font-size-heading-base:24px;--font-size-heading-small:18px;--font-size-heading-large:28px;--font-size-h5:16px;--font-weight-light:400;--font-weight-normal:500;--font-weight-semibold:600;--font-weight-bold:700;--font-leading-body:1.6;--font-leading-head:1.2;--font-letter-spacing-headings:0.5px;--font-family-body:"Open Sans",--apple-default,sans-serif;--font-family-headings:"Dosis","Arial",sans-serif;--border-default:1px solid var(--color-border-default);--border-light:1px solid var(--color-border-light);--border-dark:1px solid var(--color-border-dark);--border-accent:1px solid var(--color-border-accent);--border-accent-shade:1px solid var(--color-border-accent-shade);--border-radius:5px;--border-radius-small:3px;--text-shadow-dark-color:rgba(42,63,95,.7);--text-shadow-dark-ui:0 1px 2px var(--text-shadow-dark-color);--text-shadow-dark-ui-inactive:0 1px 1px rgba(42,63,95,.4);--box-shadow-base-color:rgba(80,103,132,.2);--box-shadow-base:0px 2px 9px var(--box-shadow-base-color);--scrollbar-track-background:var(--color-background-base);--scrollbar-thumb-color:var(--color-accent);--panel-background:var(--color-background-base);--panel-width:335px;--fold-header-text-color-base:var(--color-white);--fold-header-text-color-closed:var(--color-white);--fold-header-background-base:var(--color-rhino-dark);--fold-header-background-closed:var(--color-rhino-core);--fold-header-border-color-closed:var(--color-rhino-core);--fold-header-border-color-base:var(--color-rhino-dark);--sidebar-background:var(--color-background-top);--sidebar-width:100px;--sidebar-group-background-base:var(--sidebar-background);--sidebar-item-background-base:var(--color-background-light);--sidebar-item-background-hover:var(--color-background-base);--sidebar-item-background-active:var(--color-background-medium);--editor-width:calc(var(--sidebar-width) + var(--panel-width) + 1px)}.editor_controls{position:relative;width:var(--editor-width);flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--font-family-body)}.editor_controls .sidebar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:100%;min-width:var(--sidebar-width);width:var(--sidebar-width);max-width:var(--sidebar-width);text-align:center;background:var(--sidebar-background);overflow-y:auto;overflow-x:hidden;float:left;border-right:var(--border-default);flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .sidebar__group{background-color:var(--sidebar-group-background-base);cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:var(--color-text-base);font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);padding:var(--spacing-half-unit) 0;text-transform:capitalize;text-align:left;border-bottom:var(--border-light);display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:var(--spacing-base-unit)}.editor_controls .sidebar__group__title__icon{position:absolute;-webkit-transform:scale(.9) translateX(2px) translateY(-4px);transform:scale(.9) translateX(2px) translateY(-4px);-webkit-transform-origin:center center;transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:var(--color-text-active);cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:var(--font-weight-semibold);color:var(--color-text-active)}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:var(--color-accent)}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{-webkit-transform:scale(.9) translateY(-5px) rotate(90deg);transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:var(--box-shadow-base)}.editor_controls .sidebar__item{color:var(--color-text-base);cursor:pointer;font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);line-height:var(--font-size-medium);text-transform:capitalize;background-color:var(--sidebar-item-background-base);padding:10px;padding-left:18px;padding-right:var(--spacing-quarter-unit);text-align:left;border-bottom:var(--border-light);position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:var(--color-accent);-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:left center;transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:var(--sidebar-item-background-hover)}.editor_controls .sidebar__item--is-active{color:var(--color-text-active);font-weight:var(--font-weight-semibold);cursor:default}.editor_controls .sidebar__item--is-active:before{-webkit-transform:none;transform:none}.editor_controls .sidebar__item--is-active span{-webkit-transform:translateX(5px);transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:var(--spacing-half-unit);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls__wrapper>.panel{background-color:var(--panel-background);border-right:var(--border-default);width:calc(var(--panel-width))}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:var(--spacing-half-unit);display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:var(--font-size-medium);float:left;color:var(--color-text-base);display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:var(--color-text-light);padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:var(--panel-width);border-right:var(--border-default);height:100%;padding:var(--spacing-half-unit);background-color:var(--panel-background);box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:calc(var(--spacing-base-unit) * 2);margin-bottom:var(--spacing-half-unit);opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:var(--color-text-light)}.editor_controls .panel__empty__message__heading{color:var(--color-text-headings);font-size:var(--font-size-heading-base);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings)}.editor_controls .panel__empty__message__content{font-size:var(--font-size-base);color:var(--color-text-base);line-height:var(--font-leading-body)}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-bottom:var(--spacing-half-unit)}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);color:var(--fold-header-text-color-closed);font-size:var(--font-size-base);border:1px solid var(--fold-header-border-color-closed);background-color:var(--fold-header-background-closed);height:15px;border-radius:var(--border-radius);text-shadow:var(--text-shadow-dark-ui);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out;box-sizing:content-box}.editor_controls .fold__top:hover{cursor:pointer;background-color:var(--fold-header-background-closed)}.editor_controls .fold__top svg{width:18px;height:18px;display:block;-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:var(--fold-header-text-color-base);background-color:var(--fold-header-background-base);border:1px solid var(--fold-header-border-color-base);border-radius:var(--border-radius) var(--border-radius) 0 0;text-shadow:var(--text-shadow-dark-ui-inactive)}.editor_controls .fold__top--open svg{-webkit-filter:drop-shadow(0 1px 1px rgba(42,63,95,.4));filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:var(--fold-header-background-base)}.editor_controls .fold__top__icon{display:block;margin-right:var(--spacing-quarter-unit);-webkit-transform:translateY(-1px);transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:var(--spacing-half-unit)/3;font-size:var(--font-size-medium);line-height:var(--font-size-medium);font-weight:var(--font-weight-semibold);-webkit-transform:translateY(1px);transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{-webkit-transform:translateX(-3px) translateY(-1px);transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:-webkit-transform .1s ease-in-out;transition:transform .1s ease-in-out;transition:transform .1s ease-in-out,-webkit-transform .1s ease-in-out;-webkit-transform:rotate(-90deg);transform:rotate(-90deg);font-weight:700;-webkit-transform-origin:center center;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;-webkit-transform:translateY(-2px);transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:var(--color-background-top);border:var(--border-default);border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:var(--font-family-headings);display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:var(--color-dodger);display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:var(--color-text-base)}.editor_controls .fold__content__empty__message__secondary{font-family:var(--font-family-body);font-size:var(--font-size-small);text-align:center;color:var(--color-text-base)}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:var(--font-size-base);color:var(--color-text-section-header);font-weight:var(--font-weight-semibold);cursor:default;background-color:var(--color-background-light);padding:var(--spacing-quarter-unit) var(--spacing-half-unit);clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:var(--border-light)}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:var(--spacing-quarter-unit);width:100%}.editor_controls .menupanel__label{font-weight:var(--font-weight-semibold);padding-right:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:var(--color-text-light)!important;padding-left:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:var(--color-accent)!important}.editor_controls .menupanel__icon-span{font-size:var(--font-size-small);display:flex}.editor_controls .menupanel__icon-span--question{color:var(--color-text-base)}.editor_controls .info__title{color:var(--color-text-headings);font-size:var(--font-size-heading-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings);padding:var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit)}.editor_controls .info__text{padding:var(--spacing-quarter-unit) var(--spacing-half-unit)}.editor_controls .info__sub-text,.editor_controls .info__text{color:var(--color-text-base);font-size:var(--font-size-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-body)}.editor_controls .info__sub-text{font-style:italic;padding:var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .modalbox{position:absolute;border-radius:var(--border-radius);overflow:hidden;text-transform:none;text-align:left;border:var(--border-default);align-content:center;box-shadow:var(--box-shadow-base);left:calc(var(--spacing-quarter-unit) * -1);width:calc(100% + var(--spacing-half-unit));top:calc(100% + var(--spacing-quarter-unit));background-color:var(--color-background-top);z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:var(--color-background-inverse)}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:var(--color-background-dark);position:fixed}.editor_controls .modal__card{background:var(--color-background-top);border-radius:var(--border-radius);position:relative;z-index:1003;max-width:calc(100% - var(--spacing-base-unit));box-shadow:var(--box-shadow-base);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:.1s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:var(--color-text-base);padding:var(--spacing-half-unit);font-weight:var(--font-weight-semibold)}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:var(--color-background-light);border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:var(--spacing-quarter-unit);color:var(--color-text-base);font-size:var(--font-size-base);background:var(--color-background-medium);border:var(--border-default);border-bottom:0;position:relative;background:var(--color-background-light);transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:var(--color-background-medium);margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:var(--spacing-half-unit) var(--spacing-half-unit) 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:var(--border-radius)}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:var(--border-radius);border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:var(--color-background-base);cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:var(--color-background-base);pointer-events:none;margin-top:0;color:var(--color-text-active);border-top-color:var(--color-accent);border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:var(--color-background-base);left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:var(--border-default);display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:var(--border-light);color:var(--color-text-base);display:flex;font-size:var(--font-size-base);font-weight:var(--font-weight-normal);justify-content:flex-start;line-height:var(--font-size-base);min-height:32px;padding:var(--spacing-quarter-unit) 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 var(--spacing-half-unit);align-self:center;line-height:var(--font-leading-body)}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:var(--spacing-half-unit);padding-left:var(--spacing-half-unit);align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{align-self:center}.editor_controls .field__title{width:80px;padding-left:var(--spacing-half-unit);display:block;font-size:var(--font-size-small);line-height:var(--font-leading-body);color:var(--color-text-base);padding-top:var(--spacing-quarter-unit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:var(--spacing-quarter-unit);opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:var(--color-text-base)}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:var(--color-sienna)}.editor_controls .field .rect,.editor_controls .field .square{border-color:var(--color-accent)}.editor_controls .field .rect-grid{border-color:var(--panel-background)!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:var(--border-default);border-radius:var(--border-radius);width:80px;cursor:pointer;padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:var(--color-background-inverse)}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:var(--color-text-light);padding-top:var(--spacing-eighth-unit);width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:var(--border-default);padding:var(--spacing-half-unit);box-shadow:2px 2px var(--spacing-half-unit) var(--color-border-light);border-radius:var(--border-radius-small);left:var(--spacing-base-unit)}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:var(--color-border-default)}.editor_controls button{display:inline-block;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:var(--font-size-medium);font-weight:var(--font-weight-semibold);font-family:var(--font-family-body);border:1px solid transparent;border-radius:var(--border-radius);transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:var(--spacing-half-unit)}.editor_controls .button__icon{display:flex;padding-left:var(--spacing-quarter-unit);will-change:transform}.editor_controls .button__icon svg{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - var(--spacing-base-unit));margin-left:var(--spacing-half-unit);margin-right:var(--spacing-half-unit)}.editor_controls .button--no-text{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--no-text--disabled{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--default{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text)}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--primary{background-color:var(--color-button-primary-base-fill);border-color:var(--color-button-primary-base-border);color:var(--color-button-primary-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--primary svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:var(--color-button-primary-hover-fill);border:1px solid var(--color-button-primary-hover-border);color:var(--color-button-primary-hover-text)}.editor_controls .button--primary:active:not(.button--no-text--disabled){background-color:var(--color-button-primary-active-fill);border:1px solid var(--color-button-primary-active-border);color:var(--color-button-primary-active-text)}.editor_controls .button--secondary{background-color:var(--color-button-secondary-base-fill);border-color:var(--color-button-secondary-base-border);color:var(--color-button-secondary-base-text)}.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:var(--color-button-secondary-hover-fill);border:1px solid var(--color-button-secondary-hover-border);color:var(--color-button-secondary-hover-text)}.editor_controls .button--secondary:active:not(.button--no-text--disabled){background-color:var(--color-button-secondary-active-fill);border:1px solid var(--color-button-secondary-active-border);color:var(--color-button-secondary-active-text)}.editor_controls .button--tertiary{background-color:var(--color-button-tertiary-base-fill);border-color:var(--color-button-tertiary-base-border);color:var(--color-button-tertiary-base-text)}.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-hover-fill);border:1px solid var(--color-button-tertiary-hover-border);color:var(--color-button-tertiary-hover-text)}.editor_controls .button--tertiary:active:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-active-fill);border:1px solid var(--color-button-tertiary-active-border);color:var(--color-button-tertiary-active-text)}.editor_controls .button--upgrade{background-color:var(--color-button-upgrade-base-fill);border-color:var(--color-button-upgrade-base-border);color:var(--color-button-upgrade-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--upgrade svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-hover-fill);border:1px solid var(--color-button-upgrade-hover-border);color:var(--color-button-upgrade-hover-text)}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-active-fill);border:1px solid var(--color-button-upgrade-active-border);color:var(--color-button-upgrade-active-text)}.editor_controls .button--header{background-color:var(--color-button-header-base-fill);border-color:var(--color-button-header-base-border);color:var(--color-button-header-base-text)}.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:var(--color-button-header-hover-fill);border:1px solid var(--color-button-header-hover-border);color:var(--color-button-header-hover-text)}.editor_controls .button--header:active:not(.button--no-text--disabled){background-color:var(--color-button-header-active-fill);border:1px solid var(--color-button-header-active-border);color:var(--color-button-header-active-text)}.editor_controls .checkbox__group{padding-left:var(--spacing-half-unit);text-align:left}.editor_controls .checkbox__item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;padding-top:var(--spacing-eighth-unit);padding-bottom:var(--spacing-eighth-unit)}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:var(--color-background-light)}.editor_controls .checkbox__box--checked{border:var(--border-accent-shade);background:var(--color-accent)}.editor_controls .checkbox__box--checked:hover{background:var(--color-accent-shade)}.editor_controls .checkbox__box--checked+.checkbox__label{color:var(--color-text-active)}.editor_controls .checkbox__check{color:var(--color-text-base);font-size:var(--spacing-half-unit);position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:var(--color-white)}.editor_controls .checkbox__label{padding-left:var(--spacing-quarter-unit);font-size:var(--font-size-base);color:var(--color-text-base);display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:var(--border-default);padding:var(--spacing-eighth-unit)}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:var(--spacing-half-unit);color:var(--color-text-base);font-weight:var(--font-weight-semibold);font-size:var(--font-size-small);display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:var(--spacing-eighth-unit)}.editor_controls .colorpicker__custom-input input{border:var(--border-default)!important;box-shadow:none!important;background-color:var(--color-background-inputs);color:var(--color-text-dark)}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:var(--spacing-eighth-unit) 0}.editor_controls .colorpicker__controls .colorpicker__active{height:var(--spacing-base-unit);width:var(--spacing-base-unit);margin:var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit)}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--border-radius-small);border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit))}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:var(--spacing-quarter-unit);text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:var(--color-border-dark);background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:var(--color-border-accent)}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:var(--color-text-base)}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{background-color:#fff;border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:var(--color-background-inputs);border:var(--border-default);box-shadow:none!important;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{-webkit-animation:e .4s infinite linear;animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{-webkit-animation:d .2s;animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:var(--color-border-default) transparent transparent}@-webkit-keyframes d{0%{opacity:0}to{opacity:1}}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:var(--border-default);border-top-color:var(--color-border-default);background-color:transparent;box-shadow:var(--box-shadow-base)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;background-color:#fff;color:#666;cursor:pointer;display:block;padding:8px 10px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:var(--color-text-active);font-weight:var(--font-weight-semibold);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:var(--color-border-dark)}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-option:hover{color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-value-label{color:var(--color-text-base)!important}.editor_controls .dropdown-container .Select-placeholder{color:var(--color-text-placeholder)}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:var(--color-background-inverse)}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:var(--color-border-default)}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:var(--color-border-light)}.editor_controls ::-webkit-input-placeholder{color:var(--color-text-placeholder)}.editor_controls ::-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls :-ms-input-placeholder{color:var(--color-text-placeholder)}.editor_controls :-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:var(--color-text-base)}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:var(--spacing-quarter-unit);margin-right:var(--spacing-half-unit);vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:var(--color-background-light);border:var(--border-default);border-radius:1px;line-height:var(--spacing-half-unit);text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:var(--color-text-base)!important}.editor_controls .text-input{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:var(--font-leading-head);display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);background-color:var(--color-background-top);border:var(--border-default);display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:var(--font-size-small)}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .radio-block__option--active{background-color:var(--color-button-primary-base-fill);color:var(--color-button-primary-base-text);border:1px solid var(--color-button-primary-base-border);margin-left:-1px;cursor:default;text-shadow:var(--text-shadow-dark-ui);font-weight:var(--font-weight-semibold)}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:var(--border-accent-shade)!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:var(--border-radius-small);border-bottom-right-radius:var(--border-radius-small);border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:var(--border-radius-small);border-bottom-left-radius:var(--border-radius-small)}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:var(--border-default)}.editor_controls .text-editor{overflow:hidden;border:var(--border-default);border-radius:var(--border-radius);min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:var(--border-default)}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:var(--spacing-quarter-unit);resize:none;line-height:24px;font-size:13px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:var(--color-text-base);display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:var(--border-default)}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:var(--border-default)}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:var(--border-default);width:100%;display:block;color:var(--color-text-base)}.editor_controls .multi-format-editor__tab.selected{background:var(--color-background-light);font-weight:var(--font-weight-semibold)}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:var(--color-background-light);display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:var(--color-text-section-header);margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:var(--spacing-half-unit)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:var(--spacing-half-unit);width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid var(--color-border-light);-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:var(--font-weight-semibold);color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:var(--color-text-base);display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:var(--color-background-light);font-size:14px;padding:10px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:var(--border-default)}.editor_controls .rich-text-editor__controls .icon-link{-webkit-transform:translateY(3px);transform:translateY(3px);display:inline-block;fill:var(--color-text-base);width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:var(--color-background-light);border:var(--border-default);padding:var(--spacing-half-unit);position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:var(--border-default);color:var(--color-text-base);overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:var(--color-text-base);cursor:pointer;display:inline-block;margin:0;min-height:var(--spacing-base-unit);min-width:var(--spacing-base-unit);text-align:center;background-color:transparent;border:var(--border-default);border-radius:var(--border-radius-small);line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:var(--color-accent);border:var(--border-accent-shade);color:var(--color-white)}.editor_controls .rich-text-editor__styleButton--active:hover:before{-webkit-transform:scaleX(0);transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:var(--color-accent);will-change:transform;-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:scaleX(0);transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:var(--color-text-active);background-color:var(--color-background-top)}.editor_controls .rich-text-editor__styleButton:hover:before{-webkit-transform:none;transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 var(--spacing-quarter-unit);min-width:60px;position:relative;background:var(--color-background-light);touch-action:none;border:1px solid var(--color-border-default);flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid var(--color-border-default);cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:var(--color-accent);border:var(--border-accent);border-radius:10px;-webkit-transform:translateY(-1px);transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:var(--color-accent);display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:var(--spacing-quarter-unit)}.editor_controls .trace-grid{display:grid;grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:var(--border-light);height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(2,90px);grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:var(--font-weight-semibold);text-align:left;border-top:var(--border-light);width:100%;padding:var(--spacing-half-unit) var(--spacing-base-unit) 0;box-sizing:border-box}.editor_controls .trace-grid__column__header,.editor_controls .trace-item{color:var(--color-text-base);display:flex;align-items:center;justify-content:flex-start}.editor_controls .trace-item{width:90px;flex-direction:column;flex-grow:0;margin-top:var(--spacing-half-unit);transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:var(--color-accent);border-width:2px;color:var(--color-accent)}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:var(--spacing-quarter-unit);justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{-webkit-transform:translateX(-10px);transform:translateX(-10px);opacity:0;pointer-events:none;color:var(--color-text-light);transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .trace-item__actions__item:hover{color:var(--color-accent)}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__label{color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__image{border-color:var(--color-accent)}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid var(--color-border-default);width:60px;height:60px;border-radius:var(--border-radius);background:var(--color-background-top);box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:var(--spacing-quarter-unit)}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:var(--color-text-base)}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:var(--font-weight-semibold);width:72px;height:34px;margin-top:var(--spacing-quarter-unit);color:var(--color-text-base);text-transform:capitalize;font-size:var(--font-size-small);text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:var(--border-default);width:100%;height:36px;border-radius:var(--border-radius);padding:0 var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed var(--color-border-default);height:160px;box-sizing:border-box;padding:8px;border-radius:var(--border-radius)}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:var(--color-rhino-light-5);border-radius:var(--border-radius);display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:var(--color-dodger)}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);position:absolute;box-sizing:border-box;z-index:10;-webkit-transform-origin:top;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);text-transform:var(--microtip-text-transform,none);padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{-webkit-transform:translate3d(-50%,-5px,0);transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),-5px,0);transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),-5px,0);transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),-10px,0);transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{-webkit-transform:translate3d(calc(0% + -16px),-10px,0);transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;-webkit-transform:translate3d(10px,-50%,0);transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;-webkit-transform:translate3d(-10px,-50%,0);transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file diff --git a/src/styles/components/containers/_fold.scss b/src/styles/components/containers/_fold.scss index 225ecedd9..946ec74ce 100644 --- a/src/styles/components/containers/_fold.scss +++ b/src/styles/components/containers/_fold.scss @@ -15,6 +15,7 @@ text-shadow: var(--text-shadow-dark-ui); transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; + box-sizing: content-box; &:hover { cursor: pointer; From 886720181f6098da7b55ab2b913259912f8c3e83 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 15:20:47 +0900 Subject: [PATCH 18/69] remove Item.contextType --- lib/components/widgets/TraceTypeSelector.js | 2 +- lib/components/widgets/TraceTypeSelector.js.map | 2 +- src/components/widgets/TraceTypeSelector.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/components/widgets/TraceTypeSelector.js b/lib/components/widgets/TraceTypeSelector.js index 1b18cbd4d..27c257952 100644 --- a/lib/components/widgets/TraceTypeSelector.js +++ b/lib/components/widgets/TraceTypeSelector.js @@ -105,7 +105,7 @@ Item.propTypes = { actions: _propTypes2.default.func, showActions: _propTypes2.default.bool }; -Item.contextType = _context3.EditorControlsContext; +// Item.contextType = EditorControlsContext; var TraceTypeSelector = function (_Component) { _inherits(TraceTypeSelector, _Component); diff --git a/lib/components/widgets/TraceTypeSelector.js.map b/lib/components/widgets/TraceTypeSelector.js.map index a343b7ab7..e41cf859c 100644 --- a/lib/components/widgets/TraceTypeSelector.js.map +++ b/lib/components/widgets/TraceTypeSelector.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/components/widgets/TraceTypeSelector.js"],"names":["renderActionItems","actionItems","item","map","action","i","onClick","label","icon","Item","active","handleClick","actions","showActions","complex","value","SimpleIcon","ComplexIcon","propTypes","PropTypes","object","bool","func","contextType","EditorControlsContext","TraceTypeSelector","props","selectAndClose","bind","renderCategories","renderGrid","renderSingleBlock","updateContainer","glByDefault","type","fullContainer","computedValue","endsWith","TRACES_WITH_GL","includes","context","handleClose","_","localize","chartHelp","e","stopPropagation","feedQuery","window","open","helpDoc","examplePlot","fullValue","mapBoxAccess","traceTypesConfig","traces","categories","category","items","filter","MAX_ITEMS","columnClasses","length","maxColumns","Boolean","display","Component","string","contextTypes","TraceTypeSelectorButton","container","inferredType","find","Icon","isRequired"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,oBAAoB,SAApBA,iBAAoB,CAACC,WAAD,EAAcC,IAAd;AAAA,SACxBD,cACIA,YAAYC,IAAZ,EAAkBC,GAAlB,CACE,UAACC,MAAD,EAASC,CAAT;AAAA,WAC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A0B7CG,wBAAwBnD,SAAxB,GAAoC;AAClCP,eAAaQ,oBAAUG,IAAV,CAAeoD,UADM;AAElCJ,aAAWnD,oBAAUC,MAFa;AAGlCkC,oBAAkBnC,oBAAUC,MAAV,CAAiBsD;AAHD,CAApC;AAKAL,wBAAwB9C,WAAxB,GAAsCC,+BAAtC;;kBAEeC,iB","file":"TraceTypeSelector.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SearchIcon, ThumnailViewIcon, GraphIcon} from 'plotly-icons';\nimport Modal from 'components/containers/Modal';\nimport {traceTypeToPlotlyInitFigure, renderTraceIcon, plotlyTraceToCustomTrace} from 'lib';\nimport {TRACES_WITH_GL} from 'lib/constants';\nimport {EditorControlsContext} from '../../context';\n\nconst renderActionItems = (actionItems, item) =>\n actionItems\n ? actionItems(item).map(\n (action, i) =>\n !action.onClick ? null : (\n \n {action.icon}\n \n )\n )\n : null;\n\nconst Item = ({item, active, handleClick, actions, showActions, complex}) => {\n const {label, value, icon} = item;\n const SimpleIcon = renderTraceIcon(icon ? icon : value);\n const ComplexIcon = renderTraceIcon(icon ? icon : value, 'TraceType');\n\n return (\n
\n
\n {actions && showActions ? renderActionItems(actions, item) : null}\n
\n
\n {!complex && (\n
\n \n
\n )}\n {complex && (\n
\n \n
\n )}\n
\n
{label}
\n
\n );\n};\n\nItem.propTypes = {\n item: PropTypes.object,\n active: PropTypes.bool,\n complex: PropTypes.bool,\n handleClick: PropTypes.func,\n actions: PropTypes.func,\n showActions: PropTypes.bool,\n};\nItem.contextType = EditorControlsContext;\n\nclass TraceTypeSelector extends Component {\n constructor(props) {\n super(props);\n\n this.selectAndClose = this.selectAndClose.bind(this);\n this.actions = this.actions.bind(this);\n this.renderCategories = this.renderCategories.bind(this);\n this.renderGrid = this.renderGrid.bind(this);\n this.renderSingleBlock = this.renderSingleBlock.bind(this);\n }\n\n selectAndClose(value) {\n const {\n updateContainer,\n glByDefault,\n fullContainer: {type},\n } = this.props;\n const computedValue = traceTypeToPlotlyInitFigure(value);\n if (\n ((type && type.endsWith('gl')) || (!TRACES_WITH_GL.includes(type) && glByDefault)) &&\n TRACES_WITH_GL.includes(computedValue.type) &&\n !computedValue.type.endsWith('gl')\n ) {\n computedValue.type += 'gl';\n }\n updateContainer(computedValue);\n this.context.handleClose();\n }\n\n actions({value}) {\n const {localize: _, chartHelp} = this.context;\n\n const onClick = (e, func) => {\n e.stopPropagation();\n func();\n this.context.handleClose();\n };\n\n return [\n {\n label: _('Charts like this by Plotly users.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].feedQuery &&\n (e =>\n onClick(e, () =>\n window.open(\n `https://plot.ly/feed/?q=${chartHelp[value] ? chartHelp[value].feedQuery : value}`,\n '_blank'\n )\n )),\n icon: ,\n },\n {\n label: _('View tutorials on this chart type.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].helpDoc &&\n (e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))),\n icon: ,\n },\n {\n label: _('See a basic example.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].examplePlot &&\n (e => onClick(e, chartHelp[value].examplePlot)),\n icon: ,\n },\n ];\n }\n\n renderCategories() {\n const {fullValue} = this.props;\n const {mapBoxAccess, localize: _, chartHelp} = this.context;\n const {\n traceTypesConfig: {traces, categories, complex},\n } = this.props;\n\n return categories(_).map((category, i) => {\n let items = traces(_)\n .filter(({category: {value}}) => value === category.value)\n .filter(i => i.value !== 'scattergl' && i.value !== 'scatterpolargl');\n\n if (!mapBoxAccess) {\n items = items.filter(i => i.value !== 'scattermapbox');\n }\n\n const MAX_ITEMS = 4;\n\n const columnClasses =\n (items.length > MAX_ITEMS && !category.maxColumns) ||\n (category.maxColumns && category.maxColumns > 1)\n ? 'trace-grid__column trace-grid__column--double'\n : 'trace-grid__column';\n\n return (\n
\n
{category.label}
\n
\n {items.map(item => (\n this.selectAndClose(item.value)}\n showActions={Boolean(chartHelp)}\n />\n ))}\n
\n
\n );\n });\n }\n\n renderGrid() {\n return
{this.renderCategories()}
;\n }\n\n renderSingleBlock() {\n const {fullValue} = this.props;\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {traces, complex},\n } = this.props;\n\n return (\n
\n {traces(_).map(item => (\n this.selectAndClose(item.value)}\n style={{display: 'inline-block'}}\n />\n ))}\n
\n );\n }\n\n render() {\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {categories},\n } = this.props;\n\n return (\n \n {categories ? this.renderGrid() : this.renderSingleBlock()}\n \n );\n }\n}\n\nTraceTypeSelector.propTypes = {\n updateContainer: PropTypes.func,\n fullValue: PropTypes.string,\n fullContainer: PropTypes.object,\n glByDefault: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n};\nTraceTypeSelector.contextTypes = {\n handleClose: PropTypes.func,\n localize: PropTypes.func,\n mapBoxAccess: PropTypes.bool,\n chartHelp: PropTypes.object,\n};\n\nexport class TraceTypeSelectorButton extends Component {\n render() {\n const {\n handleClick,\n container,\n traceTypesConfig: {traces},\n } = this.props;\n\n const {localize: _} = this.context;\n\n const inferredType = plotlyTraceToCustomTrace(container);\n const {label, icon, value} = traces(_).find(type => type.value === inferredType);\n\n const Icon = renderTraceIcon(icon ? icon : value);\n\n return (\n
\n
\n \n
\n {label}\n
\n );\n }\n}\n\nTraceTypeSelectorButton.propTypes = {\n handleClick: PropTypes.func.isRequired,\n container: PropTypes.object,\n traceTypesConfig: PropTypes.object.isRequired,\n};\nTraceTypeSelectorButton.contextType = EditorControlsContext;\n\nexport default TraceTypeSelector;\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/components/widgets/TraceTypeSelector.js"],"names":["renderActionItems","actionItems","item","map","action","i","onClick","label","icon","Item","active","handleClick","actions","showActions","complex","value","SimpleIcon","ComplexIcon","propTypes","PropTypes","object","bool","func","TraceTypeSelector","props","selectAndClose","bind","renderCategories","renderGrid","renderSingleBlock","updateContainer","glByDefault","type","fullContainer","computedValue","endsWith","TRACES_WITH_GL","includes","context","handleClose","_","localize","chartHelp","e","stopPropagation","feedQuery","window","open","helpDoc","examplePlot","fullValue","mapBoxAccess","traceTypesConfig","traces","categories","category","items","filter","MAX_ITEMS","columnClasses","length","maxColumns","Boolean","display","Component","string","contextTypes","TraceTypeSelectorButton","container","inferredType","find","Icon","isRequired","contextType","EditorControlsContext"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,oBAAoB,SAApBA,iBAAoB,CAACC,WAAD,EAAcC,IAAd;AAAA,SACxBD,cACIA,YAAYC,IAAZ,EAAkBC,GAAlB,CACE,UAACC,MAAD,EAASC,CAAT;AAAA,WACE,CAACD,OAAOE,OAAR,GAAkB,IAAlB,GACE;AAAA;AAAA;AACE,mBAAU,2BADZ;AAEE,aAAKD,CAFP;AAGE,sBAAYD,OAAOG,KAHrB;AAIE,4CAJF;AAKE,cAAK,SALP;AAME,iBAASH,OAAOE,OANlB;AAOE,gBAAO;AAPT;AASGF,aAAOI;AATV,KAFJ;AAAA,GADF,CADJ,GAiBI,IAlBoB;AAAA,CAA1B;;AAoBA,IAAMC,OAAO,SAAPA,IAAO,OAAgE;AAAA,MAA9DP,IAA8D,QAA9DA,IAA8D;AAAA,MAAxDQ,MAAwD,QAAxDA,MAAwD;AAAA,MAAhDC,WAAgD,QAAhDA,WAAgD;AAAA,MAAnCC,OAAmC,QAAnCA,OAAmC;AAAA,MAA1BC,WAA0B,QAA1BA,WAA0B;AAAA,MAAbC,OAAa,QAAbA,OAAa;AAAA,MACpEP,KADoE,GAC9CL,IAD8C,CACpEK,KADoE;AAAA,MAC7DQ,KAD6D,GAC9Cb,IAD8C,CAC7Da,KAD6D;AAAA,MACtDP,IADsD,GAC9CN,IAD8C,CACtDM,IADsD;;AAE3E,MAAMQ,aAAa,0BAAgBR,OAAOA,IAAP,GAAcO,KAA9B,CAAnB;AACA,MAAME,cAAc,0BAAgBT,OAAOA,IAAP,GAAcO,KAA9B,EAAqC,WAArC,C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Af,CAVtB;AAAA,UAUA9D,KAVA,gBAUAA,KAVA;AAAA,UAUOC,IAVP,gBAUOA,IAVP;AAAA,UAUaO,KAVb,gBAUaA,KAVb;;AAYP,UAAMwD,OAAO,0BAAgB/D,OAAOA,IAAP,GAAcO,KAA9B,CAAb;;AAEA,aACE;AAAA;AAAA,UAAK,WAAU,0BAAf,EAA0C,SAASJ,cAAcA,WAAd,GAA4B,IAA/E;AACE;AAAA;AAAA,YAAK,WAAU,gCAAf;AACE,wCAAC,IAAD;AADF,SADF;AAIGJ;AAJH,OADF;AAQD;;;;EAvB0CyD,gB;;AA0B7CG,wBAAwBjD,SAAxB,GAAoC;AAClCP,eAAaQ,oBAAUG,IAAV,CAAekD,UADM;AAElCJ,aAAWjD,oBAAUC,MAFa;AAGlCgC,oBAAkBjC,oBAAUC,MAAV,CAAiBoD;AAHD,CAApC;AAKAL,wBAAwBM,WAAxB,GAAsCC,+BAAtC;;kBAEenD,iB","file":"TraceTypeSelector.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SearchIcon, ThumnailViewIcon, GraphIcon} from 'plotly-icons';\nimport Modal from 'components/containers/Modal';\nimport {traceTypeToPlotlyInitFigure, renderTraceIcon, plotlyTraceToCustomTrace} from 'lib';\nimport {TRACES_WITH_GL} from 'lib/constants';\nimport {EditorControlsContext} from '../../context';\n\nconst renderActionItems = (actionItems, item) =>\n actionItems\n ? actionItems(item).map(\n (action, i) =>\n !action.onClick ? null : (\n \n {action.icon}\n \n )\n )\n : null;\n\nconst Item = ({item, active, handleClick, actions, showActions, complex}) => {\n const {label, value, icon} = item;\n const SimpleIcon = renderTraceIcon(icon ? icon : value);\n const ComplexIcon = renderTraceIcon(icon ? icon : value, 'TraceType');\n\n return (\n
\n
\n {actions && showActions ? renderActionItems(actions, item) : null}\n
\n
\n {!complex && (\n
\n \n
\n )}\n {complex && (\n
\n \n
\n )}\n
\n
{label}
\n
\n );\n};\n\nItem.propTypes = {\n item: PropTypes.object,\n active: PropTypes.bool,\n complex: PropTypes.bool,\n handleClick: PropTypes.func,\n actions: PropTypes.func,\n showActions: PropTypes.bool,\n};\n// Item.contextType = EditorControlsContext;\n\nclass TraceTypeSelector extends Component {\n constructor(props) {\n super(props);\n\n this.selectAndClose = this.selectAndClose.bind(this);\n this.actions = this.actions.bind(this);\n this.renderCategories = this.renderCategories.bind(this);\n this.renderGrid = this.renderGrid.bind(this);\n this.renderSingleBlock = this.renderSingleBlock.bind(this);\n }\n\n selectAndClose(value) {\n const {\n updateContainer,\n glByDefault,\n fullContainer: {type},\n } = this.props;\n const computedValue = traceTypeToPlotlyInitFigure(value);\n if (\n ((type && type.endsWith('gl')) || (!TRACES_WITH_GL.includes(type) && glByDefault)) &&\n TRACES_WITH_GL.includes(computedValue.type) &&\n !computedValue.type.endsWith('gl')\n ) {\n computedValue.type += 'gl';\n }\n updateContainer(computedValue);\n this.context.handleClose();\n }\n\n actions({value}) {\n const {localize: _, chartHelp} = this.context;\n\n const onClick = (e, func) => {\n e.stopPropagation();\n func();\n this.context.handleClose();\n };\n\n return [\n {\n label: _('Charts like this by Plotly users.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].feedQuery &&\n (e =>\n onClick(e, () =>\n window.open(\n `https://plot.ly/feed/?q=${chartHelp[value] ? chartHelp[value].feedQuery : value}`,\n '_blank'\n )\n )),\n icon: ,\n },\n {\n label: _('View tutorials on this chart type.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].helpDoc &&\n (e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))),\n icon: ,\n },\n {\n label: _('See a basic example.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].examplePlot &&\n (e => onClick(e, chartHelp[value].examplePlot)),\n icon: ,\n },\n ];\n }\n\n renderCategories() {\n const {fullValue} = this.props;\n const {mapBoxAccess, localize: _, chartHelp} = this.context;\n const {\n traceTypesConfig: {traces, categories, complex},\n } = this.props;\n\n return categories(_).map((category, i) => {\n let items = traces(_)\n .filter(({category: {value}}) => value === category.value)\n .filter(i => i.value !== 'scattergl' && i.value !== 'scatterpolargl');\n\n if (!mapBoxAccess) {\n items = items.filter(i => i.value !== 'scattermapbox');\n }\n\n const MAX_ITEMS = 4;\n\n const columnClasses =\n (items.length > MAX_ITEMS && !category.maxColumns) ||\n (category.maxColumns && category.maxColumns > 1)\n ? 'trace-grid__column trace-grid__column--double'\n : 'trace-grid__column';\n\n return (\n
\n
{category.label}
\n
\n {items.map(item => (\n this.selectAndClose(item.value)}\n showActions={Boolean(chartHelp)}\n />\n ))}\n
\n
\n );\n });\n }\n\n renderGrid() {\n return
{this.renderCategories()}
;\n }\n\n renderSingleBlock() {\n const {fullValue} = this.props;\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {traces, complex},\n } = this.props;\n\n return (\n
\n {traces(_).map(item => (\n this.selectAndClose(item.value)}\n style={{display: 'inline-block'}}\n />\n ))}\n
\n );\n }\n\n render() {\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {categories},\n } = this.props;\n\n return (\n \n {categories ? this.renderGrid() : this.renderSingleBlock()}\n \n );\n }\n}\n\nTraceTypeSelector.propTypes = {\n updateContainer: PropTypes.func,\n fullValue: PropTypes.string,\n fullContainer: PropTypes.object,\n glByDefault: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n};\nTraceTypeSelector.contextTypes = {\n handleClose: PropTypes.func,\n localize: PropTypes.func,\n mapBoxAccess: PropTypes.bool,\n chartHelp: PropTypes.object,\n};\n\nexport class TraceTypeSelectorButton extends Component {\n render() {\n const {\n handleClick,\n container,\n traceTypesConfig: {traces},\n } = this.props;\n\n const {localize: _} = this.context;\n\n const inferredType = plotlyTraceToCustomTrace(container);\n const {label, icon, value} = traces(_).find(type => type.value === inferredType);\n\n const Icon = renderTraceIcon(icon ? icon : value);\n\n return (\n
\n
\n \n
\n {label}\n
\n );\n }\n}\n\nTraceTypeSelectorButton.propTypes = {\n handleClick: PropTypes.func.isRequired,\n container: PropTypes.object,\n traceTypesConfig: PropTypes.object.isRequired,\n};\nTraceTypeSelectorButton.contextType = EditorControlsContext;\n\nexport default TraceTypeSelector;\n"]} \ No newline at end of file diff --git a/src/components/widgets/TraceTypeSelector.js b/src/components/widgets/TraceTypeSelector.js index e69a99e77..afde29c94 100644 --- a/src/components/widgets/TraceTypeSelector.js +++ b/src/components/widgets/TraceTypeSelector.js @@ -61,7 +61,7 @@ Item.propTypes = { actions: PropTypes.func, showActions: PropTypes.bool, }; -Item.contextType = EditorControlsContext; +// Item.contextType = EditorControlsContext; class TraceTypeSelector extends Component { constructor(props) { From 40c5dbaf585d48edd0713ab2214bf8358dfab851 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 12 Nov 2018 21:56:04 +0900 Subject: [PATCH 19/69] add props updatePayload in PlotlyEditor --- lib/EditorControls.js | 26 +++++++++++++++++++- lib/EditorControls.js.map | 2 +- lib/PlotlyEditor.js | 6 +++-- lib/PlotlyEditor.js.map | 2 +- lib/components/containers/PlotlyPanel.js | 4 +-- lib/components/containers/PlotlyPanel.js.map | 2 +- lib/lib/index.js | 5 +++- lib/lib/index.js.map | 2 +- src/EditorControls.js | 19 ++++++++++++++ src/PlotlyEditor.js | 2 ++ src/components/containers/PlotlyPanel.js | 6 ++--- src/lib/index.js | 2 ++ 12 files changed, 63 insertions(+), 15 deletions(-) diff --git a/lib/EditorControls.js b/lib/EditorControls.js index 43104d858..c5b637b9f 100644 --- a/lib/EditorControls.js +++ b/lib/EditorControls.js @@ -66,6 +66,15 @@ var EditorControls = function (_Component) { } _createClass(EditorControls, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + var updatePayload = nextProps.updatePayload; + + if (updatePayload && updatePayload.length > 0) { + this.handleDataSourceChange(updatePayload); + } + } + }, { key: 'getChildContext', value: function getChildContext() { var gd = this.props.graphDiv || {}; @@ -129,6 +138,20 @@ var EditorControls = function (_Component) { chartHelp: this.props.chartHelp }; } + }, { + key: 'handleDataSourceChange', + value: function handleDataSourceChange(updatePayload) { + var _this2 = this; + + if (updatePayload && updatePayload.length !== 0) { + updatePayload.forEach(function (payload) { + _this2.handleUpdate({ + type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, + payload: payload + }); + }); + } + } }, { key: 'handleUpdate', value: function handleUpdate(_ref) { @@ -385,7 +408,8 @@ EditorControls.propTypes = { fontOptions: _propTypes2.default.array, chartHelp: _propTypes2.default.object, optionalPanel: _propTypes2.default.node, - menuPanelOrder: _propTypes2.default.array + menuPanelOrder: _propTypes2.default.array, + updatePayload: _propTypes2.default.array }; EditorControls.defaultProps = { diff --git a/lib/EditorControls.js.map b/lib/EditorControls.js.map index 4bff95157..8087e524d 100644 --- a/lib/EditorControls.js.map +++ b/lib/EditorControls.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","type","payload","EDITOR_ACTIONS","UPDATE_TRACES","beforeUpdateTraces","i","traceIndexes","length","attr","traceIndex","splitTraceGroup","toString","value","update","forEach","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","optionalPanel","menuPanelOrder","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAUA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;;;;;;;;;IAEMA,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAG1B,UAAKC,QAAL,GAAgB;AAAA,aAAO,yBAAe,MAAKF,KAAL,CAAWG,YAAX,IAA2B,EAA1C,EAA8C,MAAKH,KAAL,CAAWI,MAAzD,EAAiEC,GAAjE,CAAP;AAAA,KAAhB;;AAEA;AACA,QAAI,MAAKL,KAAL,CAAWM,MAAf,EAAuB;AACrB,YAAKC,UAAL,GAAkB,MAAKP,KAAL,CAAWM,MAAX,CAAkBE,UAAlB,CAA6BC,GAA7B,EAAlB;AACD;AARyB;AAS3B;;;;sCAEiB;AAChB,UAAMC,KAAK,KAAKV,KAAL,CAAWW,QAAX,IAAuB,EAAlC;AACA,aAAO;AACLC,mCAA2B,KAAKZ,KAAL,CAAWY,yBADjC;AAELC,gBAAQH,GAAGI,QAFN;AAGLC,uBAAe,KAAKf,KAAL,CAAWe,aAHrB;AAILC,cAAMN,GAAGM,IAJJ;AAKLC,qBAAa,KAAKjB,KAAL,CAAWiB,WALnB;AAMLC,2BAAmB,KAAKlB,KAAL,CAAWkB,iBANzB;AAOLC,iCAAyB,KAAKnB,KAAL,CAAWmB,uBAP/B;AAQLC,kCAA0B,KAAKpB,KAAL,CAAWoB,wBARhC;AASLjB,sBAAc,KAAKH,KAAL,CAAWG,YAAX,IAA2B,EATpC;AAULD,kBAAU,KAAKA,QAVV;AAWLmB,gBAAQX,GAAGY,eAAH,GAAqB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,aAAK,4BAAWD,CAAX,CAAL;AAAA,KAFQ;AAGhBE,aAAS;AAHO,GAHU;AAQ5BtF,eAAauF;AARe,CAA9B;;AAWA5H,eAAe6H,iBAAf,GAAmC;AACjChH,6BAA2B+F,oBAAUC,IADJ;AAEjC/F,UAAQ8F,oBAAUU,MAFe;AAGjCtG,iBAAe4F,oBAAUK,KAAV,CAAgB;AAC7BC,WAAON,oBAAUE,IAAV,CAAeK,UADO;AAE7BC,aAASR,oBAAUE,IAAV,CAAeK;AAFK,GAAhB,CAHkB;AAOjClG,QAAM2F,oBAAUS,KAPiB;AAQjChG,4BAA0BuF,oBAAUE,IARH;AASjC3F,qBAAmByF,oBAAUS,KATI;AAUjCnG,eAAa0F,oBAAUU,MAVU;AAWjClG,2BAAyBwF,oBAAUE,IAXF;AAYjC1G,gBAAcwG,oBAAUU,MAZS;AAajChG,UAAQsF,oBAAUS,KAbe;AAcjC5F,YAAUmF,oBAAUS,KAda;AAejC1F,cAAYiF,oBAAUU,MAfW;AAgBjC1G,YAAUgG,oBAAUkB,GAhBa;AAiBjCjG,UAAQ+E,oBAAUU,MAjBe;AAkBjCjH,UAAQuG,oBAAUI,MAlBe;AAmBjC7G,YAAUyG,oBAAUE,IAnBa;AAoBjChF,YAAU8E,oBAAUE,IApBa;AAqBjCvG,UAAQqG,oBAAUU,MArBe;AAsBjC9G,cAAYoG,oBAAUU,MAtBW;AAuBjCrF,oBAAkB2E,oBAAUU,MAvBK;AAwBjCpF,qBAAmB0E,oBAAUC,IAxBI;AAyBjC1E,eAAayE,oBAAUC,IAzBU;AA0BjCzE,gBAAcwE,oBAAUC,IA1BS;AA2BjCxE,eAAauE,oBAAUS,KA3BU;AA4BjC/E,aAAWsE,oBAAUU;AA5BY,CAAnC;;kBA+BetH,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? (\n this.props.children\n ) : this.props.optionalPanel ? (\n \n {this.props.optionalPanel}\n \n ) : (\n \n ))}\n \n \n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","nextProps","updatePayload","length","handleDataSourceChange","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","forEach","type","EDITOR_ACTIONS","UPDATE_TRACES","payload","beforeUpdateTraces","i","traceIndexes","attr","traceIndex","splitTraceGroup","toString","value","update","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","optionalPanel","menuPanelOrder","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAUA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;;;;;;;;;IAEMA,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAG1B,UAAKC,QAAL,GAAgB;AAAA,aAAO,yBAAe,MAAKF,KAAL,CAAWG,YAAX,IAA2B,EAA1C,EAA8C,MAAKH,KAAL,CAAWI,MAAzD,EAAiEC,GAAjE,CAAP;AAAA,KAAhB;;AAEA;AACA,QAAI,MAAKL,KAAL,CAAWM,MAAf,EAAuB;AACrB,YAAKC,UAAL,GAAkB,MAAKP,KAAL,CAAWM,MAAX,CAAkBE,UAAlB,CAA6BC,GAA7B,EAA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AAUE,IAAV,CAAeK,UADO;AAE7BC,aAASR,oBAAUE,IAAV,CAAeK;AAFK,GAAhB,CAHkB;AAOjCjG,QAAM0F,oBAAUS,KAPiB;AAQjC/F,4BAA0BsF,oBAAUE,IARH;AASjC1F,qBAAmBwF,oBAAUS,KATI;AAUjClG,eAAayF,oBAAUU,MAVU;AAWjCjG,2BAAyBuF,oBAAUE,IAXF;AAYjC7G,gBAAc2G,oBAAUU,MAZS;AAajC/F,UAAQqF,oBAAUS,KAbe;AAcjC3F,YAAUkF,oBAAUS,KAda;AAejCzF,cAAYgF,oBAAUU,MAfW;AAgBjCzG,YAAU+F,oBAAUkB,GAhBa;AAiBjChG,UAAQ8E,oBAAUU,MAjBe;AAkBjCpH,UAAQ0G,oBAAUI,MAlBe;AAmBjChH,YAAU4G,oBAAUE,IAnBa;AAoBjC/E,YAAU6E,oBAAUE,IApBa;AAqBjC1G,UAAQwG,oBAAUU,MArBe;AAsBjCjH,cAAYuG,oBAAUU,MAtBW;AAuBjCpF,oBAAkB0E,oBAAUU,MAvBK;AAwBjCnF,qBAAmByE,oBAAUC,IAxBI;AAyBjCzE,eAAawE,oBAAUC,IAzBU;AA0BjCxE,gBAAcuE,oBAAUC,IA1BS;AA2BjCvE,eAAasE,oBAAUS,KA3BU;AA4BjC9E,aAAWqE,oBAAUU;AA5BY,CAAnC;;kBA+BezH,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n componentWillReceiveProps(nextProps) {\n const {updatePayload} = nextProps;\n if (updatePayload && updatePayload.length > 0) {\n this.handleDataSourceChange(updatePayload);\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleDataSourceChange(updatePayload) {\n if (updatePayload && updatePayload.length !== 0) {\n updatePayload.forEach(payload => {\n this.handleUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload,\n });\n });\n }\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? (\n this.props.children\n ) : this.props.optionalPanel ? (\n \n {this.props.optionalPanel}\n \n ) : (\n \n ))}\n \n \n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n updatePayload: PropTypes.array,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file diff --git a/lib/PlotlyEditor.js b/lib/PlotlyEditor.js index 558074fc7..ec70672dc 100644 --- a/lib/PlotlyEditor.js +++ b/lib/PlotlyEditor.js @@ -80,7 +80,8 @@ var PlotlyEditor = function (_Component) { fontOptions: this.props.fontOptions, chartHelp: this.props.chartHelp, optionalPanel: this.props.optionalPanel, - menuPanelOrder: this.props.menuPanelOrder + menuPanelOrder: this.props.menuPanelOrder, + updatePayload: this.props.updatePayload }, this.props.children ), @@ -136,7 +137,8 @@ PlotlyEditor.propTypes = { fontOptions: _propTypes2.default.array, chartHelp: _propTypes2.default.object, optionalPanel: _propTypes2.default.any, - menuPanelOrder: _propTypes2.default.array + menuPanelOrder: _propTypes2.default.array, + updatePayload: _propTypes2.default.array }; PlotlyEditor.defaultProps = { diff --git a/lib/PlotlyEditor.js.map b/lib/PlotlyEditor.js.map index e9f41d78a..3c06925e1 100644 --- a/lib/PlotlyEditor.js.map +++ b/lib/PlotlyEditor.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/PlotlyEditor.js"],"names":["PlotlyEditor","props","state","graphDiv","PlotComponent","plotly","handleRender","bind","fig","setState","onRender","data","layout","_transitionData","_frames","hideControls","dataSources","dataSourceOptions","onUpdate","advancedTraceTypeSelector","locale","traceTypesConfig","dictionaries","showFieldTooltips","srcConverters","makeDefaultTrace","glByDefault","Boolean","config","mapboxAccessToken","fontOptions","chartHelp","optionalPanel","menuPanelOrder","children","width","height","frames","useResizeHandler","debug","divId","Component","propTypes","PropTypes","any","object","array","func","bool","string","shape","toSrc","isRequired","fromSrc","defaultProps","DEFAULT_FONTS"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Y;;;AACJ,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AAEjB,UAAKC,KAAL,GAAa,EAACC,UAAU,EAAX,EAAb;AACA,UAAKC,aAAL,GAAqB,uBAAoBH,MAAMI,MAA1B,CAArB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAJiB;AAKlB;;;;iCAEYC,G,EAAKL,Q,EAAU;AAC1B,WAAKM,QAAL,CAAc,EAACN,kBAAD,EAAd;AACA,UAAI,KAAKF,KAAL,CAAWS,QAAf,EAAyB;AACvB,aAAKT,KAAL,CAAWS,QAAX,CAAoBP,S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vB3B,oBAAkBkB,oBAAUI,IAxBL;AAyBvBrB,eAAaiB,oBAAUK,IAzBA;AA0BvBlB,eAAaa,oBAAUG,KA1BA;AA2BvBf,aAAWY,oBAAUE,MA3BE;AA4BvBb,iBAAeW,oBAAUC,GA5BF;AA6BvBX,kBAAgBU,oBAAUG;AA7BH,CAAzB;;AAgCA9C,aAAasD,YAAb,GAA4B;AAC1BvC,gBAAc,KADY;AAE1BQ,qBAAmB,KAFO;AAG1BO,eAAayB;AAHa,CAA5B;;kBAMevD,Y","file":"PlotlyEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport createPlotComponent from 'react-plotly.js/factory';\nimport EditorControls from './EditorControls';\nimport PropTypes from 'prop-types';\nimport {DEFAULT_FONTS} from 'lib/constants';\n\nclass PlotlyEditor extends Component {\n constructor(props) {\n super();\n this.state = {graphDiv: {}};\n this.PlotComponent = createPlotComponent(props.plotly);\n this.handleRender = this.handleRender.bind(this);\n }\n\n handleRender(fig, graphDiv) {\n this.setState({graphDiv});\n if (this.props.onRender) {\n this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n render() {\n return (\n
\n {!this.props.hideControls && (\n \n {this.props.children}\n \n )}\n
\n \n
\n
\n );\n }\n}\n\nPlotlyEditor.propTypes = {\n children: PropTypes.any,\n layout: PropTypes.object,\n data: PropTypes.array,\n config: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n frames: PropTypes.array,\n onUpdate: PropTypes.func,\n onRender: PropTypes.func,\n plotly: PropTypes.object,\n useResizeHandler: PropTypes.bool,\n debug: PropTypes.bool,\n advancedTraceTypeSelector: PropTypes.bool,\n locale: PropTypes.string,\n traceTypesConfig: PropTypes.object,\n dictionaries: PropTypes.object,\n divId: PropTypes.string,\n hideControls: PropTypes.bool,\n showFieldTooltips: PropTypes.bool,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.any,\n menuPanelOrder: PropTypes.array,\n};\n\nPlotlyEditor.defaultProps = {\n hideControls: false,\n showFieldTooltips: false,\n fontOptions: DEFAULT_FONTS,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/PlotlyEditor.js"],"names":["PlotlyEditor","props","state","graphDiv","PlotComponent","plotly","handleRender","bind","fig","setState","onRender","data","layout","_transitionData","_frames","hideControls","dataSources","dataSourceOptions","onUpdate","advancedTraceTypeSelector","locale","traceTypesConfig","dictionaries","showFieldTooltips","srcConverters","makeDefaultTrace","glByDefault","Boolean","config","mapboxAccessToken","fontOptions","chartHelp","optionalPanel","menuPanelOrder","updatePayload","children","width","height","frames","useResizeHandler","debug","divId","Component","propTypes","PropTypes","any","object","array","func","bool","string","shape","toSrc","isRequired","fromSrc","defaultProps","DEFAULT_FONTS"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Y;;;AACJ,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AAEjB,UAAKC,KAAL,GAAa,EAACC,UAAU,EAAX,EAAb;AACA,UAAKC,aAAL,GAAqB,uBAAoBH,MAAMI,MAA1B,CAArB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAJiB;AAKlB;;;;iCAEYC,G,EAAKL,Q,EAAU;AAC1B,WAAKM,QAAL,CAAc,EAACN,kBAAD,EAAd;AACA,UAAI,KAAKF,KAAL,CAAWS,QAAf,EAAyB;AACvB,aAAKT,KAAL,CAAWS,QAAX,CAAoBP,SAASQ,IAA7B,EAAmCR,SAASS,MAA5C,EAAoDT,SAASU,eAAT,CAAyBC,OAA7E;AACD;AACF;;;6BAEQ;AACP,aACE;AAAA;AAAA,UAAK,WAAU,eAAf;AACG,SAA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A1BA;AA2BvBhB,aAAWa,oBAAUE,MA3BE;AA4BvBd,iBAAeY,oBAAUC,GA5BF;AA6BvBZ,kBAAgBW,oBAAUG,KA7BH;AA8BvBb,iBAAeU,oBAAUG;AA9BF,CAAzB;;AAiCA/C,aAAauD,YAAb,GAA4B;AAC1BxC,gBAAc,KADY;AAE1BQ,qBAAmB,KAFO;AAG1BO,eAAa0B;AAHa,CAA5B;;kBAMexD,Y","file":"PlotlyEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport createPlotComponent from 'react-plotly.js/factory';\nimport EditorControls from './EditorControls';\nimport PropTypes from 'prop-types';\nimport {DEFAULT_FONTS} from 'lib/constants';\n\nclass PlotlyEditor extends Component {\n constructor(props) {\n super();\n this.state = {graphDiv: {}};\n this.PlotComponent = createPlotComponent(props.plotly);\n this.handleRender = this.handleRender.bind(this);\n }\n\n handleRender(fig, graphDiv) {\n this.setState({graphDiv});\n if (this.props.onRender) {\n this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n render() {\n return (\n
\n {!this.props.hideControls && (\n \n {this.props.children}\n \n )}\n
\n \n
\n
\n );\n }\n}\n\nPlotlyEditor.propTypes = {\n children: PropTypes.any,\n layout: PropTypes.object,\n data: PropTypes.array,\n config: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n frames: PropTypes.array,\n onUpdate: PropTypes.func,\n onRender: PropTypes.func,\n plotly: PropTypes.object,\n useResizeHandler: PropTypes.bool,\n debug: PropTypes.bool,\n advancedTraceTypeSelector: PropTypes.bool,\n locale: PropTypes.string,\n traceTypesConfig: PropTypes.object,\n dictionaries: PropTypes.object,\n divId: PropTypes.string,\n hideControls: PropTypes.bool,\n showFieldTooltips: PropTypes.bool,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.any,\n menuPanelOrder: PropTypes.array,\n updatePayload: PropTypes.array,\n};\n\nPlotlyEditor.defaultProps = {\n hideControls: false,\n showFieldTooltips: false,\n fontOptions: DEFAULT_FONTS,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PlotlyPanel.js b/lib/components/containers/PlotlyPanel.js index 38c6a5571..5ecc2d74c 100644 --- a/lib/components/containers/PlotlyPanel.js +++ b/lib/components/containers/PlotlyPanel.js @@ -71,9 +71,7 @@ var PanelErrorImpl = function (_Component) { return PanelErrorImpl; }(_react.Component); -PanelErrorImpl.contextTypes = { - localize: _propTypes2.default.func -}; +PanelErrorImpl.contextType = _context.EditorControlsContext; var PanelError = PanelErrorImpl; diff --git a/lib/components/containers/PlotlyPanel.js.map b/lib/components/containers/PlotlyPanel.js.map index 6e5ba16bc..4d656a370 100644 --- a/lib/components/containers/PlotlyPanel.js.map +++ b/lib/components/containers/PlotlyPanel.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/components/containers/PlotlyPanel.js"],"names":["PanelErrorImpl","_","context","localize","EmbedIconIcon","Component","contextTypes","PropTypes","func","PanelError","Panel","props","state","individualFoldStates","hasError","toggleFolds","bind","toggleFold","deleteContainer","deleteAction","setState","hasOpen","length","some","s","map","index","$toggle","numFolds","React","Children","forEach","children","child","type","plotly_editor_traits","foldable","newFoldStates","Array","fill","addAction","e","i","calculateFolds","provideValue","newChildren","key","folded","noPadding","showExpandCollapse","propTypes","object","node","bool","defaultProps","childContextTypes","PlotlyPanel","no_visibility_forcing"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;IAEMA,c;;;;;;;;;;;6BACK;AAAA,UACUC,CADV,GACe,KAAKC,OADpB,CACAC,QADA;;;AAGP,aACE;AAAC,4BAAD;AAAA,UAAY,MAAMC,0BAAlB,EAAiC,SAASH,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,yBAAuB;AADU,CAAnC;;kBAIeD,W","file":"PlotlyPanel.js","sourcesContent":["import PanelHeader from './PanelHeader';\nimport PanelEmpty from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component, cloneElement} from 'react';\nimport update from 'immutability-helper';\nimport {bem} from 'lib';\nimport {EmbedIconIcon} from 'plotly-icons';\nimport {PlotlyPanelContext} from '../../context';\n\nclass PanelErrorImpl extends Component {\n render() {\n const {localize: _} = this.context;\n\n return (\n \n

{_('This panel could not be displayed due to an error.')}

\n
\n );\n }\n}\n\nPanelErrorImpl.contextTypes = {\n localize: PropTypes.func,\n};\n\nconst PanelError = PanelErrorImpl;\n\nexport class Panel extends Component {\n constructor(props) {\n super(props);\n this.state = {\n individualFoldStates: [],\n hasError: false,\n };\n this.toggleFolds = this.toggleFolds.bind(this);\n this.toggleFold = this.toggleFold.bind(this);\n }\n\n getChildContext() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n provideValue() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n componentDidCatch() {\n this.setState({hasError: true});\n }\n\n toggleFolds() {\n const {individualFoldStates} = this.state;\n const hasOpen = individualFoldStates.length > 0 && individualFoldStates.some(s => s !== true);\n this.setState({\n individualFoldStates: individualFoldStates.map(() => hasOpen),\n });\n }\n\n toggleFold(index) {\n this.setState(update(this.state, {individualFoldStates: {$toggle: [index]}}));\n }\n\n calculateFolds() {\n // to get proper number of child folds and initialize component state\n let numFolds = 0;\n\n React.Children.forEach(this.props.children, child => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n numFolds++;\n }\n });\n\n if (this.state.individualFoldStates.length !== numFolds) {\n const newFoldStates = new Array(numFolds).fill(false);\n this.setState({\n individualFoldStates: this.props.addAction\n ? newFoldStates.map((e, i) => i !== numFolds - 1)\n : newFoldStates,\n });\n }\n }\n\n componentDidUpdate() {\n this.calculateFolds();\n }\n componentDidMount() {\n this.calculateFolds();\n }\n\n render() {\n const {individualFoldStates, hasError} = this.state;\n\n if (hasError) {\n return (\n \n \n \n );\n }\n\n const newChildren = React.Children.map(this.props.children, (child, index) => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n return cloneElement(child, {\n key: index,\n folded: individualFoldStates[index] || false,\n toggleFold: () => this.toggleFold(index),\n });\n }\n return child;\n });\n\n return (\n \n
\n 1}\n toggleFolds={this.toggleFolds}\n hasOpen={individualFoldStates.some(s => s === false)}\n />\n
{newChildren}
\n
\n
\n );\n }\n}\n\nPanel.propTypes = {\n addAction: PropTypes.object,\n children: PropTypes.node,\n deleteAction: PropTypes.func,\n noPadding: PropTypes.bool,\n showExpandCollapse: PropTypes.bool,\n};\n\nPanel.defaultProps = {\n showExpandCollapse: true,\n};\n\nPanel.contextTypes = {\n localize: PropTypes.func,\n};\n\nPanel.childContextTypes = {\n deleteContainer: PropTypes.func,\n};\n\nclass PlotlyPanel extends Panel {}\n\nPlotlyPanel.plotly_editor_traits = {\n no_visibility_forcing: true,\n};\n\nexport default PlotlyPanel;\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/components/containers/PlotlyPanel.js"],"names":["PanelErrorImpl","_","context","localize","EmbedIconIcon","Component","contextType","EditorControlsContext","PanelError","Panel","props","state","individualFoldStates","hasError","toggleFolds","bind","toggleFold","deleteContainer","deleteAction","setState","hasOpen","length","some","s","map","index","$toggle","numFolds","React","Children","forEach","children","child","type","plotly_editor_traits","foldable","newFoldStates","Array","fill","addAction","e","i","calculateFolds","provideValue","newChildren","key","folded","noPadding","showExpandCollapse","propTypes","PropTypes","object","node","func","bool","defaultProps","contextTypes","childContextTypes","PlotlyPanel","no_visibility_forcing"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;IAEMA,c;;;;;;;;;;;6BACK;AAAA,UACUC,CADV,GACe,KAAKC,OADpB,CACAC,QADA;;;AAGP,aACE;A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Z,GAAmC;AACjCyB,yBAAuB;AADU,CAAnC;;kBAIeD,W","file":"PlotlyPanel.js","sourcesContent":["import PanelHeader from './PanelHeader';\nimport PanelEmpty from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component, cloneElement} from 'react';\nimport update from 'immutability-helper';\nimport {bem} from 'lib';\nimport {EmbedIconIcon} from 'plotly-icons';\nimport {EditorControlsContext, PlotlyPanelContext} from '../../context';\n\nclass PanelErrorImpl extends Component {\n render() {\n const {localize: _} = this.context;\n\n return (\n \n

{_('This panel could not be displayed due to an error.')}

\n
\n );\n }\n}\n\nPanelErrorImpl.contextType = EditorControlsContext;\n\nconst PanelError = PanelErrorImpl;\n\nexport class Panel extends Component {\n constructor(props) {\n super(props);\n this.state = {\n individualFoldStates: [],\n hasError: false,\n };\n this.toggleFolds = this.toggleFolds.bind(this);\n this.toggleFold = this.toggleFold.bind(this);\n }\n\n getChildContext() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n provideValue() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n componentDidCatch() {\n this.setState({hasError: true});\n }\n\n toggleFolds() {\n const {individualFoldStates} = this.state;\n const hasOpen = individualFoldStates.length > 0 && individualFoldStates.some(s => s !== true);\n this.setState({\n individualFoldStates: individualFoldStates.map(() => hasOpen),\n });\n }\n\n toggleFold(index) {\n this.setState(update(this.state, {individualFoldStates: {$toggle: [index]}}));\n }\n\n calculateFolds() {\n // to get proper number of child folds and initialize component state\n let numFolds = 0;\n\n React.Children.forEach(this.props.children, child => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n numFolds++;\n }\n });\n\n if (this.state.individualFoldStates.length !== numFolds) {\n const newFoldStates = new Array(numFolds).fill(false);\n this.setState({\n individualFoldStates: this.props.addAction\n ? newFoldStates.map((e, i) => i !== numFolds - 1)\n : newFoldStates,\n });\n }\n }\n\n componentDidUpdate() {\n this.calculateFolds();\n }\n componentDidMount() {\n this.calculateFolds();\n }\n\n render() {\n const {individualFoldStates, hasError} = this.state;\n\n if (hasError) {\n return (\n \n \n \n );\n }\n\n const newChildren = React.Children.map(this.props.children, (child, index) => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n return cloneElement(child, {\n key: index,\n folded: individualFoldStates[index] || false,\n toggleFold: () => this.toggleFold(index),\n });\n }\n return child;\n });\n\n return (\n \n
\n 1}\n toggleFolds={this.toggleFolds}\n hasOpen={individualFoldStates.some(s => s === false)}\n />\n
{newChildren}
\n
\n
\n );\n }\n}\n\nPanel.propTypes = {\n addAction: PropTypes.object,\n children: PropTypes.node,\n deleteAction: PropTypes.func,\n noPadding: PropTypes.bool,\n showExpandCollapse: PropTypes.bool,\n};\n\nPanel.defaultProps = {\n showExpandCollapse: true,\n};\n\nPanel.contextTypes = {\n localize: PropTypes.func,\n};\n\nPanel.childContextTypes = {\n deleteContainer: PropTypes.func,\n};\n\nclass PlotlyPanel extends Panel {}\n\nPlotlyPanel.plotly_editor_traits = {\n no_visibility_forcing: true,\n};\n\nexport default PlotlyPanel;\n"]} \ No newline at end of file diff --git a/lib/lib/index.js b/lib/lib/index.js index 198ae5483..8dbe2c652 100644 --- a/lib/lib/index.js +++ b/lib/lib/index.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.getFullTrace = exports.transpose = exports.traceTypeToAxisType = exports.striptags = exports.tooLight = exports.walkObject = exports.unpackPlotProps = exports.renderTraceIcon = exports.plotlyTraceToCustomTrace = exports.maybeTransposeData = exports.maybeAdjustSrc = exports.localizeString = exports.localize = exports.isPlainObject = exports.getDisplayName = exports.getSubplotTitle = exports.getAxisTitle = exports.getAllAxes = exports.dereference = exports.traceTypeToPlotlyInitFigure = exports.computeTraceOptionsFromSchema = exports.containerConnectedContextTypes = exports.connectTraceToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectUpdateMenuToLayout = exports.connectSliderToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.clamp = exports.pascalCase = exports.camelCase = exports.removeNonWord = exports.upperCase = exports.lowerCase = exports.capitalize = exports.bem = exports.axisIdToAxisName = exports.adjustColorscale = undefined; +exports.EDITOR_ACTIONS = exports.getFullTrace = exports.transpose = exports.traceTypeToAxisType = exports.striptags = exports.tooLight = exports.walkObject = exports.unpackPlotProps = exports.renderTraceIcon = exports.plotlyTraceToCustomTrace = exports.maybeTransposeData = exports.maybeAdjustSrc = exports.localizeString = exports.localize = exports.isPlainObject = exports.getDisplayName = exports.getSubplotTitle = exports.getAxisTitle = exports.getAllAxes = exports.dereference = exports.traceTypeToPlotlyInitFigure = exports.computeTraceOptionsFromSchema = exports.containerConnectedContextTypes = exports.connectTraceToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectUpdateMenuToLayout = exports.connectSliderToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.clamp = exports.pascalCase = exports.camelCase = exports.removeNonWord = exports.upperCase = exports.lowerCase = exports.capitalize = exports.bem = exports.axisIdToAxisName = exports.adjustColorscale = undefined; var _bem = require('./bem'); @@ -105,6 +105,8 @@ var _strings = require('./strings'); var _reactColorscales = require('react-colorscales'); +var _constants = require('./constants'); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -310,4 +312,5 @@ exports.striptags = _striptags2.default; exports.traceTypeToAxisType = _getAllAxes.traceTypeToAxisType; exports.transpose = transpose; exports.getFullTrace = getFullTrace; +exports.EDITOR_ACTIONS = _constants.EDITOR_ACTIONS; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/lib/index.js.map b/lib/lib/index.js.map index 42790de58..80092daf6 100644 --- a/lib/lib/index.js.map +++ b/lib/lib/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/lib/index.js"],"names":["PlotlyIcons","TOO_LIGHT_FACTOR","clamp","value","min","max","Math","getDisplayName","WrappedComponent","displayName","name","tooLight","color","hslColor","toHsl","l","renderTraceIcon","trace","prefix","gl","componentName","endsWith","slice","length","PlotLineIcon","transpose","originalArray","every","Array","isArray","a","map","longestArrayItem","forEach","newArray","outerIndex","innerIndex","push","specialTableCase","traceType","srcAttributePath","some","maybeTransposeData","data","isTransposable2DArray","includes","maybeAdjustSrc","src","config","fromSrc","adjustColorscale","colorscale","numberOfNeededColors","colorscaleType","repeat","repetitions","ceil","fill","reduce","b","concat","getFullTrace","props","context","fullTrace","fullData","fullDataArrayPosition","filter","t","traceIndexes","index","transforms","type","_fullInput","axisIdToAxisName","bem","capitalize","lowerCase","upperCase","removeNonWord","camelCase","pascalCase","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectSliderToLayout","connectUpdateMenuToLayout","connectImageToLayout","connectAxesToLayout","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTransformToTrace","connectAggregationToTransform","connectTraceToPlot","containerConnectedContextTypes","computeTraceOptionsFromSchema","traceTypeToPlotlyInitFigure","dereference","getAllAxes","getAxisTitle","getSubplotTitle","isPlainObject","localize","localizeString","plotlyTraceToCustomTrace","unpackPlotProps","walkObject","striptags","traceTypeToAxisType"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;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,MAAnB,EAA2BI,QAA3B,CAAoCuB,EAAEI,IAAtC,CAAL;AAAA,KAA1B,CADD,IAEA,CAACV,MAAMI,qBAHT,EAIE;AACAF,kBAAYA,UAAUS,UAAtB;AACD;AACF;AACD,SAAOT,SAAP;AACD;;QAGCd,gB,GAAAA,gB;QACAwB,gB,GAAAA,4B;QACAC,G,GAAAA,a;QACAC,U,GAAAA,mB;QACAC,S,GAAAA,kB;QACAC,S,GAAAA,kB;QACAC,a,GAAAA,sB;QACAC,S,GAAAA,kB;QACAC,U,GAAAA,mB;QACA/E,K,GAAAA,K;QACAgF,+B,GAAAA,yC;QACAC,kC,GAAAA,4C;QACAC,yB,GAAAA,mC;QACAC,oB,GAAAA,8B;QACAC,qB,GAAAA,+B;QACAC,yB,GAAAA,mC;QACAC,oB,GAAAA,8B;QACAC,mB,GAAAA,6B;QACAC,mB,GAAAA,6B;QACAC,kB,GAAAA,4B;QACAC,0B,GAAAA,oC;QACAC,uB,GAAAA,iC;QACAC,6B,GAAAA,uC;QACAC,kB,GAAAA,4B;QACAC,8B,GAAAA,kD;QACAC,6B,GAAAA,4D;QACAC,2B,GAAAA,4C;QACAC,W,GAAAA,qB;QACAC,U,GAAAA,oB;QACAC,Y,GAAAA,wB;QACAC,e,GAAAA,2B;QACA/F,c,GAAAA,c;QACAgG,a,GAAAA,yB;QACAC,Q,GAAAA,kB;QACAC,c,GAAAA,wB;QACA3D,c,GAAAA,c;QACAJ,kB,GAAAA,kB;QACAgE,wB,GAAAA,yC;QACA1F,e,GAAAA,e;QACA2F,e,GAAAA,yB;QACAC,U,GAAAA,oB;QACAjG,Q,GAAAA,Q;QACAkG,S,GAAAA,mB;QACAC,mB,GAAAA,+B;QACArF,S,GAAAA,S;QACAoC,Y,GAAAA,Y","file":"index.js","sourcesContent":["import bem from './bem';\nimport connectCartesianSubplotToLayout from './connectCartesianSubplotToLayout';\nimport connectNonCartesianSubplotToLayout from './connectNonCartesianSubplotToLayout';\nimport connectAnnotationToLayout from './connectAnnotationToLayout';\nimport connectShapeToLayout from './connectShapeToLayout';\nimport connectSliderToLayout from './connectSliderToLayout';\nimport connectImageToLayout from './connectImageToLayout';\nimport connectUpdateMenuToLayout from './connectUpdateMenuToLayout';\nimport connectRangeSelectorToAxis from './connectRangeSelectorToAxis';\nimport connectTransformToTrace from './connectTransformToTrace';\nimport connectAggregationToTransform from './connectAggregationToTransform';\nimport connectAxesToLayout from './connectAxesToLayout';\nimport connectLayoutToPlot from './connectLayoutToPlot';\nimport connectToContainer, {containerConnectedContextTypes} from './connectToContainer';\nimport {computeTraceOptionsFromSchema} from './computeTraceOptionsFromSchema';\nimport connectTraceToPlot from './connectTraceToPlot';\nimport dereference from './dereference';\nimport getAllAxes, {\n axisIdToAxisName,\n traceTypeToAxisType,\n getAxisTitle,\n getSubplotTitle,\n} from './getAllAxes';\nimport localize, {localizeString} from './localize';\nimport tinyColor from 'tinycolor2';\nimport unpackPlotProps from './unpackPlotProps';\nimport walkObject, {isPlainObject} from './walkObject';\nimport {traceTypeToPlotlyInitFigure, plotlyTraceToCustomTrace} from './customTraceType';\nimport * as PlotlyIcons from 'plotly-icons';\nimport striptags from './striptags';\nimport {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase} from './strings';\nimport {getColorscale} from 'react-colorscales';\n\nconst TOO_LIGHT_FACTOR = 0.8;\n\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nfunction tooLight(color) {\n const hslColor = tinyColor(color).toHsl();\n return hslColor.l > TOO_LIGHT_FACTOR;\n}\n\nfunction renderTraceIcon(trace, prefix = 'Plot') {\n if (!trace) {\n return null;\n }\n const gl = 'gl';\n const componentName = `${prefix}${pascalCase(\n trace.endsWith(gl) ? trace.slice(0, -gl.length) : trace\n )}Icon`;\n\n return PlotlyIcons[componentName] ? PlotlyIcons[componentName] : PlotlyIcons.PlotLineIcon;\n}\n\nfunction transpose(originalArray) {\n // if we want to transpose a uni dimensional array\n if (originalArray.every(a => !Array.isArray(a))) {\n return originalArray.map(a => [a]);\n }\n\n let longestArrayItem = Array.isArray(originalArray[0]) ? originalArray[0].length : 1;\n\n originalArray.forEach(a => {\n // if it's not an array, it's a string\n const length = Array.isArray(a) ? a.length : 1;\n if (length > longestArrayItem) {\n longestArrayItem = length;\n }\n });\n\n const newArray = new Array(longestArrayItem);\n\n for (let outerIndex = 0; outerIndex < originalArray.length; outerIndex++) {\n if (!Array.isArray(originalArray[outerIndex])) {\n originalArray[outerIndex] = [originalArray[outerIndex]];\n }\n\n for (let innerIndex = 0; innerIndex < longestArrayItem; innerIndex++) {\n // ensure we have an array to push to\n if (!Array.isArray(newArray[innerIndex])) {\n newArray[innerIndex] = [];\n }\n\n const value =\n typeof originalArray[outerIndex][innerIndex] !== 'undefined'\n ? originalArray[outerIndex][innerIndex]\n : null;\n newArray[innerIndex].push(value);\n }\n }\n\n return newArray;\n}\n\nconst specialTableCase = (traceType, srcAttributePath) => {\n /* Just more user friendly\n * Table traces have many configuration options,\n * The below attributes can be 2d or 1d and will affect the plot differently\n * EX:\n * header.values = ['Jan', 'Feb', 'Mar'] => will put data in a row\n * header.values = [['Jan', 1], ['Feb', 2], ['Mar', 3]] => will create 3 columns\n * 1d arrays affect columns\n * 2d arrays affect rows within each column\n */\n return (\n traceType === 'table' &&\n [\n 'header.valuessrc',\n 'header.font.colorsrc',\n 'header.font.sizesrc',\n 'header.fill.colorsrc',\n 'columnwidthsrc',\n ].some(a => srcAttributePath.endsWith(a))\n );\n};\n\nfunction maybeTransposeData(data, srcAttributePath, traceType) {\n if (!data || (Array.isArray(data) && data.length === 0)) {\n return null;\n }\n\n const isTransposable2DArray =\n srcAttributePath.endsWith('zsrc') &&\n ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(\n traceType\n );\n\n if (isTransposable2DArray) {\n return transpose(data);\n }\n\n if (\n specialTableCase(traceType, srcAttributePath) &&\n Array.isArray(data[0]) &&\n data.length === 1\n ) {\n return data[0];\n }\n\n return data;\n}\n\nfunction maybeAdjustSrc(src, srcAttributePath, traceType, config) {\n if (!src || (Array.isArray(src) && src.length === 0)) {\n return null;\n }\n\n if (specialTableCase(traceType, srcAttributePath) && src.length === 1) {\n return src[0];\n }\n\n return config && config.fromSrc ? config.fromSrc(src, traceType) : src;\n}\n\nfunction adjustColorscale(colorscale, numberOfNeededColors, colorscaleType, config) {\n if (config && config.repeat) {\n if (numberOfNeededColors < colorscale.length) {\n return colorscale.slice(0, numberOfNeededColors);\n }\n\n const repetitions = Math.ceil(numberOfNeededColors / colorscale.length);\n const newArray = new Array(repetitions).fill(colorscale);\n return newArray\n .reduce((a, b) => {\n return a.concat(b);\n }, [])\n .slice(0, numberOfNeededColors);\n }\n\n return getColorscale(colorscale, numberOfNeededColors, null, null, colorscaleType);\n}\n\nfunction getFullTrace(props, context) {\n let fullTrace = {};\n if (context.fullData && context.data) {\n if (props.fullDataArrayPosition) {\n // fullDataArrayPosition will be supplied in panels that have the canGroup prop\n fullTrace = context.fullData[props.fullDataArrayPosition[0]];\n } else {\n // for all other panels, we'll find fullTrace with the data index\n fullTrace = context.fullData.filter(t => t && props.traceIndexes[0] === t.index)[0];\n }\n\n // For transformed traces, we actually want to read in _fullInput because\n // there's original parent information that's more useful to the user there\n // This is true except for fit transforms, where reading in fullData is\n // what we want\n if (\n fullTrace.transforms &&\n !fullTrace.transforms.some(t => ['moving-average', 'fits'].includes(t.type)) &&\n !props.fullDataArrayPosition\n ) {\n fullTrace = fullTrace._fullInput;\n }\n }\n return fullTrace;\n}\n\nexport {\n adjustColorscale,\n axisIdToAxisName,\n bem,\n capitalize,\n lowerCase,\n upperCase,\n removeNonWord,\n camelCase,\n pascalCase,\n clamp,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectSliderToLayout,\n connectUpdateMenuToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectTraceToPlot,\n containerConnectedContextTypes,\n computeTraceOptionsFromSchema,\n traceTypeToPlotlyInitFigure,\n dereference,\n getAllAxes,\n getAxisTitle,\n getSubplotTitle,\n getDisplayName,\n isPlainObject,\n localize,\n localizeString,\n maybeAdjustSrc,\n maybeTransposeData,\n plotlyTraceToCustomTrace,\n renderTraceIcon,\n unpackPlotProps,\n walkObject,\n tooLight,\n striptags,\n traceTypeToAxisType,\n transpose,\n getFullTrace,\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../src/lib/index.js"],"names":["PlotlyIcons","TOO_LIGHT_FACTOR","clamp","value","min","max","Math","getDisplayName","WrappedComponent","displayName","name","tooLight","color","hslColor","toHsl","l","renderTraceIcon","trace","prefix","gl","componentName","endsWith","slice","length","PlotLineIcon","transpose","originalArray","every","Array","isArray","a","map","longestArrayItem","forEach","newArray","outerIndex","innerIndex","push","specialTableCase","traceType","srcAttributePath","some","maybeTransposeData","data","isTransposable2DArray","includes","maybeAdjustSrc","src","config","fromSrc","adjustColorscale","colorscale","numberOfNeededColors","colorscaleType","repeat","repetitions","ceil","fill","reduce","b","concat","getFullTrace","props","context","fullTrace","fullData","fullDataArrayPosition","filter","t","traceIndexes","index","transforms","type","_fullInput","axisIdToAxisName","bem","capitalize","lowerCase","upperCase","removeNonWord","camelCase","pascalCase","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectSliderToLayout","connectUpdateMenuToLayout","connectImageToLayout","connectAxesToLayout","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTransformToTrace","connectAggregationToTransform","connectTraceToPlot","containerConnectedContextTypes","computeTraceOptionsFromSchema","traceTypeToPlotlyInitFigure","dereference","getAllAxes","getAxisTitle","getSubplotTitle","isPlainObject","localize","localizeString","plotlyTraceToCustomTrace","unpackPlotProps","walkObject","striptags","traceTypeToAxisType","EDITOR_ACTIONS"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AAMA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;IAAYA,W;;AACZ;;;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMC,mBAAmB,GAAzB;;AAEA,SAASC,KAAT,CAAeC,KAAf,EAAsBC,GAAtB,EAA2BC,GAA3B,EAAgC;AAC9B,SAAOC,KAAKD,GAAL,CAASD,GAAT,EAAcE,KAAKF,GAAL,CAASC,GAAT,EAAcF,KAAd,CAAd,CAAP;AACD;;AAED,SAASI,cAAT,CAAwBC,gBAAxB,EAA0C;AACxC,SAAOA,iBAAiBC,WAAjB,IAAgCD,iBAAiBE,IAAjD,IAAyD,WAAhE;AACD;;AAED,SAASC,QAAT,CAAkBC,KAAlB,EAAyB;AACvB,MAAMC,WAAW,yBAAUD,KAAV,EAAiBE,KAAjB,EAAjB;AACA,SAAOD,SAASE,CAAT,GAAad,gBAApB;AACD;;AAED,SAASe,eAAT,CAAyBC,KAAzB,EAAiD;AAAA,MAAjBC,MAAiB,uEAAR,MAAQ;;AAC/C,MAAI,CAACD,KAAL,EAAY;AACV,WAAO,IAAP;AACD;AACD,MAAME,KAAK,IAAX;AACA,MAAMC,qBAAmBF,MAAnB,GAA4B,yBAChCD,MAAMI,QAAN,CAAeF,EAAf,IAAqBF,MAAMK,KAAN,CAAY,CAAZ,EAAe,CAACH,GAAGI,MAAnB,CAArB,GAAkDN,KADlB,CAA5B,SAAN;;AAIA,SAAOjB,YAAYoB,aAAZ,IAA6BpB,YAAYoB,aAAZ,CAA7B,GAA0DpB,YAAYwB,YAA7E;AACD;;AAED,SAASC,SAAT,CAAmBC,aAAnB,EAAkC;A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AAA,S;QACAoC,Y,GAAAA,Y;QACAkD,c,GAAAA,yB","file":"index.js","sourcesContent":["import bem from './bem';\nimport connectCartesianSubplotToLayout from './connectCartesianSubplotToLayout';\nimport connectNonCartesianSubplotToLayout from './connectNonCartesianSubplotToLayout';\nimport connectAnnotationToLayout from './connectAnnotationToLayout';\nimport connectShapeToLayout from './connectShapeToLayout';\nimport connectSliderToLayout from './connectSliderToLayout';\nimport connectImageToLayout from './connectImageToLayout';\nimport connectUpdateMenuToLayout from './connectUpdateMenuToLayout';\nimport connectRangeSelectorToAxis from './connectRangeSelectorToAxis';\nimport connectTransformToTrace from './connectTransformToTrace';\nimport connectAggregationToTransform from './connectAggregationToTransform';\nimport connectAxesToLayout from './connectAxesToLayout';\nimport connectLayoutToPlot from './connectLayoutToPlot';\nimport connectToContainer, {containerConnectedContextTypes} from './connectToContainer';\nimport {computeTraceOptionsFromSchema} from './computeTraceOptionsFromSchema';\nimport connectTraceToPlot from './connectTraceToPlot';\nimport dereference from './dereference';\nimport getAllAxes, {\n axisIdToAxisName,\n traceTypeToAxisType,\n getAxisTitle,\n getSubplotTitle,\n} from './getAllAxes';\nimport localize, {localizeString} from './localize';\nimport tinyColor from 'tinycolor2';\nimport unpackPlotProps from './unpackPlotProps';\nimport walkObject, {isPlainObject} from './walkObject';\nimport {traceTypeToPlotlyInitFigure, plotlyTraceToCustomTrace} from './customTraceType';\nimport * as PlotlyIcons from 'plotly-icons';\nimport striptags from './striptags';\nimport {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase} from './strings';\nimport {getColorscale} from 'react-colorscales';\nimport {EDITOR_ACTIONS} from './constants';\n\nconst TOO_LIGHT_FACTOR = 0.8;\n\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nfunction tooLight(color) {\n const hslColor = tinyColor(color).toHsl();\n return hslColor.l > TOO_LIGHT_FACTOR;\n}\n\nfunction renderTraceIcon(trace, prefix = 'Plot') {\n if (!trace) {\n return null;\n }\n const gl = 'gl';\n const componentName = `${prefix}${pascalCase(\n trace.endsWith(gl) ? trace.slice(0, -gl.length) : trace\n )}Icon`;\n\n return PlotlyIcons[componentName] ? PlotlyIcons[componentName] : PlotlyIcons.PlotLineIcon;\n}\n\nfunction transpose(originalArray) {\n // if we want to transpose a uni dimensional array\n if (originalArray.every(a => !Array.isArray(a))) {\n return originalArray.map(a => [a]);\n }\n\n let longestArrayItem = Array.isArray(originalArray[0]) ? originalArray[0].length : 1;\n\n originalArray.forEach(a => {\n // if it's not an array, it's a string\n const length = Array.isArray(a) ? a.length : 1;\n if (length > longestArrayItem) {\n longestArrayItem = length;\n }\n });\n\n const newArray = new Array(longestArrayItem);\n\n for (let outerIndex = 0; outerIndex < originalArray.length; outerIndex++) {\n if (!Array.isArray(originalArray[outerIndex])) {\n originalArray[outerIndex] = [originalArray[outerIndex]];\n }\n\n for (let innerIndex = 0; innerIndex < longestArrayItem; innerIndex++) {\n // ensure we have an array to push to\n if (!Array.isArray(newArray[innerIndex])) {\n newArray[innerIndex] = [];\n }\n\n const value =\n typeof originalArray[outerIndex][innerIndex] !== 'undefined'\n ? originalArray[outerIndex][innerIndex]\n : null;\n newArray[innerIndex].push(value);\n }\n }\n\n return newArray;\n}\n\nconst specialTableCase = (traceType, srcAttributePath) => {\n /* Just more user friendly\n * Table traces have many configuration options,\n * The below attributes can be 2d or 1d and will affect the plot differently\n * EX:\n * header.values = ['Jan', 'Feb', 'Mar'] => will put data in a row\n * header.values = [['Jan', 1], ['Feb', 2], ['Mar', 3]] => will create 3 columns\n * 1d arrays affect columns\n * 2d arrays affect rows within each column\n */\n return (\n traceType === 'table' &&\n [\n 'header.valuessrc',\n 'header.font.colorsrc',\n 'header.font.sizesrc',\n 'header.fill.colorsrc',\n 'columnwidthsrc',\n ].some(a => srcAttributePath.endsWith(a))\n );\n};\n\nfunction maybeTransposeData(data, srcAttributePath, traceType) {\n if (!data || (Array.isArray(data) && data.length === 0)) {\n return null;\n }\n\n const isTransposable2DArray =\n srcAttributePath.endsWith('zsrc') &&\n ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(\n traceType\n );\n\n if (isTransposable2DArray) {\n return transpose(data);\n }\n\n if (\n specialTableCase(traceType, srcAttributePath) &&\n Array.isArray(data[0]) &&\n data.length === 1\n ) {\n return data[0];\n }\n\n return data;\n}\n\nfunction maybeAdjustSrc(src, srcAttributePath, traceType, config) {\n if (!src || (Array.isArray(src) && src.length === 0)) {\n return null;\n }\n\n if (specialTableCase(traceType, srcAttributePath) && src.length === 1) {\n return src[0];\n }\n\n return config && config.fromSrc ? config.fromSrc(src, traceType) : src;\n}\n\nfunction adjustColorscale(colorscale, numberOfNeededColors, colorscaleType, config) {\n if (config && config.repeat) {\n if (numberOfNeededColors < colorscale.length) {\n return colorscale.slice(0, numberOfNeededColors);\n }\n\n const repetitions = Math.ceil(numberOfNeededColors / colorscale.length);\n const newArray = new Array(repetitions).fill(colorscale);\n return newArray\n .reduce((a, b) => {\n return a.concat(b);\n }, [])\n .slice(0, numberOfNeededColors);\n }\n\n return getColorscale(colorscale, numberOfNeededColors, null, null, colorscaleType);\n}\n\nfunction getFullTrace(props, context) {\n let fullTrace = {};\n if (context.fullData && context.data) {\n if (props.fullDataArrayPosition) {\n // fullDataArrayPosition will be supplied in panels that have the canGroup prop\n fullTrace = context.fullData[props.fullDataArrayPosition[0]];\n } else {\n // for all other panels, we'll find fullTrace with the data index\n fullTrace = context.fullData.filter(t => t && props.traceIndexes[0] === t.index)[0];\n }\n\n // For transformed traces, we actually want to read in _fullInput because\n // there's original parent information that's more useful to the user there\n // This is true except for fit transforms, where reading in fullData is\n // what we want\n if (\n fullTrace.transforms &&\n !fullTrace.transforms.some(t => ['moving-average', 'fits'].includes(t.type)) &&\n !props.fullDataArrayPosition\n ) {\n fullTrace = fullTrace._fullInput;\n }\n }\n return fullTrace;\n}\n\nexport {\n adjustColorscale,\n axisIdToAxisName,\n bem,\n capitalize,\n lowerCase,\n upperCase,\n removeNonWord,\n camelCase,\n pascalCase,\n clamp,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectSliderToLayout,\n connectUpdateMenuToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectTraceToPlot,\n containerConnectedContextTypes,\n computeTraceOptionsFromSchema,\n traceTypeToPlotlyInitFigure,\n dereference,\n getAllAxes,\n getAxisTitle,\n getSubplotTitle,\n getDisplayName,\n isPlainObject,\n localize,\n localizeString,\n maybeAdjustSrc,\n maybeTransposeData,\n plotlyTraceToCustomTrace,\n renderTraceIcon,\n unpackPlotProps,\n walkObject,\n tooLight,\n striptags,\n traceTypeToAxisType,\n transpose,\n getFullTrace,\n EDITOR_ACTIONS,\n};\n"]} \ No newline at end of file diff --git a/src/EditorControls.js b/src/EditorControls.js index 91d937e55..e9292a953 100644 --- a/src/EditorControls.js +++ b/src/EditorControls.js @@ -32,6 +32,13 @@ class EditorControls extends Component { } } + componentWillReceiveProps(nextProps) { + const {updatePayload} = nextProps; + if (updatePayload && updatePayload.length > 0) { + this.handleDataSourceChange(updatePayload); + } + } + getChildContext() { const gd = this.props.graphDiv || {}; return { @@ -94,6 +101,17 @@ class EditorControls extends Component { }; } + handleDataSourceChange(updatePayload) { + if (updatePayload && updatePayload.length !== 0) { + updatePayload.forEach(payload => { + this.handleUpdate({ + type: EDITOR_ACTIONS.UPDATE_TRACES, + payload, + }); + }); + } + } + handleUpdate({type, payload}) { const {graphDiv} = this.props; @@ -394,6 +412,7 @@ EditorControls.propTypes = { chartHelp: PropTypes.object, optionalPanel: PropTypes.node, menuPanelOrder: PropTypes.array, + updatePayload: PropTypes.array, }; EditorControls.defaultProps = { diff --git a/src/PlotlyEditor.js b/src/PlotlyEditor.js index 99bcaf253..cef744fdf 100644 --- a/src/PlotlyEditor.js +++ b/src/PlotlyEditor.js @@ -42,6 +42,7 @@ class PlotlyEditor extends Component { chartHelp={this.props.chartHelp} optionalPanel={this.props.optionalPanel} menuPanelOrder={this.props.menuPanelOrder} + updatePayload={this.props.updatePayload} > {this.props.children} @@ -95,6 +96,7 @@ PlotlyEditor.propTypes = { chartHelp: PropTypes.object, optionalPanel: PropTypes.any, menuPanelOrder: PropTypes.array, + updatePayload: PropTypes.array, }; PlotlyEditor.defaultProps = { diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index 7a22588db..d6441fd10 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -5,7 +5,7 @@ import React, {Component, cloneElement} from 'react'; import update from 'immutability-helper'; import {bem} from 'lib'; import {EmbedIconIcon} from 'plotly-icons'; -import {PlotlyPanelContext} from '../../context'; +import {EditorControlsContext, PlotlyPanelContext} from '../../context'; class PanelErrorImpl extends Component { render() { @@ -19,9 +19,7 @@ class PanelErrorImpl extends Component { } } -PanelErrorImpl.contextTypes = { - localize: PropTypes.func, -}; +PanelErrorImpl.contextType = EditorControlsContext; const PanelError = PanelErrorImpl; diff --git a/src/lib/index.js b/src/lib/index.js index d26665ddf..ff414f6a9 100644 --- a/src/lib/index.js +++ b/src/lib/index.js @@ -30,6 +30,7 @@ import * as PlotlyIcons from 'plotly-icons'; import striptags from './striptags'; import {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase} from './strings'; import {getColorscale} from 'react-colorscales'; +import {EDITOR_ACTIONS} from './constants'; const TOO_LIGHT_FACTOR = 0.8; @@ -249,4 +250,5 @@ export { traceTypeToAxisType, transpose, getFullTrace, + EDITOR_ACTIONS, }; From c9a7cdfc7c092676e0f3a2594e15df79dd667370 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 14 Nov 2018 19:04:50 +0900 Subject: [PATCH 20/69] change handleDataSourceUpdate to handleUpdateActions --- dev/App.js | 215 +++++++++++++++++++++--------------------- src/EditorControls.js | 11 +-- 2 files changed, 112 insertions(+), 114 deletions(-) diff --git a/dev/App.js b/dev/App.js index 39e9429a7..e63ab1944 100644 --- a/dev/App.js +++ b/dev/App.js @@ -230,25 +230,26 @@ class App extends Component { , ]; - const menuPanelOrder=[ - {group: 'Dev', name: 'JSON'}, - {group: 'Dev', name: 'Inspector'}, - {group: 'Structure', name: 'Create'}, - {group: 'Structure', name: 'Subplots'}, - {group: 'Structure', name: 'Transforms'}, - {group: 'Test', name: 'Testing'}, - {group: 'Style', name: 'General'}, - {group: 'Style', name: 'Traces'}, - {group: 'Style', name: 'Axes'}, - {group: 'Style', name: 'Legend'}, - {group: 'Style', name: 'Color Bars'}, - {group: 'Style', name: 'Annotation'}, - {group: 'Style', name: 'Shapes'}, - {group: 'Style', name: 'Images'}, - {group: 'Style', name: 'Sliders'}, - {group: 'Style', name: 'Menus'}, - ] + const menuPanelOrder = [ + {group: 'Dev', name: 'JSON'}, + {group: 'Dev', name: 'Inspector'}, + {group: 'Structure', name: 'Create'}, + {group: 'Structure', name: 'Subplots'}, + {group: 'Structure', name: 'Transforms'}, + {group: 'Test', name: 'Testing'}, + {group: 'Style', name: 'General'}, + {group: 'Style', name: 'Traces'}, + {group: 'Style', name: 'Axes'}, + {group: 'Style', name: 'Legend'}, + {group: 'Style', name: 'Color Bars'}, + {group: 'Style', name: 'Annotation'}, + {group: 'Style', name: 'Shapes'}, + {group: 'Style', name: 'Images'}, + {group: 'Style', name: 'Sliders'}, + {group: 'Style', name: 'Menus'}, + ]; + console.log(this.state.data, this.state.layout, this.state.frames); return (
({type: 'scattergl', mode: 'markers'})} // fontOptions={[{label:'Arial', value: 'arial'}]} // chartHelp={chartHelp} - optionalPanel={optionalPanel} - menuPanelOrder={menuPanelOrder} - /> - {/**/} - {/**/} - {/*
*/} - {/* ({*/} - {/*label: item,*/} - {/*value: i,*/} - {/*}))}*/} - {/*searchable={true}*/} - {/*searchPromptText="Search for a mock"*/} - {/*onChange={option => this.loadMock(option.value)}*/} - {/*noResultsText={'No Results'}*/} - {/*placeholder={'Search for a mock'}*/} - {/*/>*/} - {/*
*/} - {/**/} - {/*Save*/} - {/**/} - {/* this.setState({json_string})}*/} - {/*value={this.state.json_string}*/} - {/*name="UNIQUE_ID_OF_DIV"*/} - {/*style={{height: '80vh'}}*/} - {/*setOptions={{*/} - {/*showLineNumbers: false,*/} - {/*tabSize: 2,*/} - {/*}}*/} - {/*commands={[*/} - {/*{*/} - {/*name: 'save',*/} - {/*bindKey: {win: 'Ctrl-s', mac: 'Command-s'},*/} - {/*exec: this.loadJSON,*/} - {/*},*/} - {/*]}*/} - {/*editorProps={{$blockScrolling: true}}*/} - {/*/>*/} - {/*
*/} - {/**/} - {/* {*/} - {/*const gd = document.getElementById('gd') || {};*/} - {/*this.setState({*/} - {/*full: {*/} - {/*_fullData: gd._fullData || [],*/} - {/*_fullLayout: gd._fullLayout || {},*/} - {/*},*/} - {/*});*/} - {/*}}*/} - {/*>*/} - {/*Refresh*/} - {/**/} - {/*
*/} - {/**/} - {/*
*/} - {/*
*/} - {/**/} - {/*
*/} + // optionalPanel={optionalPanel} + // menuPanelOrder={menuPanelOrder} + > + + +
+ ({ + label: item, + value: i, + }))} + searchable={true} + searchPromptText="Search for a mock" + onChange={option => this.loadMock(option.value)} + noResultsText={'No Results'} + placeholder={'Search for a mock'} + /> +
+ + this.setState({json_string})} + value={this.state.json_string} + name="UNIQUE_ID_OF_DIV" + style={{height: '80vh'}} + setOptions={{ + showLineNumbers: false, + tabSize: 2, + }} + commands={[ + { + name: 'save', + bindKey: {win: 'Ctrl-s', mac: 'Command-s'}, + exec: this.loadJSON, + }, + ]} + editorProps={{$blockScrolling: true}} + /> +
+ + +
+ +
+
+
+
); } diff --git a/src/EditorControls.js b/src/EditorControls.js index e9292a953..0b5111e81 100644 --- a/src/EditorControls.js +++ b/src/EditorControls.js @@ -35,7 +35,7 @@ class EditorControls extends Component { componentWillReceiveProps(nextProps) { const {updatePayload} = nextProps; if (updatePayload && updatePayload.length > 0) { - this.handleDataSourceChange(updatePayload); + this.handleUpdateActions(updatePayload); } } @@ -101,13 +101,10 @@ class EditorControls extends Component { }; } - handleDataSourceChange(updatePayload) { + handleUpdateActions(updatePayload) { if (updatePayload && updatePayload.length !== 0) { - updatePayload.forEach(payload => { - this.handleUpdate({ - type: EDITOR_ACTIONS.UPDATE_TRACES, - payload, - }); + updatePayload.forEach(actions => { + this.handleUpdate(actions); }); } } From f7f528aeb0ab558aff3d079d089b2c1ffdec0389 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 14 Nov 2018 19:11:46 +0900 Subject: [PATCH 22/69] remake --- lib/EditorControls.js | 13 +++++-------- lib/EditorControls.js.map | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/EditorControls.js b/lib/EditorControls.js index c5b637b9f..1a1b616f5 100644 --- a/lib/EditorControls.js +++ b/lib/EditorControls.js @@ -71,7 +71,7 @@ var EditorControls = function (_Component) { var updatePayload = nextProps.updatePayload; if (updatePayload && updatePayload.length > 0) { - this.handleDataSourceChange(updatePayload); + this.handleUpdateActions(updatePayload); } } }, { @@ -139,16 +139,13 @@ var EditorControls = function (_Component) { }; } }, { - key: 'handleDataSourceChange', - value: function handleDataSourceChange(updatePayload) { + key: 'handleUpdateActions', + value: function handleUpdateActions(updatePayload) { var _this2 = this; if (updatePayload && updatePayload.length !== 0) { - updatePayload.forEach(function (payload) { - _this2.handleUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, - payload: payload - }); + updatePayload.forEach(function (actions) { + _this2.handleUpdate(actions); }); } } diff --git a/lib/EditorControls.js.map b/lib/EditorControls.js.map index 8087e524d..0bbdce715 100644 --- a/lib/EditorControls.js.map +++ b/lib/EditorControls.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","nextProps","updatePayload","length","handleDataSourceChange","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","forEach","type","EDITOR_ACTIONS","UPDATE_TRACES","payload","beforeUpdateTraces","i","traceIndexes","attr","traceIndex","splitTraceGroup","toString","value","update","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","optionalPanel","menuPanelOrder","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAUA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;;;;;;;;;IAEMA,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAG1B,UAAKC,QAAL,GAAgB;AAAA,aAAO,yBAAe,MAAKF,KAAL,CAAWG,YAAX,IAA2B,EAA1C,EAA8C,MAAKH,KAAL,CAAWI,MAAzD,EAAiEC,G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,CAA9B;;AAWA/H,eAAegI,iBAAf,GAAmC;AACjC/G,6BAA2B8F,oBAAUC,IADJ;AAEjC9F,UAAQ6F,oBAAUU,MAFe;AAGjCrG,iBAAe2F,oBAAUK,KAAV,CAAgB;AAC7BC,WAAON,oBAAUE,IAAV,CAAeK,UADO;AAE7BC,aAASR,oBAAUE,IAAV,CAAeK;AAFK,GAAhB,CAHkB;AAOjCjG,QAAM0F,oBAAUS,KAPiB;AAQjC/F,4BAA0BsF,oBAAUE,IARH;AASjC1F,qBAAmBwF,oBAAUS,KATI;AAUjClG,eAAayF,oBAAUU,MAVU;AAWjCjG,2BAAyBuF,oBAAUE,IAXF;AAYjC7G,gBAAc2G,oBAAUU,MAZS;AAajC/F,UAAQqF,oBAAUS,KAbe;AAcjC3F,YAAUkF,oBAAUS,KAda;AAejCzF,cAAYgF,oBAAUU,MAfW;AAgBjCzG,YAAU+F,oBAAUkB,GAhBa;AAiBjChG,UAAQ8E,oBAAUU,MAjBe;AAkBjCpH,UAAQ0G,oBAAUI,MAlBe;AAmBjChH,YAAU4G,oBAAUE,IAnBa;AAoBjC/E,YAAU6E,oBAAUE,IApBa;AAqBjC1G,UAAQwG,oBAAUU,MArBe;AAsBjCjH,cAAYuG,oBAAUU,MAtBW;AAuBjCpF,oBAAkB0E,oBAAUU,MAvBK;AAwBjCnF,qBAAmByE,oBAAUC,IAxBI;AAyBjCzE,eAAawE,oBAAUC,IAzBU;AA0BjCxE,gBAAcuE,oBAAUC,IA1BS;AA2BjCvE,eAAasE,oBAAUS,KA3BU;AA4BjC9E,aAAWqE,oBAAUU;AA5BY,CAAnC;;kBA+BezH,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n componentWillReceiveProps(nextProps) {\n const {updatePayload} = nextProps;\n if (updatePayload && updatePayload.length > 0) {\n this.handleDataSourceChange(updatePayload);\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleDataSourceChange(updatePayload) {\n if (updatePayload && updatePayload.length !== 0) {\n updatePayload.forEach(payload => {\n this.handleUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload,\n });\n });\n }\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? (\n this.props.children\n ) : this.props.optionalPanel ? (\n \n {this.props.optionalPanel}\n \n ) : (\n \n ))}\n \n \n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n updatePayload: PropTypes.array,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","nextProps","updatePayload","length","handleUpdateActions","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","forEach","actions","type","payload","EDITOR_ACTIONS","UPDATE_TRACES","beforeUpdateTraces","i","traceIndexes","attr","traceIndex","splitTraceGroup","toString","value","update","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","optionalPanel","menuPanelOrder","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAUA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;;;;;;;;;IAEMA,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAG1B,UAAKC,QAAL,GAAgB;AAAA,aAAO,yBAAe,MAAKF,KAAL,CAAWG,YAAX,IAA2B,EAA1C,EAA8C,MAAKH,KAAL,CAAWI,MAAz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Af,GAAmC;AACjChH,6BAA2B+F,oBAAUC,IADJ;AAEjC/F,UAAQ8F,oBAAUU,MAFe;AAGjCtG,iBAAe4F,oBAAUK,KAAV,CAAgB;AAC7BC,WAAON,oBAAUE,IAAV,CAAeK,UADO;AAE7BC,aAASR,oBAAUE,IAAV,CAAeK;AAFK,GAAhB,CAHkB;AAOjClG,QAAM2F,oBAAUS,KAPiB;AAQjChG,4BAA0BuF,oBAAUE,IARH;AASjC3F,qBAAmByF,oBAAUS,KATI;AAUjCnG,eAAa0F,oBAAUU,MAVU;AAWjClG,2BAAyBwF,oBAAUE,IAXF;AAYjC9G,gBAAc4G,oBAAUU,MAZS;AAajChG,UAAQsF,oBAAUS,KAbe;AAcjC5F,YAAUmF,oBAAUS,KAda;AAejC1F,cAAYiF,oBAAUU,MAfW;AAgBjC1G,YAAUgG,oBAAUkB,GAhBa;AAiBjCjG,UAAQ+E,oBAAUU,MAjBe;AAkBjCrH,UAAQ2G,oBAAUI,MAlBe;AAmBjCjH,YAAU6G,oBAAUE,IAnBa;AAoBjChF,YAAU8E,oBAAUE,IApBa;AAqBjC3G,UAAQyG,oBAAUU,MArBe;AAsBjClH,cAAYwG,oBAAUU,MAtBW;AAuBjCrF,oBAAkB2E,oBAAUU,MAvBK;AAwBjCpF,qBAAmB0E,oBAAUC,IAxBI;AAyBjC1E,eAAayE,oBAAUC,IAzBU;AA0BjCzE,gBAAcwE,oBAAUC,IA1BS;AA2BjCxE,eAAauE,oBAAUS,KA3BU;AA4BjC/E,aAAWsE,oBAAUU;AA5BY,CAAnC;;kBA+Be1H,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n componentWillReceiveProps(nextProps) {\n const {updatePayload} = nextProps;\n if (updatePayload && updatePayload.length > 0) {\n this.handleUpdateActions(updatePayload);\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleUpdateActions(updatePayload) {\n if (updatePayload && updatePayload.length !== 0) {\n updatePayload.forEach(actions => {\n this.handleUpdate(actions);\n });\n }\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? (\n this.props.children\n ) : this.props.optionalPanel ? (\n \n {this.props.optionalPanel}\n \n ) : (\n \n ))}\n \n \n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n updatePayload: PropTypes.array,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file From 00985817d8c51eb72ac4e70324820905d2312d47 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 15 Nov 2018 16:58:43 +0900 Subject: [PATCH 23/69] remove lib --- lib/DefaultEditor.js | 148 - lib/DefaultEditor.js.map | 1 - lib/EditorControls.js | 462 --- lib/EditorControls.js.map | 1 - lib/PlotlyEditor.js | 151 - lib/PlotlyEditor.js.map | 1 - lib/__percy__/panels.percy.js | 82 - lib/__percy__/panels.percy.js.map | 1 - lib/components/PanelMenuWrapper.js | 175 -- lib/components/PanelMenuWrapper.js.map | 1 - .../containers/AnnotationAccordion.js | 124 - .../containers/AnnotationAccordion.js.map | 1 - lib/components/containers/AxesFold.js | 71 - lib/components/containers/AxesFold.js.map | 1 - lib/components/containers/FoldEmpty.js | 79 - lib/components/containers/FoldEmpty.js.map | 1 - lib/components/containers/ImageAccordion.js | 129 - .../containers/ImageAccordion.js.map | 1 - lib/components/containers/MenuPanel.js | 137 - lib/components/containers/MenuPanel.js.map | 1 - lib/components/containers/Modal.js | 147 - lib/components/containers/Modal.js.map | 1 - lib/components/containers/ModalBox.js | 76 - lib/components/containers/ModalBox.js.map | 1 - lib/components/containers/ModalProvider.js | 180 -- .../containers/ModalProvider.js.map | 1 - lib/components/containers/PanelEmpty.js | 113 - lib/components/containers/PanelEmpty.js.map | 1 - lib/components/containers/PanelHeader.js | 158 - lib/components/containers/PanelHeader.js.map | 1 - lib/components/containers/PlotlyFold.js | 259 -- lib/components/containers/PlotlyFold.js.map | 1 - lib/components/containers/PlotlyPanel.js | 259 -- lib/components/containers/PlotlyPanel.js.map | 1 - lib/components/containers/PlotlySection.js | 132 - .../containers/PlotlySection.js.map | 1 - .../containers/RangeSelectorAccordion.js | 110 - .../containers/RangeSelectorAccordion.js.map | 1 - lib/components/containers/ShapeAccordion.js | 130 - .../containers/ShapeAccordion.js.map | 1 - .../containers/SingleSidebarItem.js | 56 - .../containers/SingleSidebarItem.js.map | 1 - lib/components/containers/SliderAccordion.js | 84 - .../containers/SliderAccordion.js.map | 1 - lib/components/containers/SubplotAccordion.js | 202 -- .../containers/SubplotAccordion.js.map | 1 - lib/components/containers/TraceAccordion.js | 312 -- .../containers/TraceAccordion.js.map | 1 - .../containers/TraceMarkerSection.js | 84 - .../containers/TraceMarkerSection.js.map | 1 - .../containers/TraceRequiredPanel.js | 110 - .../containers/TraceRequiredPanel.js.map | 1 - .../containers/TransformAccordion.js | 223 -- .../containers/TransformAccordion.js.map | 1 - .../containers/UpdateMenuAccordion.js | 94 - .../containers/UpdateMenuAccordion.js.map | 1 - lib/components/containers/derived.js | 67 - lib/components/containers/derived.js.map | 1 - lib/components/containers/index.js | 119 - lib/components/containers/index.js.map | 1 - lib/components/fields/ArrowSelector.js | 63 - lib/components/fields/ArrowSelector.js.map | 1 - lib/components/fields/AxesCreator.js | 256 -- lib/components/fields/AxesCreator.js.map | 1 - lib/components/fields/AxesSelector.js | 122 - lib/components/fields/AxesSelector.js.map | 1 - lib/components/fields/AxisRangeValue.js | 71 - lib/components/fields/AxisRangeValue.js.map | 1 - lib/components/fields/ColorPicker.js | 103 - lib/components/fields/ColorPicker.js.map | 1 - lib/components/fields/ColorscalePicker.js | 99 - lib/components/fields/ColorscalePicker.js.map | 1 - lib/components/fields/ColorwayPicker.js | 70 - lib/components/fields/ColorwayPicker.js.map | 1 - lib/components/fields/DataSelector.js | 182 -- lib/components/fields/DataSelector.js.map | 1 - lib/components/fields/Dropdown.js | 88 - lib/components/fields/Dropdown.js.map | 1 - lib/components/fields/DropdownCustom.js | 150 - lib/components/fields/DropdownCustom.js.map | 1 - lib/components/fields/Dropzone.js | 71 - lib/components/fields/Dropzone.js.map | 1 - lib/components/fields/DualNumeric.js | 149 - lib/components/fields/DualNumeric.js.map | 1 - lib/components/fields/ErrorBars.js | 207 -- lib/components/fields/ErrorBars.js.map | 1 - lib/components/fields/Field.js | 199 -- lib/components/fields/Field.js.map | 1 - lib/components/fields/FilterOperation.js | 273 -- lib/components/fields/FilterOperation.js.map | 1 - lib/components/fields/Flaglist.js | 72 - lib/components/fields/Flaglist.js.map | 1 - lib/components/fields/FontSelector.js | 54 - lib/components/fields/FontSelector.js.map | 1 - lib/components/fields/GroupCreator.js | 154 - lib/components/fields/GroupCreator.js.map | 1 - lib/components/fields/Info.js | 62 - lib/components/fields/Info.js.map | 1 - lib/components/fields/LineSelectors.js | 154 - lib/components/fields/LineSelectors.js.map | 1 - lib/components/fields/LocationSelector.js | 186 -- lib/components/fields/LocationSelector.js.map | 1 - lib/components/fields/MarkerColor.js | 265 -- lib/components/fields/MarkerColor.js.map | 1 - lib/components/fields/MarkerSize.js | 141 - lib/components/fields/MarkerSize.js.map | 1 - lib/components/fields/MultiColorPicker.js | 223 -- lib/components/fields/MultiColorPicker.js.map | 1 - lib/components/fields/Numeric.js | 94 - lib/components/fields/Numeric.js.map | 1 - lib/components/fields/PieColorscalePicker.js | 105 - .../fields/PieColorscalePicker.js.map | 1 - lib/components/fields/Radio.js | 79 - lib/components/fields/Radio.js.map | 1 - lib/components/fields/RectanglePositioner.js | 245 -- .../fields/RectanglePositioner.js.map | 1 - lib/components/fields/SubplotCreator.js | 240 -- lib/components/fields/SubplotCreator.js.map | 1 - lib/components/fields/SymbolSelector.js | 367 --- lib/components/fields/SymbolSelector.js.map | 1 - lib/components/fields/Text.js | 83 - lib/components/fields/Text.js.map | 1 - lib/components/fields/TextEditor.js | 128 - lib/components/fields/TextEditor.js.map | 1 - lib/components/fields/TraceSelector.js | 220 -- lib/components/fields/TraceSelector.js.map | 1 - lib/components/fields/UpdateMenuButtons.js | 93 - .../fields/UpdateMenuButtons.js.map | 1 - lib/components/fields/VisibilitySelect.js | 130 - lib/components/fields/VisibilitySelect.js.map | 1 - lib/components/fields/derived.js | 617 ---- lib/components/fields/derived.js.map | 1 - lib/components/fields/index.js | 203 -- lib/components/fields/index.js.map | 1 - lib/components/index.js | 104 - lib/components/index.js.map | 1 - lib/components/sidebar/SidebarGroup.js | 123 - lib/components/sidebar/SidebarGroup.js.map | 1 - lib/components/sidebar/SidebarItem.js | 71 - lib/components/sidebar/SidebarItem.js.map | 1 - lib/components/widgets/Button.js | 98 - lib/components/widgets/Button.js.map | 1 - lib/components/widgets/CheckboxGroup.js | 134 - lib/components/widgets/CheckboxGroup.js.map | 1 - lib/components/widgets/ColorPicker.js | 190 -- lib/components/widgets/ColorPicker.js.map | 1 - lib/components/widgets/ColorscalePicker.js | 141 - .../widgets/ColorscalePicker.js.map | 1 - lib/components/widgets/Dropdown.js | 164 - lib/components/widgets/Dropdown.js.map | 1 - lib/components/widgets/Dropzone.js | 222 -- lib/components/widgets/Dropzone.js.map | 1 - lib/components/widgets/EditableText.js | 162 - lib/components/widgets/EditableText.js.map | 1 - .../widgets/FlaglistCheckboxGroup.js | 162 - .../widgets/FlaglistCheckboxGroup.js.map | 1 - lib/components/widgets/Logo.js | 52 - lib/components/widgets/Logo.js.map | 1 - lib/components/widgets/NumericInput.js | 255 -- lib/components/widgets/NumericInput.js.map | 1 - lib/components/widgets/RadioBlocks.js | 128 - lib/components/widgets/RadioBlocks.js.map | 1 - lib/components/widgets/SymbolSelector.js | 197 -- lib/components/widgets/SymbolSelector.js.map | 1 - lib/components/widgets/TextArea.js | 95 - lib/components/widgets/TextArea.js.map | 1 - lib/components/widgets/TextInput.js | 83 - lib/components/widgets/TextInput.js.map | 1 - lib/components/widgets/TraceTypeSelector.js | 370 --- .../widgets/TraceTypeSelector.js.map | 1 - lib/components/widgets/index.js | 26 - lib/components/widgets/index.js.map | 1 - lib/components/widgets/text_editors/HTML.js | 65 - .../widgets/text_editors/HTML.js.map | 1 - lib/components/widgets/text_editors/LaTeX.js | 132 - .../widgets/text_editors/LaTeX.js.map | 1 - .../widgets/text_editors/MultiFormat.js | 379 --- .../widgets/text_editors/MultiFormat.js.map | 1 - .../text_editors/RichText/DraftCommands.js | 210 -- .../RichText/DraftCommands.js.map | 1 - .../text_editors/RichText/LinkDecorator.js | 39 - .../RichText/LinkDecorator.js.map | 1 - .../text_editors/RichText/LinkEditor.js | 197 -- .../text_editors/RichText/LinkEditor.js.map | 1 - .../text_editors/RichText/StyleButton.js | 95 - .../text_editors/RichText/StyleButton.js.map | 1 - .../text_editors/RichText/StyleButtonGroup.js | 97 - .../RichText/StyleButtonGroup.js.map | 1 - .../text_editors/RichText/configuration.js | 110 - .../RichText/configuration.js.map | 1 - .../widgets/text_editors/RichText/debounce.js | 25 - .../text_editors/RichText/debounce.js.map | 1 - .../RichText/decoratorStrategies.js | 31 - .../RichText/decoratorStrategies.js.map | 1 - .../RichText/getSelectionCoordinates.js | 23 - .../RichText/getSelectionCoordinates.js.map | 1 - .../widgets/text_editors/RichText/index.js | 431 --- .../text_editors/RichText/index.js.map | 1 - .../widgets/text_editors/convertFormats.js | 97 - .../text_editors/convertFormats.js.map | 1 - lib/context/index.js | 36 - lib/context/index.js.map | 1 - lib/default_panels/GraphCreatePanel.js | 191 -- lib/default_panels/GraphCreatePanel.js.map | 1 - lib/default_panels/GraphSubplotsPanel.js | 232 -- lib/default_panels/GraphSubplotsPanel.js.map | 1 - lib/default_panels/GraphTransformsPanel.js | 125 - .../GraphTransformsPanel.js.map | 1 - lib/default_panels/StyleAxesPanel.js | 397 --- lib/default_panels/StyleAxesPanel.js.map | 1 - lib/default_panels/StyleColorbarsPanel.js | 267 -- lib/default_panels/StyleColorbarsPanel.js.map | 1 - lib/default_panels/StyleImagesPanel.js | 79 - lib/default_panels/StyleImagesPanel.js.map | 1 - lib/default_panels/StyleLayoutPanel.js | 157 - lib/default_panels/StyleLayoutPanel.js.map | 1 - lib/default_panels/StyleLegendPanel.js | 98 - lib/default_panels/StyleLegendPanel.js.map | 1 - lib/default_panels/StyleNotesPanel.js | 86 - lib/default_panels/StyleNotesPanel.js.map | 1 - lib/default_panels/StyleShapesPanel.js | 72 - lib/default_panels/StyleShapesPanel.js.map | 1 - lib/default_panels/StyleSlidersPanel.js | 105 - lib/default_panels/StyleSlidersPanel.js.map | 1 - lib/default_panels/StyleTracesPanel.js | 621 ---- lib/default_panels/StyleTracesPanel.js.map | 1 - lib/default_panels/StyleUpdateMenusPanel.js | 96 - .../StyleUpdateMenusPanel.js.map | 1 - lib/default_panels/index.js | 75 - lib/default_panels/index.js.map | 1 - lib/index.js | 127 - lib/index.js.map | 1 - lib/lib/bem.js | 53 - lib/lib/bem.js.map | 1 - lib/lib/computeTraceOptionsFromSchema.js | 137 - lib/lib/computeTraceOptionsFromSchema.js.map | 1 - lib/lib/connectAggregationToTransform.js | 140 - lib/lib/connectAggregationToTransform.js.map | 1 - lib/lib/connectAnnotationToLayout.js | 155 - lib/lib/connectAnnotationToLayout.js.map | 1 - lib/lib/connectAxesToLayout.js | 235 -- lib/lib/connectAxesToLayout.js.map | 1 - lib/lib/connectCartesianSubplotToLayout.js | 159 - .../connectCartesianSubplotToLayout.js.map | 1 - lib/lib/connectImageToLayout.js | 155 - lib/lib/connectImageToLayout.js.map | 1 - lib/lib/connectLayoutToPlot.js | 139 - lib/lib/connectLayoutToPlot.js.map | 1 - lib/lib/connectNonCartesianSubplotToLayout.js | 148 - .../connectNonCartesianSubplotToLayout.js.map | 1 - lib/lib/connectRangeSelectorToAxis.js | 158 - lib/lib/connectRangeSelectorToAxis.js.map | 1 - lib/lib/connectShapeToLayout.js | 155 - lib/lib/connectShapeToLayout.js.map | 1 - lib/lib/connectSliderToLayout.js | 138 - lib/lib/connectSliderToLayout.js.map | 1 - lib/lib/connectToContainer.js | 150 - lib/lib/connectToContainer.js.map | 1 - lib/lib/connectTraceToPlot.js | 260 -- lib/lib/connectTraceToPlot.js.map | 1 - lib/lib/connectTransformToTrace.js | 158 - lib/lib/connectTransformToTrace.js.map | 1 - lib/lib/connectUpdateMenuToLayout.js | 138 - lib/lib/connectUpdateMenuToLayout.js.map | 1 - lib/lib/constants.js | 112 - lib/lib/constants.js.map | 1 - lib/lib/customTraceType.js | 109 - lib/lib/customTraceType.js.map | 1 - lib/lib/dereference.js | 60 - lib/lib/dereference.js.map | 1 - lib/lib/getAllAxes.js | 114 - lib/lib/getAllAxes.js.map | 1 - lib/lib/index.js | 316 -- lib/lib/index.js.map | 1 - lib/lib/localize.js | 77 - lib/lib/localize.js.map | 1 - lib/lib/multiValues.js | 95 - lib/lib/multiValues.js.map | 1 - lib/lib/sortMenu.js | 91 - lib/lib/sortMenu.js.map | 1 - lib/lib/strings.js | 55 - lib/lib/strings.js.map | 1 - lib/lib/striptags.js | 249 -- lib/lib/striptags.js.map | 1 - lib/lib/test-utils.js | 170 - lib/lib/test-utils.js.map | 1 - lib/lib/traceTypes.js | 192 -- lib/lib/traceTypes.js.map | 1 - lib/lib/unpackPlotProps.js | 98 - lib/lib/unpackPlotProps.js.map | 1 - lib/lib/walkObject.js | 186 -- lib/lib/walkObject.js.map | 1 - lib/locales/en.js | 9 - lib/locales/en.js.map | 1 - lib/locales/index.js | 21 - lib/locales/index.js.map | 1 - lib/locales/xx.js | 214 -- lib/locales/xx.js.map | 1 - lib/react-chart-editor.css | 2747 ----------------- lib/react-chart-editor.ie.css | 2747 ----------------- lib/react-chart-editor.ie.min.css | 1 - lib/react-chart-editor.min.css | 1 - lib/shame.js | 238 -- lib/shame.js.map | 1 - 304 files changed, 28493 deletions(-) delete mode 100644 lib/DefaultEditor.js delete mode 100644 lib/DefaultEditor.js.map delete mode 100644 lib/EditorControls.js delete mode 100644 lib/EditorControls.js.map delete mode 100644 lib/PlotlyEditor.js delete mode 100644 lib/PlotlyEditor.js.map delete mode 100644 lib/__percy__/panels.percy.js delete mode 100644 lib/__percy__/panels.percy.js.map delete mode 100644 lib/components/PanelMenuWrapper.js delete mode 100644 lib/components/PanelMenuWrapper.js.map delete mode 100644 lib/components/containers/AnnotationAccordion.js delete mode 100644 lib/components/containers/AnnotationAccordion.js.map delete mode 100644 lib/components/containers/AxesFold.js delete mode 100644 lib/components/containers/AxesFold.js.map delete mode 100644 lib/components/containers/FoldEmpty.js delete mode 100644 lib/components/containers/FoldEmpty.js.map delete mode 100644 lib/components/containers/ImageAccordion.js delete mode 100644 lib/components/containers/ImageAccordion.js.map delete mode 100644 lib/components/containers/MenuPanel.js delete mode 100644 lib/components/containers/MenuPanel.js.map delete mode 100644 lib/components/containers/Modal.js delete mode 100644 lib/components/containers/Modal.js.map delete mode 100644 lib/components/containers/ModalBox.js delete mode 100644 lib/components/containers/ModalBox.js.map delete mode 100644 lib/components/containers/ModalProvider.js delete mode 100644 lib/components/containers/ModalProvider.js.map delete mode 100644 lib/components/containers/PanelEmpty.js delete mode 100644 lib/components/containers/PanelEmpty.js.map delete mode 100644 lib/components/containers/PanelHeader.js delete mode 100644 lib/components/containers/PanelHeader.js.map delete mode 100644 lib/components/containers/PlotlyFold.js delete mode 100644 lib/components/containers/PlotlyFold.js.map delete mode 100644 lib/components/containers/PlotlyPanel.js delete mode 100644 lib/components/containers/PlotlyPanel.js.map delete mode 100644 lib/components/containers/PlotlySection.js delete mode 100644 lib/components/containers/PlotlySection.js.map delete mode 100644 lib/components/containers/RangeSelectorAccordion.js delete mode 100644 lib/components/containers/RangeSelectorAccordion.js.map delete mode 100644 lib/components/containers/ShapeAccordion.js delete mode 100644 lib/components/containers/ShapeAccordion.js.map delete mode 100644 lib/components/containers/SingleSidebarItem.js delete mode 100644 lib/components/containers/SingleSidebarItem.js.map delete mode 100644 lib/components/containers/SliderAccordion.js delete mode 100644 lib/components/containers/SliderAccordion.js.map delete mode 100644 lib/components/containers/SubplotAccordion.js delete mode 100644 lib/components/containers/SubplotAccordion.js.map delete mode 100644 lib/components/containers/TraceAccordion.js delete mode 100644 lib/components/containers/TraceAccordion.js.map delete mode 100644 lib/components/containers/TraceMarkerSection.js delete mode 100644 lib/components/containers/TraceMarkerSection.js.map delete mode 100644 lib/components/containers/TraceRequiredPanel.js delete mode 100644 lib/components/containers/TraceRequiredPanel.js.map delete mode 100644 lib/components/containers/TransformAccordion.js delete mode 100644 lib/components/containers/TransformAccordion.js.map delete mode 100644 lib/components/containers/UpdateMenuAccordion.js delete mode 100644 lib/components/containers/UpdateMenuAccordion.js.map delete mode 100644 lib/components/containers/derived.js delete mode 100644 lib/components/containers/derived.js.map delete mode 100644 lib/components/containers/index.js delete mode 100644 lib/components/containers/index.js.map delete mode 100644 lib/components/fields/ArrowSelector.js delete mode 100644 lib/components/fields/ArrowSelector.js.map delete mode 100644 lib/components/fields/AxesCreator.js delete mode 100644 lib/components/fields/AxesCreator.js.map delete mode 100644 lib/components/fields/AxesSelector.js delete mode 100644 lib/components/fields/AxesSelector.js.map delete mode 100644 lib/components/fields/AxisRangeValue.js delete mode 100644 lib/components/fields/AxisRangeValue.js.map delete mode 100644 lib/components/fields/ColorPicker.js delete mode 100644 lib/components/fields/ColorPicker.js.map delete mode 100644 lib/components/fields/ColorscalePicker.js delete mode 100644 lib/components/fields/ColorscalePicker.js.map delete mode 100644 lib/components/fields/ColorwayPicker.js delete mode 100644 lib/components/fields/ColorwayPicker.js.map delete mode 100644 lib/components/fields/DataSelector.js delete mode 100644 lib/components/fields/DataSelector.js.map delete mode 100644 lib/components/fields/Dropdown.js delete mode 100644 lib/components/fields/Dropdown.js.map delete mode 100644 lib/components/fields/DropdownCustom.js delete mode 100644 lib/components/fields/DropdownCustom.js.map delete mode 100644 lib/components/fields/Dropzone.js delete mode 100644 lib/components/fields/Dropzone.js.map delete mode 100644 lib/components/fields/DualNumeric.js delete mode 100644 lib/components/fields/DualNumeric.js.map delete mode 100644 lib/components/fields/ErrorBars.js delete mode 100644 lib/components/fields/ErrorBars.js.map delete mode 100644 lib/components/fields/Field.js delete mode 100644 lib/components/fields/Field.js.map delete mode 100644 lib/components/fields/FilterOperation.js delete mode 100644 lib/components/fields/FilterOperation.js.map delete mode 100644 lib/components/fields/Flaglist.js delete mode 100644 lib/components/fields/Flaglist.js.map delete mode 100644 lib/components/fields/FontSelector.js delete mode 100644 lib/components/fields/FontSelector.js.map delete mode 100644 lib/components/fields/GroupCreator.js delete mode 100644 lib/components/fields/GroupCreator.js.map delete mode 100644 lib/components/fields/Info.js delete mode 100644 lib/components/fields/Info.js.map delete mode 100644 lib/components/fields/LineSelectors.js delete mode 100644 lib/components/fields/LineSelectors.js.map delete mode 100644 lib/components/fields/LocationSelector.js delete mode 100644 lib/components/fields/LocationSelector.js.map delete mode 100644 lib/components/fields/MarkerColor.js delete mode 100644 lib/components/fields/MarkerColor.js.map delete mode 100644 lib/components/fields/MarkerSize.js delete mode 100644 lib/components/fields/MarkerSize.js.map delete mode 100644 lib/components/fields/MultiColorPicker.js delete mode 100644 lib/components/fields/MultiColorPicker.js.map delete mode 100644 lib/components/fields/Numeric.js delete mode 100644 lib/components/fields/Numeric.js.map delete mode 100644 lib/components/fields/PieColorscalePicker.js delete mode 100644 lib/components/fields/PieColorscalePicker.js.map delete mode 100644 lib/components/fields/Radio.js delete mode 100644 lib/components/fields/Radio.js.map delete mode 100644 lib/components/fields/RectanglePositioner.js delete mode 100644 lib/components/fields/RectanglePositioner.js.map delete mode 100644 lib/components/fields/SubplotCreator.js delete mode 100644 lib/components/fields/SubplotCreator.js.map delete mode 100644 lib/components/fields/SymbolSelector.js delete mode 100644 lib/components/fields/SymbolSelector.js.map delete mode 100644 lib/components/fields/Text.js delete mode 100644 lib/components/fields/Text.js.map delete mode 100644 lib/components/fields/TextEditor.js delete mode 100644 lib/components/fields/TextEditor.js.map delete mode 100644 lib/components/fields/TraceSelector.js delete mode 100644 lib/components/fields/TraceSelector.js.map delete mode 100644 lib/components/fields/UpdateMenuButtons.js delete mode 100644 lib/components/fields/UpdateMenuButtons.js.map delete mode 100644 lib/components/fields/VisibilitySelect.js delete mode 100644 lib/components/fields/VisibilitySelect.js.map delete mode 100644 lib/components/fields/derived.js delete mode 100644 lib/components/fields/derived.js.map delete mode 100644 lib/components/fields/index.js delete mode 100644 lib/components/fields/index.js.map delete mode 100644 lib/components/index.js delete mode 100644 lib/components/index.js.map delete mode 100644 lib/components/sidebar/SidebarGroup.js delete mode 100644 lib/components/sidebar/SidebarGroup.js.map delete mode 100644 lib/components/sidebar/SidebarItem.js delete mode 100644 lib/components/sidebar/SidebarItem.js.map delete mode 100644 lib/components/widgets/Button.js delete mode 100644 lib/components/widgets/Button.js.map delete mode 100644 lib/components/widgets/CheckboxGroup.js delete mode 100644 lib/components/widgets/CheckboxGroup.js.map delete mode 100644 lib/components/widgets/ColorPicker.js delete mode 100644 lib/components/widgets/ColorPicker.js.map delete mode 100644 lib/components/widgets/ColorscalePicker.js delete mode 100644 lib/components/widgets/ColorscalePicker.js.map delete mode 100644 lib/components/widgets/Dropdown.js delete mode 100644 lib/components/widgets/Dropdown.js.map delete mode 100644 lib/components/widgets/Dropzone.js delete mode 100644 lib/components/widgets/Dropzone.js.map delete mode 100644 lib/components/widgets/EditableText.js delete mode 100644 lib/components/widgets/EditableText.js.map delete mode 100644 lib/components/widgets/FlaglistCheckboxGroup.js delete mode 100644 lib/components/widgets/FlaglistCheckboxGroup.js.map delete mode 100644 lib/components/widgets/Logo.js delete mode 100644 lib/components/widgets/Logo.js.map delete mode 100644 lib/components/widgets/NumericInput.js delete mode 100644 lib/components/widgets/NumericInput.js.map delete mode 100644 lib/components/widgets/RadioBlocks.js delete mode 100644 lib/components/widgets/RadioBlocks.js.map delete mode 100644 lib/components/widgets/SymbolSelector.js delete mode 100644 lib/components/widgets/SymbolSelector.js.map delete mode 100644 lib/components/widgets/TextArea.js delete mode 100644 lib/components/widgets/TextArea.js.map delete mode 100644 lib/components/widgets/TextInput.js delete mode 100644 lib/components/widgets/TextInput.js.map delete mode 100644 lib/components/widgets/TraceTypeSelector.js delete mode 100644 lib/components/widgets/TraceTypeSelector.js.map delete mode 100644 lib/components/widgets/index.js delete mode 100644 lib/components/widgets/index.js.map delete mode 100644 lib/components/widgets/text_editors/HTML.js delete mode 100644 lib/components/widgets/text_editors/HTML.js.map delete mode 100644 lib/components/widgets/text_editors/LaTeX.js delete mode 100644 lib/components/widgets/text_editors/LaTeX.js.map delete mode 100644 lib/components/widgets/text_editors/MultiFormat.js delete mode 100644 lib/components/widgets/text_editors/MultiFormat.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/DraftCommands.js delete mode 100644 lib/components/widgets/text_editors/RichText/DraftCommands.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/LinkDecorator.js delete mode 100644 lib/components/widgets/text_editors/RichText/LinkDecorator.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/LinkEditor.js delete mode 100644 lib/components/widgets/text_editors/RichText/LinkEditor.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/StyleButton.js delete mode 100644 lib/components/widgets/text_editors/RichText/StyleButton.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/StyleButtonGroup.js delete mode 100644 lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/configuration.js delete mode 100644 lib/components/widgets/text_editors/RichText/configuration.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/debounce.js delete mode 100644 lib/components/widgets/text_editors/RichText/debounce.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/decoratorStrategies.js delete mode 100644 lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js delete mode 100644 lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map delete mode 100644 lib/components/widgets/text_editors/RichText/index.js delete mode 100644 lib/components/widgets/text_editors/RichText/index.js.map delete mode 100644 lib/components/widgets/text_editors/convertFormats.js delete mode 100644 lib/components/widgets/text_editors/convertFormats.js.map delete mode 100644 lib/context/index.js delete mode 100644 lib/context/index.js.map delete mode 100644 lib/default_panels/GraphCreatePanel.js delete mode 100644 lib/default_panels/GraphCreatePanel.js.map delete mode 100644 lib/default_panels/GraphSubplotsPanel.js delete mode 100644 lib/default_panels/GraphSubplotsPanel.js.map delete mode 100644 lib/default_panels/GraphTransformsPanel.js delete mode 100644 lib/default_panels/GraphTransformsPanel.js.map delete mode 100644 lib/default_panels/StyleAxesPanel.js delete mode 100644 lib/default_panels/StyleAxesPanel.js.map delete mode 100644 lib/default_panels/StyleColorbarsPanel.js delete mode 100644 lib/default_panels/StyleColorbarsPanel.js.map delete mode 100644 lib/default_panels/StyleImagesPanel.js delete mode 100644 lib/default_panels/StyleImagesPanel.js.map delete mode 100644 lib/default_panels/StyleLayoutPanel.js delete mode 100644 lib/default_panels/StyleLayoutPanel.js.map delete mode 100644 lib/default_panels/StyleLegendPanel.js delete mode 100644 lib/default_panels/StyleLegendPanel.js.map delete mode 100644 lib/default_panels/StyleNotesPanel.js delete mode 100644 lib/default_panels/StyleNotesPanel.js.map delete mode 100644 lib/default_panels/StyleShapesPanel.js delete mode 100644 lib/default_panels/StyleShapesPanel.js.map delete mode 100644 lib/default_panels/StyleSlidersPanel.js delete mode 100644 lib/default_panels/StyleSlidersPanel.js.map delete mode 100644 lib/default_panels/StyleTracesPanel.js delete mode 100644 lib/default_panels/StyleTracesPanel.js.map delete mode 100644 lib/default_panels/StyleUpdateMenusPanel.js delete mode 100644 lib/default_panels/StyleUpdateMenusPanel.js.map delete mode 100644 lib/default_panels/index.js delete mode 100644 lib/default_panels/index.js.map delete mode 100644 lib/index.js delete mode 100644 lib/index.js.map delete mode 100644 lib/lib/bem.js delete mode 100644 lib/lib/bem.js.map delete mode 100644 lib/lib/computeTraceOptionsFromSchema.js delete mode 100644 lib/lib/computeTraceOptionsFromSchema.js.map delete mode 100644 lib/lib/connectAggregationToTransform.js delete mode 100644 lib/lib/connectAggregationToTransform.js.map delete mode 100644 lib/lib/connectAnnotationToLayout.js delete mode 100644 lib/lib/connectAnnotationToLayout.js.map delete mode 100644 lib/lib/connectAxesToLayout.js delete mode 100644 lib/lib/connectAxesToLayout.js.map delete mode 100644 lib/lib/connectCartesianSubplotToLayout.js delete mode 100644 lib/lib/connectCartesianSubplotToLayout.js.map delete mode 100644 lib/lib/connectImageToLayout.js delete mode 100644 lib/lib/connectImageToLayout.js.map delete mode 100644 lib/lib/connectLayoutToPlot.js delete mode 100644 lib/lib/connectLayoutToPlot.js.map delete mode 100644 lib/lib/connectNonCartesianSubplotToLayout.js delete mode 100644 lib/lib/connectNonCartesianSubplotToLayout.js.map delete mode 100644 lib/lib/connectRangeSelectorToAxis.js delete mode 100644 lib/lib/connectRangeSelectorToAxis.js.map delete mode 100644 lib/lib/connectShapeToLayout.js delete mode 100644 lib/lib/connectShapeToLayout.js.map delete mode 100644 lib/lib/connectSliderToLayout.js delete mode 100644 lib/lib/connectSliderToLayout.js.map delete mode 100644 lib/lib/connectToContainer.js delete mode 100644 lib/lib/connectToContainer.js.map delete mode 100644 lib/lib/connectTraceToPlot.js delete mode 100644 lib/lib/connectTraceToPlot.js.map delete mode 100644 lib/lib/connectTransformToTrace.js delete mode 100644 lib/lib/connectTransformToTrace.js.map delete mode 100644 lib/lib/connectUpdateMenuToLayout.js delete mode 100644 lib/lib/connectUpdateMenuToLayout.js.map delete mode 100644 lib/lib/constants.js delete mode 100644 lib/lib/constants.js.map delete mode 100644 lib/lib/customTraceType.js delete mode 100644 lib/lib/customTraceType.js.map delete mode 100644 lib/lib/dereference.js delete mode 100644 lib/lib/dereference.js.map delete mode 100644 lib/lib/getAllAxes.js delete mode 100644 lib/lib/getAllAxes.js.map delete mode 100644 lib/lib/index.js delete mode 100644 lib/lib/index.js.map delete mode 100644 lib/lib/localize.js delete mode 100644 lib/lib/localize.js.map delete mode 100644 lib/lib/multiValues.js delete mode 100644 lib/lib/multiValues.js.map delete mode 100644 lib/lib/sortMenu.js delete mode 100644 lib/lib/sortMenu.js.map delete mode 100644 lib/lib/strings.js delete mode 100644 lib/lib/strings.js.map delete mode 100644 lib/lib/striptags.js delete mode 100644 lib/lib/striptags.js.map delete mode 100644 lib/lib/test-utils.js delete mode 100644 lib/lib/test-utils.js.map delete mode 100644 lib/lib/traceTypes.js delete mode 100644 lib/lib/traceTypes.js.map delete mode 100644 lib/lib/unpackPlotProps.js delete mode 100644 lib/lib/unpackPlotProps.js.map delete mode 100644 lib/lib/walkObject.js delete mode 100644 lib/lib/walkObject.js.map delete mode 100644 lib/locales/en.js delete mode 100644 lib/locales/en.js.map delete mode 100644 lib/locales/index.js delete mode 100644 lib/locales/index.js.map delete mode 100644 lib/locales/xx.js delete mode 100644 lib/locales/xx.js.map delete mode 100644 lib/react-chart-editor.css delete mode 100644 lib/react-chart-editor.ie.css delete mode 100644 lib/react-chart-editor.ie.min.css delete mode 100644 lib/react-chart-editor.min.css delete mode 100644 lib/shame.js delete mode 100644 lib/shame.js.map diff --git a/lib/DefaultEditor.js b/lib/DefaultEditor.js deleted file mode 100644 index 443a9a8dc..000000000 --- a/lib/DefaultEditor.js +++ /dev/null @@ -1,148 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _components = require('./components'); - -var _default_panels = require('./default_panels'); - -var _StyleColorbarsPanel = require('./default_panels/StyleColorbarsPanel'); - -var _Logo = require('./components/widgets/Logo'); - -var _Logo2 = _interopRequireDefault(_Logo); - -var _constants = require('./lib/constants'); - -var _context = require('./context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var DefaultEditor = function (_Component) { - _inherits(DefaultEditor, _Component); - - function DefaultEditor(props) { - _classCallCheck(this, DefaultEditor); - - var _this = _possibleConstructorReturn(this, (DefaultEditor.__proto__ || Object.getPrototypeOf(DefaultEditor)).call(this, props)); - - _this.hasTransforms = _this.hasTransforms.bind(_this); - _this.hasAxes = _this.hasAxes.bind(_this); - _this.hasMenus = _this.hasMenus.bind(_this); - _this.hasSliders = _this.hasSliders.bind(_this); - _this.hasColorbars = _this.hasColorbars.bind(_this); - return _this; - } - - _createClass(DefaultEditor, [{ - key: 'hasTransforms', - value: function hasTransforms(fullData) { - return fullData.some(function (d) { - return _constants.TRANSFORMABLE_TRACES.includes(d.type); - }); - } - }, { - key: 'hasAxes', - value: function hasAxes(fullLayout) { - return Object.keys(fullLayout._subplots).filter(function (type) { - return !['cartesian', 'mapbox'].includes(type) && fullLayout._subplots[type].length > 0; - }).length > 0; - } - }, { - key: 'hasMenus', - value: function hasMenus(fullLayout) { - var _fullLayout$updatemen = fullLayout.updatemenus, - updatemenus = _fullLayout$updatemen === undefined ? [] : _fullLayout$updatemen; - - - return updatemenus.length > 0; - } - }, { - key: 'hasSliders', - value: function hasSliders(layout) { - var _layout$sliders = layout.sliders, - sliders = _layout$sliders === undefined ? [] : _layout$sliders; - // const { - // layout: {sliders = []}, - // } = this.context; - - return sliders.length > 0; - } - }, { - key: 'hasColorbars', - value: function hasColorbars(fullData) { - return fullData.some(function (d) { - return (0, _StyleColorbarsPanel.traceHasColorbar)({}, d); - }); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var logo = this.props.logoSrc && _react2.default.createElement(_Logo2.default, { src: this.props.logoSrc }); - - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize, - fullData = _ref.fullData, - fullLayout = _ref.fullLayout, - layout = _ref.layout; - - return _react2.default.createElement( - _components.PanelMenuWrapper, - { menuPanelOrder: _this2.props.menuPanelOrder }, - logo ? logo : null, - _react2.default.createElement(_default_panels.GraphCreatePanel, { group: _('Structure'), name: _('Traces') }), - _react2.default.createElement(_default_panels.GraphSubplotsPanel, { group: _('Structure'), name: _('Subplots') }), - _this2.hasTransforms(fullData) && _react2.default.createElement(_default_panels.GraphTransformsPanel, { group: _('Structure'), name: _('Transforms') }), - _react2.default.createElement(_default_panels.StyleLayoutPanel, { group: _('Style'), name: _('General') }), - _react2.default.createElement(_default_panels.StyleTracesPanel, { group: _('Style'), name: _('Traces') }), - _this2.hasAxes(fullLayout) && _react2.default.createElement(_default_panels.StyleAxesPanel, { group: _('Style'), name: _('Axes') }), - _react2.default.createElement(_default_panels.StyleLegendPanel, { group: _('Style'), name: _('Legend') }), - _this2.hasColorbars(fullData) && _react2.default.createElement(_default_panels.StyleColorbarsPanel, { group: _('Style'), name: _('Color Bars') }), - _react2.default.createElement(_default_panels.StyleNotesPanel, { group: _('Style'), name: _('Annotation') }), - _react2.default.createElement(_default_panels.StyleShapesPanel, { group: _('Style'), name: _('Shapes') }), - _react2.default.createElement(_default_panels.StyleImagesPanel, { group: _('Style'), name: _('Images') }), - _this2.hasSliders(layout) && _react2.default.createElement(_default_panels.StyleSlidersPanel, { group: _('Style'), name: _('Sliders') }), - _this2.hasMenus(fullLayout) && _react2.default.createElement(_default_panels.StyleUpdateMenusPanel, { group: _('Style'), name: _('Menus') }), - _this2.props.children ? _this2.props.children : null - ); - } - ); - } - }]); - - return DefaultEditor; -}(_react.Component); - -DefaultEditor.propTypes = { - children: _propTypes2.default.node, - logoSrc: _propTypes2.default.string, - menuPanelOrder: _propTypes2.default.array -}; - -// DefaultEditor.contextType = EditorControlsContext; - -exports.default = DefaultEditor; -//# sourceMappingURL=DefaultEditor.js.map \ No newline at end of file diff --git a/lib/DefaultEditor.js.map b/lib/DefaultEditor.js.map deleted file mode 100644 index b660811c4..000000000 --- a/lib/DefaultEditor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/DefaultEditor.js"],"names":["DefaultEditor","props","hasTransforms","bind","hasAxes","hasMenus","hasSliders","hasColorbars","fullData","some","TRANSFORMABLE_TRACES","includes","d","type","fullLayout","Object","keys","_subplots","filter","length","updatemenus","layout","sliders","logo","logoSrc","_","localize","menuPanelOrder","children","Component","propTypes","PropTypes","node","string","array"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;AAeA;;AACA;;;;AACA;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8HACXA,KADW;;AAEjB,UAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBC,IAAnB,OAArB;AACA,UAAKC,OAAL,GAAe,MAAKA,OAAL,CAAaD,IAAb,OAAf;AACA,UAAKE,QAAL,GAAgB,MAAKA,QAAL,CAAcF,IAAd,OAAhB;AACA,UAAKG,UAAL,GAAkB,MAAKA,UAAL,CAAgBH,IAAhB,OAAlB;AACA,UAAKI,YAAL,GAAoB,MAAKA,YAAL,CAAkBJ,IAAlB,OAApB;AANiB;AAOlB;;;;kCAEaK,Q,EAAU;AACtB,aAAOA,SAASC,IAAT,CAAc;AAAA,eAAKC,gCAAqBC,QAArB,CAA8BC,EAAEC,IAAhC,CAAL;AAAA,OAAd,CAAP;AACD;;;4BAEOC,U,EAAY;AAClB,aACEC,OAAOC,IAAP,CAAYF,WAAWG,SAAvB,EAAkCC,MAAlC,CACE;AAAA,eAAQ,CAAC,CAAC,WAAD,EAAc,QAAd,EAAwBP,QAAxB,CAAiCE,IAAjC,CAAD,IAA2CC,WAAWG,SAAX,CAAqBJ,IAArB,EAA2BM,MAA3B,GAAoC,CAAvF;AAAA,OADF,EAEEA,MAFF,GAEW,CAHb;AAKD;;;6BAEQL,U,EAAY;AAAA,kCACQA,UADR,CACZM,WADY;AAAA,UACZA,WADY,yCACE,EADF;;;AAGnB,aAAOA,YAAYD,MAAZ,GAAqB,CAA5B;AACD;;;+BAEUE,M,EAAQ;AAAA,4BACMA,MADN,CACVC,OADU;AAAA,UACVA,OADU,m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CAAvB,EAAmC,MAAMA,EAAE,MAAF,CAAzC,GAT/B;AAUE,0CAAC,gCAAD,IAAkB,OAAOA,EAAE,OAAF,CAAzB,EAAqC,MAAMA,EAAE,QAAF,CAA3C,GAVF;AAWG,mBAAKlB,YAAL,CAAkBC,QAAlB,KACC,8BAAC,mCAAD,IAAqB,OAAOiB,EAAE,OAAF,CAA5B,EAAwC,MAAMA,EAAE,YAAF,CAA9C,GAZJ;AAcE,0CAAC,+BAAD,IAAiB,OAAOA,EAAE,OAAF,CAAxB,EAAoC,MAAMA,EAAE,YAAF,CAA1C,GAdF;AAeE,0CAAC,gCAAD,IAAkB,OAAOA,EAAE,OAAF,CAAzB,EAAqC,MAAMA,EAAE,QAAF,CAA3C,GAfF;AAgBE,0CAAC,gCAAD,IAAkB,OAAOA,EAAE,OAAF,CAAzB,EAAqC,MAAMA,EAAE,QAAF,CAA3C,GAhBF;AAiBG,mBAAKnB,UAAL,CAAgBe,MAAhB,KACC,8BAAC,iCAAD,IAAmB,OAAOI,EAAE,OAAF,CAA1B,EAAsC,MAAMA,EAAE,SAAF,CAA5C,GAlBJ;AAoBG,mBAAKpB,QAAL,CAAcS,UAAd,KACC,8BAAC,qCAAD,IAAuB,OAAOW,EAAE,OAAF,CAA9B,EAA0C,MAAMA,EAAE,OAAF,CAAhD,GArBJ;AAuBG,mBAAKxB,KAAL,CAAW2B,QAAX,GAAsB,OAAK3B,KAAL,CAAW2B,QAAjC,GAA4C;AAvB/C,WADF;AA2BD;AA7BH,OADF;AAiCD;;;;EA7EyBC,gB;;AAgF5B7B,cAAc8B,SAAd,GAA0B;AACxBF,YAAUG,oBAAUC,IADI;AAExBR,WAASO,oBAAUE,MAFK;AAGxBN,kBAAgBI,oBAAUG;AAHF,CAA1B;;AAMA;;kBAEelC,a","file":"DefaultEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {PanelMenuWrapper} from './components';\nimport {\n GraphCreatePanel,\n GraphTransformsPanel,\n GraphSubplotsPanel,\n StyleLayoutPanel,\n StyleAxesPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleSlidersPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n StyleColorbarsPanel,\n StyleUpdateMenusPanel,\n} from './default_panels';\nimport {traceHasColorbar} from './default_panels/StyleColorbarsPanel';\nimport Logo from './components/widgets/Logo';\nimport {TRANSFORMABLE_TRACES} from './lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass DefaultEditor extends Component {\n constructor(props) {\n super(props);\n this.hasTransforms = this.hasTransforms.bind(this);\n this.hasAxes = this.hasAxes.bind(this);\n this.hasMenus = this.hasMenus.bind(this);\n this.hasSliders = this.hasSliders.bind(this);\n this.hasColorbars = this.hasColorbars.bind(this);\n }\n\n hasTransforms(fullData) {\n return fullData.some(d => TRANSFORMABLE_TRACES.includes(d.type));\n }\n\n hasAxes(fullLayout) {\n return (\n Object.keys(fullLayout._subplots).filter(\n type => !['cartesian', 'mapbox'].includes(type) && fullLayout._subplots[type].length > 0\n ).length > 0\n );\n }\n\n hasMenus(fullLayout) {\n const {updatemenus = []} = fullLayout;\n\n return updatemenus.length > 0;\n }\n\n hasSliders(layout) {\n const {sliders = []} = layout;\n // const {\n // layout: {sliders = []},\n // } = this.context;\n\n return sliders.length > 0;\n }\n\n hasColorbars(fullData) {\n return fullData.some(d => traceHasColorbar({}, d));\n }\n\n render() {\n const logo = this.props.logoSrc && ;\n\n return (\n \n {({localize: _, fullData, fullLayout, layout}) => {\n return (\n \n {logo ? logo : null}\n \n \n {this.hasTransforms(fullData) && (\n \n )}\n \n \n {this.hasAxes(fullLayout) && }\n \n {this.hasColorbars(fullData) && (\n \n )}\n \n \n \n {this.hasSliders(layout) && (\n \n )}\n {this.hasMenus(fullLayout) && (\n \n )}\n {this.props.children ? this.props.children : null}\n \n );\n }}\n \n );\n }\n}\n\nDefaultEditor.propTypes = {\n children: PropTypes.node,\n logoSrc: PropTypes.string,\n menuPanelOrder: PropTypes.array,\n};\n\n// DefaultEditor.contextType = EditorControlsContext;\n\nexport default DefaultEditor;\n"]} \ No newline at end of file diff --git a/lib/EditorControls.js b/lib/EditorControls.js deleted file mode 100644 index c5b637b9f..000000000 --- a/lib/EditorControls.js +++ /dev/null @@ -1,462 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _DefaultEditor = require('./DefaultEditor'); - -var _DefaultEditor2 = _interopRequireDefault(_DefaultEditor); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('./lib'); - -var _shame = require('./shame'); - -var _constants = require('./lib/constants'); - -var _fastIsnumeric = require('fast-isnumeric'); - -var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); - -var _nested_property = require('plotly.js/src/lib/nested_property'); - -var _nested_property2 = _interopRequireDefault(_nested_property); - -var _traceTypes = require('./lib/traceTypes'); - -var _containers = require('./components/containers'); - -var _context = require('./context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var EditorControls = function (_Component) { - _inherits(EditorControls, _Component); - - function EditorControls(props, context) { - _classCallCheck(this, EditorControls); - - var _this = _possibleConstructorReturn(this, (EditorControls.__proto__ || Object.getPrototypeOf(EditorControls)).call(this, props, context)); - - _this.localize = function (key) { - return (0, _lib.localizeString)(_this.props.dictionaries || {}, _this.props.locale, key); - }; - - // we only need to compute this once. - if (_this.props.plotly) { - _this.plotSchema = _this.props.plotly.PlotSchema.get(); - } - return _this; - } - - _createClass(EditorControls, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var updatePayload = nextProps.updatePayload; - - if (updatePayload && updatePayload.length > 0) { - this.handleDataSourceChange(updatePayload); - } - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var gd = this.props.graphDiv || {}; - return { - advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, - config: gd._context, - srcConverters: this.props.srcConverters, - data: gd.data, - dataSources: this.props.dataSources, - dataSourceOptions: this.props.dataSourceOptions, - dataSourceValueRenderer: this.props.dataSourceValueRenderer, - dataSourceOptionRenderer: this.props.dataSourceOptionRenderer, - dictionaries: this.props.dictionaries || {}, - localize: this.localize, - frames: gd._transitionData ? gd._transitionData._frames : [], - fullData: gd._fullData, - fullLayout: gd._fullLayout, - graphDiv: gd, - layout: gd.layout, - locale: this.props.locale, - onUpdate: this.handleUpdate.bind(this), - plotSchema: this.plotSchema, - plotly: this.props.plotly, - traceTypesConfig: this.props.traceTypesConfig, - showFieldTooltips: this.props.showFieldTooltips, - glByDefault: this.props.glByDefault, - mapBoxAccess: this.props.mapBoxAccess, - fontOptions: this.props.fontOptions, - chartHelp: this.props.chartHelp - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var gd = this.props.graphDiv || {}; - return { - advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, - config: gd._context, - srcConverters: this.props.srcConverters, - data: gd.data, - dataSources: this.props.dataSources, - dataSourceOptions: this.props.dataSourceOptions, - dataSourceValueRenderer: this.props.dataSourceValueRenderer, - dataSourceOptionRenderer: this.props.dataSourceOptionRenderer, - dictionaries: this.props.dictionaries || {}, - localize: this.localize, - frames: gd._transitionData ? gd._transitionData._frames : [], - fullData: gd._fullData, - fullLayout: gd._fullLayout, - graphDiv: gd, - layout: gd.layout, - locale: this.props.locale, - onUpdate: this.handleUpdate.bind(this), - plotSchema: this.plotSchema, - plotly: this.props.plotly, - traceTypesConfig: this.props.traceTypesConfig, - showFieldTooltips: this.props.showFieldTooltips, - glByDefault: this.props.glByDefault, - mapBoxAccess: this.props.mapBoxAccess, - fontOptions: this.props.fontOptions, - chartHelp: this.props.chartHelp - }; - } - }, { - key: 'handleDataSourceChange', - value: function handleDataSourceChange(updatePayload) { - var _this2 = this; - - if (updatePayload && updatePayload.length !== 0) { - updatePayload.forEach(function (payload) { - _this2.handleUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, - payload: payload - }); - }); - } - } - }, { - key: 'handleUpdate', - value: function handleUpdate(_ref) { - var type = _ref.type, - payload = _ref.payload; - var graphDiv = this.props.graphDiv; - - - switch (type) { - case _constants.EDITOR_ACTIONS.UPDATE_TRACES: - if (this.props.beforeUpdateTraces) { - this.props.beforeUpdateTraces(payload); - } - - (0, _shame.shamefullyAdjustSizeref)(graphDiv, payload); - (0, _shame.shamefullyClearAxisTypes)(graphDiv, payload); - (0, _shame.shamefullyAdjustAxisRef)(graphDiv, payload); - (0, _shame.shamefullyAddTableColumns)(graphDiv, payload); - (0, _shame.shamefullyAdjustSplitStyleTargetContainers)(graphDiv, payload); - - for (var i = 0; i < payload.traceIndexes.length; i++) { - var _loop = function _loop(attr) { - var traceIndex = payload.traceIndexes[i]; - var splitTraceGroup = payload.splitTraceGroup ? payload.splitTraceGroup.toString() : null; - - var props = [(0, _nested_property2.default)(graphDiv.data[traceIndex], attr)]; - var value = payload.update[attr]; - - if (splitTraceGroup) { - props = (0, _shame.shamefullyCreateSplitStyleProps)(graphDiv, attr, traceIndex, splitTraceGroup); - } - - props.forEach(function (p) { - if (value !== void 0) { - p.set(value); - } - }); - }; - - for (var attr in payload.update) { - _loop(attr); - } - } - - if (this.props.afterUpdateTraces) { - this.props.afterUpdateTraces(payload); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); - } - break; - - case _constants.EDITOR_ACTIONS.UPDATE_LAYOUT: - (0, _shame.shamefullyAdjustGeo)(graphDiv, payload); - - if (this.props.beforeUpdateLayout) { - this.props.beforeUpdateLayout(payload); - } - for (var attr in payload.update) { - var prop = (0, _nested_property2.default)(graphDiv.layout, attr); - var _value = payload.update[attr]; - if (_value !== void 0) { - prop.set(_value); - } - } - if (this.props.afterUpdateLayout) { - this.props.afterUpdateLayout(payload); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); - } - break; - - case _constants.EDITOR_ACTIONS.ADD_TRACE: - if (this.props.beforeAddTrace) { - this.props.beforeAddTrace(payload); - } - - // can't use default prop because plotly.js mutates it: - // https://github.com/plotly/react-chart-editor/issues/509 - if (graphDiv.data.length === 0) { - graphDiv.data.push(this.props.makeDefaultTrace ? this.props.makeDefaultTrace() : { - type: 'scatter' + (this.props.glByDefault ? 'gl' : ''), - mode: 'markers' - }); - } else { - var prevTrace = graphDiv.data[graphDiv.data.length - 1]; - var prevTraceType = (0, _lib.plotlyTraceToCustomTrace)(prevTrace); - graphDiv.data.push((0, _lib.traceTypeToPlotlyInitFigure)(prevTraceType, prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : '')); - } - - if (this.props.afterAddTrace) { - this.props.afterAddTrace(payload); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); - } - break; - - case _constants.EDITOR_ACTIONS.DELETE_TRACE: - if (payload.traceIndexes && payload.traceIndexes.length) { - if (this.props.beforeDeleteTrace) { - this.props.beforeDeleteTrace(payload); - } - - (0, _shame.shamefullyAdjustAxisRef)(graphDiv, payload); - (0, _shame.shamefullyDeleteRelatedAnalysisTransforms)(graphDiv, payload); - - graphDiv.data.splice(payload.traceIndexes[0], 1); - if (this.props.afterDeleteTrace) { - this.props.afterDeleteTrace(payload); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); - } - } - break; - - case _constants.EDITOR_ACTIONS.DELETE_ANNOTATION: - if ((0, _fastIsnumeric2.default)(payload.annotationIndex)) { - if (this.props.beforeDeleteAnnotation) { - this.props.beforeDeleteAnnotation(payload); - } - graphDiv.layout.annotations.splice(payload.annotationIndex, 1); - if (this.props.afterDeleteAnnotation) { - this.props.afterDeleteAnnotation(payload); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); - } - } - break; - - case _constants.EDITOR_ACTIONS.DELETE_SHAPE: - if ((0, _fastIsnumeric2.default)(payload.shapeIndex)) { - if (this.props.beforeDeleteShape) { - this.props.beforeDeleteShape(payload); - } - graphDiv.layout.shapes.splice(payload.shapeIndex, 1); - if (this.props.afterDeleteShape) { - this.props.afterDeleteShape(payload); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); - } - } - break; - - case _constants.EDITOR_ACTIONS.DELETE_IMAGE: - if ((0, _fastIsnumeric2.default)(payload.imageIndex)) { - if (this.props.beforeDeleteImage) { - this.props.beforeDeleteImage(payload); - } - graphDiv.layout.images.splice(payload.imageIndex, 1); - if (this.props.afterDeleteImage) { - this.props.afterDeleteImage(payload); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); - } - } - break; - - case _constants.EDITOR_ACTIONS.DELETE_RANGESELECTOR: - if ((0, _fastIsnumeric2.default)(payload.rangeselectorIndex)) { - graphDiv.layout[payload.axisId].rangeselector.buttons.splice(payload.rangeselectorIndex, 1); - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames); - } - } - break; - - case _constants.EDITOR_ACTIONS.DELETE_TRANSFORM: - if ((0, _fastIsnumeric2.default)(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) { - if (graphDiv.data[payload.traceIndex].transforms.length === 1) { - delete graphDiv.data[payload.traceIndex].transforms; - } else { - graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1); - } - if (this.props.onUpdate) { - this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames); - } - } - break; - - default: - throw new Error(this.localize('must specify an action type to handleEditorUpdate')); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _context.EditorControlsContext.Provider, - { value: this.provideValue() }, - _react2.default.createElement( - 'div', - { - className: (0, _lib.bem)('editor_controls') + ' plotly-editor--theme-provider' + ('' + (this.props.className ? ' ' + this.props.className : '')) - }, - _react2.default.createElement( - _containers.ModalProvider, - null, - this.props.graphDiv && this.props.graphDiv._fullLayout && (this.props.children ? this.props.children : this.props.optionalPanel ? _react2.default.createElement( - _DefaultEditor2.default, - { menuPanelOrder: this.props.menuPanelOrder }, - this.props.optionalPanel - ) : _react2.default.createElement(_DefaultEditor2.default, null)) - ) - ) - ); - } - }]); - - return EditorControls; -}(_react.Component); - -EditorControls.propTypes = { - advancedTraceTypeSelector: _propTypes2.default.bool, - afterAddTrace: _propTypes2.default.func, - afterDeleteAnnotation: _propTypes2.default.func, - afterDeleteShape: _propTypes2.default.func, - afterDeleteImage: _propTypes2.default.func, - afterDeleteTrace: _propTypes2.default.func, - afterUpdateLayout: _propTypes2.default.func, - afterUpdateTraces: _propTypes2.default.func, - beforeAddTrace: _propTypes2.default.func, - beforeDeleteAnnotation: _propTypes2.default.func, - beforeDeleteShape: _propTypes2.default.func, - beforeDeleteImage: _propTypes2.default.func, - beforeDeleteTrace: _propTypes2.default.func, - beforeUpdateLayout: _propTypes2.default.func, - beforeUpdateTraces: _propTypes2.default.func, - children: _propTypes2.default.node, - className: _propTypes2.default.string, - srcConverters: _propTypes2.default.shape({ - toSrc: _propTypes2.default.func.isRequired, - fromSrc: _propTypes2.default.func.isRequired - }), - dataSourceOptionRenderer: _propTypes2.default.func, - dataSourceOptions: _propTypes2.default.array, - dataSources: _propTypes2.default.object, - dataSourceValueRenderer: _propTypes2.default.func, - dictionaries: _propTypes2.default.object, - graphDiv: _propTypes2.default.object, - locale: _propTypes2.default.string, - onUpdate: _propTypes2.default.func, - plotly: _propTypes2.default.object, - showFieldTooltips: _propTypes2.default.bool, - traceTypesConfig: _propTypes2.default.object, - makeDefaultTrace: _propTypes2.default.func, - glByDefault: _propTypes2.default.bool, - mapBoxAccess: _propTypes2.default.bool, - fontOptions: _propTypes2.default.array, - chartHelp: _propTypes2.default.object, - optionalPanel: _propTypes2.default.node, - menuPanelOrder: _propTypes2.default.array, - updatePayload: _propTypes2.default.array -}; - -EditorControls.defaultProps = { - showFieldTooltips: false, - locale: 'en', - traceTypesConfig: { - categories: function categories(_) { - return (0, _traceTypes.categoryLayout)(_); - }, - traces: function traces(_) { - return (0, _traceTypes.traceTypes)(_); - }, - complex: true - }, - fontOptions: _constants.DEFAULT_FONTS -}; - -EditorControls.childContextTypes = { - advancedTraceTypeSelector: _propTypes2.default.bool, - config: _propTypes2.default.object, - srcConverters: _propTypes2.default.shape({ - toSrc: _propTypes2.default.func.isRequired, - fromSrc: _propTypes2.default.func.isRequired - }), - data: _propTypes2.default.array, - dataSourceOptionRenderer: _propTypes2.default.func, - dataSourceOptions: _propTypes2.default.array, - dataSources: _propTypes2.default.object, - dataSourceValueRenderer: _propTypes2.default.func, - dictionaries: _propTypes2.default.object, - frames: _propTypes2.default.array, - fullData: _propTypes2.default.array, - fullLayout: _propTypes2.default.object, - graphDiv: _propTypes2.default.any, - layout: _propTypes2.default.object, - locale: _propTypes2.default.string, - localize: _propTypes2.default.func, - onUpdate: _propTypes2.default.func, - plotly: _propTypes2.default.object, - plotSchema: _propTypes2.default.object, - traceTypesConfig: _propTypes2.default.object, - showFieldTooltips: _propTypes2.default.bool, - glByDefault: _propTypes2.default.bool, - mapBoxAccess: _propTypes2.default.bool, - fontOptions: _propTypes2.default.array, - chartHelp: _propTypes2.default.object -}; - -exports.default = EditorControls; -//# sourceMappingURL=EditorControls.js.map \ No newline at end of file diff --git a/lib/EditorControls.js.map b/lib/EditorControls.js.map deleted file mode 100644 index 8087e524d..000000000 --- a/lib/EditorControls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/EditorControls.js"],"names":["EditorControls","props","context","localize","dictionaries","locale","key","plotly","plotSchema","PlotSchema","get","nextProps","updatePayload","length","handleDataSourceChange","gd","graphDiv","advancedTraceTypeSelector","config","_context","srcConverters","data","dataSources","dataSourceOptions","dataSourceValueRenderer","dataSourceOptionRenderer","frames","_transitionData","_frames","fullData","_fullData","fullLayout","_fullLayout","layout","onUpdate","handleUpdate","bind","traceTypesConfig","showFieldTooltips","glByDefault","mapBoxAccess","fontOptions","chartHelp","forEach","type","EDITOR_ACTIONS","UPDATE_TRACES","payload","beforeUpdateTraces","i","traceIndexes","attr","traceIndex","splitTraceGroup","toString","value","update","p","set","afterUpdateTraces","slice","UPDATE_LAYOUT","beforeUpdateLayout","prop","afterUpdateLayout","Object","assign","ADD_TRACE","beforeAddTrace","push","makeDefaultTrace","mode","prevTrace","prevTraceType","endsWith","afterAddTrace","DELETE_TRACE","beforeDeleteTrace","splice","afterDeleteTrace","DELETE_ANNOTATION","annotationIndex","beforeDeleteAnnotation","annotations","afterDeleteAnnotation","DELETE_SHAPE","shapeIndex","beforeDeleteShape","shapes","afterDeleteShape","DELETE_IMAGE","imageIndex","beforeDeleteImage","images","afterDeleteImage","DELETE_RANGESELECTOR","rangeselectorIndex","axisId","rangeselector","buttons","DELETE_TRANSFORM","transformIndex","transforms","Error","provideValue","className","children","optionalPanel","menuPanelOrder","Component","propTypes","PropTypes","bool","func","node","string","shape","toSrc","isRequired","fromSrc","array","object","defaultProps","categories","_","traces","complex","DEFAULT_FONTS","childContextTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AAUA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;;;;;;;;;IAEMA,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAG1B,UAAKC,QAAL,GAAgB;AAAA,aAAO,yBAAe,MAAKF,KAAL,CAAWG,YAAX,IAA2B,EAA1C,EAA8C,MAAKH,KAAL,CAAWI,MAAzD,EAAiEC,GAAjE,CAAP;AAAA,KAAhB;;AAEA;AACA,QAAI,MAAKL,KAAL,CAAWM,MAAf,EAAuB;AACrB,YAAKC,UAAL,GAAkB,MAAKP,KAAL,CAAWM,MAAX,CAAkBE,UAAlB,CAA6BC,GAA7B,EAAlB;AACD;AARyB;AAS3B;;;;8CAEyBC,S,EAAW;AAAA,UAC5BC,aAD4B,GACXD,SADW,CAC5BC,aAD4B;;AAEnC,UAAIA,iBAAiBA,cAAcC,MAAd,GAAuB,CAA5C,EAA+C;AAC7C,aAAKC,sBAAL,CAA4BF,aAA5B;AACD;AACF;;;sCAEiB;AAChB,UAAMG,KAAK,KAAKd,KAAL,CAAWe,QAAX,IAAuB,EAAlC;AACA,aAAO;AACLC,mCAA2B,KAAKhB,KAAL,CAAWgB,yBADjC;AAELC,gBAAQH,GAAGI,QAFN;AAGLC,uBAAe,KAAKnB,KAAL,CAAWmB,aAHrB;AAILC,cAAMN,GAAGM,IAJJ;AAKLC,qBAAa,KAAKrB,KAAL,CAAWqB,WALnB;AAMLC,2BAAmB,KAAKtB,KAAL,CAAWsB,iBANzB;AAOLC,iCAAyB,KA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,oBAAUE,IApBa;AAqBjC1G,UAAQwG,oBAAUU,MArBe;AAsBjCjH,cAAYuG,oBAAUU,MAtBW;AAuBjCpF,oBAAkB0E,oBAAUU,MAvBK;AAwBjCnF,qBAAmByE,oBAAUC,IAxBI;AAyBjCzE,eAAawE,oBAAUC,IAzBU;AA0BjCxE,gBAAcuE,oBAAUC,IA1BS;AA2BjCvE,eAAasE,oBAAUS,KA3BU;AA4BjC9E,aAAWqE,oBAAUU;AA5BY,CAAnC;;kBA+BezH,c","file":"EditorControls.js","sourcesContent":["import DefaultEditor from './DefaultEditor';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {bem, localizeString, plotlyTraceToCustomTrace, traceTypeToPlotlyInitFigure} from './lib';\nimport {\n shamefullyClearAxisTypes,\n shamefullyAdjustAxisRef,\n shamefullyAdjustGeo,\n shamefullyAddTableColumns,\n shamefullyCreateSplitStyleProps,\n shamefullyAdjustSplitStyleTargetContainers,\n shamefullyDeleteRelatedAnalysisTransforms,\n shamefullyAdjustSizeref,\n} from './shame';\nimport {EDITOR_ACTIONS} from './lib/constants';\nimport isNumeric from 'fast-isnumeric';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {categoryLayout, traceTypes} from 'lib/traceTypes';\nimport {ModalProvider} from 'components/containers';\nimport {DEFAULT_FONTS} from 'lib/constants';\nimport {EditorControlsContext} from './context';\n\nclass EditorControls extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.localize = key => localizeString(this.props.dictionaries || {}, this.props.locale, key);\n\n // we only need to compute this once.\n if (this.props.plotly) {\n this.plotSchema = this.props.plotly.PlotSchema.get();\n }\n }\n\n componentWillReceiveProps(nextProps) {\n const {updatePayload} = nextProps;\n if (updatePayload && updatePayload.length > 0) {\n this.handleDataSourceChange(updatePayload);\n }\n }\n\n getChildContext() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n provideValue() {\n const gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSourceValueRenderer: this.props.dataSourceValueRenderer,\n dataSourceOptionRenderer: this.props.dataSourceOptionRenderer,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n };\n }\n\n handleDataSourceChange(updatePayload) {\n if (updatePayload && updatePayload.length !== 0) {\n updatePayload.forEach(payload => {\n this.handleUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload,\n });\n });\n }\n }\n\n handleUpdate({type, payload}) {\n const {graphDiv} = this.props;\n\n switch (type) {\n case EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n shamefullyAdjustSizeref(graphDiv, payload);\n shamefullyClearAxisTypes(graphDiv, payload);\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyAddTableColumns(graphDiv, payload);\n shamefullyAdjustSplitStyleTargetContainers(graphDiv, payload);\n\n for (let i = 0; i < payload.traceIndexes.length; i++) {\n for (const attr in payload.update) {\n const traceIndex = payload.traceIndexes[i];\n const splitTraceGroup = payload.splitTraceGroup\n ? payload.splitTraceGroup.toString()\n : null;\n\n let props = [nestedProperty(graphDiv.data[traceIndex], attr)];\n const value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(p => {\n if (value !== void 0) {\n p.set(value);\n }\n });\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.UPDATE_LAYOUT:\n shamefullyAdjustGeo(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n for (const attr in payload.update) {\n const prop = nestedProperty(graphDiv.layout, attr);\n const value = payload.update[attr];\n if (value !== void 0) {\n prop.set(value);\n }\n }\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n }\n\n // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(\n this.props.makeDefaultTrace\n ? this.props.makeDefaultTrace()\n : {\n type: `scatter${this.props.glByDefault ? 'gl' : ''}`,\n mode: 'markers',\n }\n );\n } else {\n const prevTrace = graphDiv.data[graphDiv.data.length - 1];\n const prevTraceType = plotlyTraceToCustomTrace(prevTrace);\n graphDiv.data.push(\n traceTypeToPlotlyInitFigure(\n prevTraceType,\n prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''\n )\n );\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n shamefullyAdjustAxisRef(graphDiv, payload);\n shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload);\n\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_ANNOTATION:\n if (isNumeric(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_SHAPE:\n if (isNumeric(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_IMAGE:\n if (isNumeric(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if (isNumeric(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(\n payload.rangeselectorIndex,\n 1\n );\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data,\n Object.assign({}, graphDiv.layout),\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n case EDITOR_ACTIONS.DELETE_TRANSFORM:\n if (isNumeric(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n if (this.props.onUpdate) {\n this.props.onUpdate(\n graphDiv.data.slice(),\n graphDiv.layout,\n graphDiv._transitionData._frames\n );\n }\n }\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n\n render() {\n return (\n \n \n \n {this.props.graphDiv &&\n this.props.graphDiv._fullLayout &&\n (this.props.children ? (\n this.props.children\n ) : this.props.optionalPanel ? (\n \n {this.props.optionalPanel}\n \n ) : (\n \n ))}\n \n \n \n );\n }\n}\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n afterAddTrace: PropTypes.func,\n afterDeleteAnnotation: PropTypes.func,\n afterDeleteShape: PropTypes.func,\n afterDeleteImage: PropTypes.func,\n afterDeleteTrace: PropTypes.func,\n afterUpdateLayout: PropTypes.func,\n afterUpdateTraces: PropTypes.func,\n beforeAddTrace: PropTypes.func,\n beforeDeleteAnnotation: PropTypes.func,\n beforeDeleteShape: PropTypes.func,\n beforeDeleteImage: PropTypes.func,\n beforeDeleteTrace: PropTypes.func,\n beforeUpdateLayout: PropTypes.func,\n beforeUpdateTraces: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.object,\n locale: PropTypes.string,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n updatePayload: PropTypes.array,\n};\n\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: _ => categoryLayout(_),\n traces: _ => traceTypes(_),\n complex: true,\n },\n fontOptions: DEFAULT_FONTS,\n};\n\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: PropTypes.bool,\n config: PropTypes.object,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n data: PropTypes.array,\n dataSourceOptionRenderer: PropTypes.func,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n dataSourceValueRenderer: PropTypes.func,\n dictionaries: PropTypes.object,\n frames: PropTypes.array,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n graphDiv: PropTypes.any,\n layout: PropTypes.object,\n locale: PropTypes.string,\n localize: PropTypes.func,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n plotSchema: PropTypes.object,\n traceTypesConfig: PropTypes.object,\n showFieldTooltips: PropTypes.bool,\n glByDefault: PropTypes.bool,\n mapBoxAccess: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n};\n\nexport default EditorControls;\n"]} \ No newline at end of file diff --git a/lib/PlotlyEditor.js b/lib/PlotlyEditor.js deleted file mode 100644 index ec70672dc..000000000 --- a/lib/PlotlyEditor.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _factory = require('react-plotly.js/factory'); - -var _factory2 = _interopRequireDefault(_factory); - -var _EditorControls = require('./EditorControls'); - -var _EditorControls2 = _interopRequireDefault(_EditorControls); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _constants = require('./lib/constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PlotlyEditor = function (_Component) { - _inherits(PlotlyEditor, _Component); - - function PlotlyEditor(props) { - _classCallCheck(this, PlotlyEditor); - - var _this = _possibleConstructorReturn(this, (PlotlyEditor.__proto__ || Object.getPrototypeOf(PlotlyEditor)).call(this)); - - _this.state = { graphDiv: {} }; - _this.PlotComponent = (0, _factory2.default)(props.plotly); - _this.handleRender = _this.handleRender.bind(_this); - return _this; - } - - _createClass(PlotlyEditor, [{ - key: 'handleRender', - value: function handleRender(fig, graphDiv) { - this.setState({ graphDiv: graphDiv }); - if (this.props.onRender) { - this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - 'div', - { className: 'plotly_editor' }, - !this.props.hideControls && _react2.default.createElement( - _EditorControls2.default, - { - graphDiv: this.state.graphDiv, - dataSources: this.props.dataSources, - dataSourceOptions: this.props.dataSourceOptions, - plotly: this.props.plotly, - onUpdate: this.props.onUpdate, - advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, - locale: this.props.locale, - traceTypesConfig: this.props.traceTypesConfig, - dictionaries: this.props.dictionaries, - showFieldTooltips: this.props.showFieldTooltips, - srcConverters: this.props.srcConverters, - makeDefaultTrace: this.props.makeDefaultTrace, - glByDefault: this.props.glByDefault, - mapBoxAccess: Boolean(this.props.config && this.props.config.mapboxAccessToken), - fontOptions: this.props.fontOptions, - chartHelp: this.props.chartHelp, - optionalPanel: this.props.optionalPanel, - menuPanelOrder: this.props.menuPanelOrder, - updatePayload: this.props.updatePayload - }, - this.props.children - ), - _react2.default.createElement( - 'div', - { className: 'plotly_editor_plot', style: { width: '100%', height: '100%' } }, - _react2.default.createElement(this.PlotComponent, { - data: this.props.data, - layout: this.props.layout, - frames: this.props.frames, - config: this.props.config, - useResizeHandler: this.props.useResizeHandler, - debug: this.props.debug, - onInitialized: this.handleRender, - onUpdate: this.handleRender, - style: { width: '100%', height: '100%' }, - divId: this.props.divId - }) - ) - ); - } - }]); - - return PlotlyEditor; -}(_react.Component); - -PlotlyEditor.propTypes = { - children: _propTypes2.default.any, - layout: _propTypes2.default.object, - data: _propTypes2.default.array, - config: _propTypes2.default.object, - dataSourceOptions: _propTypes2.default.array, - dataSources: _propTypes2.default.object, - frames: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - onRender: _propTypes2.default.func, - plotly: _propTypes2.default.object, - useResizeHandler: _propTypes2.default.bool, - debug: _propTypes2.default.bool, - advancedTraceTypeSelector: _propTypes2.default.bool, - locale: _propTypes2.default.string, - traceTypesConfig: _propTypes2.default.object, - dictionaries: _propTypes2.default.object, - divId: _propTypes2.default.string, - hideControls: _propTypes2.default.bool, - showFieldTooltips: _propTypes2.default.bool, - srcConverters: _propTypes2.default.shape({ - toSrc: _propTypes2.default.func.isRequired, - fromSrc: _propTypes2.default.func.isRequired - }), - makeDefaultTrace: _propTypes2.default.func, - glByDefault: _propTypes2.default.bool, - fontOptions: _propTypes2.default.array, - chartHelp: _propTypes2.default.object, - optionalPanel: _propTypes2.default.any, - menuPanelOrder: _propTypes2.default.array, - updatePayload: _propTypes2.default.array -}; - -PlotlyEditor.defaultProps = { - hideControls: false, - showFieldTooltips: false, - fontOptions: _constants.DEFAULT_FONTS -}; - -exports.default = PlotlyEditor; -//# sourceMappingURL=PlotlyEditor.js.map \ No newline at end of file diff --git a/lib/PlotlyEditor.js.map b/lib/PlotlyEditor.js.map deleted file mode 100644 index 3c06925e1..000000000 --- a/lib/PlotlyEditor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/PlotlyEditor.js"],"names":["PlotlyEditor","props","state","graphDiv","PlotComponent","plotly","handleRender","bind","fig","setState","onRender","data","layout","_transitionData","_frames","hideControls","dataSources","dataSourceOptions","onUpdate","advancedTraceTypeSelector","locale","traceTypesConfig","dictionaries","showFieldTooltips","srcConverters","makeDefaultTrace","glByDefault","Boolean","config","mapboxAccessToken","fontOptions","chartHelp","optionalPanel","menuPanelOrder","updatePayload","children","width","height","frames","useResizeHandler","debug","divId","Component","propTypes","PropTypes","any","object","array","func","bool","string","shape","toSrc","isRequired","fromSrc","defaultProps","DEFAULT_FONTS"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Y;;;AACJ,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AAEjB,UAAKC,KAAL,GAAa,EAACC,UAAU,EAAX,EAAb;AACA,UAAKC,aAAL,GAAqB,uBAAoBH,MAAMI,MAA1B,CAArB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAJiB;AAKlB;;;;iCAEYC,G,EAAKL,Q,EAAU;AAC1B,WAAKM,QAAL,CAAc,EAACN,kBAAD,EAAd;AACA,UAAI,KAAKF,KAAL,CAAWS,QAAf,EAAyB;AACvB,aAAKT,KAAL,CAAWS,QAAX,CAAoBP,SAASQ,IAA7B,EAAmCR,SAASS,MAA5C,EAAoDT,SAASU,eAAT,CAAyBC,OAA7E;AACD;AACF;;;6BAEQ;AACP,aACE;AAAA;AAAA,UAAK,WAAU,eAAf;AACG,SAAC,KAAKb,KAAL,CAAWc,YAAZ,IACC;AAAC,kCAAD;AAAA;AACE,sBAAU,KAAKb,KAAL,CAAWC,QADvB;AAEE,yBAAa,KAAKF,KAAL,CAAWe,WAF1B;AAGE,+BAAmB,KAAKf,KAAL,CAAWgB,iBAHhC;AAIE,oBAAQ,KAAKhB,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Y;AAE1BQ,qBAAmB,KAFO;AAG1BO,eAAa0B;AAHa,CAA5B;;kBAMexD,Y","file":"PlotlyEditor.js","sourcesContent":["import React, {Component} from 'react';\nimport createPlotComponent from 'react-plotly.js/factory';\nimport EditorControls from './EditorControls';\nimport PropTypes from 'prop-types';\nimport {DEFAULT_FONTS} from 'lib/constants';\n\nclass PlotlyEditor extends Component {\n constructor(props) {\n super();\n this.state = {graphDiv: {}};\n this.PlotComponent = createPlotComponent(props.plotly);\n this.handleRender = this.handleRender.bind(this);\n }\n\n handleRender(fig, graphDiv) {\n this.setState({graphDiv});\n if (this.props.onRender) {\n this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n render() {\n return (\n
\n {!this.props.hideControls && (\n \n {this.props.children}\n \n )}\n
\n \n
\n
\n );\n }\n}\n\nPlotlyEditor.propTypes = {\n children: PropTypes.any,\n layout: PropTypes.object,\n data: PropTypes.array,\n config: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n dataSources: PropTypes.object,\n frames: PropTypes.array,\n onUpdate: PropTypes.func,\n onRender: PropTypes.func,\n plotly: PropTypes.object,\n useResizeHandler: PropTypes.bool,\n debug: PropTypes.bool,\n advancedTraceTypeSelector: PropTypes.bool,\n locale: PropTypes.string,\n traceTypesConfig: PropTypes.object,\n dictionaries: PropTypes.object,\n divId: PropTypes.string,\n hideControls: PropTypes.bool,\n showFieldTooltips: PropTypes.bool,\n srcConverters: PropTypes.shape({\n toSrc: PropTypes.func.isRequired,\n fromSrc: PropTypes.func.isRequired,\n }),\n makeDefaultTrace: PropTypes.func,\n glByDefault: PropTypes.bool,\n fontOptions: PropTypes.array,\n chartHelp: PropTypes.object,\n optionalPanel: PropTypes.any,\n menuPanelOrder: PropTypes.array,\n updatePayload: PropTypes.array,\n};\n\nPlotlyEditor.defaultProps = {\n hideControls: false,\n showFieldTooltips: false,\n fontOptions: DEFAULT_FONTS,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file diff --git a/lib/__percy__/panels.percy.js b/lib/__percy__/panels.percy.js deleted file mode 100644 index 8df54b5c2..000000000 --- a/lib/__percy__/panels.percy.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -var _testUtils = require('../lib/test-utils'); - -var _components = require('../components'); - -var _percy = require('../../dev/percy'); - -var mocks = _interopRequireWildcard(_percy); - -var _default_panels = require('../default_panels/'); - -var panels = _interopRequireWildcard(_default_panels); - -require('../../dev/styles.css'); - -require('../styles/main.scss'); - -require('./percy.css'); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -/** - * To add more Percy tests - add a mock file to /dev/percy, add it to /dev/percy/index.js - * To specify which panels to test with the mock, add entry to panelsToTest, else all panels will be tested - */ -var panelsToTest = { - bar: ['GraphCreatePanel', 'StyleTracesPanel'], - box: ['GraphCreatePanel', 'StyleTracesPanel'], - pie: ['GraphCreatePanel', 'StyleTracesPanel'], - histogram: ['GraphCreatePanel', 'StyleTracesPanel'], - histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'], - violin: ['GraphCreatePanel', 'StyleTracesPanel'] -}; - -window.URL.createObjectURL = function () { - return null; -}; - -var panelFixture = function panelFixture(Panel, group, name, figure) { - var gd = (0, _testUtils.setupGraphDiv)(figure); - gd._context = _testUtils.plotly.setPlotConfig(); - gd._context.setBackground = function () { - return null; - }; - - return React.createElement( - 'div', - { className: 'plotly_editor' }, - React.createElement( - _testUtils.TestEditor, - { - plotly: _testUtils.plotly, - graphDiv: gd, - dataSources: _testUtils.fixtures.scatter().dataSources, - dataSourceOptions: _testUtils.fixtures.scatter().dataSourceOptions - }, - React.createElement( - _components.PanelMenuWrapper, - null, - React.createElement(Panel, { group: group, name: name }) - ) - ) - ); -}; - -var snapshotWidth = 500; - -Object.keys(mocks).forEach(function (m) { - var selectedPanels = panelsToTest[m] ? panelsToTest[m] : Object.keys(panels); - - selectedPanels.forEach(function (p) { - var words = p.split(/(?=[A-Z])/); - var panelGroup = words[0]; - var panelName = words.slice(1, -1).join(' '); - - percySnapshot(m + '_' + p, { widths: [snapshotWidth] }, function () { - return panelFixture(panels[p], panelGroup, panelName, mocks[m]); - }); - }); -}); -//# sourceMappingURL=panels.percy.js.map \ No newline at end of file diff --git a/lib/__percy__/panels.percy.js.map b/lib/__percy__/panels.percy.js.map deleted file mode 100644 index aacaf7863..000000000 --- a/lib/__percy__/panels.percy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/__percy__/panels.percy.js"],"names":["mocks","panels","panelsToTest","bar","box","pie","histogram","histogram2d","violin","window","URL","createObjectURL","panelFixture","Panel","group","name","figure","gd","_context","plotly","setPlotConfig","setBackground","fixtures","scatter","dataSources","dataSourceOptions","snapshotWidth","Object","keys","forEach","selectedPanels","m","words","p","split","panelGroup","panelName","slice","join","percySnapshot","widths"],"mappings":";;AAAA;;AAEA;;AAEA;;IAAYA,K;;AACZ;;IAAYC,M;;AAEZ;;AACA;;AACA;;;;AAEA;;;;AAIA,IAAMC,eAAe;AACnBC,OAAK,CAAC,kBAAD,EAAqB,kBAArB,CADc;AAEnBC,OAAK,CAAC,kBAAD,EAAqB,kBAArB,CAFc;AAGnBC,OAAK,CAAC,kBAAD,EAAqB,kBAArB,CAHc;AAInBC,aAAW,CAAC,kBAAD,EAAqB,kBAArB,CAJQ;AAKnBC,eAAa,CAAC,kBAAD,EAAqB,kBAArB,CALM;AAMnBC,UAAQ,CAAC,kBAAD,EAAqB,kBAArB;AANW,CAArB;;AASAC,OAAOC,GAAP,CAAWC,eAAX,GAA6B,YAAW;AACtC,SAAO,IAAP;AACD,CAFD;;AAIA,IAAMC,eAAe,SAAfA,YAAe,CAACC,KAAD,EAAQC,KAAR,EAAeC,IAAf,EAAqBC,MAArB,EAAgC;AACnD,MAAMC,KAAK,8BAAcD,MAAd,CAAX;AACAC,KAAGC,QAAH,GAAcC,kBAAOC,aAAP,EAAd;AACAH,KAAGC,QAAH,CAAYG,aAAZ,GAA4B,YAAM;AAChC,WAAO,IAAP;AACD,GAFD;;AAIA,SACE;AAAA;AAAA,MAAK,WAAU,eAAf;AACE;AAAC,2BAAD;AAAA;AACE,gBAAQF,iBADV;AAEE,kBAAUF,EAFZ;AAGE,qBAAaK,oBAASC,OAAT,GAAmBC,WAHlC;AAIE,2BAAmBF,oBAASC,OAAT,GAAmBE;AAJxC;AAME;AAAC,oCAAD;AAAA;AACE,4BAAC,KAAD,IAAO,OAAOX,KAAd,EAAqB,MAAMC,IAA3B;AADF;AANF;AADF,GADF;AAcD,CArBD;;AAuBA,IAAMW,gBAAgB,GAAtB;;AAEAC,OAAOC,IAAP,CAAY5B,KAAZ,EAAmB6B,OAAnB,CAA2B,aAAK;AAC9B,MAAMC,iBAAiB5B,aAAa6B,CAAb,IAAkB7B,aAAa6B,CAAb,CAAlB,GAAoCJ,OAAOC,IAAP,CAAY3B,MAAZ,CAA3D;;AAEA6B,iBAAeD,OAAf,CAAuB,aAAK;AAC1B,QAAMG,QAAQC,EAAEC,KAAF,CAAQ,WAAR,CAAd;AACA,QAAMC,aAAaH,MAAM,CAAN,CAAnB;AACA,QAAMI,YAAYJ,MAAMK,KAAN,CAAY,CAAZ,EAAe,CAAC,CAAhB,EAAmBC,IAAnB,CAAwB,GAAxB,CAAlB;;AAEAC,kBAAiBR,CAAjB,SAAsBE,CAAtB,EAA2B,EAACO,QAAQ,CAACd,aAAD,CAAT,EAA3B,EAAsD;AAAA,aACpDd,aAAaX,OAAOgC,CAAP,CAAb,EAAwBE,UAAxB,EAAoCC,SAApC,EAA+CpC,MAAM+B,CAAN,CAA/C,CADoD;AAAA,KAAtD;AAGD,GARD;AASD,CAZD","file":"panels.percy.js","sourcesContent":["import {TestEditor, setupGraphDiv, fixtures, plotly} from 'lib/test-utils';\n\nimport {PanelMenuWrapper} from '../components';\n\nimport * as mocks from '../../dev/percy';\nimport * as panels from '../default_panels/';\n\nimport '../../dev/styles.css';\nimport '../styles/main.scss';\nimport './percy.css';\n\n/**\n * To add more Percy tests - add a mock file to /dev/percy, add it to /dev/percy/index.js\n * To specify which panels to test with the mock, add entry to panelsToTest, else all panels will be tested\n */\nconst panelsToTest = {\n bar: ['GraphCreatePanel', 'StyleTracesPanel'],\n box: ['GraphCreatePanel', 'StyleTracesPanel'],\n pie: ['GraphCreatePanel', 'StyleTracesPanel'],\n histogram: ['GraphCreatePanel', 'StyleTracesPanel'],\n histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'],\n violin: ['GraphCreatePanel', 'StyleTracesPanel'],\n};\n\nwindow.URL.createObjectURL = function() {\n return null;\n};\n\nconst panelFixture = (Panel, group, name, figure) => {\n const gd = setupGraphDiv(figure);\n gd._context = plotly.setPlotConfig();\n gd._context.setBackground = () => {\n return null;\n };\n\n return (\n
\n \n \n \n \n \n
\n );\n};\n\nconst snapshotWidth = 500;\n\nObject.keys(mocks).forEach(m => {\n const selectedPanels = panelsToTest[m] ? panelsToTest[m] : Object.keys(panels);\n\n selectedPanels.forEach(p => {\n const words = p.split(/(?=[A-Z])/);\n const panelGroup = words[0];\n const panelName = words.slice(1, -1).join(' ');\n\n percySnapshot(`${m}_${p}`, {widths: [snapshotWidth]}, () =>\n panelFixture(panels[p], panelGroup, panelName, mocks[m])\n );\n });\n});\n"]} \ No newline at end of file diff --git a/lib/components/PanelMenuWrapper.js b/lib/components/PanelMenuWrapper.js deleted file mode 100644 index 1d208183c..000000000 --- a/lib/components/PanelMenuWrapper.js +++ /dev/null @@ -1,175 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _SidebarGroup = require('./sidebar/SidebarGroup'); - -var _SidebarGroup2 = _interopRequireDefault(_SidebarGroup); - -var _lib = require('../lib'); - -var _sortMenu = require('../lib/sortMenu'); - -var _sortMenu2 = _interopRequireDefault(_sortMenu); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PanelsWithSidebar = function (_Component) { - _inherits(PanelsWithSidebar, _Component); - - function PanelsWithSidebar(props) { - _classCallCheck(this, PanelsWithSidebar); - - var _this = _possibleConstructorReturn(this, (PanelsWithSidebar.__proto__ || Object.getPrototypeOf(PanelsWithSidebar)).call(this, props)); - - var opts = _this.computeMenuOptions(props); - var firstSidebarGroup = opts.filter(function (o) { - return o.panels; - })[0]; - - _this.state = { - group: firstSidebarGroup.name, - panel: firstSidebarGroup.panels[0] - }; - - _this.setPanel = _this.setPanel.bind(_this); - _this.renderSection = _this.renderSection.bind(_this); - return _this; - } - - _createClass(PanelsWithSidebar, [{ - key: 'setPanel', - value: function setPanel(group, panel) { - this.setState({ group: group, panel: panel }); - } - }, { - key: 'getChildContext', - value: function getChildContext() { - return { - setPanel: this.setPanel - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - return { - setPanel: this.setPanel - }; - } - }, { - key: 'renderSection', - value: function renderSection(section, i) { - if (section.type && (section.type.plotly_editor_traits || {}).sidebar_element) { - return (0, _react.cloneElement)(section, { key: i }); - } - return _react2.default.createElement(_SidebarGroup2.default, { - key: i, - selectedGroup: this.state.group, - selectedPanel: this.state.panel, - group: section.name, - panels: section.panels, - onChangeGroup: this.setPanel - }); - } - }, { - key: 'computeMenuOptions', - value: function computeMenuOptions(props) { - var children = props.children, - menuPanelOrder = props.menuPanelOrder; - - var sections = []; - var groupLookup = {}; - var groupIndex = void 0; - var panels = _react2.default.Children.toArray(children); - - if (menuPanelOrder) { - (0, _sortMenu2.default)(panels, menuPanelOrder); - } - - panels.forEach(function (child) { - if (!child) { - return; - } - var group = child.props.group; - var name = child.props.name; - - if (group && name) { - var obj = void 0; - if (groupLookup.hasOwnProperty(group)) { - groupIndex = groupLookup[group]; - obj = sections[groupIndex]; - } else { - groupLookup[group] = sections.length; - obj = { name: group, panels: [] }; - sections.push(obj); - } - obj.panels.push(name); - } - - if ((child.type.plotly_editor_traits || {}).sidebar_element) { - sections.push(child); - } - }); - - return sections; - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var menuOpts = this.computeMenuOptions(this.props); - - return _react2.default.createElement( - _context.PanelMenuWrapperContext.Provider, - { value: this.provideValue() }, - _react2.default.createElement( - 'div', - { className: (0, _lib.bem)('editor_controls', 'wrapper') }, - _react2.default.createElement( - 'div', - { className: (0, _lib.bem)('sidebar') }, - menuOpts.map(this.renderSection) - ), - _react2.default.Children.map(this.props.children, function (child, i) { - return child === null || _this2.state.group !== child.props.group || _this2.state.panel !== child.props.name ? null : (0, _react.cloneElement)(child, { key: i }); - }) - ) - ); - } - }]); - - return PanelsWithSidebar; -}(_react.Component); - -PanelsWithSidebar.propTypes = { - children: _propTypes2.default.node, - menuPanelOrder: _propTypes2.default.array -}; - -PanelsWithSidebar.childContextTypes = { - setPanel: _propTypes2.default.func -}; - -exports.default = PanelsWithSidebar; -//# sourceMappingURL=PanelMenuWrapper.js.map \ No newline at end of file diff --git a/lib/components/PanelMenuWrapper.js.map b/lib/components/PanelMenuWrapper.js.map deleted file mode 100644 index 247b8b863..000000000 --- a/lib/components/PanelMenuWrapper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/components/PanelMenuWrapper.js"],"names":["PanelsWithSidebar","props","opts","computeMenuOptions","firstSidebarGroup","filter","o","panels","state","group","name","panel","setPanel","bind","renderSection","setState","section","i","type","plotly_editor_traits","sidebar_element","key","children","menuPanelOrder","sections","groupLookup","groupIndex","React","Children","toArray","forEach","child","obj","hasOwnProperty","length","push","menuOpts","provideValue","map","Component","propTypes","PropTypes","node","array","childContextTypes","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;;;;;;;IAEMA,iB;;;AACJ,6BAAYC,KAAZ,EAAmB;AAAA;;AAAA,sIACXA,KADW;;AAGjB,QAAMC,OAAO,MAAKC,kBAAL,CAAwBF,KAAxB,CAAb;AACA,QAAMG,oBAAoBF,KAAKG,MAAL,CAAY;AAAA,aAAKC,EAAEC,MAAP;AAAA,KAAZ,EAA2B,CAA3B,CAA1B;;AAEA,UAAKC,KAAL,GAAa;AACXC,aAAOL,kBAAkBM,IADd;AAEXC,aAAOP,kBAAkBG,MAAlB,CAAyB,CAAzB;AAFI,KAAb;;AAKA,UAAKK,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AACA,UAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBD,IAAnB,OAArB;AAZiB;AAalB;;;;6BAEQJ,K,EAAOE,K,EAAO;AACrB,WAAKI,QAAL,CAAc,EAACN,YAAD,EAAQE,YAAR,EAAd;AACD;;;sCAEiB;AAChB,aAAO;AACLC,kBAAU,KAAKA;AADV,OAAP;AAGD;;;mCAEc;AACb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Wrapper.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {cloneElement, Component} from 'react';\nimport SidebarGroup from './sidebar/SidebarGroup';\nimport {bem} from 'lib';\nimport sortMenu from 'lib/sortMenu';\nimport {PanelMenuWrapperContext} from '../context';\n\nclass PanelsWithSidebar extends Component {\n constructor(props) {\n super(props);\n\n const opts = this.computeMenuOptions(props);\n const firstSidebarGroup = opts.filter(o => o.panels)[0];\n\n this.state = {\n group: firstSidebarGroup.name,\n panel: firstSidebarGroup.panels[0],\n };\n\n this.setPanel = this.setPanel.bind(this);\n this.renderSection = this.renderSection.bind(this);\n }\n\n setPanel(group, panel) {\n this.setState({group, panel});\n }\n\n getChildContext() {\n return {\n setPanel: this.setPanel,\n };\n }\n\n provideValue() {\n return {\n setPanel: this.setPanel,\n };\n }\n\n renderSection(section, i) {\n if (section.type && (section.type.plotly_editor_traits || {}).sidebar_element) {\n return cloneElement(section, {key: i});\n }\n return (\n \n );\n }\n\n computeMenuOptions(props) {\n const {children, menuPanelOrder} = props;\n const sections = [];\n const groupLookup = {};\n let groupIndex;\n const panels = React.Children.toArray(children);\n\n if (menuPanelOrder) {\n sortMenu(panels, menuPanelOrder);\n }\n\n panels.forEach(child => {\n if (!child) {\n return;\n }\n const group = child.props.group;\n const name = child.props.name;\n\n if (group && name) {\n let obj;\n if (groupLookup.hasOwnProperty(group)) {\n groupIndex = groupLookup[group];\n obj = sections[groupIndex];\n } else {\n groupLookup[group] = sections.length;\n obj = {name: group, panels: []};\n sections.push(obj);\n }\n obj.panels.push(name);\n }\n\n if ((child.type.plotly_editor_traits || {}).sidebar_element) {\n sections.push(child);\n }\n });\n\n return sections;\n }\n\n render() {\n const menuOpts = this.computeMenuOptions(this.props);\n\n return (\n \n
\n
{menuOpts.map(this.renderSection)}
\n {React.Children.map(\n this.props.children,\n (child, i) =>\n child === null ||\n this.state.group !== child.props.group ||\n this.state.panel !== child.props.name\n ? null\n : cloneElement(child, {key: i})\n )}\n
\n
\n );\n }\n}\n\nPanelsWithSidebar.propTypes = {\n children: PropTypes.node,\n menuPanelOrder: PropTypes.array,\n};\n\nPanelsWithSidebar.childContextTypes = {\n setPanel: PropTypes.func,\n};\n\nexport default PanelsWithSidebar;\n"]} \ No newline at end of file diff --git a/lib/components/containers/AnnotationAccordion.js b/lib/components/containers/AnnotationAccordion.js deleted file mode 100644 index a57077f07..000000000 --- a/lib/components/containers/AnnotationAccordion.js +++ /dev/null @@ -1,124 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _derived = require('./derived'); - -var _PanelEmpty = require('./PanelEmpty'); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _context2 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var AnnotationFold = (0, _lib.connectAnnotationToLayout)(_PlotlyFold2.default); - -var AnnotationAccordion = function (_Component) { - _inherits(AnnotationAccordion, _Component); - - function AnnotationAccordion() { - _classCallCheck(this, AnnotationAccordion); - - return _possibleConstructorReturn(this, (AnnotationAccordion.__proto__ || Object.getPrototypeOf(AnnotationAccordion)).apply(this, arguments)); - } - - _createClass(AnnotationAccordion, [{ - key: 'render', - value: function render() { - var _context = this.context, - _context$layout$annot = _context.layout.annotations, - annotations = _context$layout$annot === undefined ? [] : _context$layout$annot, - _ = _context.localize; - var _props = this.props, - canAdd = _props.canAdd, - children = _props.children; - - - var content = annotations.length && annotations.map(function (ann, i) { - return _react2.default.createElement( - AnnotationFold, - { key: i, annotationIndex: i, name: ann.text, canDelete: canAdd }, - children - ); - }); - - var addAction = { - label: _('Annotation'), - handler: function handler(_ref) { - var layout = _ref.layout, - updateContainer = _ref.updateContainer; - - var annotationIndex = void 0; - if (Array.isArray(layout.annotations)) { - annotationIndex = layout.annotations.length; - } else { - annotationIndex = 0; - } - - var key = 'annotations[' + annotationIndex + ']'; - var value = { text: _('new text') }; - - if (updateContainer) { - updateContainer(_defineProperty({}, key, value)); - } - } - }; - - return _react2.default.createElement( - _derived.LayoutPanel, - { addAction: canAdd ? addAction : null }, - content ? content : _react2.default.createElement( - _PanelEmpty.PanelMessage, - { heading: _('Call out your data.') }, - _react2.default.createElement( - 'p', - null, - _('Annotations are text and arrows you can use to point out specific parts of your figure.') - ), - _react2.default.createElement( - 'p', - null, - _('Click on the + button above to add an annotation.') - ) - ) - ); - } - }]); - - return AnnotationAccordion; -}(_react.Component); - -AnnotationAccordion.contextType = _context2.EditorControlsContext; - -AnnotationAccordion.propTypes = { - children: _propTypes2.default.node, - canAdd: _propTypes2.default.bool -}; - -exports.default = AnnotationAccordion; -//# sourceMappingURL=AnnotationAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/AnnotationAccordion.js.map b/lib/components/containers/AnnotationAccordion.js.map deleted file mode 100644 index a7ee33a43..000000000 --- a/lib/components/containers/AnnotationAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/AnnotationAccordion.js"],"names":["AnnotationFold","PlotlyFold","AnnotationAccordion","context","layout","annotations","_","localize","props","canAdd","children","content","length","map","ann","i","text","addAction","label","handler","updateContainer","annotationIndex","Array","isArray","key","value","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;AACA;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,iBAAiB,oCAA0BC,oBAA1B,CAAvB;;IAEMC,mB;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,MAFK,CAEIC,WAFJ;AAAA,UAEIA,WAFJ,yCAEkB,EAFlB;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,mBAKoB,KAAKC,KALzB;AAAA,UAKAC,MALA,UAKAA,MALA;AAAA,UAKQC,QALR,UAKQA,QALR;;;AAOP,UAAMC,UACJN,YAAYO,MAAZ,IACAP,YAAYQ,GAAZ,CAAgB,UAACC,GAAD,EAAMC,CAAN;AAAA,eACd;AAAC,wBAAD;AAAA,YAAgB,KAAKA,CAArB,EAAwB,iBAAiBA,CAAzC,EAA4C,MAAMD,IAAIE,IAAtD,EAA4D,WAAWP,MAAvE;AACGC;AADH,SADc;AAAA,OAAhB,CAFF;;AAQA,UAAMO,YAAY;AAChBC,eAAOZ,EAAE,YAAF,CADS;AAEhBa,iBAAS,uBAA+B;AAAA,cAA7Bf,MAA6B,QAA7BA,MAA6B;AAAA,cAArBgB,eAAqB,QAArBA,eAAqB;;AACtC,cAAIC,wBAAJ;AACA,cAAIC,MAAMC,OAAN,CAAcnB,OAAOC,WAArB,CAAJ,EAAuC;AACrCgB,8BAAkBjB,OAAOC,WAAP,CAAmBO,MAArC;AACD,WAFD,MAEO;AACLS,8BAAkB,CAAlB;AACD;;AAED,cAAMG,uBAAqBH,eAArB,MAAN;AACA,cAAMI,QAAQ,EAACT,MAAMV,EAAE,UAAF,CAAP,EAAd;;AAEA,cAAIc,eAAJ,EAAqB;AACnBA,gDAAkBI,GAAlB,EAAwBC,KAAxB;AACD;AACF;AAhBe,OAAlB;;AAmBA,aACE;AAAC,4BAAD;AAAA,UAAa,WAAWhB,SAASQ,SAAT,GAAqB,IAA7C;AACGN,kBACCA,OADD,GAGC;AAAC,kCAAD;AAAA,YAAc,SAASL,EAAE,qBAAF,CAAvB;AACE;AAAA;AAAA;AACGA,cACC,yFADD;AADH,WADF;AAME;AAAA;AAAA;AAAIA,cAAE,mDAAF;AAAJ;AANF;AAJJ,OADF;AAgBD;;;;EAnD+BoB,gB;;AAsDlCxB,oBAAoByB,WAApB,GAAkCC,+BAAlC;;AAEA1B,oBAAoB2B,SAApB,GAAgC;AAC9BnB,YAAUoB,oBAAUC,IADU;AAE9BtB,UAAQqB,oBAAUE;AAFY,CAAhC;;kBAKe9B,mB","file":"AnnotationAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport {LayoutPanel} from './derived';\nimport {PanelMessage} from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectAnnotationToLayout} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst AnnotationFold = connectAnnotationToLayout(PlotlyFold);\n\nclass AnnotationAccordion extends Component {\n render() {\n const {\n layout: {annotations = []},\n localize: _,\n } = this.context;\n const {canAdd, children} = this.props;\n\n const content =\n annotations.length &&\n annotations.map((ann, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Annotation'),\n handler: ({layout, updateContainer}) => {\n let annotationIndex;\n if (Array.isArray(layout.annotations)) {\n annotationIndex = layout.annotations.length;\n } else {\n annotationIndex = 0;\n }\n\n const key = `annotations[${annotationIndex}]`;\n const value = {text: _('new text')};\n\n if (updateContainer) {\n updateContainer({[key]: value});\n }\n },\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n

\n {_(\n 'Annotations are text and arrows you can use to point out specific parts of your figure.'\n )}\n

\n

{_('Click on the + button above to add an annotation.')}

\n
\n )}\n
\n );\n }\n}\n\nAnnotationAccordion.contextType = EditorControlsContext;\n\nAnnotationAccordion.propTypes = {\n children: PropTypes.node,\n canAdd: PropTypes.bool,\n};\n\nexport default AnnotationAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/AxesFold.js b/lib/components/containers/AxesFold.js deleted file mode 100644 index 5b61dbc47..000000000 --- a/lib/components/containers/AxesFold.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _AxesSelector = require('../fields/AxesSelector'); - -var _AxesSelector2 = _interopRequireDefault(_AxesSelector); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var AxesFold = function (_Component) { - _inherits(AxesFold, _Component); - - function AxesFold() { - _classCallCheck(this, AxesFold); - - return _possibleConstructorReturn(this, (AxesFold.__proto__ || Object.getPrototypeOf(AxesFold)).apply(this, arguments)); - } - - _createClass(AxesFold, [{ - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - options = _props.options; - - return options.length && children ? _react2.default.createElement( - _PlotlyFold2.default, - this.props, - options.length === 1 ? null : _react2.default.createElement(_AxesSelector2.default, { axesOptions: options }), - children - ) : null; - } - }]); - - return AxesFold; -}(_react.Component); - -AxesFold.propTypes = { - children: _propTypes2.default.any, - options: _propTypes2.default.array -}; - -AxesFold.plotly_editor_traits = { foldable: true }; - -exports.default = (0, _lib.connectAxesToLayout)(AxesFold); -//# sourceMappingURL=AxesFold.js.map \ No newline at end of file diff --git a/lib/components/containers/AxesFold.js.map b/lib/components/containers/AxesFold.js.map deleted file mode 100644 index cb19f66fe..000000000 --- a/lib/components/containers/AxesFold.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/AxesFold.js"],"names":["AxesFold","props","children","options","length","Component","propTypes","PropTypes","any","array","plotly_editor_traits","foldable"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Q;;;;;;;;;;;6BACK;AAAA,mBACqB,KAAKC,KAD1B;AAAA,UACAC,QADA,UACAA,QADA;AAAA,UACUC,OADV,UACUA,OADV;;AAEP,aAAOA,QAAQC,MAAR,IAAkBF,QAAlB,GACL;AAAC,4BAAD;AAAgB,aAAKD,KAArB;AACGE,gBAAQC,MAAR,KAAmB,CAAnB,GAAuB,IAAvB,GAA8B,8BAAC,sBAAD,IAAc,aAAaD,OAA3B,GADjC;AAEGD;AAFH,OADK,GAKH,IALJ;AAMD;;;;EAToBG,gB;;AAYvBL,SAASM,SAAT,GAAqB;AACnBJ,YAAUK,oBAAUC,GADD;AAEnBL,WAASI,oBAAUE;AAFA,CAArB;;AAKAT,SAASU,oBAAT,GAAgC,EAACC,UAAU,IAAX,EAAhC;;kBAEe,8BAAoBX,QAApB,C","file":"AxesFold.js","sourcesContent":["import AxesSelector from '../fields/AxesSelector';\nimport PlotlyFold from './PlotlyFold';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectAxesToLayout} from 'lib';\n\nclass AxesFold extends Component {\n render() {\n const {children, options} = this.props;\n return options.length && children ? (\n \n {options.length === 1 ? null : }\n {children}\n \n ) : null;\n }\n}\n\nAxesFold.propTypes = {\n children: PropTypes.any,\n options: PropTypes.array,\n};\n\nAxesFold.plotly_editor_traits = {foldable: true};\n\nexport default connectAxesToLayout(AxesFold);\n"]} \ No newline at end of file diff --git a/lib/components/containers/FoldEmpty.js b/lib/components/containers/FoldEmpty.js deleted file mode 100644 index 962fc48ad..000000000 --- a/lib/components/containers/FoldEmpty.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var FoldEmpty = function (_Component) { - _inherits(FoldEmpty, _Component); - - function FoldEmpty() { - _classCallCheck(this, FoldEmpty); - - return _possibleConstructorReturn(this, (FoldEmpty.__proto__ || Object.getPrototypeOf(FoldEmpty)).apply(this, arguments)); - } - - _createClass(FoldEmpty, [{ - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - Icon = _props.icon, - messagePrimary = _props.messagePrimary, - messageSecondary = _props.messageSecondary; - - - return _react2.default.createElement( - 'div', - { className: 'fold__content__empty' }, - Icon ? _react2.default.createElement( - 'div', - { className: 'fold__content__empty__icon' }, - _react2.default.createElement(Icon, null) - ) : null, - messagePrimary ? _react2.default.createElement( - 'div', - { className: 'fold__content__empty__message__primary' }, - messagePrimary - ) : null, - messageSecondary ? _react2.default.createElement( - 'div', - { className: 'fold__content__empty__message__secondary' }, - messageSecondary - ) : null, - children ? children : null - ); - } - }]); - - return FoldEmpty; -}(_react.Component); - -exports.default = FoldEmpty; - - -FoldEmpty.propTypes = { - messagePrimary: _propTypes2.default.string, - messageSecondary: _propTypes2.default.string, - children: _propTypes2.default.node, - icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) -}; -//# sourceMappingURL=FoldEmpty.js.map \ No newline at end of file diff --git a/lib/components/containers/FoldEmpty.js.map b/lib/components/containers/FoldEmpty.js.map deleted file mode 100644 index d19b2b15e..000000000 --- a/lib/components/containers/FoldEmpty.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/FoldEmpty.js"],"names":["FoldEmpty","props","children","Icon","icon","messagePrimary","messageSecondary","Component","propTypes","PropTypes","string","node","oneOfType","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,S;;;;;;;;;;;6BACV;AAAA,mBAC0D,KAAKC,KAD/D;AAAA,UACAC,QADA,UACAA,QADA;AAAA,UACgBC,IADhB,UACUC,IADV;AAAA,UACsBC,cADtB,UACsBA,cADtB;AAAA,UACsCC,gBADtC,UACsCA,gBADtC;;;AAGP,aACE;AAAA;AAAA,UAAK,WAAU,sBAAf;AACGH,eACC;AAAA;AAAA,YAAK,WAAU,4BAAf;AACE,wCAAC,IAAD;AADF,SADD,GAIG,IALN;AAMGE,yBACC;AAAA;AAAA,YAAK,WAAU,wCAAf;AAAyDA;AAAzD,SADD,GAEG,IARN;AASGC,2BACC;AAAA;AAAA,YAAK,WAAU,0CAAf;AAA2DA;AAA3D,SADD,GAEG,IAXN;AAYGJ,mBAAWA,QAAX,GAAsB;AAZzB,OADF;AAgBD;;;;EApBoCK,gB;;kBAAlBP,S;;;AAuBrBA,UAAUQ,SAAV,GAAsB;AACpBH,kBAAgBI,oBAAUC,MADN;AAEpBJ,oBAAkBG,oBAAUC,MAFR;AAGpBR,YAAUO,oBAAUE,IAHA;AAIpBP,QAAMK,oBAAUG,SAAV,CAAoB,CAACH,oBAAUE,IAAX,EAAiBF,oBAAUI,IAA3B,CAApB;AAJc,CAAtB","file":"FoldEmpty.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nexport default class FoldEmpty extends Component {\n render() {\n const {children, icon: Icon, messagePrimary, messageSecondary} = this.props;\n\n return (\n
\n {Icon ? (\n
\n \n
\n ) : null}\n {messagePrimary ? (\n
{messagePrimary}
\n ) : null}\n {messageSecondary ? (\n
{messageSecondary}
\n ) : null}\n {children ? children : null}\n
\n );\n }\n}\n\nFoldEmpty.propTypes = {\n messagePrimary: PropTypes.string,\n messageSecondary: PropTypes.string,\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/ImageAccordion.js b/lib/components/containers/ImageAccordion.js deleted file mode 100644 index b7e0973c2..000000000 --- a/lib/components/containers/ImageAccordion.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _derived = require('./derived'); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _PanelEmpty = require('./PanelEmpty'); - -var _context2 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ImageFold = (0, _lib.connectImageToLayout)(_PlotlyFold2.default); - -var ImageAccordion = function (_Component) { - _inherits(ImageAccordion, _Component); - - function ImageAccordion() { - _classCallCheck(this, ImageAccordion); - - return _possibleConstructorReturn(this, (ImageAccordion.__proto__ || Object.getPrototypeOf(ImageAccordion)).apply(this, arguments)); - } - - _createClass(ImageAccordion, [{ - key: 'render', - value: function render() { - var _context = this.context, - _context$layout$image = _context.layout.images, - images = _context$layout$image === undefined ? [] : _context$layout$image, - _ = _context.localize; - var _props = this.props, - canAdd = _props.canAdd, - children = _props.children; - - - var content = images.length && images.map(function (img, i) { - return _react2.default.createElement( - ImageFold, - { key: i, imageIndex: i, name: _('Image') + ' ' + (i + 1), canDelete: canAdd }, - children - ); - }); - - var addAction = { - label: _('Image'), - handler: function handler(_ref) { - var layout = _ref.layout, - updateContainer = _ref.updateContainer; - - var imageIndex = void 0; - if (Array.isArray(layout.images)) { - imageIndex = layout.images.length; - } else { - imageIndex = 0; - } - - var key = 'images[' + imageIndex + ']'; - var value = { - sizex: 0.1, - sizey: 0.1, - x: 0.5, - y: 0.5 - }; - - if (updateContainer) { - updateContainer(_defineProperty({}, key, value)); - } - } - }; - - return _react2.default.createElement( - _derived.LayoutPanel, - { addAction: canAdd ? addAction : null }, - content ? content : _react2.default.createElement( - _PanelEmpty.PanelMessage, - { heading: _('Logos, watermarks and more.') }, - _react2.default.createElement( - 'p', - null, - _('Embed images in your figure to make the data more readable or to brand your content.') - ), - _react2.default.createElement( - 'p', - null, - _('Click on the + button above to add an image.') - ) - ) - ); - } - }]); - - return ImageAccordion; -}(_react.Component); - -ImageAccordion.contextType = _context2.EditorControlsContext; - -ImageAccordion.propTypes = { - children: _propTypes2.default.node, - canAdd: _propTypes2.default.bool -}; - -exports.default = ImageAccordion; -//# sourceMappingURL=ImageAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/ImageAccordion.js.map b/lib/components/containers/ImageAccordion.js.map deleted file mode 100644 index 0160d8456..000000000 --- a/lib/components/containers/ImageAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/ImageAccordion.js"],"names":["ImageFold","PlotlyFold","ImageAccordion","context","layout","images","_","localize","props","canAdd","children","content","length","map","img","i","addAction","label","handler","updateContainer","imageIndex","Array","isArray","key","value","sizex","sizey","x","y","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,YAAY,+BAAqBC,oBAArB,CAAlB;;IAEMC,c;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,MAFK,CAEIC,MAFJ;AAAA,UAEIA,MAFJ,yCAEa,EAFb;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,mBAKoB,KAAKC,KALzB;AAAA,UAKAC,MALA,UAKAA,MALA;AAAA,UAKQC,QALR,UAKQA,QALR;;;AAOP,UAAMC,UACJN,OAAOO,MAAP,IACAP,OAAOQ,GAAP,CAAW,UAACC,GAAD,EAAMC,CAAN;AAAA,eACT;AAAC,mBAAD;AAAA,YAAW,KAAKA,CAAhB,EAAmB,YAAYA,CAA/B,EAAkC,MAAST,EAAE,OAAF,CAAT,UAAuBS,IAAI,CAA3B,CAAlC,EAAkE,WAAWN,MAA7E;AACGC;AADH,SADS;AAAA,OAAX,CAFF;;AAQA,UAAMM,YAAY;AAChBC,eAAOX,EAAE,OAAF,CADS;AAEhBY,iBAAS,uBAA+B;AAAA,cAA7Bd,MAA6B,QAA7BA,MAA6B;AAAA,cAArBe,eAAqB,QAArBA,eAAqB;;AACtC,cAAIC,mBAAJ;AACA,cAAIC,MAAMC,OAAN,CAAclB,OAAOC,MAArB,CAAJ,EAAkC;AAChCe,yBAAahB,OAAOC,MAAP,CAAcO,MAA3B;AACD,WAFD,MAEO;AACLQ,yBAAa,CAAb;AACD;;AAED,cAAMG,kBAAgBH,UAAhB,MAAN;AACA,cAAMI,QAAQ;AACZC,mBAAO,GADK;AAEZC,mBAAO,GAFK;AAGZC,eAAG,GAHS;AAIZC,eAAG;AAJS,WAAd;;AAOA,cAAIT,eAAJ,EAAqB;AACnBA,gDAAkBI,GAAlB,EAAwBC,KAAxB;AACD;AACF;AArBe,OAAlB;;AAwBA,aACE;AAAC,4BAAD;AAAA,UAAa,WAAWf,SAASO,SAAT,GAAqB,IAA7C;AACGL,kBACCA,OADD,GAGC;AAAC,kCAAD;AAAA,YAAc,SAASL,EAAE,6BAAF,CAAvB;AACE;AAAA;AAAA;AACGA,cACC,sFADD;AADH,WADF;AAME;AAAA;AAAA;AAAIA,cAAE,8CAAF;AAAJ;AANF;AAJJ,OADF;AAgBD;;;;EAxD0BuB,gB;;AA2D7B3B,eAAe4B,WAAf,GAA6BC,+BAA7B;;AAEA7B,eAAe8B,SAAf,GAA2B;AACzBtB,YAAUuB,oBAAUC,IADK;AAEzBzB,UAAQwB,oBAAUE;AAFO,CAA3B;;kBAKejC,c","file":"ImageAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport {LayoutPanel} from './derived';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectImageToLayout} from 'lib';\nimport {PanelMessage} from './PanelEmpty';\nimport {EditorControlsContext} from '../../context';\n\nconst ImageFold = connectImageToLayout(PlotlyFold);\n\nclass ImageAccordion extends Component {\n render() {\n const {\n layout: {images = []},\n localize: _,\n } = this.context;\n const {canAdd, children} = this.props;\n\n const content =\n images.length &&\n images.map((img, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Image'),\n handler: ({layout, updateContainer}) => {\n let imageIndex;\n if (Array.isArray(layout.images)) {\n imageIndex = layout.images.length;\n } else {\n imageIndex = 0;\n }\n\n const key = `images[${imageIndex}]`;\n const value = {\n sizex: 0.1,\n sizey: 0.1,\n x: 0.5,\n y: 0.5,\n };\n\n if (updateContainer) {\n updateContainer({[key]: value});\n }\n },\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n

\n {_(\n 'Embed images in your figure to make the data more readable or to brand your content.'\n )}\n

\n

{_('Click on the + button above to add an image.')}

\n
\n )}\n
\n );\n }\n}\n\nImageAccordion.contextType = EditorControlsContext;\n\nImageAccordion.propTypes = {\n children: PropTypes.node,\n canAdd: PropTypes.bool,\n};\n\nexport default ImageAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/MenuPanel.js b/lib/components/containers/MenuPanel.js deleted file mode 100644 index 52412656a..000000000 --- a/lib/components/containers/MenuPanel.js +++ /dev/null @@ -1,137 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _ModalBox = require('./ModalBox'); - -var _ModalBox2 = _interopRequireDefault(_ModalBox); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _plotlyIcons = require('plotly-icons'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var MenuPanel = function (_Component) { - _inherits(MenuPanel, _Component); - - function MenuPanel() { - _classCallCheck(this, MenuPanel); - - var _this = _possibleConstructorReturn(this, (MenuPanel.__proto__ || Object.getPrototypeOf(MenuPanel)).call(this)); - - _this.state = { isOpen: false }; - - _this.togglePanel = _this.togglePanel.bind(_this); - return _this; - } - - _createClass(MenuPanel, [{ - key: 'getIcon', - value: function getIcon() { - var _props = this.props, - question = _props.question, - Icon = _props.icon; - - if (question) { - return { - icon: _react2.default.createElement(_plotlyIcons.QuestionIcon, { className: 'menupanel__icon' }), - spanClass: 'menupanel__icon-span menupanel__icon-span--question' - }; - } - if (Icon) { - return { - icon: _react2.default.createElement(Icon, { className: 'menupanel__icon' }), - spanClass: 'menupanel__icon-span' - }; - } - return { - icon: _react2.default.createElement(_plotlyIcons.CogIcon, { className: 'menupanel__icon' }), - spanClass: 'menupanel__icon-span menupanel__icon-span--cog' - }; - } - }, { - key: 'togglePanel', - value: function togglePanel() { - this.setState({ isOpen: !this.state.isOpen }); - } - }, { - key: 'render', - value: function render() { - var _props2 = this.props, - show = _props2.show, - ownline = _props2.ownline, - label = _props2.label, - children = _props2.children; - - var isOpen = show || this.state.isOpen; - - var containerClass = (0, _classnames2.default)('menupanel', { - 'menupanel--ownline': ownline - }); - - var _getIcon = this.getIcon(), - icon = _getIcon.icon, - spanClass = _getIcon.spanClass; - - return _react2.default.createElement( - 'div', - { className: containerClass }, - _react2.default.createElement( - 'div', - { className: spanClass }, - _react2.default.createElement( - 'div', - { className: 'menupanel__label' }, - label - ), - _react2.default.createElement( - 'div', - { className: 'menupanel__icon__wrapper', onClick: this.togglePanel }, - icon - ) - ), - isOpen && _react2.default.createElement( - _ModalBox2.default, - { onClose: this.togglePanel }, - children - ) - ); - } - }]); - - return MenuPanel; -}(_react.Component); - -exports.default = MenuPanel; - - -MenuPanel.propTypes = { - children: _propTypes2.default.node, - icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), - label: _propTypes2.default.string, - ownline: _propTypes2.default.bool, - question: _propTypes2.default.bool, - show: _propTypes2.default.bool -}; -//# sourceMappingURL=MenuPanel.js.map \ No newline at end of file diff --git a/lib/components/containers/MenuPanel.js.map b/lib/components/containers/MenuPanel.js.map deleted file mode 100644 index 56acaf624..000000000 --- a/lib/components/containers/MenuPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/MenuPanel.js"],"names":["MenuPanel","state","isOpen","togglePanel","bind","props","question","Icon","icon","spanClass","setState","show","ownline","label","children","containerClass","getIcon","Component","propTypes","PropTypes","node","oneOfType","func","string","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEqBA,S;;;AACnB,uBAAc;AAAA;;AAAA;;AAEZ,UAAKC,KAAL,GAAa,EAACC,QAAQ,KAAT,EAAb;;AAEA,UAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AAJY;AAKb;;;;8BAES;AAAA,mBACuB,KAAKC,KAD5B;AAAA,UACDC,QADC,UACDA,QADC;AAAA,UACeC,IADf,UACSC,IADT;;AAER,UAAIF,QAAJ,EAAc;AACZ,eAAO;AACLE,gBAAM,8BAAC,yBAAD,IAAc,WAAU,iBAAxB,GADD;AAELC;AAFK,SAAP;AAID;AACD,UAAIF,IAAJ,EAAU;AACR,eAAO;AACLC,gBAAM,8BAAC,IAAD,IAAM,WAAU,iBAAhB,GADD;AAELC;AAFK,SAAP;AAID;AACD,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alBox';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport classnames from 'classnames';\nimport {QuestionIcon, CogIcon} from 'plotly-icons';\n\nexport default class MenuPanel extends Component {\n constructor() {\n super();\n this.state = {isOpen: false};\n\n this.togglePanel = this.togglePanel.bind(this);\n }\n\n getIcon() {\n const {question, icon: Icon} = this.props;\n if (question) {\n return {\n icon: ,\n spanClass: `menupanel__icon-span menupanel__icon-span--question`,\n };\n }\n if (Icon) {\n return {\n icon: ,\n spanClass: `menupanel__icon-span`,\n };\n }\n return {\n icon: ,\n spanClass: 'menupanel__icon-span menupanel__icon-span--cog',\n };\n }\n\n togglePanel() {\n this.setState({isOpen: !this.state.isOpen});\n }\n\n render() {\n const {show, ownline, label, children} = this.props;\n const isOpen = show || this.state.isOpen;\n\n const containerClass = classnames('menupanel', {\n 'menupanel--ownline': ownline,\n });\n\n const {icon, spanClass} = this.getIcon();\n\n return (\n
\n
\n
{label}
\n
\n {icon}\n
\n
\n {isOpen && {children}}\n
\n );\n }\n}\n\nMenuPanel.propTypes = {\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n label: PropTypes.string,\n ownline: PropTypes.bool,\n question: PropTypes.bool,\n show: PropTypes.bool,\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/Modal.js b/lib/components/containers/Modal.js deleted file mode 100644 index 45359b0d3..000000000 --- a/lib/components/containers/Modal.js +++ /dev/null @@ -1,147 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ModalContent = exports.ModalHeader = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _plotlyIcons = require('plotly-icons'); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ModalHeader = function ModalHeader(_ref) { - var title = _ref.title, - handleClose = _ref.handleClose; - return _react2.default.createElement( - 'div', - { className: 'modal__header' }, - title ? _react2.default.createElement( - 'div', - { className: 'modal__header__title' }, - title - ) : null, - handleClose ? _react2.default.createElement( - 'div', - { className: 'modal__header__close', onClick: handleClose ? function () { - return handleClose(); - } : null }, - _react2.default.createElement(_plotlyIcons.CloseIcon, null) - ) : null - ); -}; - -var ModalContent = function ModalContent(_ref2) { - var children = _ref2.children; - return _react2.default.createElement( - 'div', - { className: 'modal__content' }, - children - ); -}; - -var Modal = function (_Component) { - _inherits(Modal, _Component); - - function Modal(props) { - _classCallCheck(this, Modal); - - var _this = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, props)); - - _this.escFunction = _this.escFunction.bind(_this); - return _this; - } - - _createClass(Modal, [{ - key: 'escFunction', - value: function escFunction(event) { - var escKeyCode = 27; - if (event.keyCode === escKeyCode) { - this.context.handleClose(); - } - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - document.addEventListener('keydown', this.escFunction, false); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - document.removeEventListener('keydown', this.escFunction, false); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props = this.props, - children = _props.children, - title = _props.title; - - var classes = 'modal'; - if (this.context.isAnimatingOut) { - classes += ' modal--animate-out'; - } - return _react2.default.createElement( - 'div', - { className: classes }, - _react2.default.createElement( - 'div', - { className: 'modal__card' }, - _react2.default.createElement(ModalHeader, { title: title, handleClose: function handleClose() { - return _this2.context.handleClose(); - } }), - _react2.default.createElement( - ModalContent, - null, - children - ) - ), - _react2.default.createElement('div', { className: 'modal__backdrop', onClick: function onClick() { - return _this2.context.handleClose(); - } }) - ); - } - }]); - - return Modal; -}(_react.Component); - -ModalHeader.propTypes = { - title: _propTypes2.default.node, - handleClose: _propTypes2.default.func.isRequired -}; - -ModalContent.propTypes = { - children: _propTypes2.default.node.isRequired -}; - -Modal.propTypes = { - children: _propTypes2.default.node.isRequired, - title: _propTypes2.default.node -}; - -Modal.contextType = _context.ModalProviderContext; - -exports.default = Modal; -exports.ModalHeader = ModalHeader; -exports.ModalContent = ModalContent; -//# sourceMappingURL=Modal.js.map \ No newline at end of file diff --git a/lib/components/containers/Modal.js.map b/lib/components/containers/Modal.js.map deleted file mode 100644 index c1c99e8f8..000000000 --- a/lib/components/containers/Modal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/Modal.js"],"names":["ModalHeader","title","handleClose","ModalContent","children","Modal","props","escFunction","bind","event","escKeyCode","keyCode","context","document","addEventListener","removeEventListener","classes","isAnimatingOut","Component","propTypes","PropTypes","node","func","isRequired","contextType","ModalProviderContext"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,cAAc,SAAdA,WAAc;AAAA,MAAEC,KAAF,QAAEA,KAAF;AAAA,MAASC,WAAT,QAASA,WAAT;AAAA,SAClB;AAAA;AAAA,MA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EAAN;AAAA,aAAxC,GADF;AAEE;AAAC,wBAAD;AAAA;AAAeE;AAAf;AAFF,SADF;AAKE,+CAAK,WAAU,iBAAf,EAAiC,SAAS;AAAA,mBAAM,OAAKQ,OAAL,CAAaV,WAAb,EAAN;AAAA,WAA1C;AALF,OADF;AASD;;;;EApCiBgB,gB;;AAuCpBlB,YAAYmB,SAAZ,GAAwB;AACtBlB,SAAOmB,oBAAUC,IADK;AAEtBnB,eAAakB,oBAAUE,IAAV,CAAeC;AAFN,CAAxB;;AAKApB,aAAagB,SAAb,GAAyB;AACvBf,YAAUgB,oBAAUC,IAAV,CAAeE;AADF,CAAzB;;AAIAlB,MAAMc,SAAN,GAAkB;AAChBf,YAAUgB,oBAAUC,IAAV,CAAeE,UADT;AAEhBtB,SAAOmB,oBAAUC;AAFD,CAAlB;;AAKAhB,MAAMmB,WAAN,GAAoBC,6BAApB;;kBAEepB,K;QAEPL,W,GAAAA,W;QAAaG,Y,GAAAA,Y","file":"Modal.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {CloseIcon} from 'plotly-icons';\nimport {ModalProviderContext} from '../../context';\n\nconst ModalHeader = ({title, handleClose}) => (\n
\n {title ?
{title}
: null}\n {handleClose ? (\n
handleClose() : null}>\n \n
\n ) : null}\n
\n);\n\nconst ModalContent = ({children}) =>
{children}
;\n\nclass Modal extends Component {\n constructor(props) {\n super(props);\n this.escFunction = this.escFunction.bind(this);\n }\n\n escFunction(event) {\n const escKeyCode = 27;\n if (event.keyCode === escKeyCode) {\n this.context.handleClose();\n }\n }\n\n componentDidMount() {\n document.addEventListener('keydown', this.escFunction, false);\n }\n\n componentWillUnmount() {\n document.removeEventListener('keydown', this.escFunction, false);\n }\n\n render() {\n const {children, title} = this.props;\n let classes = 'modal';\n if (this.context.isAnimatingOut) {\n classes += ' modal--animate-out';\n }\n return (\n
\n
\n this.context.handleClose()} />\n {children}\n
\n
this.context.handleClose()} />\n
\n );\n }\n}\n\nModalHeader.propTypes = {\n title: PropTypes.node,\n handleClose: PropTypes.func.isRequired,\n};\n\nModalContent.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nModal.propTypes = {\n children: PropTypes.node.isRequired,\n title: PropTypes.node,\n};\n\nModal.contextType = ModalProviderContext;\n\nexport default Modal;\n\nexport {ModalHeader, ModalContent};\n"]} \ No newline at end of file diff --git a/lib/components/containers/ModalBox.js b/lib/components/containers/ModalBox.js deleted file mode 100644 index 8ddb13de9..000000000 --- a/lib/components/containers/ModalBox.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ModalBox = function (_Component) { - _inherits(ModalBox, _Component); - - function ModalBox() { - _classCallCheck(this, ModalBox); - - return _possibleConstructorReturn(this, (ModalBox.__proto__ || Object.getPrototypeOf(ModalBox)).apply(this, arguments)); - } - - _createClass(ModalBox, [{ - key: 'render', - value: function render() { - var _props = this.props, - backgroundDark = _props.backgroundDark, - children = _props.children, - onClose = _props.onClose, - relative = _props.relative; - - var modalboxClass = (0, _classnames2.default)('modalbox', { - 'modalbox--dark': backgroundDark, - 'modalbox--relative': relative - }); - return _react2.default.createElement( - 'div', - { className: modalboxClass }, - _react2.default.createElement('div', { className: 'modalbox__cover', onClick: onClose }), - _react2.default.createElement( - 'div', - { className: 'modalbox__content' }, - children - ) - ); - } - }]); - - return ModalBox; -}(_react.Component); - -exports.default = ModalBox; - - -ModalBox.propTypes = { - backgroundDark: _propTypes2.default.bool, - relative: _propTypes2.default.bool, - children: _propTypes2.default.node, - onClose: _propTypes2.default.func -}; -//# sourceMappingURL=ModalBox.js.map \ No newline at end of file diff --git a/lib/components/containers/ModalBox.js.map b/lib/components/containers/ModalBox.js.map deleted file mode 100644 index ca47756c2..000000000 --- a/lib/components/containers/ModalBox.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/ModalBox.js"],"names":["ModalBox","props","backgroundDark","children","onClose","relative","modalboxClass","Component","propTypes","PropTypes","bool","node","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEqBA,Q;;;;;;;;;;;6BACV;AAAA,mBAC+C,KAAKC,KADpD;AAAA,UACAC,cADA,UACAA,cADA;AAAA,UACgBC,QADhB,UACgBA,QADhB;AAAA,UAC0BC,OAD1B,UAC0BA,OAD1B;AAAA,UACmCC,QADnC,UACmCA,QADnC;;AAEP,UAAMC,gBAAgB,0BAAW,UAAX,EAAuB;AAC3C,0BAAkBJ,cADyB;AAE3C,8BAAsBG;AAFqB,OAAvB,CAAtB;AAIA,aACE;AAAA;AAAA,UAAK,WAAWC,aAAhB;AACE,+CAAK,WAAU,iBAAf,EAAiC,SAASF,OAA1C,GADF;AAEE;AAAA;AAAA,YAAK,WAAU,mBAAf;AAAoCD;AAApC;AAFF,OADF;AAMD;;;;EAbmCI,gB;;kBAAjBP,Q;;;AAgBrBA,SAASQ,SAAT,GAAqB;AACnBN,kBAAgBO,oBAAUC,IADP;AAEnBL,YAAUI,oBAAUC,IAFD;AAGnBP,YAAUM,oBAAUE,IAHD;AAInBP,WAASK,oBAAUG;AAJA,CAArB","file":"ModalBox.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nexport default class ModalBox extends Component {\n render() {\n const {backgroundDark, children, onClose, relative} = this.props;\n const modalboxClass = classnames('modalbox', {\n 'modalbox--dark': backgroundDark,\n 'modalbox--relative': relative,\n });\n return (\n
\n
\n
{children}
\n
\n );\n }\n}\n\nModalBox.propTypes = {\n backgroundDark: PropTypes.bool,\n relative: PropTypes.bool,\n children: PropTypes.node,\n onClose: PropTypes.func,\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/ModalProvider.js b/lib/components/containers/ModalProvider.js deleted file mode 100644 index def4ddac6..000000000 --- a/lib/components/containers/ModalProvider.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ModalProvider = function (_React$Component) { - _inherits(ModalProvider, _React$Component); - - function ModalProvider(props) { - _classCallCheck(this, ModalProvider); - - var _this = _possibleConstructorReturn(this, (ModalProvider.__proto__ || Object.getPrototypeOf(ModalProvider)).call(this, props)); - - _this.state = { - component: null, - componentProps: {}, - open: false, - isAnimatingOut: false - }; - return _this; - } - - _createClass(ModalProvider, [{ - key: 'componentDidUpdate', - value: function componentDidUpdate() { - var body = document.body; - var open = this.state.open; - - // Toggle scroll on document body if modal is open - - var hasClass = body.classList.contains('no-scroll'); - - if (open && !hasClass) { - body.classList.add('no-scroll'); - } - if (!open && hasClass) { - body.classList.remove('no-scroll'); - } - } - }, { - key: 'openModal', - value: function openModal(component, componentProps) { - var _ = this.context.localize; - - if (!component) { - throw Error(_('You need to provide a component for the modal to open!')); - } - var open = this.state.open; - - - if (!open) { - this.setState({ - component: component, - componentProps: componentProps, - open: true - }); - } - } - }, { - key: 'closeModal', - value: function closeModal() { - var open = this.state.open; - - if (open) { - this.setState({ - open: false, - component: null - }); - } - } - }, { - key: 'handleClose', - value: function handleClose() { - var _this2 = this; - - this.setState({ isAnimatingOut: true }); - var animationDuration = 600; - setTimeout(function () { - _this2.setState({ isAnimatingOut: false }); - _this2.closeModal(); - }, animationDuration); - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this3 = this; - - return { - openModal: function openModal(c, p) { - return _this3.openModal(c, p); - }, - closeModal: function closeModal() { - return _this3.closeModal(); - }, - handleClose: function handleClose() { - return _this3.handleClose(); - }, - isAnimatingOut: this.state.isAnimatingOut - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this4 = this; - - return { - openModal: function openModal(c, p) { - return _this4.openModal(c, p); - }, - closeModal: function closeModal() { - return _this4.closeModal(); - }, - handleClose: function handleClose() { - return _this4.handleClose(); - }, - isAnimatingOut: this.state.isAnimatingOut - }; - } - }, { - key: 'render', - value: function render() { - var _state = this.state, - Component = _state.component, - componentProps = _state.componentProps, - isAnimatingOut = _state.isAnimatingOut; - - return _react2.default.createElement( - _context.ModalProviderContext.Provider, - { value: this.provideValue() }, - _react2.default.createElement( - _react.Fragment, - null, - this.props.children, - this.state.open ? _react2.default.createElement(Component, _extends({ isAnimatingOut: isAnimatingOut }, componentProps)) : null - ) - ); - } - }]); - - return ModalProvider; -}(_react2.default.Component); - -ModalProvider.propTypes = { - children: _propTypes2.default.node -}; -ModalProvider.contextTypes = { - localize: _propTypes2.default.func -}; -ModalProvider.childContextTypes = { - openModal: _propTypes2.default.func, - closeModal: _propTypes2.default.func, - handleClose: _propTypes2.default.func, - isAnimatingOut: _propTypes2.default.bool -}; - -exports.default = ModalProvider; -//# sourceMappingURL=ModalProvider.js.map \ No newline at end of file diff --git a/lib/components/containers/ModalProvider.js.map b/lib/components/containers/ModalProvider.js.map deleted file mode 100644 index 256d13d13..000000000 --- a/lib/components/containers/ModalProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/ModalProvider.js"],"names":["ModalProvider","props","state","component","componentProps","open","isAnimatingOut","body","document","hasClass","classList","contains","add","remove","_","context","localize","Error","setState","animationDuration","setTimeout","closeModal","openModal","c","p","handleClose","Component","provideValue","children","React","propTypes","PropTypes","node","contextTypes","func","childContextTypes","bool"],"mappings":";;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,iBAAW,IADA;AAEXC,sBAAgB,EAFL;AAGXC,YAAM,KAHK;AAIXC,sBAAgB;AAJL,KAAb;AAFiB;AAQlB;;;;yCAEoB;AACnB,UAAMC,OAAOC,SAASD,IAAtB;AADmB,UAEZF,IAFY,GAEJ,KAAKH,KAFD,CAEZG,IAFY;;AAInB;;AACA,UAAMI,WAAWF,KAAKG,SAAL,CAAeC,QAAf,CAAwB,WAAxB,CAAjB;;AAEA,UAAIN,QAAQ,CAACI,QAAb,EAAuB;AACrBF,aAAKG,SAAL,CAAeE,GAAf,CAAmB,WAAnB;AACD;AACD,UAAI,CAACP,IAAD,IAASI,QAAb,EAAuB;AACrBF,aAAKG,SAAL,CAAeG,MAAf,CAAsB,WAAtB;AACD;AACF;;;8BAESV,S,EAAWC,c,EAAgB;AAAA,UAClBU,CADkB,GACb,KAAKC,OADQ,CAC5BC,QAD4B;;AAEnC,UAAI,CAACb,SAAL,EAAgB;AACd,cAAMc,MAAMH,EAAE,wDAAF,CAAN,CAAN;AACD;AAJkC,UAK5BT,IAL4B,GAKpB,KAAKH,KALe,CAK5BG,IAL4B;;;AAOnC,UAAI,CAACA,IAAL,EAAW;AACT,aAAKa,QAAL,CAAc;AACZf,qBAAWA,SADC;AAEZC,0BAAgBA,cAFJ;AAGZC,gBAAM;AAHM,SAAd;AAKD;AACF;;;iCAEY;AAAA,UACJA,IADI,GACI,KAAKH,KADT,CACJG,IADI;;AAEX,UAAIA,IAAJ,EAAU;AACR,aAAKa,QAAL,CAAc;AACZb,gBAAM,KADM;AAEZF,qBAAW;AAFC,SAAd;AAID;AACF;;;kCACa;AAAA;;AACZ,WAA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gBAAMH,S;;AA6FlC1B,cAAc8B,SAAd,GAA0B;AACxBF,YAAUG,oBAAUC;AADI,CAA1B;AAGAhC,cAAciC,YAAd,GAA6B;AAC3BjB,YAAUe,oBAAUG;AADO,CAA7B;AAGAlC,cAAcmC,iBAAd,GAAkC;AAChCb,aAAWS,oBAAUG,IADW;AAEhCb,cAAYU,oBAAUG,IAFU;AAGhCT,eAAaM,oBAAUG,IAHS;AAIhC5B,kBAAgByB,oBAAUK;AAJM,CAAlC;;kBAOepC,a","file":"ModalProvider.js","sourcesContent":["import React, {Fragment} from 'react';\nimport PropTypes from 'prop-types';\nimport {ModalProviderContext} from '../../context';\n\nclass ModalProvider extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n component: null,\n componentProps: {},\n open: false,\n isAnimatingOut: false,\n };\n }\n\n componentDidUpdate() {\n const body = document.body;\n const {open} = this.state;\n\n // Toggle scroll on document body if modal is open\n const hasClass = body.classList.contains('no-scroll');\n\n if (open && !hasClass) {\n body.classList.add('no-scroll');\n }\n if (!open && hasClass) {\n body.classList.remove('no-scroll');\n }\n }\n\n openModal(component, componentProps) {\n const {localize: _} = this.context;\n if (!component) {\n throw Error(_('You need to provide a component for the modal to open!'));\n }\n const {open} = this.state;\n\n if (!open) {\n this.setState({\n component: component,\n componentProps: componentProps,\n open: true,\n });\n }\n }\n\n closeModal() {\n const {open} = this.state;\n if (open) {\n this.setState({\n open: false,\n component: null,\n });\n }\n }\n handleClose() {\n this.setState({isAnimatingOut: true});\n const animationDuration = 600;\n setTimeout(() => {\n this.setState({isAnimatingOut: false});\n this.closeModal();\n }, animationDuration);\n }\n\n getChildContext() {\n return {\n openModal: (c, p) => this.openModal(c, p),\n closeModal: () => this.closeModal(),\n handleClose: () => this.handleClose(),\n isAnimatingOut: this.state.isAnimatingOut,\n };\n }\n\n provideValue() {\n return {\n openModal: (c, p) => this.openModal(c, p),\n closeModal: () => this.closeModal(),\n handleClose: () => this.handleClose(),\n isAnimatingOut: this.state.isAnimatingOut,\n };\n }\n\n render() {\n const {component: Component, componentProps, isAnimatingOut} = this.state;\n return (\n \n \n {this.props.children}\n {this.state.open ? (\n \n ) : null}\n \n \n );\n }\n}\n\nModalProvider.propTypes = {\n children: PropTypes.node,\n};\nModalProvider.contextTypes = {\n localize: PropTypes.func,\n};\nModalProvider.childContextTypes = {\n openModal: PropTypes.func,\n closeModal: PropTypes.func,\n handleClose: PropTypes.func,\n isAnimatingOut: PropTypes.bool,\n};\n\nexport default ModalProvider;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PanelEmpty.js b/lib/components/containers/PanelEmpty.js deleted file mode 100644 index d7ed01c56..000000000 --- a/lib/components/containers/PanelEmpty.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PanelMessage = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _plotlyIcons = require('plotly-icons'); - -var _lib = require('../../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PanelMessage = exports.PanelMessage = function (_Component) { - _inherits(PanelMessage, _Component); - - function PanelMessage() { - _classCallCheck(this, PanelMessage); - - return _possibleConstructorReturn(this, (PanelMessage.__proto__ || Object.getPrototypeOf(PanelMessage)).apply(this, arguments)); - } - - _createClass(PanelMessage, [{ - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - Icon = _props.icon; - - var heading = this.props.heading || ''; - - return _react2.default.createElement( - 'div', - { className: 'panel__empty__message' }, - Boolean(Icon) && _react2.default.createElement( - 'div', - { className: 'panel__empty__message__icon' }, - _react2.default.createElement(Icon, null) - ), - Boolean(heading) && _react2.default.createElement( - 'div', - { className: 'panel__empty__message__heading' }, - heading - ), - _react2.default.createElement( - 'div', - { className: 'panel__empty__message__content' }, - children - ) - ); - } - }]); - - return PanelMessage; -}(_react.Component); - -PanelMessage.defaultProps = { - icon: _plotlyIcons.ChartLineIcon -}; - -PanelMessage.propTypes = { - heading: _propTypes2.default.string, - children: _propTypes2.default.node, - icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) -}; - -var PanelEmpty = function (_Component2) { - _inherits(PanelEmpty, _Component2); - - function PanelEmpty() { - _classCallCheck(this, PanelEmpty); - - return _possibleConstructorReturn(this, (PanelEmpty.__proto__ || Object.getPrototypeOf(PanelEmpty)).apply(this, arguments)); - } - - _createClass(PanelEmpty, [{ - key: 'render', - value: function render() { - return _react2.default.createElement( - 'div', - { className: (0, _lib.bem)('panel', 'empty') }, - _react2.default.createElement(PanelMessage, this.props) - ); - } - }]); - - return PanelEmpty; -}(_react.Component); - -PanelEmpty.propTypes = { - heading: _propTypes2.default.string, - children: _propTypes2.default.node, - icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) -}; - -exports.default = PanelEmpty; -//# sourceMappingURL=PanelEmpty.js.map \ No newline at end of file diff --git a/lib/components/containers/PanelEmpty.js.map b/lib/components/containers/PanelEmpty.js.map deleted file mode 100644 index c5d4c84a8..000000000 --- a/lib/components/containers/PanelEmpty.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/PanelEmpty.js"],"names":["PanelMessage","props","children","Icon","icon","heading","Boolean","Component","defaultProps","ChartLineIcon","propTypes","PropTypes","string","node","oneOfType","func","PanelEmpty"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;IAEaA,Y,WAAAA,Y;;;;;;;;;;;6BACF;AAAA,mBACwB,KAAKC,KAD7B;AAAA,UACAC,QADA,UACAA,QADA;AAAA,UACgBC,IADhB,UACUC,IADV;;AAEP,UAAMC,UAAU,KAAKJ,KAAL,CAAWI,OAAX,IAAsB,EAAtC;;AAEA,aACE;AAAA;AAAA,UAAK,WAAU,uBAAf;AACGC,gBAAQH,IAAR,KACC;AAAA;AAAA,YAAK,WAAU,6BAAf;AACE,wCAAC,IAAD;AADF,SAFJ;AAMGG,gBAAQD,OAAR,KAAoB;AAAA;AAAA,YAAK,WAAU,gCAAf;AAAiDA;AAAjD,SANvB;AAOE;AAAA;AAAA,YAAK,WAAU,gCAAf;AAAiDH;AAAjD;AAPF,OADF;AAWD;;;;EAhB+BK,gB;;AAmBlCP,aAAaQ,YAAb,GAA4B;AAC1BJ,QAAMK;AADoB,CAA5B;;AAIAT,aAAaU,SAAb,GAAyB;AACvBL,WAASM,oBAAUC,MADI;AAEvBV,YAAUS,oBAAUE,IAFG;AAGvBT,QAAMO,oBAAUG,SAAV,CAAoB,CAACH,oBAAUE,IAAX,EAAiBF,oBAAUI,IAA3B,CAApB;AAHiB,CAAzB;;IAMMC,U;;;;;;;;;;;6BACK;AACP,aACE;AAAA;AAAA,UAAK,WAAW,cAAI,OAAJ,EAAa,OAAb,CAAhB;AACE,sCAAC,YAAD,EAAkB,KAAKf,KAAvB;AADF,OADF;AAKD;;;;EAPsBM,gB;;AAUzBS,WAAWN,SAAX,GAAuB;AACrBL,WAASM,oBAAUC,MADE;AAErBV,YAAUS,oBAAUE,IAFC;AAGrBT,QAAMO,oBAAUG,SAAV,CAAoB,CAACH,oBAAUE,IAAX,EAAiBF,oBAAUI,IAA3B,CAApB;AAHe,CAAvB;;kBAMeC,U","file":"PanelEmpty.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {ChartLineIcon} from 'plotly-icons';\nimport {bem} from 'lib';\n\nexport class PanelMessage extends Component {\n render() {\n const {children, icon: Icon} = this.props;\n const heading = this.props.heading || '';\n\n return (\n
\n {Boolean(Icon) && (\n
\n \n
\n )}\n {Boolean(heading) &&
{heading}
}\n
{children}
\n
\n );\n }\n}\n\nPanelMessage.defaultProps = {\n icon: ChartLineIcon,\n};\n\nPanelMessage.propTypes = {\n heading: PropTypes.string,\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n};\n\nclass PanelEmpty extends Component {\n render() {\n return (\n
\n \n
\n );\n }\n}\n\nPanelEmpty.propTypes = {\n heading: PropTypes.string,\n children: PropTypes.node,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n};\n\nexport default PanelEmpty;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PanelHeader.js b/lib/components/containers/PanelHeader.js deleted file mode 100644 index 23693d2ac..000000000 --- a/lib/components/containers/PanelHeader.js +++ /dev/null @@ -1,158 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _Button = require('../widgets/Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _plotlyIcons = require('plotly-icons'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PanelHeader = function (_Component) { - _inherits(PanelHeader, _Component); - - function PanelHeader() { - _classCallCheck(this, PanelHeader); - - var _this = _possibleConstructorReturn(this, (PanelHeader.__proto__ || Object.getPrototypeOf(PanelHeader)).call(this)); - - _this.state = { addPanelOpen: false }; - - _this.togglePanel = _this.togglePanel.bind(_this); - return _this; - } - - _createClass(PanelHeader, [{ - key: 'togglePanel', - value: function togglePanel() { - this.setState({ addPanelOpen: !this.state.addPanelOpen }); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _ = this.context.localize; - var _props = this.props, - children = _props.children, - addAction = _props.addAction, - allowCollapse = _props.allowCollapse, - toggleFolds = _props.toggleFolds, - hasOpen = _props.hasOpen; - - // dropdown is styled with same styles as react-select component - see _dropdown.scss - - var icon = _react2.default.createElement(_plotlyIcons.PlusIcon, null); - return !children && !addAction && !allowCollapse ? null : _react2.default.createElement( - 'div', - { className: 'panel__header' }, - children && children.length ? _react2.default.createElement( - 'div', - { className: 'panel__header__content' }, - children - ) : null, - _react2.default.createElement( - 'div', - { className: 'panel__header__actions__container' }, - allowCollapse ? _react2.default.createElement( - 'div', - { className: 'panel__header__collapse', onClick: toggleFolds }, - hasOpen ? _react2.default.createElement( - 'span', - null, - _react2.default.createElement(_plotlyIcons.ResizeDownIcon, null), - _('Collapse All') - ) : _react2.default.createElement( - 'span', - null, - _react2.default.createElement(_plotlyIcons.ResizeUpIcon, null), - _('Expand All') - ) - ) : null, - addAction ? _react2.default.createElement( - 'div', - { className: 'panel__header__action dropdown-container' }, - _react2.default.createElement(_Button2.default, { - variant: 'primary', - className: 'js-add-button', - onClick: Array.isArray(addAction.handler) ? this.togglePanel : function () { - return addAction.handler(_this2.context); - }, - icon: icon, - label: addAction.label - }), - this.state.addPanelOpen && _react2.default.createElement( - 'div', - { className: 'Select' }, - _react2.default.createElement( - 'div', - { className: 'Select-menu-outer' }, - _react2.default.createElement( - 'div', - { className: 'Select-menu' }, - addAction.handler.map(function (_ref) { - var label = _ref.label, - handler = _ref.handler; - return _react2.default.createElement( - 'div', - { - className: 'Select-option', - key: label, - onClick: function onClick() { - handler(_this2.context); - _this2.togglePanel(); - } - }, - label - ); - }) - ) - ) - ) - ) : null - ) - ); - } - }]); - - return PanelHeader; -}(_react.Component); - -PanelHeader.contextTypes = { - layout: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - localize: _propTypes2.default.func -}; - -PanelHeader.propTypes = { - addAction: _propTypes2.default.object, - allowCollapse: _propTypes2.default.bool, - children: _propTypes2.default.node, - hasOpen: _propTypes2.default.bool, - toggleFolds: _propTypes2.default.func -}; - -exports.default = PanelHeader; -//# sourceMappingURL=PanelHeader.js.map \ No newline at end of file diff --git a/lib/components/containers/PanelHeader.js.map b/lib/components/containers/PanelHeader.js.map deleted file mode 100644 index 778663ad0..000000000 --- a/lib/components/containers/PanelHeader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/PanelHeader.js"],"names":["PanelHeader","state","addPanelOpen","togglePanel","bind","setState","_","context","localize","props","children","addAction","allowCollapse","toggleFolds","hasOpen","icon","length","Array","isArray","handler","label","map","Component","contextTypes","layout","PropTypes","object","fullContainer","onUpdate","func","updateContainer","propTypes","bool","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,W;;;AACJ,yBAAc;AAAA;;AAAA;;AAEZ,UAAKC,KAAL,GAAa,EAACC,cAAc,KAAf,EAAb;;AAEA,UAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AAJY;AAKb;;;;kCAEa;AACZ,WAAKC,QAAL,CAAc,EAACH,cAAc,CAAC,KAAKD,KAAL,CAAWC,YAA3B,EAAd;AACD;;;6BAEQ;AAAA;;AAAA,UACUI,CADV,GACe,KAAKC,OADpB,CACAC,QADA;AAAA,mBAE4D,KAAKC,KAFjE;AAAA,UAEAC,QAFA,UAEAA,QAFA;AAAA,UAEUC,SAFV,UAEUA,SAFV;AAAA,UAEqBC,aAFrB,UAEqBA,aAFrB;AAAA,UAEoCC,WAFpC,UAEoCA,WAFpC;AAAA,UAEiDC,OAFjD,UAEiDA,OAFjD;;AAIP;;AACA,UAAMC,OAAO,8BAAC,qBAAD,OAAb;AACA,aAAO,CAACL,QAAD,IAAa,CAACC,SAAd,IAA2B,CAACC,aAA5B,GAA4C,IAA5C,GACL;AAAA;AAAA,UAAK,WAAU,eAAf;AACGF,oBAAYA,SAASM,MAArB,GACC;AAAA;AAAA,YAAK,WAAU,wBAAf;AAAyCN;AAAzC,SADD,GAEG,IAHN;AAIE;AAAA;AAAA,YAAK,WAAU,mCAAf;AACGE,0BACC;AAAA;AAAA,cAAK,WAAU,yBAAf,EAAyC,SAASC,WAAlD;AACGC,sBACC;AAAA;AAAA;AACE,4CAAC,2BAAD,OADF;AAEGR,gBAAE,cAAF;AAFH,aADD,GAMC;AAAA;AAAA;AACE,4CAAC,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,oBAAUI;AALD,CAAxB;;kBAQe7B,W","file":"PanelHeader.js","sourcesContent":["import Button from 'components/widgets/Button';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {PlusIcon, ResizeUpIcon, ResizeDownIcon} from 'plotly-icons';\n\nclass PanelHeader extends Component {\n constructor() {\n super();\n this.state = {addPanelOpen: false};\n\n this.togglePanel = this.togglePanel.bind(this);\n }\n\n togglePanel() {\n this.setState({addPanelOpen: !this.state.addPanelOpen});\n }\n\n render() {\n const {localize: _} = this.context;\n const {children, addAction, allowCollapse, toggleFolds, hasOpen} = this.props;\n\n // dropdown is styled with same styles as react-select component - see _dropdown.scss\n const icon = ;\n return !children && !addAction && !allowCollapse ? null : (\n
\n {children && children.length ? (\n
{children}
\n ) : null}\n
\n {allowCollapse ? (\n
\n {hasOpen ? (\n \n \n {_('Collapse All')}\n \n ) : (\n \n \n {_('Expand All')}\n \n )}\n
\n ) : null}\n\n {addAction ? (\n
\n addAction.handler(this.context)\n }\n icon={icon}\n label={addAction.label}\n />\n {this.state.addPanelOpen && (\n
\n
\n
\n {addAction.handler.map(({label, handler}) => (\n {\n handler(this.context);\n this.togglePanel();\n }}\n >\n {label}\n
\n ))}\n
\n
\n
\n )}\n
\n ) : null}\n
\n
\n );\n }\n}\n\nPanelHeader.contextTypes = {\n layout: PropTypes.object,\n fullContainer: PropTypes.object,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n localize: PropTypes.func,\n};\n\nPanelHeader.propTypes = {\n addAction: PropTypes.object,\n allowCollapse: PropTypes.bool,\n children: PropTypes.node,\n hasOpen: PropTypes.bool,\n toggleFolds: PropTypes.func,\n};\n\nexport default PanelHeader;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PlotlyFold.js b/lib/components/containers/PlotlyFold.js deleted file mode 100644 index d8fa6ca04..000000000 --- a/lib/components/containers/PlotlyFold.js +++ /dev/null @@ -1,259 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Fold = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _FoldEmpty = require('./FoldEmpty'); - -var _FoldEmpty2 = _interopRequireDefault(_FoldEmpty); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _plotlyIcons = require('plotly-icons'); - -var _lib = require('../../lib'); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Fold = exports.Fold = function (_Component) { - _inherits(Fold, _Component); - - function Fold() { - _classCallCheck(this, Fold); - - var _this = _possibleConstructorReturn(this, (Fold.__proto__ || Object.getPrototypeOf(Fold)).call(this)); - - _this.foldVisible = true; - return _this; - } - - _createClass(Fold, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - foldInfo: this.props.foldInfo ? this.props.foldInfo : null - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - return { - foldInfo: this.props.foldInfo ? this.props.foldInfo : null - }; - } - }, { - key: 'render', - value: function render() { - if (!this.foldVisible && !this.props.messageIfEmpty) { - return _react2.default.createElement(_context.PlotlyFoldContext.Provider, { value: this.getChildContext() }); - } - var deleteContainer = this.context.deleteContainer; - var _props = this.props, - canDelete = _props.canDelete, - children = _props.children, - className = _props.className, - folded = _props.folded, - foldInfo = _props.foldInfo, - toggleFold = _props.toggleFold, - hideHeader = _props.hideHeader, - Icon = _props.icon, - messageIfEmpty = _props.messageIfEmpty, - name = _props.name; - - - var contentClass = (0, _classnames2.default)('fold__content', { - 'fold__content--noheader': hideHeader - }); - - var headerClass = (0, _classnames2.default)('fold__top', { - 'fold__top--open': !folded - }); - - var arrowClass = (0, _classnames2.default)('fold__top__arrow', { - 'fold__top__arrow--open': !folded - }); - - var arrowIcon = _react2.default.createElement( - 'div', - { className: arrowClass }, - _react2.default.createElement( - 'div', - { className: 'fold__top__arrow__wrapper' }, - _react2.default.createElement(_plotlyIcons.AngleDownIcon, null) - ) - ); - - var icon = Icon ? _react2.default.createElement(Icon, { className: 'fold__top__icon' }) : null; - - var deleteButton = canDelete && typeof deleteContainer === 'function' ? _react2.default.createElement( - 'div', - { - className: 'fold__top__delete js-fold__delete', - onClick: function onClick(e) { - e.stopPropagation(); - deleteContainer(foldInfo); - } - }, - _react2.default.createElement(_plotlyIcons.CloseIcon, null) - ) : null; - - var foldHeader = !hideHeader && _react2.default.createElement( - 'div', - { className: headerClass, onClick: toggleFold }, - _react2.default.createElement( - 'div', - { className: 'fold__top__arrow-title' }, - arrowIcon, - icon, - _react2.default.createElement( - 'div', - { className: 'fold__top__title' }, - (0, _lib.striptags)(name) - ) - ), - deleteButton - ); - - var foldContent = null; - if (!folded) { - if (this.foldVisible) { - foldContent = _react2.default.createElement( - 'div', - { className: contentClass }, - children - ); - } else { - foldContent = _react2.default.createElement( - 'div', - { className: contentClass }, - _react2.default.createElement(_FoldEmpty2.default, { icon: Icon, messagePrimary: messageIfEmpty }) - ); - } - } - - var classes = className ? ' ' + className : ''; - - return _react2.default.createElement( - _context.PlotlyFoldContext.Provider, - { value: this.provideValue() }, - _react2.default.createElement( - 'div', - { className: 'fold' + classes }, - foldHeader, - foldContent - ) - ); - } - }]); - - return Fold; -}(_react.Component); - -Fold.plotly_editor_traits = { foldable: true }; - -Fold.propTypes = { - canDelete: _propTypes2.default.bool, - children: _propTypes2.default.node, - className: _propTypes2.default.string, - folded: _propTypes2.default.bool, - foldInfo: _propTypes2.default.object, - toggleFold: _propTypes2.default.func, - hideHeader: _propTypes2.default.bool, - icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), - messageIfEmpty: _propTypes2.default.string, - name: _propTypes2.default.string -}; - -Fold.contextTypes = { - deleteContainer: _propTypes2.default.func -}; - -Fold.childContextTypes = { - foldInfo: _propTypes2.default.object -}; - -var PlotlyFold = function (_Fold) { - _inherits(PlotlyFold, _Fold); - - function PlotlyFold(props, context) { - _classCallCheck(this, PlotlyFold); - - var _this2 = _possibleConstructorReturn(this, (PlotlyFold.__proto__ || Object.getPrototypeOf(PlotlyFold)).call(this, props, context)); - - _this2.foldVisible = false; - _this2.determineVisibility(props, context); - return _this2; - } - - _createClass(PlotlyFold, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.determineVisibility(nextProps, nextContext); - } - }, { - key: 'determineVisibility', - value: function determineVisibility(nextProps, nextContext) { - var _this3 = this; - - this.foldVisible = false; - - _react2.default.Children.forEach(nextProps.children, function (child) { - if (!child || _this3.foldVisible) { - return; - } - - if (child.props.attr) { - // attr components force fold open if they are visible - var plotProps = (0, _lib.unpackPlotProps)(child.props, nextContext); - if (child.type.modifyPlotProps) { - child.type.modifyPlotProps(child.props, nextContext, plotProps); - } - - _this3.foldVisible = _this3.foldVisible || plotProps.isVisible; - return; - } - - if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) { - // non-attr components force visibility (unless they don't via traits) - _this3.foldVisible = true; - return; - } - }); - } - }]); - - return PlotlyFold; -}(Fold); - -PlotlyFold.plotly_editor_traits = { - foldable: true -}; - -PlotlyFold.contextTypes = Object.assign({ - deleteContainer: _propTypes2.default.func -}, _lib.containerConnectedContextTypes); - -exports.default = PlotlyFold; -//# sourceMappingURL=PlotlyFold.js.map \ No newline at end of file diff --git a/lib/components/containers/PlotlyFold.js.map b/lib/components/containers/PlotlyFold.js.map deleted file mode 100644 index f30999fee..000000000 --- a/lib/components/containers/PlotlyFold.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/PlotlyFold.js"],"names":["Fold","foldVisible","foldInfo","props","messageIfEmpty","getChildContext","deleteContainer","context","canDelete","children","className","folded","toggleFold","hideHeader","Icon","icon","name","contentClass","headerClass","arrowClass","arrowIcon","deleteButton","e","stopPropagation","foldHeader","foldContent","classes","provideValue","Component","plotly_editor_traits","foldable","propTypes","PropTypes","bool","node","string","object","func","oneOfType","contextTypes","childContextTypes","PlotlyFold","determineVisibility","nextProps","nextContext","React","Children","forEach","child","attr","plotProps","type","modifyPlotProps","isVisible","no_visibility_forcing","Object","assign","containerConnectedContextTypes"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;IAEaA,I,WAAAA,I;;;AACX,kBAAc;AAAA;;AAAA;;AAEZ,UAAKC,WAAL,GAAmB,IAAnB;AAFY;AAGb;;;;sCAEiB;AAChB,aAAO;AACLC,kBAAU,KAAKC,KAAL,CAAWD,QAAX,GAAsB,KAAKC,KAAL,CAAWD,QAAjC,GAA4C;AADjD,OAAP;AAGD;;;mCAEc;AACb,aAAO;AACLA,kBAAU,KAAKC,KAAL,CAAWD,QAAX,GAAsB,KAAKC,KAAL,CAAWD,QAAjC,GAA4C;AADjD,OAAP;AAGD;;;6BAEQ;AACP,UAAI,CAAC,KAAKD,WAAN,IAAqB,CAAC,KAAKE,KAAL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ACElD,mBAAiB0B,oBAAUK;AAD7B,CADwB,EAIxBoB,mCAJwB,CAA1B;;kBAOehB,U","file":"PlotlyFold.js","sourcesContent":["import FoldEmpty from './FoldEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport classnames from 'classnames';\nimport {CloseIcon, AngleDownIcon} from 'plotly-icons';\nimport {unpackPlotProps, containerConnectedContextTypes, striptags} from 'lib';\nimport {PlotlyFoldContext} from '../../context';\n\nexport class Fold extends Component {\n constructor() {\n super();\n this.foldVisible = true;\n }\n\n getChildContext() {\n return {\n foldInfo: this.props.foldInfo ? this.props.foldInfo : null,\n };\n }\n\n provideValue() {\n return {\n foldInfo: this.props.foldInfo ? this.props.foldInfo : null,\n };\n }\n\n render() {\n if (!this.foldVisible && !this.props.messageIfEmpty) {\n return ;\n }\n const {deleteContainer} = this.context;\n const {\n canDelete,\n children,\n className,\n folded,\n foldInfo,\n toggleFold,\n hideHeader,\n icon: Icon,\n messageIfEmpty,\n name,\n } = this.props;\n\n const contentClass = classnames('fold__content', {\n 'fold__content--noheader': hideHeader,\n });\n\n const headerClass = classnames('fold__top', {\n 'fold__top--open': !folded,\n });\n\n const arrowClass = classnames('fold__top__arrow', {\n 'fold__top__arrow--open': !folded,\n });\n\n const arrowIcon = (\n
\n
\n \n
\n
\n );\n\n const icon = Icon ? : null;\n\n const deleteButton =\n canDelete && typeof deleteContainer === 'function' ? (\n {\n e.stopPropagation();\n deleteContainer(foldInfo);\n }}\n >\n \n
\n ) : null;\n\n const foldHeader = !hideHeader && (\n
\n
\n {arrowIcon}\n {icon}\n
{striptags(name)}
\n
\n {deleteButton}\n
\n );\n\n let foldContent = null;\n if (!folded) {\n if (this.foldVisible) {\n foldContent =
{children}
;\n } else {\n foldContent = (\n
\n \n
\n );\n }\n }\n\n const classes = className ? ' ' + className : '';\n\n return (\n \n
\n {foldHeader}\n {foldContent}\n
\n
\n );\n }\n}\n\nFold.plotly_editor_traits = {foldable: true};\n\nFold.propTypes = {\n canDelete: PropTypes.bool,\n children: PropTypes.node,\n className: PropTypes.string,\n folded: PropTypes.bool,\n foldInfo: PropTypes.object,\n toggleFold: PropTypes.func,\n hideHeader: PropTypes.bool,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n messageIfEmpty: PropTypes.string,\n name: PropTypes.string,\n};\n\nFold.contextTypes = {\n deleteContainer: PropTypes.func,\n};\n\nFold.childContextTypes = {\n foldInfo: PropTypes.object,\n};\n\nclass PlotlyFold extends Fold {\n constructor(props, context) {\n super(props, context);\n\n this.foldVisible = false;\n this.determineVisibility(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.determineVisibility(nextProps, nextContext);\n }\n\n determineVisibility(nextProps, nextContext) {\n this.foldVisible = false;\n\n React.Children.forEach(nextProps.children, child => {\n if (!child || this.foldVisible) {\n return;\n }\n\n if (child.props.attr) {\n // attr components force fold open if they are visible\n const plotProps = unpackPlotProps(child.props, nextContext);\n if (child.type.modifyPlotProps) {\n child.type.modifyPlotProps(child.props, nextContext, plotProps);\n }\n\n this.foldVisible = this.foldVisible || plotProps.isVisible;\n return;\n }\n\n if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) {\n // non-attr components force visibility (unless they don't via traits)\n this.foldVisible = true;\n return;\n }\n });\n }\n}\n\nPlotlyFold.plotly_editor_traits = {\n foldable: true,\n};\n\nPlotlyFold.contextTypes = Object.assign(\n {\n deleteContainer: PropTypes.func,\n },\n containerConnectedContextTypes\n);\n\nexport default PlotlyFold;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PlotlyPanel.js b/lib/components/containers/PlotlyPanel.js deleted file mode 100644 index 5ecc2d74c..000000000 --- a/lib/components/containers/PlotlyPanel.js +++ /dev/null @@ -1,259 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Panel = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PanelHeader = require('./PanelHeader'); - -var _PanelHeader2 = _interopRequireDefault(_PanelHeader); - -var _PanelEmpty = require('./PanelEmpty'); - -var _PanelEmpty2 = _interopRequireDefault(_PanelEmpty); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _immutabilityHelper = require('immutability-helper'); - -var _immutabilityHelper2 = _interopRequireDefault(_immutabilityHelper); - -var _lib = require('../../lib'); - -var _plotlyIcons = require('plotly-icons'); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PanelErrorImpl = function (_Component) { - _inherits(PanelErrorImpl, _Component); - - function PanelErrorImpl() { - _classCallCheck(this, PanelErrorImpl); - - return _possibleConstructorReturn(this, (PanelErrorImpl.__proto__ || Object.getPrototypeOf(PanelErrorImpl)).apply(this, arguments)); - } - - _createClass(PanelErrorImpl, [{ - key: 'render', - value: function render() { - var _ = this.context.localize; - - - return _react2.default.createElement( - _PanelEmpty2.default, - { icon: _plotlyIcons.EmbedIconIcon, heading: _('Well this is embarrassing.') }, - _react2.default.createElement( - 'p', - null, - _('This panel could not be displayed due to an error.') - ) - ); - } - }]); - - return PanelErrorImpl; -}(_react.Component); - -PanelErrorImpl.contextType = _context.EditorControlsContext; - -var PanelError = PanelErrorImpl; - -var Panel = exports.Panel = function (_Component2) { - _inherits(Panel, _Component2); - - function Panel(props) { - _classCallCheck(this, Panel); - - var _this2 = _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).call(this, props)); - - _this2.state = { - individualFoldStates: [], - hasError: false - }; - _this2.toggleFolds = _this2.toggleFolds.bind(_this2); - _this2.toggleFold = _this2.toggleFold.bind(_this2); - return _this2; - } - - _createClass(Panel, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - deleteContainer: this.props.deleteAction ? this.props.deleteAction : null - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - return { - deleteContainer: this.props.deleteAction ? this.props.deleteAction : null - }; - } - }, { - key: 'componentDidCatch', - value: function componentDidCatch() { - this.setState({ hasError: true }); - } - }, { - key: 'toggleFolds', - value: function toggleFolds() { - var individualFoldStates = this.state.individualFoldStates; - - var hasOpen = individualFoldStates.length > 0 && individualFoldStates.some(function (s) { - return s !== true; - }); - this.setState({ - individualFoldStates: individualFoldStates.map(function () { - return hasOpen; - }) - }); - } - }, { - key: 'toggleFold', - value: function toggleFold(index) { - this.setState((0, _immutabilityHelper2.default)(this.state, { individualFoldStates: { $toggle: [index] } })); - } - }, { - key: 'calculateFolds', - value: function calculateFolds() { - // to get proper number of child folds and initialize component state - var numFolds = 0; - - _react2.default.Children.forEach(this.props.children, function (child) { - if ((child && child.type && child.type.plotly_editor_traits || {}).foldable) { - numFolds++; - } - }); - - if (this.state.individualFoldStates.length !== numFolds) { - var newFoldStates = new Array(numFolds).fill(false); - this.setState({ - individualFoldStates: this.props.addAction ? newFoldStates.map(function (e, i) { - return i !== numFolds - 1; - }) : newFoldStates - }); - } - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.calculateFolds(); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this.calculateFolds(); - } - }, { - key: 'render', - value: function render() { - var _this3 = this; - - var _state = this.state, - individualFoldStates = _state.individualFoldStates, - hasError = _state.hasError; - - - if (hasError) { - return _react2.default.createElement( - _context.PlotlyPanelContext.Provider, - { value: this.provideValue() }, - _react2.default.createElement(PanelError, null) - ); - } - - var newChildren = _react2.default.Children.map(this.props.children, function (child, index) { - if ((child && child.type && child.type.plotly_editor_traits || {}).foldable) { - return (0, _react.cloneElement)(child, { - key: index, - folded: individualFoldStates[index] || false, - toggleFold: function toggleFold() { - return _this3.toggleFold(index); - } - }); - } - return child; - }); - - return _react2.default.createElement( - _context.PlotlyPanelContext.Provider, - { value: this.provideValue() }, - _react2.default.createElement( - 'div', - { className: 'panel' + (this.props.noPadding ? ' panel--no-padding' : '') }, - _react2.default.createElement(_PanelHeader2.default, { - addAction: this.props.addAction, - allowCollapse: this.props.showExpandCollapse && individualFoldStates.length > 1, - toggleFolds: this.toggleFolds, - hasOpen: individualFoldStates.some(function (s) { - return s === false; - }) - }), - _react2.default.createElement( - 'div', - { className: (0, _lib.bem)('panel', 'content') }, - newChildren - ) - ) - ); - } - }]); - - return Panel; -}(_react.Component); - -Panel.propTypes = { - addAction: _propTypes2.default.object, - children: _propTypes2.default.node, - deleteAction: _propTypes2.default.func, - noPadding: _propTypes2.default.bool, - showExpandCollapse: _propTypes2.default.bool -}; - -Panel.defaultProps = { - showExpandCollapse: true -}; - -Panel.contextTypes = { - localize: _propTypes2.default.func -}; - -Panel.childContextTypes = { - deleteContainer: _propTypes2.default.func -}; - -var PlotlyPanel = function (_Panel) { - _inherits(PlotlyPanel, _Panel); - - function PlotlyPanel() { - _classCallCheck(this, PlotlyPanel); - - return _possibleConstructorReturn(this, (PlotlyPanel.__proto__ || Object.getPrototypeOf(PlotlyPanel)).apply(this, arguments)); - } - - return PlotlyPanel; -}(Panel); - -PlotlyPanel.plotly_editor_traits = { - no_visibility_forcing: true -}; - -exports.default = PlotlyPanel; -//# sourceMappingURL=PlotlyPanel.js.map \ No newline at end of file diff --git a/lib/components/containers/PlotlyPanel.js.map b/lib/components/containers/PlotlyPanel.js.map deleted file mode 100644 index 4d656a370..000000000 --- a/lib/components/containers/PlotlyPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/PlotlyPanel.js"],"names":["PanelErrorImpl","_","context","localize","EmbedIconIcon","Component","contextType","EditorControlsContext","PanelError","Panel","props","state","individualFoldStates","hasError","toggleFolds","bind","toggleFold","deleteContainer","deleteAction","setState","hasOpen","length","some","s","map","index","$toggle","numFolds","React","Children","forEach","children","child","type","plotly_editor_traits","foldable","newFoldStates","Array","fill","addAction","e","i","calculateFolds","provideValue","newChildren","key","folded","noPadding","showExpandCollapse","propTypes","PropTypes","object","node","func","bool","defaultProps","contextTypes","childContextTypes","PlotlyPanel","no_visibility_forcing"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;IAEMA,c;;;;;;;;;;;6BACK;AAAA,UACUC,CADV,GACe,KAAKC,OADpB,CACAC,QADA;;;AAGP,aACE;AAAC,4BAAD;AAAA,UAAY,MAAMC,0BAAlB,EAAiC,SAASH,EAAE,4BAAF,CAA1C;AACE;AAAA;AAAA;AAAIA,YAAE,oDAAF;AAAJ;AADF,OADF;AAKD;;;;EAT0BI,gB;;AAY7BL,eAAeM,WAAf,GAA6BC,8BAA7B;;AAEA,IAAMC,aAAaR,cAAnB;;IAEaS,K,WAAAA,K;;;AACX,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA,+GACXA,KADW;;AAEjB,WAAKC,KAAL,GAAa;AACXC,4BAAsB,EADX;AAEXC,gBAAU;AAFC,KAAb;AAIA,WAAKC,WAAL,GAAmB,OAAKA,WAAL,CAAiBC,IAAjB,QAAnB;AACA,WAAKC,UAAL,GAA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CAAW6B,SADxB;AAEE,2BAAe,KAAK7B,KAAL,CAAWsC,kBAAX,IAAiCpC,qBAAqBS,MAArB,GAA8B,CAFhF;AAGE,yBAAa,KAAKP,WAHpB;AAIE,qBAASF,qBAAqBU,IAArB,CAA0B;AAAA,qBAAKC,MAAM,KAAX;AAAA,aAA1B;AAJX,YADF;AAOE;AAAA;AAAA,cAAK,WAAW,cAAI,OAAJ,EAAa,SAAb,CAAhB;AAA0CqB;AAA1C;AAPF;AADF,OADF;AAaD;;;;EArGwBvC,gB;;AAwG3BI,MAAMwC,SAAN,GAAkB;AAChBV,aAAWW,oBAAUC,MADL;AAEhBpB,YAAUmB,oBAAUE,IAFJ;AAGhBlC,gBAAcgC,oBAAUG,IAHR;AAIhBN,aAAWG,oBAAUI,IAJL;AAKhBN,sBAAoBE,oBAAUI;AALd,CAAlB;;AAQA7C,MAAM8C,YAAN,GAAqB;AACnBP,sBAAoB;AADD,CAArB;;AAIAvC,MAAM+C,YAAN,GAAqB;AACnBrD,YAAU+C,oBAAUG;AADD,CAArB;;AAIA5C,MAAMgD,iBAAN,GAA0B;AACxBxC,mBAAiBiC,oBAAUG;AADH,CAA1B;;IAIMK,W;;;;;;;;;;EAAoBjD,K;;AAE1BiD,YAAYxB,oBAAZ,GAAmC;AACjCyB,yBAAuB;AADU,CAAnC;;kBAIeD,W","file":"PlotlyPanel.js","sourcesContent":["import PanelHeader from './PanelHeader';\nimport PanelEmpty from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component, cloneElement} from 'react';\nimport update from 'immutability-helper';\nimport {bem} from 'lib';\nimport {EmbedIconIcon} from 'plotly-icons';\nimport {EditorControlsContext, PlotlyPanelContext} from '../../context';\n\nclass PanelErrorImpl extends Component {\n render() {\n const {localize: _} = this.context;\n\n return (\n \n

{_('This panel could not be displayed due to an error.')}

\n
\n );\n }\n}\n\nPanelErrorImpl.contextType = EditorControlsContext;\n\nconst PanelError = PanelErrorImpl;\n\nexport class Panel extends Component {\n constructor(props) {\n super(props);\n this.state = {\n individualFoldStates: [],\n hasError: false,\n };\n this.toggleFolds = this.toggleFolds.bind(this);\n this.toggleFold = this.toggleFold.bind(this);\n }\n\n getChildContext() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n provideValue() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null,\n };\n }\n\n componentDidCatch() {\n this.setState({hasError: true});\n }\n\n toggleFolds() {\n const {individualFoldStates} = this.state;\n const hasOpen = individualFoldStates.length > 0 && individualFoldStates.some(s => s !== true);\n this.setState({\n individualFoldStates: individualFoldStates.map(() => hasOpen),\n });\n }\n\n toggleFold(index) {\n this.setState(update(this.state, {individualFoldStates: {$toggle: [index]}}));\n }\n\n calculateFolds() {\n // to get proper number of child folds and initialize component state\n let numFolds = 0;\n\n React.Children.forEach(this.props.children, child => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n numFolds++;\n }\n });\n\n if (this.state.individualFoldStates.length !== numFolds) {\n const newFoldStates = new Array(numFolds).fill(false);\n this.setState({\n individualFoldStates: this.props.addAction\n ? newFoldStates.map((e, i) => i !== numFolds - 1)\n : newFoldStates,\n });\n }\n }\n\n componentDidUpdate() {\n this.calculateFolds();\n }\n componentDidMount() {\n this.calculateFolds();\n }\n\n render() {\n const {individualFoldStates, hasError} = this.state;\n\n if (hasError) {\n return (\n \n \n \n );\n }\n\n const newChildren = React.Children.map(this.props.children, (child, index) => {\n if (((child && child.type && child.type.plotly_editor_traits) || {}).foldable) {\n return cloneElement(child, {\n key: index,\n folded: individualFoldStates[index] || false,\n toggleFold: () => this.toggleFold(index),\n });\n }\n return child;\n });\n\n return (\n \n
\n 1}\n toggleFolds={this.toggleFolds}\n hasOpen={individualFoldStates.some(s => s === false)}\n />\n
{newChildren}
\n
\n
\n );\n }\n}\n\nPanel.propTypes = {\n addAction: PropTypes.object,\n children: PropTypes.node,\n deleteAction: PropTypes.func,\n noPadding: PropTypes.bool,\n showExpandCollapse: PropTypes.bool,\n};\n\nPanel.defaultProps = {\n showExpandCollapse: true,\n};\n\nPanel.contextTypes = {\n localize: PropTypes.func,\n};\n\nPanel.childContextTypes = {\n deleteContainer: PropTypes.func,\n};\n\nclass PlotlyPanel extends Panel {}\n\nPlotlyPanel.plotly_editor_traits = {\n no_visibility_forcing: true,\n};\n\nexport default PlotlyPanel;\n"]} \ No newline at end of file diff --git a/lib/components/containers/PlotlySection.js b/lib/components/containers/PlotlySection.js deleted file mode 100644 index 521baa484..000000000 --- a/lib/components/containers/PlotlySection.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Section = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Section = exports.Section = function (_Component) { - _inherits(Section, _Component); - - function Section() { - _classCallCheck(this, Section); - - var _this = _possibleConstructorReturn(this, (Section.__proto__ || Object.getPrototypeOf(Section)).call(this)); - - _this.sectionVisible = true; - return _this; - } - - _createClass(Section, [{ - key: 'render', - value: function render() { - if (!this.sectionVisible) { - return null; - } - - return _react2.default.createElement( - 'div', - { className: 'section' }, - this.props.name ? _react2.default.createElement( - 'div', - { className: 'section__heading' }, - _react2.default.createElement( - 'div', - { className: 'section__heading__text' }, - this.props.name - ) - ) : null, - this.props.children - ); - } - }]); - - return Section; -}(_react.Component); - -Section.plotly_editor_traits = { no_visibility_forcing: false }; -Section.propTypes = { - children: _propTypes2.default.node, - name: _propTypes2.default.string, - attr: _propTypes2.default.string -}; - -var PlotlySection = function (_Section) { - _inherits(PlotlySection, _Section); - - function PlotlySection(props, context) { - _classCallCheck(this, PlotlySection); - - var _this2 = _possibleConstructorReturn(this, (PlotlySection.__proto__ || Object.getPrototypeOf(PlotlySection)).call(this, props, context)); - - _this2.determineVisibility(props, context); - return _this2; - } - - _createClass(PlotlySection, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.determineVisibility(nextProps, nextContext); - } - }, { - key: 'determineVisibility', - value: function determineVisibility(nextProps, nextContext) { - var _this3 = this; - - var _unpackPlotProps = (0, _lib.unpackPlotProps)(nextProps, nextContext), - isVisible = _unpackPlotProps.isVisible; - - this.sectionVisible = Boolean(isVisible); - - _react2.default.Children.forEach(nextProps.children, function (child) { - if (!child || _this3.sectionVisible) { - return; - } - - if (child.props.attr) { - var plotProps = (0, _lib.unpackPlotProps)(child.props, nextContext); - if (child.type.modifyPlotProps) { - child.type.modifyPlotProps(child.props, nextContext, plotProps); - } - _this3.sectionVisible = _this3.sectionVisible || plotProps.isVisible; - return; - } - - if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) { - // non-attr components force visibility (unless they don't via traits) - _this3.sectionVisible = true; - return; - } - }); - } - }]); - - return PlotlySection; -}(Section); - -exports.default = PlotlySection; - - -PlotlySection.plotly_editor_traits = { no_visibility_forcing: true }; -PlotlySection.contextTypes = _lib.containerConnectedContextTypes; -//# sourceMappingURL=PlotlySection.js.map \ No newline at end of file diff --git a/lib/components/containers/PlotlySection.js.map b/lib/components/containers/PlotlySection.js.map deleted file mode 100644 index ea92564fa..000000000 --- a/lib/components/containers/PlotlySection.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/PlotlySection.js"],"names":["Section","sectionVisible","props","name","children","Component","plotly_editor_traits","no_visibility_forcing","propTypes","PropTypes","node","string","attr","PlotlySection","context","determineVisibility","nextProps","nextContext","isVisible","Boolean","React","Children","forEach","child","plotProps","type","modifyPlotProps","contextTypes","containerConnectedContextTypes"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;IAEaA,O,WAAAA,O;;;AACX,qBAAc;AAAA;;AAAA;;AAEZ,UAAKC,cAAL,GAAsB,IAAtB;AAFY;AAGb;;;;6BAEQ;AACP,UAAI,CAAC,KAAKA,cAAV,EAA0B;AACxB,eAAO,IAAP;AACD;;AAED,aACE;AAAA;AAAA,UAAK,WAAU,SAAf;AACG,aAAKC,KAAL,CAAWC,IAAX,GACC;AAAA;AAAA,YAAK,WAAU,kBAAf;AACE;AAAA;AAAA,cAAK,WAAU,wBAAf;AAAyC,iBAAKD,KAAL,CAAWC;AAApD;AADF,SADD,GAIG,IALN;AAMG,aAAKD,KAAL,CAAWE;AANd,OADF;AAUD;;;;EArB0BC,gB;;AAwB7BL,QAAQM,oBAAR,GAA+B,EAACC,uBAAuB,KAAxB,EAA/B;AACAP,QAAQQ,SAAR,GAAoB;AAClBJ,YAAUK,oBAAUC,IADF;AAElBP,QAAMM,oBAAUE,MAFE;AAGlBC,QAAMH,oBAAUE;AAHE,CAApB;;IAMqBE,a;;;AACnB,yBAAYX,KAAZ,EAAmBY,OAAnB,EAA4B;AAAA;;AAAA,+HACpBZ,KADoB,EACbY,OADa;;AAE1B,WAAKC,mBAAL,CAAyBb,KAAzB,EAAgCY,OAAhC;AAF0B;AAG3B;;;;8CAEyBE,S,EAAWC,W,EAAa;AAChD,WAAKF,mBAAL,CAAyBC,SAAzB,EAAoCC,WAApC;AACD;;;wCAEmBD,S,EAAWC,W,EAAa;AAAA;;AAAA,6BACtB,0BAAgBD,SAAhB,EAA2BC,WAA3B,CADsB;AAAA,UACnCC,SADmC,oBACnCA,SADmC;;AAE1C,WAAKjB,cAAL,GAAsBkB,QAAQD,SAAR,CAAtB;;AAEAE,sBAAMC,QAAN,CAAeC,OAAf,CAAuBN,UAAUZ,QAAjC,EAA2C,iBAAS;AAClD,YAAI,CAACmB,KAAD,IAAU,OAAKtB,cAAnB,EAAmC;AACjC;AACD;;AAED,YAAIsB,MAAMrB,KAAN,CAAYU,IAAhB,EAAsB;AACpB,cAAMY,YAAY,0BAAgBD,MAAMrB,KAAtB,EAA6Be,WAA7B,CAAlB;AACA,cAAIM,MAAME,IAAN,CAAWC,eAAf,EAAgC;AAC9BH,kBAAME,IAAN,CAAWC,eAAX,CAA2BH,MAAMrB,KAAjC,EAAwCe,WAAxC,EAAqDO,SAArD;AACD;AACD,iBAAKvB,cAAL,GAAsB,OAAKA,cAAL,IAAuBuB,UAAUN,SAAvD;AACA;AACD;;AAED,YAAI,CAAC,CAACK,MAAME,IAAN,CAAWnB,oBAAX,IAAmC,EAApC,EAAwCC,qBAA7C,EAAoE;AAClE;AACA,iBAAKN,cAAL,GAAsB,IAAtB;AACA;AACD;AACF,OAnBD;AAoBD;;;;EAlCwCD,O;;kBAAtBa,a;;;AAqCrBA,cAAcP,oBAAd,GAAqC,EAACC,uBAAuB,IAAxB,EAArC;AACAM,cAAcc,YAAd,GAA6BC,mCAA7B","file":"PlotlySection.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {containerConnectedContextTypes, unpackPlotProps} from '../../lib';\n\nexport class Section extends Component {\n constructor() {\n super();\n this.sectionVisible = true;\n }\n\n render() {\n if (!this.sectionVisible) {\n return null;\n }\n\n return (\n
\n {this.props.name ? (\n
\n
{this.props.name}
\n
\n ) : null}\n {this.props.children}\n
\n );\n }\n}\n\nSection.plotly_editor_traits = {no_visibility_forcing: false};\nSection.propTypes = {\n children: PropTypes.node,\n name: PropTypes.string,\n attr: PropTypes.string,\n};\n\nexport default class PlotlySection extends Section {\n constructor(props, context) {\n super(props, context);\n this.determineVisibility(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.determineVisibility(nextProps, nextContext);\n }\n\n determineVisibility(nextProps, nextContext) {\n const {isVisible} = unpackPlotProps(nextProps, nextContext);\n this.sectionVisible = Boolean(isVisible);\n\n React.Children.forEach(nextProps.children, child => {\n if (!child || this.sectionVisible) {\n return;\n }\n\n if (child.props.attr) {\n const plotProps = unpackPlotProps(child.props, nextContext);\n if (child.type.modifyPlotProps) {\n child.type.modifyPlotProps(child.props, nextContext, plotProps);\n }\n this.sectionVisible = this.sectionVisible || plotProps.isVisible;\n return;\n }\n\n if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) {\n // non-attr components force visibility (unless they don't via traits)\n this.sectionVisible = true;\n return;\n }\n });\n }\n}\n\nPlotlySection.plotly_editor_traits = {no_visibility_forcing: true};\nPlotlySection.contextTypes = containerConnectedContextTypes;\n"]} \ No newline at end of file diff --git a/lib/components/containers/RangeSelectorAccordion.js b/lib/components/containers/RangeSelectorAccordion.js deleted file mode 100644 index fbe997f52..000000000 --- a/lib/components/containers/RangeSelectorAccordion.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _PlotlyPanel = require('./PlotlyPanel'); - -var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _context2 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var RangeSelectorFold = (0, _lib.connectRangeSelectorToAxis)(_PlotlyFold2.default); - -var RangeSelectorAccordion = function (_Component) { - _inherits(RangeSelectorAccordion, _Component); - - function RangeSelectorAccordion() { - _classCallCheck(this, RangeSelectorAccordion); - - return _possibleConstructorReturn(this, (RangeSelectorAccordion.__proto__ || Object.getPrototypeOf(RangeSelectorAccordion)).apply(this, arguments)); - } - - _createClass(RangeSelectorAccordion, [{ - key: 'render', - value: function render() { - if (!this.context.fullContainer || !this.context.fullContainer.rangeselector || !this.context.fullContainer.rangeselector.visible || - // next line checks for "all" case - this.context.fullContainer._axisGroup === 0) { - return null; - } - - var _context = this.context, - _context$fullContaine = _context.fullContainer.rangeselector.buttons, - buttons = _context$fullContaine === undefined ? [] : _context$fullContaine, - _ = _context.localize; - var children = this.props.children; - - - var content = buttons.length && buttons.map(function (btn, i) { - return _react2.default.createElement( - RangeSelectorFold, - { key: i, rangeselectorIndex: i, name: btn.label, canDelete: true }, - children - ); - }); - - var addAction = { - label: _('Button'), - handler: function handler(context) { - var fullContainer = context.fullContainer, - updateContainer = context.updateContainer; - - if (updateContainer) { - var rangeselectorIndex = Array.isArray(fullContainer.rangeselector.buttons) ? fullContainer.rangeselector.buttons.length : 0; - - updateContainer(_defineProperty({}, 'rangeselector.buttons[' + rangeselectorIndex + ']', {})); - } - } - }; - - return _react2.default.createElement( - _PlotlyPanel2.default, - { addAction: addAction }, - content ? content : null - ); - } - }]); - - return RangeSelectorAccordion; -}(_react.Component); - -RangeSelectorAccordion.contextType = _context2.EditorControlsContext; - -RangeSelectorAccordion.propTypes = { - children: _propTypes2.default.node -}; - -RangeSelectorAccordion.plotly_editor_traits = { - no_visibility_forcing: true -}; - -exports.default = RangeSelectorAccordion; -//# sourceMappingURL=RangeSelectorAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/RangeSelectorAccordion.js.map b/lib/components/containers/RangeSelectorAccordion.js.map deleted file mode 100644 index e435cb0da..000000000 --- a/lib/components/containers/RangeSelectorAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/RangeSelectorAccordion.js"],"names":["RangeSelectorFold","PlotlyFold","RangeSelectorAccordion","context","fullContainer","rangeselector","visible","_axisGroup","buttons","_","localize","children","props","content","length","map","btn","i","label","addAction","handler","updateContainer","rangeselectorIndex","Array","isArray","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","plotly_editor_traits","no_visibility_forcing"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAE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AAoCN,kBAAUA,OAAV,GAAoB;AAAxD,OAAP;AACD;;;;EA7CkCY,gB;;AAgDrCvB,uBAAuBwB,WAAvB,GAAqCC,+BAArC;;AAEAzB,uBAAuB0B,SAAvB,GAAmC;AACjCjB,YAAUkB,oBAAUC;AADa,CAAnC;;AAIA5B,uBAAuB6B,oBAAvB,GAA8C;AAC5CC,yBAAuB;AADqB,CAA9C;;kBAIe9B,sB","file":"RangeSelectorAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport PlotlyPanel from './PlotlyPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectRangeSelectorToAxis} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst RangeSelectorFold = connectRangeSelectorToAxis(PlotlyFold);\n\nclass RangeSelectorAccordion extends Component {\n render() {\n if (\n !this.context.fullContainer ||\n !this.context.fullContainer.rangeselector ||\n !this.context.fullContainer.rangeselector.visible ||\n // next line checks for \"all\" case\n this.context.fullContainer._axisGroup === 0\n ) {\n return null;\n }\n\n const {\n fullContainer: {\n rangeselector: {buttons = []},\n },\n localize: _,\n } = this.context;\n const {children} = this.props;\n\n const content =\n buttons.length &&\n buttons.map((btn, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Button'),\n handler: context => {\n const {fullContainer, updateContainer} = context;\n if (updateContainer) {\n const rangeselectorIndex = Array.isArray(fullContainer.rangeselector.buttons)\n ? fullContainer.rangeselector.buttons.length\n : 0;\n\n updateContainer({\n [`rangeselector.buttons[${rangeselectorIndex}]`]: {},\n });\n }\n },\n };\n\n return {content ? content : null};\n }\n}\n\nRangeSelectorAccordion.contextType = EditorControlsContext;\n\nRangeSelectorAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nRangeSelectorAccordion.plotly_editor_traits = {\n no_visibility_forcing: true,\n};\n\nexport default RangeSelectorAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/ShapeAccordion.js b/lib/components/containers/ShapeAccordion.js deleted file mode 100644 index 55350be6e..000000000 --- a/lib/components/containers/ShapeAccordion.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _derived = require('./derived'); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _constants = require('../../lib/constants'); - -var _PanelEmpty = require('./PanelEmpty'); - -var _context2 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ShapeFold = (0, _lib.connectShapeToLayout)(_PlotlyFold2.default); - -var ShapeAccordion = function (_Component) { - _inherits(ShapeAccordion, _Component); - - function ShapeAccordion() { - _classCallCheck(this, ShapeAccordion); - - return _possibleConstructorReturn(this, (ShapeAccordion.__proto__ || Object.getPrototypeOf(ShapeAccordion)).apply(this, arguments)); - } - - _createClass(ShapeAccordion, [{ - key: 'render', - value: function render() { - var _context = this.context, - _context$layout$shape = _context.layout.shapes, - shapes = _context$layout$shape === undefined ? [] : _context$layout$shape, - _ = _context.localize; - var _props = this.props, - canAdd = _props.canAdd, - children = _props.children; - - - var content = shapes.length && shapes.map(function (shp, i) { - return _react2.default.createElement( - ShapeFold, - { key: i, shapeIndex: i, name: _('Shape') + ' ' + (i + 1), canDelete: canAdd }, - children - ); - }); - - var addAction = { - label: _('Shape'), - handler: function handler(_ref) { - var layout = _ref.layout, - updateContainer = _ref.updateContainer; - - var shapeIndex = void 0; - if (Array.isArray(layout.shapes)) { - shapeIndex = layout.shapes.length; - } else { - shapeIndex = 0; - } - - var key = 'shapes[' + shapeIndex + ']'; - var value = { - line: { color: _constants.COLORS.charcoal }, - fillcolor: _constants.COLORS.middleGray, - opacity: 0.3 - }; - - if (updateContainer) { - updateContainer(_defineProperty({}, key, value)); - } - } - }; - - return _react2.default.createElement( - _derived.LayoutPanel, - { addAction: canAdd ? addAction : null }, - content ? content : _react2.default.createElement( - _PanelEmpty.PanelMessage, - { heading: _('Lines, Rectangles and Ellipses.') }, - _react2.default.createElement( - 'p', - null, - _('Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest.') - ), - _react2.default.createElement( - 'p', - null, - _('Click on the + button above to add a shape.') - ) - ) - ); - } - }]); - - return ShapeAccordion; -}(_react.Component); - -ShapeAccordion.contextType = _context2.EditorControlsContext; - -ShapeAccordion.propTypes = { - children: _propTypes2.default.node, - canAdd: _propTypes2.default.bool -}; - -exports.default = ShapeAccordion; -//# sourceMappingURL=ShapeAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/ShapeAccordion.js.map b/lib/components/containers/ShapeAccordion.js.map deleted file mode 100644 index fcd364f53..000000000 --- a/lib/components/containers/ShapeAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/ShapeAccordion.js"],"names":["ShapeFold","PlotlyFold","ShapeAccordion","context","layout","shapes","_","localize","props","canAdd","children","content","length","map","shp","i","addAction","label","handler","updateContainer","shapeIndex","Array","isArray","key","value","line","color","COLORS","charcoal","fillcolor","middleGray","opacity","Component","contextType","EditorControlsContext","propTypes","PropTypes","node","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,YAAY,+BAAqBC,oBAArB,CAAlB;;IAEMC,c;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,MAFK,CAEIC,MAFJ;AAAA,UAEIA,MAFJ,yCAEa,EAFb;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,mBAKoB,KAAKC,KALzB;AAAA,UAKAC,MALA,UAKAA,MALA;AAAA,UAKQC,QALR,UAKQA,QALR;;;AAOP,UAAMC,UACJN,OAAOO,MAAP,IACAP,OAAOQ,GAAP,CAAW,UAACC,GAAD,EAAMC,CAAN;AAAA,eACT;AAAC,mBAAD;AAAA,YAAW,KAAKA,CAAhB,EAAmB,YAAYA,CAA/B,EAAkC,MAAST,EAAE,OAAF,CAAT,UAAuBS,IAAI,CAA3B,CAAlC,EAAkE,WAAWN,MAA7E;AACGC;AADH,SADS;AAAA,OAAX,CAFF;;AAQA,UAAMM,YAAY;AAChBC,eAAOX,EAAE,OAAF,CADS;AAEhBY,iBAAS,uBAA+B;AAAA,cAA7Bd,MAA6B,QAA7BA,MAA6B;AAAA,cAArBe,eAAqB,QAArBA,eAAqB;;AACtC,cAAIC,mBAAJ;AACA,cAAIC,MAAMC,OAAN,CAAclB,OAAOC,MAArB,CAAJ,EAAkC;AAChCe,yBAAahB,OAAOC,MAAP,CAAcO,MAA3B;AACD,WAFD,MAEO;AACLQ,yBAAa,CAAb;AACD;;AAED,cAAMG,kBAAgBH,UAAhB,MAAN;AACA,cAAMI,QAAQ;AACZC,kBAAM,EAACC,OAAOC,kBAAOC,QAAf,EADM;AAEZC,uBAAWF,kBAAOG,UAFN;AAGZC,qBAAS;AAHG,WAAd;;AAMA,cAAIZ,eAAJ,EAAqB;AACnBA,gDAAkBI,GAAlB,EAAwBC,KAAxB;AACD;AACF;AApBe,OAAlB;;AAuBA,aACE;AAAC,4BAAD;AAAA,UAAa,WAAWf,SAASO,SAAT,GAAqB,IAA7C;AACGL,kBACCA,OADD,GAGC;AAAC,kCAAD;AAAA,YAAc,SAASL,EAAE,iCAAF,CAAvB;AACE;AAAA;AAAA;AACGA,cACC,kGADD;AADH,WADF;AAME;AAAA;AAAA;AAAIA,cAAE,6CAAF;AAAJ;AANF;AAJJ,OADF;AAgBD;;;;EAvD0B0B,gB;;AA0D7B9B,eAAe+B,WAAf,GAA6BC,+BAA7B;;AAEAhC,eAAeiC,SAAf,GAA2B;AACzBzB,YAAU0B,oBAAUC,IADK;AAEzB5B,UAAQ2B,oBAAUE;AAFO,CAA3B;;kBAKepC,c","file":"ShapeAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport {LayoutPanel} from './derived';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectShapeToLayout} from 'lib';\nimport {COLORS} from 'lib/constants';\nimport {PanelMessage} from './PanelEmpty';\nimport {EditorControlsContext} from '../../context';\n\nconst ShapeFold = connectShapeToLayout(PlotlyFold);\n\nclass ShapeAccordion extends Component {\n render() {\n const {\n layout: {shapes = []},\n localize: _,\n } = this.context;\n const {canAdd, children} = this.props;\n\n const content =\n shapes.length &&\n shapes.map((shp, i) => (\n \n {children}\n \n ));\n\n const addAction = {\n label: _('Shape'),\n handler: ({layout, updateContainer}) => {\n let shapeIndex;\n if (Array.isArray(layout.shapes)) {\n shapeIndex = layout.shapes.length;\n } else {\n shapeIndex = 0;\n }\n\n const key = `shapes[${shapeIndex}]`;\n const value = {\n line: {color: COLORS.charcoal},\n fillcolor: COLORS.middleGray,\n opacity: 0.3,\n };\n\n if (updateContainer) {\n updateContainer({[key]: value});\n }\n },\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n

\n {_(\n 'Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest.'\n )}\n

\n

{_('Click on the + button above to add a shape.')}

\n
\n )}\n
\n );\n }\n}\n\nShapeAccordion.contextType = EditorControlsContext;\n\nShapeAccordion.propTypes = {\n children: PropTypes.node,\n canAdd: PropTypes.bool,\n};\n\nexport default ShapeAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/SingleSidebarItem.js b/lib/components/containers/SingleSidebarItem.js deleted file mode 100644 index cbc3c8faa..000000000 --- a/lib/components/containers/SingleSidebarItem.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SingleSidebarItem = function (_Component) { - _inherits(SingleSidebarItem, _Component); - - function SingleSidebarItem() { - _classCallCheck(this, SingleSidebarItem); - - return _possibleConstructorReturn(this, (SingleSidebarItem.__proto__ || Object.getPrototypeOf(SingleSidebarItem)).apply(this, arguments)); - } - - _createClass(SingleSidebarItem, [{ - key: 'render', - value: function render() { - return this.props.children ? _react2.default.createElement( - 'div', - { className: 'sidebar__item--single' }, - this.props.children - ) : null; - } - }]); - - return SingleSidebarItem; -}(_react.Component); - -exports.default = SingleSidebarItem; - - -SingleSidebarItem.plotly_editor_traits = { sidebar_element: true }; - -SingleSidebarItem.propTypes = { - children: _propTypes2.default.any -}; -//# sourceMappingURL=SingleSidebarItem.js.map \ No newline at end of file diff --git a/lib/components/containers/SingleSidebarItem.js.map b/lib/components/containers/SingleSidebarItem.js.map deleted file mode 100644 index 0a6496c58..000000000 --- a/lib/components/containers/SingleSidebarItem.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/SingleSidebarItem.js"],"names":["SingleSidebarItem","props","children","Component","plotly_editor_traits","sidebar_element","propTypes","PropTypes","any"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,iB;;;;;;;;;;;6BACV;AACP,aAAO,KAAKC,KAAL,CAAWC,QAAX,GACL;AAAA;AAAA,UAAK,WAAU,uBAAf;AAAwC,aAAKD,KAAL,CAAWC;AAAnD,OADK,GAEH,IAFJ;AAGD;;;;EAL4CC,gB;;kBAA1BH,iB;;;AAQrBA,kBAAkBI,oBAAlB,GAAyC,EAACC,iBAAiB,IAAlB,EAAzC;;AAEAL,kBAAkBM,SAAlB,GAA8B;AAC5BJ,YAAUK,oBAAUC;AADQ,CAA9B","file":"SingleSidebarItem.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nexport default class SingleSidebarItem extends Component {\n render() {\n return this.props.children ? (\n
{this.props.children}
\n ) : null;\n }\n}\n\nSingleSidebarItem.plotly_editor_traits = {sidebar_element: true};\n\nSingleSidebarItem.propTypes = {\n children: PropTypes.any,\n};\n"]} \ No newline at end of file diff --git a/lib/components/containers/SliderAccordion.js b/lib/components/containers/SliderAccordion.js deleted file mode 100644 index 803fe9a3c..000000000 --- a/lib/components/containers/SliderAccordion.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _TraceRequiredPanel = require('./TraceRequiredPanel'); - -var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _context2 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SliderFold = (0, _lib.connectSliderToLayout)(_PlotlyFold2.default); - -var SliderAccordion = function (_Component) { - _inherits(SliderAccordion, _Component); - - function SliderAccordion() { - _classCallCheck(this, SliderAccordion); - - return _possibleConstructorReturn(this, (SliderAccordion.__proto__ || Object.getPrototypeOf(SliderAccordion)).apply(this, arguments)); - } - - _createClass(SliderAccordion, [{ - key: 'render', - value: function render() { - var _context = this.context, - _context$layout$slide = _context.layout.sliders, - sliders = _context$layout$slide === undefined ? [] : _context$layout$slide, - _ = _context.localize; - var children = this.props.children; - - - var content = sliders.length > 0 && sliders.map(function (sli, i) { - return _react2.default.createElement( - SliderFold, - { key: i, sliderIndex: i, name: _('Slider') + (' ' + (i + 1)) }, - children - ); - }); - - return _react2.default.createElement( - _TraceRequiredPanel2.default, - null, - content ? content : null - ); - } - }]); - - return SliderAccordion; -}(_react.Component); - -SliderAccordion.contextType = _context2.EditorControlsContext; - -SliderAccordion.propTypes = { - children: _propTypes2.default.node -}; - -exports.default = SliderAccordion; -//# sourceMappingURL=SliderAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/SliderAccordion.js.map b/lib/components/containers/SliderAccordion.js.map deleted file mode 100644 index 0400537e6..000000000 --- a/lib/components/containers/SliderAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/SliderAccordion.js"],"names":["SliderFold","PlotlyFold","SliderAccordion","context","layout","sliders","_","localize","children","props","content","length","map","sli","i","Component","contextType","EditorControlsContext","propTypes","PropTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,aAAa,gCAAsBC,oBAAtB,CAAnB;;IAEMC,e;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,MAFK,CAEIC,OAFJ;AAAA,UAEIA,OAFJ,yCAEc,EAFd;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,UAKAC,QALA,GAKY,KAAKC,KALjB,CAKAD,QALA;;;AAOP,UAAME,UACJL,QAAQM,MAAR,GAAiB,CAAjB,IACAN,QAAQO,GAAR,CAAY,UAACC,GAAD,EAAMC,CAAN;AAAA,eACV;AAAC,oBAAD;AAAA,YAAY,KAAKA,CAAjB,EAAoB,aAAaA,CAAjC,EAAoC,MAAMR,EAAE,QAAF,YAAkBQ,IAAI,CAAtB,EAA1C;AACGN;AADH,SADU;AAAA,OAAZ,CAFF;;AAQA,aAAO;AAAC,oCAAD;AAAA;AAAqBE,kBAAUA,OAAV,GAAoB;AAAzC,OAAP;AACD;;;;EAjB2BK,gB;;AAoB9Bb,gBAAgBc,WAAhB,GAA8BC,+BAA9B;;AAEAf,gBAAgBgB,SAAhB,GAA4B;AAC1BV,YAAUW,oBAAUC;AADM,CAA5B;;kBAIelB,e","file":"SliderAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectSliderToLayout} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst SliderFold = connectSliderToLayout(PlotlyFold);\n\nclass SliderAccordion extends Component {\n render() {\n const {\n layout: {sliders = []},\n localize: _,\n } = this.context;\n const {children} = this.props;\n\n const content =\n sliders.length > 0 &&\n sliders.map((sli, i) => (\n \n {children}\n \n ));\n\n return {content ? content : null};\n }\n}\n\nSliderAccordion.contextType = EditorControlsContext;\n\nSliderAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default SliderAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/SubplotAccordion.js b/lib/components/containers/SubplotAccordion.js deleted file mode 100644 index d641d84f3..000000000 --- a/lib/components/containers/SubplotAccordion.js +++ /dev/null @@ -1,202 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _TraceRequiredPanel = require('./TraceRequiredPanel'); - -var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _constants = require('../../lib/constants'); - -var _context2 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TraceFold = (0, _lib.connectTraceToPlot)(_PlotlyFold2.default); -var NonCartesianSubplotFold = (0, _lib.connectNonCartesianSubplotToLayout)(_PlotlyFold2.default); -var CartesianSubplotFold = (0, _lib.connectCartesianSubplotToLayout)(_PlotlyFold2.default); - -var SubplotAccordion = function (_Component) { - _inherits(SubplotAccordion, _Component); - - function SubplotAccordion() { - _classCallCheck(this, SubplotAccordion); - - return _possibleConstructorReturn(this, (SubplotAccordion.__proto__ || Object.getPrototypeOf(SubplotAccordion)).apply(this, arguments)); - } - - _createClass(SubplotAccordion, [{ - key: 'render', - value: function render() { - var _context = this.context, - _context$data = _context.data, - data = _context$data === undefined ? [] : _context$data, - _context$layout = _context.layout, - layout = _context$layout === undefined ? {} : _context$layout, - _ = _context.localize; - var children = this.props.children; - - var subplotFolds = []; - - var allCartesianAxisCombinations = data.reduce(function (acc, curVal, inx) { - if (_constants.TRACE_TO_AXIS.cartesian.some(function (c) { - return c === curVal.type; - })) { - var xaxis = 'xaxis' + (curVal.xaxis ? curVal.xaxis.substring(1) : ''); - var yaxis = 'yaxis' + (curVal.yaxis ? curVal.yaxis.substring(1) : ''); - - var existingComboIndex = acc.findIndex(function (t) { - return t.xaxis === xaxis && t.yaxis === yaxis; - }); - if (existingComboIndex === -1) { - acc.push({ - xaxis: xaxis, - yaxis: yaxis, - xaxisName: curVal.xaxis ? (0, _lib.getSubplotTitle)(curVal.xaxis, 'x', _) : 'X 1', - yaxisName: curVal.yaxis ? (0, _lib.getSubplotTitle)(curVal.yaxis, 'y', _) : 'Y 1', - index: [inx] - }); - } else { - acc[existingComboIndex].index.push(inx); - } - } - return acc; - }, []); - - allCartesianAxisCombinations.forEach(function (d) { - return subplotFolds[d.index[0]] = _react2.default.createElement( - CartesianSubplotFold, - { - key: d.index[0], - traceIndexes: d.index, - canDelete: false, - xaxis: d.xaxis, - yaxis: d.yaxis, - name: d.xaxisName + ' | ' + d.yaxisName - }, - children - ); - }); - - // For each key in layout, find all traces that belong to this subplot. - // E.g. if layout attr is 'ternary', find all traces that are of type - // that has subplot ternary, if layout attr is 'ternary2', find traces - // of right type that have attr 'subplot': 'ternary' in their data. - - /** - Example: - { - "data": [ - { - "type": "scatterternary", - "mode": "markers", - }, - { - "type": "scatterternary", - "mode": "markers", - "subplot": "ternary2" - } - ], - "layout": { - "ternary": {}, - "ternary2": {}, - }, - } - */ - - Object.keys(layout).forEach(function (layoutKey) { - var traceIndexes = []; - var subplotName = void 0; - if (['geo', 'mapbox', 'polar', 'gl3d', 'ternary'].some(function (subplotType) { - subplotName = (0, _lib.getSubplotTitle)(layoutKey, subplotType, _); - var trIndex = _constants.SUBPLOT_TO_ATTR[subplotType].layout === layoutKey ? data.findIndex(function (trace) { - return _constants.TRACE_TO_AXIS[subplotType].some(function (tt) { - return tt === trace.type; - }); - }) : data.findIndex(function (trace) { - return trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === layoutKey; - }); - if (trIndex !== -1) { - traceIndexes.push(trIndex); - } - return layoutKey.startsWith(_constants.SUBPLOT_TO_ATTR[subplotType].layout); - })) { - subplotFolds[traceIndexes[0]] = _react2.default.createElement( - NonCartesianSubplotFold, - { - key: layoutKey, - traceIndexes: traceIndexes, - canDelete: false, - subplot: layoutKey, - name: subplotName - }, - children - ); - } - }); - - var pieCounter = 0; - var tableCounter = 0; - data.forEach(function (d, i) { - if (d.type === 'pie' && d.values || d.type === 'table') { - if (d.type === 'pie') { - pieCounter++; - } else if (d.type === 'table') { - tableCounter++; - } - subplotFolds[i] = _react2.default.createElement( - TraceFold, - { - key: i, - traceIndexes: [i], - canDelete: false, - name: d.type === 'pie' ? _('Pie') + ' ' + (pieCounter > 1 ? pieCounter : '') : _('Table') + ' ' + (tableCounter > 1 ? tableCounter : '') - }, - children - ); - } - }); - - return _react2.default.createElement( - _TraceRequiredPanel2.default, - null, - subplotFolds - ); - } - }]); - - return SubplotAccordion; -}(_react.Component); - -SubplotAccordion.contextType = _context2.EditorControlsContext; - -SubplotAccordion.propTypes = { - children: _propTypes2.default.node -}; - -exports.default = SubplotAccordion; -//# sourceMappingURL=SubplotAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/SubplotAccordion.js.map b/lib/components/containers/SubplotAccordion.js.map deleted file mode 100644 index 8f96534a1..000000000 --- a/lib/components/containers/SubplotAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/SubplotAccordion.js"],"names":["TraceFold","PlotlyFold","NonCartesianSubplotFold","CartesianSubplotFold","SubplotAccordion","context","data","layout","_","localize","children","props","subplotFolds","allCartesianAxisCombinations","reduce","acc","curVal","inx","TRACE_TO_AXIS","cartesian","some","c","type","xaxis","substring","yaxis","existingComboIndex","findIndex","t","push","xaxisName","yaxisName","index","forEach","d","Object","keys","traceIndexes","subplotName","layoutKey","subplotType","trIndex","SUBPLOT_TO_ATTR","tt","trace","startsWith","pieCounter","tableCounter","i","values","Component","contextType","EditorControlsContext","propTypes","PropTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AAMA;;AACA;;;;;;;;;;AAEA,IAAMA,YAAY,6BAAmBC,oBAAnB,CAAlB;AACA,IAAMC,0BAA0B,6CAAmCD,oBAAnC,CAAhC;AACA,IAAME,uBAAuB,0CAAgCF,oBAAhC,CAA7B;;IAEMG,gB;;;;;;;;;;;6BACK;AAAA,qBACuC,KAAKC,OAD5C;AAAA,mCACAC,IADA;AAAA,UACAA,IADA,iCACO,EADP;AAAA,qCACWC,MADX;AAAA,UACWA,MADX,mCACoB,EADpB;AAAA,UACkCC,CADlC,YACwBC,QADxB;AAAA,UAEAC,QAFA,GAEY,KAAKC,KAFjB,CAEAD,QAFA;;AAGP,UAAME,eAAe,EAArB;;AAEA,UAAMC,+BAA+BP,KAAKQ,MAAL,CAAY,UAACC,GAAD,EAAMC,MAAN,EAAcC,GAAd,EAAsB;AACrE,YAAIC,yBAAcC,SAAd,CAAwBC,IAAxB,CAA6B;AAAA,iBAAKC,MAAML,OAAOM,IAAlB;AAAA,SAA7B,CAAJ,EAA0D;AACxD,cAAMC,QAAQ,WAAWP,OAAOO,KAAP,GAAeP,OAAOO,KAAP,CAAaC,SAAb,CAAuB,CAAvB,CAAf,GAA2C,EAAtD,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D,WAFD,MAEO,IAAIZ,EAAEZ,IAAF,KAAW,OAAf,EAAwB;AAC7ByB;AACD;AACDnC,uBAAaoC,CAAb,IACE;AAAC,qBAAD;AAAA;AACE,mBAAKA,CADP;AAEE,4BAAc,CAACA,CAAD,CAFhB;AAGE,yBAAW,KAHb;AAIE,oBACEd,EAAEZ,IAAF,KAAW,KAAX,GACOd,EAAE,KAAF,CADP,UACmBsC,aAAa,CAAb,GAAiBA,UAAjB,GAA8B,EADjD,IAEOtC,EAAE,OAAF,CAFP,UAEqBuC,eAAe,CAAf,GAAmBA,YAAnB,GAAkC,EAFvD;AALJ;AAUGrC;AAVH,WADF;AAcD;AACF,OAtBD;;AAwBA,aAAO;AAAC,oCAAD;AAAA;AAAqBE;AAArB,OAAP;AACD;;;;EA9H4BsC,gB;;AAiI/B9C,iBAAiB+C,WAAjB,GAA+BC,+BAA/B;;AAEAhD,iBAAiBiD,SAAjB,GAA6B;AAC3B3C,YAAU4C,oBAAUC;AADO,CAA7B;;kBAIenD,gB","file":"SubplotAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {\n connectTraceToPlot,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n getSubplotTitle,\n} from 'lib';\nimport {TRACE_TO_AXIS, SUBPLOT_TO_ATTR} from 'lib/constants';\nimport {EditorControlsContext} from '../../context';\n\nconst TraceFold = connectTraceToPlot(PlotlyFold);\nconst NonCartesianSubplotFold = connectNonCartesianSubplotToLayout(PlotlyFold);\nconst CartesianSubplotFold = connectCartesianSubplotToLayout(PlotlyFold);\n\nclass SubplotAccordion extends Component {\n render() {\n const {data = [], layout = {}, localize: _} = this.context;\n const {children} = this.props;\n const subplotFolds = [];\n\n const allCartesianAxisCombinations = data.reduce((acc, curVal, inx) => {\n if (TRACE_TO_AXIS.cartesian.some(c => c === curVal.type)) {\n const xaxis = 'xaxis' + (curVal.xaxis ? curVal.xaxis.substring(1) : '');\n const yaxis = 'yaxis' + (curVal.yaxis ? curVal.yaxis.substring(1) : '');\n\n const existingComboIndex = acc.findIndex(t => t.xaxis === xaxis && t.yaxis === yaxis);\n if (existingComboIndex === -1) {\n acc.push({\n xaxis: xaxis,\n yaxis: yaxis,\n xaxisName: curVal.xaxis ? getSubplotTitle(curVal.xaxis, 'x', _) : 'X 1',\n yaxisName: curVal.yaxis ? getSubplotTitle(curVal.yaxis, 'y', _) : 'Y 1',\n index: [inx],\n });\n } else {\n acc[existingComboIndex].index.push(inx);\n }\n }\n return acc;\n }, []);\n\n allCartesianAxisCombinations.forEach(\n d =>\n (subplotFolds[d.index[0]] = (\n \n {children}\n \n ))\n );\n\n // For each key in layout, find all traces that belong to this subplot.\n // E.g. if layout attr is 'ternary', find all traces that are of type\n // that has subplot ternary, if layout attr is 'ternary2', find traces\n // of right type that have attr 'subplot': 'ternary' in their data.\n\n /**\n Example: \n {\n \"data\": [\n {\n \"type\": \"scatterternary\",\n \"mode\": \"markers\",\n },\n {\n \"type\": \"scatterternary\",\n \"mode\": \"markers\",\n \"subplot\": \"ternary2\"\n }\n ],\n \"layout\": {\n \"ternary\": {},\n \"ternary2\": {},\n },\n }\n */\n\n Object.keys(layout).forEach(layoutKey => {\n const traceIndexes = [];\n let subplotName;\n if (\n ['geo', 'mapbox', 'polar', 'gl3d', 'ternary'].some(subplotType => {\n subplotName = getSubplotTitle(layoutKey, subplotType, _);\n const trIndex =\n SUBPLOT_TO_ATTR[subplotType].layout === layoutKey\n ? data.findIndex(trace => TRACE_TO_AXIS[subplotType].some(tt => tt === trace.type))\n : data.findIndex(trace => trace[SUBPLOT_TO_ATTR[subplotType].data] === layoutKey);\n if (trIndex !== -1) {\n traceIndexes.push(trIndex);\n }\n return layoutKey.startsWith(SUBPLOT_TO_ATTR[subplotType].layout);\n })\n ) {\n subplotFolds[traceIndexes[0]] = (\n \n {children}\n \n );\n }\n });\n\n let pieCounter = 0;\n let tableCounter = 0;\n data.forEach((d, i) => {\n if ((d.type === 'pie' && d.values) || d.type === 'table') {\n if (d.type === 'pie') {\n pieCounter++;\n } else if (d.type === 'table') {\n tableCounter++;\n }\n subplotFolds[i] = (\n 1 ? pieCounter : ''}`\n : `${_('Table')} ${tableCounter > 1 ? tableCounter : ''}`\n }\n >\n {children}\n \n );\n }\n });\n\n return {subplotFolds};\n }\n}\n\nSubplotAccordion.contextType = EditorControlsContext;\n\nSubplotAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default SubplotAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TraceAccordion.js b/lib/components/containers/TraceAccordion.js deleted file mode 100644 index 1edf7d4c4..000000000 --- a/lib/components/containers/TraceAccordion.js +++ /dev/null @@ -1,312 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _TraceRequiredPanel = require('./TraceRequiredPanel'); - -var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); - -var _PlotlyPanel = require('./PlotlyPanel'); - -var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _constants = require('../../lib/constants'); - -var _lib = require('../../lib'); - -var _reactTabs = require('react-tabs'); - -var _traceTypes = require('../../lib/traceTypes'); - -var _PanelEmpty = require('./PanelEmpty'); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TraceFold = (0, _lib.connectTraceToPlot)(_PlotlyFold2.default); - -var TraceAccordion = function (_Component) { - _inherits(TraceAccordion, _Component); - - function TraceAccordion(props, context) { - _classCallCheck(this, TraceAccordion); - - var _this = _possibleConstructorReturn(this, (TraceAccordion.__proto__ || Object.getPrototypeOf(TraceAccordion)).call(this, props, context)); - - _this.setLocals(props, context); - return _this; - } - - _createClass(TraceAccordion, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var _this2 = this; - - var base = props.canGroup ? context.fullData : context.data; - var traceFilterCondition = this.props.traceFilterCondition || function () { - return true; - }; - - this.filteredTracesDataIndexes = []; - this.filteredTraces = []; - - if (base && base.length && context.fullData.length) { - this.filteredTraces = base.filter(function (t, i) { - var fullTrace = props.canGroup ? t : context.fullData.filter(function (tr) { - return tr.index === i; - })[0]; - - if (fullTrace) { - var trace = context.data[fullTrace.index]; - if (traceFilterCondition(trace, fullTrace)) { - _this2.filteredTracesDataIndexes.push(fullTrace.index); - return true; - } - } - - return false; - }); - } - } - }, { - key: 'renderGroupedTraceFolds', - value: function renderGroupedTraceFolds() { - var _this3 = this; - - if (!this.filteredTraces.length || this.filteredTraces.length <= 1) { - return null; - } - - var _ = this.context.localize; - - var dataArrayPositionsByTraceType = {}; - var fullDataArrayPositionsByTraceType = {}; - - this.filteredTraces.forEach(function (trace) { - var traceType = (0, _lib.plotlyTraceToCustomTrace)(trace); - if (!dataArrayPositionsByTraceType[traceType]) { - dataArrayPositionsByTraceType[traceType] = []; - } - - if (!fullDataArrayPositionsByTraceType[traceType]) { - fullDataArrayPositionsByTraceType[traceType] = []; - } - - dataArrayPositionsByTraceType[traceType].push(trace.index); - // _expandedIndex is the trace's index in the fullData array - fullDataArrayPositionsByTraceType[traceType].push(trace._expandedIndex); - }); - - return Object.keys(fullDataArrayPositionsByTraceType).map(function (type, index) { - return _react2.default.createElement( - TraceFold, - { - key: index, - traceIndexes: dataArrayPositionsByTraceType[type], - name: (0, _traceTypes.traceTypes)(_).find(function (t) { - return t.value === type; - }).label, - fullDataArrayPosition: fullDataArrayPositionsByTraceType[type] - }, - _this3.props.children - ); - }); - } - }, { - key: 'renderUngroupedTraceFolds', - value: function renderUngroupedTraceFolds() { - var _this4 = this; - - if (this.filteredTraces.length) { - return this.filteredTraces.map(function (d, i) { - return _react2.default.createElement( - TraceFold, - { - key: i, - traceIndexes: [d.index], - canDelete: _this4.props.canAdd, - fullDataArrayPosition: [d._expandedIndex] - }, - _this4.props.children - ); - }); - } - return null; - } - }, { - key: 'renderTraceFolds', - value: function renderTraceFolds() { - var _this5 = this; - - if (this.filteredTraces.length) { - return this.filteredTraces.map(function (d, i) { - return _react2.default.createElement( - TraceFold, - { - key: i, - traceIndexes: [_this5.filteredTracesDataIndexes[i]], - canDelete: _this5.props.canAdd - }, - _this5.props.children - ); - }); - } - return null; - } - }, { - key: 'renderTracePanelHelp', - value: function renderTracePanelHelp() { - var _ = this.context.localize; - return _react2.default.createElement( - _PanelEmpty.PanelMessage, - { heading: _('Trace your data.') }, - _react2.default.createElement( - 'p', - null, - _('Traces of various types like bar and line are the building blocks of your figure.') - ), - _react2.default.createElement( - 'p', - null, - _('You can add as many as you like, mixing and matching types and arranging them into subplots.') - ), - _react2.default.createElement( - 'p', - null, - _('Click on the + button above to add a trace.') - ) - ); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - canAdd = _props.canAdd, - canGroup = _props.canGroup; - - var _ = this.context.localize; - - if (canAdd) { - var addAction = { - label: _('Trace'), - handler: function handler(_ref) { - var onUpdate = _ref.onUpdate; - - if (onUpdate) { - onUpdate({ - type: _constants.EDITOR_ACTIONS.ADD_TRACE - }); - } - } - }; - var traceFolds = this.renderTraceFolds(); - return _react2.default.createElement( - _PlotlyPanel2.default, - { addAction: addAction }, - traceFolds ? traceFolds : this.renderTracePanelHelp() - ); - } - - if (canGroup) { - if (this.filteredTraces.length === 1) { - return _react2.default.createElement( - _TraceRequiredPanel2.default, - null, - this.renderUngroupedTraceFolds() - ); - } - - if (this.filteredTraces.length > 1) { - return _react2.default.createElement( - _TraceRequiredPanel2.default, - { noPadding: true }, - _react2.default.createElement( - _reactTabs.Tabs, - null, - _react2.default.createElement( - _reactTabs.TabList, - null, - _react2.default.createElement( - _reactTabs.Tab, - null, - _('Individually') - ), - _react2.default.createElement( - _reactTabs.Tab, - null, - _('By Type') - ) - ), - _react2.default.createElement( - _reactTabs.TabPanel, - null, - _react2.default.createElement( - _PlotlyPanel2.default, - null, - this.renderUngroupedTraceFolds() - ) - ), - _react2.default.createElement( - _reactTabs.TabPanel, - null, - _react2.default.createElement( - _PlotlyPanel2.default, - null, - this.renderGroupedTraceFolds() - ) - ) - ) - ); - } - } - - return _react2.default.createElement( - _TraceRequiredPanel2.default, - null, - this.renderTraceFolds() - ); - } - }]); - - return TraceAccordion; -}(_react.Component); - -TraceAccordion.contextType = _context.EditorControlsContext; - -TraceAccordion.propTypes = { - canAdd: _propTypes2.default.bool, - canGroup: _propTypes2.default.bool, - children: _propTypes2.default.node, - traceFilterCondition: _propTypes2.default.func -}; - -exports.default = TraceAccordion; -//# sourceMappingURL=TraceAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/TraceAccordion.js.map b/lib/components/containers/TraceAccordion.js.map deleted file mode 100644 index 91910dce5..000000000 --- a/lib/components/containers/TraceAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/TraceAccordion.js"],"names":["TraceFold","PlotlyFold","TraceAccordion","props","context","setLocals","nextProps","nextContext","base","canGroup","fullData","data","traceFilterCondition","filteredTracesDataIndexes","filteredTraces","length","filter","t","i","fullTrace","tr","index","trace","push","_","localize","dataArrayPositionsByTraceType","fullDataArrayPositionsByTraceType","forEach","traceType","_expandedIndex","Object","keys","map","type","find","value","label","children","d","canAdd","addAction","handler","onUpdate","EDITOR_ACTIONS","ADD_TRACE","traceFolds","renderTraceFolds","renderTracePanelHelp","renderUngroupedTraceFolds","renderGroupedTraceFolds","Component","contextType","EditorControlsContext","propTypes","PropTypes","bool","node","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,YAAY,6BAAmBC,oBAAnB,CAAlB;;IAEMC,c;;;AACJ,0BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gIACpBD,KADoB,EACbC,OADa;;AAE1B,UAAKC,SAAL,CAAeF,KAAf,EAAsBC,OAAtB;AAF0B;AAG3B;;;;8CAEyBE,S,EAAWC,W,EAAa;AAChD,WAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;;;8BAESJ,K,EAAOC,O,EAAS;AAAA;;AACxB,UAAMI,OAAOL,MAAMM,QAAN,GAAiBL,QAAQM,QAAzB,GAAoCN,QAAQO,IAAzD;AACA,UAAMC,uBAAuB,KAAKT,KAAL,CAAWS,oBAAX,IAAoC;AAAA,eAAM,IAAN;AAAA,OAAjE;;AAEA,WAAKC,yBAAL,GAAiC,EAAjC;AACA,WAAKC,cAAL,GAAsB,EAAtB;;AAEA,UAA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AAAA;AAAMA,oBAAE,SAAF;AAAN;AAFF,eADF;AAKE;AAAC,mCAAD;AAAA;AACE;AAAC,uCAAD;AAAA;AAAc,uBAAKyB,yBAAL;AAAd;AADF,eALF;AAQE;AAAC,mCAAD;AAAA;AACE;AAAC,uCAAD;AAAA;AAAc,uBAAKC,uBAAL;AAAd;AADF;AARF;AADF,WADF;AAgBD;AACF;;AAED,aAAO;AAAC,oCAAD;AAAA;AAAqB,aAAKH,gBAAL;AAArB,OAAP;AACD;;;;EAvK0BI,gB;;AA0K7BjD,eAAekD,WAAf,GAA6BC,8BAA7B;;AAEAnD,eAAeoD,SAAf,GAA2B;AACzBd,UAAQe,oBAAUC,IADO;AAEzB/C,YAAU8C,oBAAUC,IAFK;AAGzBlB,YAAUiB,oBAAUE,IAHK;AAIzB7C,wBAAsB2C,oBAAUG;AAJP,CAA3B;;kBAOexD,c","file":"TraceAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PlotlyPanel from './PlotlyPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {EDITOR_ACTIONS} from 'lib/constants';\nimport {connectTraceToPlot, plotlyTraceToCustomTrace} from 'lib';\nimport {Tab, Tabs, TabList, TabPanel} from 'react-tabs';\nimport {traceTypes} from 'lib/traceTypes';\nimport {PanelMessage} from './PanelEmpty';\nimport {EditorControlsContext} from '../../context';\n\nconst TraceFold = connectTraceToPlot(PlotlyFold);\n\nclass TraceAccordion extends Component {\n constructor(props, context) {\n super(props, context);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const base = props.canGroup ? context.fullData : context.data;\n const traceFilterCondition = this.props.traceFilterCondition || (() => true);\n\n this.filteredTracesDataIndexes = [];\n this.filteredTraces = [];\n\n if (base && base.length && context.fullData.length) {\n this.filteredTraces = base.filter((t, i) => {\n const fullTrace = props.canGroup ? t : context.fullData.filter(tr => tr.index === i)[0];\n\n if (fullTrace) {\n const trace = context.data[fullTrace.index];\n if (traceFilterCondition(trace, fullTrace)) {\n this.filteredTracesDataIndexes.push(fullTrace.index);\n return true;\n }\n }\n\n return false;\n });\n }\n }\n\n renderGroupedTraceFolds() {\n if (!this.filteredTraces.length || this.filteredTraces.length <= 1) {\n return null;\n }\n\n const {localize: _} = this.context;\n const dataArrayPositionsByTraceType = {};\n const fullDataArrayPositionsByTraceType = {};\n\n this.filteredTraces.forEach(trace => {\n const traceType = plotlyTraceToCustomTrace(trace);\n if (!dataArrayPositionsByTraceType[traceType]) {\n dataArrayPositionsByTraceType[traceType] = [];\n }\n\n if (!fullDataArrayPositionsByTraceType[traceType]) {\n fullDataArrayPositionsByTraceType[traceType] = [];\n }\n\n dataArrayPositionsByTraceType[traceType].push(trace.index);\n // _expandedIndex is the trace's index in the fullData array\n fullDataArrayPositionsByTraceType[traceType].push(trace._expandedIndex);\n });\n\n return Object.keys(fullDataArrayPositionsByTraceType).map((type, index) => (\n t.value === type).label}\n fullDataArrayPosition={fullDataArrayPositionsByTraceType[type]}\n >\n {this.props.children}\n \n ));\n }\n\n renderUngroupedTraceFolds() {\n if (this.filteredTraces.length) {\n return this.filteredTraces.map((d, i) => (\n \n {this.props.children}\n \n ));\n }\n return null;\n }\n\n renderTraceFolds() {\n if (this.filteredTraces.length) {\n return this.filteredTraces.map((d, i) => (\n \n {this.props.children}\n \n ));\n }\n return null;\n }\n\n renderTracePanelHelp() {\n const _ = this.context.localize;\n return (\n \n

\n {_('Traces of various types like bar and line are the building blocks of your figure.')}\n

\n

\n {_(\n 'You can add as many as you like, mixing and matching types and arranging them into subplots.'\n )}\n

\n

{_('Click on the + button above to add a trace.')}

\n
\n );\n }\n\n render() {\n const {canAdd, canGroup} = this.props;\n const _ = this.context.localize;\n\n if (canAdd) {\n const addAction = {\n label: _('Trace'),\n handler: ({onUpdate}) => {\n if (onUpdate) {\n onUpdate({\n type: EDITOR_ACTIONS.ADD_TRACE,\n });\n }\n },\n };\n const traceFolds = this.renderTraceFolds();\n return (\n \n {traceFolds ? traceFolds : this.renderTracePanelHelp()}\n \n );\n }\n\n if (canGroup) {\n if (this.filteredTraces.length === 1) {\n return {this.renderUngroupedTraceFolds()};\n }\n\n if (this.filteredTraces.length > 1) {\n return (\n \n \n \n {_('Individually')}\n {_('By Type')}\n \n \n {this.renderUngroupedTraceFolds()}\n \n \n {this.renderGroupedTraceFolds()}\n \n \n \n );\n }\n }\n\n return {this.renderTraceFolds()};\n }\n}\n\nTraceAccordion.contextType = EditorControlsContext;\n\nTraceAccordion.propTypes = {\n canAdd: PropTypes.bool,\n canGroup: PropTypes.bool,\n children: PropTypes.node,\n traceFilterCondition: PropTypes.func,\n};\n\nexport default TraceAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TraceMarkerSection.js b/lib/components/containers/TraceMarkerSection.js deleted file mode 100644 index 6d3a60b31..000000000 --- a/lib/components/containers/TraceMarkerSection.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlySection = require('./PlotlySection'); - -var _PlotlySection2 = _interopRequireDefault(_PlotlySection); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TraceMarkerSection = function (_Component) { - _inherits(TraceMarkerSection, _Component); - - function TraceMarkerSection(props, context) { - _classCallCheck(this, TraceMarkerSection); - - var _this = _possibleConstructorReturn(this, (TraceMarkerSection.__proto__ || Object.getPrototypeOf(TraceMarkerSection)).call(this, props, context)); - - _this.setLocals(context); - return _this; - } - - _createClass(TraceMarkerSection, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(context) { - var _ = this.context.localize; - var traceType = context.fullContainer.type; - if (['bar', 'histogram'].includes(traceType)) { - this.name = _('Bars'); - } else if (traceType === 'pie') { - this.name = _('Pie Segments'); - } else { - this.name = _('Points'); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _PlotlySection2.default, - { name: this.name }, - this.props.children - ); - } - }]); - - return TraceMarkerSection; -}(_react.Component); - -TraceMarkerSection.propTypes = { - children: _propTypes2.default.node, - name: _propTypes2.default.string -}; - -TraceMarkerSection.contextTypes = { - fullContainer: _propTypes2.default.object, - localize: _propTypes2.default.func -}; - -exports.default = TraceMarkerSection; -//# sourceMappingURL=TraceMarkerSection.js.map \ No newline at end of file diff --git a/lib/components/containers/TraceMarkerSection.js.map b/lib/components/containers/TraceMarkerSection.js.map deleted file mode 100644 index 72e9e31d8..000000000 --- a/lib/components/containers/TraceMarkerSection.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/TraceMarkerSection.js"],"names":["TraceMarkerSection","props","context","setLocals","nextProps","nextContext","_","localize","traceType","fullContainer","type","includes","name","children","Component","propTypes","PropTypes","node","string","contextTypes","object","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,kB;;;AACJ,8BAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,wIACpBD,KADoB,EACbC,OADa;;AAE1B,UAAKC,SAAL,CAAeD,OAAf;AAF0B;AAG3B;;;;8CAEyBE,S,EAAWC,W,EAAa;AAChD,WAAKF,SAAL,CAAeE,WAAf;AACD;;;8BAESH,O,EAAS;AACjB,UAAMI,IAAI,KAAKJ,OAAL,CAAaK,QAAvB;AACA,UAAMC,YAAYN,QAAQO,aAAR,CAAsBC,IAAxC;AACA,UAAI,CAAC,KAAD,EAAQ,WAAR,EAAqBC,QAArB,CAA8BH,SAA9B,CAAJ,EAA8C;AAC5C,aAAKI,IAAL,GAAYN,EAAE,MAAF,CAAZ;AACD,OAFD,MAEO,IAAIE,cAAc,KAAlB,EAAyB;AAC9B,aAAKI,IAAL,GAAYN,EAAE,cAAF,CAAZ;AACD,OAFM,MAEA;AACL,aAAKM,IAAL,GAAYN,EAAE,QAAF,CAAZ;AACD;AACF;;;6BAEQ;AACP,aAAO;AAAC,+BAAD;AAAA,UAAe,MAAM,KAAKM,IAA1B;AAAiC,aAAKX,KAAL,CAAWY;AAA5C,OAAP;AACD;;;;EAxB8BC,gB;;AA2BjCd,mBAAmBe,SAAnB,GAA+B;AAC7BF,YAAUG,oBAAUC,IADS;AAE7BL,QAAMI,oBAAUE;AAFa,CAA/B;;AAKAlB,mBAAmBmB,YAAnB,GAAkC;AAChCV,iBAAeO,oBAAUI,MADO;AAEhCb,YAAUS,oBAAUK;AAFY,CAAlC;;kBAKerB,kB","file":"TraceMarkerSection.js","sourcesContent":["import PlotlySection from './PlotlySection';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nclass TraceMarkerSection extends Component {\n constructor(props, context) {\n super(props, context);\n this.setLocals(context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextContext);\n }\n\n setLocals(context) {\n const _ = this.context.localize;\n const traceType = context.fullContainer.type;\n if (['bar', 'histogram'].includes(traceType)) {\n this.name = _('Bars');\n } else if (traceType === 'pie') {\n this.name = _('Pie Segments');\n } else {\n this.name = _('Points');\n }\n }\n\n render() {\n return {this.props.children};\n }\n}\n\nTraceMarkerSection.propTypes = {\n children: PropTypes.node,\n name: PropTypes.string,\n};\n\nTraceMarkerSection.contextTypes = {\n fullContainer: PropTypes.object,\n localize: PropTypes.func,\n};\n\nexport default TraceMarkerSection;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TraceRequiredPanel.js b/lib/components/containers/TraceRequiredPanel.js deleted file mode 100644 index 46e0dca70..000000000 --- a/lib/components/containers/TraceRequiredPanel.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PanelEmpty = require('./PanelEmpty'); - -var _PanelEmpty2 = _interopRequireDefault(_PanelEmpty); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _derived = require('./derived'); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TraceRequiredPanel = function (_Component) { - _inherits(TraceRequiredPanel, _Component); - - function TraceRequiredPanel() { - _classCallCheck(this, TraceRequiredPanel); - - return _possibleConstructorReturn(this, (TraceRequiredPanel.__proto__ || Object.getPrototypeOf(TraceRequiredPanel)).apply(this, arguments)); - } - - _createClass(TraceRequiredPanel, [{ - key: 'hasTrace', - value: function hasTrace() { - return this.context.fullData.filter(function (trace) { - return trace.visible; - }).length > 0; - } - }, { - key: 'render', - value: function render() { - var _ = this.context.localize; - - var _props = this.props, - children = _props.children, - rest = _objectWithoutProperties(_props, ['children']); - - if (!this.props.visible) { - return null; - } - - return this.hasTrace() ? _react2.default.createElement( - _derived.LayoutPanel, - rest, - children - ) : _react2.default.createElement( - _context.ModalProviderContext.Consumer, - null, - function (_ref) { - var setPanel = _ref.setPanel; - return _react2.default.createElement( - _PanelEmpty2.default, - { heading: _("Looks like there aren't any traces defined yet.") }, - _react2.default.createElement( - 'p', - null, - _('Go to the '), - _react2.default.createElement( - 'a', - { onClick: function onClick() { - return setPanel('Structure', 'Traces'); - } }, - _('Traces') - ), - _(' panel under Structure to define traces.') - ) - ); - } - ); - } - }]); - - return TraceRequiredPanel; -}(_react.Component); - -TraceRequiredPanel.propTypes = { - children: _propTypes2.default.node, - visible: _propTypes2.default.bool -}; - -TraceRequiredPanel.defaultProps = { - visible: true -}; - -TraceRequiredPanel.contextType = _context.EditorControlsContext; - -exports.default = TraceRequiredPanel; -//# sourceMappingURL=TraceRequiredPanel.js.map \ No newline at end of file diff --git a/lib/components/containers/TraceRequiredPanel.js.map b/lib/components/containers/TraceRequiredPanel.js.map deleted file mode 100644 index a43fd4687..000000000 --- a/lib/components/containers/TraceRequiredPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/TraceRequiredPanel.js"],"names":["TraceRequiredPanel","context","fullData","filter","trace","visible","length","_","localize","props","children","rest","hasTrace","setPanel","Component","propTypes","PropTypes","node","bool","defaultProps","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;IAEMA,kB;;;;;;;;;;;+BACO;AACT,aAAO,KAAKC,OAAL,CAAaC,QAAb,CAAsBC,MAAtB,CAA6B;AAAA,eAASC,MAAMC,OAAf;AAAA,OAA7B,EAAqDC,MAArD,GAA8D,CAArE;AACD;;;6BAEQ;AAAA,UACUC,CADV,GACe,KAAKN,OADpB,CACAO,QADA;;AAAA,mBAEqB,KAAKC,KAF1B;AAAA,UAEAC,QAFA,UAEAA,QAFA;AAAA,UAEaC,IAFb;;AAIP,UAAI,CAAC,KAAKF,KAAL,CAAWJ,OAAhB,EAAyB;AACvB,eAAO,IAAP;AACD;;AAED,aAAO,KAAKO,QAAL,KACL;AAAC,4BAAD;AAAiBD,YAAjB;AAAwBD;AAAxB,OADK,GAGL;AAAC,qCAAD,CAAsB,QAAtB;AAAA;AACG;AAAA,cAAEG,QAAF,QAAEA,QAAF;AAAA,iBACC;AAAC,gCAAD;AAAA,cAAY,SAASN,EAAE,iDAAF,CAArB;AACE;AAAA;AAAA;AACGA,gBAAE,YAAF,CADH;AAEE;AAAA;AAAA,kBAAG,SAAS;AAAA,2BAAMM,SAAS,WAAT,EAAsB,QAAtB,CAAN;AAAA,mBAAZ;AAAoDN,kBAAE,QAAF;AAApD,eAFF;AAGGA,gBAAE,0CAAF;AAHH;AADF,WADD;AAAA;AADH,OAHF;AAeD;;;;EA5B8BO,gB;;AA+BjCd,mBAAmBe,SAAnB,GAA+B;AAC7BL,YAAUM,oBAAUC,IADS;AAE7BZ,WAASW,oBAAUE;AAFU,CAA/B;;AAKAlB,mBAAmBmB,YAAnB,GAAkC;AAChCd,WAAS;AADuB,CAAlC;;AAIAL,mBAAmBoB,WAAnB,GAAiCC,8BAAjC;;kBAEerB,kB","file":"TraceRequiredPanel.js","sourcesContent":["import PanelEmpty from './PanelEmpty';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {LayoutPanel} from './derived';\nimport {EditorControlsContext, ModalProviderContext} from '../../context';\n\nclass TraceRequiredPanel extends Component {\n hasTrace() {\n return this.context.fullData.filter(trace => trace.visible).length > 0;\n }\n\n render() {\n const {localize: _} = this.context;\n const {children, ...rest} = this.props;\n\n if (!this.props.visible) {\n return null;\n }\n\n return this.hasTrace() ? (\n {children}\n ) : (\n \n {({setPanel}) => (\n \n

\n {_('Go to the ')}\n setPanel('Structure', 'Traces')}>{_('Traces')}\n {_(' panel under Structure to define traces.')}\n

\n
\n )}\n
\n );\n }\n}\n\nTraceRequiredPanel.propTypes = {\n children: PropTypes.node,\n visible: PropTypes.bool,\n};\n\nTraceRequiredPanel.defaultProps = {\n visible: true,\n};\n\nTraceRequiredPanel.contextType = EditorControlsContext;\n\nexport default TraceRequiredPanel;\n"]} \ No newline at end of file diff --git a/lib/components/containers/TransformAccordion.js b/lib/components/containers/TransformAccordion.js deleted file mode 100644 index 2af171a20..000000000 --- a/lib/components/containers/TransformAccordion.js +++ /dev/null @@ -1,223 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _PlotlyPanel = require('./PlotlyPanel'); - -var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _PanelEmpty = require('./PanelEmpty'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TransformFold = (0, _lib.connectTransformToTrace)(_PlotlyFold2.default); - -var TransformAccordion = function (_Component) { - _inherits(TransformAccordion, _Component); - - function TransformAccordion() { - _classCallCheck(this, TransformAccordion); - - return _possibleConstructorReturn(this, (TransformAccordion.__proto__ || Object.getPrototypeOf(TransformAccordion)).apply(this, arguments)); - } - - _createClass(TransformAccordion, [{ - key: 'render', - value: function render() { - var _context = this.context, - _context$fullContaine = _context.fullContainer.transforms, - transforms = _context$fullContaine === undefined ? [] : _context$fullContaine, - _ = _context.localize, - container = _context.container, - dataSourceOptions = _context.dataSourceOptions; - var children = this.props.children; - - - var transformTypes = [{ label: _('Filter'), type: 'filter' }, { label: _('Split'), type: 'groupby' }, { label: _('Aggregate'), type: 'aggregate' }, { label: _('Sort'), type: 'sort' }]; - - var transformBy = container.transforms && container.transforms.map(function (tr) { - var foldNameSuffix = ''; - if (tr.groupssrc) { - var groupssrc = dataSourceOptions && dataSourceOptions.find(function (d) { - return d.value === tr.groupssrc; - }); - foldNameSuffix = ': ' + (groupssrc && groupssrc.label ? groupssrc.label : tr.groupssrc); - } else if (tr.targetsrc) { - var targetsrc = dataSourceOptions && dataSourceOptions.find(function (d) { - return d.value === tr.targetsrc; - }); - foldNameSuffix = ': ' + (targetsrc && targetsrc.label ? targetsrc.label : tr.targetsrc); - } - return foldNameSuffix; - }); - - var filteredTransforms = transforms.filter(function (_ref) { - var type = _ref.type; - return Boolean(type); - }); - var content = filteredTransforms.length && filteredTransforms.map(function (tr, i) { - return _react2.default.createElement( - TransformFold, - { - key: i, - transformIndex: i, - name: '' + transformTypes.filter(function (_ref2) { - var type = _ref2.type; - return type === tr.type; - })[0].label + (transformBy && transformBy[i]), - canDelete: true - }, - children - ); - }); - - // cannot have 2 Split transforms on one trace: - // https://github.com/plotly/plotly.js/issues/1742 - var addActionOptions = container.transforms && container.transforms.some(function (t) { - return t.type === 'groupby'; - }) ? transformTypes.filter(function (t) { - return t.type !== 'groupby'; - }) : transformTypes; - - var addAction = { - label: _('Transform'), - handler: addActionOptions.map(function (_ref3) { - var label = _ref3.label, - type = _ref3.type; - - return { - label: label, - handler: function handler(context) { - var fullContainer = context.fullContainer, - updateContainer = context.updateContainer; - - if (updateContainer) { - var transformIndex = Array.isArray(fullContainer.transforms) ? fullContainer.transforms.length : 0; - var key = 'transforms[' + transformIndex + ']'; - - var payload = { type: type }; - if (type === 'filter') { - payload.target = []; - payload.targetsrc = null; - } else { - payload.groupssrc = null; - payload.groups = null; - } - - if (type === 'groupby') { - payload.styles = []; - } - - updateContainer(_defineProperty({}, key, payload)); - } - } - }; - }) - }; - - return _react2.default.createElement( - _PlotlyPanel2.default, - { addAction: addAction }, - content ? content : _react2.default.createElement( - _PanelEmpty.PanelMessage, - { icon: null }, - _react2.default.createElement( - 'div', - { style: { textAlign: 'left' } }, - _react2.default.createElement( - 'p', - null, - _react2.default.createElement( - 'strong', - null, - _('Filter') - ), - ' ', - _(' transforms allow you to filter data out from a trace.') - ), - _react2.default.createElement( - 'p', - null, - _react2.default.createElement( - 'strong', - null, - _('Split') - ), - ' ', - _(' transforms allow you to create multiple traces from one source trace, so as to style them differently.') - ), - _react2.default.createElement( - 'p', - null, - _react2.default.createElement( - 'strong', - null, - _('Aggregate') - ), - ' ', - _(' transforms allow you to summarize a trace using an aggregate function like "average" or "minimum".') - ), - _react2.default.createElement( - 'p', - null, - _react2.default.createElement( - 'strong', - null, - _('Sort') - ), - ' ', - _(' transforms allow you to sort a trace, so as to control marker overlay or line connection order.') - ) - ), - _react2.default.createElement( - 'p', - null, - _('Click on the + button above to add a transform.') - ) - ) - ); - } - }]); - - return TransformAccordion; -}(_react.Component); - -TransformAccordion.contextTypes = { - fullContainer: _propTypes2.default.object, - localize: _propTypes2.default.func, - container: _propTypes2.default.object, - dataSourceOptions: _propTypes2.default.array -}; - -TransformAccordion.propTypes = { - children: _propTypes2.default.node -}; - -exports.default = TransformAccordion; -//# sourceMappingURL=TransformAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/TransformAccordion.js.map b/lib/components/containers/TransformAccordion.js.map deleted file mode 100644 index 729073630..000000000 --- a/lib/components/containers/TransformAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/TransformAccordion.js"],"names":["TransformFold","PlotlyFold","TransformAccordion","context","fullContainer","transforms","_","localize","container","dataSourceOptions","children","props","transformTypes","label","type","transformBy","map","foldNameSuffix","tr","groupssrc","find","d","value","targetsrc","filteredTransforms","filter","Boolean","content","length","i","addActionOptions","some","t","addAction","handler","updateContainer","transformIndex","Array","isArray","key","payload","target","groups","styles","textAlign","Component","contextTypes","PropTypes","object","func","array","propTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,gBAAgB,kCAAwBC,oBAAxB,CAAtB;;IAEMC,kB;;;;;;;;;;;6BACK;AAAA,qBAMH,KAAKC,OANF;AAAA,2CAELC,aAFK,CAEWC,UAFX;AAAA,UAEWA,UAFX,yCAEwB,EAFxB;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,UAILC,SAJK,YAILA,SAJK;AAAA,UAKLC,iBALK,YAKLA,iBALK;AAAA,UAOAC,QAPA,GAOY,KAAKC,KAPjB,CAOAD,QAPA;;;AASP,UAAME,iBAAiB,CACrB,EAACC,OAAOP,EAAE,QAAF,CAAR,EAAqBQ,MAAM,QAA3B,EADqB,EAErB,EAACD,OAAOP,EAAE,OAAF,CAAR,EAAoBQ,MAAM,SAA1B,EAFqB,EAGrB,EAACD,OAAOP,EAAE,WAAF,CAAR,EAAwBQ,MAAM,WAA9B,EAHqB,EAIrB,EAACD,OAAOP,EAAE,MAAF,CAAR,EAAmBQ,MAAM,MAAzB,EAJqB,CAAvB;;AAOA,UAAMC,cACJP,UAAUH,UAAV,IACAG,UAAUH,UAAV,CAAqBW,GAArB,CAAyB,cAAM;AAC7B,YAAIC,iBAAiB,EAArB;AACA,YAAIC,GAAGC,SAAP,EAAkB;AAChB,cAAMA,YACJV,qBAAqBA,kBAAkBW,IAAlB,CAAuB;AAAA,mBAAKC,EAAEC,KAAF,KAAYJ,GAAGC,SAApB;AAAA,WAAvB,CADvB;AAEAF,mCAAsBE,aAAaA,UAAUN,KAAvB,GAA+BM,UAAUN,KAAzC,GAAiDK,GAAGC,SAA1E;AACD,SAJD,MAIO,IAAID,GAAGK,SAAP,EAAkB;AACvB,cAAMA,YACJd,qBAAqBA,kBAA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T,eADF;AAC+B,iBAD/B;AAEGA,gBACC,kGADD;AAFH;AAjBF,WADF;AAyBE;AAAA;AAAA;AAAIA,cAAE,iDAAF;AAAJ;AAzBF;AAJJ,OADF;AAmCD;;;;EA3H8BuC,gB;;AA8HjC3C,mBAAmB4C,YAAnB,GAAkC;AAChC1C,iBAAe2C,oBAAUC,MADO;AAEhCzC,YAAUwC,oBAAUE,IAFY;AAGhCzC,aAAWuC,oBAAUC,MAHW;AAIhCvC,qBAAmBsC,oBAAUG;AAJG,CAAlC;;AAOAhD,mBAAmBiD,SAAnB,GAA+B;AAC7BzC,YAAUqC,oBAAUK;AADS,CAA/B;;kBAIelD,kB","file":"TransformAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport PlotlyPanel from './PlotlyPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectTransformToTrace} from 'lib';\nimport {PanelMessage} from './PanelEmpty';\n\nconst TransformFold = connectTransformToTrace(PlotlyFold);\n\nclass TransformAccordion extends Component {\n render() {\n const {\n fullContainer: {transforms = []},\n localize: _,\n container,\n dataSourceOptions,\n } = this.context;\n const {children} = this.props;\n\n const transformTypes = [\n {label: _('Filter'), type: 'filter'},\n {label: _('Split'), type: 'groupby'},\n {label: _('Aggregate'), type: 'aggregate'},\n {label: _('Sort'), type: 'sort'},\n ];\n\n const transformBy =\n container.transforms &&\n container.transforms.map(tr => {\n let foldNameSuffix = '';\n if (tr.groupssrc) {\n const groupssrc =\n dataSourceOptions && dataSourceOptions.find(d => d.value === tr.groupssrc);\n foldNameSuffix = `: ${groupssrc && groupssrc.label ? groupssrc.label : tr.groupssrc}`;\n } else if (tr.targetsrc) {\n const targetsrc =\n dataSourceOptions && dataSourceOptions.find(d => d.value === tr.targetsrc);\n foldNameSuffix = `: ${targetsrc && targetsrc.label ? targetsrc.label : tr.targetsrc}`;\n }\n return foldNameSuffix;\n });\n\n const filteredTransforms = transforms.filter(({type}) => Boolean(type));\n const content =\n filteredTransforms.length &&\n filteredTransforms.map((tr, i) => (\n type === tr.type)[0].label}${transformBy &&\n transformBy[i]}`}\n canDelete={true}\n >\n {children}\n \n ));\n\n // cannot have 2 Split transforms on one trace:\n // https://github.com/plotly/plotly.js/issues/1742\n const addActionOptions =\n container.transforms && container.transforms.some(t => t.type === 'groupby')\n ? transformTypes.filter(t => t.type !== 'groupby')\n : transformTypes;\n\n const addAction = {\n label: _('Transform'),\n handler: addActionOptions.map(({label, type}) => {\n return {\n label,\n handler: context => {\n const {fullContainer, updateContainer} = context;\n if (updateContainer) {\n const transformIndex = Array.isArray(fullContainer.transforms)\n ? fullContainer.transforms.length\n : 0;\n const key = `transforms[${transformIndex}]`;\n\n const payload = {type};\n if (type === 'filter') {\n payload.target = [];\n payload.targetsrc = null;\n } else {\n payload.groupssrc = null;\n payload.groups = null;\n }\n\n if (type === 'groupby') {\n payload.styles = [];\n }\n\n updateContainer({[key]: payload});\n }\n },\n };\n }),\n };\n\n return (\n \n {content ? (\n content\n ) : (\n \n
\n

\n {_('Filter')}{' '}\n {_(' transforms allow you to filter data out from a trace.')}\n

\n

\n {_('Split')}{' '}\n {_(\n ' transforms allow you to create multiple traces from one source trace, so as to style them differently.'\n )}\n

\n

\n {_('Aggregate')}{' '}\n {_(\n ' transforms allow you to summarize a trace using an aggregate function like \"average\" or \"minimum\".'\n )}\n

\n

\n {_('Sort')}{' '}\n {_(\n ' transforms allow you to sort a trace, so as to control marker overlay or line connection order.'\n )}\n

\n
\n

{_('Click on the + button above to add a transform.')}

\n
\n )}\n
\n );\n }\n}\n\nTransformAccordion.contextTypes = {\n fullContainer: PropTypes.object,\n localize: PropTypes.func,\n container: PropTypes.object,\n dataSourceOptions: PropTypes.array,\n};\n\nTransformAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default TransformAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/UpdateMenuAccordion.js b/lib/components/containers/UpdateMenuAccordion.js deleted file mode 100644 index dd83a904f..000000000 --- a/lib/components/containers/UpdateMenuAccordion.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _TraceRequiredPanel = require('./TraceRequiredPanel'); - -var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _lib = require('../../lib'); - -var _context2 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var UpdateMenuFold = (0, _lib.connectUpdateMenuToLayout)(_PlotlyFold2.default); - -var UpdateMenuAccordion = function (_Component) { - _inherits(UpdateMenuAccordion, _Component); - - function UpdateMenuAccordion() { - _classCallCheck(this, UpdateMenuAccordion); - - return _possibleConstructorReturn(this, (UpdateMenuAccordion.__proto__ || Object.getPrototypeOf(UpdateMenuAccordion)).apply(this, arguments)); - } - - _createClass(UpdateMenuAccordion, [{ - key: 'render', - value: function render() { - var _context = this.context, - _context$fullLayout$u = _context.fullLayout.updatemenus, - updatemenus = _context$fullLayout$u === undefined ? [] : _context$fullLayout$u, - _ = _context.localize; - var children = this.props.children; - - - var content = updatemenus.length > 0 && updatemenus.map(function (upd, i) { - var localizedType = { - dropdown: _('Dropdown'), - buttons: _('Buttons') - }; - var menuType = localizedType[upd.type] || localizedType.dropdown; - var activeBtn = upd.buttons.filter(function (b) { - return b._index === upd.active; - })[0]; - var foldName = menuType + (activeBtn ? ': ' + activeBtn.label : ''); - - return _react2.default.createElement( - UpdateMenuFold, - { key: i, updateMenuIndex: i, name: foldName }, - children - ); - }); - - return _react2.default.createElement( - _TraceRequiredPanel2.default, - null, - content ? content : null - ); - } - }]); - - return UpdateMenuAccordion; -}(_react.Component); - -UpdateMenuAccordion.contextType = _context2.EditorControlsContext; - -UpdateMenuAccordion.propTypes = { - children: _propTypes2.default.node -}; - -exports.default = UpdateMenuAccordion; -//# sourceMappingURL=UpdateMenuAccordion.js.map \ No newline at end of file diff --git a/lib/components/containers/UpdateMenuAccordion.js.map b/lib/components/containers/UpdateMenuAccordion.js.map deleted file mode 100644 index 47f00f125..000000000 --- a/lib/components/containers/UpdateMenuAccordion.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/UpdateMenuAccordion.js"],"names":["UpdateMenuFold","PlotlyFold","UpdateMenuAccordion","context","fullLayout","updatemenus","_","localize","children","props","content","length","map","upd","i","localizedType","dropdown","buttons","menuType","type","activeBtn","filter","b","_index","active","foldName","label","Component","contextType","EditorControlsContext","propTypes","PropTypes","node"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,oCAA0BC,oBAA1B,CAAvB;;IAEMC,mB;;;;;;;;;;;6BACK;AAAA,qBAIH,KAAKC,OAJF;AAAA,2CAELC,UAFK,CAEQC,WAFR;AAAA,UAEQA,WAFR,yCAEsB,EAFtB;AAAA,UAGKC,CAHL,YAGLC,QAHK;AAAA,UAKAC,QALA,GAKY,KAAKC,KALjB,CAKAD,QALA;;;AAOP,UAAME,UACJL,YAAYM,MAAZ,GAAqB,CAArB,IACAN,YAAYO,GAAZ,CAAgB,UAACC,GAAD,EAAMC,CAAN,EAAY;AAC1B,YAAMC,gBAAgB;AACpBC,oBAAUV,EAAE,UAAF,CADU;AAEpBW,mBAASX,EAAE,SAAF;AAFW,SAAtB;AAIA,YAAMY,WAAWH,cAAcF,IAAIM,IAAlB,KAA2BJ,cAAcC,QAA1D;AACA,YAAMI,YAAYP,IAAII,OAAJ,CAAYI,MAAZ,CAAmB;AAAA,iBAAKC,EAAEC,MAAF,KAAaV,IAAIW,MAAtB;AAAA,SAAnB,EAAiD,CAAjD,CAAlB;AACA,YAAMC,WAAWP,YAAYE,YAAY,OAAOA,UAAUM,KAA7B,GAAqC,EAAjD,CAAjB;;AAEA,eACE;AAAC,wBAAD;AAAA,YAAgB,KAAKZ,CAArB,EAAwB,iBAAiBA,CAAzC,EAA4C,MAAMW,QAAlD;AACGjB;AADH,SADF;AAKD,OAdD,CAFF;;AAkBA,aAAO;AAAC,oCAAD;AAAA;AAAqBE,kBAAUA,OAAV,GAAoB;AAAzC,OAAP;AACD;;;;EA3B+BiB,gB;;AA8BlCzB,oBAAoB0B,WAApB,GAAkCC,+BAAlC;;AAEA3B,oBAAoB4B,SAApB,GAAgC;AAC9BtB,YAAUuB,oBAAUC;AADU,CAAhC;;kBAIe9B,mB","file":"UpdateMenuAccordion.js","sourcesContent":["import PlotlyFold from './PlotlyFold';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {connectUpdateMenuToLayout} from 'lib';\nimport {EditorControlsContext} from '../../context';\n\nconst UpdateMenuFold = connectUpdateMenuToLayout(PlotlyFold);\n\nclass UpdateMenuAccordion extends Component {\n render() {\n const {\n fullLayout: {updatemenus = []},\n localize: _,\n } = this.context;\n const {children} = this.props;\n\n const content =\n updatemenus.length > 0 &&\n updatemenus.map((upd, i) => {\n const localizedType = {\n dropdown: _('Dropdown'),\n buttons: _('Buttons'),\n };\n const menuType = localizedType[upd.type] || localizedType.dropdown;\n const activeBtn = upd.buttons.filter(b => b._index === upd.active)[0];\n const foldName = menuType + (activeBtn ? ': ' + activeBtn.label : '');\n\n return (\n \n {children}\n \n );\n });\n\n return {content ? content : null};\n }\n}\n\nUpdateMenuAccordion.contextType = EditorControlsContext;\n\nUpdateMenuAccordion.propTypes = {\n children: PropTypes.node,\n};\n\nexport default UpdateMenuAccordion;\n"]} \ No newline at end of file diff --git a/lib/components/containers/derived.js b/lib/components/containers/derived.js deleted file mode 100644 index 3dc3bee87..000000000 --- a/lib/components/containers/derived.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TraceTypeSection = exports.LayoutSection = exports.LayoutPanel = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _PlotlyPanel = require('./PlotlyPanel'); - -var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); - -var _PlotlySection = require('./PlotlySection'); - -var _PlotlySection2 = _interopRequireDefault(_PlotlySection); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var LayoutPanel = (0, _lib.connectLayoutToPlot)(_PlotlyPanel2.default); -var LayoutSection = (0, _lib.connectLayoutToPlot)(_PlotlySection2.default); - -var TraceTypeSection = function TraceTypeSection(props, context) { - var fullContainer = context.fullContainer, - fullData = context.fullData; - var mode = props.mode, - traceTypes = props.traceTypes; - - - var ifConnectedToTrace = mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type); - - var ifConnectedToLayout = mode === 'layout' && fullData && fullData.some(function (t) { - return traceTypes.includes(t.type); - }); - - if (ifConnectedToTrace || ifConnectedToLayout) { - return _react2.default.createElement(_PlotlySection2.default, props); - } - - return null; -}; - -TraceTypeSection.contextTypes = _lib.containerConnectedContextTypes; -TraceTypeSection.propTypes = { - children: _propTypes2.default.node, - name: _propTypes2.default.string, - traceTypes: _propTypes2.default.array, - mode: _propTypes2.default.string -}; - -TraceTypeSection.defaultProps = { - traceTypes: [], - mode: 'layout' -}; - -exports.LayoutPanel = LayoutPanel; -exports.LayoutSection = LayoutSection; -exports.TraceTypeSection = TraceTypeSection; -//# sourceMappingURL=derived.js.map \ No newline at end of file diff --git a/lib/components/containers/derived.js.map b/lib/components/containers/derived.js.map deleted file mode 100644 index 9bc93de60..000000000 --- a/lib/components/containers/derived.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/derived.js"],"names":["LayoutPanel","PlotlyPanel","LayoutSection","PlotlySection","TraceTypeSection","props","context","fullContainer","fullData","mode","traceTypes","ifConnectedToTrace","includes","type","ifConnectedToLayout","some","t","contextTypes","containerConnectedContextTypes","propTypes","children","PropTypes","node","name","string","array","defaultProps"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA;;;;AAEA,IAAMA,cAAc,8BAAoBC,qBAApB,CAApB;AACA,IAAMC,gBAAgB,8BAAoBC,uBAApB,CAAtB;;AAEA,IAAMC,mBAAmB,SAAnBA,gBAAmB,CAACC,KAAD,EAAQC,OAAR,EAAoB;AAAA,MACpCC,aADoC,GACTD,OADS,CACpCC,aADoC;AAAA,MACrBC,QADqB,GACTF,OADS,CACrBE,QADqB;AAAA,MAEpCC,IAFoC,GAEhBJ,KAFgB,CAEpCI,IAFoC;AAAA,MAE9BC,UAF8B,GAEhBL,KAFgB,CAE9BK,UAF8B;;;AAI3C,MAAMC,qBACJF,SAAS,OAAT,IAAoBF,aAApB,IAAqCG,WAAWE,QAAX,CAAoBL,cAAcM,IAAlC,CADvC;;AAGA,MAAMC,sBACJL,SAAS,QAAT,IAAqBD,QAArB,IAAiCA,SAASO,IAAT,CAAc;AAAA,WAAKL,WAAWE,QAAX,CAAoBI,EAAEH,IAAtB,CAAL;AAAA,GAAd,CADnC;;AAGA,MAAIF,sBAAsBG,mBAA1B,EAA+C;AAC7C,WAAO,8BAAC,uBAAD,EAAmBT,KAAnB,CAAP;AACD;;AAED,SAAO,IAAP;AACD,CAfD;;AAiBAD,iBAAiBa,YAAjB,GAAgCC,mCAAhC;AACAd,iBAAiBe,SAAjB,GAA6B;AAC3BC,YAAUC,oBAAUC,IADO;AAE3BC,QAAMF,oBAAUG,MAFW;AAG3Bd,cAAYW,oBAAUI,KAHK;AAI3BhB,QAAMY,oBAAUG;AAJW,CAA7B;;AAOApB,iBAAiBsB,YAAjB,GAAgC;AAC9BhB,cAAY,EADkB;AAE9BD,QAAM;AAFwB,CAAhC;;QAKQT,W,GAAAA,W;QAAaE,a,GAAAA,a;QAAeE,gB,GAAAA,gB","file":"derived.js","sourcesContent":["import React from 'react';\nimport PlotlyPanel from './PlotlyPanel';\nimport PlotlySection from './PlotlySection';\nimport PropTypes from 'prop-types';\n\nimport {connectLayoutToPlot, containerConnectedContextTypes} from 'lib';\n\nconst LayoutPanel = connectLayoutToPlot(PlotlyPanel);\nconst LayoutSection = connectLayoutToPlot(PlotlySection);\n\nconst TraceTypeSection = (props, context) => {\n const {fullContainer, fullData} = context;\n const {mode, traceTypes} = props;\n\n const ifConnectedToTrace =\n mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type);\n\n const ifConnectedToLayout =\n mode === 'layout' && fullData && fullData.some(t => traceTypes.includes(t.type));\n\n if (ifConnectedToTrace || ifConnectedToLayout) {\n return ;\n }\n\n return null;\n};\n\nTraceTypeSection.contextTypes = containerConnectedContextTypes;\nTraceTypeSection.propTypes = {\n children: PropTypes.node,\n name: PropTypes.string,\n traceTypes: PropTypes.array,\n mode: PropTypes.string,\n};\n\nTraceTypeSection.defaultProps = {\n traceTypes: [],\n mode: 'layout',\n};\n\nexport {LayoutPanel, LayoutSection, TraceTypeSection};\n"]} \ No newline at end of file diff --git a/lib/components/containers/index.js b/lib/components/containers/index.js deleted file mode 100644 index 009464cc4..000000000 --- a/lib/components/containers/index.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PanelMessage = exports.ModalProvider = exports.Modal = exports.TraceTypeSection = exports.SingleSidebarItem = exports.AxesFold = exports.LayoutSection = exports.LayoutPanel = exports.TraceRequiredPanel = exports.TraceMarkerSection = exports.TransformAccordion = exports.TraceAccordion = exports.SubplotAccordion = exports.Section = exports.PlotlySection = exports.PanelEmpty = exports.Panel = exports.PlotlyPanel = exports.Fold = exports.PlotlyFold = exports.MenuPanel = exports.RangeSelectorAccordion = exports.UpdateMenuAccordion = exports.ImageAccordion = exports.SliderAccordion = exports.ShapeAccordion = exports.AnnotationAccordion = undefined; - -var _AnnotationAccordion = require('./AnnotationAccordion'); - -var _AnnotationAccordion2 = _interopRequireDefault(_AnnotationAccordion); - -var _ShapeAccordion = require('./ShapeAccordion'); - -var _ShapeAccordion2 = _interopRequireDefault(_ShapeAccordion); - -var _SliderAccordion = require('./SliderAccordion'); - -var _SliderAccordion2 = _interopRequireDefault(_SliderAccordion); - -var _ImageAccordion = require('./ImageAccordion'); - -var _ImageAccordion2 = _interopRequireDefault(_ImageAccordion); - -var _UpdateMenuAccordion = require('./UpdateMenuAccordion'); - -var _UpdateMenuAccordion2 = _interopRequireDefault(_UpdateMenuAccordion); - -var _RangeSelectorAccordion = require('./RangeSelectorAccordion'); - -var _RangeSelectorAccordion2 = _interopRequireDefault(_RangeSelectorAccordion); - -var _AxesFold = require('./AxesFold'); - -var _AxesFold2 = _interopRequireDefault(_AxesFold); - -var _PlotlyFold = require('./PlotlyFold'); - -var _PlotlyFold2 = _interopRequireDefault(_PlotlyFold); - -var _MenuPanel = require('./MenuPanel'); - -var _MenuPanel2 = _interopRequireDefault(_MenuPanel); - -var _PlotlyPanel = require('./PlotlyPanel'); - -var _PlotlyPanel2 = _interopRequireDefault(_PlotlyPanel); - -var _PlotlySection = require('./PlotlySection'); - -var _PlotlySection2 = _interopRequireDefault(_PlotlySection); - -var _PanelEmpty = require('./PanelEmpty'); - -var _PanelEmpty2 = _interopRequireDefault(_PanelEmpty); - -var _SubplotAccordion = require('./SubplotAccordion'); - -var _SubplotAccordion2 = _interopRequireDefault(_SubplotAccordion); - -var _TraceAccordion = require('./TraceAccordion'); - -var _TraceAccordion2 = _interopRequireDefault(_TraceAccordion); - -var _TransformAccordion = require('./TransformAccordion'); - -var _TransformAccordion2 = _interopRequireDefault(_TransformAccordion); - -var _TraceMarkerSection = require('./TraceMarkerSection'); - -var _TraceMarkerSection2 = _interopRequireDefault(_TraceMarkerSection); - -var _derived = require('./derived'); - -var _TraceRequiredPanel = require('./TraceRequiredPanel'); - -var _TraceRequiredPanel2 = _interopRequireDefault(_TraceRequiredPanel); - -var _SingleSidebarItem = require('./SingleSidebarItem'); - -var _SingleSidebarItem2 = _interopRequireDefault(_SingleSidebarItem); - -var _ModalProvider = require('./ModalProvider'); - -var _ModalProvider2 = _interopRequireDefault(_ModalProvider); - -var _Modal = require('./Modal'); - -var _Modal2 = _interopRequireDefault(_Modal); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.AnnotationAccordion = _AnnotationAccordion2.default; -exports.ShapeAccordion = _ShapeAccordion2.default; -exports.SliderAccordion = _SliderAccordion2.default; -exports.ImageAccordion = _ImageAccordion2.default; -exports.UpdateMenuAccordion = _UpdateMenuAccordion2.default; -exports.RangeSelectorAccordion = _RangeSelectorAccordion2.default; -exports.MenuPanel = _MenuPanel2.default; -exports.PlotlyFold = _PlotlyFold2.default; -exports.Fold = _PlotlyFold.Fold; -exports.PlotlyPanel = _PlotlyPanel2.default; -exports.Panel = _PlotlyPanel.Panel; -exports.PanelEmpty = _PanelEmpty2.default; -exports.PlotlySection = _PlotlySection2.default; -exports.Section = _PlotlySection.Section; -exports.SubplotAccordion = _SubplotAccordion2.default; -exports.TraceAccordion = _TraceAccordion2.default; -exports.TransformAccordion = _TransformAccordion2.default; -exports.TraceMarkerSection = _TraceMarkerSection2.default; -exports.TraceRequiredPanel = _TraceRequiredPanel2.default; -exports.LayoutPanel = _derived.LayoutPanel; -exports.LayoutSection = _derived.LayoutSection; -exports.AxesFold = _AxesFold2.default; -exports.SingleSidebarItem = _SingleSidebarItem2.default; -exports.TraceTypeSection = _derived.TraceTypeSection; -exports.Modal = _Modal2.default; -exports.ModalProvider = _ModalProvider2.default; -exports.PanelMessage = _PanelEmpty.PanelMessage; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/components/containers/index.js.map b/lib/components/containers/index.js.map deleted file mode 100644 index 791b9563a..000000000 --- a/lib/components/containers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/containers/index.js"],"names":["AnnotationAccordion","ShapeAccordion","SliderAccordion","ImageAccordion","UpdateMenuAccordion","RangeSelectorAccordion","MenuPanel","PlotlyFold","Fold","PlotlyPanel","Panel","PanelEmpty","PlotlySection","Section","SubplotAccordion","TraceAccordion","TransformAccordion","TraceMarkerSection","TraceRequiredPanel","LayoutPanel","LayoutSection","AxesFold","SingleSidebarItem","TraceTypeSection","Modal","ModalProvider","PanelMessage"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;QAGEA,mB,GAAAA,6B;QACAC,c,GAAAA,wB;QACAC,e,GAAAA,yB;QACAC,c,GAAAA,wB;QACAC,mB,GAAAA,6B;QACAC,sB,GAAAA,gC;QACAC,S,GAAAA,mB;QACAC,U,GAAAA,oB;QACAC,I,GAAAA,gB;QACAC,W,GAAAA,qB;QACAC,K,GAAAA,kB;QACAC,U,GAAAA,oB;QACAC,a,GAAAA,uB;QACAC,O,GAAAA,sB;QACAC,gB,GAAAA,0B;QACAC,c,GAAAA,wB;QACAC,kB,GAAAA,4B;QACAC,kB,GAAAA,4B;QACAC,kB,GAAAA,4B;QACAC,W,GAAAA,oB;QACAC,a,GAAAA,sB;QACAC,Q,GAAAA,kB;QACAC,iB,GAAAA,2B;QACAC,gB,GAAAA,yB;QACAC,K,GAAAA,e;QACAC,a,GAAAA,uB;QACAC,Y,GAAAA,wB","file":"index.js","sourcesContent":["import AnnotationAccordion from './AnnotationAccordion';\nimport ShapeAccordion from './ShapeAccordion';\nimport SliderAccordion from './SliderAccordion';\nimport ImageAccordion from './ImageAccordion';\nimport UpdateMenuAccordion from './UpdateMenuAccordion';\nimport RangeSelectorAccordion from './RangeSelectorAccordion';\nimport AxesFold from './AxesFold';\nimport PlotlyFold, {Fold} from './PlotlyFold';\nimport MenuPanel from './MenuPanel';\nimport PlotlyPanel, {Panel} from './PlotlyPanel';\nimport PlotlySection, {Section} from './PlotlySection';\nimport PanelEmpty, {PanelMessage} from './PanelEmpty';\nimport SubplotAccordion from './SubplotAccordion';\nimport TraceAccordion from './TraceAccordion';\nimport TransformAccordion from './TransformAccordion';\nimport TraceMarkerSection from './TraceMarkerSection';\nimport {LayoutPanel, LayoutSection, TraceTypeSection} from './derived';\nimport TraceRequiredPanel from './TraceRequiredPanel';\nimport SingleSidebarItem from './SingleSidebarItem';\nimport ModalProvider from './ModalProvider';\nimport Modal from './Modal';\n\nexport {\n AnnotationAccordion,\n ShapeAccordion,\n SliderAccordion,\n ImageAccordion,\n UpdateMenuAccordion,\n RangeSelectorAccordion,\n MenuPanel,\n PlotlyFold,\n Fold,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PlotlySection,\n Section,\n SubplotAccordion,\n TraceAccordion,\n TransformAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n LayoutPanel,\n LayoutSection,\n AxesFold,\n SingleSidebarItem,\n TraceTypeSection,\n Modal,\n ModalProvider,\n PanelMessage,\n};\n"]} \ No newline at end of file diff --git a/lib/components/fields/ArrowSelector.js b/lib/components/fields/ArrowSelector.js deleted file mode 100644 index 2b4d1ce3e..000000000 --- a/lib/components/fields/ArrowSelector.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _Dropdown = require('./Dropdown'); - -var _Dropdown2 = _interopRequireDefault(_Dropdown); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _arrow_paths = require('plotly.js/src/components/annotations/arrow_paths'); - -var _arrow_paths2 = _interopRequireDefault(_arrow_paths); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ARROW_OPTIONS = _arrow_paths2.default.map(function (_ref, index) { - var path = _ref.path; - - var label = _react2.default.createElement( - 'svg', - { width: '40', height: '20', style: { position: 'relative', top: '5px' } }, - _react2.default.createElement('line', { - stroke: 'rgb(68, 68, 68)', - style: { fill: 'none' }, - x1: '5', - y1: '10', - x2: '23.8', - y2: '10', - strokeWidth: '2' - }), - _react2.default.createElement('path', { - d: path, - transform: 'translate(23.8,10)rotate(360)scale(2)', - style: { fill: 'rgb(68, 68, 68)', opacity: 1, strokeWidth: 0 } - }) - ); - - return { - label: label, - value: index, - key: 'arrow' + index - }; -}); - -var ArrowSelector = function ArrowSelector(props) { - return _react2.default.createElement(_Dropdown2.default, _extends({}, props, { options: ARROW_OPTIONS })); -}; - -ArrowSelector.propTypes = _extends({}, _Dropdown2.default.propTypes); - -ArrowSelector.defaultProps = { - clearable: false -}; - -exports.default = ArrowSelector; -//# sourceMappingURL=ArrowSelector.js.map \ No newline at end of file diff --git a/lib/components/fields/ArrowSelector.js.map b/lib/components/fields/ArrowSelector.js.map deleted file mode 100644 index dcd2fd1f6..000000000 --- a/lib/components/fields/ArrowSelector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/fields/ArrowSelector.js"],"names":["ARROW_OPTIONS","ARROW_PATHS","map","index","path","label","position","top","fill","opacity","strokeWidth","value","key","ArrowSelector","props","propTypes","Dropdown","defaultProps","clearable"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;AAEA,IAAMA,gBAAgBC,sBAAYC,GAAZ,CAAgB,gBAASC,KAAT,EAAmB;AAAA,MAAjBC,IAAiB,QAAjBA,IAAiB;;AACvD,MAAMC,QACJ;AAAA;AAAA,MAAK,OAAM,IAAX,EAAgB,QAAO,IAAvB,EAA4B,OAAO,EAACC,UAAU,UAAX,EAAuBC,KAAK,KAA5B,EAAnC;AACE;AACE,cAAO,iBADT;AAEE,aAAO,EAACC,MAAM,MAAP,EAFT;AAGE,UAAG,GAHL;AAIE,UAAG,IAJL;AAKE,UAAG,MALL;AAME,UAAG,IANL;AAOE,mBAAY;AAPd,MADF;AAUE;AACE,SAAGJ,IADL;AAEE,iBAAU,uCAFZ;AAGE,aAAO,EAACI,MAAM,iBAAP,EAA0BC,SAAS,CAAnC,EAAsCC,aAAa,CAAnD;AAHT;AAVF,GADF;;AAmBA,SAAO;AACLL,gBADK;AAELM,WAAOR,KAFF;AAGLS,SAAK,UAAUT;AAHV,GAAP;AAKD,CAzBqB,CAAtB;;AA2BA,IAAMU,gBAAgB,SAAhBA,aAAgB,QAAS;AAC7B,SAAO,8BAAC,kBAAD,eAAcC,KAAd,IAAqB,SAASd,aAA9B,IAAP;AACD,CAFD;;AAIAa,cAAcE,SAAd,gBACKC,mBAASD,SADd;;AAIAF,cAAcI,YAAd,GAA6B;AAC3BC,aAAW;AADgB,CAA7B;;kBAIeL,a","file":"ArrowSelector.js","sourcesContent":["import Dropdown from './Dropdown';\nimport React from 'react';\nimport ARROW_PATHS from 'plotly.js/src/components/annotations/arrow_paths';\n\nconst ARROW_OPTIONS = ARROW_PATHS.map(({path}, index) => {\n const label = (\n \n \n \n \n );\n\n return {\n label,\n value: index,\n key: 'arrow' + index,\n };\n});\n\nconst ArrowSelector = props => {\n return ;\n};\n\nArrowSelector.propTypes = {\n ...Dropdown.propTypes,\n};\n\nArrowSelector.defaultProps = {\n clearable: false,\n};\n\nexport default ArrowSelector;\n"]} \ No newline at end of file diff --git a/lib/components/fields/AxesCreator.js b/lib/components/fields/AxesCreator.js deleted file mode 100644 index adbee7895..000000000 --- a/lib/components/fields/AxesCreator.js +++ /dev/null @@ -1,256 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _Dropdown = require('./Dropdown'); - -var _Dropdown2 = _interopRequireDefault(_Dropdown); - -var _Info = require('./Info'); - -var _Info2 = _interopRequireDefault(_Info); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _constants = require('../../lib/constants'); - -var _Button = require('../widgets/Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _plotlyIcons = require('plotly-icons'); - -var _lib = require('../../lib'); - -var _2 = require('./..'); - -var _context3 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var UnconnectedAxisCreator = function (_Component) { - _inherits(UnconnectedAxisCreator, _Component); - - function UnconnectedAxisCreator() { - _classCallCheck(this, UnconnectedAxisCreator); - - return _possibleConstructorReturn(this, (UnconnectedAxisCreator.__proto__ || Object.getPrototypeOf(UnconnectedAxisCreator)).apply(this, arguments)); - } - - _createClass(UnconnectedAxisCreator, [{ - key: 'canAddAxis', - value: function canAddAxis() { - var _this2 = this; - - var currentAxisId = this.props.fullContainer[this.props.attr]; - var currentTraceIndex = this.props.fullContainer.index; - return this.context.fullData.some(function (d) { - return d.index !== currentTraceIndex && d[_this2.props.attr] === currentAxisId; - }); - } - }, { - key: 'addAndUpdateAxis', - value: function addAndUpdateAxis() { - var _update; - - var _props = this.props, - attr = _props.attr, - updateContainer = _props.updateContainer; - var _context = this.context, - onUpdate = _context.onUpdate, - subplots = _context.fullLayout._subplots; - - var lastAxisNumber = Number(subplots[attr][subplots[attr].length - 1].charAt(1)) || 1; - - updateContainer(_defineProperty({}, attr, attr.charAt(0) + (lastAxisNumber + 1))); - - var side = null; - if (attr === 'yaxis') { - side = 'right'; - } else if (attr === 'xaxis') { - side = 'top'; - } - - onUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT, - payload: { - update: (_update = {}, _defineProperty(_update, attr + (lastAxisNumber + 1) + '.side', side), _defineProperty(_update, attr + (lastAxisNumber + 1) + '.overlaying', !(attr === 'yaxis' || attr === 'xaxis') ? null : subplots[attr][subplots[attr].length - 1]), _update) - } - }); - } - }, { - key: 'updateAxis', - value: function updateAxis(update) { - var _this3 = this; - - var currentAxisId = this.props.fullContainer[this.props.attr]; - var axesToBeGarbageCollected = []; - - // When we select another axis, make sure no unused axes are left - if (currentAxisId !== update && !this.context.fullData.some(function (trace) { - return trace[_this3.props.attr] === currentAxisId && trace.index !== _this3.props.fullContainer.index; - })) { - axesToBeGarbageCollected.push(currentAxisId); - } - - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, - payload: { - axesToBeGarbageCollected: axesToBeGarbageCollected, - update: _defineProperty({}, this.props.attr, update), - traceIndexes: [this.props.fullContainer.index] - } - }); - } - }, { - key: 'render', - value: function render() { - var _this4 = this; - - var icon = _react2.default.createElement(_plotlyIcons.PlusIcon, null); - var extraComponent = this.canAddAxis() ? _react2.default.createElement(_Button2.default, { variant: 'no-text', icon: icon, onClick: function onClick() { - return _this4.addAndUpdateAxis(); - } }) : _react2.default.createElement(_Button2.default, { variant: 'no-text--disabled', icon: icon, onClick: function onClick() {} }); - - return _react2.default.createElement(_Dropdown2.default, { - label: this.props.label, - attr: this.props.attr, - clearable: false, - options: this.props.options, - updatePlot: function updatePlot(u) { - return _this4.updateAxis(u); - }, - extraComponent: extraComponent - }); - } - }]); - - return UnconnectedAxisCreator; -}(_react.Component); - -UnconnectedAxisCreator.propTypes = { - attr: _propTypes2.default.string, - label: _propTypes2.default.string, - options: _propTypes2.default.array, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - updateContainer: _propTypes2.default.func -}; - -UnconnectedAxisCreator.contextType = _context3.EditorControlsContext; - -var AxisCreator = (0, _lib.connectToContainer)(UnconnectedAxisCreator); - -var UnconnectedAxesCreator = function (_Component2) { - _inherits(UnconnectedAxesCreator, _Component2); - - function UnconnectedAxesCreator() { - _classCallCheck(this, UnconnectedAxesCreator); - - return _possibleConstructorReturn(this, (UnconnectedAxesCreator.__proto__ || Object.getPrototypeOf(UnconnectedAxesCreator)).apply(this, arguments)); - } - - _createClass(UnconnectedAxesCreator, [{ - key: 'render', - value: function render() { - var axisType = (0, _lib.traceTypeToAxisType)(this.props.container.type); - var isFirstTraceOfAxisType = this.context.data.filter(function (d) { - return (0, _lib.traceTypeToAxisType)(d.type) === axisType; - }).length === 1; - - if (isFirstTraceOfAxisType) { - return null; - } - - var _context2 = this.context, - fullLayout = _context2.fullLayout, - _ = _context2.localize; - - var controls = []; - - function getOptions(axisType) { - return fullLayout._subplots[axisType].map(function (axisId) { - return { - label: (0, _lib.getAxisTitle)(fullLayout[(0, _lib.axisIdToAxisName)(axisId)]), - value: axisId - }; - }); - } - - if (axisType === 'cartesian') { - ['xaxis', 'yaxis'].forEach(function (type, index) { - controls.push(_react2.default.createElement(AxisCreator, { - key: index, - attr: type, - label: type.charAt(0).toUpperCase() + _(' Axis'), - options: getOptions(type) - })); - }); - } - - return _react2.default.createElement( - _2.PlotlySection, - { name: _('Axes to Use') }, - controls, - _react2.default.createElement( - _context3.ModalProviderContext.Consumer, - null, - function (_ref) { - var setPanel = _ref.setPanel; - return _react2.default.createElement( - _Info2.default, - null, - _('You can style and position your axes in the '), - _react2.default.createElement( - 'a', - { onClick: function onClick() { - return setPanel('Structure', 'Subplots'); - } }, - _('Subplots') - ), - _(' panel.') - ); - } - ) - ); - } - }]); - - return UnconnectedAxesCreator; -}(_react.Component); - -UnconnectedAxesCreator.propTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object -}; - -UnconnectedAxesCreator.contextType = _context3.EditorControlsContext; - -exports.default = (0, _lib.connectToContainer)(UnconnectedAxesCreator, { - modifyPlotProps: function modifyPlotProps(props, context, plotProps) { - var data = context.data; - var fullContainer = plotProps.fullContainer; - - - plotProps.isVisible = data.length > 1 && data[fullContainer.index] && (0, _lib.traceTypeToAxisType)(data[fullContainer.index].type) === 'cartesian'; - } -}); -//# sourceMappingURL=AxesCreator.js.map \ No newline at end of file diff --git a/lib/components/fields/AxesCreator.js.map b/lib/components/fields/AxesCreator.js.map deleted file mode 100644 index 645e9a4eb..000000000 --- a/lib/components/fields/AxesCreator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/fields/AxesCreator.js"],"names":["UnconnectedAxisCreator","currentAxisId","props","fullContainer","attr","currentTraceIndex","index","context","fullData","some","d","updateContainer","onUpdate","subplots","fullLayout","_subplots","lastAxisNumber","Number","length","charAt","side","type","EDITOR_ACTIONS","UPDATE_LAYOUT","payload","update","axesToBeGarbageCollected","trace","push","UPDATE_TRACES","traceIndexes","icon","extraComponent","canAddAxis","addAndUpdateAxis","label","options","updateAxis","u","Component","propTypes","PropTypes","string","array","container","object","func","contextType","EditorControlsContext","AxisCreator","UnconnectedAxesCreator","axisType","isFirstTraceOfAxisType","data","filter","_","localize","controls","getOptions","map","axisId","value","forEach","toUpperCase","setPanel","modifyPlotProps","plotProps","isVisible"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;IAEMA,sB;;;;;;;;;;;iCACS;AAAA;;AACX,UAAMC,gBAAgB,KAAKC,KAAL,CAAWC,aAAX,CAAyB,KAAKD,KAAL,CAAWE,IAApC,CAAtB;AACA,UAAMC,oBAAoB,KAAKH,KAAL,CAAWC,aAAX,CAAyBG,KAAnD;AACA,aAAO,KAAKC,OAAL,CAAaC,QAAb,CAAsBC,IAAtB,CACL;AAAA,eAAKC,EAAEJ,KAAF,KAAYD,iBAAZ,IAAiCK,EAAE,OAAKR,KAAL,CAAWE,IAAb,MAAuBH,aAA7D;AAAA,OADK,CAAP;AAGD;;;uCAEkB;AAAA;;AAAA,mBACe,KAAKC,KADpB;AAAA,UACVE,IADU,UACVA,IADU;AAAA,UACJO,eADI,UACJA,eADI;AAAA,qBAKb,KAAKJ,OALQ;AAAA,UAG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AAtB,CAAN;AAAA,mBAAZ;AAAsDT,kBAAE,UAAF;AAAtD,eAFF;AAGGA,gBAAE,SAAF;AAHH,aADD;AAAA;AADH;AAFF,OADF;AAcD;;;;EA/CkChB,gB;;AAkDrCW,uBAAuBV,SAAvB,GAAmC;AACjCI,aAAWH,oBAAUI,MADY;AAEjC1C,iBAAesC,oBAAUI;AAFQ,CAAnC;;AAKAK,uBAAuBH,WAAvB,GAAqCC,+BAArC;;kBAEe,6BAAmBE,sBAAnB,EAA2C;AACxDe,mBAAiB,yBAAC/D,KAAD,EAAQK,OAAR,EAAiB2D,SAAjB,EAA+B;AAAA,QACvCb,IADuC,GAC/B9C,OAD+B,CACvC8C,IADuC;AAAA,QAEvClD,aAFuC,GAEtB+D,SAFsB,CAEvC/D,aAFuC;;;AAI9C+D,cAAUC,SAAV,GACEd,KAAKnC,MAAL,GAAc,CAAd,IACAmC,KAAKlD,cAAcG,KAAnB,CADA,IAEA,8BAAoB+C,KAAKlD,cAAcG,KAAnB,EAA0Be,IAA9C,MAAwD,WAH1D;AAID;AATuD,CAA3C,C","file":"AxesCreator.js","sourcesContent":["import Dropdown from './Dropdown';\nimport Info from './Info';\nimport PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {EDITOR_ACTIONS} from 'lib/constants';\nimport Button from '../widgets/Button';\nimport {PlusIcon} from 'plotly-icons';\nimport {connectToContainer, traceTypeToAxisType, getAxisTitle, axisIdToAxisName} from 'lib';\nimport {PlotlySection} from 'components';\nimport {EditorControlsContext, ModalProviderContext} from '../../context';\n\nclass UnconnectedAxisCreator extends Component {\n canAddAxis() {\n const currentAxisId = this.props.fullContainer[this.props.attr];\n const currentTraceIndex = this.props.fullContainer.index;\n return this.context.fullData.some(\n d => d.index !== currentTraceIndex && d[this.props.attr] === currentAxisId\n );\n }\n\n addAndUpdateAxis() {\n const {attr, updateContainer} = this.props;\n const {\n onUpdate,\n fullLayout: {_subplots: subplots},\n } = this.context;\n const lastAxisNumber = Number(subplots[attr][subplots[attr].length - 1].charAt(1)) || 1;\n\n updateContainer({\n [attr]: attr.charAt(0) + (lastAxisNumber + 1),\n });\n\n let side = null;\n if (attr === 'yaxis') {\n side = 'right';\n } else if (attr === 'xaxis') {\n side = 'top';\n }\n\n onUpdate({\n type: EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update: {\n [`${attr + (lastAxisNumber + 1)}.side`]: side,\n [`${attr + (lastAxisNumber + 1)}.overlaying`]: !(attr === 'yaxis' || attr === 'xaxis')\n ? null\n : subplots[attr][subplots[attr].length - 1],\n },\n },\n });\n }\n\n updateAxis(update) {\n const currentAxisId = this.props.fullContainer[this.props.attr];\n const axesToBeGarbageCollected = [];\n\n // When we select another axis, make sure no unused axes are left\n if (\n currentAxisId !== update &&\n !this.context.fullData.some(\n trace =>\n trace[this.props.attr] === currentAxisId && trace.index !== this.props.fullContainer.index\n )\n ) {\n axesToBeGarbageCollected.push(currentAxisId);\n }\n\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n axesToBeGarbageCollected,\n update: {[this.props.attr]: update},\n traceIndexes: [this.props.fullContainer.index],\n },\n });\n }\n\n render() {\n const icon = ;\n const extraComponent = this.canAddAxis() ? (\n \n );\n }\n}\n\nButton.propTypes = {\n children: PropTypes.node,\n className: PropTypes.any,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n label: PropTypes.any,\n variant: PropTypes.string,\n};\n\nexport default Button;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/CheckboxGroup.js b/lib/components/widgets/CheckboxGroup.js deleted file mode 100644 index 9496abf74..000000000 --- a/lib/components/widgets/CheckboxGroup.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _plotlyIcons = require('plotly-icons'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var CheckboxGroup = function (_Component) { - _inherits(CheckboxGroup, _Component); - - function CheckboxGroup(props) { - _classCallCheck(this, CheckboxGroup); - - var _this = _possibleConstructorReturn(this, (CheckboxGroup.__proto__ || Object.getPrototypeOf(CheckboxGroup)).call(this, props)); - - _this.state = { options: _this.props.options }; - _this.handleChange = _this.handleChange.bind(_this); - return _this; - } - - _createClass(CheckboxGroup, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - this.setState({ options: nextProps.options }); - } - }, { - key: 'handleChange', - value: function handleChange(i) { - var newOptions = this.props.options.slice(); - newOptions[i] = Object.assign(newOptions[i], { - checked: !newOptions[i].checked - }); - this.props.onChange(newOptions); - } - }, { - key: 'renderOptions', - value: function renderOptions() { - var _this2 = this; - - return this.state.options.map(function (option, i) { - var checkClass = (0, _classnames2.default)(['checkbox__check', 'icon'], { - 'checkbox__check--checked': option.checked - }); - - var itemClass = (0, _classnames2.default)('checkbox__item', { - 'checkbox__item--vertical': _this2.props.orientation === 'vertical', - 'checkbox__item--horizontal': _this2.props.orientation === 'horizontal' - }); - - return _react2.default.createElement( - 'div', - { key: i, className: itemClass }, - _react2.default.createElement( - 'div', - { - className: 'checkbox__box' + (option.checked ? ' checkbox__box--checked' : ''), - onClick: function onClick() { - return _this2.handleChange(i); - } - }, - option.checked && _react2.default.createElement( - 'div', - { className: checkClass }, - _react2.default.createElement(_plotlyIcons.CheckIcon, null) - ) - ), - _react2.default.createElement( - 'div', - { className: 'checkbox__label', onClick: function onClick() { - return _this2.handleChange(i); - } }, - option.label - ) - ); - }); - } - }, { - key: 'render', - value: function render() { - var boxClass = (0, _classnames2.default)('checkbox__group', this.props.className, { - checkbox__group_horizontal: this.props.orientation === 'horizontal' - }); - - return _react2.default.createElement( - 'div', - { className: boxClass }, - this.renderOptions() - ); - } - }]); - - return CheckboxGroup; -}(_react.Component); - -CheckboxGroup.propTypes = { - options: _propTypes2.default.arrayOf(_propTypes2.default.shape({ - label: _propTypes2.default.string.isRequired, - value: _propTypes2.default.string.isRequired, - checked: _propTypes2.default.bool.isRequired - })).isRequired, - onChange: _propTypes2.default.func, - className: _propTypes2.default.string, - orientation: _propTypes2.default.string -}; - -CheckboxGroup.defaultProps = { - className: '' -}; - -exports.default = CheckboxGroup; -//# sourceMappingURL=CheckboxGroup.js.map \ No newline at end of file diff --git a/lib/components/widgets/CheckboxGroup.js.map b/lib/components/widgets/CheckboxGroup.js.map deleted file mode 100644 index f057a3c4f..000000000 --- a/lib/components/widgets/CheckboxGroup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/CheckboxGroup.js"],"names":["CheckboxGroup","props","state","options","handleChange","bind","nextProps","setState","i","newOptions","slice","Object","assign","checked","onChange","map","option","checkClass","itemClass","orientation","label","boxClass","className","checkbox__group_horizontal","renderOptions","Component","propTypes","PropTypes","arrayOf","shape","string","isRequired","value","bool","func","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,a;;;AACJ,yBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa,EAACC,SAAS,MAAKF,KAAL,CAAWE,OAArB,EAAb;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAHiB;AAIlB;;;;8CAEyBC,S,EAAW;AACnC,WAAKC,QAAL,CAAc,EAACJ,SAASG,UAAUH,OAApB,EAAd;AACD;;;iCAEYK,C,EAAG;AACd,UAAIC,aAAa,KAAKR,KAAL,CAAWE,OAAX,CAAmBO,KAAnB,EAAjB;AACAD,iBAAWD,CAAX,IAAgBG,OAAOC,MAAP,CAAcH,WAAWD,CAAX,CAAd,EAA6B;AAC3CK,iBAAS,CAACJ,WAAWD,CAAX,EAAcK;AADmB,OAA7B,CAAhB;AAGA,WAAKZ,KAAL,CAAWa,QAAX,CAAoBL,UAApB;AACD;;;oCAEe;AAAA;;AACd,aAAO,KAAKP,KAAL,CAAWC,OAAX,CAAmBY,GAAnB,CAAuB,UAACC,MAAD,EAASR,CAAT,EAAe;AAC3C,YAAMS,aAAa,0BAAW,CAAC,iBAAD,EAAoB,MAApB,CAAX,EAAwC;AACzD,sCAA4BD,OAAOH;AADsB,SAAxC,CAAnB;;AAIA,YAAMK,YAAY,0BAAW,gBAAX,EAA6B;AAC7C,sCAA4B,OAAKjB,KAAL,CAAWkB,WAAX,KAA2B,UADV;AAE7C,wCAA8B,OAAKlB,KAAL,CAAWkB,WAAX,KAA2B;AAFZ,SAA7B,CAAlB;;AAKA,eACE;AAAA;AAAA,YAAK,KAAKX,CAAV,EAAa,WAAWU,SAAxB;AACE;AAAA;AAAA;AACE,4CAA2BF,OAAOH,OAAP,GAAiB,yBAAjB,GAA6C,EAAxE,CADF;AAEE,uBAAS;AAAA,uBAAM,OAAKT,YAAL,CAAkBI,CAAlB,CAAN;AAAA;AAFX;AAIGQ,mBAAOH,OAAP,IACC;AAAA;AAAA,gBAAK,WAAWI,UAAhB;AACE,4CAAC,sBAAD;AADF;AALJ,WADF;AAWE;AAAA;AAAA,cAAK,WAAU,iBAAf,EAAiC,SAAS;AAAA,uBAAM,OAAKb,YAAL,CAAkBI,CAAlB,CAAN;AAAA,eAA1C;AACGQ,mBAAOI;AADV;AAXF,SADF;AAiBD,OA3BM,CAAP;AA4BD;;;6BAEQ;AACP,UAAMC,WAAW,0BAAW,iBAAX,EAA8B,KAAKpB,KAAL,CAAWqB,SAAzC,EAAoD;AACnEC,oCAA4B,KAAKtB,KAAL,CAAWkB,WAAX,KAA2B;AADY,OAApD,CAAjB;;AAIA,aAAO;AAAA;AAAA,UAAK,WAAWE,QAAhB;AAA2B,aAAKG,aAAL;AAA3B,OAAP;AACD;;;;EAxDyBC,gB;;AA2D5BzB,cAAc0B,SAAd,GAA0B;AACxBvB,WAASwB,oBAAUC,OAAV,CACPD,oBAAUE,KAAV,CAAgB;AACdT,WAAOO,oBAAUG,MAAV,CAAiBC,UADV;AAEdC,WAAOL,oBAAUG,MAAV,CAAiBC,UAFV;AAGdlB,aAASc,oBAAUM,IAAV,CAAeF;AAHV,GAAhB,CADO,EAMPA,UAPsB;AAQxBjB,YAAUa,oBAAUO,IARI;AASxBZ,aAAWK,oBAAUG,MATG;AAUxBX,eAAaQ,oBAAUG;AAVC,CAA1B;;AAaA9B,cAAcmC,YAAd,GAA6B;AAC3Bb,aAAW;AADgB,CAA7B;;kBAIetB,a","file":"CheckboxGroup.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {CheckIcon} from 'plotly-icons';\n\nclass CheckboxGroup extends Component {\n constructor(props) {\n super(props);\n this.state = {options: this.props.options};\n this.handleChange = this.handleChange.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState({options: nextProps.options});\n }\n\n handleChange(i) {\n var newOptions = this.props.options.slice();\n newOptions[i] = Object.assign(newOptions[i], {\n checked: !newOptions[i].checked,\n });\n this.props.onChange(newOptions);\n }\n\n renderOptions() {\n return this.state.options.map((option, i) => {\n const checkClass = classnames(['checkbox__check', 'icon'], {\n 'checkbox__check--checked': option.checked,\n });\n\n const itemClass = classnames('checkbox__item', {\n 'checkbox__item--vertical': this.props.orientation === 'vertical',\n 'checkbox__item--horizontal': this.props.orientation === 'horizontal',\n });\n\n return (\n
\n this.handleChange(i)}\n >\n {option.checked && (\n
\n \n
\n )}\n
\n
this.handleChange(i)}>\n {option.label}\n
\n \n );\n });\n }\n\n render() {\n const boxClass = classnames('checkbox__group', this.props.className, {\n checkbox__group_horizontal: this.props.orientation === 'horizontal',\n });\n\n return
{this.renderOptions()}
;\n }\n}\n\nCheckboxGroup.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired,\n checked: PropTypes.bool.isRequired,\n })\n ).isRequired,\n onChange: PropTypes.func,\n className: PropTypes.string,\n orientation: PropTypes.string,\n};\n\nCheckboxGroup.defaultProps = {\n className: '',\n};\n\nexport default CheckboxGroup;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/ColorPicker.js b/lib/components/widgets/ColorPicker.js deleted file mode 100644 index dc7651638..000000000 --- a/lib/components/widgets/ColorPicker.js +++ /dev/null @@ -1,190 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _SketchFields = require('react-color/lib/components/sketch/SketchFields'); - -var _SketchFields2 = _interopRequireDefault(_SketchFields); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _tinycolor = require('tinycolor2'); - -var _tinycolor2 = _interopRequireDefault(_tinycolor); - -var _common = require('react-color/lib/components/common'); - -var _reactColor = require('react-color'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// Utility functions for converting ColorPicker color objects or raw strings -// into TinyColor objects. -var extractRGB = function extractRGB(c) { - return c.rgb || c; -}; -var getColorSource = function getColorSource(c) { - return c.source === 'hex' ? c.hex : extractRGB(c); -}; -var toTinyColor = function toTinyColor(c) { - return (0, _tinycolor2.default)(getColorSource(c)); -}; - -var Custom = function (_Component) { - _inherits(Custom, _Component); - - function Custom() { - _classCallCheck(this, Custom); - - return _possibleConstructorReturn(this, (Custom.__proto__ || Object.getPrototypeOf(Custom)).apply(this, arguments)); - } - - _createClass(Custom, [{ - key: 'render', - value: function render() { - var onChangeComplete = this.props.onChangeComplete; - - - return _react2.default.createElement( - 'div', - { className: 'colorpicker__outer' }, - _react2.default.createElement( - 'div', - { className: 'colorpicker__controls +flex' }, - _react2.default.createElement( - 'div', - { className: 'colorpicker__sliders' }, - _react2.default.createElement( - 'div', - { className: 'colorpicker__slider' }, - _react2.default.createElement(_common.Hue, this.props) - ) - ) - ), - _react2.default.createElement( - 'div', - { className: 'colorpicker__saturation' }, - _react2.default.createElement(_common.Saturation, this.props) - ), - _react2.default.createElement( - 'div', - { className: 'colorpicker__custom-input' }, - _react2.default.createElement(_SketchFields2.default, _extends({}, this.props, { onChange: onChangeComplete })) - ) - ); - } - }]); - - return Custom; -}(_react.Component); - -Custom.propTypes = { - rgb: _propTypes2.default.object, - onChangeComplete: _propTypes2.default.func -}; - -var CustomColorPicker = (0, _reactColor.CustomPicker)(Custom); - -var ColorPicker = function (_Component2) { - _inherits(ColorPicker, _Component2); - - function ColorPicker(props) { - _classCallCheck(this, ColorPicker); - - var _this2 = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, props)); - - _this2.state = { - isVisible: false - }; - - _this2.onSelectedColorChange = _this2.onSelectedColorChange.bind(_this2); - _this2.toggleVisible = _this2.toggleVisible.bind(_this2); - return _this2; - } - - _createClass(ColorPicker, [{ - key: 'onSelectedColorChange', - value: function onSelectedColorChange(newColor) { - // We use our own toTinyColor because this value is a ColorPicker - // color value which is an object that needs unpacking. We also handle - // the case where a color string is passed in (just in case). - var color = toTinyColor(newColor); - - // relayout call only wants a RGB String - this.props.onColorChange(color.toRgbString()); - } - }, { - key: 'toggleVisible', - value: function toggleVisible() { - this.setState({ isVisible: !this.state.isVisible }); - } - }, { - key: 'render', - value: function render() { - // We use tinycolor here instead of our own toTinyColor as - // tinycolor handles `null` values and other weirdness we may - // expect from user data. - var selectedColor = (0, _tinycolor2.default)(this.props.selectedColor); - var colorText = selectedColor.toHexString(); - - // Convert rgba to rgb if necessary - var rgbString = selectedColor._a !== 0 ? selectedColor.toRgbString() : 'rgb(' + selectedColor._r + ',' + selectedColor._g + ',' + selectedColor._b + ')'; - - // We need inline style here to assign the background color - // dynamically. - var swatchStyle = { backgroundColor: rgbString }; - - return _react2.default.createElement( - _react.Fragment, - null, - _react2.default.createElement( - 'div', - { className: 'colorpicker__container' }, - _react2.default.createElement( - 'div', - { className: 'colorpicker' }, - _react2.default.createElement('div', { - className: 'colorpicker__swatch +cursor-clickable', - style: swatchStyle, - onClick: this.toggleVisible - }) - ), - _react2.default.createElement( - 'div', - { className: 'colorpicker__selected-color +hover-grey', onClick: this.toggleVisible }, - colorText - ) - ), - this.state.isVisible && _react2.default.createElement(CustomColorPicker, { color: rgbString, onChangeComplete: this.onSelectedColorChange }) - ); - } - }]); - - return ColorPicker; -}(_react.Component); - -ColorPicker.propTypes = { - onColorChange: _propTypes2.default.func.isRequired, - selectedColor: _propTypes2.default.string -}; - -exports.default = ColorPicker; -//# sourceMappingURL=ColorPicker.js.map \ No newline at end of file diff --git a/lib/components/widgets/ColorPicker.js.map b/lib/components/widgets/ColorPicker.js.map deleted file mode 100644 index 572d1e0bf..000000000 --- a/lib/components/widgets/ColorPicker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/ColorPicker.js"],"names":["extractRGB","c","rgb","getColorSource","source","hex","toTinyColor","Custom","onChangeComplete","props","Component","propTypes","PropTypes","object","func","CustomColorPicker","ColorPicker","state","isVisible","onSelectedColorChange","bind","toggleVisible","newColor","color","onColorChange","toRgbString","setState","selectedColor","colorText","toHexString","rgbString","_a","_r","_g","_b","swatchStyle","backgroundColor","isRequired","string"],"mappings":";;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA;AACA;AACA,IAAMA,aAAa,SAAbA,UAAa;AAAA,SAAKC,EAAEC,GAAF,IAASD,CAAd;AAAA,CAAnB;AACA,IAAME,iBAAiB,SAAjBA,cAAiB;AAAA,SAAMF,EAAEG,MAAF,KAAa,KAAb,GAAqBH,EAAEI,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L,CAAc,EAACR,WAAW,CAAC,KAAKD,KAAL,CAAWC,SAAxB,EAAd;AACD;;;6BAEQ;AACP;AACA;AACA;AACA,UAAMS,gBAAgB,yBAAU,KAAKlB,KAAL,CAAWkB,aAArB,CAAtB;AACA,UAAMC,YAAYD,cAAcE,WAAd,EAAlB;;AAEA;AACA,UAAMC,YACJH,cAAcI,EAAd,KAAqB,CAArB,GACIJ,cAAcF,WAAd,EADJ,YAEWE,cAAcK,EAFzB,SAE+BL,cAAcM,EAF7C,SAEmDN,cAAcO,EAFjE,MADF;;AAKA;AACA;AACA,UAAMC,cAAc,EAACC,iBAAiBN,SAAlB,EAApB;;AAEA,aACE;AAAC,uBAAD;AAAA;AACE;AAAA;AAAA,YAAK,WAAU,wBAAf;AACE;AAAA;AAAA,cAAK,WAAU,aAAf;AACE;AACE,yBAAU,uCADZ;AAEE,qBAAOK,WAFT;AAGE,uBAAS,KAAKd;AAHhB;AADF,WADF;AASE;AAAA;AAAA,cAAK,WAAU,yCAAf,EAAyD,SAAS,KAAKA,aAAvE;AACGO;AADH;AATF,SADF;AAeG,aAAKX,KAAL,CAAWC,SAAX,IACC,8BAAC,iBAAD,IAAmB,OAAOY,SAA1B,EAAqC,kBAAkB,KAAKX,qBAA5D;AAhBJ,OADF;AAqBD;;;;EAhEuBT,gB;;AAmE1BM,YAAYL,SAAZ,GAAwB;AACtBa,iBAAeZ,oBAAUE,IAAV,CAAeuB,UADR;AAEtBV,iBAAef,oBAAU0B;AAFH,CAAxB;;kBAKetB,W","file":"ColorPicker.js","sourcesContent":["import Fields from 'react-color/lib/components/sketch/SketchFields';\nimport React, {Component, Fragment} from 'react';\nimport PropTypes from 'prop-types';\nimport tinycolor from 'tinycolor2';\nimport {Hue, Saturation} from 'react-color/lib/components/common';\nimport {CustomPicker as customPicker} from 'react-color';\n\n// Utility functions for converting ColorPicker color objects or raw strings\n// into TinyColor objects.\nconst extractRGB = c => c.rgb || c;\nconst getColorSource = c => (c.source === 'hex' ? c.hex : extractRGB(c));\nconst toTinyColor = c => tinycolor(getColorSource(c));\n\nclass Custom extends Component {\n render() {\n const {onChangeComplete} = this.props;\n\n return (\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n );\n }\n}\n\nCustom.propTypes = {\n rgb: PropTypes.object,\n onChangeComplete: PropTypes.func,\n};\n\nconst CustomColorPicker = customPicker(Custom);\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n isVisible: false,\n };\n\n this.onSelectedColorChange = this.onSelectedColorChange.bind(this);\n this.toggleVisible = this.toggleVisible.bind(this);\n }\n\n onSelectedColorChange(newColor) {\n // We use our own toTinyColor because this value is a ColorPicker\n // color value which is an object that needs unpacking. We also handle\n // the case where a color string is passed in (just in case).\n const color = toTinyColor(newColor);\n\n // relayout call only wants a RGB String\n this.props.onColorChange(color.toRgbString());\n }\n\n toggleVisible() {\n this.setState({isVisible: !this.state.isVisible});\n }\n\n render() {\n // We use tinycolor here instead of our own toTinyColor as\n // tinycolor handles `null` values and other weirdness we may\n // expect from user data.\n const selectedColor = tinycolor(this.props.selectedColor);\n const colorText = selectedColor.toHexString();\n\n // Convert rgba to rgb if necessary\n const rgbString =\n selectedColor._a !== 0\n ? selectedColor.toRgbString()\n : `rgb(${selectedColor._r},${selectedColor._g},${selectedColor._b})`;\n\n // We need inline style here to assign the background color\n // dynamically.\n const swatchStyle = {backgroundColor: rgbString};\n\n return (\n \n
\n
\n \n
\n\n
\n {colorText}\n
\n
\n\n {this.state.isVisible && (\n \n )}\n
\n );\n }\n}\n\nColorPicker.propTypes = {\n onColorChange: PropTypes.func.isRequired,\n selectedColor: PropTypes.string,\n};\n\nexport default ColorPicker;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/ColorscalePicker.js b/lib/components/widgets/ColorscalePicker.js deleted file mode 100644 index 6d52b3fff..000000000 --- a/lib/components/widgets/ColorscalePicker.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _reactColorscales = require('react-colorscales'); - -var _reactColorscales2 = _interopRequireDefault(_reactColorscales); - -var _Dropdown = require('./Dropdown'); - -var _Dropdown2 = _interopRequireDefault(_Dropdown); - -var _Info = require('../fields/Info'); - -var _Info2 = _interopRequireDefault(_Info); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Scale = function (_Component) { - _inherits(Scale, _Component); - - function Scale(props) { - _classCallCheck(this, Scale); - - var _this = _possibleConstructorReturn(this, (Scale.__proto__ || Object.getPrototypeOf(Scale)).call(this, props)); - - _this.state = { - selectedColorscaleType: props.initialCategory || 'sequential', - showColorscalePicker: false - }; - - _this.onChange = _this.onChange.bind(_this); - _this.onClick = _this.onClick.bind(_this); - return _this; - } - - _createClass(Scale, [{ - key: 'onClick', - value: function onClick() { - this.setState({ - showColorscalePicker: !this.state.showColorscalePicker - }); - } - }, { - key: 'onChange', - value: function onChange(selectedColorscaleType) { - this.setState({ selectedColorscaleType: selectedColorscaleType }); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - onColorscaleChange = _props.onColorscaleChange, - selected = _props.selected; - var _state = this.state, - selectedColorscaleType = _state.selectedColorscaleType, - showColorscalePicker = _state.showColorscalePicker; - - var description = _reactColorscales.COLOR_PICKER_CONSTANTS.COLORSCALE_DESCRIPTIONS[selectedColorscaleType]; - var colorscaleOptions = _reactColorscales.COLOR_PICKER_CONSTANTS.COLORSCALE_TYPES.filter(function (type) { - return type !== 'custom'; - }).map(function (type) { - return { - label: type + ' scales', - value: type - }; - }); - var _ = this.context.localize; - - return _react2.default.createElement( - 'div', - { className: 'customPickerContainer__outer' }, - _react2.default.createElement(_reactColorscales.Colorscale, { colorscale: selected, onClick: this.onClick }), - showColorscalePicker ? _react2.default.createElement( - 'div', - { className: 'customPickerContainer' }, - _react2.default.createElement(_Dropdown2.default, { - options: colorscaleOptions, - value: selectedColorscaleType, - onChange: this.onChange, - clearable: false, - searchable: false, - placeholder: _('Select a Colorscale Type') - }), - description ? _react2.default.createElement( - _react.Fragment, - null, - _react2.default.createElement(_reactColorscales2.default, { - onChange: onColorscaleChange, - colorscale: selected, - width: 215, - colorscaleType: this.state.selectedColorscaleType, - onColorscaleTypeChange: this.onColorscaleTypeChange, - disableSwatchControls: true, - scaleLength: 7 - }), - _react2.default.createElement( - _Info2.default, - null, - description - ) - ) : null - ) : null - ); - } - }]); - - return Scale; -}(_react.Component); - -Scale.propTypes = { - onColorscaleChange: _propTypes2.default.func, - selected: _propTypes2.default.array, - label: _propTypes2.default.string, - initialCategory: _propTypes2.default.string -}; - -Scale.contextType = _context.EditorControlsContext; - -exports.default = Scale; -//# sourceMappingURL=ColorscalePicker.js.map \ No newline at end of file diff --git a/lib/components/widgets/ColorscalePicker.js.map b/lib/components/widgets/ColorscalePicker.js.map deleted file mode 100644 index 6b650726e..000000000 --- a/lib/components/widgets/ColorscalePicker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/ColorscalePicker.js"],"names":["Scale","props","state","selectedColorscaleType","initialCategory","showColorscalePicker","onChange","bind","onClick","setState","onColorscaleChange","selected","description","COLOR_PICKER_CONSTANTS","COLORSCALE_DESCRIPTIONS","colorscaleOptions","COLORSCALE_TYPES","filter","type","map","label","value","_","context","localize","onColorscaleTypeChange","Component","propTypes","PropTypes","func","array","string","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,K;;;AACJ,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8GACXA,KADW;;AAGjB,UAAKC,KAAL,GAAa;AACXC,8BAAwBF,MAAMG,eAAN,IAAyB,YADtC;AAEXC,4BAAsB;AAFX,KAAb;;AAKA,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AACA,UAAKC,OAAL,GAAe,MAAKA,OAAL,CAAaD,IAAb,OAAf;AATiB;AAUlB;;;;8BAES;AACR,WAAKE,QAAL,CAAc;AACZJ,8BAAsB,CAAC,KAAKH,KAAL,CAAWG;AADtB,OAAd;AAGD;;;6BAEQF,sB,EAAwB;AAC/B,WAAKM,QAAL,CAAc,EAACN,8CAAD,EAAd;AACD;;;6BAEQ;AAAA,mBACgC,KAAKF,KADrC;AAAA,UACAS,kBADA,UACAA,kBADA;AAAA,UACoBC,QADpB,UACoBA,QADpB;AAAA,mBAEgD,KAAKT,KAFrD;AAAA,UAEAC,sBAFA,UAEAA,sBAFA;AAAA,UAEwBE,oBAFxB,UAEwBA,oBAFxB;;AAGP,UAAMO,cAAcC,yCAAuBC,uBAAvB,CAA+CX,sBAA/C,CAApB;AACA,UAAMY,oBAAoBF,yCAAuBG,gBAAvB,CAAwCC,MAAxC,CACxB;AAAA,eAAQC,SAAS,QAAjB;AAAA,OADwB,EAExBC,GAFwB,CAEpB;AAAA,eAAS;AACbC,iBAAOF,OAAO,SADD;AAEbG,iBAAOH;AAFM,SAAT;AAAA,OAFoB,CAA1B;AAMA,UAAMI,IAAI,KAAKC,OAAL,CAAaC,QAAvB;;AAEA,aACE;AAAA;AAAA,UAAK,WAAU,8BAAf;AACE,sCAAC,4BAAD,IAAY,YAAYb,QAAxB,EAAkC,SAAS,KAAKH,OAAhD,GADF;AAGGH,+BACC;AAAA;AAAA,YAAK,WAAU,uBAAf;AACE,wCAAC,kBAAD;AACE,qBAASU,iBADX;AAEE,mBAAOZ,sBAFT;AAGE,sBAAU,KAAKG,QAHjB;AAIE,uBAAW,KAJb;AAKE,wBAAY,KALd;AAME,yBAAagB,EAAE,0BAAF;AANf,YADF;AASGV,wBACC;AAAC,2BAAD;AAAA;AACE,0CAAC,0BAAD;AACE,wBAAUF,kBADZ;AAEE,0BAAYC,QAFd;AAGE,qBAAO,GAHT;AAIE,8BAAgB,KAAKT,KAAL,CAAWC,sBAJ7B;AAKE,sCAAwB,KAAKsB,sBAL/B;AAME,yCANF;AAOE,2BAAa;AAPf,cADF;AAUE;AAAC,4BAAD;AAAA;AAAOb;AAAP;AAVF,WADD,GAaG;AAtBN,SADD,GAyBG;AA5BN,OADF;AAgCD;;;;EAnEiBc,gB;;AAsEpB1B,MAAM2B,SAAN,GAAkB;AAChBjB,sBAAoBkB,oBAAUC,IADd;AAEhBlB,YAAUiB,oBAAUE,KAFJ;AAGhBV,SAAOQ,oBAAUG,MAHD;AAIhB3B,mBAAiBwB,oBAAUG;AAJX,CAAlB;;AAOA/B,MAAMgC,WAAN,GAAoBC,8BAApB;;kBAEejC,K","file":"ColorscalePicker.js","sourcesContent":["import ColorscalePicker, {Colorscale, COLOR_PICKER_CONSTANTS} from 'react-colorscales';\nimport Dropdown from './Dropdown';\nimport Info from '../fields/Info';\nimport PropTypes from 'prop-types';\nimport React, {Component, Fragment} from 'react';\nimport {EditorControlsContext} from '../../context';\n\nclass Scale extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n selectedColorscaleType: props.initialCategory || 'sequential',\n showColorscalePicker: false,\n };\n\n this.onChange = this.onChange.bind(this);\n this.onClick = this.onClick.bind(this);\n }\n\n onClick() {\n this.setState({\n showColorscalePicker: !this.state.showColorscalePicker,\n });\n }\n\n onChange(selectedColorscaleType) {\n this.setState({selectedColorscaleType});\n }\n\n render() {\n const {onColorscaleChange, selected} = this.props;\n const {selectedColorscaleType, showColorscalePicker} = this.state;\n const description = COLOR_PICKER_CONSTANTS.COLORSCALE_DESCRIPTIONS[selectedColorscaleType];\n const colorscaleOptions = COLOR_PICKER_CONSTANTS.COLORSCALE_TYPES.filter(\n type => type !== 'custom'\n ).map(type => ({\n label: type + ' scales',\n value: type,\n }));\n const _ = this.context.localize;\n\n return (\n
\n \n\n {showColorscalePicker ? (\n
\n \n {description ? (\n \n \n {description}\n \n ) : null}\n
\n ) : null}\n
\n );\n }\n}\n\nScale.propTypes = {\n onColorscaleChange: PropTypes.func,\n selected: PropTypes.array,\n label: PropTypes.string,\n initialCategory: PropTypes.string,\n};\n\nScale.contextType = EditorControlsContext;\n\nexport default Scale;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/Dropdown.js b/lib/components/widgets/Dropdown.js deleted file mode 100644 index 36aa2f08b..000000000 --- a/lib/components/widgets/Dropdown.js +++ /dev/null @@ -1,164 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactSelect = require('react-select'); - -var _reactSelect2 = _interopRequireDefault(_reactSelect); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Dropdown = function (_Component) { - _inherits(Dropdown, _Component); - - function Dropdown(props) { - _classCallCheck(this, Dropdown); - - var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props)); - - _this.onChange = _this.onChange.bind(_this); - return _this; - } - - _createClass(Dropdown, [{ - key: 'onChange', - value: function onChange(selection) { - var _props = this.props, - multi = _props.multi, - onChange = _props.onChange, - valueKey = _props.valueKey; - - - if (!selection) { - return onChange(null); - } else if (multi) { - return onChange(selection.map(function (s) { - return s[valueKey]; - })); - } - - return onChange(selection[valueKey]); - } - }, { - key: 'render', - value: function render() { - var _props2 = this.props, - backspaceToRemoveMessage = _props2.backspaceToRemoveMessage, - minWidth = _props2.minWidth, - placeholder = _props2.placeholder, - clearable = _props2.clearable, - value = _props2.value, - options = _props2.options, - searchable = _props2.searchable, - multi = _props2.multi, - optionRenderer = _props2.optionRenderer, - valueRenderer = _props2.valueRenderer, - noResultsText = _props2.noResultsText, - valueKey = _props2.valueKey, - disabled = _props2.disabled, - className = _props2.className, - width = _props2.width; - var _ = this.context.localize; - - - var dropdownStyle = { minWidth: minWidth }; - if (width) { - dropdownStyle.width = width; - } - - var opts = options.slice(); - for (var i = 0; i < opts.length; i++) { - if (typeof opts[i] === 'string') { - opts[i] = _defineProperty({ label: opts[i] }, valueKey, opts[i]); - } - } - - var dropdownContainerClass = (0, _classnames2.default)('dropdown-container', { - 'dropdown--dark': this.props.backgroundDark - }); - - return _react2.default.createElement( - 'div', - { className: dropdownContainerClass, style: dropdownStyle }, - _react2.default.createElement(_reactSelect2.default, { - backspaceToRemoveMessage: backspaceToRemoveMessage, - placeholder: placeholder || _('Select an Option'), - clearable: clearable, - value: value, - options: opts, - searchable: searchable, - onChange: this.onChange, - multi: multi, - optionRenderer: optionRenderer, - valueRenderer: valueRenderer, - noResultsText: noResultsText || _('No Results'), - valueKey: valueKey, - disabled: disabled, - className: className - }) - ); - } - }]); - - return Dropdown; -}(_react.Component); - -Dropdown.defaultProps = { - clearable: true, - multi: false, - searchable: false, - minWidth: '120px', - valueKey: 'value', - disabled: false -}; - -Dropdown.propTypes = { - backspaceToRemoveMessage: _propTypes2.default.string, - backgroundDark: _propTypes2.default.bool, - clearable: _propTypes2.default.bool, - onChange: _propTypes2.default.func.isRequired, - options: _propTypes2.default.array.isRequired, - placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), - searchable: _propTypes2.default.bool, - minWidth: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - valueKey: _propTypes2.default.string, - value: _propTypes2.default.any, - multi: _propTypes2.default.bool, - optionRenderer: _propTypes2.default.func, - valueRenderer: _propTypes2.default.func, - noResultsText: _propTypes2.default.string, - disabled: _propTypes2.default.bool, - className: _propTypes2.default.string, - width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]) -}; - -Dropdown.contextType = _context.EditorControlsContext; - -exports.default = Dropdown; -//# sourceMappingURL=Dropdown.js.map \ No newline at end of file diff --git a/lib/components/widgets/Dropdown.js.map b/lib/components/widgets/Dropdown.js.map deleted file mode 100644 index 40d031c80..000000000 --- a/lib/components/widgets/Dropdown.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/Dropdown.js"],"names":["Dropdown","props","onChange","bind","selection","multi","valueKey","map","s","backspaceToRemoveMessage","minWidth","placeholder","clearable","value","options","searchable","optionRenderer","valueRenderer","noResultsText","disabled","className","width","_","context","localize","dropdownStyle","opts","slice","i","length","label","dropdownContainerClass","backgroundDark","Component","defaultProps","propTypes","PropTypes","string","bool","func","isRequired","array","oneOfType","object","number","any","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,Q;;;AACJ,oBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oHACXA,KADW;;AAGjB,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AAHiB;AAIlB;;;;6BAEQC,S,EAAW;AAAA,mBACkB,KAAKH,KADvB;AAAA,UACXI,KADW,UACXA,KADW;AAAA,UACJH,QADI,UACJA,QADI;AAAA,UACMI,QADN,UACMA,QADN;;;AAGlB,UAAI,CAACF,SAAL,EAAgB;AACd,eAAOF,SAAS,IAAT,CAAP;AACD,OAFD,MAEO,IAAIG,KAAJ,EAAW;AAChB,eAAOH,SAASE,UAAUG,GAAV,CAAc;AAAA,iBAAKC,EAAEF,QAAF,CAAL;AAAA,SAAd,CAAT,CAAP;AACD;;AAED,aAAOJ,SAASE,UAAUE,QAAV,CAAT,CAAP;AACD;;;6BAEQ;AAAA,oBAiBH,KAAKL,KAjBF;AAAA,UAELQ,wBAFK,WAELA,wBAFK;AAAA,UAGLC,QAHK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;kBAEe/C,Q","file":"Dropdown.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport Select from 'react-select';\nimport classnames from 'classnames';\nimport {EditorControlsContext} from '../../context';\n\nclass Dropdown extends Component {\n constructor(props) {\n super(props);\n\n this.onChange = this.onChange.bind(this);\n }\n\n onChange(selection) {\n const {multi, onChange, valueKey} = this.props;\n\n if (!selection) {\n return onChange(null);\n } else if (multi) {\n return onChange(selection.map(s => s[valueKey]));\n }\n\n return onChange(selection[valueKey]);\n }\n\n render() {\n const {\n backspaceToRemoveMessage,\n minWidth,\n placeholder,\n clearable,\n value,\n options,\n searchable,\n multi,\n optionRenderer,\n valueRenderer,\n noResultsText,\n valueKey,\n disabled,\n className,\n width,\n } = this.props;\n\n const {localize: _} = this.context;\n\n const dropdownStyle = {minWidth};\n if (width) {\n dropdownStyle.width = width;\n }\n\n const opts = options.slice();\n for (let i = 0; i < opts.length; i++) {\n if (typeof opts[i] === 'string') {\n opts[i] = {label: opts[i], [valueKey]: opts[i]};\n }\n }\n\n const dropdownContainerClass = classnames('dropdown-container', {\n 'dropdown--dark': this.props.backgroundDark,\n });\n\n return (\n
\n \n
\n );\n }\n}\n\nDropdown.defaultProps = {\n clearable: true,\n multi: false,\n searchable: false,\n minWidth: '120px',\n valueKey: 'value',\n disabled: false,\n};\n\nDropdown.propTypes = {\n backspaceToRemoveMessage: PropTypes.string,\n backgroundDark: PropTypes.bool,\n clearable: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n options: PropTypes.array.isRequired,\n placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n searchable: PropTypes.bool,\n minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n valueKey: PropTypes.string,\n value: PropTypes.any,\n multi: PropTypes.bool,\n optionRenderer: PropTypes.func,\n valueRenderer: PropTypes.func,\n noResultsText: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n};\n\nDropdown.contextType = EditorControlsContext;\n\nexport default Dropdown;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/Dropzone.js b/lib/components/widgets/Dropzone.js deleted file mode 100644 index 55c3366e7..000000000 --- a/lib/components/widgets/Dropzone.js +++ /dev/null @@ -1,222 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactDropzone = require('react-dropzone'); - -var _reactDropzone2 = _interopRequireDefault(_reactDropzone); - -var _context = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Dropzone = function (_Component) { - _inherits(Dropzone, _Component); - - function Dropzone(props, context) { - _classCallCheck(this, Dropzone); - - var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context)); - - var _ = context.localize; - - _this.state = { - content: '' - }; - - _this.validFiletypes = { - image: _('image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp') - }; - - _this.onDrop = _this.onDrop.bind(_this); - _this.renderSuccess = _this.renderSuccess.bind(_this); - return _this; - } - - _createClass(Dropzone, [{ - key: 'renderSuccess', - value: function renderSuccess(value) { - var _ = this.context.localize; - - if (this.props.fileType === 'image') { - return _react2.default.createElement('div', { className: 'dropzone-container__image', style: { backgroundImage: 'url(' + value + ')' } }); - } - - return _react2.default.createElement( - 'div', - { className: 'dropzone-container__message' }, - _('File loaded!') - ); - } - }, { - key: 'componentWillMount', - value: function componentWillMount() { - var _ = this.context.localize; - - if (this.props.value && this.props.value !== '') { - this.setState({ content: this.renderSuccess(this.props.value) }); - return; - } - - this.setState({ - content: _react2.default.createElement( - 'div', - { className: 'dropzone-container__message' }, - _react2.default.createElement( - 'p', - null, - _('Drop the ') + this.props.fileType + _(' to upload here or click to choose a file from your computer.') - ), - this.props.fileType === 'image' ? _react2.default.createElement( - 'p', - null, - _('Supported formats are: ') + this.validFiletypes[this.props.fileType].split('image/').join('') + '.' - ) : null - ) - }); - } - }, { - key: 'onLoad', - value: function onLoad(e) { - var _ = this.context.localize; - var supportedFileTypes = this.props.fileType === 'image' ? this.validFiletypes[this.props.fileType].split('image/').join('') : this.validFiletypes[this.props.fileType]; - - var parsingError = _react2.default.createElement( - 'div', - { className: 'dropzone-container__message' }, - _react2.default.createElement( - 'p', - null, - _('Yikes! An error occurred while parsing this file.') - ), - _react2.default.createElement( - 'p', - null, - _('Try again with a supported file format: ') + supportedFileTypes + '.' - ) - ); - - if (this.props.fileType === 'image') { - try { - this.props.onUpdate(e.target.result); - this.setState({ - content: this.renderSuccess(e.target.result) - }); - } catch (error) { - console.warn(error); // eslint-disable-line - this.setState({ - content: parsingError - }); - } - } - } - }, { - key: 'onDrop', - value: function onDrop(accepted, rejected) { - var _this2 = this; - - var _ = this.context.localize; - var reader = new FileReader(); - - if (accepted.length) { - if (accepted.length > 1) { - this.setState({ - content: _react2.default.createElement( - 'div', - { className: 'dropzone-container__message' }, - _react2.default.createElement( - 'p', - null, - _('Yikes! You can only upload one file at a time.') - ), - _react2.default.createElement( - 'p', - null, - _('To upload multiple files, create multiple files and upload them individually.') - ) - ) - }); - return; - } - this.setState({ content: _('Loading...') }); - reader.onload = function (e) { - return _this2.onLoad(e); - }; - if (this.props.fileType === 'image') { - reader.readAsDataURL(accepted[0]); - } - } - - if (rejected.length) { - var supportedFileTypes = this.props.fileType === 'image' ? this.validFiletypes[this.props.fileType].split('image/').join('') : this.validFiletypes[this.props.fileType]; - - this.setState({ - content: _react2.default.createElement( - 'div', - { className: 'dropzone-container__message' }, - _react2.default.createElement( - 'p', - null, - _("Yikes! This doesn't look like a valid ") + this.props.fileType + _(' to us. ') - ), - _react2.default.createElement( - 'p', - null, - _('Try again with a ') + supportedFileTypes + ' file.' - ) - ) - }); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactDropzone2.default, - { - accept: this.validFiletypes[this.props.fileType], - onDrop: this.onDrop, - className: 'dropzone-container', - activeClassName: 'dropzone-container--active', - rejectClassName: 'dropzone-container--rejected' - }, - _react2.default.createElement( - 'div', - { className: 'dropzone-container__content' }, - this.state.content - ) - ); - } - }]); - - return Dropzone; -}(_react.Component); - -Dropzone.propTypes = { - fileType: _propTypes2.default.string.isRequired, - onUpdate: _propTypes2.default.func, - value: _propTypes2.default.any -}; - -Dropzone.contextType = _context.EditorControlsContext; - -exports.default = Dropzone; -//# sourceMappingURL=Dropzone.js.map \ No newline at end of file diff --git a/lib/components/widgets/Dropzone.js.map b/lib/components/widgets/Dropzone.js.map deleted file mode 100644 index 9dea0315e..000000000 --- a/lib/components/widgets/Dropzone.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/Dropzone.js"],"names":["Dropzone","props","context","_","localize","state","content","validFiletypes","image","onDrop","bind","renderSuccess","value","fileType","backgroundImage","setState","split","join","e","supportedFileTypes","parsingError","onUpdate","target","result","error","console","warn","accepted","rejected","reader","FileReader","length","onload","onLoad","readAsDataURL","Component","propTypes","PropTypes","string","isRequired","func","any","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,Q;;;AACJ,oBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oHACpBD,KADoB,EACbC,OADa;;AAE1B,QAAMC,IAAID,QAAQE,QAAlB;;AAEA,UAAKC,KAAL,GAAa;AACXC,eAAS;AADE,KAAb;;AAIA,UAAKC,cAAL,GAAsB;AACpBC,aAAOL,EAAE,+EAAF;AADa,KAAtB;;AAIA,UAAKM,MAAL,GAAc,MAAKA,MAAL,CAAYC,IAAZ,OAAd;AACA,UAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBD,IAAnB,OAArB;AAb0B;AAc3B;;;;kCAEaE,K,EAAO;AACnB,UAAMT,IAAI,KAAKD,OAAL,CAAaE,QAAvB;;AAEA,UAAI,KAAKH,KAAL,CAAWY,QAAX,KAAwB,OAA5B,EAAqC;AACnC,eACE,uCAAK,WAAU,2BAAf,EAA2C,OAAO,EAACC,0BAAwBF,KAAxB,MAAD,EAAlD,GADF;AAGD;;AAED,aAAO;AAAA;AAAA,UAAK,WAAU,6BAAf;AAA8CT,UAAE,cAAF;AAA9C,OAAP;AACD;;;yCAEoB;AACnB,UAAMA,IAAI,KAAKD,OAAL,CAAaE,QAAvB;;AAEA,UAAI,KAAKH,KAAL,CAAWW,KAAX,IAAoB,KAAKX,KAAL,CAAWW,KAAX,KAAqB,EAA7C,EAAiD;AAC/C,aAAKG,QAAL,CAAc,EAACT,SAAS,KAAKK,aAAL,CAAmB,KAAKV,KAAL,CAAWW,KAA9B,CAAV,EAAd;AACA;AACD;;AAED,WAAKG,QAAL,CAAc;AACZT,iBACE;AAAA;AAAA,YAAK,WAAU,6BA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AAAC,+BAAD;AAAA;AACE,kBAAQ,KAAKZ,cAAL,CAAoB,KAAKN,KAAL,CAAWY,QAA/B,CADV;AAEE,kBAAQ,KAAKJ,MAFf;AAGE,qBAAU,oBAHZ;AAIE,2BAAgB,4BAJlB;AAKE,2BAAgB;AALlB;AAOE;AAAA;AAAA,YAAK,WAAU,6BAAf;AAA8C,eAAKJ,KAAL,CAAWC;AAAzD;AAPF,OADF;AAWD;;;;EA/IoB6B,gB;;AAkJvBnC,SAASoC,SAAT,GAAqB;AACnBvB,YAAUwB,oBAAUC,MAAV,CAAiBC,UADR;AAEnBlB,YAAUgB,oBAAUG,IAFD;AAGnB5B,SAAOyB,oBAAUI;AAHE,CAArB;;AAMAzC,SAAS0C,WAAT,GAAuBC,8BAAvB;;kBAEe3C,Q","file":"Dropzone.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport Drop from 'react-dropzone';\nimport {EditorControlsContext} from '../../context';\n\nclass Dropzone extends Component {\n constructor(props, context) {\n super(props, context);\n const _ = context.localize;\n\n this.state = {\n content: '',\n };\n\n this.validFiletypes = {\n image: _('image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp'),\n };\n\n this.onDrop = this.onDrop.bind(this);\n this.renderSuccess = this.renderSuccess.bind(this);\n }\n\n renderSuccess(value) {\n const _ = this.context.localize;\n\n if (this.props.fileType === 'image') {\n return (\n
\n );\n }\n\n return
{_('File loaded!')}
;\n }\n\n componentWillMount() {\n const _ = this.context.localize;\n\n if (this.props.value && this.props.value !== '') {\n this.setState({content: this.renderSuccess(this.props.value)});\n return;\n }\n\n this.setState({\n content: (\n
\n

\n {_('Drop the ') +\n this.props.fileType +\n _(' to upload here or click to choose a file from your computer.')}\n

\n\n {this.props.fileType === 'image' ? (\n

\n {_('Supported formats are: ') +\n this.validFiletypes[this.props.fileType].split('image/').join('') +\n '.'}\n

\n ) : null}\n
\n ),\n });\n }\n\n onLoad(e) {\n const _ = this.context.localize;\n const supportedFileTypes =\n this.props.fileType === 'image'\n ? this.validFiletypes[this.props.fileType].split('image/').join('')\n : this.validFiletypes[this.props.fileType];\n\n const parsingError = (\n
\n

{_('Yikes! An error occurred while parsing this file.')}

\n

{_('Try again with a supported file format: ') + supportedFileTypes + '.'}

\n
\n );\n\n if (this.props.fileType === 'image') {\n try {\n this.props.onUpdate(e.target.result);\n this.setState({\n content: this.renderSuccess(e.target.result),\n });\n } catch (error) {\n console.warn(error); // eslint-disable-line\n this.setState({\n content: parsingError,\n });\n }\n }\n }\n\n onDrop(accepted, rejected) {\n const _ = this.context.localize;\n const reader = new FileReader();\n\n if (accepted.length) {\n if (accepted.length > 1) {\n this.setState({\n content: (\n
\n

{_('Yikes! You can only upload one file at a time.')}

\n

\n {_('To upload multiple files, create multiple files and upload them individually.')}\n

\n
\n ),\n });\n return;\n }\n this.setState({content: _('Loading...')});\n reader.onload = e => this.onLoad(e);\n if (this.props.fileType === 'image') {\n reader.readAsDataURL(accepted[0]);\n }\n }\n\n if (rejected.length) {\n const supportedFileTypes =\n this.props.fileType === 'image'\n ? this.validFiletypes[this.props.fileType].split('image/').join('')\n : this.validFiletypes[this.props.fileType];\n\n this.setState({\n content: (\n
\n

\n {_(\"Yikes! This doesn't look like a valid \") + this.props.fileType + _(' to us. ')}\n

\n

{_('Try again with a ') + supportedFileTypes + ' file.'}

\n
\n ),\n });\n }\n }\n\n render() {\n return (\n \n
{this.state.content}
\n \n );\n }\n}\n\nDropzone.propTypes = {\n fileType: PropTypes.string.isRequired,\n onUpdate: PropTypes.func,\n value: PropTypes.any,\n};\n\nDropzone.contextType = EditorControlsContext;\n\nexport default Dropzone;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/EditableText.js b/lib/components/widgets/EditableText.js deleted file mode 100644 index 5674c61d6..000000000 --- a/lib/components/widgets/EditableText.js +++ /dev/null @@ -1,162 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ENTER_KEYCODE = 13; - -// A generic component to handle text that can be edited when the user -// clicks on it. - -var EditableText = function (_Component) { - _inherits(EditableText, _Component); - - function EditableText(props) { - _classCallCheck(this, EditableText); - - var _this = _possibleConstructorReturn(this, (EditableText.__proto__ || Object.getPrototypeOf(EditableText)).call(this, props)); - - _this.handleFocus = _this.handleFocus.bind(_this); - _this.handleChange = _this.handleChange.bind(_this); - _this.handleUpdate = _this.handleUpdate.bind(_this); - _this.handleKeyPress = _this.handleKeyPress.bind(_this); - _this.handleWheel = _this.handleWheel.bind(_this); - _this.getRef = _this.getRef.bind(_this); - return _this; - } - - _createClass(EditableText, [{ - key: 'getRef', - value: function getRef(c) { - this._ref = c; - } - - // Selects/highlights all of the text in the filename input - - }, { - key: 'handleFocus', - value: function handleFocus(event) { - event.target.select(); - } - }, { - key: 'handleChange', - value: function handleChange(event) { - var onChange = this.props.onChange; - - - if (onChange) { - onChange(event.target.value); - } - } - }, { - key: 'handleUpdate', - value: function handleUpdate(event) { - var onUpdate = this.props.onUpdate; - - - if (onUpdate) { - onUpdate(event.target.value); - } - } - }, { - key: 'handleKeyPress', - value: function handleKeyPress(event) { - // This will force handleUpdate to be called via the input's onBlur - if ((event.keyCode || event.which) === ENTER_KEYCODE) { - this._ref.blur(); - } - } - }, { - key: 'handleWheel', - value: function handleWheel(event) { - if (this.props.onWheel && document.activeElement === this._ref) { - this.props.onWheel(event); - } - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - type = _props.type, - className = _props.className, - text = _props.text, - disable = _props.disable, - autoFocus = _props.autoFocus, - onKeyDown = _props.onKeyDown, - placeholder = _props.placeholder, - readOnly = _props.readOnly, - size = _props.size; - - return _react2.default.createElement('input', { - ref: this.getRef, - type: type, - className: className || '', - value: text, - onFocus: this.handleFocus, - onChange: this.handleChange, - onBlur: this.handleUpdate, - disabled: disable, - autoFocus: autoFocus, - onKeyPress: this.handleKeyPress, - onKeyDown: onKeyDown, - onWheel: this.handleWheel, - placeholder: placeholder, - readOnly: readOnly, - size: size - }); - } - }]); - - return EditableText; -}(_react.Component); - -EditableText.propTypes = { - // Called with input value on changes (as the user types) - onChange: _propTypes2.default.func, - - // Called with input value on blur (and enter if no onEnter is given) - onUpdate: _propTypes2.default.func, - - // Called on input keyDown events - onKeyDown: _propTypes2.default.func, - - onWheel: _propTypes2.default.func, - // Input value property ... - text: _propTypes2.default.any, - - // Input properties - placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - className: _propTypes2.default.string, - disable: _propTypes2.default.bool, - autoFocus: _propTypes2.default.bool, - readOnly: _propTypes2.default.bool, - type: _propTypes2.default.oneOf(['text', 'password']), - size: _propTypes2.default.number -}; - -EditableText.defaultProps = { - readOnly: false, - type: 'text' -}; - -exports.default = EditableText; -//# sourceMappingURL=EditableText.js.map \ No newline at end of file diff --git a/lib/components/widgets/EditableText.js.map b/lib/components/widgets/EditableText.js.map deleted file mode 100644 index 169695097..000000000 --- a/lib/components/widgets/EditableText.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/EditableText.js"],"names":["ENTER_KEYCODE","EditableText","props","handleFocus","bind","handleChange","handleUpdate","handleKeyPress","handleWheel","getRef","c","_ref","event","target","select","onChange","value","onUpdate","keyCode","which","blur","onWheel","document","activeElement","type","className","text","disable","autoFocus","onKeyDown","placeholder","readOnly","size","Component","propTypes","PropTypes","func","any","oneOfType","string","number","bool","oneOf","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;AAEA,IAAMA,gBAAgB,EAAtB;;AAEA;AACA;;IACMC,Y;;;AACJ,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA,4HACXA,KADW;;AAGjB,UAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBD,IAAlB,OAApB;AACA,UAAKE,YAAL,GAAoB,MAAKA,YAAL,CAAkBF,IAAlB,OAApB;AACA,UAAKG,cAAL,GAAsB,MAAKA,cAAL,CAAoBH,IAApB,OAAtB;AACA,UAAKI,WAAL,GAAmB,MAAKA,WAAL,CAAiBJ,IAAjB,OAAnB;AACA,UAAKK,MAAL,GAAc,MAAKA,MAAL,CAAYL,IAAZ,OAAd;AARiB;AASlB;;;;2BAEMM,C,EAAG;AACR,WAAKC,IAAL,GAAYD,CAAZ;AACD;;AAED;;;;gCACYE,K,EAAO;AACjBA,YAAMC,MAAN,CAAaC,MAAb;AACD;;;iCAEYF,K,EAAO;AAAA,UACXG,QADW,GACC,KAAKb,KADN,CACXa,QADW;;;AAGlB,UAAIA,QAAJ,EAAc;AACZA,iBAASH,MAAMC,MAAN,CAAaG,KAAtB;AACD;AACF;;;iCAEYJ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B;AACAnB,YAAUkB,oBAAUC,IALG;;AAOvB;AACAP,aAAWM,oBAAUC,IARE;;AAUvBf,WAASc,oBAAUC,IAVI;AAWvB;AACAV,QAAMS,oBAAUE,GAZO;;AAcvB;AACAP,eAAaK,oBAAUG,SAAV,CAAoB,CAACH,oBAAUI,MAAX,EAAmBJ,oBAAUK,MAA7B,CAApB,CAfU;AAgBvBf,aAAWU,oBAAUI,MAhBE;AAiBvBZ,WAASQ,oBAAUM,IAjBI;AAkBvBb,aAAWO,oBAAUM,IAlBE;AAmBvBV,YAAUI,oBAAUM,IAnBG;AAoBvBjB,QAAMW,oBAAUO,KAAV,CAAgB,CAAC,MAAD,EAAS,UAAT,CAAhB,CApBiB;AAqBvBV,QAAMG,oBAAUK;AArBO,CAAzB;;AAwBAvC,aAAa0C,YAAb,GAA4B;AAC1BZ,YAAU,KADgB;AAE1BP,QAAM;AAFoB,CAA5B;;kBAKevB,Y","file":"EditableText.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nconst ENTER_KEYCODE = 13;\n\n// A generic component to handle text that can be edited when the user\n// clicks on it.\nclass EditableText extends Component {\n constructor(props) {\n super(props);\n\n this.handleFocus = this.handleFocus.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.handleUpdate = this.handleUpdate.bind(this);\n this.handleKeyPress = this.handleKeyPress.bind(this);\n this.handleWheel = this.handleWheel.bind(this);\n this.getRef = this.getRef.bind(this);\n }\n\n getRef(c) {\n this._ref = c;\n }\n\n // Selects/highlights all of the text in the filename input\n handleFocus(event) {\n event.target.select();\n }\n\n handleChange(event) {\n const {onChange} = this.props;\n\n if (onChange) {\n onChange(event.target.value);\n }\n }\n\n handleUpdate(event) {\n const {onUpdate} = this.props;\n\n if (onUpdate) {\n onUpdate(event.target.value);\n }\n }\n\n handleKeyPress(event) {\n // This will force handleUpdate to be called via the input's onBlur\n if ((event.keyCode || event.which) === ENTER_KEYCODE) {\n this._ref.blur();\n }\n }\n\n handleWheel(event) {\n if (this.props.onWheel && document.activeElement === this._ref) {\n this.props.onWheel(event);\n }\n }\n\n render() {\n const {\n type,\n className,\n text,\n disable,\n autoFocus,\n onKeyDown,\n placeholder,\n readOnly,\n size,\n } = this.props;\n return (\n \n );\n }\n}\n\nEditableText.propTypes = {\n // Called with input value on changes (as the user types)\n onChange: PropTypes.func,\n\n // Called with input value on blur (and enter if no onEnter is given)\n onUpdate: PropTypes.func,\n\n // Called on input keyDown events\n onKeyDown: PropTypes.func,\n\n onWheel: PropTypes.func,\n // Input value property ...\n text: PropTypes.any,\n\n // Input properties\n placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n className: PropTypes.string,\n disable: PropTypes.bool,\n autoFocus: PropTypes.bool,\n readOnly: PropTypes.bool,\n type: PropTypes.oneOf(['text', 'password']),\n size: PropTypes.number,\n};\n\nEditableText.defaultProps = {\n readOnly: false,\n type: 'text',\n};\n\nexport default EditableText;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/FlaglistCheckboxGroup.js b/lib/components/widgets/FlaglistCheckboxGroup.js deleted file mode 100644 index 93031c4a8..000000000 --- a/lib/components/widgets/FlaglistCheckboxGroup.js +++ /dev/null @@ -1,162 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _CheckboxGroup = require('./CheckboxGroup'); - -var _CheckboxGroup2 = _interopRequireDefault(_CheckboxGroup); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// Component handles activeOption with shape "x+y+z" -// and ties it to the CheckboxGroup Component -var FlaglistCheckboxGroup = function (_Component) { - _inherits(FlaglistCheckboxGroup, _Component); - - function FlaglistCheckboxGroup(props) { - _classCallCheck(this, FlaglistCheckboxGroup); - - var _this = _possibleConstructorReturn(this, (FlaglistCheckboxGroup.__proto__ || Object.getPrototypeOf(FlaglistCheckboxGroup)).call(this, props)); - - var currentActiveOption = void 0; - if (props.activeOption !== null) { - currentActiveOption = props.activeOption; - } else { - currentActiveOption = ''; - } - - _this.state = { - activeOption: _this.parseFlags(currentActiveOption) - }; - - _this.handleChange = _this.handleChange.bind(_this); - return _this; - } - - // convert plotly.js's "all" or "none" option in its `flaglist` type - // to a series of options separated by `+` that our component can handle - - - _createClass(FlaglistCheckboxGroup, [{ - key: 'parseFlags', - value: function parseFlags(option) { - var activeOption = void 0; - if (option === 'all') { - activeOption = this.props.options.map(function (o) { - return o.value; - }).join('+'); - } else if (option === 'none') { - activeOption = ''; - } else { - activeOption = option; - } - return activeOption; - } - - // Sync local state to parent props. - - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - this.setState({ activeOption: this.parseFlags(nextProps.activeOption) }); - } - - // Called whenever a checkbox is changed, this updates the local - // state to reflect the new activeOptions and then called props.onChange with - // the new options. - - }, { - key: 'handleChange', - value: function handleChange(newOptions) { - var newActiveOptions = ''; - - newOptions.map(function (option) { - if (option.checked === true) { - newActiveOptions += option.value + '+'; - } - }); - - newActiveOptions = newActiveOptions.slice(0, -1); - - if (newActiveOptions.length === 0) { - newActiveOptions = 'none'; - } - - this.setState({ activeOption: newActiveOptions }); - this.props.onChange(newActiveOptions); - } - - // Turns the activeOptions "e.g "x+y+z" into an array that - // the CheckboxGroup component can handle - - }, { - key: 'renderCheckedOption', - value: function renderCheckedOption() { - var activeOptions = typeof this.state.activeOption === 'string' ? this.state.activeOption.split('+') : [this.state.activeOption]; - var allOptions = this.props.options; - var newOptions = []; - - allOptions.map(function (option) { - var currentChecked = void 0; - - if (activeOptions.indexOf(option.value) > -1) { - currentChecked = true; - } else { - currentChecked = false; - } - - newOptions.push({ - label: option.label, - value: option.value, - checked: currentChecked - }); - }); - - return newOptions; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(_CheckboxGroup2.default, { - options: this.renderCheckedOption(), - onChange: this.handleChange, - className: this.props.className, - orientation: this.props.orientation - }); - } - }]); - - return FlaglistCheckboxGroup; -}(_react.Component); - -FlaglistCheckboxGroup.propTypes = { - options: _propTypes2.default.arrayOf(_propTypes2.default.shape({ - value: _propTypes2.default.any.isRequired, - label: _propTypes2.default.string.isRequired - })).isRequired, - activeOption: _propTypes2.default.any, - onChange: _propTypes2.default.func, - className: _propTypes2.default.string, - orientation: _propTypes2.default.string -}; - -exports.default = FlaglistCheckboxGroup; -//# sourceMappingURL=FlaglistCheckboxGroup.js.map \ No newline at end of file diff --git a/lib/components/widgets/FlaglistCheckboxGroup.js.map b/lib/components/widgets/FlaglistCheckboxGroup.js.map deleted file mode 100644 index 9de34adab..000000000 --- a/lib/components/widgets/FlaglistCheckboxGroup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/FlaglistCheckboxGroup.js"],"names":["FlaglistCheckboxGroup","props","currentActiveOption","activeOption","state","parseFlags","handleChange","bind","option","options","map","o","value","join","nextProps","setState","newOptions","newActiveOptions","checked","slice","length","onChange","activeOptions","split","allOptions","currentChecked","indexOf","push","label","renderCheckedOption","className","orientation","Component","propTypes","PropTypes","arrayOf","shape","any","isRequired","string","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;AAEA;AACA;IACMA,qB;;;AACJ,iCAAYC,KAAZ,EAAmB;AAAA;;AAAA,8IACXA,KADW;;AAGjB,QAAIC,4BAAJ;AACA,QAAID,MAAME,YAAN,KAAuB,IAA3B,EAAiC;AAC/BD,4BAAsBD,MAAME,YAA5B;AACD,KAFD,MAEO;AACLD,4BAAsB,EAAtB;AACD;;AAED,UAAKE,KAAL,GAAa;AACXD,oBAAc,MAAKE,UAAL,CAAgBH,mBAAhB;AADH,KAAb;;AAIA,UAAKI,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AAdiB;AAelB;;AAED;AACA;;;;;+BACWC,M,EAAQ;AACjB,UAAIL,qBAAJ;AACA,UAAIK,WAAW,KAAf,EAAsB;AACpBL,uBAAe,KAAKF,KAAL,CAAWQ,OAAX,CAAmBC,GAAnB,CAAuB;AAAA,iBAAKC,EAAEC,KAAP;AAAA,SAAvB,EAAqCC,IAArC,CAA0C,GAA1C,CAAf;AACD,OAFD,MAEO,IAAIL,WAAW,MAAf,EAAuB;AAC5BL,uBAAe,EAAf;AACD,OAFM,MAEA;AACLA,uBAAeK,MAAf;AACD;AACD,aAAOL,YAAP;AACD;;AAED;;;;8CAC0BW,S,EAAW;AACnC,WAAKC,QAAL,CAAc,EAACZ,cAAc,KAAKE,UAAL,CAAgBS,UAAUX,YAA1B,CAAf,EAAd;AACD;;AAED;AACA;AACA;;;;iCACaa,U,EAAY;AACvB,UAAIC,mBAAmB,EAAvB;;AAEAD,iBAAWN,GAAX,CAAe,kBAAU;AACvB,YAAIF,OAAOU,OAAP,KAAmB,IAAvB,EAA6B;AAC3BD,8BAAoBT,OAAOI,K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UE,KAAV,CAAgB;AACdxB,WAAOsB,oBAAUG,GAAV,CAAcC,UADP;AAEdV,WAAOM,oBAAUK,MAAV,CAAiBD;AAFV,GAAhB,CADO,EAKPA,UAN8B;AAOhCnC,gBAAc+B,oBAAUG,GAPQ;AAQhChB,YAAUa,oBAAUM,IARY;AAShCV,aAAWI,oBAAUK,MATW;AAUhCR,eAAaG,oBAAUK;AAVS,CAAlC;;kBAaevC,qB","file":"FlaglistCheckboxGroup.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport CheckboxGroup from './CheckboxGroup';\n\n// Component handles activeOption with shape \"x+y+z\"\n// and ties it to the CheckboxGroup Component\nclass FlaglistCheckboxGroup extends Component {\n constructor(props) {\n super(props);\n\n let currentActiveOption;\n if (props.activeOption !== null) {\n currentActiveOption = props.activeOption;\n } else {\n currentActiveOption = '';\n }\n\n this.state = {\n activeOption: this.parseFlags(currentActiveOption),\n };\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n // convert plotly.js's \"all\" or \"none\" option in its `flaglist` type\n // to a series of options separated by `+` that our component can handle\n parseFlags(option) {\n let activeOption;\n if (option === 'all') {\n activeOption = this.props.options.map(o => o.value).join('+');\n } else if (option === 'none') {\n activeOption = '';\n } else {\n activeOption = option;\n }\n return activeOption;\n }\n\n // Sync local state to parent props.\n componentWillReceiveProps(nextProps) {\n this.setState({activeOption: this.parseFlags(nextProps.activeOption)});\n }\n\n // Called whenever a checkbox is changed, this updates the local\n // state to reflect the new activeOptions and then called props.onChange with\n // the new options.\n handleChange(newOptions) {\n let newActiveOptions = '';\n\n newOptions.map(option => {\n if (option.checked === true) {\n newActiveOptions += option.value + '+';\n }\n });\n\n newActiveOptions = newActiveOptions.slice(0, -1);\n\n if (newActiveOptions.length === 0) {\n newActiveOptions = 'none';\n }\n\n this.setState({activeOption: newActiveOptions});\n this.props.onChange(newActiveOptions);\n }\n\n // Turns the activeOptions \"e.g \"x+y+z\" into an array that\n // the CheckboxGroup component can handle\n renderCheckedOption() {\n const activeOptions =\n typeof this.state.activeOption === 'string'\n ? this.state.activeOption.split('+')\n : [this.state.activeOption];\n const allOptions = this.props.options;\n const newOptions = [];\n\n allOptions.map(option => {\n let currentChecked;\n\n if (activeOptions.indexOf(option.value) > -1) {\n currentChecked = true;\n } else {\n currentChecked = false;\n }\n\n newOptions.push({\n label: option.label,\n value: option.value,\n checked: currentChecked,\n });\n });\n\n return newOptions;\n }\n\n render() {\n return (\n \n );\n }\n}\n\nFlaglistCheckboxGroup.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.any.isRequired,\n label: PropTypes.string.isRequired,\n })\n ).isRequired,\n activeOption: PropTypes.any,\n onChange: PropTypes.func,\n className: PropTypes.string,\n orientation: PropTypes.string,\n};\n\nexport default FlaglistCheckboxGroup;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/Logo.js b/lib/components/widgets/Logo.js deleted file mode 100644 index 0461143db..000000000 --- a/lib/components/widgets/Logo.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Logo = function (_Component) { - _inherits(Logo, _Component); - - function Logo() { - _classCallCheck(this, Logo); - - return _possibleConstructorReturn(this, (Logo.__proto__ || Object.getPrototypeOf(Logo)).apply(this, arguments)); - } - - _createClass(Logo, [{ - key: 'render', - value: function render() { - return _react2.default.createElement('img', { className: 'sidebar__logo', src: this.props.src }); - } - }]); - - return Logo; -}(_react.Component); - -exports.default = Logo; - - -Logo.plotly_editor_traits = { sidebar_element: true }; - -Logo.propTypes = { - src: _propTypes2.default.string -}; -//# sourceMappingURL=Logo.js.map \ No newline at end of file diff --git a/lib/components/widgets/Logo.js.map b/lib/components/widgets/Logo.js.map deleted file mode 100644 index 3815f3120..000000000 --- a/lib/components/widgets/Logo.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/Logo.js"],"names":["Logo","props","src","Component","plotly_editor_traits","sidebar_element","propTypes","PropTypes","string"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,I;;;;;;;;;;;6BACV;AACP,aAAO,uCAAK,WAAU,eAAf,EAA+B,KAAK,KAAKC,KAAL,CAAWC,GAA/C,GAAP;AACD;;;;EAH+BC,gB;;kBAAbH,I;;;AAMrBA,KAAKI,oBAAL,GAA4B,EAACC,iBAAiB,IAAlB,EAA5B;;AAEAL,KAAKM,SAAL,GAAiB;AACfJ,OAAKK,oBAAUC;AADA,CAAjB","file":"Logo.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\n\nexport default class Logo extends Component {\n render() {\n return ;\n }\n}\n\nLogo.plotly_editor_traits = {sidebar_element: true};\n\nLogo.propTypes = {\n src: PropTypes.string,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/NumericInput.js b/lib/components/widgets/NumericInput.js deleted file mode 100644 index 36c9c69f8..000000000 --- a/lib/components/widgets/NumericInput.js +++ /dev/null @@ -1,255 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.DOWN_ARROW = exports.UP_ARROW = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _EditableText = require('./EditableText'); - -var _EditableText2 = _interopRequireDefault(_EditableText); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _fastIsnumeric = require('fast-isnumeric'); - -var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); - -var _reactRangeslider = require('react-rangeslider'); - -var _reactRangeslider2 = _interopRequireDefault(_reactRangeslider); - -var _plotlyIcons = require('plotly-icons'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var UP_ARROW = exports.UP_ARROW = 38; -var DOWN_ARROW = exports.DOWN_ARROW = 40; - -var NumericInput = function (_Component) { - _inherits(NumericInput, _Component); - - function NumericInput(props) { - _classCallCheck(this, NumericInput); - - var _this = _possibleConstructorReturn(this, (NumericInput.__proto__ || Object.getPrototypeOf(NumericInput)).call(this, props)); - - _this.state = { value: props.value }; - _this.onChange = _this.onChange.bind(_this); - _this.updateValue = _this.updateValue.bind(_this); - _this.onKeyDown = _this.onKeyDown.bind(_this); - _this.onWheel = _this.onWheel.bind(_this); - return _this; - } - - _createClass(NumericInput, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (nextProps.value !== this.state.value) { - this.setState({ value: nextProps.value }); - } - } - }, { - key: 'onKeyDown', - value: function onKeyDown(e) { - switch (e.keyCode) { - case UP_ARROW: - this.incrementValue('increase'); - break; - case DOWN_ARROW: - this.incrementValue('decrease'); - break; - default: - break; - } - } - }, { - key: 'onWheel', - value: function onWheel(e) { - e.stopPropagation(); - e.preventDefault(); - if (e.deltaY > 0) { - this.incrementValue('increase'); - } else { - this.incrementValue('decrease'); - } - } - }, { - key: 'onChange', - value: function onChange(value) { - this.setState({ value: value }); - } - }, { - key: 'updateValue', - value: function updateValue(newValue) { - var _props = this.props, - max = _props.max, - min = _props.min, - integerOnly = _props.integerOnly, - propsValue = _props.value; - - var updatedValue = newValue; - - // When the user blurs on non-numeric data reset the component - // to the last known good value (this.props.value). - if (!(0, _fastIsnumeric2.default)(updatedValue)) { - this.setState({ value: propsValue }); - return; - } - - updatedValue = Number(updatedValue); - if (integerOnly) { - updatedValue = Math.floor(updatedValue); - } - - if ((0, _fastIsnumeric2.default)(min)) { - updatedValue = Math.max(min, updatedValue); - } - - if ((0, _fastIsnumeric2.default)(max)) { - updatedValue = Math.min(max, updatedValue); - } - - this.props.onUpdate(updatedValue); - } - }, { - key: 'incrementValue', - value: function incrementValue(direction) { - var _props2 = this.props, - defaultValue = _props2.defaultValue, - min = _props2.min, - _props2$step = _props2.step, - step = _props2$step === undefined ? 1 : _props2$step, - _props2$stepmode = _props2.stepmode, - stepmode = _props2$stepmode === undefined ? 'absolute' : _props2$stepmode; - var value = this.state.value; - - - var valueUpdate = void 0; - if ((0, _fastIsnumeric2.default)(value)) { - var x = parseFloat(value); - var absMode = stepmode === 'absolute'; - if (direction === 'increase') { - valueUpdate = absMode ? x + step : x * (1 + step); - } else { - valueUpdate = absMode ? x - step : x / (1 + step); - } - } else { - // if we are multi-valued and the user is incrementing or decrementing - // update with some sane value so we can "break" out of multi-valued mode. - if ((0, _fastIsnumeric2.default)(defaultValue)) { - valueUpdate = defaultValue; - } else { - // TODO smarter handling depending if user decrements or increments? - valueUpdate = min || 0; - } - } - - // incrementers blur the line between blur and onChange. - this.updateValue(valueUpdate); - } - }, { - key: 'renderArrows', - value: function renderArrows() { - if (!this.props.showArrows || this.props.showSlider) { - return null; - } - - return _react2.default.createElement( - 'div', - { className: 'numeric-input__caret-box' }, - _react2.default.createElement( - 'div', - { - className: 'numeric-input__caret js-numeric-increase', - onClick: this.incrementValue.bind(this, 'increase') - }, - _react2.default.createElement(_plotlyIcons.CarretUpIcon, { className: 'numeric-top-caret-modifier' }) - ), - _react2.default.createElement( - 'div', - { - className: 'numeric-input__caret js-numeric-decrease', - onClick: this.incrementValue.bind(this, 'decrease') - }, - _react2.default.createElement(_plotlyIcons.CarretDownIcon, { className: 'numeric-bottom-caret-modifier' }) - ) - ); - } - }, { - key: 'renderSlider', - value: function renderSlider() { - if (!this.props.showSlider) { - return null; - } - - return _react2.default.createElement(_reactRangeslider2.default, { - min: this.props.min, - max: this.props.max, - step: this.props.step, - value: parseFloat(this.state.value), - onChange: this.updateValue, - tooltip: false - }); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - 'div', - { className: 'numeric-input__wrapper' }, - _react2.default.createElement(_EditableText2.default, { - className: 'numeric-input__number ' + this.props.editableClassName, - placeholder: this.props.placeholder, - text: this.state.value, - type: 'text', - onChange: this.onChange, - onUpdate: this.updateValue, - onKeyDown: this.onKeyDown, - onWheel: this.onWheel - }), - this.renderArrows(), - this.renderSlider() - ); - } - }]); - - return NumericInput; -}(_react.Component); - -exports.default = NumericInput; - - -NumericInput.propTypes = { - defaultValue: _propTypes2.default.any, - editableClassName: _propTypes2.default.string, - integerOnly: _propTypes2.default.bool, - max: _propTypes2.default.number, - min: _propTypes2.default.number, - onUpdate: _propTypes2.default.func.isRequired, - placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - showArrows: _propTypes2.default.bool, - showSlider: _propTypes2.default.bool, - step: _propTypes2.default.number, - stepmode: _propTypes2.default.string, - value: _propTypes2.default.any -}; - -NumericInput.defaultProps = { - showArrows: true -}; -//# sourceMappingURL=NumericInput.js.map \ No newline at end of file diff --git a/lib/components/widgets/NumericInput.js.map b/lib/components/widgets/NumericInput.js.map deleted file mode 100644 index c6ef06913..000000000 --- a/lib/components/widgets/NumericInput.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/NumericInput.js"],"names":["UP_ARROW","DOWN_ARROW","NumericInput","props","state","value","onChange","bind","updateValue","onKeyDown","onWheel","nextProps","setState","e","keyCode","incrementValue","stopPropagation","preventDefault","deltaY","newValue","max","min","integerOnly","propsValue","updatedValue","Number","Math","floor","onUpdate","direction","defaultValue","step","stepmode","valueUpdate","x","parseFloat","absMode","showArrows","showSlider","editableClassName","placeholder","renderArrows","renderSlider","Component","propTypes","PropTypes","any","string","bool","number","func","isRequired","oneOfType","defaultProps"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;AAEO,IAAMA,8BAAW,EAAjB;AACA,IAAMC,kCAAa,EAAnB;;IAEcC,Y;;;AACnB,wBAAYC,KAAZ,EAAmB;AAAA;;AAAA,4HACXA,KADW;;AAGjB,UAAKC,KAAL,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gBAAce,oBAAUC,GADD;AAEvBP,qBAAmBM,oBAAUE,MAFN;AAGvBzB,eAAauB,oBAAUG,IAHA;AAIvB5B,OAAKyB,oBAAUI,MAJQ;AAKvB5B,OAAKwB,oBAAUI,MALQ;AAMvBrB,YAAUiB,oBAAUK,IAAV,CAAeC,UANF;AAOvBX,eAAaK,oBAAUO,SAAV,CAAoB,CAACP,oBAAUE,MAAX,EAAmBF,oBAAUI,MAA7B,CAApB,CAPU;AAQvBZ,cAAYQ,oBAAUG,IARC;AASvBV,cAAYO,oBAAUG,IATC;AAUvBjB,QAAMc,oBAAUI,MAVO;AAWvBjB,YAAUa,oBAAUE,MAXG;AAYvB1C,SAAOwC,oBAAUC;AAZM,CAAzB;;AAeA5C,aAAamD,YAAb,GAA4B;AAC1BhB,cAAY;AADc,CAA5B","file":"NumericInput.js","sourcesContent":["import EditableText from './EditableText';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport isNumeric from 'fast-isnumeric';\nimport Slider from 'react-rangeslider';\nimport {CarretDownIcon, CarretUpIcon} from 'plotly-icons';\n\nexport const UP_ARROW = 38;\nexport const DOWN_ARROW = 40;\n\nexport default class NumericInput extends Component {\n constructor(props) {\n super(props);\n\n this.state = {value: props.value};\n this.onChange = this.onChange.bind(this);\n this.updateValue = this.updateValue.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onWheel = this.onWheel.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.state.value) {\n this.setState({value: nextProps.value});\n }\n }\n\n onKeyDown(e) {\n switch (e.keyCode) {\n case UP_ARROW:\n this.incrementValue('increase');\n break;\n case DOWN_ARROW:\n this.incrementValue('decrease');\n break;\n default:\n break;\n }\n }\n\n onWheel(e) {\n e.stopPropagation();\n e.preventDefault();\n if (e.deltaY > 0) {\n this.incrementValue('increase');\n } else {\n this.incrementValue('decrease');\n }\n }\n\n onChange(value) {\n this.setState({value});\n }\n\n updateValue(newValue) {\n const {max, min, integerOnly, value: propsValue} = this.props;\n let updatedValue = newValue;\n\n // When the user blurs on non-numeric data reset the component\n // to the last known good value (this.props.value).\n if (!isNumeric(updatedValue)) {\n this.setState({value: propsValue});\n return;\n }\n\n updatedValue = Number(updatedValue);\n if (integerOnly) {\n updatedValue = Math.floor(updatedValue);\n }\n\n if (isNumeric(min)) {\n updatedValue = Math.max(min, updatedValue);\n }\n\n if (isNumeric(max)) {\n updatedValue = Math.min(max, updatedValue);\n }\n\n this.props.onUpdate(updatedValue);\n }\n\n incrementValue(direction) {\n const {defaultValue, min, step = 1, stepmode = 'absolute'} = this.props;\n const {value} = this.state;\n\n let valueUpdate;\n if (isNumeric(value)) {\n const x = parseFloat(value);\n const absMode = stepmode === 'absolute';\n if (direction === 'increase') {\n valueUpdate = absMode ? x + step : x * (1 + step);\n } else {\n valueUpdate = absMode ? x - step : x / (1 + step);\n }\n } else {\n // if we are multi-valued and the user is incrementing or decrementing\n // update with some sane value so we can \"break\" out of multi-valued mode.\n if (isNumeric(defaultValue)) {\n valueUpdate = defaultValue;\n } else {\n // TODO smarter handling depending if user decrements or increments?\n valueUpdate = min || 0;\n }\n }\n\n // incrementers blur the line between blur and onChange.\n this.updateValue(valueUpdate);\n }\n\n renderArrows() {\n if (!this.props.showArrows || this.props.showSlider) {\n return null;\n }\n\n return (\n
\n \n \n
\n \n \n
\n \n );\n }\n\n renderSlider() {\n if (!this.props.showSlider) {\n return null;\n }\n\n return (\n \n );\n }\n\n render() {\n return (\n
\n \n {this.renderArrows()}\n {this.renderSlider()}\n
\n );\n }\n}\n\nNumericInput.propTypes = {\n defaultValue: PropTypes.any,\n editableClassName: PropTypes.string,\n integerOnly: PropTypes.bool,\n max: PropTypes.number,\n min: PropTypes.number,\n onUpdate: PropTypes.func.isRequired,\n placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showArrows: PropTypes.bool,\n showSlider: PropTypes.bool,\n step: PropTypes.number,\n stepmode: PropTypes.string,\n value: PropTypes.any,\n};\n\nNumericInput.defaultProps = {\n showArrows: true,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/RadioBlocks.js b/lib/components/widgets/RadioBlocks.js deleted file mode 100644 index 7e5585165..000000000 --- a/lib/components/widgets/RadioBlocks.js +++ /dev/null @@ -1,128 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var RadioBlocks = function (_Component) { - _inherits(RadioBlocks, _Component); - - function RadioBlocks(props) { - _classCallCheck(this, RadioBlocks); - - var _this = _possibleConstructorReturn(this, (RadioBlocks.__proto__ || Object.getPrototypeOf(RadioBlocks)).call(this, props)); - - _this.state = { activeOption: _this.props.activeOption }; - _this.handleChange = _this.handleChange.bind(_this); - _this.renderOption = _this.renderOption.bind(_this); - return _this; - } - - _createClass(RadioBlocks, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - // Reset the value to the graph's actual value - if (nextProps.activeOption !== this.state.activeOption) { - this.setState({ - activeOption: nextProps.activeOption - }); - } - } - }, { - key: 'handleChange', - value: function handleChange(newValue) { - this.setState({ activeOption: newValue }); - this.props.onOptionChange(newValue); - } - }, { - key: 'renderOption', - value: function renderOption(optionName) { - var _this2 = this; - - var label = optionName.label, - value = optionName.value, - Icon = optionName.icon; - - var defaultActive = this.state.activeOption === value; - - var optionClass = (0, _classnames2.default)('radio-block__option', { - 'radio-block__option--active': defaultActive - }); - - return _react2.default.createElement( - 'div', - { - className: optionClass, - key: value, - checked: defaultActive, - onClick: function onClick() { - return _this2.handleChange(value); - } - }, - Icon ? _react2.default.createElement(Icon, { className: 'radio-block__icon' }) : null, - label ? _react2.default.createElement( - 'span', - null, - label - ) : null - ); - } - }, { - key: 'render', - value: function render() { - var optionList = this.props.options.map(this.renderOption); - - var groupClass = (0, _classnames2.default)('radio-block', 'radio-block__group', { - 'radio-block__group--center': this.props.alignment === 'center' - }); - - return _react2.default.createElement( - 'div', - { className: groupClass }, - optionList - ); - } - }]); - - return RadioBlocks; -}(_react.Component); - -RadioBlocks.propTypes = { - options: _propTypes2.default.arrayOf(_propTypes2.default.shape({ - value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool, _propTypes2.default.number]).isRequired, - label: _propTypes2.default.string, - icon: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), - disabled: _propTypes2.default.bool - })), - onOptionChange: _propTypes2.default.func.isRequired, - activeOption: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool, _propTypes2.default.number]), - radioClassName: _propTypes2.default.string, - - // One of right, left, center - alignment: _propTypes2.default.string -}; - -exports.default = RadioBlocks; -//# sourceMappingURL=RadioBlocks.js.map \ No newline at end of file diff --git a/lib/components/widgets/RadioBlocks.js.map b/lib/components/widgets/RadioBlocks.js.map deleted file mode 100644 index 3bbe9c122..000000000 --- a/lib/components/widgets/RadioBlocks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/RadioBlocks.js"],"names":["RadioBlocks","props","state","activeOption","handleChange","bind","renderOption","nextProps","setState","newValue","onOptionChange","optionName","label","value","Icon","icon","defaultActive","optionClass","optionList","options","map","groupClass","alignment","Component","propTypes","PropTypes","arrayOf","shape","oneOfType","string","bool","number","isRequired","node","func","disabled","radioClassName"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,W;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA,0HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa,EAACC,cAAc,MAAKF,KAAL,CAAWE,YAA1B,EAAb;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AACA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBD,IAAlB,OAApB;AAJiB;AAKlB;;;;8CAEyBE,S,EAAW;AACnC;AACA,UAAIA,UAAUJ,YAAV,KAA2B,KAAKD,KAAL,CAAWC,YAA1C,EAAwD;AACtD,aAAKK,QAAL,CAAc;AACZL,wBAAcI,UAAUJ;AADZ,SAAd;AAGD;AACF;;;iCAEYM,Q,EAAU;AACrB,WAAKD,QAAL,CAAc,EAACL,cAAcM,QAAf,EAAd;AACA,WAAKR,KAAL,CAAWS,cAAX,CAA0BD,QAA1B;AACD;;;iCAEYE,U,EAAY;AAAA;;AAAA,UAChBC,KADgB,GACYD,UADZ,CAChBC,KADgB;AAAA,UACTC,KADS,GACYF,UADZ,CACTE,KADS;AAAA,UACIC,IADJ,GACYH,UADZ,CACFI,IADE;;AAEvB,UAAMC,gBAAgB,KAAKd,KAAL,CAAWC,YAAX,KAA4BU,KAAlD;;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ApB,CAVQ;AAWtBK,kBAAgBX,oBAAUI,MAXJ;;AAatB;AACAP,aAAWG,oBAAUI;AAdC,CAAxB;;kBAiBe7B,W","file":"RadioBlocks.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nclass RadioBlocks extends Component {\n constructor(props) {\n super(props);\n this.state = {activeOption: this.props.activeOption};\n this.handleChange = this.handleChange.bind(this);\n this.renderOption = this.renderOption.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n // Reset the value to the graph's actual value\n if (nextProps.activeOption !== this.state.activeOption) {\n this.setState({\n activeOption: nextProps.activeOption,\n });\n }\n }\n\n handleChange(newValue) {\n this.setState({activeOption: newValue});\n this.props.onOptionChange(newValue);\n }\n\n renderOption(optionName) {\n const {label, value, icon: Icon} = optionName;\n const defaultActive = this.state.activeOption === value;\n\n const optionClass = classnames('radio-block__option', {\n 'radio-block__option--active': defaultActive,\n });\n\n return (\n this.handleChange(value)}\n >\n {Icon ? : null}\n {label ? {label} : null}\n \n );\n }\n\n render() {\n const optionList = this.props.options.map(this.renderOption);\n\n const groupClass = classnames('radio-block', 'radio-block__group', {\n 'radio-block__group--center': this.props.alignment === 'center',\n });\n\n return
{optionList}
;\n }\n}\n\nRadioBlocks.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]).isRequired,\n label: PropTypes.string,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n disabled: PropTypes.bool,\n })\n ),\n onOptionChange: PropTypes.func.isRequired,\n activeOption: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number]),\n radioClassName: PropTypes.string,\n\n // One of right, left, center\n alignment: PropTypes.string,\n};\n\nexport default RadioBlocks;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/SymbolSelector.js b/lib/components/widgets/SymbolSelector.js deleted file mode 100644 index 3dda9a4a6..000000000 --- a/lib/components/widgets/SymbolSelector.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _plotlyIcons = require('plotly-icons'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SymbolSelector = function (_Component) { - _inherits(SymbolSelector, _Component); - - function SymbolSelector(props) { - _classCallCheck(this, SymbolSelector); - - var _this = _possibleConstructorReturn(this, (SymbolSelector.__proto__ || Object.getPrototypeOf(SymbolSelector)).call(this, props)); - - _this.state = { - isOpen: false - }; - _this.togglePanel = _this.togglePanel.bind(_this); - return _this; - } - - _createClass(SymbolSelector, [{ - key: 'shouldComponentUpdate', - value: function shouldComponentUpdate(nextProps, nextState) { - var _props = this.props, - markerColor = _props.markerColor, - borderColor = _props.borderColor; - var nextMarkerColor = nextProps.markerColor, - nextBorderColor = nextProps.borderColor; - - - return this.props.value !== nextProps.value || this.state.isOpen !== nextState.isOpen || markerColor !== nextMarkerColor || borderColor !== nextBorderColor; - } - }, { - key: 'togglePanel', - value: function togglePanel() { - this.setState({ isOpen: !this.state.isOpen }); - } - }, { - key: 'renderActiveOption', - value: function renderActiveOption() { - var _props2 = this.props, - markerColor = _props2.markerColor, - borderColor = _props2.borderColor, - symbolOptions = _props2.symbolOptions, - value = _props2.value; - - var currentSymbol = symbolOptions.find(function (symbol) { - return symbol.value === value; - }); - if (!currentSymbol) { - return _react2.default.createElement( - 'span', - { - style: { - paddingTop: '5px', - paddingLeft: '15px' - } - }, - '-' - ); - } - - var symbolStyle = { - stroke: currentSymbol.fill === 'none' ? markerColor : borderColor, - strokeOpacity: '1', - strokeWidth: '2px', - fill: currentSymbol.fill === 'none' ? 'none' : markerColor - }; - - return _react2.default.createElement( - 'span', - null, - _react2.default.createElement( - 'svg', - { width: '18', height: '18' }, - _react2.default.createElement( - 'g', - { transform: 'translate(8,8)' }, - _react2.default.createElement('path', { d: currentSymbol.label, style: symbolStyle }) - ) - ) - ); - } - }, { - key: 'renderOptions', - value: function renderOptions() { - var _this2 = this; - - var _props3 = this.props, - markerColor = _props3.markerColor, - borderColor = _props3.borderColor, - symbolOptions = _props3.symbolOptions; - - return symbolOptions.map(function (option) { - var fill = option.fill, - value = option.value, - label = option.label; - - - var symbolStyle = { - stroke: fill === 'none' ? markerColor : borderColor, - strokeOpacity: '1', - strokeWidth: '2px', - fill: fill === 'none' ? 'none' : markerColor - }; - return _react2.default.createElement( - 'div', - { - className: 'symbol-selector__item', - key: value, - onClick: function onClick() { - return _this2.props.onChange(value); - } - }, - _react2.default.createElement( - 'svg', - { width: '28', height: '28', className: 'symbol-selector__symbol', 'data-value': value }, - _react2.default.createElement( - 'g', - { transform: 'translate(14,14)' }, - _react2.default.createElement('path', { d: label, style: symbolStyle }) - ) - ) - ); - }); - } - }, { - key: 'render', - value: function render() { - var isOpen = this.state.isOpen; - - var toggleClass = (0, _classnames2.default)('symbol-selector__toggle', { - 'symbol-selector__toggle--dark': this.props.backgroundDark - }); - - return _react2.default.createElement( - 'div', - null, - _react2.default.createElement( - 'div', - { className: toggleClass, onClick: this.togglePanel }, - _react2.default.createElement( - 'span', - { className: 'symbol-selector__toggle_option' }, - this.renderActiveOption() - ), - _react2.default.createElement( - 'span', - null, - _react2.default.createElement(_plotlyIcons.CarretDownIcon, { className: 'symbol-selector__toggle__caret' }) - ) - ), - isOpen && this.renderOptions() - ); - } - }]); - - return SymbolSelector; -}(_react.Component); - -exports.default = SymbolSelector; - - -SymbolSelector.propTypes = { - backgroundDark: _propTypes2.default.bool, - markerColor: _propTypes2.default.string, - borderColor: _propTypes2.default.string, - value: _propTypes2.default.string, - onChange: _propTypes2.default.func, - symbolOptions: _propTypes2.default.array -}; -//# sourceMappingURL=SymbolSelector.js.map \ No newline at end of file diff --git a/lib/components/widgets/SymbolSelector.js.map b/lib/components/widgets/SymbolSelector.js.map deleted file mode 100644 index 1c97e75f1..000000000 --- a/lib/components/widgets/SymbolSelector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/SymbolSelector.js"],"names":["SymbolSelector","props","state","isOpen","togglePanel","bind","nextProps","nextState","markerColor","borderColor","nextMarkerColor","nextBorderColor","value","setState","symbolOptions","currentSymbol","find","symbol","paddingTop","paddingLeft","symbolStyle","stroke","fill","strokeOpacity","strokeWidth","label","map","option","onChange","toggleClass","backgroundDark","renderActiveOption","renderOptions","Component","propTypes","PropTypes","bool","string","func","array"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEqBA,c;;;AACnB,0BAAYC,KAAZ,EAAmB;AAAA;;AAAA,gIACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,cAAQ;AADG,KAAb;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S,KAAKzB,WAA3C;AACE;AAAA;AAAA,cAAM,WAAU,gCAAhB;AAAkD,iBAAK2B,kBAAL;AAAlD,WADF;AAEE;AAAA;AAAA;AACE,0CAAC,2BAAD,IAAgB,WAAU,gCAA1B;AADF;AAFF,SADF;AAOG5B,kBAAU,KAAK6B,aAAL;AAPb,OADF;AAWD;;;;EAvGyCC,gB;;kBAAvBjC,c;;;AA0GrBA,eAAekC,SAAf,GAA2B;AACzBJ,kBAAgBK,oBAAUC,IADD;AAEzB5B,eAAa2B,oBAAUE,MAFE;AAGzB5B,eAAa0B,oBAAUE,MAHE;AAIzBzB,SAAOuB,oBAAUE,MAJQ;AAKzBT,YAAUO,oBAAUG,IALK;AAMzBxB,iBAAeqB,oBAAUI;AANA,CAA3B","file":"SymbolSelector.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {CarretDownIcon} from 'plotly-icons';\n\nexport default class SymbolSelector extends Component {\n constructor(props) {\n super(props);\n this.state = {\n isOpen: false,\n };\n this.togglePanel = this.togglePanel.bind(this);\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n const {markerColor, borderColor} = this.props;\n const {markerColor: nextMarkerColor, borderColor: nextBorderColor} = nextProps;\n\n return (\n this.props.value !== nextProps.value ||\n this.state.isOpen !== nextState.isOpen ||\n markerColor !== nextMarkerColor ||\n borderColor !== nextBorderColor\n );\n }\n\n togglePanel() {\n this.setState({isOpen: !this.state.isOpen});\n }\n\n renderActiveOption() {\n const {markerColor, borderColor, symbolOptions, value} = this.props;\n const currentSymbol = symbolOptions.find(symbol => symbol.value === value);\n if (!currentSymbol) {\n return (\n \n {'-'}\n \n );\n }\n\n const symbolStyle = {\n stroke: currentSymbol.fill === 'none' ? markerColor : borderColor,\n strokeOpacity: '1',\n strokeWidth: '2px',\n fill: currentSymbol.fill === 'none' ? 'none' : markerColor,\n };\n\n return (\n \n \n \n \n \n \n \n );\n }\n\n renderOptions() {\n const {markerColor, borderColor, symbolOptions} = this.props;\n return symbolOptions.map(option => {\n const {fill, value, label} = option;\n\n const symbolStyle = {\n stroke: fill === 'none' ? markerColor : borderColor,\n strokeOpacity: '1',\n strokeWidth: '2px',\n fill: fill === 'none' ? 'none' : markerColor,\n };\n return (\n this.props.onChange(value)}\n >\n \n \n \n \n \n \n );\n });\n }\n\n render() {\n const {isOpen} = this.state;\n const toggleClass = classnames('symbol-selector__toggle', {\n 'symbol-selector__toggle--dark': this.props.backgroundDark,\n });\n\n return (\n
\n
\n {this.renderActiveOption()}\n \n \n \n
\n {isOpen && this.renderOptions()}\n
\n );\n }\n}\n\nSymbolSelector.propTypes = {\n backgroundDark: PropTypes.bool,\n markerColor: PropTypes.string,\n borderColor: PropTypes.string,\n value: PropTypes.string,\n onChange: PropTypes.func,\n symbolOptions: PropTypes.array,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/TextArea.js b/lib/components/widgets/TextArea.js deleted file mode 100644 index 6ff703db9..000000000 --- a/lib/components/widgets/TextArea.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TextArea = function (_Component) { - _inherits(TextArea, _Component); - - function TextArea(props) { - _classCallCheck(this, TextArea); - - var _this = _possibleConstructorReturn(this, (TextArea.__proto__ || Object.getPrototypeOf(TextArea)).call(this, props)); - - _this.state = { - value: _this.props.value - }; - - _this.onChange = _this.onChange.bind(_this); - return _this; - } - - _createClass(TextArea, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - // Reset the value to the graph's actual value - if (nextProps.value !== this.state.value) { - this.setState({ - value: nextProps.value - }); - } - } - }, { - key: 'onChange', - value: function onChange(e) { - var newValue = e.target.value; - this.setState({ value: newValue }); - this.props.onChange(newValue); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - 'span', - null, - _react2.default.createElement('textarea', { - value: this.state.value, - rows: this.props.visibleRows, - cols: this.props.areaWidth, - placeholder: this.props.placeholder, - onChange: this.onChange, - className: this.props.textareaClass - }) - ); - } - }]); - - return TextArea; -}(_react.Component); - -exports.default = TextArea; - - -TextArea.propTypes = { - value: _propTypes2.default.string.isRequired, - onChange: _propTypes2.default.func.isRequired, - placeholder: _propTypes2.default.string.isRequired, - visibleRows: _propTypes2.default.number, - areaWidth: _propTypes2.default.number, - textareaClass: _propTypes2.default.string -}; - -TextArea.defaultProps = { - visibleRows: 10, - areaWidth: 30 -}; -//# sourceMappingURL=TextArea.js.map \ No newline at end of file diff --git a/lib/components/widgets/TextArea.js.map b/lib/components/widgets/TextArea.js.map deleted file mode 100644 index 99cac19e9..000000000 --- a/lib/components/widgets/TextArea.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/TextArea.js"],"names":["TextArea","props","state","value","onChange","bind","nextProps","setState","e","newValue","target","visibleRows","areaWidth","placeholder","textareaClass","Component","propTypes","PropTypes","string","isRequired","func","number","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;IAEqBA,Q;;;AACnB,oBAAYC,KAAZ,EAAmB;AAAA;;AAAA,oHACXA,KADW;;AAGjB,UAAKC,KAAL,GAAa;AACXC,aAAO,MAAKF,KAAL,CAAWE;AADP,KAAb;;AAIA,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AAPiB;AAQlB;;;;8CAEyBC,S,EAAW;AACnC;AACA,UAAIA,UAAUH,KAAV,KAAoB,KAAKD,KAAL,CAAWC,KAAnC,EAA0C;AACxC,aAAKI,QAAL,CAAc;AACZJ,iBAAOG,UAAUH;AADL,SAAd;AAGD;AACF;;;6BAEQK,C,EAAG;AACV,UAAMC,WAAWD,EAAEE,MAAF,CAASP,KAA1B;AACA,WAAKI,QAAL,CAAc,EAACJ,OAAOM,QAAR,EAAd;AACA,WAAKR,KAAL,CAAWG,QAAX,CAAoBK,QAApB;AACD;;;6BAEQ;AACP,aACE;AAAA;AAAA;AACE;AACE,iBAAO,KAAKP,KAAL,CAAWC,KADpB;AAEE,gBAAM,KAAKF,KAAL,CAAWU,WAFnB;AAGE,gBAAM,KAAKV,KAAL,CAAWW,SAHnB;AAIE,uBAAa,KAAKX,KAAL,CAAWY,WAJ1B;AAKE,oBAAU,KAAKT,QALjB;AAME,qBAAW,KAAKH,KAAL,CAAWa;AANxB;AADF,OADF;AAYD;;;;EAvCmCC,gB;;kBAAjBf,Q;;;AA0CrBA,SAASgB,SAAT,GAAqB;AACnBb,SAAOc,oBAAUC,MAAV,CAAiBC,UADL;AAEnBf,YAAUa,oBAAUG,IAAV,CAAeD,UAFN;AAGnBN,eAAaI,oBAAUC,MAAV,CAAiBC,UAHX;AAInBR,eAAaM,oBAAUI,MAJJ;AAKnBT,aAAWK,oBAAUI,MALF;AAMnBP,iBAAeG,oBAAUC;AANN,CAArB;;AASAlB,SAASsB,YAAT,GAAwB;AACtBX,eAAa,EADS;AAEtBC,aAAW;AAFW,CAAxB","file":"TextArea.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class TextArea extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n value: this.props.value,\n };\n\n this.onChange = this.onChange.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n // Reset the value to the graph's actual value\n if (nextProps.value !== this.state.value) {\n this.setState({\n value: nextProps.value,\n });\n }\n }\n\n onChange(e) {\n const newValue = e.target.value;\n this.setState({value: newValue});\n this.props.onChange(newValue);\n }\n\n render() {\n return (\n \n \n \n );\n }\n}\n\nTextArea.propTypes = {\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string.isRequired,\n visibleRows: PropTypes.number,\n areaWidth: PropTypes.number,\n textareaClass: PropTypes.string,\n};\n\nTextArea.defaultProps = {\n visibleRows: 10,\n areaWidth: 30,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/TextInput.js b/lib/components/widgets/TextInput.js deleted file mode 100644 index f374245d0..000000000 --- a/lib/components/widgets/TextInput.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _EditableText = require('./EditableText'); - -var _EditableText2 = _interopRequireDefault(_EditableText); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TextInput = function (_Component) { - _inherits(TextInput, _Component); - - function TextInput(props) { - _classCallCheck(this, TextInput); - - var _this = _possibleConstructorReturn(this, (TextInput.__proto__ || Object.getPrototypeOf(TextInput)).call(this, props)); - - _this.state = { value: props.value }; - return _this; - } - - _createClass(TextInput, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (nextProps.value !== this.state.value) { - this.setState({ value: nextProps.value }); - } - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - return _react2.default.createElement(_EditableText2.default, { - className: 'text-input ' + this.props.editableClassName, - placeholder: this.props.placeholder, - text: this.state.value, - type: 'text', - onChange: function onChange(value) { - if (_this2.props.onChange) { - _this2.props.onChange(value); - } - _this2.setState({ value: value }); - }, - onUpdate: this.props.onUpdate - }); - } - }]); - - return TextInput; -}(_react.Component); - -exports.default = TextInput; - - -TextInput.propTypes = { - defaultValue: _propTypes2.default.any, - editableClassName: _propTypes2.default.string, - onUpdate: _propTypes2.default.func.isRequired, - onChange: _propTypes2.default.func, - placeholder: _propTypes2.default.string, - value: _propTypes2.default.any -}; -//# sourceMappingURL=TextInput.js.map \ No newline at end of file diff --git a/lib/components/widgets/TextInput.js.map b/lib/components/widgets/TextInput.js.map deleted file mode 100644 index 2a16c0453..000000000 --- a/lib/components/widgets/TextInput.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/TextInput.js"],"names":["TextInput","props","state","value","nextProps","setState","editableClassName","placeholder","onChange","onUpdate","Component","propTypes","defaultValue","PropTypes","any","string","func","isRequired"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEqBA,S;;;AACnB,qBAAYC,KAAZ,EAAmB;AAAA;;AAAA,sHACXA,KADW;;AAGjB,UAAKC,KAAL,GAAa,EAACC,OAAOF,MAAME,KAAd,EAAb;AAHiB;AAIlB;;;;8CAEyBC,S,EAAW;AACnC,UAAIA,UAAUD,KAAV,KAAoB,KAAKD,KAAL,CAAWC,KAAnC,EAA0C;AACxC,aAAKE,QAAL,CAAc,EAACF,OAAOC,UAAUD,KAAlB,EAAd;AACD;AACF;;;6BAEQ;AAAA;;AACP,aACE,8BAAC,sBAAD;AACE,mCAAyB,KAAKF,KAAL,CAAWK,iBADtC;AAEE,qBAAa,KAAKL,KAAL,CAAWM,WAF1B;AAGE,cAAM,KAAKL,KAAL,CAAWC,KAHnB;AAIE,cAAK,MAJP;AAKE,kBAAU,yBAAS;AACjB,cAAI,OAAKF,KAAL,CAAWO,QAAf,EAAyB;AACvB,mBAAKP,KAAL,CAAWO,QAAX,CAAoBL,KAApB;AACD;AACD,iBAAKE,QAAL,CAAc,EAACF,YAAD,EAAd;AACD,SAVH;AAWE,kBAAU,KAAKF,KAAL,CAAWQ;AAXvB,QADF;AAeD;;;;EA7BoCC,gB;;kBAAlBV,S;;;AAgCrBA,UAAUW,SAAV,GAAsB;AACpBC,gBAAcC,oBAAUC,GADJ;AAEpBR,qBAAmBO,oBAAUE,MAFT;AAGpBN,YAAUI,oBAAUG,IAAV,CAAeC,UAHL;AAIpBT,YAAUK,oBAAUG,IAJA;AAKpBT,eAAaM,oBAAUE,MALH;AAMpBZ,SAAOU,oBAAUC;AANG,CAAtB","file":"TextInput.js","sourcesContent":["import EditableText from './EditableText';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class TextInput extends Component {\n constructor(props) {\n super(props);\n\n this.state = {value: props.value};\n }\n\n componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.state.value) {\n this.setState({value: nextProps.value});\n }\n }\n\n render() {\n return (\n {\n if (this.props.onChange) {\n this.props.onChange(value);\n }\n this.setState({value});\n }}\n onUpdate={this.props.onUpdate}\n />\n );\n }\n}\n\nTextInput.propTypes = {\n defaultValue: PropTypes.any,\n editableClassName: PropTypes.string,\n onUpdate: PropTypes.func.isRequired,\n onChange: PropTypes.func,\n placeholder: PropTypes.string,\n value: PropTypes.any,\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/TraceTypeSelector.js b/lib/components/widgets/TraceTypeSelector.js deleted file mode 100644 index 27c257952..000000000 --- a/lib/components/widgets/TraceTypeSelector.js +++ /dev/null @@ -1,370 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TraceTypeSelectorButton = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _plotlyIcons = require('plotly-icons'); - -var _Modal = require('../containers/Modal'); - -var _Modal2 = _interopRequireDefault(_Modal); - -var _lib = require('../../lib'); - -var _constants = require('../../lib/constants'); - -var _context3 = require('../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var renderActionItems = function renderActionItems(actionItems, item) { - return actionItems ? actionItems(item).map(function (action, i) { - return !action.onClick ? null : _react2.default.createElement( - 'a', - { - className: 'trace-item__actions__item', - key: i, - 'aria-label': action.label, - 'data-microtip-position': 'top-left', - role: 'tooltip', - onClick: action.onClick, - target: '_blank' - }, - action.icon - ); - }) : null; -}; - -var Item = function Item(_ref) { - var item = _ref.item, - active = _ref.active, - handleClick = _ref.handleClick, - actions = _ref.actions, - showActions = _ref.showActions, - complex = _ref.complex; - var label = item.label, - value = item.value, - icon = item.icon; - - var SimpleIcon = (0, _lib.renderTraceIcon)(icon ? icon : value); - var ComplexIcon = (0, _lib.renderTraceIcon)(icon ? icon : value, 'TraceType'); - - return _react2.default.createElement( - 'div', - { className: 'trace-item' + (active ? ' trace-item--active' : ''), onClick: handleClick }, - _react2.default.createElement( - 'div', - { className: 'trace-item__actions' }, - actions && showActions ? renderActionItems(actions, item) : null - ), - _react2.default.createElement( - 'div', - { className: 'trace-item__image' }, - !complex && _react2.default.createElement( - 'div', - { className: 'trace-item__image__svg' }, - _react2.default.createElement(SimpleIcon, null) - ), - complex && _react2.default.createElement( - 'div', - { className: 'trace-item__image__wrapper' }, - _react2.default.createElement(ComplexIcon, null) - ) - ), - _react2.default.createElement( - 'div', - { className: 'trace-item__label' }, - label - ) - ); -}; - -Item.propTypes = { - item: _propTypes2.default.object, - active: _propTypes2.default.bool, - complex: _propTypes2.default.bool, - handleClick: _propTypes2.default.func, - actions: _propTypes2.default.func, - showActions: _propTypes2.default.bool -}; -// Item.contextType = EditorControlsContext; - -var TraceTypeSelector = function (_Component) { - _inherits(TraceTypeSelector, _Component); - - function TraceTypeSelector(props) { - _classCallCheck(this, TraceTypeSelector); - - var _this = _possibleConstructorReturn(this, (TraceTypeSelector.__proto__ || Object.getPrototypeOf(TraceTypeSelector)).call(this, props)); - - _this.selectAndClose = _this.selectAndClose.bind(_this); - _this.actions = _this.actions.bind(_this); - _this.renderCategories = _this.renderCategories.bind(_this); - _this.renderGrid = _this.renderGrid.bind(_this); - _this.renderSingleBlock = _this.renderSingleBlock.bind(_this); - return _this; - } - - _createClass(TraceTypeSelector, [{ - key: 'selectAndClose', - value: function selectAndClose(value) { - var _props = this.props, - updateContainer = _props.updateContainer, - glByDefault = _props.glByDefault, - type = _props.fullContainer.type; - - var computedValue = (0, _lib.traceTypeToPlotlyInitFigure)(value); - if ((type && type.endsWith('gl') || !_constants.TRACES_WITH_GL.includes(type) && glByDefault) && _constants.TRACES_WITH_GL.includes(computedValue.type) && !computedValue.type.endsWith('gl')) { - computedValue.type += 'gl'; - } - updateContainer(computedValue); - this.context.handleClose(); - } - }, { - key: 'actions', - value: function actions(_ref2) { - var _this2 = this; - - var value = _ref2.value; - var _context = this.context, - _ = _context.localize, - chartHelp = _context.chartHelp; - - - var onClick = function onClick(e, func) { - e.stopPropagation(); - func(); - _this2.context.handleClose(); - }; - - return [{ - label: _('Charts like this by Plotly users.'), - onClick: chartHelp[value] && chartHelp[value].feedQuery && function (e) { - return onClick(e, function () { - return window.open('https://plot.ly/feed/?q=' + (chartHelp[value] ? chartHelp[value].feedQuery : value), '_blank'); - }); - }, - icon: _react2.default.createElement(_plotlyIcons.SearchIcon, null) - }, { - label: _('View tutorials on this chart type.'), - onClick: chartHelp[value] && chartHelp[value].helpDoc && function (e) { - return onClick(e, function () { - return window.open(chartHelp[value].helpDoc, '_blank'); - }); - }, - icon: _react2.default.createElement(_plotlyIcons.ThumnailViewIcon, null) - }, { - label: _('See a basic example.'), - onClick: chartHelp[value] && chartHelp[value].examplePlot && function (e) { - return onClick(e, chartHelp[value].examplePlot); - }, - icon: _react2.default.createElement(_plotlyIcons.GraphIcon, null) - }]; - } - }, { - key: 'renderCategories', - value: function renderCategories() { - var _this3 = this; - - var fullValue = this.props.fullValue; - var _context2 = this.context, - mapBoxAccess = _context2.mapBoxAccess, - _ = _context2.localize, - chartHelp = _context2.chartHelp; - var _props$traceTypesConf = this.props.traceTypesConfig, - traces = _props$traceTypesConf.traces, - categories = _props$traceTypesConf.categories, - complex = _props$traceTypesConf.complex; - - - return categories(_).map(function (category, i) { - var items = traces(_).filter(function (_ref3) { - var value = _ref3.category.value; - return value === category.value; - }).filter(function (i) { - return i.value !== 'scattergl' && i.value !== 'scatterpolargl'; - }); - - if (!mapBoxAccess) { - items = items.filter(function (i) { - return i.value !== 'scattermapbox'; - }); - } - - var MAX_ITEMS = 4; - - var columnClasses = items.length > MAX_ITEMS && !category.maxColumns || category.maxColumns && category.maxColumns > 1 ? 'trace-grid__column trace-grid__column--double' : 'trace-grid__column'; - - return _react2.default.createElement( - 'div', - { className: columnClasses, key: i }, - _react2.default.createElement( - 'div', - { className: 'trace-grid__column__header' }, - category.label - ), - _react2.default.createElement( - 'div', - { className: 'trace-grid__column__items' }, - items.map(function (item) { - return _react2.default.createElement(Item, { - complex: complex, - key: item.value, - active: fullValue === item.value, - item: item, - actions: _this3.actions, - handleClick: function handleClick() { - return _this3.selectAndClose(item.value); - }, - showActions: Boolean(chartHelp) - }); - }) - ) - ); - }); - } - }, { - key: 'renderGrid', - value: function renderGrid() { - return _react2.default.createElement( - 'div', - { className: 'trace-grid' }, - this.renderCategories() - ); - } - }, { - key: 'renderSingleBlock', - value: function renderSingleBlock() { - var _this4 = this; - - var fullValue = this.props.fullValue; - var _ = this.context.localize; - var _props$traceTypesConf2 = this.props.traceTypesConfig, - traces = _props$traceTypesConf2.traces, - complex = _props$traceTypesConf2.complex; - - - return _react2.default.createElement( - 'div', - { className: 'trace-grid-single-block' }, - traces(_).map(function (item) { - return _react2.default.createElement(Item, { - key: item.value, - complex: complex, - active: fullValue === item.value, - item: item, - actions: _this4.actions, - showActions: false, - handleClick: function handleClick() { - return _this4.selectAndClose(item.value); - }, - style: { display: 'inline-block' } - }); - }) - ); - } - }, { - key: 'render', - value: function render() { - var _ = this.context.localize; - var categories = this.props.traceTypesConfig.categories; - - - return _react2.default.createElement( - _Modal2.default, - { title: _('Select Trace Type') }, - categories ? this.renderGrid() : this.renderSingleBlock() - ); - } - }]); - - return TraceTypeSelector; -}(_react.Component); - -TraceTypeSelector.propTypes = { - updateContainer: _propTypes2.default.func, - fullValue: _propTypes2.default.string, - fullContainer: _propTypes2.default.object, - glByDefault: _propTypes2.default.bool, - traceTypesConfig: _propTypes2.default.object -}; -TraceTypeSelector.contextTypes = { - handleClose: _propTypes2.default.func, - localize: _propTypes2.default.func, - mapBoxAccess: _propTypes2.default.bool, - chartHelp: _propTypes2.default.object -}; - -var TraceTypeSelectorButton = exports.TraceTypeSelectorButton = function (_Component2) { - _inherits(TraceTypeSelectorButton, _Component2); - - function TraceTypeSelectorButton() { - _classCallCheck(this, TraceTypeSelectorButton); - - return _possibleConstructorReturn(this, (TraceTypeSelectorButton.__proto__ || Object.getPrototypeOf(TraceTypeSelectorButton)).apply(this, arguments)); - } - - _createClass(TraceTypeSelectorButton, [{ - key: 'render', - value: function render() { - var _props2 = this.props, - handleClick = _props2.handleClick, - container = _props2.container, - traces = _props2.traceTypesConfig.traces; - var _ = this.context.localize; - - - var inferredType = (0, _lib.plotlyTraceToCustomTrace)(container); - - var _traces$find = traces(_).find(function (type) { - return type.value === inferredType; - }), - label = _traces$find.label, - icon = _traces$find.icon, - value = _traces$find.value; - - var Icon = (0, _lib.renderTraceIcon)(icon ? icon : value); - - return _react2.default.createElement( - 'div', - { className: 'trace-type-select-button', onClick: handleClick ? handleClick : null }, - _react2.default.createElement( - 'div', - { className: 'trace-type-select-button__icon' }, - _react2.default.createElement(Icon, null) - ), - label - ); - } - }]); - - return TraceTypeSelectorButton; -}(_react.Component); - -TraceTypeSelectorButton.propTypes = { - handleClick: _propTypes2.default.func.isRequired, - container: _propTypes2.default.object, - traceTypesConfig: _propTypes2.default.object.isRequired -}; -TraceTypeSelectorButton.contextType = _context3.EditorControlsContext; - -exports.default = TraceTypeSelector; -//# sourceMappingURL=TraceTypeSelector.js.map \ No newline at end of file diff --git a/lib/components/widgets/TraceTypeSelector.js.map b/lib/components/widgets/TraceTypeSelector.js.map deleted file mode 100644 index e41cf859c..000000000 --- a/lib/components/widgets/TraceTypeSelector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/TraceTypeSelector.js"],"names":["renderActionItems","actionItems","item","map","action","i","onClick","label","icon","Item","active","handleClick","actions","showActions","complex","value","SimpleIcon","ComplexIcon","propTypes","PropTypes","object","bool","func","TraceTypeSelector","props","selectAndClose","bind","renderCategories","renderGrid","renderSingleBlock","updateContainer","glByDefault","type","fullContainer","computedValue","endsWith","TRACES_WITH_GL","includes","context","handleClose","_","localize","chartHelp","e","stopPropagation","feedQuery","window","open","helpDoc","examplePlot","fullValue","mapBoxAccess","traceTypesConfig","traces","categories","category","items","filter","MAX_ITEMS","columnClasses","length","maxColumns","Boolean","display","Component","string","contextTypes","TraceTypeSelectorButton","container","inferredType","find","Icon","isRequired","contextType","EditorControlsContext"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,oBAAoB,SAApBA,iBAAoB,CAACC,WAAD,EAAcC,IAAd;AAAA,SACxBD,cACIA,YAAYC,IAAZ,EAAkBC,GAAlB,CACE,UAACC,MAAD,EAASC,CAAT;AAAA,WACE,CAACD,OAAOE,OAAR,GAAkB,IAAlB,GACE;AAAA;AAAA;AACE,mBAAU,2BADZ;AAEE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AAkBjC,oBAAUC,MAAV,CAAiBoD;AAHD,CAApC;AAKAL,wBAAwBM,WAAxB,GAAsCC,+BAAtC;;kBAEenD,iB","file":"TraceTypeSelector.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {SearchIcon, ThumnailViewIcon, GraphIcon} from 'plotly-icons';\nimport Modal from 'components/containers/Modal';\nimport {traceTypeToPlotlyInitFigure, renderTraceIcon, plotlyTraceToCustomTrace} from 'lib';\nimport {TRACES_WITH_GL} from 'lib/constants';\nimport {EditorControlsContext} from '../../context';\n\nconst renderActionItems = (actionItems, item) =>\n actionItems\n ? actionItems(item).map(\n (action, i) =>\n !action.onClick ? null : (\n \n {action.icon}\n \n )\n )\n : null;\n\nconst Item = ({item, active, handleClick, actions, showActions, complex}) => {\n const {label, value, icon} = item;\n const SimpleIcon = renderTraceIcon(icon ? icon : value);\n const ComplexIcon = renderTraceIcon(icon ? icon : value, 'TraceType');\n\n return (\n
\n
\n {actions && showActions ? renderActionItems(actions, item) : null}\n
\n
\n {!complex && (\n
\n \n
\n )}\n {complex && (\n
\n \n
\n )}\n
\n
{label}
\n
\n );\n};\n\nItem.propTypes = {\n item: PropTypes.object,\n active: PropTypes.bool,\n complex: PropTypes.bool,\n handleClick: PropTypes.func,\n actions: PropTypes.func,\n showActions: PropTypes.bool,\n};\n// Item.contextType = EditorControlsContext;\n\nclass TraceTypeSelector extends Component {\n constructor(props) {\n super(props);\n\n this.selectAndClose = this.selectAndClose.bind(this);\n this.actions = this.actions.bind(this);\n this.renderCategories = this.renderCategories.bind(this);\n this.renderGrid = this.renderGrid.bind(this);\n this.renderSingleBlock = this.renderSingleBlock.bind(this);\n }\n\n selectAndClose(value) {\n const {\n updateContainer,\n glByDefault,\n fullContainer: {type},\n } = this.props;\n const computedValue = traceTypeToPlotlyInitFigure(value);\n if (\n ((type && type.endsWith('gl')) || (!TRACES_WITH_GL.includes(type) && glByDefault)) &&\n TRACES_WITH_GL.includes(computedValue.type) &&\n !computedValue.type.endsWith('gl')\n ) {\n computedValue.type += 'gl';\n }\n updateContainer(computedValue);\n this.context.handleClose();\n }\n\n actions({value}) {\n const {localize: _, chartHelp} = this.context;\n\n const onClick = (e, func) => {\n e.stopPropagation();\n func();\n this.context.handleClose();\n };\n\n return [\n {\n label: _('Charts like this by Plotly users.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].feedQuery &&\n (e =>\n onClick(e, () =>\n window.open(\n `https://plot.ly/feed/?q=${chartHelp[value] ? chartHelp[value].feedQuery : value}`,\n '_blank'\n )\n )),\n icon: ,\n },\n {\n label: _('View tutorials on this chart type.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].helpDoc &&\n (e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))),\n icon: ,\n },\n {\n label: _('See a basic example.'),\n onClick:\n chartHelp[value] &&\n chartHelp[value].examplePlot &&\n (e => onClick(e, chartHelp[value].examplePlot)),\n icon: ,\n },\n ];\n }\n\n renderCategories() {\n const {fullValue} = this.props;\n const {mapBoxAccess, localize: _, chartHelp} = this.context;\n const {\n traceTypesConfig: {traces, categories, complex},\n } = this.props;\n\n return categories(_).map((category, i) => {\n let items = traces(_)\n .filter(({category: {value}}) => value === category.value)\n .filter(i => i.value !== 'scattergl' && i.value !== 'scatterpolargl');\n\n if (!mapBoxAccess) {\n items = items.filter(i => i.value !== 'scattermapbox');\n }\n\n const MAX_ITEMS = 4;\n\n const columnClasses =\n (items.length > MAX_ITEMS && !category.maxColumns) ||\n (category.maxColumns && category.maxColumns > 1)\n ? 'trace-grid__column trace-grid__column--double'\n : 'trace-grid__column';\n\n return (\n
\n
{category.label}
\n
\n {items.map(item => (\n this.selectAndClose(item.value)}\n showActions={Boolean(chartHelp)}\n />\n ))}\n
\n
\n );\n });\n }\n\n renderGrid() {\n return
{this.renderCategories()}
;\n }\n\n renderSingleBlock() {\n const {fullValue} = this.props;\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {traces, complex},\n } = this.props;\n\n return (\n
\n {traces(_).map(item => (\n this.selectAndClose(item.value)}\n style={{display: 'inline-block'}}\n />\n ))}\n
\n );\n }\n\n render() {\n const {localize: _} = this.context;\n const {\n traceTypesConfig: {categories},\n } = this.props;\n\n return (\n \n {categories ? this.renderGrid() : this.renderSingleBlock()}\n \n );\n }\n}\n\nTraceTypeSelector.propTypes = {\n updateContainer: PropTypes.func,\n fullValue: PropTypes.string,\n fullContainer: PropTypes.object,\n glByDefault: PropTypes.bool,\n traceTypesConfig: PropTypes.object,\n};\nTraceTypeSelector.contextTypes = {\n handleClose: PropTypes.func,\n localize: PropTypes.func,\n mapBoxAccess: PropTypes.bool,\n chartHelp: PropTypes.object,\n};\n\nexport class TraceTypeSelectorButton extends Component {\n render() {\n const {\n handleClick,\n container,\n traceTypesConfig: {traces},\n } = this.props;\n\n const {localize: _} = this.context;\n\n const inferredType = plotlyTraceToCustomTrace(container);\n const {label, icon, value} = traces(_).find(type => type.value === inferredType);\n\n const Icon = renderTraceIcon(icon ? icon : value);\n\n return (\n
\n
\n \n
\n {label}\n
\n );\n }\n}\n\nTraceTypeSelectorButton.propTypes = {\n handleClick: PropTypes.func.isRequired,\n container: PropTypes.object,\n traceTypesConfig: PropTypes.object.isRequired,\n};\nTraceTypeSelectorButton.contextType = EditorControlsContext;\n\nexport default TraceTypeSelector;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/index.js b/lib/components/widgets/index.js deleted file mode 100644 index ef66f585b..000000000 --- a/lib/components/widgets/index.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TraceTypeSelectorButton = exports.TraceTypeSelector = exports.RadioBlocks = exports.Button = undefined; - -var _Button = require('./Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _RadioBlocks = require('./RadioBlocks'); - -var _RadioBlocks2 = _interopRequireDefault(_RadioBlocks); - -var _TraceTypeSelector = require('./TraceTypeSelector'); - -var _TraceTypeSelector2 = _interopRequireDefault(_TraceTypeSelector); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.Button = _Button2.default; -exports.RadioBlocks = _RadioBlocks2.default; -exports.TraceTypeSelector = _TraceTypeSelector2.default; -exports.TraceTypeSelectorButton = _TraceTypeSelector.TraceTypeSelectorButton; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/components/widgets/index.js.map b/lib/components/widgets/index.js.map deleted file mode 100644 index a4810dfae..000000000 --- a/lib/components/widgets/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/components/widgets/index.js"],"names":["Button","RadioBlocks","TraceTypeSelector","TraceTypeSelectorButton"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;QAEQA,M,GAAAA,gB;QAAQC,W,GAAAA,qB;QAAaC,iB,GAAAA,2B;QAAmBC,uB,GAAAA,0C","file":"index.js","sourcesContent":["import Button from './Button';\nimport RadioBlocks from './RadioBlocks';\nimport TraceTypeSelector, {TraceTypeSelectorButton} from './TraceTypeSelector';\n\nexport {Button, RadioBlocks, TraceTypeSelector, TraceTypeSelectorButton};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/HTML.js b/lib/components/widgets/text_editors/HTML.js deleted file mode 100644 index 481cd80a3..000000000 --- a/lib/components/widgets/text_editors/HTML.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _TextArea2 = require('../TextArea'); - -var _TextArea3 = _interopRequireDefault(_TextArea2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var HTML = function (_TextArea) { - _inherits(HTML, _TextArea); - - function HTML() { - _classCallCheck(this, HTML); - - return _possibleConstructorReturn(this, (HTML.__proto__ || Object.getPrototypeOf(HTML)).apply(this, arguments)); - } - - _createClass(HTML, [{ - key: 'render', - value: function render() { - var className = this.props.className; - - var editorClassNames = className ? className : 'text-editor__html'; - return _react2.default.createElement('textarea', { - value: this.state.value, - placeholder: this.props.placeholder, - onChange: this.onChange, - className: editorClassNames - }); - } - }]); - - return HTML; -}(_TextArea3.default); - -HTML.propTypes = { - className: _propTypes2.default.string -}; - -HTML.defaultProps = { - placeholder: '' -}; - -exports.default = HTML; -//# sourceMappingURL=HTML.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/HTML.js.map b/lib/components/widgets/text_editors/HTML.js.map deleted file mode 100644 index a44026cb6..000000000 --- a/lib/components/widgets/text_editors/HTML.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/components/widgets/text_editors/HTML.js"],"names":["HTML","className","props","editorClassNames","state","value","placeholder","onChange","TextArea","propTypes","PropTypes","string","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,I;;;;;;;;;;;6BACK;AAAA,UACAC,SADA,GACa,KAAKC,KADlB,CACAD,SADA;;AAEP,UAAME,mBAAmBF,YAAYA,SAAZ,GAAwB,mBAAjD;AACA,aACE;AACE,eAAO,KAAKG,KAAL,CAAWC,KADpB;AAEE,qBAAa,KAAKH,KAAL,CAAWI,WAF1B;AAGE,kBAAU,KAAKC,QAHjB;AAIE,mBAAWJ;AAJb,QADF;AAQD;;;;EAZgBK,kB;;AAenBR,KAAKS,SAAL,GAAiB;AACfR,aAAWS,oBAAUC;AADN,CAAjB;;AAIAX,KAAKY,YAAL,GAAoB;AAClBN,eAAa;AADK,CAApB;;kBAIeN,I","file":"HTML.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport TextArea from '../TextArea';\n\nclass HTML extends TextArea {\n render() {\n const {className} = this.props;\n const editorClassNames = className ? className : 'text-editor__html';\n return (\n \n );\n }\n}\n\nHTML.propTypes = {\n className: PropTypes.string,\n};\n\nHTML.defaultProps = {\n placeholder: '',\n};\n\nexport default HTML;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/LaTeX.js b/lib/components/widgets/text_editors/LaTeX.js deleted file mode 100644 index 9ca89fd51..000000000 --- a/lib/components/widgets/text_editors/LaTeX.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _TextArea2 = require('../TextArea'); - -var _TextArea3 = _interopRequireDefault(_TextArea2); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _convertFormats = require('./convertFormats'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var LaTeX = function (_TextArea) { - _inherits(LaTeX, _TextArea); - - function LaTeX(props) { - _classCallCheck(this, LaTeX); - - // Internally, represesent the LaTeX document without the - // wrapping `$...$` characters. - var _this = _possibleConstructorReturn(this, (LaTeX.__proto__ || Object.getPrototypeOf(LaTeX)).call(this, props)); - - var unwrappedValue = _this.unwrap(props.value); - - _this.state = { - value: unwrappedValue - }; - _this.onChange = _this.onChange.bind(_this); - _this.onBlur = _this.onBlur.bind(_this); - return _this; - } - - _createClass(LaTeX, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var unwrappedNextValue = this.unwrap(nextProps.value); - - if (unwrappedNextValue !== this.state.value) { - this.setState({ - value: unwrappedNextValue - }); - } - } - - // Return a new value with wrapping `$...$` removed. - - }, { - key: 'unwrap', - value: function unwrap(value) { - if ((0, _convertFormats.isLaTeXExpr)(value)) { - return value.substr(1, value.length - 2); - } - - return value; - } - - // Wrap value in `$...$`. - - }, { - key: 'wrap', - value: function wrap(value) { - if (!(0, _convertFormats.isLaTeXExpr)(value)) { - return '$' + value + '$'; - } - - return value; - } - }, { - key: 'onChange', - value: function onChange(e) { - this.setState({ - value: e.target.value - }); - } - }, { - key: 'onBlur', - value: function onBlur(e) { - var value = this.wrap(e.target.value); - this.props.onChange(value); - } - }, { - key: 'render', - value: function render() { - var className = this.props.className; - - var editorClassNames = className ? className : 'text-editor__latex'; - return _react2.default.createElement('textarea', { - value: this.state.value, - placeholder: this.props.placeholder, - onChange: this.onChange, - onBlur: this.onBlur, - className: editorClassNames - }); - } - }]); - - return LaTeX; -}(_TextArea3.default); - -exports.default = LaTeX; - - -LaTeX.propTypes = { - className: _propTypes2.default.string, - onChange: _propTypes2.default.func.isRequired, - placeholder: _propTypes2.default.string, - value: _propTypes2.default.string -}; - -LaTeX.defaultProps = { - value: '', - placeholder: '' -}; -//# sourceMappingURL=LaTeX.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/LaTeX.js.map b/lib/components/widgets/text_editors/LaTeX.js.map deleted file mode 100644 index ab28ea838..000000000 --- a/lib/components/widgets/text_editors/LaTeX.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/components/widgets/text_editors/LaTeX.js"],"names":["LaTeX","props","unwrappedValue","unwrap","value","state","onChange","bind","onBlur","nextProps","unwrappedNextValue","setState","substr","length","e","target","wrap","className","editorClassNames","placeholder","TextArea","propTypes","PropTypes","string","func","isRequired","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AAEA;;;;;;;;;;IAEqBA,K;;;AACnB,iBAAYC,KAAZ,EAAmB;AAAA;;AAGjB;AACA;AAJiB,8GACXA,KADW;;AAKjB,QAAMC,iBAAiB,MAAKC,MAAL,CAAYF,MAAMG,KAAlB,CAAvB;;AAEA,UAAKC,KAAL,GAAa;AACXD,aAAOF;AADI,KAAb;AAGA,UAAKI,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AACA,UAAKC,MAAL,GAAc,MAAKA,MAAL,CAAYD,IAAZ,OAAd;AAXiB;AAYlB;;;;8CAEyBE,S,EAAW;AACnC,UAAMC,qBAAqB,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EADY;AAEnBe,eAAa;AAFM,CAArB","file":"LaTeX.js","sourcesContent":["import React from 'react';\nimport TextArea from '../TextArea';\nimport PropTypes from 'prop-types';\n\nimport {isLaTeXExpr as isWrapped} from './convertFormats';\n\nexport default class LaTeX extends TextArea {\n constructor(props) {\n super(props);\n\n // Internally, represesent the LaTeX document without the\n // wrapping `$...$` characters.\n const unwrappedValue = this.unwrap(props.value);\n\n this.state = {\n value: unwrappedValue,\n };\n this.onChange = this.onChange.bind(this);\n this.onBlur = this.onBlur.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n const unwrappedNextValue = this.unwrap(nextProps.value);\n\n if (unwrappedNextValue !== this.state.value) {\n this.setState({\n value: unwrappedNextValue,\n });\n }\n }\n\n // Return a new value with wrapping `$...$` removed.\n unwrap(value) {\n if (isWrapped(value)) {\n return value.substr(1, value.length - 2);\n }\n\n return value;\n }\n\n // Wrap value in `$...$`.\n wrap(value) {\n if (!isWrapped(value)) {\n return `$${value}$`;\n }\n\n return value;\n }\n\n onChange(e) {\n this.setState({\n value: e.target.value,\n });\n }\n\n onBlur(e) {\n const value = this.wrap(e.target.value);\n this.props.onChange(value);\n }\n\n render() {\n const {className} = this.props;\n const editorClassNames = className ? className : 'text-editor__latex';\n return (\n \n );\n }\n}\n\nLaTeX.propTypes = {\n className: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n};\n\nLaTeX.defaultProps = {\n value: '',\n placeholder: '',\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/MultiFormat.js b/lib/components/widgets/text_editors/MultiFormat.js deleted file mode 100644 index 8b338015e..000000000 --- a/lib/components/widgets/text_editors/MultiFormat.js +++ /dev/null @@ -1,379 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _HTML = require('./HTML'); - -var _HTML2 = _interopRequireDefault(_HTML); - -var _LaTeX = require('./LaTeX'); - -var _LaTeX2 = _interopRequireDefault(_LaTeX); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _RichText = require('./RichText'); - -var _RichText2 = _interopRequireDefault(_RichText); - -var _convertFormats = require('./convertFormats'); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _Button = require('../Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _context = require('../../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var MultiFormatTextEditor = function (_Component) { - _inherits(MultiFormatTextEditor, _Component); - - function MultiFormatTextEditor(props, context) { - _classCallCheck(this, MultiFormatTextEditor); - - var _this = _possibleConstructorReturn(this, (MultiFormatTextEditor.__proto__ || Object.getPrototypeOf(MultiFormatTextEditor)).call(this, props, context)); - - var _ = context.localize; - - var editors = [{ - key: 'RICH_TEXT', - label: _('Rich Text'), - component: _RichText2.default - }, { - key: 'LATEX', - label: _('LaTeX'), - component: _LaTeX2.default - }, { - key: 'HTML', - label: _('Edit in HTML'), - component: _HTML2.default - }]; - - var startTab = (0, _convertFormats.isLaTeXExpr)(props.value) ? 'LATEX' : 'RICH_TEXT'; - - _this.state = { - /* - * When nextTab is set, we are waiting for confirmation from the - * user before switching to the next tab. - */ - nextTab: null, - currentTab: startTab, - messages: [] - }; - - _this.onModeChange = _this.onModeChange.bind(_this); - _this.editors = editors; - return _this; - } - - /** - * Convert a value to the format expected by the provided editor. - * - * @param {String} value The current value - * @param {String} editor The editor to convert for [RICH_TEXT|LATEX] - * @returns {String} The converted value - */ - - - _createClass(MultiFormatTextEditor, [{ - key: 'convertValue', - value: function convertValue(value, editor) { - var currentTab = this.state.currentTab; - - - if (currentTab === 'RICH_TEXT' && editor === 'LATEX') { - return (0, _convertFormats.htmlToLaTeX)(value); - } - - if (currentTab === 'LATEX' && editor === 'RICH_TEXT') { - return (0, _convertFormats.laTeXToHTML)(value); - } - - if (currentTab === 'HTML' && editor === 'LATEX') { - return (0, _convertFormats.htmlToLaTeX)(value); - } - - /* - * Else we're switching from / to HTML / Rich Text Editor - * no conversion is needed - */ - return value; - } - }, { - key: 'onModeChange', - value: function onModeChange(nextTab) { - var _ = this.context.localize; - var _props = this.props, - defaultValuePattern = _props.defaultValuePattern, - value = _props.value, - onChange = _props.onChange; - var currentTab = this.state.currentTab; - - var trimmedValue = value.trim(); - var trimmedValueLength = trimmedValue.length; - var convertedValue = this.convertValue(trimmedValue, nextTab); - - /* - * Check against default value - we have to compare the plain - * value, not the LaTeX format value with `\text{}` wrapping. - */ - var isDefaultValue = (0, _convertFormats.isLaTeXExpr)(trimmedValue) ? defaultValuePattern.test(convertedValue) : defaultValuePattern.test(trimmedValue); - - var switchingBetweenRichAndHtml = currentTab === 'RICH_TEXT' && nextTab === 'HTML' || currentTab === 'HTML' && nextTab === 'RICH_TEXT'; - - if (!isDefaultValue && trimmedValueLength > 0 && !switchingBetweenRichAndHtml) { - // Show confirmation dialogue and defer tab change. - var messages = void 0; - - if (!(0, _convertFormats.isLaTeXExpr)(value)) { - messages = [_("LaTeX is a math typesetting language that doesn't work with rich text."), _('Continuing will convert your note to LaTeX-style text.')]; - } else if ((0, _convertFormats.hasTextExpression)(value)) { - messages = [_('Rich text is incompatible with LaTeX.'), _('Continuing will convert your LaTeX expression into raw text.')]; - } else { - messages = [_('Rich text is incompatible with LaTeX.'), _('Continuing will remove your expression.')]; - } - - this.setState({ - nextTab: nextTab, - messages: messages - }); - - return; - } - - // Show requested tab immediately. - this.setState({ - currentTab: nextTab - }); - - // Convert the annotation and dispatch onChange action - onChange(convertedValue); - } - }, { - key: 'renderConfirmationPanel', - value: function renderConfirmationPanel(render) { - var _this2 = this; - - if (!render) { - return null; - } - - var _ = this.context.localize; - var messages = this.state.messages; - - - var onCancel = function onCancel() { - _this2.setState({ - nextTab: null - }); - }; - - var onContinue = function onContinue() { - var nextTab = _this2.state.nextTab; - var _props2 = _this2.props, - onChange = _props2.onChange, - value = _props2.value; - - // Set next tab as active - - _this2.setState({ - currentTab: nextTab, - nextTab: null - }); - - // Convert the annotation - var convertedValue = _this2.convertValue(value, nextTab); - onChange(convertedValue); - }; - - return _react2.default.createElement( - 'div', - { className: 'multi-format-editor__confirmation-panel' }, - _react2.default.createElement( - 'div', - { className: 'multi-format-editor__confirmation-panel__content' }, - _react2.default.createElement( - 'h3', - { className: 'multi-format-editor__confirmation-panel__header' }, - _('Heads up!') - ), - _react2.default.createElement( - 'div', - { className: 'multi-format-editor__confirmation-panel__message' }, - _react2.default.createElement( - 'p', - { className: 'multi-format-editor__confirmation-panel__message-primary' }, - messages[0] - ), - _react2.default.createElement( - 'p', - { className: 'multi-format-editor__confirmation-panel__message-secondary' }, - messages[1] - ) - ) - ), - _react2.default.createElement( - 'div', - { className: 'multi-format-editor__confirmation-panel__actions' }, - _react2.default.createElement( - _Button2.default, - { - variant: 'default', - className: 'multi-format-editor__confirmation-panel__cancel-button', - onClick: onCancel - }, - _('Go back') - ), - _react2.default.createElement( - _Button2.default, - { - variant: 'primary', - className: 'multi-format-editor__confirmation-panel__continue-button', - onClick: onContinue - }, - _('Continue') - ) - ) - ); - } - }, { - key: 'renderEditor', - value: function renderEditor(render) { - var _this3 = this; - - if (!render) { - return null; - } - var _ = this.context.localize; - var _props3 = this.props, - onChange = _props3.onChange, - placeholder = _props3.placeholder, - value = _props3.value; - var currentTab = this.state.currentTab; - - - var richTextClassNames = (0, _classnames2.default)('multi-format-editor__tab', 'top-tab', 'left', { - selected: currentTab === 'RICH_TEXT' - }); - var latexClassNames = (0, _classnames2.default)('multi-format-editor__tab', 'top-tab', 'right', { - selected: currentTab === 'LATEX' - }); - var bottomTabClassNames = (0, _classnames2.default)('multi-format-editor__tab', 'bottom-tab'); - - var Editor = this.editors.filter(function (editor) { - return editor.key === currentTab; - })[0].component; - - var ModeTabsText = this.editors.map(function (editor) { - return editor.label; - }); - - var showBottomTab = currentTab === 'HTML' || currentTab === 'RICH_TEXT'; - var BottomTab = currentTab === 'HTML' ? _react2.default.createElement( - 'div', - { className: bottomTabClassNames, onClick: function onClick() { - return _this3.onModeChange('RICH_TEXT'); - } }, - _('Edit in Rich Text') - ) : _react2.default.createElement( - 'div', - { className: bottomTabClassNames, onClick: function onClick() { - return _this3.onModeChange('HTML'); - } }, - _('Edit in HTML') - ); - - return _react2.default.createElement( - 'div', - { className: 'multi-format-editor__root__wrapper' }, - _react2.default.createElement( - 'div', - { className: 'multi-format-editor__tabs' }, - _react2.default.createElement( - 'div', - { className: richTextClassNames, onClick: function onClick() { - return _this3.onModeChange('RICH_TEXT'); - } }, - ModeTabsText[0] - ), - _react2.default.createElement( - 'div', - { className: latexClassNames, onClick: function onClick() { - return _this3.onModeChange('LATEX'); - } }, - ModeTabsText[1] - ) - ), - _react2.default.createElement( - 'div', - { className: 'multi-format-editor__content__wrapper__' + currentTab.toLowerCase() }, - _react2.default.createElement(Editor, { - className: 'multi-format-editor__' + currentTab.toLowerCase(), - onChange: onChange, - placeholder: placeholder, - value: value - }) - ), - showBottomTab ? BottomTab : null - ); - } - }, { - key: 'render', - value: function render() { - /* - * `renderConfirmationPanel` and `renderEditor` are mutually - * exclusive; only one will return a component. - */ - var nextTab = this.state.nextTab; - - var content = this.renderConfirmationPanel(nextTab !== null) || this.renderEditor(nextTab === null); - - return _react2.default.createElement( - 'div', - { className: 'multi-format-editor__root' }, - content - ); - } - }]); - - return MultiFormatTextEditor; -}(_react.Component); - -MultiFormatTextEditor.propTypes = { - defaultValuePattern: _propTypes2.default.instanceOf(RegExp), - onChange: _propTypes2.default.func.isRequired, - placeholder: _propTypes2.default.string, - value: _propTypes2.default.string -}; - -MultiFormatTextEditor.defaultProps = { - defaultValuePattern: /^$/, - placeholder: '', - value: '' -}; - -MultiFormatTextEditor.contextType = _context.EditorControlsContext; - -exports.default = MultiFormatTextEditor; -//# sourceMappingURL=MultiFormat.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/MultiFormat.js.map b/lib/components/widgets/text_editors/MultiFormat.js.map deleted file mode 100644 index 396e522b2..000000000 --- a/lib/components/widgets/text_editors/MultiFormat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/components/widgets/text_editors/MultiFormat.js"],"names":["MultiFormatTextEditor","props","context","_","localize","editors","key","label","component","RichTextEditor","LaTeXEditor","HTMLEditor","startTab","value","state","nextTab","currentTab","messages","onModeChange","bind","editor","defaultValuePattern","onChange","trimmedValue","trim","trimmedValueLength","length","convertedValue","convertValue","isDefaultValue","test","switchingBetweenRichAndHtml","setState","render","onCancel","onContinue","placeholder","richTextClassNames","selected","latexClassNames","bottomTabClassNames","Editor","filter","ModeTabsText","map","showBottomTab","BottomTab","toLowerCase","content","renderConfirmationPanel","renderEditor","Component","propTypes","PropTypes","instanceOf","RegExp","func","isRequired","string","defaultProps","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;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esContent":["import HTMLEditor from './HTML';\nimport LaTeXEditor from './LaTeX';\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport RichTextEditor from './RichText';\nimport {isLaTeXExpr, htmlToLaTeX, laTeXToHTML, hasTextExpression} from './convertFormats';\nimport classnames from 'classnames';\nimport Button from 'components/widgets/Button';\nimport {EditorControlsContext} from '../../../context';\n\nclass MultiFormatTextEditor extends Component {\n constructor(props, context) {\n super(props, context);\n\n const _ = context.localize;\n\n const editors = [\n {\n key: 'RICH_TEXT',\n label: _('Rich Text'),\n component: RichTextEditor,\n },\n {\n key: 'LATEX',\n label: _('LaTeX'),\n component: LaTeXEditor,\n },\n {\n key: 'HTML',\n label: _('Edit in HTML'),\n component: HTMLEditor,\n },\n ];\n\n const startTab = isLaTeXExpr(props.value) ? 'LATEX' : 'RICH_TEXT';\n\n this.state = {\n /*\n * When nextTab is set, we are waiting for confirmation from the\n * user before switching to the next tab.\n */\n nextTab: null,\n currentTab: startTab,\n messages: [],\n };\n\n this.onModeChange = this.onModeChange.bind(this);\n this.editors = editors;\n }\n\n /**\n * Convert a value to the format expected by the provided editor.\n *\n * @param {String} value The current value\n * @param {String} editor The editor to convert for [RICH_TEXT|LATEX]\n * @returns {String} The converted value\n */\n convertValue(value, editor) {\n const {currentTab} = this.state;\n\n if (currentTab === 'RICH_TEXT' && editor === 'LATEX') {\n return htmlToLaTeX(value);\n }\n\n if (currentTab === 'LATEX' && editor === 'RICH_TEXT') {\n return laTeXToHTML(value);\n }\n\n if (currentTab === 'HTML' && editor === 'LATEX') {\n return htmlToLaTeX(value);\n }\n\n /*\n * Else we're switching from / to HTML / Rich Text Editor\n * no conversion is needed\n */\n return value;\n }\n\n onModeChange(nextTab) {\n const {localize: _} = this.context;\n const {defaultValuePattern, value, onChange} = this.props;\n const {currentTab} = this.state;\n const trimmedValue = value.trim();\n const trimmedValueLength = trimmedValue.length;\n const convertedValue = this.convertValue(trimmedValue, nextTab);\n\n /*\n * Check against default value - we have to compare the plain\n * value, not the LaTeX format value with `\\text{}` wrapping.\n */\n const isDefaultValue = isLaTeXExpr(trimmedValue)\n ? defaultValuePattern.test(convertedValue)\n : defaultValuePattern.test(trimmedValue);\n\n const switchingBetweenRichAndHtml =\n (currentTab === 'RICH_TEXT' && nextTab === 'HTML') ||\n (currentTab === 'HTML' && nextTab === 'RICH_TEXT');\n\n if (!isDefaultValue && trimmedValueLength > 0 && !switchingBetweenRichAndHtml) {\n // Show confirmation dialogue and defer tab change.\n let messages;\n\n if (!isLaTeXExpr(value)) {\n messages = [\n _(\"LaTeX is a math typesetting language that doesn't work with rich text.\"),\n _('Continuing will convert your note to LaTeX-style text.'),\n ];\n } else if (hasTextExpression(value)) {\n messages = [\n _('Rich text is incompatible with LaTeX.'),\n _('Continuing will convert your LaTeX expression into raw text.'),\n ];\n } else {\n messages = [\n _('Rich text is incompatible with LaTeX.'),\n _('Continuing will remove your expression.'),\n ];\n }\n\n this.setState({\n nextTab,\n messages,\n });\n\n return;\n }\n\n // Show requested tab immediately.\n this.setState({\n currentTab: nextTab,\n });\n\n // Convert the annotation and dispatch onChange action\n onChange(convertedValue);\n }\n\n renderConfirmationPanel(render) {\n if (!render) {\n return null;\n }\n\n const {localize: _} = this.context;\n const {messages} = this.state;\n\n const onCancel = () => {\n this.setState({\n nextTab: null,\n });\n };\n\n const onContinue = () => {\n const {nextTab} = this.state;\n const {onChange, value} = this.props;\n\n // Set next tab as active\n this.setState({\n currentTab: nextTab,\n nextTab: null,\n });\n\n // Convert the annotation\n const convertedValue = this.convertValue(value, nextTab);\n onChange(convertedValue);\n };\n\n return (\n
\n
\n

{_('Heads up!')}

\n
\n

\n {messages[0]}\n

\n

\n {messages[1]}\n

\n
\n
\n
\n \n {_('Go back')}\n \n \n {_('Continue')}\n \n
\n
\n );\n }\n\n renderEditor(render) {\n if (!render) {\n return null;\n }\n const {localize: _} = this.context;\n const {onChange, placeholder, value} = this.props;\n\n const {currentTab} = this.state;\n\n const richTextClassNames = classnames('multi-format-editor__tab', 'top-tab', 'left', {\n selected: currentTab === 'RICH_TEXT',\n });\n const latexClassNames = classnames('multi-format-editor__tab', 'top-tab', 'right', {\n selected: currentTab === 'LATEX',\n });\n const bottomTabClassNames = classnames('multi-format-editor__tab', 'bottom-tab');\n\n const Editor = this.editors.filter(editor => editor.key === currentTab)[0].component;\n\n const ModeTabsText = this.editors.map(editor => editor.label);\n\n const showBottomTab = currentTab === 'HTML' || currentTab === 'RICH_TEXT';\n const BottomTab =\n currentTab === 'HTML' ? (\n
this.onModeChange('RICH_TEXT')}>\n {_('Edit in Rich Text')}\n
\n ) : (\n
this.onModeChange('HTML')}>\n {_('Edit in HTML')}\n
\n );\n\n return (\n
\n
\n
this.onModeChange('RICH_TEXT')}>\n {ModeTabsText[0]}\n
\n
this.onModeChange('LATEX')}>\n {ModeTabsText[1]}\n
\n
\n
\n \n
\n {showBottomTab ? BottomTab : null}\n
\n );\n }\n\n render() {\n /*\n * `renderConfirmationPanel` and `renderEditor` are mutually\n * exclusive; only one will return a component.\n */\n const {nextTab} = this.state;\n const content =\n this.renderConfirmationPanel(nextTab !== null) || this.renderEditor(nextTab === null);\n\n return
{content}
;\n }\n}\n\nMultiFormatTextEditor.propTypes = {\n defaultValuePattern: PropTypes.instanceOf(RegExp),\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n};\n\nMultiFormatTextEditor.defaultProps = {\n defaultValuePattern: /^$/,\n placeholder: '',\n value: '',\n};\n\nMultiFormatTextEditor.contextType = EditorControlsContext;\n\nexport default MultiFormatTextEditor;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/DraftCommands.js b/lib/components/widgets/text_editors/RichText/DraftCommands.js deleted file mode 100644 index 6acbc8a05..000000000 --- a/lib/components/widgets/text_editors/RichText/DraftCommands.js +++ /dev/null @@ -1,210 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.cursorHasLink = cursorHasLink; -exports.getEntityByKey = getEntityByKey; -exports.getEntityKeyAt = getEntityKeyAt; -exports.handleKeyCommand = handleKeyCommand; -exports.insertSoftNewline = insertSoftNewline; -exports.toggleInlineStyle = toggleInlineStyle; -exports.toggleLink = toggleLink; -exports.toggleMutuallyExclusiveStyles = toggleMutuallyExclusiveStyles; - -var _draftJs = require('draft-js'); - -var _DraftModifier = require('draft-js/lib/DraftModifier'); - -var _configuration = require('./configuration'); - -/** - * Check whether the current selection is over a link - * - * @param {EditorState} editorState The DraftJS editor state - * @param {SelectionState} selection A DraftJS selection state - * @returns {Boolean} `true` if selection is over a link - */ -function selectionHasLink(editorState, selection) { - // If nothing is selected, bail early. - if (selection.isCollapsed()) { - return false; - } - - return cursorHasLink(editorState, selection); -} - -/** - * Check whether the cursor position is over a link - * - * @param {EditorState} editorState The DraftJS editor state - * @param {SelectionState} selection A DraftJS selection state - * @returns {Boolean} `true` if cursor is over a link - */ -/* - * This module exports functions that act on a DraftJS EditorState to - * effect commands. - */ - -function cursorHasLink(editorState, selection) { - var entity = getEntityByKey(getEntityKeyAt(editorState, selection)); - - return Boolean(entity && entity.get('type') === _configuration.LINK); -} - -/** - * Get an entity by its key - * Links are represented as DraftJS entities. - * https://facebook.github.io/draft-js/docs/api-reference-entity.html#content - * - * @param {String} entityKey The entity key - * @returns {DraftEntityInstance} The entity for the key, or `null` if not found - */ -function getEntityByKey(entityKey) { - if (!entityKey) { - return null; - } - - return _draftJs.Entity.get(entityKey); -} - -/** - * For a given SelectionState, get the underlying entity key. - * - * @param {EditorState} editorState The DraftJS editor state - * @param {SelectionState} selection The DraftJS selection state - * @returns {String} The entity key, or `null` if not found - */ -function getEntityKeyAt(editorState, selection) { - if (!selection) { - return null; - } - - var blockStartKey = selection.getStartKey(); - var selectionOffset = selection.getStartOffset(); - - var contentState = editorState.getCurrentContent(); - var block = contentState.getBlockForKey(blockStartKey); - - return block.getEntityAt(selectionOffset); -} - -/** - * Handle a keyboard command. - * TODO: add custom CMD-k command for link button. - * https://github.com/plotly/streambed/issues/6384 - * - * @param {EditorState} editorState The DraftJS editor state - * @param {String} command The command string representation - * @returns {EditorState} The new editor state - */ -function handleKeyCommand(editorState, command) { - switch (command) { - case 'split-block': - // Never split editor content into `

` blocks. - return insertSoftNewline(editorState); - case 'bold': - return toggleInlineStyle(editorState, _configuration.BOLD); - case 'italic': - return toggleInlineStyle(editorState, _configuration.ITALIC); - default: - return false; - } -} - -/** - * Insert a soft newline `\n` that converts to `
` in HTML. - * - * @param {EditorState} editorState The DraftJS editor state - * @returns {EditorState} The new editor state - */ -function insertSoftNewline(editorState) { - var newEditorState = editorState; - - // Terminate all current inline styles - var currentStyleSet = newEditorState.getCurrentInlineStyle(); - newEditorState = currentStyleSet.reduce(function (reducedEditorState, style) { - return _draftJs.RichUtils.toggleInlineStyle(reducedEditorState, style); - }, newEditorState); - - // If text is selected, delete text first. - var selectionState = newEditorState.getSelection(); - var selectionStart = selectionState.getStartOffset(); - var selectionEnd = selectionState.getEndOffset(); - - if (selectionEnd - selectionStart !== 0) { - var contentState = (0, _DraftModifier.removeRange)(newEditorState.getCurrentContent(), selectionState, 'back'); - - newEditorState = _draftJs.EditorState.push(newEditorState, contentState, 'backspace-character'); - } - - // Insert a newline - return _draftJs.RichUtils.insertSoftNewline(newEditorState); -} - -/** - * Toggle an inline style on/off - * - * @param {EditorState} editorState The DraftJS editor state - * @param {String} inlineStyle The inline style string representation - * @returns {EditorState} The new editor state - */ -function toggleInlineStyle(editorState, inlineStyle) { - /* - * TODO tech-debt. Link toggles should not go via toggleInlineStyle. - * https://github.com/plotly/streambed/issues/6354 - */ - - if (inlineStyle === _configuration.LINK) { - return toggleLink(editorState); - } - - // and should be mutually exclusive. - var updatedEditorState = toggleMutuallyExclusiveStyles(editorState, inlineStyle); - - // Add the new style. - return _draftJs.RichUtils.toggleInlineStyle(updatedEditorState, inlineStyle); -} - -/** - * Toggle a link on/off - * - * @param {EditorState} editorState The DraftJS editor state - * @returns {EditorState} The new editor state - */ -function toggleLink(editorState) { - var selection = editorState.getSelection(); - - if (selectionHasLink(editorState, selection)) { - // Remove link - return _draftJs.RichUtils.toggleLink(editorState, selection, null); - } - - // Create a link with an empty URL - var entityKey = _draftJs.Entity.create(_configuration.LINK, 'MUTABLE', { url: '' }); - - return _draftJs.RichUtils.toggleLink(editorState, selection, entityKey); -} - -/** - * For the current selection, if a SUPERSCRIPT or SUBSCRIPT style is - * to be applied, un-apply the other style. - * - * @param {EditorState} editorState The DraftJS editor state - * @param {String} inlineStyle Style about to be applied - * @returns {EditorState} The new editor state - */ -function toggleMutuallyExclusiveStyles(editorState, inlineStyle) { - var currentStyleSet = editorState.getCurrentInlineStyle(); - - if (inlineStyle === _configuration.SUBSCRIPT && currentStyleSet.includes(_configuration.SUPERSCRIPT)) { - return _draftJs.RichUtils.toggleInlineStyle(editorState, _configuration.SUPERSCRIPT); - } - - if (inlineStyle === _configuration.SUPERSCRIPT && currentStyleSet.includes(_configuration.SUBSCRIPT)) { - return _draftJs.RichUtils.toggleInlineStyle(editorState, _configuration.SUBSCRIPT); - } - - return editorState; -} -//# sourceMappingURL=DraftCommands.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/DraftCommands.js.map b/lib/components/widgets/text_editors/RichText/DraftCommands.js.map deleted file mode 100644 index 0ca147b82..000000000 --- a/lib/components/widgets/text_editors/RichText/DraftCommands.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/DraftCommands.js"],"names":["cursorHasLink","getEntityByKey","getEntityKeyAt","handleKeyCommand","insertSoftNewline","toggleInlineStyle","toggleLink","toggleMutuallyExclusiveStyles","selectionHasLink","editorState","selection","isCollapsed","entity","Boolean","get","LINK","entityKey","Entity","blockStartKey","getStartKey","selectionOffset","getStartOffset","contentState","getCurrentContent","block","getBlockForKey","getEntityAt","command","BOLD","ITALIC","newEditorState","currentStyleSet","getCurrentInlineStyle","reduce","reducedEditorState","style","RichUtils","selectionState","getSelection","selectionStart","selectionEnd","getEndOffset","EditorState","push","inlineStyle","updatedEditorState","create","url","SUBSCRIPT","includes","SUPERSCRIPT"],"mappings":";;;;;QAyCgBA,a,GAAAA,a;QAcAC,c,GAAAA,c;QAeAC,c,GAAAA,c;QAuBAC,gB,GAAAA,gB;QAoBAC,iB,GAAAA,iB;QAgCAC,iB,GAAAA,iB;QAuBAC,U,GAAAA,U;QAsBAC,6B,GAAAA,6B;;AAzLhB;;AASA;;AAEA;;AAEA;;;;;;;AAOA,SAASC,gBAAT,CAA0BC,WAA1B,EAAuCC,SAAvC,EAAkD;AAChD;AACA,MAAIA,UAAUC,WAAV,EAAJ,EAA6B;AAC3B,WAAO,KAAP;AACD;;AAED,SAAOX,cAAcS,WAAd,EAA2BC,SAA3B,CAAP;AACD;;AAED;;;;;;;AAlCA;;;;;AAyCO,SAASV,aAAT,CAAuBS,WAAvB,EAAoCC,SAApC,EAA+C;AACpD,MAAME,SAASX,eAAeC,eAAeO,WAAf,EAA4BC,SAA5B,CAAf,CAAf;;AAEA,SAAOG,QAAQD,UAAUA,OAAOE,GAAP,CAAW,MAAX,MAAuBC,mBAAzC,CAAP;AACD;;AAED;;;;;;;;AAQO,SAASd,cAAT,CAAwBe,SAAxB,EAAmC;AACxC,MAAI,CAACA,SAAL,EAAgB;AACd,WAAO,IAAP;AACD;;AAED,SAAOC,gBAAOH,GAAP,CAAWE,SAAX,CAAP;AACD;;AAED;;;;;;;AAOO,SAASd,cAAT,CAAwBO,WAAxB,EAAqCC,SAArC,EAAgD;AACrD,MAAI,CAACA,SAAL,EAAgB;AACd,WAAO,IAAP;AACD;;AAED,MAAMQ,gBAAgBR,UAAUS,WAAV,EAAtB;AACA,MAAMC,kBAAkBV,UAAUW,cAAV,EAAxB;;AAEA,MAAMC,eAAeb,YAAYc,iBAAZ,EAArB;AACA,MAAMC,QAAQF,aAAaG,cAAb,CAA4BP,aAA5B,CAAd;;AAEA,SAAOM,MAAME,WAAN,CAAkBN,eAAlB,CAAP;AACD;;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AMoC,qBAAqBtC,8BAA8BE,WAA9B,EAA2CmC,WAA3C,CAA3B;;AAEA;AACA,SAAOR,mBAAU/B,iBAAV,CAA4BwC,kBAA5B,EAAgDD,WAAhD,CAAP;AACD;;AAED;;;;;;AAMO,SAAStC,UAAT,CAAoBG,WAApB,EAAiC;AACtC,MAAMC,YAAYD,YAAY6B,YAAZ,EAAlB;;AAEA,MAAI9B,iBAAiBC,WAAjB,EAA8BC,SAA9B,CAAJ,EAA8C;AAC5C;AACA,WAAO0B,mBAAU9B,UAAV,CAAqBG,WAArB,EAAkCC,SAAlC,EAA6C,IAA7C,CAAP;AACD;;AAED;AACA,MAAMM,YAAYC,gBAAO6B,MAAP,CAAc/B,mBAAd,EAAoB,SAApB,EAA+B,EAACgC,KAAK,EAAN,EAA/B,CAAlB;;AAEA,SAAOX,mBAAU9B,UAAV,CAAqBG,WAArB,EAAkCC,SAAlC,EAA6CM,SAA7C,CAAP;AACD;;AAED;;;;;;;;AAQO,SAAST,6BAAT,CAAuCE,WAAvC,EAAoDmC,WAApD,EAAiE;AACtE,MAAMb,kBAAkBtB,YAAYuB,qBAAZ,EAAxB;;AAEA,MAAIY,gBAAgBI,wBAAhB,IAA6BjB,gBAAgBkB,QAAhB,CAAyBC,0BAAzB,CAAjC,EAAwE;AACtE,WAAOd,mBAAU/B,iBAAV,CAA4BI,WAA5B,EAAyCyC,0BAAzC,CAAP;AACD;;AAED,MAAIN,gBAAgBM,0BAAhB,IAA+BnB,gBAAgBkB,QAAhB,CAAyBD,wBAAzB,CAAnC,EAAwE;AACtE,WAAOZ,mBAAU/B,iBAAV,CAA4BI,WAA5B,EAAyCuC,wBAAzC,CAAP;AACD;;AAED,SAAOvC,WAAP;AACD","file":"DraftCommands.js","sourcesContent":["/*\n * This module exports functions that act on a DraftJS EditorState to\n * effect commands.\n */\n\nimport {\n EditorState,\n Entity,\n RichUtils,\n\n // Note: disable eslint cause SelectionState is mentioned quite often in JSDoc\n // eslint-disable-next-line no-unused-vars\n SelectionState,\n} from 'draft-js';\nimport {removeRange} from 'draft-js/lib/DraftModifier';\n\nimport {BOLD, ITALIC, SUPERSCRIPT, SUBSCRIPT, LINK} from './configuration';\n\n/**\n * Check whether the current selection is over a link\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection A DraftJS selection state\n * @returns {Boolean} `true` if selection is over a link\n */\nfunction selectionHasLink(editorState, selection) {\n // If nothing is selected, bail early.\n if (selection.isCollapsed()) {\n return false;\n }\n\n return cursorHasLink(editorState, selection);\n}\n\n/**\n * Check whether the cursor position is over a link\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection A DraftJS selection state\n * @returns {Boolean} `true` if cursor is over a link\n */\nexport function cursorHasLink(editorState, selection) {\n const entity = getEntityByKey(getEntityKeyAt(editorState, selection));\n\n return Boolean(entity && entity.get('type') === LINK);\n}\n\n/**\n * Get an entity by its key\n * Links are represented as DraftJS entities.\n * https://facebook.github.io/draft-js/docs/api-reference-entity.html#content\n *\n * @param {String} entityKey The entity key\n * @returns {DraftEntityInstance} The entity for the key, or `null` if not found\n */\nexport function getEntityByKey(entityKey) {\n if (!entityKey) {\n return null;\n }\n\n return Entity.get(entityKey);\n}\n\n/**\n * For a given SelectionState, get the underlying entity key.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection The DraftJS selection state\n * @returns {String} The entity key, or `null` if not found\n */\nexport function getEntityKeyAt(editorState, selection) {\n if (!selection) {\n return null;\n }\n\n const blockStartKey = selection.getStartKey();\n const selectionOffset = selection.getStartOffset();\n\n const contentState = editorState.getCurrentContent();\n const block = contentState.getBlockForKey(blockStartKey);\n\n return block.getEntityAt(selectionOffset);\n}\n\n/**\n * Handle a keyboard command.\n * TODO: add custom CMD-k command for link button.\n * https://github.com/plotly/streambed/issues/6384\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} command The command string representation\n * @returns {EditorState} The new editor state\n */\nexport function handleKeyCommand(editorState, command) {\n switch (command) {\n case 'split-block':\n // Never split editor content into `

` blocks.\n return insertSoftNewline(editorState);\n case 'bold':\n return toggleInlineStyle(editorState, BOLD);\n case 'italic':\n return toggleInlineStyle(editorState, ITALIC);\n default:\n return false;\n }\n}\n\n/**\n * Insert a soft newline `\\n` that converts to `
` in HTML.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @returns {EditorState} The new editor state\n */\nexport function insertSoftNewline(editorState) {\n let newEditorState = editorState;\n\n // Terminate all current inline styles\n const currentStyleSet = newEditorState.getCurrentInlineStyle();\n newEditorState = currentStyleSet.reduce(\n (reducedEditorState, style) => RichUtils.toggleInlineStyle(reducedEditorState, style),\n newEditorState\n );\n\n // If text is selected, delete text first.\n const selectionState = newEditorState.getSelection();\n const selectionStart = selectionState.getStartOffset();\n const selectionEnd = selectionState.getEndOffset();\n\n if (selectionEnd - selectionStart !== 0) {\n const contentState = removeRange(newEditorState.getCurrentContent(), selectionState, 'back');\n\n newEditorState = EditorState.push(newEditorState, contentState, 'backspace-character');\n }\n\n // Insert a newline\n return RichUtils.insertSoftNewline(newEditorState);\n}\n\n/**\n * Toggle an inline style on/off\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} inlineStyle The inline style string representation\n * @returns {EditorState} The new editor state\n */\nexport function toggleInlineStyle(editorState, inlineStyle) {\n /*\n * TODO tech-debt. Link toggles should not go via toggleInlineStyle.\n * https://github.com/plotly/streambed/issues/6354\n */\n\n if (inlineStyle === LINK) {\n return toggleLink(editorState);\n }\n\n // and should be mutually exclusive.\n const updatedEditorState = toggleMutuallyExclusiveStyles(editorState, inlineStyle);\n\n // Add the new style.\n return RichUtils.toggleInlineStyle(updatedEditorState, inlineStyle);\n}\n\n/**\n * Toggle a link on/off\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @returns {EditorState} The new editor state\n */\nexport function toggleLink(editorState) {\n const selection = editorState.getSelection();\n\n if (selectionHasLink(editorState, selection)) {\n // Remove link\n return RichUtils.toggleLink(editorState, selection, null);\n }\n\n // Create a link with an empty URL\n const entityKey = Entity.create(LINK, 'MUTABLE', {url: ''});\n\n return RichUtils.toggleLink(editorState, selection, entityKey);\n}\n\n/**\n * For the current selection, if a SUPERSCRIPT or SUBSCRIPT style is\n * to be applied, un-apply the other style.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} inlineStyle Style about to be applied\n * @returns {EditorState} The new editor state\n */\nexport function toggleMutuallyExclusiveStyles(editorState, inlineStyle) {\n const currentStyleSet = editorState.getCurrentInlineStyle();\n\n if (inlineStyle === SUBSCRIPT && currentStyleSet.includes(SUPERSCRIPT)) {\n return RichUtils.toggleInlineStyle(editorState, SUPERSCRIPT);\n }\n\n if (inlineStyle === SUPERSCRIPT && currentStyleSet.includes(SUBSCRIPT)) {\n return RichUtils.toggleInlineStyle(editorState, SUBSCRIPT);\n }\n\n return editorState;\n}\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkDecorator.js b/lib/components/widgets/text_editors/RichText/LinkDecorator.js deleted file mode 100644 index 77ab0cd44..000000000 --- a/lib/components/widgets/text_editors/RichText/LinkDecorator.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * A DecoratorComponent is used by `draft-js` to render rich content - * beyond inline styles. This Decorator renders LINK entities. - * - * See - * https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#decorator-components - */ - -var LinkDecorator = function LinkDecorator(props) { - return _react2.default.createElement( - 'a', - { href: '#', style: props.style }, - props.children - ); -}; - -LinkDecorator.propTypes = { - style: _propTypes2.default.object.isRequired, - children: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.element]).isRequired -}; - -exports.default = LinkDecorator; -//# sourceMappingURL=LinkDecorator.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkDecorator.js.map b/lib/components/widgets/text_editors/RichText/LinkDecorator.js.map deleted file mode 100644 index d1c84c7d6..000000000 --- a/lib/components/widgets/text_editors/RichText/LinkDecorator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/LinkDecorator.js"],"names":["LinkDecorator","props","style","children","propTypes","PropTypes","object","isRequired","oneOfType","array","element"],"mappings":";;;;;;AAQA;;;;AACA;;;;;;AATA;;;;;;;;AAWA,IAAMA,gBAAgB,SAAhBA,aAAgB,QAAS;AAC7B,SACE;AAAA;AAAA,MAAG,MAAK,GAAR,EAAY,OAAOC,MAAMC,KAAzB;AACGD,UAAME;AADT,GADF;AAKD,CAND;;AAQAH,cAAcI,SAAd,GAA0B;AACxBF,SAAOG,oBAAUC,MAAV,CAAiBC,UADA;AAExBJ,YAAUE,oBAAUG,SAAV,CAAoB,CAACH,oBAAUI,KAAX,EAAkBJ,oBAAUK,OAA5B,CAApB,EAA0DH;AAF5C,CAA1B;;kBAKeP,a","file":"LinkDecorator.js","sourcesContent":["/*\n * A DecoratorComponent is used by `draft-js` to render rich content\n * beyond inline styles. This Decorator renders LINK entities.\n *\n * See\n * https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#decorator-components\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst LinkDecorator = props => {\n return (\n \n {props.children}\n \n );\n};\n\nLinkDecorator.propTypes = {\n style: PropTypes.object.isRequired,\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.element]).isRequired,\n};\n\nexport default LinkDecorator;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkEditor.js b/lib/components/widgets/text_editors/RichText/LinkEditor.js deleted file mode 100644 index cfb6df266..000000000 --- a/lib/components/widgets/text_editors/RichText/LinkEditor.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _constants = require('../../../../lib/constants'); - -var _reactDom = require('react-dom'); - -var _context = require('../../../../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* - * The LinkEditor is a simple UI component that floats below a selected link - * in the RichTextEditor, and lets the user enter a URL. - */ - -var LinkEditor = function (_Component) { - _inherits(LinkEditor, _Component); - - function LinkEditor(props) { - _classCallCheck(this, LinkEditor); - - var _this = _possibleConstructorReturn(this, (LinkEditor.__proto__ || Object.getPrototypeOf(LinkEditor)).call(this, props)); - - _this.state = { - // Use cached position to maintain position during times of focus. - position: _this.getUpdatedPosition(props), - originalLinkURL: props.linkURL - }; - return _this; - } - - _createClass(LinkEditor, [{ - key: 'componentDidMount', - value: function componentDidMount() { - // Focus the input field if the URL value is empty - if (this.props.linkURL.trim() === '') { - (0, _reactDom.findDOMNode)(this.input).focus(); - } - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var props = this.props; - - // Update position if we are editing a new link - - if (nextProps.linkID !== props.linkID) { - this.setState({ - position: this.getUpdatedPosition(props) - }); - } - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - // Cursor dissappears when component rerenders, to make sure it's present - // we're using setSelection range to make it appear at the end of text: - // https://github.com/plotly/streambed/issues/9964 - (0, _reactDom.findDOMNode)(this.input).setSelectionRange(this.props.linkURL.length, this.props.linkURL.length); - } - }, { - key: 'getUpdatedPosition', - value: function getUpdatedPosition(props) { - var _props$coordinates = props.coordinates, - x = _props$coordinates.x, - y = _props$coordinates.y; - - - return { x: x, y: y }; - } - }, { - key: 'onInputChange', - value: function onInputChange(urlValue) { - var _props = this.props, - linkID = _props.linkID, - onURLChange = _props.onURLChange; - - // Call back to parent - - onURLChange(linkID, urlValue); - } - }, { - key: 'onInputKeyDown', - value: function onInputKeyDown(ev) { - /* - * `KeyboardEvent.key` enjoys excellent cross-browser support. - * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key - */ - var key = ev.key; - - - if (key === _constants.RETURN_KEY) { - // Save changes - ev.preventDefault(); - - this.props.onClose(this.props.linkID); - } - - if (key === _constants.ESCAPE_KEY) { - // Cancel changes - ev.preventDefault(); - - // Restore original URL - this.onInputChange(this.state.originalLinkURL); - - this.props.onClose(this.props.linkID); - } - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _ = this.context.localize; - var position = this.state.position; - var _props2 = this.props, - onBlur = _props2.onBlur, - onFocus = _props2.onFocus, - linkURL = _props2.linkURL; - - var placeholderText = _('Enter Link URL'); - var urlText = _('URL'); - // TODO: add close button - return _react2.default.createElement( - 'div', - { className: 'rich-text-editor__link-editor', style: { left: position.x, top: position.y } }, - _react2.default.createElement( - 'span', - { className: 'rich-text-editor__link-editor__label' }, - urlText - ), - _react2.default.createElement('input', { - className: 'rich-text-editor__link-editor__input', - onBlur: onBlur, - onFocus: onFocus, - onChange: function onChange(ev) { - return _this2.onInputChange(ev.target.value); - }, - onKeyDown: function onKeyDown(ev) { - return _this2.onInputKeyDown(ev); - }, - ref: function ref(input) { - return _this2.input = input; - }, - value: linkURL, - placeholder: placeholderText - }) - ); - } - }]); - - return LinkEditor; -}(_react.Component); - -LinkEditor.propTypes = { - linkID: _propTypes2.default.string.isRequired, - linkURL: _propTypes2.default.string.isRequired, - onBlur: _propTypes2.default.func.isRequired, - onFocus: _propTypes2.default.func.isRequired, - onClose: _propTypes2.default.func.isRequired, - onURLChange: _propTypes2.default.func.isRequired, - - coordinates: _propTypes2.default.shape({ - x: _propTypes2.default.number, - y: _propTypes2.default.number - }) -}; - -LinkEditor.defaultProps = { - coordinates: { - x: 0, - y: 0 - } -}; - -LinkEditor.contextType = _context.EditorControlsContext; - -exports.default = LinkEditor; -//# sourceMappingURL=LinkEditor.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/LinkEditor.js.map b/lib/components/widgets/text_editors/RichText/LinkEditor.js.map deleted file mode 100644 index ff86a903b..000000000 --- a/lib/components/widgets/text_editors/RichText/LinkEditor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/LinkEditor.js"],"names":["LinkEditor","props","state","position","getUpdatedPosition","originalLinkURL","linkURL","trim","input","focus","nextProps","linkID","setState","setSelectionRange","length","coordinates","x","y","urlValue","onURLChange","ev","key","RETURN_KEY","preventDefault","onClose","ESCAPE_KEY","onInputChange","_","context","localize","onBlur","onFocus","placeholderText","urlText","left","top","target","value","onInputKeyDown","Component","propTypes","PropTypes","string","isRequired","func","shape","number","defaultProps","contextType","EditorControlsContext"],"mappings":";;;;;;;;AAKA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;;;+eATA;;;;;IAWMA,U;;;AACJ,sBAAYC,KAAZ,EAAmB;AAAA;;AAAA,wH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G,IAAV,CAAeD,UAHF;AAIrBZ,WAASU,oBAAUG,IAAV,CAAeD,UAJH;AAKrBnB,WAASiB,oBAAUG,IAAV,CAAeD,UALH;AAMrBxB,eAAasB,oBAAUG,IAAV,CAAeD,UANP;;AAQrB5B,eAAa0B,oBAAUI,KAAV,CAAgB;AAC3B7B,OAAGyB,oBAAUK,MADc;AAE3B7B,OAAGwB,oBAAUK;AAFc,GAAhB;AARQ,CAAvB;;AAcA9C,WAAW+C,YAAX,GAA0B;AACxBhC,eAAa;AACXC,OAAG,CADQ;AAEXC,OAAG;AAFQ;AADW,CAA1B;;AAOAjB,WAAWgD,WAAX,GAAyBC,8BAAzB;;kBAEejD,U","file":"LinkEditor.js","sourcesContent":["/*\n * The LinkEditor is a simple UI component that floats below a selected link\n * in the RichTextEditor, and lets the user enter a URL.\n */\n\nimport React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {RETURN_KEY, ESCAPE_KEY} from 'lib/constants';\nimport {findDOMNode} from 'react-dom';\nimport {EditorControlsContext} from '../../../../context';\n\nclass LinkEditor extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n // Use cached position to maintain position during times of focus.\n position: this.getUpdatedPosition(props),\n originalLinkURL: props.linkURL,\n };\n }\n\n componentDidMount() {\n // Focus the input field if the URL value is empty\n if (this.props.linkURL.trim() === '') {\n findDOMNode(this.input).focus();\n }\n }\n\n componentWillReceiveProps(nextProps) {\n const {props} = this;\n\n // Update position if we are editing a new link\n if (nextProps.linkID !== props.linkID) {\n this.setState({\n position: this.getUpdatedPosition(props),\n });\n }\n }\n\n componentDidUpdate() {\n // Cursor dissappears when component rerenders, to make sure it's present\n // we're using setSelection range to make it appear at the end of text:\n // https://github.com/plotly/streambed/issues/9964\n findDOMNode(this.input).setSelectionRange(this.props.linkURL.length, this.props.linkURL.length);\n }\n\n getUpdatedPosition(props) {\n const {x, y} = props.coordinates;\n\n return {x, y};\n }\n\n onInputChange(urlValue) {\n const {linkID, onURLChange} = this.props;\n\n // Call back to parent\n onURLChange(linkID, urlValue);\n }\n\n onInputKeyDown(ev) {\n /*\n * `KeyboardEvent.key` enjoys excellent cross-browser support.\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n */\n const {key} = ev;\n\n if (key === RETURN_KEY) {\n // Save changes\n ev.preventDefault();\n\n this.props.onClose(this.props.linkID);\n }\n\n if (key === ESCAPE_KEY) {\n // Cancel changes\n ev.preventDefault();\n\n // Restore original URL\n this.onInputChange(this.state.originalLinkURL);\n\n this.props.onClose(this.props.linkID);\n }\n }\n\n render() {\n const {localize: _} = this.context;\n const {position} = this.state;\n const {onBlur, onFocus, linkURL} = this.props;\n const placeholderText = _('Enter Link URL');\n const urlText = _('URL');\n // TODO: add close button\n return (\n

\n {urlText}\n this.onInputChange(ev.target.value)}\n onKeyDown={ev => this.onInputKeyDown(ev)}\n ref={input => (this.input = input)}\n value={linkURL}\n placeholder={placeholderText}\n />\n
\n );\n }\n}\n\nLinkEditor.propTypes = {\n linkID: PropTypes.string.isRequired,\n linkURL: PropTypes.string.isRequired,\n onBlur: PropTypes.func.isRequired,\n onFocus: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n onURLChange: PropTypes.func.isRequired,\n\n coordinates: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number,\n }),\n};\n\nLinkEditor.defaultProps = {\n coordinates: {\n x: 0,\n y: 0,\n },\n};\n\nLinkEditor.contextType = EditorControlsContext;\n\nexport default LinkEditor;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButton.js b/lib/components/widgets/text_editors/RichText/StyleButton.js deleted file mode 100644 index 40eb7d012..000000000 --- a/lib/components/widgets/text_editors/RichText/StyleButton.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var StyleButton = function (_Component) { - _inherits(StyleButton, _Component); - - function StyleButton(props) { - _classCallCheck(this, StyleButton); - - var _this = _possibleConstructorReturn(this, (StyleButton.__proto__ || Object.getPrototypeOf(StyleButton)).call(this, props)); - - _this.onToggle = _this.onToggle.bind(_this); - return _this; - } - - _createClass(StyleButton, [{ - key: 'onToggle', - value: function onToggle(ev) { - // Prevent focus moving from editor to button - ev.preventDefault(); - this.props.onToggle(this.props.value); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - active = _props.active, - label = _props.label, - value = _props.value; - - - var className = (0, _classnames2.default)('rich-text-editor__styleButton', 'rich-text-editor__styleButton__' + value, { - 'rich-text-editor__styleButton--active': active - }); - - return _react2.default.createElement( - 'span', - { className: 'rich-text-editor__styleButton__wrapper' }, - _react2.default.createElement( - 'span', - { - className: className, - onMouseDown: this.onToggle, - 'data-role': 'button', - 'data-pressed': active - }, - label - ) - ); - } - }]); - - return StyleButton; -}(_react.Component); - -StyleButton.propTypes = { - active: _propTypes2.default.bool, - - // A (styled) React element to display as label - label: _propTypes2.default.element.isRequired, - - // Callback for clicks - onToggle: _propTypes2.default.func.isRequired, - - // The value passed to `onToggle` when clicked - value: _propTypes2.default.string.isRequired -}; - -exports.default = StyleButton; -//# sourceMappingURL=StyleButton.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButton.js.map b/lib/components/widgets/text_editors/RichText/StyleButton.js.map deleted file mode 100644 index d5a2d0c5f..000000000 --- a/lib/components/widgets/text_editors/RichText/StyleButton.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/StyleButton.js"],"names":["StyleButton","props","onToggle","bind","ev","preventDefault","value","active","label","className","Component","propTypes","PropTypes","bool","element","isRequired","func","string"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEMA,W;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA,0HACXA,KADW;;AAGjB,UAAKC,QAAL,GAAgB,MAAKA,QAAL,CAAcC,IAAd,OAAhB;AAHiB;AAIlB;;;;6BAEQC,E,EAAI;AACX;AACAA,SAAGC,cAAH;AACA,WAAKJ,KAAL,CAAWC,QAAX,CAAoB,KAAKD,KAAL,CAAWK,KAA/B;AACD;;;6BAEQ;AAAA,mBACwB,KAAKL,KAD7B;AAAA,UACAM,MADA,UACAA,MADA;AAAA,UACQC,KADR,UACQA,KADR;AAAA,UACeF,KADf,UACeA,KADf;;;AAGP,UAAMG,YAAY,0BAChB,+BADgB,sCAEkBH,KAFlB,EAGhB;AACE,iDAAyCC;AAD3C,OAHgB,CAAlB;;AAQA,aACE;AAAA;AAAA,UAAM,WAAU,wCAAhB;AACE;AAAA;AAAA;AACE,uBAAWE,SADb;AAEE,yBAAa,KAAKP,QAFpB;AAGE,yBAAU,QAHZ;AAIE,4BAAcK;AAJhB;AAMGC;AANH;AADF,OADF;AAYD;;;;EApCuBE,gB;;AAuC1BV,YAAYW,SAAZ,GAAwB;AACtBJ,UAAQK,oBAAUC,IADI;;AAGtB;AACAL,SAAOI,oBAAUE,OAAV,CAAkBC,UAJH;;AAMtB;AACAb,YAAUU,oBAAUI,IAAV,CAAeD,UAPH;;AAStB;AACAT,SAAOM,oBAAUK,MAAV,CAAiBF;AAVF,CAAxB;;kBAaef,W","file":"StyleButton.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nclass StyleButton extends Component {\n constructor(props) {\n super(props);\n\n this.onToggle = this.onToggle.bind(this);\n }\n\n onToggle(ev) {\n // Prevent focus moving from editor to button\n ev.preventDefault();\n this.props.onToggle(this.props.value);\n }\n\n render() {\n const {active, label, value} = this.props;\n\n const className = classnames(\n 'rich-text-editor__styleButton',\n `rich-text-editor__styleButton__${value}`,\n {\n 'rich-text-editor__styleButton--active': active,\n }\n );\n\n return (\n \n \n {label}\n \n \n );\n }\n}\n\nStyleButton.propTypes = {\n active: PropTypes.bool,\n\n // A (styled) React element to display as label\n label: PropTypes.element.isRequired,\n\n // Callback for clicks\n onToggle: PropTypes.func.isRequired,\n\n // The value passed to `onToggle` when clicked\n value: PropTypes.string.isRequired,\n};\n\nexport default StyleButton;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js b/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js deleted file mode 100644 index 3865d8591..000000000 --- a/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _StyleButton = require('./StyleButton'); - -var _StyleButton2 = _interopRequireDefault(_StyleButton); - -var _configuration = require('./configuration'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var StyleButtonGroup = function (_Component) { - _inherits(StyleButtonGroup, _Component); - - function StyleButtonGroup() { - _classCallCheck(this, StyleButtonGroup); - - return _possibleConstructorReturn(this, (StyleButtonGroup.__proto__ || Object.getPrototypeOf(StyleButtonGroup)).apply(this, arguments)); - } - - _createClass(StyleButtonGroup, [{ - key: 'render', - value: function render() { - var _props = this.props, - currentStyle = _props.currentStyle, - linkIsSelected = _props.linkIsSelected, - styles = _props.styles, - onToggle = _props.onToggle; - - - var isActive = function isActive(currentStyle, value) { - if (value === _configuration.LINK) { - return linkIsSelected; - } - - if (typeof currentStyle.has === 'function') { - return currentStyle.has(value); - } - - return Boolean(currentStyle.value); - }; - - return _react2.default.createElement( - 'div', - { className: 'rich-text-editor__controls' }, - styles.map(function (_ref) { - var label = _ref.label, - value = _ref.value; - return _react2.default.createElement(_StyleButton2.default, { - key: value, - active: isActive(currentStyle, value), - label: label, - onToggle: onToggle, - value: value - }); - }) - ); - } - }]); - - return StyleButtonGroup; -}(_react.Component); - -StyleButtonGroup.propTypes = { - onToggle: _propTypes2.default.func.isRequired, - styles: _propTypes2.default.arrayOf(_propTypes2.default.shape({ - label: _propTypes2.default.element.isRequired, - value: _propTypes2.default.string.isRequired - })).isRequired, - - // A draft-js DraftInlineStyle instance - // https://facebook.github.io/draft-js/docs/api-reference-editor-state.html#getcurrentinlinestyle - currentStyle: _propTypes2.default.object, - linkIsSelected: _propTypes2.default.bool -}; - -exports.default = StyleButtonGroup; -//# sourceMappingURL=StyleButtonGroup.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map b/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map deleted file mode 100644 index 67beb58fb..000000000 --- a/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/StyleButtonGroup.js"],"names":["StyleButtonGroup","props","currentStyle","linkIsSelected","styles","onToggle","isActive","value","LINK","has","Boolean","map","label","Component","propTypes","PropTypes","func","isRequired","arrayOf","shape","element","string","object","bool"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,gB;;;;;;;;;;;6BACK;AAAA,mBACkD,KAAKC,KADvD;AAAA,UACAC,YADA,UACAA,YADA;AAAA,UACcC,cADd,UACcA,cADd;AAAA,UAC8BC,MAD9B,UAC8BA,MAD9B;AAAA,UACsCC,QADtC,UACsCA,QADtC;;;AAGP,UAAMC,WAAW,SAAXA,QAAW,CAACJ,YAAD,EAAeK,KAAf,EAAyB;AACxC,YAAIA,UAAUC,mBAAd,EAAoB;AAClB,iBAAOL,cAAP;AACD;;AAED,YAAI,OAAOD,aAAaO,GAApB,KAA4B,UAAhC,EAA4C;AAC1C,iBAAOP,aAAaO,GAAb,CAAiBF,KAAjB,CAAP;AACD;;AAED,eAAOG,QAAQR,aAAaK,KAArB,CAAP;AACD,OAVD;;AAYA,aACE;AAAA;AAAA,UAAK,WAAU,4BAAf;AACGH,eAAOO,GAAP,CAAW;AAAA,cAAEC,KAAF,QAAEA,KAAF;AAAA,cAASL,KAAT,QAASA,KAAT;AAAA,iBACV,8BAAC,qBAAD;AACE,iBAAKA,KADP;AAEE,oBAAQD,SAASJ,YAAT,EAAuBK,KAAvB,CAFV;AAGE,mBAAOK,KAHT;AAIE,sBAAUP,QAJZ;AAKE,mBAAOE;AALT,YADU;AAAA,SAAX;AADH,OADF;AAaD;;;;EA7B4BM,gB;;AAgC/Bb,iBAAiBc,SAAjB,GAA6B;AAC3BT,YAAUU,oBAAUC,IAAV,CAAeC,UADE;AAE3Bb,UAAQW,oBAAUG,OAAV,CACNH,oBAAUI,KAAV,CAAgB;AACdP,WAAOG,oBAAUK,OAAV,CAAkBH,UADX;AAEdV,WAAOQ,oBAAUM,MAAV,CAAiBJ;AAFV,GAAhB,CADM,EAKNA,UAPyB;;AAS3B;AACA;AACAf,gBAAca,oBAAUO,MAXG;AAY3BnB,kBAAgBY,oBAAUQ;AAZC,CAA7B;;kBAeevB,gB","file":"StyleButtonGroup.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport StyleButton from './StyleButton';\nimport {LINK} from './configuration';\n\nclass StyleButtonGroup extends Component {\n render() {\n const {currentStyle, linkIsSelected, styles, onToggle} = this.props;\n\n const isActive = (currentStyle, value) => {\n if (value === LINK) {\n return linkIsSelected;\n }\n\n if (typeof currentStyle.has === 'function') {\n return currentStyle.has(value);\n }\n\n return Boolean(currentStyle.value);\n };\n\n return (\n
\n {styles.map(({label, value}) => (\n \n ))}\n
\n );\n }\n}\n\nStyleButtonGroup.propTypes = {\n onToggle: PropTypes.func.isRequired,\n styles: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.element.isRequired,\n value: PropTypes.string.isRequired,\n })\n ).isRequired,\n\n // A draft-js DraftInlineStyle instance\n // https://facebook.github.io/draft-js/docs/api-reference-editor-state.html#getcurrentinlinestyle\n currentStyle: PropTypes.object,\n linkIsSelected: PropTypes.bool,\n};\n\nexport default StyleButtonGroup;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/configuration.js b/lib/components/widgets/text_editors/RichText/configuration.js deleted file mode 100644 index b498bc912..000000000 --- a/lib/components/widgets/text_editors/RichText/configuration.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.INLINE_STYLES = exports.STYLE_MAP = exports.STYLES_TO_HTML_TAGS = exports.ITALIC = exports.BOLD = exports.LINK = exports.SUBSCRIPT = exports.SUPERSCRIPT = undefined; - -var _STYLES_TO_HTML_TAGS, _STYLE_MAP; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _draftJsUtils = require('draft-js-utils'); - -var _plotlyIcons = require('plotly-icons'); - -var _constants = require('../../../../lib/constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var SUPERSCRIPT = exports.SUPERSCRIPT = 'SUPERSCRIPT'; -var SUBSCRIPT = exports.SUBSCRIPT = 'SUBSCRIPT'; -var LINK = exports.LINK = 'LINK'; - -var BOLD = _draftJsUtils.INLINE_STYLE.BOLD, - ITALIC = _draftJsUtils.INLINE_STYLE.ITALIC; -exports.BOLD = BOLD; -exports.ITALIC = ITALIC; -var STYLES_TO_HTML_TAGS = exports.STYLES_TO_HTML_TAGS = (_STYLES_TO_HTML_TAGS = {}, _defineProperty(_STYLES_TO_HTML_TAGS, BOLD, { element: 'b' }), _defineProperty(_STYLES_TO_HTML_TAGS, ITALIC, { element: 'i' }), _defineProperty(_STYLES_TO_HTML_TAGS, SUPERSCRIPT, { element: 'sup' }), _defineProperty(_STYLES_TO_HTML_TAGS, SUBSCRIPT, { element: 'sub' }), _defineProperty(_STYLES_TO_HTML_TAGS, LINK, { element: 'a' }), _STYLES_TO_HTML_TAGS); - -var STYLE_MAP = exports.STYLE_MAP = (_STYLE_MAP = {}, _defineProperty(_STYLE_MAP, BOLD, { - fontWeight: 'bolder' -}), _defineProperty(_STYLE_MAP, ITALIC, { - fontStyle: 'italic' -}), _defineProperty(_STYLE_MAP, SUBSCRIPT, { - /* - * Can't use text-align; IE renders `text-bottom` properly, but - * FF doesn't (same height as `bottom`). Chrome doesn't understand - * `text-align: bottom`. Use relative positioning instead. - */ - lineHeight: 0, - fontSize: '65%', - position: 'relative', - bottom: '-3px' -}), _defineProperty(_STYLE_MAP, SUPERSCRIPT, { - /* - * Can't use text-align; IE renders `text-top` properly, but - * FF doesn't (same height as `top`). Chrome doesn't understand - * `text-align: top`. Use relative positioning instead. - */ - lineHeight: 0, - fontSize: '65%', - position: 'relative', - top: '-5px' -}), _defineProperty(_STYLE_MAP, LINK, { - color: _constants.COLORS.editorLink, - linkDecoration: 'none', - cursor: 'pointer' -}), _STYLE_MAP); - -var INLINE_STYLES = exports.INLINE_STYLES = [{ - label: _react2.default.createElement( - 'span', - { style: STYLE_MAP[BOLD] }, - 'B' - ), - value: BOLD -}, { - label: _react2.default.createElement( - 'span', - { style: STYLE_MAP[ITALIC] }, - 'I' - ), - value: ITALIC -}, { - label: _react2.default.createElement( - 'span', - null, - 'x', - _react2.default.createElement( - 'span', - { style: STYLE_MAP[SUBSCRIPT] }, - '2' - ) - ), - value: SUBSCRIPT -}, { - label: _react2.default.createElement( - 'span', - null, - 'x', - _react2.default.createElement( - 'span', - { style: STYLE_MAP[SUPERSCRIPT] }, - '2' - ) - ), - value: SUPERSCRIPT -}, { - label: _react2.default.createElement( - 'span', - null, - _react2.default.createElement(_plotlyIcons.LinkIcon, { className: 'icon-link' }) - ), - value: LINK -}]; -//# sourceMappingURL=configuration.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/configuration.js.map b/lib/components/widgets/text_editors/RichText/configuration.js.map deleted file mode 100644 index 56a8fa285..000000000 --- a/lib/components/widgets/text_editors/RichText/configuration.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/configuration.js"],"names":["SUPERSCRIPT","SUBSCRIPT","LINK","BOLD","INLINE_STYLE","ITALIC","STYLES_TO_HTML_TAGS","element","STYLE_MAP","fontWeight","fontStyle","lineHeight","fontSize","position","bottom","top","color","COLORS","editorLink","linkDecoration","cursor","INLINE_STYLES","label","value"],"mappings":";;;;;;;;;AAAA;;;;AACA;;AACA;;AACA;;;;;;AAEO,IAAMA,oCAAc,aAApB;AACA,IAAMC,gCAAY,WAAlB;AACA,IAAMC,sBAAO,MAAb;;IAEOC,I,GAAgBC,0B,CAAhBD,I;IAAME,M,GAAUD,0B,CAAVC,M;;;AAEb,IAAMC,sHACVH,IADU,EACH,EAACI,SAAS,GAAV,EADG,yCAEVF,MAFU,EAED,EAACE,SAAS,GAAV,EAFC,yCAGVP,WAHU,EAGI,EAACO,SAAS,KAAV,EAHJ,yCAIVN,SAJU,EAIE,EAACM,SAAS,KAAV,EAJF,yCAKVL,IALU,EAKH,EAACK,SAAS,GAAV,EALG,wBAAN;;AAQA,IAAMC,8EACVL,IADU,EACH;AACNM,cAAY;AADN,CADG,+BAIVJ,MAJU,EAID;AACRK,aAAW;AADH,CAJC,+BAOVT,SAPU,EAOE;AACX;;;;;AAKAU,cAAY,CAND;AAOXC,YAAU,KAPC;AAQXC,YAAU,UARC;AASXC,UAAQ;AATG,CAPF,+BAkBVd,WAlBU,EAkBI;AACb;;;;;AAKAW,cAAY,CANC;AAObC,YAAU,KAPG;AAQbC,YAAU,UARG;AASbE,OAAK;AATQ,CAlBJ,+BA6BVb,IA7BU,EA6BH;AACNc,SAAOC,kBAAOC,UADR;AAENC,kBAAgB,MAFV;AAGNC,UAAQ;AAHF,CA7BG,cAAN;;AAoCA,IAAMC,wCAAgB,CAC3B;AACEC,SAAO;AAAA;AAAA,MAAM,OAAOd,UAAUL,IAAV,CAAb;AAAA;AAAA,GADT;AAEEoB,SAAOpB;AAFT,CAD2B,EAK3B;AACEmB,SAAO;AAAA;AAAA,MAAM,OAAOd,UAAUH,MAAV,CAAb;AAAA;AAAA,GADT;AAEEkB,SAAOlB;AAFT,CAL2B,EAS3B;AACEiB,SACE;AAAA;AAAA;AAAA;AACG;AAAA;AAAA,QAAM,OAAOd,UAAUP,SAAV,CAAb;AAAA;AAAA;AADH,GAFJ;AAMEsB,SAAOtB;AANT,CAT2B,EAiB3B;AACEqB,SACE;AAAA;AAAA;AAAA;AACG;AAAA;AAAA,QAAM,OAAOd,UAAUR,WAAV,CAAb;AAAA;AAAA;AADH,GAFJ;AAMEuB,SAAOvB;AANT,CAjB2B,EAyB3B;AACEsB,SACE;AAAA;AAAA;AACE,kCAAC,qBAAD,IAAU,WAAU,WAApB;AADF,GAFJ;AAMEC,SAAOrB;AANT,CAzB2B,CAAtB","file":"configuration.js","sourcesContent":["import React from 'react';\nimport {INLINE_STYLE} from 'draft-js-utils';\nimport {LinkIcon} from 'plotly-icons';\nimport {COLORS} from 'lib/constants';\n\nexport const SUPERSCRIPT = 'SUPERSCRIPT';\nexport const SUBSCRIPT = 'SUBSCRIPT';\nexport const LINK = 'LINK';\n\nexport const {BOLD, ITALIC} = INLINE_STYLE;\n\nexport const STYLES_TO_HTML_TAGS = {\n [BOLD]: {element: 'b'},\n [ITALIC]: {element: 'i'},\n [SUPERSCRIPT]: {element: 'sup'},\n [SUBSCRIPT]: {element: 'sub'},\n [LINK]: {element: 'a'},\n};\n\nexport const STYLE_MAP = {\n [BOLD]: {\n fontWeight: 'bolder',\n },\n [ITALIC]: {\n fontStyle: 'italic',\n },\n [SUBSCRIPT]: {\n /*\n * Can't use text-align; IE renders `text-bottom` properly, but\n * FF doesn't (same height as `bottom`). Chrome doesn't understand\n * `text-align: bottom`. Use relative positioning instead.\n */\n lineHeight: 0,\n fontSize: '65%',\n position: 'relative',\n bottom: '-3px',\n },\n [SUPERSCRIPT]: {\n /*\n * Can't use text-align; IE renders `text-top` properly, but\n * FF doesn't (same height as `top`). Chrome doesn't understand\n * `text-align: top`. Use relative positioning instead.\n */\n lineHeight: 0,\n fontSize: '65%',\n position: 'relative',\n top: '-5px',\n },\n [LINK]: {\n color: COLORS.editorLink,\n linkDecoration: 'none',\n cursor: 'pointer',\n },\n};\n\nexport const INLINE_STYLES = [\n {\n label: B,\n value: BOLD,\n },\n {\n label: I,\n value: ITALIC,\n },\n {\n label: (\n \n x2\n \n ),\n value: SUBSCRIPT,\n },\n {\n label: (\n \n x2\n \n ),\n value: SUPERSCRIPT,\n },\n {\n label: (\n \n \n \n ),\n value: LINK,\n },\n];\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/debounce.js b/lib/components/widgets/text_editors/RichText/debounce.js deleted file mode 100644 index abbe28f2f..000000000 --- a/lib/components/widgets/text_editors/RichText/debounce.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = debounce; -var DEBOUNCE_DELAY = 250; -var timeout = void 0; - -function clearTimeout() { - window.clearTimeout(timeout); - timeout = null; -} - -function debounce(fn, args) { - if (timeout) { - clearTimeout(); - } - - timeout = window.setTimeout(function () { - fn.apply(null, args); - timeout = null; - }, DEBOUNCE_DELAY); -} -//# sourceMappingURL=debounce.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/debounce.js.map b/lib/components/widgets/text_editors/RichText/debounce.js.map deleted file mode 100644 index d77a19602..000000000 --- a/lib/components/widgets/text_editors/RichText/debounce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/debounce.js"],"names":["debounce","DEBOUNCE_DELAY","timeout","clearTimeout","window","fn","args","setTimeout","apply"],"mappings":";;;;;kBAQwBA,Q;AARxB,IAAMC,iBAAiB,GAAvB;AACA,IAAIC,gBAAJ;;AAEA,SAASC,YAAT,GAAwB;AACtBC,SAAOD,YAAP,CAAoBD,OAApB;AACAA,YAAU,IAAV;AACD;;AAEc,SAASF,QAAT,CAAkBK,EAAlB,EAAsBC,IAAtB,EAA4B;AACzC,MAAIJ,OAAJ,EAAa;AACXC;AACD;;AAEDD,YAAUE,OAAOG,UAAP,CAAkB,YAAM;AAChCF,OAAGG,KAAH,CAAS,IAAT,EAAeF,IAAf;AACAJ,cAAU,IAAV;AACD,GAHS,EAGPD,cAHO,CAAV;AAID","file":"debounce.js","sourcesContent":["const DEBOUNCE_DELAY = 250;\nlet timeout;\n\nfunction clearTimeout() {\n window.clearTimeout(timeout);\n timeout = null;\n}\n\nexport default function debounce(fn, args) {\n if (timeout) {\n clearTimeout();\n }\n\n timeout = window.setTimeout(() => {\n fn.apply(null, args);\n timeout = null;\n }, DEBOUNCE_DELAY);\n}\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/decoratorStrategies.js b/lib/components/widgets/text_editors/RichText/decoratorStrategies.js deleted file mode 100644 index d5b9977c8..000000000 --- a/lib/components/widgets/text_editors/RichText/decoratorStrategies.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.findLinkEntities = undefined; - -var _draftJs = require('draft-js'); - -var characterIsLinkEntity = function characterIsLinkEntity(character) { - var entityKey = character.getEntity(); - - if (entityKey === null) { - return false; - } - - var entity = _draftJs.Entity.get(entityKey); - - return entity.getType() === 'LINK'; -}; /* - * A decoratorStrategy is used by `draft-js` to determine how to render - * content beyond inline styles. We use them to render LINK entities. - * - * See https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#content - * and - * https://facebook.github.io/draft-js/docs/advanced-topics-entities.html#content - */ -var findLinkEntities = exports.findLinkEntities = function findLinkEntities(contentBlock, callback) { - contentBlock.findEntityRanges(characterIsLinkEntity, callback); -}; -//# sourceMappingURL=decoratorStrategies.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map b/lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map deleted file mode 100644 index 54c1d1ae0..000000000 --- a/lib/components/widgets/text_editors/RichText/decoratorStrategies.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/decoratorStrategies.js"],"names":["characterIsLinkEntity","entityKey","character","getEntity","entity","Entity","get","getType","findLinkEntities","contentBlock","callback","findEntityRanges"],"mappings":";;;;;;;AAQA;;AAEA,IAAMA,wBAAwB,SAAxBA,qBAAwB,YAAa;AACzC,MAAMC,YAAYC,UAAUC,SAAV,EAAlB;;AAEA,MAAIF,cAAc,IAAlB,EAAwB;AACtB,WAAO,KAAP;AACD;;AAED,MAAMG,SAASC,gBAAOC,GAAP,CAAWL,SAAX,CAAf;;AAEA,SAAOG,OAAOG,OAAP,OAAqB,MAA5B;AACD,CAVD,C,CAVA;;;;;;;;AAsBO,IAAMC,8CAAmB,SAAnBA,gBAAmB,CAACC,YAAD,EAAeC,QAAf,EAA4B;AAC1DD,eAAaE,gBAAb,CAA8BX,qBAA9B,EAAqDU,QAArD;AACD,CAFM","file":"decoratorStrategies.js","sourcesContent":["/*\n * A decoratorStrategy is used by `draft-js` to determine how to render\n * content beyond inline styles. We use them to render LINK entities.\n *\n * See https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#content\n * and\n * https://facebook.github.io/draft-js/docs/advanced-topics-entities.html#content\n */\nimport {Entity} from 'draft-js';\n\nconst characterIsLinkEntity = character => {\n const entityKey = character.getEntity();\n\n if (entityKey === null) {\n return false;\n }\n\n const entity = Entity.get(entityKey);\n\n return entity.getType() === 'LINK';\n};\n\nexport const findLinkEntities = (contentBlock, callback) => {\n contentBlock.findEntityRanges(characterIsLinkEntity, callback);\n};\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js b/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js deleted file mode 100644 index 1f98087be..000000000 --- a/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var getCoordinates = function getCoordinates() { - var coordinates = { x: 0, y: 0 }; - - var rect = document.getElementsByClassName('text-editor')[0].getBoundingClientRect(); - - var LINK_POP_UP_WIDTH = 158.5; - - if (rect) { - // Add to the offset - coordinates.x += rect.width * 0.5 - LINK_POP_UP_WIDTH / 2; - coordinates.y += rect.height * 0.5; - } - - return coordinates; -}; - -exports.default = getCoordinates; -//# sourceMappingURL=getSelectionCoordinates.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map b/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map deleted file mode 100644 index b8b8d8340..000000000 --- a/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/getSelectionCoordinates.js"],"names":["getCoordinates","coordinates","x","y","rect","document","getElementsByClassName","getBoundingClientRect","LINK_POP_UP_WIDTH","width","height"],"mappings":";;;;;AAAA,IAAMA,iBAAiB,SAAjBA,cAAiB,GAAM;AAC3B,MAAMC,cAAc,EAACC,GAAG,CAAJ,EAAOC,GAAG,CAAV,EAApB;;AAEA,MAAMC,OAAOC,SAASC,sBAAT,CAAgC,aAAhC,EAA+C,CAA/C,EAAkDC,qBAAlD,EAAb;;AAEA,MAAMC,oBAAoB,KAA1B;;AAEA,MAAIJ,IAAJ,EAAU;AACR;AACAH,gBAAYC,CAAZ,IAAiBE,KAAKK,KAAL,GAAa,GAAb,GAAmBD,oBAAoB,CAAxD;AACAP,gBAAYE,CAAZ,IAAiBC,KAAKM,MAAL,GAAc,GAA/B;AACD;;AAED,SAAOT,WAAP;AACD,CAdD;;kBAgBeD,c","file":"getSelectionCoordinates.js","sourcesContent":["const getCoordinates = () => {\n const coordinates = {x: 0, y: 0};\n\n const rect = document.getElementsByClassName('text-editor')[0].getBoundingClientRect();\n\n const LINK_POP_UP_WIDTH = 158.5;\n\n if (rect) {\n // Add to the offset\n coordinates.x += rect.width * 0.5 - LINK_POP_UP_WIDTH / 2;\n coordinates.y += rect.height * 0.5;\n }\n\n return coordinates;\n};\n\nexport default getCoordinates;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/index.js b/lib/components/widgets/text_editors/RichText/index.js deleted file mode 100644 index 443500254..000000000 --- a/lib/components/widgets/text_editors/RichText/index.js +++ /dev/null @@ -1,431 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _draftJs = require('draft-js'); - -var _draftJsExportHtml = require('@plotly/draft-js-export-html'); - -var _draftJsImportHtml = require('draft-js-import-html'); - -var _configuration = require('./configuration'); - -var _LinkDecorator = require('./LinkDecorator'); - -var _LinkDecorator2 = _interopRequireDefault(_LinkDecorator); - -var _LinkEditor = require('./LinkEditor'); - -var _LinkEditor2 = _interopRequireDefault(_LinkEditor); - -var _StyleButtonGroup = require('./StyleButtonGroup'); - -var _StyleButtonGroup2 = _interopRequireDefault(_StyleButtonGroup); - -var _debounce = require('./debounce'); - -var _debounce2 = _interopRequireDefault(_debounce); - -var _DraftCommands = require('./DraftCommands'); - -var _decoratorStrategies = require('./decoratorStrategies'); - -var _getSelectionCoordinates = require('./getSelectionCoordinates'); - -var _getSelectionCoordinates2 = _interopRequireDefault(_getSelectionCoordinates); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// Constants - - -// Components - - -// Libraries - - -var RichText = function (_Component) { - _inherits(RichText, _Component); - - function RichText(props, context) { - _classCallCheck(this, RichText); - - /* - * Initially set state based on the plotly.js annotation content. - * After this, as long as this component is mounted, it owns the source - * of truth for the annotation value via `this.state.editorState`. - * This state may be updated externally via a prop update. - * See `componentWillReceiveProps`. - */ - var _this = _possibleConstructorReturn(this, (RichText.__proto__ || Object.getPrototypeOf(RichText)).call(this, props, context)); - - _this.state = { - editorState: props.value.toString().trim().length ? _this.createEditorStateFromHTML(props.value) : _draftJs.EditorState.createEmpty(_this.getDecorator()) - }; - - _this.getDecorator = _this.getDecorator.bind(_this); - _this.createEditorStateFromHTML = _this.createEditorStateFromHTML.bind(_this); - _this.getEditorStateAsHTML = _this.getEditorStateAsHTML.bind(_this); - _this.focus = _this.focus.bind(_this); - _this.getParentContainerVerticalOffset = _this.getParentContainerVerticalOffset.bind(_this); - _this.onChange = _this.onChange.bind(_this); - _this.onBlur = _this.onBlur.bind(_this); - _this.onFocus = _this.onFocus.bind(_this); - _this.onLinkEditorBlur = _this.onLinkEditorBlur.bind(_this); - _this.onLinkEditorFocus = _this.onLinkEditorFocus.bind(_this); - _this.onLinkEditorChange = _this.onLinkEditorChange.bind(_this); - _this.onLinkEditorClose = _this.onLinkEditorClose.bind(_this); - _this.onKeyCommand = _this.onKeyCommand.bind(_this); - _this.onReturnPressed = _this.onReturnPressed.bind(_this); - _this.onStyleButtonToggle = _this.onStyleButtonToggle.bind(_this); - _this.renderLinkEditor = _this.renderLinkEditor.bind(_this); - return _this; - } - - _createClass(RichText, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var _state = this.state, - linkEditorFocus = _state.linkEditorFocus, - editorFocus = _state.editorFocus; - - /* - * Don't worry about what plotly.js thinks the annotation value - * should be while we're using our editor, for these reasons: - * - * 1. The editor should be considered the source of truth, unless the - * user is actually editing the annotation inline, in the chart. - * 2. Sometimes we get updates with stale values. - */ - - if (linkEditorFocus || editorFocus) { - return; - } - - // Sync editor state with plotly annotation value. - var editorState = this.createEditorStateFromHTML(nextProps.value); - - this.setState({ editorState: editorState }); - } - }, { - key: 'shouldComponentUpdate', - value: function shouldComponentUpdate(nextProps, nextState) { - var _props = this.props, - placeholder = _props.placeholder, - value = _props.value; - var _state2 = this.state, - editorState = _state2.editorState, - linkEditorFocus = _state2.linkEditorFocus; - - // If relevant props or state changed, return true. - - if ( - // Always update when user is editing link - linkEditorFocus || placeholder !== nextProps.placeholder || value !== nextProps.value || editorState !== nextState.editorState) { - return true; - } - - // Compare incoming value with HTML representation of state. - return nextProps.value !== this.getEditorStateAsHTML(editorState); - } - }, { - key: 'getDecorator', - value: function getDecorator() { - return new _draftJs.CompositeDecorator([{ - strategy: _decoratorStrategies.findLinkEntities, - component: _LinkDecorator2.default, - - // Props for the LinkDecorator component - props: { - style: _configuration.STYLE_MAP[_configuration.LINK] - } - }]); - } - }, { - key: 'createEditorStateFromHTML', - value: function createEditorStateFromHTML(html) { - var _inlineStyles; - - var contentState = (0, _draftJsImportHtml.stateFromHTML)(html, { - inlineStyles: (_inlineStyles = {}, _defineProperty(_inlineStyles, _configuration.SUPERSCRIPT, { element: 'sup' }), _defineProperty(_inlineStyles, _configuration.SUBSCRIPT, { element: 'sub' }), _inlineStyles), - defaultBlockTag: null - }); - - var decorator = this.getDecorator(); - - /* - * Work around issue described here: - * https://github.com/facebook/draft-js/issues/185 - * #issuecomment-217207612 - */ - - // Parse once to generate entity instances - _draftJs.EditorState.createWithContent(contentState); - - // Now we can add our decorator - return _draftJs.EditorState.createWithContent(contentState, decorator); - } - }, { - key: 'getEditorStateAsHTML', - value: function getEditorStateAsHTML(editorState) { - var contentState = editorState.getCurrentContent(); - - return (0, _draftJsExportHtml.stateToHTML)(contentState, { - defaultBlockTag: null, - inlineStyles: _configuration.STYLES_TO_HTML_TAGS - }); - } - }, { - key: 'focus', - value: function focus() { - this.editorInput.focus(); - } - - // Used to properly calculate user selection coordinates. - - }, { - key: 'getParentContainerVerticalOffset', - value: function getParentContainerVerticalOffset() { - return document.querySelector('.panel').scrollTop; - } - }, { - key: 'onChange', - value: function onChange(editorState) { - var selectedLinkID = this.state.selectedLinkID; - - var selection = editorState.getSelection(); - var entityKey = (0, _DraftCommands.getEntityKeyAt)(editorState, selection); - - var newState = { editorState: editorState }; - - // Update selected link ID - if (!(0, _DraftCommands.cursorHasLink)(editorState, selection)) { - // If a link is no longer selected, clear selected link ID state - Object.assign(newState, { - selectedLinkID: null - }); - } else if (selectedLinkID !== entityKey) { - // If link selection is new / different link selected, update it - Object.assign(newState, { - selectedLinkID: entityKey - }); - } - - // Update internal state - this.setState(newState); - - // Dispatch changes to plotly.js - // TODO consider moving to render (plotly.js is a render target) - var htmlContent = this.getEditorStateAsHTML(editorState); - if (this.props.value !== htmlContent) { - (0, _debounce2.default)(this.props.onChange, [htmlContent]); - } - } - }, { - key: 'onBlur', - value: function onBlur() { - this.setState({ - editorFocus: false - }); - } - }, { - key: 'onFocus', - value: function onFocus() { - this.setState({ - editorFocus: true - }); - } - }, { - key: 'onLinkEditorBlur', - value: function onLinkEditorBlur() { - this.setState({ - linkEditorFocus: false - }); - } - }, { - key: 'onLinkEditorFocus', - value: function onLinkEditorFocus() { - this.setState({ - linkEditorFocus: true - }); - } - }, { - key: 'onLinkEditorChange', - value: function onLinkEditorChange(linkID, urlValue) { - var editorState = this.state.editorState; - - var selectionState = editorState.getSelection(); - - // Update link URL - _draftJs.Entity.replaceData(linkID, { url: urlValue }); - - // Trigger an editor state update - var updatedEditorState = _draftJs.RichUtils.toggleLink(editorState, selectionState, linkID); - - this.onChange(updatedEditorState); - } - - /** - * Will be called by LinkEditor when the user confirms or cancels new URL. - * Will not be called if LinkEditor is closed by moving the cursor off of - * the selected LINK entity. - * - * @param {String} linkID The link entity key related to this LinkEditor - * @returns {undefined} - */ - - }, { - key: 'onLinkEditorClose', - value: function onLinkEditorClose() { - /* - * Focus on editor immediately to avoid error that occurs when - * `selection.extend` is called and another element has focus. - * https://bugzilla.mozilla.org/show_bug.cgi?id=921444 - * https://github.com/facebook/draft-js/blob/342576bf7186d07c82a41d9ca8169130669747d6/src/component/selection/setDraftEditorSelection.js#L128-L134 - */ - this.focus(); - - // Hide the editor. - this.setState({ - linkEditorFocus: false, - selectedLinkID: null - }); - } - }, { - key: 'onKeyCommand', - value: function onKeyCommand(command) { - var newEditorState = (0, _DraftCommands.handleKeyCommand)(this.state.editorState, command); - - if (newEditorState) { - this.onChange(newEditorState); - - // Let draft-js know that keyboard command is handled. - return true; - } - - // Default draft-js implementation - return false; - } - }, { - key: 'onReturnPressed', - value: function onReturnPressed() { - var newEditorState = (0, _DraftCommands.insertSoftNewline)(this.state.editorState); - - // Update internal and external state - this.onChange(newEditorState); - - // Cancel draft-js implementation - return true; - } - }, { - key: 'onStyleButtonToggle', - value: function onStyleButtonToggle(inlineStyle) { - var newEditorState = (0, _DraftCommands.toggleInlineStyle)(this.state.editorState, inlineStyle); - - if (newEditorState) { - this.onChange(newEditorState); - } - } - }, { - key: 'renderLinkEditor', - value: function renderLinkEditor(selectedLinkID) { - if (!selectedLinkID) { - return null; - } - - // All entities are link entities. - var linkEntity = (0, _DraftCommands.getEntityByKey)(selectedLinkID); - var linkURL = linkEntity.getData().url; - - var coordinates = (0, _getSelectionCoordinates2.default)(); - - return _react2.default.createElement(_LinkEditor2.default, { - onFocus: this.onLinkEditorFocus, - onURLChange: this.onLinkEditorChange, - onBlur: this.onLinkEditorBlur, - onClose: this.onLinkEditorClose, - coordinates: coordinates, - linkID: selectedLinkID, - linkURL: linkURL - }); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _state3 = this.state, - editorState = _state3.editorState, - selectedLinkID = _state3.selectedLinkID; - - var linkIsSelected = Boolean(selectedLinkID); - - return _react2.default.createElement( - 'div', - { className: 'rich-text-editor__root' }, - _react2.default.createElement(_StyleButtonGroup2.default, { - styles: _configuration.INLINE_STYLES, - currentStyle: editorState.getCurrentInlineStyle(), - linkIsSelected: linkIsSelected, - onToggle: this.onStyleButtonToggle - }), - _react2.default.createElement( - 'div', - { className: 'rich-text-editor__editor', onClick: this.focus }, - _react2.default.createElement(_draftJs.Editor, { - customStyleMap: _configuration.STYLE_MAP, - editorState: editorState, - handleReturn: this.onReturnPressed, - handleKeyCommand: this.onKeyCommand, - onChange: this.onChange, - onBlur: this.onBlur, - onFocus: this.onFocus, - placeholder: this.props.placeholder, - spellCheck: false, - ref: function ref(input) { - return _this2.editorInput = input; - } - }) - ), - this.renderLinkEditor(selectedLinkID) - ); - } - }]); - - return RichText; -}(_react.Component); - -RichText.propTypes = { - onChange: _propTypes2.default.func.isRequired, - placeholder: _propTypes2.default.string, - value: _propTypes2.default.any -}; - -RichText.defaultProps = { - placeholder: '', - value: '' -}; - -exports.default = RichText; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/RichText/index.js.map b/lib/components/widgets/text_editors/RichText/index.js.map deleted file mode 100644 index 6e1421baf..000000000 --- a/lib/components/widgets/text_editors/RichText/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../../src/components/widgets/text_editors/RichText/index.js"],"names":["RichText","props","context","state","editorState","value","toString","trim","length","createEditorStateFromHTML","EditorState","createEmpty","getDecorator","bind","getEditorStateAsHTML","focus","getParentContainerVerticalOffset","onChange","onBlur","onFocus","onLinkEditorBlur","onLinkEditorFocus","onLinkEditorChange","onLinkEditorClose","onKeyCommand","onReturnPressed","onStyleButtonToggle","renderLinkEditor","nextProps","linkEditorFocus","editorFocus","setState","nextState","placeholder","CompositeDecorator","strategy","findLinkEntities","component","LinkDecorator","style","STYLE_MAP","LINK","html","contentState","inlineStyles","SUPERSCRIPT","element","SUBSCRIPT","defaultBlockTag","decorator","createWithContent","getCurrentContent","STYLES_TO_HTML_TAGS","editorInput","document","querySelector","scrollTop","selectedLinkID","selection","getSelection","entityKey","newState","Object","assign","htmlContent","linkID","urlValue","selectionState","Entity","replaceData","url","updatedEditorState","RichUtils","toggleLink","command","newEditorState","inlineStyle","linkEntity","linkURL","getData","coordinates","linkIsSelected","Boolean","INLINE_STYLES","getCurrentInlineStyle","input","Component","propTypes","PropTypes","func","isRequired","string","any","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;AACA;;AAGA;;AAUA;;;;AACA;;;;AACA;;;;AAGA;;;;AACA;;AAQA;;AACA;;;;;;;;;;;;;;AA1BA;;;AAUA;;;AAKA;;;IAaMA,Q;;;AACJ,oBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAG1B;;;;;;;AAH0B,oHACpBD,KADoB,EACbC,OADa;;AAU1B,UAAKC,KAAL,GAAa;AACXC,mBAAaH,MAAMI,KAAN,CAAYC,QAAZ,GAAuBC,IAAvB,GAA8BC,MAA9B,GACT,MAAKC,yBAAL,CAA+BR,MAAMI,KAArC,CADS,GAETK,qBAAYC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tB5B,SAAO;AAFe,CAAxB;;kBAKeL,Q","file":"index.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {CompositeDecorator, Editor, EditorState, Entity, RichUtils} from 'draft-js';\nimport {stateToHTML} from '@plotly/draft-js-export-html';\nimport {stateFromHTML} from 'draft-js-import-html';\n\n// Constants\nimport {\n SUPERSCRIPT,\n SUBSCRIPT,\n LINK,\n STYLES_TO_HTML_TAGS,\n STYLE_MAP,\n INLINE_STYLES,\n} from './configuration';\n\n// Components\nimport LinkDecorator from './LinkDecorator';\nimport LinkEditor from './LinkEditor';\nimport StyleButtonGroup from './StyleButtonGroup';\n\n// Libraries\nimport debounce from './debounce';\nimport {\n getEntityKeyAt,\n getEntityByKey,\n toggleInlineStyle,\n handleKeyCommand,\n insertSoftNewline,\n cursorHasLink,\n} from './DraftCommands';\nimport {findLinkEntities} from './decoratorStrategies';\nimport getCoordinates from './getSelectionCoordinates';\n\nclass RichText extends Component {\n constructor(props, context) {\n super(props, context);\n\n /*\n * Initially set state based on the plotly.js annotation content.\n * After this, as long as this component is mounted, it owns the source\n * of truth for the annotation value via `this.state.editorState`.\n * This state may be updated externally via a prop update.\n * See `componentWillReceiveProps`.\n */\n this.state = {\n editorState: props.value.toString().trim().length\n ? this.createEditorStateFromHTML(props.value)\n : EditorState.createEmpty(this.getDecorator()),\n };\n\n this.getDecorator = this.getDecorator.bind(this);\n this.createEditorStateFromHTML = this.createEditorStateFromHTML.bind(this);\n this.getEditorStateAsHTML = this.getEditorStateAsHTML.bind(this);\n this.focus = this.focus.bind(this);\n this.getParentContainerVerticalOffset = this.getParentContainerVerticalOffset.bind(this);\n this.onChange = this.onChange.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onLinkEditorBlur = this.onLinkEditorBlur.bind(this);\n this.onLinkEditorFocus = this.onLinkEditorFocus.bind(this);\n this.onLinkEditorChange = this.onLinkEditorChange.bind(this);\n this.onLinkEditorClose = this.onLinkEditorClose.bind(this);\n this.onKeyCommand = this.onKeyCommand.bind(this);\n this.onReturnPressed = this.onReturnPressed.bind(this);\n this.onStyleButtonToggle = this.onStyleButtonToggle.bind(this);\n this.renderLinkEditor = this.renderLinkEditor.bind(this);\n }\n\n componentWillReceiveProps(nextProps) {\n const {linkEditorFocus, editorFocus} = this.state;\n\n /*\n * Don't worry about what plotly.js thinks the annotation value\n * should be while we're using our editor, for these reasons:\n *\n * 1. The editor should be considered the source of truth, unless the\n * user is actually editing the annotation inline, in the chart.\n * 2. Sometimes we get updates with stale values.\n */\n if (linkEditorFocus || editorFocus) {\n return;\n }\n\n // Sync editor state with plotly annotation value.\n const editorState = this.createEditorStateFromHTML(nextProps.value);\n\n this.setState({editorState});\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n const {placeholder, value} = this.props;\n const {editorState, linkEditorFocus} = this.state;\n\n // If relevant props or state changed, return true.\n if (\n // Always update when user is editing link\n linkEditorFocus ||\n placeholder !== nextProps.placeholder ||\n value !== nextProps.value ||\n editorState !== nextState.editorState\n ) {\n return true;\n }\n\n // Compare incoming value with HTML representation of state.\n return nextProps.value !== this.getEditorStateAsHTML(editorState);\n }\n\n getDecorator() {\n return new CompositeDecorator([\n {\n strategy: findLinkEntities,\n component: LinkDecorator,\n\n // Props for the LinkDecorator component\n props: {\n style: STYLE_MAP[LINK],\n },\n },\n ]);\n }\n\n createEditorStateFromHTML(html) {\n const contentState = stateFromHTML(html, {\n inlineStyles: {\n [SUPERSCRIPT]: {element: 'sup'},\n [SUBSCRIPT]: {element: 'sub'},\n },\n defaultBlockTag: null,\n });\n\n const decorator = this.getDecorator();\n\n /*\n * Work around issue described here:\n * https://github.com/facebook/draft-js/issues/185\n * #issuecomment-217207612\n */\n\n // Parse once to generate entity instances\n EditorState.createWithContent(contentState);\n\n // Now we can add our decorator\n return EditorState.createWithContent(contentState, decorator);\n }\n\n getEditorStateAsHTML(editorState) {\n const contentState = editorState.getCurrentContent();\n\n return stateToHTML(contentState, {\n defaultBlockTag: null,\n inlineStyles: STYLES_TO_HTML_TAGS,\n });\n }\n\n focus() {\n this.editorInput.focus();\n }\n\n // Used to properly calculate user selection coordinates.\n getParentContainerVerticalOffset() {\n return document.querySelector('.panel').scrollTop;\n }\n\n onChange(editorState) {\n const {selectedLinkID} = this.state;\n const selection = editorState.getSelection();\n const entityKey = getEntityKeyAt(editorState, selection);\n\n const newState = {editorState};\n\n // Update selected link ID\n if (!cursorHasLink(editorState, selection)) {\n // If a link is no longer selected, clear selected link ID state\n Object.assign(newState, {\n selectedLinkID: null,\n });\n } else if (selectedLinkID !== entityKey) {\n // If link selection is new / different link selected, update it\n Object.assign(newState, {\n selectedLinkID: entityKey,\n });\n }\n\n // Update internal state\n this.setState(newState);\n\n // Dispatch changes to plotly.js\n // TODO consider moving to render (plotly.js is a render target)\n const htmlContent = this.getEditorStateAsHTML(editorState);\n if (this.props.value !== htmlContent) {\n debounce(this.props.onChange, [htmlContent]);\n }\n }\n\n onBlur() {\n this.setState({\n editorFocus: false,\n });\n }\n\n onFocus() {\n this.setState({\n editorFocus: true,\n });\n }\n\n onLinkEditorBlur() {\n this.setState({\n linkEditorFocus: false,\n });\n }\n\n onLinkEditorFocus() {\n this.setState({\n linkEditorFocus: true,\n });\n }\n\n onLinkEditorChange(linkID, urlValue) {\n const {editorState} = this.state;\n const selectionState = editorState.getSelection();\n\n // Update link URL\n Entity.replaceData(linkID, {url: urlValue});\n\n // Trigger an editor state update\n const updatedEditorState = RichUtils.toggleLink(editorState, selectionState, linkID);\n\n this.onChange(updatedEditorState);\n }\n\n /**\n * Will be called by LinkEditor when the user confirms or cancels new URL.\n * Will not be called if LinkEditor is closed by moving the cursor off of\n * the selected LINK entity.\n *\n * @param {String} linkID The link entity key related to this LinkEditor\n * @returns {undefined}\n */\n onLinkEditorClose() {\n /*\n * Focus on editor immediately to avoid error that occurs when\n * `selection.extend` is called and another element has focus.\n * https://bugzilla.mozilla.org/show_bug.cgi?id=921444\n * https://github.com/facebook/draft-js/blob/342576bf7186d07c82a41d9ca8169130669747d6/src/component/selection/setDraftEditorSelection.js#L128-L134\n */\n this.focus();\n\n // Hide the editor.\n this.setState({\n linkEditorFocus: false,\n selectedLinkID: null,\n });\n }\n\n onKeyCommand(command) {\n const newEditorState = handleKeyCommand(this.state.editorState, command);\n\n if (newEditorState) {\n this.onChange(newEditorState);\n\n // Let draft-js know that keyboard command is handled.\n return true;\n }\n\n // Default draft-js implementation\n return false;\n }\n\n onReturnPressed() {\n const newEditorState = insertSoftNewline(this.state.editorState);\n\n // Update internal and external state\n this.onChange(newEditorState);\n\n // Cancel draft-js implementation\n return true;\n }\n\n onStyleButtonToggle(inlineStyle) {\n const newEditorState = toggleInlineStyle(this.state.editorState, inlineStyle);\n\n if (newEditorState) {\n this.onChange(newEditorState);\n }\n }\n\n renderLinkEditor(selectedLinkID) {\n if (!selectedLinkID) {\n return null;\n }\n\n // All entities are link entities.\n const linkEntity = getEntityByKey(selectedLinkID);\n const linkURL = linkEntity.getData().url;\n\n const coordinates = getCoordinates();\n\n return (\n \n );\n }\n\n render() {\n const {editorState, selectedLinkID} = this.state;\n const linkIsSelected = Boolean(selectedLinkID);\n\n return (\n
\n \n
\n (this.editorInput = input)}\n />\n
\n {this.renderLinkEditor(selectedLinkID)}\n
\n );\n }\n}\n\nRichText.propTypes = {\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n value: PropTypes.any,\n};\n\nRichText.defaultProps = {\n placeholder: '',\n value: '',\n};\n\nexport default RichText;\n"]} \ No newline at end of file diff --git a/lib/components/widgets/text_editors/convertFormats.js b/lib/components/widgets/text_editors/convertFormats.js deleted file mode 100644 index 29011a318..000000000 --- a/lib/components/widgets/text_editors/convertFormats.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var getTextBlockRegExp = function getTextBlockRegExp() { - return (/\\text\{([^}]*)}/g - ); -}; - -/** - * To match any character including newline whitespace, use `[\s\S]*` - * instead of `.*`. http://stackoverflow.com/a/1068308 - * - * @returns {RegExp} the regular expression - */ -var getLaTeXWrappedRegExp = function getLaTeXWrappedRegExp() { - return (/^\$[\s\S]*\$$/ - ); -}; - -var stripHTMLTags = function stripHTMLTags(html) { - return html.replace(/<[^>]*>/g, '').trim(); -}; - -var extractTextBlocks = function extractTextBlocks(laTeX) { - var matchObj = void 0; - var matchStr = void 0; - var matches = []; - - // Need to stringify to match literally on `\t`. - var stringifiedLaTeX = JSON.stringify(laTeX); - var regExp = getTextBlockRegExp(); - - /** - * Find multiple matches with the ``//g` flag. - * The `RegExp.prototype.exec` API mutates the RegExp object. - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec#Finding_successive_matches - */ - while ((matchObj = regExp.exec(stringifiedLaTeX)) !== null) { - matchStr = matchObj[1].trim().replace('\\n', ''); - matches.push(matchStr); - } - - return matches.join('
'); -}; - -var wrapLaTeX = function wrapLaTeX(value) { - return value ? '$' + value + '$' : '$$'; -}; - -var wrapText = function wrapText(value) { - return value ? '\\text{' + value + '}' : '\\text{}'; -}; - -// Exports -// ------- - -var isLaTeXExpr = exports.isLaTeXExpr = function isLaTeXExpr(value) { - return getLaTeXWrappedRegExp().test(value); -}; - -var hasTextExpression = exports.hasTextExpression = function hasTextExpression(laTeX) { - var regExp = getTextBlockRegExp(); - var stringifiedLaTeX = JSON.stringify(laTeX); - - return regExp.test(stringifiedLaTeX); -}; - -var htmlToLaTeX = exports.htmlToLaTeX = function htmlToLaTeX(html) { - var breakTag = '
'; - var trimmedHTML = html.trim(); - - // Handle empty input - if (trimmedHTML === '') { - return wrapLaTeX(wrapText()); - } - - // Handle input with only linebreaks - if (trimmedHTML.replace(breakTag, '') === '') { - return wrapLaTeX(wrapText()); - } - - return wrapLaTeX(trimmedHTML.split(breakTag) - - // Ignore empty linebreaks - .map(function (para) { - return para.length ? wrapText(stripHTMLTags(para)) : ''; - }).join('\n')); -}; - -var laTeXToHTML = exports.laTeXToHTML = function laTeXToHTML(laTeX) { - var trimmedLaTeX = laTeX.trim(); - - return extractTextBlocks(trimmedLaTeX); -}; -//# sourceMappingURL=convertFormats.js.map \ No newline at end of file diff --git a/lib/components/widgets/text_editors/convertFormats.js.map b/lib/components/widgets/text_editors/convertFormats.js.map deleted file mode 100644 index f49b57cc2..000000000 --- a/lib/components/widgets/text_editors/convertFormats.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/components/widgets/text_editors/convertFormats.js"],"names":["getTextBlockRegExp","getLaTeXWrappedRegExp","stripHTMLTags","html","replace","trim","extractTextBlocks","matchObj","matchStr","matches","stringifiedLaTeX","JSON","stringify","laTeX","regExp","exec","push","join","wrapLaTeX","value","wrapText","isLaTeXExpr","test","hasTextExpression","htmlToLaTeX","breakTag","trimmedHTML","split","map","para","length","laTeXToHTML","trimmedLaTeX"],"mappings":";;;;;AAAA,IAAMA,qBAAqB,SAArBA,kBAAqB;AAAA,SAAM;AAAN;AAAA,CAA3B;;AAEA;;;;;;AAMA,IAAMC,wBAAwB,SAAxBA,qBAAwB;AAAA,SAAM;AAAN;AAAA,CAA9B;;AAEA,IAAMC,gBAAgB,SAAhBA,aAAgB;AAAA,SAAQC,KAAKC,OAAL,CAAa,UAAb,EAAyB,EAAzB,EAA6BC,IAA7B,EAAR;AAAA,CAAtB;;AAEA,IAAMC,oBAAoB,SAApBA,iBAAoB,QAAS;AACjC,MAAIC,iBAAJ;AACA,MAAIC,iBAAJ;AACA,MAAMC,UAAU,EAAhB;;AAEA;AACA,MAAMC,mBAAmBC,KAAKC,SAAL,CAAeC,KAAf,CAAzB;AACA,MAAMC,SAASd,oBAAf;;AAEA;;;;;AAKA,SAAO,CAACO,WAAWO,OAAOC,IAAP,CAAYL,gBAAZ,CAAZ,MAA+C,IAAtD,EAA4D;AAC1DF,eAAWD,SAAS,CAAT,EAAYF,IAAZ,GAAmBD,OAAnB,CAA2B,KAA3B,EAAkC,EAAlC,CAAX;A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file":"convertFormats.js","sourcesContent":["const getTextBlockRegExp = () => /\\\\text\\{([^}]*)}/g;\n\n/**\n * To match any character including newline whitespace, use `[\\s\\S]*`\n * instead of `.*`. http://stackoverflow.com/a/1068308\n *\n * @returns {RegExp} the regular expression\n */\nconst getLaTeXWrappedRegExp = () => /^\\$[\\s\\S]*\\$$/;\n\nconst stripHTMLTags = html => html.replace(/<[^>]*>/g, '').trim();\n\nconst extractTextBlocks = laTeX => {\n let matchObj;\n let matchStr;\n const matches = [];\n\n // Need to stringify to match literally on `\\t`.\n const stringifiedLaTeX = JSON.stringify(laTeX);\n const regExp = getTextBlockRegExp();\n\n /**\n * Find multiple matches with the ``//g` flag.\n * The `RegExp.prototype.exec` API mutates the RegExp object.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec#Finding_successive_matches\n */\n while ((matchObj = regExp.exec(stringifiedLaTeX)) !== null) {\n matchStr = matchObj[1].trim().replace('\\\\n', '');\n matches.push(matchStr);\n }\n\n return matches.join('
');\n};\n\nconst wrapLaTeX = value => (value ? `$${value}$` : '$$');\n\nconst wrapText = value => (value ? `\\\\text{${value}}` : '\\\\text{}');\n\n// Exports\n// -------\n\nexport const isLaTeXExpr = value => getLaTeXWrappedRegExp().test(value);\n\nexport const hasTextExpression = laTeX => {\n const regExp = getTextBlockRegExp();\n const stringifiedLaTeX = JSON.stringify(laTeX);\n\n return regExp.test(stringifiedLaTeX);\n};\n\nexport const htmlToLaTeX = html => {\n const breakTag = '
';\n const trimmedHTML = html.trim();\n\n // Handle empty input\n if (trimmedHTML === '') {\n return wrapLaTeX(wrapText());\n }\n\n // Handle input with only linebreaks\n if (trimmedHTML.replace(breakTag, '') === '') {\n return wrapLaTeX(wrapText());\n }\n\n return wrapLaTeX(\n trimmedHTML\n .split(breakTag)\n\n // Ignore empty linebreaks\n .map(para => (para.length ? wrapText(stripHTMLTags(para)) : ''))\n .join('\\n')\n );\n};\n\nexport const laTeXToHTML = laTeX => {\n const trimmedLaTeX = laTeX.trim();\n\n return extractTextBlocks(trimmedLaTeX);\n};\n"]} \ No newline at end of file diff --git a/lib/context/index.js b/lib/context/index.js deleted file mode 100644 index c4fed5620..000000000 --- a/lib/context/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ConnectTraceToPlotContext = exports.PlotlyPanelContext = exports.PlotlyFoldContext = exports.ModalProviderContext = exports.PanelMenuWrapperContext = exports.EditorControlsContext = undefined; - -var _react = require('react'); - -var EditorControlsContext = (0, _react.createContext)({}); -var PanelMenuWrapperContext = (0, _react.createContext)({}); -var ModalProviderContext = (0, _react.createContext)({}); -var PlotlyFoldContext = (0, _react.createContext)({}); -var PlotlyPanelContext = (0, _react.createContext)({}); -// const ConnectAggregationToTransformContext = createContext({}); -// const ConnectAnnotationToLayoutContext = createContext({}); -// const ConnectAxesToLayoutContext = createContext({}); -// const ConnectCartesianSubplotToLayoutContext = createContext({}); -// const ConnectImageToLayoutContext = createContext({}); -// const ConnectLayoutToPlotContext = createContext({}); -// const ConnectNonCartesianSubplotToLayoutContext = createContext({}); -// const ConnectRangeSelectorToAxisContext = createContext({}); -// const ConnectShapeToLayoutContext = createContext({}); -// const ConnectSliderToLayoutContext = createContext({}); -// const ConnectToContainerContext = createContext({}); -var ConnectTraceToPlotContext = (0, _react.createContext)({}); -// const ConnectTransformToTraceContext = createContext({}); -// const ConnectUpdateMenuToLayoutContext = createContext({}); - -exports.EditorControlsContext = EditorControlsContext; -exports.PanelMenuWrapperContext = PanelMenuWrapperContext; -exports.ModalProviderContext = ModalProviderContext; -exports.PlotlyFoldContext = PlotlyFoldContext; -exports.PlotlyPanelContext = PlotlyPanelContext; -exports.ConnectTraceToPlotContext = ConnectTraceToPlotContext; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/context/index.js.map b/lib/context/index.js.map deleted file mode 100644 index 57781e7ef..000000000 --- a/lib/context/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/context/index.js"],"names":["EditorControlsContext","PanelMenuWrapperContext","ModalProviderContext","PlotlyFoldContext","PlotlyPanelContext","ConnectTraceToPlotContext"],"mappings":";;;;;;;AAAA;;AACA,IAAMA,wBAAwB,0BAAc,EAAd,CAA9B;AACA,IAAMC,0BAA0B,0BAAc,EAAd,CAAhC;AACA,IAAMC,uBAAuB,0BAAc,EAAd,CAA7B;AACA,IAAMC,oBAAoB,0BAAc,EAAd,CAA1B;AACA,IAAMC,qBAAqB,0BAAc,EAAd,CAA3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,4BAA4B,0BAAc,EAAd,CAAlC;AACA;AACA;;QAGEL,qB,GAAAA,qB;QACAC,uB,GAAAA,uB;QACAC,oB,GAAAA,oB;QACAC,iB,GAAAA,iB;QACAC,kB,GAAAA,kB;QAYAC,yB,GAAAA,yB","file":"index.js","sourcesContent":["import {createContext} from 'react';\nconst EditorControlsContext = createContext({});\nconst PanelMenuWrapperContext = createContext({});\nconst ModalProviderContext = createContext({});\nconst PlotlyFoldContext = createContext({});\nconst PlotlyPanelContext = createContext({});\n// const ConnectAggregationToTransformContext = createContext({});\n// const ConnectAnnotationToLayoutContext = createContext({});\n// const ConnectAxesToLayoutContext = createContext({});\n// const ConnectCartesianSubplotToLayoutContext = createContext({});\n// const ConnectImageToLayoutContext = createContext({});\n// const ConnectLayoutToPlotContext = createContext({});\n// const ConnectNonCartesianSubplotToLayoutContext = createContext({});\n// const ConnectRangeSelectorToAxisContext = createContext({});\n// const ConnectShapeToLayoutContext = createContext({});\n// const ConnectSliderToLayoutContext = createContext({});\n// const ConnectToContainerContext = createContext({});\nconst ConnectTraceToPlotContext = createContext({});\n// const ConnectTransformToTraceContext = createContext({});\n// const ConnectUpdateMenuToLayoutContext = createContext({});\n\nexport {\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n // ConnectAggregationToTransformContext,\n // ConnectAnnotationToLayoutContext,\n // ConnectAxesToLayoutContext,\n // ConnectCartesianSubplotToLayoutContext,\n // ConnectImageToLayoutContext,\n // ConnectLayoutToPlotContext,\n // ConnectNonCartesianSubplotToLayoutContext,\n // ConnectRangeSelectorToAxisContext,\n // ConnectShapeToLayoutContext,\n // ConnectSliderToLayoutContext,\n // ConnectToContainerContext,\n ConnectTraceToPlotContext,\n // ConnectTransformToTraceContext,\n // ConnectUpdateMenuToLayoutContext,\n};\n"]} \ No newline at end of file diff --git a/lib/default_panels/GraphCreatePanel.js b/lib/default_panels/GraphCreatePanel.js deleted file mode 100644 index acb3417fc..000000000 --- a/lib/default_panels/GraphCreatePanel.js +++ /dev/null @@ -1,191 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _derived = require('../components/fields/derived'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var GraphCreatePanel = function GraphCreatePanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _context.ModalProviderContext.Consumer, - null, - function (_ref2) { - var setPanel = _ref2.setPanel; - return _react2.default.createElement( - _components.TraceAccordion, - { - canAdd: true, - traceFilterCondition: function traceFilterCondition(t) { - return !(t.transforms && t.transforms.some(function (tr) { - return ['fit', 'moving-average'].includes(tr.type); - })); - } - }, - _react2.default.createElement(_components.TraceSelector, { label: _('Type'), attr: 'type', show: true }), - _react2.default.createElement(_components.LocationSelector, { attr: 'type' }), - _react2.default.createElement(_components.DataSelector, { label: _('Values'), attr: 'values' }), - _react2.default.createElement(_components.DataSelector, { label: _('Labels'), attr: 'labels' }), - _react2.default.createElement(_components.DataSelector, { - label: { - histogram2d: _('X Values'), - histogram: _('X Values'), - '*': _('X') - }, - attr: 'x' - }), - _react2.default.createElement(_components.DataSelector, { - label: { - histogram2d: _('Y Values'), - histogram: _('Y Values'), - '*': _('Y') - }, - attr: 'y' - }), - _react2.default.createElement(_components.DataSelector, { - label: { - choropleth: _('Values'), - histogram2d: _('Z Values'), - '*': _('Z') - }, - attr: 'z' - }), - _react2.default.createElement(_components.Radio, { - label: _('Orientation'), - attr: 'orientation', - options: [{ label: _('Vertical'), value: 'v' }, { label: _('Horizontal'), value: 'h' }] - }), - _react2.default.createElement( - _derived.HistogramInfoVertical, - null, - _('Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the '), - _react2.default.createElement( - 'a', - { onClick: function onClick() { - return setPanel('Style', 'Traces'); - } }, - _('Traces') - ), - _(' panel under Style. If Y values are omitted, the histogram function defaults to Count.') - ), - _react2.default.createElement( - _derived.HistogramInfoHorizontal, - null, - _('Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the '), - _react2.default.createElement( - 'a', - { onClick: function onClick() { - return setPanel('Style', 'Traces'); - } }, - _('Traces') - ), - _(' under Style panel. If X values are omitted, the histogram function defaults to Count.') - ), - _react2.default.createElement( - _derived.Histogram2d, - null, - _('Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the '), - _react2.default.createElement( - 'a', - { onClick: function onClick() { - return setPanel('Style', 'Traces'); - } }, - _('Traces') - ), - _(' under Style panel. If Z values are omitted, the histogram function defaults to Count.') - ), - _react2.default.createElement(_components.DataSelector, { label: _('I (Optional)'), attr: 'i' }), - _react2.default.createElement(_components.DataSelector, { label: _('J (Optional)'), attr: 'j' }), - _react2.default.createElement(_components.DataSelector, { label: _('K (Optional)'), attr: 'k' }), - _react2.default.createElement(_components.DataSelector, { label: _('Open'), attr: 'open' }), - _react2.default.createElement(_components.DataSelector, { label: _('High'), attr: 'high' }), - _react2.default.createElement(_components.DataSelector, { label: _('Low'), attr: 'low' }), - _react2.default.createElement(_components.DataSelector, { label: _('Close'), attr: 'close' }), - _react2.default.createElement(_components.DataSelector, { label: _('A'), attr: 'a' }), - _react2.default.createElement(_components.DataSelector, { label: _('B'), attr: 'b' }), - _react2.default.createElement(_components.DataSelector, { label: _('C'), attr: 'c' }), - _react2.default.createElement(_components.DataSelector, { label: _('U'), attr: 'u' }), - _react2.default.createElement(_components.DataSelector, { label: _('V'), attr: 'v' }), - _react2.default.createElement(_components.DataSelector, { label: _('W'), attr: 'w' }), - _react2.default.createElement(_components.DataSelector, { label: _('X start'), attr: 'starts.x' }), - _react2.default.createElement(_components.DataSelector, { label: _('Y start'), attr: 'starts.y' }), - _react2.default.createElement(_components.DataSelector, { label: _('Z start'), attr: 'starts.z' }), - _react2.default.createElement(_components.DataSelector, { label: _('Headers'), attr: 'header.values' }), - _react2.default.createElement(_components.DataSelector, { label: _('Columns'), attr: 'cells.values' }), - _react2.default.createElement( - _components.TraceTypeSection, - { - traceTypes: ['scatterpolar', 'scatterpolargl', 'barpolar'], - mode: 'trace' - }, - _react2.default.createElement(_components.DataSelector, { label: _('Radius'), attr: 'r' }), - _react2.default.createElement(_components.DataSelector, { label: _('Theta'), attr: 'theta' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Theta Unit'), - options: [{ label: _('Radians'), value: 'radians' }, { label: _('Degrees'), value: 'degrees' }, { label: _('Gradians'), value: 'gradians' }], - attr: 'thetaunit', - clearable: false - }) - ), - _react2.default.createElement(_components.AxesCreator, { attr: 'fake_attr' }), - _react2.default.createElement(_components.SubplotCreator, { attr: 'fake_attr' }), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Header Options') }, - _react2.default.createElement(_components.DataSelector, { label: _('Fill Color'), attr: 'header.fill.color' }), - _react2.default.createElement(_components.DataSelector, { label: _('Font Color'), attr: 'header.font.color' }), - _react2.default.createElement(_components.DataSelector, { label: _('Font Size'), attr: 'header.font.size' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Cell Options') }, - _react2.default.createElement(_components.DataSelector, { label: _('Fill Color'), attr: 'cells.fill.color' }), - _react2.default.createElement(_components.DataSelector, { label: _('Font Color'), attr: 'cells.font.color' }), - _react2.default.createElement(_components.DataSelector, { label: _('Font Size'), attr: 'cells.font.size' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Column Options') }, - _react2.default.createElement(_components.DataSelector, { label: _('Width'), attr: 'columnwidth' }), - _react2.default.createElement(_components.DataSelector, { label: _('Order'), attr: 'columnorder' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Options') }, - _react2.default.createElement(_components.DataSelector, { label: _('Intensity'), attr: 'intensity' }), - _react2.default.createElement(_components.DataSelector, { label: _('Facecolor'), attr: 'facecolor' }), - _react2.default.createElement(_components.DataSelector, { label: _('Vertexcolor'), attr: 'vertexcolor' }), - _react2.default.createElement(_components.Radio, { - label: _('Transpose'), - attr: 'transpose', - options: [{ label: _('No'), value: false }, { label: _('Yes'), value: true }] - }) - ) - ); - } - ); - } - ); -}; -// import PropTypes from 'prop-types'; -exports.default = GraphCreatePanel; -// GraphCreatePanel.contextTypes = { -// localize: PropTypes.func, -// setPanel: PropTypes.func, -// }; -//# sourceMappingURL=GraphCreatePanel.js.map \ No newline at end of file diff --git a/lib/default_panels/GraphCreatePanel.js.map b/lib/default_panels/GraphCreatePanel.js.map deleted file mode 100644 index b746ec2bc..000000000 --- a/lib/default_panels/GraphCreatePanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/GraphCreatePanel.js"],"names":["GraphCreatePanel","_","localize","setPanel","t","transforms","some","includes","tr","type","histogram2d","histogram","choropleth","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAYA;;AAKA;;;;AAEA,IAAMA,mBAAmB,SAAnBA,gBAAmB,GAAM;AAC7B,SACE;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,qCAAD,CAAsB,QAAtB;AAAA;AACG;AAAA,c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AAOA,EAAE,WAAF,CAArB,EAAqC,MAAK,WAA1C,GADF;AAEE,4CAAC,wBAAD,IAAc,OAAOA,EAAE,WAAF,CAArB,EAAqC,MAAK,WAA1C,GAFF;AAGE,4CAAC,wBAAD,IAAc,OAAOA,EAAE,aAAF,CAArB,EAAuC,MAAK,aAA5C,GAHF;AAIE,4CAAC,iBAAD;AACE,uBAAOA,EAAE,WAAF,CADT;AAEE,sBAAK,WAFP;AAGE,yBAAS,CAAC,EAACY,OAAOZ,EAAE,IAAF,CAAR,EAAiBa,OAAO,KAAxB,EAAD,EAAiC,EAACD,OAAOZ,EAAE,KAAF,CAAR,EAAkBa,OAAO,IAAzB,EAAjC;AAHX;AAJF;AAjIF,WADD;AAAA;AADH,OADD;AAAA;AADH,GADF;AAsJD,CAvJD;AApBA;kBA6Ked,gB;AACf;AACA;AACA;AACA","file":"GraphCreatePanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n DataSelector,\n Dropdown,\n Radio,\n PlotlySection,\n AxesCreator,\n SubplotCreator,\n TraceAccordion,\n TraceSelector,\n TraceTypeSection,\n LocationSelector,\n} from '../components';\nimport {\n HistogramInfoVertical,\n HistogramInfoHorizontal,\n Histogram2d,\n} from '../components/fields/derived';\nimport {EditorControlsContext, ModalProviderContext} from '../context';\n\nconst GraphCreatePanel = () => {\n return (\n \n {({localize: _}) => (\n \n {({setPanel}) => (\n \n !(\n t.transforms &&\n t.transforms.some(tr => ['fit', 'moving-average'].includes(tr.type))\n )\n }\n >\n \n\n \n\n \n \n\n \n \n \n \n \n {_(\n 'Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the '\n )}\n setPanel('Style', 'Traces')}>{_('Traces')}\n {_(\n ' panel under Style. If Y values are omitted, the histogram function defaults to Count.'\n )}\n \n \n {_(\n 'Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the '\n )}\n setPanel('Style', 'Traces')}>{_('Traces')}\n {_(\n ' under Style panel. If X values are omitted, the histogram function defaults to Count.'\n )}\n \n \n {_(\n 'Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the '\n )}\n setPanel('Style', 'Traces')}>{_('Traces')}\n {_(\n ' under Style panel. If Z values are omitted, the histogram function defaults to Count.'\n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default GraphCreatePanel;\n// GraphCreatePanel.contextTypes = {\n// localize: PropTypes.func,\n// setPanel: PropTypes.func,\n// };\n"]} \ No newline at end of file diff --git a/lib/default_panels/GraphSubplotsPanel.js b/lib/default_panels/GraphSubplotsPanel.js deleted file mode 100644 index 020d44100..000000000 --- a/lib/default_panels/GraphSubplotsPanel.js +++ /dev/null @@ -1,232 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _constants = require('../lib/constants'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var GraphSubplotsPanel = function GraphSubplotsPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.SubplotAccordion, - null, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Boundaries'), attr: 'xaxis.domain[0]' }, - _react2.default.createElement(_components.AxisOverlayDropdown, { label: _('X Overlay'), attr: 'xaxis.overlaying' }), - _react2.default.createElement(_components.AxisOverlayDropdown, { label: _('Y Overlay'), attr: 'yaxis.overlaying' }) - ), - _react2.default.createElement(_components.RectanglePositioner, { attr: 'domain.x[0]' }), - _react2.default.createElement(_components.RectanglePositioner, { attr: 'xaxis.domain[0]', cartesian: true }), - _react2.default.createElement( - _components.TraceTypeSection, - { name: _('X Anchor'), traceTypes: _constants.TRACE_TO_AXIS.cartesian }, - _react2.default.createElement(_components.AxisAnchorDropdown, { label: _('Anchor to'), attr: 'xaxis.anchor', clearable: false }), - _react2.default.createElement(_components.AxisSide, { label: _('Side'), attr: 'xaxis.side' }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { name: _('Y Anchor'), traceTypes: _constants.TRACE_TO_AXIS.cartesian }, - _react2.default.createElement(_components.AxisAnchorDropdown, { label: _('Anchor to'), attr: 'yaxis.anchor', clearable: false }), - _react2.default.createElement(_components.AxisSide, { label: _('Side'), attr: 'yaxis.side' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Aspect Ratio') }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'aspectmode', - options: [{ label: _('Auto'), value: 'mode' }, { label: _('Cube'), value: 'cube' }, { label: _('Data'), value: 'data' }, { label: _('Manual'), value: 'manual' }], - dropdown: true, - clearable: false, - showOn: 'manual', - defaultOpt: 'mode' - }, - _react2.default.createElement(_components.Numeric, { label: _('X'), attr: 'aspectratio.x', step: 0.1 }), - _react2.default.createElement(_components.Numeric, { label: _('Y'), attr: 'aspectratio.y', step: 0.1 }), - _react2.default.createElement(_components.Numeric, { label: _('Z'), attr: 'aspectratio.z', step: 0.1 }) - ) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Canvas') }, - _react2.default.createElement(_components.ColorPicker, { label: _('Plot Background'), attr: 'bgcolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Bar Options') }, - _react2.default.createElement(_components.Radio, { - label: _('Bar Mode'), - attr: 'barmode', - options: [{ label: _('Stack'), value: 'stack' }, { label: _('Overlay'), value: 'overlay' }] - }), - _react2.default.createElement(_components.NumericFraction, { label: _('Bar Padding'), attr: 'bargap', showSlider: true }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Map Style') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Mapbox Style'), - attr: 'style', - options: [{ label: _('Basic'), value: 'basic' }, { label: _('Outdoors'), value: 'outdoors' }, { label: _('Light'), value: 'light' }, { label: _('Dark'), value: 'dark' }, { label: _('Satellite'), value: 'satellite' }, { label: _('Satellite with Streets'), value: 'satellite-streets' }], - clearable: false - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Map Positioning') }, - _react2.default.createElement(_components.Numeric, { label: _('Center Latitude'), attr: 'center.lat' }), - _react2.default.createElement(_components.Numeric, { label: _('Center Longitude'), attr: 'center.lon' }), - _react2.default.createElement(_components.Numeric, { label: _('Zoom Level'), attr: 'zoom', min: 0 }), - _react2.default.createElement(_components.Numeric, { label: _('Bearing'), attr: 'bearing' }), - _react2.default.createElement(_components.Numeric, { label: _('Pitch'), attr: 'pitch', min: 0 }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Map Projection') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Region'), - attr: 'scope', - options: [{ label: _('World'), value: 'world' }, { label: _('USA'), value: 'usa' }, { label: _('Europe'), value: 'europe' }, { label: _('Asia'), value: 'asia' }, { label: _('Africa'), value: 'africa' }, { label: _('North America'), value: 'north america' }, { label: _('South America'), value: 'south america' }], - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Projection'), - attr: 'projection.type', - clearable: false, - options: [{ label: _('Equirectangular'), value: 'equirectangular' }, { label: _('Mercator'), value: 'mercator' }, { label: _('Orthographic'), value: 'orthographic' }, { label: _('Natural Earth'), value: 'natural earth' }, { label: _('Albers USA'), value: 'albers usa' }, { label: _('Winkel Tripel'), value: 'winkel tripel' }, { label: _('Robinson'), value: 'robinson' }, { label: _('Miller'), value: 'miller' }, { label: _('Kavrayskiy 7'), value: 'kavrayskiy7' }, { label: _('Eckert 4'), value: 'eckert4' }, { label: _('Azimuthal Equal Area'), value: 'azimuthal equal area' }, { - label: _('Azimuthal Equidistant'), - value: 'azimuthal equidistant' - }, { label: _('Conic Equal Area'), value: 'conic equal area' }, { label: _('Conic Conformal'), value: 'conic conformal' }, { label: _('Conic Equidistant'), value: 'conic equidistant' }, { label: _('Gnomonic'), value: 'gnomonic' }, { label: _('Stereographic'), value: 'stereographic' }, { label: _('Mollweide'), value: 'mollweide' }, { label: _('Hammer'), value: 'hammer' }, { label: _('Transverse Mercator'), value: 'transverse mercator' }, { label: _('Aitoff'), value: 'aitoff' }, { label: _('Sinusoidal'), value: 'sinusoidal' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Country Borders'), attr: 'showcountries' }, - _react2.default.createElement(_components.Radio, { - attr: 'showcountries', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'countrywidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'countrycolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Sub-Country Unit Borders'), attr: 'showsubunits' }, - _react2.default.createElement(_components.Radio, { - attr: 'showsubunits', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'subunitwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'subunitcolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Coastlines'), attr: 'showcoastlines' }, - _react2.default.createElement(_components.Radio, { - attr: 'showcoastlines', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'coastlinewidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'coastlinecolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Oceans'), attr: 'showocean' }, - _react2.default.createElement(_components.Radio, { - attr: 'showocean', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'oceancolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Land'), attr: 'showland' }, - _react2.default.createElement(_components.Radio, { - attr: 'showland', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'landcolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Lakes'), attr: 'showlakes' }, - _react2.default.createElement(_components.Radio, { - attr: 'showlakes', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'lakecolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Rivers'), attr: 'showrivers' }, - _react2.default.createElement(_components.Radio, { - attr: 'showrivers', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'riverwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'rivercolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Map Frame'), attr: 'showframe' }, - _react2.default.createElement(_components.Radio, { - attr: 'showframe', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'framewidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'framecolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Map Options') }, - _react2.default.createElement(_components.Radio, { - label: _('Resolution'), - attr: 'resolution', - options: [{ label: _('1:110,000,000'), value: 110 }, { label: _('1:50,000,000'), value: 50 }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Scale'), attr: 'projection.scale', min: 0 }), - _react2.default.createElement(_components.Numeric, { label: _('Latitude'), attr: 'projection.rotation.lon', min: 0 }), - _react2.default.createElement(_components.Numeric, { label: _('Longitude'), attr: 'projection.rotation.lat', min: 0 }), - _react2.default.createElement(_components.Numeric, { label: _('Roll'), attr: 'projection.rotation.roll', min: 0 }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Ternary') }, - _react2.default.createElement(_components.Numeric, { label: _('Sum'), attr: 'sum' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Polar Sector') }, - _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'sector[0]', min: -360, max: 360, showSlider: true }), - _react2.default.createElement(_components.Numeric, { label: _('Max'), attr: 'sector[1]', min: -360, max: 360, showSlider: true }), - _react2.default.createElement(_components.NumericFraction, { label: _('Hole'), attr: 'hole', min: 0, max: 100, showSlider: true }) - ) - ); - } - ); -}; - -// GraphSubplotsPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -// import PropTypes from 'prop-types'; -exports.default = GraphSubplotsPanel; -//# sourceMappingURL=GraphSubplotsPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/GraphSubplotsPanel.js.map b/lib/default_panels/GraphSubplotsPanel.js.map deleted file mode 100644 index 92a469866..000000000 --- a/lib/default_panels/GraphSubplotsPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/GraphSubplotsPanel.js"],"names":["GraphSubplotsPanel","_","localize","TRACE_TO_AXIS","cartesian","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAeA;;AACA;;;;AAEA,IAAMA,qBAAqB,SAArBA,kBAAqB;AAAA,SACzB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,oCAAD;AAAA;AACE;AAAC,mCAAD;AAAA,YAAe,MAAMD,EAAE,YAAF,CAArB,EAAsC,MAAK,iBAA3C;AACE,wCAAC,+BAAD,IAAqB,OAAOA,EAAE,WAAF,CAA5B,EAA4C,MAAK,kBAAjD,GADF;AAEE,wCAAC,+BAAD,IAAqB,OAAOA,EAAE,WAAF,CAA5B,EAA4C,MAAK,kBAAjD;AAFF,SADF;AAME,sCAAC,+BAA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AAiE,gBAAjE;AAHF;AA7MF,OADD;AAAA;AADH,GADyB;AAAA,CAA3B;;AA0NA;AACA;AACA;;AA/OA;kBAiPeD,kB","file":"GraphSubplotsPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n SubplotAccordion,\n RectanglePositioner,\n AxisOverlayDropdown,\n PlotlySection,\n TraceTypeSection,\n AxisAnchorDropdown,\n AxisSide,\n Dropdown,\n Radio,\n Numeric,\n ColorPicker,\n VisibilitySelect,\n NumericFraction,\n} from '../components';\nimport {TRACE_TO_AXIS} from '../lib/constants';\nimport {EditorControlsContext} from '../context';\n\nconst GraphSubplotsPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n )}\n \n);\n\n// GraphSubplotsPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default GraphSubplotsPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/GraphTransformsPanel.js b/lib/default_panels/GraphTransformsPanel.js deleted file mode 100644 index 4c5d9edf0..000000000 --- a/lib/default_panels/GraphTransformsPanel.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Aggregations = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _components = require('../components'); - -var _lib = require('../lib'); - -var _constants = require('../lib/constants'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var AggregationSection = (0, _lib.connectAggregationToTransform)(_components.PlotlySection); - -var Aggregations = exports.Aggregations = function (_Component) { - _inherits(Aggregations, _Component); - - function Aggregations() { - _classCallCheck(this, Aggregations); - - return _possibleConstructorReturn(this, (Aggregations.__proto__ || Object.getPrototypeOf(Aggregations)).apply(this, arguments)); - } - - _createClass(Aggregations, [{ - key: 'render', - value: function render() { - var _context$fullContaine = this.context.fullContainer.aggregations, - aggregations = _context$fullContaine === undefined ? [] : _context$fullContaine; - var _ = this.context.localize; - - if (aggregations.length === 0) { - return null; - } - - return _react2.default.createElement( - _components.PlotlySection, - { name: _('Aggregations'), attr: 'aggregations' }, - aggregations.filter(function (aggr) { - return aggr.target && aggr.target.match(/transforms\[\d*\]\./gi) === null; - }).map(function (_ref, i) { - var target = _ref.target; - return _react2.default.createElement( - AggregationSection, - { show: true, key: i, aggregationIndex: i }, - _react2.default.createElement(_components.Dropdown, { - attr: 'func', - label: target, - options: [{ label: _('Count'), value: 'count' }, { label: _('Sum'), value: 'sum' }, { label: _('Average'), value: 'avg' }, { label: _('Median'), value: 'median' }, { label: _('Mode'), value: 'mode' }, { label: _('RMS'), value: 'rms' }, { label: _('Standard Deviation'), value: 'stddev' }, { label: _('Min'), value: 'min' }, { label: _('Max'), value: 'max' }, { label: _('First'), value: 'first' }, { label: _('Last'), value: 'last' }, { label: _('Change'), value: 'change' }, { label: _('Range'), value: 'range' }], - clearable: false - }) - ); - }) - ); - } - }]); - - return Aggregations; -}(_react.Component); - -Aggregations.plotly_editor_traits = { no_visibility_forcing: true }; -Aggregations.contextTypes = { - fullContainer: _propTypes2.default.object, - localize: _propTypes2.default.func -}; - -var GraphTransformsPanel = function GraphTransformsPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref2) { - var _ = _ref2.localize; - return _react2.default.createElement( - _components.TraceAccordion, - { traceFilterCondition: function traceFilterCondition(t) { - return _constants.TRANSFORMABLE_TRACES.includes(t.type); - } }, - _react2.default.createElement( - _components.TransformAccordion, - null, - _react2.default.createElement(_components.Radio, { - attr: 'enabled', - options: [{ label: _('Enabled'), value: true }, { label: _('Disabled'), value: false }] - }), - _react2.default.createElement(_components.DataSelector, { label: _('By'), attr: 'groups' }), - _react2.default.createElement(_components.DataSelector, { label: _('Target'), attr: 'target' }), - _react2.default.createElement(_components.FilterOperation, { label: _('Operator'), attr: 'operation' }), - _react2.default.createElement(_components.FilterValue, { label: _('Value'), attr: 'value' }), - _react2.default.createElement(_components.Radio, { - attr: 'order', - options: [{ label: _('Ascending'), value: 'ascending' }, { label: _('Descending'), value: 'descending' }] - }), - _react2.default.createElement(Aggregations, null) - ) - ); - } - ); -}; - -// GraphTransformsPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = GraphTransformsPanel; -//# sourceMappingURL=GraphTransformsPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/GraphTransformsPanel.js.map b/lib/default_panels/GraphTransformsPanel.js.map deleted file mode 100644 index 901abcd81..000000000 --- a/lib/default_panels/GraphTransformsPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/GraphTransformsPanel.js"],"names":["AggregationSection","PlotlySection","Aggregations","context","fullContainer","aggregations","_","localize","length","filter","aggr","target","match","map","i","label","value","Component","plotly_editor_traits","no_visibility_forcing","contextTypes","PropTypes","object","func","GraphTransformsPanel","TRANSFORMABLE_TRACES","includes","t","type"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AAUA;;AACA;;AAGA;;;;;;;;;;AADA,IAAMA,qBAAqB,wCAA8BC,yBAA9B,CAA3B;;IAGaC,Y,WAAAA,Y;;;;;;;;;;;6BACF;AAAA,kCAGH,KAAKC,OAHF,CAELC,aAFK,CAEWC,YAFX;AAAA,UAEWA,YAFX,yCAE0B,EAF1B;AAAA,UAIUC,CAJV,GAIe,KAAKH,OAJpB,CAIAI,QAJA;;AAKP,UAAIF,aAAaG,MAAb,KAAwB,CAA5B,EAA+B;AAC7B,eAAO,IAAP;AACD;;AAED,aACE;AAAC,iCAAD;AAAA,UAAe,MAAMF,EAAE,cAAF,CAArB,EAAwC,MAAK,cAA7C;AACGD,qBACEI,MADF,CACS;AAAA,iBAAQC,KAAKC,MAAL,IAAeD,KAAKC,MAAL,CAAYC,KAAZ,CAAkB,uBAAlB,MAA+C,IAAtE;AAAA,SADT,EAEEC,GAFF,CAEM,gBAAWC,CAAX;AAAA,cAAEH,MAAF,QAAEA,MAAF;AAAA,iBACH;AAAC,8BAAD;AAAA,cAAoB,UAApB,EAAyB,KAAKG,CAA9B,EAAiC,kBAAkBA,CAAnD;AACE,0CAAC,oBAAD;AACE,oBAAK,MADP;AAEE,qBAAOH,MAFT;AAGE,uBAAS,CACP,EAACI,OAAOT,EAAE,OAAF,CAAR,EAAoBU,OAAO,OAA3B,EADO,EAEP,EAACD,OAAOT,EAAE,KAAF,CAAR,EAAkBU,OAAO,KAAzB,EAFO,EAGP,EAACD,OAAOT,EAAE,SAAF,CAAR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BAAS,CAAC,EAACb,OAAOT,EAAE,SAAF,CAAR,EAAsBU,OAAO,IAA7B,EAAD,EAAqC,EAACD,OAAOT,EAAE,UAAF,CAAR,EAAuBU,OAAO,KAA9B,EAArC;AAFX,YADF;AAME,wCAAC,wBAAD,IAAc,OAAOV,EAAE,IAAF,CAArB,EAA8B,MAAK,QAAnC,GANF;AAQE,wCAAC,wBAAD,IAAc,OAAOA,EAAE,QAAF,CAArB,EAAkC,MAAK,QAAvC,GARF;AASE,wCAAC,2BAAD,IAAiB,OAAOA,EAAE,UAAF,CAAxB,EAAuC,MAAK,WAA5C,GATF;AAUE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,OAArC,GAVF;AAYE,wCAAC,iBAAD;AACE,kBAAK,OADP;AAEE,qBAAS,CACP,EAACS,OAAOT,EAAE,WAAF,CAAR,EAAwBU,OAAO,WAA/B,EADO,EAEP,EAACD,OAAOT,EAAE,YAAF,CAAR,EAAyBU,OAAO,YAAhC,EAFO;AAFX,YAZF;AAoBE,wCAAC,YAAD;AApBF;AADF,OADD;AAAA;AADH,GADF;AA8BD,CA/BD;;AAiCA;AACA;AACA;;kBAEeQ,oB","file":"GraphTransformsPanel.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Radio,\n TransformAccordion,\n TraceAccordion,\n DataSelector,\n Dropdown,\n PlotlySection,\n FilterOperation,\n FilterValue,\n} from '../components';\nimport {connectAggregationToTransform} from '../lib';\nimport {TRANSFORMABLE_TRACES} from 'lib/constants';\n\nconst AggregationSection = connectAggregationToTransform(PlotlySection);\nimport {EditorControlsContext} from '../context';\n\nexport class Aggregations extends Component {\n render() {\n const {\n fullContainer: {aggregations = []},\n } = this.context;\n const {localize: _} = this.context;\n if (aggregations.length === 0) {\n return null;\n }\n\n return (\n \n {aggregations\n .filter(aggr => aggr.target && aggr.target.match(/transforms\\[\\d*\\]\\./gi) === null)\n .map(({target}, i) => (\n \n \n \n ))}\n \n );\n }\n}\n\nAggregations.plotly_editor_traits = {no_visibility_forcing: true};\nAggregations.contextTypes = {\n fullContainer: PropTypes.object,\n localize: PropTypes.func,\n};\n\nconst GraphTransformsPanel = () => {\n return (\n \n {({localize: _}) => (\n TRANSFORMABLE_TRACES.includes(t.type)}>\n \n \n\n \n\n \n \n \n\n \n\n \n \n \n )}\n \n );\n};\n\n// GraphTransformsPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default GraphTransformsPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleAxesPanel.js b/lib/default_panels/StyleAxesPanel.js deleted file mode 100644 index de5ba2b1d..000000000 --- a/lib/default_panels/StyleAxesPanel.js +++ /dev/null @@ -1,397 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _components = require('../components'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var StyleAxesPanel = function (_Component) { - _inherits(StyleAxesPanel, _Component); - - function StyleAxesPanel() { - _classCallCheck(this, StyleAxesPanel); - - return _possibleConstructorReturn(this, (StyleAxesPanel.__proto__ || Object.getPrototypeOf(StyleAxesPanel)).apply(this, arguments)); - } - - _createClass(StyleAxesPanel, [{ - key: 'render', - value: function render() { - var _ = this.context.localize; - - return _react2.default.createElement( - _components.LayoutPanel, - null, - _react2.default.createElement( - _components.AxesFold, - { - name: _('Titles'), - axisFilter: function axisFilter(axis) { - return !(axis._name.includes('angular') || axis._subplot.includes('geo')); - } - }, - _react2.default.createElement(_components.TextEditor, { attr: 'title' }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'titlefont.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'titlefont.size', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'titlefont.color' }) - ), - _react2.default.createElement( - _components.AxesFold, - { name: _('Range') }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Range'), attr: 'autorange' }, - _react2.default.createElement(_components.Dropdown, { - attr: 'type', - label: _('Type'), - clearable: false, - options: [{ label: _('Linear'), value: 'linear' }, { label: _('Log'), value: 'log' }, { label: _('Date'), value: 'date' }, { label: _('Categorical'), value: 'category' }] - }), - _react2.default.createElement(_components.Radio, { - attr: 'autorange', - label: _('Range'), - options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }] - }), - _react2.default.createElement(_components.AxesRange, { label: _('Min'), attr: 'range[0]' }), - _react2.default.createElement(_components.AxesRange, { label: _('Max'), attr: 'range[1]' }), - _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'min' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Zoom Interactivity'), attr: 'fixedrange' }, - _react2.default.createElement(_components.Radio, { - attr: 'fixedrange', - options: [{ label: _('Enable'), value: false }, { label: _('Disable'), value: true }] - }) - ), - _react2.default.createElement(_components.Dropdown, { - label: _('Direction'), - attr: 'direction', - options: [{ label: _('Clockwise'), value: 'clockwise' }, { label: _('Counter Clockwise'), value: 'counterclockwise' }], - clearable: false - }) - ), - _react2.default.createElement( - _components.AxesFold, - { name: _('Lines') }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Axis Line'), attr: 'showline' }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'showline', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true, - defaultOpt: true - }, - _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'linewidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'linecolor' }), - _react2.default.createElement(_components.AxisSide, { label: _('Position'), attr: 'side' }), - _react2.default.createElement(_components.Radio, { - label: _('Mirror Axis'), - attr: 'mirror', - options: [{ label: _('On'), value: 'ticks' }, { label: _('Off'), value: false }] - }) - ) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Grid Lines'), attr: 'showgrid' }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'showgrid', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true, - defaultOpt: true - }, - _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'gridwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'gridcolor' }), - _react2.default.createElement(_components.Radio, { - label: _('Grid Spacing'), - attr: 'tickmode', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }] - }), - _react2.default.createElement(_components.DTicks, { label: _('Step Offset'), attr: 'tick0' }), - _react2.default.createElement(_components.DTicks, { label: _('Step Size'), attr: 'dtick' }), - _react2.default.createElement(_components.NTicks, { label: _('Max Number of Lines'), attr: 'nticks' }) - ) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Zero Line'), attr: 'zeroline' }, - _react2.default.createElement(_components.Radio, { - attr: 'zeroline', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'zerolinewidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'zerolinecolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Axis Background'), attr: 'showbackground' }, - _react2.default.createElement(_components.Radio, { - attr: 'showbackground', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'backgroundcolor' }) - ) - ), - _react2.default.createElement( - _components.AxesFold, - { name: _('Tick Labels'), axisFilter: function axisFilter(axis) { - return !axis._subplot.includes('geo'); - } }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Tick Labels'), attr: 'showticklabels' }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'showticklabels', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true, - defaultOpt: true - }, - _react2.default.createElement(_components.AxisSide, { label: _('Position'), attr: 'side' }), - _react2.default.createElement(_components.Radio, { - label: _('Auto margins'), - attr: 'automargin', - options: [{ label: _('True'), value: true }, { label: _('False'), value: false }] - }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'tickfont.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'tickfont.size', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'tickfont.color' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Angle'), - attr: 'tickangle', - clearable: false, - options: [{ label: _('Auto'), value: 'auto' }, { label: _('45'), value: 45 }, { label: _('90'), value: 90 }, { label: _('135'), value: 135 }, { label: _('180'), value: 180 }] - }), - _react2.default.createElement(_components.TickFormat, { - label: _('Label Format'), - attr: 'tickformat', - dafaultOpt: '', - clearable: false - }), - _react2.default.createElement(_components.Radio, { - label: _('Separate Thousands'), - attr: 'separatethousands', - options: [{ label: _('True'), value: true }, { label: _('False'), value: false }] - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Exponents'), - attr: 'exponentformat', - clearable: false, - options: [{ label: _('None'), value: '000' }, { label: _('e+6'), value: 'e' }, { label: _('E+6'), value: 'E' }, { label: _('x10^6'), value: 'power' }, { label: _('k/M/G'), value: 'SI' }, { label: _('k/M/B'), value: 'B' }] - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Show Exponents'), - attr: 'showexponent', - clearable: false, - options: [{ label: _('All'), value: 'all' }, { label: _('First'), value: 'first' }, { label: _('Last'), value: 'last' }, { label: _('None'), value: 'none' }] - }), - _react2.default.createElement(_components.DropdownCustom, { - label: _('Prefix'), - attr: 'tickprefix', - options: [{ label: _('None'), value: '' }, { label: _('x'), value: 'x' }, { label: _('$'), value: '$' }, { label: _('#'), value: '#' }, { label: _('@'), value: '@' }, { label: _('Custom'), value: 'custom' }], - customOpt: 'custom', - dafaultOpt: '', - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Show Prefix'), - attr: 'showtickprefix', - options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None'), value: 'none' }] - }), - _react2.default.createElement(_components.DropdownCustom, { - label: _('Suffix'), - attr: 'ticksuffix', - options: [{ label: _('None'), value: '' }, { label: _('C'), value: 'C' }, { label: _('%'), value: '%' }, { label: _('^'), value: '^' }, { label: _('Custom'), value: 'custom' }], - customOpt: 'custom', - dafaultOpt: '', - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Show Suffix'), - attr: 'showticksuffix', - options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None'), value: 'none' }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Tick Spacing'), - attr: 'tickmode', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }] - }), - _react2.default.createElement(_components.DTicks, { label: _('Step Offset'), attr: 'tick0' }), - _react2.default.createElement(_components.DTicks, { label: _('Step Size'), attr: 'dtick' }), - _react2.default.createElement(_components.NTicks, { label: _('Max Number of Labels'), attr: 'nticks' }) - ) - ) - ), - _react2.default.createElement( - _components.AxesFold, - { name: _('Tick Markers'), axisFilter: function axisFilter(axis) { - return !axis._subplot.includes('geo'); - } }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Tick Markers'), attr: 'ticks' }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'ticks', - options: [{ label: _('Inside'), value: 'inside' }, { label: _('Outside'), value: 'outside' }, { label: _('Hide'), value: '' }], - showOn: ['inside', 'outside'], - defaultOpt: 'Outside' - }, - _react2.default.createElement(_components.AxisSide, { label: _('Position'), attr: 'side' }), - _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: 'ticklen', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'tickwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'tickcolor' }), - _react2.default.createElement(_components.Radio, { - label: _('Tick Spacing'), - attr: 'tickmode', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }] - }), - _react2.default.createElement(_components.DTicks, { label: _('Step Offset'), attr: 'tick0' }), - _react2.default.createElement(_components.DTicks, { label: _('Step Size'), attr: 'dtick' }), - _react2.default.createElement(_components.NTicks, { label: _('Max Number of Markers'), attr: 'nticks' }) - ) - ) - ), - _react2.default.createElement( - _components.AxesFold, - { name: _('Range Slider'), axisFilter: function axisFilter(axis) { - return axis._subplot.includes('xaxis'); - } }, - _react2.default.createElement(_components.RangesliderVisible, { - attr: 'rangeslider.visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.NumericFraction, { label: _('Height'), attr: 'rangeslider.thickness' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'rangeslider.bgcolor' }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'rangeslider.borderwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'rangeslider.bordercolor' }) - ), - _react2.default.createElement( - _components.AxesFold, - { - name: _('Timescale Buttons'), - axisFilter: function axisFilter(axis) { - return axis._subplot.includes('xaxis') && axis.type === 'date'; - } - }, - _react2.default.createElement(_components.Radio, { - attr: 'rangeselector.visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement( - _components.RangeSelectorAccordion, - null, - _react2.default.createElement(_components.TextEditor, { attr: 'label', label: _('Label'), show: true }), - _react2.default.createElement(_components.Numeric, { label: _('Count'), attr: 'count' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Step'), - attr: 'step', - clearable: false, - options: [{ label: _('Year'), value: 'year' }, { label: _('Month'), value: 'month' }, { label: _('Day'), value: 'day' }, { label: _('Hour'), value: 'hour' }, { label: _('Minute'), value: 'minute' }, { label: _('Second'), value: 'second' }, { label: _('All'), value: 'all' }] - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Stepmode'), - attr: 'stepmode', - clearable: false, - options: [{ label: _('To Date'), value: 'todate' }, { label: _('Backward'), value: 'backward' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Text') }, - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'rangeselector.font.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'rangeselector.font.size', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'rangeselector.font.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Style') }, - _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'rangeselector.bgcolor' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Active Color'), attr: 'rangeselector.activecolor' }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'rangeselector.borderwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'rangeselector.bordercolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'rangeselector.xanchor', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Position'), step: 0.02, attr: 'rangeselector.x' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'rangeselector.yanchor', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Position'), step: 0.02, attr: 'rangeselector.y' }) - ) - ), - _react2.default.createElement( - _components.AxesFold, - { - name: _('Spike Lines'), - axisFilter: function axisFilter(axis) { - return !(axis._subplot.includes('ternary') || axis._subplot.includes('polar') || axis._subplot.includes('geo')); - } - }, - _react2.default.createElement(_components.Radio, { - attr: 'showspikes', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Radio, { - attr: 'spikesides', - label: _('Show Sides'), - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Thickness'), attr: 'spikethickness', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'spikecolor' }) - ) - ); - } - }]); - - return StyleAxesPanel; -}(_react.Component); - -StyleAxesPanel.contextTypes = { - fullLayout: _propTypes2.default.object, - localize: _propTypes2.default.func -}; - -exports.default = StyleAxesPanel; -//# sourceMappingURL=StyleAxesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleAxesPanel.js.map b/lib/default_panels/StyleAxesPanel.js.map deleted file mode 100644 index c76abb537..000000000 --- a/lib/default_panels/StyleAxesPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleAxesPanel.js"],"names":["StyleAxesPanel","_","context","localize","axis","_name","includes","_subplot","label","value","type","Component","contextTypes","fullLayout","PropTypes","object","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;IAsBMA,c;;;;;;;;;;;6BACK;AAAA,UACUC,CADV,GACe,KAAKC,OADpB,CACAC,QADA;;AAEP,aACE;AAAC,+BAAD;AAAA;AACE;AAAC,8BAAD;AAAA;AACE,kBAAMF,EAAE,QAAF,CADR;AAEE,wBAAY;AAAA,qBAAQ,EAAEG,KAAKC,KAAL,CAAWC,QAAX,CAAoB,SAApB,KAAkCF,KAAKG,QAAL,CAAcD,QAAd,CAAuB,KAAvB,CAApC,CAAR;AAAA;AAFd;AAIE,wCAAC,sBAAD,IAAY,MAAK,OAAjB,GAJF;AAKE,wCAAC,wBAAD,IAAc,OAAOL,EAAE,UAAF,CAArB,EAAoC,MAAK,kBAAzC,GALF;AAME,wCAAC,mBAAD,IAAS,OAAOA,EAAE,WAAF,CAAhB,EAAgC,MAAK,gBAArC,EAAsD,OAAM,IAA5D,GANF;AAOE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,YAAF,CAApB,EAAqC,MAAK,iBAA1C;AAPF,SADF;AAWE;AAAC,8BAAD;AAAA,YAAU,MAAMA,EAAE,OAAF,CAAhB;AACE;AAAC,qCAAD;AAAA,cAAe,MAAMA,EAAE,OAAF,CAArB,EAAiC,MAAK,WAAtC;AACE,0CAAC,oBAAD;AACE,oBAAK,MADP;AAEE,qBAAOA,EAAE,MAAF,CAFT;AAGE,yBAAW,KAHb;AAIE,uBAAS,CACP,EAACO,OAAOP,EAAE,QAAF,CAAR,EAAqBQ,OAAO,QAA5B,EADO,EAEP,EA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X,YAdF;AAoBE,wCAAC,mBAAD,IAAS,OAAOR,EAAE,WAAF,CAAhB,EAAgC,MAAK,gBAArC,EAAsD,OAAM,IAA5D,GApBF;AAqBE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,YAArC;AArBF;AAjWF,OADF;AA2XD;;;;EA9X0BU,gB;;AAiY7BX,eAAeY,YAAf,GAA8B;AAC5BC,cAAYC,oBAAUC,MADM;AAE5BZ,YAAUW,oBAAUE;AAFQ,CAA9B;;kBAKehB,c","file":"StyleAxesPanel.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {\n AxesRange,\n DTicks,\n NTicks,\n ColorPicker,\n Dropdown,\n FontSelector,\n Numeric,\n NumericFraction,\n Radio,\n TextEditor,\n PlotlySection,\n LayoutPanel,\n AxesFold,\n AxisSide,\n RangesliderVisible,\n RangeSelectorAccordion,\n VisibilitySelect,\n DropdownCustom,\n TickFormat,\n} from '../components';\n\nclass StyleAxesPanel extends Component {\n render() {\n const {localize: _} = this.context;\n return (\n \n !(axis._name.includes('angular') || axis._subplot.includes('geo'))}\n >\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n !axis._subplot.includes('geo')}>\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n\n \n \n \n \n \n \n !axis._subplot.includes('geo')}>\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n axis._subplot.includes('xaxis')}>\n \n \n \n \n \n \n\n axis._subplot.includes('xaxis') && axis.type === 'date'}\n >\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n !(\n axis._subplot.includes('ternary') ||\n axis._subplot.includes('polar') ||\n axis._subplot.includes('geo')\n )\n }\n >\n \n \n\n \n \n \n \n );\n }\n}\n\nStyleAxesPanel.contextTypes = {\n fullLayout: PropTypes.object,\n localize: PropTypes.func,\n};\n\nexport default StyleAxesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleColorbarsPanel.js b/lib/default_panels/StyleColorbarsPanel.js deleted file mode 100644 index 0f24254c3..000000000 --- a/lib/default_panels/StyleColorbarsPanel.js +++ /dev/null @@ -1,267 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.traceHasColorbar = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// import PropTypes from 'prop-types'; - -var traceHasColorbar = exports.traceHasColorbar = function traceHasColorbar(trace, fullTrace) { - return fullTrace.marker && fullTrace.marker.showscale !== undefined || // eslint-disable-line no-undefined - fullTrace.showscale !== undefined; -}; // eslint-disable-line no-undefined - -var StyleColorBarsPanel = function StyleColorBarsPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.TraceAccordion, - { traceFilterCondition: traceHasColorbar }, - ['', 'marker.'].map(function (prefix) { - return _react2.default.createElement( - _components.VisibilitySelect, - { - attr: prefix + 'showscale', - key: 'x' + prefix, - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true - }, - _react2.default.createElement( - _components.PlotlyPanel, - { key: prefix + ' panel' }, - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Title') }, - _react2.default.createElement(_components.TextEditor, { attr: prefix + 'colorbar.title' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Location'), - attr: prefix + 'colorbar.titleside', - options: [{ label: _('Top'), value: 'top' }, { label: _('Right'), value: 'right' }, { label: _('Bottom'), value: 'bottom' }] - }), - _react2.default.createElement(_components.FontSelector, { - label: _('Typeface'), - attr: prefix + 'colorbar.titlefont.family' - }), - _react2.default.createElement(_components.Numeric, { - label: _('Font Size'), - attr: prefix + 'colorbar.titlefont.size', - units: 'px' - }), - _react2.default.createElement(_components.ColorPicker, { - label: _('Font Color'), - attr: prefix + 'colorbar.titlefont.color' - }) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Size and Positioning') }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Size'), attr: prefix + 'colorbar.len' }, - _react2.default.createElement(_components.Numeric, { label: _('Height'), attr: prefix + 'colorbar.len' }), - _react2.default.createElement(_components.Radio, { - attr: prefix + 'colorbar.lenmode', - options: [{ label: _('Fraction of Plot'), value: 'fraction' }, { label: _('Pixels'), value: 'pixels' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: prefix + 'colorbar.thickness' }), - _react2.default.createElement(_components.Radio, { - attr: prefix + 'colorbar.thicknessmode', - options: [{ label: _('Fraction of Plot'), value: 'fraction' }, { label: _('Pixels'), value: 'pixels' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Positioning'), attr: prefix + 'colorbar.x' }, - _react2.default.createElement(_components.Numeric, { - label: _('Position'), - attr: prefix + 'colorbar.x', - showSlider: true, - step: 0.02 - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor'), - attr: prefix + 'colorbar.xanchor', - options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Positioning'), attr: prefix + 'colorbar.y' }, - _react2.default.createElement(_components.Numeric, { - label: _('Position'), - attr: prefix + 'colorbar.y', - showSlider: true, - step: 0.02 - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor'), - attr: prefix + 'colorbar.yanchor', - options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Padding'), attr: prefix + 'colorbar.xpad' }, - _react2.default.createElement(_components.Numeric, { label: _('Vertical'), attr: prefix + 'colorbar.ypad', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Horizontal'), attr: prefix + 'colorbar.xpad', units: 'px' }) - ) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Labels') }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: prefix + 'colorbar.showticklabels', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true, - defaultOpt: true - }, - _react2.default.createElement(_components.FontSelector, { - label: _('Typeface'), - attr: prefix + 'colorbar.tickfont.family' - }), - _react2.default.createElement(_components.Numeric, { - label: _('Font Size'), - attr: prefix + 'colorbar.tickfont.size', - units: 'px' - }), - _react2.default.createElement(_components.ColorPicker, { - label: _('Font Color'), - attr: prefix + 'colorbar.tickfont.color' - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Angle'), - attr: prefix + 'colorbar.tickangle', - clearable: false, - options: [{ label: _('Auto'), value: 'auto' }, { label: _('45'), value: 45 }, { label: _('90'), value: 90 }, { label: _('135'), value: 135 }, { label: _('180'), value: 180 }] - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Exponents'), - attr: prefix + 'colorbar.exponentformat', - clearable: false, - options: [{ label: _('None'), value: '000' }, { label: _('e+6'), value: 'e' }, { label: _('E+6'), value: 'E' }, { label: _('x10^6'), value: 'power' }, { label: _('k/M/G'), value: 'SI' }, { label: _('k/M/B'), value: 'B' }] - }), - _react2.default.createElement(_components.DropdownCustom, { - label: _('Label Prefix'), - attr: prefix + 'colorbar.tickprefix', - options: [{ label: _('None'), value: '' }, { label: _('x'), value: 'x' }, { label: _('$'), value: '$' }, { label: _('#'), value: '#' }, { label: _('@'), value: '@' }, { label: _('Custom'), value: 'custom' }], - customOpt: 'custom', - dafaultOpt: '', - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Show Prefix'), - attr: prefix + 'colorbar.showtickprefix', - options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None label'), value: 'none' }] - }), - _react2.default.createElement(_components.DropdownCustom, { - label: _('Label Suffix'), - attr: prefix + 'colorbar.ticksuffix', - options: [{ label: _('None'), value: '' }, { label: _('C'), value: 'C' }, { label: _('%'), value: '%' }, { label: _('^'), value: '^' }, { label: _('Custom'), value: 'custom' }], - customOpt: 'custom', - dafaultOpt: '', - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Show Suffix'), - attr: prefix + 'colorbar.showticksuffix', - options: [{ label: _('Every label'), value: 'all' }, { label: _('First label'), value: 'first' }, { label: _('Last label'), value: 'last' }, { label: _('None label'), value: 'none' }] - }), - _react2.default.createElement(_components.Radio, { - attr: prefix + 'colorbar.tickmode', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }], - label: _('Tick spacing') - }), - _react2.default.createElement(_components.Numeric, { label: _('Step Offset'), attr: prefix + 'colorbar.tick0' }), - _react2.default.createElement(_components.Numeric, { label: _('Step Size'), attr: prefix + 'colorbar.dtick' }), - _react2.default.createElement(_components.Numeric, { - label: _('Max Number of Labels'), - attr: prefix + 'colorbar.nticks' - }) - ) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Ticks') }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: prefix + 'colorbar.ticks', - options: [{ label: _('Inside'), value: 'inside' }, { label: _('Outside'), value: 'outside' }, { label: _('Hide'), value: '' }], - showOn: ['inside', 'outside'], - defaultOpt: '' - }, - _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: prefix + 'colorbar.ticklen', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: prefix + 'colorbar.tickwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: prefix + 'colorbar.tickcolor' }), - _react2.default.createElement(_components.Radio, { - attr: prefix + 'colorbar.tickmode', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Custom'), value: 'linear' }], - label: _('Tick spacing') - }), - _react2.default.createElement(_components.Numeric, { label: _('Step Offset'), attr: prefix + 'colorbar.tick0' }), - _react2.default.createElement(_components.Numeric, { label: _('Step Size'), attr: prefix + 'colorbar.dtick' }), - _react2.default.createElement(_components.Numeric, { - label: _('Max Number of Labels'), - attr: prefix + 'colorbar.nticks' - }) - ) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Borders and Background') }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Color Bar'), attr: prefix + 'colorbar.outlinewidth' }, - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: prefix + 'colorbar.outlinewidth' }), - _react2.default.createElement(_components.ColorPicker, { - label: _('Border Color'), - attr: prefix + 'colorbar.outlinecolor' - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { - name: _('Color Bar Container'), - attr: prefix + 'colorbar.bgcolor' - }, - _react2.default.createElement(_components.ColorPicker, { - label: _('Background Color'), - attr: prefix + 'colorbar.bgcolor' - }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: prefix + 'colorbar.borderwidth' }), - _react2.default.createElement(_components.ColorPicker, { - label: _('Border Color'), - attr: prefix + 'colorbar.bordercolor' - }) - ) - ) - ) - ); - }) - ); - } - ); -}; - -// StyleColorBarsPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = StyleColorBarsPanel; -//# sourceMappingURL=StyleColorbarsPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleColorbarsPanel.js.map b/lib/default_panels/StyleColorbarsPanel.js.map deleted file mode 100644 index 18dac38a0..000000000 --- a/lib/default_panels/StyleColorbarsPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleColorbarsPanel.js"],"names":["traceHasColorbar","trace","fullTrace","marker","showscale","undefined","StyleColorBarsPanel","_","localize","map","prefix","label","value"],"mappings":";;;;;;;AAAA;;;;AAGA;;AAcA;;;;AAhBA;;AAkBO,IAAMA,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BAAF,CAAlB;AACE;AAAC,2CAAD;AAAA,oBAAe,MAAMA,EAAE,WAAF,CAArB,EAAqC,MAAMG,SAAS,uBAApD;AACE,gDAAC,mBAAD,IAAS,OAAOH,EAAE,cAAF,CAAhB,EAAmC,MAAMG,SAAS,uBAAlD,GADF;AAEE,gDAAC,uBAAD;AACE,2BAAOH,EAAE,cAAF,CADT;AAEE,0BAAMG,SAAS;AAFjB;AAFF,iBADF;AAQE;AAAC,2CAAD;AAAA;AACE,0BAAMH,EAAE,qBAAF,CADR;AAEE,0BAAMG,SAAS;AAFjB;AAIE,gDAAC,uBAAD;AACE,2BAAOH,EAAE,kBAAF,CADT;AAEE,0BAAMG,SAAS;AAFjB,oBAJF;AAQE,gDAAC,mBAAD,IAAS,OAAOH,EAAE,cAAF,CAAhB,EAAmC,MAAMG,SAAS,sBAAlD,GARF;AASE,gDAAC,uBAAD;AACE,2BAAOH,EAAE,cAAF,CADT;AAEE,0BAAMG,SAAS;AAFjB;AATF;AARF;AAvOF;AANF,WADF;AAwQD,SAzQA;AADH,OADD;AAAA;AADH,GADF;AAkRD,CAnRD;;AAqRA;AACA;AACA;;kBAEeJ,mB","file":"StyleColorbarsPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\n\nimport {\n Radio,\n TextEditor,\n TraceAccordion,\n Numeric,\n PlotlyFold,\n PlotlyPanel,\n PlotlySection,\n Dropdown,\n DropdownCustom,\n FontSelector,\n ColorPicker,\n VisibilitySelect,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nexport const traceHasColorbar = (trace, fullTrace) =>\n (fullTrace.marker && fullTrace.marker.showscale !== undefined) || // eslint-disable-line no-undefined\n fullTrace.showscale !== undefined; // eslint-disable-line no-undefined\n\nconst StyleColorBarsPanel = () => {\n return (\n \n {({localize: _}) => (\n \n {['', 'marker.'].map(prefix => {\n return (\n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n );\n })}\n \n )}\n \n );\n};\n\n// StyleColorBarsPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleColorBarsPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleImagesPanel.js b/lib/default_panels/StyleImagesPanel.js deleted file mode 100644 index d58017479..000000000 --- a/lib/default_panels/StyleImagesPanel.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// import PropTypes from 'prop-types'; -var StyleImagesPanel = function StyleImagesPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.ImageAccordion, - { canAdd: true }, - _react2.default.createElement(_components.Radio, { - attr: 'visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Dropzone, { attr: 'source', fileType: _('image'), show: true }), - _react2.default.createElement(_components.Dropdown, { - label: _('Aspect Ratio'), - attr: 'sizing', - options: [{ label: _('Contain'), value: 'contain' }, { label: _('Fill'), value: 'fill' }, { label: _('Stretch'), value: 'stretch' }], - clearable: false - }), - _react2.default.createElement(_components.Radio, { - label: _('Relative to Grid'), - attr: 'layer', - options: [{ label: _('Below'), value: 'below' }, { label: _('Above'), value: 'above' }] - }), - _react2.default.createElement(_components.PositioningNumeric, { attr: 'sizex', label: _('Width') }), - _react2.default.createElement(_components.PositioningNumeric, { attr: 'sizey', label: _('Height') }), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'xanchor', - options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] - }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'x' }), - _react2.default.createElement(_components.PositioningRef, { label: _('Relative To'), attr: 'xref' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'yanchor', - options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] - }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'y' }), - _react2.default.createElement(_components.PositioningRef, { label: _('Relative To'), attr: 'yref' }) - ) - ); - } - ); -}; - -// StyleImagesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = StyleImagesPanel; -//# sourceMappingURL=StyleImagesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleImagesPanel.js.map b/lib/default_panels/StyleImagesPanel.js.map deleted file mode 100644 index 4dfc6b84a..000000000 --- a/lib/default_panels/StyleImagesPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleImagesPanel.js"],"names":["StyleImagesPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AASA;;;;AAVA;AAYA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,kCAAD;AAAA,UAAgB,YAAhB;AACE,sCAAC,iBAAD;AACE,gBAAK,SADP;AAEE,mBAAS,CAAC,EAACC,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC;AAFX,UADF;AA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;AAYE,wCAAC,0BAAD,IAAgB,OAAOA,EAAE,aAAF,CAAvB,EAAyC,MAAK,MAA9C;AAZF,SAzBF;AAwCE;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,sBAAF,CAArB;AACE,wCAAC,oBAAD;AACE,mBAAOA,EAAE,cAAF,CADT;AAEE,uBAAW,KAFb;AAGE,kBAAK,SAHP;AAIE,qBAAS,CACP,EAACE,OAAOF,EAAE,KAAF,CAAR,EAAkBG,OAAO,KAAzB,EADO,EAEP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAFO,EAGP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAHO;AAJX,YADF;AAWE,wCAAC,8BAAD,IAAoB,OAAOH,EAAE,UAAF,CAA3B,EAA0C,MAAK,GAA/C,GAXF;AAYE,wCAAC,0BAAD,IAAgB,OAAOA,EAAE,aAAF,CAAvB,EAAyC,MAAK,MAA9C;AAZF;AAxCF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AA8DA;AACA;AACA;;kBAEeD,gB","file":"StyleImagesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ImageAccordion,\n Radio,\n Dropzone,\n PositioningNumeric,\n PlotlySection,\n PositioningRef,\n Dropdown,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleImagesPanel = () => (\n \n {({localize: _}) => (\n \n \n\n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n )}\n \n);\n\n// StyleImagesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleImagesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleLayoutPanel.js b/lib/default_panels/StyleLayoutPanel.js deleted file mode 100644 index 52ff629a3..000000000 --- a/lib/default_panels/StyleLayoutPanel.js +++ /dev/null @@ -1,157 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _derived = require('../components/fields/derived'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var StyleLayoutPanel = function StyleLayoutPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.LayoutPanel, - null, - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Defaults') }, - _react2.default.createElement(_components.ColorPicker, { label: _('Plot Background'), attr: 'plot_bgcolor' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Margin Color'), attr: 'paper_bgcolor' }), - _react2.default.createElement(_components.ColorwayPicker, { label: _('Base Colors'), attr: 'colorway' }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family', clearable: false }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'font.size', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'font.color' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Number format'), - attr: 'separators', - options: [{ label: _('1,234.56'), value: '.,' }, { label: _('1 234.56'), value: ', ' }, { label: _('1 234,56'), value: ', ' }, { label: _('1.234,56'), value: ',.' }], - clearable: false - }) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Title') }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Title'), attr: 'title' }, - _react2.default.createElement(_components.TextEditor, { attr: 'title' }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'titlefont.family', clearable: false }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'titlefont.size', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'titlefont.color' }) - ) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Modebar') }, - _react2.default.createElement(_components.Radio, { - label: _('Orientation'), - attr: 'modebar.orientation', - options: [{ label: _('Horizontal'), value: 'h' }, { label: _('Vertical'), value: 'v' }] - }), - _react2.default.createElement(_components.ColorPicker, { label: _('Icon Color'), attr: 'modebar.color' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Active Icon Color'), attr: 'modebar.activecolor' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'modebar.bgcolor' }) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Layout') }, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'autosize', - label: _('Size'), - options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }], - showOn: false, - defaultOpt: true - }, - _react2.default.createElement(_components.Numeric, { label: _('Fixed Width'), attr: 'width', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Fixed height'), attr: 'height', units: 'px' }) - ), - _react2.default.createElement(_components.Numeric, { label: _('Top'), attr: 'margin.t', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Bottom'), attr: 'margin.b', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Left'), attr: 'margin.l', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Right'), attr: 'margin.r', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Padding'), attr: 'margin.pad', units: 'px' }) - ), - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Interactions') }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Drag'), attr: 'dragmode' }, - _react2.default.createElement(_components.Dropdown, { - label: _('Mode'), - attr: 'dragmode', - options: [{ label: _('Zoom'), value: 'zoom' }, { label: _('Select'), value: 'select' }, { label: _('Pan'), value: 'pan' }, { label: _('Lasso'), value: 'lasso' }, { label: _('Orbit'), value: 'orbit' }, { label: _('Turntable'), value: 'turntable' }], - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Select Direction'), - attr: 'selectdirection', - options: [{ label: _('Any'), value: 'any' }, { label: _('Horizontal'), value: 'h' }, { label: _('Vertical'), value: 'v' }, { label: _('Diagonal'), value: 'd' }], - clearable: false - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Click'), attr: 'clickmode' }, - _react2.default.createElement(_components.Flaglist, { - label: _('Mode'), - attr: 'clickmode', - options: [{ label: _('Click Event'), value: 'event' }, { label: _('Select Data Point'), value: 'select' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Hover') }, - _react2.default.createElement( - _components.HovermodeDropdown, - { label: _('Mode'), attr: 'hovermode' }, - _react2.default.createElement(_derived.HoverColor, { - label: _('Background Color'), - attr: 'hoverlabel.bgcolor', - defaultColor: '#FFF', - handleEmpty: true - }), - _react2.default.createElement(_derived.HoverColor, { - label: _('Border Color'), - attr: 'hoverlabel.bordercolor', - defaultColor: '#000', - handleEmpty: true - }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'hoverlabel.font.family', clearable: true }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'hoverlabel.font.size' }), - _react2.default.createElement(_derived.HoverColor, { - label: _('Font Color'), - attr: 'hoverlabel.font.color', - defaultColor: '#000', - handleEmpty: true - }) - ) - ) - ) - ); - } - ); -}; - -// StyleLayoutPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -// import PropTypes from 'prop-types'; -exports.default = StyleLayoutPanel; -//# sourceMappingURL=StyleLayoutPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleLayoutPanel.js.map b/lib/default_panels/StyleLayoutPanel.js.map deleted file mode 100644 index 548f8cee2..000000000 --- a/lib/default_panels/StyleLayoutPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleLayoutPanel.js"],"names":["StyleLayoutPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAeA;;AACA;;;;AAEA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aAC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JF;AAfF;AADF;AArCF;AAzDF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AA+HA;AACA;AACA;;AApJA;kBAsJeD,gB","file":"StyleLayoutPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n ColorwayPicker,\n Dropdown,\n FontSelector,\n PlotlyFold,\n Numeric,\n TextEditor,\n PlotlySection,\n LayoutPanel,\n VisibilitySelect,\n HovermodeDropdown,\n Flaglist,\n Radio,\n} from '../components';\nimport {HoverColor} from '../components/fields/derived';\nimport {EditorControlsContext} from '../context';\n\nconst StyleLayoutPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleLayoutPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleLayoutPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleLegendPanel.js b/lib/default_panels/StyleLegendPanel.js deleted file mode 100644 index 0fc3dcdfb..000000000 --- a/lib/default_panels/StyleLegendPanel.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// import PropTypes from 'prop-types'; -var StyleLegendPanel = function StyleLegendPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.TraceRequiredPanel, - null, - _react2.default.createElement( - _components.PlotlyFold, - { name: _('Legend') }, - _react2.default.createElement(_components.Radio, { - attr: 'showlegend', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Text') }, - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'legend.font.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'legend.font.size', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'legend.font.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Legend Box') }, - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'legend.borderwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Border Color'), attr: 'legend.bordercolor' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Background Color'), attr: 'legend.bgcolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'legend.xanchor', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Position'), showSlider: true, step: 0.02, attr: 'legend.x' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'legend.yanchor', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Position'), showSlider: true, step: 0.02, attr: 'legend.y' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Orientation') }, - _react2.default.createElement(_components.Radio, { - attr: 'legend.orientation', - options: [{ label: _('Vertical'), value: 'v' }, { label: _('Horizontal'), value: 'h' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Trace Order') }, - _react2.default.createElement(_components.Dropdown, { - attr: 'legend.traceorder', - options: [{ label: _('Normal'), value: 'normal' }, { label: _('Reversed'), value: 'reversed' }, { label: _('Grouped'), value: 'grouped' }, { label: _('Reversed and Grouped'), value: 'reversed+grouped' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Gap Between Groups'), attr: 'legend.tracegroupgap', units: 'px' }) - ) - ) - ); - } - ); -}; - -// StyleLegendPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = StyleLegendPanel; -//# sourceMappingURL=StyleLegendPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleLegendPanel.js.map b/lib/default_panels/StyleLegendPanel.js.map deleted file mode 100644 index f669d1a29..000000000 --- a/lib/default_panels/StyleLegendPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleLegendPanel.js"],"names":["StyleLegendPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAUA;;;;AAXA;AAaA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,sCAAD;AAAA;AACE;AAAC,gCAAD;AAAA,YAAY,MAAMD,EAAE,QAAF,CAAlB;AACE,wCAAC,iBAAD;AACE,kBAAK,YADP;AAEE,qBAAS,CAAC,EAACE,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC;AAFX,YADF;AAKE;AAAC,qCAAD;AAAA,cAAe,MAAMH,EAAE,MAAF,CAArB;AACE,0CAAC,wBAAD,IAAc,OAAOA,EAAE,UAAF,CAArB,EAAoC,MAAK,oBAAzC,GADF;AAEE,0CAAC,mBAAD,IAAS,OAAOA,EAAE,MAAF,CAAhB,EAA2B,MAAK,kBAAhC,EAAmD,OAAM,IAAzD,GAFF;AAGE,0CAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,E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BG,OAAO,QAA5B,EAHO,EAIP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAJO;AAJX,cADF;AAYE,0CAAC,mBAAD,IAAS,OAAOH,EAAE,UAAF,CAAhB,EAA+B,gBAA/B,EAA0C,MAAM,IAAhD,EAAsD,MAAK,UAA3D;AAZF,WA7BF;AA2CE;AAAC,qCAAD;AAAA,cAAe,MAAMA,EAAE,aAAF,CAArB;AACE,0CAAC,iBAAD;AACE,oBAAK,oBADP;AAEE,uBAAS,CAAC,EAACE,OAAOF,EAAE,UAAF,CAAR,EAAuBG,OAAO,GAA9B,EAAD,EAAqC,EAACD,OAAOF,EAAE,YAAF,CAAR,EAAyBG,OAAO,GAAhC,EAArC;AAFX;AADF,WA3CF;AAiDE;AAAC,qCAAD;AAAA,cAAe,MAAMH,EAAE,aAAF,CAArB;AACE,0CAAC,oBAAD;AACE,oBAAK,mBADP;AAEE,uBAAS,CACP,EAACE,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EADO,EAEP,EAACD,OAAOF,EAAE,UAAF,CAAR,EAAuBG,OAAO,UAA9B,EAFO,EAGP,EAACD,OAAOF,EAAE,SAAF,CAAR,EAAsBG,OAAO,SAA7B,EAHO,EAIP,EAACD,OAAOF,EAAE,sBAAF,CAAR,EAAmCG,OAAO,kBAA1C,EAJO;AAFX,cADF;AAUE,0CAAC,mBAAD,IAAS,OAAOH,EAAE,oBAAF,CAAhB,EAAyC,MAAK,sBAA9C,EAAqE,OAAM,IAA3E;AAVF;AAjDF;AADF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AAuEA;AACA;AACA;;kBAEeD,gB","file":"StyleLegendPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n FontSelector,\n PlotlyFold,\n Numeric,\n Radio,\n PlotlySection,\n Dropdown,\n TraceRequiredPanel,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleLegendPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleLegendPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleLegendPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleNotesPanel.js b/lib/default_panels/StyleNotesPanel.js deleted file mode 100644 index 771336693..000000000 --- a/lib/default_panels/StyleNotesPanel.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// import PropTypes from 'prop-types'; -var StyleNotesPanel = function StyleNotesPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.AnnotationAccordion, - { canAdd: true }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Note Text'), attr: 'text' }, - _react2.default.createElement(_components.TextEditor, { attr: 'text' }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'font.size', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Font Color'), attr: 'font.color' }), - _react2.default.createElement(_components.Numeric, { label: _('Angle'), attr: 'textangle', units: '\xB0' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Arrow') }, - _react2.default.createElement(_components.Radio, { - attr: 'showarrow', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Line Width'), attr: 'arrowwidth', units: 'px' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'arrowcolor' }), - _react2.default.createElement(_components.ArrowSelector, { label: _('Arrowhead'), attr: 'arrowhead' }), - _react2.default.createElement(_components.Numeric, { label: _('Scale'), step: 0.1, attr: 'arrowsize', units: 'px' }), - _react2.default.createElement(_components.AnnotationArrowRef, { label: _('X Offset'), attr: 'axref' }), - _react2.default.createElement(_components.AnnotationArrowRef, { label: _('Y Offset'), attr: 'ayref' }), - _react2.default.createElement(_components.Numeric, { label: _('X Vector'), attr: 'ax' }), - _react2.default.createElement(_components.Numeric, { label: _('Y Vector'), attr: 'ay' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'xanchor', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] - }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'x' }), - _react2.default.createElement(_components.AnnotationRef, { label: _('Relative To'), attr: 'xref' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Positioning') }, - _react2.default.createElement(_components.Dropdown, { - label: _('Anchor Point'), - clearable: false, - attr: 'yanchor', - options: [{ label: _('Auto'), value: 'auto' }, { label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] - }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('Position'), attr: 'y' }), - _react2.default.createElement(_components.AnnotationRef, { label: _('Relative To'), attr: 'yref' }) - ) - ); - } - ); -}; - -// StyleNotesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = StyleNotesPanel; -//# sourceMappingURL=StyleNotesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleNotesPanel.js.map b/lib/default_panels/StyleNotesPanel.js.map deleted file mode 100644 index 1a3ab4a70..000000000 --- a/lib/default_panels/StyleNotesPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleNotesPanel.js"],"names":["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1B,EADO,EAEP,EAACD,OAAOF,EAAE,KAAF,CAAR,EAAkBG,OAAO,KAAzB,EAFO,EAGP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAHO,EAIP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAJO;AAJX,YADF;AAYE,wCAAC,8BAAD,IAAoB,OAAOH,EAAE,UAAF,CAA3B,EAA0C,MAAK,GAA/C,GAZF;AAaE,wCAAC,yBAAD,IAAe,OAAOA,EAAE,aAAF,CAAtB,EAAwC,MAAK,MAA7C;AAbF;AArCF,OADD;AAAA;AADH,GADsB;AAAA,CAAxB;;AA4DA;AACA;AACA;;kBAEeD,e","file":"StyleNotesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n AnnotationArrowRef,\n AnnotationRef,\n AnnotationAccordion,\n ArrowSelector,\n ColorPicker,\n FontSelector,\n Numeric,\n Dropdown,\n PositioningNumeric,\n Radio,\n TextEditor,\n PlotlySection,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleNotesPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleNotesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleNotesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleShapesPanel.js b/lib/default_panels/StyleShapesPanel.js deleted file mode 100644 index 1f8fc52e1..000000000 --- a/lib/default_panels/StyleShapesPanel.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// import PropTypes from 'prop-types'; -var StyleShapesPanel = function StyleShapesPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.ShapeAccordion, - { canAdd: true }, - _react2.default.createElement(_components.Radio, { - attr: 'visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Radio, { - attr: 'type', - options: [{ label: _('Line'), value: 'line' }, { label: _('Rectangle'), value: 'rect' }, { label: _('Ellipse'), value: 'circle' }] - }), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Boundaries') }, - _react2.default.createElement(_components.PositioningRef, { label: _('Relative to'), attr: 'xref' }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('Start Point'), attr: 'x0' }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('End Point'), attr: 'x1' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Boundaries') }, - _react2.default.createElement(_components.PositioningRef, { label: _('Relative to'), attr: 'yref' }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('Start Point'), attr: 'y0' }), - _react2.default.createElement(_components.PositioningNumeric, { label: _('End Point'), attr: 'y1' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Lines') }, - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'line.width' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'line.color' }), - _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'line.dash' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Fill') }, - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'fillcolor' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Opacity'), attr: 'opacity' }) - ) - ); - } - ); -}; - -// StyleShapesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = StyleShapesPanel; -//# sourceMappingURL=StyleShapesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleShapesPanel.js.map b/lib/default_panels/StyleShapesPanel.js.map deleted file mode 100644 index d12747e49..000000000 --- a/lib/default_panels/StyleShapesPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleShapesPanel.js"],"names":["StyleShapesPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAWA;;;;AAZA;AAcA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,kCAAD;AAAA,UAAgB,YAAhB;AACE,sCAAC,iBAAD;AACE,gBAAK,SADP;AAEE,mBAAS,CAAC,EAACC,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC;AAFX,UADF;AAKE,sCAAC,iBAAD;AACE,gBAAK,MADP;AAEE,mBAAS,CACP,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,MAA1B,EADO,EAEP,EAACD,OAAOF,EAAE,WAAF,CAAR,EAAwBG,OAAO,MAA/B,EAFO,EAGP,EAACD,OAAOF,EAAE,SAAF,CAAR,EAAsBG,OAAO,QAA7B,EAHO;AAFX,UALF;AAcE;AAAC,mCAAD;AAAA,YAAe,MAAMH,EAAE,uBAAF,CAArB;AACE,wCAAC,0BAAD,IAAgB,OAAOA,EAAE,aAAF,CAAvB,EAAyC,MAAK,MAA9C,GADF;AAEE,wCAAC,8BAAD,IAAoB,OAAOA,EAAE,aAAF,CAA3B,EAA6C,MAAK,IAAlD,GAFF;AAGE,wCAAC,8BAAD,IAAoB,OAAOA,EAAE,WAAF,CAA3B,EAA2C,MAAK,IAAhD;AAHF,SAdF;AAoBE;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,qBAAF,CAArB;AACE,wCAAC,0BAAD,IAAgB,OAAOA,EAAE,aAAF,CAAvB,EAAyC,MAAK,MAA9C,GADF;AAEE,wCAAC,8BAAD,IAAoB,OAAOA,EAAE,aAAF,CAA3B,EAA6C,MAAK,IAAlD,GAFF;AAGE,wCAAC,8BAAD,IAAoB,OAAOA,EAAE,WAAF,CAA3B,EAA2C,MAAK,IAAhD;AAHF,SApBF;AAyBE;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,OAAF,CAArB;AACE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,OAAF,CAAhB,EAA4B,MAAK,YAAjC,GADF;AAEE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,YAArC,GAFF;AAGE,wCAAC,4BAAD,IAAkB,OAAOA,EAAE,MAAF,CAAzB,EAAoC,MAAK,WAAzC;AAHF,SAzBF;AA8BE;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,MAAF,CAArB;AACE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,WAArC,GADF;AAEE,wCAAC,2BAAD,IAAiB,OAAOA,EAAE,SAAF,CAAxB,EAAsC,MAAK,SAA3C;AAFF;AA9BF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AA0CA;AACA;AACA;;kBAEeD,gB","file":"StyleShapesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ShapeAccordion,\n Radio,\n PlotlySection,\n PositioningRef,\n PositioningNumeric,\n Numeric,\n NumericFraction,\n ColorPicker,\n LineDashSelector,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleShapesPanel = () => (\n \n {({localize: _}) => (\n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleShapesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleShapesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleSlidersPanel.js b/lib/default_panels/StyleSlidersPanel.js deleted file mode 100644 index 534347bdc..000000000 --- a/lib/default_panels/StyleSlidersPanel.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// import PropTypes from 'prop-types'; -var StyleSlidersPanel = function StyleSlidersPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.SliderAccordion, - null, - _react2.default.createElement(_components.Radio, { - attr: 'visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Background') }, - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bgcolor' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Active Color'), attr: 'activebgcolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Border') }, - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'borderwidth' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bordercolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Font') }, - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'font.size' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'font.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Length'), attr: 'len' }, - _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: 'len', step: 0.02 }), - _react2.default.createElement(_components.Dropdown, { - label: _('Length Mode'), - attr: 'lenmode', - options: [{ label: _('Fraction of canvas'), value: 'fraction' }, { label: _('Pixels'), value: 'pixels' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Positioning'), attr: 'x' }, - _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'x', showSlider: true, step: 0.02 }), - _react2.default.createElement(_components.Radio, { - label: _('Anchor'), - attr: 'xanchor', - options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Positioning'), attr: 'y' }, - _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'y', showSlider: true, step: 0.02 }), - _react2.default.createElement(_components.Radio, { - label: _('Anchor'), - attr: 'yanchor', - options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Padding') }, - _react2.default.createElement(_components.Numeric, { label: _('Top'), attr: 'pad.t', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Bottom'), attr: 'pad.b', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Left'), attr: 'pad.l', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Right'), attr: 'pad.r', units: 'px' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Ticks') }, - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'tickcolor' }), - _react2.default.createElement(_components.Numeric, { label: _('Length'), attr: 'ticklen' }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'tickwidth' }) - ) - ); - } - ); -}; - -// StyleSlidersPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = StyleSlidersPanel; -//# sourceMappingURL=StyleSlidersPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleSlidersPanel.js.map b/lib/default_panels/StyleSlidersPanel.js.map deleted file mode 100644 index 827d86727..000000000 --- a/lib/default_panels/StyleSlidersPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleSlidersPanel.js"],"names":["StyleSlidersPanel","_","localize","label","value"],"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EAHO;AAHX;AAFF,SAzCF;AAqDE;AAAC,mCAAD;AAAA,YAAe,MAAMH,EAAE,SAAF,CAArB;AACE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,KAAF,CAAhB,EAA0B,MAAK,OAA/B,EAAuC,OAAM,IAA7C,GADF;AAEE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,QAAF,CAAhB,EAA6B,MAAK,OAAlC,EAA0C,OAAM,IAAhD,GAFF;AAGE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,MAAF,CAAhB,EAA2B,MAAK,OAAhC,EAAwC,OAAM,IAA9C,GAHF;AAIE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,OAAF,CAAhB,EAA4B,MAAK,OAAjC,EAAyC,OAAM,IAA/C;AAJF,SArDF;AA2DE;AAAC,mCAAD;AAAA,YAAe,MAAMA,EAAE,OAAF,CAArB;AACE,wCAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,WAArC,GADF;AAEE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,QAAF,CAAhB,EAA6B,MAAK,SAAlC,GAFF;AAGE,wCAAC,mBAAD,IAAS,OAAOA,EAAE,OAAF,CAAhB,EAA4B,MAAK,WAAjC;AAHF;AA3DF,OADD;AAAA;AADH,GADwB;AAAA,CAA1B;;AAwEA;AACA;AACA;;kBAEeD,iB","file":"StyleSlidersPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n FontSelector,\n Numeric,\n Radio,\n PlotlySection,\n Dropdown,\n SliderAccordion,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleSlidersPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleSlidersPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleSlidersPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleTracesPanel.js b/lib/default_panels/StyleTracesPanel.js deleted file mode 100644 index feca70f93..000000000 --- a/lib/default_panels/StyleTracesPanel.js +++ /dev/null @@ -1,621 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _derived = require('../components/fields/derived'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var StyleTracesPanel = function StyleTracesPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.TraceAccordion, - { canGroup: true }, - _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'name', richTextOnly: true }), - _react2.default.createElement(_components.NumericFraction, { label: _('Trace Opacity'), attr: 'opacity' }), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Legend') }, - _react2.default.createElement( - _derived.ShowInLegend, - { - label: _('Show in Legend'), - attr: 'showlegend', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true - }, - _react2.default.createElement(_components.GroupCreator, { label: _('Legend Group'), prefix: _('Group'), attr: 'legendgroup' }) - ) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Cones & Streamtubes') }, - _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'sizeref', stepmode: 'relative' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Size Mode'), - options: [{ label: _('scaled'), value: 'scaled' }, { label: _('absolute'), value: 'absolute' }], - attr: 'sizemode' - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Cone Anchor'), - options: [{ label: _('Tip'), value: 'tip' }, { label: _('Tail'), value: 'tail' }, { label: _('Center'), value: 'center' }, { label: _('Center of Mass'), value: 'cm' }], - attr: 'anchor' - }), - _react2.default.createElement(_components.Numeric, { label: _('Max Tube segments'), attr: 'maxdisplayed' }) - ), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Color'), attr: 'color' }), - _react2.default.createElement( - _components.TraceTypeSection, - { name: _('Pie Colors'), traceTypes: ['pie'], mode: 'trace' }, - _react2.default.createElement( - _components.LayoutSection, - { attr: 'name' }, - _react2.default.createElement(_components.ColorwayPicker, { label: _('Colors'), attr: 'piecolorway' }), - _react2.default.createElement(_components.Radio, { - label: _('Extended Colors'), - attr: 'extendpiecolors', - options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] - }) - ) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Pie Title'), attr: 'title' }, - _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'title' }), - _react2.default.createElement(_components.Dropdown, { - label: 'Title Position', - attr: 'titleposition', - options: [{ label: _('Top Left'), value: 'top left' }, { label: _('Top Center'), value: 'top center' }, { label: _('Top Right'), value: 'top right' }, { label: _('Middle Center'), value: 'middle center' }, { label: _('Bottom Left'), value: 'bottom left' }, { label: _('Bottom Center'), value: 'bottom center' }, { label: _('Bottom Right'), value: 'bottom right' }] - }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'titlefont.family', clearable: false }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'titlefont.size', units: 'px' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Values') }, - _react2.default.createElement(_derived.BinningDropdown, { label: _('Histogram Function'), attr: 'histfunc' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Histogram Normalization'), - options: [{ label: _('Number of Occurences'), value: '' }, { label: _('Percent'), value: 'percent' }, { label: _('Probability'), value: 'probability' }, { label: _('Density'), value: 'density' }, { label: _('Probability Density'), value: 'probability density' }], - attr: 'histnorm' - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Cumulative') }, - _react2.default.createElement(_components.Radio, { - label: _('Cumulative'), - attr: 'cumulative.enabled', - options: [{ label: _('Enabled'), value: true }, { label: _('Disabled'), value: false }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Direction'), - attr: 'cumulative.direction', - options: [{ label: _('Increasing'), value: 'increasing' }, { label: _('Decreasing'), value: 'decreasing' }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Current Bin'), - attr: 'cumulative.currentbin', - options: [{ label: _('Include'), value: 'include' }, { label: _('Exclude'), value: 'exclude' }, { label: _('Half'), value: 'half' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Header') }, - _react2.default.createElement(_components.Numeric, { label: _('Height'), attr: 'header.height' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'header.fill.color' }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'header.font.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'header.font.size' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Text Alignment'), - options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }], - attr: 'header.align' - }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Font Color'), attr: 'header.font.color' }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'header.line.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Border Color'), attr: 'header.line.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Cells') }, - _react2.default.createElement(_components.Numeric, { label: _('Height'), attr: 'cells.height' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'cells.fill.color' }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'cells.font.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'cells.font.size' }), - _react2.default.createElement(_components.Dropdown, { - label: _('Text Alignment'), - options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }], - attr: 'cells.align' - }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Font Color'), attr: 'cells.font.color' }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'cells.line.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Border Color'), attr: 'cells.line.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Display') }, - _react2.default.createElement(_components.Flaglist, { - attr: 'mode', - options: [{ label: _('Points'), value: 'markers' }, { label: _('Lines'), value: 'lines' }, { label: _('Text'), value: 'text' }] - }), - _react2.default.createElement(_components.Radio, { - attr: 'flatshading', - label: _('Flatshading'), - options: [{ label: _('Enable'), value: true }, { label: _('Disable'), value: false }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Binning') }, - _react2.default.createElement(_components.Numeric, { label: _('X Bin Start'), attr: 'xbins.start', axis: 'x' }), - _react2.default.createElement(_components.Numeric, { label: _('X Bin End'), attr: 'xbins.end', axis: 'x' }), - _react2.default.createElement(_components.Numeric, { label: _('X Bin Size'), attr: 'xbins.size', axis: 'x' }), - _react2.default.createElement(_components.Numeric, { label: _('Max X Bins'), attr: 'nbinsx' }), - _react2.default.createElement(_components.Numeric, { label: _('Y Bin Start'), attr: 'ybins.start', axis: 'y' }), - _react2.default.createElement(_components.Numeric, { label: _('Y Bin End'), attr: 'ybins.end', axis: 'y' }), - _react2.default.createElement(_components.Numeric, { label: _('Y Bin Size'), attr: 'ybins.size', axis: 'y' }), - _react2.default.createElement(_components.Numeric, { label: _('Max Y Bins'), attr: 'nbinsy' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { label: _('Bar Position') }, - _react2.default.createElement(_components.Numeric, { label: _('Base'), attr: 'base' }), - _react2.default.createElement(_components.Numeric, { label: _('Offset'), attr: 'offset' }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'width' }) - ), - _react2.default.createElement( - _components.TraceMarkerSection, - null, - _react2.default.createElement(_components.Radio, { - label: _('Order'), - attr: 'sort', - options: [{ label: _('Sorted'), value: true }, { label: _('Unsorted'), value: false }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Direction'), - attr: 'direction', - options: [{ label: _('Clockwise'), value: 'clockwise' }, { label: _('Counterclockwise'), value: 'counterclockwise' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Rotation'), attr: 'rotation' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Hole Size'), attr: 'hole' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Pull'), attr: 'pull' }), - _react2.default.createElement(_components.Dropdown, { - options: [{ label: _('Show All'), value: 'all' }, { label: _('Outliers'), value: 'outliers' }, { label: _('Suspected Outliers'), value: 'suspectedoutliers' }, { label: _('Hide'), value: false }], - attr: 'boxpoints', - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - options: [{ label: _('Show All'), value: 'all' }, { label: _('Outliers'), value: 'outliers' }, { label: _('Suspected Outliers'), value: 'suspectedoutliers' }, { label: _('Hide'), value: false }], - attr: 'points', - clearable: false - }), - _react2.default.createElement(_components.NumericFraction, { label: _('Jitter'), attr: 'jitter' }), - _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'pointpos', step: 0.1, showSlider: true }), - _react2.default.createElement(_components.MarkerColor, { suppressMultiValuedMessage: true, label: _('Color'), attr: 'marker.color' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Point Opacity'), attr: 'marker.opacity' }), - _react2.default.createElement(_components.MarkerSize, { label: _('Size'), attr: 'marker.size' }), - _react2.default.createElement(_derived.NumericReciprocal, { - label: _('Size Scale'), - attr: 'marker.sizeref', - step: 0.2, - stepmode: 'relative' - }), - _react2.default.createElement(_components.Radio, { - label: _('Size Mode'), - attr: 'marker.sizemode', - options: [{ label: _('Area'), value: 'area' }, { label: _('Diameter'), value: 'diameter' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Minimum Size'), attr: 'marker.sizemin' }), - _react2.default.createElement(_components.SymbolSelector, { label: _('Symbol'), attr: 'marker.symbol' }), - _react2.default.createElement(_components.Numeric, { label: _('Border Width'), attr: 'marker.line.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Border Color'), attr: 'marker.line.color' }), - _react2.default.createElement(_components.Numeric, { label: _('Max Number of Points'), attr: 'marker.maxdisplayed' }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { - name: _('Bar Size and Spacing'), - traceTypes: ['bar', 'histogram'], - mode: 'trace' - }, - _react2.default.createElement( - _components.LayoutSection, - { attr: 'name' }, - _react2.default.createElement(_components.Dropdown, { - label: _('Bar Mode'), - attr: 'barmode', - options: [{ label: _('Overlay'), value: 'overlay' }, { label: _('Group'), value: 'group' }, { label: _('Stack'), value: 'stack' }, { label: _('Relative'), value: 'relative' }], - clearable: false - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Normalization'), - attr: 'barnorm', - options: [{ label: _('None'), value: '' }, { label: _('Fraction'), value: 'fraction' }, { label: _('Percent'), value: 'percent' }], - clearable: false - }), - _react2.default.createElement(_components.NumericFractionInverse, { label: _('Bar Width'), attr: 'bargap' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Bar Padding'), attr: 'bargroupgap' }) - ) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { name: _('Box Size and Spacing'), traceTypes: ['box'], mode: 'trace' }, - _react2.default.createElement( - _components.LayoutSection, - { attr: 'name' }, - _react2.default.createElement(_components.Radio, { - label: _('Box Mode'), - attr: 'boxmode', - options: [{ label: _('Overlay'), value: 'overlay' }, { label: _('Group'), value: 'group' }] - }), - _react2.default.createElement(_components.NumericFractionInverse, { label: _('Box Width'), attr: 'boxgap' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Box Padding'), attr: 'boxgroupgap' }) - ) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { name: _('Violin Size and Spacing'), traceTypes: ['violin'], mode: 'trace' }, - _react2.default.createElement( - _components.LayoutSection, - { attr: 'name' }, - _react2.default.createElement(_components.Radio, { - label: _('Violin Mode'), - attr: 'violinmode', - options: [{ label: _('Overlay'), value: 'overlay' }, { label: _('Group'), value: 'group' }] - }), - _react2.default.createElement(_components.NumericFractionInverse, { label: _('Violin Width'), attr: 'violingap' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Violin Padding'), attr: 'violingroupgap' }) - ) - ), - _react2.default.createElement(_components.NumericFraction, { label: _('Whisker Width'), attr: 'whiskerwidth' }), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Ticks') }, - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'tickwidth' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Contours') }, - _react2.default.createElement(_components.Radio, { - label: _('Type'), - attr: 'contours.type', - options: [{ label: _('Levels'), value: 'levels' }, { label: _('Constraint'), value: 'constraint' }] - }), - _react2.default.createElement(_components.Dropdown, { - label: _('Coloring'), - attr: 'contours.coloring', - options: [{ label: _('Fill'), value: 'fill' }, { label: _('Heatmap'), value: 'heatmap' }, { label: _('Lines'), value: 'lines' }, { label: _('None'), value: 'none' }], - clearable: false - }), - _react2.default.createElement(_components.Radio, { - label: _('Contour Lines'), - attr: 'contours.showlines', - options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Contour Labels'), - attr: 'contours.showlabels', - options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Number of Contours'), - attr: 'autocontour', - options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Max Contours'), attr: 'ncontours' }), - _react2.default.createElement(_components.ContourNumeric, { label: _('Step Size'), attr: 'contours.size' }), - _react2.default.createElement(_components.ContourNumeric, { label: _('Min Contour'), attr: 'contours.start' }), - _react2.default.createElement(_components.ContourNumeric, { label: _('Max Contour'), attr: 'contours.end' }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { name: _('Stacking'), traceTypes: ['scatter'], mode: 'trace' }, - _react2.default.createElement(_components.GroupCreator, { label: _('Group'), prefix: _('Stack'), attr: 'stackgroup' }), - _react2.default.createElement(_components.Radio, { - label: _('Gaps'), - attr: 'stackgaps', - options: [{ label: _('Infer Zero'), value: 'infer zero' }, { label: _('Interpolate'), value: 'interpolate' }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Orientation'), - attr: 'orientation', - options: [{ label: _('Horizontal'), value: 'h' }, { label: _('Vertical'), value: 'v' }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Normalization'), - attr: 'groupnorm', - options: [{ label: _('None'), value: '' }, { label: _('Fraction'), value: 'fraction' }, { label: _('Percent'), value: 'percent' }] - }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { - name: _('Lines'), - traceTypes: ['scatter', 'contour', 'scatterternary', 'scatterpolar', 'scatterpolargl', 'scatter3d', 'scattergl', 'scattergeo', 'scattermapbox', 'box', 'violin'], - mode: 'trace' - }, - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'line.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Color'), attr: 'line.color' }), - _react2.default.createElement(_components.Radio, { - label: _('Color Bar'), - attr: 'line.showscale', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.ColorscalePicker, { label: _('Colorscale'), attr: 'line.colorscale' }), - _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'line.dash' }), - _react2.default.createElement(_components.LineShapeSelector, { label: _('Shape'), attr: 'line.shape' }), - _react2.default.createElement(_components.Numeric, { label: _('Smoothing'), attr: 'line.smoothing', showSlider: true, step: 0.1 }), - _react2.default.createElement(_components.Radio, { - label: _('Connect Gaps'), - attr: 'connectgaps', - options: [{ label: _('Connect'), value: true }, { label: _('Blank'), value: false }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Filled Area') }, - _react2.default.createElement(_components.FillDropdown, { attr: 'fill', label: _('Fill to') }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Color'), attr: 'fillcolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Text Attributes') }, - _react2.default.createElement(_derived.TextInfo, { attr: 'textinfo' }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { - name: _('Text'), - traceTypes: ['scatter', 'scattergl', 'scatterpolar', 'scatterpolargl', 'barpolar', 'pie', 'scatter3d', 'scatterternary', 'bar', 'scattergeo', 'scattermapbox'], - mode: 'trace' - }, - _react2.default.createElement(_components.DataSelector, { label: _('Text'), attr: 'text' }), - _react2.default.createElement(_components.TextPosition, { label: _('Text Position'), attr: 'textposition' }), - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'textfont.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Font Size'), attr: 'textfont.size', units: 'px' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Font Color'), attr: 'textfont.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Colorscale') }, - _react2.default.createElement(_components.ColorscalePicker, { label: _('Colorscale'), attr: 'colorscale' }), - _react2.default.createElement(_components.Radio, { - label: _('Color Bar'), - attr: 'showscale', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Orientation'), - attr: 'reversescale', - options: [{ label: _('Normal'), value: false }, { label: _('Reversed'), value: true }] - }), - _react2.default.createElement( - _components.VisibilitySelect, - { - label: _('Range'), - attr: 'zauto', - options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }], - showOn: false, - defaultOpt: true - }, - _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'zmin' }), - _react2.default.createElement(_components.Numeric, { label: _('Max'), attr: 'zmax' }) - ), - _react2.default.createElement( - _components.VisibilitySelect, - { - label: _('Range'), - attr: 'cauto', - options: [{ label: _('Auto'), value: true }, { label: _('Custom'), value: false }], - showOn: false, - defaultOpt: true - }, - _react2.default.createElement(_components.Numeric, { label: _('Min'), attr: 'cmin' }), - _react2.default.createElement(_components.Numeric, { label: _('Max'), attr: 'cmax' }) - ), - _react2.default.createElement(_components.Radio, { - label: _('Smoothing'), - attr: 'zsmooth', - options: [{ label: _('On'), value: 'best' }, { label: _('Off'), value: false }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Gaps Between Cells') }, - _react2.default.createElement(_components.Numeric, { label: _('Horizontal Gap'), attr: 'xgap' }), - _react2.default.createElement(_components.Numeric, { label: _('Vertical Gap'), attr: 'ygap' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Heatmap') }, - _react2.default.createElement(_components.Numeric, { label: _('Horizontal Gaps'), attr: 'xgap' }), - _react2.default.createElement(_components.Numeric, { label: _('Vertical Gaps'), attr: 'ygap' }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { - name: _('Gaps in Data'), - traceTypes: ['heatmap', 'contour', 'heatmapgl'], - mode: 'trace' - }, - _react2.default.createElement(_components.Radio, { - label: _('Interpolate Gaps'), - attr: 'connectgaps', - options: [{ label: _('On'), value: true }, { label: _('Off'), value: false }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Lighting') }, - _react2.default.createElement(_components.NumericFraction, { label: _('Ambient'), attr: 'lighting.ambient' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Diffuse'), attr: 'lighting.diffuse' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Specular'), attr: 'lighting.specular' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Roughness'), attr: 'lighting.roughness' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Fresnel'), attr: 'lighting.fresnel' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Vertex Normal'), attr: 'lighting.vertexnormalsepsilon' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Face Normal'), attr: 'lighting.facenormalsepsilon' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Light Position') }, - _react2.default.createElement(_components.NumericFraction, { label: _('X'), attr: 'lightposition.x' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Y'), attr: 'lightposition.y' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Z'), attr: 'lightposition.z' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Increasing Trace Styles') }, - _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'increasing.name', richTextOnly: true }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'increasing.line.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Line Color'), attr: 'increasing.line.color' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'increasing.fillcolor' }), - _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'increasing.line.dash' }), - _react2.default.createElement(_components.Radio, { - label: _('Show in Legend'), - attr: 'increasing.showlegend', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Decreasing Trace Styles') }, - _react2.default.createElement(_components.TextEditor, { label: _('Name'), attr: 'decreasing.name', richTextOnly: true }), - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'decreasing.line.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Line Color'), attr: 'decreasing.line.color' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Fill Color'), attr: 'decreasing.fillcolor' }), - _react2.default.createElement(_components.LineDashSelector, { label: _('Type'), attr: 'decreasing.line.dash' }), - _react2.default.createElement(_components.Radio, { - label: _('Show in Legend'), - attr: 'decreasing.showlegend', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Scaling') }, - _react2.default.createElement(_components.GroupCreator, { label: _('Scale Group'), prefix: _('Group'), attr: 'scalegroup' }), - _react2.default.createElement(_components.Radio, { - label: _('Scale Mode'), - attr: 'scalemode', - options: [{ label: _('Width'), value: 'width' }, { label: _('Count'), value: 'count' }] - }), - _react2.default.createElement(_components.Radio, { - label: _('Span Mode'), - attr: 'spanmode', - options: [{ label: _('Soft'), value: 'soft' }, { label: _('Hard'), value: 'hard' }, { label: _('Manual'), value: 'manual' }] - }), - _react2.default.createElement(_components.Numeric, { label: _('Bandwidth'), attr: 'bandwidth' }), - _react2.default.createElement(_components.Numeric, { label: _('Span'), attr: 'span' }), - _react2.default.createElement(_components.Radio, { - attr: 'side', - label: _('Visible Sides'), - options: [{ label: _('Both'), value: 'both' }, { label: _('Positive'), value: 'positive' }, { label: _('Negative'), value: 'negative' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Box Mean') }, - _react2.default.createElement(_components.Radio, { - attr: 'boxmean', - options: [{ label: _('Mean'), value: true }, { label: _('Mean & SD'), value: 'sd' }, { label: _('None'), value: false }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Box') }, - _react2.default.createElement(_components.Radio, { - attr: 'box.visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.NumericFraction, { label: _('Box Width'), attr: 'box.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Box Fill Color'), attr: 'box.color' }), - _react2.default.createElement(_components.NumericFraction, { label: _('Box Line Width'), attr: 'box.line.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Box Line Color'), attr: 'box.line.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Meanline') }, - _react2.default.createElement(_components.Radio, { - attr: 'meanline.visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }] - }), - _react2.default.createElement(_components.NumericFraction, { label: _('Meanline Width'), attr: 'meanline.width' }), - _react2.default.createElement(_components.MultiColorPicker, { label: _('Meanline Color'), attr: 'meanline.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('On Hover') }, - _react2.default.createElement(_components.HoverInfo, { attr: 'hoverinfo', label: _('Values Shown On Hover') }), - _react2.default.createElement(_components.Radio, { - label: _('Split labels'), - attr: 'hoverlabel.split', - options: [{ label: _('Yes'), value: true }, { label: _('No'), value: false }] - }), - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'contour.show', - label: _('Show Contour'), - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true, - defaultOpt: false - }, - _react2.default.createElement(_components.MultiColorPicker, { label: _('Contour Color'), attr: 'contour.color' }), - _react2.default.createElement(_components.Numeric, { label: _('Contour Width'), attr: 'contour.width' }) - ) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Hover Action') }, - _react2.default.createElement(_derived.HoveronDropdown, { attr: 'hoveron', label: _('Hover on') }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { - name: _('Error Bars X'), - traceTypes: ['scatter', 'scattergl', 'scatter3d', 'bar'], - mode: 'trace' - }, - _react2.default.createElement(_components.ErrorBars, { attr: 'error_x' }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { - name: _('Error Bars Y'), - traceTypes: ['scatter', 'scattergl', 'scatter3d', 'bar'], - mode: 'trace' - }, - _react2.default.createElement(_components.ErrorBars, { attr: 'error_y' }) - ), - _react2.default.createElement( - _components.TraceTypeSection, - { name: _('Error Bars Z'), traceTypes: ['scatter3d'], mode: 'trace' }, - _react2.default.createElement(_components.ErrorBars, { attr: 'error_z' }) - ) - ); - } - ); -}; - -// StyleTracesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -// import PropTypes from 'prop-types'; - -exports.default = StyleTracesPanel; -//# sourceMappingURL=StyleTracesPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleTracesPanel.js.map b/lib/default_panels/StyleTracesPanel.js.map deleted file mode 100644 index 53eec00e9..000000000 --- a/lib/default_panels/StyleTracesPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleTracesPanel.js"],"names":["StyleTracesPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAGA;;AA+BA;;AAOA;;;;AAEA,IAAMA,mBAAmB,SAAnBA,gBAAmB;AAAA,SACvB;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;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AA;AACE,kBAAMA,EAAE,cAAF,CADR;AAEE,wBAAY,CAAC,SAAD,EAAY,WAAZ,EAAyB,WAAzB,EAAsC,KAAtC,CAFd;AAGE,kBAAK;AAHP;AAKE,wCAAC,qBAAD,IAAW,MAAK,SAAhB;AALF,SAvlBF;AA+lBE;AAAC,sCAAD;AAAA;AACE,kBAAMA,EAAE,cAAF,CADR;AAEE,wBAAY,CAAC,SAAD,EAAY,WAAZ,EAAyB,WAAzB,EAAsC,KAAtC,CAFd;AAGE,kBAAK;AAHP;AAKE,wCAAC,qBAAD,IAAW,MAAK,SAAhB;AALF,SA/lBF;AAumBE;AAAC,sCAAD;AAAA,YAAkB,MAAMA,EAAE,cAAF,CAAxB,EAA2C,YAAY,CAAC,WAAD,CAAvD,EAAsE,MAAK,OAA3E;AACE,wCAAC,qBAAD,IAAW,MAAK,SAAhB;AADF;AAvmBF,OADD;AAAA;AADH,GADuB;AAAA,CAAzB;;AAknBA;AACA;AACA;;AA9pBA;;kBAgqBeD,gB","file":"StyleTracesPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\n\nimport {\n Flaglist,\n ContourNumeric,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n NumericFraction,\n NumericFractionInverse,\n Radio,\n TextEditor,\n PlotlySection,\n LayoutSection,\n SymbolSelector,\n TraceAccordion,\n TraceTypeSection,\n TraceMarkerSection,\n ColorscalePicker,\n ColorwayPicker,\n HoverInfo,\n Dropdown,\n FillDropdown,\n FontSelector,\n TextPosition,\n MarkerSize,\n MarkerColor,\n MultiColorPicker,\n ErrorBars,\n DataSelector,\n VisibilitySelect,\n GroupCreator,\n} from '../components';\nimport {\n BinningDropdown,\n NumericReciprocal,\n ShowInLegend,\n TextInfo,\n HoveronDropdown,\n} from '../components/fields/derived';\nimport {EditorControlsContext} from '../context';\n\nconst StyleTracesPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n )}\n \n);\n\n// StyleTracesPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleTracesPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/StyleUpdateMenusPanel.js b/lib/default_panels/StyleUpdateMenusPanel.js deleted file mode 100644 index 3fe526158..000000000 --- a/lib/default_panels/StyleUpdateMenusPanel.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _components = require('../components'); - -var _context = require('../context'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// import PropTypes from 'prop-types'; -var StyleUpdateMenusPanel = function StyleUpdateMenusPanel() { - return _react2.default.createElement( - _context.EditorControlsContext.Consumer, - null, - function (_ref) { - var _ = _ref.localize; - return _react2.default.createElement( - _components.UpdateMenuAccordion, - null, - _react2.default.createElement( - _components.VisibilitySelect, - { - attr: 'visible', - options: [{ label: _('Show'), value: true }, { label: _('Hide'), value: false }], - showOn: true - }, - _react2.default.createElement( - _components.PlotlySection, - { name: _('Button Labels') }, - _react2.default.createElement(_components.UpdateMenuButtons, { attr: 'buttons' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Background') }, - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bgcolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Font') }, - _react2.default.createElement(_components.FontSelector, { label: _('Typeface'), attr: 'font.family' }), - _react2.default.createElement(_components.Numeric, { label: _('Size'), attr: 'font.size' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'font.color' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Border') }, - _react2.default.createElement(_components.Numeric, { label: _('Width'), attr: 'borderwidth' }), - _react2.default.createElement(_components.ColorPicker, { label: _('Color'), attr: 'bordercolor' }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Horizontal Positioning'), attr: 'x' }, - _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'x', showSlider: true, step: 0.02 }), - _react2.default.createElement(_components.Radio, { - label: _('Anchor'), - attr: 'xanchor', - options: [{ label: _('Left'), value: 'left' }, { label: _('Center'), value: 'center' }, { label: _('Right'), value: 'right' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Vertical Positioning'), attr: 'y' }, - _react2.default.createElement(_components.Numeric, { label: _('Position'), attr: 'y', showSlider: true, step: 0.02 }), - _react2.default.createElement(_components.Radio, { - label: _('Anchor'), - attr: 'yanchor', - options: [{ label: _('Top'), value: 'top' }, { label: _('Middle'), value: 'middle' }, { label: _('Bottom'), value: 'bottom' }] - }) - ), - _react2.default.createElement( - _components.PlotlySection, - { name: _('Padding') }, - _react2.default.createElement(_components.Numeric, { label: _('Top'), attr: 'pad.t', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Bottom'), attr: 'pad.b', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Left'), attr: 'pad.l', units: 'px' }), - _react2.default.createElement(_components.Numeric, { label: _('Right'), attr: 'pad.r', units: 'px' }) - ) - ) - ); - } - ); -}; - -// StyleUpdateMenusPanel.contextTypes = { -// localize: PropTypes.func, -// }; - -exports.default = StyleUpdateMenusPanel; -//# sourceMappingURL=StyleUpdateMenusPanel.js.map \ No newline at end of file diff --git a/lib/default_panels/StyleUpdateMenusPanel.js.map b/lib/default_panels/StyleUpdateMenusPanel.js.map deleted file mode 100644 index 017b89bdf..000000000 --- a/lib/default_panels/StyleUpdateMenusPanel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/StyleUpdateMenusPanel.js"],"names":["StyleUpdateMenusPanel","_","localize","label","value"],"mappings":";;;;;;AAAA;;;;AAEA;;AAUA;;;;AAXA;AAaA,IAAMA,wBAAwB,SAAxBA,qBAAwB;AAAA,SAC5B;AAAC,kCAAD,CAAuB,QAAvB;AAAA;AACG;AAAA,UAAYC,CAAZ,QAAEC,QAAF;AAAA,aACC;AAAC,uCAAD;AAAA;AACE;AAAC,sCAAD;AAAA;AACE,kBAAK,SADP;AAEE,qBAAS,CAAC,EAACC,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,IAA1B,EAAD,EAAkC,EAACD,OAAOF,EAAE,MAAF,CAAR,EAAmBG,OAAO,KAA1B,EAAlC,CAFX;AAGE,oBAAQ;AAHV;AAKE;AAAC,qCAAD;AAAA,cAAe,MAAMH,EAAE,eAAF,CAArB;AACE,0CAAC,6BAAD,IAAmB,MAAK,SAAxB;AADF,WALF;AAQE;AAAC,qCAAD;AAAA,cAAe,MAAMA,EAAE,YAAF,CAArB;AACE,0CAAC,uBAAD,IAAa,OAAOA,EAAE,OAAF,CAApB,EAAgC,MAAK,SAArC;AADF,WARF;AAWE;AAAC,qCAAD;AAAA,cAAe,MAAMA,EAAE,MAAF,CAArB;AACE,0CAAC,wBAAD,IAAc,OAAOA,EAAE,UAAF,CAArB,EAAoC,MAAK,aAAzC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E,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAFO,EAGP,EAACD,OAAOF,EAAE,QAAF,CAAR,EAAqBG,OAAO,QAA5B,EAHO;AAHX;AAFF,WAjCF;AA8CE;AAAC,qCAAD;AAAA,cAAe,MAAMH,EAAE,SAAF,CAArB;AACE,0CAAC,mBAAD,IAAS,OAAOA,EAAE,KAAF,CAAhB,EAA0B,MAAK,OAA/B,EAAuC,OAAM,IAA7C,GADF;AAEE,0CAAC,mBAAD,IAAS,OAAOA,EAAE,QAAF,CAAhB,EAA6B,MAAK,OAAlC,EAA0C,OAAM,IAAhD,GAFF;AAGE,0CAAC,mBAAD,IAAS,OAAOA,EAAE,MAAF,CAAhB,EAA2B,MAAK,OAAhC,EAAwC,OAAM,IAA9C,GAHF;AAIE,0CAAC,mBAAD,IAAS,OAAOA,EAAE,OAAF,CAAhB,EAA4B,MAAK,OAAjC,EAAyC,OAAM,IAA/C;AAJF;AA9CF;AADF,OADD;AAAA;AADH,GAD4B;AAAA,CAA9B;;AA8DA;AACA;AACA;;kBAEeD,qB","file":"StyleUpdateMenusPanel.js","sourcesContent":["import React from 'react';\n// import PropTypes from 'prop-types';\nimport {\n ColorPicker,\n FontSelector,\n Numeric,\n PlotlySection,\n UpdateMenuAccordion,\n UpdateMenuButtons,\n VisibilitySelect,\n Radio,\n} from '../components';\nimport {EditorControlsContext} from '../context';\n\nconst StyleUpdateMenusPanel = () => (\n \n {({localize: _}) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n )}\n \n);\n\n// StyleUpdateMenusPanel.contextTypes = {\n// localize: PropTypes.func,\n// };\n\nexport default StyleUpdateMenusPanel;\n"]} \ No newline at end of file diff --git a/lib/default_panels/index.js b/lib/default_panels/index.js deleted file mode 100644 index 9cae79c33..000000000 --- a/lib/default_panels/index.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.GraphSubplotsPanel = exports.StyleUpdateMenusPanel = exports.StyleColorbarsPanel = exports.StyleTracesPanel = exports.StyleImagesPanel = exports.StyleSlidersPanel = exports.StyleShapesPanel = exports.StyleNotesPanel = exports.StyleLegendPanel = exports.StyleAxesPanel = exports.StyleLayoutPanel = exports.GraphTransformsPanel = exports.GraphCreatePanel = undefined; - -var _GraphCreatePanel = require('./GraphCreatePanel'); - -var _GraphCreatePanel2 = _interopRequireDefault(_GraphCreatePanel); - -var _GraphTransformsPanel = require('./GraphTransformsPanel'); - -var _GraphTransformsPanel2 = _interopRequireDefault(_GraphTransformsPanel); - -var _StyleLayoutPanel = require('./StyleLayoutPanel'); - -var _StyleLayoutPanel2 = _interopRequireDefault(_StyleLayoutPanel); - -var _StyleAxesPanel = require('./StyleAxesPanel'); - -var _StyleAxesPanel2 = _interopRequireDefault(_StyleAxesPanel); - -var _StyleLegendPanel = require('./StyleLegendPanel'); - -var _StyleLegendPanel2 = _interopRequireDefault(_StyleLegendPanel); - -var _StyleNotesPanel = require('./StyleNotesPanel'); - -var _StyleNotesPanel2 = _interopRequireDefault(_StyleNotesPanel); - -var _StyleShapesPanel = require('./StyleShapesPanel'); - -var _StyleShapesPanel2 = _interopRequireDefault(_StyleShapesPanel); - -var _StyleSlidersPanel = require('./StyleSlidersPanel'); - -var _StyleSlidersPanel2 = _interopRequireDefault(_StyleSlidersPanel); - -var _StyleImagesPanel = require('./StyleImagesPanel'); - -var _StyleImagesPanel2 = _interopRequireDefault(_StyleImagesPanel); - -var _StyleTracesPanel = require('./StyleTracesPanel'); - -var _StyleTracesPanel2 = _interopRequireDefault(_StyleTracesPanel); - -var _StyleColorbarsPanel = require('./StyleColorbarsPanel'); - -var _StyleColorbarsPanel2 = _interopRequireDefault(_StyleColorbarsPanel); - -var _StyleUpdateMenusPanel = require('./StyleUpdateMenusPanel'); - -var _StyleUpdateMenusPanel2 = _interopRequireDefault(_StyleUpdateMenusPanel); - -var _GraphSubplotsPanel = require('./GraphSubplotsPanel'); - -var _GraphSubplotsPanel2 = _interopRequireDefault(_GraphSubplotsPanel); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.GraphCreatePanel = _GraphCreatePanel2.default; -exports.GraphTransformsPanel = _GraphTransformsPanel2.default; -exports.StyleLayoutPanel = _StyleLayoutPanel2.default; -exports.StyleAxesPanel = _StyleAxesPanel2.default; -exports.StyleLegendPanel = _StyleLegendPanel2.default; -exports.StyleNotesPanel = _StyleNotesPanel2.default; -exports.StyleShapesPanel = _StyleShapesPanel2.default; -exports.StyleSlidersPanel = _StyleSlidersPanel2.default; -exports.StyleImagesPanel = _StyleImagesPanel2.default; -exports.StyleTracesPanel = _StyleTracesPanel2.default; -exports.StyleColorbarsPanel = _StyleColorbarsPanel2.default; -exports.StyleUpdateMenusPanel = _StyleUpdateMenusPanel2.default; -exports.GraphSubplotsPanel = _GraphSubplotsPanel2.default; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/default_panels/index.js.map b/lib/default_panels/index.js.map deleted file mode 100644 index 72f862052..000000000 --- a/lib/default_panels/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/default_panels/index.js"],"names":["GraphCreatePanel","GraphTransformsPanel","StyleLayoutPanel","StyleAxesPanel","StyleLegendPanel","StyleNotesPanel","StyleShapesPanel","StyleSlidersPanel","StyleImagesPanel","StyleTracesPanel","StyleColorbarsPanel","StyleUpdateMenusPanel","GraphSubplotsPanel"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;QAGEA,gB,GAAAA,0B;QACAC,oB,GAAAA,8B;QACAC,gB,GAAAA,0B;QACAC,c,GAAAA,wB;QACAC,gB,GAAAA,0B;QACAC,e,GAAAA,yB;QACAC,gB,GAAAA,0B;QACAC,iB,GAAAA,2B;QACAC,gB,GAAAA,0B;QACAC,gB,GAAAA,0B;QACAC,mB,GAAAA,6B;QACAC,qB,GAAAA,+B;QACAC,kB,GAAAA,4B","file":"index.js","sourcesContent":["import GraphCreatePanel from './GraphCreatePanel';\nimport GraphTransformsPanel from './GraphTransformsPanel';\nimport StyleLayoutPanel from './StyleLayoutPanel';\nimport StyleAxesPanel from './StyleAxesPanel';\nimport StyleLegendPanel from './StyleLegendPanel';\nimport StyleNotesPanel from './StyleNotesPanel';\nimport StyleShapesPanel from './StyleShapesPanel';\nimport StyleSlidersPanel from './StyleSlidersPanel';\nimport StyleImagesPanel from './StyleImagesPanel';\nimport StyleTracesPanel from './StyleTracesPanel';\nimport StyleColorbarsPanel from './StyleColorbarsPanel';\nimport StyleUpdateMenusPanel from './StyleUpdateMenusPanel';\nimport GraphSubplotsPanel from './GraphSubplotsPanel';\n\nexport {\n GraphCreatePanel,\n GraphTransformsPanel,\n StyleLayoutPanel,\n StyleAxesPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleSlidersPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n StyleColorbarsPanel,\n StyleUpdateMenusPanel,\n GraphSubplotsPanel,\n};\n"]} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 3d2a22e5d..000000000 --- a/lib/index.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TRANSFORMABLE_TRACES = exports.traceHasColorbar = exports.PlotlyPanelContext = exports.PlotlyFoldContext = exports.ModalProviderContext = exports.PanelMenuWrapperContext = exports.EditorControlsContext = exports.RectanglePositioner = exports.DefaultEditor = exports.EditorControls = exports.walkObject = exports.localizeString = exports.localize = exports.dereference = exports.connectTraceToPlot = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.TraceSelector = exports.TraceRequiredPanel = exports.TraceMarkerSection = exports.TraceAccordion = exports.TextEditor = exports.SymbolSelector = exports.StyleTracesPanel = exports.StyleImagesPanel = exports.StyleShapesPanel = exports.StyleNotesPanel = exports.StyleLegendPanel = exports.StyleLayoutPanel = exports.StyleColorbarsPanel = exports.StyleAxesPanel = exports.GraphTransformsPanel = exports.SingleSidebarItem = exports.Section = exports.PlotlySection = exports.Radio = exports.PanelMenuWrapper = exports.PanelEmpty = exports.Panel = exports.PlotlyPanel = exports.Text = exports.AxisRangeValue = exports.Numeric = exports.LineShapeSelector = exports.LineDashSelector = exports.LayoutSection = exports.LayoutPanel = exports.NumericFractionInverse = exports.PositioningNumeric = exports.NumericFraction = exports.Info = exports.GraphCreatePanel = exports.FontSelector = exports.Fold = exports.PlotlyFold = exports.Flaglist = exports.RangesliderVisible = exports.EDITOR_ACTIONS = exports.Dropzone = exports.Dropdown = exports.DataSelector = exports.ErrorBars = exports.ContourNumeric = exports.PieColorscalePicker = exports.ColorscalePicker = exports.ColorwayPicker = exports.PanelMessage = exports.ColorPicker = exports.Button = exports.AxesSelector = exports.DTicks = exports.NTicks = exports.AxesRange = exports.AxesFold = exports.TransformAccordion = exports.ArrowSelector = exports.PositioningRef = exports.AnnotationRef = exports.AnnotationArrowRef = exports.RangeSelectorAccordion = exports.ImageAccordion = exports.ShapeAccordion = exports.AnnotationAccordion = undefined; - -var _PlotlyEditor = require('./PlotlyEditor'); - -var _PlotlyEditor2 = _interopRequireDefault(_PlotlyEditor); - -var _DefaultEditor = require('./DefaultEditor'); - -var _DefaultEditor2 = _interopRequireDefault(_DefaultEditor); - -var _EditorControls = require('./EditorControls'); - -var _EditorControls2 = _interopRequireDefault(_EditorControls); - -var _lib = require('./lib'); - -var _constants = require('./lib/constants'); - -var _context = require('./context'); - -var _components = require('./components'); - -var _StyleColorbarsPanel = require('./default_panels/StyleColorbarsPanel'); - -var _default_panels = require('./default_panels'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.AnnotationAccordion = _components.AnnotationAccordion; -exports.ShapeAccordion = _components.ShapeAccordion; -exports.ImageAccordion = _components.ImageAccordion; -exports.RangeSelectorAccordion = _components.RangeSelectorAccordion; -exports.AnnotationArrowRef = _components.AnnotationArrowRef; -exports.AnnotationRef = _components.AnnotationRef; -exports.PositioningRef = _components.PositioningRef; -exports.ArrowSelector = _components.ArrowSelector; -exports.TransformAccordion = _components.TransformAccordion; -exports.AxesFold = _components.AxesFold; -exports.AxesRange = _components.AxesRange; -exports.NTicks = _components.NTicks; -exports.DTicks = _components.DTicks; -exports.AxesSelector = _components.AxesSelector; -exports.Button = _components.Button; -exports.ColorPicker = _components.ColorPicker; -exports.PanelMessage = _components.PanelMessage; -exports.ColorwayPicker = _components.ColorwayPicker; -exports.ColorscalePicker = _components.ColorscalePicker; -exports.PieColorscalePicker = _components.PieColorscalePicker; -exports.ContourNumeric = _components.ContourNumeric; -exports.ErrorBars = _components.ErrorBars; -exports.DataSelector = _components.DataSelector; -exports.Dropdown = _components.Dropdown; -exports.Dropzone = _components.Dropzone; -exports.EDITOR_ACTIONS = _constants.EDITOR_ACTIONS; -exports.RangesliderVisible = _components.RangesliderVisible; -exports.Flaglist = _components.Flaglist; -exports.PlotlyFold = _components.PlotlyFold; -exports.Fold = _components.Fold; -exports.FontSelector = _components.FontSelector; -exports.GraphCreatePanel = _default_panels.GraphCreatePanel; -exports.Info = _components.Info; -exports.NumericFraction = _components.NumericFraction; -exports.PositioningNumeric = _components.PositioningNumeric; -exports.NumericFractionInverse = _components.NumericFractionInverse; -exports.LayoutPanel = _components.LayoutPanel; -exports.LayoutSection = _components.LayoutSection; -exports.LineDashSelector = _components.LineDashSelector; -exports.LineShapeSelector = _components.LineShapeSelector; -exports.Numeric = _components.Numeric; -exports.AxisRangeValue = _components.AxisRangeValue; -exports.Text = _components.Text; -exports.PlotlyPanel = _components.PlotlyPanel; -exports.Panel = _components.Panel; -exports.PanelEmpty = _components.PanelEmpty; -exports.PanelMenuWrapper = _components.PanelMenuWrapper; -exports.Radio = _components.Radio; -exports.PlotlySection = _components.PlotlySection; -exports.Section = _components.Section; -exports.SingleSidebarItem = _components.SingleSidebarItem; -exports.GraphTransformsPanel = _default_panels.GraphTransformsPanel; -exports.StyleAxesPanel = _default_panels.StyleAxesPanel; -exports.StyleColorbarsPanel = _default_panels.StyleColorbarsPanel; -exports.StyleLayoutPanel = _default_panels.StyleLayoutPanel; -exports.StyleLegendPanel = _default_panels.StyleLegendPanel; -exports.StyleNotesPanel = _default_panels.StyleNotesPanel; -exports.StyleShapesPanel = _default_panels.StyleShapesPanel; -exports.StyleImagesPanel = _default_panels.StyleImagesPanel; -exports.StyleTracesPanel = _default_panels.StyleTracesPanel; -exports.SymbolSelector = _components.SymbolSelector; -exports.TextEditor = _components.TextEditor; -exports.TraceAccordion = _components.TraceAccordion; -exports.TraceMarkerSection = _components.TraceMarkerSection; -exports.TraceRequiredPanel = _components.TraceRequiredPanel; -exports.TraceSelector = _components.TraceSelector; -exports.connectCartesianSubplotToLayout = _lib.connectCartesianSubplotToLayout; -exports.connectNonCartesianSubplotToLayout = _lib.connectNonCartesianSubplotToLayout; -exports.connectAnnotationToLayout = _lib.connectAnnotationToLayout; -exports.connectShapeToLayout = _lib.connectShapeToLayout; -exports.connectImageToLayout = _lib.connectImageToLayout; -exports.connectAxesToLayout = _lib.connectAxesToLayout; -exports.connectTransformToTrace = _lib.connectTransformToTrace; -exports.connectAggregationToTransform = _lib.connectAggregationToTransform; -exports.connectLayoutToPlot = _lib.connectLayoutToPlot; -exports.connectToContainer = _lib.connectToContainer; -exports.connectRangeSelectorToAxis = _lib.connectRangeSelectorToAxis; -exports.connectTraceToPlot = _lib.connectTraceToPlot; -exports.dereference = _lib.dereference; -exports.localize = _lib.localize; -exports.localizeString = _lib.localizeString; -exports.walkObject = _lib.walkObject; -exports.EditorControls = _EditorControls2.default; -exports.DefaultEditor = _DefaultEditor2.default; -exports.RectanglePositioner = _components.RectanglePositioner; -exports.EditorControlsContext = _context.EditorControlsContext; -exports.PanelMenuWrapperContext = _context.PanelMenuWrapperContext; -exports.ModalProviderContext = _context.ModalProviderContext; -exports.PlotlyFoldContext = _context.PlotlyFoldContext; -exports.PlotlyPanelContext = _context.PlotlyPanelContext; -exports.traceHasColorbar = _StyleColorbarsPanel.traceHasColorbar; -exports.TRANSFORMABLE_TRACES = _constants.TRANSFORMABLE_TRACES; -exports.default = _PlotlyEditor2.default; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map deleted file mode 100644 index 4d3330a85..000000000 --- a/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/index.js"],"names":["AnnotationAccordion","ShapeAccordion","ImageAccordion","RangeSelectorAccordion","AnnotationArrowRef","AnnotationRef","PositioningRef","ArrowSelector","TransformAccordion","AxesFold","AxesRange","NTicks","DTicks","AxesSelector","Button","ColorPicker","PanelMessage","ColorwayPicker","ColorscalePicker","PieColorscalePicker","ContourNumeric","ErrorBars","DataSelector","Dropdown","Dropzone","EDITOR_ACTIONS","RangesliderVisible","Flaglist","PlotlyFold","Fold","FontSelector","GraphCreatePanel","Info","NumericFraction","PositioningNumeric","NumericFractionInverse","LayoutPanel","LayoutSection","LineDashSelector","LineShapeSelector","Numeric","AxisRangeValue","Text","PlotlyPanel","Panel","PanelEmpty","PanelMenuWrapper","Radio","PlotlySection","Section","SingleSidebarItem","GraphTransformsPanel","StyleAxesPanel","StyleColorbarsPanel","StyleLayoutPanel","StyleLegendPanel","StyleNotesPanel","StyleShapesPanel","StyleImagesPanel","StyleTracesPanel","SymbolSelector","TextEditor","TraceAccordion","TraceMarkerSection","TraceRequiredPanel","TraceSelector","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectImageToLayout","connectAxesToLayout","connectTransformToTrace","connectAggregationToTransform","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTraceToPlot","dereference","localize","localizeString","walkObject","EditorControls","DefaultEditor","RectanglePositioner","EditorControlsContext","PanelMenuWrapperContext","ModalProviderContext","PlotlyFoldContext","PlotlyPanelContext","traceHasColorbar","TRANSFORMABLE_TRACES","PlotlyEditor"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;AAkBA;;AACA;;AAQA;;AA0DA;;AAEA;;;;QAcEA,mB,GAAAA,+B;QACAC,c,GAAAA,0B;QACAC,c,GAAAA,0B;QACAC,sB,GAAAA,kC;QACAC,kB,GAAAA,8B;QACAC,a,GAAAA,yB;QACAC,c,GAAAA,0B;QACAC,a,GAAAA,yB;QACAC,kB,GAAAA,8B;QACAC,Q,GAAAA,oB;QACAC,S,GAAAA,qB;QACAC,M,GAAAA,kB;QACAC,M,GAAAA,kB;QACAC,Y,GAAAA,wB;QACAC,M,GAAAA,kB;QACAC,W,GAAAA,uB;QACAC,Y,GAAAA,wB;QACAC,c,GAAAA,0B;QACAC,gB,GAAAA,4B;QACAC,mB,GAAAA,+B;QACAC,c,GAAAA,0B;QACAC,S,GAAAA,qB;QACAC,Y,GAAAA,wB;QACAC,Q,GAAAA,oB;QACAC,Q,GAAAA,oB;QACAC,c,GAAAA,yB;QACAC,kB,GAAAA,8B;QACAC,Q,GAAAA,oB;QACAC,U,GAAAA,sB;QACAC,I,GAAAA,gB;QACAC,Y,GAAAA,wB;QACAC,gB,GAAAA,gC;QACAC,I,GAAAA,gB;QACAC,e,GAAAA,2B;QACAC,kB,GAAAA,8B;QACAC,sB,GAAAA,kC;QACAC,W,GAAAA,uB;QACAC,a,GAAAA,yB;QACAC,gB,GAAAA,4B;QACAC,iB,GAAAA,6B;QACAC,O,GAAAA,mB;QACAC,c,GAAAA,0B;QACAC,I,GAAAA,gB;QACAC,W,GAAAA,uB;QACAC,K,GAAAA,iB;QACAC,U,GAAAA,sB;QACAC,gB,GAAAA,4B;QACAC,K,GAAAA,iB;QACAC,a,GAAAA,yB;QACAC,O,GAAAA,mB;QACAC,iB,GAAAA,6B;QACAC,oB,GAAAA,oC;QACAC,c,GAAAA,8B;QACAC,mB,GAAAA,mC;QACAC,gB,GAAAA,gC;QACAC,gB,GAAAA,gC;QACAC,e,GAAAA,+B;QACAC,gB,GAAAA,gC;QACAC,gB,GAAAA,gC;QACAC,gB,GAAAA,gC;QACAC,c,GAAAA,0B;QACAC,U,GAAAA,sB;QACAC,c,GAAAA,0B;QACAC,kB,GAAAA,8B;QACAC,kB,GAAAA,8B;QACAC,a,GAAAA,yB;QACAC,+B,GAAAA,oC;QACAC,kC,GAAAA,uC;QACAC,yB,GAAAA,8B;QACAC,oB,GAAAA,yB;QACAC,oB,GAAAA,yB;QACAC,mB,GAAAA,wB;QACAC,uB,GAAAA,4B;QACAC,6B,GAAAA,kC;QACAC,mB,GAAAA,wB;QACAC,kB,GAAAA,uB;QACAC,0B,GAAAA,+B;QACAC,kB,GAAAA,uB;QACAC,W,GAAAA,gB;QACAC,Q,GAAAA,a;QACAC,c,GAAAA,mB;QACAC,U,GAAAA,e;QACAC,c,GAAAA,wB;QACAC,a,GAAAA,uB;QACAC,mB,GAAAA,+B;QACAC,qB,GAAAA,8B;QACAC,uB,GAAAA,gC;QACAC,oB,GAAAA,6B;QACAC,iB,GAAAA,0B;QACAC,kB,GAAAA,2B;QACAC,gB,GAAAA,qC;QACAC,oB,GAAAA,+B;kBAGaC,sB","file":"index.js","sourcesContent":["import PlotlyEditor from './PlotlyEditor';\nimport DefaultEditor from './DefaultEditor';\nimport EditorControls from './EditorControls';\nimport {\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectAggregationToTransform,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectLayoutToPlot,\n connectToContainer,\n connectTraceToPlot,\n connectRangeSelectorToAxis,\n dereference,\n localize,\n localizeString,\n walkObject,\n} from './lib';\nimport {EDITOR_ACTIONS, TRANSFORMABLE_TRACES} from './lib/constants';\nimport {\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n} from './context';\n\nimport {\n AnnotationAccordion,\n ShapeAccordion,\n RangeSelectorAccordion,\n ImageAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n AxesFold,\n AxesRange,\n TransformAccordion,\n NTicks,\n DTicks,\n AxesSelector,\n PanelMessage,\n Button,\n ColorPicker,\n ColorwayPicker,\n PieColorscalePicker,\n ColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n SymbolSelector,\n TextEditor,\n RangesliderVisible,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n RectanglePositioner,\n} from './components';\nimport {traceHasColorbar} from './default_panels/StyleColorbarsPanel';\n\nimport {\n GraphCreatePanel,\n StyleAxesPanel,\n GraphTransformsPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n} from './default_panels';\n\nexport {\n AnnotationAccordion,\n ShapeAccordion,\n ImageAccordion,\n RangeSelectorAccordion,\n AnnotationArrowRef,\n AnnotationRef,\n PositioningRef,\n ArrowSelector,\n TransformAccordion,\n AxesFold,\n AxesRange,\n NTicks,\n DTicks,\n AxesSelector,\n Button,\n ColorPicker,\n PanelMessage,\n ColorwayPicker,\n ColorscalePicker,\n PieColorscalePicker,\n ContourNumeric,\n ErrorBars,\n DataSelector,\n Dropdown,\n Dropzone,\n EDITOR_ACTIONS,\n RangesliderVisible,\n Flaglist,\n PlotlyFold,\n Fold,\n FontSelector,\n GraphCreatePanel,\n Info,\n NumericFraction,\n PositioningNumeric,\n NumericFractionInverse,\n LayoutPanel,\n LayoutSection,\n LineDashSelector,\n LineShapeSelector,\n Numeric,\n AxisRangeValue,\n Text,\n PlotlyPanel,\n Panel,\n PanelEmpty,\n PanelMenuWrapper,\n Radio,\n PlotlySection,\n Section,\n SingleSidebarItem,\n GraphTransformsPanel,\n StyleAxesPanel,\n StyleColorbarsPanel,\n StyleLayoutPanel,\n StyleLegendPanel,\n StyleNotesPanel,\n StyleShapesPanel,\n StyleImagesPanel,\n StyleTracesPanel,\n SymbolSelector,\n TextEditor,\n TraceAccordion,\n TraceMarkerSection,\n TraceRequiredPanel,\n TraceSelector,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTraceToPlot,\n dereference,\n localize,\n localizeString,\n walkObject,\n EditorControls,\n DefaultEditor,\n RectanglePositioner,\n EditorControlsContext,\n PanelMenuWrapperContext,\n ModalProviderContext,\n PlotlyFoldContext,\n PlotlyPanelContext,\n traceHasColorbar,\n TRANSFORMABLE_TRACES,\n};\n\nexport default PlotlyEditor;\n"]} \ No newline at end of file diff --git a/lib/lib/bem.js b/lib/lib/bem.js deleted file mode 100644 index 5d62c61ec..000000000 --- a/lib/lib/bem.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = bem; - -var _constants = require('./constants'); - -function bem(block, element, modifiers) { - var i = void 0, - modifier = void 0; - var out = []; - - if (!block) { - return _constants.baseClass; - } - if (Array.isArray(block)) { - throw new Error('bem error: Argument `block` cannot be an array'); - } else if (Array.isArray(element)) { - modifiers = element; - element = null; - } - - var className = block; - - if (element && element.length) { - className += '__' + element; - } - - out.push(className); - if (modifiers) { - for (i = 0; i < modifiers.length; i++) { - modifier = modifiers[i]; - if (modifier && modifier.length) { - out.push(className + '--' + modifier); - } - } - } - - return out.join(' '); -} // -// BEM helper -// -// bem() => 'plotly-editor' -// bem('foo') => 'foo' -// bem('foo', 'bar') => 'foo__bar' -// bem('foo', ['mod']) => 'foo foo--mod' -// bem('foo', 'bar', ['mod']) => 'foo__bar foo__bar--mod' -// bem('foo', ['mod1', mod2']) => 'foo foo--mod1 foo--mod2' - -/* eslint-disable no-param-reassign */ -//# sourceMappingURL=bem.js.map \ No newline at end of file diff --git a/lib/lib/bem.js.map b/lib/lib/bem.js.map deleted file mode 100644 index b21f59877..000000000 --- a/lib/lib/bem.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/bem.js"],"names":["bem","block","element","modifiers","i","modifier","out","baseClass","Array","isArray","Error","className","length","push","join"],"mappings":";;;;;kBAawBA,G;;AAFxB;;AAEe,SAASA,GAAT,CAAaC,KAAb,EAAoBC,OAApB,EAA6BC,SAA7B,EAAwC;AACrD,MAAIC,UAAJ;AAAA,MAAOC,iBAAP;AACA,MAAMC,MAAM,EAAZ;;AAEA,MAAI,CAACL,KAAL,EAAY;AACV,WAAOM,oBAAP;AACD;AACD,MAAIC,MAAMC,OAAN,CAAcR,KAAd,CAAJ,EAA0B;AACxB,UAAM,IAAIS,KAAJ,CAAU,gDAAV,CAAN;AACD,GAFD,MAEO,IAAIF,MAAMC,OAAN,CAAcP,OAAd,CAAJ,EAA4B;AACjCC,gBAAYD,OAAZ;AACAA,cAAU,IAAV;AACD;;AAED,MAAIS,YAAYV,KAAhB;;AAEA,MAAIC,WAAWA,QAAQU,MAAvB,EAA+B;AAC7BD,iBAAa,OAAOT,OAApB;AACD;;AAEDI,MAAIO,IAAJ,CAASF,SAAT;AACA,MAAIR,SAAJ,EAAe;AACb,SAAKC,IAAI,CAAT,EAAYA,IAAID,UAAUS,MAA1B,EAAkCR,GAAlC,EAAuC;AACrCC,iBAAWF,UAAUC,CAAV,CAAX;AACA,UAAIC,YAAYA,SAASO,MAAzB,EAAiC;AAC/BN,YAAIO,IAAJ,CAASF,YAAY,IAAZ,GAAmBN,QAA5B;AACD;AACF;AACF;;AAED,SAAOC,IAAIQ,IAAJ,CAAS,GAAT,CAAP;AACD,C,CA5CD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA","file":"bem.js","sourcesContent":["//\n// BEM helper\n//\n// bem() => 'plotly-editor'\n// bem('foo') => 'foo'\n// bem('foo', 'bar') => 'foo__bar'\n// bem('foo', ['mod']) => 'foo foo--mod'\n// bem('foo', 'bar', ['mod']) => 'foo__bar foo__bar--mod'\n// bem('foo', ['mod1', mod2']) => 'foo foo--mod1 foo--mod2'\n\n/* eslint-disable no-param-reassign */\nimport {baseClass} from './constants';\n\nexport default function bem(block, element, modifiers) {\n let i, modifier;\n const out = [];\n\n if (!block) {\n return baseClass;\n }\n if (Array.isArray(block)) {\n throw new Error('bem error: Argument `block` cannot be an array');\n } else if (Array.isArray(element)) {\n modifiers = element;\n element = null;\n }\n\n let className = block;\n\n if (element && element.length) {\n className += '__' + element;\n }\n\n out.push(className);\n if (modifiers) {\n for (i = 0; i < modifiers.length; i++) {\n modifier = modifiers[i];\n if (modifier && modifier.length) {\n out.push(className + '--' + modifier);\n }\n }\n }\n\n return out.join(' ');\n}\n"]} \ No newline at end of file diff --git a/lib/lib/computeTraceOptionsFromSchema.js b/lib/lib/computeTraceOptionsFromSchema.js deleted file mode 100644 index 4f0543c78..000000000 --- a/lib/lib/computeTraceOptionsFromSchema.js +++ /dev/null @@ -1,137 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -function computeTraceOptionsFromSchema(schema, _, context) { - // Filter out Polar "area" type as it is fairly broken and we want to present - // scatter with fill as an "area" chart type for convenience. - var traceTypes = Object.keys(schema.traces).filter(function (t) { - return !['area', 'scattermapbox'].includes(t); - }); - - var traceOptions = [{ - value: 'scatter', - label: _('Scatter') - }, { - value: 'box', - label: _('Box') - }, { - value: 'bar', - label: _('Bar') - }, { - value: 'heatmap', - label: _('Heatmap') - }, { - value: 'histogram', - label: _('Histogram') - }, { - value: 'histogram2d', - label: _('2D Histogram') - }, { - value: 'histogram2dcontour', - label: _('2D Contour Histogram') - }, { - value: 'pie', - label: _('Pie') - }, { - value: 'contour', - label: _('Contour') - }, { - value: 'scatterternary', - label: _('Ternary Scatter') - }, { - value: 'violin', - label: _('Violin') - }, { - value: 'scatter3d', - label: _('3D Scatter') - }, { - value: 'surface', - label: _('Surface') - }, { - value: 'mesh3d', - label: _('3D Mesh') - }, { - value: 'cone', - label: _('Cone') - }, { - value: 'streamtube', - label: _('Streamtube') - }, { - value: 'scattergeo', - label: _('Atlas Map') - }, { - value: 'choropleth', - label: _('Choropleth') - }, { - value: 'scattergl', - label: _('Scatter GL') - }, { - value: 'pointcloud', - label: _('Point Cloud') - }, { - value: 'heatmapgl', - label: _('Heatmap GL') - }, { - value: 'parcoords', - label: _('Parallel Coordinates') - }, { - value: 'sankey', - label: _('Sankey') - }, { - value: 'table', - label: _('Table') - }, { - value: 'carpet', - label: _('Carpet') - }, { - value: 'scattercarpet', - label: _('Carpet Scatter') - }, { - value: 'contourcarpet', - label: _('Carpet Contour') - }, { - value: 'ohlc', - label: _('OHLC') - }, { - value: 'candlestick', - label: _('Candlestick') - }, { - value: 'scatterpolar', - label: _('Polar Scatter') - }, { - value: 'scatterpolargl', - label: _('Polar Scatter GL') - }, { - value: 'barpolar', - label: _('Polar Bar') - }].filter(function (obj) { - return traceTypes.indexOf(obj.value) !== -1; - }); - - var traceIndex = function traceIndex(traceType) { - return traceOptions.findIndex(function (opt) { - return opt.value === traceType; - }); - }; - - traceOptions.splice(traceIndex('scatter') + 1, 0, { label: _('Line'), value: 'line' }, { label: _('Area'), value: 'area' }, { label: _('Timeseries'), value: 'timeseries' }); - - traceOptions.splice(traceIndex('scatter3d') + 1, 0, { - label: _('3D Line'), - value: 'line3d' - }); - - if (context.config && context.config.mapboxAccessToken) { - traceOptions.push({ - value: 'scattermapbox', - label: _('Satellite Map') - }); - } - - return traceOptions; -} - -exports.computeTraceOptionsFromSchema = computeTraceOptionsFromSchema; -//# sourceMappingURL=computeTraceOptionsFromSchema.js.map \ No newline at end of file diff --git a/lib/lib/computeTraceOptionsFromSchema.js.map b/lib/lib/computeTraceOptionsFromSchema.js.map deleted file mode 100644 index a09fc7ba9..000000000 --- a/lib/lib/computeTraceOptionsFromSchema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/computeTraceOptionsFromSchema.js"],"names":["computeTraceOptionsFromSchema","schema","_","context","traceTypes","Object","keys","traces","filter","includes","t","traceOptions","value","label","indexOf","obj","traceIndex","findIndex","opt","traceType","splice","config","mapboxAccessToken","push"],"mappings":";;;;;AAAA,SAASA,6BAAT,CAAuCC,MAAvC,EAA+CC,CAA/C,EAAkDC,OAAlD,EAA2D;AACzD;AACA;AACA,MAAMC,aAAaC,OAAOC,IAAP,CAAYL,OAAOM,MAAnB,EAA2BC,MAA3B,CAAkC;AAAA,WAAK,CAAC,CAAC,MAAD,EAAS,eAAT,EAA0BC,QAA1B,CAAmCC,CAAnC,CAAN;AAAA,GAAlC,CAAnB;;AAEA,MAAMC,eAAe,CACnB;AACEC,WAAO,SADT;AAEEC,WAAOX,EAAE,SAAF;AAFT,GADmB,EAKnB;AACEU,WAAO,KADT;AAEEC,WAAOX,EAAE,KAAF;AAFT,GALmB,EASnB;AACEU,WAAO,KADT;AAEEC,WAAOX,EAAE,KAAF;AAFT,GATmB,EAanB;AACEU,WAAO,SADT;AAEEC,WAAOX,EAAE,SAAF;AAFT,GAbmB,EAiBnB;AACEU,WAAO,WADT;AAEEC,WAAOX,EAAE,W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;;AAKA,MAAIT,QAAQkB,MAAR,IAAkBlB,QAAQkB,MAAR,CAAeC,iBAArC,EAAwD;AACtDX,iBAAaY,IAAb,CAAkB;AAChBX,aAAO,eADS;AAEhBC,aAAOX,EAAE,eAAF;AAFS,KAAlB;AAID;;AAED,SAAOS,YAAP;AACD;;QAEOX,6B,GAAAA,6B","file":"computeTraceOptionsFromSchema.js","sourcesContent":["function computeTraceOptionsFromSchema(schema, _, context) {\n // Filter out Polar \"area\" type as it is fairly broken and we want to present\n // scatter with fill as an \"area\" chart type for convenience.\n const traceTypes = Object.keys(schema.traces).filter(t => !['area', 'scattermapbox'].includes(t));\n\n const traceOptions = [\n {\n value: 'scatter',\n label: _('Scatter'),\n },\n {\n value: 'box',\n label: _('Box'),\n },\n {\n value: 'bar',\n label: _('Bar'),\n },\n {\n value: 'heatmap',\n label: _('Heatmap'),\n },\n {\n value: 'histogram',\n label: _('Histogram'),\n },\n {\n value: 'histogram2d',\n label: _('2D Histogram'),\n },\n {\n value: 'histogram2dcontour',\n label: _('2D Contour Histogram'),\n },\n {\n value: 'pie',\n label: _('Pie'),\n },\n {\n value: 'contour',\n label: _('Contour'),\n },\n {\n value: 'scatterternary',\n label: _('Ternary Scatter'),\n },\n {\n value: 'violin',\n label: _('Violin'),\n },\n {\n value: 'scatter3d',\n label: _('3D Scatter'),\n },\n {\n value: 'surface',\n label: _('Surface'),\n },\n {\n value: 'mesh3d',\n label: _('3D Mesh'),\n },\n {\n value: 'cone',\n label: _('Cone'),\n },\n {\n value: 'streamtube',\n label: _('Streamtube'),\n },\n {\n value: 'scattergeo',\n label: _('Atlas Map'),\n },\n {\n value: 'choropleth',\n label: _('Choropleth'),\n },\n {\n value: 'scattergl',\n label: _('Scatter GL'),\n },\n {\n value: 'pointcloud',\n label: _('Point Cloud'),\n },\n {\n value: 'heatmapgl',\n label: _('Heatmap GL'),\n },\n {\n value: 'parcoords',\n label: _('Parallel Coordinates'),\n },\n {\n value: 'sankey',\n label: _('Sankey'),\n },\n {\n value: 'table',\n label: _('Table'),\n },\n {\n value: 'carpet',\n label: _('Carpet'),\n },\n {\n value: 'scattercarpet',\n label: _('Carpet Scatter'),\n },\n {\n value: 'contourcarpet',\n label: _('Carpet Contour'),\n },\n {\n value: 'ohlc',\n label: _('OHLC'),\n },\n {\n value: 'candlestick',\n label: _('Candlestick'),\n },\n {\n value: 'scatterpolar',\n label: _('Polar Scatter'),\n },\n {\n value: 'scatterpolargl',\n label: _('Polar Scatter GL'),\n },\n {\n value: 'barpolar',\n label: _('Polar Bar'),\n },\n ].filter(obj => traceTypes.indexOf(obj.value) !== -1);\n\n const traceIndex = traceType => traceOptions.findIndex(opt => opt.value === traceType);\n\n traceOptions.splice(\n traceIndex('scatter') + 1,\n 0,\n {label: _('Line'), value: 'line'},\n {label: _('Area'), value: 'area'},\n {label: _('Timeseries'), value: 'timeseries'}\n );\n\n traceOptions.splice(traceIndex('scatter3d') + 1, 0, {\n label: _('3D Line'),\n value: 'line3d',\n });\n\n if (context.config && context.config.mapboxAccessToken) {\n traceOptions.push({\n value: 'scattermapbox',\n label: _('Satellite Map'),\n });\n }\n\n return traceOptions;\n}\n\nexport {computeTraceOptionsFromSchema};\n"]} \ No newline at end of file diff --git a/lib/lib/connectAggregationToTransform.js b/lib/lib/connectAggregationToTransform.js deleted file mode 100644 index c785d4390..000000000 --- a/lib/lib/connectAggregationToTransform.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectAggregationToTransform; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectAggregationToTransform(WrappedComponent) { - var AggregationConnectedComponent = function (_Component) { - _inherits(AggregationConnectedComponent, _Component); - - function AggregationConnectedComponent(props, context) { - _classCallCheck(this, AggregationConnectedComponent); - - var _this = _possibleConstructorReturn(this, (AggregationConnectedComponent.__proto__ || Object.getPrototypeOf(AggregationConnectedComponent)).call(this, props, context)); - - _this.updateAggregation = _this.updateAggregation.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(AggregationConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var aggregationIndex = props.aggregationIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var aggregations = container && container.aggregations || []; - var fullAggregations = fullContainer.aggregations || []; - this.container = aggregations[aggregationIndex]; - this.fullContainer = fullAggregations[aggregationIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('aggregations[].' + attr); - }, - updateContainer: this.updateAggregation, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('aggregations[].' + attr); - }, - updateContainer: this.updateAggregation, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateAggregation', - value: function updateAggregation(update) { - var newUpdate = {}; - var path = 'aggregations[' + this.props.aggregationIndex + ']'; - for (var key in update) { - newUpdate[path + '.' + key] = update[key]; - } - newUpdate[path + '.target'] = this.fullContainer.target; - newUpdate[path + '.enabled'] = true; - this.context.updateContainer(newUpdate); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return AggregationConnectedComponent; - }(_react.Component); - - AggregationConnectedComponent.displayName = 'AggregationConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - AggregationConnectedComponent.propTypes = { - aggregationIndex: _propTypes2.default.number.isRequired - }; - - AggregationConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - AggregationConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return AggregationConnectedComponent; -} -//# sourceMappingURL=connectAggregationToTransform.js.map \ No newline at end of file diff --git a/lib/lib/connectAggregationToTransform.js.map b/lib/lib/connectAggregationToTransform.js.map deleted file mode 100644 index 16f4b4090..000000000 --- a/lib/lib/connectAggregationToTransform.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectAggregationToTransform.js"],"names":["connectAggregationToTransform","WrappedComponent","AggregationConnectedComponent","props","context","updateAggregation","bind","setLocals","nextProps","nextContext","aggregationIndex","container","fullContainer","aggregations","fullAggregations","getValObject","attr","updateContainer","update","newUpdate","path","key","target","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","onUpdate","func","childContextTypes","deleteContainer","plotly_editor_traits"],"mappings":";;;;;;;;kBAIwBA,6B;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,6BAAT,CAAuCC,gBAAvC,EAAyD;AAAA,MAChEC,6BADgE;AAAA;;AAEpE,2CAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,gKACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBC,IAAvB,OAAzB;AACA,YAAKC,SAAL,CAAeJ,KAAf,EAAsBC,OAAtB;AAJ0B;AAK3B;;AAPmE;AAAA;AAAA,gDAS1CI,SAT0C,EAS/BC,WAT+B,EASlB;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAXmE;AAAA;AAAA,gCAa1DN,KAb0D,EAanDC,OAbmD,EAa1C;AAAA,YACjBM,gBADiB,GACGP,KADH,CACjBO,gBADiB;AAAA,YAEjBC,SAFiB,GAEWP,OAFX,CAEjBO,SAFiB;AAAA,YAENC,aAFM,GAEWR,OAFX,CAENQ,aAFM;;;AAIxB,YAAMC,eAAgBF,aAAaA,UAAUE,YAAxB,IAAyC,EAA9D;AACA,YAAMC,mBAAmBF,cAAcC,YAAd,IAA8B,EAAvD;AACA,aAAKF,SAAL,GAAiBE,aAAaH,gBAAb,CAAjB;AACA,aAAKE,aAAL,GAAqBE,iBAAiBJ,gBAAjB,CAArB;AACD;AArBmE;AAAA;AAAA,wCAuBlD;AAAA;;AAChB,eAAO;AACLK,wBAAc;AAAA,mBACZ,CAAC,OAAKX,OAAL,CAAaW,YAAd,GAA6B,IAA7B,GAAoC,OAAKX,OAAL,CAAaW,YAAb,qBAA4C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,IAJuB;AAK3CjB,qBAAiBS,oBAAUQ,IALgB;AAM3CnB,kBAAcW,oBAAUQ;AANmB,GAA7C;;AASAhC,gCAA8BiC,iBAA9B,GAAkD;AAChDlB,qBAAiBS,oBAAUQ,IADqB;AAEhDE,qBAAiBV,oBAAUQ,IAFqB;AAGhDvB,eAAWe,oBAAUI,MAH2B;AAIhDlB,mBAAec,oBAAUI,MAJuB;AAKhDf,kBAAcW,oBAAUQ;AALwB,GAAlD;;AA5EsE,MAoF/DG,oBApF+D,GAoFvCpC,gBApFuC,CAoF/DoC,oBApF+D;;AAqFtEnC,gCAA8BmC,oBAA9B,GAAqDA,oBAArD;;AAEA,SAAOnC,6BAAP;AACD","file":"connectAggregationToTransform.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\n\nexport default function connectAggregationToTransform(WrappedComponent) {\n class AggregationConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.updateAggregation = this.updateAggregation.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {aggregationIndex} = props;\n const {container, fullContainer} = context;\n\n const aggregations = (container && container.aggregations) || [];\n const fullAggregations = fullContainer.aggregations || [];\n this.container = aggregations[aggregationIndex];\n this.fullContainer = fullAggregations[aggregationIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`aggregations[].${attr}`),\n updateContainer: this.updateAggregation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`aggregations[].${attr}`),\n updateContainer: this.updateAggregation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateAggregation(update) {\n const newUpdate = {};\n const path = `aggregations[${this.props.aggregationIndex}]`;\n for (const key in update) {\n newUpdate[`${path}.${key}`] = update[key];\n }\n newUpdate[`${path}.target`] = this.fullContainer.target;\n newUpdate[`${path}.enabled`] = true;\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n AggregationConnectedComponent.displayName = `AggregationConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n AggregationConnectedComponent.propTypes = {\n aggregationIndex: PropTypes.number.isRequired,\n };\n\n AggregationConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n AggregationConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return AggregationConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectAnnotationToLayout.js b/lib/lib/connectAnnotationToLayout.js deleted file mode 100644 index 85a2dffbe..000000000 --- a/lib/lib/connectAnnotationToLayout.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectAnnotationToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectAnnotationToLayout(WrappedComponent) { - var AnnotationConnectedComponent = function (_Component) { - _inherits(AnnotationConnectedComponent, _Component); - - function AnnotationConnectedComponent(props, context) { - _classCallCheck(this, AnnotationConnectedComponent); - - var _this = _possibleConstructorReturn(this, (AnnotationConnectedComponent.__proto__ || Object.getPrototypeOf(AnnotationConnectedComponent)).call(this, props, context)); - - _this.deleteAnnotation = _this.deleteAnnotation.bind(_this); - _this.updateAnnotation = _this.updateAnnotation.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(AnnotationConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var annotationIndex = props.annotationIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var annotations = container.annotations || []; - var fullAnnotations = fullContainer.annotations || []; - this.container = annotations[annotationIndex]; - this.fullContainer = fullAnnotations[annotationIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('annotations[].' + attr); - }, - updateContainer: this.updateAnnotation, - deleteContainer: this.deleteAnnotation, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('annotations[].' + attr); - }, - updateContainer: this.updateAnnotation, - deleteContainer: this.deleteAnnotation, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateAnnotation', - value: function updateAnnotation(update) { - var newUpdate = {}; - var annotationIndex = this.props.annotationIndex; - - for (var key in update) { - var newkey = 'annotations[' + annotationIndex + '].' + key; - newUpdate[newkey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'deleteAnnotation', - value: function deleteAnnotation() { - if (this.context.onUpdate) { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.DELETE_ANNOTATION, - payload: { annotationIndex: this.props.annotationIndex } - }); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return AnnotationConnectedComponent; - }(_react.Component); - - AnnotationConnectedComponent.displayName = 'AnnotationConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - AnnotationConnectedComponent.propTypes = { - annotationIndex: _propTypes2.default.number.isRequired - }; - - AnnotationConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - AnnotationConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - AnnotationConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return AnnotationConnectedComponent; -} -//# sourceMappingURL=connectAnnotationToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectAnnotationToLayout.js.map b/lib/lib/connectAnnotationToLayout.js.map deleted file mode 100644 index 14d377d05..000000000 --- a/lib/lib/connectAnnotationToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectAnnotationToLayout.js"],"names":["connectAnnotationToLayout","WrappedComponent","AnnotationConnectedComponent","props","context","deleteAnnotation","bind","updateAnnotation","setLocals","nextProps","nextContext","annotationIndex","container","fullContainer","annotations","fullAnnotations","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_ANNOTATION","payload","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,yB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,yBAAT,CAAmCC,gBAAnC,EAAqD;AAAA,MAC5DC,4BAD4D;AAAA;;AAEhE,0CAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,8JACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,gBAAL,GAAwB,MAAKA,gBAAL,CAAsBC,IAAtB,OAAxB;AACA,YAAKC,gBAAL,GAAwB,MAAKA,gBAAL,CAAsBD,IAAtB,OAAxB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR+D;AAAA;AAAA,gDAUtCK,SAVsC,EAU3BC,WAV2B,EAUd;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZ+D;AAAA;AAAA,gCActDP,KAdsD,EAc/CC,OAd+C,EActC;AAAA,YACjBO,eADiB,GACER,KADF,CACjBQ,eADiB;AAAA,YAEjBC,SAFiB,GAEWR,OAFX,CAEjBQ,SAFiB;AAAA,YAENC,aAFM,GAEWT,OAFX,CAENS,aAFM;;;AAIxB,YAAMC,cAAcF,UAAUE,WAAV,IAAyB,EAA7C;AACA,YAAMC,kBAAkBF,cAAcC,WAAd,IAA6B,EAArD;AACA,aAAKF,SAAL,GAAiBE,YAAYH,eAAZ,CAAjB;AACA,aAAKE,aAAL,GAAqBE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ACF;AA/D+D;AAAA;AAAA,+BAiEvD;AACP,eAAO,8BAAC,gBAAD,EAAsB,KAAKR,KAA3B,CAAP;AACD;AAnE+D;;AAAA;AAAA,IACvB0B,gBADuB;;AAsElE3B,+BAA6B4B,WAA7B,2BAAiE,yBAC/D7B,gBAD+D,CAAjE;;AAIAC,+BAA6B6B,SAA7B,GAAyC;AACvCpB,qBAAiBqB,oBAAUC,MAAV,CAAiBC;AADK,GAAzC;;AAIAhC,+BAA6BiC,YAA7B,GAA4C;AAC1CvB,eAAWoB,oBAAUI,MADqB;AAE1CvB,mBAAemB,oBAAUI,MAFiB;AAG1CC,UAAML,oBAAUM,KAH0B;AAI1Cd,cAAUQ,oBAAUO,IAJsB;AAK1CrB,qBAAiBc,oBAAUO,IALe;AAM1CvB,kBAAcgB,oBAAUO;AANkB,GAA5C;;AASArC,+BAA6BsC,iBAA7B,GAAiD;AAC/CtB,qBAAiBc,oBAAUO,IADoB;AAE/CpB,qBAAiBa,oBAAUO,IAFoB;AAG/C3B,eAAWoB,oBAAUI,MAH0B;AAI/CvB,mBAAemB,oBAAUI,MAJsB;AAK/CpB,kBAAcgB,oBAAUO;AALuB,GAAjD;;AAvFkE,MA+F3DE,oBA/F2D,GA+FnCxC,gBA/FmC,CA+F3DwC,oBA/F2D;;AAgGlEvC,+BAA6BuC,oBAA7B,GAAoDA,oBAApD;;AAEA,SAAOvC,4BAAP;AACD","file":"connectAnnotationToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectAnnotationToLayout(WrappedComponent) {\n class AnnotationConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteAnnotation = this.deleteAnnotation.bind(this);\n this.updateAnnotation = this.updateAnnotation.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {annotationIndex} = props;\n const {container, fullContainer} = context;\n\n const annotations = container.annotations || [];\n const fullAnnotations = fullContainer.annotations || [];\n this.container = annotations[annotationIndex];\n this.fullContainer = fullAnnotations[annotationIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`annotations[].${attr}`),\n updateContainer: this.updateAnnotation,\n deleteContainer: this.deleteAnnotation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`annotations[].${attr}`),\n updateContainer: this.updateAnnotation,\n deleteContainer: this.deleteAnnotation,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateAnnotation(update) {\n const newUpdate = {};\n const {annotationIndex} = this.props;\n for (const key in update) {\n const newkey = `annotations[${annotationIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteAnnotation() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_ANNOTATION,\n payload: {annotationIndex: this.props.annotationIndex},\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n AnnotationConnectedComponent.displayName = `AnnotationConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n AnnotationConnectedComponent.propTypes = {\n annotationIndex: PropTypes.number.isRequired,\n };\n\n AnnotationConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n AnnotationConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n AnnotationConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return AnnotationConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectAxesToLayout.js b/lib/lib/connectAxesToLayout.js deleted file mode 100644 index c3f61aee0..000000000 --- a/lib/lib/connectAxesToLayout.js +++ /dev/null @@ -1,235 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectAxesToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _nested_property = require('plotly.js/src/lib/nested_property'); - -var _nested_property2 = _interopRequireDefault(_nested_property); - -var _multiValues = require('./multiValues'); - -var _lib = require('../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function computeAxesOptions(axes, props, context) { - var _ = context.localize; - var filteredAxes = axes; - if (props.axisFilter) { - filteredAxes = axes.filter(props.axisFilter); - } - - var options = []; - for (var i = 0; i < filteredAxes.length; i++) { - var ax = filteredAxes[i]; - var label = (0, _lib.capitalize)(ax._name.split('axis')[0]); - var value = (ax._subplot && !ax._subplot.includes('xaxis') && !ax._subplot.includes('yaxis') ? ax._subplot + '.' + ax._name : ax._subplot).trim(); - - options[i] = { - label: label, - value: value, - axisGroup: ax._axisGroup, - title: (0, _lib.getAxisTitle)(ax) - }; - } - - return options.length > 1 ? [{ label: _('All'), value: 'allaxes' }].concat(options) : options; -} - -function connectAxesToLayout(WrappedComponent) { - var AxesConnectedComponent = function (_Component) { - _inherits(AxesConnectedComponent, _Component); - - function AxesConnectedComponent(props, context) { - _classCallCheck(this, AxesConnectedComponent); - - var _this = _possibleConstructorReturn(this, (AxesConnectedComponent.__proto__ || Object.getPrototypeOf(AxesConnectedComponent)).call(this, props, context)); - - _this.axes = (0, _lib.getAllAxes)(context.fullContainer); - _this.axesOptions = computeAxesOptions(_this.axes, props, context); - - // this.axesOptions can be an empty array when we have a filter on an AxesFold - // and no axes correspond to the condition - var defaultAxesTarget = null; - if (_this.axesOptions.length === 1) { - defaultAxesTarget = _this.axesOptions[0].value; - } - if (_this.axesOptions.length > 1) { - defaultAxesTarget = _this.axesOptions[1].value; - } - - _this.state = { - axesTarget: defaultAxesTarget - }; - - _this.axesTargetHandler = _this.axesTargetHandler.bind(_this); - _this.updateContainer = _this.updateContainer.bind(_this); - - _this.setLocals(props, _this.state, context); - return _this; - } - - _createClass(AxesConnectedComponent, [{ - key: 'componentWillUpdate', - value: function componentWillUpdate(nextProps, nextState, nextContext) { - this.axes = (0, _lib.getAllAxes)(nextContext.fullContainer); - this.axesOptions = computeAxesOptions(this.axes, nextProps, nextContext); - // This is not enough, what if plotly.js adds new axes... - this.setLocals(nextProps, nextState, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(nextProps, nextState, nextContext) { - var container = nextContext.container, - fullContainer = nextContext.fullContainer; - var axesTarget = nextState.axesTarget; - - - if (axesTarget === 'allaxes') { - var multiValuedContainer = (0, _multiValues.deepCopyPublic)(this.axes[0]); - this.axes.slice(1).forEach(function (ax) { - return Object.keys(ax).forEach(function (key) { - return (0, _multiValues.setMultiValuedContainer)(multiValuedContainer, (0, _multiValues.deepCopyPublic)(ax), key, { - searchArrays: true - }); - }); - }); - this.fullContainer = multiValuedContainer; - this.defaultContainer = this.axes[0]; - this.container = {}; - } else if (axesTarget) { - this.fullContainer = (0, _nested_property2.default)(fullContainer, axesTarget).get(); - this.container = this.container = (0, _nested_property2.default)(container, axesTarget).get() || {}; - } - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject(_this2.state.axesTarget + '.' + attr); - }, - axesOptions: this.axesOptions, - axesTarget: this.state.axesTarget, - axesTargetHandler: this.axesTargetHandler, - container: this.container, - defaultContainer: this.defaultContainer, - fullContainer: this.fullContainer, - updateContainer: this.updateContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject(_this3.state.axesTarget + '.' + attr); - }, - axesOptions: this.axesOptions, - axesTarget: this.state.axesTarget, - axesTargetHandler: this.axesTargetHandler, - container: this.container, - defaultContainer: this.defaultContainer, - fullContainer: this.fullContainer, - updateContainer: this.updateContainer - }; - } - }, { - key: 'axesTargetHandler', - value: function axesTargetHandler(axesTarget) { - this.setState({ axesTarget: axesTarget }); - } - }, { - key: 'updateContainer', - value: function updateContainer(update) { - var newUpdate = {}; - var axesTarget = this.state.axesTarget; - - - var axes = this.axes; - if (axesTarget !== 'allaxes') { - // only the selected container - axes = [this.fullContainer]; - } - - var keys = Object.keys(update); - for (var i = 0; i < keys.length; i++) { - for (var j = 0; j < axes.length; j++) { - var subplot = axes[j]._subplot; - var axesKey = axes[j]._name; - - if (subplot && !subplot.includes('xaxis') && !subplot.includes('yaxis')) { - axesKey = subplot + '.' + axesKey; - } - - var newkey = axesKey + '.' + keys[i]; - newUpdate[newkey] = update[keys[i]]; - } - } - - this.context.updateContainer(newUpdate); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, _extends({}, this.props, { options: this.axesOptions })); - } - }]); - - return AxesConnectedComponent; - }(_react.Component); - - AxesConnectedComponent.displayName = 'AxesConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - AxesConnectedComponent.contextTypes = { - container: _propTypes2.default.object.isRequired, - fullContainer: _propTypes2.default.object.isRequired, - updateContainer: _propTypes2.default.func, - localize: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - AxesConnectedComponent.childContextTypes = { - axesOptions: _propTypes2.default.array, - axesTarget: _propTypes2.default.string, - axesTargetHandler: _propTypes2.default.func, - container: _propTypes2.default.object, - defaultContainer: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return AxesConnectedComponent; -} -//# sourceMappingURL=connectAxesToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectAxesToLayout.js.map b/lib/lib/connectAxesToLayout.js.map deleted file mode 100644 index 292278209..000000000 --- a/lib/lib/connectAxesToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectAxesToLayout.js"],"names":["connectAxesToLayout","computeAxesOptions","axes","props","context","_","localize","filteredAxes","axisFilter","filter","options","i","length","ax","label","_name","split","value","_subplot","includes","trim","axisGroup","_axisGroup","title","concat","WrappedComponent","AxesConnectedComponent","fullContainer","axesOptions","defaultAxesTarget","state","axesTarget","axesTargetHandler","bind","updateContainer","setLocals","nextProps","nextState","nextContext","container","multiValuedContainer","slice","forEach","Object","keys","key","searchArrays","defaultContainer","get","getValObject","attr","setState","update","newUpdate","j","subplot","axesKey","newkey","Component","displayName","contextTypes","PropTypes","object","isRequired","func","childContextTypes","array","string","plotly_editor_traits"],"mappings":";;;;;;;;;;kBAiCwBA,mB;;AAjCxB;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEA,SAASC,kBAAT,CAA4BC,IAA5B,EAAkCC,KAAlC,EAAyCC,OAAzC,EAAkD;AAChD,MAAMC,IAAID,QAAQE,QAAlB;AACA,MAAIC,eAAeL,IAAnB;AACA,MAAIC,MAAMK,UAAV,EAAsB;AACpBD,mBAAeL,KAAKO,MAAL,CAAYN,MAAMK,UAAlB,CAAf;AACD;;AAED,MAAME,UAAU,EAAhB;AACA,OAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIJ,aAAaK,MAAjC,EAAyCD,GAAzC,EAA8C;AAC5C,QAAME,KAAKN,aAAaI,CAAb,CAAX;AACA,QAAMG,QAAQ,qBAAWD,GAAGE,KAAH,CAASC,KAAT,CAAe,MAAf,EAAuB,CAAvB,CAAX,CAAd;AACA,QAAMC,QAAQ,CAACJ,GAAGK,QAAH,IAAe,CAACL,GAAGK,QAAH,CAAYC,QAAZ,CAAqB,OAArB,CAAhB,IAAiD,CAACN,GAAGK,QAAH,CAAYC,QAAZ,CAAqB,OAArB,CAAlD,GACXN,GAAGK,QAAH,GAAc,GAAd,GAAoBL,GAAGE,KADZ,GAEXF,GAAGK,QAFO,EAGZE,IAHY,EAAd;;AAKAV,YAAQC,CAAR,IAAa;AACXG,kBADW;AAEXG,kBAFW;AAGXI,iBAAWR,GAAGS,UAHH;AAIXC,aAAO,uBAAaV,EAAb;AAJI,KAAb;AAMD;;AAED,SAAOH,QAAQE,MAAR,GAAiB,CAAjB,GAAqB,CAAC,EAACE,OAAOT,EAAE,KAAF,CAAR,EAAkBY,OAAO,SAAzB,EAAD,EAAsCO,MAAtC,CAA6Cd,OAA7C,CAArB,GAA6EA,OAApF;AACD;;AAEc,SAASV,mB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oJ5D1C,yBAAuB0C,oBAAvB,GAA8CA,oBAA9C;;AAEA,SAAO1C,sBAAP;AACD","file":"connectAxesToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {deepCopyPublic, setMultiValuedContainer} from './multiValues';\nimport {capitalize, getAllAxes, getDisplayName, getAxisTitle} from '../lib';\n\nfunction computeAxesOptions(axes, props, context) {\n const _ = context.localize;\n let filteredAxes = axes;\n if (props.axisFilter) {\n filteredAxes = axes.filter(props.axisFilter);\n }\n\n const options = [];\n for (let i = 0; i < filteredAxes.length; i++) {\n const ax = filteredAxes[i];\n const label = capitalize(ax._name.split('axis')[0]);\n const value = (ax._subplot && !ax._subplot.includes('xaxis') && !ax._subplot.includes('yaxis')\n ? ax._subplot + '.' + ax._name\n : ax._subplot\n ).trim();\n\n options[i] = {\n label,\n value,\n axisGroup: ax._axisGroup,\n title: getAxisTitle(ax),\n };\n }\n\n return options.length > 1 ? [{label: _('All'), value: 'allaxes'}].concat(options) : options;\n}\n\nexport default function connectAxesToLayout(WrappedComponent) {\n class AxesConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.axes = getAllAxes(context.fullContainer);\n this.axesOptions = computeAxesOptions(this.axes, props, context);\n\n // this.axesOptions can be an empty array when we have a filter on an AxesFold\n // and no axes correspond to the condition\n let defaultAxesTarget = null;\n if (this.axesOptions.length === 1) {\n defaultAxesTarget = this.axesOptions[0].value;\n }\n if (this.axesOptions.length > 1) {\n defaultAxesTarget = this.axesOptions[1].value;\n }\n\n this.state = {\n axesTarget: defaultAxesTarget,\n };\n\n this.axesTargetHandler = this.axesTargetHandler.bind(this);\n this.updateContainer = this.updateContainer.bind(this);\n\n this.setLocals(props, this.state, context);\n }\n\n componentWillUpdate(nextProps, nextState, nextContext) {\n this.axes = getAllAxes(nextContext.fullContainer);\n this.axesOptions = computeAxesOptions(this.axes, nextProps, nextContext);\n // This is not enough, what if plotly.js adds new axes...\n this.setLocals(nextProps, nextState, nextContext);\n }\n\n setLocals(nextProps, nextState, nextContext) {\n const {container, fullContainer} = nextContext;\n const {axesTarget} = nextState;\n\n if (axesTarget === 'allaxes') {\n const multiValuedContainer = deepCopyPublic(this.axes[0]);\n this.axes.slice(1).forEach(ax =>\n Object.keys(ax).forEach(key =>\n setMultiValuedContainer(multiValuedContainer, deepCopyPublic(ax), key, {\n searchArrays: true,\n })\n )\n );\n this.fullContainer = multiValuedContainer;\n this.defaultContainer = this.axes[0];\n this.container = {};\n } else if (axesTarget) {\n this.fullContainer = nestedProperty(fullContainer, axesTarget).get();\n this.container = this.container = nestedProperty(container, axesTarget).get() || {};\n }\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.state.axesTarget}.${attr}`),\n axesOptions: this.axesOptions,\n axesTarget: this.state.axesTarget,\n axesTargetHandler: this.axesTargetHandler,\n container: this.container,\n defaultContainer: this.defaultContainer,\n fullContainer: this.fullContainer,\n updateContainer: this.updateContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.state.axesTarget}.${attr}`),\n axesOptions: this.axesOptions,\n axesTarget: this.state.axesTarget,\n axesTargetHandler: this.axesTargetHandler,\n container: this.container,\n defaultContainer: this.defaultContainer,\n fullContainer: this.fullContainer,\n updateContainer: this.updateContainer,\n };\n }\n\n axesTargetHandler(axesTarget) {\n this.setState({axesTarget});\n }\n\n updateContainer(update) {\n const newUpdate = {};\n const {axesTarget} = this.state;\n\n let axes = this.axes;\n if (axesTarget !== 'allaxes') {\n // only the selected container\n axes = [this.fullContainer];\n }\n\n const keys = Object.keys(update);\n for (let i = 0; i < keys.length; i++) {\n for (let j = 0; j < axes.length; j++) {\n const subplot = axes[j]._subplot;\n let axesKey = axes[j]._name;\n\n if (subplot && !subplot.includes('xaxis') && !subplot.includes('yaxis')) {\n axesKey = `${subplot}.${axesKey}`;\n }\n\n const newkey = `${axesKey}.${keys[i]}`;\n newUpdate[newkey] = update[keys[i]];\n }\n }\n\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n AxesConnectedComponent.displayName = `AxesConnected${getDisplayName(WrappedComponent)}`;\n\n AxesConnectedComponent.contextTypes = {\n container: PropTypes.object.isRequired,\n fullContainer: PropTypes.object.isRequired,\n updateContainer: PropTypes.func,\n localize: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n AxesConnectedComponent.childContextTypes = {\n axesOptions: PropTypes.array,\n axesTarget: PropTypes.string,\n axesTargetHandler: PropTypes.func,\n container: PropTypes.object,\n defaultContainer: PropTypes.object,\n fullContainer: PropTypes.object,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return AxesConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectCartesianSubplotToLayout.js b/lib/lib/connectCartesianSubplotToLayout.js deleted file mode 100644 index cae7cd537..000000000 --- a/lib/lib/connectCartesianSubplotToLayout.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectCartesianSubplotToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectCartesianSubplotToLayout(WrappedComponent) { - var SubplotConnectedComponent = function (_Component) { - _inherits(SubplotConnectedComponent, _Component); - - function SubplotConnectedComponent(props, context) { - _classCallCheck(this, SubplotConnectedComponent); - - var _this = _possibleConstructorReturn(this, (SubplotConnectedComponent.__proto__ || Object.getPrototypeOf(SubplotConnectedComponent)).call(this, props, context)); - - _this.updateSubplot = _this.updateSubplot.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(SubplotConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var xaxis = props.xaxis, - yaxis = props.yaxis, - traceIndexes = props.traceIndexes; - var container = context.container, - fullContainer = context.fullContainer, - data = context.data; - - - this.container = { - xaxis: container[xaxis], - yaxis: container[yaxis] - }; - this.fullContainer = { - xaxis: fullContainer[xaxis], - yaxis: fullContainer[yaxis] - }; - - var trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {}; - var fullTrace = (0, _lib.getFullTrace)(props, context); - - if (trace && fullTrace) { - this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace)); - this.name = fullTrace.name; - } - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject(attr.replace('xaxis', _this2.props.xaxis).replace('yaxis', _this2.props.yaxis)); - }, - updateContainer: this.updateSubplot, - deleteContainer: this.deleteSubplot, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject(attr.replace('xaxis', _this3.props.xaxis).replace('yaxis', _this3.props.yaxis)); - }, - updateContainer: this.updateSubplot, - deleteContainer: this.deleteSubplot, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateSubplot', - value: function updateSubplot(update) { - var newUpdate = {}; - for (var key in update) { - var newKey = key.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis); - newUpdate[newKey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, _extends({ name: this.name, icon: this.icon }, this.props)); - } - }]); - - return SubplotConnectedComponent; - }(_react.Component); - - SubplotConnectedComponent.displayName = 'SubplotConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - SubplotConnectedComponent.propTypes = { - xaxis: _propTypes2.default.string.isRequired, - yaxis: _propTypes2.default.string.isRequired - }; - - SubplotConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - fullData: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - SubplotConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return SubplotConnectedComponent; -} -//# sourceMappingURL=connectCartesianSubplotToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectCartesianSubplotToLayout.js.map b/lib/lib/connectCartesianSubplotToLayout.js.map deleted file mode 100644 index 1aa70547f..000000000 --- a/lib/lib/connectCartesianSubplotToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectCartesianSubplotToLayout.js"],"names":["connectCartesianSubplotToLayout","WrappedComponent","SubplotConnectedComponent","props","context","updateSubplot","bind","setLocals","nextProps","nextContext","xaxis","yaxis","traceIndexes","container","fullContainer","data","trace","length","fullTrace","icon","name","getValObject","attr","replace","updateContainer","deleteContainer","deleteSubplot","update","newUpdate","key","newKey","Component","displayName","propTypes","PropTypes","string","isRequired","contextTypes","object","array","fullData","onUpdate","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;;;kBAIwBA,+B;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,+BAAT,CAAyCC,gBAAzC,EAA2D;AAAA,MAClEC,yBADkE;AAAA;;AAEtE,uCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,wJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,aAAL,GAAqB,MAAKA,aAAL,CAAmBC,IAAnB,OAArB;AACA,YAAKC,SAAL,CAAeJ,KAAf,EAAsBC,OAAtB;AAJ0B;AAK3B;;AAPqE;AAAA;AAAA,gDAS5CI,SAT4C,EASjCC,WATiC,EASpB;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAXqE;AAAA;AAAA,gCAa5DN,KAb4D,EAarDC,OAbqD,EAa5C;AAAA,YACjBM,KADiB,GACaP,KADb,CACjBO,KADiB;AAAA,YACVC,KADU,GACaR,KADb,CACVQ,KADU;AAAA,YACHC,YADG,GACaT,KADb,CACHS,Y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JmB;AAKvCE,cAAUP,oBAAUQ,IALmB;AAMvClB,qBAAiBU,oBAAUQ,IANY;AAOvCrB,kBAAca,oBAAUQ;AAPe,GAAzC;;AAUAxC,4BAA0ByC,iBAA1B,GAA8C;AAC5CnB,qBAAiBU,oBAAUQ,IADiB;AAE5CjB,qBAAiBS,oBAAUQ,IAFiB;AAG5C7B,eAAWqB,oBAAUI,MAHuB;AAI5CxB,mBAAeoB,oBAAUI,MAJmB;AAK5CjB,kBAAca,oBAAUQ;AALoB,GAA9C;;AAhGwE,MAwGjEE,oBAxGiE,GAwGzC3C,gBAxGyC,CAwGjE2C,oBAxGiE;;AAyGxE1C,4BAA0B0C,oBAA1B,GAAiDA,oBAAjD;;AAEA,SAAO1C,yBAAP;AACD","file":"connectCartesianSubplotToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib';\n\nexport default function connectCartesianSubplotToLayout(WrappedComponent) {\n class SubplotConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.updateSubplot = this.updateSubplot.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {xaxis, yaxis, traceIndexes} = props;\n const {container, fullContainer, data} = context;\n\n this.container = {\n xaxis: container[xaxis],\n yaxis: container[yaxis],\n };\n this.fullContainer = {\n xaxis: fullContainer[xaxis],\n yaxis: fullContainer[yaxis],\n };\n\n const trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {};\n const fullTrace = getFullTrace(props, context);\n\n if (trace && fullTrace) {\n this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace));\n this.name = fullTrace.name;\n }\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(\n attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis)\n ),\n updateContainer: this.updateSubplot,\n deleteContainer: this.deleteSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(\n attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis)\n ),\n updateContainer: this.updateSubplot,\n deleteContainer: this.deleteSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateSubplot(update) {\n const newUpdate = {};\n for (const key in update) {\n const newKey = key.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis);\n newUpdate[newKey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n SubplotConnectedComponent.displayName = `SubplotConnected${getDisplayName(WrappedComponent)}`;\n\n SubplotConnectedComponent.propTypes = {\n xaxis: PropTypes.string.isRequired,\n yaxis: PropTypes.string.isRequired,\n };\n\n SubplotConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n fullData: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n SubplotConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return SubplotConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectImageToLayout.js b/lib/lib/connectImageToLayout.js deleted file mode 100644 index b0a67e32c..000000000 --- a/lib/lib/connectImageToLayout.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectImageToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectImageToLayout(WrappedComponent) { - var ImageConnectedComponent = function (_Component) { - _inherits(ImageConnectedComponent, _Component); - - function ImageConnectedComponent(props, context) { - _classCallCheck(this, ImageConnectedComponent); - - var _this = _possibleConstructorReturn(this, (ImageConnectedComponent.__proto__ || Object.getPrototypeOf(ImageConnectedComponent)).call(this, props, context)); - - _this.deleteImage = _this.deleteImage.bind(_this); - _this.updateImage = _this.updateImage.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(ImageConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var imageIndex = props.imageIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var images = container.images || []; - var fullImages = fullContainer.images || []; - this.container = images[imageIndex]; - this.fullContainer = fullImages[imageIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('images[].' + attr); - }, - updateContainer: this.updateImage, - deleteContainer: this.deleteImage, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('images[].' + attr); - }, - updateContainer: this.updateImage, - deleteContainer: this.deleteImage, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateImage', - value: function updateImage(update) { - var newUpdate = {}; - var imageIndex = this.props.imageIndex; - - for (var key in update) { - var newkey = 'images[' + imageIndex + '].' + key; - newUpdate[newkey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'deleteImage', - value: function deleteImage() { - if (this.context.onUpdate) { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.DELETE_IMAGE, - payload: { imageIndex: this.props.imageIndex } - }); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return ImageConnectedComponent; - }(_react.Component); - - ImageConnectedComponent.displayName = 'ImageConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - ImageConnectedComponent.propTypes = { - imageIndex: _propTypes2.default.number.isRequired - }; - - ImageConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - ImageConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return ImageConnectedComponent; -} -//# sourceMappingURL=connectImageToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectImageToLayout.js.map b/lib/lib/connectImageToLayout.js.map deleted file mode 100644 index 80c6380dc..000000000 --- a/lib/lib/connectImageToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectImageToLayout.js"],"names":["connectImageToLayout","WrappedComponent","ImageConnectedComponent","props","context","deleteImage","bind","updateImage","setLocals","nextProps","nextContext","imageIndex","container","fullContainer","images","fullImages","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_IMAGE","payload","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,oB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,oBAAT,CAA8BC,gBAA9B,EAAgD;AAAA,MACvDC,uBADuD;AAAA;;AAE3D,qCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBD,IAAjB,OAAnB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR0D;AAAA;AAAA,gDAUjCK,SAViC,EAUtBC,WAVsB,EAUT;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZ0D;AAAA;AAAA,gCAcjDP,KAdiD,EAc1CC,OAd0C,EAcjC;AAAA,YACjBO,UADiB,GACHR,KADG,CACjBQ,UADiB;AAAA,YAEjBC,SAFiB,GAEWR,OAFX,CAEjBQ,SAFiB;AAAA,YAENC,aAFM,GAEWT,OAFX,CAENS,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,EAA2B;AACzB,eAAKpB,OAAL,CAAaoB,QAAb,CAAsB;AACpBC,kBAAMC,0BAAeC,YADD;AAEpBC,qBAAS,EAACjB,YAAY,KAAKR,KAAL,CAAWQ,UAAxB;AAFW,WAAtB;AAID;AACF;AA/D0D;AAAA;AAAA,+BAiElD;AACP,eAAO,8BAAC,gBAAD,EAAsB,KAAKR,KAA3B,CAAP;AACD;AAnE0D;;AAAA;AAAA,IACvB0B,gBADuB;;AAsE7D3B,0BAAwB4B,WAAxB,sBAAuD,yBAAe7B,gBAAf,CAAvD;;AAEAC,0BAAwB6B,SAAxB,GAAoC;AAClCpB,gBAAYqB,oBAAUC,MAAV,CAAiBC;AADK,GAApC;;AAIAhC,0BAAwBiC,YAAxB,GAAuC;AACrCvB,eAAWoB,oBAAUI,MADgB;AAErCvB,mBAAemB,oBAAUI,MAFY;AAGrCC,UAAML,oBAAUM,KAHqB;AAIrCd,cAAUQ,oBAAUO,IAJiB;AAKrCrB,qBAAiBc,oBAAUO,IALU;AAMrCvB,kBAAcgB,oBAAUO;AANa,GAAvC;;AASArC,0BAAwBsC,iBAAxB,GAA4C;AAC1CtB,qBAAiBc,oBAAUO,IADe;AAE1CpB,qBAAiBa,oBAAUO,IAFe;AAG1C3B,eAAWoB,oBAAUI,MAHqB;AAI1CvB,mBAAemB,oBAAUI,MAJiB;AAK1CpB,kBAAcgB,oBAAUO;AALkB,GAA5C;;AArF6D,MA6FtDE,oBA7FsD,GA6F9BxC,gBA7F8B,CA6FtDwC,oBA7FsD;;AA8F7DvC,0BAAwBuC,oBAAxB,GAA+CA,oBAA/C;;AAEA,SAAOvC,uBAAP;AACD","file":"connectImageToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectImageToLayout(WrappedComponent) {\n class ImageConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteImage = this.deleteImage.bind(this);\n this.updateImage = this.updateImage.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {imageIndex} = props;\n const {container, fullContainer} = context;\n\n const images = container.images || [];\n const fullImages = fullContainer.images || [];\n this.container = images[imageIndex];\n this.fullContainer = fullImages[imageIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`),\n updateContainer: this.updateImage,\n deleteContainer: this.deleteImage,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`),\n updateContainer: this.updateImage,\n deleteContainer: this.deleteImage,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateImage(update) {\n const newUpdate = {};\n const {imageIndex} = this.props;\n for (const key in update) {\n const newkey = `images[${imageIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteImage() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_IMAGE,\n payload: {imageIndex: this.props.imageIndex},\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n ImageConnectedComponent.displayName = `ImageConnected${getDisplayName(WrappedComponent)}`;\n\n ImageConnectedComponent.propTypes = {\n imageIndex: PropTypes.number.isRequired,\n };\n\n ImageConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n ImageConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return ImageConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectLayoutToPlot.js b/lib/lib/connectLayoutToPlot.js deleted file mode 100644 index 704f4936a..000000000 --- a/lib/lib/connectLayoutToPlot.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectLayoutToPlot; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _nested_property = require('plotly.js/src/lib/nested_property'); - -var _nested_property2 = _interopRequireDefault(_nested_property); - -var _lib = require('../lib'); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectLayoutToPlot(WrappedComponent) { - var LayoutConnectedComponent = function (_Component) { - _inherits(LayoutConnectedComponent, _Component); - - function LayoutConnectedComponent() { - _classCallCheck(this, LayoutConnectedComponent); - - return _possibleConstructorReturn(this, (LayoutConnectedComponent.__proto__ || Object.getPrototypeOf(LayoutConnectedComponent)).apply(this, arguments)); - } - - _createClass(LayoutConnectedComponent, [{ - key: 'getChildContext', - value: function getChildContext() { - var _context = this.context, - layout = _context.layout, - fullLayout = _context.fullLayout, - plotly = _context.plotly, - onUpdate = _context.onUpdate; - - - var updateContainer = function updateContainer(update) { - if (!onUpdate) { - return; - } - onUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT, - payload: { - update: update - } - }); - }; - - return { - getValObject: function getValObject(attr) { - return !plotly ? null : plotly.PlotSchema.getLayoutValObject(fullLayout, (0, _nested_property2.default)({}, attr).parts); - }, - updateContainer: updateContainer, - container: layout, - fullContainer: fullLayout - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _context2 = this.context, - layout = _context2.layout, - fullLayout = _context2.fullLayout, - plotly = _context2.plotly, - onUpdate = _context2.onUpdate; - - - var updateContainer = function updateContainer(update) { - if (!onUpdate) { - return; - } - onUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT, - payload: { - update: update - } - }); - }; - - return { - getValObject: function getValObject(attr) { - return !plotly ? null : plotly.PlotSchema.getLayoutValObject(fullLayout, (0, _nested_property2.default)({}, attr).parts); - }, - updateContainer: updateContainer, - container: layout, - fullContainer: fullLayout - }; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return LayoutConnectedComponent; - }(_react.Component); - - LayoutConnectedComponent.displayName = 'LayoutConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - LayoutConnectedComponent.contextTypes = { - layout: _propTypes2.default.object, - fullLayout: _propTypes2.default.object, - plotly: _propTypes2.default.object, - onUpdate: _propTypes2.default.func - }; - - LayoutConnectedComponent.childContextTypes = { - getValObject: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - LayoutConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return LayoutConnectedComponent; -} -//# sourceMappingURL=connectLayoutToPlot.js.map \ No newline at end of file diff --git a/lib/lib/connectLayoutToPlot.js.map b/lib/lib/connectLayoutToPlot.js.map deleted file mode 100644 index 87fd3a834..000000000 --- a/lib/lib/connectLayoutToPlot.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectLayoutToPlot.js"],"names":["connectLayoutToPlot","WrappedComponent","LayoutConnectedComponent","context","layout","fullLayout","plotly","onUpdate","updateContainer","type","EDITOR_ACTIONS","UPDATE_LAYOUT","payload","update","getValObject","PlotSchema","getLayoutValObject","attr","parts","container","fullContainer","props","Component","displayName","contextTypes","PropTypes","object","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAMwBA,mB;;AANxB;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,mBAAT,CAA6BC,gBAA7B,EAA+C;AAAA,MACtDC,wBADsD;AAAA;;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;AAAA,wCAExC;AAAA,uBAC+B,KAAKC,OADpC;AAAA,YACTC,MADS,YACTA,MADS;AAAA,YACDC,UADC,YACDA,UADC;AAAA,YACWC,MADX,YACWA,MADX;AAAA,YACmBC,QADnB,YACmBA,QADnB;;;AAGhB,YAAMC,kBAAkB,SAAlBA,eAAkB,SAAU;AAChC,cAAI,CAACD,QAAL,EAAe;AACb;AACD;AACDA,mBAAS;AACPE,kBAAMC,0BAAeC,aADd;AAEPC,qBAAS;AACPC;AADO;AAFF,WAAT;AAMD,SAVD;;AAYA,eAAO;AACLC,wBAAc;AAAA,mBACZ,CAACR,MAAD,GACI,IADJ,GAEIA,OAAOS,UAAP,CAAkBC,kBAAlB,CAAqCX,UAArC,EAAiD,+BAAe,EAAf,EAAmBY,IAAnB,EAAyBC,KAA1E,CAHQ;AAAA,WADT;AAK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,gBA3E6B,CA2ErD4B,oBA3EqD;;AA4E5D3B,2BAAyB2B,oBAAzB,GAAgDA,oBAAhD;;AAEA,SAAO3B,wBAAP;AACD","file":"connectLayoutToPlot.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectLayoutToPlot(WrappedComponent) {\n class LayoutConnectedComponent extends Component {\n getChildContext() {\n const {layout, fullLayout, plotly, onUpdate} = this.context;\n\n const updateContainer = update => {\n if (!onUpdate) {\n return;\n }\n onUpdate({\n type: EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update,\n },\n });\n };\n\n return {\n getValObject: attr =>\n !plotly\n ? null\n : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts),\n updateContainer,\n container: layout,\n fullContainer: fullLayout,\n };\n }\n\n provideValue() {\n const {layout, fullLayout, plotly, onUpdate} = this.context;\n\n const updateContainer = update => {\n if (!onUpdate) {\n return;\n }\n onUpdate({\n type: EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update,\n },\n });\n };\n\n return {\n getValObject: attr =>\n !plotly\n ? null\n : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts),\n updateContainer,\n container: layout,\n fullContainer: fullLayout,\n };\n }\n\n render() {\n return ;\n }\n }\n\n LayoutConnectedComponent.displayName = `LayoutConnected${getDisplayName(WrappedComponent)}`;\n\n LayoutConnectedComponent.contextTypes = {\n layout: PropTypes.object,\n fullLayout: PropTypes.object,\n plotly: PropTypes.object,\n onUpdate: PropTypes.func,\n };\n\n LayoutConnectedComponent.childContextTypes = {\n getValObject: PropTypes.func,\n updateContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n LayoutConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return LayoutConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectNonCartesianSubplotToLayout.js b/lib/lib/connectNonCartesianSubplotToLayout.js deleted file mode 100644 index 70d574725..000000000 --- a/lib/lib/connectNonCartesianSubplotToLayout.js +++ /dev/null @@ -1,148 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectNonCartesianSubplotToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectNonCartesianSubplotToLayout(WrappedComponent) { - var SubplotConnectedComponent = function (_Component) { - _inherits(SubplotConnectedComponent, _Component); - - function SubplotConnectedComponent(props, context) { - _classCallCheck(this, SubplotConnectedComponent); - - var _this = _possibleConstructorReturn(this, (SubplotConnectedComponent.__proto__ || Object.getPrototypeOf(SubplotConnectedComponent)).call(this, props, context)); - - _this.updateSubplot = _this.updateSubplot.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(SubplotConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var subplot = props.subplot, - traceIndexes = props.traceIndexes; - var container = context.container, - fullContainer = context.fullContainer, - data = context.data; - - - this.container = container[subplot] || {}; - this.fullContainer = fullContainer[subplot] || {}; - - var trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {}; - var fullTrace = (0, _lib.getFullTrace)(props, context); - - if (trace && fullTrace) { - this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace)); - this.name = fullTrace.name; - } - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject(_this2.props.subplot + '.' + attr); - }, - updateContainer: this.updateSubplot, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject(_this3.props.subplot + '.' + attr); - }, - updateContainer: this.updateSubplot, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateSubplot', - value: function updateSubplot(update) { - var newUpdate = {}; - for (var key in update) { - newUpdate[this.props.subplot + '.' + key] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, _extends({ name: this.name, icon: this.icon }, this.props)); - } - }]); - - return SubplotConnectedComponent; - }(_react.Component); - - SubplotConnectedComponent.displayName = 'SubplotConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - SubplotConnectedComponent.propTypes = { - subplot: _propTypes2.default.string.isRequired - }; - - SubplotConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - fullData: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - SubplotConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return SubplotConnectedComponent; -} -//# sourceMappingURL=connectNonCartesianSubplotToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectNonCartesianSubplotToLayout.js.map b/lib/lib/connectNonCartesianSubplotToLayout.js.map deleted file mode 100644 index 97efae896..000000000 --- a/lib/lib/connectNonCartesianSubplotToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectNonCartesianSubplotToLayout.js"],"names":["connectNonCartesianSubplotToLayout","WrappedComponent","SubplotConnectedComponent","props","context","updateSubplot","bind","setLocals","nextProps","nextContext","subplot","traceIndexes","container","fullContainer","data","trace","length","fullTrace","icon","name","getValObject","attr","updateContainer","update","newUpdate","key","Component","displayName","propTypes","PropTypes","string","isRequired","contextTypes","object","array","fullData","onUpdate","func","childContextTypes","deleteContainer","plotly_editor_traits"],"mappings":";;;;;;;;;;kBAIwBA,kC;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,kCAAT,CAA4CC,gBAA5C,EAA8D;AAAA,MACrEC,yBADqE;AAAA;;AAEzE,uCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,wJACpBD,KAD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C,4BAA0BoC,iBAA1B,GAA8C;AAC5ChB,qBAAiBO,oBAAUQ,IADiB;AAE5CE,qBAAiBV,oBAAUQ,IAFiB;AAG5CzB,eAAWiB,oBAAUI,MAHuB;AAI5CpB,mBAAegB,oBAAUI,MAJmB;AAK5Cb,kBAAcS,oBAAUQ;AALoB,GAA9C;;AAlF2E,MA0FpEG,oBA1FoE,GA0F5CvC,gBA1F4C,CA0FpEuC,oBA1FoE;;AA2F3EtC,4BAA0BsC,oBAA1B,GAAiDA,oBAAjD;;AAEA,SAAOtC,yBAAP;AACD","file":"connectNonCartesianSubplotToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib';\n\nexport default function connectNonCartesianSubplotToLayout(WrappedComponent) {\n class SubplotConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.updateSubplot = this.updateSubplot.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {subplot, traceIndexes} = props;\n const {container, fullContainer, data} = context;\n\n this.container = container[subplot] || {};\n this.fullContainer = fullContainer[subplot] || {};\n\n const trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {};\n const fullTrace = getFullTrace(props, context);\n\n if (trace && fullTrace) {\n this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace));\n this.name = fullTrace.name;\n }\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.props.subplot}.${attr}`),\n updateContainer: this.updateSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`${this.props.subplot}.${attr}`),\n updateContainer: this.updateSubplot,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateSubplot(update) {\n const newUpdate = {};\n for (const key in update) {\n newUpdate[`${this.props.subplot}.${key}`] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n SubplotConnectedComponent.displayName = `SubplotConnected${getDisplayName(WrappedComponent)}`;\n\n SubplotConnectedComponent.propTypes = {\n subplot: PropTypes.string.isRequired,\n };\n\n SubplotConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n fullData: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n SubplotConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return SubplotConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectRangeSelectorToAxis.js b/lib/lib/connectRangeSelectorToAxis.js deleted file mode 100644 index 78a529321..000000000 --- a/lib/lib/connectRangeSelectorToAxis.js +++ /dev/null @@ -1,158 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectRangeSelectorToAxis; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectRangeSelectorToAxis(WrappedComponent) { - var RangeSelectorConnectedComponent = function (_Component) { - _inherits(RangeSelectorConnectedComponent, _Component); - - function RangeSelectorConnectedComponent(props, context) { - _classCallCheck(this, RangeSelectorConnectedComponent); - - var _this = _possibleConstructorReturn(this, (RangeSelectorConnectedComponent.__proto__ || Object.getPrototypeOf(RangeSelectorConnectedComponent)).call(this, props, context)); - - _this.deleteRangeselector = _this.deleteRangeselector.bind(_this); - _this.updateRangeselector = _this.updateRangeselector.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(RangeSelectorConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var rangeselectorIndex = props.rangeselectorIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var rangeselectors = container.rangeselector ? container.rangeselector.buttons || [] : []; - var fullRangeselectors = fullContainer.rangeselector ? fullContainer.rangeselector.buttons || [] : []; - this.container = rangeselectors[rangeselectorIndex]; - this.fullContainer = fullRangeselectors[rangeselectorIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('rangeselector.buttons[].' + attr); - }, - updateContainer: this.updateRangeselector, - deleteContainer: this.deleteRangeselector, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('rangeselector.buttons[].' + attr); - }, - updateContainer: this.updateRangeselector, - deleteContainer: this.deleteRangeselector, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateRangeselector', - value: function updateRangeselector(update) { - var newUpdate = {}; - var rangeselectorIndex = this.props.rangeselectorIndex; - - for (var key in update) { - var newkey = 'rangeselector.buttons[' + rangeselectorIndex + '].' + key; - newUpdate[newkey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'deleteRangeselector', - value: function deleteRangeselector() { - if (this.context.onUpdate) { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.DELETE_RANGESELECTOR, - payload: { - axisId: this.context.fullContainer._name, - rangeselectorIndex: this.props.rangeselectorIndex - } - }); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return RangeSelectorConnectedComponent; - }(_react.Component); - - RangeSelectorConnectedComponent.displayName = 'RangeSelectorConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - RangeSelectorConnectedComponent.propTypes = { - rangeselectorIndex: _propTypes2.default.number.isRequired - }; - - RangeSelectorConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - RangeSelectorConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return RangeSelectorConnectedComponent; -} -//# sourceMappingURL=connectRangeSelectorToAxis.js.map \ No newline at end of file diff --git a/lib/lib/connectRangeSelectorToAxis.js.map b/lib/lib/connectRangeSelectorToAxis.js.map deleted file mode 100644 index f445699c5..000000000 --- a/lib/lib/connectRangeSelectorToAxis.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectRangeSelectorToAxis.js"],"names":["connectRangeSelectorToAxis","WrappedComponent","RangeSelectorConnectedComponent","props","context","deleteRangeselector","bind","updateRangeselector","setLocals","nextProps","nextContext","rangeselectorIndex","container","fullContainer","rangeselectors","rangeselector","buttons","fullRangeselectors","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_RANGESELECTOR","payload","axisId","_name","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,0B;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,0BAAT,CAAoCC,gBAApC,EAAsD;AAAA,MAC7DC,+BAD6D;AAAA;;AAEjE,6CAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oKACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,mBAAL,GAA2B,MAAKA,mBAAL,CAAyBC,IAAzB,OAA3B;AACA,YAAKC,mBAAL,GAA2B,MAAKA,mBAAL,CAAyBD,IAAzB,OAA3B;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AARgE;AAAA;AAAA,gDAUvCK,SAVuC,EAU5BC,WAV4B,EAUf;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZgE;AAAA;AAAA,gCAcvDP,KAduD,EAchDC,OAdgD,EAcvC;AAAA,YACjBO,kBADiB,GACKR,KADL,CACjBQ,kBADiB;AAAA,YAEjBC,SAFiB,GAE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A,oBAAvD;;AAEA,SAAO3C,+BAAP;AACD","file":"connectRangeSelectorToAxis.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectRangeSelectorToAxis(WrappedComponent) {\n class RangeSelectorConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteRangeselector = this.deleteRangeselector.bind(this);\n this.updateRangeselector = this.updateRangeselector.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {rangeselectorIndex} = props;\n const {container, fullContainer} = context;\n\n const rangeselectors = container.rangeselector ? container.rangeselector.buttons || [] : [];\n const fullRangeselectors = fullContainer.rangeselector\n ? fullContainer.rangeselector.buttons || []\n : [];\n this.container = rangeselectors[rangeselectorIndex];\n this.fullContainer = fullRangeselectors[rangeselectorIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`rangeselector.buttons[].${attr}`),\n updateContainer: this.updateRangeselector,\n deleteContainer: this.deleteRangeselector,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject\n ? null\n : this.context.getValObject(`rangeselector.buttons[].${attr}`),\n updateContainer: this.updateRangeselector,\n deleteContainer: this.deleteRangeselector,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateRangeselector(update) {\n const newUpdate = {};\n const {rangeselectorIndex} = this.props;\n for (const key in update) {\n const newkey = `rangeselector.buttons[${rangeselectorIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteRangeselector() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_RANGESELECTOR,\n payload: {\n axisId: this.context.fullContainer._name,\n rangeselectorIndex: this.props.rangeselectorIndex,\n },\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n RangeSelectorConnectedComponent.displayName = `RangeSelectorConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n RangeSelectorConnectedComponent.propTypes = {\n rangeselectorIndex: PropTypes.number.isRequired,\n };\n\n RangeSelectorConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n RangeSelectorConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return RangeSelectorConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectShapeToLayout.js b/lib/lib/connectShapeToLayout.js deleted file mode 100644 index 19e768348..000000000 --- a/lib/lib/connectShapeToLayout.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectShapeToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectShapeToLayout(WrappedComponent) { - var ShapeConnectedComponent = function (_Component) { - _inherits(ShapeConnectedComponent, _Component); - - function ShapeConnectedComponent(props, context) { - _classCallCheck(this, ShapeConnectedComponent); - - var _this = _possibleConstructorReturn(this, (ShapeConnectedComponent.__proto__ || Object.getPrototypeOf(ShapeConnectedComponent)).call(this, props, context)); - - _this.deleteShape = _this.deleteShape.bind(_this); - _this.updateShape = _this.updateShape.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(ShapeConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var shapeIndex = props.shapeIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var shapes = container.shapes || []; - var fullShapes = fullContainer.shapes || []; - this.container = shapes[shapeIndex]; - this.fullContainer = fullShapes[shapeIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('shapes[].' + attr); - }, - updateContainer: this.updateShape, - deleteContainer: this.deleteShape, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('shapes[].' + attr); - }, - updateContainer: this.updateShape, - deleteContainer: this.deleteShape, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateShape', - value: function updateShape(update) { - var newUpdate = {}; - var shapeIndex = this.props.shapeIndex; - - for (var key in update) { - var newkey = 'shapes[' + shapeIndex + '].' + key; - newUpdate[newkey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'deleteShape', - value: function deleteShape() { - if (this.context.onUpdate) { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.DELETE_SHAPE, - payload: { shapeIndex: this.props.shapeIndex } - }); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return ShapeConnectedComponent; - }(_react.Component); - - ShapeConnectedComponent.displayName = 'ShapeConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - ShapeConnectedComponent.propTypes = { - shapeIndex: _propTypes2.default.number.isRequired - }; - - ShapeConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - ShapeConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return ShapeConnectedComponent; -} -//# sourceMappingURL=connectShapeToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectShapeToLayout.js.map b/lib/lib/connectShapeToLayout.js.map deleted file mode 100644 index f4912443b..000000000 --- a/lib/lib/connectShapeToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectShapeToLayout.js"],"names":["connectShapeToLayout","WrappedComponent","ShapeConnectedComponent","props","context","deleteShape","bind","updateShape","setLocals","nextProps","nextContext","shapeIndex","container","fullContainer","shapes","fullShapes","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_SHAPE","payload","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,oB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,oBAAT,CAA8BC,gBAA9B,EAAgD;AAAA,MACvDC,uBADuD;AAAA;;AAE3D,qCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBD,IAAjB,OAAnB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR0D;AAAA;AAAA,gDAUjCK,SAViC,EAUtBC,WAVsB,EAUT;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZ0D;AAAA;AAAA,gCAcjDP,KAdiD,EAc1CC,OAd0C,EAcjC;AAAA,YACjBO,UADiB,GACHR,KADG,CACjBQ,UADiB;AAAA,YAEjBC,SAFiB,GAEWR,OAFX,CAEjBQ,SAFiB;AAAA,YAENC,aAFM,GAEWT,OAFX,CAENS,aAFM;;;AAIxB,YAAMC,SAASF,UAAUE,MAAV,IAAoB,EAAnC;AACA,YAAMC,aAAaF,cAAcC,MAAd,IAAwB,EAA3C;AACA,aAAKF,SAAL,GAAiBE,OAAOH,UAAP,CAAjB;AACA,aAAKE,aAAL,GAAqBE,WAAWJ,UAAX,CAArB;AACD;AAtB0D;AAAA;AAAA,wCAwBzC;AAAA;;AAChB,eAAO;AACLK,wBAAc;AAAA,mBACZ,CAAC,OAAKZ,OAAL,CAAaY,YAAd,GAA6B,IAA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yBAAe7B,gBAAf,CAAvD;;AAEAC,0BAAwB6B,SAAxB,GAAoC;AAClCpB,gBAAYqB,oBAAUC,MAAV,CAAiBC;AADK,GAApC;;AAIAhC,0BAAwBiC,YAAxB,GAAuC;AACrCvB,eAAWoB,oBAAUI,MADgB;AAErCvB,mBAAemB,oBAAUI,MAFY;AAGrCC,UAAML,oBAAUM,KAHqB;AAIrCd,cAAUQ,oBAAUO,IAJiB;AAKrCrB,qBAAiBc,oBAAUO,IALU;AAMrCvB,kBAAcgB,oBAAUO;AANa,GAAvC;;AASArC,0BAAwBsC,iBAAxB,GAA4C;AAC1CtB,qBAAiBc,oBAAUO,IADe;AAE1CpB,qBAAiBa,oBAAUO,IAFe;AAG1C3B,eAAWoB,oBAAUI,MAHqB;AAI1CvB,mBAAemB,oBAAUI,MAJiB;AAK1CpB,kBAAcgB,oBAAUO;AALkB,GAA5C;;AArF6D,MA6FtDE,oBA7FsD,GA6F9BxC,gBA7F8B,CA6FtDwC,oBA7FsD;;AA8F7DvC,0BAAwBuC,oBAAxB,GAA+CA,oBAA/C;;AAEA,SAAOvC,uBAAP;AACD","file":"connectShapeToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectShapeToLayout(WrappedComponent) {\n class ShapeConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteShape = this.deleteShape.bind(this);\n this.updateShape = this.updateShape.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {shapeIndex} = props;\n const {container, fullContainer} = context;\n\n const shapes = container.shapes || [];\n const fullShapes = fullContainer.shapes || [];\n this.container = shapes[shapeIndex];\n this.fullContainer = fullShapes[shapeIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`),\n updateContainer: this.updateShape,\n deleteContainer: this.deleteShape,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`),\n updateContainer: this.updateShape,\n deleteContainer: this.deleteShape,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateShape(update) {\n const newUpdate = {};\n const {shapeIndex} = this.props;\n for (const key in update) {\n const newkey = `shapes[${shapeIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteShape() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_SHAPE,\n payload: {shapeIndex: this.props.shapeIndex},\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n ShapeConnectedComponent.displayName = `ShapeConnected${getDisplayName(WrappedComponent)}`;\n\n ShapeConnectedComponent.propTypes = {\n shapeIndex: PropTypes.number.isRequired,\n };\n\n ShapeConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n ShapeConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return ShapeConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectSliderToLayout.js b/lib/lib/connectSliderToLayout.js deleted file mode 100644 index 62daf6c33..000000000 --- a/lib/lib/connectSliderToLayout.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectSliderToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectSliderToLayout(WrappedComponent) { - var SliderConnectedComponent = function (_Component) { - _inherits(SliderConnectedComponent, _Component); - - function SliderConnectedComponent(props, context) { - _classCallCheck(this, SliderConnectedComponent); - - var _this = _possibleConstructorReturn(this, (SliderConnectedComponent.__proto__ || Object.getPrototypeOf(SliderConnectedComponent)).call(this, props, context)); - - _this.updateSlider = _this.updateSlider.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(SliderConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var sliderIndex = props.sliderIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var sliders = container.sliders || []; - var fullSliders = fullContainer.sliders || []; - this.container = sliders[sliderIndex]; - this.fullContainer = fullSliders[sliderIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('sliders[].' + attr); - }, - updateContainer: this.updateSlider, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('sliders[].' + attr); - }, - updateContainer: this.updateSlider, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateSlider', - value: function updateSlider(update) { - var newUpdate = {}; - var sliderIndex = this.props.sliderIndex; - - for (var key in update) { - var newkey = 'sliders[' + sliderIndex + '].' + key; - newUpdate[newkey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return SliderConnectedComponent; - }(_react.Component); - - SliderConnectedComponent.displayName = 'SliderConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - SliderConnectedComponent.propTypes = { - sliderIndex: _propTypes2.default.number.isRequired - }; - - SliderConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - SliderConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return SliderConnectedComponent; -} -//# sourceMappingURL=connectSliderToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectSliderToLayout.js.map b/lib/lib/connectSliderToLayout.js.map deleted file mode 100644 index 59c1bb506..000000000 --- a/lib/lib/connectSliderToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectSliderToLayout.js"],"names":["connectSliderToLayout","WrappedComponent","SliderConnectedComponent","props","context","updateSlider","bind","setLocals","nextProps","nextContext","sliderIndex","container","fullContainer","sliders","fullSliders","getValObject","attr","updateContainer","update","newUpdate","key","newkey","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","onUpdate","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAIwBA,qB;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,qBAAT,CAA+BC,gBAA/B,EAAiD;AAAA,MACxDC,wBADwD;AAAA;;AAE5D,sCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,sJACpBD,KADoB,EACbC,OADa;;AAE1B,YAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,OAApB;AACA,YAAKC,SAAL,CAAeJ,KAAf,EAAsBC,OAAtB;AAH0B;AAI3B;;AAN2D;AAAA;AAAA,gDAQlCI,SARkC,EAQvBC,WARuB,EAQV;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAV2D;AAAA;AAAA,gCAYlDN,KAZkD,EAY3CC,OAZ2C,EAYlC;AAAA,YACjBM,WADiB,GACFP,KADE,CACjBO,WADiB;AAAA,YAEjBC,SAFiB,GAEWP,OAFX,CAEjBO,SAFiB;AAAA,YAENC,aAFM,GAEWR,OAFX,CAENQ,aAFM;;;AAIxB,YAAMC,UAAUF,UAAUE,OAAV,IAAqB,EAArC;AACA,YAAMC,cAAcF,cAAcC,OAAd,IAAyB,EAA7C;AACA,aAAKF,SAAL,GAAiBE,QAAQH,WAAR,CAAjB;AACA,aAAKE,aAAL,GAAqBE,YAAYJ,WAAZ,CAArB;AACD;AApB2D;AAAA;AAAA,wCAsB1C;AAAA;;AAChB,eAAO;AACLK,wBAAc;AAAA,mBACZ,CAAC,OAAKX,OAAL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W;AAKtChB,kBAAcU,oBAAUM;AALc,GAAxC;;AAQA7B,2BAAyB8B,iBAAzB,GAA6C;AAC3Cf,qBAAiBQ,oBAAUM,IADgB;AAE3CpB,eAAWc,oBAAUI,MAFsB;AAG3CjB,mBAAea,oBAAUI,MAHkB;AAI3Cd,kBAAcU,oBAAUM;AAJmB,GAA7C;;AAvE8D,MA8EvDE,oBA9EuD,GA8E/BhC,gBA9E+B,CA8EvDgC,oBA9EuD;;AA+E9D/B,2BAAyB+B,oBAAzB,GAAgDA,oBAAhD;;AAEA,SAAO/B,wBAAP;AACD","file":"connectSliderToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\n\nexport default function connectSliderToLayout(WrappedComponent) {\n class SliderConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n this.updateSlider = this.updateSlider.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {sliderIndex} = props;\n const {container, fullContainer} = context;\n\n const sliders = container.sliders || [];\n const fullSliders = fullContainer.sliders || [];\n this.container = sliders[sliderIndex];\n this.fullContainer = fullSliders[sliderIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`),\n updateContainer: this.updateSlider,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`),\n updateContainer: this.updateSlider,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateSlider(update) {\n const newUpdate = {};\n const {sliderIndex} = this.props;\n for (const key in update) {\n const newkey = `sliders[${sliderIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n SliderConnectedComponent.displayName = `SliderConnected${getDisplayName(WrappedComponent)}`;\n\n SliderConnectedComponent.propTypes = {\n sliderIndex: PropTypes.number.isRequired,\n };\n\n SliderConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n SliderConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return SliderConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectToContainer.js b/lib/lib/connectToContainer.js deleted file mode 100644 index bf444699f..000000000 --- a/lib/lib/connectToContainer.js +++ /dev/null @@ -1,150 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.containerConnectedContextTypes = undefined; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectToContainer; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _unpackPlotProps = require('./unpackPlotProps'); - -var _unpackPlotProps2 = _interopRequireDefault(_unpackPlotProps); - -var _lib = require('../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var containerConnectedContextTypes = exports.containerConnectedContextTypes = { - localize: _propTypes2.default.func, - container: _propTypes2.default.object, - data: _propTypes2.default.array, - defaultContainer: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - fullData: _propTypes2.default.array, - fullLayout: _propTypes2.default.object, - getValObject: _propTypes2.default.func, - graphDiv: _propTypes2.default.object, - layout: _propTypes2.default.object, - onUpdate: _propTypes2.default.func, - plotly: _propTypes2.default.object, - updateContainer: _propTypes2.default.func, - traceIndexes: _propTypes2.default.array -}; - -function connectToContainer(WrappedComponent) { - var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var ContainerConnectedComponent = function (_Component) { - _inherits(ContainerConnectedComponent, _Component); - - _createClass(ContainerConnectedComponent, null, [{ - key: 'modifyPlotProps', - - // Run the inner modifications first and allow more recent modifyPlotProp - // config function to modify last. - value: function modifyPlotProps(props, context, plotProps) { - if (WrappedComponent.modifyPlotProps) { - WrappedComponent.modifyPlotProps(props, context, plotProps); - } - if (config.modifyPlotProps) { - config.modifyPlotProps(props, context, plotProps); - } - } - }]); - - function ContainerConnectedComponent(props, context) { - _classCallCheck(this, ContainerConnectedComponent); - - var _this = _possibleConstructorReturn(this, (ContainerConnectedComponent.__proto__ || Object.getPrototypeOf(ContainerConnectedComponent)).call(this, props, context)); - - _this.setLocals(props, context); - return _this; - } - - _createClass(ContainerConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - this.plotProps = (0, _unpackPlotProps2.default)(props, context); - this.attr = props.attr; - ContainerConnectedComponent.modifyPlotProps(props, context, this.plotProps); - } - }, { - key: 'getChildContext', - value: function getChildContext() { - return { - description: this.plotProps.description, - attr: this.attr - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - return { - description: this.plotProps.description, - attr: this.attr - }; - } - }, { - key: 'render', - value: function render() { - // Merge plotprops onto props so leaf components only need worry about - // props. However pass plotProps as a specific prop in case inner component - // is also wrapped by a component that `unpackPlotProps`. That way inner - // component can skip computation as it can see plotProps is already defined. - var _Object$assign = Object.assign({}, this.plotProps, this.props), - _Object$assign$plotPr = _Object$assign.plotProps, - plotProps = _Object$assign$plotPr === undefined ? this.plotProps : _Object$assign$plotPr, - props = _objectWithoutProperties(_Object$assign, ['plotProps']); - - if (props.isVisible) { - return _react2.default.createElement(WrappedComponent, _extends({}, props, { plotProps: plotProps })); - } - - return null; - } - }]); - - return ContainerConnectedComponent; - }(_react.Component); - - ContainerConnectedComponent.displayName = 'ContainerConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - ContainerConnectedComponent.contextTypes = containerConnectedContextTypes; - ContainerConnectedComponent.childContextTypes = { - description: _propTypes2.default.string, - attr: _propTypes2.default.string - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return ContainerConnectedComponent; -} -//# sourceMappingURL=connectToContainer.js.map \ No newline at end of file diff --git a/lib/lib/connectToContainer.js.map b/lib/lib/connectToContainer.js.map deleted file mode 100644 index b2ea13f38..000000000 --- a/lib/lib/connectToContainer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectToContainer.js"],"names":["connectToContainer","containerConnectedContextTypes","localize","PropTypes","func","container","object","data","array","defaultContainer","fullContainer","fullData","fullLayout","getValObject","graphDiv","layout","onUpdate","plotly","updateContainer","traceIndexes","WrappedComponent","config","ContainerConnectedComponent","props","context","plotProps","modifyPlotProps","setLocals","nextProps","nextContext","attr","description","Object","assign","isVisible","Component","displayName","contextTypes","childContextTypes","string","plotly_editor_traits"],"mappings":";;;;;;;;;;;kBAsBwBA,kB;;AAtBxB;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;AAEO,IAAMC,0EAAiC;AAC5CC,YAAUC,oBAAUC,IADwB;AAE5CC,aAAWF,oBAAUG,MAFuB;AAG5CC,QAAMJ,oBAAUK,KAH4B;AAI5CC,oBAAkBN,oBAAUG,MAJgB;AAK5CI,iBAAeP,oBAAUG,MALmB;AAM5CK,YAAUR,oBAAUK,KANwB;AAO5CI,cAAYT,oBAAUG,MAPsB;AAQ5CO,gBAAcV,oBAAUC,IARoB;AAS5CU,YAAUX,oBAAUG,MATwB;AAU5CS,UAAQZ,oBAAUG,MAV0B;AAW5CU,YAAUb,oBAAUC,IAXwB;AAY5Ca,UAAQd,oBAAUG,MAZ0B;AAa5CY,mBAAiBf,oBAAUC,IAbiB;AAc5Ce,gBAAchB,oBAAUK;AAdoB,CAAvC;;AAiBQ,SAASR,kBAAT,CAA4BoB,gBAA5B,EAA2D;AAAA,MAAbC,MAAa,uEAAJ,EAAI;;AAAA,MAClEC,2BADkE;AAAA;;AAAA;AAAA;;AAEtE;AACA;AAHsE,sCAI/CC,KAJ+C,EAIxCC,OAJwC,EAI/BC,SAJ+B,EAIpB;AAChD,YAAIL,iBAAiBM,eAArB,EAAsC;AACpCN,2BAAiBM,eAAjB,CAAiCH,KAAjC,EAAwCC,OAAxC,EAAiDC,SAAjD;AACD;AACD,YAAIJ,OAAOK,eAAX,EAA4B;AAC1BL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AyDxEb,8BAA4Bc,WAA5B,0BAA+D,yBAAehB,gBAAf,CAA/D;;AAEAE,8BAA4Be,YAA5B,GAA2CpC,8BAA3C;AACAqB,8BAA4BgB,iBAA5B,GAAgD;AAC9CP,iBAAa5B,oBAAUoC,MADuB;AAE9CT,UAAM3B,oBAAUoC;AAF8B,GAAhD;;AA5DwE,MAiEjEC,oBAjEiE,GAiEzCpB,gBAjEyC,CAiEjEoB,oBAjEiE;;AAkExElB,8BAA4BkB,oBAA5B,GAAmDA,oBAAnD;;AAEA,SAAOlB,2BAAP;AACD","file":"connectToContainer.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport unpackPlotProps from './unpackPlotProps';\nimport {getDisplayName} from '../lib';\n\nexport const containerConnectedContextTypes = {\n localize: PropTypes.func,\n container: PropTypes.object,\n data: PropTypes.array,\n defaultContainer: PropTypes.object,\n fullContainer: PropTypes.object,\n fullData: PropTypes.array,\n fullLayout: PropTypes.object,\n getValObject: PropTypes.func,\n graphDiv: PropTypes.object,\n layout: PropTypes.object,\n onUpdate: PropTypes.func,\n plotly: PropTypes.object,\n updateContainer: PropTypes.func,\n traceIndexes: PropTypes.array,\n};\n\nexport default function connectToContainer(WrappedComponent, config = {}) {\n class ContainerConnectedComponent extends Component {\n // Run the inner modifications first and allow more recent modifyPlotProp\n // config function to modify last.\n static modifyPlotProps(props, context, plotProps) {\n if (WrappedComponent.modifyPlotProps) {\n WrappedComponent.modifyPlotProps(props, context, plotProps);\n }\n if (config.modifyPlotProps) {\n config.modifyPlotProps(props, context, plotProps);\n }\n }\n\n constructor(props, context) {\n super(props, context);\n\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n this.plotProps = unpackPlotProps(props, context);\n this.attr = props.attr;\n ContainerConnectedComponent.modifyPlotProps(props, context, this.plotProps);\n }\n\n getChildContext() {\n return {\n description: this.plotProps.description,\n attr: this.attr,\n };\n }\n\n provideValue() {\n return {\n description: this.plotProps.description,\n attr: this.attr,\n };\n }\n\n render() {\n // Merge plotprops onto props so leaf components only need worry about\n // props. However pass plotProps as a specific prop in case inner component\n // is also wrapped by a component that `unpackPlotProps`. That way inner\n // component can skip computation as it can see plotProps is already defined.\n const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, this.props);\n if (props.isVisible) {\n return ;\n }\n\n return null;\n }\n }\n\n ContainerConnectedComponent.displayName = `ContainerConnected${getDisplayName(WrappedComponent)}`;\n\n ContainerConnectedComponent.contextTypes = containerConnectedContextTypes;\n ContainerConnectedComponent.childContextTypes = {\n description: PropTypes.string,\n attr: PropTypes.string,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return ContainerConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectTraceToPlot.js b/lib/lib/connectTraceToPlot.js deleted file mode 100644 index 1017078e7..000000000 --- a/lib/lib/connectTraceToPlot.js +++ /dev/null @@ -1,260 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectTraceToPlot; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _nested_property = require('plotly.js/src/lib/nested_property'); - -var _nested_property2 = _interopRequireDefault(_nested_property); - -var _lib = require('../lib'); - -var _multiValues = require('./multiValues'); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectTraceToPlot(WrappedComponent) { - var TraceConnectedComponent = function (_Component) { - _inherits(TraceConnectedComponent, _Component); - - function TraceConnectedComponent(props, context) { - _classCallCheck(this, TraceConnectedComponent); - - var _this = _possibleConstructorReturn(this, (TraceConnectedComponent.__proto__ || Object.getPrototypeOf(TraceConnectedComponent)).call(this, props, context)); - - _this.deleteTrace = _this.deleteTrace.bind(_this); - _this.updateTrace = _this.updateTrace.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(TraceConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var traceIndexes = props.traceIndexes; - var data = context.data, - fullData = context.fullData, - plotly = context.plotly; - - - var trace = data[traceIndexes[0]]; - var fullTrace = (0, _lib.getFullTrace)(props, context); - - this.childContext = { - getValObject: function getValObject(attr) { - return !plotly ? null : plotly.PlotSchema.getTraceValObject(fullTrace, (0, _nested_property2.default)({}, attr).parts); - }, - updateContainer: this.updateTrace, - deleteContainer: this.deleteTrace, - container: trace, - fullContainer: fullTrace, - traceIndexes: this.props.traceIndexes - }; - - if (traceIndexes.length > 1) { - var multiValuedFullContainer = (0, _multiValues.deepCopyPublic)(fullTrace); - fullData.forEach(function (t) { - return Object.keys(t).forEach(function (key) { - return (0, _multiValues.setMultiValuedContainer)(multiValuedFullContainer, (0, _multiValues.deepCopyPublic)(t), key, { - searchArrays: true - }); - }); - }); - var multiValuedContainer = (0, _multiValues.deepCopyPublic)(trace); - data.forEach(function (t) { - return Object.keys(t).forEach(function (key) { - return (0, _multiValues.setMultiValuedContainer)(multiValuedContainer, (0, _multiValues.deepCopyPublic)(t), key, { - searchArrays: true - }); - }); - }); - this.childContext.fullContainer = multiValuedFullContainer; - this.childContext.defaultContainer = fullTrace; - this.childContext.container = multiValuedContainer; - } - - if (trace && fullTrace) { - this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace)); - this.name = fullTrace.name; - } - } - }, { - key: 'getChildContext', - value: function getChildContext() { - return this.childContext; - } - }, { - key: 'provideValue', - value: function provideValue() { - return this.childContext; - } - }, { - key: 'updateTrace', - value: function updateTrace(update) { - var _this2 = this; - - if (this.context.onUpdate) { - var splitTraceGroup = this.props.fullDataArrayPosition ? this.props.fullDataArrayPosition.map(function (p) { - return _this2.context.fullData[p]._group; - }) : null; - - var containsAnSrc = Object.keys(update).filter(function (a) { - return a.endsWith('src'); - }).length > 0; - - if (Array.isArray(update)) { - update.forEach(function (u, i) { - _this2.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, - payload: { - update: u, - traceIndexes: [_this2.props.traceIndexes[i]], - splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null - } - }); - }); - } else if (splitTraceGroup && !containsAnSrc) { - this.props.traceIndexes.forEach(function (t, i) { - _this2.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, - payload: { - update: update, - traceIndexes: [_this2.props.traceIndexes[i]], - splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null - } - }); - }); - } else { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.UPDATE_TRACES, - payload: { - update: update, - traceIndexes: this.props.traceIndexes - } - }); - } - } - } - }, { - key: 'deleteTrace', - value: function deleteTrace() { - var _this3 = this; - - var currentTrace = this.context.fullData[this.props.traceIndexes[0]]; - if (!currentTrace && this.context.onUpdate) { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.DELETE_TRACE, - payload: { - traceIndexes: this.props.traceIndexes - } - }); - return; - } - var axesToBeGarbageCollected = []; - var subplotToBeGarbageCollected = null; - var subplotType = (0, _lib.traceTypeToAxisType)(currentTrace.type); - - if (subplotType) { - var subplotNames = subplotType === 'cartesian' ? [currentTrace.xaxis || 'xaxis', currentTrace.yaxis || 'yaxis'] : currentTrace[_constants.SUBPLOT_TO_ATTR[subplotType].data] || _constants.SUBPLOT_TO_ATTR[subplotType].data; - - var isSubplotUsedAnywhereElse = function isSubplotUsedAnywhereElse(subplotType, subplotName) { - return _this3.context.fullData.some(function (trace) { - return (trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === subplotName || ((subplotType === 'xaxis' || subplotType === 'yaxis') && subplotName.charAt(1)) === '' || subplotName.split(subplotType)[1] === '' && trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === null) && trace.index !== _this3.props.traceIndexes[0]; - }); - }; - - // When we delete a subplot, make sure no unused axes/subplots are left - if (subplotType === 'cartesian') { - if (!isSubplotUsedAnywhereElse('xaxis', subplotNames[0])) { - axesToBeGarbageCollected.push(subplotNames[0]); - } - if (!isSubplotUsedAnywhereElse('yaxis', subplotNames[1])) { - axesToBeGarbageCollected.push(subplotNames[1]); - } - } else { - if (!isSubplotUsedAnywhereElse(subplotType, subplotNames)) { - subplotToBeGarbageCollected = subplotNames; - } - } - } - - if (this.context.onUpdate) { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.DELETE_TRACE, - payload: { - axesToBeGarbageCollected: axesToBeGarbageCollected, - subplotToBeGarbageCollected: subplotToBeGarbageCollected, - traceIndexes: this.props.traceIndexes - } - }); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, _extends({ name: this.name, icon: this.icon }, this.props)); - } - }]); - - return TraceConnectedComponent; - }(_react.Component); - - TraceConnectedComponent.displayName = 'TraceConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - TraceConnectedComponent.propTypes = { - traceIndexes: _propTypes2.default.arrayOf(_propTypes2.default.number).isRequired, - fullDataArrayPosition: _propTypes2.default.arrayOf(_propTypes2.default.number) - }; - - TraceConnectedComponent.contextTypes = { - fullData: _propTypes2.default.array, - data: _propTypes2.default.array, - plotly: _propTypes2.default.object, - onUpdate: _propTypes2.default.func - }; - - TraceConnectedComponent.childContextTypes = { - getValObject: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - defaultContainer: _propTypes2.default.object, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - traceIndexes: _propTypes2.default.array - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - TraceConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return TraceConnectedComponent; -} -//# sourceMappingURL=connectTraceToPlot.js.map \ No newline at end of file diff --git a/lib/lib/connectTraceToPlot.js.map b/lib/lib/connectTraceToPlot.js.map deleted file mode 100644 index 5c8390aed..000000000 --- a/lib/lib/connectTraceToPlot.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectTraceToPlot.js"],"names":["connectTraceToPlot","WrappedComponent","TraceConnectedComponent","props","context","deleteTrace","bind","updateTrace","setLocals","nextProps","nextContext","traceIndexes","data","fullData","plotly","trace","fullTrace","childContext","getValObject","PlotSchema","getTraceValObject","attr","parts","updateContainer","deleteContainer","container","fullContainer","length","multiValuedFullContainer","forEach","Object","keys","t","key","searchArrays","multiValuedContainer","defaultContainer","icon","name","update","onUpdate","splitTraceGroup","fullDataArrayPosition","map","p","_group","containsAnSrc","filter","a","endsWith","Array","isArray","u","i","type","EDITOR_ACTIONS","UPDATE_TRACES","payload","currentTrace","DELETE_TRACE","axesToBeGarbageCollected","subplotToBeGarbageCollected","subplotType","subplotNames","xaxis","yaxis","SUBPLOT_TO_ATTR","isSubplotUsedAnywhereElse","subplotName","some","charAt","split","index","push","Component","displayName","propTypes","PropTypes","arrayOf","number","isRequired","contextTypes","array","object","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;;;kBAawBA,kB;;AAbxB;;;;AACA;;;;AACA;;;;AACA;;AAOA;;AACA;;;;;;;;;;AAEe,SAASA,kBAAT,CAA4BC,gBAA5B,EAA8C;AAAA,MACrDC,uBADqD;AAAA;;AAEzD,qCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,oJACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,YAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBD,IAAjB,OAAnB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AARwD;AAAA;AAAA,gDAU/BK,SAV+B,EAUpBC,WAVoB,EAUP;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZwD;AAAA;AAAA,gCAc/CP,KAd+C,EAcxCC,OAdwC,EAc/B;AAAA,YACjBO,YADiB,GACDR,KADC,CACjBQ,YADiB;AAAA,YAEjBC,IAFiB,GAESR,OAFT,CAEjBQ,IAFiB;AAAA,YAEXC,QAFW,GAEST,OAFT,CAEXS,QAFW;AAAA,YAEDC,MAFC,GAESV,OAFT,CAEDU,MAFC;;;AAIxB,YAAMC,QAAQH,KAAKD,aAAa,CAAb,CAAL,CAAd;AACA,YAAMK,YAAY,uBAAab,KAAb,EAAoBC,OAApB,CAAlB;;AAEA,aAAKa,YAAL,GAAoB;AAClBC,wBAAc;AAAA,mBACZ,CAACJ,MAAD,GACI,IADJ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ACrBuE,gBADqB;;AA+K3DxE,0BAAwByE,WAAxB,sBAAuD,yBAAe1E,gBAAf,CAAvD;;AAEAC,0BAAwB0E,SAAxB,GAAoC;AAClCjE,kBAAckE,oBAAUC,OAAV,CAAkBD,oBAAUE,MAA5B,EAAoCC,UADhB;AAElCtC,2BAAuBmC,oBAAUC,OAAV,CAAkBD,oBAAUE,MAA5B;AAFW,GAApC;;AAKA7E,0BAAwB+E,YAAxB,GAAuC;AACrCpE,cAAUgE,oBAAUK,KADiB;AAErCtE,UAAMiE,oBAAUK,KAFqB;AAGrCpE,YAAQ+D,oBAAUM,MAHmB;AAIrC3C,cAAUqC,oBAAUO;AAJiB,GAAvC;;AAOAlF,0BAAwBmF,iBAAxB,GAA4C;AAC1CnE,kBAAc2D,oBAAUO,IADkB;AAE1C7D,qBAAiBsD,oBAAUO,IAFe;AAG1C5D,qBAAiBqD,oBAAUO,IAHe;AAI1ChD,sBAAkByC,oBAAUM,MAJc;AAK1C1D,eAAWoD,oBAAUM,MALqB;AAM1CzD,mBAAemD,oBAAUM,MANiB;AAO1CxE,kBAAckE,oBAAUK;AAPkB,GAA5C;;AA7L2D,MAuMpDI,oBAvMoD,GAuM5BrF,gBAvM4B,CAuMpDqF,oBAvMoD;;AAwM3DpF,0BAAwBoF,oBAAxB,GAA+CA,oBAA/C;;AAEA,SAAOpF,uBAAP;AACD","file":"connectTraceToPlot.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\nimport {\n getDisplayName,\n plotlyTraceToCustomTrace,\n renderTraceIcon,\n traceTypeToAxisType,\n getFullTrace,\n} from '../lib';\nimport {deepCopyPublic, setMultiValuedContainer} from './multiValues';\nimport {EDITOR_ACTIONS, SUBPLOT_TO_ATTR} from 'lib/constants';\n\nexport default function connectTraceToPlot(WrappedComponent) {\n class TraceConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteTrace = this.deleteTrace.bind(this);\n this.updateTrace = this.updateTrace.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {traceIndexes} = props;\n const {data, fullData, plotly} = context;\n\n const trace = data[traceIndexes[0]];\n const fullTrace = getFullTrace(props, context);\n\n this.childContext = {\n getValObject: attr =>\n !plotly\n ? null\n : plotly.PlotSchema.getTraceValObject(fullTrace, nestedProperty({}, attr).parts),\n updateContainer: this.updateTrace,\n deleteContainer: this.deleteTrace,\n container: trace,\n fullContainer: fullTrace,\n traceIndexes: this.props.traceIndexes,\n };\n\n if (traceIndexes.length > 1) {\n const multiValuedFullContainer = deepCopyPublic(fullTrace);\n fullData.forEach(t =>\n Object.keys(t).forEach(key =>\n setMultiValuedContainer(multiValuedFullContainer, deepCopyPublic(t), key, {\n searchArrays: true,\n })\n )\n );\n const multiValuedContainer = deepCopyPublic(trace);\n data.forEach(t =>\n Object.keys(t).forEach(key =>\n setMultiValuedContainer(multiValuedContainer, deepCopyPublic(t), key, {\n searchArrays: true,\n })\n )\n );\n this.childContext.fullContainer = multiValuedFullContainer;\n this.childContext.defaultContainer = fullTrace;\n this.childContext.container = multiValuedContainer;\n }\n\n if (trace && fullTrace) {\n this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace));\n this.name = fullTrace.name;\n }\n }\n\n getChildContext() {\n return this.childContext;\n }\n\n provideValue() {\n return this.childContext;\n }\n\n updateTrace(update) {\n if (this.context.onUpdate) {\n const splitTraceGroup = this.props.fullDataArrayPosition\n ? this.props.fullDataArrayPosition.map(p => this.context.fullData[p]._group)\n : null;\n\n const containsAnSrc = Object.keys(update).filter(a => a.endsWith('src')).length > 0;\n\n if (Array.isArray(update)) {\n update.forEach((u, i) => {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update: u,\n traceIndexes: [this.props.traceIndexes[i]],\n splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null,\n },\n });\n });\n } else if (splitTraceGroup && !containsAnSrc) {\n this.props.traceIndexes.forEach((t, i) => {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update,\n traceIndexes: [this.props.traceIndexes[i]],\n splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null,\n },\n });\n });\n } else {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update,\n traceIndexes: this.props.traceIndexes,\n },\n });\n }\n }\n }\n\n deleteTrace() {\n const currentTrace = this.context.fullData[this.props.traceIndexes[0]];\n if (!currentTrace && this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_TRACE,\n payload: {\n traceIndexes: this.props.traceIndexes,\n },\n });\n return;\n }\n const axesToBeGarbageCollected = [];\n let subplotToBeGarbageCollected = null;\n const subplotType = traceTypeToAxisType(currentTrace.type);\n\n if (subplotType) {\n const subplotNames =\n subplotType === 'cartesian'\n ? [currentTrace.xaxis || 'xaxis', currentTrace.yaxis || 'yaxis']\n : currentTrace[SUBPLOT_TO_ATTR[subplotType].data] || SUBPLOT_TO_ATTR[subplotType].data;\n\n const isSubplotUsedAnywhereElse = (subplotType, subplotName) =>\n this.context.fullData.some(\n trace =>\n (trace[SUBPLOT_TO_ATTR[subplotType].data] === subplotName ||\n (((subplotType === 'xaxis' || subplotType === 'yaxis') && subplotName.charAt(1)) ===\n '' ||\n (subplotName.split(subplotType)[1] === '' &&\n trace[SUBPLOT_TO_ATTR[subplotType].data] === null))) &&\n trace.index !== this.props.traceIndexes[0]\n );\n\n // When we delete a subplot, make sure no unused axes/subplots are left\n if (subplotType === 'cartesian') {\n if (!isSubplotUsedAnywhereElse('xaxis', subplotNames[0])) {\n axesToBeGarbageCollected.push(subplotNames[0]);\n }\n if (!isSubplotUsedAnywhereElse('yaxis', subplotNames[1])) {\n axesToBeGarbageCollected.push(subplotNames[1]);\n }\n } else {\n if (!isSubplotUsedAnywhereElse(subplotType, subplotNames)) {\n subplotToBeGarbageCollected = subplotNames;\n }\n }\n }\n\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_TRACE,\n payload: {\n axesToBeGarbageCollected,\n subplotToBeGarbageCollected,\n traceIndexes: this.props.traceIndexes,\n },\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n TraceConnectedComponent.displayName = `TraceConnected${getDisplayName(WrappedComponent)}`;\n\n TraceConnectedComponent.propTypes = {\n traceIndexes: PropTypes.arrayOf(PropTypes.number).isRequired,\n fullDataArrayPosition: PropTypes.arrayOf(PropTypes.number),\n };\n\n TraceConnectedComponent.contextTypes = {\n fullData: PropTypes.array,\n data: PropTypes.array,\n plotly: PropTypes.object,\n onUpdate: PropTypes.func,\n };\n\n TraceConnectedComponent.childContextTypes = {\n getValObject: PropTypes.func,\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n defaultContainer: PropTypes.object,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n traceIndexes: PropTypes.array,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n TraceConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return TraceConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectTransformToTrace.js b/lib/lib/connectTransformToTrace.js deleted file mode 100644 index d1f266989..000000000 --- a/lib/lib/connectTransformToTrace.js +++ /dev/null @@ -1,158 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectTransformToTrace; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectTransformToTrace(WrappedComponent) { - var TransformConnectedComponent = function (_Component) { - _inherits(TransformConnectedComponent, _Component); - - function TransformConnectedComponent(props, context) { - _classCallCheck(this, TransformConnectedComponent); - - var _this = _possibleConstructorReturn(this, (TransformConnectedComponent.__proto__ || Object.getPrototypeOf(TransformConnectedComponent)).call(this, props, context)); - - _this.deleteTransform = _this.deleteTransform.bind(_this); - _this.updateTransform = _this.updateTransform.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(TransformConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var transformIndex = props.transformIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var transforms = container.transforms || []; - var fullTransforms = fullContainer.transforms || []; - this.container = transforms[transformIndex]; - this.fullContainer = fullTransforms[transformIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('transforms[].' + attr); - }, - updateContainer: this.updateTransform, - deleteContainer: this.deleteTransform, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('transforms[].' + attr); - }, - updateContainer: this.updateTransform, - deleteContainer: this.deleteTransform, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateTransform', - value: function updateTransform(update) { - var newUpdate = {}; - var transformIndex = this.props.transformIndex; - - for (var key in update) { - var newkey = 'transforms[' + transformIndex + '].' + key; - newUpdate[newkey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'deleteTransform', - value: function deleteTransform() { - if (this.context.onUpdate) { - this.context.onUpdate({ - type: _constants.EDITOR_ACTIONS.DELETE_TRANSFORM, - payload: { - traceIndex: this.context.fullContainer.index, - transformIndex: this.props.transformIndex - } - }); - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return TransformConnectedComponent; - }(_react.Component); - - TransformConnectedComponent.displayName = 'TransformConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - TransformConnectedComponent.propTypes = { - transformIndex: _propTypes2.default.number.isRequired - }; - - TransformConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - data: _propTypes2.default.array, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - TransformConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - deleteContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return TransformConnectedComponent; -} -//# sourceMappingURL=connectTransformToTrace.js.map \ No newline at end of file diff --git a/lib/lib/connectTransformToTrace.js.map b/lib/lib/connectTransformToTrace.js.map deleted file mode 100644 index 24db5e0b1..000000000 --- a/lib/lib/connectTransformToTrace.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectTransformToTrace.js"],"names":["connectTransformToTrace","WrappedComponent","TransformConnectedComponent","props","context","deleteTransform","bind","updateTransform","setLocals","nextProps","nextContext","transformIndex","container","fullContainer","transforms","fullTransforms","getValObject","attr","updateContainer","deleteContainer","update","newUpdate","key","newkey","onUpdate","type","EDITOR_ACTIONS","DELETE_TRANSFORM","payload","traceIndex","index","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","data","array","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAKwBA,uB;;AALxB;;;;AACA;;;;AACA;;AACA;;;;;;;;;;AAEe,SAASA,uBAAT,CAAiCC,gBAAjC,EAAmD;AAAA,MAC1DC,2BAD0D;AAAA;;AAE9D,yCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,4JACpBD,KADoB,EACbC,OADa;;AAG1B,YAAKC,eAAL,GAAuB,MAAKA,eAAL,CAAqBC,IAArB,OAAvB;AACA,YAAKC,eAAL,GAAuB,MAAKA,eAAL,CAAqBD,IAArB,OAAvB;AACA,YAAKE,SAAL,CAAeL,KAAf,EAAsBC,OAAtB;AAL0B;AAM3B;;AAR6D;AAAA;AAAA,gDAUpCK,SAVoC,EAUzBC,WAVyB,EAUZ;AAChD,aAAKF,SAAL,CAAeC,SAAf,EAA0BC,WAA1B;AACD;AAZ6D;AAAA;AAAA,gCAcpDP,KAdoD,EAc7CC,OAd6C,EAcpC;AAAA,YACjBO,cADiB,GACCR,KADD,CACjBQ,cADiB;AAAA,YAEjBC,SAFiB,GAEWR,OAFX,CAEjBQ,SAFiB;AAAA,YAENC,aAFM,GAEWT,OAFX,CAENS,aAFM;;;AAIxB,YAAMC,aAAaF,UAAUE,UAAV,IAAwB,EAA3C;AACA,YAAMC,iBAAiBF,cAAcC,UAAd,IAA4B,E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;AACPC,0BAAY,KAAKzB,OAAL,CAAaS,aAAb,CAA2BiB,KADhC;AAEPnB,8BAAgB,KAAKR,KAAL,CAAWQ;AAFpB;AAFW,WAAtB;AAOD;AACF;AAlE6D;AAAA;AAAA,+BAoErD;AACP,eAAO,8BAAC,gBAAD,EAAsB,KAAKR,KAA3B,CAAP;AACD;AAtE6D;;AAAA;AAAA,IACtB4B,gBADsB;;AAyEhE7B,8BAA4B8B,WAA5B,0BAA+D,yBAAe/B,gBAAf,CAA/D;;AAEAC,8BAA4B+B,SAA5B,GAAwC;AACtCtB,oBAAgBuB,oBAAUC,MAAV,CAAiBC;AADK,GAAxC;;AAIAlC,8BAA4BmC,YAA5B,GAA2C;AACzCzB,eAAWsB,oBAAUI,MADoB;AAEzCzB,mBAAeqB,oBAAUI,MAFgB;AAGzCC,UAAML,oBAAUM,KAHyB;AAIzChB,cAAUU,oBAAUO,IAJqB;AAKzCvB,qBAAiBgB,oBAAUO,IALc;AAMzCzB,kBAAckB,oBAAUO;AANiB,GAA3C;;AASAvC,8BAA4BwC,iBAA5B,GAAgD;AAC9CxB,qBAAiBgB,oBAAUO,IADmB;AAE9CtB,qBAAiBe,oBAAUO,IAFmB;AAG9C7B,eAAWsB,oBAAUI,MAHyB;AAI9CzB,mBAAeqB,oBAAUI,MAJqB;AAK9CtB,kBAAckB,oBAAUO;AALsB,GAAhD;;AAxFgE,MAgGzDE,oBAhGyD,GAgGjC1C,gBAhGiC,CAgGzD0C,oBAhGyD;;AAiGhEzC,8BAA4ByC,oBAA5B,GAAmDA,oBAAnD;;AAEA,SAAOzC,2BAAP;AACD","file":"connectTransformToTrace.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\nimport {EDITOR_ACTIONS} from './constants';\n\nexport default function connectTransformToTrace(WrappedComponent) {\n class TransformConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n this.deleteTransform = this.deleteTransform.bind(this);\n this.updateTransform = this.updateTransform.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {transformIndex} = props;\n const {container, fullContainer} = context;\n\n const transforms = container.transforms || [];\n const fullTransforms = fullContainer.transforms || [];\n this.container = transforms[transformIndex];\n this.fullContainer = fullTransforms[transformIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`),\n updateContainer: this.updateTransform,\n deleteContainer: this.deleteTransform,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`),\n updateContainer: this.updateTransform,\n deleteContainer: this.deleteTransform,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateTransform(update) {\n const newUpdate = {};\n const {transformIndex} = this.props;\n for (const key in update) {\n const newkey = `transforms[${transformIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n deleteTransform() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: EDITOR_ACTIONS.DELETE_TRANSFORM,\n payload: {\n traceIndex: this.context.fullContainer.index,\n transformIndex: this.props.transformIndex,\n },\n });\n }\n }\n\n render() {\n return ;\n }\n }\n\n TransformConnectedComponent.displayName = `TransformConnected${getDisplayName(WrappedComponent)}`;\n\n TransformConnectedComponent.propTypes = {\n transformIndex: PropTypes.number.isRequired,\n };\n\n TransformConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n data: PropTypes.array,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n TransformConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n deleteContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return TransformConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/connectUpdateMenuToLayout.js b/lib/lib/connectUpdateMenuToLayout.js deleted file mode 100644 index d755e6476..000000000 --- a/lib/lib/connectUpdateMenuToLayout.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = connectUpdateMenuToLayout; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lib = require('../lib'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function connectUpdateMenuToLayout(WrappedComponent) { - var UpdateMenuConnectedComponent = function (_Component) { - _inherits(UpdateMenuConnectedComponent, _Component); - - function UpdateMenuConnectedComponent(props, context) { - _classCallCheck(this, UpdateMenuConnectedComponent); - - var _this = _possibleConstructorReturn(this, (UpdateMenuConnectedComponent.__proto__ || Object.getPrototypeOf(UpdateMenuConnectedComponent)).call(this, props, context)); - - _this.updateUpdateMenu = _this.updateUpdateMenu.bind(_this); - _this.setLocals(props, context); - return _this; - } - - _createClass(UpdateMenuConnectedComponent, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); - } - }, { - key: 'setLocals', - value: function setLocals(props, context) { - var updateMenuIndex = props.updateMenuIndex; - var container = context.container, - fullContainer = context.fullContainer; - - - var updatemenus = container.updatemenus || []; - var fullUpdateMenus = fullContainer.updatemenus || []; - this.container = updatemenus[updateMenuIndex]; - this.fullContainer = fullUpdateMenus[updateMenuIndex]; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - var _this2 = this; - - return { - getValObject: function getValObject(attr) { - return !_this2.context.getValObject ? null : _this2.context.getValObject('updatemenus[].' + attr); - }, - updateContainer: this.updateUpdateMenu, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'provideValue', - value: function provideValue() { - var _this3 = this; - - return { - getValObject: function getValObject(attr) { - return !_this3.context.getValObject ? null : _this3.context.getValObject('updatemenus[].' + attr); - }, - updateContainer: this.updateUpdateMenu, - container: this.container, - fullContainer: this.fullContainer - }; - } - }, { - key: 'updateUpdateMenu', - value: function updateUpdateMenu(update) { - var newUpdate = {}; - var updateMenuIndex = this.props.updateMenuIndex; - - for (var key in update) { - var newkey = 'updatemenus[' + updateMenuIndex + '].' + key; - newUpdate[newkey] = update[key]; - } - this.context.updateContainer(newUpdate); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, this.props); - } - }]); - - return UpdateMenuConnectedComponent; - }(_react.Component); - - UpdateMenuConnectedComponent.displayName = 'UpdateMenuConnected' + (0, _lib.getDisplayName)(WrappedComponent); - - UpdateMenuConnectedComponent.propTypes = { - updateMenuIndex: _propTypes2.default.number.isRequired - }; - - UpdateMenuConnectedComponent.contextTypes = { - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - onUpdate: _propTypes2.default.func, - updateContainer: _propTypes2.default.func, - getValObject: _propTypes2.default.func - }; - - UpdateMenuConnectedComponent.childContextTypes = { - updateContainer: _propTypes2.default.func, - container: _propTypes2.default.object, - fullContainer: _propTypes2.default.object, - getValObject: _propTypes2.default.func - }; - - var plotly_editor_traits = WrappedComponent.plotly_editor_traits; - - UpdateMenuConnectedComponent.plotly_editor_traits = plotly_editor_traits; - - return UpdateMenuConnectedComponent; -} -//# sourceMappingURL=connectUpdateMenuToLayout.js.map \ No newline at end of file diff --git a/lib/lib/connectUpdateMenuToLayout.js.map b/lib/lib/connectUpdateMenuToLayout.js.map deleted file mode 100644 index 416d9db04..000000000 --- a/lib/lib/connectUpdateMenuToLayout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/connectUpdateMenuToLayout.js"],"names":["connectUpdateMenuToLayout","WrappedComponent","UpdateMenuConnectedComponent","props","context","updateUpdateMenu","bind","setLocals","nextProps","nextContext","updateMenuIndex","container","fullContainer","updatemenus","fullUpdateMenus","getValObject","attr","updateContainer","update","newUpdate","key","newkey","Component","displayName","propTypes","PropTypes","number","isRequired","contextTypes","object","onUpdate","func","childContextTypes","plotly_editor_traits"],"mappings":";;;;;;;;kBAIwBA,yB;;AAJxB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASA,yBAAT,CAAmCC,gBAAnC,EAAqD;AAAA,MAC5DC,4BAD4D;AAAA;;AAEhE,0CAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,8JACpBD,KADoB,EACbC,OADa;;AAE1B,YAAKC,gBAAL,GAAwB,MAAKA,gBAAL,CAAsBC,IAAtB,OAAxB;AACA,YAAKC,SAAL,CAAeJ,KAAf,EAAsBC,OAAtB;AAH0B;AAI3B;;AAN+D;AAAA;AAAA,gDAQtCI,SARsC,EAQ3BC,W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G,0BAAwBX,eAAxB,UAA4CU,GAAlD;AACAD,oBAAUE,MAAV,IAAoBH,OAAOE,GAAP,CAApB;AACD;AACD,aAAKhB,OAAL,CAAaa,eAAb,CAA6BE,SAA7B;AACD;AAlD+D;AAAA;AAAA,+BAoDvD;AACP,eAAO,8BAAC,gBAAD,EAAsB,KAAKhB,KAA3B,CAAP;AACD;AAtD+D;;AAAA;AAAA,IACvBmB,gBADuB;;AAyDlEpB,+BAA6BqB,WAA7B,2BAAiE,yBAC/DtB,gBAD+D,CAAjE;;AAIAC,+BAA6BsB,SAA7B,GAAyC;AACvCd,qBAAiBe,oBAAUC,MAAV,CAAiBC;AADK,GAAzC;;AAIAzB,+BAA6B0B,YAA7B,GAA4C;AAC1CjB,eAAWc,oBAAUI,MADqB;AAE1CjB,mBAAea,oBAAUI,MAFiB;AAG1CC,cAAUL,oBAAUM,IAHsB;AAI1Cd,qBAAiBQ,oBAAUM,IAJe;AAK1ChB,kBAAcU,oBAAUM;AALkB,GAA5C;;AAQA7B,+BAA6B8B,iBAA7B,GAAiD;AAC/Cf,qBAAiBQ,oBAAUM,IADoB;AAE/CpB,eAAWc,oBAAUI,MAF0B;AAG/CjB,mBAAea,oBAAUI,MAHsB;AAI/Cd,kBAAcU,oBAAUM;AAJuB,GAAjD;;AAzEkE,MAgF3DE,oBAhF2D,GAgFnChC,gBAhFmC,CAgF3DgC,oBAhF2D;;AAiFlE/B,+BAA6B+B,oBAA7B,GAAoDA,oBAApD;;AAEA,SAAO/B,4BAAP;AACD","file":"connectUpdateMenuToLayout.js","sourcesContent":["import React, {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {getDisplayName} from '../lib';\n\nexport default function connectUpdateMenuToLayout(WrappedComponent) {\n class UpdateMenuConnectedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n this.updateUpdateMenu = this.updateUpdateMenu.bind(this);\n this.setLocals(props, context);\n }\n\n componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n\n setLocals(props, context) {\n const {updateMenuIndex} = props;\n const {container, fullContainer} = context;\n\n const updatemenus = container.updatemenus || [];\n const fullUpdateMenus = fullContainer.updatemenus || [];\n this.container = updatemenus[updateMenuIndex];\n this.fullContainer = fullUpdateMenus[updateMenuIndex];\n }\n\n getChildContext() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`updatemenus[].${attr}`),\n updateContainer: this.updateUpdateMenu,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n provideValue() {\n return {\n getValObject: attr =>\n !this.context.getValObject ? null : this.context.getValObject(`updatemenus[].${attr}`),\n updateContainer: this.updateUpdateMenu,\n container: this.container,\n fullContainer: this.fullContainer,\n };\n }\n\n updateUpdateMenu(update) {\n const newUpdate = {};\n const {updateMenuIndex} = this.props;\n for (const key in update) {\n const newkey = `updatemenus[${updateMenuIndex}].${key}`;\n newUpdate[newkey] = update[key];\n }\n this.context.updateContainer(newUpdate);\n }\n\n render() {\n return ;\n }\n }\n\n UpdateMenuConnectedComponent.displayName = `UpdateMenuConnected${getDisplayName(\n WrappedComponent\n )}`;\n\n UpdateMenuConnectedComponent.propTypes = {\n updateMenuIndex: PropTypes.number.isRequired,\n };\n\n UpdateMenuConnectedComponent.contextTypes = {\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n onUpdate: PropTypes.func,\n updateContainer: PropTypes.func,\n getValObject: PropTypes.func,\n };\n\n UpdateMenuConnectedComponent.childContextTypes = {\n updateContainer: PropTypes.func,\n container: PropTypes.object,\n fullContainer: PropTypes.object,\n getValObject: PropTypes.func,\n };\n\n const {plotly_editor_traits} = WrappedComponent;\n UpdateMenuConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n\n return UpdateMenuConnectedComponent;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/constants.js b/lib/lib/constants.js deleted file mode 100644 index f3168d0d4..000000000 --- a/lib/lib/constants.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var baseClass = exports.baseClass = 'plotly-editor'; - -/* - * Control represents multiple settings (like for several axes) - * and the values are different. - * - * Because this is sometimes used in contexts where users can enter freeform - * strings, we include a non-printable character (ESC) so it's not something - * people could type. - */ -var MULTI_VALUED = exports.MULTI_VALUED = '\x1bMIXED_VALUES'; - -// how mixed values are represented in text inputs -var MULTI_VALUED_PLACEHOLDER = exports.MULTI_VALUED_PLACEHOLDER = '---'; - -var getMultiValueText = exports.getMultiValueText = function getMultiValueText(key, _) { - var multiValueText = { - title: _('Multiple Values'), - text: _('This input has multiple values associated with it. ' + 'Changing this setting will override these custom inputs.'), - subText: _("Common Case: An 'All' tab might display this message " + 'because the X and Y tabs contain different settings.') - }; - return multiValueText[key]; -}; - -var EDITOR_ACTIONS = exports.EDITOR_ACTIONS = { - UPDATE_TRACES: 'plotly-editor-update-traces', - ADD_TRACE: 'plotly-editor-add-trace', - DELETE_TRACE: 'plotly-editor-delete-trace', - UPDATE_LAYOUT: 'plotly-editor-update-layout', - DELETE_ANNOTATION: 'plotly-editor-delete-annotation', - DELETE_SHAPE: 'plotly-editor-delete-shape', - DELETE_IMAGE: 'plotly-editor-delete-image', - DELETE_RANGESELECTOR: 'plotly-editor-delete-rangeselector', - DELETE_TRANSFORM: 'plotly-editor-delete-transform' -}; - -var DEFAULT_FONTS = exports.DEFAULT_FONTS = [{ label: 'Sans Serif', value: 'sans-serif' }, { label: 'Serif', value: 'serif' }, { label: 'Monospaced', value: 'monospace' }]; - -var RETURN_KEY = exports.RETURN_KEY = 'Enter'; -var ESCAPE_KEY = exports.ESCAPE_KEY = 'Escape'; -var COMMAND_KEY = exports.COMMAND_KEY = 'Meta'; -var CONTROL_KEY = exports.CONTROL_KEY = 'Control'; - -// matches gd._fullLayout._subplots categories except for xaxis & yaxis which -// are in fact cartesian types -var TRACE_TO_AXIS = exports.TRACE_TO_AXIS = { - cartesian: ['scatter', 'scattergl', 'box', 'violin', 'bar', 'heatmap', 'heatmapgl', 'contour', 'ohlc', 'candlestick', 'histogram', 'histogram2d', 'histogram2dcontour'], - ternary: ['scatterternary'], - gl3d: ['scatter3d', 'surface', 'mesh3d', 'cone', 'streamtube'], - geo: ['scattergeo', 'choropleth'], - mapbox: ['scattermapbox'], - polar: ['scatterpolar', 'scatterpolargl', 'barpolar'] -}; - -// Note: scene, and xaxis/yaxis were added for convenience sake even though they're not subplot types -var SUBPLOT_TO_ATTR = exports.SUBPLOT_TO_ATTR = { - cartesian: { data: ['xaxis', 'yaxis'], layout: ['x', 'y'] }, - xaxis: { data: 'xaxis', layout: 'x' }, - yaxis: { data: 'yaxis', layout: 'y' }, - x: { data: 'xaxis', layout: 'x' }, - y: { data: 'yaxis', layout: 'y' }, - ternary: { data: 'subplot', layout: 'ternary' }, - gl3d: { data: 'scene', layout: 'scene' }, - scene: { data: 'scene', layout: 'scene' }, - geo: { data: 'geo', layout: 'geo' }, - mapbox: { data: 'subplot', layout: 'mapbox' }, - polar: { data: 'subplot', layout: 'polar' } -}; - -var subplotName = exports.subplotName = function subplotName(type, _) { - return { - x: _('X'), - y: _('Y'), - ternary: _('Ternary'), - gl3d: _('Scene'), - scene: _('Scene'), - geo: _('Geo'), - mapbox: _('Mapbox'), - polar: _('Polar') - }[type]; -}; - -var TRANSFORMS_LIST = exports.TRANSFORMS_LIST = ['filter', 'groupby', 'aggregate', 'sort']; - -var TRANSFORMABLE_TRACES = exports.TRANSFORMABLE_TRACES = ['scatter', 'scattergl', 'box', 'violin', 'bar', 'ohlc', 'candlestick', 'histogram', 'histogram2d']; - -var TRACES_WITH_GL = exports.TRACES_WITH_GL = ['scatter', 'scatterpolar', 'scattergl', 'scatterpolargl']; - -var COLORS = exports.COLORS = { - charcoal: '#444444', - white: '#ffffff', - mutedBlue: '#1f77b4', - safetyOrange: '#ff7f0e', - cookedAsparagusGreen: '#2ca02c', - brickRed: '#d62728', - mutedPurple: '#9467bd', - chestnutBrown: '#8c564b', - raspberryYogurtPink: '#e377c2', - middleGray: '#7f7f7f', - curryYellowGreen: '#bcbd22', - blueTeal: '#17becf', - editorLink: '#447bdc', - black: '#000000' -}; - -var DEFAULT_COLORS = exports.DEFAULT_COLORS = [COLORS.charcoal, COLORS.white, COLORS.mutedBlue, COLORS.safetyOrange, COLORS.cookedAsparagusGreen, COLORS.brickRed, COLORS.mutedPurple, COLORS.chestnutBrown, COLORS.raspberryYogurtPink, COLORS.middleGray, COLORS.curryYellowGreen, COLORS.blueTeal]; -//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/lib/lib/constants.js.map b/lib/lib/constants.js.map deleted file mode 100644 index 48812fc95..000000000 --- a/lib/lib/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/constants.js"],"names":["baseClass","MULTI_VALUED","MULTI_VALUED_PLACEHOLDER","getMultiValueText","key","_","multiValueText","title","text","subText","EDITOR_ACTIONS","UPDATE_TRACES","ADD_TRACE","DELETE_TRACE","UPDATE_LAYOUT","DELETE_ANNOTATION","DELETE_SHAPE","DELETE_IMAGE","DELETE_RANGESELECTOR","DELETE_TRANSFORM","DEFAULT_FONTS","label","value","RETURN_KEY","ESCAPE_KEY","COMMAND_KEY","CONTROL_KEY","TRACE_TO_AXIS","cartesian","ternary","gl3d","geo","mapbox","polar","SUBPLOT_TO_ATTR","data","layout","xaxis","yaxis","x","y","scene","subplotName","type","TRANSFORMS_LIST","TRANSFORMABLE_TRACES","TRACES_WITH_GL","COLORS","charcoal","white","mutedBlue","safetyOrange","cookedAsparagusGreen","brickRed","mutedPurple","chestnutBrown","raspberryYogurtPink","middleGray","curryYellowGreen","blueTeal","editorLink","black","DEFAULT_COLORS"],"mappings":";;;;;AAAO,IAAMA,gCAAY,eAAlB;;AAEP;;;;;;;;AAQO,IAAMC,sCAAe,kBAArB;;AAEP;AACO,IAAMC,8DAA2B,KAAjC;;AAEA,IAAMC,gDAAoB,SAApBA,iBAAoB,CAACC,GAAD,EAAMC,CAAN,EAAY;AAC3C,MAAMC,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FkC,EAGlC,KAHkC,EAIlC,QAJkC,EAKlC,KALkC,EAMlC,MANkC,EAOlC,aAPkC,EAQlC,WARkC,EASlC,aATkC,CAA7B;;AAYA,IAAMC,0CAAiB,CAAC,SAAD,EAAY,cAAZ,EAA4B,WAA5B,EAAyC,gBAAzC,CAAvB;;AAEA,IAAMC,0BAAS;AACpBC,YAAU,SADU;AAEpBC,SAAO,SAFa;AAGpBC,aAAW,SAHS;AAIpBC,gBAAc,SAJM;AAKpBC,wBAAsB,SALF;AAMpBC,YAAU,SANU;AAOpBC,eAAa,SAPO;AAQpBC,iBAAe,SARK;AASpBC,uBAAqB,SATD;AAUpBC,cAAY,SAVQ;AAWpBC,oBAAkB,SAXE;AAYpBC,YAAU,SAZU;AAapBC,cAAY,SAbQ;AAcpBC,SAAO;AAda,CAAf;;AAiBA,IAAMC,0CAAiB,CAC5Bf,OAAOC,QADqB,EAE5BD,OAAOE,KAFqB,EAG5BF,OAAOG,SAHqB,EAI5BH,OAAOI,YAJqB,EAK5BJ,OAAOK,oBALqB,EAM5BL,OAAOM,QANqB,EAO5BN,OAAOO,WAPqB,EAQ5BP,OAAOQ,aARqB,EAS5BR,OAAOS,mBATqB,EAU5BT,OAAOU,UAVqB,EAW5BV,OAAOW,gBAXqB,EAY5BX,OAAOY,QAZqB,CAAvB","file":"constants.js","sourcesContent":["export const baseClass = 'plotly-editor';\n\n/*\n * Control represents multiple settings (like for several axes)\n * and the values are different.\n *\n * Because this is sometimes used in contexts where users can enter freeform\n * strings, we include a non-printable character (ESC) so it's not something\n * people could type.\n */\nexport const MULTI_VALUED = '\\x1bMIXED_VALUES';\n\n// how mixed values are represented in text inputs\nexport const MULTI_VALUED_PLACEHOLDER = '---';\n\nexport const getMultiValueText = (key, _) => {\n const multiValueText = {\n title: _('Multiple Values'),\n text: _(\n 'This input has multiple values associated with it. ' +\n 'Changing this setting will override these custom inputs.'\n ),\n subText: _(\n \"Common Case: An 'All' tab might display this message \" +\n 'because the X and Y tabs contain different settings.'\n ),\n };\n return multiValueText[key];\n};\n\nexport const EDITOR_ACTIONS = {\n UPDATE_TRACES: 'plotly-editor-update-traces',\n ADD_TRACE: 'plotly-editor-add-trace',\n DELETE_TRACE: 'plotly-editor-delete-trace',\n UPDATE_LAYOUT: 'plotly-editor-update-layout',\n DELETE_ANNOTATION: 'plotly-editor-delete-annotation',\n DELETE_SHAPE: 'plotly-editor-delete-shape',\n DELETE_IMAGE: 'plotly-editor-delete-image',\n DELETE_RANGESELECTOR: 'plotly-editor-delete-rangeselector',\n DELETE_TRANSFORM: 'plotly-editor-delete-transform',\n};\n\nexport const DEFAULT_FONTS = [\n {label: 'Sans Serif', value: 'sans-serif'},\n {label: 'Serif', value: 'serif'},\n {label: 'Monospaced', value: 'monospace'},\n];\n\nexport const RETURN_KEY = 'Enter';\nexport const ESCAPE_KEY = 'Escape';\nexport const COMMAND_KEY = 'Meta';\nexport const CONTROL_KEY = 'Control';\n\n// matches gd._fullLayout._subplots categories except for xaxis & yaxis which\n// are in fact cartesian types\nexport const TRACE_TO_AXIS = {\n cartesian: [\n 'scatter',\n 'scattergl',\n 'box',\n 'violin',\n 'bar',\n 'heatmap',\n 'heatmapgl',\n 'contour',\n 'ohlc',\n 'candlestick',\n 'histogram',\n 'histogram2d',\n 'histogram2dcontour',\n ],\n ternary: ['scatterternary'],\n gl3d: ['scatter3d', 'surface', 'mesh3d', 'cone', 'streamtube'],\n geo: ['scattergeo', 'choropleth'],\n mapbox: ['scattermapbox'],\n polar: ['scatterpolar', 'scatterpolargl', 'barpolar'],\n};\n\n// Note: scene, and xaxis/yaxis were added for convenience sake even though they're not subplot types\nexport const SUBPLOT_TO_ATTR = {\n cartesian: {data: ['xaxis', 'yaxis'], layout: ['x', 'y']},\n xaxis: {data: 'xaxis', layout: 'x'},\n yaxis: {data: 'yaxis', layout: 'y'},\n x: {data: 'xaxis', layout: 'x'},\n y: {data: 'yaxis', layout: 'y'},\n ternary: {data: 'subplot', layout: 'ternary'},\n gl3d: {data: 'scene', layout: 'scene'},\n scene: {data: 'scene', layout: 'scene'},\n geo: {data: 'geo', layout: 'geo'},\n mapbox: {data: 'subplot', layout: 'mapbox'},\n polar: {data: 'subplot', layout: 'polar'},\n};\n\nexport const subplotName = (type, _) =>\n ({\n x: _('X'),\n y: _('Y'),\n ternary: _('Ternary'),\n gl3d: _('Scene'),\n scene: _('Scene'),\n geo: _('Geo'),\n mapbox: _('Mapbox'),\n polar: _('Polar'),\n }[type]);\n\nexport const TRANSFORMS_LIST = ['filter', 'groupby', 'aggregate', 'sort'];\n\nexport const TRANSFORMABLE_TRACES = [\n 'scatter',\n 'scattergl',\n 'box',\n 'violin',\n 'bar',\n 'ohlc',\n 'candlestick',\n 'histogram',\n 'histogram2d',\n];\n\nexport const TRACES_WITH_GL = ['scatter', 'scatterpolar', 'scattergl', 'scatterpolargl'];\n\nexport const COLORS = {\n charcoal: '#444444',\n white: '#ffffff',\n mutedBlue: '#1f77b4',\n safetyOrange: '#ff7f0e',\n cookedAsparagusGreen: '#2ca02c',\n brickRed: '#d62728',\n mutedPurple: '#9467bd',\n chestnutBrown: '#8c564b',\n raspberryYogurtPink: '#e377c2',\n middleGray: '#7f7f7f',\n curryYellowGreen: '#bcbd22',\n blueTeal: '#17becf',\n editorLink: '#447bdc',\n black: '#000000',\n};\n\nexport const DEFAULT_COLORS = [\n COLORS.charcoal,\n COLORS.white,\n COLORS.mutedBlue,\n COLORS.safetyOrange,\n COLORS.cookedAsparagusGreen,\n COLORS.brickRed,\n COLORS.mutedPurple,\n COLORS.chestnutBrown,\n COLORS.raspberryYogurtPink,\n COLORS.middleGray,\n COLORS.curryYellowGreen,\n COLORS.blueTeal,\n];\n"]} \ No newline at end of file diff --git a/lib/lib/customTraceType.js b/lib/lib/customTraceType.js deleted file mode 100644 index 29efd1b0c..000000000 --- a/lib/lib/customTraceType.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -exports.plotlyTraceToCustomTrace = plotlyTraceToCustomTrace; -exports.traceTypeToPlotlyInitFigure = traceTypeToPlotlyInitFigure; - -var _constants = require('./constants'); - -function plotlyTraceToCustomTrace(trace) { - if ((typeof trace === 'undefined' ? 'undefined' : _typeof(trace)) !== 'object') { - throw new Error('trace provided to plotlyTraceToCustomTrace function should be an object, received ' + (typeof trace === 'undefined' ? 'undefined' : _typeof(trace))); - } - - var gl = 'gl'; - var type = trace.type ? trace.type.endsWith(gl) ? trace.type.slice(0, -gl.length) : trace.type : 'scatter'; - - if ((type === 'scatter' || type === 'scattergl') && (![null, undefined, ''].includes(trace.stackgroup) || // eslint-disable-line no-undefined - ['tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'].includes(trace.fill))) { - return 'area'; - } else if ((type === 'scatter' || type === 'scattergl') && (trace.mode === 'lines' || trace.mode === 'lines+markers')) { - return 'line'; - } else if (type === 'scatter3d' && trace.mode === 'lines') { - return 'line3d'; - } - return type; -} - -function traceTypeToPlotlyInitFigure(traceType) { - var gl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - - var scatterTrace = { type: 'scatter' + gl, mode: 'markers', stackgroup: null }; - - switch (traceType) { - case 'line': - return { type: 'scatter' + gl, mode: 'lines', stackgroup: null }; - case 'scatter': - return scatterTrace; - case undefined: - // eslint-disable-line - return scatterTrace; - case 'area': - return { type: 'scatter' + gl, mode: 'lines', stackgroup: 1 }; - case 'scatterpolar': - return { type: 'scatterpolar' + gl }; - case 'ohlc': - return { - type: 'ohlc', - decreasing: { line: { color: _constants.COLORS.middleGray } }, - increasing: { line: { color: _constants.COLORS.blueTeal } } - }; - case 'candlestick': - return { - type: 'candlestick', - decreasing: { - line: { color: _constants.COLORS.middleGray }, - fillcolor: 'rgba(127, 127, 127, 0.5)' - }, - increasing: { - line: { color: _constants.COLORS.blueTeal }, - fillcolor: 'rgba(23, 190, 207, 0.5)' - } - }; - case 'box': - return { - type: 'box', - boxpoints: false - }; - case 'violin': - return { - type: 'violin', - bandwidth: 0 - }; - case 'line3d': - return { - type: 'scatter3d', - mode: 'lines' - }; - case 'scatter3d': - return { - type: 'scatter3d', - mode: 'markers' - }; - case 'pie': - return { - marker: { - colors: [] - }, - type: 'pie' - }; - case 'bar': - return { - orientation: 'v', - type: 'bar' - }; - case 'cone': - return { - sizeref: 1, - type: 'cone' - }; - default: - return { type: traceType }; - } -} -//# sourceMappingURL=customTraceType.js.map \ No newline at end of file diff --git a/lib/lib/customTraceType.js.map b/lib/lib/customTraceType.js.map deleted file mode 100644 index 84211f28d..000000000 --- a/lib/lib/customTraceType.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/customTraceType.js"],"names":["plotlyTraceToCustomTrace","traceTypeToPlotlyInitFigure","trace","Error","gl","type","endsWith","slice","length","undefined","includes","stackgroup","fill","mode","traceType","scatterTrace","decreasing","line","color","COLORS","middleGray","increasing","blueTeal","fillcolor","boxpoints","bandwidth","marker","colors","orientation","sizeref"],"mappings":";;;;;;;;QAEgBA,wB,GAAAA,wB;QA+BAC,2B,GAAAA,2B;;AAjChB;;AAEO,SAASD,wBAAT,CAAkCE,KAAlC,EAAyC;AAC9C,MAAI,QAAOA,KAAP,yCAAOA,KAAP,OAAiB,QAArB,EAA+B;AAC7B,UAAM,IAAIC,KAAJ,gGACwFD,KADxF,yCACwFA,KADxF,GAAN;AAGD;;AAED,MAAME,KAAK,IAAX;AACA,MAAMC,OAAOH,MAAMG,IAAN,GACTH,MAAMG,IAAN,CAAWC,QAAX,CAAoBF,EAApB,IACEF,MAAMG,IAAN,CAAWE,KAAX,CAAiB,CAAjB,EAAoB,CAACH,GAAGI,MAAxB,CADF,GAEEN,MAAMG,IAHC,GAIT,SAJJ;;AAMA,MACE,CAACA,SAAS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AACJ,MAAM,EAACC,OAAOC,kBAAOG,QAAf,EAAP;AAHP,OAAP;AAKF,SAAK,aAAL;AACE,aAAO;AACLjB,cAAM,aADD;AAELW,oBAAY;AACVC,gBAAM,EAACC,OAAOC,kBAAOC,UAAf,EADI;AAEVG,qBAAW;AAFD,SAFP;AAMLF,oBAAY;AACVJ,gBAAM,EAACC,OAAOC,kBAAOG,QAAf,EADI;AAEVC,qBAAW;AAFD;AANP,OAAP;AAWF,SAAK,KAAL;AACE,aAAO;AACLlB,cAAM,KADD;AAELmB,mBAAW;AAFN,OAAP;AAIF,SAAK,QAAL;AACE,aAAO;AACLnB,cAAM,QADD;AAELoB,mBAAW;AAFN,OAAP;AAIF,SAAK,QAAL;AACE,aAAO;AACLpB,cAAM,WADD;AAELQ,cAAM;AAFD,OAAP;AAIF,SAAK,WAAL;AACE,aAAO;AACLR,cAAM,WADD;AAELQ,cAAM;AAFD,OAAP;AAIF,SAAK,KAAL;AACE,aAAO;AACLa,gBAAQ;AACNC,kBAAQ;AADF,SADH;AAILtB,cAAM;AAJD,OAAP;AAMF,SAAK,KAAL;AACE,aAAO;AACLuB,qBAAa,GADR;AAELvB,cAAM;AAFD,OAAP;AAIF,SAAK,MAAL;AACE,aAAO;AACLwB,iBAAS,CADJ;AAELxB,cAAM;AAFD,OAAP;AAIF;AACE,aAAO,EAACA,MAAMS,SAAP,EAAP;AAnEJ;AAqED","file":"customTraceType.js","sourcesContent":["import {COLORS} from 'lib/constants';\n\nexport function plotlyTraceToCustomTrace(trace) {\n if (typeof trace !== 'object') {\n throw new Error(\n `trace provided to plotlyTraceToCustomTrace function should be an object, received ${typeof trace}`\n );\n }\n\n const gl = 'gl';\n const type = trace.type\n ? trace.type.endsWith(gl)\n ? trace.type.slice(0, -gl.length)\n : trace.type\n : 'scatter';\n\n if (\n (type === 'scatter' || type === 'scattergl') &&\n (![null, undefined, ''].includes(trace.stackgroup) || // eslint-disable-line no-undefined\n ['tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'].includes(trace.fill))\n ) {\n return 'area';\n } else if (\n (type === 'scatter' || type === 'scattergl') &&\n (trace.mode === 'lines' || trace.mode === 'lines+markers')\n ) {\n return 'line';\n } else if (type === 'scatter3d' && trace.mode === 'lines') {\n return 'line3d';\n }\n return type;\n}\n\nexport function traceTypeToPlotlyInitFigure(traceType, gl = '') {\n const scatterTrace = {type: 'scatter' + gl, mode: 'markers', stackgroup: null};\n\n switch (traceType) {\n case 'line':\n return {type: 'scatter' + gl, mode: 'lines', stackgroup: null};\n case 'scatter':\n return scatterTrace;\n case undefined: // eslint-disable-line\n return scatterTrace;\n case 'area':\n return {type: 'scatter' + gl, mode: 'lines', stackgroup: 1};\n case 'scatterpolar':\n return {type: 'scatterpolar' + gl};\n case 'ohlc':\n return {\n type: 'ohlc',\n decreasing: {line: {color: COLORS.middleGray}},\n increasing: {line: {color: COLORS.blueTeal}},\n };\n case 'candlestick':\n return {\n type: 'candlestick',\n decreasing: {\n line: {color: COLORS.middleGray},\n fillcolor: 'rgba(127, 127, 127, 0.5)',\n },\n increasing: {\n line: {color: COLORS.blueTeal},\n fillcolor: 'rgba(23, 190, 207, 0.5)',\n },\n };\n case 'box':\n return {\n type: 'box',\n boxpoints: false,\n };\n case 'violin':\n return {\n type: 'violin',\n bandwidth: 0,\n };\n case 'line3d':\n return {\n type: 'scatter3d',\n mode: 'lines',\n };\n case 'scatter3d':\n return {\n type: 'scatter3d',\n mode: 'markers',\n };\n case 'pie':\n return {\n marker: {\n colors: [],\n },\n type: 'pie',\n };\n case 'bar':\n return {\n orientation: 'v',\n type: 'bar',\n };\n case 'cone':\n return {\n sizeref: 1,\n type: 'cone',\n };\n default:\n return {type: traceType};\n }\n}\n"]} \ No newline at end of file diff --git a/lib/lib/dereference.js b/lib/lib/dereference.js deleted file mode 100644 index 5af1a6805..000000000 --- a/lib/lib/dereference.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = dereference; - -var _walkObject = require('./walkObject'); - -var _walkObject2 = _interopRequireDefault(_walkObject); - -var _index = require('./index'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SRC_ATTR_PATTERN = /src$/; - -function dereference(container, dataSources) { - var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { deleteKeys: false }; - - var replacer = function replacer(key, parent, srcPath) { - if (!SRC_ATTR_PATTERN.test(key)) { - return; - } - - var dataKey = key.replace(SRC_ATTR_PATTERN, ''); - var traceType = parent.type; - - var srcRef = config.toSrc ? config.toSrc(parent[key]) : parent[key]; - - // making this into an array to more easily lookup 1d and 2d srcs in dataSourceOptions - if (!Array.isArray(srcRef)) { - srcRef = [srcRef]; - } - - var data = srcRef.map(function (ref) { - if (config.deleteKeys && !(ref in dataSources)) { - delete parent[dataKey]; - } - return dataSources[ref]; - }); - - // remove extra data wrapping - if (srcRef.length === 1) { - data = data[0]; - } - - if (!Array.isArray(data)) { - return; - } - - parent[dataKey] = (0, _index.maybeTransposeData)(data, srcPath, traceType); - }; - - (0, _walkObject2.default)(container, replacer, { - walkArraysMatchingKeys: ['data', 'transforms'], - pathType: 'nestedProperty' - }); -} -//# sourceMappingURL=dereference.js.map \ No newline at end of file diff --git a/lib/lib/dereference.js.map b/lib/lib/dereference.js.map deleted file mode 100644 index 6585881ec..000000000 --- a/lib/lib/dereference.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/dereference.js"],"names":["dereference","SRC_ATTR_PATTERN","container","dataSources","config","deleteKeys","replacer","key","parent","srcPath","test","dataKey","replace","traceType","type","srcRef","toSrc","Array","isArray","data","map","ref","length","walkArraysMatchingKeys","pathType"],"mappings":";;;;;kBAKwBA,W;;AALxB;;;;AACA;;;;AAEA,IAAMC,mBAAmB,MAAzB;;AAEe,SAASD,WAAT,CAAqBE,SAArB,EAAgCC,WAAhC,EAA2E;AAAA,MAA9BC,MAA8B,uEAArB,EAACC,YAAY,KAAb,EAAqB;;AACxF,MAAMC,WAAW,SAAXA,QAAW,CAACC,GAAD,EAAMC,MAAN,EAAcC,OAAd,EAA0B;AACzC,QAAI,CAACR,iBAAiBS,IAAjB,CAAsBH,GAAtB,CAAL,EAAiC;AAC/B;AACD;;AAED,QAAMI,UAAUJ,IAAIK,OAAJ,CAAYX,gBAAZ,EAA8B,EAA9B,CAAhB;AACA,QAAMY,YAAYL,OAAOM,IAAzB;;AAEA,QAAIC,SAASX,OAAOY,KAAP,GAAeZ,OAAOY,KAAP,CAAaR,OAAOD,GAAP,CAAb,CAAf,GAA2CC,OAAOD,GAAP,CAAxD;;AAEA;AACA,QAAI,CAACU,MAAMC,OAAN,CAAcH,MAAd,CAAL,EAA4B;AAC1BA,eAAS,CAACA,MAAD,CAAT;AACD;;AAED,QAAII,OAAOJ,OAAOK,GAAP,CAAW,eAAO;AAC3B,UAAIhB,OAAOC,UAAP,IAAqB,EAAEgB,OAAOlB,WAAT,CAAzB,EAAgD;AAC9C,eAAOK,OAAOG,OAAP,CAAP;AACD;AACD,aAAOR,YAAYkB,GAAZ,CAAP;AACD,KALU,CAAX;;AAOA;AACA,QAAIN,OAAOO,MAAP,KAAkB,CAAtB,EAAyB;AACvBH,aAAOA,KAAK,CAAL,CAAP;AACD;;AAED,QAAI,CAACF,MAAMC,OAAN,CAAcC,IAAd,CAAL,EAA0B;AACxB;AACD;;AAEDX,WAAOG,OAAP,IAAkB,+BAAmBQ,IAAnB,EAAyBV,OAAzB,EAAkCI,SAAlC,CAAlB;AACD,GAhCD;;AAkCA,4BAAWX,SAAX,EAAsBI,QAAtB,EAAgC;AAC9BiB,4BAAwB,CAAC,MAAD,EAAS,YAAT,CADM;AAE9BC,cAAU;AAFoB,GAAhC;AAID","file":"dereference.js","sourcesContent":["import walkObject from './walkObject';\nimport {maybeTransposeData} from './index';\n\nconst SRC_ATTR_PATTERN = /src$/;\n\nexport default function dereference(container, dataSources, config = {deleteKeys: false}) {\n const replacer = (key, parent, srcPath) => {\n if (!SRC_ATTR_PATTERN.test(key)) {\n return;\n }\n\n const dataKey = key.replace(SRC_ATTR_PATTERN, '');\n const traceType = parent.type;\n\n let srcRef = config.toSrc ? config.toSrc(parent[key]) : parent[key];\n\n // making this into an array to more easily lookup 1d and 2d srcs in dataSourceOptions\n if (!Array.isArray(srcRef)) {\n srcRef = [srcRef];\n }\n\n let data = srcRef.map(ref => {\n if (config.deleteKeys && !(ref in dataSources)) {\n delete parent[dataKey];\n }\n return dataSources[ref];\n });\n\n // remove extra data wrapping\n if (srcRef.length === 1) {\n data = data[0];\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n parent[dataKey] = maybeTransposeData(data, srcPath, traceType);\n };\n\n walkObject(container, replacer, {\n walkArraysMatchingKeys: ['data', 'transforms'],\n pathType: 'nestedProperty',\n });\n}\n"]} \ No newline at end of file diff --git a/lib/lib/getAllAxes.js b/lib/lib/getAllAxes.js deleted file mode 100644 index e32310077..000000000 --- a/lib/lib/getAllAxes.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getAllAxes; -exports.traceTypeToAxisType = traceTypeToAxisType; -exports.axisIdToAxisName = axisIdToAxisName; -exports.getAxisTitle = getAxisTitle; -exports.getSubplotTitle = getSubplotTitle; - -var _constants = require('./constants'); - -var _2 = require('./'); - -function getAllAxes(fullLayout) { - var axes = []; - // Plotly.js should really have a helper function for this, but until it does.. - if (fullLayout && fullLayout._subplots) { - Object.keys(fullLayout._subplots).filter( - // xaxis and yaxis already included separately in _fullLayout._subplots - function (type) { - return type !== 'cartesian' && fullLayout._subplots[type].length !== 0; - }).forEach(function (type) { - fullLayout._subplots[type].forEach(function (subplot) { - if (['xaxis', 'yaxis'].includes(type)) { - // subplot will look like x2, x45, convert it to xaxis2, xaxis45 - subplot = // eslint-disable-line no-param-reassign - subplot.length > 1 ? subplot.slice(0, 1) + 'axis' + subplot.slice(1) : subplot + 'axis'; - - fullLayout[subplot]._subplot = subplot; - fullLayout[subplot]._axisGroup = type; - axes.push(fullLayout[subplot]); - } else { - Object.keys(fullLayout[subplot]).filter(function (key) { - return key.includes('axis'); - }).forEach(function (axis) { - fullLayout[subplot][axis]._subplot = subplot; - fullLayout[subplot][axis]._axisGroup = type; - - // it should be in plotly.js, but it's not there for geo axes.. - if (!fullLayout[subplot][axis]._name) { - fullLayout[subplot][axis]._name = axis; - } - axes.push(fullLayout[subplot][axis]); - }); - } - }); - }); - } - - return axes; -} - -function traceTypeToAxisType(traceType) { - var subplot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - // plotly.js actually allows traces with no type and just - // defaults them to scatter, so do this here as well. - if (!traceType) { - traceType = 'scatter'; // eslint-disable-line - } - - var category = null; - var traceToAxis = _constants.TRACE_TO_AXIS; - if (subplot) { - Object.assign(traceToAxis, _constants.TRACE_TO_AXIS, { scene: _constants.TRACE_TO_AXIS.gl3d }); - delete traceToAxis.gl3d; - } - - Object.keys(traceToAxis).forEach(function (c) { - if (traceToAxis[c].includes(traceType)) { - category = c; - } - }); - - if (category) { - return category; - } - - if (traceType === 'pie' || traceType === 'table') { - return null; - } - - throw new Error('Sorry, could not find ' + traceType + ' in any category.'); -} - -function axisIdToAxisName(id) { - return id.charAt(0) + 'axis' + id.slice(1); -} - -function getAxisNumber(axis) { - var splitSubplot = axis._subplot ? axis._subplot.split(axis._axisGroup) : []; - return splitSubplot[1] ? Number(splitSubplot[1]) : axis._name.split('axis')[1]; -} - -function getAxisTitle(axis) { - var axisType = (0, _2.capitalize)(axis._name.split('axis')[0]); - var subplotNumber = getAxisNumber(axis) || 1; - - return axis._input && axis._input.title ? (0, _2.striptags)(axisType + ': ' + axis._input.title) : (0, _2.striptags)(axisType + ' ' + subplotNumber); -} - -function getSubplotNumber(subplot, type) { - return Number(subplot.split(type)[1]); -} - -function getSubplotTitle(subplot, type, _) { - var axisName = (0, _constants.subplotName)(type, _); - var subplotNumber = getSubplotNumber(subplot, _constants.SUBPLOT_TO_ATTR[type].layout) || ''; - - return axisName + ' ' + subplotNumber; -} -//# sourceMappingURL=getAllAxes.js.map \ No newline at end of file diff --git a/lib/lib/getAllAxes.js.map b/lib/lib/getAllAxes.js.map deleted file mode 100644 index eac83b7a0..000000000 --- a/lib/lib/getAllAxes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/getAllAxes.js"],"names":["getAllAxes","traceTypeToAxisType","axisIdToAxisName","getAxisTitle","getSubplotTitle","fullLayout","axes","_subplots","Object","keys","filter","type","length","forEach","includes","subplot","slice","_subplot","_axisGroup","push","key","axis","_name","traceType","category","traceToAxis","TRACE_TO_AXIS","assign","scene","gl3d","c","Error","id","charAt","getAxisNumber","splitSubplot","split","Number","axisType","subplotNumber","_input","title","getSubplotNumber","_","axisName","SUBPLOT_TO_ATTR","layout"],"mappings":";;;;;kBAGwBA,U;QA0CRC,mB,GAAAA,mB;QA+BAC,gB,GAAAA,gB;QASAC,Y,GAAAA,Y;QAaAC,e,GAAAA,e;;AAlGhB;;AACA;;AAEe,SAASJ,UAAT,CAAoBK,UAApB,EAAgC;AAC7C,MAAMC,OAAO,EAAb;AACA;AACA,MAAID,cAAcA,WAAWE,SAA7B,EAAwC;AACtCC,WAAOC,IAAP,CAAYJ,WAAWE,SAAvB,EACGG,MADH;AAEI;AACA;AAAA,aAAQC,SAAS,WAAT,IAAwBN,WAAWE,SAAX,CAAqBI,IAArB,EAA2BC,MAA3B,KAAsC,CAAtE;AAAA,KAHJ,EAKGC,OALH,CAKW,gBAAQ;AACfR,iBAAWE,SAAX,CAAqBI,IAArB,EAA2BE,OAA3B,CAAmC,mBAAW;AAC5C,YAAI,CAAC,OAAD,EAAU,OAAV,EAAmBC,QAAnB,CAA4BH,IAA5B,CAAJ,EAAuC;AACrC;AACAI,oBAAU;AACRA,kBAAQH,MAAR,GAAiB,CAAjB,GACIG,QAAQC,KAAR,CAAc,CAAd,EAAiB,CAAjB,IAAsB,MAAtB,GAA+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ACD;;AAEM,SAASP,eAAT,CAAyBW,OAAzB,EAAkCJ,IAAlC,EAAwCgC,CAAxC,EAA2C;AAChD,MAAMC,WAAW,4BAAYjC,IAAZ,EAAkBgC,CAAlB,CAAjB;AACA,MAAMJ,gBAAgBG,iBAAiB3B,OAAjB,EAA0B8B,2BAAgBlC,IAAhB,EAAsBmC,MAAhD,KAA2D,EAAjF;;AAEA,SAAUF,QAAV,SAAsBL,aAAtB;AACD","file":"getAllAxes.js","sourcesContent":["import {TRACE_TO_AXIS, SUBPLOT_TO_ATTR, subplotName} from 'lib/constants';\nimport {capitalize, striptags} from 'lib';\n\nexport default function getAllAxes(fullLayout) {\n const axes = [];\n // Plotly.js should really have a helper function for this, but until it does..\n if (fullLayout && fullLayout._subplots) {\n Object.keys(fullLayout._subplots)\n .filter(\n // xaxis and yaxis already included separately in _fullLayout._subplots\n type => type !== 'cartesian' && fullLayout._subplots[type].length !== 0\n )\n .forEach(type => {\n fullLayout._subplots[type].forEach(subplot => {\n if (['xaxis', 'yaxis'].includes(type)) {\n // subplot will look like x2, x45, convert it to xaxis2, xaxis45\n subplot = // eslint-disable-line no-param-reassign\n subplot.length > 1\n ? subplot.slice(0, 1) + 'axis' + subplot.slice(1)\n : subplot + 'axis';\n\n fullLayout[subplot]._subplot = subplot;\n fullLayout[subplot]._axisGroup = type;\n axes.push(fullLayout[subplot]);\n } else {\n Object.keys(fullLayout[subplot])\n .filter(key => key.includes('axis'))\n .forEach(axis => {\n fullLayout[subplot][axis]._subplot = subplot;\n fullLayout[subplot][axis]._axisGroup = type;\n\n // it should be in plotly.js, but it's not there for geo axes..\n if (!fullLayout[subplot][axis]._name) {\n fullLayout[subplot][axis]._name = axis;\n }\n axes.push(fullLayout[subplot][axis]);\n });\n }\n });\n });\n }\n\n return axes;\n}\n\nexport function traceTypeToAxisType(traceType, subplot = false) {\n // plotly.js actually allows traces with no type and just\n // defaults them to scatter, so do this here as well.\n if (!traceType) {\n traceType = 'scatter'; // eslint-disable-line\n }\n\n let category = null;\n const traceToAxis = TRACE_TO_AXIS;\n if (subplot) {\n Object.assign(traceToAxis, TRACE_TO_AXIS, {scene: TRACE_TO_AXIS.gl3d});\n delete traceToAxis.gl3d;\n }\n\n Object.keys(traceToAxis).forEach(c => {\n if (traceToAxis[c].includes(traceType)) {\n category = c;\n }\n });\n\n if (category) {\n return category;\n }\n\n if (traceType === 'pie' || traceType === 'table') {\n return null;\n }\n\n throw new Error(`Sorry, could not find ${traceType} in any category.`);\n}\n\nexport function axisIdToAxisName(id) {\n return id.charAt(0) + 'axis' + id.slice(1);\n}\n\nfunction getAxisNumber(axis) {\n const splitSubplot = axis._subplot ? axis._subplot.split(axis._axisGroup) : [];\n return splitSubplot[1] ? Number(splitSubplot[1]) : axis._name.split('axis')[1];\n}\n\nexport function getAxisTitle(axis) {\n const axisType = capitalize(axis._name.split('axis')[0]);\n const subplotNumber = getAxisNumber(axis) || 1;\n\n return axis._input && axis._input.title\n ? striptags(`${axisType}: ${axis._input.title}`)\n : striptags(`${axisType} ${subplotNumber}`);\n}\n\nfunction getSubplotNumber(subplot, type) {\n return Number(subplot.split(type)[1]);\n}\n\nexport function getSubplotTitle(subplot, type, _) {\n const axisName = subplotName(type, _);\n const subplotNumber = getSubplotNumber(subplot, SUBPLOT_TO_ATTR[type].layout) || '';\n\n return `${axisName} ${subplotNumber}`;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/index.js b/lib/lib/index.js deleted file mode 100644 index 8dbe2c652..000000000 --- a/lib/lib/index.js +++ /dev/null @@ -1,316 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.EDITOR_ACTIONS = exports.getFullTrace = exports.transpose = exports.traceTypeToAxisType = exports.striptags = exports.tooLight = exports.walkObject = exports.unpackPlotProps = exports.renderTraceIcon = exports.plotlyTraceToCustomTrace = exports.maybeTransposeData = exports.maybeAdjustSrc = exports.localizeString = exports.localize = exports.isPlainObject = exports.getDisplayName = exports.getSubplotTitle = exports.getAxisTitle = exports.getAllAxes = exports.dereference = exports.traceTypeToPlotlyInitFigure = exports.computeTraceOptionsFromSchema = exports.containerConnectedContextTypes = exports.connectTraceToPlot = exports.connectAggregationToTransform = exports.connectTransformToTrace = exports.connectRangeSelectorToAxis = exports.connectToContainer = exports.connectLayoutToPlot = exports.connectAxesToLayout = exports.connectImageToLayout = exports.connectUpdateMenuToLayout = exports.connectSliderToLayout = exports.connectShapeToLayout = exports.connectAnnotationToLayout = exports.connectNonCartesianSubplotToLayout = exports.connectCartesianSubplotToLayout = exports.clamp = exports.pascalCase = exports.camelCase = exports.removeNonWord = exports.upperCase = exports.lowerCase = exports.capitalize = exports.bem = exports.axisIdToAxisName = exports.adjustColorscale = undefined; - -var _bem = require('./bem'); - -var _bem2 = _interopRequireDefault(_bem); - -var _connectCartesianSubplotToLayout = require('./connectCartesianSubplotToLayout'); - -var _connectCartesianSubplotToLayout2 = _interopRequireDefault(_connectCartesianSubplotToLayout); - -var _connectNonCartesianSubplotToLayout = require('./connectNonCartesianSubplotToLayout'); - -var _connectNonCartesianSubplotToLayout2 = _interopRequireDefault(_connectNonCartesianSubplotToLayout); - -var _connectAnnotationToLayout = require('./connectAnnotationToLayout'); - -var _connectAnnotationToLayout2 = _interopRequireDefault(_connectAnnotationToLayout); - -var _connectShapeToLayout = require('./connectShapeToLayout'); - -var _connectShapeToLayout2 = _interopRequireDefault(_connectShapeToLayout); - -var _connectSliderToLayout = require('./connectSliderToLayout'); - -var _connectSliderToLayout2 = _interopRequireDefault(_connectSliderToLayout); - -var _connectImageToLayout = require('./connectImageToLayout'); - -var _connectImageToLayout2 = _interopRequireDefault(_connectImageToLayout); - -var _connectUpdateMenuToLayout = require('./connectUpdateMenuToLayout'); - -var _connectUpdateMenuToLayout2 = _interopRequireDefault(_connectUpdateMenuToLayout); - -var _connectRangeSelectorToAxis = require('./connectRangeSelectorToAxis'); - -var _connectRangeSelectorToAxis2 = _interopRequireDefault(_connectRangeSelectorToAxis); - -var _connectTransformToTrace = require('./connectTransformToTrace'); - -var _connectTransformToTrace2 = _interopRequireDefault(_connectTransformToTrace); - -var _connectAggregationToTransform = require('./connectAggregationToTransform'); - -var _connectAggregationToTransform2 = _interopRequireDefault(_connectAggregationToTransform); - -var _connectAxesToLayout = require('./connectAxesToLayout'); - -var _connectAxesToLayout2 = _interopRequireDefault(_connectAxesToLayout); - -var _connectLayoutToPlot = require('./connectLayoutToPlot'); - -var _connectLayoutToPlot2 = _interopRequireDefault(_connectLayoutToPlot); - -var _connectToContainer = require('./connectToContainer'); - -var _connectToContainer2 = _interopRequireDefault(_connectToContainer); - -var _computeTraceOptionsFromSchema = require('./computeTraceOptionsFromSchema'); - -var _connectTraceToPlot = require('./connectTraceToPlot'); - -var _connectTraceToPlot2 = _interopRequireDefault(_connectTraceToPlot); - -var _dereference = require('./dereference'); - -var _dereference2 = _interopRequireDefault(_dereference); - -var _getAllAxes = require('./getAllAxes'); - -var _getAllAxes2 = _interopRequireDefault(_getAllAxes); - -var _localize = require('./localize'); - -var _localize2 = _interopRequireDefault(_localize); - -var _tinycolor = require('tinycolor2'); - -var _tinycolor2 = _interopRequireDefault(_tinycolor); - -var _unpackPlotProps = require('./unpackPlotProps'); - -var _unpackPlotProps2 = _interopRequireDefault(_unpackPlotProps); - -var _walkObject = require('./walkObject'); - -var _walkObject2 = _interopRequireDefault(_walkObject); - -var _customTraceType = require('./customTraceType'); - -var _plotlyIcons = require('plotly-icons'); - -var PlotlyIcons = _interopRequireWildcard(_plotlyIcons); - -var _striptags = require('./striptags'); - -var _striptags2 = _interopRequireDefault(_striptags); - -var _strings = require('./strings'); - -var _reactColorscales = require('react-colorscales'); - -var _constants = require('./constants'); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var TOO_LIGHT_FACTOR = 0.8; - -function clamp(value, min, max) { - return Math.max(min, Math.min(max, value)); -} - -function getDisplayName(WrappedComponent) { - return WrappedComponent.displayName || WrappedComponent.name || 'Component'; -} - -function tooLight(color) { - var hslColor = (0, _tinycolor2.default)(color).toHsl(); - return hslColor.l > TOO_LIGHT_FACTOR; -} - -function renderTraceIcon(trace) { - var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Plot'; - - if (!trace) { - return null; - } - var gl = 'gl'; - var componentName = '' + prefix + (0, _strings.pascalCase)(trace.endsWith(gl) ? trace.slice(0, -gl.length) : trace) + 'Icon'; - - return PlotlyIcons[componentName] ? PlotlyIcons[componentName] : PlotlyIcons.PlotLineIcon; -} - -function transpose(originalArray) { - // if we want to transpose a uni dimensional array - if (originalArray.every(function (a) { - return !Array.isArray(a); - })) { - return originalArray.map(function (a) { - return [a]; - }); - } - - var longestArrayItem = Array.isArray(originalArray[0]) ? originalArray[0].length : 1; - - originalArray.forEach(function (a) { - // if it's not an array, it's a string - var length = Array.isArray(a) ? a.length : 1; - if (length > longestArrayItem) { - longestArrayItem = length; - } - }); - - var newArray = new Array(longestArrayItem); - - for (var outerIndex = 0; outerIndex < originalArray.length; outerIndex++) { - if (!Array.isArray(originalArray[outerIndex])) { - originalArray[outerIndex] = [originalArray[outerIndex]]; - } - - for (var innerIndex = 0; innerIndex < longestArrayItem; innerIndex++) { - // ensure we have an array to push to - if (!Array.isArray(newArray[innerIndex])) { - newArray[innerIndex] = []; - } - - var value = typeof originalArray[outerIndex][innerIndex] !== 'undefined' ? originalArray[outerIndex][innerIndex] : null; - newArray[innerIndex].push(value); - } - } - - return newArray; -} - -var specialTableCase = function specialTableCase(traceType, srcAttributePath) { - /* Just more user friendly - * Table traces have many configuration options, - * The below attributes can be 2d or 1d and will affect the plot differently - * EX: - * header.values = ['Jan', 'Feb', 'Mar'] => will put data in a row - * header.values = [['Jan', 1], ['Feb', 2], ['Mar', 3]] => will create 3 columns - * 1d arrays affect columns - * 2d arrays affect rows within each column - */ - return traceType === 'table' && ['header.valuessrc', 'header.font.colorsrc', 'header.font.sizesrc', 'header.fill.colorsrc', 'columnwidthsrc'].some(function (a) { - return srcAttributePath.endsWith(a); - }); -}; - -function maybeTransposeData(data, srcAttributePath, traceType) { - if (!data || Array.isArray(data) && data.length === 0) { - return null; - } - - var isTransposable2DArray = srcAttributePath.endsWith('zsrc') && ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(traceType); - - if (isTransposable2DArray) { - return transpose(data); - } - - if (specialTableCase(traceType, srcAttributePath) && Array.isArray(data[0]) && data.length === 1) { - return data[0]; - } - - return data; -} - -function maybeAdjustSrc(src, srcAttributePath, traceType, config) { - if (!src || Array.isArray(src) && src.length === 0) { - return null; - } - - if (specialTableCase(traceType, srcAttributePath) && src.length === 1) { - return src[0]; - } - - return config && config.fromSrc ? config.fromSrc(src, traceType) : src; -} - -function adjustColorscale(colorscale, numberOfNeededColors, colorscaleType, config) { - if (config && config.repeat) { - if (numberOfNeededColors < colorscale.length) { - return colorscale.slice(0, numberOfNeededColors); - } - - var repetitions = Math.ceil(numberOfNeededColors / colorscale.length); - var newArray = new Array(repetitions).fill(colorscale); - return newArray.reduce(function (a, b) { - return a.concat(b); - }, []).slice(0, numberOfNeededColors); - } - - return (0, _reactColorscales.getColorscale)(colorscale, numberOfNeededColors, null, null, colorscaleType); -} - -function getFullTrace(props, context) { - var fullTrace = {}; - if (context.fullData && context.data) { - if (props.fullDataArrayPosition) { - // fullDataArrayPosition will be supplied in panels that have the canGroup prop - fullTrace = context.fullData[props.fullDataArrayPosition[0]]; - } else { - // for all other panels, we'll find fullTrace with the data index - fullTrace = context.fullData.filter(function (t) { - return t && props.traceIndexes[0] === t.index; - })[0]; - } - - // For transformed traces, we actually want to read in _fullInput because - // there's original parent information that's more useful to the user there - // This is true except for fit transforms, where reading in fullData is - // what we want - if (fullTrace.transforms && !fullTrace.transforms.some(function (t) { - return ['moving-average', 'fits'].includes(t.type); - }) && !props.fullDataArrayPosition) { - fullTrace = fullTrace._fullInput; - } - } - return fullTrace; -} - -exports.adjustColorscale = adjustColorscale; -exports.axisIdToAxisName = _getAllAxes.axisIdToAxisName; -exports.bem = _bem2.default; -exports.capitalize = _strings.capitalize; -exports.lowerCase = _strings.lowerCase; -exports.upperCase = _strings.upperCase; -exports.removeNonWord = _strings.removeNonWord; -exports.camelCase = _strings.camelCase; -exports.pascalCase = _strings.pascalCase; -exports.clamp = clamp; -exports.connectCartesianSubplotToLayout = _connectCartesianSubplotToLayout2.default; -exports.connectNonCartesianSubplotToLayout = _connectNonCartesianSubplotToLayout2.default; -exports.connectAnnotationToLayout = _connectAnnotationToLayout2.default; -exports.connectShapeToLayout = _connectShapeToLayout2.default; -exports.connectSliderToLayout = _connectSliderToLayout2.default; -exports.connectUpdateMenuToLayout = _connectUpdateMenuToLayout2.default; -exports.connectImageToLayout = _connectImageToLayout2.default; -exports.connectAxesToLayout = _connectAxesToLayout2.default; -exports.connectLayoutToPlot = _connectLayoutToPlot2.default; -exports.connectToContainer = _connectToContainer2.default; -exports.connectRangeSelectorToAxis = _connectRangeSelectorToAxis2.default; -exports.connectTransformToTrace = _connectTransformToTrace2.default; -exports.connectAggregationToTransform = _connectAggregationToTransform2.default; -exports.connectTraceToPlot = _connectTraceToPlot2.default; -exports.containerConnectedContextTypes = _connectToContainer.containerConnectedContextTypes; -exports.computeTraceOptionsFromSchema = _computeTraceOptionsFromSchema.computeTraceOptionsFromSchema; -exports.traceTypeToPlotlyInitFigure = _customTraceType.traceTypeToPlotlyInitFigure; -exports.dereference = _dereference2.default; -exports.getAllAxes = _getAllAxes2.default; -exports.getAxisTitle = _getAllAxes.getAxisTitle; -exports.getSubplotTitle = _getAllAxes.getSubplotTitle; -exports.getDisplayName = getDisplayName; -exports.isPlainObject = _walkObject.isPlainObject; -exports.localize = _localize2.default; -exports.localizeString = _localize.localizeString; -exports.maybeAdjustSrc = maybeAdjustSrc; -exports.maybeTransposeData = maybeTransposeData; -exports.plotlyTraceToCustomTrace = _customTraceType.plotlyTraceToCustomTrace; -exports.renderTraceIcon = renderTraceIcon; -exports.unpackPlotProps = _unpackPlotProps2.default; -exports.walkObject = _walkObject2.default; -exports.tooLight = tooLight; -exports.striptags = _striptags2.default; -exports.traceTypeToAxisType = _getAllAxes.traceTypeToAxisType; -exports.transpose = transpose; -exports.getFullTrace = getFullTrace; -exports.EDITOR_ACTIONS = _constants.EDITOR_ACTIONS; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/lib/index.js.map b/lib/lib/index.js.map deleted file mode 100644 index 80092daf6..000000000 --- a/lib/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/index.js"],"names":["PlotlyIcons","TOO_LIGHT_FACTOR","clamp","value","min","max","Math","getDisplayName","WrappedComponent","displayName","name","tooLight","color","hslColor","toHsl","l","renderTraceIcon","trace","prefix","gl","componentName","endsWith","slice","length","PlotLineIcon","transpose","originalArray","every","Array","isArray","a","map","longestArrayItem","forEach","newArray","outerIndex","innerIndex","push","specialTableCase","traceType","srcAttributePath","some","maybeTransposeData","data","isTransposable2DArray","includes","maybeAdjustSrc","src","config","fromSrc","adjustColorscale","colorscale","numberOfNeededColors","colorscaleType","repeat","repetitions","ceil","fill","reduce","b","concat","getFullTrace","props","context","fullTrace","fullData","fullDataArrayPosition","filter","t","traceIndexes","index","transforms","type","_fullInput","axisIdToAxisName","bem","capitalize","lowerCase","upperCase","removeNonWord","camelCase","pascalCase","connectCartesianSubplotToLayout","connectNonCartesianSubplotToLayout","connectAnnotationToLayout","connectShapeToLayout","connectSliderToLayout","connectUpdateMenuToLayout","connectImageToLayout","connectAxesToLayout","connectLayoutToPlot","connectToContainer","connectRangeSelectorToAxis","connectTransformToTrace","connectAggregationToTransform","connectTraceToPlot","containerConnectedContextTypes","computeTraceOptionsFromSchema","traceTypeToPlotlyInitFigure","dereference","getAllAxes","getAxisTitle","getSubplotTitle","isPlainObject","localize","localizeString","plotlyTraceToCustomTrace","unpackPlotProps","walkObject","striptags","traceTypeToAxisType","EDITOR_ACTIONS"],"mappings":";;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AAMA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;IAAYA,W;;AACZ;;;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMC,mBAAmB,GAAzB;;AAEA,SAASC,KAAT,CAAeC,KAAf,EAAsBC,GAAtB,EAA2BC,GAA3B,EAAgC;AAC9B,SAAOC,KAAKD,GAAL,CAASD,GAAT,EAAcE,KAAKF,GAAL,CAASC,GAAT,EAAcF,KAAd,CAAd,CAAP;AACD;;AAED,SAASI,cAAT,CAAwBC,gBAAxB,EAA0C;AACxC,SAAOA,iBAAiBC,WAAjB,IAAgCD,iBAAiBE,IAAjD,IAAyD,WAAhE;AACD;;AAED,SAASC,QAAT,CAAkBC,KAAlB,EAAyB;AACvB,MAAMC,WAAW,yBAAUD,KAAV,EAAiBE,KAAjB,EAAjB;AACA,SAAOD,SAASE,CAAT,GAAad,gBAApB;AACD;;AAED,SAASe,eAAT,CAAyBC,KAAzB,EAAiD;AAAA,MAAjBC,MAAiB,uEAAR,MAAQ;;AAC/C,MAAI,CAACD,KAAL,EAAY;AACV,WAAO,IAAP;AACD;AACD,MAAME,KAAK,IAAX;AACA,MAAMC,qBAAmBF,MAAnB,GAA4B,yBAChCD,MAAMI,QAAN,CAAeF,EAAf,IAAqBF,MAAMK,KAAN,CAAY,CAAZ,EAAe,CAACH,GAAGI,MAAnB,CAArB,GAAkDN,KADlB,CAA5B,SAAN;;AAIA,SAAOjB,YAAYoB,aAAZ,IAA6BpB,YAAYoB,aAAZ,CAA7B,GAA0DpB,YAAYwB,YAA7E;AACD;;A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AAA,mB;QACAC,mB,GAAAA,+B;QACArF,S,GAAAA,S;QACAoC,Y,GAAAA,Y;QACAkD,c,GAAAA,yB","file":"index.js","sourcesContent":["import bem from './bem';\nimport connectCartesianSubplotToLayout from './connectCartesianSubplotToLayout';\nimport connectNonCartesianSubplotToLayout from './connectNonCartesianSubplotToLayout';\nimport connectAnnotationToLayout from './connectAnnotationToLayout';\nimport connectShapeToLayout from './connectShapeToLayout';\nimport connectSliderToLayout from './connectSliderToLayout';\nimport connectImageToLayout from './connectImageToLayout';\nimport connectUpdateMenuToLayout from './connectUpdateMenuToLayout';\nimport connectRangeSelectorToAxis from './connectRangeSelectorToAxis';\nimport connectTransformToTrace from './connectTransformToTrace';\nimport connectAggregationToTransform from './connectAggregationToTransform';\nimport connectAxesToLayout from './connectAxesToLayout';\nimport connectLayoutToPlot from './connectLayoutToPlot';\nimport connectToContainer, {containerConnectedContextTypes} from './connectToContainer';\nimport {computeTraceOptionsFromSchema} from './computeTraceOptionsFromSchema';\nimport connectTraceToPlot from './connectTraceToPlot';\nimport dereference from './dereference';\nimport getAllAxes, {\n axisIdToAxisName,\n traceTypeToAxisType,\n getAxisTitle,\n getSubplotTitle,\n} from './getAllAxes';\nimport localize, {localizeString} from './localize';\nimport tinyColor from 'tinycolor2';\nimport unpackPlotProps from './unpackPlotProps';\nimport walkObject, {isPlainObject} from './walkObject';\nimport {traceTypeToPlotlyInitFigure, plotlyTraceToCustomTrace} from './customTraceType';\nimport * as PlotlyIcons from 'plotly-icons';\nimport striptags from './striptags';\nimport {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase} from './strings';\nimport {getColorscale} from 'react-colorscales';\nimport {EDITOR_ACTIONS} from './constants';\n\nconst TOO_LIGHT_FACTOR = 0.8;\n\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nfunction tooLight(color) {\n const hslColor = tinyColor(color).toHsl();\n return hslColor.l > TOO_LIGHT_FACTOR;\n}\n\nfunction renderTraceIcon(trace, prefix = 'Plot') {\n if (!trace) {\n return null;\n }\n const gl = 'gl';\n const componentName = `${prefix}${pascalCase(\n trace.endsWith(gl) ? trace.slice(0, -gl.length) : trace\n )}Icon`;\n\n return PlotlyIcons[componentName] ? PlotlyIcons[componentName] : PlotlyIcons.PlotLineIcon;\n}\n\nfunction transpose(originalArray) {\n // if we want to transpose a uni dimensional array\n if (originalArray.every(a => !Array.isArray(a))) {\n return originalArray.map(a => [a]);\n }\n\n let longestArrayItem = Array.isArray(originalArray[0]) ? originalArray[0].length : 1;\n\n originalArray.forEach(a => {\n // if it's not an array, it's a string\n const length = Array.isArray(a) ? a.length : 1;\n if (length > longestArrayItem) {\n longestArrayItem = length;\n }\n });\n\n const newArray = new Array(longestArrayItem);\n\n for (let outerIndex = 0; outerIndex < originalArray.length; outerIndex++) {\n if (!Array.isArray(originalArray[outerIndex])) {\n originalArray[outerIndex] = [originalArray[outerIndex]];\n }\n\n for (let innerIndex = 0; innerIndex < longestArrayItem; innerIndex++) {\n // ensure we have an array to push to\n if (!Array.isArray(newArray[innerIndex])) {\n newArray[innerIndex] = [];\n }\n\n const value =\n typeof originalArray[outerIndex][innerIndex] !== 'undefined'\n ? originalArray[outerIndex][innerIndex]\n : null;\n newArray[innerIndex].push(value);\n }\n }\n\n return newArray;\n}\n\nconst specialTableCase = (traceType, srcAttributePath) => {\n /* Just more user friendly\n * Table traces have many configuration options,\n * The below attributes can be 2d or 1d and will affect the plot differently\n * EX:\n * header.values = ['Jan', 'Feb', 'Mar'] => will put data in a row\n * header.values = [['Jan', 1], ['Feb', 2], ['Mar', 3]] => will create 3 columns\n * 1d arrays affect columns\n * 2d arrays affect rows within each column\n */\n return (\n traceType === 'table' &&\n [\n 'header.valuessrc',\n 'header.font.colorsrc',\n 'header.font.sizesrc',\n 'header.fill.colorsrc',\n 'columnwidthsrc',\n ].some(a => srcAttributePath.endsWith(a))\n );\n};\n\nfunction maybeTransposeData(data, srcAttributePath, traceType) {\n if (!data || (Array.isArray(data) && data.length === 0)) {\n return null;\n }\n\n const isTransposable2DArray =\n srcAttributePath.endsWith('zsrc') &&\n ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(\n traceType\n );\n\n if (isTransposable2DArray) {\n return transpose(data);\n }\n\n if (\n specialTableCase(traceType, srcAttributePath) &&\n Array.isArray(data[0]) &&\n data.length === 1\n ) {\n return data[0];\n }\n\n return data;\n}\n\nfunction maybeAdjustSrc(src, srcAttributePath, traceType, config) {\n if (!src || (Array.isArray(src) && src.length === 0)) {\n return null;\n }\n\n if (specialTableCase(traceType, srcAttributePath) && src.length === 1) {\n return src[0];\n }\n\n return config && config.fromSrc ? config.fromSrc(src, traceType) : src;\n}\n\nfunction adjustColorscale(colorscale, numberOfNeededColors, colorscaleType, config) {\n if (config && config.repeat) {\n if (numberOfNeededColors < colorscale.length) {\n return colorscale.slice(0, numberOfNeededColors);\n }\n\n const repetitions = Math.ceil(numberOfNeededColors / colorscale.length);\n const newArray = new Array(repetitions).fill(colorscale);\n return newArray\n .reduce((a, b) => {\n return a.concat(b);\n }, [])\n .slice(0, numberOfNeededColors);\n }\n\n return getColorscale(colorscale, numberOfNeededColors, null, null, colorscaleType);\n}\n\nfunction getFullTrace(props, context) {\n let fullTrace = {};\n if (context.fullData && context.data) {\n if (props.fullDataArrayPosition) {\n // fullDataArrayPosition will be supplied in panels that have the canGroup prop\n fullTrace = context.fullData[props.fullDataArrayPosition[0]];\n } else {\n // for all other panels, we'll find fullTrace with the data index\n fullTrace = context.fullData.filter(t => t && props.traceIndexes[0] === t.index)[0];\n }\n\n // For transformed traces, we actually want to read in _fullInput because\n // there's original parent information that's more useful to the user there\n // This is true except for fit transforms, where reading in fullData is\n // what we want\n if (\n fullTrace.transforms &&\n !fullTrace.transforms.some(t => ['moving-average', 'fits'].includes(t.type)) &&\n !props.fullDataArrayPosition\n ) {\n fullTrace = fullTrace._fullInput;\n }\n }\n return fullTrace;\n}\n\nexport {\n adjustColorscale,\n axisIdToAxisName,\n bem,\n capitalize,\n lowerCase,\n upperCase,\n removeNonWord,\n camelCase,\n pascalCase,\n clamp,\n connectCartesianSubplotToLayout,\n connectNonCartesianSubplotToLayout,\n connectAnnotationToLayout,\n connectShapeToLayout,\n connectSliderToLayout,\n connectUpdateMenuToLayout,\n connectImageToLayout,\n connectAxesToLayout,\n connectLayoutToPlot,\n connectToContainer,\n connectRangeSelectorToAxis,\n connectTransformToTrace,\n connectAggregationToTransform,\n connectTraceToPlot,\n containerConnectedContextTypes,\n computeTraceOptionsFromSchema,\n traceTypeToPlotlyInitFigure,\n dereference,\n getAllAxes,\n getAxisTitle,\n getSubplotTitle,\n getDisplayName,\n isPlainObject,\n localize,\n localizeString,\n maybeAdjustSrc,\n maybeTransposeData,\n plotlyTraceToCustomTrace,\n renderTraceIcon,\n unpackPlotProps,\n walkObject,\n tooLight,\n striptags,\n traceTypeToAxisType,\n transpose,\n getFullTrace,\n EDITOR_ACTIONS,\n};\n"]} \ No newline at end of file diff --git a/lib/lib/localize.js b/lib/lib/localize.js deleted file mode 100644 index 6ff0820e0..000000000 --- a/lib/lib/localize.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -exports.default = localize; -exports.localizeString = localizeString; - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _ = require('./'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function localize(Comp) { - var LocalizedComponent = function (_Component) { - _inherits(LocalizedComponent, _Component); - - function LocalizedComponent(props, context) { - _classCallCheck(this, LocalizedComponent); - - var _this = _possibleConstructorReturn(this, (LocalizedComponent.__proto__ || Object.getPrototypeOf(LocalizedComponent)).call(this, props, context)); - - var dictionaries = context.dictionaries; - var locale = context.locale; - - _this.localize = function localize(str) { - return localizeString(dictionaries, locale, str); - }; - return _this; - } - - _createClass(LocalizedComponent, [{ - key: 'render', - value: function render() { - return _react2.default.createElement(Comp, _extends({ localize: this.localize }, this.props)); - } - }]); - - return LocalizedComponent; - }(_react.Component); - - LocalizedComponent.displayName = 'Localized' + (0, _.getDisplayName)(Comp); - LocalizedComponent.contextTypes = LocalizedComponent.contextTypes || {}; - LocalizedComponent.contextTypes.dictionaries = _propTypes2.default.object; - LocalizedComponent.contextTypes.locale = _propTypes2.default.string; - - LocalizedComponent.plotly_editor_traits = Comp.plotly_editor_traits; - - return LocalizedComponent; -} - -function localizeString(dictionaries, locale, key) { - var dict = dictionaries[locale]; - if (dict && dict.hasOwnProperty(key)) { - return dict[key]; - } - return key; -} -//# sourceMappingURL=localize.js.map \ No newline at end of file diff --git a/lib/lib/localize.js.map b/lib/lib/localize.js.map deleted file mode 100644 index d6c0e610d..000000000 --- a/lib/lib/localize.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/localize.js"],"names":["localize","localizeString","Comp","LocalizedComponent","props","context","dictionaries","locale","str","Component","displayName","contextTypes","PropTypes","object","string","plotly_editor_traits","key","dict","hasOwnProperty"],"mappings":";;;;;;;;;;kBAIwBA,Q;QA2BRC,c,GAAAA,c;;AA/BhB;;;;AACA;;;;AACA;;;;;;;;;;AAEe,SAASD,QAAT,CAAkBE,IAAlB,EAAwB;AAAA,MAC/BC,kBAD+B;AAAA;;AAEnC,gCAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,0IACpBD,KADoB,EACbC,OADa;;AAG1B,UAAMC,eAAeD,QAAQC,YAA7B;AACA,UAAMC,SAASF,QAAQE,MAAvB;;AAEA,YAAKP,QAAL,GAAgB,SAASA,QAAT,CAAkBQ,GAAlB,EAAuB;AACrC,eAAOP,eAAeK,YAAf,EAA6BC,MAA7B,EAAqCC,GAArC,CAAP;AACD,OAFD;AAN0B;AAS3B;;AAXkC;AAAA;AAAA,+BAa1B;AACP,eAAO,8BAAC,IAAD,aAAM,UAAU,KAAKR,QAArB,IAAmC,KAAKI,KAAxC,EAAP;AACD;AAfkC;;AAAA;AAAA,IACJK,gBADI;;AAiBrCN,qBAAmBO,WAAnB,iBAA6C,sBAAeR,IAAf,CAA7C;AACAC,qBAAmBQ,YAAnB,GAAkCR,mBAAmBQ,YAAnB,IAAmC,EAArE;AACAR,qBAAmBQ,YAAnB,CAAgCL,YAAhC,GAA+CM,oBAAUC,MAAzD;AACAV,qBAAmBQ,YAAnB,CAAgCJ,MAAhC,GAAyCK,oBAAUE,MAAnD;;AAEAX,qBAAmBY,oBAAnB,GAA0Cb,KAAKa,oBAA/C;;AAEA,SAAOZ,kBAAP;AACD;;AAEM,SAASF,cAAT,CAAwBK,YAAxB,EAAsCC,MAAtC,EAA8CS,GAA9C,EAAmD;AACxD,MAAMC,OAAOX,aAAaC,MAAb,CAAb;AACA,MAAIU,QAAQA,KAAKC,cAAL,CAAoBF,GAApB,CAAZ,EAAsC;AACpC,WAAOC,KAAKD,GAAL,CAAP;AACD;AACD,SAAOA,GAAP;AACD","file":"localize.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React, {Component} from 'react';\nimport {getDisplayName} from 'lib';\n\nexport default function localize(Comp) {\n class LocalizedComponent extends Component {\n constructor(props, context) {\n super(props, context);\n\n const dictionaries = context.dictionaries;\n const locale = context.locale;\n\n this.localize = function localize(str) {\n return localizeString(dictionaries, locale, str);\n };\n }\n\n render() {\n return ;\n }\n }\n LocalizedComponent.displayName = `Localized${getDisplayName(Comp)}`;\n LocalizedComponent.contextTypes = LocalizedComponent.contextTypes || {};\n LocalizedComponent.contextTypes.dictionaries = PropTypes.object;\n LocalizedComponent.contextTypes.locale = PropTypes.string;\n\n LocalizedComponent.plotly_editor_traits = Comp.plotly_editor_traits;\n\n return LocalizedComponent;\n}\n\nexport function localizeString(dictionaries, locale, key) {\n const dict = dictionaries[locale];\n if (dict && dict.hasOwnProperty(key)) {\n return dict[key];\n }\n return key;\n}\n"]} \ No newline at end of file diff --git a/lib/lib/multiValues.js b/lib/lib/multiValues.js deleted file mode 100644 index 56b2a5864..000000000 --- a/lib/lib/multiValues.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setMultiValuedContainer = exports.deepCopyPublic = undefined; - -var _constants = require('./constants'); - -var _lib = require('../lib'); - -/** - * Deep-copies the value using JSON. Underscored (private) keys are removed. - * @param {*} value Some nested value from the plotDiv object. - * @returns {*} A deepcopy of the value. - */ -function deepCopyPublic(value) { - if (typeof value === 'undefined') { - return value; - } - - var skipPrivateKeys = function skipPrivateKeys(key, value) { - return key.startsWith('_') ? 0 : value; - }; - - return window.JSON.parse(window.JSON.stringify(value, skipPrivateKeys)); -} - -/* - * WARNING: When using this function, make intoObj and fromObject are copies of - * your objects, so that no mutations occur - */ -function setMultiValuedContainer(intoObj, fromObj, key) { - var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - var intoVal = intoObj[key]; - var fromVal = fromObj[key]; - - // don't merge private attrs - if (typeof key === 'string' && key.charAt(0) === '_' && key !== '_group' || typeof intoVal === 'function' || key === 'module') { - return; - } - - // already a mixture of values, can't get any worse - if (intoVal === _constants.MULTI_VALUED) { - return; - } else if (intoVal === void 0) { - // if the original doesn't have the key it's because that key - // doesn't do anything there - so use the new value - // note that if fromObj doesn't have a key in intoObj we will not - // attempt to merge them at all, so this behavior makes the merge - // independent of order. - - // WARNING: Careful that data copies were passed in as args here, as mutation can occur - intoObj[key] = fromVal; - } else if (key === 'colorscale') { - // colorscales are arrays... need to stringify before comparing - // (other vals we don't want to stringify, as differences could - // potentially be real, like 'false' and false) - if (String(intoVal) !== String(fromVal)) { - intoObj[key] = _constants.MULTI_VALUED; - } - } else if (Array.isArray(intoVal)) { - // in data, other arrays are data, which we don't care about - // for styling purposes - if (!config.searchArrays) { - return; - } - if (!Array.isArray(fromVal)) { - intoObj[key] = _constants.MULTI_VALUED; - } else { - // in layout though, we need to recurse into arrays - for (var i = 0; i < fromVal.length; i++) { - setMultiValuedContainer(intoVal, fromVal, i, config); - } - } - } else if ((0, _lib.isPlainObject)(fromVal)) { - // recurse into objects - if (!(0, _lib.isPlainObject)(intoVal)) { - throw new Error('tried to merge object into non-object: ' + key); - } - Object.keys(fromVal).forEach(function (key2) { - setMultiValuedContainer(intoVal, fromVal, key2, config); - }); - } else if ((0, _lib.isPlainObject)(intoVal)) { - throw new Error('tried to merge non-object into object: ' + key); - } else if (intoVal !== fromVal) { - // different non-empty values - - intoObj[key] = _constants.MULTI_VALUED; - } -} - -exports.deepCopyPublic = deepCopyPublic; -exports.setMultiValuedContainer = setMultiValuedContainer; -//# sourceMappingURL=multiValues.js.map \ No newline at end of file diff --git a/lib/lib/multiValues.js.map b/lib/lib/multiValues.js.map deleted file mode 100644 index 1c453e7d1..000000000 --- a/lib/lib/multiValues.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/multiValues.js"],"names":["deepCopyPublic","value","skipPrivateKeys","key","startsWith","window","JSON","parse","stringify","setMultiValuedContainer","intoObj","fromObj","config","intoVal","fromVal","charAt","MULTI_VALUED","String","Array","isArray","searchArrays","i","length","Error","Object","keys","forEach","key2"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;AAKA,SAASA,cAAT,CAAwBC,KAAxB,EAA+B;AAC7B,MAAI,OAAOA,KAAP,KAAiB,WAArB,EAAkC;AAChC,WAAOA,KAAP;AACD;;AAED,MAAMC,kBAAkB,SAAlBA,eAAkB,CAACC,GAAD,EAAMF,KAAN;AAAA,WAAiBE,IAAIC,UAAJ,CAAe,GAAf,IAAsB,CAAtB,GAA0BH,KAA3C;AAAA,GAAxB;;AAEA,SAAOI,OAAOC,IAAP,CAAYC,KAAZ,CAAkBF,OAAOC,IAAP,CAAYE,SAAZ,CAAsBP,KAAtB,EAA6BC,eAA7B,CAAlB,CAAP;AACD;;AAED;;;;AAIA,SAASO,uBAAT,CAAiCC,OAAjC,EAA0CC,OAA1C,EAAmDR,GAAnD,EAAqE;AAAA,MAAbS,MAAa,uEAAJ,EAAI;;AACnE,MAAMC,UAAUH,QAAQP,GAAR,CAAhB;AACA,MAAMW,UAAUH,QAAQR,GAAR,CAAhB;;AAEA;AACA,MACG,OAAOA,GAAP,KAAe,QAAf,IAA2BA,IAAIY,MAAJ,CAAW,CAAX,MAAkB,GAA7C,IAAoDZ,QAAQ,QAA7D,IACA,OAAOU,OAAP,KAAmB,UADnB,IAEAV,QAAQ,QAHV,EAIE;AACA;AACD;;AAED;AACA,MAAIU,YAAYG,uBAAhB,EAA8B;AAC5B;AACD,GAFD,MAEO,IAAIH,YAAY,KAAK,CAAr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cesContent":["import {MULTI_VALUED} from './constants';\nimport {isPlainObject} from '../lib';\n\n/**\n * Deep-copies the value using JSON. Underscored (private) keys are removed.\n * @param {*} value Some nested value from the plotDiv object.\n * @returns {*} A deepcopy of the value.\n */\nfunction deepCopyPublic(value) {\n if (typeof value === 'undefined') {\n return value;\n }\n\n const skipPrivateKeys = (key, value) => (key.startsWith('_') ? 0 : value);\n\n return window.JSON.parse(window.JSON.stringify(value, skipPrivateKeys));\n}\n\n/*\n * WARNING: When using this function, make intoObj and fromObject are copies of\n * your objects, so that no mutations occur\n */\nfunction setMultiValuedContainer(intoObj, fromObj, key, config = {}) {\n const intoVal = intoObj[key];\n const fromVal = fromObj[key];\n\n // don't merge private attrs\n if (\n (typeof key === 'string' && key.charAt(0) === '_' && key !== '_group') ||\n typeof intoVal === 'function' ||\n key === 'module'\n ) {\n return;\n }\n\n // already a mixture of values, can't get any worse\n if (intoVal === MULTI_VALUED) {\n return;\n } else if (intoVal === void 0) {\n // if the original doesn't have the key it's because that key\n // doesn't do anything there - so use the new value\n // note that if fromObj doesn't have a key in intoObj we will not\n // attempt to merge them at all, so this behavior makes the merge\n // independent of order.\n\n // WARNING: Careful that data copies were passed in as args here, as mutation can occur\n intoObj[key] = fromVal;\n } else if (key === 'colorscale') {\n // colorscales are arrays... need to stringify before comparing\n // (other vals we don't want to stringify, as differences could\n // potentially be real, like 'false' and false)\n if (String(intoVal) !== String(fromVal)) {\n intoObj[key] = MULTI_VALUED;\n }\n } else if (Array.isArray(intoVal)) {\n // in data, other arrays are data, which we don't care about\n // for styling purposes\n if (!config.searchArrays) {\n return;\n }\n if (!Array.isArray(fromVal)) {\n intoObj[key] = MULTI_VALUED;\n } else {\n // in layout though, we need to recurse into arrays\n for (let i = 0; i < fromVal.length; i++) {\n setMultiValuedContainer(intoVal, fromVal, i, config);\n }\n }\n } else if (isPlainObject(fromVal)) {\n // recurse into objects\n if (!isPlainObject(intoVal)) {\n throw new Error('tried to merge object into non-object: ' + key);\n }\n Object.keys(fromVal).forEach(function(key2) {\n setMultiValuedContainer(intoVal, fromVal, key2, config);\n });\n } else if (isPlainObject(intoVal)) {\n throw new Error('tried to merge non-object into object: ' + key);\n } else if (intoVal !== fromVal) {\n // different non-empty values -\n intoObj[key] = MULTI_VALUED;\n }\n}\n\nexport {deepCopyPublic, setMultiValuedContainer};\n"]} \ No newline at end of file diff --git a/lib/lib/sortMenu.js b/lib/lib/sortMenu.js deleted file mode 100644 index bc5e7b497..000000000 --- a/lib/lib/sortMenu.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = sortMenu; -function getUniqueValues(value, index, self) { - return self.indexOf(value) === index; -} - -function sortAlphabetically(a, b) { - var sortByGroup = a.props.group === b.props.group ? 0 : a.props.group < b.props.group ? -1 : 1; - var sortByName = a.props.name === b.props.name ? 0 : a.props.name < b.props.name ? -1 : 1; - return sortByGroup || sortByName; -} - -function sortMenu(panels, order) { - // validates order, if a desired panel matches no panel in the panels array, - // it is excluded from ordering considerations - - // eslint-disable-next-line - order = order.filter(function (desiredPanel) { - return panels.some(function (actualPanel) { - return actualPanel.props.name === desiredPanel.name && actualPanel.props.group === desiredPanel.group; - }); - }); - - var desiredGroupOrder = order.map(function (panel) { - return panel.group; - }).filter(getUniqueValues); - var desiredNameOrder = order.map(function (panel) { - return panel.name; - }).filter(getUniqueValues); - - panels.sort(function (a, b) { - var panelAHasGroupCustomOrder = desiredGroupOrder.includes(a.props.group); - var panelBHasGroupCustomOrder = desiredGroupOrder.includes(b.props.group); - - // if one of the elements is not in the desiredGroupOrder array, then it goes to the end of the list - if (panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) { - return -1; - } - if (!panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) { - return 1; - } - - // if both elements are not in the desiredGroupOrder array, they get sorted alphabetically, - // by group, then by name - if (!panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) { - return sortAlphabetically(a, b); - } - - // if both elements are in the desiredGroupOrder array, they get sorted according to their order in - // the desiredGroupOrder, then desiredNameOrder arrays. - if (panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) { - var indexOfGroupA = desiredGroupOrder.indexOf(a.props.group); - var indexOfGroupB = desiredGroupOrder.indexOf(b.props.group); - - if (indexOfGroupA < indexOfGroupB) { - return -1; - } - - if (indexOfGroupA > indexOfGroupB) { - return 1; - } - - if (indexOfGroupA === indexOfGroupB) { - var panelAHasNameCustomOrder = desiredNameOrder.includes(a.props.name); - var panelBHasNameCustomOrder = desiredNameOrder.includes(b.props.name); - - if (!panelAHasNameCustomOrder || !panelBHasNameCustomOrder) { - if (panelAHasNameCustomOrder && !panelBHasNameCustomOrder) { - return -1; - } - if (!panelAHasNameCustomOrder && panelBHasNameCustomOrder) { - return 1; - } - if (!panelAHasNameCustomOrder && !panelBHasNameCustomOrder) { - return sortAlphabetically(a, b); - } - } - - if (panelAHasNameCustomOrder && panelBHasNameCustomOrder) { - return desiredNameOrder.indexOf(a.props.name) - desiredNameOrder.indexOf(b.props.name); - } - } - } - return 0; - }); -} -//# sourceMappingURL=sortMenu.js.map \ No newline at end of file diff --git a/lib/lib/sortMenu.js.map b/lib/lib/sortMenu.js.map deleted file mode 100644 index f220fe031..000000000 --- a/lib/lib/sortMenu.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/sortMenu.js"],"names":["sortMenu","getUniqueValues","value","index","self","indexOf","sortAlphabetically","a","b","sortByGroup","props","group","sortByName","name","panels","order","filter","some","actualPanel","desiredPanel","desiredGroupOrder","map","panel","desiredNameOrder","sort","panelAHasGroupCustomOrder","includes","panelBHasGroupCustomOrder","indexOfGroupA","indexOfGroupB","panelAHasNameCustomOrder","panelBHasNameCustomOrder"],"mappings":";;;;;kBAUwBA,Q;AAVxB,SAASC,eAAT,CAAyBC,KAAzB,EAAgCC,KAAhC,EAAuCC,IAAvC,EAA6C;AAC3C,SAAOA,KAAKC,OAAL,CAAaH,KA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AA0D;AACxD,iBAAOR,iBAAiBlB,OAAjB,CAAyBE,EAAEG,KAAF,CAAQG,IAAjC,IAAyCU,iBAAiBlB,OAAjB,CAAyBG,EAAEE,KAAF,CAAQG,IAAjC,CAAhD;AACD;AACF;AACF;AACD,WAAO,CAAP;AACD,GAtDD;AAuDD","file":"sortMenu.js","sourcesContent":["function getUniqueValues(value, index, self) {\n return self.indexOf(value) === index;\n}\n\nfunction sortAlphabetically(a, b) {\n const sortByGroup = a.props.group === b.props.group ? 0 : a.props.group < b.props.group ? -1 : 1;\n const sortByName = a.props.name === b.props.name ? 0 : a.props.name < b.props.name ? -1 : 1;\n return sortByGroup || sortByName;\n}\n\nexport default function sortMenu(panels, order) {\n // validates order, if a desired panel matches no panel in the panels array,\n // it is excluded from ordering considerations\n\n // eslint-disable-next-line\n order = order.filter(desiredPanel =>\n panels.some(\n actualPanel =>\n actualPanel.props.name === desiredPanel.name &&\n actualPanel.props.group === desiredPanel.group\n )\n );\n\n const desiredGroupOrder = order.map(panel => panel.group).filter(getUniqueValues);\n const desiredNameOrder = order.map(panel => panel.name).filter(getUniqueValues);\n\n panels.sort((a, b) => {\n const panelAHasGroupCustomOrder = desiredGroupOrder.includes(a.props.group);\n const panelBHasGroupCustomOrder = desiredGroupOrder.includes(b.props.group);\n\n // if one of the elements is not in the desiredGroupOrder array, then it goes to the end of the list\n if (panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) {\n return -1;\n }\n if (!panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) {\n return 1;\n }\n\n // if both elements are not in the desiredGroupOrder array, they get sorted alphabetically,\n // by group, then by name\n if (!panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) {\n return sortAlphabetically(a, b);\n }\n\n // if both elements are in the desiredGroupOrder array, they get sorted according to their order in\n // the desiredGroupOrder, then desiredNameOrder arrays.\n if (panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) {\n const indexOfGroupA = desiredGroupOrder.indexOf(a.props.group);\n const indexOfGroupB = desiredGroupOrder.indexOf(b.props.group);\n\n if (indexOfGroupA < indexOfGroupB) {\n return -1;\n }\n\n if (indexOfGroupA > indexOfGroupB) {\n return 1;\n }\n\n if (indexOfGroupA === indexOfGroupB) {\n const panelAHasNameCustomOrder = desiredNameOrder.includes(a.props.name);\n const panelBHasNameCustomOrder = desiredNameOrder.includes(b.props.name);\n\n if (!panelAHasNameCustomOrder || !panelBHasNameCustomOrder) {\n if (panelAHasNameCustomOrder && !panelBHasNameCustomOrder) {\n return -1;\n }\n if (!panelAHasNameCustomOrder && panelBHasNameCustomOrder) {\n return 1;\n }\n if (!panelAHasNameCustomOrder && !panelBHasNameCustomOrder) {\n return sortAlphabetically(a, b);\n }\n }\n\n if (panelAHasNameCustomOrder && panelBHasNameCustomOrder) {\n return desiredNameOrder.indexOf(a.props.name) - desiredNameOrder.indexOf(b.props.name);\n }\n }\n }\n return 0;\n });\n}\n"]} \ No newline at end of file diff --git a/lib/lib/strings.js b/lib/lib/strings.js deleted file mode 100644 index c036a1f6b..000000000 --- a/lib/lib/strings.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -/*eslint-disable */ - -/** - * Capitalize string - */ -function capitalize(s) { - return !s ? '' : s.charAt(0).toUpperCase() + s.substring(1); -} - -/** - * "Safer" String.toLowerCase() - */ -function lowerCase(str) { - return str.toLowerCase(); -} - -/** - * "Safer" String.toUpperCase() - */ -function upperCase(str) { - return str.toUpperCase(); -} - -/** - * Remove non-word chars. - */ -function removeNonWord(str) { - return str.replace(/[^0-9a-zA-Z\xC0-\xFF \-]/g, ''); -} - -/** - * Convert string to camelCase text. - */ -function camelCase(string) { - return string.replace(/\-/g, ' ').replace(/(\d)(?=(\d{1})+$)/g, '$1 ').replace(/\s[a-z]/g, upperCase).replace(/\s+/g, '').replace(/^[A-Z]/g, lowerCase); -} - -function pascalCase(str) { - return camelCase(str).replace(/^[a-z]/, upperCase); -} - -exports.capitalize = capitalize; -exports.lowerCase = lowerCase; -exports.upperCase = upperCase; -exports.removeNonWord = removeNonWord; -exports.camelCase = camelCase; -exports.pascalCase = pascalCase; - -/* eslint-enable */ -//# sourceMappingURL=strings.js.map \ No newline at end of file diff --git a/lib/lib/strings.js.map b/lib/lib/strings.js.map deleted file mode 100644 index 2e009b2d8..000000000 --- a/lib/lib/strings.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/strings.js"],"names":["capitalize","s","charAt","toUpperCase","substring","lowerCase","str","toLowerCase","upperCase","removeNonWord","replace","camelCase","string","pascalCase"],"mappings":";;;;;AAAA;;AAEA;;;AAGA,SAASA,UAAT,CAAoBC,CAApB,EAAuB;AACrB,SAAO,CAACA,CAAD,GAAK,EAAL,GAAUA,EAAEC,MAAF,CAAS,CAAT,EAAYC,WAAZ,KAA4BF,EAAEG,SAAF,CAAY,CAAZ,CAA7C;AACD;;AAED;;;AAGA,SAASC,SAAT,CAAmBC,GAAnB,EAAwB;AACtB,SAAOA,IAAIC,WAAJ,EAAP;AACD;;AAED;;;AAGA,SAASC,SAAT,CAAmBF,GAAnB,EAAwB;AACtB,SAAOA,IAAIH,WAAJ,EAAP;AACD;;AAED;;;AAGA,SAASM,aAAT,CAAuBH,GAAvB,EAA4B;AAC1B,SAAOA,IAAII,OAAJ,CAAY,2BAAZ,EAAyC,EAAzC,CAAP;AACD;;AAED;;;AAGA,SAASC,SAAT,CAAmBC,MAAnB,EAA2B;AACzB,SAAOA,OACJF,OADI,CACI,KADJ,EACW,GADX,EAEJA,OAFI,CAEI,oBAFJ,EAE0B,KAF1B,EAGJA,OAHI,CAGI,UAHJ,EAGgBF,SAHhB,EAIJE,OAJI,CAII,MAJJ,EAIY,EAJZ,EAKJA,OALI,CAKI,SALJ,EAKeL,SALf,CAAP;AAMD;;AAED,SAASQ,UAAT,CAAoBP,GAApB,EAAyB;AACvB,SAAOK,UAAUL,GAAV,EAAeI,OAAf,CAAuB,QAAvB,EAAiCF,SAAjC,CAAP;AACD;;QAEOR,U,GAAAA,U;QAAYK,S,GAAAA,S;QAAWG,S,GAAAA,S;QAAWC,a,GAAAA,a;QAAeE,S,GAAAA,S;QAAWE,U,GAAAA,U;;AAEpE","file":"strings.js","sourcesContent":["/*eslint-disable */\n\n/**\n * Capitalize string\n */\nfunction capitalize(s) {\n return !s ? '' : s.charAt(0).toUpperCase() + s.substring(1);\n}\n\n/**\n * \"Safer\" String.toLowerCase()\n */\nfunction lowerCase(str) {\n return str.toLowerCase();\n}\n\n/**\n * \"Safer\" String.toUpperCase()\n */\nfunction upperCase(str) {\n return str.toUpperCase();\n}\n\n/**\n * Remove non-word chars.\n */\nfunction removeNonWord(str) {\n return str.replace(/[^0-9a-zA-Z\\xC0-\\xFF \\-]/g, '');\n}\n\n/**\n * Convert string to camelCase text.\n */\nfunction camelCase(string) {\n return string\n .replace(/\\-/g, ' ')\n .replace(/(\\d)(?=(\\d{1})+$)/g, '$1 ')\n .replace(/\\s[a-z]/g, upperCase)\n .replace(/\\s+/g, '')\n .replace(/^[A-Z]/g, lowerCase);\n}\n\nfunction pascalCase(str) {\n return camelCase(str).replace(/^[a-z]/, upperCase);\n}\n\nexport {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase};\n\n/* eslint-enable */\n"]} \ No newline at end of file diff --git a/lib/lib/striptags.js b/lib/lib/striptags.js deleted file mode 100644 index 6856df9be..000000000 --- a/lib/lib/striptags.js +++ /dev/null @@ -1,249 +0,0 @@ -/* eslint-disable */ - -// The MIT License (MIT) -// -// Copyright (c) [2017] [Eric Norris] -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -'use strict'; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -(function (global) { - // minimal symbol polyfill for IE11 and others - if (typeof _Symbol !== 'function') { - var _Symbol = function _Symbol(name) { - return name; - }; - - _Symbol.nonNative = true; - } - - var STATE_PLAINTEXT = _Symbol('plaintext'); - var STATE_HTML = _Symbol('html'); - var STATE_COMMENT = _Symbol('comment'); - - var ALLOWED_TAGS_REGEX = /<(\w*)>/g; - var NORMALIZE_TAG_REGEX = /<\/?([^\s\/>]+)/; - - function striptags(html, allowable_tags, tag_replacement) { - html = html || ''; - allowable_tags = allowable_tags || []; - tag_replacement = tag_replacement || ''; - - var context = init_context(allowable_tags, tag_replacement); - - return striptags_internal(html, context); - } - - function init_striptags_stream(allowable_tags, tag_replacement) { - allowable_tags = allowable_tags || []; - tag_replacement = tag_replacement || ''; - - var context = init_context(allowable_tags, tag_replacement); - - return function striptags_stream(html) { - return striptags_internal(html || '', context); - }; - } - - striptags.init_streaming_mode = init_striptags_stream; - - function init_context(allowable_tags, tag_replacement) { - allowable_tags = parse_allowable_tags(allowable_tags); - - return { - allowable_tags: allowable_tags, - tag_replacement: tag_replacement, - - state: STATE_PLAINTEXT, - tag_buffer: '', - depth: 0, - in_quote_char: '' - }; - } - - function striptags_internal(html, context) { - var allowable_tags = context.allowable_tags; - var tag_replacement = context.tag_replacement; - - var state = context.state; - var tag_buffer = context.tag_buffer; - var depth = context.depth; - var in_quote_char = context.in_quote_char; - var output = ''; - - for (var idx = 0, length = html.length; idx < length; idx++) { - var char = html[idx]; - - if (state === STATE_PLAINTEXT) { - switch (char) { - case '<': - state = STATE_HTML; - tag_buffer += char; - break; - - default: - output += char; - break; - } - } else if (state === STATE_HTML) { - switch (char) { - case '<': - // ignore '<' if inside a quote - if (in_quote_char) { - break; - } - - // we're seeing a nested '<' - depth++; - break; - - case '>': - // ignore '>' if inside a quote - if (in_quote_char) { - break; - } - - // something like this is happening: '<<>>' - if (depth) { - depth--; - - break; - } - - // this is closing the tag in tag_buffer - in_quote_char = ''; - state = STATE_PLAINTEXT; - tag_buffer += '>'; - - if (allowable_tags.has(normalize_tag(tag_buffer))) { - output += tag_buffer; - } else { - output += tag_replacement; - } - - tag_buffer = ''; - break; - - case '"': - case "'": - // catch both single and double quotes - - if (char === in_quote_char) { - in_quote_char = ''; - } else { - in_quote_char = in_quote_char || char; - } - - tag_buffer += char; - break; - - case '-': - if (tag_buffer === '': - if (tag_buffer.slice(-2) == '--') { - // close the comment - state = STATE_PLAINTEXT; - } - - tag_buffer = ''; - break; - - default: - tag_buffer += char; - break; - } - } - } - - // save the context for future iterations - context.state = state; - context.tag_buffer = tag_buffer; - context.depth = depth; - context.in_quote_char = in_quote_char; - - return output; - } - - function parse_allowable_tags(allowable_tags) { - var tag_set = new Set(); - - if (typeof allowable_tags === 'string') { - var match = void 0; - - while (match = ALLOWED_TAGS_REGEX.exec(allowable_tags)) { - tag_set.add(match[1]); - } - } else if (!_Symbol.nonNative && typeof allowable_tags[_Symbol.iterator] === 'function') { - tag_set = new Set(allowable_tags); - } else if (typeof allowable_tags.forEach === 'function') { - // IE11 compatible - allowable_tags.forEach(tag_set.add, tag_set); - } - - return tag_set; - } - - function normalize_tag(tag_buffer) { - var match = NORMALIZE_TAG_REGEX.exec(tag_buffer); - - return match ? match[1].toLowerCase() : null; - } - - if (typeof define === 'function' && define.amd) { - // AMD - define(function module_factory() { - return striptags; - }); - } else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) { - // Node - module.exports = striptags; - } else { - // Browser - global.striptags = striptags; - } -})(undefined); -//# sourceMappingURL=striptags.js.map \ No newline at end of file diff --git a/lib/lib/striptags.js.map b/lib/lib/striptags.js.map deleted file mode 100644 index 480528e23..000000000 --- a/lib/lib/striptags.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/striptags.js"],"names":["global","Symbol","name","nonNative","STATE_PLAINTEXT","STATE_HTML","STATE_COMMENT","ALLOWED_TAGS_REGEX","NORMALIZE_TAG_REGEX","striptags","html","allowable_tags","tag_replacement","context","init_context","striptags_internal","init_striptags_stream","striptags_stream","init_streaming_mode","parse_allowable_tags","state","tag_buffer","depth","in_quote_char","output","idx","length","char","has","normalize_tag","slice","tag_set","Set","match","exec","add","iterator","forEach","toLowerCase","define","amd","module_factory","module","exports"],"mappings":"AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;AAEA,CAAC,UAASA,MAAT,EAAiB;AAChB;AACA,MAAI,OAAOC,OAAP,KAAkB,UAAtB,EAAkC;AAChC,QAAIA,UAAS,SAATA,OAAS,CAASC,IAAT,EAAe;AAC1B,aAAOA,IAAP;AACD,KAFD;;AAIAD,YAAOE,SAAP,GAAmB,IAAnB;AACD;;AAED,MAAMC,kBAAkBH,QAAO,WAAP,CAAxB;AACA,MAAMI,aAAaJ,QAAO,MAAP,CAAnB;AACA,MAAMK,gBAAgBL,QAAO,SAAP,CAAtB;;AAEA,MAAMM,qBAAqB,UAA3B;AACA,MAAMC,sBAAsB,iBAA5B;;AAEA,WAASC,SAAT,CAAmBC,IAAnB,EAAyBC,cAAzB,EAAyCC,eAA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9C;AACAD,WAAO,SAASE,cAAT,GAA0B;AAC/B,aAAOhC,SAAP;AACD,KAFD;AAGD,GALD,MAKO,IAAI,QAAOiC,MAAP,yCAAOA,MAAP,OAAkB,QAAlB,IAA8BA,OAAOC,OAAzC,EAAkD;AACvD;AACAD,WAAOC,OAAP,GAAiBlC,SAAjB;AACD,GAHM,MAGA;AACL;AACAT,WAAOS,SAAP,GAAmBA,SAAnB;AACD;AACF,CA3ND","file":"striptags.js","sourcesContent":["/* eslint-disable */\n\n// The MIT License (MIT)\n//\n// Copyright (c) [2017] [Eric Norris]\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n'use strict';\n\n(function(global) {\n // minimal symbol polyfill for IE11 and others\n if (typeof Symbol !== 'function') {\n var Symbol = function(name) {\n return name;\n };\n\n Symbol.nonNative = true;\n }\n\n const STATE_PLAINTEXT = Symbol('plaintext');\n const STATE_HTML = Symbol('html');\n const STATE_COMMENT = Symbol('comment');\n\n const ALLOWED_TAGS_REGEX = /<(\\w*)>/g;\n const NORMALIZE_TAG_REGEX = /<\\/?([^\\s\\/>]+)/;\n\n function striptags(html, allowable_tags, tag_replacement) {\n html = html || '';\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n\n const context = init_context(allowable_tags, tag_replacement);\n\n return striptags_internal(html, context);\n }\n\n function init_striptags_stream(allowable_tags, tag_replacement) {\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n\n const context = init_context(allowable_tags, tag_replacement);\n\n return function striptags_stream(html) {\n return striptags_internal(html || '', context);\n };\n }\n\n striptags.init_streaming_mode = init_striptags_stream;\n\n function init_context(allowable_tags, tag_replacement) {\n allowable_tags = parse_allowable_tags(allowable_tags);\n\n return {\n allowable_tags: allowable_tags,\n tag_replacement: tag_replacement,\n\n state: STATE_PLAINTEXT,\n tag_buffer: '',\n depth: 0,\n in_quote_char: '',\n };\n }\n\n function striptags_internal(html, context) {\n const allowable_tags = context.allowable_tags;\n const tag_replacement = context.tag_replacement;\n\n let state = context.state;\n let tag_buffer = context.tag_buffer;\n let depth = context.depth;\n let in_quote_char = context.in_quote_char;\n let output = '';\n\n for (let idx = 0, length = html.length; idx < length; idx++) {\n const char = html[idx];\n\n if (state === STATE_PLAINTEXT) {\n switch (char) {\n case '<':\n state = STATE_HTML;\n tag_buffer += char;\n break;\n\n default:\n output += char;\n break;\n }\n } else if (state === STATE_HTML) {\n switch (char) {\n case '<':\n // ignore '<' if inside a quote\n if (in_quote_char) {\n break;\n }\n\n // we're seeing a nested '<'\n depth++;\n break;\n\n case '>':\n // ignore '>' if inside a quote\n if (in_quote_char) {\n break;\n }\n\n // something like this is happening: '<<>>'\n if (depth) {\n depth--;\n\n break;\n }\n\n // this is closing the tag in tag_buffer\n in_quote_char = '';\n state = STATE_PLAINTEXT;\n tag_buffer += '>';\n\n if (allowable_tags.has(normalize_tag(tag_buffer))) {\n output += tag_buffer;\n } else {\n output += tag_replacement;\n }\n\n tag_buffer = '';\n break;\n\n case '\"':\n case \"'\":\n // catch both single and double quotes\n\n if (char === in_quote_char) {\n in_quote_char = '';\n } else {\n in_quote_char = in_quote_char || char;\n }\n\n tag_buffer += char;\n break;\n\n case '-':\n if (tag_buffer === '':\n if (tag_buffer.slice(-2) == '--') {\n // close the comment\n state = STATE_PLAINTEXT;\n }\n\n tag_buffer = '';\n break;\n\n default:\n tag_buffer += char;\n break;\n }\n }\n }\n\n // save the context for future iterations\n context.state = state;\n context.tag_buffer = tag_buffer;\n context.depth = depth;\n context.in_quote_char = in_quote_char;\n\n return output;\n }\n\n function parse_allowable_tags(allowable_tags) {\n let tag_set = new Set();\n\n if (typeof allowable_tags === 'string') {\n let match;\n\n while ((match = ALLOWED_TAGS_REGEX.exec(allowable_tags))) {\n tag_set.add(match[1]);\n }\n } else if (!Symbol.nonNative && typeof allowable_tags[Symbol.iterator] === 'function') {\n tag_set = new Set(allowable_tags);\n } else if (typeof allowable_tags.forEach === 'function') {\n // IE11 compatible\n allowable_tags.forEach(tag_set.add, tag_set);\n }\n\n return tag_set;\n }\n\n function normalize_tag(tag_buffer) {\n const match = NORMALIZE_TAG_REGEX.exec(tag_buffer);\n\n return match ? match[1].toLowerCase() : null;\n }\n\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(function module_factory() {\n return striptags;\n });\n } else if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = striptags;\n } else {\n // Browser\n global.striptags = striptags;\n }\n})(this);\n"]} \ No newline at end of file diff --git a/lib/lib/test-utils.js b/lib/lib/test-utils.js deleted file mode 100644 index 461c31ab3..000000000 --- a/lib/lib/test-utils.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setupGraphDiv = exports.shallow = exports.mount = exports.TestEditor = exports.plotly = exports.fixtures = undefined; - -var _plotlyCartesian = require('plotly.js/dist/plotly-cartesian'); - -var _plotlyCartesian2 = _interopRequireDefault(_plotlyCartesian); - -var _extend = require('plotly.js/src/lib/extend'); - -var _EditorControls = require('../EditorControls'); - -var _EditorControls2 = _interopRequireDefault(_EditorControls); - -var _enzyme = require('enzyme'); - -var _lib = require('../lib'); - -var _enzymeAdapterReact = require('enzyme-adapter-react-16'); - -var _enzymeAdapterReact2 = _interopRequireDefault(_enzymeAdapterReact); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -(0, _enzyme.configure)({ adapter: new _enzymeAdapterReact2.default() }); - -/* eslint-disable no-magic-numbers */ - -var fixtures = { - scatter: function scatter(config) { - return applyConfig(config, { - dataSources: { - x1: [1, 2, 3], - y1: [2, 3, 4], - y2: [20, 30, 40] - }, - dataSourceOptions: [{ label: 'xCol', value: 'x1' }, { label: 'yCol', value: 'y1' }, { label: 'yCol2', value: 'y2' }], - graphDiv: { - data: [{ - xsrc: 'x1', - ysrc: 'y1', - name: 'yaxis data', - type: 'scatter' - }, { - xsrc: 'x1', - ysrc: 'y2', - name: 'yaxis2 data', - yaxis: 'y2', - type: 'scatter' - }], - layout: { - title: 'Double Y Axis Example', - yaxis: {}, - yaxis2: { - title: 'yaxis2 title', - titlefont: { color: 'rgb(148, 103, 189)' }, - tickfont: { color: 'rgb(148, 103, 189)' }, - overlaying: 'y', - side: 'right' - } - } - } - }); - }, - area: function area(config) { - return applyConfig(config, { - dataSources: { - x1: [1, 2, 3], - y1: [2, 3, 4] - }, - dataSourceOptions: [{ label: 'xCol', value: 'x1' }, { label: 'yCol', value: 'y1' }], - graphDiv: { - data: [{ - type: 'scatter', - mode: 'markers+lines', - stackgroup: 1, - xsrc: 'x1', - ysrc: 'y1' - }], - layout: {} - } - }); - }, - pie: function pie(config) { - return applyConfig(config, { - dataSources: { - x1: [1, 2, 3], - y1: [2, 3, 4] - }, - dataSourceOptions: [{ label: 'xCol', value: 'x1' }, { label: 'yCol', value: 'y1' }], - graphDiv: { - data: [{ type: 'pie', mode: 'markers', labelssrc: 'x1', valuessrc: 'y1' }], - layout: {} - } - }); - } -}; - -function applyConfig() { - var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var _ref = arguments[1]; - var _ref$graphDiv = _ref.graphDiv, - data = _ref$graphDiv.data, - layout = _ref$graphDiv.layout, - dataSourceOptions = _ref.dataSourceOptions, - dataSources = _ref.dataSources; - - if (config.layout) { - (0, _extend.extendDeep)(layout, config.layout); - } - if (config.data) { - (0, _extend.extendDeep)(data, config.data); - } - if (config.deref !== false) { - (0, _lib.dereference)(data, dataSources); - } - - // replace simple graphDiv with properly mocked GD including fullData/fullLayout - var graphDiv = setupGraphDiv({ data: data, layout: layout }); - - return { dataSources: dataSources, dataSourceOptions: dataSourceOptions, graphDiv: graphDiv }; -} - -/* - * JSDOM does not implement full SVG spec. Mock out necessary methods here. - * https://github.com/tmpvar/jsdom/issues/1330 - * Hardcoded return values have been "good enough" for now but feel free to - * extend the API if necessary. - */ -function mockMissingSvgApis() { - var p = document.createElementNS('http://www.w3.org/2000/svg', 'path'); - var proto = Object.getPrototypeOf(p); - if (typeof proto.getTotalLength !== 'function') { - proto.getTotalLength = function () { - return 100; - }; - } - if (typeof proto.getPointAtLength !== 'function') { - proto.getPointAtLength = function () { - return { x: 0, y: 0 }; - }; - } -} - -function newGraphDiv() { - var graphDiv = window.document.createElement('div'); - graphDiv.id = 'graphDiv'; - - return graphDiv; -} - -function setupGraphDiv(figure) { - var gd = newGraphDiv(); - - mockMissingSvgApis(); - - _plotlyCartesian2.default.newPlot(gd, figure); - return gd; -} - -exports.fixtures = fixtures; -exports.plotly = _plotlyCartesian2.default; -exports.TestEditor = _EditorControls2.default; -exports.mount = _enzyme.mount; -exports.shallow = _enzyme.shallow; -exports.setupGraphDiv = setupGraphDiv; -//# sourceMappingURL=test-utils.js.map \ No newline at end of file diff --git a/lib/lib/test-utils.js.map b/lib/lib/test-utils.js.map deleted file mode 100644 index a86d563ec..000000000 --- a/lib/lib/test-utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/test-utils.js"],"names":["adapter","Adapter","fixtures","scatter","config","applyConfig","dataSources","x1","y1","y2","dataSourceOptions","label","value","graphDiv","data","xsrc","ysrc","name","type","yaxis","layout","title","yaxis2","titlefont","color","tickfont","overlaying","side","area","mode","stackgroup","pie","labelssrc","valuessrc","deref","setupGraphDiv","mockMissingSvgApis","p","document","createElementNS","proto","Object","getPrototypeOf","getTotalLength","getPointAtLength","x","y","newGraphDiv","window","createElement","id","figure","gd","plotly","newPlot","TestEditor","EditorControls","mount","shallow"],"mappings":";;;;;;;AAAA;;;;AACA;;AACA;;;;AACA;;AACA;;AACA;;;;;;AAEA,uBAAU,EAACA,SAAS,IAAIC,4BAAJ,EAAV,EAAV;;AAEA;;AAEA,IAAMC,WAAW;AACfC,SADe,mBACPC,MADO,EACC;AACd,WAAOC,YAAYD,MAAZ,EAAoB;AACzBE,mBAAa;AACXC,YAAI,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CADO;AAEXC,YAAI,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,CAFO;AAGXC,YAAI,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT;AAHO,OADY;AAMzBC,yBAAmB,CACjB,EAACC,OAAO,MAAR,EAAgBC,OAAO,IAAvB,EADiB,EAEjB,EAACD,OAAO,MAAR,EAAgBC,OAAO,IAAvB,EAFiB,EAGjB,EAACD,OAAO,OAAR,EAAiBC,OAAO,IAAxB,EAHiB,CANM;AAWzBC,gBAAU;AACRC,cAAM,CACJ;AACEC,gBAAM,IADR;AAEEC,gBAAM,IAFR;AAGEC,gBAAM,YAHR;AAIEC,gBAAM;AAJR,SADI,EAOJ;AACEH,gBAAM,IADR;AAEEC,gBAAM,IAFR;AAGEC,gBAAM,aAHR;AAIEE,iBAAO,IAJT;AAKED,gBAAM;AALR,SAPI,CADE;AAgBRE,gBAAQ;AACNC,iBAAO,uBADD;AAENF,iBAAO,EAFD;AAGNG,kBAAQ;AACND,mBAAO,cADD;AAENE,uBAAW,EAACC,OAAO,oBAAR,EAFL;AAGNC,sBAAU,EAAC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;;AAEAX;;AAEAiB,4BAAOC,OAAP,CAAeF,EAAf,EAAmBD,MAAnB;AACA,SAAOC,EAAP;AACD;;QAEOlD,Q,GAAAA,Q;QAAUmD,M,GAAAA,yB;QAA0BE,U,GAAlBC,wB;QAA8BC,K,GAAAA,a;QAAOC,O,GAAAA,e;QAASvB,a,GAAAA,a","file":"test-utils.js","sourcesContent":["import plotly from 'plotly.js/dist/plotly-cartesian';\nimport {extendDeep} from 'plotly.js/src/lib/extend';\nimport EditorControls from '../EditorControls';\nimport {configure, mount, shallow} from 'enzyme';\nimport {dereference} from '../lib';\nimport Adapter from 'enzyme-adapter-react-16';\n\nconfigure({adapter: new Adapter()});\n\n/* eslint-disable no-magic-numbers */\n\nconst fixtures = {\n scatter(config) {\n return applyConfig(config, {\n dataSources: {\n x1: [1, 2, 3],\n y1: [2, 3, 4],\n y2: [20, 30, 40],\n },\n dataSourceOptions: [\n {label: 'xCol', value: 'x1'},\n {label: 'yCol', value: 'y1'},\n {label: 'yCol2', value: 'y2'},\n ],\n graphDiv: {\n data: [\n {\n xsrc: 'x1',\n ysrc: 'y1',\n name: 'yaxis data',\n type: 'scatter',\n },\n {\n xsrc: 'x1',\n ysrc: 'y2',\n name: 'yaxis2 data',\n yaxis: 'y2',\n type: 'scatter',\n },\n ],\n layout: {\n title: 'Double Y Axis Example',\n yaxis: {},\n yaxis2: {\n title: 'yaxis2 title',\n titlefont: {color: 'rgb(148, 103, 189)'},\n tickfont: {color: 'rgb(148, 103, 189)'},\n overlaying: 'y',\n side: 'right',\n },\n },\n },\n });\n },\n\n area(config) {\n return applyConfig(config, {\n dataSources: {\n x1: [1, 2, 3],\n y1: [2, 3, 4],\n },\n dataSourceOptions: [{label: 'xCol', value: 'x1'}, {label: 'yCol', value: 'y1'}],\n graphDiv: {\n data: [\n {\n type: 'scatter',\n mode: 'markers+lines',\n stackgroup: 1,\n xsrc: 'x1',\n ysrc: 'y1',\n },\n ],\n layout: {},\n },\n });\n },\n\n pie(config) {\n return applyConfig(config, {\n dataSources: {\n x1: [1, 2, 3],\n y1: [2, 3, 4],\n },\n dataSourceOptions: [{label: 'xCol', value: 'x1'}, {label: 'yCol', value: 'y1'}],\n graphDiv: {\n data: [{type: 'pie', mode: 'markers', labelssrc: 'x1', valuessrc: 'y1'}],\n layout: {},\n },\n });\n },\n};\n\nfunction applyConfig(config = {}, {graphDiv: {data, layout}, dataSourceOptions, dataSources}) {\n if (config.layout) {\n extendDeep(layout, config.layout);\n }\n if (config.data) {\n extendDeep(data, config.data);\n }\n if (config.deref !== false) {\n dereference(data, dataSources);\n }\n\n // replace simple graphDiv with properly mocked GD including fullData/fullLayout\n const graphDiv = setupGraphDiv({data, layout});\n\n return {dataSources, dataSourceOptions, graphDiv};\n}\n\n/*\n * JSDOM does not implement full SVG spec. Mock out necessary methods here.\n * https://github.com/tmpvar/jsdom/issues/1330\n * Hardcoded return values have been \"good enough\" for now but feel free to\n * extend the API if necessary.\n */\nfunction mockMissingSvgApis() {\n const p = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n const proto = Object.getPrototypeOf(p);\n if (typeof proto.getTotalLength !== 'function') {\n proto.getTotalLength = () => 100;\n }\n if (typeof proto.getPointAtLength !== 'function') {\n proto.getPointAtLength = () => ({x: 0, y: 0});\n }\n}\n\nfunction newGraphDiv() {\n const graphDiv = window.document.createElement('div');\n graphDiv.id = 'graphDiv';\n\n return graphDiv;\n}\n\nfunction setupGraphDiv(figure) {\n const gd = newGraphDiv();\n\n mockMissingSvgApis();\n\n plotly.newPlot(gd, figure);\n return gd;\n}\n\nexport {fixtures, plotly, EditorControls as TestEditor, mount, shallow, setupGraphDiv};\n"]} \ No newline at end of file diff --git a/lib/lib/traceTypes.js b/lib/lib/traceTypes.js deleted file mode 100644 index fca21aebf..000000000 --- a/lib/lib/traceTypes.js +++ /dev/null @@ -1,192 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -/** - * Trace type constants - */ - -var chartCategory = exports.chartCategory = function chartCategory(_) { - return { - SIMPLE: { - value: 'SIMPLE', - label: _('Simple') - }, - CHARTS_3D: { - value: 'CHARTS_3D', - label: _('3D charts') - }, - FINANCIAL: { - value: 'FINANCIAL', - label: _('Finance') - }, - DISTRIBUTIONS: { - value: 'DISTRIBUTIONS', - label: _('Distributions') - }, - MAPS: { - value: 'MAPS', - label: _('Maps') - }, - SPECIALIZED: { - value: 'SPECIALIZED', - label: _('Specialized') - }, - THREE_D: { - value: '3D', - label: _('3D'), - maxColumns: 1 - } - }; -}; - -// Layout specification for TraceTypeSelector.js -var categoryLayout = exports.categoryLayout = function categoryLayout(_) { - return [chartCategory(_).SIMPLE, chartCategory(_).DISTRIBUTIONS, chartCategory(_).THREE_D, chartCategory(_).MAPS, chartCategory(_).FINANCIAL, chartCategory(_).SPECIALIZED]; -}; - -var traceTypes = exports.traceTypes = function traceTypes(_) { - return [{ - value: 'scatter', - label: _('Scatter'), - category: chartCategory(_).SIMPLE - }, { - value: 'bar', - label: _('Bar'), - category: chartCategory(_).SIMPLE - }, { - value: 'line', - label: _('Line'), - category: chartCategory(_).SIMPLE - }, { - value: 'area', - label: _('Area'), - category: chartCategory(_).SIMPLE - }, { - value: 'heatmap', - label: _('Heatmap'), - category: chartCategory(_).SIMPLE - }, { - value: 'table', - label: _('Table'), - category: chartCategory(_).SIMPLE - }, { - value: 'contour', - label: _('Contour'), - category: chartCategory(_).SIMPLE - }, { - value: 'pie', - label: _('Pie'), - category: chartCategory(_).SIMPLE - }, { - value: 'scatter3d', - label: _('3D Scatter'), - category: chartCategory(_).THREE_D - }, { - value: 'line3d', - label: _('3D Line'), - category: chartCategory(_).THREE_D - }, { - value: 'surface', - label: _('3D Surface'), - category: chartCategory(_).THREE_D - }, { - value: 'mesh3d', - label: _('3D Mesh'), - category: chartCategory(_).THREE_D - }, { - value: 'cone', - label: _('Cone'), - category: chartCategory(_).THREE_D - }, { - value: 'streamtube', - label: _('Streamtube'), - category: chartCategory(_).THREE_D - }, { - value: 'box', - label: _('Box'), - category: chartCategory(_).DISTRIBUTIONS - }, { - value: 'violin', - label: _('Violin'), - category: chartCategory(_).DISTRIBUTIONS - }, { - value: 'histogram', - label: _('Histogram'), - category: chartCategory(_).DISTRIBUTIONS - }, { - value: 'histogram2d', - label: _('2D Histogram'), - category: chartCategory(_).DISTRIBUTIONS - }, { - value: 'histogram2dcontour', - label: _('2D Contour Histogram'), - category: chartCategory(_).DISTRIBUTIONS - }, { - value: 'choropleth', - label: _('Choropleth'), - category: chartCategory(_).MAPS - }, { - value: 'scattermapbox', - label: _('Satellite Map'), - category: chartCategory(_).MAPS - }, { - value: 'scattergeo', - label: _('Atlas Map'), - category: chartCategory(_).MAPS - }, - // { - // value: 'parcoords', - // label: _('Parallel Coordinates'), - // category: chartCategory(_).SPECIALIZED, - // }, - // { - // value: 'sankey', - // label: _('Sankey'), - // category: chartCategory(_).SPECIALIZED, - // }, - // { - // value: 'carpet', - // label: _('Carpet'), - // category: chartCategory(_).SPECIALIZED, - // }, - { - value: 'scatterpolar', - label: _('Polar Scatter'), - category: chartCategory(_).SPECIALIZED - }, { - value: 'barpolar', - label: _('Polar Bar'), - category: chartCategory(_).SPECIALIZED - }, { - value: 'scatterternary', - label: _('Ternary Scatter'), - category: chartCategory(_).SPECIALIZED - }, { - value: 'candlestick', - label: _('Candlestick'), - category: chartCategory(_).FINANCIAL - }, { - value: 'ohlc', - label: _('OHLC'), - category: chartCategory(_).FINANCIAL - }, - // { - // value: 'pointcloud', - // label: _('Point Cloud'), - // category: chartCategory(_).THREE_D, - // }, - { - value: 'scattergl', - icon: 'scatter', - label: _('Scatter'), - category: chartCategory(_).THREE_D - }, { - value: 'scatterpolargl', - icon: 'scatterpolar', - label: _('Polar Scatter'), - category: chartCategory(_).THREE_D - }]; -}; -//# sourceMappingURL=traceTypes.js.map \ No newline at end of file diff --git a/lib/lib/traceTypes.js.map b/lib/lib/traceTypes.js.map deleted file mode 100644 index 238bd9ce0..000000000 --- a/lib/lib/traceTypes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/traceTypes.js"],"names":["chartCategory","SIMPLE","value","label","_","CHARTS_3D","FINANCIAL","DISTRIBUTIONS","MAPS","SPECIALIZED","THREE_D","maxColumns","categoryLayout","traceTypes","category","icon"],"mappings":";;;;;AAAA;;;;AAIO,IAAMA,wCAAgB,SAAhBA,aAAgB,IAAK;AAChC,SAAO;AACLC,YAAQ;AACNC,aAAO,QADD;AAENC,aAAOC,EAAE,QAAF;AAFD,KADH;AAKLC,eAAW;AACTH,aAAO,WADE;AAETC,aAAOC,EAAE,WAAF;AAFE,KALN;AASLE,eAAW;AACTJ,aAAO,WADE;AAETC,aAAOC,EAAE,SAAF;AAFE,KATN;AAaLG,mBAAe;AACbL,aAAO,eADM;AAEbC,aAAOC,EAAE,eAAF;AAFM,KAbV;AAiBLI,UAAM;AACJN,aAAO,MADH;AAEJC,aAAOC,EAAE,MAAF;AAFH,KAjBD;AAqBLK,iBAAa;AACXP,aAAO,aADI;AAEXC,aAAOC,EAAE,aAAF;AAFI,KArBR;AAyBLM,aAAS;AACPR,aAAO,IADA;AAEPC,aAAOC,EAAE,IAAF,CAFA;AAGPO,kBAAY;AAHL;AAzBJ,GAAP;AA+BD,CAhCM;;AAkCP;AACO,IAAMC,0CAAiB,SAAjBA,cAAiB;AAAA,SAAK,CACjCZ,cAAcI,CAAd,EAAiBH,MADgB,EAEjCD,cAAcI,CAAd,EAAiBG,aAFgB,EAGjCP,cAAcI,CAAd,EAAiBM,OAHgB,EAIjCV,cAAcI,CAAd,EAAiBI,IAJgB,EAKjCR,cAAcI,CAAd,EAAiBE,SALgB,EAMjCN,cAAcI,CAAd,EAAiBK,WANgB,CAAL;AAAA,CAAvB;;AASA,IAAMI,kCAAa,SAAbA,UAAa;AAAA,SAAK,CAC7B;AACEX,WAAO,SADT;AAEEC,WAAOC,EAAE,SAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBH;AAH7B,GAD6B,EAM7B;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I7B;AACEP,WAAO,UADT;AAEEC,WAAOC,EAAE,WAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBK;AAH7B,GAnI6B,EAwI7B;AACEP,WAAO,gBADT;AAEEC,WAAOC,EAAE,iBAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBK;AAH7B,GAxI6B,EA6I7B;AACEP,WAAO,aADT;AAEEC,WAAOC,EAAE,aAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBE;AAH7B,GA7I6B,EAkJ7B;AACEJ,WAAO,MADT;AAEEC,WAAOC,EAAE,MAAF,CAFT;AAGEU,cAAUd,cAAcI,CAAd,EAAiBE;AAH7B,GAlJ6B;AAuJ7B;AACA;AACA;AACA;AACA;AACA;AACEJ,WAAO,WADT;AAEEa,UAAM,SAFR;AAGEZ,WAAOC,EAAE,SAAF,CAHT;AAIEU,cAAUd,cAAcI,CAAd,EAAiBM;AAJ7B,GA5J6B,EAkK7B;AACER,WAAO,gBADT;AAEEa,UAAM,cAFR;AAGEZ,WAAOC,EAAE,eAAF,CAHT;AAIEU,cAAUd,cAAcI,CAAd,EAAiBM;AAJ7B,GAlK6B,CAAL;AAAA,CAAnB","file":"traceTypes.js","sourcesContent":["/**\n * Trace type constants\n */\n\nexport const chartCategory = _ => {\n return {\n SIMPLE: {\n value: 'SIMPLE',\n label: _('Simple'),\n },\n CHARTS_3D: {\n value: 'CHARTS_3D',\n label: _('3D charts'),\n },\n FINANCIAL: {\n value: 'FINANCIAL',\n label: _('Finance'),\n },\n DISTRIBUTIONS: {\n value: 'DISTRIBUTIONS',\n label: _('Distributions'),\n },\n MAPS: {\n value: 'MAPS',\n label: _('Maps'),\n },\n SPECIALIZED: {\n value: 'SPECIALIZED',\n label: _('Specialized'),\n },\n THREE_D: {\n value: '3D',\n label: _('3D'),\n maxColumns: 1,\n },\n };\n};\n\n// Layout specification for TraceTypeSelector.js\nexport const categoryLayout = _ => [\n chartCategory(_).SIMPLE,\n chartCategory(_).DISTRIBUTIONS,\n chartCategory(_).THREE_D,\n chartCategory(_).MAPS,\n chartCategory(_).FINANCIAL,\n chartCategory(_).SPECIALIZED,\n];\n\nexport const traceTypes = _ => [\n {\n value: 'scatter',\n label: _('Scatter'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'bar',\n label: _('Bar'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'line',\n label: _('Line'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'area',\n label: _('Area'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'heatmap',\n label: _('Heatmap'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'table',\n label: _('Table'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'contour',\n label: _('Contour'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'pie',\n label: _('Pie'),\n category: chartCategory(_).SIMPLE,\n },\n {\n value: 'scatter3d',\n label: _('3D Scatter'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'line3d',\n label: _('3D Line'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'surface',\n label: _('3D Surface'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'mesh3d',\n label: _('3D Mesh'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'cone',\n label: _('Cone'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'streamtube',\n label: _('Streamtube'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'box',\n label: _('Box'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'violin',\n label: _('Violin'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'histogram',\n label: _('Histogram'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'histogram2d',\n label: _('2D Histogram'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'histogram2dcontour',\n label: _('2D Contour Histogram'),\n category: chartCategory(_).DISTRIBUTIONS,\n },\n {\n value: 'choropleth',\n label: _('Choropleth'),\n category: chartCategory(_).MAPS,\n },\n {\n value: 'scattermapbox',\n label: _('Satellite Map'),\n category: chartCategory(_).MAPS,\n },\n {\n value: 'scattergeo',\n label: _('Atlas Map'),\n category: chartCategory(_).MAPS,\n },\n // {\n // value: 'parcoords',\n // label: _('Parallel Coordinates'),\n // category: chartCategory(_).SPECIALIZED,\n // },\n // {\n // value: 'sankey',\n // label: _('Sankey'),\n // category: chartCategory(_).SPECIALIZED,\n // },\n // {\n // value: 'carpet',\n // label: _('Carpet'),\n // category: chartCategory(_).SPECIALIZED,\n // },\n {\n value: 'scatterpolar',\n label: _('Polar Scatter'),\n category: chartCategory(_).SPECIALIZED,\n },\n {\n value: 'barpolar',\n label: _('Polar Bar'),\n category: chartCategory(_).SPECIALIZED,\n },\n {\n value: 'scatterternary',\n label: _('Ternary Scatter'),\n category: chartCategory(_).SPECIALIZED,\n },\n {\n value: 'candlestick',\n label: _('Candlestick'),\n category: chartCategory(_).FINANCIAL,\n },\n {\n value: 'ohlc',\n label: _('OHLC'),\n category: chartCategory(_).FINANCIAL,\n },\n // {\n // value: 'pointcloud',\n // label: _('Point Cloud'),\n // category: chartCategory(_).THREE_D,\n // },\n {\n value: 'scattergl',\n icon: 'scatter',\n label: _('Scatter'),\n category: chartCategory(_).THREE_D,\n },\n {\n value: 'scatterpolargl',\n icon: 'scatterpolar',\n label: _('Polar Scatter'),\n category: chartCategory(_).THREE_D,\n },\n // {\n // value: 'heatmapgl',\n // icon: 'heatmap',\n // label: _('Heatmap GL'),\n // category: chartCategory(_).THREE_D,\n // },\n];\n"]} \ No newline at end of file diff --git a/lib/lib/unpackPlotProps.js b/lib/lib/unpackPlotProps.js deleted file mode 100644 index 259ad82f7..000000000 --- a/lib/lib/unpackPlotProps.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = unpackPlotProps; - -var _nested_property = require('plotly.js/src/lib/nested_property'); - -var _nested_property2 = _interopRequireDefault(_nested_property); - -var _fastIsnumeric = require('fast-isnumeric'); - -var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); - -var _constants = require('./constants'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function unpackPlotProps(props, context) { - var container = context.container, - getValObject = context.getValObject, - defaultContainer = context.defaultContainer, - updateContainer = context.updateContainer; - - - if (!props.attr) { - return {}; - } - - var attrMeta = void 0; - if (getValObject) { - attrMeta = context.getValObject(props.attr) || {}; - } - - var fullContainer = context.fullContainer; - - var fullProperty = (0, _nested_property2.default)(fullContainer, props.attr); - var fullValue = fullProperty.get(); - var multiValued = false; - - // MULTI_VALUED consists of a control sequence that cannot be confused with - // user data. We must transform it into something that can be displayed as - // the screen. - if (fullValue === _constants.MULTI_VALUED) { - fullValue = _constants.MULTI_VALUED_PLACEHOLDER; - multiValued = true; - } - - var isVisible = false; - if (props.show || fullValue !== void 0 && fullValue !== null) { - isVisible = true; - } - - var defaultValue = props.defaultValue; - if (defaultValue === void 0 && defaultContainer) { - defaultValue = (0, _nested_property2.default)(defaultContainer, props.attr).get(); - } - - var min = void 0, - max = void 0, - description = void 0; - if (attrMeta) { - if ((0, _fastIsnumeric2.default)(attrMeta.max)) { - max = attrMeta.max; - } - if ((0, _fastIsnumeric2.default)(attrMeta.min)) { - min = attrMeta.min; - } - - description = attrMeta.description; - } - - var updatePlot = function updatePlot(v) { - if (updateContainer) { - updateContainer(_defineProperty({}, props.attr, v)); - } - }; - - return { - attrMeta: attrMeta, - container: container, - defaultValue: defaultValue, - fullContainer: fullContainer, - fullValue: fullValue, - getValObject: getValObject, - isVisible: isVisible, - max: max, - min: min, - description: description, - multiValued: multiValued, - updateContainer: updateContainer, - updatePlot: updatePlot - }; -} -//# sourceMappingURL=unpackPlotProps.js.map \ No newline at end of file diff --git a/lib/lib/unpackPlotProps.js.map b/lib/lib/unpackPlotProps.js.map deleted file mode 100644 index b3ddf0c36..000000000 --- a/lib/lib/unpackPlotProps.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/unpackPlotProps.js"],"names":["unpackPlotProps","props","context","container","getValObject","defaultContainer","updateContainer","attr","attrMeta","fullContainer","fullProperty","fullValue","get","multiValued","MULTI_VALUED","MULTI_VALUED_PLACEHOLDER","isVisible","show","defaultValue","min","max","description","updatePlot","v"],"mappings":";;;;;kBAIwBA,e;;AAJxB;;;;AACA;;;;AACA;;;;;;AAEe,SAASA,eAAT,CAAyBC,KAAzB,EAAgCC,OAAhC,EAAyC;AAAA,MAC/CC,SAD+C,GACeD,OADf,CAC/CC,SAD+C;AAAA,MACpCC,YADoC,GACeF,OADf,CACpCE,YADoC;AAAA,MACtBC,gBADsB,GACeH,OADf,CACtBG,gBADsB;AAAA,MACJC,eADI,GACeJ,OADf,CACJI,eADI;;;AAGtD,MAAI,CAACL,MAAMM,IAAX,EAAiB;AACf,WAAO,EAAP;AACD;;AAED,MAAIC,iBAAJ;AACA,MAAIJ,YAAJ,EAAkB;AAChBI,eAAWN,QAAQE,YAAR,CAAqBH,MAAMM,IAA3B,KAAoC,EAA/C;AACD;;AAED,MAAME,gBAAgBP,QAAQO,aAA9B;;AAEA,MAAMC,eAAe,+BAAeD,aAAf,EAA8BR,MAAMM,IAApC,CAArB;AACA,MAAII,YAAYD,aAAaE,GAAb,EAAhB;AACA,MAAIC,cAAc,KAAlB;;AAEA;AACA;AACA;AACA,MAAIF,cAAcG,uBAAlB,EAAgC;AAC9BH,gBAAYI,mCAAZ;AACAF,kBAAc,IAAd;AACD;;AAED,MAAIG,YAAY,KAAhB;AACA,MAAIf,MAAMgB,IAAN,IAAeN,cAAc,KAAK,CAAnB,IAAwBA,cAAc,IAAzD,EAAgE;AAC9DK,gBAAY,IAAZ;AACD;;AAED,MAAIE,eAAejB,MAAMiB,YAAzB;AACA,MAAIA,iBAAiB,KAAK,CAAtB,IAA2Bb,gBAA/B,EAAiD;AAC/Ca,mBAAe,+BAAeb,gBAAf,EAAiCJ,MAAMM,IAAvC,EAA6CK,GAA7C,EAAf;AACD;;AAED,MAAIO,YAAJ;AAAA,MAASC,YAAT;AAAA,MAAcC,oBAAd;AACA,MAAIb,QAAJ,EAAc;AACZ,QAAI,6BAAUA,SAASY,GAAnB,CAAJ,EAA6B;AAC3BA,YAAMZ,SAASY,GAAf;AACD;AACD,QAAI,6BAAUZ,SAASW,GAAnB,CAAJ,EAA6B;AAC3BA,YAAMX,SAASW,GAAf;AACD;;AAEDE,kBAAcb,SAASa,WAAvB;AACD;;AAED,MAAMC,aAAa,SAAbA,UAAa,IAAK;AACtB,QAAIhB,eAAJ,EAAqB;AACnBA,0CAAkBL,MAAMM,IAAxB,EAA+BgB,CAA/B;AACD;AACF,GAJD;;AAMA,SAAO;AACLf,sBADK;AAELL,wBAFK;AAGLe,8BAHK;AAILT,gCAJK;AAKLE,wBALK;AAMLP,8BANK;AAOLY,wBAPK;AAQLI,YARK;AASLD,YATK;AAULE,4BAVK;AAWLR,4BAXK;AAYLP,oCAZK;AAaLgB;AAbK,GAAP;AAeD","file":"unpackPlotProps.js","sourcesContent":["import nestedProperty from 'plotly.js/src/lib/nested_property';\nimport isNumeric from 'fast-isnumeric';\nimport {MULTI_VALUED, MULTI_VALUED_PLACEHOLDER} from './constants';\n\nexport default function unpackPlotProps(props, context) {\n const {container, getValObject, defaultContainer, updateContainer} = context;\n\n if (!props.attr) {\n return {};\n }\n\n let attrMeta;\n if (getValObject) {\n attrMeta = context.getValObject(props.attr) || {};\n }\n\n const fullContainer = context.fullContainer;\n\n const fullProperty = nestedProperty(fullContainer, props.attr);\n let fullValue = fullProperty.get();\n let multiValued = false;\n\n // MULTI_VALUED consists of a control sequence that cannot be confused with\n // user data. We must transform it into something that can be displayed as\n // the screen.\n if (fullValue === MULTI_VALUED) {\n fullValue = MULTI_VALUED_PLACEHOLDER;\n multiValued = true;\n }\n\n let isVisible = false;\n if (props.show || (fullValue !== void 0 && fullValue !== null)) {\n isVisible = true;\n }\n\n let defaultValue = props.defaultValue;\n if (defaultValue === void 0 && defaultContainer) {\n defaultValue = nestedProperty(defaultContainer, props.attr).get();\n }\n\n let min, max, description;\n if (attrMeta) {\n if (isNumeric(attrMeta.max)) {\n max = attrMeta.max;\n }\n if (isNumeric(attrMeta.min)) {\n min = attrMeta.min;\n }\n\n description = attrMeta.description;\n }\n\n const updatePlot = v => {\n if (updateContainer) {\n updateContainer({[props.attr]: v});\n }\n };\n\n return {\n attrMeta,\n container,\n defaultValue,\n fullContainer,\n fullValue,\n getValObject,\n isVisible,\n max,\n min,\n description,\n multiValued,\n updateContainer,\n updatePlot,\n };\n}\n"]} \ No newline at end of file diff --git a/lib/lib/walkObject.js b/lib/lib/walkObject.js deleted file mode 100644 index 8c0a610b9..000000000 --- a/lib/lib/walkObject.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -exports.isPlainObject = isPlainObject; -exports.makeAttrSetterPath = makeAttrSetterPath; -exports.default = walkObject; -function isPlainObject(input) { - return input && !Array.isArray(input) && (typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object'; -} - -/* - * Helper function for _walkObject - */ -function doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys) { - if (!Array.isArray(value)) { - return false; - } - - if (walkArrays || walkArraysMatchingKeys && walkArraysMatchingKeys.includes(key)) { - return true; - } - - return false; -} - -/* - * Helper utility for path accumulation in _walkObject. Supports array - * path accumulation and also Plotly.js nestedProperty style. - */ -function getPath() { - var pathType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'array'; - var _path = arguments[1]; - - return { - _path: _path || (pathType === 'array' ? [] : ''), - set: function set(parent, key) { - var nextPath = void 0; - switch (pathType) { - case 'array': - nextPath = this._path.concat([key]); - break; - - case 'nestedProperty': - if (this._path.length === 0) { - nextPath = key; - } else if (Array.isArray(parent)) { - nextPath = this._path + ('[' + key + ']'); - } else { - nextPath = this._path + '.' + key; - } - break; - - default: - throw new Error('unrecognized pathType ' + pathType); - } - - return getPath(pathType, nextPath); - }, - get: function get(parent, key) { - // in array mode we do not return the leaf node key. - if (pathType === 'array') { - return this._path; - } - - // in nestedProperty mode we return full path including final key - return this.set(parent, key)._path; - } - }; -} - -/* - * Helper function that transforms an array of path parts into a single path. - * For example: - * - * ['_fullData', 0, 'transforms', 3, 'type'] => 'transforms[3].type' - * - * Note that it strips out the _fullData part (and also _fullInput) since that's - * usually present in the attribute path but isn't necessary in the attribute - * string since it's usually implicitly applied through the userDataIndex. - */ -function makeAttrSetterPath(parts) { - var path = ''; - - // Truncate the leading parts that aren't intersting when applying changes: - var i0 = 0; - if (parts[i0] === '_fullData') { - i0 += 2; - } - if (parts[i0] === '_fullInput') { - i0++; - } - if (parts[i0] === '_fullLayout') { - i0++; - } - - for (var i = i0; i < parts.length; i++) { - if (typeof parts[i] === 'number' || Array.isArray(parts[i])) { - path += '[' + (Array.isArray(parts[i]) ? parts[i][0] : parts[i]) + ']'; - } else { - path += (i > i0 ? '.' : '') + parts[i]; - } - } - return path; -} - -/** - * The function that walkObject calls at each node. - * - * @callback walkObjectCallback - * @param {string|number} key The current key, which may be nested. - * @param {object} parent The object which owns the 'key' as a prop. - * @param {Array} path The keys that lead to the 'parent' object. - * @returns {boolean} True if the value at 'key' should *not* be traversed into - * if it happens to be an object. I.e., you don't need to - * return anything if you want the default traversal of the - * whole object. - */ - -/** - * Walks through object and recurses if necessary. - * - * @param {object} object The top-level or nested object we're walking through. - * @param {walkObjectCallback} callback Called at each object node. - * @param {Array} path The keys that lead from to top-level object to this one. - * @param {object} config configuration object - * @param {string} config.walkArrays flag allowing array walking - * @param {Array} config.walkArraysMatchingKeys An array of keys permitting - * array walking - * @param {string} config.pathType Either 'array' or 'nestedProperty'. Array - * based paths return string keys in an array up - * until the current key position. - * NestedProperty style returns a single - * concatenated "nestedProperty" style string. - * @returns {void} - * @private - */ -function _walkObject(object, callback, path, config) { - var walkArrays = config.walkArrays, - walkArraysMatchingKeys = config.walkArraysMatchingKeys; - - Object.keys(object).forEach(function (key) { - // Callback can force traversal to stop by returning `true`. - if (callback(key, object, path.get(object, key))) { - return; - } - - var value = object[key]; - if (isPlainObject(value) || doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys)) { - _walkObject(value, callback, path.set(object, key), config); - } - }); -} - -/** - * General function to walk object and call the given callback for each node. - * - * @param {Object|Array} input The object or array we want to walk. - * @param {walkObjectCallback} callback Called at each object node. - * @param {Object} [config] configuration object - * @param {Boolean} [config.walkArrays] flag allowing array walking - * @param {Array} [config.walkArraysMatchingKeys] An array of keys permitting - * array walking - * @param {String} [config.pathType] Either 'array' or 'nestedProperty'. Array - * based paths return string keys in an array - * up until the current key position. - * NestedProperty style returns a single - * concatenated "nestedProperty" style string - * with the current key included in the path. - * Defaults to "array" - * @returns {void} - */ -function walkObject(input, callback) { - var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - if (!isPlainObject(input) && !Array.isArray(input)) { - throw new Error('The input must be an object.'); - } - var path = getPath(config.pathType); - _walkObject(input, callback, path, config); -} -//# sourceMappingURL=walkObject.js.map \ No newline at end of file diff --git a/lib/lib/walkObject.js.map b/lib/lib/walkObject.js.map deleted file mode 100644 index 5703f7281..000000000 --- a/lib/lib/walkObject.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/lib/walkObject.js"],"names":["isPlainObject","makeAttrSetterPath","walkObject","input","Array","isArray","doArrayWalk","key","value","walkArrays","walkArraysMatchingKeys","includes","getPath","pathType","_path","set","parent","nextPath","concat","length","Error","get","parts","path","i0","i","_walkObject","object","callback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AAAA,MAC5CpB,UAD4C,GACNoB,MADM,CAC5CpB,UAD4C;AAAA,MAChCC,sBADgC,GACNmB,MADM,CAChCnB,sBADgC;;AAEnDoB,SAAOC,IAAP,CAAYJ,MAAZ,EAAoBK,OAApB,CAA4B,eAAO;AACjC;AACA,QAAIJ,SAASrB,GAAT,EAAcoB,MAAd,EAAsBJ,KAAKF,GAAL,CAASM,MAAT,EAAiBpB,GAAjB,CAAtB,CAAJ,EAAkD;AAChD;AACD;;AAED,QAAMC,QAAQmB,OAAOpB,GAAP,CAAd;AACA,QAAIP,cAAcQ,KAAd,KAAwBF,YAAYC,GAAZ,EAAiBC,KAAjB,EAAwBC,UAAxB,EAAoCC,sBAApC,CAA5B,EAAyF;AACvFgB,kBAAYlB,KAAZ,EAAmBoB,QAAnB,EAA6BL,KAAKR,GAAL,CAASY,MAAT,EAAiBpB,GAAjB,CAA7B,EAAoDsB,MAApD;AACD;AACF,GAVD;AAWD;;AAED;;;;;;;;;;;;;;;;;;AAkBe,SAAS3B,UAAT,CAAoBC,KAApB,EAA2ByB,QAA3B,EAAkD;AAAA,MAAbC,MAAa,uEAAJ,EAAI;;AAC/D,MAAI,CAAC7B,cAAcG,KAAd,CAAD,IAAyB,CAACC,MAAMC,OAAN,CAAcF,KAAd,CAA9B,EAAoD;AAClD,UAAM,IAAIiB,KAAJ,CAAU,8BAAV,CAAN;AACD;AACD,MAAIG,OAAOX,QAAQiB,OAAOhB,QAAf,CAAX;AACAa,cAAYvB,KAAZ,EAAmByB,QAAnB,EAA6BL,IAA7B,EAAmCM,MAAnC;AACD","file":"walkObject.js","sourcesContent":["export function isPlainObject(input) {\n return input && !Array.isArray(input) && typeof input === 'object';\n}\n\n/*\n * Helper function for _walkObject\n */\nfunction doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys) {\n if (!Array.isArray(value)) {\n return false;\n }\n\n if (walkArrays || (walkArraysMatchingKeys && walkArraysMatchingKeys.includes(key))) {\n return true;\n }\n\n return false;\n}\n\n/*\n * Helper utility for path accumulation in _walkObject. Supports array\n * path accumulation and also Plotly.js nestedProperty style.\n */\nfunction getPath(pathType = 'array', _path) {\n return {\n _path: _path || (pathType === 'array' ? [] : ''),\n set(parent, key) {\n let nextPath;\n switch (pathType) {\n case 'array':\n nextPath = this._path.concat([key]);\n break;\n\n case 'nestedProperty':\n if (this._path.length === 0) {\n nextPath = key;\n } else if (Array.isArray(parent)) {\n nextPath = this._path + `[${key}]`;\n } else {\n nextPath = this._path + '.' + key;\n }\n break;\n\n default:\n throw new Error('unrecognized pathType ' + pathType);\n }\n\n return getPath(pathType, nextPath);\n },\n\n get(parent, key) {\n // in array mode we do not return the leaf node key.\n if (pathType === 'array') {\n return this._path;\n }\n\n // in nestedProperty mode we return full path including final key\n return this.set(parent, key)._path;\n },\n };\n}\n\n/*\n * Helper function that transforms an array of path parts into a single path.\n * For example:\n *\n * ['_fullData', 0, 'transforms', 3, 'type'] => 'transforms[3].type'\n *\n * Note that it strips out the _fullData part (and also _fullInput) since that's\n * usually present in the attribute path but isn't necessary in the attribute\n * string since it's usually implicitly applied through the userDataIndex.\n */\nexport function makeAttrSetterPath(parts) {\n let path = '';\n\n // Truncate the leading parts that aren't intersting when applying changes:\n let i0 = 0;\n if (parts[i0] === '_fullData') {\n i0 += 2;\n }\n if (parts[i0] === '_fullInput') {\n i0++;\n }\n if (parts[i0] === '_fullLayout') {\n i0++;\n }\n\n for (let i = i0; i < parts.length; i++) {\n if (typeof parts[i] === 'number' || Array.isArray(parts[i])) {\n path += '[' + (Array.isArray(parts[i]) ? parts[i][0] : parts[i]) + ']';\n } else {\n path += (i > i0 ? '.' : '') + parts[i];\n }\n }\n return path;\n}\n\n/**\n * The function that walkObject calls at each node.\n *\n * @callback walkObjectCallback\n * @param {string|number} key The current key, which may be nested.\n * @param {object} parent The object which owns the 'key' as a prop.\n * @param {Array} path The keys that lead to the 'parent' object.\n * @returns {boolean} True if the value at 'key' should *not* be traversed into\n * if it happens to be an object. I.e., you don't need to\n * return anything if you want the default traversal of the\n * whole object.\n */\n\n/**\n * Walks through object and recurses if necessary.\n *\n * @param {object} object The top-level or nested object we're walking through.\n * @param {walkObjectCallback} callback Called at each object node.\n * @param {Array} path The keys that lead from to top-level object to this one.\n * @param {object} config configuration object\n * @param {string} config.walkArrays flag allowing array walking\n * @param {Array} config.walkArraysMatchingKeys An array of keys permitting\n * array walking\n * @param {string} config.pathType Either 'array' or 'nestedProperty'. Array\n * based paths return string keys in an array up\n * until the current key position.\n * NestedProperty style returns a single\n * concatenated \"nestedProperty\" style string.\n * @returns {void}\n * @private\n */\nfunction _walkObject(object, callback, path, config) {\n const {walkArrays, walkArraysMatchingKeys} = config;\n Object.keys(object).forEach(key => {\n // Callback can force traversal to stop by returning `true`.\n if (callback(key, object, path.get(object, key))) {\n return;\n }\n\n const value = object[key];\n if (isPlainObject(value) || doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys)) {\n _walkObject(value, callback, path.set(object, key), config);\n }\n });\n}\n\n/**\n * General function to walk object and call the given callback for each node.\n *\n * @param {Object|Array} input The object or array we want to walk.\n * @param {walkObjectCallback} callback Called at each object node.\n * @param {Object} [config] configuration object\n * @param {Boolean} [config.walkArrays] flag allowing array walking\n * @param {Array} [config.walkArraysMatchingKeys] An array of keys permitting\n * array walking\n * @param {String} [config.pathType] Either 'array' or 'nestedProperty'. Array\n * based paths return string keys in an array\n * up until the current key position.\n * NestedProperty style returns a single\n * concatenated \"nestedProperty\" style string\n * with the current key included in the path.\n * Defaults to \"array\"\n * @returns {void}\n */\nexport default function walkObject(input, callback, config = {}) {\n if (!isPlainObject(input) && !Array.isArray(input)) {\n throw new Error('The input must be an object.');\n }\n var path = getPath(config.pathType);\n _walkObject(input, callback, path, config);\n}\n"]} \ No newline at end of file diff --git a/lib/locales/en.js b/lib/locales/en.js deleted file mode 100644 index 2d4be0f4c..000000000 --- a/lib/locales/en.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - foo: 'bar' -}; -//# sourceMappingURL=en.js.map \ No newline at end of file diff --git a/lib/locales/en.js.map b/lib/locales/en.js.map deleted file mode 100644 index 9cb7f6cfc..000000000 --- a/lib/locales/en.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/locales/en.js"],"names":["foo"],"mappings":";;;;;kBAAe;AACbA,OAAK;AADQ,C","file":"en.js","sourcesContent":["export default {\n foo: 'bar',\n};\n"]} \ No newline at end of file diff --git a/lib/locales/index.js b/lib/locales/index.js deleted file mode 100644 index c733f5ad3..000000000 --- a/lib/locales/index.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _en = require('./en'); - -var _en2 = _interopRequireDefault(_en); - -var _xx = require('./xx'); - -var _xx2 = _interopRequireDefault(_xx); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - en: _en2.default, - xx: _xx2.default -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/locales/index.js.map b/lib/locales/index.js.map deleted file mode 100644 index b7d4f2027..000000000 --- a/lib/locales/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/locales/index.js"],"names":["en","xx"],"mappings":";;;;;;AAAA;;;;AACA;;;;;;kBAEe;AACbA,MAAIA,YADS;AAEbC,MAAIA;AAFS,C","file":"index.js","sourcesContent":["import en from './en';\nimport xx from './xx';\n\nexport default {\n en: en,\n xx: xx,\n};\n"]} \ No newline at end of file diff --git a/lib/locales/xx.js b/lib/locales/xx.js deleted file mode 100644 index c206c60ea..000000000 --- a/lib/locales/xx.js +++ /dev/null @@ -1,214 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - '2D Contour Histogram': '⇚⇚⇚⇚2D Contour Histogram⇚⇚⇚⇚', - '2D Histogram': '⇚⇚2D Histogram⇚⇚', - '3D Scatter': '⇚⇚3D Scatter⇚⇚', - All: '⇚All⇚', - 'Anchor Point': '⇚⇚Anchor Point⇚⇚', - Angle: '⇚Angle⇚', - Annotation: '⇚⇚Annotation⇚⇚', - Area: '⇚Area⇚', - Arrow: '⇚Arrow⇚', - Arrowhead: '⇚⇚Arrowhead⇚⇚', - 'Atlas Map': '⇚⇚Atlas Map⇚⇚', - Auto: '⇚Auto⇚', - Autoscale: '⇚⇚Autoscale⇚⇚', - Axes: '⇚Axes⇚', - 'Background Color': '⇚⇚⇚Background Color⇚⇚⇚', - Bar: '⇚Bar⇚', - 'Bar Padding': '⇚⇚Bar Padding⇚⇚', - 'Bar Width': '⇚⇚Bar Width⇚⇚', - Bars: '⇚Bars⇚', - Blank: '⇚Blank⇚', - 'Border Color': '⇚⇚Border Color⇚⇚', - 'Border Width': '⇚⇚Border Width⇚⇚', - Bottom: '⇚Bottom⇚', - Box: '⇚Box⇚', - 'Box Padding': '⇚⇚Box Padding⇚⇚', - 'Box Select': '⇚⇚Box Select⇚⇚', - 'Box Width': '⇚⇚Box Width⇚⇚', - Candlestick: '⇚⇚Candlestick⇚⇚', - Canvas: '⇚Canvas⇚', - Carpet: '⇚Carpet⇚', - 'Carpet Contour': '⇚⇚Carpet Contour⇚⇚', - 'Carpet Scatter': '⇚⇚Carpet Scatter⇚⇚', - Center: '⇚Center⇚', - Choropleth: '⇚⇚Choropleth⇚⇚', - 'Click to enter Colorscale title': '⇚⇚⇚⇚⇚Click to enter Colorscale title⇚⇚⇚⇚⇚', - 'Click to enter Component A title': '⇚⇚⇚⇚⇚⇚Click to enter Component A title⇚⇚⇚⇚⇚⇚', - 'Click to enter Component B title': '⇚⇚⇚⇚⇚⇚Click to enter Component B title⇚⇚⇚⇚⇚⇚', - 'Click to enter Component C title': '⇚⇚⇚⇚⇚⇚Click to enter Component C title⇚⇚⇚⇚⇚⇚', - 'Click to enter Plot title': '⇚⇚⇚⇚Click to enter Plot title⇚⇚⇚⇚', - 'Click to enter X axis title': '⇚⇚⇚⇚⇚Click to enter X axis title⇚⇚⇚⇚⇚', - 'Click to enter Y axis title': '⇚⇚⇚⇚⇚Click to enter Y axis title⇚⇚⇚⇚⇚', - 'Collapse All': '⇚⇚Collapse All⇚⇚', - Color: '⇚Color⇚', - "Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.": "⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚", - 'Compare data on hover': '⇚⇚⇚⇚Compare data on hover⇚⇚⇚⇚', - Connect: '⇚Connect⇚', - 'Connect Gaps': '⇚⇚Connect Gaps⇚⇚', - Continue: '⇚Continue⇚', - 'Continuing will convert your LaTeX expression into raw text.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your LaTeX expression into raw text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', - 'Continuing will convert your note to LaTeX-style text.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your note to LaTeX-style text.⇚⇚⇚⇚⇚⇚⇚⇚⇚', - 'Continuing will remove your expression.': '⇚⇚⇚⇚⇚⇚⇚Continuing will remove your expression.⇚⇚⇚⇚⇚⇚⇚', - Contour: '⇚Contour⇚', - Custom: '⇚Custom⇚', - 'Custom Color': '⇚⇚Custom Color⇚⇚', - 'Default Colors': '⇚⇚Default Colors⇚⇚', - Display: '⇚Display⇚', - 'Double-click on legend to isolate one trace': '⇚⇚⇚⇚⇚⇚⇚⇚Double-click on legend to isolate one trace⇚⇚⇚⇚⇚⇚⇚⇚', - 'Double-click to zoom back out': '⇚⇚⇚⇚⇚Double-click to zoom back out⇚⇚⇚⇚⇚', - 'Download plot as a png': '⇚⇚⇚⇚Download plot as a png⇚⇚⇚⇚', - 'Edit in Chart Studio': '⇚⇚⇚⇚Edit in Chart Studio⇚⇚⇚⇚', - 'Edit in HTML': '⇚⇚Edit in HTML⇚⇚', - 'Edit in Rich Text': '⇚⇚⇚Edit in Rich Text⇚⇚⇚', - 'Enter Link URL': '⇚⇚Enter Link URL⇚⇚', - 'Expand All': '⇚⇚Expand All⇚⇚', - 'Filled Area': '⇚⇚Filled Area⇚⇚', - 'Fixed Height': '⇚⇚Fixed Height⇚⇚', - 'Fixed Width': '⇚⇚Fixed Width⇚⇚', - 'Font Color': '⇚⇚Font Color⇚⇚', - 'Font Size': '⇚⇚Font Size⇚⇚', - 'Global Font': '⇚⇚Global Font⇚⇚', - 'Go back': '⇚Go back⇚', - "Go to the 'Create' tab to define traces.": "⇚⇚⇚⇚⇚⇚⇚Go to the 'Create' tab to define traces.⇚⇚⇚⇚⇚⇚⇚", - 'Heads up!': '⇚⇚Heads up!⇚⇚', - Heatmap: '⇚Heatmap⇚', - 'Heatmap GL': '⇚⇚Heatmap GL⇚⇚', - Hide: '⇚Hide⇚', - Histogram: '⇚⇚Histogram⇚⇚', - Horizontal: '⇚⇚Horizontal⇚⇚', - 'Horizontal Positioning': '⇚⇚⇚⇚Horizontal Positioning⇚⇚⇚⇚', - 'IE only supports svg. Changing format to svg.': '⇚⇚⇚⇚⇚⇚⇚⇚IE only supports svg. Changing format to svg.⇚⇚⇚⇚⇚⇚⇚⇚', - LaTeX: '⇚LaTeX⇚', - "LaTeX is a math typesetting language that doesn't work with rich text.": "⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚LaTeX is a math typesetting language that doesn't work with rich text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚", - 'Lasso Select': '⇚⇚Lasso Select⇚⇚', - Layout: '⇚Layout⇚', - Left: '⇚Left⇚', - Legend: '⇚Legend⇚', - 'Legend Box': '⇚⇚Legend Box⇚⇚', - Line: '⇚Line⇚', - 'Line Color': '⇚⇚Line Color⇚⇚', - 'Line Width': '⇚⇚Line Width⇚⇚', - Linear: '⇚Linear⇚', - Lines: '⇚Lines⇚', - "Looks like there aren't any traces defined yet.": "⇚⇚⇚⇚⇚⇚⇚⇚Looks like there aren't any traces defined yet.⇚⇚⇚⇚⇚⇚⇚⇚", - 'Margin Color': '⇚⇚Margin Color⇚⇚', - 'Margins and Padding': '⇚⇚⇚Margins and Padding⇚⇚⇚', - Max: '⇚Max⇚', - Mesh3d: '⇚Mesh3d⇚', - Middle: '⇚Middle⇚', - Min: '⇚Min⇚', - 'Multiple Values': '⇚⇚⇚Multiple Values⇚⇚⇚', - 'No Results': '⇚⇚No Results⇚⇚', - Normal: '⇚Normal⇚', - 'Note Text': '⇚⇚Note Text⇚⇚', - Notes: '⇚Notes⇚', - OHLC: '⇚OHLC⇚', - Opacity: '⇚Opacity⇚', - 'Orbital rotation': '⇚⇚⇚Orbital rotation⇚⇚⇚', - Orientation: '⇚⇚Orientation⇚⇚', - Padding: '⇚Padding⇚', - Pan: '⇚Pan⇚', - 'Parallel Coordinates': '⇚⇚⇚⇚Parallel Coordinates⇚⇚⇚⇚', - Pie: '⇚Pie⇚', - 'Plot Background': '⇚⇚⇚Plot Background⇚⇚⇚', - 'Point Cloud': '⇚⇚Point Cloud⇚⇚', - Points: '⇚Points⇚', - 'Polar Scatter': '⇚⇚Polar Scatter⇚⇚', - Position: '⇚Position⇚', - Positioning: '⇚⇚Positioning⇚⇚', - 'Produced with Plotly': '⇚⇚⇚⇚Produced with Plotly⇚⇚⇚⇚', - Range: '⇚Range⇚', - 'Relative To': '⇚⇚Relative To⇚⇚', - Reset: '⇚Reset⇚', - 'Reset axes': '⇚⇚Reset axes⇚⇚', - 'Reset camera to default': '⇚⇚⇚⇚Reset camera to default⇚⇚⇚⇚', - 'Reset camera to last save': '⇚⇚⇚⇚Reset camera to last save⇚⇚⇚⇚', - 'Reset view': '⇚⇚Reset view⇚⇚', - 'Reset views': '⇚⇚Reset views⇚⇚', - 'Return to the Graph > Create menu above to add data.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚Return to the Graph > Create menu above to add data.⇚⇚⇚⇚⇚⇚⇚⇚⇚', - Reversed: '⇚Reversed⇚', - 'Rich Text': '⇚⇚Rich Text⇚⇚', - 'Rich text is incompatible with LaTeX.': '⇚⇚⇚⇚⇚⇚Rich text is incompatible with LaTeX.⇚⇚⇚⇚⇚⇚', - Right: '⇚Right⇚', - Sankey: '⇚Sankey⇚', - 'Satellite Map': '⇚⇚Satellite Map⇚⇚', - Scale: '⇚Scale⇚', - Scatter: '⇚Scatter⇚', - 'Scatter GL': '⇚⇚Scatter GL⇚⇚', - 'Select an Option': '⇚⇚⇚Select an Option⇚⇚⇚', - Selection: '⇚⇚Selection⇚⇚', - Shape: '⇚Shape⇚', - Show: '⇚Show⇚', - 'Show closest data on hover': '⇚⇚⇚⇚⇚Show closest data on hover⇚⇚⇚⇚⇚', - Size: '⇚Size⇚', - 'Size and Spacing': '⇚⇚⇚Size and Spacing⇚⇚⇚', - 'Snapshot succeeded': '⇚⇚⇚Snapshot succeeded⇚⇚⇚', - 'Sorry, there was a problem downloading your snapshot!': '⇚⇚⇚⇚⇚⇚⇚⇚⇚Sorry, there was a problem downloading your snapshot!⇚⇚⇚⇚⇚⇚⇚⇚⇚', - Surface: '⇚Surface⇚', - Symbol: '⇚Symbol⇚', - Table: '⇚Table⇚', - 'Taking snapshot - this may take a few seconds': '⇚⇚⇚⇚⇚⇚⇚⇚Taking snapshot - this may take a few seconds⇚⇚⇚⇚⇚⇚⇚⇚', - 'Ternary Scatter': '⇚⇚⇚Ternary Scatter⇚⇚⇚', - Text: '⇚Text⇚', - 'Text Attributes': '⇚⇚⇚Text Attributes⇚⇚⇚', - "The anchor point determines which side of the annotation's positioning coordinates refer to.": "⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The anchor point determines which side of the annotation's positioning coordinates refer to.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚", - 'The positioning inputs are relative to the anchor points on the text box.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The positioning inputs are relative to the anchor points on the text box.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', - 'This input has multiple values associated with it. Changing this setting will override these custom inputs.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚This input has multiple values associated with it. Changing this setting will override these custom inputs.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', - 'This trace does not yet have any data.': '⇚⇚⇚⇚⇚⇚⇚This trace does not yet have any data.⇚⇚⇚⇚⇚⇚⇚', - 'Tick Labels': '⇚⇚Tick Labels⇚⇚', - 'Tick Markers': '⇚⇚Tick Markers⇚⇚', - Title: '⇚Title⇚', - 'Title and Fonts': '⇚⇚⇚Title and Fonts⇚⇚⇚', - Titles: '⇚Titles⇚', - 'Toggle Spike Lines': '⇚⇚⇚Toggle Spike Lines⇚⇚⇚', - 'Toggle show closest data on hover': '⇚⇚⇚⇚⇚⇚Toggle show closest data on hover⇚⇚⇚⇚⇚⇚', - Top: '⇚Top⇚', - Trace: '⇚Trace⇚', - 'Trace Order': '⇚⇚Trace Order⇚⇚', - 'Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.': '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚', - 'Turntable rotation': '⇚⇚⇚Turntable rotation⇚⇚⇚', - Type: '⇚Type⇚', - Typeface: '⇚Typeface⇚', - URL: '⇚URL⇚', - Vertical: '⇚Vertical⇚', - 'Vertical Positioning': '⇚⇚⇚⇚Vertical Positioning⇚⇚⇚⇚', - Violin: '⇚Violin⇚', - Width: '⇚Width⇚', - 'X Position': '⇚⇚X Position⇚⇚', - 'X Vector': '⇚X Vector⇚', - 'Y Position': '⇚⇚Y Position⇚⇚', - 'Y Vector': '⇚Y Vector⇚', - Zoom: '⇚Zoom⇚', - 'Zoom Interactivity': '⇚⇚⇚Zoom Interactivity⇚⇚⇚', - 'Zoom in': '⇚Zoom in⇚', - 'Zoom out': '⇚Zoom out⇚', - 'close:': '⇚close:⇚', - 'high:': '⇚high:⇚', - 'incoming flow count:': '⇚⇚⇚⇚incoming flow count:⇚⇚⇚⇚', - 'kde:': '⇚kde:⇚', - 'lat:': '⇚lat:⇚', - log: '⇚log⇚', - 'lon:': '⇚lon:⇚', - 'low:': '⇚low:⇚', - 'lower fence:': '⇚⇚lower fence:⇚⇚', - 'max:': '⇚max:⇚', - 'mean ± σ:': '⇚⇚mean ± σ:⇚⇚', - 'mean:': '⇚mean:⇚', - 'median:': '⇚median:⇚', - 'min:': '⇚min:⇚', - 'open:': '⇚open:⇚', - 'outgoing flow count:': '⇚⇚⇚⇚outgoing flow count:⇚⇚⇚⇚', - 'q1:': '⇚q1:⇚', - 'q3:': '⇚q3:⇚', - 'source:': '⇚source:⇚', - 'target:': '⇚target:⇚', - trace: '⇚trace⇚', - 'upper fence:': '⇚⇚upper fence:⇚⇚' -}; -//# sourceMappingURL=xx.js.map \ No newline at end of file diff --git a/lib/locales/xx.js.map b/lib/locales/xx.js.map deleted file mode 100644 index 2cb1f9b63..000000000 --- a/lib/locales/xx.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/locales/xx.js"],"names":["All","Angle","Annotation","Area","Arrow","Arrowhead","Auto","Autoscale","Axes","Bar","Bars","Blank","Bottom","Box","Candlestick","Canvas","Carpet","Center","Choropleth","Color","Connect","Continue","Contour","Custom","Display","Heatmap","Hide","Histogram","Horizontal","LaTeX","Layout","Left","Legend","Line","Linear","Lines","Max","Mesh3d","Middle","Min","Normal","Notes","OHLC","Opacity","Orientation","Padding","Pan","Pie","Points","Position","Positioning","Range","Reset","Reversed","Right","Sankey","Scale","Scatter","Selection","Shape","Show","Size","Surface","Symbol","Table","Text","Title","Titles","Top","Trace","Type","Typeface","URL","Vertical","Violin","Width","Zoom","log","trace"],"mappings":";;;;;kBAAe;AACb,0BAAwB,8BADX;AAEb,kBAAgB,kBAFH;AAGb,gBAAc,gBAHD;AAIbA,OAAK,OAJQ;AAKb,kBAAgB,kBALH;AAMbC,SAAO,SANM;AAObC,cAAY,gBAPC;AAQbC,QAAM,QARO;AASbC,SAAO,SATM;AAUbC,aAAW,eAVE;AAWb,eAAa,eAXA;AAYbC,QAAM,QAZO;AAabC,aAAW,eAbE;AAcbC,QAAM,QAdO;AAeb,sBAAoB,wBAfP;AAgBbC,OAAK,OAhBQ;AAiBb,iBAAe,iBAjBF;AAkBb,eAAa,eAlBA;AAmBbC,QAAM,QAnBO;AAoBbC,SAAO,SApBM;AAqBb,kBAAgB,kBArBH;AAsBb,kBAAgB,kBAtBH;AAuBbC,UAAQ,UAvBK;AAwBbC,OAAK,OAxBQ;AAyBb,iBAAe,iBAzBF;AA0Bb,gBAAc,gBA1BD;AA2Bb,eAAa,eA3BA;AA4BbC,eAAa,iBA5BA;AA6BbC,UAAQ,UA7BK;AA8BbC,UAAQ,UA9BK;AA+Bb,oBAAkB,oBA/BL;AAgCb,oBAAkB,oBAhCL;AAiCbC,UAAQ,UAjCK;AAkCbC,cAAY,gBAlCC;AAmCb,qCAAmC,2CAnCtB;AAoCb,sCAAoC,8CApCvB;AAqCb,sCAAoC,8CArCvB;AAsCb,sCAAoC,8CAtCvB;AAuCb,+BAA6B,mCAvChB;AAwCb,iCAA+B,uCAxClB;AAyCb,iCAA+B,uCAzClB;AA0Cb,kBAAgB,kBA1CH;AA2CbC,SAAO,SA3CM;AA4Cb,+GACE,+IA7CW;AA8Cb,2BAAyB,+BA9CZ;AA+CbC,WAAS,WA/CI;AAgDb,kBAAgB,kBAhDH;AAiDbC,YAAU,YAjDG;AAkDb,kEACE,oFAnDW;AAoDb,4DACE,0EArDW;AA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or Point': '⇚⇚Anchor Point⇚⇚',\n Angle: '⇚Angle⇚',\n Annotation: '⇚⇚Annotation⇚⇚',\n Area: '⇚Area⇚',\n Arrow: '⇚Arrow⇚',\n Arrowhead: '⇚⇚Arrowhead⇚⇚',\n 'Atlas Map': '⇚⇚Atlas Map⇚⇚',\n Auto: '⇚Auto⇚',\n Autoscale: '⇚⇚Autoscale⇚⇚',\n Axes: '⇚Axes⇚',\n 'Background Color': '⇚⇚⇚Background Color⇚⇚⇚',\n Bar: '⇚Bar⇚',\n 'Bar Padding': '⇚⇚Bar Padding⇚⇚',\n 'Bar Width': '⇚⇚Bar Width⇚⇚',\n Bars: '⇚Bars⇚',\n Blank: '⇚Blank⇚',\n 'Border Color': '⇚⇚Border Color⇚⇚',\n 'Border Width': '⇚⇚Border Width⇚⇚',\n Bottom: '⇚Bottom⇚',\n Box: '⇚Box⇚',\n 'Box Padding': '⇚⇚Box Padding⇚⇚',\n 'Box Select': '⇚⇚Box Select⇚⇚',\n 'Box Width': '⇚⇚Box Width⇚⇚',\n Candlestick: '⇚⇚Candlestick⇚⇚',\n Canvas: '⇚Canvas⇚',\n Carpet: '⇚Carpet⇚',\n 'Carpet Contour': '⇚⇚Carpet Contour⇚⇚',\n 'Carpet Scatter': '⇚⇚Carpet Scatter⇚⇚',\n Center: '⇚Center⇚',\n Choropleth: '⇚⇚Choropleth⇚⇚',\n 'Click to enter Colorscale title': '⇚⇚⇚⇚⇚Click to enter Colorscale title⇚⇚⇚⇚⇚',\n 'Click to enter Component A title': '⇚⇚⇚⇚⇚⇚Click to enter Component A title⇚⇚⇚⇚⇚⇚',\n 'Click to enter Component B title': '⇚⇚⇚⇚⇚⇚Click to enter Component B title⇚⇚⇚⇚⇚⇚',\n 'Click to enter Component C title': '⇚⇚⇚⇚⇚⇚Click to enter Component C title⇚⇚⇚⇚⇚⇚',\n 'Click to enter Plot title': '⇚⇚⇚⇚Click to enter Plot title⇚⇚⇚⇚',\n 'Click to enter X axis title': '⇚⇚⇚⇚⇚Click to enter X axis title⇚⇚⇚⇚⇚',\n 'Click to enter Y axis title': '⇚⇚⇚⇚⇚Click to enter Y axis title⇚⇚⇚⇚⇚',\n 'Collapse All': '⇚⇚Collapse All⇚⇚',\n Color: '⇚Color⇚',\n \"Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'Compare data on hover': '⇚⇚⇚⇚Compare data on hover⇚⇚⇚⇚',\n Connect: '⇚Connect⇚',\n 'Connect Gaps': '⇚⇚Connect Gaps⇚⇚',\n Continue: '⇚Continue⇚',\n 'Continuing will convert your LaTeX expression into raw text.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your LaTeX expression into raw text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Continuing will convert your note to LaTeX-style text.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚Continuing will convert your note to LaTeX-style text.⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Continuing will remove your expression.':\n '⇚⇚⇚⇚⇚⇚⇚Continuing will remove your expression.⇚⇚⇚⇚⇚⇚⇚',\n Contour: '⇚Contour⇚',\n Custom: '⇚Custom⇚',\n 'Custom Color': '⇚⇚Custom Color⇚⇚',\n 'Default Colors': '⇚⇚Default Colors⇚⇚',\n Display: '⇚Display⇚',\n 'Double-click on legend to isolate one trace':\n '⇚⇚⇚⇚⇚⇚⇚⇚Double-click on legend to isolate one trace⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Double-click to zoom back out': '⇚⇚⇚⇚⇚Double-click to zoom back out⇚⇚⇚⇚⇚',\n 'Download plot as a png': '⇚⇚⇚⇚Download plot as a png⇚⇚⇚⇚',\n 'Edit in Chart Studio': '⇚⇚⇚⇚Edit in Chart Studio⇚⇚⇚⇚',\n 'Edit in HTML': '⇚⇚Edit in HTML⇚⇚',\n 'Edit in Rich Text': '⇚⇚⇚Edit in Rich Text⇚⇚⇚',\n 'Enter Link URL': '⇚⇚Enter Link URL⇚⇚',\n 'Expand All': '⇚⇚Expand All⇚⇚',\n 'Filled Area': '⇚⇚Filled Area⇚⇚',\n 'Fixed Height': '⇚⇚Fixed Height⇚⇚',\n 'Fixed Width': '⇚⇚Fixed Width⇚⇚',\n 'Font Color': '⇚⇚Font Color⇚⇚',\n 'Font Size': '⇚⇚Font Size⇚⇚',\n 'Global Font': '⇚⇚Global Font⇚⇚',\n 'Go back': '⇚Go back⇚',\n \"Go to the 'Create' tab to define traces.\":\n \"⇚⇚⇚⇚⇚⇚⇚Go to the 'Create' tab to define traces.⇚⇚⇚⇚⇚⇚⇚\",\n 'Heads up!': '⇚⇚Heads up!⇚⇚',\n Heatmap: '⇚Heatmap⇚',\n 'Heatmap GL': '⇚⇚Heatmap GL⇚⇚',\n Hide: '⇚Hide⇚',\n Histogram: '⇚⇚Histogram⇚⇚',\n Horizontal: '⇚⇚Horizontal⇚⇚',\n 'Horizontal Positioning': '⇚⇚⇚⇚Horizontal Positioning⇚⇚⇚⇚',\n 'IE only supports svg. Changing format to svg.':\n '⇚⇚⇚⇚⇚⇚⇚⇚IE only supports svg. Changing format to svg.⇚⇚⇚⇚⇚⇚⇚⇚',\n LaTeX: '⇚LaTeX⇚',\n \"LaTeX is a math typesetting language that doesn't work with rich text.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚LaTeX is a math typesetting language that doesn't work with rich text.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'Lasso Select': '⇚⇚Lasso Select⇚⇚',\n Layout: '⇚Layout⇚',\n Left: '⇚Left⇚',\n Legend: '⇚Legend⇚',\n 'Legend Box': '⇚⇚Legend Box⇚⇚',\n Line: '⇚Line⇚',\n 'Line Color': '⇚⇚Line Color⇚⇚',\n 'Line Width': '⇚⇚Line Width⇚⇚',\n Linear: '⇚Linear⇚',\n Lines: '⇚Lines⇚',\n \"Looks like there aren't any traces defined yet.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚Looks like there aren't any traces defined yet.⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'Margin Color': '⇚⇚Margin Color⇚⇚',\n 'Margins and Padding': '⇚⇚⇚Margins and Padding⇚⇚⇚',\n Max: '⇚Max⇚',\n Mesh3d: '⇚Mesh3d⇚',\n Middle: '⇚Middle⇚',\n Min: '⇚Min⇚',\n 'Multiple Values': '⇚⇚⇚Multiple Values⇚⇚⇚',\n 'No Results': '⇚⇚No Results⇚⇚',\n Normal: '⇚Normal⇚',\n 'Note Text': '⇚⇚Note Text⇚⇚',\n Notes: '⇚Notes⇚',\n OHLC: '⇚OHLC⇚',\n Opacity: '⇚Opacity⇚',\n 'Orbital rotation': '⇚⇚⇚Orbital rotation⇚⇚⇚',\n Orientation: '⇚⇚Orientation⇚⇚',\n Padding: '⇚Padding⇚',\n Pan: '⇚Pan⇚',\n 'Parallel Coordinates': '⇚⇚⇚⇚Parallel Coordinates⇚⇚⇚⇚',\n Pie: '⇚Pie⇚',\n 'Plot Background': '⇚⇚⇚Plot Background⇚⇚⇚',\n 'Point Cloud': '⇚⇚Point Cloud⇚⇚',\n Points: '⇚Points⇚',\n 'Polar Scatter': '⇚⇚Polar Scatter⇚⇚',\n Position: '⇚Position⇚',\n Positioning: '⇚⇚Positioning⇚⇚',\n 'Produced with Plotly': '⇚⇚⇚⇚Produced with Plotly⇚⇚⇚⇚',\n Range: '⇚Range⇚',\n 'Relative To': '⇚⇚Relative To⇚⇚',\n Reset: '⇚Reset⇚',\n 'Reset axes': '⇚⇚Reset axes⇚⇚',\n 'Reset camera to default': '⇚⇚⇚⇚Reset camera to default⇚⇚⇚⇚',\n 'Reset camera to last save': '⇚⇚⇚⇚Reset camera to last save⇚⇚⇚⇚',\n 'Reset view': '⇚⇚Reset view⇚⇚',\n 'Reset views': '⇚⇚Reset views⇚⇚',\n 'Return to the Graph > Create menu above to add data.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚Return to the Graph > Create menu above to add data.⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n Reversed: '⇚Reversed⇚',\n 'Rich Text': '⇚⇚Rich Text⇚⇚',\n 'Rich text is incompatible with LaTeX.': '⇚⇚⇚⇚⇚⇚Rich text is incompatible with LaTeX.⇚⇚⇚⇚⇚⇚',\n Right: '⇚Right⇚',\n Sankey: '⇚Sankey⇚',\n 'Satellite Map': '⇚⇚Satellite Map⇚⇚',\n Scale: '⇚Scale⇚',\n Scatter: '⇚Scatter⇚',\n 'Scatter GL': '⇚⇚Scatter GL⇚⇚',\n 'Select an Option': '⇚⇚⇚Select an Option⇚⇚⇚',\n Selection: '⇚⇚Selection⇚⇚',\n Shape: '⇚Shape⇚',\n Show: '⇚Show⇚',\n 'Show closest data on hover': '⇚⇚⇚⇚⇚Show closest data on hover⇚⇚⇚⇚⇚',\n Size: '⇚Size⇚',\n 'Size and Spacing': '⇚⇚⇚Size and Spacing⇚⇚⇚',\n 'Snapshot succeeded': '⇚⇚⇚Snapshot succeeded⇚⇚⇚',\n 'Sorry, there was a problem downloading your snapshot!':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚Sorry, there was a problem downloading your snapshot!⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n Surface: '⇚Surface⇚',\n Symbol: '⇚Symbol⇚',\n Table: '⇚Table⇚',\n 'Taking snapshot - this may take a few seconds':\n '⇚⇚⇚⇚⇚⇚⇚⇚Taking snapshot - this may take a few seconds⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Ternary Scatter': '⇚⇚⇚Ternary Scatter⇚⇚⇚',\n Text: '⇚Text⇚',\n 'Text Attributes': '⇚⇚⇚Text Attributes⇚⇚⇚',\n \"The anchor point determines which side of the annotation's positioning coordinates refer to.\":\n \"⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The anchor point determines which side of the annotation's positioning coordinates refer to.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚\",\n 'The positioning inputs are relative to the anchor points on the text box.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚The positioning inputs are relative to the anchor points on the text box.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'This input has multiple values associated with it. Changing this setting will override these custom inputs.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚This input has multiple values associated with it. Changing this setting will override these custom inputs.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'This trace does not yet have any data.': '⇚⇚⇚⇚⇚⇚⇚This trace does not yet have any data.⇚⇚⇚⇚⇚⇚⇚',\n 'Tick Labels': '⇚⇚Tick Labels⇚⇚',\n 'Tick Markers': '⇚⇚Tick Markers⇚⇚',\n Title: '⇚Title⇚',\n 'Title and Fonts': '⇚⇚⇚Title and Fonts⇚⇚⇚',\n Titles: '⇚Titles⇚',\n 'Toggle Spike Lines': '⇚⇚⇚Toggle Spike Lines⇚⇚⇚',\n 'Toggle show closest data on hover': '⇚⇚⇚⇚⇚⇚Toggle show closest data on hover⇚⇚⇚⇚⇚⇚',\n Top: '⇚Top⇚',\n Trace: '⇚Trace⇚',\n 'Trace Order': '⇚⇚Trace Order⇚⇚',\n 'Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.':\n '⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚Trace opacity is not supported for a scatter trace with fill or for a scatter trace that gets filled by another scatter trace.⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚⇚',\n 'Turntable rotation': '⇚⇚⇚Turntable rotation⇚⇚⇚',\n Type: '⇚Type⇚',\n Typeface: '⇚Typeface⇚',\n URL: '⇚URL⇚',\n Vertical: '⇚Vertical⇚',\n 'Vertical Positioning': '⇚⇚⇚⇚Vertical Positioning⇚⇚⇚⇚',\n Violin: '⇚Violin⇚',\n Width: '⇚Width⇚',\n 'X Position': '⇚⇚X Position⇚⇚',\n 'X Vector': '⇚X Vector⇚',\n 'Y Position': '⇚⇚Y Position⇚⇚',\n 'Y Vector': '⇚Y Vector⇚',\n Zoom: '⇚Zoom⇚',\n 'Zoom Interactivity': '⇚⇚⇚Zoom Interactivity⇚⇚⇚',\n 'Zoom in': '⇚Zoom in⇚',\n 'Zoom out': '⇚Zoom out⇚',\n 'close:': '⇚close:⇚',\n 'high:': '⇚high:⇚',\n 'incoming flow count:': '⇚⇚⇚⇚incoming flow count:⇚⇚⇚⇚',\n 'kde:': '⇚kde:⇚',\n 'lat:': '⇚lat:⇚',\n log: '⇚log⇚',\n 'lon:': '⇚lon:⇚',\n 'low:': '⇚low:⇚',\n 'lower fence:': '⇚⇚lower fence:⇚⇚',\n 'max:': '⇚max:⇚',\n 'mean ± σ:': '⇚⇚mean ± σ:⇚⇚',\n 'mean:': '⇚mean:⇚',\n 'median:': '⇚median:⇚',\n 'min:': '⇚min:⇚',\n 'open:': '⇚open:⇚',\n 'outgoing flow count:': '⇚⇚⇚⇚outgoing flow count:⇚⇚⇚⇚',\n 'q1:': '⇚q1:⇚',\n 'q3:': '⇚q3:⇚',\n 'source:': '⇚source:⇚',\n 'target:': '⇚target:⇚',\n trace: '⇚trace⇚',\n 'upper fence:': '⇚⇚upper fence:⇚⇚',\n};\n"]} \ No newline at end of file diff --git a/lib/react-chart-editor.css b/lib/react-chart-editor.css deleted file mode 100644 index 33a2011f8..000000000 --- a/lib/react-chart-editor.css +++ /dev/null @@ -1,2747 +0,0 @@ -/* - * Layout - */ -/* - * Typography - */ -/* - * SPACING - */ -/* - * BORDERS - */ -/* - * Typography - */ -/* - * Effects - */ -.\+flex { - display: flex; } - -.\+cursor-clickable { - cursor: pointer; } - -.\+hover-grey:hover { - color: var(--color-text-active); } - -@keyframes fade-in { - from { - opacity: 0; } - to { - opacity: 1; } } - -@keyframes fade-and-slide-in-from-bottom { - from { - opacity: 0; - transform: translateY(20px); } - to { - opacity: 1; - transform: none; } } - -@keyframes fsbr { - from { - opacity: 1; - transform: none; } - to { - opacity: 0; - transform: translateY(20px); } } - -@keyframes fade-out { - from { - opacity: 1; } - to { - opacity: 0; } } - -.animate--fade-in, .editor_controls .modal__backdrop { - opacity: 0; - animation: fade-in 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -.animate--fade-out, .editor_controls .modal--animate-out .modal__backdrop { - opacity: 1; - animation: fade-out 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -.animate--fade-and-slide-in-from-bottom, .editor_controls .modal__card { - opacity: 0; - transform: translateY(20px); - animation: fade-and-slide-in-from-bottom 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -.animate--fsbr, .editor_controls .modal--animate-out .modal__card { - opacity: 1; - transform: none; - animation: fsbr 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -:root { - --env: $ENV; } - -.plotly-editor--theme-provider { - --color-white: #ffffff; - --color-rhino-core: #2a3f5f; - --color-rhino-dark: #506784; - --color-rhino-medium-1: #a2b1c6; - --color-rhino-medium-2: #c8d4e3; - --color-rhino-light-1: #dfe8f3; - --color-rhino-light-2: #ebf0f8; - --color-rhino-light-3: #f3f6fa; - --color-rhino-light-4: #fafbfd; - --color-rhino-light-5: #f8f8f9; - --color-dodger: #119dff; - --color-dodger-shade: #0d76bf; - --color-dodger-shade-mid: #0d76bf; - --color-aqua: #09ffff; - --color-aqua-shade: #19d3f3; - --color-lavender: #e763fa; - --color-lavender-shade: #ab63fa; - --color-lavender-shade-mid: #934bde; - --color-cornflower: #636efa; - --color-emerald: #00cc96; - --color-sienna: #ef553b; - --color-accent: var(--color-dodger); - --color-accent-shade: var(--color-dodger-shade); - --color-accent-shade-mid: var(--color-dodger-shade-mid); - --color-brand: var(--color-dodger); - --color-hightlight-darker: var(--color-gray-blue-pale); - --color-text-base: var(--color-rhino-dark); - --color-text-light: var(--color-rhino-medium-1); - --color-text-dark: var(--color-rhino-core); - --color-text-headings: var(--color-text-dark); - --color-text-section-header: var(--color-text-dark); - --color-text-active: var(--color-rhino-core); - --color-text-placeholder: var(--color-rhino-medium-1); - --color-border-default: var(--color-rhino-medium-2); - --color-border-light: var(--color-rhino-light-1); - --color-border-dark: var(--color-rhino-medium-1); - --color-border-accent: var(--color-accent); - --color-border-accent-shade: var(--color-accent-shade); - --color-background: var(--color-rhino-light-2); - --color-background-base: var(--color-rhino-light-2); - --color-background-light: var(--color-rhino-light-3); - --color-background-medium: var(--color-rhino-light-1); - --color-background-dark: var(--color-rhino-medium-1); - --color-background-top: var(--color-white); - --color-background-inverse: var(--color-rhino-dark); - --color-background-inputs: var(--color-background-top); - --color-button-primary-base-fill: var(--color-accent); - --color-button-primary-base-border: var(--color-accent-shade); - --color-button-primary-base-text: var(--color-white); - --color-button-primary-hover-fill: var(--color-accent-shade-mid); - --color-button-primary-hover-border: var(--color-accent-shade); - --color-button-primary-hover-text: var(--color-white); - --color-button-primary-active-fill: var(--color-accent-shade); - --color-button-primary-active-border: var(--color-accent-shade); - --color-button-primary-active-text: var(--color-white); - --color-button-secondary-base-fill: transparent; - --color-button-secondary-base-border: var(--color-rhino-medium-2); - --color-button-secondary-base-text: var(--color-text-base); - --color-button-secondary-hover-fill: transparent; - --color-button-secondary-hover-border: var(--color-rhino-medium-1); - --color-button-secondary-hover-text: var(--color-text-dark); - --color-button-secondary-active-fill: transparent; - --color-button-secondary-active-border: var(--color-rhino-medium-1); - --color-button-secondary-active-text: var(--color-text-dark); - --color-button-tertiary-base-fill: transparent; - --color-button-tertiary-base-border: transparent; - --color-button-tertiary-base-text: var(--color-text-base); - --color-button-tertiary-hover-fill: transparent; - --color-button-tertiary-hover-border: transparent; - --color-button-tertiary-hover-text: var(--color-text-dark); - --color-button-tertiary-active-fill: transparent; - --color-button-tertiary-active-border: transparent; - --color-button-tertiary-active-text: var(--color-text-dark); - --color-button-default-base-fill: var(--color-background-light); - --color-button-default-base-border: var(--color-border-default); - --color-button-default-base-text: var(--color-text-base); - --color-button-default-hover-fill: var(--color-background-base); - --color-button-default-hover-border: var(--color-border-dark); - --color-button-default-hover-text: var(--color-text-dark); - --color-button-default-active-fill: var(--color-background-dark); - --color-button-default-active-border: var(--color-border-dark); - --color-button-default-active-text: var(--color-text-dark); - --color-button-upgrade-base-fill: var(--color-lavender-shade); - --color-button-upgrade-base-border: var(--color-lavender-shade-dark); - --color-button-upgrade-base-text: var(--color-white); - --color-button-upgrade-hover-fill: var(--color-lavender-shade-mid); - --color-button-upgrade-hover-border: var(--color-lavender-shade-dark); - --color-button-upgrade-hover-text: var(--color-white); - --color-button-upgrade-active-fill: var(--color-lavender-shade-dark); - --color-button-upgrade-active-border: var(--color-lavender-shade-dark); - --color-button-upgrade-active-text: var(--color-white); - --color-button-header-base-fill: transparent; - --color-button-header-base-border: var(--color-dodger); - --color-button-header-base-text: var(--color-dodger); - --color-button-header-hover-fill: transparent; - --color-button-header-hover-border: var(--color-dodger-shade-mid); - --color-button-header-hover-text: var(--color-dodger-shade); - --color-button-header-active-fill: transparent; - --color-button-header-active-border: var(--color-dodger-shade); - --color-button-header-active-text: var(--color-dodger-shade); - --spacing-base-unit: 24px; - --spacing-half-unit: 12px; - --spacing-quarter-unit: 6px; - --spacing-sixth-unit: 4px; - --spacing-eighth-unit: 3px; - --font-size-base: 13px; - --font-size-small: 12px; - --font-size-medium: 14px; - --font-size-large: 14px; - --font-size-heading-base: 24px; - --font-size-heading-small: 18px; - --font-size-heading-large: 28px; - --font-size-h5: 16px; - --font-weight-light: 400; - --font-weight-normal: 500; - --font-weight-semibold: 600; - --font-weight-bold: 700; - --font-leading-body: 1.6; - --font-leading-head: 1.2; - --font-letter-spacing-headings: 0.5px; - --font-family-body: "Open Sans", --apple-default, sans-serif; - --font-family-headings: "Dosis", "Arial", sans-serif; - --border-default: 1px solid var(--color-border-default); - --border-light: 1px solid var(--color-border-light); - --border-dark: 1px solid var(--color-border-dark); - --border-accent: 1px solid var(--color-border-accent); - --border-accent-shade: 1px solid var(--color-border-accent-shade); - --border-radius: 5px; - --border-radius-small: 3px; - --text-shadow-dark-color: rgba(42, 63, 95, 0.7); - --text-shadow-dark-ui: 0 1px 2px var(--text-shadow-dark-color); - --text-shadow-dark-ui-inactive: 0 1px 1px rgba(42, 63, 95, 0.4); - --box-shadow-base-color: rgba(80, 103, 132, 0.2); - --box-shadow-base: 0px 2px 9px var(--box-shadow-base-color); - --scrollbar-track-background: var(--color-background-base); - --scrollbar-thumb-color: var(--color-accent); - --panel-background: var(--color-background-base); - --panel-width: 335px; - --fold-header-text-color-base: var(--color-white); - --fold-header-text-color-closed: var(--color-white); - --fold-header-background-base: var(--color-rhino-dark); - --fold-header-background-closed: var(--color-rhino-core); - --fold-header-border-color-closed: var(--color-rhino-core); - --fold-header-border-color-base: var(--color-rhino-dark); - --sidebar-background: var(--color-background-top); - --sidebar-width: 100px; - --sidebar-group-background-base: var(--sidebar-background); - --sidebar-item-background-base: var(--color-background-light); - --sidebar-item-background-hover: var(--color-background-base); - --sidebar-item-background-active: var(--color-background-medium); - --editor-width: calc( - var(--sidebar-width) + var(--panel-width) + 1px - ); } - -.editor_controls { - position: relative; - width: var(--editor-width); - flex-shrink: 0; - overflow: hidden; - display: flex; - /* TODO: Don't inline Draft.css; load it with `systemjs`. */ - /** - * Draft v0.3.0 - * - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - /** -* Rangeslider -*/ - /** -* Rangeslider - Horizontal slider -*/ - /** -* Rangeslider - Vertical slider -*/ - /** -* Rangeslider - Reverse -*/ - /** -* Rangeslider - Labels -*/ - /* ------------------------------------------------------------------- - Microtip - - Modern, lightweight css-only tooltips - Just 1kb minified and gzipped - - @author Ghosh - @package Microtip - ----------------------------------------------------------------------- - 1. Base Styles - 2. Direction Modifiers - 3. Position Modifiers ---------------------------------------------------------------------*/ - /* ------------------------------------------------ - [1] Base Styles --------------------------------------------------*/ - /* ------------------------------------------------ - [2] Position Modifiers --------------------------------------------------*/ - /* ------------------------------------------------ - [2.1] Top Left --------------------------------------------------*/ - /* ------------------------------------------------ - [2.2] Top Right --------------------------------------------------*/ - /* ------------------------------------------------ - [2.3] Bottom --------------------------------------------------*/ - /* ------------------------------------------------ - [2.4] Bottom Left --------------------------------------------------*/ - /* ------------------------------------------------ - [2.5] Bottom Right --------------------------------------------------*/ - /* ------------------------------------------------ - [2.6] Left --------------------------------------------------*/ - /* ------------------------------------------------ - [2.7] Right --------------------------------------------------*/ - /* ------------------------------------------------ - [3] Size --------------------------------------------------*/ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-family: var(--font-family-body); } - .editor_controls .sidebar { - user-select: none; - height: 100%; - min-width: var(--sidebar-width); - width: var(--sidebar-width); - max-width: var(--sidebar-width); - text-align: center; - background: var(--sidebar-background); - overflow-y: auto; - overflow-x: hidden; - float: left; - border-right: var(--border-default); - flex-grow: 1; - -webkit-overflow-scrolling: touch; - -ms-overflow-style: none; } - .editor_controls .sidebar::-webkit-scrollbar { - background: white; - width: 0px; } - .editor_controls .sidebar::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .sidebar::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls .sidebar__group { - background-color: var(--sidebar-group-background-base); - cursor: pointer; - width: 100%; } - .editor_controls .sidebar__group__title { - color: var(--color-text-base); - font-size: var(--font-size-medium); - font-weight: var(--font-weight-normal); - padding: var(--spacing-half-unit) 0; - text-transform: capitalize; - text-align: left; - border-bottom: var(--border-light); - display: flex; - position: relative; } - .editor_controls .sidebar__group__title__label { - padding-left: var(--spacing-base-unit); } - .editor_controls .sidebar__group__title__icon { - position: absolute; - transform: scale(0.9) translateX(2px) translateY(-4px); - transform-origin: center center; - opacity: 0.5; - transition: all 0.15s ease-in-out; } - .editor_controls .sidebar__group__title__icon svg path { - fill: currentColor; } - .editor_controls .sidebar__group:hover .sidebar__group__title__icon { - opacity: 1; } - .editor_controls .sidebar__group--is-active { - color: var(--color-text-active); - cursor: default; } - .editor_controls .sidebar__group--is-active .sidebar__group__title__label { - font-weight: var(--font-weight-semibold); - color: var(--color-text-active); } - .editor_controls .sidebar__group--is-active .sidebar__group__title__icon { - opacity: 1; } - .editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path { - fill: var(--color-accent); } - .editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon { - transform: scale(0.9) translateY(-5px) rotate(90deg); - opacity: 1; } - .editor_controls .sidebar__group--is-expanded .sidebar__group__title { - position: relative; - z-index: 4; - box-shadow: var(--box-shadow-base); } - .editor_controls .sidebar__item { - color: var(--color-text-base); - cursor: pointer; - font-size: var(--font-size-medium); - font-weight: var(--font-weight-normal); - line-height: var(--font-size-medium); - text-transform: capitalize; - background-color: var(--sidebar-item-background-base); - padding: 10px; - padding-left: 18px; - padding-right: var(--spacing-quarter-unit); - text-align: left; - border-bottom: var(--border-light); - position: relative; - overflow: hidden; } - .editor_controls .sidebar__item--single { - margin-top: 15px; } - .editor_controls .sidebar__item--single:last-child { - margin-bottom: 15px; } - .editor_controls .sidebar__item::before { - content: ''; - position: absolute; - height: 100%; - top: 0; - left: 0; - width: 5px; - background-color: var(--color-accent); - transform: scaleX(0); - transform-origin: left center; - will-change: transform; - transition: all 0.15s ease-in-out; } - .editor_controls .sidebar__item span { - display: block; - will-change: transform; - transition: all 0.15s ease-in-out; } - .editor_controls .sidebar__item:not(.sidebar__item--is-active):hover { - background-color: var(--sidebar-item-background-hover); } - .editor_controls .sidebar__item--is-active { - color: var(--color-text-active); - font-weight: var(--font-weight-semibold); - cursor: default; } - .editor_controls .sidebar__item--is-active::before { - transform: none; } - .editor_controls .sidebar__item--is-active span { - transform: translateX(5px); } - .editor_controls .sidebar__logo { - height: 50px; - margin: 10px; } - .editor_controls .panel { - flex-grow: 1; - overflow-x: hidden; - overflow-y: auto; - padding: var(--spacing-half-unit); - box-sizing: border-box; - position: relative; - display: flex; - flex-direction: column; - width: 100%; - -webkit-overflow-scrolling: touch; } - .editor_controls .panel::-webkit-scrollbar { - background: white; - width: 5px; } - .editor_controls .panel::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .panel::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls__wrapper > .panel { - background-color: var(--panel-background); - border-right: var(--border-default); - width: calc(var(--panel-width)); } - .editor_controls .panel__content { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .panel__header { - margin-bottom: var(--spacing-half-unit); - display: flex; - flex-shrink: 0; } - .editor_controls .panel__header__content { - flex-grow: 1; } - .editor_controls .panel__header__actions__container { - width: 100%; } - .editor_controls .panel__header__collapse { - font-size: var(--font-size-medium); - float: left; - color: var(--color-text-base); - display: flex; - align-items: center; - height: 100%; - cursor: pointer; } - .editor_controls .panel__header__collapse svg { - width: 16px !important; - height: 16px !important; - fill: var(--color-text-light); - padding-right: 3px; } - .editor_controls .panel__header__action { - float: right; } - .editor_controls .panel__empty { - position: absolute; - top: 0; - right: 0; - width: var(--panel-width); - border-right: var(--border-default); - height: 100%; - padding: var(--spacing-half-unit); - background-color: var(--panel-background); - box-sizing: border-box; - z-index: 1003; - display: flex; } - .editor_controls .panel__empty__message { - text-align: center; } - .editor_controls .panel__empty__message__icon { - padding-top: calc(var(--spacing-base-unit) * 2); - margin-bottom: var(--spacing-half-unit); - opacity: 0.5; } - .editor_controls .panel__empty__message__icon svg { - width: 48px !important; - height: 48px !important; } - .editor_controls .panel__empty__message__icon svg path { - fill: var(--color-text-light); } - .editor_controls .panel__empty__message__heading { - color: var(--color-text-headings); - font-size: var(--font-size-heading-base); - font-weight: var(--font-weight-normal); - line-height: var(--font-leading-head); - font-family: var(--font-family-headings); - letter-spacing: var(--font-letter-spacing-headings); } - .editor_controls .panel__empty__message__content { - font-size: var(--font-size-base); - color: var(--color-text-base); - line-height: var(--font-leading-body); } - .editor_controls .panel--no-padding { - padding: 0; } - .editor_controls .fold .panel { - overflow-x: visible; - overflow-y: visible; } - .editor_controls .fold { - width: 100%; - user-select: none; } - .editor_controls .fold__top { - display: flex; - justify-content: space-between; - clear: both; - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - color: var(--fold-header-text-color-closed); - font-size: var(--font-size-base); - border: 1px solid var(--fold-header-border-color-closed); - background-color: var(--fold-header-background-closed); - height: 15px; - border-radius: var(--border-radius); - text-shadow: var(--text-shadow-dark-ui); - transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; - box-sizing: content-box; } - .editor_controls .fold__top:hover { - cursor: pointer; - background-color: var(--fold-header-background-closed); } - .editor_controls .fold__top svg { - width: 18px; - height: 18px; - display: block; - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .fold__top svg path { - fill: currentColor; } - .editor_controls .fold__top--open { - color: var(--fold-header-text-color-base); - background-color: var(--fold-header-background-base); - border: 1px solid var(--fold-header-border-color-base); - border-radius: var(--border-radius) var(--border-radius) 0 0; - text-shadow: var(--text-shadow-dark-ui-inactive); } - .editor_controls .fold__top--open svg { - filter: drop-shadow(0 1px 1px rgba(42, 63, 95, 0.4)); } - .editor_controls .fold__top--open:hover { - background-color: var(--fold-header-background-base); } - .editor_controls .fold__top__icon { - display: block; - margin-right: var(--spacing-quarter-unit); - transform: translateY(-1px); } - .editor_controls .fold__top__title { - margin-left: var(--spacing-half-unit)/3; - font-size: var(--font-size-medium); - line-height: var(--font-size-medium); - font-weight: var(--font-weight-semibold); - transform: translateY(1px); - white-space: nowrap; - max-width: 230px; - letter-spacing: 0.2px; - text-overflow: ellipsis; - overflow: hidden; } - .editor_controls .fold__top__arrow { - transform: translateX(-3px) translateY(-1px); } - .editor_controls .fold__top__arrow svg { - will-change: transform; - transition: transform 0.1s ease-in-out; - transform: rotate(-90deg); - font-weight: bold; - transform-origin: center center; } - .editor_controls .fold__top__arrow-title { - display: flex; - flex-grow: 1; } - .editor_controls .fold__top__arrow--open svg { - transform: rotate(0deg); } - .editor_controls .fold__top__delete { - font-size: 18px; - opacity: 0.75; - transform: translateY(-2px); } - .editor_controls .fold__top__delete:hover { - opacity: 1; } - .editor_controls .fold__content { - background: var(--color-background-top); - border: var(--border-default); - border-width: 0 1px 1px 1px; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; } - .editor_controls .fold__content__plot { - overflow: hidden; - border-bottom-left-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius); } - .editor_controls .fold__content > *:first-child { - border-top: 0; } - .editor_controls .fold__content__empty { - font-family: var(--font-family-headings); - display: flex; - flex-direction: column; - justify-content: center; - padding: 30px 25px; } - .editor_controls .fold__content__empty__icon { - margin: 0 auto; - margin-bottom: 15px; - width: 40px; - height: 40px; - border-radius: 50%; - background-color: var(--color-dodger); - display: flex; - flex-direction: column; - justify-content: center; } - .editor_controls .fold__content__empty__icon svg { - margin: 0 auto !important; - fill: white; - width: 23px; - height: 23px; } - .editor_controls .fold__content__empty__message__primary { - text-align: center; - margin-bottom: 20px; - font-size: 17px; - color: var(--color-text-base); } - .editor_controls .fold__content__empty__message__secondary { - font-family: var(--font-family-body); - font-size: var(--font-size-small); - text-align: center; - color: var(--color-text-base); } - .editor_controls .fold__content--noheader { - border-width: 1px 1px 1px 1px; } - .editor_controls .fold { - margin-bottom: var(--spacing-half-unit); } - .editor_controls .fold .fold:last-child { - margin-bottom: 0; } - .editor_controls .section__heading { - position: relative; - display: flex; - font-size: var(--font-size-base); - color: var(--color-text-section-header); - font-weight: var(--font-weight-semibold); - cursor: default; - background-color: var(--color-background-light); - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - clear: both; - text-transform: capitalize; } - .editor_controls .section:not(:first-child) .section__heading { - border-top: var(--border-light); } - .editor_controls .section:first-child .section__heading { - border-top: 0; } - .editor_controls .menupanel { - padding-top: 0; - display: flex; - justify-content: flex-end; - flex-grow: 1; } - .editor_controls .menupanel--ownline { - padding-top: var(--spacing-quarter-unit); - width: 100%; } - .editor_controls .menupanel__label { - font-weight: var(--font-weight-semibold); - padding-right: var(--spacing-quarter-unit); } - .editor_controls .menupanel__icon { - vertical-align: middle; - width: 15px !important; - height: 15px !important; - fill: var(--color-text-light) !important; - padding-left: var(--spacing-quarter-unit); } - .editor_controls .menupanel__icon svg { - display: block; } - .editor_controls .menupanel__icon:hover { - cursor: pointer; - fill: var(--color-accent) !important; } - .editor_controls .menupanel__icon-span { - font-size: var(--font-size-small); - display: flex; } - .editor_controls .menupanel__icon-span--question { - color: var(--color-text-base); } - .editor_controls .info__title { - color: var(--color-text-headings); - font-size: var(--font-size-heading-small); - font-weight: var(--font-weight-normal); - line-height: var(--font-leading-head); - font-family: var(--font-family-headings); - letter-spacing: var(--font-letter-spacing-headings); - padding: var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); } - .editor_controls .info__text { - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - color: var(--color-text-base); - font-size: var(--font-size-small); - font-weight: var(--font-weight-normal); - line-height: var(--font-leading-body); } - .editor_controls .info__sub-text { - color: var(--color-text-base); - font-size: var(--font-size-small); - font-weight: var(--font-weight-normal); - font-style: italic; - line-height: var(--font-leading-body); - padding: var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-half-unit); } - .editor_controls .modalbox { - position: absolute; - border-radius: var(--border-radius); - overflow: hidden; - text-transform: none; - text-align: left; - border: var(--border-default); - align-content: center; - box-shadow: var(--box-shadow-base); - left: calc(var(--spacing-quarter-unit) * -1); - width: calc(100% + var(--spacing-half-unit)); - top: calc(100% + var(--spacing-quarter-unit)); - background-color: var(--color-background-top); - z-index: 9; } - .editor_controls .modalbox__cover { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: -1; } - .editor_controls .modalbox--dark { - background-color: var(--color-background-inverse); } - .editor_controls .modalbox--relative { - position: relative; } - .editor_controls .field .modalbox { - width: 100%; - left: -1px; - top: 100%; } - .editor_controls .modal { - box-sizing: border-box; - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - display: flex; - align-items: flex-start; - overflow-y: auto; - justify-content: center; - z-index: 1003; } - .editor_controls .modal * { - box-sizing: border-box; } - .editor_controls .modal__backdrop { - height: 100%; - width: 100%; - left: 0; - top: 0; - position: fixed; - opacity: 0; - will-change: opacity; } - .editor_controls .modal__backdrop::before { - content: ''; - height: 100%; - width: 100%; - left: 0; - opacity: 0.5; - top: 0; - background: var(--color-background-dark); - position: fixed; } - .editor_controls .modal__card { - background: var(--color-background-top); - border-radius: var(--border-radius); - position: relative; - z-index: 1003; - max-width: calc(100% - var(--spacing-base-unit)); - box-shadow: var(--box-shadow-base); - display: flex; - flex-direction: column; - will-change: opacity, transform; - flex-grow: 0; - margin: 5vh 10vw; } - .editor_controls .modal__header { - display: flex; - justify-content: space-between; - align-items: center; - color: var(--color-text-base); - padding: var(--spacing-half-unit); - font-weight: var(--font-weight-semibold); } - .editor_controls .modal__header__close { - opacity: 0.5; } - .editor_controls .modal__header__close:hover { - cursor: pointer; - opacity: 1; } - .editor_controls .modal__header__close svg { - display: block; } - .editor_controls .modal__header__close svg * { - fill: currentColor; } - .editor_controls .modal__content { - flex-grow: 1; - background-color: var(--color-background-light); - border-bottom-left-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius); } - .editor_controls .modal__backdrop { - animation-duration: 1s; - animation-delay: 0s; } - .editor_controls .modal__card { - animation-duration: 0.85s; - animation-delay: 0.1s; } - .editor_controls .modal--animate-out { - pointer-events: none; } - .editor_controls .modal--animate-out .modal__backdrop { - animation-duration: 0.85s; - animation-delay: 0s; } - .editor_controls .modal--animate-out .modal__card { - animation-duration: 0.85s; - animation-delay: 0s; } - .editor_controls .panel .react-tabs { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .panel .react-tabs__tab { - flex-grow: 1; - flex-shrink: 0; - display: flex; - align-items: center; - justify-content: center; - padding: var(--spacing-quarter-unit); - color: var(--color-text-base); - font-size: var(--font-size-base); - background: var(--color-background-medium); - border: var(--border-default); - border-bottom: 0; - position: relative; - background: var(--color-background-light); - transition: border-color 0.15s ease-in-out; } - .editor_controls .panel .react-tabs__tab-list { - background: var(--color-background-medium); - margin: 0; - flex-shrink: 0; - list-style: none; - display: flex; - align-items: flex-end; - padding-top: var(--spacing-half-unit); - padding-left: var(--spacing-half-unit); - padding-right: var(--spacing-half-unit); - padding-bottom: 0; - height: 32px; } - .editor_controls .panel .react-tabs__tab:first-of-type { - border-top-left-radius: var(--border-radius); } - .editor_controls .panel .react-tabs__tab:last-of-type { - border-top-right-radius: var(--border-radius); } - .editor_controls .panel .react-tabs__tab:hover { - background-color: var(--color-background-base); - cursor: pointer; } - .editor_controls .panel .react-tabs__tab--selected { - background-color: var(--color-background-base); - pointer-events: none; - margin-top: 0; - color: var(--color-text-active); - border-top-color: var(--color-accent); - border-top-width: 2px; } - .editor_controls .panel .react-tabs__tab--selected::before { - position: absolute; - top: 100%; - width: 100%; - height: 1px; - content: ''; - background-color: var(--color-background-base); - left: 0; - z-index: 4; } - .editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type) { - border-left: 0; } - .editor_controls .panel .react-tabs__tab:last-of-type { - border-left: none; } - .editor_controls .panel .react-tabs__tab-panel { - border-top: var(--border-default); - display: none; } - .editor_controls .panel .react-tabs__tab-panel--selected { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .field { - align-items: flex-start; - border-top: var(--border-light); - color: var(--color-text-base); - display: flex; - font-size: var(--font-size-base); - font-weight: var(--font-weight-normal); - justify-content: flex-start; - line-height: var(--font-size-base); - min-height: 32px; - padding: var(--spacing-quarter-unit) 0; - width: 100%; - position: relative; } - .editor_controls .field__no-title { - width: 100%; - padding: 0 var(--spacing-half-unit); - align-self: center; - line-height: var(--font-leading-body); } - .editor_controls .field__no-title--center { - text-align: center; } - .editor_controls .field__widget { - display: flex; - flex-wrap: wrap; - flex-basis: 0; - padding-right: var(--spacing-half-unit); - padding-left: var(--spacing-half-unit); - align-self: center; } - .editor_controls .field__widget:not(.field__widget--units) { - flex-grow: 1; } - .editor_controls .field__widget--units { - padding-right: 0; } - .editor_controls .field__units { - align-self: center; } - .editor_controls .field__title { - width: 80px; - padding-left: var(--spacing-half-unit); - display: block; - font-size: var(--font-size-small); - line-height: var(--font-leading-body); - color: var(--color-text-base); - padding-top: var(--spacing-quarter-unit); - user-select: none; } - .editor_controls .field__title-text { - text-transform: capitalize; - cursor: default; } - .editor_controls .field__delete { - display: flex; - align-items: center; - justify-content: center; - padding-left: var(--spacing-quarter-unit); - opacity: 0.5; } - .editor_controls .field__delete svg { - display: block; } - .editor_controls .field__delete svg path { - fill: var(--color-text-base); } - .editor_controls .field__delete:hover { - cursor: pointer; - opacity: 1; } - .editor_controls .field__delete:hover svg path { - fill: var(--color-sienna); } - .editor_controls .field .rect, - .editor_controls .field .square { - border-color: var(--color-accent); } - .editor_controls .field .rect-grid { - border-color: var(--panel-background) !important; - float: left; - border-top: 1px solid; - border-left: 1px solid; } - .editor_controls .field .rect-container { - margin: 0 auto; - position: relative; - max-width: 294px; } - @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { - .editor_controls .field__widget { - flex-basis: auto; } } - .editor_controls .field .field { - border-top: none; } - .editor_controls .field .field .field__no-title { - padding: 0; } - .editor_controls .symbol-selector__toggle { - border: var(--border-default); - border-radius: var(--border-radius); - width: 80px; - cursor: pointer; - padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px var(--spacing-quarter-unit); } - .editor_controls .symbol-selector__toggle:before, .editor_controls .symbol-selector__toggle:after { - content: ' '; - display: table; } - .editor_controls .symbol-selector__toggle:after { - clear: both; } - .editor_controls .symbol-selector__toggle--dark { - background-color: var(--color-background-inverse); } - .editor_controls .symbol-selector__toggle__option { - float: left; } - .editor_controls .symbol-selector__toggle__caret { - float: right; - fill: var(--color-text-light); - padding-top: var(--spacing-eighth-unit); - width: 13px !important; - height: 13px !important; } - .editor_controls .symbol-selector__menu { - max-width: 225px; - position: absolute; - z-index: 1003; - border: var(--border-default); - padding: var(--spacing-half-unit); - box-shadow: 2px 2px var(--spacing-half-unit) var(--color-border-light); - border-radius: var(--border-radius-small); - left: var(--spacing-base-unit); } - .editor_controls .symbol-selector__item { - display: inline; } - .editor_controls .symbol-selector__symbol:hover { - background-color: var(--color-border-default); } - .editor_controls button { - display: inline-block; - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - line-height: 1; - letter-spacing: 0.5px; - text-transform: capitalize; - text-align: center; - cursor: pointer; - height: 36px; - outline: none; - user-select: none; - font-size: var(--font-size-medium); - font-weight: var(--font-weight-semibold); - font-family: var(--font-family-body); - border-width: 1px; - border-style: solid; - border-color: transparent; - border-radius: var(--border-radius); - transition: all 0.15s ease-in-out; } - .editor_controls button.button { - padding-left: 0; } - .editor_controls .button__wrapper { - display: flex; - align-items: center; - justify-content: center; - position: relative; - overflow: hidden; } - .editor_controls .button__label { - padding-left: var(--spacing-half-unit); } - .editor_controls .button__icon { - display: flex; - padding-left: var(--spacing-quarter-unit); - will-change: transform; } - .editor_controls .button__icon svg { - transform: scale(0.8); - transform-origin: center center; - display: block; } - .editor_controls .button__icon svg path { - fill: currentColor; } - .editor_controls .button__icon + .button__label { - padding-left: 0; } - .sidebar .button { - width: calc(100% - var(--spacing-base-unit)); - margin-left: var(--spacing-half-unit); - margin-right: var(--spacing-half-unit); } - .editor_controls .button--no-text { - background-color: var(--color-button-default-base-fill); - border-color: var(--color-button-default-base-border); - color: var(--color-button-default-base-text); - padding-right: var(--spacing-quarter-unit); - margin-left: 5px; } - .editor_controls .button--no-text:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-default-hover-fill); - border: 1px solid var(--color-button-default-hover-border); - color: var(--color-button-default-hover-text); } - .editor_controls .button--no-text:active:not(.button--no-text--disabled) { - background-color: var(--color-button-default-active-fill); - border: 1px solid var(--color-button-default-active-border); - color: var(--color-button-default-active-text); } - .editor_controls .button--no-text--disabled { - background-color: var(--color-button-default-base-fill); - border-color: var(--color-button-default-base-border); - color: var(--color-button-default-base-text); - padding-right: var(--spacing-quarter-unit); - margin-left: 5px; - color: #bababa; - cursor: default; } - .editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-default-hover-fill); - border: 1px solid var(--color-button-default-hover-border); - color: var(--color-button-default-hover-text); } - .editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled) { - background-color: var(--color-button-default-active-fill); - border: 1px solid var(--color-button-default-active-border); - color: var(--color-button-default-active-text); } - .editor_controls .button--default { - background-color: var(--color-button-default-base-fill); - border-color: var(--color-button-default-base-border); - color: var(--color-button-default-base-text); } - .editor_controls .button--default:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-default-hover-fill); - border: 1px solid var(--color-button-default-hover-border); - color: var(--color-button-default-hover-text); } - .editor_controls .button--default:active:not(.button--no-text--disabled) { - background-color: var(--color-button-default-active-fill); - border: 1px solid var(--color-button-default-active-border); - color: var(--color-button-default-active-text); } - .editor_controls .button--primary { - background-color: var(--color-button-primary-base-fill); - border-color: var(--color-button-primary-base-border); - color: var(--color-button-primary-base-text); - text-shadow: var(--text-shadow-dark-ui); } - .editor_controls .button--primary svg { - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .button--primary:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-primary-hover-fill); - border: 1px solid var(--color-button-primary-hover-border); - color: var(--color-button-primary-hover-text); } - .editor_controls .button--primary:active:not(.button--no-text--disabled) { - background-color: var(--color-button-primary-active-fill); - border: 1px solid var(--color-button-primary-active-border); - color: var(--color-button-primary-active-text); } - .editor_controls .button--secondary { - background-color: var(--color-button-secondary-base-fill); - border-color: var(--color-button-secondary-base-border); - color: var(--color-button-secondary-base-text); } - .editor_controls .button--secondary:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-secondary-hover-fill); - border: 1px solid var(--color-button-secondary-hover-border); - color: var(--color-button-secondary-hover-text); } - .editor_controls .button--secondary:active:not(.button--no-text--disabled) { - background-color: var(--color-button-secondary-active-fill); - border: 1px solid var(--color-button-secondary-active-border); - color: var(--color-button-secondary-active-text); } - .editor_controls .button--tertiary { - background-color: var(--color-button-tertiary-base-fill); - border-color: var(--color-button-tertiary-base-border); - color: var(--color-button-tertiary-base-text); } - .editor_controls .button--tertiary:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-tertiary-hover-fill); - border: 1px solid var(--color-button-tertiary-hover-border); - color: var(--color-button-tertiary-hover-text); } - .editor_controls .button--tertiary:active:not(.button--no-text--disabled) { - background-color: var(--color-button-tertiary-active-fill); - border: 1px solid var(--color-button-tertiary-active-border); - color: var(--color-button-tertiary-active-text); } - .editor_controls .button--upgrade { - background-color: var(--color-button-upgrade-base-fill); - border-color: var(--color-button-upgrade-base-border); - color: var(--color-button-upgrade-base-text); - text-shadow: var(--text-shadow-dark-ui); } - .editor_controls .button--upgrade svg { - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .button--upgrade:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-upgrade-hover-fill); - border: 1px solid var(--color-button-upgrade-hover-border); - color: var(--color-button-upgrade-hover-text); } - .editor_controls .button--upgrade:active:not(.button--no-text--disabled) { - background-color: var(--color-button-upgrade-active-fill); - border: 1px solid var(--color-button-upgrade-active-border); - color: var(--color-button-upgrade-active-text); } - .editor_controls .button--header { - background-color: var(--color-button-header-base-fill); - border-color: var(--color-button-header-base-border); - color: var(--color-button-header-base-text); } - .editor_controls .button--header:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-header-hover-fill); - border: 1px solid var(--color-button-header-hover-border); - color: var(--color-button-header-hover-text); } - .editor_controls .button--header:active:not(.button--no-text--disabled) { - background-color: var(--color-button-header-active-fill); - border: 1px solid var(--color-button-header-active-border); - color: var(--color-button-header-active-text); } - .editor_controls .checkbox__group { - padding-left: var(--spacing-half-unit); - text-align: left; } - .editor_controls .checkbox__item { - user-select: none; - cursor: default; - padding-top: var(--spacing-eighth-unit); - padding-bottom: var(--spacing-eighth-unit); } - .editor_controls .checkbox__item--vertical { - display: block; - clear: both; } - .editor_controls .checkbox__box { - height: 18px; - width: 18px; - border: var(--border-default); - border-radius: var(--border-radius-small); - cursor: pointer; - display: inline-block; - vertical-align: middle; - text-align: center; - position: relative; } - .editor_controls .checkbox__box:hover { - background: var(--color-background-light); } - .editor_controls .checkbox__box--checked { - border: var(--border-accent-shade); - background: var(--color-accent); } - .editor_controls .checkbox__box--checked:hover { - background: var(--color-accent-shade); } - .editor_controls .checkbox__box--checked + .checkbox__label { - color: var(--color-text-active); } - .editor_controls .checkbox__check { - color: var(--color-text-base); - font-size: var(--spacing-half-unit); - position: absolute; - height: 100%; - width: 100%; - left: 0; - top: 0; - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .checkbox__check svg { - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .checkbox__check svg path { - fill: var(--color-white); } - .editor_controls .checkbox__label { - padding-left: var(--spacing-quarter-unit); - font-size: var(--font-size-base); - color: var(--color-text-base); - display: inline-block; - line-height: 20px; - text-align: left; - vertical-align: middle; - cursor: pointer; } - .editor_controls .colorpicker__saturation, .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider, .editor_controls .colorpicker__controls .colorpicker__active { - position: relative; - overflow: hidden; - border: var(--border-default); - border-radius: var(--border-radius-small); - cursor: pointer; } - .editor_controls .colorpicker { - display: flex; - width: 26px; - height: 26px; - border-radius: 100%; - border: var(--border-default); - padding: var(--spacing-eighth-unit); - /* Saturation wrapper style */ - /* Wrapper style for Hue and Alpha sliders and swatch */ } - .editor_controls .colorpicker__outer { - width: 185px; } - .editor_controls .colorpicker__container { - display: flex; - align-items: center; - line-height: 2; - position: relative; - width: 185px; } - .editor_controls .colorpicker__selected-color { - margin-left: var(--spacing-half-unit); - color: var(--color-text-base); - font-weight: var(--font-weight-semibold); - font-size: var(--font-size-small); - display: inline-block; - vertical-align: middle; - text-transform: uppercase; } - .editor_controls .colorpicker__swatch { - border-radius: 50%; - flex-grow: 1; - width: 100%; - height: 100%; } - .editor_controls .colorpicker__saturation { - height: 100px; } - .editor_controls .colorpicker__custom-input { - padding-top: var(--spacing-eighth-unit); } - .editor_controls .colorpicker__custom-input input { - border: var(--border-default) !important; - box-shadow: none !important; - background-color: var(--color-background-inputs); - color: var(--color-text-dark); } - .editor_controls .colorpicker__custom-input input + span { - color: var(--color-text) !important; } - .editor_controls .colorpicker__controls .colorpicker__sliders { - width: 100%; } - .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider { - margin: auto 0; - height: 10px; - margin: var(--spacing-eighth-unit) 0; } - .editor_controls .colorpicker__controls .colorpicker__active { - height: var(--spacing-base-unit); - width: var(--spacing-base-unit); - margin: var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit); } - .editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - border-radius: var(--border-radius-small); - border: 1px solid #eee; } - .editor_controls .fold .fold .colorpicker__container { - width: calc( $colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit)); } - .editor_controls .colorscalePickerContainer { - min-width: 215px; - position: relative; - padding: 0; - resize: none; - border: none; - background: none; } - .editor_controls .colorscalePickerContainer::-webkit-scrollbar { - width: 5px; } - .editor_controls .colorscalePickerTopContainer { - display: none; } - .editor_controls .colorscaleDescription { - display: none; } - .editor_controls .colorscalePickerContainer input:focus { - outline: none; } - @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { - .editor_controls .colorscalePickerContainer { - display: inline; } } - .editor_controls .colorscalePickerBottomContainer { - padding-right: 3px; } - .editor_controls .customPickerContainer { - margin-top: var(--spacing-quarter-unit); - text-align: left; } - .editor_controls .customPickerContainer__outer { - width: 215px; - text-align: center; } - .editor_controls .dropdown-container { - /** - * React Select - * ============ - * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/ - * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs - * MIT License: https://github.com/JedWatson/react-select -*/ - flex-grow: 1; } - -@keyframes Select-animation-spin { - to { - transform: rotate(1turn); } } - -@-webkit-keyframes Select-animation-spin { - to { - -webkit-transform: rotate(1turn); } } - .editor_controls .dropdown-container .Select { - position: relative; } - .editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button, - .editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button { - display: none !important; } - .editor_controls .dropdown-container .Select input::-ms-clear { - display: none !important; } - .editor_controls .dropdown-container .Select input::-ms-reveal { - display: none !important; } - .editor_controls .dropdown-container .Select, - .editor_controls .dropdown-container .Select div, - .editor_controls .dropdown-container .Select input, - .editor_controls .dropdown-container .Select span { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone { - cursor: default; - pointer-events: none; } - .editor_controls .dropdown-container .Select.is-disabled > .Select-control { - background-color: #f9f9f9; } - .editor_controls .dropdown-container .Select.is-disabled > .Select-control:hover { - box-shadow: none; } - .editor_controls .dropdown-container .Select.is-searchable.is-open > .Select-control { - cursor: text; } - .editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open) > .Select-control { - cursor: text; } - .editor_controls .dropdown-container .Select.is-open > .Select-control { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - background: #fff; - border-color: #b3b3b3 #ccc #d9d9d9; } - .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-arrow { - top: -2px; - border-color: transparent transparent #999; - border-width: 0 5px 5px; } - .editor_controls .dropdown-container .Select.is-focused > .Select-control { - background: #fff; } - .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { - border-color: #08c #0099e6 #0099e6; - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px fade(#08c, 50%); } - .editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single > .Select-control .Select-value { - padding-right: 42px; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { - color: #333; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label { - cursor: pointer; - text-decoration: none; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:hover, .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:hover, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { - color: #08c; - outline: none; - text-decoration: underline; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { - background: #fff; } - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input { - opacity: 0; } - .editor_controls .dropdown-container .Select.is-open .Select-arrow, - .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { - border-top-color: #666; } - .editor_controls .dropdown-container .Select.Select--rtl { - direction: rtl; - text-align: right; } - .editor_controls .dropdown-container .Select-control { - background-color: #fff; - border-color: #d9d9d9 #ccc #b3b3b3; - border-radius: 4px; - border: 1px solid #ccc; - color: #333; - cursor: default; - display: table; - border-spacing: 0; - border-collapse: separate; - height: 36px; - outline: none; - overflow: hidden; - position: relative; - width: 100%; } - .editor_controls .dropdown-container .Select-control:hover { - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); } - .editor_controls .dropdown-container .Select-control .Select-input:focus { - outline: none; - background: #fff; } - .editor_controls .dropdown-container .Select-placeholder, - .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { - bottom: 0; - color: #aaa; - left: 0; - line-height: 34px; - padding-left: 10px; - padding-right: 10px; - position: absolute; - right: 0; - top: 0; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } - .editor_controls .dropdown-container .Select-input { - height: 34px; - padding-left: 10px; - padding-right: 10px; - vertical-align: middle; } - .editor_controls .dropdown-container .Select-input > input { - width: 100%; - background: none transparent; - border: 0 none; - box-shadow: none; - cursor: default; - display: inline-block; - font-family: inherit; - font-size: inherit; - margin: 0; - outline: none; - line-height: 17px; - /* For IE 8 compatibility */ - padding: 8px 0 12px; - /* For IE 8 compatibility */ - -webkit-appearance: none; } - .is-focused .editor_controls .dropdown-container .Select-input > input { - cursor: text; } - .editor_controls .dropdown-container .Select-control:not(.is-searchable) > .Select-input { - outline: none; } - .editor_controls .dropdown-container .Select-loading-zone { - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 16px; } - .editor_controls .dropdown-container .Select-loading { - -webkit-animation: Select-animation-spin 400ms infinite linear; - -o-animation: Select-animation-spin 400ms infinite linear; - animation: Select-animation-spin 400ms infinite linear; - width: 16px; - height: 16px; - box-sizing: border-box; - border-radius: 50%; - border: 2px solid #ccc; - border-right-color: #333; - display: inline-block; - position: relative; - vertical-align: middle; } - .editor_controls .dropdown-container .Select-clear-zone { - -webkit-animation: Select-animation-fadeIn 200ms; - -o-animation: Select-animation-fadeIn 200ms; - animation: Select-animation-fadeIn 200ms; - color: #999; - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 17px; } - .editor_controls .dropdown-container .Select-clear-zone:hover { - color: #D0021B; } - .editor_controls .dropdown-container .Select-clear { - display: inline-block; - font-size: 18px; - line-height: 1; } - .editor_controls .dropdown-container .Select--multi .Select-clear-zone { - width: 17px; } - .editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper { - display: inline-block; } - .editor_controls .dropdown-container .Select .Select-aria-only { - position: absolute; - display: inline-block; - height: 1px; - width: 1px; - margin: -1px; - clip: rect(0, 0, 0, 0); - overflow: hidden; - float: left; } - .editor_controls .dropdown-container .Select-arrow-zone { - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 25px; - padding-right: 5px; } - .Select--rtl .editor_controls .dropdown-container .Select-arrow-zone { - padding-right: 0; - padding-left: 5px; } - .editor_controls .dropdown-container .Select-arrow { - border-color: #999 transparent transparent; - border-style: solid; - border-width: 5px 5px 2.5px; - display: inline-block; - height: 0; - width: 0; - position: relative; } - -@-webkit-keyframes Select-animation-fadeIn { - from { - opacity: 0; } - to { - opacity: 1; } } - -@keyframes Select-animation-fadeIn { - from { - opacity: 0; } - to { - opacity: 1; } } - .editor_controls .dropdown-container .Select-menu-outer { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - background-color: #fff; - border: 1px solid #ccc; - border-top-color: #e6e6e6; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); - box-sizing: border-box; - margin-top: -1px; - max-height: 200px; - position: absolute; - left: 0; - top: 100%; - width: 100%; - z-index: 1000; - -webkit-overflow-scrolling: touch; } - .editor_controls .dropdown-container .Select-menu { - max-height: 198px; - overflow-y: auto; } - .editor_controls .dropdown-container .Select-option { - box-sizing: border-box; - background-color: #fff; - color: #666666; - cursor: pointer; - display: block; - padding: 8px 10px; } - .editor_controls .dropdown-container .Select-option:last-child { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; } - .editor_controls .dropdown-container .Select-option.is-selected { - background-color: #f5faff; - color: #333; } - .editor_controls .dropdown-container .Select-option.is-focused { - background-color: #f2f9fc; - color: #333; } - .editor_controls .dropdown-container .Select-option.is-disabled { - color: #cccccc; - cursor: default; } - .editor_controls .dropdown-container .Select-noresults { - box-sizing: border-box; - color: #999999; - cursor: default; - display: block; - padding: 8px 10px; } - .editor_controls .dropdown-container .Select--multi .Select-input { - vertical-align: middle; - margin-left: 10px; - padding: 0; } - .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input { - margin-left: 0; - margin-right: 10px; } - .editor_controls .dropdown-container .Select--multi.has-value .Select-input { - margin-left: 5px; } - .editor_controls .dropdown-container .Select--multi .Select-value { - background-color: #f2f9fc; - border-radius: 2px; - border: 1px solid #c9e6f2; - color: #08c; - display: inline-block; - font-size: 0.9em; - margin-left: 5px; - margin-top: 5px; - vertical-align: top; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon, - .editor_controls .dropdown-container .Select--multi .Select-value-label { - display: inline-block; - vertical-align: middle; } - .editor_controls .dropdown-container .Select--multi .Select-value-label { - border-bottom-right-radius: 2px; - border-top-right-radius: 2px; - cursor: default; - padding: 2px 5px; } - .editor_controls .dropdown-container .Select--multi a.Select-value-label { - color: #08c; - cursor: pointer; - text-decoration: none; } - .editor_controls .dropdown-container .Select--multi a.Select-value-label:hover { - text-decoration: underline; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon { - cursor: pointer; - border-bottom-left-radius: 2px; - border-top-left-radius: 2px; - border-right: 1px solid #c9e6f2; - padding: 1px 5px 3px; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi .Select-value-icon:focus { - background-color: #ddeff7; - color: #0077b3; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon:active { - background-color: #c9e6f2; } - .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value { - margin-left: 0; - margin-right: 5px; } - .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon { - border-right: none; - border-left: 1px solid #c9e6f2; } - .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value { - background-color: #fcfcfc; - border: 1px solid #e3e3e3; - color: #333; } - .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon { - cursor: not-allowed; - border-right: 1px solid #e3e3e3; } - .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active { - background-color: #fcfcfc; } - -@keyframes Select-animation-spin { - to { - transform: rotate(1turn); } } - -@-webkit-keyframes Select-animation-spin { - to { - -webkit-transform: rotate(1turn); } } - .editor_controls .dropdown-container:not(:last-child) { - margin-bottom: var(--spacing-quarter-unit); } - .editor_controls .dropdown-container .Select.is-focused > .Select-control { - background-color: var(--color-background-inputs); } - .editor_controls .dropdown-container .Select.is-focused > .Select-control .Select-input { - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select.is-open > .Select-control { - border-color: var(--color-border-dark); - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-input { - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select:not(.is-open) .Select-control { - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover { - border-color: var(--color-border-dark); } - .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow { - opacity: 1; } - .editor_controls .dropdown-container .Select-control { - background-color: var(--color-background-inputs); - border: var(--border-default); - box-shadow: none !important; - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select-option { - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select-menu-outer { - border: var(--border-default); - border-top-color: var(--color-border-default); - background-color: transparent; - box-shadow: var(--box-shadow-base); } - .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { - border-color: var(--color-border-accent); } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select.is-open .Select-arrow, - .editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { - border-color: transparent transparent var(--color-border-accent) !important; } - .editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow { - border-top-color: var(--color-border-accent) !important; } - .editor_controls .dropdown-container .Select-arrow { - border-color: var(--color-border-default) transparent transparent; } - .editor_controls .dropdown-container .Select-option { - background-color: var(--color-background-inputs); } - .editor_controls .dropdown-container .Select-option.is-selected { - color: var(--color-text-active); - font-weight: var(--font-weight-semibold); - background-color: var(--color-background-light); } - .editor_controls .dropdown-container .Select-option.is-focused { - background-color: var(--color-background-light); - color: var(--color-text-active); } - .editor_controls .dropdown-container .Select-option:hover { - color: var(--color-text-active); - background-color: var(--color-background-light); } - .editor_controls .dropdown-container .Select-placeholder, - .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select-value-label { - color: var(--color-text-base) !important; } - .editor_controls .dropdown-container .Select-placeholder { - color: var(--color-text-placeholder); } - .editor_controls .dropdown-container .dropdown--dark .Select-control { - background-color: var(--color-background-inverse); } - .editor_controls .dropdown-container .dropdown--dark .Select-option { - background-color: var(--color-background-inverse); } - .editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected { - background-color: var(--color-border-default); } - .editor_controls .dropdown-container .dropdown--dark .Select.is-focused { - background-color: var(--color-border-light); } - .editor_controls ::-webkit-input-placeholder { - /* Chrome/Opera/Safari */ - color: var(--color-text-placeholder); } - .editor_controls ::-moz-placeholder { - /* Firefox 19+ */ - color: var(--color-text-placeholder); } - .editor_controls :-ms-input-placeholder { - /* IE 10+ */ - color: var(--color-text-placeholder); } - .editor_controls :-moz-placeholder { - /* Firefox 18- */ - color: var(--color-text-placeholder); } - .editor_controls .numeric-input__wrapper { - line-height: 20px; - max-width: 100%; - flex: 1; - display: flex; - align-items: center; - color: var(--color-text-base); } - @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { - .editor_controls .numeric-input__wrapper { - flex-basis: auto; } } - .editor_controls .numeric-input__number { - display: inline-block; - border: var(--border-default); - background: var(--color-background-inputs); - cursor: text; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - text-align: left; - border-radius: var(--border-radius-small); - padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); - width: 62px; - vertical-align: middle; - font-size: inherit; - color: inherit; - font-family: inherit; } - .editor_controls .numeric-input__caret-box { - display: inline-block; - max-height: 32px; - margin-left: var(--spacing-quarter-unit); - margin-right: var(--spacing-half-unit); - vertical-align: middle; - box-sizing: border-box; } - .editor_controls .numeric-input__caret:first-child { - margin-bottom: 2px; } - .editor_controls .numeric-input__caret { - cursor: pointer; - background-color: var(--color-background-light); - border: var(--border-default); - border-radius: 1px; - line-height: var(--spacing-half-unit); - text-align: center; } - .editor_controls .numeric-top-caret-modifier { - width: 13px !important; - height: 13px !important; - fill: var(--color-text-base) !important; } - .editor_controls .numeric-bottom-caret-modifier { - width: 13px !important; - height: 13px !important; - fill: var(--color-text-base) !important; } - .editor_controls ::-webkit-input-placeholder { - /* Chrome/Opera/Safari */ - color: var(--color-text-placeholder); } - .editor_controls ::-moz-placeholder { - /* Firefox 19+ */ - color: var(--color-text-placeholder); } - .editor_controls :-ms-input-placeholder { - /* IE 10+ */ - color: var(--color-text-placeholder); } - .editor_controls :-moz-placeholder { - /* Firefox 18- */ - color: var(--color-text-placeholder); } - .editor_controls .text-input { - display: inline-block; - border: var(--border-default); - background: var(--color-background-inputs); - cursor: text; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - text-align: left; - border-radius: var(--border-radius-small); - padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); - width: 140px; - vertical-align: middle; - font-size: inherit; - color: inherit; - font-family: inherit; } - .editor_controls .radio-block { - width: 100%; - line-height: var(--font-leading-head); - display: flex; } - .editor_controls .radio-block__option { - flex-grow: 1; - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - background-color: var(--color-background-top); - border: var(--border-default); - display: inline-block; - cursor: pointer; - min-width: 0px; - text-align: center; - font-size: var(--font-size-small); } - .editor_controls .radio-block__option:not(.radio-block__option--active):hover { - background-color: var(--color-background-light); - color: var(--color-text-active); } - .editor_controls .radio-block__option--active { - background-color: var(--color-button-primary-base-fill); - color: var(--color-button-primary-base-text); - border: 1px solid var(--color-button-primary-base-border); - margin-left: -1px; - cursor: default; - text-shadow: var(--text-shadow-dark-ui); - font-weight: var(--font-weight-semibold); } - .editor_controls .radio-block__option--active:not(:first-child), .editor_controls .radio-block__option--active:last-child { - border-left: var(--border-accent-shade) !important; } - .editor_controls .radio-block__option:not(:first-child):not(:last-child) { - border-left: 0; } - .editor_controls .radio-block__option:last-child { - border-top-right-radius: var(--border-radius-small); - border-bottom-right-radius: var(--border-radius-small); - border-left: 0; } - .editor_controls .radio-block__option:first-child { - border-top-left-radius: var(--border-radius-small); - border-bottom-left-radius: var(--border-radius-small); } - .editor_controls .radio-block__option:first-child:not(.radio-block__option--active) { - border-left: var(--border-default); } - .editor_controls .text-editor { - overflow: hidden; - border: var(--border-default); - border-radius: var(--border-radius); - min-height: 155px; - display: flex; - flex-direction: column; - flex-grow: 1; } - .editor_controls .text-editor * { - box-sizing: border-box; } - .editor_controls .text-editor textarea[class='multi-format-editor__latex'] { - height: 155px; - width: 100%; - margin: 10px; - border: var(--border-default); } - .editor_controls .text-editor textarea[class='multi-format-editor__html'] { - height: 145px; - width: 100%; } - .editor_controls .text-editor textarea { - width: 100%; - height: 100%; - border: none; - overflow: auto; - outline: none; - box-shadow: none; - padding: var(--spacing-quarter-unit); - resize: none; - line-height: 24px; - font-size: 13px; - color: var(--color-text-base); - background-color: var(--color-background-inputs); } - .editor_controls .multi-format-editor__root { - display: flex; - overflow: hidden; - height: 205px; } - .editor_controls .multi-format-editor__root__wrapper { - flex-grow: 1; - display: flex; - flex-wrap: wrap; - align-items: stretch; - flex-direction: column; } - .editor_controls .multi-format-editor__tabs { - height: 30px; - display: block; - width: 100%; } - .editor_controls .multi-format-editor__tab { - text-align: center; - height: 30px; - line-height: 28px; - box-sizing: border-box; } - .editor_controls .multi-format-editor__tab.top-tab { - width: 50%; - overflow: hidden; - color: var(--color-text-base); - display: inline-block; } - .editor_controls .multi-format-editor__tab.top-tab.left { - border-top-left-radius: 5px; - border-right: var(--border-default); } - .editor_controls .multi-format-editor__tab.top-tab.right { - border-top-right-radius: 5px; } - .editor_controls .multi-format-editor__tab.top-tab:not(.selected) { - border-bottom: var(--border-default); } - .editor_controls .multi-format-editor__tab.bottom-tab { - border-top: var(--border-default); - width: 100%; - display: block; - color: var(--color-text-base); } - .editor_controls .multi-format-editor__tab.selected { - background: var(--color-background-light); - font-weight: var(--font-weight-semibold); } - .editor_controls .multi-format-editor__tab:hover:not(.selected) { - cursor: pointer; - color: var(--color-text-active); - background-color: var(--color-background-light); } - .editor_controls .multi-format-editor__content__wrapper__rich_text { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .multi-format-editor__content__wrapper__latex { - background-color: var(--color-background-light); - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .multi-format-editor__content__wrapper__html { - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .multi-format-editor__confirmation-panel { - height: 100%; - max-height: 100%; - width: 100%; - text-align: center; - display: flex; - flex-direction: column; - align-items: flex-start; - flex: 1; } - .editor_controls .multi-format-editor__confirmation-panel__header { - color: var(--color-text-section-header); - margin-top: 0; - margin-bottom: 5px; - font-weight: 600; } - .editor_controls .multi-format-editor__confirmation-panel__content { - overflow-y: auto; - display: flex; - flex-direction: column; - -webkit-overflow-scrolling: touch; - padding: var(--spacing-half-unit); } - .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar { - background: white; - width: 5px; } - .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls .multi-format-editor__confirmation-panel__actions { - padding: var(--spacing-half-unit); - width: 100%; - display: flex; - justify-content: center; - align-items: center; - border-top: 1px solid var(--color-border-light); - -webkit-overflow-scrolling: touch; } - .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar { - background: white; - width: 5px; } - .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls .multi-format-editor__confirmation-panel__message { - line-height: 20px; } - .editor_controls .multi-format-editor__confirmation-panel__message-primary { - font-weight: var(--font-weight-semibold); - color: var(--color-text-base); } - .editor_controls .multi-format-editor__confirmation-panel__message-secondary { - color: var(--color-text-base); } - .editor_controls .multi-format-editor__confirmation-panel__continue-button { - margin-left: 10px; } - .editor_controls .rich-text-editor__root { - border-top: none; - width: 100%; - color: var(--color-text-base); - display: flex; - flex-direction: column; - flex-grow: 1; } - .editor_controls .rich-text-editor__editor { - cursor: text; - position: relative; - flex-grow: 1; } - .editor_controls .rich-text-editor__editor > div { - position: absolute; - width: 100%; - height: 100%; - max-width: 100%; - max-height: 100%; - overflow: auto; - flex-grow: 1; - left: 0; - top: 0; } - .editor_controls .rich-text-editor__controls { - display: flex; - justify-content: space-evenly; - background: var(--color-background-light); - font-size: 14px; - padding: 10px 0; - user-select: none; - border-bottom: var(--border-default); } - .editor_controls .rich-text-editor__controls .icon-link { - transform: translateY(3px); - display: inline-block; - fill: var(--color-text-base); - width: 15px !important; - height: 15px !important; } - .editor_controls .rich-text-editor__link-editor { - background-color: var(--color-background-light); - border: var(--border-default); - padding: var(--spacing-half-unit); - position: absolute; - z-index: 1; - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; } - .editor_controls .rich-text-editor__link-editor__label { - display: block; } - .editor_controls .rich-text-editor__link-editor__input { - border: var(--border-default); - color: var(--color-text-base); - overflow: scroll; - padding: 0 10px; - width: 100%; - margin-top: 10px; } - .editor_controls .rich-text-editor__styleButton { - color: var(--color-text-base); - cursor: pointer; - display: inline-block; - margin: 0; - min-height: var(--spacing-base-unit); - min-width: var(--spacing-base-unit); - text-align: center; - background-color: transparent; - border: var(--border-default); - border-radius: var(--border-radius-small); - line-height: 20px; - position: relative; } - .editor_controls .rich-text-editor__styleButton__wrapper { - padding: 0 var(--spacing-quarter-unit); } - .editor_controls .rich-text-editor__styleButton--active { - background-color: var(--color-accent); - border: var(--border-accent-shade); - color: var(--color-white); } - .editor_controls .rich-text-editor__styleButton--active:hover { - background-color: var(--color-accent); - border: var(--border-accent-shade); - color: var(--color-white); } - .editor_controls .rich-text-editor__styleButton--active:hover::before { - transform: scaleX(0); } - .editor_controls .rich-text-editor__styleButton::before { - content: ''; - position: absolute; - bottom: -1px; - height: 1px; - width: calc(100% + 2px); - left: -1px; - background: var(--color-accent); - will-change: transform; - transform-origin: center center; - transform: scaleX(0); - transition: all 0.15s ease-in-out; } - .editor_controls .rich-text-editor__styleButton:hover { - color: var(--color-text-active); - background-color: var(--color-background-top); } - .editor_controls .rich-text-editor__styleButton:hover::before { - transform: none; } - .editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root, - .editor_controls .rich-text-editor__editor .public-DraftEditor-content { - padding: var(--spacing-quarter-unit); } - .editor_controls .rich-text-editor__editor .public-DraftEditor-content { - min-height: 100px; } - .editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root { - display: none; } - .editor_controls .rich-text-editor__editor .RichEditor-blockquote { - border-left: 5px solid #eee; - color: #666; - font-style: italic; - margin: 16px 0; - padding: 10px 20px; } - .editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre { - background-color: rgba(0, 0, 0, 0.05); - font-size: 16px; - padding: 20px; } - .editor_controls .DraftEditor-editorContainer, - .editor_controls .DraftEditor-root, - .editor_controls .public-DraftEditor-content { - height: inherit; - text-align: initial; } - .editor_controls .DraftEditor-root { - position: relative; } - .editor_controls .DraftEditor-editorContainer { - background-color: rgba(255, 255, 255, 0); - border-left: 0.1px solid transparent; - position: relative; - z-index: 1; } - .editor_controls .public-DraftEditor-block { - position: relative; } - .editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block { - text-align: left; } - .editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root { - left: 0; - text-align: left; } - .editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block { - text-align: center; } - .editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root { - margin: 0 auto; - text-align: center; - width: 100%; } - .editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block { - text-align: right; } - .editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root { - right: 0; - text-align: right; } - .editor_controls .public-DraftEditorPlaceholder-root { - color: #9197a3; - position: absolute; - z-index: 0; } - .editor_controls .public-DraftEditorPlaceholder-hasFocus { - color: #bdc1c9; } - .editor_controls .DraftEditorPlaceholder-hidden { - display: none; } - .editor_controls .public-DraftStyleDefault-block { - position: relative; - white-space: pre-wrap; } - .editor_controls .public-DraftStyleDefault-ltr { - direction: ltr; - text-align: left; } - .editor_controls .public-DraftStyleDefault-rtl { - direction: rtl; - text-align: right; } - .editor_controls .public-DraftStyleDefault-listLTR { - direction: ltr; } - .editor_controls .public-DraftStyleDefault-listRTL { - direction: rtl; } - .editor_controls .public-DraftStyleDefault-ol, - .editor_controls .public-DraftStyleDefault-ul { - margin: 16px 0; - padding: 0; } - .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR { - margin-left: 1.5em; } - .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL { - margin-right: 1.5em; } - .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR { - margin-left: 3em; } - .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL { - margin-right: 3em; } - .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR { - margin-left: 4.5em; } - .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL { - margin-right: 4.5em; } - .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR { - margin-left: 6em; } - .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL { - margin-right: 6em; } - .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR { - margin-left: 7.5em; } - .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL { - margin-right: 7.5em; } - .editor_controls .public-DraftStyleDefault-unorderedListItem { - list-style-type: square; - position: relative; } - .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0 { - list-style-type: disc; } - .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1 { - list-style-type: circle; } - .editor_controls .public-DraftStyleDefault-orderedListItem { - list-style-type: none; - position: relative; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before { - left: -36px; - position: absolute; - text-align: right; - width: 30px; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before { - position: absolute; - right: -36px; - text-align: left; - width: 30px; } - .editor_controls .public-DraftStyleDefault-orderedListItem:before { - content: counter(ol0) ". "; - counter-increment: ol0; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before { - content: counter(ol1) ". "; - counter-increment: ol1; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before { - content: counter(ol2) ". "; - counter-increment: ol2; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before { - content: counter(ol3) ". "; - counter-increment: ol3; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before { - content: counter(ol4) ". "; - counter-increment: ol4; } - .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset { - counter-reset: ol0; } - .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset { - counter-reset: ol1; } - .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset { - counter-reset: ol2; } - .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset { - counter-reset: ol3; } - .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset { - counter-reset: ol4; } - .editor_controls .rangeslider { - margin: 0 var(--spacing-quarter-unit); - min-width: 60px; - position: relative; - background: var(--color-background-light); - -ms-touch-action: none; - touch-action: none; - border: 1px solid var(--color-border-default); - flex-grow: 1; } - .editor_controls .rangeslider, - .editor_controls .rangeslider .rangeslider__fill { - display: block; } - .editor_controls .rangeslider .rangeslider__handle { - outline: 0; - background: #fff; - border: 1px solid var(--color-border-default); - cursor: pointer; - display: inline-block; - position: absolute; } - .editor_controls .rangeslider .rangeslider__handle .rangeslider__active { - opacity: 1; } - .editor_controls .rangeslider .rangeslider__handle-tooltip { - width: 20px; - height: 20px; - text-align: center; - position: absolute; - background-color: rgba(0, 0, 0, 0.8); - font-weight: normal; - font-size: 14px; - transition: all 100ms ease-in; - border-radius: 4px; - display: inline-block; - color: white; - left: 50%; - transform: translate3d(-50%, 0, 0); } - .editor_controls .rangeslider .rangeslider__handle-tooltip span { - margin-top: 12px; - display: inline-block; - line-height: 100%; } - .editor_controls .rangeslider .rangeslider__handle-tooltip:after { - content: ' '; - position: absolute; - width: 0; - height: 0; } - .editor_controls .rangeslider-horizontal { - height: 6px; - border-radius: 10px; } - .editor_controls .rangeslider-horizontal .rangeslider__fill { - height: 100%; - background-color: var(--color-accent); - border: var(--border-accent); - border-radius: 10px; - transform: translateY(-1px); - top: 0; } - .editor_controls .rangeslider-horizontal .rangeslider__handle { - width: 6.66667px; - height: 30px; - border-radius: 20px; - top: 50%; - transform: translate3d(-50%, -50%, 0); - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .rangeslider-horizontal .rangeslider__handle:after { - content: ' '; - position: absolute; - width: 4px; - height: 20px; - border-radius: 5px; - background-color: var(--color-accent); - display: none; } - .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip { - top: -55px; } - .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after { - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-top: 8px solid rgba(0, 0, 0, 0.8); - left: 50%; - bottom: -8px; - transform: translate3d(-50%, 0, 0); } - .editor_controls .rangeslider-vertical { - margin: 20px auto; - height: 150px; - max-width: 10px; - background-color: transparent; } - .editor_controls .rangeslider-vertical .rangeslider__fill, - .editor_controls .rangeslider-vertical .rangeslider__handle { - position: absolute; } - .editor_controls .rangeslider-vertical .rangeslider__fill { - width: 100%; - background-color: #7cb342; - box-shadow: none; - bottom: 0; } - .editor_controls .rangeslider-vertical .rangeslider__handle { - width: 30px; - height: 10px; - left: -10px; - box-shadow: none; } - .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip { - left: -100%; - top: 50%; - transform: translate3d(-50%, -50%, 0); } - .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after { - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - border-left: 8px solid rgba(0, 0, 0, 0.8); - left: 100%; - top: 12px; } - .editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill { - right: 0; } - .editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill { - top: 0; - bottom: inherit; } - .editor_controls .rangeslider__labels { - position: relative; } - .rangeslider-vertical .editor_controls .rangeslider__labels { - position: relative; - list-style-type: none; - margin: 0 0 0 24px; - padding: 0; - text-align: left; - width: 250px; - height: 100%; - left: 10px; } - .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item { - position: absolute; - transform: translate3d(0, -50%, 0); } - .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item::before { - content: ''; - width: 10px; - height: 2px; - background: black; - position: absolute; - left: -14px; - top: 50%; - transform: translateY(-50%); - z-index: -1; } - .editor_controls .rangeslider__labels .rangeslider__label-item { - position: absolute; - font-size: 14px; - cursor: pointer; - display: inline-block; - top: 10px; - transform: translate3d(-50%, 0, 0); } - .editor_controls .trace-grid-single-block { - max-width: 460px; - display: flex; - flex-flow: wrap; - padding: var(--spacing-quarter-unit); } - .editor_controls .trace-grid { - display: grid; - grid-template-columns: repeat(4, 1fr); } - @media (max-width: 860px) { - .editor_controls .trace-grid { - grid-template-columns: repeat(2, 1fr); } } - .editor_controls .trace-grid__column { - text-align: center; - display: flex; - align-items: flex-start; - justify-content: flex-start; - flex-direction: column; - flex-shrink: 0; - flex-grow: 0; } - .editor_controls .trace-grid__column:nth-of-type(4n + 3) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column:nth-of-type(4n) { - -ms-grid-column: 2; } - .editor_controls .trace-grid__column:nth-of-type(4n + 1) { - -ms-grid-column: 3; } - .editor_controls .trace-grid__column:nth-of-type(4n + 2) { - -ms-grid-column: 4; } - .editor_controls .trace-grid__column:nth-of-type(3), .editor_controls .trace-grid__column:nth-of-type(4), .editor_controls .trace-grid__column:nth-of-type(5), .editor_controls .trace-grid__column:nth-of-type(6) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column:nth-of-type(7), .editor_controls .trace-grid__column:nth-of-type(8), .editor_controls .trace-grid__column:nth-of-type(9), .editor_controls .trace-grid__column:nth-of-type(10) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 1) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 2) { - -ms-grid-column: 2; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(3), .editor_controls .trace-grid__column .trace-item:nth-of-type(4) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(5), .editor_controls .trace-grid__column .trace-item:nth-of-type(6) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(7), .editor_controls .trace-grid__column .trace-item:nth-of-type(8) { - -ms-grid-row: 4; } - .editor_controls .trace-grid__column:not(:first-of-type) { - position: relative; } - .editor_controls .trace-grid__column:not(:first-of-type)::before { - position: absolute; - width: 1px; - border-left: var(--border-light); - height: 100%; - top: 0; - left: 0; - content: ''; } - .editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header { - position: relative; - z-index: 99; } - .editor_controls .trace-grid__column--double { - grid-column: span 2; - flex-grow: 0; } - .editor_controls .trace-grid__column--double:nth-of-type(2n + 1) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column--double:nth-of-type(2n + 2) { - -ms-grid-column: 3; } - .editor_controls .trace-grid__column--double:nth-of-type(5), .editor_controls .trace-grid__column--double:nth-of-type(6) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column--double:nth-of-type(7), .editor_controls .trace-grid__column--double:nth-of-type(8) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 1) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 2) { - -ms-grid-column: 2; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 3) { - -ms-grid-column: 3; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n) { - -ms-grid-column: 4; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(3), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4) { - -ms-grid-row: 1; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(5), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(6), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(7), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(8) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(9), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(10), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(11), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(12) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column--double .trace-grid__column__items { - display: grid; - grid-gap: 0; - grid-template-columns: repeat(4, 1fr); } - .editor_controls .trace-grid__column__items { - display: grid; - grid-gap: 0; - grid-template-columns: repeat(2, 90px); - grid-template-rows: repeat(2, 112px); - flex-grow: 1; - width: 100%; - padding: 0 var(--spacing-half-unit) var(--spacing-half-unit); } - .editor_controls .trace-grid__column__header { - text-transform: capitalize; - font-weight: var(--font-weight-semibold); - color: var(--color-text-base); - text-align: left; - display: flex; - align-items: center; - justify-content: flex-start; - border-top: var(--border-light); - width: 100%; - padding: var(--spacing-half-unit) var(--spacing-base-unit) 0; - box-sizing: border-box; } - .editor_controls .trace-item { - width: 90px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: flex-start; - flex-grow: 0; - margin-top: var(--spacing-half-unit); - color: var(--color-text-base); - transition: all 0.15s ease-in-out; - position: relative; } - .editor_controls .trace-item--active .trace-item__image { - border-color: var(--color-accent); - border-width: 2px; - color: var(--color-accent); } - .editor_controls .trace-item__actions { - position: absolute; - width: calc(100%); - display: flex; - flex-direction: column; - top: 0; - left: var(--spacing-quarter-unit); - justify-content: flex-start; - align-items: flex-end; - z-index: 99; - height: 60px; } - .editor_controls .trace-item__actions:hover .trace-item__actions__item { - transform: translateX(-2px); - opacity: 1; - pointer-events: initial; } - .editor_controls .trace-item__actions__item { - transform: translateX(-10px); - opacity: 0; - pointer-events: none; - color: var(--color-text-light); - transition: all 0.15s ease-in-out; } - .editor_controls .trace-item__actions__item:not(:last-child) { - margin-bottom: var(--spacing-quarter-unit); } - .editor_controls .trace-item__actions__item:hover { - color: var(--color-accent); } - .editor_controls .trace-item__actions__item svg { - display: block; - width: 16px; - height: 16px; - fill: currentColor; } - .editor_controls .trace-item:hover { - cursor: pointer; - color: var(--color-accent); } - .editor_controls .trace-item:hover .trace-item__label { - color: var(--color-accent); } - .editor_controls .trace-item:hover .trace-item__image { - border-color: var(--color-accent); } - .editor_controls .trace-item__image { - position: relative; - z-index: 2; - border: 1px solid var(--color-border-default); - width: 60px; - height: 60px; - border-radius: var(--border-radius); - background: var(--color-background-top); - box-shadow: 0 2px 9px transparent; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.15s ease-in-out; } - .editor_controls .trace-item__image__svg { - width: 100%; - flex-grow: 1; - padding: var(--spacing-quarter-unit); } - .editor_controls .trace-item__image svg { - display: block; } - .editor_controls .trace-item__image img { - display: block; - font-size: 10px; - color: var(--color-text-base); } - .editor_controls .trace-item__image__wrapper { - width: 100%; } - .editor_controls .trace-item__label { - font-weight: var(--font-weight-semibold); - width: 72px; - height: 34px; - margin-top: var(--spacing-quarter-unit); - color: var(--color-text-base); - text-transform: capitalize; - font-size: var(--font-size-small); - text-align: center; } - .editor_controls .trace-type-select-dropdown__wrapper > * > * { - pointer-events: none; } - .editor_controls .trace-type-select-dropdown__wrapper > *:hover { - cursor: pointer; } - .editor_controls .trace-type-select-dropdown__wrapper > *:hover .Select:not(.is-open) .Select-control { - border-color: var(--color-border-dark); } - .editor_controls .trace-type-select-button { - display: flex; - align-items: center; - border: var(--border-default); - width: 100%; - height: 36px; - border-radius: var(--border-radius); - padding: 0 var(--spacing-quarter-unit); } - .editor_controls .trace-type-select-button:hover { - cursor: pointer; - border-color: var(--color-border-dark); } - .editor_controls .trace-type-select-button__icon { - max-width: 20px; - width: 20px; - margin-right: var(--spacing-quarter-unit); } - .editor_controls .trace-type-select-button__icon svg { - max-width: 100%; - display: block; } - .editor_controls .trace-type-select-button__icon svg * { - fill: currentColor; } - .editor_controls .dropzone-container { - flex-grow: 1; - display: flex; - align-items: center; - justify-content: center; - border: 1px dashed var(--color-border-default); - height: 160px; - box-sizing: border-box; - padding: 8px; - border-radius: var(--border-radius); } - .editor_controls .dropzone-container__content { - width: 100%; - height: 100%; - text-align: center; - background-color: var(--color-rhino-light-5); - border-radius: var(--border-radius); - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .dropzone-container__message { - padding: 15px; } - .editor_controls .dropzone-container__image { - width: 100%; - height: 100%; - background-size: contain; - background-position: center; - position: relative; - background-repeat: no-repeat; } - .editor_controls .dropzone-container--active { - border-color: var(--color-dodger); } - .editor_controls .dropzone-container--rejected { - border-color: red; } - .editor_controls [aria-label][role~='tooltip'] { - position: relative; } - .editor_controls [aria-label][role~='tooltip']::before, - .editor_controls [aria-label][role~='tooltip']::after { - transform: translate3d(0, 0, 0); - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - display: none; - will-change: transform; - opacity: 0; - pointer-events: none; - transition: all var(--microtip-transition-duration, 0.18s) var(--microtip-transition-easing, ease-in-out) var(--microtip-transition-delay, 0s); - position: absolute; - box-sizing: border-box; - z-index: 10; - transform-origin: top; } - .editor_controls [aria-label][role~='tooltip']::before { - background-size: 100% auto !important; - content: ''; } - .editor_controls [aria-label][role~='tooltip']::after { - background: #506784; - border-radius: 4px; - color: #ffffff; - content: attr(aria-label); - font-size: var(--microtip-font-size, 13px); - font-weight: var(--microtip-font-weight, normal); - text-transform: var(--microtip-text-transform, none); - padding: 0.5em 1em; - white-space: nowrap; - box-sizing: content-box; } - .editor_controls [aria-label][role~='tooltip']:hover::before, - .editor_controls [aria-label][role~='tooltip']:hover::after, - .editor_controls [aria-label][role~='tooltip']:focus::before, - .editor_controls [aria-label][role~='tooltip']:focus::after { - opacity: 1; - pointer-events: auto; - display: block; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 6px; - width: 18px; - margin-bottom: 5px; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { - margin-bottom: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { - transform: translate3d(-50%, 0, 0); - bottom: 100%; - left: 50%; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']:hover::before { - transform: translate3d(-50%, -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { - transform: translate3d(-50%, 0, 0); - bottom: 100%; - left: 50%; } - .editor_controls [role~='tooltip'][data-microtip-position='top']:hover::after { - transform: translate3d(-50%, -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='top-left']::after { - transform: translate3d(calc(-100% + 16px), 0, 0); - bottom: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='top-left']:hover::after { - transform: translate3d(calc(-100% + 16px), -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='top-right']::after { - transform: translate3d(calc(0% + -16px), 0, 0); - bottom: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='top-right']:hover::after { - transform: translate3d(calc(0% + -16px), -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 6px; - width: 18px; - margin-top: 5px; - margin-bottom: 0; } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { - margin-top: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { - transform: translate3d(-50%, -10px, 0); - bottom: auto; - left: 10px; - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']:hover::before { - transform: translate3d(-50%, 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { - transform: translate3d(-50%, -10px, 0); - left: 10px; - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='bottom']:hover::after { - transform: translate3d(-50%, 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']::after { - transform: translate3d(calc(-100% + 16px), -10px, 0); - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']:hover::after { - transform: translate3d(calc(-100% + 16px), 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']::after { - transform: translate3d(calc(0% + -16px), -10px, 0); - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']:hover::after { - transform: translate3d(calc(0% + -16px), 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='left']::before, - .editor_controls [role~='tooltip'][data-microtip-position='left']::after { - bottom: auto; - left: auto; - right: 100%; - top: 50%; - transform: translate3d(10px, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='left']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 18px; - width: 6px; - margin-right: 5px; - margin-bottom: 0; } - .editor_controls [role~='tooltip'][data-microtip-position='left']::after { - margin-right: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::before, - .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::after { - transform: translate3d(0, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='right']::before, - .editor_controls [role~='tooltip'][data-microtip-position='right']::after { - bottom: auto; - left: 100%; - top: 50%; - transform: translate3d(-10px, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='right']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 18px; - width: 6px; - margin-bottom: 0; - margin-left: 5px; } - .editor_controls [role~='tooltip'][data-microtip-position='right']::after { - margin-left: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::before, - .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::after { - transform: translate3d(0, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-size='small']::after { - white-space: initial; - width: 80px; } - .editor_controls [role~='tooltip'][data-microtip-size='medium']::after { - white-space: initial; - width: 140px; } - .editor_controls [role~='tooltip'][data-microtip-size='large']::after { - white-space: initial; - width: 260px; } - .editor_controls__wrapper { - display: flex; - flex-grow: 1; } - .editor_controls a { - color: #0d76bf; - cursor: pointer; } - -.plotly_editor { - display: flex; - /* - We are defining the max height of the app so that the editor knows how big to be - currently the editor will take up whatever space it can if it is not constrained in its parent - */ - flex-grow: 1; - height: 100%; - max-height: 100%; - width: 100%; } - -.plotly_editor_plot { - max-width: 100%; - height: 100%; - max-height: 100%; - overflow: auto; - flex-grow: 1; } diff --git a/lib/react-chart-editor.ie.css b/lib/react-chart-editor.ie.css deleted file mode 100644 index a7ac7fc78..000000000 --- a/lib/react-chart-editor.ie.css +++ /dev/null @@ -1,2747 +0,0 @@ -/* - * Layout - */ -/* - * Typography - */ -/* - * SPACING - */ -/* - * BORDERS - */ -/* - * Typography - */ -/* - * Effects - */ -.\+flex { - display: flex; } - -.\+cursor-clickable { - cursor: pointer; } - -.\+hover-grey:hover { - color: var(--color-text-active); } - -@keyframes fade-in { - from { - opacity: 0; } - to { - opacity: 1; } } - -@keyframes fade-and-slide-in-from-bottom { - from { - opacity: 0; - transform: translateY(20px); } - to { - opacity: 1; - transform: none; } } - -@keyframes fsbr { - from { - opacity: 1; - transform: none; } - to { - opacity: 0; - transform: translateY(20px); } } - -@keyframes fade-out { - from { - opacity: 1; } - to { - opacity: 0; } } - -.animate--fade-in, .editor_controls .modal__backdrop { - opacity: 0; - animation: fade-in 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -.animate--fade-out, .editor_controls .modal--animate-out .modal__backdrop { - opacity: 1; - animation: fade-out 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -.animate--fade-and-slide-in-from-bottom, .editor_controls .modal__card { - opacity: 0; - transform: translateY(20px); - animation: fade-and-slide-in-from-bottom 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -.animate--fsbr, .editor_controls .modal--animate-out .modal__card { - opacity: 1; - transform: none; - animation: fsbr 0.1s forwards cubic-bezier(0.19, 1, 0.22, 1); } - -:root { - --env: $ENV; } - -:root { - --color-white: #ffffff; - --color-rhino-core: #2a3f5f; - --color-rhino-dark: #506784; - --color-rhino-medium-1: #a2b1c6; - --color-rhino-medium-2: #c8d4e3; - --color-rhino-light-1: #dfe8f3; - --color-rhino-light-2: #ebf0f8; - --color-rhino-light-3: #f3f6fa; - --color-rhino-light-4: #fafbfd; - --color-rhino-light-5: #f8f8f9; - --color-dodger: #119dff; - --color-dodger-shade: #0d76bf; - --color-dodger-shade-mid: #0d76bf; - --color-aqua: #09ffff; - --color-aqua-shade: #19d3f3; - --color-lavender: #e763fa; - --color-lavender-shade: #ab63fa; - --color-lavender-shade-mid: #934bde; - --color-cornflower: #636efa; - --color-emerald: #00cc96; - --color-sienna: #ef553b; - --color-accent: var(--color-dodger); - --color-accent-shade: var(--color-dodger-shade); - --color-accent-shade-mid: var(--color-dodger-shade-mid); - --color-brand: var(--color-dodger); - --color-hightlight-darker: var(--color-gray-blue-pale); - --color-text-base: var(--color-rhino-dark); - --color-text-light: var(--color-rhino-medium-1); - --color-text-dark: var(--color-rhino-core); - --color-text-headings: var(--color-text-dark); - --color-text-section-header: var(--color-text-dark); - --color-text-active: var(--color-rhino-core); - --color-text-placeholder: var(--color-rhino-medium-1); - --color-border-default: var(--color-rhino-medium-2); - --color-border-light: var(--color-rhino-light-1); - --color-border-dark: var(--color-rhino-medium-1); - --color-border-accent: var(--color-accent); - --color-border-accent-shade: var(--color-accent-shade); - --color-background: var(--color-rhino-light-2); - --color-background-base: var(--color-rhino-light-2); - --color-background-light: var(--color-rhino-light-3); - --color-background-medium: var(--color-rhino-light-1); - --color-background-dark: var(--color-rhino-medium-1); - --color-background-top: var(--color-white); - --color-background-inverse: var(--color-rhino-dark); - --color-background-inputs: var(--color-background-top); - --color-button-primary-base-fill: var(--color-accent); - --color-button-primary-base-border: var(--color-accent-shade); - --color-button-primary-base-text: var(--color-white); - --color-button-primary-hover-fill: var(--color-accent-shade-mid); - --color-button-primary-hover-border: var(--color-accent-shade); - --color-button-primary-hover-text: var(--color-white); - --color-button-primary-active-fill: var(--color-accent-shade); - --color-button-primary-active-border: var(--color-accent-shade); - --color-button-primary-active-text: var(--color-white); - --color-button-secondary-base-fill: transparent; - --color-button-secondary-base-border: var(--color-rhino-medium-2); - --color-button-secondary-base-text: var(--color-text-base); - --color-button-secondary-hover-fill: transparent; - --color-button-secondary-hover-border: var(--color-rhino-medium-1); - --color-button-secondary-hover-text: var(--color-text-dark); - --color-button-secondary-active-fill: transparent; - --color-button-secondary-active-border: var(--color-rhino-medium-1); - --color-button-secondary-active-text: var(--color-text-dark); - --color-button-tertiary-base-fill: transparent; - --color-button-tertiary-base-border: transparent; - --color-button-tertiary-base-text: var(--color-text-base); - --color-button-tertiary-hover-fill: transparent; - --color-button-tertiary-hover-border: transparent; - --color-button-tertiary-hover-text: var(--color-text-dark); - --color-button-tertiary-active-fill: transparent; - --color-button-tertiary-active-border: transparent; - --color-button-tertiary-active-text: var(--color-text-dark); - --color-button-default-base-fill: var(--color-background-light); - --color-button-default-base-border: var(--color-border-default); - --color-button-default-base-text: var(--color-text-base); - --color-button-default-hover-fill: var(--color-background-base); - --color-button-default-hover-border: var(--color-border-dark); - --color-button-default-hover-text: var(--color-text-dark); - --color-button-default-active-fill: var(--color-background-dark); - --color-button-default-active-border: var(--color-border-dark); - --color-button-default-active-text: var(--color-text-dark); - --color-button-upgrade-base-fill: var(--color-lavender-shade); - --color-button-upgrade-base-border: var(--color-lavender-shade-dark); - --color-button-upgrade-base-text: var(--color-white); - --color-button-upgrade-hover-fill: var(--color-lavender-shade-mid); - --color-button-upgrade-hover-border: var(--color-lavender-shade-dark); - --color-button-upgrade-hover-text: var(--color-white); - --color-button-upgrade-active-fill: var(--color-lavender-shade-dark); - --color-button-upgrade-active-border: var(--color-lavender-shade-dark); - --color-button-upgrade-active-text: var(--color-white); - --color-button-header-base-fill: transparent; - --color-button-header-base-border: var(--color-dodger); - --color-button-header-base-text: var(--color-dodger); - --color-button-header-hover-fill: transparent; - --color-button-header-hover-border: var(--color-dodger-shade-mid); - --color-button-header-hover-text: var(--color-dodger-shade); - --color-button-header-active-fill: transparent; - --color-button-header-active-border: var(--color-dodger-shade); - --color-button-header-active-text: var(--color-dodger-shade); - --spacing-base-unit: 24px; - --spacing-half-unit: 12px; - --spacing-quarter-unit: 6px; - --spacing-sixth-unit: 4px; - --spacing-eighth-unit: 3px; - --font-size-base: 13px; - --font-size-small: 12px; - --font-size-medium: 14px; - --font-size-large: 14px; - --font-size-heading-base: 24px; - --font-size-heading-small: 18px; - --font-size-heading-large: 28px; - --font-size-h5: 16px; - --font-weight-light: 400; - --font-weight-normal: 500; - --font-weight-semibold: 600; - --font-weight-bold: 700; - --font-leading-body: 1.6; - --font-leading-head: 1.2; - --font-letter-spacing-headings: 0.5px; - --font-family-body: "Open Sans", --apple-default, sans-serif; - --font-family-headings: "Dosis", "Arial", sans-serif; - --border-default: 1px solid var(--color-border-default); - --border-light: 1px solid var(--color-border-light); - --border-dark: 1px solid var(--color-border-dark); - --border-accent: 1px solid var(--color-border-accent); - --border-accent-shade: 1px solid var(--color-border-accent-shade); - --border-radius: 5px; - --border-radius-small: 3px; - --text-shadow-dark-color: rgba(42, 63, 95, 0.7); - --text-shadow-dark-ui: 0 1px 2px var(--text-shadow-dark-color); - --text-shadow-dark-ui-inactive: 0 1px 1px rgba(42, 63, 95, 0.4); - --box-shadow-base-color: rgba(80, 103, 132, 0.2); - --box-shadow-base: 0px 2px 9px var(--box-shadow-base-color); - --scrollbar-track-background: var(--color-background-base); - --scrollbar-thumb-color: var(--color-accent); - --panel-background: var(--color-background-base); - --panel-width: 335px; - --fold-header-text-color-base: var(--color-white); - --fold-header-text-color-closed: var(--color-white); - --fold-header-background-base: var(--color-rhino-dark); - --fold-header-background-closed: var(--color-rhino-core); - --fold-header-border-color-closed: var(--color-rhino-core); - --fold-header-border-color-base: var(--color-rhino-dark); - --sidebar-background: var(--color-background-top); - --sidebar-width: 100px; - --sidebar-group-background-base: var(--sidebar-background); - --sidebar-item-background-base: var(--color-background-light); - --sidebar-item-background-hover: var(--color-background-base); - --sidebar-item-background-active: var(--color-background-medium); - --editor-width: calc( - var(--sidebar-width) + var(--panel-width) + 1px - ); } - -.editor_controls { - position: relative; - width: var(--editor-width); - flex-shrink: 0; - overflow: hidden; - display: flex; - /* TODO: Don't inline Draft.css; load it with `systemjs`. */ - /** - * Draft v0.3.0 - * - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - /** -* Rangeslider -*/ - /** -* Rangeslider - Horizontal slider -*/ - /** -* Rangeslider - Vertical slider -*/ - /** -* Rangeslider - Reverse -*/ - /** -* Rangeslider - Labels -*/ - /* ------------------------------------------------------------------- - Microtip - - Modern, lightweight css-only tooltips - Just 1kb minified and gzipped - - @author Ghosh - @package Microtip - ----------------------------------------------------------------------- - 1. Base Styles - 2. Direction Modifiers - 3. Position Modifiers ---------------------------------------------------------------------*/ - /* ------------------------------------------------ - [1] Base Styles --------------------------------------------------*/ - /* ------------------------------------------------ - [2] Position Modifiers --------------------------------------------------*/ - /* ------------------------------------------------ - [2.1] Top Left --------------------------------------------------*/ - /* ------------------------------------------------ - [2.2] Top Right --------------------------------------------------*/ - /* ------------------------------------------------ - [2.3] Bottom --------------------------------------------------*/ - /* ------------------------------------------------ - [2.4] Bottom Left --------------------------------------------------*/ - /* ------------------------------------------------ - [2.5] Bottom Right --------------------------------------------------*/ - /* ------------------------------------------------ - [2.6] Left --------------------------------------------------*/ - /* ------------------------------------------------ - [2.7] Right --------------------------------------------------*/ - /* ------------------------------------------------ - [3] Size --------------------------------------------------*/ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-family: var(--font-family-body); } - .editor_controls .sidebar { - user-select: none; - height: 100%; - min-width: var(--sidebar-width); - width: var(--sidebar-width); - max-width: var(--sidebar-width); - text-align: center; - background: var(--sidebar-background); - overflow-y: auto; - overflow-x: hidden; - float: left; - border-right: var(--border-default); - flex-grow: 1; - -webkit-overflow-scrolling: touch; - -ms-overflow-style: none; } - .editor_controls .sidebar::-webkit-scrollbar { - background: white; - width: 0px; } - .editor_controls .sidebar::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .sidebar::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls .sidebar__group { - background-color: var(--sidebar-group-background-base); - cursor: pointer; - width: 100%; } - .editor_controls .sidebar__group__title { - color: var(--color-text-base); - font-size: var(--font-size-medium); - font-weight: var(--font-weight-normal); - padding: var(--spacing-half-unit) 0; - text-transform: capitalize; - text-align: left; - border-bottom: var(--border-light); - display: flex; - position: relative; } - .editor_controls .sidebar__group__title__label { - padding-left: var(--spacing-base-unit); } - .editor_controls .sidebar__group__title__icon { - position: absolute; - transform: scale(0.9) translateX(2px) translateY(-4px); - transform-origin: center center; - opacity: 0.5; - transition: all 0.15s ease-in-out; } - .editor_controls .sidebar__group__title__icon svg path { - fill: currentColor; } - .editor_controls .sidebar__group:hover .sidebar__group__title__icon { - opacity: 1; } - .editor_controls .sidebar__group--is-active { - color: var(--color-text-active); - cursor: default; } - .editor_controls .sidebar__group--is-active .sidebar__group__title__label { - font-weight: var(--font-weight-semibold); - color: var(--color-text-active); } - .editor_controls .sidebar__group--is-active .sidebar__group__title__icon { - opacity: 1; } - .editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path { - fill: var(--color-accent); } - .editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon { - transform: scale(0.9) translateY(-5px) rotate(90deg); - opacity: 1; } - .editor_controls .sidebar__group--is-expanded .sidebar__group__title { - position: relative; - z-index: 4; - box-shadow: var(--box-shadow-base); } - .editor_controls .sidebar__item { - color: var(--color-text-base); - cursor: pointer; - font-size: var(--font-size-medium); - font-weight: var(--font-weight-normal); - line-height: var(--font-size-medium); - text-transform: capitalize; - background-color: var(--sidebar-item-background-base); - padding: 10px; - padding-left: 18px; - padding-right: var(--spacing-quarter-unit); - text-align: left; - border-bottom: var(--border-light); - position: relative; - overflow: hidden; } - .editor_controls .sidebar__item--single { - margin-top: 15px; } - .editor_controls .sidebar__item--single:last-child { - margin-bottom: 15px; } - .editor_controls .sidebar__item::before { - content: ''; - position: absolute; - height: 100%; - top: 0; - left: 0; - width: 5px; - background-color: var(--color-accent); - transform: scaleX(0); - transform-origin: left center; - will-change: transform; - transition: all 0.15s ease-in-out; } - .editor_controls .sidebar__item span { - display: block; - will-change: transform; - transition: all 0.15s ease-in-out; } - .editor_controls .sidebar__item:not(.sidebar__item--is-active):hover { - background-color: var(--sidebar-item-background-hover); } - .editor_controls .sidebar__item--is-active { - color: var(--color-text-active); - font-weight: var(--font-weight-semibold); - cursor: default; } - .editor_controls .sidebar__item--is-active::before { - transform: none; } - .editor_controls .sidebar__item--is-active span { - transform: translateX(5px); } - .editor_controls .sidebar__logo { - height: 50px; - margin: 10px; } - .editor_controls .panel { - flex-grow: 1; - overflow-x: hidden; - overflow-y: auto; - padding: var(--spacing-half-unit); - box-sizing: border-box; - position: relative; - display: flex; - flex-direction: column; - width: 100%; - -webkit-overflow-scrolling: touch; } - .editor_controls .panel::-webkit-scrollbar { - background: white; - width: 5px; } - .editor_controls .panel::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .panel::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls__wrapper > .panel { - background-color: var(--panel-background); - border-right: var(--border-default); - width: calc(var(--panel-width)); } - .editor_controls .panel__content { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .panel__header { - margin-bottom: var(--spacing-half-unit); - display: flex; - flex-shrink: 0; } - .editor_controls .panel__header__content { - flex-grow: 1; } - .editor_controls .panel__header__actions__container { - width: 100%; } - .editor_controls .panel__header__collapse { - font-size: var(--font-size-medium); - float: left; - color: var(--color-text-base); - display: flex; - align-items: center; - height: 100%; - cursor: pointer; } - .editor_controls .panel__header__collapse svg { - width: 16px !important; - height: 16px !important; - fill: var(--color-text-light); - padding-right: 3px; } - .editor_controls .panel__header__action { - float: right; } - .editor_controls .panel__empty { - position: absolute; - top: 0; - right: 0; - width: var(--panel-width); - border-right: var(--border-default); - height: 100%; - padding: var(--spacing-half-unit); - background-color: var(--panel-background); - box-sizing: border-box; - z-index: 1003; - display: flex; } - .editor_controls .panel__empty__message { - text-align: center; } - .editor_controls .panel__empty__message__icon { - padding-top: calc(var(--spacing-base-unit) * 2); - margin-bottom: var(--spacing-half-unit); - opacity: 0.5; } - .editor_controls .panel__empty__message__icon svg { - width: 48px !important; - height: 48px !important; } - .editor_controls .panel__empty__message__icon svg path { - fill: var(--color-text-light); } - .editor_controls .panel__empty__message__heading { - color: var(--color-text-headings); - font-size: var(--font-size-heading-base); - font-weight: var(--font-weight-normal); - line-height: var(--font-leading-head); - font-family: var(--font-family-headings); - letter-spacing: var(--font-letter-spacing-headings); } - .editor_controls .panel__empty__message__content { - font-size: var(--font-size-base); - color: var(--color-text-base); - line-height: var(--font-leading-body); } - .editor_controls .panel--no-padding { - padding: 0; } - .editor_controls .fold .panel { - overflow-x: visible; - overflow-y: visible; } - .editor_controls .fold { - width: 100%; - user-select: none; } - .editor_controls .fold__top { - display: flex; - justify-content: space-between; - clear: both; - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - color: var(--fold-header-text-color-closed); - font-size: var(--font-size-base); - border: 1px solid var(--fold-header-border-color-closed); - background-color: var(--fold-header-background-closed); - height: 15px; - border-radius: var(--border-radius); - text-shadow: var(--text-shadow-dark-ui); - transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border 0.1s ease-in-out; - box-sizing: content-box; } - .editor_controls .fold__top:hover { - cursor: pointer; - background-color: var(--fold-header-background-closed); } - .editor_controls .fold__top svg { - width: 18px; - height: 18px; - display: block; - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .fold__top svg path { - fill: currentColor; } - .editor_controls .fold__top--open { - color: var(--fold-header-text-color-base); - background-color: var(--fold-header-background-base); - border: 1px solid var(--fold-header-border-color-base); - border-radius: var(--border-radius) var(--border-radius) 0 0; - text-shadow: var(--text-shadow-dark-ui-inactive); } - .editor_controls .fold__top--open svg { - filter: drop-shadow(0 1px 1px rgba(42, 63, 95, 0.4)); } - .editor_controls .fold__top--open:hover { - background-color: var(--fold-header-background-base); } - .editor_controls .fold__top__icon { - display: block; - margin-right: var(--spacing-quarter-unit); - transform: translateY(-1px); } - .editor_controls .fold__top__title { - margin-left: var(--spacing-half-unit)/3; - font-size: var(--font-size-medium); - line-height: var(--font-size-medium); - font-weight: var(--font-weight-semibold); - transform: translateY(1px); - white-space: nowrap; - max-width: 230px; - letter-spacing: 0.2px; - text-overflow: ellipsis; - overflow: hidden; } - .editor_controls .fold__top__arrow { - transform: translateX(-3px) translateY(-1px); } - .editor_controls .fold__top__arrow svg { - will-change: transform; - transition: transform 0.1s ease-in-out; - transform: rotate(-90deg); - font-weight: bold; - transform-origin: center center; } - .editor_controls .fold__top__arrow-title { - display: flex; - flex-grow: 1; } - .editor_controls .fold__top__arrow--open svg { - transform: rotate(0deg); } - .editor_controls .fold__top__delete { - font-size: 18px; - opacity: 0.75; - transform: translateY(-2px); } - .editor_controls .fold__top__delete:hover { - opacity: 1; } - .editor_controls .fold__content { - background: var(--color-background-top); - border: var(--border-default); - border-width: 0 1px 1px 1px; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; } - .editor_controls .fold__content__plot { - overflow: hidden; - border-bottom-left-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius); } - .editor_controls .fold__content > *:first-child { - border-top: 0; } - .editor_controls .fold__content__empty { - font-family: var(--font-family-headings); - display: flex; - flex-direction: column; - justify-content: center; - padding: 30px 25px; } - .editor_controls .fold__content__empty__icon { - margin: 0 auto; - margin-bottom: 15px; - width: 40px; - height: 40px; - border-radius: 50%; - background-color: var(--color-dodger); - display: flex; - flex-direction: column; - justify-content: center; } - .editor_controls .fold__content__empty__icon svg { - margin: 0 auto !important; - fill: white; - width: 23px; - height: 23px; } - .editor_controls .fold__content__empty__message__primary { - text-align: center; - margin-bottom: 20px; - font-size: 17px; - color: var(--color-text-base); } - .editor_controls .fold__content__empty__message__secondary { - font-family: var(--font-family-body); - font-size: var(--font-size-small); - text-align: center; - color: var(--color-text-base); } - .editor_controls .fold__content--noheader { - border-width: 1px 1px 1px 1px; } - .editor_controls .fold { - margin-bottom: var(--spacing-half-unit); } - .editor_controls .fold .fold:last-child { - margin-bottom: 0; } - .editor_controls .section__heading { - position: relative; - display: flex; - font-size: var(--font-size-base); - color: var(--color-text-section-header); - font-weight: var(--font-weight-semibold); - cursor: default; - background-color: var(--color-background-light); - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - clear: both; - text-transform: capitalize; } - .editor_controls .section:not(:first-child) .section__heading { - border-top: var(--border-light); } - .editor_controls .section:first-child .section__heading { - border-top: 0; } - .editor_controls .menupanel { - padding-top: 0; - display: flex; - justify-content: flex-end; - flex-grow: 1; } - .editor_controls .menupanel--ownline { - padding-top: var(--spacing-quarter-unit); - width: 100%; } - .editor_controls .menupanel__label { - font-weight: var(--font-weight-semibold); - padding-right: var(--spacing-quarter-unit); } - .editor_controls .menupanel__icon { - vertical-align: middle; - width: 15px !important; - height: 15px !important; - fill: var(--color-text-light) !important; - padding-left: var(--spacing-quarter-unit); } - .editor_controls .menupanel__icon svg { - display: block; } - .editor_controls .menupanel__icon:hover { - cursor: pointer; - fill: var(--color-accent) !important; } - .editor_controls .menupanel__icon-span { - font-size: var(--font-size-small); - display: flex; } - .editor_controls .menupanel__icon-span--question { - color: var(--color-text-base); } - .editor_controls .info__title { - color: var(--color-text-headings); - font-size: var(--font-size-heading-small); - font-weight: var(--font-weight-normal); - line-height: var(--font-leading-head); - font-family: var(--font-family-headings); - letter-spacing: var(--font-letter-spacing-headings); - padding: var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); } - .editor_controls .info__text { - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - color: var(--color-text-base); - font-size: var(--font-size-small); - font-weight: var(--font-weight-normal); - line-height: var(--font-leading-body); } - .editor_controls .info__sub-text { - color: var(--color-text-base); - font-size: var(--font-size-small); - font-weight: var(--font-weight-normal); - font-style: italic; - line-height: var(--font-leading-body); - padding: var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-half-unit); } - .editor_controls .modalbox { - position: absolute; - border-radius: var(--border-radius); - overflow: hidden; - text-transform: none; - text-align: left; - border: var(--border-default); - align-content: center; - box-shadow: var(--box-shadow-base); - left: calc(var(--spacing-quarter-unit) * -1); - width: calc(100% + var(--spacing-half-unit)); - top: calc(100% + var(--spacing-quarter-unit)); - background-color: var(--color-background-top); - z-index: 9; } - .editor_controls .modalbox__cover { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: -1; } - .editor_controls .modalbox--dark { - background-color: var(--color-background-inverse); } - .editor_controls .modalbox--relative { - position: relative; } - .editor_controls .field .modalbox { - width: 100%; - left: -1px; - top: 100%; } - .editor_controls .modal { - box-sizing: border-box; - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - display: flex; - align-items: flex-start; - overflow-y: auto; - justify-content: center; - z-index: 1003; } - .editor_controls .modal * { - box-sizing: border-box; } - .editor_controls .modal__backdrop { - height: 100%; - width: 100%; - left: 0; - top: 0; - position: fixed; - opacity: 0; - will-change: opacity; } - .editor_controls .modal__backdrop::before { - content: ''; - height: 100%; - width: 100%; - left: 0; - opacity: 0.5; - top: 0; - background: var(--color-background-dark); - position: fixed; } - .editor_controls .modal__card { - background: var(--color-background-top); - border-radius: var(--border-radius); - position: relative; - z-index: 1003; - max-width: calc(100% - var(--spacing-base-unit)); - box-shadow: var(--box-shadow-base); - display: flex; - flex-direction: column; - will-change: opacity, transform; - flex-grow: 0; - margin: 5vh 10vw; } - .editor_controls .modal__header { - display: flex; - justify-content: space-between; - align-items: center; - color: var(--color-text-base); - padding: var(--spacing-half-unit); - font-weight: var(--font-weight-semibold); } - .editor_controls .modal__header__close { - opacity: 0.5; } - .editor_controls .modal__header__close:hover { - cursor: pointer; - opacity: 1; } - .editor_controls .modal__header__close svg { - display: block; } - .editor_controls .modal__header__close svg * { - fill: currentColor; } - .editor_controls .modal__content { - flex-grow: 1; - background-color: var(--color-background-light); - border-bottom-left-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius); } - .editor_controls .modal__backdrop { - animation-duration: 1s; - animation-delay: 0s; } - .editor_controls .modal__card { - animation-duration: 0.85s; - animation-delay: 0.1s; } - .editor_controls .modal--animate-out { - pointer-events: none; } - .editor_controls .modal--animate-out .modal__backdrop { - animation-duration: 0.85s; - animation-delay: 0s; } - .editor_controls .modal--animate-out .modal__card { - animation-duration: 0.85s; - animation-delay: 0s; } - .editor_controls .panel .react-tabs { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .panel .react-tabs__tab { - flex-grow: 1; - flex-shrink: 0; - display: flex; - align-items: center; - justify-content: center; - padding: var(--spacing-quarter-unit); - color: var(--color-text-base); - font-size: var(--font-size-base); - background: var(--color-background-medium); - border: var(--border-default); - border-bottom: 0; - position: relative; - background: var(--color-background-light); - transition: border-color 0.15s ease-in-out; } - .editor_controls .panel .react-tabs__tab-list { - background: var(--color-background-medium); - margin: 0; - flex-shrink: 0; - list-style: none; - display: flex; - align-items: flex-end; - padding-top: var(--spacing-half-unit); - padding-left: var(--spacing-half-unit); - padding-right: var(--spacing-half-unit); - padding-bottom: 0; - height: 32px; } - .editor_controls .panel .react-tabs__tab:first-of-type { - border-top-left-radius: var(--border-radius); } - .editor_controls .panel .react-tabs__tab:last-of-type { - border-top-right-radius: var(--border-radius); } - .editor_controls .panel .react-tabs__tab:hover { - background-color: var(--color-background-base); - cursor: pointer; } - .editor_controls .panel .react-tabs__tab--selected { - background-color: var(--color-background-base); - pointer-events: none; - margin-top: 0; - color: var(--color-text-active); - border-top-color: var(--color-accent); - border-top-width: 2px; } - .editor_controls .panel .react-tabs__tab--selected::before { - position: absolute; - top: 100%; - width: 100%; - height: 1px; - content: ''; - background-color: var(--color-background-base); - left: 0; - z-index: 4; } - .editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type) { - border-left: 0; } - .editor_controls .panel .react-tabs__tab:last-of-type { - border-left: none; } - .editor_controls .panel .react-tabs__tab-panel { - border-top: var(--border-default); - display: none; } - .editor_controls .panel .react-tabs__tab-panel--selected { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .field { - align-items: flex-start; - border-top: var(--border-light); - color: var(--color-text-base); - display: flex; - font-size: var(--font-size-base); - font-weight: var(--font-weight-normal); - justify-content: flex-start; - line-height: var(--font-size-base); - min-height: 32px; - padding: var(--spacing-quarter-unit) 0; - width: 100%; - position: relative; } - .editor_controls .field__no-title { - width: 100%; - padding: 0 var(--spacing-half-unit); - align-self: center; - line-height: var(--font-leading-body); } - .editor_controls .field__no-title--center { - text-align: center; } - .editor_controls .field__widget { - display: flex; - flex-wrap: wrap; - flex-basis: 0; - padding-right: var(--spacing-half-unit); - padding-left: var(--spacing-half-unit); - align-self: center; } - .editor_controls .field__widget:not(.field__widget--units) { - flex-grow: 1; } - .editor_controls .field__widget--units { - padding-right: 0; } - .editor_controls .field__units { - align-self: center; } - .editor_controls .field__title { - width: 80px; - padding-left: var(--spacing-half-unit); - display: block; - font-size: var(--font-size-small); - line-height: var(--font-leading-body); - color: var(--color-text-base); - padding-top: var(--spacing-quarter-unit); - user-select: none; } - .editor_controls .field__title-text { - text-transform: capitalize; - cursor: default; } - .editor_controls .field__delete { - display: flex; - align-items: center; - justify-content: center; - padding-left: var(--spacing-quarter-unit); - opacity: 0.5; } - .editor_controls .field__delete svg { - display: block; } - .editor_controls .field__delete svg path { - fill: var(--color-text-base); } - .editor_controls .field__delete:hover { - cursor: pointer; - opacity: 1; } - .editor_controls .field__delete:hover svg path { - fill: var(--color-sienna); } - .editor_controls .field .rect, - .editor_controls .field .square { - border-color: var(--color-accent); } - .editor_controls .field .rect-grid { - border-color: var(--panel-background) !important; - float: left; - border-top: 1px solid; - border-left: 1px solid; } - .editor_controls .field .rect-container { - margin: 0 auto; - position: relative; - max-width: 294px; } - @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { - .editor_controls .field__widget { - flex-basis: auto; } } - .editor_controls .field .field { - border-top: none; } - .editor_controls .field .field .field__no-title { - padding: 0; } - .editor_controls .symbol-selector__toggle { - border: var(--border-default); - border-radius: var(--border-radius); - width: 80px; - cursor: pointer; - padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px var(--spacing-quarter-unit); } - .editor_controls .symbol-selector__toggle:before, .editor_controls .symbol-selector__toggle:after { - content: ' '; - display: table; } - .editor_controls .symbol-selector__toggle:after { - clear: both; } - .editor_controls .symbol-selector__toggle--dark { - background-color: var(--color-background-inverse); } - .editor_controls .symbol-selector__toggle__option { - float: left; } - .editor_controls .symbol-selector__toggle__caret { - float: right; - fill: var(--color-text-light); - padding-top: var(--spacing-eighth-unit); - width: 13px !important; - height: 13px !important; } - .editor_controls .symbol-selector__menu { - max-width: 225px; - position: absolute; - z-index: 1003; - border: var(--border-default); - padding: var(--spacing-half-unit); - box-shadow: 2px 2px var(--spacing-half-unit) var(--color-border-light); - border-radius: var(--border-radius-small); - left: var(--spacing-base-unit); } - .editor_controls .symbol-selector__item { - display: inline; } - .editor_controls .symbol-selector__symbol:hover { - background-color: var(--color-border-default); } - .editor_controls button { - display: inline-block; - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - line-height: 1; - letter-spacing: 0.5px; - text-transform: capitalize; - text-align: center; - cursor: pointer; - height: 36px; - outline: none; - user-select: none; - font-size: var(--font-size-medium); - font-weight: var(--font-weight-semibold); - font-family: var(--font-family-body); - border-width: 1px; - border-style: solid; - border-color: transparent; - border-radius: var(--border-radius); - transition: all 0.15s ease-in-out; } - .editor_controls button.button { - padding-left: 0; } - .editor_controls .button__wrapper { - display: flex; - align-items: center; - justify-content: center; - position: relative; - overflow: hidden; } - .editor_controls .button__label { - padding-left: var(--spacing-half-unit); } - .editor_controls .button__icon { - display: flex; - padding-left: var(--spacing-quarter-unit); - will-change: transform; } - .editor_controls .button__icon svg { - transform: scale(0.8); - transform-origin: center center; - display: block; } - .editor_controls .button__icon svg path { - fill: currentColor; } - .editor_controls .button__icon + .button__label { - padding-left: 0; } - .sidebar .button { - width: calc(100% - var(--spacing-base-unit)); - margin-left: var(--spacing-half-unit); - margin-right: var(--spacing-half-unit); } - .editor_controls .button--no-text { - background-color: var(--color-button-default-base-fill); - border-color: var(--color-button-default-base-border); - color: var(--color-button-default-base-text); - padding-right: var(--spacing-quarter-unit); - margin-left: 5px; } - .editor_controls .button--no-text:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-default-hover-fill); - border: 1px solid var(--color-button-default-hover-border); - color: var(--color-button-default-hover-text); } - .editor_controls .button--no-text:active:not(.button--no-text--disabled) { - background-color: var(--color-button-default-active-fill); - border: 1px solid var(--color-button-default-active-border); - color: var(--color-button-default-active-text); } - .editor_controls .button--no-text--disabled { - background-color: var(--color-button-default-base-fill); - border-color: var(--color-button-default-base-border); - color: var(--color-button-default-base-text); - padding-right: var(--spacing-quarter-unit); - margin-left: 5px; - color: #bababa; - cursor: default; } - .editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-default-hover-fill); - border: 1px solid var(--color-button-default-hover-border); - color: var(--color-button-default-hover-text); } - .editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled) { - background-color: var(--color-button-default-active-fill); - border: 1px solid var(--color-button-default-active-border); - color: var(--color-button-default-active-text); } - .editor_controls .button--default { - background-color: var(--color-button-default-base-fill); - border-color: var(--color-button-default-base-border); - color: var(--color-button-default-base-text); } - .editor_controls .button--default:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-default-hover-fill); - border: 1px solid var(--color-button-default-hover-border); - color: var(--color-button-default-hover-text); } - .editor_controls .button--default:active:not(.button--no-text--disabled) { - background-color: var(--color-button-default-active-fill); - border: 1px solid var(--color-button-default-active-border); - color: var(--color-button-default-active-text); } - .editor_controls .button--primary { - background-color: var(--color-button-primary-base-fill); - border-color: var(--color-button-primary-base-border); - color: var(--color-button-primary-base-text); - text-shadow: var(--text-shadow-dark-ui); } - .editor_controls .button--primary svg { - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .button--primary:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-primary-hover-fill); - border: 1px solid var(--color-button-primary-hover-border); - color: var(--color-button-primary-hover-text); } - .editor_controls .button--primary:active:not(.button--no-text--disabled) { - background-color: var(--color-button-primary-active-fill); - border: 1px solid var(--color-button-primary-active-border); - color: var(--color-button-primary-active-text); } - .editor_controls .button--secondary { - background-color: var(--color-button-secondary-base-fill); - border-color: var(--color-button-secondary-base-border); - color: var(--color-button-secondary-base-text); } - .editor_controls .button--secondary:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-secondary-hover-fill); - border: 1px solid var(--color-button-secondary-hover-border); - color: var(--color-button-secondary-hover-text); } - .editor_controls .button--secondary:active:not(.button--no-text--disabled) { - background-color: var(--color-button-secondary-active-fill); - border: 1px solid var(--color-button-secondary-active-border); - color: var(--color-button-secondary-active-text); } - .editor_controls .button--tertiary { - background-color: var(--color-button-tertiary-base-fill); - border-color: var(--color-button-tertiary-base-border); - color: var(--color-button-tertiary-base-text); } - .editor_controls .button--tertiary:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-tertiary-hover-fill); - border: 1px solid var(--color-button-tertiary-hover-border); - color: var(--color-button-tertiary-hover-text); } - .editor_controls .button--tertiary:active:not(.button--no-text--disabled) { - background-color: var(--color-button-tertiary-active-fill); - border: 1px solid var(--color-button-tertiary-active-border); - color: var(--color-button-tertiary-active-text); } - .editor_controls .button--upgrade { - background-color: var(--color-button-upgrade-base-fill); - border-color: var(--color-button-upgrade-base-border); - color: var(--color-button-upgrade-base-text); - text-shadow: var(--text-shadow-dark-ui); } - .editor_controls .button--upgrade svg { - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .button--upgrade:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-upgrade-hover-fill); - border: 1px solid var(--color-button-upgrade-hover-border); - color: var(--color-button-upgrade-hover-text); } - .editor_controls .button--upgrade:active:not(.button--no-text--disabled) { - background-color: var(--color-button-upgrade-active-fill); - border: 1px solid var(--color-button-upgrade-active-border); - color: var(--color-button-upgrade-active-text); } - .editor_controls .button--header { - background-color: var(--color-button-header-base-fill); - border-color: var(--color-button-header-base-border); - color: var(--color-button-header-base-text); } - .editor_controls .button--header:hover:not(.button--no-text--disabled) { - background-color: var(--color-button-header-hover-fill); - border: 1px solid var(--color-button-header-hover-border); - color: var(--color-button-header-hover-text); } - .editor_controls .button--header:active:not(.button--no-text--disabled) { - background-color: var(--color-button-header-active-fill); - border: 1px solid var(--color-button-header-active-border); - color: var(--color-button-header-active-text); } - .editor_controls .checkbox__group { - padding-left: var(--spacing-half-unit); - text-align: left; } - .editor_controls .checkbox__item { - user-select: none; - cursor: default; - padding-top: var(--spacing-eighth-unit); - padding-bottom: var(--spacing-eighth-unit); } - .editor_controls .checkbox__item--vertical { - display: block; - clear: both; } - .editor_controls .checkbox__box { - height: 18px; - width: 18px; - border: var(--border-default); - border-radius: var(--border-radius-small); - cursor: pointer; - display: inline-block; - vertical-align: middle; - text-align: center; - position: relative; } - .editor_controls .checkbox__box:hover { - background: var(--color-background-light); } - .editor_controls .checkbox__box--checked { - border: var(--border-accent-shade); - background: var(--color-accent); } - .editor_controls .checkbox__box--checked:hover { - background: var(--color-accent-shade); } - .editor_controls .checkbox__box--checked + .checkbox__label { - color: var(--color-text-active); } - .editor_controls .checkbox__check { - color: var(--color-text-base); - font-size: var(--spacing-half-unit); - position: absolute; - height: 100%; - width: 100%; - left: 0; - top: 0; - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .checkbox__check svg { - filter: drop-shadow(0 1px 2px rgba(42, 63, 95, 0.7)); } - .editor_controls .checkbox__check svg path { - fill: var(--color-white); } - .editor_controls .checkbox__label { - padding-left: var(--spacing-quarter-unit); - font-size: var(--font-size-base); - color: var(--color-text-base); - display: inline-block; - line-height: 20px; - text-align: left; - vertical-align: middle; - cursor: pointer; } - .editor_controls .colorpicker__saturation, .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider, .editor_controls .colorpicker__controls .colorpicker__active { - position: relative; - overflow: hidden; - border: var(--border-default); - border-radius: var(--border-radius-small); - cursor: pointer; } - .editor_controls .colorpicker { - display: flex; - width: 26px; - height: 26px; - border-radius: 100%; - border: var(--border-default); - padding: var(--spacing-eighth-unit); - /* Saturation wrapper style */ - /* Wrapper style for Hue and Alpha sliders and swatch */ } - .editor_controls .colorpicker__outer { - width: 185px; } - .editor_controls .colorpicker__container { - display: flex; - align-items: center; - line-height: 2; - position: relative; - width: 185px; } - .editor_controls .colorpicker__selected-color { - margin-left: var(--spacing-half-unit); - color: var(--color-text-base); - font-weight: var(--font-weight-semibold); - font-size: var(--font-size-small); - display: inline-block; - vertical-align: middle; - text-transform: uppercase; } - .editor_controls .colorpicker__swatch { - border-radius: 50%; - flex-grow: 1; - width: 100%; - height: 100%; } - .editor_controls .colorpicker__saturation { - height: 100px; } - .editor_controls .colorpicker__custom-input { - padding-top: var(--spacing-eighth-unit); } - .editor_controls .colorpicker__custom-input input { - border: var(--border-default) !important; - box-shadow: none !important; - background-color: var(--color-background-inputs); - color: var(--color-text-dark); } - .editor_controls .colorpicker__custom-input input + span { - color: var(--color-text) !important; } - .editor_controls .colorpicker__controls .colorpicker__sliders { - width: 100%; } - .editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider { - margin: auto 0; - height: 10px; - margin: var(--spacing-eighth-unit) 0; } - .editor_controls .colorpicker__controls .colorpicker__active { - height: var(--spacing-base-unit); - width: var(--spacing-base-unit); - margin: var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit); } - .editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - border-radius: var(--border-radius-small); - border: 1px solid #eee; } - .editor_controls .fold .fold .colorpicker__container { - width: calc( $colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit)); } - .editor_controls .colorscalePickerContainer { - min-width: 215px; - position: relative; - padding: 0; - resize: none; - border: none; - background: none; } - .editor_controls .colorscalePickerContainer::-webkit-scrollbar { - width: 5px; } - .editor_controls .colorscalePickerTopContainer { - display: none; } - .editor_controls .colorscaleDescription { - display: none; } - .editor_controls .colorscalePickerContainer input:focus { - outline: none; } - @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { - .editor_controls .colorscalePickerContainer { - display: inline; } } - .editor_controls .colorscalePickerBottomContainer { - padding-right: 3px; } - .editor_controls .customPickerContainer { - margin-top: var(--spacing-quarter-unit); - text-align: left; } - .editor_controls .customPickerContainer__outer { - width: 215px; - text-align: center; } - .editor_controls .dropdown-container { - /** - * React Select - * ============ - * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/ - * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs - * MIT License: https://github.com/JedWatson/react-select -*/ - flex-grow: 1; } - -@keyframes Select-animation-spin { - to { - transform: rotate(1turn); } } - -@-webkit-keyframes Select-animation-spin { - to { - -webkit-transform: rotate(1turn); } } - .editor_controls .dropdown-container .Select { - position: relative; } - .editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button, - .editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button { - display: none !important; } - .editor_controls .dropdown-container .Select input::-ms-clear { - display: none !important; } - .editor_controls .dropdown-container .Select input::-ms-reveal { - display: none !important; } - .editor_controls .dropdown-container .Select, - .editor_controls .dropdown-container .Select div, - .editor_controls .dropdown-container .Select input, - .editor_controls .dropdown-container .Select span { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone { - cursor: default; - pointer-events: none; } - .editor_controls .dropdown-container .Select.is-disabled > .Select-control { - background-color: #f9f9f9; } - .editor_controls .dropdown-container .Select.is-disabled > .Select-control:hover { - box-shadow: none; } - .editor_controls .dropdown-container .Select.is-searchable.is-open > .Select-control { - cursor: text; } - .editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open) > .Select-control { - cursor: text; } - .editor_controls .dropdown-container .Select.is-open > .Select-control { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - background: #fff; - border-color: #b3b3b3 #ccc #d9d9d9; } - .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-arrow { - top: -2px; - border-color: transparent transparent #999; - border-width: 0 5px 5px; } - .editor_controls .dropdown-container .Select.is-focused > .Select-control { - background: #fff; } - .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { - border-color: #08c #0099e6 #0099e6; - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 5px -1px fade(#08c, 50%); } - .editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single > .Select-control .Select-value { - padding-right: 42px; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { - color: #333; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label { - cursor: pointer; - text-decoration: none; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:hover, .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:hover, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { - color: #08c; - outline: none; - text-decoration: underline; } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus { - background: #fff; } - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input { - opacity: 0; } - .editor_controls .dropdown-container .Select.is-open .Select-arrow, - .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { - border-top-color: #666; } - .editor_controls .dropdown-container .Select.Select--rtl { - direction: rtl; - text-align: right; } - .editor_controls .dropdown-container .Select-control { - background-color: #fff; - border-color: #d9d9d9 #ccc #b3b3b3; - border-radius: 4px; - border: 1px solid #ccc; - color: #333; - cursor: default; - display: table; - border-spacing: 0; - border-collapse: separate; - height: 36px; - outline: none; - overflow: hidden; - position: relative; - width: 100%; } - .editor_controls .dropdown-container .Select-control:hover { - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); } - .editor_controls .dropdown-container .Select-control .Select-input:focus { - outline: none; - background: #fff; } - .editor_controls .dropdown-container .Select-placeholder, - .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { - bottom: 0; - color: #aaa; - left: 0; - line-height: 34px; - padding-left: 10px; - padding-right: 10px; - position: absolute; - right: 0; - top: 0; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } - .editor_controls .dropdown-container .Select-input { - height: 34px; - padding-left: 10px; - padding-right: 10px; - vertical-align: middle; } - .editor_controls .dropdown-container .Select-input > input { - width: 100%; - background: none transparent; - border: 0 none; - box-shadow: none; - cursor: default; - display: inline-block; - font-family: inherit; - font-size: inherit; - margin: 0; - outline: none; - line-height: 17px; - /* For IE 8 compatibility */ - padding: 8px 0 12px; - /* For IE 8 compatibility */ - -webkit-appearance: none; } - .is-focused .editor_controls .dropdown-container .Select-input > input { - cursor: text; } - .editor_controls .dropdown-container .Select-control:not(.is-searchable) > .Select-input { - outline: none; } - .editor_controls .dropdown-container .Select-loading-zone { - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 16px; } - .editor_controls .dropdown-container .Select-loading { - -webkit-animation: Select-animation-spin 400ms infinite linear; - -o-animation: Select-animation-spin 400ms infinite linear; - animation: Select-animation-spin 400ms infinite linear; - width: 16px; - height: 16px; - box-sizing: border-box; - border-radius: 50%; - border: 2px solid #ccc; - border-right-color: #333; - display: inline-block; - position: relative; - vertical-align: middle; } - .editor_controls .dropdown-container .Select-clear-zone { - -webkit-animation: Select-animation-fadeIn 200ms; - -o-animation: Select-animation-fadeIn 200ms; - animation: Select-animation-fadeIn 200ms; - color: #999; - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 17px; } - .editor_controls .dropdown-container .Select-clear-zone:hover { - color: #D0021B; } - .editor_controls .dropdown-container .Select-clear { - display: inline-block; - font-size: 18px; - line-height: 1; } - .editor_controls .dropdown-container .Select--multi .Select-clear-zone { - width: 17px; } - .editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper { - display: inline-block; } - .editor_controls .dropdown-container .Select .Select-aria-only { - position: absolute; - display: inline-block; - height: 1px; - width: 1px; - margin: -1px; - clip: rect(0, 0, 0, 0); - overflow: hidden; - float: left; } - .editor_controls .dropdown-container .Select-arrow-zone { - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 25px; - padding-right: 5px; } - .Select--rtl .editor_controls .dropdown-container .Select-arrow-zone { - padding-right: 0; - padding-left: 5px; } - .editor_controls .dropdown-container .Select-arrow { - border-color: #999 transparent transparent; - border-style: solid; - border-width: 5px 5px 2.5px; - display: inline-block; - height: 0; - width: 0; - position: relative; } - -@-webkit-keyframes Select-animation-fadeIn { - from { - opacity: 0; } - to { - opacity: 1; } } - -@keyframes Select-animation-fadeIn { - from { - opacity: 0; } - to { - opacity: 1; } } - .editor_controls .dropdown-container .Select-menu-outer { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - background-color: #fff; - border: 1px solid #ccc; - border-top-color: #e6e6e6; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); - box-sizing: border-box; - margin-top: -1px; - max-height: 200px; - position: absolute; - left: 0; - top: 100%; - width: 100%; - z-index: 1000; - -webkit-overflow-scrolling: touch; } - .editor_controls .dropdown-container .Select-menu { - max-height: 198px; - overflow-y: auto; } - .editor_controls .dropdown-container .Select-option { - box-sizing: border-box; - background-color: #fff; - color: #666666; - cursor: pointer; - display: block; - padding: 8px 10px; } - .editor_controls .dropdown-container .Select-option:last-child { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; } - .editor_controls .dropdown-container .Select-option.is-selected { - background-color: #f5faff; - color: #333; } - .editor_controls .dropdown-container .Select-option.is-focused { - background-color: #f2f9fc; - color: #333; } - .editor_controls .dropdown-container .Select-option.is-disabled { - color: #cccccc; - cursor: default; } - .editor_controls .dropdown-container .Select-noresults { - box-sizing: border-box; - color: #999999; - cursor: default; - display: block; - padding: 8px 10px; } - .editor_controls .dropdown-container .Select--multi .Select-input { - vertical-align: middle; - margin-left: 10px; - padding: 0; } - .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input { - margin-left: 0; - margin-right: 10px; } - .editor_controls .dropdown-container .Select--multi.has-value .Select-input { - margin-left: 5px; } - .editor_controls .dropdown-container .Select--multi .Select-value { - background-color: #f2f9fc; - border-radius: 2px; - border: 1px solid #c9e6f2; - color: #08c; - display: inline-block; - font-size: 0.9em; - margin-left: 5px; - margin-top: 5px; - vertical-align: top; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon, - .editor_controls .dropdown-container .Select--multi .Select-value-label { - display: inline-block; - vertical-align: middle; } - .editor_controls .dropdown-container .Select--multi .Select-value-label { - border-bottom-right-radius: 2px; - border-top-right-radius: 2px; - cursor: default; - padding: 2px 5px; } - .editor_controls .dropdown-container .Select--multi a.Select-value-label { - color: #08c; - cursor: pointer; - text-decoration: none; } - .editor_controls .dropdown-container .Select--multi a.Select-value-label:hover { - text-decoration: underline; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon { - cursor: pointer; - border-bottom-left-radius: 2px; - border-top-left-radius: 2px; - border-right: 1px solid #c9e6f2; - padding: 1px 5px 3px; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi .Select-value-icon:focus { - background-color: #ddeff7; - color: #0077b3; } - .editor_controls .dropdown-container .Select--multi .Select-value-icon:active { - background-color: #c9e6f2; } - .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value { - margin-left: 0; - margin-right: 5px; } - .editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon { - border-right: none; - border-left: 1px solid #c9e6f2; } - .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value { - background-color: #fcfcfc; - border: 1px solid #e3e3e3; - color: #333; } - .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon { - cursor: not-allowed; - border-right: 1px solid #e3e3e3; } - .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus, .editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active { - background-color: #fcfcfc; } - -@keyframes Select-animation-spin { - to { - transform: rotate(1turn); } } - -@-webkit-keyframes Select-animation-spin { - to { - -webkit-transform: rotate(1turn); } } - .editor_controls .dropdown-container:not(:last-child) { - margin-bottom: var(--spacing-quarter-unit); } - .editor_controls .dropdown-container .Select.is-focused > .Select-control { - background-color: var(--color-background-inputs); } - .editor_controls .dropdown-container .Select.is-focused > .Select-control .Select-input { - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select.is-open > .Select-control { - border-color: var(--color-border-dark); - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select.is-open > .Select-control .Select-input { - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select:not(.is-open) .Select-control { - background-color: var(--color-background-inputs) !important; } - .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover { - border-color: var(--color-border-dark); } - .editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow { - opacity: 1; } - .editor_controls .dropdown-container .Select-control { - background-color: var(--color-background-inputs); - border: var(--border-default); - box-shadow: none !important; - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select-option { - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select-menu-outer { - border: var(--border-default); - border-top-color: var(--color-border-default); - background-color: transparent; - box-shadow: var(--box-shadow-base); } - .editor_controls .dropdown-container .Select.is-focused:not(.is-open) > .Select-control { - border-color: var(--color-border-accent); } - .editor_controls .dropdown-container .Select.has-value.Select--single > .Select-control .Select-value .Select-value-label, - .editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label { - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select.is-open .Select-arrow, - .editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover > .Select-arrow { - border-color: transparent transparent var(--color-border-accent) !important; } - .editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow { - border-top-color: var(--color-border-accent) !important; } - .editor_controls .dropdown-container .Select-arrow { - border-color: var(--color-border-default) transparent transparent; } - .editor_controls .dropdown-container .Select-option { - background-color: var(--color-background-inputs); } - .editor_controls .dropdown-container .Select-option.is-selected { - color: var(--color-text-active); - font-weight: var(--font-weight-semibold); - background-color: var(--color-background-light); } - .editor_controls .dropdown-container .Select-option.is-focused { - background-color: var(--color-background-light); - color: var(--color-text-active); } - .editor_controls .dropdown-container .Select-option:hover { - color: var(--color-text-active); - background-color: var(--color-background-light); } - .editor_controls .dropdown-container .Select-placeholder, - .editor_controls .dropdown-container .Select--single > .Select-control .Select-value { - color: var(--color-text-base); } - .editor_controls .dropdown-container .Select-value-label { - color: var(--color-text-base) !important; } - .editor_controls .dropdown-container .Select-placeholder { - color: var(--color-text-placeholder); } - .editor_controls .dropdown-container .dropdown--dark .Select-control { - background-color: var(--color-background-inverse); } - .editor_controls .dropdown-container .dropdown--dark .Select-option { - background-color: var(--color-background-inverse); } - .editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected { - background-color: var(--color-border-default); } - .editor_controls .dropdown-container .dropdown--dark .Select.is-focused { - background-color: var(--color-border-light); } - .editor_controls ::-webkit-input-placeholder { - /* Chrome/Opera/Safari */ - color: var(--color-text-placeholder); } - .editor_controls ::-moz-placeholder { - /* Firefox 19+ */ - color: var(--color-text-placeholder); } - .editor_controls :-ms-input-placeholder { - /* IE 10+ */ - color: var(--color-text-placeholder); } - .editor_controls :-moz-placeholder { - /* Firefox 18- */ - color: var(--color-text-placeholder); } - .editor_controls .numeric-input__wrapper { - line-height: 20px; - max-width: 100%; - flex: 1; - display: flex; - align-items: center; - color: var(--color-text-base); } - @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { - .editor_controls .numeric-input__wrapper { - flex-basis: auto; } } - .editor_controls .numeric-input__number { - display: inline-block; - border: var(--border-default); - background: var(--color-background-inputs); - cursor: text; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - text-align: left; - border-radius: var(--border-radius-small); - padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); - width: 62px; - vertical-align: middle; - font-size: inherit; - color: inherit; - font-family: inherit; } - .editor_controls .numeric-input__caret-box { - display: inline-block; - max-height: 32px; - margin-left: var(--spacing-quarter-unit); - margin-right: var(--spacing-half-unit); - vertical-align: middle; - box-sizing: border-box; } - .editor_controls .numeric-input__caret:first-child { - margin-bottom: 2px; } - .editor_controls .numeric-input__caret { - cursor: pointer; - background-color: var(--color-background-light); - border: var(--border-default); - border-radius: 1px; - line-height: var(--spacing-half-unit); - text-align: center; } - .editor_controls .numeric-top-caret-modifier { - width: 13px !important; - height: 13px !important; - fill: var(--color-text-base) !important; } - .editor_controls .numeric-bottom-caret-modifier { - width: 13px !important; - height: 13px !important; - fill: var(--color-text-base) !important; } - .editor_controls ::-webkit-input-placeholder { - /* Chrome/Opera/Safari */ - color: var(--color-text-placeholder); } - .editor_controls ::-moz-placeholder { - /* Firefox 19+ */ - color: var(--color-text-placeholder); } - .editor_controls :-ms-input-placeholder { - /* IE 10+ */ - color: var(--color-text-placeholder); } - .editor_controls :-moz-placeholder { - /* Firefox 18- */ - color: var(--color-text-placeholder); } - .editor_controls .text-input { - display: inline-block; - border: var(--border-default); - background: var(--color-background-inputs); - cursor: text; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - text-align: left; - border-radius: var(--border-radius-small); - padding: var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit); - width: 140px; - vertical-align: middle; - font-size: inherit; - color: inherit; - font-family: inherit; } - .editor_controls .radio-block { - width: 100%; - line-height: var(--font-leading-head); - display: flex; } - .editor_controls .radio-block__option { - flex-grow: 1; - padding: var(--spacing-quarter-unit) var(--spacing-half-unit); - background-color: var(--color-background-top); - border: var(--border-default); - display: inline-block; - cursor: pointer; - min-width: 0px; - text-align: center; - font-size: var(--font-size-small); } - .editor_controls .radio-block__option:not(.radio-block__option--active):hover { - background-color: var(--color-background-light); - color: var(--color-text-active); } - .editor_controls .radio-block__option--active { - background-color: var(--color-button-primary-base-fill); - color: var(--color-button-primary-base-text); - border: 1px solid var(--color-button-primary-base-border); - margin-left: -1px; - cursor: default; - text-shadow: var(--text-shadow-dark-ui); - font-weight: var(--font-weight-semibold); } - .editor_controls .radio-block__option--active:not(:first-child), .editor_controls .radio-block__option--active:last-child { - border-left: var(--border-accent-shade) !important; } - .editor_controls .radio-block__option:not(:first-child):not(:last-child) { - border-left: 0; } - .editor_controls .radio-block__option:last-child { - border-top-right-radius: var(--border-radius-small); - border-bottom-right-radius: var(--border-radius-small); - border-left: 0; } - .editor_controls .radio-block__option:first-child { - border-top-left-radius: var(--border-radius-small); - border-bottom-left-radius: var(--border-radius-small); } - .editor_controls .radio-block__option:first-child:not(.radio-block__option--active) { - border-left: var(--border-default); } - .editor_controls .text-editor { - overflow: hidden; - border: var(--border-default); - border-radius: var(--border-radius); - min-height: 155px; - display: flex; - flex-direction: column; - flex-grow: 1; } - .editor_controls .text-editor * { - box-sizing: border-box; } - .editor_controls .text-editor textarea[class='multi-format-editor__latex'] { - height: 155px; - width: 100%; - margin: 10px; - border: var(--border-default); } - .editor_controls .text-editor textarea[class='multi-format-editor__html'] { - height: 145px; - width: 100%; } - .editor_controls .text-editor textarea { - width: 100%; - height: 100%; - border: none; - overflow: auto; - outline: none; - box-shadow: none; - padding: var(--spacing-quarter-unit); - resize: none; - line-height: 24px; - font-size: 13px; - color: var(--color-text-base); - background-color: var(--color-background-inputs); } - .editor_controls .multi-format-editor__root { - display: flex; - overflow: hidden; - height: 205px; } - .editor_controls .multi-format-editor__root__wrapper { - flex-grow: 1; - display: flex; - flex-wrap: wrap; - align-items: stretch; - flex-direction: column; } - .editor_controls .multi-format-editor__tabs { - height: 30px; - display: block; - width: 100%; } - .editor_controls .multi-format-editor__tab { - text-align: center; - height: 30px; - line-height: 28px; - box-sizing: border-box; } - .editor_controls .multi-format-editor__tab.top-tab { - width: 50%; - overflow: hidden; - color: var(--color-text-base); - display: inline-block; } - .editor_controls .multi-format-editor__tab.top-tab.left { - border-top-left-radius: 5px; - border-right: var(--border-default); } - .editor_controls .multi-format-editor__tab.top-tab.right { - border-top-right-radius: 5px; } - .editor_controls .multi-format-editor__tab.top-tab:not(.selected) { - border-bottom: var(--border-default); } - .editor_controls .multi-format-editor__tab.bottom-tab { - border-top: var(--border-default); - width: 100%; - display: block; - color: var(--color-text-base); } - .editor_controls .multi-format-editor__tab.selected { - background: var(--color-background-light); - font-weight: var(--font-weight-semibold); } - .editor_controls .multi-format-editor__tab:hover:not(.selected) { - cursor: pointer; - color: var(--color-text-active); - background-color: var(--color-background-light); } - .editor_controls .multi-format-editor__content__wrapper__rich_text { - flex-grow: 1; - display: flex; - flex-direction: column; } - .editor_controls .multi-format-editor__content__wrapper__latex { - background-color: var(--color-background-light); - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .multi-format-editor__content__wrapper__html { - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .multi-format-editor__confirmation-panel { - height: 100%; - max-height: 100%; - width: 100%; - text-align: center; - display: flex; - flex-direction: column; - align-items: flex-start; - flex: 1; } - .editor_controls .multi-format-editor__confirmation-panel__header { - color: var(--color-text-section-header); - margin-top: 0; - margin-bottom: 5px; - font-weight: 600; } - .editor_controls .multi-format-editor__confirmation-panel__content { - overflow-y: auto; - display: flex; - flex-direction: column; - -webkit-overflow-scrolling: touch; - padding: var(--spacing-half-unit); } - .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar { - background: white; - width: 5px; } - .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls .multi-format-editor__confirmation-panel__actions { - padding: var(--spacing-half-unit); - width: 100%; - display: flex; - justify-content: center; - align-items: center; - border-top: 1px solid var(--color-border-light); - -webkit-overflow-scrolling: touch; } - .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar { - background: white; - width: 5px; } - .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track { - box-shadow: none; - background: var(--scrollbar-track-background); } - .editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb { - background-color: var(--scrollbar-thumb-color); - border-radius: 10px; } - .editor_controls .multi-format-editor__confirmation-panel__message { - line-height: 20px; } - .editor_controls .multi-format-editor__confirmation-panel__message-primary { - font-weight: var(--font-weight-semibold); - color: var(--color-text-base); } - .editor_controls .multi-format-editor__confirmation-panel__message-secondary { - color: var(--color-text-base); } - .editor_controls .multi-format-editor__confirmation-panel__continue-button { - margin-left: 10px; } - .editor_controls .rich-text-editor__root { - border-top: none; - width: 100%; - color: var(--color-text-base); - display: flex; - flex-direction: column; - flex-grow: 1; } - .editor_controls .rich-text-editor__editor { - cursor: text; - position: relative; - flex-grow: 1; } - .editor_controls .rich-text-editor__editor > div { - position: absolute; - width: 100%; - height: 100%; - max-width: 100%; - max-height: 100%; - overflow: auto; - flex-grow: 1; - left: 0; - top: 0; } - .editor_controls .rich-text-editor__controls { - display: flex; - justify-content: space-evenly; - background: var(--color-background-light); - font-size: 14px; - padding: 10px 0; - user-select: none; - border-bottom: var(--border-default); } - .editor_controls .rich-text-editor__controls .icon-link { - transform: translateY(3px); - display: inline-block; - fill: var(--color-text-base); - width: 15px !important; - height: 15px !important; } - .editor_controls .rich-text-editor__link-editor { - background-color: var(--color-background-light); - border: var(--border-default); - padding: var(--spacing-half-unit); - position: absolute; - z-index: 1; - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; } - .editor_controls .rich-text-editor__link-editor__label { - display: block; } - .editor_controls .rich-text-editor__link-editor__input { - border: var(--border-default); - color: var(--color-text-base); - overflow: scroll; - padding: 0 10px; - width: 100%; - margin-top: 10px; } - .editor_controls .rich-text-editor__styleButton { - color: var(--color-text-base); - cursor: pointer; - display: inline-block; - margin: 0; - min-height: var(--spacing-base-unit); - min-width: var(--spacing-base-unit); - text-align: center; - background-color: transparent; - border: var(--border-default); - border-radius: var(--border-radius-small); - line-height: 20px; - position: relative; } - .editor_controls .rich-text-editor__styleButton__wrapper { - padding: 0 var(--spacing-quarter-unit); } - .editor_controls .rich-text-editor__styleButton--active { - background-color: var(--color-accent); - border: var(--border-accent-shade); - color: var(--color-white); } - .editor_controls .rich-text-editor__styleButton--active:hover { - background-color: var(--color-accent); - border: var(--border-accent-shade); - color: var(--color-white); } - .editor_controls .rich-text-editor__styleButton--active:hover::before { - transform: scaleX(0); } - .editor_controls .rich-text-editor__styleButton::before { - content: ''; - position: absolute; - bottom: -1px; - height: 1px; - width: calc(100% + 2px); - left: -1px; - background: var(--color-accent); - will-change: transform; - transform-origin: center center; - transform: scaleX(0); - transition: all 0.15s ease-in-out; } - .editor_controls .rich-text-editor__styleButton:hover { - color: var(--color-text-active); - background-color: var(--color-background-top); } - .editor_controls .rich-text-editor__styleButton:hover::before { - transform: none; } - .editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root, - .editor_controls .rich-text-editor__editor .public-DraftEditor-content { - padding: var(--spacing-quarter-unit); } - .editor_controls .rich-text-editor__editor .public-DraftEditor-content { - min-height: 100px; } - .editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root { - display: none; } - .editor_controls .rich-text-editor__editor .RichEditor-blockquote { - border-left: 5px solid #eee; - color: #666; - font-style: italic; - margin: 16px 0; - padding: 10px 20px; } - .editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre { - background-color: rgba(0, 0, 0, 0.05); - font-size: 16px; - padding: 20px; } - .editor_controls .DraftEditor-editorContainer, - .editor_controls .DraftEditor-root, - .editor_controls .public-DraftEditor-content { - height: inherit; - text-align: initial; } - .editor_controls .DraftEditor-root { - position: relative; } - .editor_controls .DraftEditor-editorContainer { - background-color: rgba(255, 255, 255, 0); - border-left: 0.1px solid transparent; - position: relative; - z-index: 1; } - .editor_controls .public-DraftEditor-block { - position: relative; } - .editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block { - text-align: left; } - .editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root { - left: 0; - text-align: left; } - .editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block { - text-align: center; } - .editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root { - margin: 0 auto; - text-align: center; - width: 100%; } - .editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block { - text-align: right; } - .editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root { - right: 0; - text-align: right; } - .editor_controls .public-DraftEditorPlaceholder-root { - color: #9197a3; - position: absolute; - z-index: 0; } - .editor_controls .public-DraftEditorPlaceholder-hasFocus { - color: #bdc1c9; } - .editor_controls .DraftEditorPlaceholder-hidden { - display: none; } - .editor_controls .public-DraftStyleDefault-block { - position: relative; - white-space: pre-wrap; } - .editor_controls .public-DraftStyleDefault-ltr { - direction: ltr; - text-align: left; } - .editor_controls .public-DraftStyleDefault-rtl { - direction: rtl; - text-align: right; } - .editor_controls .public-DraftStyleDefault-listLTR { - direction: ltr; } - .editor_controls .public-DraftStyleDefault-listRTL { - direction: rtl; } - .editor_controls .public-DraftStyleDefault-ol, - .editor_controls .public-DraftStyleDefault-ul { - margin: 16px 0; - padding: 0; } - .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR { - margin-left: 1.5em; } - .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL { - margin-right: 1.5em; } - .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR { - margin-left: 3em; } - .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL { - margin-right: 3em; } - .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR { - margin-left: 4.5em; } - .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL { - margin-right: 4.5em; } - .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR { - margin-left: 6em; } - .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL { - margin-right: 6em; } - .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR { - margin-left: 7.5em; } - .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL { - margin-right: 7.5em; } - .editor_controls .public-DraftStyleDefault-unorderedListItem { - list-style-type: square; - position: relative; } - .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0 { - list-style-type: disc; } - .editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1 { - list-style-type: circle; } - .editor_controls .public-DraftStyleDefault-orderedListItem { - list-style-type: none; - position: relative; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before { - left: -36px; - position: absolute; - text-align: right; - width: 30px; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before { - position: absolute; - right: -36px; - text-align: left; - width: 30px; } - .editor_controls .public-DraftStyleDefault-orderedListItem:before { - content: counter(ol0) ". "; - counter-increment: ol0; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before { - content: counter(ol1) ". "; - counter-increment: ol1; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before { - content: counter(ol2) ". "; - counter-increment: ol2; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before { - content: counter(ol3) ". "; - counter-increment: ol3; } - .editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before { - content: counter(ol4) ". "; - counter-increment: ol4; } - .editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset { - counter-reset: ol0; } - .editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset { - counter-reset: ol1; } - .editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset { - counter-reset: ol2; } - .editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset { - counter-reset: ol3; } - .editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset { - counter-reset: ol4; } - .editor_controls .rangeslider { - margin: 0 var(--spacing-quarter-unit); - min-width: 60px; - position: relative; - background: var(--color-background-light); - -ms-touch-action: none; - touch-action: none; - border: 1px solid var(--color-border-default); - flex-grow: 1; } - .editor_controls .rangeslider, - .editor_controls .rangeslider .rangeslider__fill { - display: block; } - .editor_controls .rangeslider .rangeslider__handle { - outline: 0; - background: #fff; - border: 1px solid var(--color-border-default); - cursor: pointer; - display: inline-block; - position: absolute; } - .editor_controls .rangeslider .rangeslider__handle .rangeslider__active { - opacity: 1; } - .editor_controls .rangeslider .rangeslider__handle-tooltip { - width: 20px; - height: 20px; - text-align: center; - position: absolute; - background-color: rgba(0, 0, 0, 0.8); - font-weight: normal; - font-size: 14px; - transition: all 100ms ease-in; - border-radius: 4px; - display: inline-block; - color: white; - left: 50%; - transform: translate3d(-50%, 0, 0); } - .editor_controls .rangeslider .rangeslider__handle-tooltip span { - margin-top: 12px; - display: inline-block; - line-height: 100%; } - .editor_controls .rangeslider .rangeslider__handle-tooltip:after { - content: ' '; - position: absolute; - width: 0; - height: 0; } - .editor_controls .rangeslider-horizontal { - height: 6px; - border-radius: 10px; } - .editor_controls .rangeslider-horizontal .rangeslider__fill { - height: 100%; - background-color: var(--color-accent); - border: var(--border-accent); - border-radius: 10px; - transform: translateY(-1px); - top: 0; } - .editor_controls .rangeslider-horizontal .rangeslider__handle { - width: 6.66667px; - height: 30px; - border-radius: 20px; - top: 50%; - transform: translate3d(-50%, -50%, 0); - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .rangeslider-horizontal .rangeslider__handle:after { - content: ' '; - position: absolute; - width: 4px; - height: 20px; - border-radius: 5px; - background-color: var(--color-accent); - display: none; } - .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip { - top: -55px; } - .editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after { - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-top: 8px solid rgba(0, 0, 0, 0.8); - left: 50%; - bottom: -8px; - transform: translate3d(-50%, 0, 0); } - .editor_controls .rangeslider-vertical { - margin: 20px auto; - height: 150px; - max-width: 10px; - background-color: transparent; } - .editor_controls .rangeslider-vertical .rangeslider__fill, - .editor_controls .rangeslider-vertical .rangeslider__handle { - position: absolute; } - .editor_controls .rangeslider-vertical .rangeslider__fill { - width: 100%; - background-color: #7cb342; - box-shadow: none; - bottom: 0; } - .editor_controls .rangeslider-vertical .rangeslider__handle { - width: 30px; - height: 10px; - left: -10px; - box-shadow: none; } - .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip { - left: -100%; - top: 50%; - transform: translate3d(-50%, -50%, 0); } - .editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after { - border-top: 8px solid transparent; - border-bottom: 8px solid transparent; - border-left: 8px solid rgba(0, 0, 0, 0.8); - left: 100%; - top: 12px; } - .editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill { - right: 0; } - .editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill { - top: 0; - bottom: inherit; } - .editor_controls .rangeslider__labels { - position: relative; } - .rangeslider-vertical .editor_controls .rangeslider__labels { - position: relative; - list-style-type: none; - margin: 0 0 0 24px; - padding: 0; - text-align: left; - width: 250px; - height: 100%; - left: 10px; } - .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item { - position: absolute; - transform: translate3d(0, -50%, 0); } - .rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item::before { - content: ''; - width: 10px; - height: 2px; - background: black; - position: absolute; - left: -14px; - top: 50%; - transform: translateY(-50%); - z-index: -1; } - .editor_controls .rangeslider__labels .rangeslider__label-item { - position: absolute; - font-size: 14px; - cursor: pointer; - display: inline-block; - top: 10px; - transform: translate3d(-50%, 0, 0); } - .editor_controls .trace-grid-single-block { - max-width: 460px; - display: flex; - flex-flow: wrap; - padding: var(--spacing-quarter-unit); } - .editor_controls .trace-grid { - display: grid; - grid-template-columns: repeat(4, 1fr); } - @media (max-width: 860px) { - .editor_controls .trace-grid { - grid-template-columns: repeat(2, 1fr); } } - .editor_controls .trace-grid__column { - text-align: center; - display: flex; - align-items: flex-start; - justify-content: flex-start; - flex-direction: column; - flex-shrink: 0; - flex-grow: 0; } - .editor_controls .trace-grid__column:nth-of-type(4n + 3) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column:nth-of-type(4n) { - -ms-grid-column: 2; } - .editor_controls .trace-grid__column:nth-of-type(4n + 1) { - -ms-grid-column: 3; } - .editor_controls .trace-grid__column:nth-of-type(4n + 2) { - -ms-grid-column: 4; } - .editor_controls .trace-grid__column:nth-of-type(3), .editor_controls .trace-grid__column:nth-of-type(4), .editor_controls .trace-grid__column:nth-of-type(5), .editor_controls .trace-grid__column:nth-of-type(6) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column:nth-of-type(7), .editor_controls .trace-grid__column:nth-of-type(8), .editor_controls .trace-grid__column:nth-of-type(9), .editor_controls .trace-grid__column:nth-of-type(10) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 1) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(2n + 2) { - -ms-grid-column: 2; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(3), .editor_controls .trace-grid__column .trace-item:nth-of-type(4) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(5), .editor_controls .trace-grid__column .trace-item:nth-of-type(6) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column .trace-item:nth-of-type(7), .editor_controls .trace-grid__column .trace-item:nth-of-type(8) { - -ms-grid-row: 4; } - .editor_controls .trace-grid__column:not(:first-of-type) { - position: relative; } - .editor_controls .trace-grid__column:not(:first-of-type)::before { - position: absolute; - width: 1px; - border-left: var(--border-light); - height: 100%; - top: 0; - left: 0; - content: ''; } - .editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header { - position: relative; - z-index: 99; } - .editor_controls .trace-grid__column--double { - grid-column: span 2; - flex-grow: 0; } - .editor_controls .trace-grid__column--double:nth-of-type(2n + 1) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column--double:nth-of-type(2n + 2) { - -ms-grid-column: 3; } - .editor_controls .trace-grid__column--double:nth-of-type(5), .editor_controls .trace-grid__column--double:nth-of-type(6) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column--double:nth-of-type(7), .editor_controls .trace-grid__column--double:nth-of-type(8) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 1) { - -ms-grid-column: 1; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 2) { - -ms-grid-column: 2; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n + 3) { - -ms-grid-column: 3; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n) { - -ms-grid-column: 4; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(3), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(4) { - -ms-grid-row: 1; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(5), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(6), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(7), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(8) { - -ms-grid-row: 2; } - .editor_controls .trace-grid__column--double .trace-item:nth-of-type(9), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(10), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(11), .editor_controls .trace-grid__column--double .trace-item:nth-of-type(12) { - -ms-grid-row: 3; } - .editor_controls .trace-grid__column--double .trace-grid__column__items { - display: grid; - grid-gap: 0; - grid-template-columns: repeat(4, 1fr); } - .editor_controls .trace-grid__column__items { - display: grid; - grid-gap: 0; - grid-template-columns: repeat(2, 90px); - grid-template-rows: repeat(2, 112px); - flex-grow: 1; - width: 100%; - padding: 0 var(--spacing-half-unit) var(--spacing-half-unit); } - .editor_controls .trace-grid__column__header { - text-transform: capitalize; - font-weight: var(--font-weight-semibold); - color: var(--color-text-base); - text-align: left; - display: flex; - align-items: center; - justify-content: flex-start; - border-top: var(--border-light); - width: 100%; - padding: var(--spacing-half-unit) var(--spacing-base-unit) 0; - box-sizing: border-box; } - .editor_controls .trace-item { - width: 90px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: flex-start; - flex-grow: 0; - margin-top: var(--spacing-half-unit); - color: var(--color-text-base); - transition: all 0.15s ease-in-out; - position: relative; } - .editor_controls .trace-item--active .trace-item__image { - border-color: var(--color-accent); - border-width: 2px; - color: var(--color-accent); } - .editor_controls .trace-item__actions { - position: absolute; - width: calc(100%); - display: flex; - flex-direction: column; - top: 0; - left: var(--spacing-quarter-unit); - justify-content: flex-start; - align-items: flex-end; - z-index: 99; - height: 60px; } - .editor_controls .trace-item__actions:hover .trace-item__actions__item { - transform: translateX(-2px); - opacity: 1; - pointer-events: initial; } - .editor_controls .trace-item__actions__item { - transform: translateX(-10px); - opacity: 0; - pointer-events: none; - color: var(--color-text-light); - transition: all 0.15s ease-in-out; } - .editor_controls .trace-item__actions__item:not(:last-child) { - margin-bottom: var(--spacing-quarter-unit); } - .editor_controls .trace-item__actions__item:hover { - color: var(--color-accent); } - .editor_controls .trace-item__actions__item svg { - display: block; - width: 16px; - height: 16px; - fill: currentColor; } - .editor_controls .trace-item:hover { - cursor: pointer; - color: var(--color-accent); } - .editor_controls .trace-item:hover .trace-item__label { - color: var(--color-accent); } - .editor_controls .trace-item:hover .trace-item__image { - border-color: var(--color-accent); } - .editor_controls .trace-item__image { - position: relative; - z-index: 2; - border: 1px solid var(--color-border-default); - width: 60px; - height: 60px; - border-radius: var(--border-radius); - background: var(--color-background-top); - box-shadow: 0 2px 9px transparent; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.15s ease-in-out; } - .editor_controls .trace-item__image__svg { - width: 100%; - flex-grow: 1; - padding: var(--spacing-quarter-unit); } - .editor_controls .trace-item__image svg { - display: block; } - .editor_controls .trace-item__image img { - display: block; - font-size: 10px; - color: var(--color-text-base); } - .editor_controls .trace-item__image__wrapper { - width: 100%; } - .editor_controls .trace-item__label { - font-weight: var(--font-weight-semibold); - width: 72px; - height: 34px; - margin-top: var(--spacing-quarter-unit); - color: var(--color-text-base); - text-transform: capitalize; - font-size: var(--font-size-small); - text-align: center; } - .editor_controls .trace-type-select-dropdown__wrapper > * > * { - pointer-events: none; } - .editor_controls .trace-type-select-dropdown__wrapper > *:hover { - cursor: pointer; } - .editor_controls .trace-type-select-dropdown__wrapper > *:hover .Select:not(.is-open) .Select-control { - border-color: var(--color-border-dark); } - .editor_controls .trace-type-select-button { - display: flex; - align-items: center; - border: var(--border-default); - width: 100%; - height: 36px; - border-radius: var(--border-radius); - padding: 0 var(--spacing-quarter-unit); } - .editor_controls .trace-type-select-button:hover { - cursor: pointer; - border-color: var(--color-border-dark); } - .editor_controls .trace-type-select-button__icon { - max-width: 20px; - width: 20px; - margin-right: var(--spacing-quarter-unit); } - .editor_controls .trace-type-select-button__icon svg { - max-width: 100%; - display: block; } - .editor_controls .trace-type-select-button__icon svg * { - fill: currentColor; } - .editor_controls .dropzone-container { - flex-grow: 1; - display: flex; - align-items: center; - justify-content: center; - border: 1px dashed var(--color-border-default); - height: 160px; - box-sizing: border-box; - padding: 8px; - border-radius: var(--border-radius); } - .editor_controls .dropzone-container__content { - width: 100%; - height: 100%; - text-align: center; - background-color: var(--color-rhino-light-5); - border-radius: var(--border-radius); - display: flex; - align-items: center; - justify-content: center; } - .editor_controls .dropzone-container__message { - padding: 15px; } - .editor_controls .dropzone-container__image { - width: 100%; - height: 100%; - background-size: contain; - background-position: center; - position: relative; - background-repeat: no-repeat; } - .editor_controls .dropzone-container--active { - border-color: var(--color-dodger); } - .editor_controls .dropzone-container--rejected { - border-color: red; } - .editor_controls [aria-label][role~='tooltip'] { - position: relative; } - .editor_controls [aria-label][role~='tooltip']::before, - .editor_controls [aria-label][role~='tooltip']::after { - transform: translate3d(0, 0, 0); - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - display: none; - will-change: transform; - opacity: 0; - pointer-events: none; - transition: all var(--microtip-transition-duration, 0.18s) var(--microtip-transition-easing, ease-in-out) var(--microtip-transition-delay, 0s); - position: absolute; - box-sizing: border-box; - z-index: 10; - transform-origin: top; } - .editor_controls [aria-label][role~='tooltip']::before { - background-size: 100% auto !important; - content: ''; } - .editor_controls [aria-label][role~='tooltip']::after { - background: #506784; - border-radius: 4px; - color: #ffffff; - content: attr(aria-label); - font-size: var(--microtip-font-size, 13px); - font-weight: var(--microtip-font-weight, normal); - text-transform: var(--microtip-text-transform, none); - padding: 0.5em 1em; - white-space: nowrap; - box-sizing: content-box; } - .editor_controls [aria-label][role~='tooltip']:hover::before, - .editor_controls [aria-label][role~='tooltip']:hover::after, - .editor_controls [aria-label][role~='tooltip']:focus::before, - .editor_controls [aria-label][role~='tooltip']:focus::after { - opacity: 1; - pointer-events: auto; - display: block; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 6px; - width: 18px; - margin-bottom: 5px; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { - margin-bottom: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::before { - transform: translate3d(-50%, 0, 0); - bottom: 100%; - left: 50%; } - .editor_controls [role~='tooltip'][data-microtip-position|='top']:hover::before { - transform: translate3d(-50%, -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position|='top']::after { - transform: translate3d(-50%, 0, 0); - bottom: 100%; - left: 50%; } - .editor_controls [role~='tooltip'][data-microtip-position='top']:hover::after { - transform: translate3d(-50%, -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='top-left']::after { - transform: translate3d(calc(-100% + 16px), 0, 0); - bottom: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='top-left']:hover::after { - transform: translate3d(calc(-100% + 16px), -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='top-right']::after { - transform: translate3d(calc(0% + -16px), 0, 0); - bottom: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='top-right']:hover::after { - transform: translate3d(calc(0% + -16px), -5px, 0); } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 6px; - width: 18px; - margin-top: 5px; - margin-bottom: 0; } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { - margin-top: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::before { - transform: translate3d(-50%, -10px, 0); - bottom: auto; - left: 10px; - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']:hover::before { - transform: translate3d(-50%, 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position|='bottom']::after { - transform: translate3d(-50%, -10px, 0); - left: 10px; - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='bottom']:hover::after { - transform: translate3d(-50%, 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']::after { - transform: translate3d(calc(-100% + 16px), -10px, 0); - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-left']:hover::after { - transform: translate3d(calc(-100% + 16px), 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']::after { - transform: translate3d(calc(0% + -16px), -10px, 0); - top: 100%; } - .editor_controls [role~='tooltip'][data-microtip-position='bottom-right']:hover::after { - transform: translate3d(calc(0% + -16px), 0, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='left']::before, - .editor_controls [role~='tooltip'][data-microtip-position='left']::after { - bottom: auto; - left: auto; - right: 100%; - top: 50%; - transform: translate3d(10px, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='left']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 18px; - width: 6px; - margin-right: 5px; - margin-bottom: 0; } - .editor_controls [role~='tooltip'][data-microtip-position='left']::after { - margin-right: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::before, - .editor_controls [role~='tooltip'][data-microtip-position='left']:hover::after { - transform: translate3d(0, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='right']::before, - .editor_controls [role~='tooltip'][data-microtip-position='right']::after { - bottom: auto; - left: 100%; - top: 50%; - transform: translate3d(-10px, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-position='right']::before { - background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2880,%20103,%20132,%201%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat; - height: 18px; - width: 6px; - margin-bottom: 0; - margin-left: 5px; } - .editor_controls [role~='tooltip'][data-microtip-position='right']::after { - margin-left: 11px; } - .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::before, - .editor_controls [role~='tooltip'][data-microtip-position='right']:hover::after { - transform: translate3d(0, -50%, 0); } - .editor_controls [role~='tooltip'][data-microtip-size='small']::after { - white-space: initial; - width: 80px; } - .editor_controls [role~='tooltip'][data-microtip-size='medium']::after { - white-space: initial; - width: 140px; } - .editor_controls [role~='tooltip'][data-microtip-size='large']::after { - white-space: initial; - width: 260px; } - .editor_controls__wrapper { - display: flex; - flex-grow: 1; } - .editor_controls a { - color: #0d76bf; - cursor: pointer; } - -.plotly_editor { - display: flex; - /* - We are defining the max height of the app so that the editor knows how big to be - currently the editor will take up whatever space it can if it is not constrained in its parent - */ - flex-grow: 1; - height: 100%; - max-height: 100%; - width: 100%; } - -.plotly_editor_plot { - max-width: 100%; - height: 100%; - max-height: 100%; - overflow: auto; - flex-grow: 1; } diff --git a/lib/react-chart-editor.ie.min.css b/lib/react-chart-editor.ie.min.css deleted file mode 100644 index 653982c0e..000000000 --- a/lib/react-chart-editor.ie.min.css +++ /dev/null @@ -1 +0,0 @@ -.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:#2a3f5f}@keyframes a{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}@keyframes b{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(20px)}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;transform:translateY(20px);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;transform:none;animation:b .1s forwards cubic-bezier(.19,1,.22,1)}.editor_controls{position:relative;width:436px;flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Open Sans,--apple-default,sans-serif}.editor_controls .sidebar{-ms-user-select:none;user-select:none;height:100%;min-width:100px;width:100px;max-width:100px;text-align:center;background:#fff;overflow-y:auto;overflow-x:hidden;float:left;border-right:1px solid #c8d4e3;flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .sidebar__group{background-color:#fff;cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:#506784;font-size:14px;font-weight:500;padding:12px 0;text-transform:capitalize;text-align:left;border-bottom:1px solid #dfe8f3;display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:24px}.editor_controls .sidebar__group__title__icon{position:absolute;transform:scale(.9) translateX(2px) translateY(-4px);transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:#2a3f5f;cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:600;color:#2a3f5f}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:#119dff}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .sidebar__item{color:#506784;cursor:pointer;font-size:14px;font-weight:500;line-height:14px;text-transform:capitalize;background-color:#f3f6fa;padding:10px;padding-left:18px;padding-right:6px;text-align:left;border-bottom:1px solid #dfe8f3;position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:#119dff;transform:scaleX(0);transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:#ebf0f8}.editor_controls .sidebar__item--is-active{color:#2a3f5f;font-weight:600;cursor:default}.editor_controls .sidebar__item--is-active:before{transform:none}.editor_controls .sidebar__item--is-active span{transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:12px;box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls__wrapper>.panel{background-color:#ebf0f8;border-right:1px solid #c8d4e3;width:335px}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:12px;display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:14px;float:left;color:#506784;display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:#a2b1c6;padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:335px;border-right:1px solid #c8d4e3;height:100%;padding:12px;background-color:#ebf0f8;box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:48px;margin-bottom:12px;opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:#a2b1c6}.editor_controls .panel__empty__message__heading{color:#2a3f5f;font-size:24px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px}.editor_controls .panel__empty__message__content{font-size:13px;color:#506784;line-height:1.6}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-ms-user-select:none;user-select:none;margin-bottom:12px}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:6px 12px;color:#fff;font-size:13px;border:1px solid #2a3f5f;background-color:#2a3f5f;height:15px;border-radius:5px;text-shadow:0 1px 2px rgba(42,63,95,.7);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out;box-sizing:content-box}.editor_controls .fold__top:hover{cursor:pointer;background-color:#2a3f5f}.editor_controls .fold__top svg{width:18px;height:18px;display:block;filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:#fff;background-color:#506784;border:1px solid #506784;border-radius:5px 5px 0 0;text-shadow:0 1px 1px rgba(42,63,95,.4)}.editor_controls .fold__top--open svg{filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:#506784}.editor_controls .fold__top__icon{display:block;margin-right:6px;transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:12px/3;font-size:14px;line-height:14px;font-weight:600;transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:transform .1s ease-in-out;transform:rotate(-90deg);font-weight:700;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:#fff;border:1px solid #c8d4e3;border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:Dosis,Arial,sans-serif;display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:#119dff;display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:#506784}.editor_controls .fold__content__empty__message__secondary{font-family:Open Sans,--apple-default,sans-serif;font-size:12px;text-align:center;color:#506784}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:13px;color:#2a3f5f;font-weight:600;cursor:default;background-color:#f3f6fa;padding:6px 12px;clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:1px solid #dfe8f3}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:6px;width:100%}.editor_controls .menupanel__label{font-weight:600;padding-right:6px}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:#a2b1c6!important;padding-left:6px}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:#119dff!important}.editor_controls .menupanel__icon-span{font-size:12px;display:flex}.editor_controls .menupanel__icon-span--question{color:#506784}.editor_controls .info__title{color:#2a3f5f;font-size:18px;font-weight:500;line-height:1.2;font-family:Dosis,Arial,sans-serif;letter-spacing:.5px;padding:12px 12px 6px}.editor_controls .info__text{padding:6px 12px;color:#506784;font-size:12px;font-weight:500;line-height:1.6}.editor_controls .info__sub-text{color:#506784;font-size:12px;font-weight:500;font-style:italic;line-height:1.6;padding:6px 12px 12px}.editor_controls .modalbox{position:absolute;border-radius:5px;overflow:hidden;text-transform:none;text-align:left;border:1px solid #c8d4e3;align-content:center;box-shadow:0 2px 9px rgba(80,103,132,.2);left:-6px;width:calc(100% + 12px);top:calc(100% + 6px);background-color:#fff;z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:#506784}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;animation-duration:1s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:#a2b1c6;position:fixed}.editor_controls .modal__card{background:#fff;border-radius:5px;position:relative;z-index:1003;max-width:calc(100% - 24px);box-shadow:0 2px 9px rgba(80,103,132,.2);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;animation-duration:.85s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:#506784;padding:12px;font-weight:600}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:#f3f6fa;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{animation-duration:.85s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;color:#506784;font-size:13px;background:#dfe8f3;border:1px solid #c8d4e3;border-bottom:0;position:relative;background:#f3f6fa;transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:#dfe8f3;margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:12px 12px 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:5px}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:5px;border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:#ebf0f8;cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:#ebf0f8;pointer-events:none;margin-top:0;color:#2a3f5f;border-top-color:#119dff;border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:#ebf0f8;left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:1px solid #c8d4e3;display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:1px solid #dfe8f3;color:#506784;display:flex;font-size:13px;font-weight:500;justify-content:flex-start;line-height:13px;min-height:32px;padding:6px 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 12px;-ms-grid-row-align:center;align-self:center;line-height:1.6}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:12px;padding-left:12px;align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{-ms-grid-row-align:center;align-self:center}.editor_controls .field__title{width:80px;padding-left:12px;display:block;font-size:12px;line-height:1.6;color:#506784;padding-top:6px;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:6px;opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:#506784}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:#ef553b}.editor_controls .field .rect,.editor_controls .field .square{border-color:#119dff}.editor_controls .field .rect-grid{border-color:#ebf0f8!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:1px solid #c8d4e3;border-radius:5px;width:80px;cursor:pointer;padding:6px 6px 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:#506784}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:#a2b1c6;padding-top:3px;width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:1px solid #c8d4e3;padding:12px;box-shadow:2px 2px 12px #dfe8f3;border-radius:3px;left:24px}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:#c8d4e3}.editor_controls button{display:inline-block;padding:6px 12px;line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-ms-user-select:none;user-select:none;font-size:14px;font-weight:600;font-family:Open Sans,--apple-default,sans-serif;border:1px solid transparent;border-radius:5px;transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:12px}.editor_controls .button__icon{display:flex;padding-left:6px;will-change:transform}.editor_controls .button__icon svg{transform:scale(.8);transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - 24px);margin-left:12px;margin-right:12px}.editor_controls .button--no-text{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784;padding-right:6px;margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default{background-color:#f3f6fa;border-color:#c8d4e3;color:#506784}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:#ebf0f8;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:#a2b1c6;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--primary{background-color:#119dff;border-color:#0d76bf;color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--primary svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:active:not(.button--no-text--disabled),.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:#0d76bf;border:1px solid #0d76bf;color:#fff}.editor_controls .button--secondary{background-color:transparent;border-color:#c8d4e3;color:#506784}.editor_controls .button--secondary:active:not(.button--no-text--disabled),.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #a2b1c6;color:#2a3f5f}.editor_controls .button--tertiary{background-color:transparent;border-color:transparent;color:#506784}.editor_controls .button--tertiary:active:not(.button--no-text--disabled),.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid transparent;color:#2a3f5f}.editor_controls .button--upgrade{background-color:#ab63fa;border-color:var(--color-lavender-shade-dark);color:#fff;text-shadow:0 1px 2px rgba(42,63,95,.7)}.editor_controls .button--upgrade svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:#934bde;border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-lavender-shade-dark);border:1px solid var(--color-lavender-shade-dark);color:#fff}.editor_controls .button--header{background-color:transparent;border-color:#119dff;color:#119dff}.editor_controls .button--header:active:not(.button--no-text--disabled),.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:transparent;border:1px solid #0d76bf;color:#0d76bf}.editor_controls .checkbox__group{padding-left:12px;text-align:left}.editor_controls .checkbox__item{-ms-user-select:none;user-select:none;cursor:default;padding-top:3px;padding-bottom:3px}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:#f3f6fa}.editor_controls .checkbox__box--checked{border:1px solid #0d76bf;background:#119dff}.editor_controls .checkbox__box--checked:hover{background:#0d76bf}.editor_controls .checkbox__box--checked+.checkbox__label{color:#2a3f5f}.editor_controls .checkbox__check{color:#506784;font-size:12px;position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:#fff}.editor_controls .checkbox__label{padding-left:6px;font-size:13px;color:#506784;display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:1px solid #c8d4e3;border-radius:3px;cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:1px solid #c8d4e3;padding:3px}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:12px;color:#506784;font-weight:600;font-size:12px;display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:3px}.editor_controls .colorpicker__custom-input input{border:1px solid #c8d4e3!important;box-shadow:none!important;background-color:#fff;color:#2a3f5f}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:3px 0}.editor_controls .colorpicker__controls .colorpicker__active{height:24px;width:24px;margin:3px 0 0 12px}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:3px;border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - 12px - 12px)}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:6px;text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:#a2b1c6;background-color:#fff!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:#fff}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:#119dff}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:#506784}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:#fff;border:1px solid #c8d4e3;box-shadow:none!important;color:#506784}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#506784}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:#c8d4e3 transparent transparent}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:1px solid #c8d4e3;border-top-color:#c8d4e3;background-color:transparent;box-shadow:0 2px 9px rgba(80,103,132,.2)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;color:#666;cursor:pointer;display:block;padding:8px 10px;color:#506784;background-color:#fff}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:#2a3f5f;font-weight:600;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:#f3f6fa;color:#2a3f5f}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:6px}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:#fff!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:#a2b1c6}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent #119dff!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:#119dff!important}.editor_controls .dropdown-container .Select-option:hover{color:#2a3f5f;background-color:#f3f6fa}.editor_controls .dropdown-container .Select-value-label{color:#506784!important}.editor_controls .dropdown-container .Select-placeholder{color:#a2b1c6}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:#506784}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:#c8d4e3}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:#dfe8f3}.editor_controls ::-webkit-input-placeholder{color:#a2b1c6}.editor_controls ::-moz-placeholder{color:#a2b1c6}.editor_controls :-ms-input-placeholder{color:#a2b1c6}.editor_controls :-moz-placeholder{color:#a2b1c6}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:#506784}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:6px;margin-right:12px;vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:#f3f6fa;border:1px solid #c8d4e3;border-radius:1px;line-height:12px;text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:#506784!important}.editor_controls .text-input{display:inline-block;border:1px solid #c8d4e3;background:#fff;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:3px;padding:6px 6px 6px 12px;width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:1.2;display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:6px 12px;background-color:#fff;border:1px solid #c8d4e3;display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:12px}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:#f3f6fa;color:#2a3f5f}.editor_controls .radio-block__option--active{background-color:#119dff;color:#fff;border:1px solid #0d76bf;margin-left:-1px;cursor:default;text-shadow:0 1px 2px rgba(42,63,95,.7);font-weight:600}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:1px solid #0d76bf!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:3px;border-bottom-right-radius:3px;border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:1px solid #c8d4e3}.editor_controls .text-editor{overflow:hidden;border:1px solid #c8d4e3;border-radius:5px;min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:1px solid #c8d4e3}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:6px;resize:none;line-height:24px;font-size:13px;color:#506784;background-color:#fff}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:#506784;display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:1px solid #c8d4e3}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:1px solid #c8d4e3;width:100%;display:block;color:#506784}.editor_controls .multi-format-editor__tab.selected{background:#f3f6fa;font-weight:600}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:#2a3f5f;background-color:#f3f6fa}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:#f3f6fa;display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:#2a3f5f;margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:12px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:12px;width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid #dfe8f3;-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:#ebf0f8}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:#119dff;border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:600;color:#506784}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:#506784}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:#506784;display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:#f3f6fa;font-size:14px;padding:10px 0;-ms-user-select:none;user-select:none;border-bottom:1px solid #c8d4e3}.editor_controls .rich-text-editor__controls .icon-link{transform:translateY(3px);display:inline-block;fill:#506784;width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:#f3f6fa;border:1px solid #c8d4e3;padding:12px;position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:1px solid #c8d4e3;color:#506784;overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:#506784;cursor:pointer;display:inline-block;margin:0;min-height:24px;min-width:24px;text-align:center;background-color:transparent;border:1px solid #c8d4e3;border-radius:3px;line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 6px}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:#119dff;border:1px solid #0d76bf;color:#fff}.editor_controls .rich-text-editor__styleButton--active:hover:before{transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:#119dff;will-change:transform;transform-origin:center center;transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:#2a3f5f;background-color:#fff}.editor_controls .rich-text-editor__styleButton:hover:before{transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:6px}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 6px;min-width:60px;position:relative;background:#f3f6fa;touch-action:none;border:1px solid #c8d4e3;flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid #c8d4e3;cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:#119dff;border:1px solid #119dff;border-radius:10px;transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:#119dff;display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:6px}.editor_controls .trace-grid{display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:1px solid #dfe8f3;height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{-ms-grid-column-span:2;grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:-ms-grid;display:grid;grid-gap:0;-ms-grid-columns:(90px)[2];grid-template-columns:repeat(2,90px);-ms-grid-rows:(112px)[2];grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 12px 12px}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:600;color:#506784;text-align:left;display:flex;align-items:center;justify-content:flex-start;border-top:1px solid #dfe8f3;width:100%;padding:12px 24px 0;box-sizing:border-box}.editor_controls .trace-item{width:90px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;flex-grow:0;margin-top:12px;color:#506784;transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:#119dff;border-width:2px;color:#119dff}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:6px;justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{transform:translateX(-10px);opacity:0;pointer-events:none;color:#a2b1c6;transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:6px}.editor_controls .trace-item__actions__item:hover{color:#119dff}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:#119dff}.editor_controls .trace-item:hover .trace-item__label{color:#119dff}.editor_controls .trace-item:hover .trace-item__image{border-color:#119dff}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid #c8d4e3;width:60px;height:60px;border-radius:5px;background:#fff;box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:6px}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:#506784}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:600;width:72px;height:34px;margin-top:6px;color:#506784;text-transform:capitalize;font-size:12px;text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:#a2b1c6}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:1px solid #c8d4e3;width:100%;height:36px;border-radius:5px;padding:0 6px}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:#a2b1c6}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:6px}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed #c8d4e3;height:160px;box-sizing:border-box;padding:8px;border-radius:5px}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:#f8f8f9;border-radius:5px;display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:#119dff}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{transform:translateZ(0);backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all .18s ease-in-out 0s;position:absolute;box-sizing:border-box;z-index:10;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:13px;font-weight:400;text-transform:none;padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file diff --git a/lib/react-chart-editor.min.css b/lib/react-chart-editor.min.css deleted file mode 100644 index b331fc19b..000000000 --- a/lib/react-chart-editor.min.css +++ /dev/null @@ -1 +0,0 @@ -.\+flex{display:flex}.\+cursor-clickable{cursor:pointer}.\+hover-grey:hover{color:var(--color-text-active)}@-webkit-keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes a{0%{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}to{opacity:1;-webkit-transform:none;transform:none}}@-webkit-keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@keyframes b{0%{opacity:1;-webkit-transform:none;transform:none}to{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}}@-webkit-keyframes c{0%{opacity:1}to{opacity:0}}@keyframes c{0%{opacity:1}to{opacity:0}}.animate--fade-in,.editor_controls .modal__backdrop{opacity:0;-webkit-animation:d .1s forwards cubic-bezier(.19,1,.22,1);animation:d .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-out,.editor_controls .modal--animate-out .modal__backdrop{opacity:1;-webkit-animation:c .1s forwards cubic-bezier(.19,1,.22,1);animation:c .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fade-and-slide-in-from-bottom,.editor_controls .modal__card{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px);-webkit-animation:a .1s forwards cubic-bezier(.19,1,.22,1);animation:a .1s forwards cubic-bezier(.19,1,.22,1)}.animate--fsbr,.editor_controls .modal--animate-out .modal__card{opacity:1;-webkit-transform:none;transform:none;-webkit-animation:b .1s forwards cubic-bezier(.19,1,.22,1);animation:b .1s forwards cubic-bezier(.19,1,.22,1)}:root{--env:$ENV}.plotly-editor--theme-provider{--color-white:#fff;--color-rhino-core:#2a3f5f;--color-rhino-dark:#506784;--color-rhino-medium-1:#a2b1c6;--color-rhino-medium-2:#c8d4e3;--color-rhino-light-1:#dfe8f3;--color-rhino-light-2:#ebf0f8;--color-rhino-light-3:#f3f6fa;--color-rhino-light-4:#fafbfd;--color-rhino-light-5:#f8f8f9;--color-dodger:#119dff;--color-dodger-shade:#0d76bf;--color-dodger-shade-mid:#0d76bf;--color-aqua:#09ffff;--color-aqua-shade:#19d3f3;--color-lavender:#e763fa;--color-lavender-shade:#ab63fa;--color-lavender-shade-mid:#934bde;--color-cornflower:#636efa;--color-emerald:#00cc96;--color-sienna:#ef553b;--color-accent:var(--color-dodger);--color-accent-shade:var(--color-dodger-shade);--color-accent-shade-mid:var(--color-dodger-shade-mid);--color-brand:var(--color-dodger);--color-hightlight-darker:var(--color-gray-blue-pale);--color-text-base:var(--color-rhino-dark);--color-text-light:var(--color-rhino-medium-1);--color-text-dark:var(--color-rhino-core);--color-text-headings:var(--color-text-dark);--color-text-section-header:var(--color-text-dark);--color-text-active:var(--color-rhino-core);--color-text-placeholder:var(--color-rhino-medium-1);--color-border-default:var(--color-rhino-medium-2);--color-border-light:var(--color-rhino-light-1);--color-border-dark:var(--color-rhino-medium-1);--color-border-accent:var(--color-accent);--color-border-accent-shade:var(--color-accent-shade);--color-background:var(--color-rhino-light-2);--color-background-base:var(--color-rhino-light-2);--color-background-light:var(--color-rhino-light-3);--color-background-medium:var(--color-rhino-light-1);--color-background-dark:var(--color-rhino-medium-1);--color-background-top:var(--color-white);--color-background-inverse:var(--color-rhino-dark);--color-background-inputs:var(--color-background-top);--color-button-primary-base-fill:var(--color-accent);--color-button-primary-base-border:var(--color-accent-shade);--color-button-primary-base-text:var(--color-white);--color-button-primary-hover-fill:var(--color-accent-shade-mid);--color-button-primary-hover-border:var(--color-accent-shade);--color-button-primary-hover-text:var(--color-white);--color-button-primary-active-fill:var(--color-accent-shade);--color-button-primary-active-border:var(--color-accent-shade);--color-button-primary-active-text:var(--color-white);--color-button-secondary-base-fill:transparent;--color-button-secondary-base-border:var(--color-rhino-medium-2);--color-button-secondary-base-text:var(--color-text-base);--color-button-secondary-hover-fill:transparent;--color-button-secondary-hover-border:var(--color-rhino-medium-1);--color-button-secondary-hover-text:var(--color-text-dark);--color-button-secondary-active-fill:transparent;--color-button-secondary-active-border:var(--color-rhino-medium-1);--color-button-secondary-active-text:var(--color-text-dark);--color-button-tertiary-base-fill:transparent;--color-button-tertiary-base-border:transparent;--color-button-tertiary-base-text:var(--color-text-base);--color-button-tertiary-hover-fill:transparent;--color-button-tertiary-hover-border:transparent;--color-button-tertiary-hover-text:var(--color-text-dark);--color-button-tertiary-active-fill:transparent;--color-button-tertiary-active-border:transparent;--color-button-tertiary-active-text:var(--color-text-dark);--color-button-default-base-fill:var(--color-background-light);--color-button-default-base-border:var(--color-border-default);--color-button-default-base-text:var(--color-text-base);--color-button-default-hover-fill:var(--color-background-base);--color-button-default-hover-border:var(--color-border-dark);--color-button-default-hover-text:var(--color-text-dark);--color-button-default-active-fill:var(--color-background-dark);--color-button-default-active-border:var(--color-border-dark);--color-button-default-active-text:var(--color-text-dark);--color-button-upgrade-base-fill:var(--color-lavender-shade);--color-button-upgrade-base-border:var(--color-lavender-shade-dark);--color-button-upgrade-base-text:var(--color-white);--color-button-upgrade-hover-fill:var(--color-lavender-shade-mid);--color-button-upgrade-hover-border:var(--color-lavender-shade-dark);--color-button-upgrade-hover-text:var(--color-white);--color-button-upgrade-active-fill:var(--color-lavender-shade-dark);--color-button-upgrade-active-border:var(--color-lavender-shade-dark);--color-button-upgrade-active-text:var(--color-white);--color-button-header-base-fill:transparent;--color-button-header-base-border:var(--color-dodger);--color-button-header-base-text:var(--color-dodger);--color-button-header-hover-fill:transparent;--color-button-header-hover-border:var(--color-dodger-shade-mid);--color-button-header-hover-text:var(--color-dodger-shade);--color-button-header-active-fill:transparent;--color-button-header-active-border:var(--color-dodger-shade);--color-button-header-active-text:var(--color-dodger-shade);--spacing-base-unit:24px;--spacing-half-unit:12px;--spacing-quarter-unit:6px;--spacing-sixth-unit:4px;--spacing-eighth-unit:3px;--font-size-base:13px;--font-size-small:12px;--font-size-medium:14px;--font-size-large:14px;--font-size-heading-base:24px;--font-size-heading-small:18px;--font-size-heading-large:28px;--font-size-h5:16px;--font-weight-light:400;--font-weight-normal:500;--font-weight-semibold:600;--font-weight-bold:700;--font-leading-body:1.6;--font-leading-head:1.2;--font-letter-spacing-headings:0.5px;--font-family-body:"Open Sans",--apple-default,sans-serif;--font-family-headings:"Dosis","Arial",sans-serif;--border-default:1px solid var(--color-border-default);--border-light:1px solid var(--color-border-light);--border-dark:1px solid var(--color-border-dark);--border-accent:1px solid var(--color-border-accent);--border-accent-shade:1px solid var(--color-border-accent-shade);--border-radius:5px;--border-radius-small:3px;--text-shadow-dark-color:rgba(42,63,95,.7);--text-shadow-dark-ui:0 1px 2px var(--text-shadow-dark-color);--text-shadow-dark-ui-inactive:0 1px 1px rgba(42,63,95,.4);--box-shadow-base-color:rgba(80,103,132,.2);--box-shadow-base:0px 2px 9px var(--box-shadow-base-color);--scrollbar-track-background:var(--color-background-base);--scrollbar-thumb-color:var(--color-accent);--panel-background:var(--color-background-base);--panel-width:335px;--fold-header-text-color-base:var(--color-white);--fold-header-text-color-closed:var(--color-white);--fold-header-background-base:var(--color-rhino-dark);--fold-header-background-closed:var(--color-rhino-core);--fold-header-border-color-closed:var(--color-rhino-core);--fold-header-border-color-base:var(--color-rhino-dark);--sidebar-background:var(--color-background-top);--sidebar-width:100px;--sidebar-group-background-base:var(--sidebar-background);--sidebar-item-background-base:var(--color-background-light);--sidebar-item-background-hover:var(--color-background-base);--sidebar-item-background-active:var(--color-background-medium);--editor-width:calc(var(--sidebar-width) + var(--panel-width) + 1px)}.editor_controls{position:relative;width:var(--editor-width);flex-shrink:0;overflow:hidden;display:flex;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:var(--font-family-body)}.editor_controls .sidebar{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:100%;min-width:var(--sidebar-width);width:var(--sidebar-width);max-width:var(--sidebar-width);text-align:center;background:var(--sidebar-background);overflow-y:auto;overflow-x:hidden;float:left;border-right:var(--border-default);flex-grow:1;-webkit-overflow-scrolling:touch;-ms-overflow-style:none}.editor_controls .sidebar::-webkit-scrollbar{background:#fff;width:0}.editor_controls .sidebar::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .sidebar__group{background-color:var(--sidebar-group-background-base);cursor:pointer;width:100%}.editor_controls .sidebar__group__title{color:var(--color-text-base);font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);padding:var(--spacing-half-unit) 0;text-transform:capitalize;text-align:left;border-bottom:var(--border-light);display:flex;position:relative}.editor_controls .sidebar__group__title__label{padding-left:var(--spacing-base-unit)}.editor_controls .sidebar__group__title__icon{position:absolute;-webkit-transform:scale(.9) translateX(2px) translateY(-4px);transform:scale(.9) translateX(2px) translateY(-4px);-webkit-transform-origin:center center;transform-origin:center center;opacity:.5;transition:all .15s ease-in-out}.editor_controls .sidebar__group__title__icon svg path{fill:currentColor}.editor_controls .sidebar__group:hover .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active{color:var(--color-text-active);cursor:default}.editor_controls .sidebar__group--is-active .sidebar__group__title__label{font-weight:var(--font-weight-semibold);color:var(--color-text-active)}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon{opacity:1}.editor_controls .sidebar__group--is-active .sidebar__group__title__icon svg path{fill:var(--color-accent)}.editor_controls .sidebar__group--is-expanded .sidebar__group__title__icon{-webkit-transform:scale(.9) translateY(-5px) rotate(90deg);transform:scale(.9) translateY(-5px) rotate(90deg);opacity:1}.editor_controls .sidebar__group--is-expanded .sidebar__group__title{position:relative;z-index:4;box-shadow:var(--box-shadow-base)}.editor_controls .sidebar__item{color:var(--color-text-base);cursor:pointer;font-size:var(--font-size-medium);font-weight:var(--font-weight-normal);line-height:var(--font-size-medium);text-transform:capitalize;background-color:var(--sidebar-item-background-base);padding:10px;padding-left:18px;padding-right:var(--spacing-quarter-unit);text-align:left;border-bottom:var(--border-light);position:relative;overflow:hidden}.editor_controls .sidebar__item--single{margin-top:15px}.editor_controls .sidebar__item--single:last-child{margin-bottom:15px}.editor_controls .sidebar__item:before{content:"";position:absolute;height:100%;top:0;left:0;width:5px;background-color:var(--color-accent);-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:left center;transform-origin:left center;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item span{display:block;will-change:transform;transition:all .15s ease-in-out}.editor_controls .sidebar__item:not(.sidebar__item--is-active):hover{background-color:var(--sidebar-item-background-hover)}.editor_controls .sidebar__item--is-active{color:var(--color-text-active);font-weight:var(--font-weight-semibold);cursor:default}.editor_controls .sidebar__item--is-active:before{-webkit-transform:none;transform:none}.editor_controls .sidebar__item--is-active span{-webkit-transform:translateX(5px);transform:translateX(5px)}.editor_controls .sidebar__logo{height:50px;margin:10px}.editor_controls .panel{flex-grow:1;overflow-x:hidden;overflow-y:auto;padding:var(--spacing-half-unit);box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;-webkit-overflow-scrolling:touch}.editor_controls .panel::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .panel::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .panel::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls__wrapper>.panel{background-color:var(--panel-background);border-right:var(--border-default);width:calc(var(--panel-width))}.editor_controls .panel__content{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel__header{margin-bottom:var(--spacing-half-unit);display:flex;flex-shrink:0}.editor_controls .panel__header__content{flex-grow:1}.editor_controls .panel__header__actions__container{width:100%}.editor_controls .panel__header__collapse{font-size:var(--font-size-medium);float:left;color:var(--color-text-base);display:flex;align-items:center;height:100%;cursor:pointer}.editor_controls .panel__header__collapse svg{width:16px!important;height:16px!important;fill:var(--color-text-light);padding-right:3px}.editor_controls .panel__header__action{float:right}.editor_controls .panel__empty{position:absolute;top:0;right:0;width:var(--panel-width);border-right:var(--border-default);height:100%;padding:var(--spacing-half-unit);background-color:var(--panel-background);box-sizing:border-box;z-index:1003;display:flex}.editor_controls .panel__empty__message{text-align:center}.editor_controls .panel__empty__message__icon{padding-top:calc(var(--spacing-base-unit) * 2);margin-bottom:var(--spacing-half-unit);opacity:.5}.editor_controls .panel__empty__message__icon svg{width:48px!important;height:48px!important}.editor_controls .panel__empty__message__icon svg path{fill:var(--color-text-light)}.editor_controls .panel__empty__message__heading{color:var(--color-text-headings);font-size:var(--font-size-heading-base);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings)}.editor_controls .panel__empty__message__content{font-size:var(--font-size-base);color:var(--color-text-base);line-height:var(--font-leading-body)}.editor_controls .panel--no-padding{padding:0}.editor_controls .fold .panel{overflow-x:visible;overflow-y:visible}.editor_controls .fold{width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-bottom:var(--spacing-half-unit)}.editor_controls .fold__top{display:flex;justify-content:space-between;clear:both;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);color:var(--fold-header-text-color-closed);font-size:var(--font-size-base);border:1px solid var(--fold-header-border-color-closed);background-color:var(--fold-header-background-closed);height:15px;border-radius:var(--border-radius);text-shadow:var(--text-shadow-dark-ui);transition:background-color .1s ease-in-out,color .1s ease-in-out,border .1s ease-in-out;box-sizing:content-box}.editor_controls .fold__top:hover{cursor:pointer;background-color:var(--fold-header-background-closed)}.editor_controls .fold__top svg{width:18px;height:18px;display:block;-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .fold__top svg path{fill:currentColor}.editor_controls .fold__top--open{color:var(--fold-header-text-color-base);background-color:var(--fold-header-background-base);border:1px solid var(--fold-header-border-color-base);border-radius:var(--border-radius) var(--border-radius) 0 0;text-shadow:var(--text-shadow-dark-ui-inactive)}.editor_controls .fold__top--open svg{-webkit-filter:drop-shadow(0 1px 1px rgba(42,63,95,.4));filter:drop-shadow(0 1px 1px rgba(42,63,95,.4))}.editor_controls .fold__top--open:hover{background-color:var(--fold-header-background-base)}.editor_controls .fold__top__icon{display:block;margin-right:var(--spacing-quarter-unit);-webkit-transform:translateY(-1px);transform:translateY(-1px)}.editor_controls .fold__top__title{margin-left:var(--spacing-half-unit)/3;font-size:var(--font-size-medium);line-height:var(--font-size-medium);font-weight:var(--font-weight-semibold);-webkit-transform:translateY(1px);transform:translateY(1px);white-space:nowrap;max-width:230px;letter-spacing:.2px;text-overflow:ellipsis;overflow:hidden}.editor_controls .fold__top__arrow{-webkit-transform:translateX(-3px) translateY(-1px);transform:translateX(-3px) translateY(-1px)}.editor_controls .fold__top__arrow svg{will-change:transform;transition:-webkit-transform .1s ease-in-out;transition:transform .1s ease-in-out;transition:transform .1s ease-in-out,-webkit-transform .1s ease-in-out;-webkit-transform:rotate(-90deg);transform:rotate(-90deg);font-weight:700;-webkit-transform-origin:center center;transform-origin:center center}.editor_controls .fold__top__arrow-title{display:flex;flex-grow:1}.editor_controls .fold__top__arrow--open svg{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.editor_controls .fold__top__delete{font-size:18px;opacity:.75;-webkit-transform:translateY(-2px);transform:translateY(-2px)}.editor_controls .fold__top__delete:hover{opacity:1}.editor_controls .fold__content{background:var(--color-background-top);border:var(--border-default);border-width:0 1px 1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.editor_controls .fold__content__plot{overflow:hidden;border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .fold__content>:first-child{border-top:0}.editor_controls .fold__content__empty{font-family:var(--font-family-headings);display:flex;flex-direction:column;justify-content:center;padding:30px 25px}.editor_controls .fold__content__empty__icon{margin:0 auto;margin-bottom:15px;width:40px;height:40px;border-radius:50%;background-color:var(--color-dodger);display:flex;flex-direction:column;justify-content:center}.editor_controls .fold__content__empty__icon svg{margin:0 auto!important;fill:#fff;width:23px;height:23px}.editor_controls .fold__content__empty__message__primary{text-align:center;margin-bottom:20px;font-size:17px;color:var(--color-text-base)}.editor_controls .fold__content__empty__message__secondary{font-family:var(--font-family-body);font-size:var(--font-size-small);text-align:center;color:var(--color-text-base)}.editor_controls .fold__content--noheader{border-width:1px}.editor_controls .fold .fold:last-child{margin-bottom:0}.editor_controls .section__heading{position:relative;display:flex;font-size:var(--font-size-base);color:var(--color-text-section-header);font-weight:var(--font-weight-semibold);cursor:default;background-color:var(--color-background-light);padding:var(--spacing-quarter-unit) var(--spacing-half-unit);clear:both;text-transform:capitalize}.editor_controls .section:not(:first-child) .section__heading{border-top:var(--border-light)}.editor_controls .section:first-child .section__heading{border-top:0}.editor_controls .menupanel{padding-top:0;display:flex;justify-content:flex-end;flex-grow:1}.editor_controls .menupanel--ownline{padding-top:var(--spacing-quarter-unit);width:100%}.editor_controls .menupanel__label{font-weight:var(--font-weight-semibold);padding-right:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon{vertical-align:middle;width:15px!important;height:15px!important;fill:var(--color-text-light)!important;padding-left:var(--spacing-quarter-unit)}.editor_controls .menupanel__icon svg{display:block}.editor_controls .menupanel__icon:hover{cursor:pointer;fill:var(--color-accent)!important}.editor_controls .menupanel__icon-span{font-size:var(--font-size-small);display:flex}.editor_controls .menupanel__icon-span--question{color:var(--color-text-base)}.editor_controls .info__title{color:var(--color-text-headings);font-size:var(--font-size-heading-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-head);font-family:var(--font-family-headings);letter-spacing:var(--font-letter-spacing-headings);padding:var(--spacing-half-unit) var(--spacing-half-unit) var(--spacing-quarter-unit)}.editor_controls .info__text{padding:var(--spacing-quarter-unit) var(--spacing-half-unit)}.editor_controls .info__sub-text,.editor_controls .info__text{color:var(--color-text-base);font-size:var(--font-size-small);font-weight:var(--font-weight-normal);line-height:var(--font-leading-body)}.editor_controls .info__sub-text{font-style:italic;padding:var(--spacing-quarter-unit) var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .modalbox{position:absolute;border-radius:var(--border-radius);overflow:hidden;text-transform:none;text-align:left;border:var(--border-default);align-content:center;box-shadow:var(--box-shadow-base);left:calc(var(--spacing-quarter-unit) * -1);width:calc(100% + var(--spacing-half-unit));top:calc(100% + var(--spacing-quarter-unit));background-color:var(--color-background-top);z-index:9}.editor_controls .modalbox__cover{position:fixed;top:0;right:0;bottom:0;left:0;z-index:-1}.editor_controls .modalbox--dark{background-color:var(--color-background-inverse)}.editor_controls .modalbox--relative{position:relative}.editor_controls .field .modalbox{width:100%;left:-1px;top:100%}.editor_controls .modal{box-sizing:border-box;position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:flex-start;overflow-y:auto;justify-content:center;z-index:1003}.editor_controls .modal *{box-sizing:border-box}.editor_controls .modal__backdrop{height:100%;width:100%;left:0;top:0;position:fixed;opacity:0;will-change:opacity;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .modal__backdrop:before{content:"";height:100%;width:100%;left:0;opacity:.5;top:0;background:var(--color-background-dark);position:fixed}.editor_controls .modal__card{background:var(--color-background-top);border-radius:var(--border-radius);position:relative;z-index:1003;max-width:calc(100% - var(--spacing-base-unit));box-shadow:var(--box-shadow-base);display:flex;flex-direction:column;will-change:opacity,transform;flex-grow:0;margin:5vh 10vw;-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:.1s;animation-delay:.1s}.editor_controls .modal__header{display:flex;justify-content:space-between;align-items:center;color:var(--color-text-base);padding:var(--spacing-half-unit);font-weight:var(--font-weight-semibold)}.editor_controls .modal__header__close{opacity:.5}.editor_controls .modal__header__close:hover{cursor:pointer;opacity:1}.editor_controls .modal__header__close svg{display:block}.editor_controls .modal__header__close svg *{fill:currentColor}.editor_controls .modal__content{flex-grow:1;background-color:var(--color-background-light);border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.editor_controls .modal--animate-out{pointer-events:none}.editor_controls .modal--animate-out .modal__backdrop,.editor_controls .modal--animate-out .modal__card{-webkit-animation-duration:.85s;animation-duration:.85s;-webkit-animation-delay:0s;animation-delay:0s}.editor_controls .panel .react-tabs{flex-grow:1;display:flex;flex-direction:column}.editor_controls .panel .react-tabs__tab{flex-grow:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:var(--spacing-quarter-unit);color:var(--color-text-base);font-size:var(--font-size-base);background:var(--color-background-medium);border:var(--border-default);border-bottom:0;position:relative;background:var(--color-background-light);transition:border-color .15s ease-in-out}.editor_controls .panel .react-tabs__tab-list{background:var(--color-background-medium);margin:0;flex-shrink:0;list-style:none;display:flex;align-items:flex-end;padding:var(--spacing-half-unit) var(--spacing-half-unit) 0;height:32px}.editor_controls .panel .react-tabs__tab:first-of-type{border-top-left-radius:var(--border-radius)}.editor_controls .panel .react-tabs__tab:last-of-type{border-top-right-radius:var(--border-radius);border-left:none}.editor_controls .panel .react-tabs__tab:hover{background-color:var(--color-background-base);cursor:pointer}.editor_controls .panel .react-tabs__tab--selected{background-color:var(--color-background-base);pointer-events:none;margin-top:0;color:var(--color-text-active);border-top-color:var(--color-accent);border-top-width:2px}.editor_controls .panel .react-tabs__tab--selected:before{position:absolute;top:100%;width:100%;height:1px;content:"";background-color:var(--color-background-base);left:0;z-index:4}.editor_controls .panel .react-tabs__tab:not(:first-of-type):not(:last-of-type){border-left:0}.editor_controls .panel .react-tabs__tab-panel{border-top:var(--border-default);display:none}.editor_controls .panel .react-tabs__tab-panel--selected{flex-grow:1;display:flex;flex-direction:column}.editor_controls .field{align-items:flex-start;border-top:var(--border-light);color:var(--color-text-base);display:flex;font-size:var(--font-size-base);font-weight:var(--font-weight-normal);justify-content:flex-start;line-height:var(--font-size-base);min-height:32px;padding:var(--spacing-quarter-unit) 0;width:100%;position:relative}.editor_controls .field__no-title{width:100%;padding:0 var(--spacing-half-unit);align-self:center;line-height:var(--font-leading-body)}.editor_controls .field__no-title--center{text-align:center}.editor_controls .field__widget{display:flex;flex-wrap:wrap;flex-basis:0;padding-right:var(--spacing-half-unit);padding-left:var(--spacing-half-unit);align-self:center}.editor_controls .field__widget:not(.field__widget--units){flex-grow:1}.editor_controls .field__widget--units{padding-right:0}.editor_controls .field__units{align-self:center}.editor_controls .field__title{width:80px;padding-left:var(--spacing-half-unit);display:block;font-size:var(--font-size-small);line-height:var(--font-leading-body);color:var(--color-text-base);padding-top:var(--spacing-quarter-unit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.editor_controls .field__title-text{text-transform:capitalize;cursor:default}.editor_controls .field__delete{display:flex;align-items:center;justify-content:center;padding-left:var(--spacing-quarter-unit);opacity:.5}.editor_controls .field__delete svg{display:block}.editor_controls .field__delete svg path{fill:var(--color-text-base)}.editor_controls .field__delete:hover{cursor:pointer;opacity:1}.editor_controls .field__delete:hover svg path{fill:var(--color-sienna)}.editor_controls .field .rect,.editor_controls .field .square{border-color:var(--color-accent)}.editor_controls .field .rect-grid{border-color:var(--panel-background)!important;float:left;border-top:1px solid;border-left:1px solid}.editor_controls .field .rect-container{margin:0 auto;position:relative;max-width:294px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .field__widget{flex-basis:auto}}.editor_controls .field .field{border-top:none}.editor_controls .field .field .field__no-title{padding:0}.editor_controls .symbol-selector__toggle{border:var(--border-default);border-radius:var(--border-radius);width:80px;cursor:pointer;padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) 3px}.editor_controls .symbol-selector__toggle:after,.editor_controls .symbol-selector__toggle:before{content:" ";display:table}.editor_controls .symbol-selector__toggle:after{clear:both}.editor_controls .symbol-selector__toggle--dark{background-color:var(--color-background-inverse)}.editor_controls .symbol-selector__toggle__option{float:left}.editor_controls .symbol-selector__toggle__caret{float:right;fill:var(--color-text-light);padding-top:var(--spacing-eighth-unit);width:13px!important;height:13px!important}.editor_controls .symbol-selector__menu{max-width:225px;position:absolute;z-index:1003;border:var(--border-default);padding:var(--spacing-half-unit);box-shadow:2px 2px var(--spacing-half-unit) var(--color-border-light);border-radius:var(--border-radius-small);left:var(--spacing-base-unit)}.editor_controls .symbol-selector__item{display:inline}.editor_controls .symbol-selector__symbol:hover{background-color:var(--color-border-default)}.editor_controls button{display:inline-block;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);line-height:1;letter-spacing:.5px;text-transform:capitalize;text-align:center;cursor:pointer;height:36px;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:var(--font-size-medium);font-weight:var(--font-weight-semibold);font-family:var(--font-family-body);border:1px solid transparent;border-radius:var(--border-radius);transition:all .15s ease-in-out}.editor_controls button.button{padding-left:0}.editor_controls .button__wrapper{display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.editor_controls .button__label{padding-left:var(--spacing-half-unit)}.editor_controls .button__icon{display:flex;padding-left:var(--spacing-quarter-unit);will-change:transform}.editor_controls .button__icon svg{-webkit-transform:scale(.8);transform:scale(.8);-webkit-transform-origin:center center;transform-origin:center center;display:block}.editor_controls .button__icon svg path{fill:currentColor}.editor_controls .button__icon+.button__label{padding-left:0}.sidebar .button{width:calc(100% - var(--spacing-base-unit));margin-left:var(--spacing-half-unit);margin-right:var(--spacing-half-unit)}.editor_controls .button--no-text{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px}.editor_controls .button--no-text:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--no-text--disabled{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text);padding-right:var(--spacing-quarter-unit);margin-left:5px;color:#bababa;cursor:default}.editor_controls .button--no-text--disabled:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--no-text--disabled:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--default{background-color:var(--color-button-default-base-fill);border-color:var(--color-button-default-base-border);color:var(--color-button-default-base-text)}.editor_controls .button--default:hover:not(.button--no-text--disabled){background-color:var(--color-button-default-hover-fill);border:1px solid var(--color-button-default-hover-border);color:var(--color-button-default-hover-text)}.editor_controls .button--default:active:not(.button--no-text--disabled){background-color:var(--color-button-default-active-fill);border:1px solid var(--color-button-default-active-border);color:var(--color-button-default-active-text)}.editor_controls .button--primary{background-color:var(--color-button-primary-base-fill);border-color:var(--color-button-primary-base-border);color:var(--color-button-primary-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--primary svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--primary:hover:not(.button--no-text--disabled){background-color:var(--color-button-primary-hover-fill);border:1px solid var(--color-button-primary-hover-border);color:var(--color-button-primary-hover-text)}.editor_controls .button--primary:active:not(.button--no-text--disabled){background-color:var(--color-button-primary-active-fill);border:1px solid var(--color-button-primary-active-border);color:var(--color-button-primary-active-text)}.editor_controls .button--secondary{background-color:var(--color-button-secondary-base-fill);border-color:var(--color-button-secondary-base-border);color:var(--color-button-secondary-base-text)}.editor_controls .button--secondary:hover:not(.button--no-text--disabled){background-color:var(--color-button-secondary-hover-fill);border:1px solid var(--color-button-secondary-hover-border);color:var(--color-button-secondary-hover-text)}.editor_controls .button--secondary:active:not(.button--no-text--disabled){background-color:var(--color-button-secondary-active-fill);border:1px solid var(--color-button-secondary-active-border);color:var(--color-button-secondary-active-text)}.editor_controls .button--tertiary{background-color:var(--color-button-tertiary-base-fill);border-color:var(--color-button-tertiary-base-border);color:var(--color-button-tertiary-base-text)}.editor_controls .button--tertiary:hover:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-hover-fill);border:1px solid var(--color-button-tertiary-hover-border);color:var(--color-button-tertiary-hover-text)}.editor_controls .button--tertiary:active:not(.button--no-text--disabled){background-color:var(--color-button-tertiary-active-fill);border:1px solid var(--color-button-tertiary-active-border);color:var(--color-button-tertiary-active-text)}.editor_controls .button--upgrade{background-color:var(--color-button-upgrade-base-fill);border-color:var(--color-button-upgrade-base-border);color:var(--color-button-upgrade-base-text);text-shadow:var(--text-shadow-dark-ui)}.editor_controls .button--upgrade svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .button--upgrade:hover:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-hover-fill);border:1px solid var(--color-button-upgrade-hover-border);color:var(--color-button-upgrade-hover-text)}.editor_controls .button--upgrade:active:not(.button--no-text--disabled){background-color:var(--color-button-upgrade-active-fill);border:1px solid var(--color-button-upgrade-active-border);color:var(--color-button-upgrade-active-text)}.editor_controls .button--header{background-color:var(--color-button-header-base-fill);border-color:var(--color-button-header-base-border);color:var(--color-button-header-base-text)}.editor_controls .button--header:hover:not(.button--no-text--disabled){background-color:var(--color-button-header-hover-fill);border:1px solid var(--color-button-header-hover-border);color:var(--color-button-header-hover-text)}.editor_controls .button--header:active:not(.button--no-text--disabled){background-color:var(--color-button-header-active-fill);border:1px solid var(--color-button-header-active-border);color:var(--color-button-header-active-text)}.editor_controls .checkbox__group{padding-left:var(--spacing-half-unit);text-align:left}.editor_controls .checkbox__item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;padding-top:var(--spacing-eighth-unit);padding-bottom:var(--spacing-eighth-unit)}.editor_controls .checkbox__item--vertical{display:block;clear:both}.editor_controls .checkbox__box{height:18px;width:18px;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer;display:inline-block;vertical-align:middle;text-align:center;position:relative}.editor_controls .checkbox__box:hover{background:var(--color-background-light)}.editor_controls .checkbox__box--checked{border:var(--border-accent-shade);background:var(--color-accent)}.editor_controls .checkbox__box--checked:hover{background:var(--color-accent-shade)}.editor_controls .checkbox__box--checked+.checkbox__label{color:var(--color-text-active)}.editor_controls .checkbox__check{color:var(--color-text-base);font-size:var(--spacing-half-unit);position:absolute;height:100%;width:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.editor_controls .checkbox__check svg{-webkit-filter:drop-shadow(0 1px 2px rgba(42,63,95,.7));filter:drop-shadow(0 1px 2px rgba(42,63,95,.7))}.editor_controls .checkbox__check svg path{fill:var(--color-white)}.editor_controls .checkbox__label{padding-left:var(--spacing-quarter-unit);font-size:var(--font-size-base);color:var(--color-text-base);display:inline-block;line-height:20px;text-align:left;vertical-align:middle;cursor:pointer}.editor_controls .colorpicker__controls .colorpicker__active,.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider,.editor_controls .colorpicker__saturation{position:relative;overflow:hidden;border:var(--border-default);border-radius:var(--border-radius-small);cursor:pointer}.editor_controls .colorpicker{display:flex;width:26px;height:26px;border-radius:100%;border:var(--border-default);padding:var(--spacing-eighth-unit)}.editor_controls .colorpicker__outer{width:185px}.editor_controls .colorpicker__container{display:flex;align-items:center;line-height:2;position:relative;width:185px}.editor_controls .colorpicker__selected-color{margin-left:var(--spacing-half-unit);color:var(--color-text-base);font-weight:var(--font-weight-semibold);font-size:var(--font-size-small);display:inline-block;vertical-align:middle;text-transform:uppercase}.editor_controls .colorpicker__swatch{border-radius:50%;flex-grow:1;width:100%;height:100%}.editor_controls .colorpicker__saturation{height:100px}.editor_controls .colorpicker__custom-input{padding-top:var(--spacing-eighth-unit)}.editor_controls .colorpicker__custom-input input{border:var(--border-default)!important;box-shadow:none!important;background-color:var(--color-background-inputs);color:var(--color-text-dark)}.editor_controls .colorpicker__custom-input input+span{color:var(--color-text)!important}.editor_controls .colorpicker__controls .colorpicker__sliders{width:100%}.editor_controls .colorpicker__controls .colorpicker__sliders .colorpicker__slider{margin:auto 0;height:10px;margin:var(--spacing-eighth-unit) 0}.editor_controls .colorpicker__controls .colorpicker__active{height:var(--spacing-base-unit);width:var(--spacing-base-unit);margin:var(--spacing-eighth-unit) 0 0 var(--spacing-half-unit)}.editor_controls .colorpicker__controls .colorpicker__active .colorpicker__active-swatch{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--border-radius-small);border:1px solid #eee}.editor_controls .fold .fold .colorpicker__container{width:calc($colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit))}.editor_controls .colorscalePickerContainer{min-width:215px;position:relative;padding:0;resize:none;border:none;background:none}.editor_controls .colorscalePickerContainer::-webkit-scrollbar{width:5px}.editor_controls .colorscaleDescription,.editor_controls .colorscalePickerTopContainer{display:none}.editor_controls .colorscalePickerContainer input:focus{outline:none}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .colorscalePickerContainer{display:inline}}.editor_controls .colorscalePickerBottomContainer{padding-right:3px}.editor_controls .customPickerContainer{margin-top:var(--spacing-quarter-unit);text-align:left}.editor_controls .customPickerContainer__outer{width:215px;text-align:center}.editor_controls .dropdown-container{flex-grow:1}.editor_controls .dropdown-container .Select{position:relative}.editor_controls .dropdown-container .Select input::-webkit-contacts-auto-fill-button,.editor_controls .dropdown-container .Select input::-webkit-credentials-auto-fill-button{display:none!important}.editor_controls .dropdown-container .Select input::-ms-clear,.editor_controls .dropdown-container .Select input::-ms-reveal{display:none!important}.editor_controls .dropdown-container .Select,.editor_controls .dropdown-container .Select div,.editor_controls .dropdown-container .Select input,.editor_controls .dropdown-container .Select span{box-sizing:border-box}.editor_controls .dropdown-container .Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.editor_controls .dropdown-container .Select.is-disabled>.Select-control{background-color:#f9f9f9}.editor_controls .dropdown-container .Select.is-disabled>.Select-control:hover{box-shadow:none}.editor_controls .dropdown-container .Select.is-searchable.is-focused:not(.is-open)>.Select-control,.editor_controls .dropdown-container .Select.is-searchable.is-open>.Select-control{cursor:text}.editor_controls .dropdown-container .Select.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9;border-color:var(--color-border-dark);background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-arrow{top:-2px;border-color:transparent transparent #999;border-width:0 5px 5px}.editor_controls .dropdown-container .Select.is-focused>.Select-control{background:#fff;background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px fade(#08c,50%);border-color:var(--color-border-accent)}.editor_controls .dropdown-container .Select.has-value.is-clearable.Select--single>.Select-control .Select-value{padding-right:42px}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value .Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value .Select-value-label{color:#333;color:var(--color-text-base)}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label{cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:hover,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:hover{color:#08c;outline:none;text-decoration:underline}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused.Select--single>.Select-control .Select-value a.Select-value-label:focus,.editor_controls .dropdown-container .Select.has-value.Select--single>.Select-control .Select-value a.Select-value-label:focus{background:#fff}.editor_controls .dropdown-container .Select.has-value.is-pseudo-focused .Select-input{opacity:0}.editor_controls .dropdown-container .Select.is-open .Select-arrow,.editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow{border-top-color:#666}.editor_controls .dropdown-container .Select.Select--rtl{direction:rtl;text-align:right}.editor_controls .dropdown-container .Select-control{background-color:#fff;border-color:#d9d9d9 #ccc #b3b3b3;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;border-spacing:0;border-collapse:separate;height:36px;outline:none;overflow:hidden;position:relative;width:100%;background-color:var(--color-background-inputs);border:var(--border-default);box-shadow:none!important;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.editor_controls .dropdown-container .Select-control .Select-input:focus{outline:none;background:#fff}.editor_controls .dropdown-container .Select--single>.Select-control .Select-value,.editor_controls .dropdown-container .Select-placeholder{bottom:0;color:#aaa;left:0;line-height:34px;padding-left:10px;padding-right:10px;position:absolute;right:0;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-text-base)}.editor_controls .dropdown-container .Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.editor_controls .dropdown-container .Select-input>input{width:100%;background:none transparent;border:0 none;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;margin:0;outline:none;line-height:17px;padding:8px 0 12px;-webkit-appearance:none}.is-focused .editor_controls .dropdown-container .Select-input>input{cursor:text}.editor_controls .dropdown-container .Select-control:not(.is-searchable)>.Select-input{outline:none}.editor_controls .dropdown-container .Select-loading-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:16px}.editor_controls .dropdown-container .Select-loading{-webkit-animation:e .4s infinite linear;animation:e .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block;position:relative;vertical-align:middle}.editor_controls .dropdown-container .Select-clear-zone{-webkit-animation:d .2s;animation:d .2s;color:#999;cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:17px}.editor_controls .dropdown-container .Select-clear-zone:hover{color:#d0021b}.editor_controls .dropdown-container .Select-clear{display:inline-block;font-size:18px;line-height:1}.editor_controls .dropdown-container .Select--multi .Select-clear-zone{width:17px}.editor_controls .dropdown-container .Select--multi .Select-multi-value-wrapper{display:inline-block}.editor_controls .dropdown-container .Select .Select-aria-only{position:absolute;display:inline-block;height:1px;width:1px;margin:-1px;clip:rect(0,0,0,0);overflow:hidden;float:left}.editor_controls .dropdown-container .Select-arrow-zone{cursor:pointer;display:table-cell;position:relative;text-align:center;vertical-align:middle;width:25px;padding-right:5px}.Select--rtl .editor_controls .dropdown-container .Select-arrow-zone{padding-right:0;padding-left:5px}.editor_controls .dropdown-container .Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0;position:relative;border-color:var(--color-border-default) transparent transparent}@-webkit-keyframes d{0%{opacity:0}to{opacity:1}}@keyframes d{0%{opacity:0}to{opacity:1}}.editor_controls .dropdown-container .Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;left:0;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch;border:var(--border-default);border-top-color:var(--color-border-default);background-color:transparent;box-shadow:var(--box-shadow-base)}.editor_controls .dropdown-container .Select-menu{max-height:198px;overflow-y:auto}.editor_controls .dropdown-container .Select-option{box-sizing:border-box;background-color:#fff;color:#666;cursor:pointer;display:block;padding:8px 10px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .dropdown-container .Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.editor_controls .dropdown-container .Select-option.is-selected{background-color:#f5faff;color:#333;color:var(--color-text-active);font-weight:var(--font-weight-semibold);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-option.is-focused{background-color:#f2f9fc;color:#333;background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .dropdown-container .Select-option.is-disabled{color:#ccc;cursor:default}.editor_controls .dropdown-container .Select-noresults{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.editor_controls .dropdown-container .Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-input{margin-left:0;margin-right:10px}.editor_controls .dropdown-container .Select--multi.has-value .Select-input{margin-left:5px}.editor_controls .dropdown-container .Select--multi .Select-value{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-left:5px;margin-top:5px;vertical-align:top}.editor_controls .dropdown-container .Select--multi .Select-value-icon,.editor_controls .dropdown-container .Select--multi .Select-value-label{display:inline-block;vertical-align:middle}.editor_controls .dropdown-container .Select--multi .Select-value-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.editor_controls .dropdown-container .Select--multi a.Select-value-label{color:#08c;cursor:pointer;text-decoration:none}.editor_controls .dropdown-container .Select--multi a.Select-value-label:hover{text-decoration:underline}.editor_controls .dropdown-container .Select--multi .Select-value-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.editor_controls .dropdown-container .Select--multi .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi .Select-value-icon:hover{background-color:#ddeff7;color:#0077b3}.editor_controls .dropdown-container .Select--multi .Select-value-icon:active{background-color:#c9e6f2}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value{margin-left:0;margin-right:5px}.editor_controls .dropdown-container .Select--multi.Select--rtl .Select-value-icon{border-right:none;border-left:1px solid #c9e6f2}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value{background-color:#fcfcfc;border:1px solid #e3e3e3;color:#333}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon{cursor:not-allowed;border-right:1px solid #e3e3e3}.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:active,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:focus,.editor_controls .dropdown-container .Select--multi.is-disabled .Select-value-icon:hover{background-color:#fcfcfc}.editor_controls .dropdown-container:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .dropdown-container .Select.is-focused>.Select-control .Select-input,.editor_controls .dropdown-container .Select.is-open>.Select-control .Select-input,.editor_controls .dropdown-container .Select:not(.is-open) .Select-control{background-color:var(--color-background-inputs)!important}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover{border-color:var(--color-border-dark)}.editor_controls .dropdown-container .Select:not(.is-open) .Select-control:hover .Select-arrow{opacity:1}.editor_controls .dropdown-container .editor_controls .dropdown-container .Select .Select-arrow-zone:hover>.Select-arrow,.editor_controls .dropdown-container .Select.is-open .Select-arrow{border-color:transparent transparent var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-arrow-zone:hover .Select-arrow{border-top-color:var(--color-border-accent)!important}.editor_controls .dropdown-container .Select-option:hover{color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .dropdown-container .Select-value-label{color:var(--color-text-base)!important}.editor_controls .dropdown-container .Select-placeholder{color:var(--color-text-placeholder)}.editor_controls .dropdown-container .dropdown--dark .Select-control,.editor_controls .dropdown-container .dropdown--dark .Select-option{background-color:var(--color-background-inverse)}.editor_controls .dropdown-container .dropdown--dark .Select-option.is-selected{background-color:var(--color-border-default)}.editor_controls .dropdown-container .dropdown--dark .Select.is-focused{background-color:var(--color-border-light)}.editor_controls ::-webkit-input-placeholder{color:var(--color-text-placeholder)}.editor_controls ::-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls :-ms-input-placeholder{color:var(--color-text-placeholder)}.editor_controls :-moz-placeholder{color:var(--color-text-placeholder)}.editor_controls .numeric-input__wrapper{line-height:20px;max-width:100%;flex:1;display:flex;align-items:center;color:var(--color-text-base)}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.editor_controls .numeric-input__wrapper{flex-basis:auto}}.editor_controls .numeric-input__number{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:62px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .numeric-input__caret-box{display:inline-block;max-height:32px;margin-left:var(--spacing-quarter-unit);margin-right:var(--spacing-half-unit);vertical-align:middle;box-sizing:border-box}.editor_controls .numeric-input__caret:first-child{margin-bottom:2px}.editor_controls .numeric-input__caret{cursor:pointer;background-color:var(--color-background-light);border:var(--border-default);border-radius:1px;line-height:var(--spacing-half-unit);text-align:center}.editor_controls .numeric-bottom-caret-modifier,.editor_controls .numeric-top-caret-modifier{width:13px!important;height:13px!important;fill:var(--color-text-base)!important}.editor_controls .text-input{display:inline-block;border:var(--border-default);background:var(--color-background-inputs);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;border-radius:var(--border-radius-small);padding:var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-quarter-unit) var(--spacing-half-unit);width:140px;vertical-align:middle;font-size:inherit;color:inherit;font-family:inherit}.editor_controls .radio-block{width:100%;line-height:var(--font-leading-head);display:flex}.editor_controls .radio-block__option{flex-grow:1;padding:var(--spacing-quarter-unit) var(--spacing-half-unit);background-color:var(--color-background-top);border:var(--border-default);display:inline-block;cursor:pointer;min-width:0;text-align:center;font-size:var(--font-size-small)}.editor_controls .radio-block__option:not(.radio-block__option--active):hover{background-color:var(--color-background-light);color:var(--color-text-active)}.editor_controls .radio-block__option--active{background-color:var(--color-button-primary-base-fill);color:var(--color-button-primary-base-text);border:1px solid var(--color-button-primary-base-border);margin-left:-1px;cursor:default;text-shadow:var(--text-shadow-dark-ui);font-weight:var(--font-weight-semibold)}.editor_controls .radio-block__option--active:last-child,.editor_controls .radio-block__option--active:not(:first-child){border-left:var(--border-accent-shade)!important}.editor_controls .radio-block__option:not(:first-child):not(:last-child){border-left:0}.editor_controls .radio-block__option:last-child{border-top-right-radius:var(--border-radius-small);border-bottom-right-radius:var(--border-radius-small);border-left:0}.editor_controls .radio-block__option:first-child{border-top-left-radius:var(--border-radius-small);border-bottom-left-radius:var(--border-radius-small)}.editor_controls .radio-block__option:first-child:not(.radio-block__option--active){border-left:var(--border-default)}.editor_controls .text-editor{overflow:hidden;border:var(--border-default);border-radius:var(--border-radius);min-height:155px;display:flex;flex-direction:column;flex-grow:1}.editor_controls .text-editor *{box-sizing:border-box}.editor_controls .text-editor textarea[class=multi-format-editor__latex]{height:155px;width:100%;margin:10px;border:var(--border-default)}.editor_controls .text-editor textarea[class=multi-format-editor__html]{height:145px;width:100%}.editor_controls .text-editor textarea{width:100%;height:100%;border:none;overflow:auto;outline:none;box-shadow:none;padding:var(--spacing-quarter-unit);resize:none;line-height:24px;font-size:13px;color:var(--color-text-base);background-color:var(--color-background-inputs)}.editor_controls .multi-format-editor__root{display:flex;overflow:hidden;height:205px}.editor_controls .multi-format-editor__root__wrapper{flex-grow:1;display:flex;flex-wrap:wrap;align-items:stretch;flex-direction:column}.editor_controls .multi-format-editor__tabs{height:30px;display:block;width:100%}.editor_controls .multi-format-editor__tab{text-align:center;height:30px;line-height:28px;box-sizing:border-box}.editor_controls .multi-format-editor__tab.top-tab{width:50%;overflow:hidden;color:var(--color-text-base);display:inline-block}.editor_controls .multi-format-editor__tab.top-tab.left{border-top-left-radius:5px;border-right:var(--border-default)}.editor_controls .multi-format-editor__tab.top-tab.right{border-top-right-radius:5px}.editor_controls .multi-format-editor__tab.top-tab:not(.selected){border-bottom:var(--border-default)}.editor_controls .multi-format-editor__tab.bottom-tab{border-top:var(--border-default);width:100%;display:block;color:var(--color-text-base)}.editor_controls .multi-format-editor__tab.selected{background:var(--color-background-light);font-weight:var(--font-weight-semibold)}.editor_controls .multi-format-editor__tab:hover:not(.selected){cursor:pointer;color:var(--color-text-active);background-color:var(--color-background-light)}.editor_controls .multi-format-editor__content__wrapper__rich_text{flex-grow:1;display:flex;flex-direction:column}.editor_controls .multi-format-editor__content__wrapper__latex{background-color:var(--color-background-light);display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__content__wrapper__html{display:flex;align-items:center;justify-content:center}.editor_controls .multi-format-editor__confirmation-panel{height:100%;max-height:100%;width:100%;text-align:center;display:flex;flex-direction:column;align-items:flex-start;flex:1}.editor_controls .multi-format-editor__confirmation-panel__header{color:var(--color-text-section-header);margin-top:0;margin-bottom:5px;font-weight:600}.editor_controls .multi-format-editor__confirmation-panel__content{overflow-y:auto;display:flex;flex-direction:column;-webkit-overflow-scrolling:touch;padding:var(--spacing-half-unit)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__content::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__actions{padding:var(--spacing-half-unit);width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid var(--color-border-light);-webkit-overflow-scrolling:touch}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar{background:#fff;width:5px}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-track{box-shadow:none;background:var(--scrollbar-track-background)}.editor_controls .multi-format-editor__confirmation-panel__actions::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:10px}.editor_controls .multi-format-editor__confirmation-panel__message{line-height:20px}.editor_controls .multi-format-editor__confirmation-panel__message-primary{font-weight:var(--font-weight-semibold);color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__message-secondary{color:var(--color-text-base)}.editor_controls .multi-format-editor__confirmation-panel__continue-button{margin-left:10px}.editor_controls .rich-text-editor__root{border-top:none;width:100%;color:var(--color-text-base);display:flex;flex-direction:column;flex-grow:1}.editor_controls .rich-text-editor__editor{cursor:text;position:relative;flex-grow:1}.editor_controls .rich-text-editor__editor>div{position:absolute;width:100%;height:100%;max-width:100%;max-height:100%;overflow:auto;flex-grow:1;left:0;top:0}.editor_controls .rich-text-editor__controls{display:flex;justify-content:space-evenly;background:var(--color-background-light);font-size:14px;padding:10px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:var(--border-default)}.editor_controls .rich-text-editor__controls .icon-link{-webkit-transform:translateY(3px);transform:translateY(3px);display:inline-block;fill:var(--color-text-base);width:15px!important;height:15px!important}.editor_controls .rich-text-editor__link-editor{background-color:var(--color-background-light);border:var(--border-default);padding:var(--spacing-half-unit);position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;flex-direction:column}.editor_controls .rich-text-editor__link-editor__label{display:block}.editor_controls .rich-text-editor__link-editor__input{border:var(--border-default);color:var(--color-text-base);overflow:scroll;padding:0 10px;width:100%;margin-top:10px}.editor_controls .rich-text-editor__styleButton{color:var(--color-text-base);cursor:pointer;display:inline-block;margin:0;min-height:var(--spacing-base-unit);min-width:var(--spacing-base-unit);text-align:center;background-color:transparent;border:var(--border-default);border-radius:var(--border-radius-small);line-height:20px;position:relative}.editor_controls .rich-text-editor__styleButton__wrapper{padding:0 var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__styleButton--active,.editor_controls .rich-text-editor__styleButton--active:hover{background-color:var(--color-accent);border:var(--border-accent-shade);color:var(--color-white)}.editor_controls .rich-text-editor__styleButton--active:hover:before{-webkit-transform:scaleX(0);transform:scaleX(0)}.editor_controls .rich-text-editor__styleButton:before{content:"";position:absolute;bottom:-1px;height:1px;width:calc(100% + 2px);left:-1px;background:var(--color-accent);will-change:transform;-webkit-transform-origin:center center;transform-origin:center center;-webkit-transform:scaleX(0);transform:scaleX(0);transition:all .15s ease-in-out}.editor_controls .rich-text-editor__styleButton:hover{color:var(--color-text-active);background-color:var(--color-background-top)}.editor_controls .rich-text-editor__styleButton:hover:before{-webkit-transform:none;transform:none}.editor_controls .rich-text-editor__editor .public-DraftEditor-content,.editor_controls .rich-text-editor__editor .public-DraftEditorPlaceholder-root{padding:var(--spacing-quarter-unit)}.editor_controls .rich-text-editor__editor .public-DraftEditor-content{min-height:100px}.editor_controls .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root{display:none}.editor_controls .rich-text-editor__editor .RichEditor-blockquote{border-left:5px solid #eee;color:#666;font-style:italic;margin:16px 0;padding:10px 20px}.editor_controls .rich-text-editor__editor .public-DraftStyleDefault-pre{background-color:rgba(0,0,0,.05);font-size:16px;padding:20px}.editor_controls .DraftEditor-editorContainer,.editor_controls .DraftEditor-root,.editor_controls .public-DraftEditor-content{height:inherit;text-align:initial}.editor_controls .DraftEditor-root{position:relative}.editor_controls .DraftEditor-editorContainer{background-color:hsla(0,0%,100%,0);border-left:.1px solid transparent;position:relative;z-index:1}.editor_controls .public-DraftEditor-block{position:relative}.editor_controls .DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left}.editor_controls .DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left}.editor_controls .DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center}.editor_controls .DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%}.editor_controls .DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right}.editor_controls .DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right}.editor_controls .public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:0}.editor_controls .public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9}.editor_controls .DraftEditorPlaceholder-hidden{display:none}.editor_controls .public-DraftStyleDefault-block{position:relative;white-space:pre-wrap}.editor_controls .public-DraftStyleDefault-ltr{direction:ltr;text-align:left}.editor_controls .public-DraftStyleDefault-rtl{direction:rtl;text-align:right}.editor_controls .public-DraftStyleDefault-listLTR{direction:ltr}.editor_controls .public-DraftStyleDefault-listRTL{direction:rtl}.editor_controls .public-DraftStyleDefault-ol,.editor_controls .public-DraftStyleDefault-ul{margin:16px 0;padding:0}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:1.5em}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:1.5em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:3em}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:3em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:4.5em}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:4.5em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:6em}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:6em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:7.5em}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:7.5em}.editor_controls .public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc}.editor_controls .public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle}.editor_controls .public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px}.editor_controls .public-DraftStyleDefault-orderedListItem:before{content:counter(a) ". ";counter-increment:a}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(b) ". ";counter-increment:b}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(c) ". ";counter-increment:c}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(d) ". ";counter-increment:d}.editor_controls .public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(e) ". ";counter-increment:e}.editor_controls .public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:a}.editor_controls .public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:b}.editor_controls .public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:c}.editor_controls .public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:d}.editor_controls .public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:e}.editor_controls .rangeslider{margin:0 var(--spacing-quarter-unit);min-width:60px;position:relative;background:var(--color-background-light);touch-action:none;border:1px solid var(--color-border-default);flex-grow:1}.editor_controls .rangeslider,.editor_controls .rangeslider .rangeslider__fill{display:block}.editor_controls .rangeslider .rangeslider__handle{outline:0;background:#fff;border:1px solid var(--color-border-default);cursor:pointer;display:inline-block;position:absolute}.editor_controls .rangeslider .rangeslider__handle .rangeslider__active{opacity:1}.editor_controls .rangeslider .rangeslider__handle-tooltip{width:20px;height:20px;text-align:center;position:absolute;background-color:rgba(0,0,0,.8);font-weight:400;font-size:14px;transition:all .1s ease-in;border-radius:4px;display:inline-block;color:#fff;left:50%;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider .rangeslider__handle-tooltip span{margin-top:12px;display:inline-block;line-height:100%}.editor_controls .rangeslider .rangeslider__handle-tooltip:after{content:" ";position:absolute;width:0;height:0}.editor_controls .rangeslider-horizontal{height:6px;border-radius:10px}.editor_controls .rangeslider-horizontal .rangeslider__fill{height:100%;background-color:var(--color-accent);border:var(--border-accent);border-radius:10px;-webkit-transform:translateY(-1px);transform:translateY(-1px);top:0}.editor_controls .rangeslider-horizontal .rangeslider__handle{width:6.66667px;height:30px;border-radius:20px;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);display:flex;align-items:center;justify-content:center}.editor_controls .rangeslider-horizontal .rangeslider__handle:after{content:" ";position:absolute;width:4px;height:20px;border-radius:5px;background-color:var(--color-accent);display:none}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip{top:-55px}.editor_controls .rangeslider-horizontal .rangeslider__handle-tooltip:after{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid rgba(0,0,0,.8);left:50%;bottom:-8px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .rangeslider-vertical{margin:20px auto;height:150px;max-width:10px;background-color:transparent}.editor_controls .rangeslider-vertical .rangeslider__fill,.editor_controls .rangeslider-vertical .rangeslider__handle{position:absolute}.editor_controls .rangeslider-vertical .rangeslider__fill{width:100%;background-color:#7cb342;box-shadow:none;bottom:0}.editor_controls .rangeslider-vertical .rangeslider__handle{width:30px;height:10px;left:-10px;box-shadow:none}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip{left:-100%;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.editor_controls .rangeslider-vertical .rangeslider__handle-tooltip:after{border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:8px solid rgba(0,0,0,.8);left:100%;top:12px}.editor_controls .rangeslider-reverse.rangeslider-horizontal .rangeslider__fill{right:0}.editor_controls .rangeslider-reverse.rangeslider-vertical .rangeslider__fill{top:0;bottom:inherit}.editor_controls .rangeslider__labels{position:relative}.rangeslider-vertical .editor_controls .rangeslider__labels{position:relative;list-style-type:none;margin:0 0 0 24px;padding:0;text-align:left;width:250px;height:100%;left:10px}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.rangeslider-vertical .editor_controls .rangeslider__labels .rangeslider__label-item:before{content:"";width:10px;height:2px;background:#000;position:absolute;left:-14px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:-1}.editor_controls .rangeslider__labels .rangeslider__label-item{position:absolute;font-size:14px;cursor:pointer;display:inline-block;top:10px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls .trace-grid-single-block{max-width:460px;display:flex;flex-flow:wrap;padding:var(--spacing-quarter-unit)}.editor_controls .trace-grid{display:grid;grid-template-columns:repeat(4,1fr)}@media (max-width:860px){.editor_controls .trace-grid{grid-template-columns:repeat(2,1fr)}}.editor_controls .trace-grid__column{text-align:center;display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;flex-shrink:0;flex-grow:0}.editor_controls .trace-grid__column:nth-of-type(4n+3){-ms-grid-column:1}.editor_controls .trace-grid__column:nth-of-type(4n){-ms-grid-column:2}.editor_controls .trace-grid__column:nth-of-type(4n+1){-ms-grid-column:3}.editor_controls .trace-grid__column:nth-of-type(4n+2){-ms-grid-column:4}.editor_controls .trace-grid__column:nth-of-type(3),.editor_controls .trace-grid__column:nth-of-type(4),.editor_controls .trace-grid__column:nth-of-type(5),.editor_controls .trace-grid__column:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column:nth-of-type(7),.editor_controls .trace-grid__column:nth-of-type(8),.editor_controls .trace-grid__column:nth-of-type(9),.editor_controls .trace-grid__column:nth-of-type(10){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column .trace-item:nth-of-type(2n+2){-ms-grid-column:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(3),.editor_controls .trace-grid__column .trace-item:nth-of-type(4){-ms-grid-row:2}.editor_controls .trace-grid__column .trace-item:nth-of-type(5),.editor_controls .trace-grid__column .trace-item:nth-of-type(6){-ms-grid-row:3}.editor_controls .trace-grid__column .trace-item:nth-of-type(7),.editor_controls .trace-grid__column .trace-item:nth-of-type(8){-ms-grid-row:4}.editor_controls .trace-grid__column:not(:first-of-type){position:relative}.editor_controls .trace-grid__column:not(:first-of-type):before{position:absolute;width:1px;border-left:var(--border-light);height:100%;top:0;left:0;content:""}.editor_controls .trace-grid__column:not(:first-of-type) .trace-grid__column__header{position:relative;z-index:99}.editor_controls .trace-grid__column--double{grid-column:span 2;flex-grow:0}.editor_controls .trace-grid__column--double:nth-of-type(odd){-ms-grid-column:1}.editor_controls .trace-grid__column--double:nth-of-type(2n+2){-ms-grid-column:3}.editor_controls .trace-grid__column--double:nth-of-type(5),.editor_controls .trace-grid__column--double:nth-of-type(6){-ms-grid-row:2}.editor_controls .trace-grid__column--double:nth-of-type(7),.editor_controls .trace-grid__column--double:nth-of-type(8){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+1){-ms-grid-column:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+2){-ms-grid-column:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n+3){-ms-grid-column:3}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4n){-ms-grid-column:4}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(3),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(4){-ms-grid-row:1}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(5),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(6),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(7),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(8){-ms-grid-row:2}.editor_controls .trace-grid__column--double .trace-item:nth-of-type(9),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(10),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(11),.editor_controls .trace-grid__column--double .trace-item:nth-of-type(12){-ms-grid-row:3}.editor_controls .trace-grid__column--double .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(4,1fr)}.editor_controls .trace-grid__column__items{display:grid;grid-gap:0;grid-template-columns:repeat(2,90px);grid-template-rows:repeat(2,112px);flex-grow:1;width:100%;padding:0 var(--spacing-half-unit) var(--spacing-half-unit)}.editor_controls .trace-grid__column__header{text-transform:capitalize;font-weight:var(--font-weight-semibold);text-align:left;border-top:var(--border-light);width:100%;padding:var(--spacing-half-unit) var(--spacing-base-unit) 0;box-sizing:border-box}.editor_controls .trace-grid__column__header,.editor_controls .trace-item{color:var(--color-text-base);display:flex;align-items:center;justify-content:flex-start}.editor_controls .trace-item{width:90px;flex-direction:column;flex-grow:0;margin-top:var(--spacing-half-unit);transition:all .15s ease-in-out;position:relative}.editor_controls .trace-item--active .trace-item__image{border-color:var(--color-accent);border-width:2px;color:var(--color-accent)}.editor_controls .trace-item__actions{position:absolute;width:100%;display:flex;flex-direction:column;top:0;left:var(--spacing-quarter-unit);justify-content:flex-start;align-items:flex-end;z-index:99;height:60px}.editor_controls .trace-item__actions:hover .trace-item__actions__item{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1;pointer-events:auto}.editor_controls .trace-item__actions__item{-webkit-transform:translateX(-10px);transform:translateX(-10px);opacity:0;pointer-events:none;color:var(--color-text-light);transition:all .15s ease-in-out}.editor_controls .trace-item__actions__item:not(:last-child){margin-bottom:var(--spacing-quarter-unit)}.editor_controls .trace-item__actions__item:hover{color:var(--color-accent)}.editor_controls .trace-item__actions__item svg{display:block;width:16px;height:16px;fill:currentColor}.editor_controls .trace-item:hover{cursor:pointer;color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__label{color:var(--color-accent)}.editor_controls .trace-item:hover .trace-item__image{border-color:var(--color-accent)}.editor_controls .trace-item__image{position:relative;z-index:2;border:1px solid var(--color-border-default);width:60px;height:60px;border-radius:var(--border-radius);background:var(--color-background-top);box-shadow:0 2px 9px transparent;display:flex;align-items:center;justify-content:center;transition:all .15s ease-in-out}.editor_controls .trace-item__image__svg{width:100%;flex-grow:1;padding:var(--spacing-quarter-unit)}.editor_controls .trace-item__image svg{display:block}.editor_controls .trace-item__image img{display:block;font-size:10px;color:var(--color-text-base)}.editor_controls .trace-item__image__wrapper{width:100%}.editor_controls .trace-item__label{font-weight:var(--font-weight-semibold);width:72px;height:34px;margin-top:var(--spacing-quarter-unit);color:var(--color-text-base);text-transform:capitalize;font-size:var(--font-size-small);text-align:center}.editor_controls .trace-type-select-dropdown__wrapper>*>*{pointer-events:none}.editor_controls .trace-type-select-dropdown__wrapper>:hover{cursor:pointer}.editor_controls .trace-type-select-dropdown__wrapper>:hover .Select:not(.is-open) .Select-control{border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button{display:flex;align-items:center;border:var(--border-default);width:100%;height:36px;border-radius:var(--border-radius);padding:0 var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button:hover{cursor:pointer;border-color:var(--color-border-dark)}.editor_controls .trace-type-select-button__icon{max-width:20px;width:20px;margin-right:var(--spacing-quarter-unit)}.editor_controls .trace-type-select-button__icon svg{max-width:100%;display:block}.editor_controls .trace-type-select-button__icon svg *{fill:currentColor}.editor_controls .dropzone-container{flex-grow:1;display:flex;align-items:center;justify-content:center;border:1px dashed var(--color-border-default);height:160px;box-sizing:border-box;padding:8px;border-radius:var(--border-radius)}.editor_controls .dropzone-container__content{width:100%;height:100%;text-align:center;background-color:var(--color-rhino-light-5);border-radius:var(--border-radius);display:flex;align-items:center;justify-content:center}.editor_controls .dropzone-container__message{padding:15px}.editor_controls .dropzone-container__image{width:100%;height:100%;background-size:contain;background-position:50%;position:relative;background-repeat:no-repeat}.editor_controls .dropzone-container--active{border-color:var(--color-dodger)}.editor_controls .dropzone-container--rejected{border-color:red}.editor_controls [aria-label][role~=tooltip]{position:relative}.editor_controls [aria-label][role~=tooltip]:after,.editor_controls [aria-label][role~=tooltip]:before{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;display:none;will-change:transform;opacity:0;pointer-events:none;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);position:absolute;box-sizing:border-box;z-index:10;-webkit-transform-origin:top;transform-origin:top}.editor_controls [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:""}.editor_controls [aria-label][role~=tooltip]:after{background:#506784;border-radius:4px;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);text-transform:var(--microtip-text-transform,none);padding:.5em 1em;white-space:nowrap;box-sizing:content-box}.editor_controls [aria-label][role~=tooltip]:focus:after,.editor_controls [aria-label][role~=tooltip]:focus:before,.editor_controls [aria-label][role~=tooltip]:hover:after,.editor_controls [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto;display:block}.editor_controls [role~=tooltip][data-microtip-position|=top]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002C14.285 12.002 8.594 0 2.658 0z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-bottom:5px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position|=top]:after{margin-bottom:11px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);bottom:100%;left:50%}.editor_controls [role~=tooltip][data-microtip-position=top]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=top]:hover:before{-webkit-transform:translate3d(-50%,-5px,0);transform:translate3d(-50%,-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),-5px,0);transform:translate3d(calc(-100% + 16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position=top-right]:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0);bottom:100%}.editor_controls [role~=tooltip][data-microtip-position=top-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),-5px,0);transform:translate3d(calc(0% + -16px),-5px,0)}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002C21.715-.002 27.406 12 33.342 12z'/%3E%3C/svg%3E") no-repeat;height:6px;width:18px;margin-top:5px;margin-bottom:0;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);bottom:auto;left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position|=bottom]:after{margin-top:11px;-webkit-transform:translate3d(-50%,-10px,0);transform:translate3d(-50%,-10px,0);left:10px;top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom]:hover:after,.editor_controls [role~=tooltip][data-microtip-position|=bottom]:hover:before{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:after{-webkit-transform:translate3d(calc(-100% + 16px),-10px,0);transform:translate3d(calc(-100% + 16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-left]:hover:after{-webkit-transform:translate3d(calc(-100% + 16px),0,0);transform:translate3d(calc(-100% + 16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:after{-webkit-transform:translate3d(calc(0% + -16px),-10px,0);transform:translate3d(calc(0% + -16px),-10px,0);top:100%}.editor_controls [role~=tooltip][data-microtip-position=bottom-right]:hover:after{-webkit-transform:translate3d(calc(0% + -16px),0,0);transform:translate3d(calc(0% + -16px),0,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:after,.editor_controls [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;-webkit-transform:translate3d(10px,-50%,0);transform:translate3d(10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=left]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002C12.002 21.715 0 27.406 0 33.342z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-right:5px;margin-bottom:0}.editor_controls [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.editor_controls [role~=tooltip][data-microtip-position=left]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=left]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:after,.editor_controls [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;-webkit-transform:translate3d(-10px,-50%,0);transform:translate3d(-10px,-50%,0)}.editor_controls [role~=tooltip][data-microtip-position=right]:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(80, 103, 132, 1)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002C-.002 14.285 12 8.594 12 2.658z'/%3E%3C/svg%3E") no-repeat;height:18px;width:6px;margin-bottom:0;margin-left:5px}.editor_controls [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.editor_controls [role~=tooltip][data-microtip-position=right]:hover:after,.editor_controls [role~=tooltip][data-microtip-position=right]:hover:before{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.editor_controls [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.editor_controls [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:140px}.editor_controls [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.editor_controls__wrapper{display:flex;flex-grow:1}.editor_controls a{color:#0d76bf;cursor:pointer}.plotly_editor{display:flex;width:100%}.plotly_editor,.plotly_editor_plot{flex-grow:1;height:100%;max-height:100%}.plotly_editor_plot{max-width:100%;overflow:auto} \ No newline at end of file diff --git a/lib/shame.js b/lib/shame.js deleted file mode 100644 index 6d63f79ca..000000000 --- a/lib/shame.js +++ /dev/null @@ -1,238 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.shamefullyAdjustSizeref = exports.shamefullyDeleteRelatedAnalysisTransforms = exports.shamefullyCreateSplitStyleProps = exports.shamefullyAdjustSplitStyleTargetContainers = exports.shamefullyAddTableColumns = exports.shamefullyAdjustGeo = exports.shamefullyAdjustAxisRef = exports.shamefullyClearAxisTypes = undefined; - -var _axis_ids = require('plotly.js/src/plots/cartesian/axis_ids'); - -var _nested_property = require('plotly.js/src/lib/nested_property'); - -var _nested_property2 = _interopRequireDefault(_nested_property); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Temporary fix for: -// https://github.com/plotly/react-chart-editor/issues/103 -// We should be able to remove this once the plotly.react method has -// been integrated into react-plotly.js and released: -// https://github.com/plotly/react-plotly.js/issues/2 -/* - * DELETE THIS FILE. EVERYTHING NEEDS TO FIND A HOME. - */ -var shamefullyClearAxisTypes = exports.shamefullyClearAxisTypes = function shamefullyClearAxisTypes(graphDiv, _ref) { - var traceIndexes = _ref.traceIndexes, - update = _ref.update; - - if (!Array.isArray(graphDiv._fullData)) { - return; - } - var hasSrc = false; - for (var key in update) { - if (key.substr(key.length - 3) === 'src') { - hasSrc = true; - } - } - if (hasSrc) { - clearAxisTypes(graphDiv, traceIndexes); - } -}; - -var axLetters = ['x', 'y', 'z']; -function clearAxisTypes(gd, traces) { - for (var i = 0; i < traces.length; i++) { - var trace = gd._fullData[i]; - for (var j = 0; j < 3; j++) { - var type = axLetters[j]; - var ax = (0, _axis_ids.getFromId)(gd, trace[type + 'axis'] || type); - - // Do not clear log type. - // Log type is never an auto result so must have been intentional. - // We are also skipping clearing 3D which could cause bugs with 3D. - if (ax && ax.type !== 'log') { - var axAttr = ax._name; - var typeAttr = axAttr + '.type'; - (0, _nested_property2.default)(gd.layout, typeAttr).set(null); - } - } - } -} - -var shamefullyAdjustAxisRef = exports.shamefullyAdjustAxisRef = function shamefullyAdjustAxisRef(graphDiv, payload) { - if (payload.axesToBeGarbageCollected) { - payload.axesToBeGarbageCollected.forEach(function (a) { - var axis = a.charAt(0); - var axisIdNumber = Number(a.slice(1)); - - (0, _nested_property2.default)(graphDiv.layout, axis + 'axis' + (axisIdNumber || '')).set(null); - Object.keys(graphDiv.layout).filter(function (key) { - return key.startsWith(axis + 'axis'); - }).forEach(function (key) { - if ((0, _nested_property2.default)(graphDiv.layout, key + '.overlaying').get() === a) { - (0, _nested_property2.default)(graphDiv.layout, key + '.overlaying').set(null); - } - }); - }); - } - if (payload.subplotToBeGarbageCollected) { - (0, _nested_property2.default)(graphDiv.layout, payload.subplotToBeGarbageCollected).set(null); - } -}; - -var geoRegex = /^(geo\d*)\./; -var shamefullyAdjustGeo = exports.shamefullyAdjustGeo = function shamefullyAdjustGeo(_ref2, _ref3) { - var layout = _ref2.layout; - var update = _ref3.update; - - Object.keys(update).forEach(function (k) { - var geoMatch = geoRegex.exec(k); - if (geoMatch) { - var geo = geoMatch[1]; - if (update[geo + '.scope']) { - update[geo + '.projection'] = {}; - update[geo + '.center'] = {}; - } - - if ( - // requesting projection change - update[geo + '.projection.type'] && (update[geo + '.projection.type'] === 'albers usa' || layout[geo] && layout[geo].scope === 'usa')) { - update[geo + '.scope'] = {}; - update[geo + '.center'] = {}; - } - } - }); -}; - -var shamefullyAddTableColumns = exports.shamefullyAddTableColumns = function shamefullyAddTableColumns(graphDiv, _ref4) { - var traceIndexes = _ref4.traceIndexes, - update = _ref4.update; - - if (update['cells.values'] && (!graphDiv.data[traceIndexes[0]].header || !graphDiv.data[traceIndexes[0]].header.valuessrc)) { - update['header.values'] = update['cells.valuessrc']; - } else if (update['header.values'] === null) { - update['header.values'] = graphDiv.data[traceIndexes[0]].cells.valuessrc || null; - } else if (update['cells.values'] === null && !graphDiv.data[traceIndexes[0]].header.valuessrc) { - update['header.values'] = null; - } -}; - -var shamefullyAdjustSplitStyleTargetContainers = exports.shamefullyAdjustSplitStyleTargetContainers = function shamefullyAdjustSplitStyleTargetContainers(graphDiv, _ref5) { - var traceIndexes = _ref5.traceIndexes, - update = _ref5.update; - - for (var attr in update) { - if (attr && attr.startsWith('transforms') && attr.endsWith('groups')) { - var transformIndex = parseInt(attr.split('[')[1], 10); - var transform = graphDiv.data[traceIndexes[0]].transforms[transformIndex]; - - if (transform && transform.type === 'groupby' && transform.styles) { - // Create style containers for all groups - if (!transform.styles.length && update[attr]) { - (function () { - var dedupedGroups = []; - update[attr].forEach(function (group) { - if (!dedupedGroups.includes(group)) { - dedupedGroups.push(group); - } - }); - - var styles = dedupedGroups.map(function (groupEl) { - return { - target: groupEl, - value: {} - }; - }); - - update['transforms[' + transformIndex + '].styles'] = styles; - })(); - } - - // When clearing the data selector of groupby transforms, we want to clear - // all the styles we've added - if (transform.styles.length && !update[attr]) { - update['transforms[' + transformIndex + '].styles'] = []; - } - } - } - } -}; - -var shamefullyCreateSplitStyleProps = exports.shamefullyCreateSplitStyleProps = function shamefullyCreateSplitStyleProps(graphDiv, attr, traceIndex, splitTraceGroup) { - if (!Array.isArray(splitTraceGroup)) { - splitTraceGroup = [splitTraceGroup]; // eslint-disable-line - } - - var indexOfSplitTransform = null; - - graphDiv.data[traceIndex].transforms.forEach(function (t, i) { - if (t.type === 'groupby') { - indexOfSplitTransform = i; - } - }); - - function getProp(group) { - var indexOfStyleObject = null; - - graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles.forEach(function (s, i) { - if (s.target.toString() === group) { - indexOfStyleObject = i; - } - }); - - var path = graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value; - - attr.split('.').forEach(function (p) { - if (!path[p]) { - path[p] = {}; - } - path = path[p]; - }); - - return (0, _nested_property2.default)(graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value, attr); - } - - return splitTraceGroup.map(function (g) { - return getProp(g); - }); -}; - -var shamefullyDeleteRelatedAnalysisTransforms = exports.shamefullyDeleteRelatedAnalysisTransforms = function shamefullyDeleteRelatedAnalysisTransforms(graphDiv, payload) { - var parentTraceDataIndex = payload.traceIndexes[0]; - var parentUid = graphDiv.data[parentTraceDataIndex].uid; - - if (parentUid) { - var relatedAnalysisTraceIndexes = []; - graphDiv.data.forEach(function (d, i) { - if (d.transforms && d.transforms.some(function (transform) { - return ['moving-average', 'fit'].includes(transform.type) && transform.inputUid === parentUid; - })) { - relatedAnalysisTraceIndexes.push(i); - } - }); - - if (relatedAnalysisTraceIndexes.length) { - relatedAnalysisTraceIndexes.forEach(function (i) { - graphDiv.data.splice(i, 1); - }); - } - } -}; - -var shamefullyAdjustSizeref = exports.shamefullyAdjustSizeref = function shamefullyAdjustSizeref(gd, _ref6) { - var update = _ref6.update; - var _update$markerSize = update['marker.size'], - size = _update$markerSize === undefined ? null : _update$markerSize, - _update$markerSizesr = update['marker.sizesrc'], - src = _update$markerSizesr === undefined ? null : _update$markerSizesr; - - if (size && src) { - var DEFAULT_MAX_AREA_PX = 45; - var scaleFactor = DEFAULT_MAX_AREA_PX * DEFAULT_MAX_AREA_PX; - update['marker.sizeref'] = size.reduce(function (a, b) { - return Math.max(a, b); - }) / scaleFactor; - update['marker.sizemode'] = 'area'; - } -}; -//# sourceMappingURL=shame.js.map \ No newline at end of file diff --git a/lib/shame.js.map b/lib/shame.js.map deleted file mode 100644 index f3bca0b47..000000000 --- a/lib/shame.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/shame.js"],"names":["shamefullyClearAxisTypes","graphDiv","traceIndexes","update","Array","isArray","_fullData","hasSrc","key","substr","length","clearAxisTypes","axLetters","gd","traces","i","trace","j","type","ax","axAttr","_name","typeAttr","layout","set","shamefullyAdjustAxisRef","payload","axesToBeGarbageCollected","forEach","axis","a","charAt","axisIdNumber","Number","slice","Object","keys","filter","startsWith","get","subplotToBeGarbageCollected","geoRegex","shamefullyAdjustGeo","geoMatch","exec","k","geo","scope","shamefullyAddTableColumns","data","header","valuessrc","cells","shamefullyAdjustSplitStyleTargetContainers","attr","endsWith","transformIndex","parseInt","split","transform","transforms","styles","dedupedGroups","includes","group","push","map","target","groupEl","value","shamefullyCreateSplitStyleProps","traceIndex","splitTraceGroup","indexOfSplitTransform","t","getProp","indexOfStyleObject","s","toString","path","p","g","shamefullyDeleteRelatedAnalysisTransforms","parentTraceDataIndex","parentUid","uid","relatedAnalysisTraceIndexes","d","some","inputUid","splice","shamefullyAdjustSizeref","size","src","DEFAULT_MAX_AREA_PX","scaleFactor","reduce","b","Math","max"],"mappings":";;;;;;;AAGA;;AACA;;;;;;AAEA;AACA;AACA;AACA;AACA;AAVA;;;AAWO,IAAMA,8DAA2B,SAA3BA,wBAA2B,CAACC,QAAD,QAAsC;AAAA,MAA1BC,YAA0B,QAA1BA,YAA0B;AAAA,MAAZC,MAAY,QAAZA,MAAY;;AAC5E,MAAI,CAACC,MAAMC,OAAN,CAAcJ,SAASK,SAAvB,CAAL,EAAwC;AACtC;AACD;AACD,MAAIC,SAA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AAU;AAC9B,UACEwE,EAAE3B,UAAF,IACA2B,EAAE3B,UAAF,CAAa4B,IAAb,CACE;AAAA,eACE,CAAC,gBAAD,EAAmB,KAAnB,EAA0BzB,QAA1B,CAAmCJ,UAAUzC,IAA7C,KAAsDyC,UAAU8B,QAAV,KAAuBL,SAD/E;AAAA,OADF,CAFF,EAME;AACAE,oCAA4BrB,IAA5B,CAAiClD,CAAjC;AACD;AACF,KAVD;;AAYA,QAAIuE,4BAA4B5E,MAAhC,EAAwC;AACtC4E,kCAA4B1D,OAA5B,CAAoC,aAAK;AACvC3B,iBAASgD,IAAT,CAAcyC,MAAd,CAAqB3E,CAArB,EAAwB,CAAxB;AACD,OAFD;AAGD;AACF;AACF,CAxBM;;AA0BA,IAAM4E,4DAA0B,SAA1BA,uBAA0B,CAAC9E,EAAD,SAAkB;AAAA,MAAZV,MAAY,SAAZA,MAAY;AAAA,2BACYA,MADZ,CAChD,aADgD;AAAA,MACjCyF,IADiC,sCAC1B,IAD0B;AAAA,6BACYzF,MADZ,CACpB,gBADoB;AAAA,MACF0F,GADE,wCACI,IADJ;;AAEvD,MAAID,QAAQC,GAAZ,EAAiB;AACf,QAAMC,sBAAsB,EAA5B;AACA,QAAMC,cAAcD,sBAAsBA,mBAA1C;AACA3F,WAAO,gBAAP,IAA2ByF,KAAKI,MAAL,CAAY,UAAClE,CAAD,EAAImE,CAAJ;AAAA,aAAUC,KAAKC,GAAL,CAASrE,CAAT,EAAYmE,CAAZ,CAAV;AAAA,KAAZ,IAAwCF,WAAnE;AACA5F,WAAO,iBAAP,IAA4B,MAA5B;AACD;AACF,CARM","file":"shame.js","sourcesContent":["/*\n * DELETE THIS FILE. EVERYTHING NEEDS TO FIND A HOME.\n */\nimport {getFromId} from 'plotly.js/src/plots/cartesian/axis_ids';\nimport nestedProperty from 'plotly.js/src/lib/nested_property';\n\n// Temporary fix for:\n// https://github.com/plotly/react-chart-editor/issues/103\n// We should be able to remove this once the plotly.react method has\n// been integrated into react-plotly.js and released:\n// https://github.com/plotly/react-plotly.js/issues/2\nexport const shamefullyClearAxisTypes = (graphDiv, {traceIndexes, update}) => {\n if (!Array.isArray(graphDiv._fullData)) {\n return;\n }\n let hasSrc = false;\n for (const key in update) {\n if (key.substr(key.length - 3) === 'src') {\n hasSrc = true;\n }\n }\n if (hasSrc) {\n clearAxisTypes(graphDiv, traceIndexes);\n }\n};\n\nconst axLetters = ['x', 'y', 'z'];\nfunction clearAxisTypes(gd, traces) {\n for (let i = 0; i < traces.length; i++) {\n const trace = gd._fullData[i];\n for (let j = 0; j < 3; j++) {\n const type = axLetters[j];\n const ax = getFromId(gd, trace[type + 'axis'] || type);\n\n // Do not clear log type.\n // Log type is never an auto result so must have been intentional.\n // We are also skipping clearing 3D which could cause bugs with 3D.\n if (ax && ax.type !== 'log') {\n const axAttr = ax._name;\n const typeAttr = axAttr + '.type';\n nestedProperty(gd.layout, typeAttr).set(null);\n }\n }\n }\n}\n\nexport const shamefullyAdjustAxisRef = (graphDiv, payload) => {\n if (payload.axesToBeGarbageCollected) {\n payload.axesToBeGarbageCollected.forEach(a => {\n const axis = a.charAt(0);\n const axisIdNumber = Number(a.slice(1));\n\n nestedProperty(graphDiv.layout, `${axis}axis${axisIdNumber || ''}`).set(null);\n Object.keys(graphDiv.layout)\n .filter(key => key.startsWith(axis + 'axis'))\n .forEach(key => {\n if (nestedProperty(graphDiv.layout, `${key}.overlaying`).get() === a) {\n nestedProperty(graphDiv.layout, `${key}.overlaying`).set(null);\n }\n });\n });\n }\n if (payload.subplotToBeGarbageCollected) {\n nestedProperty(graphDiv.layout, payload.subplotToBeGarbageCollected).set(null);\n }\n};\n\nconst geoRegex = /^(geo\\d*)\\./;\nexport const shamefullyAdjustGeo = ({layout}, {update}) => {\n Object.keys(update).forEach(k => {\n const geoMatch = geoRegex.exec(k);\n if (geoMatch) {\n const geo = geoMatch[1];\n if (update[geo + '.scope']) {\n update[geo + '.projection'] = {};\n update[geo + '.center'] = {};\n }\n\n if (\n // requesting projection change\n update[geo + '.projection.type'] &&\n (update[geo + '.projection.type'] === 'albers usa' ||\n (layout[geo] && layout[geo].scope === 'usa'))\n ) {\n update[geo + '.scope'] = {};\n update[geo + '.center'] = {};\n }\n }\n });\n};\n\nexport const shamefullyAddTableColumns = (graphDiv, {traceIndexes, update}) => {\n if (\n update['cells.values'] &&\n (!graphDiv.data[traceIndexes[0]].header || !graphDiv.data[traceIndexes[0]].header.valuessrc)\n ) {\n update['header.values'] = update['cells.valuessrc'];\n } else if (update['header.values'] === null) {\n update['header.values'] = graphDiv.data[traceIndexes[0]].cells.valuessrc || null;\n } else if (update['cells.values'] === null && !graphDiv.data[traceIndexes[0]].header.valuessrc) {\n update['header.values'] = null;\n }\n};\n\nexport const shamefullyAdjustSplitStyleTargetContainers = (graphDiv, {traceIndexes, update}) => {\n for (const attr in update) {\n if (attr && attr.startsWith('transforms') && attr.endsWith('groups')) {\n const transformIndex = parseInt(attr.split('[')[1], 10);\n const transform = graphDiv.data[traceIndexes[0]].transforms[transformIndex];\n\n if (transform && transform.type === 'groupby' && transform.styles) {\n // Create style containers for all groups\n if (!transform.styles.length && update[attr]) {\n const dedupedGroups = [];\n update[attr].forEach(group => {\n if (!dedupedGroups.includes(group)) {\n dedupedGroups.push(group);\n }\n });\n\n const styles = dedupedGroups.map(groupEl => ({\n target: groupEl,\n value: {},\n }));\n\n update[`transforms[${transformIndex}].styles`] = styles;\n }\n\n // When clearing the data selector of groupby transforms, we want to clear\n // all the styles we've added\n if (transform.styles.length && !update[attr]) {\n update[`transforms[${transformIndex}].styles`] = [];\n }\n }\n }\n }\n};\n\nexport const shamefullyCreateSplitStyleProps = (graphDiv, attr, traceIndex, splitTraceGroup) => {\n if (!Array.isArray(splitTraceGroup)) {\n splitTraceGroup = [splitTraceGroup]; // eslint-disable-line\n }\n\n let indexOfSplitTransform = null;\n\n graphDiv.data[traceIndex].transforms.forEach((t, i) => {\n if (t.type === 'groupby') {\n indexOfSplitTransform = i;\n }\n });\n\n function getProp(group) {\n let indexOfStyleObject = null;\n\n graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles.forEach((s, i) => {\n if (s.target.toString() === group) {\n indexOfStyleObject = i;\n }\n });\n\n let path =\n graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value;\n\n attr.split('.').forEach(p => {\n if (!path[p]) {\n path[p] = {};\n }\n path = path[p];\n });\n\n return nestedProperty(\n graphDiv.data[traceIndex].transforms[indexOfSplitTransform].styles[indexOfStyleObject].value,\n attr\n );\n }\n\n return splitTraceGroup.map(g => getProp(g));\n};\n\nexport const shamefullyDeleteRelatedAnalysisTransforms = (graphDiv, payload) => {\n const parentTraceDataIndex = payload.traceIndexes[0];\n const parentUid = graphDiv.data[parentTraceDataIndex].uid;\n\n if (parentUid) {\n const relatedAnalysisTraceIndexes = [];\n graphDiv.data.forEach((d, i) => {\n if (\n d.transforms &&\n d.transforms.some(\n transform =>\n ['moving-average', 'fit'].includes(transform.type) && transform.inputUid === parentUid\n )\n ) {\n relatedAnalysisTraceIndexes.push(i);\n }\n });\n\n if (relatedAnalysisTraceIndexes.length) {\n relatedAnalysisTraceIndexes.forEach(i => {\n graphDiv.data.splice(i, 1);\n });\n }\n }\n};\n\nexport const shamefullyAdjustSizeref = (gd, {update}) => {\n const {'marker.size': size = null, 'marker.sizesrc': src = null} = update;\n if (size && src) {\n const DEFAULT_MAX_AREA_PX = 45;\n const scaleFactor = DEFAULT_MAX_AREA_PX * DEFAULT_MAX_AREA_PX;\n update['marker.sizeref'] = size.reduce((a, b) => Math.max(a, b)) / scaleFactor;\n update['marker.sizemode'] = 'area';\n }\n};\n"]} \ No newline at end of file From 6fa1ade313ba9caefe5afbe4ba8d1f30da3930e0 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 15 Nov 2018 17:09:41 +0900 Subject: [PATCH 24/69] remove contextTypes in GraphCreatePanel; --- dev/App.js | 1 - src/DefaultEditor.js | 82 +++---- src/components/containers/TraceAccordion.js | 1 - src/components/fields/Field.js | 79 +++---- src/components/fields/derived.js | 4 +- src/components/widgets/TraceTypeSelector.js | 231 +++++++++++++------- src/default_panels/GraphCreatePanel.js | 1 - src/lib/connectToContainer.js | 10 +- src/lib/connectTraceToPlot.js | 15 +- 9 files changed, 244 insertions(+), 180 deletions(-) diff --git a/dev/App.js b/dev/App.js index e63ab1944..b46cb424c 100644 --- a/dev/App.js +++ b/dev/App.js @@ -249,7 +249,6 @@ class App extends Component { {group: 'Style', name: 'Menus'}, ]; - console.log(this.state.data, this.state.layout, this.state.frames); return (
TRANSFORMABLE_TRACES.includes(d.type)); + hasTransforms() { + return this.context.fullData.some(d => TRANSFORMABLE_TRACES.includes(d.type)); } - hasAxes(fullLayout) { + hasAxes() { return ( - Object.keys(fullLayout._subplots).filter( - type => !['cartesian', 'mapbox'].includes(type) && fullLayout._subplots[type].length > 0 + Object.keys(this.context.fullLayout._subplots).filter( + type => + !['cartesian', 'mapbox'].includes(type) && + this.context.fullLayout._subplots[type].length > 0 ).length > 0 ); } - hasMenus(fullLayout) { - const {updatemenus = []} = fullLayout; + hasMenus() { + const {updatemenus = []} = this.context.fullLayout; return updatemenus.length > 0; } - hasSliders(layout) { - const {sliders = []} = layout; - // const { - // layout: {sliders = []}, - // } = this.context; - + hasSliders() { + const {sliders = []} = this.context.layout; return sliders.length > 0; } - hasColorbars(fullData) { - return fullData.some(d => traceHasColorbar({}, d)); + hasColorbars() { + return this.context.fullData.some(d => traceHasColorbar({}, d)); } render() { const logo = this.props.logoSrc && ; - + const _ = this.context.localize; return ( - - {({localize: _, fullData, fullLayout, layout}) => { - return ( - - {logo ? logo : null} - - - {this.hasTransforms(fullData) && ( - - )} - - - {this.hasAxes(fullLayout) && } - - {this.hasColorbars(fullData) && ( - - )} - - - - {this.hasSliders(layout) && ( - - )} - {this.hasMenus(fullLayout) && ( - - )} - {this.props.children ? this.props.children : null} - - ); - }} - + + {logo ? logo : null} + + + {this.hasTransforms() && ( + + )} + + + {this.hasAxes() && } + + {this.hasColorbars() && } + + + + {this.hasSliders() && } + {this.hasMenus() && } + {this.props.children ? this.props.children : null} + ); } } @@ -107,6 +93,6 @@ DefaultEditor.propTypes = { menuPanelOrder: PropTypes.array, }; -// DefaultEditor.contextType = EditorControlsContext; +DefaultEditor.contextType = EditorControlsContext; export default DefaultEditor; diff --git a/src/components/containers/TraceAccordion.js b/src/components/containers/TraceAccordion.js index ca52b8bf4..e6b6250d0 100644 --- a/src/components/containers/TraceAccordion.js +++ b/src/components/containers/TraceAccordion.js @@ -11,7 +11,6 @@ import {PanelMessage} from './PanelEmpty'; import {EditorControlsContext} from '../../context'; const TraceFold = connectTraceToPlot(PlotlyFold); - class TraceAccordion extends Component { constructor(props, context) { super(props, context); diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index 399d4c6ff..f49337859 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -5,6 +5,7 @@ import classnames from 'classnames'; import {bem} from 'lib'; import {getMultiValueText} from 'lib/constants'; import {CloseIcon} from 'plotly-icons'; +import {EditorControlsContext} from '../../context'; export class FieldDelete extends Component { render() { @@ -30,8 +31,6 @@ class Field extends Component { fieldContainerClassName, } = this.props; - const {localize: _} = this.context; - let fieldClass; if (!label) { fieldClass = classnames('field__no-title', { @@ -53,41 +52,45 @@ class Field extends Component { }); return ( -
- {label ? ( -
- {this.context.showFieldTooltips ? ( -
- {label} + + {({localize: _, showFieldTooltips}) => ( +
+ {label ? ( +
+ {showFieldTooltips ? ( +
+ {label} +
+ ) : ( +
{label}
+ )}
- ) : ( -
{label}
- )} -
- ) : null} -
- {children} - {extraComponent ? extraComponent : null} - {multiValued && !suppressMultiValuedMessage ? ( - -
{getMultiValueText('title', _)}
-
{getMultiValueText('text', _)}
-
{getMultiValueText('subText', _)}
-
- ) : null} -
- {units ? ( -
-
{units}
+ ) : null} +
+ {children} + {extraComponent ? extraComponent : null} + {multiValued && !suppressMultiValuedMessage ? ( + +
{getMultiValueText('title', _)}
+
{getMultiValueText('text', _)}
+
{getMultiValueText('subText', _)}
+
+ ) : null} +
+ {units ? ( +
+
{units}
+
+ ) : null}
- ) : null} -
+ )} + ); } } @@ -104,10 +107,12 @@ Field.propTypes = { }; Field.contextTypes = { - localize: PropTypes.func, + // EditorControlsContext + // localize: PropTypes.func, + // showFieldTooltips: PropTypes.bool, + // TraceToPlotContext description: PropTypes.string, attr: PropTypes.string, - showFieldTooltips: PropTypes.bool, }; Field.defaultProps = { diff --git a/src/components/fields/derived.js b/src/components/fields/derived.js index fb6848e58..603bfd807 100644 --- a/src/components/fields/derived.js +++ b/src/components/fields/derived.js @@ -236,12 +236,12 @@ const numericFractionModifyPlotProps = (props, context, plotProps) => { const min = (attrMeta && attrMeta.min) || 0; const max = (attrMeta && attrMeta.max) || 1; if (isNumeric(fullValue)) { - plotProps.fullValue = Math.round((100 * (fullValue - min)) / (max - min)); + plotProps.fullValue = Math.round(100 * (fullValue - min) / (max - min)); } plotProps.updatePlot = v => { if (isNumeric(v)) { - updatePlot((v / 100) * (max - min) + min); + updatePlot(v / 100 * (max - min) + min); } else { updatePlot(v); } diff --git a/src/components/widgets/TraceTypeSelector.js b/src/components/widgets/TraceTypeSelector.js index afde29c94..90e527c97 100644 --- a/src/components/widgets/TraceTypeSelector.js +++ b/src/components/widgets/TraceTypeSelector.js @@ -4,7 +4,7 @@ import {SearchIcon, ThumnailViewIcon, GraphIcon} from 'plotly-icons'; import Modal from 'components/containers/Modal'; import {traceTypeToPlotlyInitFigure, renderTraceIcon, plotlyTraceToCustomTrace} from 'lib'; import {TRACES_WITH_GL} from 'lib/constants'; -import {EditorControlsContext} from '../../context'; +import {EditorControlsContext, ModalProviderContext} from '../../context'; const renderActionItems = (actionItems, item) => actionItems @@ -67,75 +67,75 @@ class TraceTypeSelector extends Component { constructor(props) { super(props); - this.selectAndClose = this.selectAndClose.bind(this); - this.actions = this.actions.bind(this); + // this.selectAndClose = this.selectAndClose.bind(this); + // this.actions = this.actions.bind(this); this.renderCategories = this.renderCategories.bind(this); this.renderGrid = this.renderGrid.bind(this); this.renderSingleBlock = this.renderSingleBlock.bind(this); } - selectAndClose(value) { - const { - updateContainer, - glByDefault, - fullContainer: {type}, - } = this.props; - const computedValue = traceTypeToPlotlyInitFigure(value); - if ( - ((type && type.endsWith('gl')) || (!TRACES_WITH_GL.includes(type) && glByDefault)) && - TRACES_WITH_GL.includes(computedValue.type) && - !computedValue.type.endsWith('gl') - ) { - computedValue.type += 'gl'; - } - updateContainer(computedValue); - this.context.handleClose(); - } + // selectAndClose(value) { + // const { + // updateContainer, + // glByDefault, + // fullContainer: {type}, + // } = this.props; + // const computedValue = traceTypeToPlotlyInitFigure(value); + // if ( + // ((type && type.endsWith('gl')) || (!TRACES_WITH_GL.includes(type) && glByDefault)) && + // TRACES_WITH_GL.includes(computedValue.type) && + // !computedValue.type.endsWith('gl') + // ) { + // computedValue.type += 'gl'; + // } + // updateContainer(computedValue); + // this.context.handleClose(); + // } + // + // actions({value}) { + // const {localize: _, chartHelp} = this.context; + // + // const onClick = (e, func) => { + // e.stopPropagation(); + // func(); + // this.context.handleClose(); + // }; + // + // return [ + // { + // label: _('Charts like this by Plotly users.'), + // onClick: + // chartHelp[value] && + // chartHelp[value].feedQuery && + // (e => + // onClick(e, () => + // window.open( + // `https://plot.ly/feed/?q=${chartHelp[value] ? chartHelp[value].feedQuery : value}`, + // '_blank' + // ) + // )), + // icon: , + // }, + // { + // label: _('View tutorials on this chart type.'), + // onClick: + // chartHelp[value] && + // chartHelp[value].helpDoc && + // (e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))), + // icon: , + // }, + // { + // label: _('See a basic example.'), + // onClick: + // chartHelp[value] && + // chartHelp[value].examplePlot && + // (e => onClick(e, chartHelp[value].examplePlot)), + // icon: , + // }, + // ]; + // } - actions({value}) { - const {localize: _, chartHelp} = this.context; - - const onClick = (e, func) => { - e.stopPropagation(); - func(); - this.context.handleClose(); - }; - - return [ - { - label: _('Charts like this by Plotly users.'), - onClick: - chartHelp[value] && - chartHelp[value].feedQuery && - (e => - onClick(e, () => - window.open( - `https://plot.ly/feed/?q=${chartHelp[value] ? chartHelp[value].feedQuery : value}`, - '_blank' - ) - )), - icon: , - }, - { - label: _('View tutorials on this chart type.'), - onClick: - chartHelp[value] && - chartHelp[value].helpDoc && - (e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))), - icon: , - }, - { - label: _('See a basic example.'), - onClick: - chartHelp[value] && - chartHelp[value].examplePlot && - (e => onClick(e, chartHelp[value].examplePlot)), - icon: , - }, - ]; - } - - renderCategories() { + renderCategories(actions, selectAndClose) { const {fullValue} = this.props; const {mapBoxAccess, localize: _, chartHelp} = this.context; const { @@ -169,8 +169,8 @@ class TraceTypeSelector extends Component { key={item.value} active={fullValue === item.value} item={item} - actions={this.actions} - handleClick={() => this.selectAndClose(item.value)} + actions={actions} + handleClick={() => selectAndClose(item.value)} showActions={Boolean(chartHelp)} /> ))} @@ -180,11 +180,11 @@ class TraceTypeSelector extends Component { }); } - renderGrid() { - return
{this.renderCategories()}
; + renderGrid(actions, selectAndClose) { + return
{this.renderCategories(actions, selectAndClose)}
; } - renderSingleBlock() { + renderSingleBlock(actions, selectAndClose) { const {fullValue} = this.props; const {localize: _} = this.context; const { @@ -199,9 +199,9 @@ class TraceTypeSelector extends Component { complex={complex} active={fullValue === item.value} item={item} - actions={this.actions} + actions={actions} showActions={false} - handleClick={() => this.selectAndClose(item.value)} + handleClick={() => selectAndClose(item.value)} style={{display: 'inline-block'}} /> ))} @@ -216,9 +216,79 @@ class TraceTypeSelector extends Component { } = this.props; return ( - - {categories ? this.renderGrid() : this.renderSingleBlock()} - + + {({handleClose}) => { + const actions = ({value}) => { + const {localize: _, chartHelp} = this.context; + + const onClick = (e, func) => { + e.stopPropagation(); + func(); + handleClose(); + }; + + return [ + { + label: _('Charts like this by Plotly users.'), + onClick: + chartHelp[value] && + chartHelp[value].feedQuery && + (e => + onClick(e, () => + window.open( + `https://plot.ly/feed/?q=${ + chartHelp[value] ? chartHelp[value].feedQuery : value + }`, + '_blank' + ) + )), + icon: , + }, + { + label: _('View tutorials on this chart type.'), + onClick: + chartHelp[value] && + chartHelp[value].helpDoc && + (e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))), + icon: , + }, + { + label: _('See a basic example.'), + onClick: + chartHelp[value] && + chartHelp[value].examplePlot && + (e => onClick(e, chartHelp[value].examplePlot)), + icon: , + }, + ]; + }; + + const selectAndClose = value => { + const { + updateContainer, + glByDefault, + fullContainer: {type}, + } = this.props; + const computedValue = traceTypeToPlotlyInitFigure(value); + if ( + ((type && type.endsWith('gl')) || (!TRACES_WITH_GL.includes(type) && glByDefault)) && + TRACES_WITH_GL.includes(computedValue.type) && + !computedValue.type.endsWith('gl') + ) { + computedValue.type += 'gl'; + } + updateContainer(computedValue); + handleClose(); + }; + return ( + + {categories + ? this.renderGrid(actions, selectAndClose) + : this.renderSingleBlock(actions, selectAndClose)} + + ); + }} + ); } } @@ -230,12 +300,13 @@ TraceTypeSelector.propTypes = { glByDefault: PropTypes.bool, traceTypesConfig: PropTypes.object, }; -TraceTypeSelector.contextTypes = { - handleClose: PropTypes.func, - localize: PropTypes.func, - mapBoxAccess: PropTypes.bool, - chartHelp: PropTypes.object, -}; +TraceTypeSelector.contextType = EditorControlsContext; +// TraceTypeSelector.contextTypes = { +// handleClose: PropTypes.func, +// localize: PropTypes.func, +// mapBoxAccess: PropTypes.bool, +// chartHelp: PropTypes.object, +// }; export class TraceTypeSelectorButton extends Component { render() { diff --git a/src/default_panels/GraphCreatePanel.js b/src/default_panels/GraphCreatePanel.js index 320bebea8..4fd8df900 100644 --- a/src/default_panels/GraphCreatePanel.js +++ b/src/default_panels/GraphCreatePanel.js @@ -35,7 +35,6 @@ const GraphCreatePanel = () => { } > - diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index 51ee0322b..1386b20d2 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -4,18 +4,20 @@ import unpackPlotProps from './unpackPlotProps'; import {getDisplayName} from '../lib'; export const containerConnectedContextTypes = { + // EditorControlsContext localize: PropTypes.func, - container: PropTypes.object, data: PropTypes.array, - defaultContainer: PropTypes.object, - fullContainer: PropTypes.object, fullData: PropTypes.array, fullLayout: PropTypes.object, getValObject: PropTypes.func, graphDiv: PropTypes.object, layout: PropTypes.object, - onUpdate: PropTypes.func, plotly: PropTypes.object, + onUpdate: PropTypes.func, + // anything context + container: PropTypes.object, + defaultContainer: PropTypes.object, + fullContainer: PropTypes.object, updateContainer: PropTypes.func, traceIndexes: PropTypes.array, }; diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index 4d58ef80e..5b5b0ab21 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -10,6 +10,7 @@ import { } from '../lib'; import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {EDITOR_ACTIONS, SUBPLOT_TO_ATTR} from 'lib/constants'; +import {EditorControlsContext} from '../context'; export default function connectTraceToPlot(WrappedComponent) { class TraceConnectedComponent extends Component { @@ -193,12 +194,14 @@ export default function connectTraceToPlot(WrappedComponent) { fullDataArrayPosition: PropTypes.arrayOf(PropTypes.number), }; - TraceConnectedComponent.contextTypes = { - fullData: PropTypes.array, - data: PropTypes.array, - plotly: PropTypes.object, - onUpdate: PropTypes.func, - }; + TraceConnectedComponent.contextType = EditorControlsContext; + + // TraceConnectedComponent.contextTypes = { + // fullData: PropTypes.array, + // data: PropTypes.array, + // plotly: PropTypes.object, + // onUpdate: PropTypes.func, + // }; TraceConnectedComponent.childContextTypes = { getValObject: PropTypes.func, From d55fa992efa93fb4b4c803061cd2d6e17dec02b8 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 15 Nov 2018 18:48:38 +0900 Subject: [PATCH 25/69] remove contextTypes in connector --- src/components/containers/PlotlyPanel.js | 4 +- src/components/fields/Field.js | 5 +- src/components/fields/LocationSelector.js | 94 ++++++++++++----------- src/lib/connectLayoutToPlot.js | 8 +- src/lib/connectTraceToPlot.js | 7 -- 5 files changed, 55 insertions(+), 63 deletions(-) diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index d6441fd10..6355ee86c 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -139,9 +139,7 @@ Panel.defaultProps = { showExpandCollapse: true, }; -Panel.contextTypes = { - localize: PropTypes.func, -}; +Panel.contextType = EditorControlsContext; Panel.childContextTypes = { deleteContainer: PropTypes.func, diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index f49337859..4b25eea7e 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -107,10 +107,7 @@ Field.propTypes = { }; Field.contextTypes = { - // EditorControlsContext - // localize: PropTypes.func, - // showFieldTooltips: PropTypes.bool, - // TraceToPlotContext + // ConnectToContainer description: PropTypes.string, attr: PropTypes.string, }; diff --git a/src/components/fields/LocationSelector.js b/src/components/fields/LocationSelector.js index c4fcbb8dd..495f5df27 100644 --- a/src/components/fields/LocationSelector.js +++ b/src/components/fields/LocationSelector.js @@ -5,6 +5,7 @@ import Field from './Field'; import Radio from './Radio'; import {UnconnectedDropdown} from './Dropdown'; import DataSelector from './DataSelector'; +import {EditorControlsContext} from '../../context'; const LocationmodeVisible = connectToContainer(UnconnectedDropdown, { modifyPlotProps: (props, context, plotProps) => { @@ -18,25 +19,27 @@ const LocationmodeVisible = connectToContainer(UnconnectedDropdown, { class UnconnectedLocation extends Component { render() { - const {localize: _} = this.context; - return ( - - - - + + {({localize: _}) => ( + + + + + )} + ); } } @@ -47,7 +50,6 @@ UnconnectedLocation.propTypes = { }; UnconnectedLocation.contextTypes = { - localize: PropTypes.func, updateContainer: PropTypes.func, }; @@ -87,39 +89,46 @@ class UnconnectedLocationSelector extends Component { render() { const {mode} = this.state; const { - localize: _, container: {type: type}, } = this.context; return type === 'scattergeo' ? ( - - - - - {mode === 'latlon' ? ( + + {({localize: _}) => ( - - + + + + {mode === 'latlon' ? ( + + + + + ) : ( + + )} - ) : ( - )} - + ) : type === 'choropleth' ? ( ) : ( - - - - + + {({localize: _}) => ( + + + + + )} + ); } } @@ -133,7 +142,6 @@ UnconnectedLocationSelector.propTypes = { UnconnectedLocationSelector.contextTypes = { container: PropTypes.object, - localize: PropTypes.func, updateContainer: PropTypes.func, }; diff --git a/src/lib/connectLayoutToPlot.js b/src/lib/connectLayoutToPlot.js index 0296c2015..8b38a05fd 100644 --- a/src/lib/connectLayoutToPlot.js +++ b/src/lib/connectLayoutToPlot.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {EditorControlsContext} from '../context'; export default function connectLayoutToPlot(WrappedComponent) { class LayoutConnectedComponent extends Component { @@ -65,12 +66,7 @@ export default function connectLayoutToPlot(WrappedComponent) { LayoutConnectedComponent.displayName = `LayoutConnected${getDisplayName(WrappedComponent)}`; - LayoutConnectedComponent.contextTypes = { - layout: PropTypes.object, - fullLayout: PropTypes.object, - plotly: PropTypes.object, - onUpdate: PropTypes.func, - }; + LayoutConnectedComponent.contextType = EditorControlsContext; LayoutConnectedComponent.childContextTypes = { getValObject: PropTypes.func, diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index 5b5b0ab21..554d2fd45 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -196,13 +196,6 @@ export default function connectTraceToPlot(WrappedComponent) { TraceConnectedComponent.contextType = EditorControlsContext; - // TraceConnectedComponent.contextTypes = { - // fullData: PropTypes.array, - // data: PropTypes.array, - // plotly: PropTypes.object, - // onUpdate: PropTypes.func, - // }; - TraceConnectedComponent.childContextTypes = { getValObject: PropTypes.func, updateContainer: PropTypes.func, From d4978c6959088b17a7648cc4429027f01be7275f Mon Sep 17 00:00:00 2001 From: oprstchn Date: Fri, 16 Nov 2018 19:56:07 +0900 Subject: [PATCH 26/69] remove contextTypes --- package.json | 1 + src/components/PanelMenuWrapper.js | 10 -- src/components/containers/ModalProvider.js | 21 +--- src/components/containers/PanelHeader.js | 4 +- src/components/containers/PlotlyFold.js | 36 ++++-- src/components/containers/PlotlySection.js | 3 +- src/components/containers/TraceAccordion.js | 1 + .../containers/TraceRequiredPanel.js | 2 + src/components/fields/DataSelector.js | 25 +++-- src/components/fields/Field.js | 9 +- src/components/fields/LocationSelector.js | 30 +++-- src/components/widgets/TraceTypeSelector.js | 6 - src/default_panels/GraphCreatePanel.js | 10 +- src/default_panels/GraphSubplotsPanel.js | 4 - src/default_panels/GraphTransformsPanel.js | 4 - src/default_panels/StyleColorbarsPanel.js | 4 - src/default_panels/StyleImagesPanel.js | 4 - src/default_panels/StyleLayoutPanel.js | 4 - src/default_panels/StyleLegendPanel.js | 4 - src/default_panels/StyleNotesPanel.js | 4 - src/default_panels/StyleShapesPanel.js | 4 - src/default_panels/StyleSlidersPanel.js | 4 - src/default_panels/StyleTracesPanel.js | 4 - src/default_panels/StyleUpdateMenusPanel.js | 4 - src/lib/connectLayoutToPlot.js | 103 ++++++++++++------ src/lib/connectToContainer.js | 71 ++++++++---- src/lib/connectTraceToPlot.js | 45 ++++++-- src/lib/index.js | 2 + src/lib/recursiveMap.js | 31 ++++++ 29 files changed, 267 insertions(+), 187 deletions(-) create mode 100644 src/lib/recursiveMap.js diff --git a/package.json b/package.json index 017e3655f..fd876bd4c 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "plotly.js": "^1.42.5", "prop-types": "^15.5.10", "raf": "^3.4.0", + "react-adopt": "^0.6.0", "react-color": "^2.13.8", "react-colorscales": "0.7.2", "react-dropzone": "^5.0.1", diff --git a/src/components/PanelMenuWrapper.js b/src/components/PanelMenuWrapper.js index 3f704acfe..36df008f5 100644 --- a/src/components/PanelMenuWrapper.js +++ b/src/components/PanelMenuWrapper.js @@ -25,12 +25,6 @@ class PanelsWithSidebar extends Component { this.setState({group, panel}); } - getChildContext() { - return { - setPanel: this.setPanel, - }; - } - provideValue() { return { setPanel: this.setPanel, @@ -119,8 +113,4 @@ PanelsWithSidebar.propTypes = { menuPanelOrder: PropTypes.array, }; -PanelsWithSidebar.childContextTypes = { - setPanel: PropTypes.func, -}; - export default PanelsWithSidebar; diff --git a/src/components/containers/ModalProvider.js b/src/components/containers/ModalProvider.js index a2fabc5bb..fefffda06 100644 --- a/src/components/containers/ModalProvider.js +++ b/src/components/containers/ModalProvider.js @@ -1,6 +1,6 @@ import React, {Fragment} from 'react'; import PropTypes from 'prop-types'; -import {ModalProviderContext} from '../../context'; +import {EditorControlsContext, ModalProviderContext} from '../../context'; class ModalProvider extends React.Component { constructor(props) { @@ -62,15 +62,6 @@ class ModalProvider extends React.Component { }, animationDuration); } - getChildContext() { - return { - openModal: (c, p) => this.openModal(c, p), - closeModal: () => this.closeModal(), - handleClose: () => this.handleClose(), - isAnimatingOut: this.state.isAnimatingOut, - }; - } - provideValue() { return { openModal: (c, p) => this.openModal(c, p), @@ -98,14 +89,6 @@ class ModalProvider extends React.Component { ModalProvider.propTypes = { children: PropTypes.node, }; -ModalProvider.contextTypes = { - localize: PropTypes.func, -}; -ModalProvider.childContextTypes = { - openModal: PropTypes.func, - closeModal: PropTypes.func, - handleClose: PropTypes.func, - isAnimatingOut: PropTypes.bool, -}; +ModalProvider.contextType = EditorControlsContext; export default ModalProvider; diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js index e08c60244..706ff05ca 100644 --- a/src/components/containers/PanelHeader.js +++ b/src/components/containers/PanelHeader.js @@ -86,10 +86,10 @@ class PanelHeader extends Component { PanelHeader.contextTypes = { layout: PropTypes.object, - fullContainer: PropTypes.object, onUpdate: PropTypes.func, - updateContainer: PropTypes.func, localize: PropTypes.func, + fullContainer: PropTypes.object, + updateContainer: PropTypes.func, }; PanelHeader.propTypes = { diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index 0c167d48f..81c9860f5 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -28,7 +28,7 @@ export class Fold extends Component { if (!this.foldVisible && !this.props.messageIfEmpty) { return ; } - const {deleteContainer} = this.context; + // const {deleteContainer} = this.context; const { canDelete, children, @@ -40,6 +40,7 @@ export class Fold extends Component { icon: Icon, messageIfEmpty, name, + context: {deleteContainer}, } = this.props; const contentClass = classnames('fold__content', { @@ -127,29 +128,35 @@ Fold.propTypes = { icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), messageIfEmpty: PropTypes.string, name: PropTypes.string, + context: PropTypes.object, }; -Fold.contextTypes = { +Fold.requireContext = { deleteContainer: PropTypes.func, }; +// Fold.contextTypes = { +// deleteContainer: PropTypes.func, +// }; + Fold.childContextTypes = { foldInfo: PropTypes.object, }; class PlotlyFold extends Fold { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.foldVisible = false; - this.determineVisibility(props, context); + this.determineVisibility(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.determineVisibility(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.determineVisibility(nextProps); } - determineVisibility(nextProps, nextContext) { + determineVisibility(nextProps) { + const {context} = nextProps; this.foldVisible = false; React.Children.forEach(nextProps.children, child => { @@ -159,9 +166,9 @@ class PlotlyFold extends Fold { if (child.props.attr) { // attr components force fold open if they are visible - const plotProps = unpackPlotProps(child.props, nextContext); + const plotProps = unpackPlotProps(child.props, context); if (child.type.modifyPlotProps) { - child.type.modifyPlotProps(child.props, nextContext, plotProps); + child.type.modifyPlotProps(child.props, context, plotProps); } this.foldVisible = this.foldVisible || plotProps.isVisible; @@ -181,11 +188,18 @@ PlotlyFold.plotly_editor_traits = { foldable: true, }; -PlotlyFold.contextTypes = Object.assign( +PlotlyFold.requireContext = Object.assign( { deleteContainer: PropTypes.func, }, containerConnectedContextTypes ); +// PlotlyFold.contextTypes = Object.assign( +// { +// deleteContainer: PropTypes.func, +// }, +// containerConnectedContextTypes +// ); + export default PlotlyFold; diff --git a/src/components/containers/PlotlySection.js b/src/components/containers/PlotlySection.js index 677be29da..d5bbe778c 100644 --- a/src/components/containers/PlotlySection.js +++ b/src/components/containers/PlotlySection.js @@ -71,4 +71,5 @@ export default class PlotlySection extends Section { } PlotlySection.plotly_editor_traits = {no_visibility_forcing: true}; -PlotlySection.contextTypes = containerConnectedContextTypes; +PlotlySection.requireContext = containerConnectedContextTypes; +// PlotlySection.contextTypes = containerConnectedContextTypes; diff --git a/src/components/containers/TraceAccordion.js b/src/components/containers/TraceAccordion.js index e6b6250d0..ca52b8bf4 100644 --- a/src/components/containers/TraceAccordion.js +++ b/src/components/containers/TraceAccordion.js @@ -11,6 +11,7 @@ import {PanelMessage} from './PanelEmpty'; import {EditorControlsContext} from '../../context'; const TraceFold = connectTraceToPlot(PlotlyFold); + class TraceAccordion extends Component { constructor(props, context) { super(props, context); diff --git a/src/components/containers/TraceRequiredPanel.js b/src/components/containers/TraceRequiredPanel.js index 745062e0e..5dffe5ec6 100644 --- a/src/components/containers/TraceRequiredPanel.js +++ b/src/components/containers/TraceRequiredPanel.js @@ -44,6 +44,8 @@ TraceRequiredPanel.defaultProps = { visible: true, }; +TraceRequiredPanel.context = LayoutPanel.context; + TraceRequiredPanel.contextType = EditorControlsContext; export default TraceRequiredPanel; diff --git a/src/components/fields/DataSelector.js b/src/components/fields/DataSelector.js index e6e98484a..1bf553e39 100644 --- a/src/components/fields/DataSelector.js +++ b/src/components/fields/DataSelector.js @@ -5,6 +5,7 @@ import Field from './Field'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {connectToContainer, maybeAdjustSrc, maybeTransposeData} from 'lib'; import {TRANSFORMS_LIST} from 'lib/constants'; +import {EditorControlsContext} from '../../context'; export function attributeIsData(meta = {}) { return meta.valType === 'data_array' || meta.arrayOk; @@ -114,18 +115,24 @@ UnconnectedDataSelector.propTypes = { ...Field.propTypes, }; -UnconnectedDataSelector.contextTypes = { - dataSources: PropTypes.object, - dataSourceOptions: PropTypes.array, - dataSourceValueRenderer: PropTypes.func, - dataSourceOptionRenderer: PropTypes.func, - srcConverters: PropTypes.shape({ - toSrc: PropTypes.func.isRequired, - fromSrc: PropTypes.func.isRequired, - }), +UnconnectedDataSelector.requireContext = { container: PropTypes.object, }; +UnconnectedDataSelector.contextType = EditorControlsContext; + +// UnconnectedDataSelector.contextTypes = { +// dataSources: PropTypes.object, +// dataSourceOptions: PropTypes.array, +// dataSourceValueRenderer: PropTypes.func, +// dataSourceOptionRenderer: PropTypes.func, +// srcConverters: PropTypes.shape({ +// toSrc: PropTypes.func.isRequired, +// fromSrc: PropTypes.func.isRequired, +// }), +// container: PropTypes.object, +// }; + function modifyPlotProps(props, context, plotProps) { if ( attributeIsData(plotProps.attrMeta) && diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index 4b25eea7e..649ffeeac 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -106,12 +106,17 @@ Field.propTypes = { fieldContainerClassName: PropTypes.string, }; -Field.contextTypes = { - // ConnectToContainer +Field.requireContext = { description: PropTypes.string, attr: PropTypes.string, }; +// Field.contextTypes = { +// // ConnectToContainer +// description: PropTypes.string, +// attr: PropTypes.string, +// }; + Field.defaultProps = { center: false, multiValued: false, diff --git a/src/components/fields/LocationSelector.js b/src/components/fields/LocationSelector.js index 495f5df27..d51301751 100644 --- a/src/components/fields/LocationSelector.js +++ b/src/components/fields/LocationSelector.js @@ -49,15 +49,19 @@ UnconnectedLocation.propTypes = { ...Field.propTypes, }; -UnconnectedLocation.contextTypes = { +UnconnectedLocation.requireContext = { updateContainer: PropTypes.func, }; +// UnconnectedLocation.contextTypes = { +// updateContainer: PropTypes.func, +// }; + const Location = connectToContainer(UnconnectedLocation); class UnconnectedLocationSelector extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.state = { mode: props.container.locations ? 'location' : 'latlon', @@ -88,9 +92,10 @@ class UnconnectedLocationSelector extends Component { render() { const {mode} = this.state; + const {context} = this.props; const { container: {type: type}, - } = this.context; + } = context; return type === 'scattergeo' ? ( @@ -109,11 +114,11 @@ class UnconnectedLocationSelector extends Component { {mode === 'latlon' ? ( - - + + ) : ( - + )} )} @@ -124,8 +129,8 @@ class UnconnectedLocationSelector extends Component { {({localize: _}) => ( - - + + )} @@ -140,9 +145,14 @@ UnconnectedLocationSelector.propTypes = { ...Field.propTypes, }; -UnconnectedLocationSelector.contextTypes = { +UnconnectedLocationSelector.requireContext = { container: PropTypes.object, updateContainer: PropTypes.func, }; +// UnconnectedLocationSelector.contextTypes = { +// container: PropTypes.object, +// updateContainer: PropTypes.func, +// }; + export default connectToContainer(UnconnectedLocationSelector); diff --git a/src/components/widgets/TraceTypeSelector.js b/src/components/widgets/TraceTypeSelector.js index 90e527c97..8a1e726f2 100644 --- a/src/components/widgets/TraceTypeSelector.js +++ b/src/components/widgets/TraceTypeSelector.js @@ -301,12 +301,6 @@ TraceTypeSelector.propTypes = { traceTypesConfig: PropTypes.object, }; TraceTypeSelector.contextType = EditorControlsContext; -// TraceTypeSelector.contextTypes = { -// handleClose: PropTypes.func, -// localize: PropTypes.func, -// mapBoxAccess: PropTypes.bool, -// chartHelp: PropTypes.object, -// }; export class TraceTypeSelectorButton extends Component { render() { diff --git a/src/default_panels/GraphCreatePanel.js b/src/default_panels/GraphCreatePanel.js index 4fd8df900..160c5f827 100644 --- a/src/default_panels/GraphCreatePanel.js +++ b/src/default_panels/GraphCreatePanel.js @@ -18,6 +18,12 @@ import { Histogram2d, } from '../components/fields/derived'; import {EditorControlsContext, ModalProviderContext} from '../context'; +// import {combineContext} from '../lib/mixContext'; +// +// const {Provide, Subscribe} = combineContext({ +// editor: , +// modal: , +// }); const GraphCreatePanel = () => { return ( @@ -172,7 +178,3 @@ const GraphCreatePanel = () => { }; export default GraphCreatePanel; -// GraphCreatePanel.contextTypes = { -// localize: PropTypes.func, -// setPanel: PropTypes.func, -// }; diff --git a/src/default_panels/GraphSubplotsPanel.js b/src/default_panels/GraphSubplotsPanel.js index 09a7f471c..e646d2c1d 100644 --- a/src/default_panels/GraphSubplotsPanel.js +++ b/src/default_panels/GraphSubplotsPanel.js @@ -236,8 +236,4 @@ const GraphSubplotsPanel = () => ( ); -// GraphSubplotsPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default GraphSubplotsPanel; diff --git a/src/default_panels/GraphTransformsPanel.js b/src/default_panels/GraphTransformsPanel.js index 717dceed5..462b207bb 100644 --- a/src/default_panels/GraphTransformsPanel.js +++ b/src/default_panels/GraphTransformsPanel.js @@ -98,8 +98,4 @@ const GraphTransformsPanel = () => { ); }; -// GraphTransformsPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default GraphTransformsPanel; diff --git a/src/default_panels/StyleColorbarsPanel.js b/src/default_panels/StyleColorbarsPanel.js index b0196f168..6a2a854d8 100644 --- a/src/default_panels/StyleColorbarsPanel.js +++ b/src/default_panels/StyleColorbarsPanel.js @@ -298,8 +298,4 @@ const StyleColorBarsPanel = () => { ); }; -// StyleColorBarsPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleColorBarsPanel; diff --git a/src/default_panels/StyleImagesPanel.js b/src/default_panels/StyleImagesPanel.js index 915cf164f..0c13d74b5 100644 --- a/src/default_panels/StyleImagesPanel.js +++ b/src/default_panels/StyleImagesPanel.js @@ -73,8 +73,4 @@ const StyleImagesPanel = () => ( ); -// StyleImagesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleImagesPanel; diff --git a/src/default_panels/StyleLayoutPanel.js b/src/default_panels/StyleLayoutPanel.js index 0ed7207d5..d799de5f0 100644 --- a/src/default_panels/StyleLayoutPanel.js +++ b/src/default_panels/StyleLayoutPanel.js @@ -145,8 +145,4 @@ const StyleLayoutPanel = () => ( ); -// StyleLayoutPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleLayoutPanel; diff --git a/src/default_panels/StyleLegendPanel.js b/src/default_panels/StyleLegendPanel.js index 2780084b3..f3ddd566d 100644 --- a/src/default_panels/StyleLegendPanel.js +++ b/src/default_panels/StyleLegendPanel.js @@ -83,8 +83,4 @@ const StyleLegendPanel = () => ( ); -// StyleLegendPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleLegendPanel; diff --git a/src/default_panels/StyleNotesPanel.js b/src/default_panels/StyleNotesPanel.js index 83eb24c50..f546a770e 100644 --- a/src/default_panels/StyleNotesPanel.js +++ b/src/default_panels/StyleNotesPanel.js @@ -76,8 +76,4 @@ const StyleNotesPanel = () => ( ); -// StyleNotesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleNotesPanel; diff --git a/src/default_panels/StyleShapesPanel.js b/src/default_panels/StyleShapesPanel.js index b8b74c23c..dc92118db 100644 --- a/src/default_panels/StyleShapesPanel.js +++ b/src/default_panels/StyleShapesPanel.js @@ -55,8 +55,4 @@ const StyleShapesPanel = () => ( ); -// StyleShapesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleShapesPanel; diff --git a/src/default_panels/StyleSlidersPanel.js b/src/default_panels/StyleSlidersPanel.js index 19a5490d3..2d0332fcb 100644 --- a/src/default_panels/StyleSlidersPanel.js +++ b/src/default_panels/StyleSlidersPanel.js @@ -83,8 +83,4 @@ const StyleSlidersPanel = () => ( ); -// StyleSlidersPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleSlidersPanel; diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index ece23680f..e37817532 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -667,8 +667,4 @@ const StyleTracesPanel = () => ( ); -// StyleTracesPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleTracesPanel; diff --git a/src/default_panels/StyleUpdateMenusPanel.js b/src/default_panels/StyleUpdateMenusPanel.js index 311f3cfd1..bf8263c37 100644 --- a/src/default_panels/StyleUpdateMenusPanel.js +++ b/src/default_panels/StyleUpdateMenusPanel.js @@ -74,8 +74,4 @@ const StyleUpdateMenusPanel = () => ( ); -// StyleUpdateMenusPanel.contextTypes = { -// localize: PropTypes.func, -// }; - export default StyleUpdateMenusPanel; diff --git a/src/lib/connectLayoutToPlot.js b/src/lib/connectLayoutToPlot.js index 8b38a05fd..578b87d2a 100644 --- a/src/lib/connectLayoutToPlot.js +++ b/src/lib/connectLayoutToPlot.js @@ -1,40 +1,60 @@ import React, {Component} from 'react'; -import PropTypes from 'prop-types'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; import {EditorControlsContext} from '../context'; +import {recursiveMap} from './recursiveMap'; +// import PropTypes from "prop-types"; + +// localize: PropTypes.func, +// data: PropTypes.array, +// fullData: PropTypes.array, +// fullLayout: PropTypes.object, +// getValObject: PropTypes.func, +// graphDiv: PropTypes.object, +// layout: PropTypes.object, +// plotly: PropTypes.object, +// onUpdate: PropTypes.func, export default function connectLayoutToPlot(WrappedComponent) { class LayoutConnectedComponent extends Component { - getChildContext() { - const {layout, fullLayout, plotly, onUpdate} = this.context; - - const updateContainer = update => { - if (!onUpdate) { - return; - } - onUpdate({ - type: EDITOR_ACTIONS.UPDATE_LAYOUT, - payload: { - update, - }, - }); - }; - - return { - getValObject: attr => - !plotly - ? null - : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts), - updateContainer, - container: layout, - fullContainer: fullLayout, - }; - } + // getChildContext() { + // const {layout, fullLayout, plotly, onUpdate} = this.context; + // + // const updateContainer = update => { + // if (!onUpdate) { + // return; + // } + // onUpdate({ + // type: EDITOR_ACTIONS.UPDATE_LAYOUT, + // payload: { + // update, + // }, + // }); + // }; + // + // return { + // getValObject: attr => + // !plotly + // ? null + // : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts), + // updateContainer, + // container: layout, + // fullContainer: fullLayout, + // }; + // } provideValue() { - const {layout, fullLayout, plotly, onUpdate} = this.context; + const { + layout, + fullLayout, + plotly, + onUpdate, + localize, + fullData, + graphDiv, + data, + } = this.context; const updateContainer = update => { if (!onUpdate) { @@ -49,6 +69,14 @@ export default function connectLayoutToPlot(WrappedComponent) { }; return { + layout, + fullLayout, + plotly, + onUpdate, + localize, + fullData, + data, + graphDiv, getValObject: attr => !plotly ? null @@ -60,7 +88,14 @@ export default function connectLayoutToPlot(WrappedComponent) { } render() { - return ; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -68,12 +103,12 @@ export default function connectLayoutToPlot(WrappedComponent) { LayoutConnectedComponent.contextType = EditorControlsContext; - LayoutConnectedComponent.childContextTypes = { - getValObject: PropTypes.func, - updateContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - }; + // LayoutConnectedComponent.childContextTypes = { + // getValObject: PropTypes.func, + // updateContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // }; const {plotly_editor_traits} = WrappedComponent; LayoutConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index 1386b20d2..6dfadc7eb 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import unpackPlotProps from './unpackPlotProps'; import {getDisplayName} from '../lib'; +import {recursiveMap} from './recursiveMap'; export const containerConnectedContextTypes = { // EditorControlsContext @@ -35,28 +36,28 @@ export default function connectToContainer(WrappedComponent, config = {}) { } } - constructor(props, context) { - super(props, context); - - this.setLocals(props, context); + constructor(props) { + super(props); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - this.plotProps = unpackPlotProps(props, context); - this.attr = props.attr; - ContainerConnectedComponent.modifyPlotProps(props, context, this.plotProps); + setLocals(props) { + const {context, ...rest} = props; + this.plotProps = unpackPlotProps(rest, context); + this.attr = rest.attr; + ContainerConnectedComponent.modifyPlotProps(rest, context, this.plotProps); } - getChildContext() { - return { - description: this.plotProps.description, - attr: this.attr, - }; - } + // getChildContext() { + // return { + // description: this.plotProps.description, + // attr: this.attr, + // }; + // } provideValue() { return { @@ -70,9 +71,31 @@ export default function connectToContainer(WrappedComponent, config = {}) { // props. However pass plotProps as a specific prop in case inner component // is also wrapped by a component that `unpackPlotProps`. That way inner // component can skip computation as it can see plotProps is already defined. - const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, this.props); + const {context, ...rest} = this.props; + const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, rest); if (props.isVisible) { - return ; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ( + + ); } return null; @@ -80,12 +103,12 @@ export default function connectToContainer(WrappedComponent, config = {}) { } ContainerConnectedComponent.displayName = `ContainerConnected${getDisplayName(WrappedComponent)}`; - - ContainerConnectedComponent.contextTypes = containerConnectedContextTypes; - ContainerConnectedComponent.childContextTypes = { - description: PropTypes.string, - attr: PropTypes.string, - }; + // ContainerConnectedComponent.contextTypes = containerConnectedContextTypes; + ContainerConnectedComponent.requireContext = containerConnectedContextTypes; + // ContainerConnectedComponent.childContextTypes = { + // description: PropTypes.string, + // attr: PropTypes.string, + // }; const {plotly_editor_traits} = WrappedComponent; ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index 554d2fd45..5f71ce13a 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -11,6 +11,7 @@ import { import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {EDITOR_ACTIONS, SUBPLOT_TO_ATTR} from 'lib/constants'; import {EditorControlsContext} from '../context'; +import {recursiveMap} from './recursiveMap'; export default function connectTraceToPlot(WrappedComponent) { class TraceConnectedComponent extends Component { @@ -28,12 +29,20 @@ export default function connectTraceToPlot(WrappedComponent) { setLocals(props, context) { const {traceIndexes} = props; - const {data, fullData, plotly} = context; + const {data, layout, fullLayout, plotly, onUpdate, localize, fullData, graphDiv} = context; const trace = data[traceIndexes[0]]; const fullTrace = getFullTrace(props, context); this.childContext = { + data, + layout, + fullLayout, + plotly, + onUpdate, + localize, + fullData, + graphDiv, getValObject: attr => !plotly ? null @@ -183,7 +192,21 @@ export default function connectTraceToPlot(WrappedComponent) { } render() { - return ; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ( + + ); } } @@ -196,15 +219,15 @@ export default function connectTraceToPlot(WrappedComponent) { TraceConnectedComponent.contextType = EditorControlsContext; - TraceConnectedComponent.childContextTypes = { - getValObject: PropTypes.func, - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - defaultContainer: PropTypes.object, - container: PropTypes.object, - fullContainer: PropTypes.object, - traceIndexes: PropTypes.array, - }; + // TraceConnectedComponent.childContextTypes = { + // getValObject: PropTypes.func, + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, + // defaultContainer: PropTypes.object, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // traceIndexes: PropTypes.array, + // }; const {plotly_editor_traits} = WrappedComponent; TraceConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/index.js b/src/lib/index.js index ff414f6a9..eda1ac55f 100644 --- a/src/lib/index.js +++ b/src/lib/index.js @@ -31,6 +31,7 @@ import striptags from './striptags'; import {capitalize, lowerCase, upperCase, removeNonWord, camelCase, pascalCase} from './strings'; import {getColorscale} from 'react-colorscales'; import {EDITOR_ACTIONS} from './constants'; +import recursiveMap from './recursiveMap'; const TOO_LIGHT_FACTOR = 0.8; @@ -251,4 +252,5 @@ export { transpose, getFullTrace, EDITOR_ACTIONS, + recursiveMap, }; diff --git a/src/lib/recursiveMap.js b/src/lib/recursiveMap.js new file mode 100644 index 000000000..1a6138eb8 --- /dev/null +++ b/src/lib/recursiveMap.js @@ -0,0 +1,31 @@ +import React from 'react'; + +export function recursiveMap(children, context) { + return React.Children.map(children, child => { + let newChild = child; + if (!React.isValidElement(child)) { + return child; + } + + if (child.type.requireContext) { + const requireContext = {}; + const newChildren = {}; + Object.keys(child.type.requireContext).forEach(key => { + if (!requireContext.context) { + requireContext.context = {}; + } + requireContext.context[key] = context[key]; + }); + + if (child.props.children) { + newChildren.children = recursiveMap(child.props.children, context); + } + newChild = React.cloneElement(child, { + ...child.props, + ...requireContext, + ...newChildren, + }); + } + return newChild; + }); +} From a4d9b7efdcce195af183d4258c5e6c3562516cab Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 20 Nov 2018 03:15:19 +0900 Subject: [PATCH 27/69] pass to context in props --- src/components/containers/AxesFold.js | 4 +- src/components/containers/PanelHeader.js | 38 +++++++++++++---- src/components/containers/PlotlyFold.js | 13 +++--- src/components/containers/PlotlyPanel.js | 17 ++++---- src/components/containers/PlotlySection.js | 23 ++++++----- .../containers/TraceMarkerSection.js | 16 +++++--- src/components/fields/AxesCreator.js | 4 +- src/components/fields/DataSelector.js | 14 +------ src/components/fields/Field.js | 3 +- src/lib/connectAggregationToTransform.js | 32 +++++++++------ src/lib/connectAxesToLayout.js | 18 +++++++- src/lib/connectLayoutToPlot.js | 41 ++----------------- src/lib/connectToContainer.js | 18 +++----- src/lib/connectTraceToPlot.js | 18 +++----- 14 files changed, 126 insertions(+), 133 deletions(-) diff --git a/src/components/containers/AxesFold.js b/src/components/containers/AxesFold.js index 1af77d744..fc23005fb 100644 --- a/src/components/containers/AxesFold.js +++ b/src/components/containers/AxesFold.js @@ -3,6 +3,7 @@ import PlotlyFold from './PlotlyFold'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectAxesToLayout} from 'lib'; +import {recursiveMap} from '../../lib/recursiveMap'; class AxesFold extends Component { render() { @@ -10,7 +11,7 @@ class AxesFold extends Component { return options.length && children ? ( {options.length === 1 ? null : } - {children} + {recursiveMap(children, this.props.context)} ) : null; } @@ -19,6 +20,7 @@ class AxesFold extends Component { AxesFold.propTypes = { children: PropTypes.any, options: PropTypes.array, + context: PropTypes.object, }; AxesFold.plotly_editor_traits = {foldable: true}; diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js index 706ff05ca..935cef666 100644 --- a/src/components/containers/PanelHeader.js +++ b/src/components/containers/PanelHeader.js @@ -2,6 +2,7 @@ import Button from 'components/widgets/Button'; import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {PlusIcon, ResizeUpIcon, ResizeDownIcon} from 'plotly-icons'; +import {EditorControlsContext} from '../../context'; class PanelHeader extends Component { constructor() { @@ -16,8 +17,22 @@ class PanelHeader extends Component { } render() { - const {localize: _} = this.context; - const {children, addAction, allowCollapse, toggleFolds, hasOpen} = this.props; + const {localize: _, layout, onUpdate} = this.context; + const { + children, + addAction, + allowCollapse, + toggleFolds, + hasOpen, + fullContainer, + updateContainer, + } = this.props; + const handleArgs = { + layout, + onUpdate, + fullContainer, + updateContainer, + }; // dropdown is styled with same styles as react-select component - see _dropdown.scss const icon = ; @@ -51,7 +66,7 @@ class PanelHeader extends Component { onClick={ Array.isArray(addAction.handler) ? this.togglePanel - : () => addAction.handler(this.context) + : () => addAction.handler(handleArgs) } icon={icon} label={addAction.label} @@ -65,7 +80,7 @@ class PanelHeader extends Component { className="Select-option" key={label} onClick={() => { - handler(this.context); + handler(handleArgs); this.togglePanel(); }} > @@ -84,14 +99,21 @@ class PanelHeader extends Component { } } -PanelHeader.contextTypes = { - layout: PropTypes.object, - onUpdate: PropTypes.func, - localize: PropTypes.func, +PanelHeader.contextType = EditorControlsContext; + +PanelHeader.requireContext = { fullContainer: PropTypes.object, updateContainer: PropTypes.func, }; +// PanelHeader.contextTypes = { +// layout: PropTypes.object, +// onUpdate: PropTypes.func, +// localize: PropTypes.func, +// fullContainer: PropTypes.object, +// updateContainer: PropTypes.func, +// }; + PanelHeader.propTypes = { addAction: PropTypes.object, allowCollapse: PropTypes.bool, diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index 81c9860f5..baba2a337 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -4,7 +4,6 @@ import React, {Component} from 'react'; import classnames from 'classnames'; import {CloseIcon, AngleDownIcon} from 'plotly-icons'; import {unpackPlotProps, containerConnectedContextTypes, striptags} from 'lib'; -import {PlotlyFoldContext} from '../../context'; export class Fold extends Component { constructor() { @@ -26,7 +25,7 @@ export class Fold extends Component { render() { if (!this.foldVisible && !this.props.messageIfEmpty) { - return ; + return null; } // const {deleteContainer} = this.context; const { @@ -105,12 +104,10 @@ export class Fold extends Component { const classes = className ? ' ' + className : ''; return ( - -
- {foldHeader} - {foldContent} -
-
+
+ {foldHeader} + {foldContent} +
); } } diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index 6355ee86c..c29847295 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -6,6 +6,7 @@ import update from 'immutability-helper'; import {bem} from 'lib'; import {EmbedIconIcon} from 'plotly-icons'; import {EditorControlsContext, PlotlyPanelContext} from '../../context'; +import {recursiveMap} from '../../lib/recursiveMap'; class PanelErrorImpl extends Component { render() { @@ -34,12 +35,6 @@ export class Panel extends Component { this.toggleFold = this.toggleFold.bind(this); } - getChildContext() { - return { - deleteContainer: this.props.deleteAction ? this.props.deleteAction : null, - }; - } - provideValue() { return { deleteContainer: this.props.deleteAction ? this.props.deleteAction : null, @@ -120,7 +115,9 @@ export class Panel extends Component { toggleFolds={this.toggleFolds} hasOpen={individualFoldStates.some(s => s === false)} /> -
{newChildren}
+
+ {recursiveMap(newChildren, {...this.context, ...this.provideValue()})} +
); @@ -141,9 +138,9 @@ Panel.defaultProps = { Panel.contextType = EditorControlsContext; -Panel.childContextTypes = { - deleteContainer: PropTypes.func, -}; +// Panel.childContextTypes = { +// deleteContainer: PropTypes.func, +// }; class PlotlyPanel extends Panel {} diff --git a/src/components/containers/PlotlySection.js b/src/components/containers/PlotlySection.js index d5bbe778c..94bb8ecdc 100644 --- a/src/components/containers/PlotlySection.js +++ b/src/components/containers/PlotlySection.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {containerConnectedContextTypes, unpackPlotProps} from '../../lib'; +import {recursiveMap} from '../../lib/recursiveMap'; export class Section extends Component { constructor() { @@ -20,7 +21,7 @@ export class Section extends Component {
{this.props.name}
) : null} - {this.props.children} + {recursiveMap(this.props.children, this.props.context)}
); } @@ -31,20 +32,22 @@ Section.propTypes = { children: PropTypes.node, name: PropTypes.string, attr: PropTypes.string, + context: PropTypes.object, }; export default class PlotlySection extends Section { - constructor(props, context) { - super(props, context); - this.determineVisibility(props, context); + constructor(props) { + super(props); + this.determineVisibility(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.determineVisibility(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.determineVisibility(nextProps); } - determineVisibility(nextProps, nextContext) { - const {isVisible} = unpackPlotProps(nextProps, nextContext); + determineVisibility(nextProps) { + const {context, ...props} = nextProps; + const {isVisible} = unpackPlotProps(props, context); this.sectionVisible = Boolean(isVisible); React.Children.forEach(nextProps.children, child => { @@ -53,9 +56,9 @@ export default class PlotlySection extends Section { } if (child.props.attr) { - const plotProps = unpackPlotProps(child.props, nextContext); + const plotProps = unpackPlotProps(child.props, context); if (child.type.modifyPlotProps) { - child.type.modifyPlotProps(child.props, nextContext, plotProps); + child.type.modifyPlotProps(child.props, context, plotProps); } this.sectionVisible = this.sectionVisible || plotProps.isVisible; return; diff --git a/src/components/containers/TraceMarkerSection.js b/src/components/containers/TraceMarkerSection.js index c817a8f4d..71db8d36c 100644 --- a/src/components/containers/TraceMarkerSection.js +++ b/src/components/containers/TraceMarkerSection.js @@ -1,15 +1,16 @@ import PlotlySection from './PlotlySection'; import React, {Component} from 'react'; import PropTypes from 'prop-types'; +import {EditorControlsContext} from '../../context'; class TraceMarkerSection extends Component { constructor(props, context) { super(props, context); - this.setLocals(context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } setLocals(context) { @@ -34,9 +35,14 @@ TraceMarkerSection.propTypes = { name: PropTypes.string, }; -TraceMarkerSection.contextTypes = { +TraceMarkerSection.contextType = EditorControlsContext; +TraceMarkerSection.requireContext = { fullContainer: PropTypes.object, - localize: PropTypes.func, }; +// TraceMarkerSection.contextTypes = { +// fullContainer: PropTypes.object, +// localize: PropTypes.func, +// }; + export default TraceMarkerSection; diff --git a/src/components/fields/AxesCreator.js b/src/components/fields/AxesCreator.js index a1d8b09ee..68ca61b5d 100644 --- a/src/components/fields/AxesCreator.js +++ b/src/components/fields/AxesCreator.js @@ -91,6 +91,7 @@ class UnconnectedAxisCreator extends Component { options={this.props.options} updatePlot={u => this.updateAxis(u)} extraComponent={extraComponent} + context={this.props.context} /> ); } @@ -141,9 +142,8 @@ class UnconnectedAxesCreator extends Component { ); }); } - return ( - + {controls} {({setPanel}) => ( diff --git a/src/components/fields/DataSelector.js b/src/components/fields/DataSelector.js index 1bf553e39..4ca4b1d8c 100644 --- a/src/components/fields/DataSelector.js +++ b/src/components/fields/DataSelector.js @@ -117,22 +117,12 @@ UnconnectedDataSelector.propTypes = { UnconnectedDataSelector.requireContext = { container: PropTypes.object, + description: PropTypes.string, + attr: PropTypes.string, }; UnconnectedDataSelector.contextType = EditorControlsContext; -// UnconnectedDataSelector.contextTypes = { -// dataSources: PropTypes.object, -// dataSourceOptions: PropTypes.array, -// dataSourceValueRenderer: PropTypes.func, -// dataSourceOptionRenderer: PropTypes.func, -// srcConverters: PropTypes.shape({ -// toSrc: PropTypes.func.isRequired, -// fromSrc: PropTypes.func.isRequired, -// }), -// container: PropTypes.object, -// }; - function modifyPlotProps(props, context, plotProps) { if ( attributeIsData(plotProps.attrMeta) && diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index 649ffeeac..a8f90341c 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -6,6 +6,7 @@ import {bem} from 'lib'; import {getMultiValueText} from 'lib/constants'; import {CloseIcon} from 'plotly-icons'; import {EditorControlsContext} from '../../context'; +import {recursiveMap} from '../../lib/recursiveMap'; export class FieldDelete extends Component { render() { @@ -73,7 +74,7 @@ class Field extends Component { ) : null}
- {children} + {recursiveMap(children, this.props.context)} {extraComponent ? extraComponent : null} {multiValued && !suppressMultiValuedMessage ? ( diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index 3aab86b0e..fd2a44e7d 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -4,20 +4,19 @@ import {getDisplayName} from '../lib'; export default function connectAggregationToTransform(WrappedComponent) { class AggregationConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.updateAggregation = this.updateAggregation.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {aggregationIndex} = props; - const {container, fullContainer} = context; + setLocals(props) { + const {aggregationIndex, container, fullContainer} = props; const aggregations = (container && container.aggregations) || []; const fullAggregations = fullContainer.aggregations || []; @@ -28,7 +27,7 @@ export default function connectAggregationToTransform(WrappedComponent) { getChildContext() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`aggregations[].${attr}`), + !this.props.getValObject ? null : this.props.getValObject(`aggregations[].${attr}`), updateContainer: this.updateAggregation, container: this.container, fullContainer: this.fullContainer, @@ -38,7 +37,7 @@ export default function connectAggregationToTransform(WrappedComponent) { provideValue() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`aggregations[].${attr}`), + !this.props.getValObject ? null : this.props.getValObject(`aggregations[].${attr}`), updateContainer: this.updateAggregation, container: this.container, fullContainer: this.fullContainer, @@ -69,15 +68,22 @@ export default function connectAggregationToTransform(WrappedComponent) { aggregationIndex: PropTypes.number.isRequired, }; - AggregationConnectedComponent.contextTypes = { + AggregationConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - data: PropTypes.array, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; + // AggregationConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // data: PropTypes.array, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + AggregationConnectedComponent.childContextTypes = { updateContainer: PropTypes.func, deleteContainer: PropTypes.func, diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index c1dd4c1f4..82cdfafbf 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {capitalize, getAllAxes, getDisplayName, getAxisTitle} from '../lib'; +import {recursiveMap} from './recursiveMap'; function computeAxesOptions(axes, props, context) { const _ = context.localize; @@ -153,13 +154,20 @@ export default function connectAxesToLayout(WrappedComponent) { } render() { + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } return ; } } AxesConnectedComponent.displayName = `AxesConnected${getDisplayName(WrappedComponent)}`; - AxesConnectedComponent.contextTypes = { + AxesConnectedComponent.requireContext = { container: PropTypes.object.isRequired, fullContainer: PropTypes.object.isRequired, updateContainer: PropTypes.func, @@ -167,6 +175,14 @@ export default function connectAxesToLayout(WrappedComponent) { getValObject: PropTypes.func, }; + // AxesConnectedComponent.contextTypes = { + // container: PropTypes.object.isRequired, + // fullContainer: PropTypes.object.isRequired, + // updateContainer: PropTypes.func, + // localize: PropTypes.func, + // getValObject: PropTypes.func, + // }; + AxesConnectedComponent.childContextTypes = { axesOptions: PropTypes.array, axesTarget: PropTypes.string, diff --git a/src/lib/connectLayoutToPlot.js b/src/lib/connectLayoutToPlot.js index 578b87d2a..884aa00f3 100644 --- a/src/lib/connectLayoutToPlot.js +++ b/src/lib/connectLayoutToPlot.js @@ -6,44 +6,8 @@ import {EditorControlsContext} from '../context'; import {recursiveMap} from './recursiveMap'; // import PropTypes from "prop-types"; -// localize: PropTypes.func, -// data: PropTypes.array, -// fullData: PropTypes.array, -// fullLayout: PropTypes.object, -// getValObject: PropTypes.func, -// graphDiv: PropTypes.object, -// layout: PropTypes.object, -// plotly: PropTypes.object, -// onUpdate: PropTypes.func, - export default function connectLayoutToPlot(WrappedComponent) { class LayoutConnectedComponent extends Component { - // getChildContext() { - // const {layout, fullLayout, plotly, onUpdate} = this.context; - // - // const updateContainer = update => { - // if (!onUpdate) { - // return; - // } - // onUpdate({ - // type: EDITOR_ACTIONS.UPDATE_LAYOUT, - // payload: { - // update, - // }, - // }); - // }; - // - // return { - // getValObject: attr => - // !plotly - // ? null - // : plotly.PlotSchema.getLayoutValObject(fullLayout, nestedProperty({}, attr).parts), - // updateContainer, - // container: layout, - // fullContainer: fullLayout, - // }; - // } - provideValue() { const { layout, @@ -88,14 +52,15 @@ export default function connectLayoutToPlot(WrappedComponent) { } render() { + const newProps = {...this.props, ...{context: this.provideValue()}}; if (this.props.children) { return ( - + {recursiveMap(this.props.children, this.provideValue())} ); } - return ; + return ; } } diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index 6dfadc7eb..ed58c6135 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -52,13 +52,6 @@ export default function connectToContainer(WrappedComponent, config = {}) { ContainerConnectedComponent.modifyPlotProps(rest, context, this.plotProps); } - // getChildContext() { - // return { - // description: this.plotProps.description, - // attr: this.attr, - // }; - // } - provideValue() { return { description: this.plotProps.description, @@ -73,27 +66,28 @@ export default function connectToContainer(WrappedComponent, config = {}) { // component can skip computation as it can see plotProps is already defined. const {context, ...rest} = this.props; const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, rest); + const newContext = {...context, ...this.provideValue()}; + if (props.isVisible) { + const newProps = {...props, ...{context: newContext}}; if (this.props.children) { return ( - {recursiveMap(this.props.children, this.provideValue())} + {recursiveMap(this.props.children, newContext)} ); } return ( ); } diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index 5f71ce13a..4e29170f4 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -82,9 +82,9 @@ export default function connectTraceToPlot(WrappedComponent) { } } - getChildContext() { - return this.childContext; - } + // getChildContext() { + // return this.childContext; + // } provideValue() { return this.childContext; @@ -192,21 +192,15 @@ export default function connectTraceToPlot(WrappedComponent) { } render() { + const newProps = {...this.props, ...{context: this.provideValue()}}; if (this.props.children) { return ( - + {recursiveMap(this.props.children, this.provideValue())} ); } - return ( - - ); + return ; } } From 927a0b816e183d8ede91359c652d640b984be273 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 20 Nov 2018 03:53:06 +0900 Subject: [PATCH 28/69] fix UnconnnectedContainerVisibility-test --- src/EditorControls.js | 3 +- src/components/containers/PlotlyPanel.js | 34 ++++++++++------------ src/components/containers/PlotlySection.js | 1 + src/components/fields/Numeric.js | 1 - 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/EditorControls.js b/src/EditorControls.js index 0b5111e81..5503f0775 100644 --- a/src/EditorControls.js +++ b/src/EditorControls.js @@ -19,6 +19,7 @@ import {categoryLayout, traceTypes} from 'lib/traceTypes'; import {ModalProvider} from 'components/containers'; import {DEFAULT_FONTS} from 'lib/constants'; import {EditorControlsContext} from './context'; +import {recursiveMap} from './lib/recursiveMap'; class EditorControls extends Component { constructor(props, context) { @@ -354,7 +355,7 @@ class EditorControls extends Component { {this.props.graphDiv && this.props.graphDiv._fullLayout && (this.props.children ? ( - this.props.children + recursiveMap(this.props.children, this.provideValue()) ) : this.props.optionalPanel ? ( {this.props.optionalPanel} diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index c29847295..c5a04e092 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -5,7 +5,7 @@ import React, {Component, cloneElement} from 'react'; import update from 'immutability-helper'; import {bem} from 'lib'; import {EmbedIconIcon} from 'plotly-icons'; -import {EditorControlsContext, PlotlyPanelContext} from '../../context'; +import {EditorControlsContext} from '../../context'; import {recursiveMap} from '../../lib/recursiveMap'; class PanelErrorImpl extends Component { @@ -88,11 +88,7 @@ export class Panel extends Component { const {individualFoldStates, hasError} = this.state; if (hasError) { - return ( - - - - ); + return ; } const newChildren = React.Children.map(this.props.children, (child, index) => { @@ -107,19 +103,21 @@ export class Panel extends Component { }); return ( - -
- 1} - toggleFolds={this.toggleFolds} - hasOpen={individualFoldStates.some(s => s === false)} - /> -
- {recursiveMap(newChildren, {...this.context, ...this.provideValue()})} -
+
+ 1} + toggleFolds={this.toggleFolds} + hasOpen={individualFoldStates.some(s => s === false)} + /> +
+ {recursiveMap(newChildren, { + ...this.context, + ...this.props.context, + ...this.provideValue(), + })}
- +
); } } diff --git a/src/components/containers/PlotlySection.js b/src/components/containers/PlotlySection.js index 94bb8ecdc..de42a5564 100644 --- a/src/components/containers/PlotlySection.js +++ b/src/components/containers/PlotlySection.js @@ -34,6 +34,7 @@ Section.propTypes = { attr: PropTypes.string, context: PropTypes.object, }; +Section.requireContext = containerConnectedContextTypes; export default class PlotlySection extends Section { constructor(props) { diff --git a/src/components/fields/Numeric.js b/src/components/fields/Numeric.js index f3a991298..3d0f51378 100644 --- a/src/components/fields/Numeric.js +++ b/src/components/fields/Numeric.js @@ -12,7 +12,6 @@ export class UnconnectedNumeric extends Component { placeholder = fullValue; fullValue = ''; } - return ( Date: Tue, 20 Nov 2018 18:53:12 +0900 Subject: [PATCH 29/69] fix tests --- .../containers/AnnotationAccordion.js | 3 +- src/components/containers/PanelHeader.js | 21 +++--- src/components/containers/PlotlyPanel.js | 2 + src/components/fields/Numeric.js | 1 + src/lib/connectAnnotationToLayout.js | 53 ++++++------- src/lib/connectAxesToLayout.js | 75 ++++++++++--------- src/lib/connectToContainer.js | 1 + src/lib/recursiveMap.js | 9 +++ 8 files changed, 86 insertions(+), 79 deletions(-) diff --git a/src/components/containers/AnnotationAccordion.js b/src/components/containers/AnnotationAccordion.js index bba399ce1..1d547fa04 100644 --- a/src/components/containers/AnnotationAccordion.js +++ b/src/components/containers/AnnotationAccordion.js @@ -5,6 +5,7 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectAnnotationToLayout} from 'lib'; import {EditorControlsContext} from '../../context'; +import {recursiveMap} from '../../lib/recursiveMap'; const AnnotationFold = connectAnnotationToLayout(PlotlyFold); @@ -20,7 +21,7 @@ class AnnotationAccordion extends Component { annotations.length && annotations.map((ann, i) => ( - {children} + {recursiveMap(children, this.context)} )); diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js index 935cef666..76353ac2e 100644 --- a/src/components/containers/PanelHeader.js +++ b/src/components/containers/PanelHeader.js @@ -18,20 +18,18 @@ class PanelHeader extends Component { render() { const {localize: _, layout, onUpdate} = this.context; - const { - children, - addAction, - allowCollapse, - toggleFolds, - hasOpen, - fullContainer, - updateContainer, - } = this.props; + const {children, addAction, allowCollapse, toggleFolds, hasOpen, context} = this.props; + let contextHandleArgs = {}; + if (context && context.fullContainer && context.updateContainer) { + contextHandleArgs = { + fullContainer: context.fullContainer, + updateContainer: context.updateContainer, + }; + } const handleArgs = { layout, onUpdate, - fullContainer, - updateContainer, + ...contextHandleArgs, }; // dropdown is styled with same styles as react-select component - see _dropdown.scss @@ -120,6 +118,7 @@ PanelHeader.propTypes = { children: PropTypes.node, hasOpen: PropTypes.bool, toggleFolds: PropTypes.func, + context: PropTypes.object, }; export default PanelHeader; diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index c5a04e092..2080d343d 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -109,6 +109,7 @@ export class Panel extends Component { allowCollapse={this.props.showExpandCollapse && individualFoldStates.length > 1} toggleFolds={this.toggleFolds} hasOpen={individualFoldStates.some(s => s === false)} + context={this.props.context} />
{recursiveMap(newChildren, { @@ -128,6 +129,7 @@ Panel.propTypes = { deleteAction: PropTypes.func, noPadding: PropTypes.bool, showExpandCollapse: PropTypes.bool, + context: PropTypes.object, }; Panel.defaultProps = { diff --git a/src/components/fields/Numeric.js b/src/components/fields/Numeric.js index 3d0f51378..f3a991298 100644 --- a/src/components/fields/Numeric.js +++ b/src/components/fields/Numeric.js @@ -12,6 +12,7 @@ export class UnconnectedNumeric extends Component { placeholder = fullValue; fullValue = ''; } + return ( - !this.context.getValObject ? null : this.context.getValObject(`annotations[].${attr}`), - updateContainer: this.updateAnnotation, - deleteContainer: this.deleteAnnotation, - container: this.container, - fullContainer: this.fullContainer, - }; - } - provideValue() { return { getValObject: attr => @@ -56,12 +47,12 @@ export default function connectAnnotationToLayout(WrappedComponent) { const newkey = `annotations[${annotationIndex}].${key}`; newUpdate[newkey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } deleteAnnotation() { - if (this.context.onUpdate) { - this.context.onUpdate({ + if (this.props.context.onUpdate) { + this.props.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_ANNOTATION, payload: {annotationIndex: this.props.annotationIndex}, }); @@ -69,7 +60,15 @@ export default function connectAnnotationToLayout(WrappedComponent) { } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -81,7 +80,7 @@ export default function connectAnnotationToLayout(WrappedComponent) { annotationIndex: PropTypes.number.isRequired, }; - AnnotationConnectedComponent.contextTypes = { + AnnotationConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, data: PropTypes.array, @@ -90,14 +89,6 @@ export default function connectAnnotationToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - AnnotationConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; - const {plotly_editor_traits} = WrappedComponent; AnnotationConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index 82cdfafbf..633f4fa4d 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -34,11 +34,12 @@ function computeAxesOptions(axes, props, context) { export default function connectAxesToLayout(WrappedComponent) { class AxesConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); + const {context, ...newProps} = props; this.axes = getAllAxes(context.fullContainer); - this.axesOptions = computeAxesOptions(this.axes, props, context); + this.axesOptions = computeAxesOptions(this.axes, newProps, context); // this.axesOptions can be an empty array when we have a filter on an AxesFold // and no axes correspond to the condition @@ -57,14 +58,15 @@ export default function connectAxesToLayout(WrappedComponent) { this.axesTargetHandler = this.axesTargetHandler.bind(this); this.updateContainer = this.updateContainer.bind(this); - this.setLocals(props, this.state, context); + this.setLocals(newProps, this.state, context); } - componentWillUpdate(nextProps, nextState, nextContext) { + componentWillUpdate(nextProps, nextState) { + const {context: nextContext, ...newProps} = nextProps; this.axes = getAllAxes(nextContext.fullContainer); this.axesOptions = computeAxesOptions(this.axes, nextProps, nextContext); // This is not enough, what if plotly.js adds new axes... - this.setLocals(nextProps, nextState, nextContext); + this.setLocals(newProps, nextState, nextContext); } setLocals(nextProps, nextState, nextContext) { @@ -89,28 +91,28 @@ export default function connectAxesToLayout(WrappedComponent) { } } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject - ? null - : this.context.getValObject(`${this.state.axesTarget}.${attr}`), - axesOptions: this.axesOptions, - axesTarget: this.state.axesTarget, - axesTargetHandler: this.axesTargetHandler, - container: this.container, - defaultContainer: this.defaultContainer, - fullContainer: this.fullContainer, - updateContainer: this.updateContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject + // ? null + // : this.context.getValObject(`${this.state.axesTarget}.${attr}`), + // axesOptions: this.axesOptions, + // axesTarget: this.state.axesTarget, + // axesTargetHandler: this.axesTargetHandler, + // container: this.container, + // defaultContainer: this.defaultContainer, + // fullContainer: this.fullContainer, + // updateContainer: this.updateContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject + !this.props.context.getValObject ? null - : this.context.getValObject(`${this.state.axesTarget}.${attr}`), + : this.props.context.getValObject(`${this.state.axesTarget}.${attr}`), axesOptions: this.axesOptions, axesTarget: this.state.axesTarget, axesTargetHandler: this.axesTargetHandler, @@ -150,18 +152,19 @@ export default function connectAxesToLayout(WrappedComponent) { } } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } render() { + const newProps = {...this.props, context: this.provideValue()}; if (this.props.children) { return ( - + {recursiveMap(this.props.children, this.provideValue())} ); } - return ; + return ; } } @@ -183,16 +186,16 @@ export default function connectAxesToLayout(WrappedComponent) { // getValObject: PropTypes.func, // }; - AxesConnectedComponent.childContextTypes = { - axesOptions: PropTypes.array, - axesTarget: PropTypes.string, - axesTargetHandler: PropTypes.func, - container: PropTypes.object, - defaultContainer: PropTypes.object, - fullContainer: PropTypes.object, - updateContainer: PropTypes.func, - getValObject: PropTypes.func, - }; + // AxesConnectedComponent.childContextTypes = { + // axesOptions: PropTypes.array, + // axesTarget: PropTypes.string, + // axesTargetHandler: PropTypes.func, + // container: PropTypes.object, + // defaultContainer: PropTypes.object, + // fullContainer: PropTypes.object, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index ed58c6135..60ab7f1c2 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -47,6 +47,7 @@ export default function connectToContainer(WrappedComponent, config = {}) { setLocals(props) { const {context, ...rest} = props; + this.plotProps = unpackPlotProps(rest, context); this.attr = rest.attr; ContainerConnectedComponent.modifyPlotProps(rest, context, this.plotProps); diff --git a/src/lib/recursiveMap.js b/src/lib/recursiveMap.js index 1a6138eb8..dce401b94 100644 --- a/src/lib/recursiveMap.js +++ b/src/lib/recursiveMap.js @@ -7,6 +7,15 @@ export function recursiveMap(children, context) { return child; } + if ( + child.type && + child.type.displayName && + (child.type.displayName.indexOf('LayoutConnected') === 0 || + child.type.displayName.indexOf('TraceConnected') === 0) + ) { + return newChild; + } + if (child.type.requireContext) { const requireContext = {}; const newChildren = {}; From 83ce0e66e0e807882dfabbfd264c940635f203a1 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 20 Nov 2018 19:42:54 +0900 Subject: [PATCH 30/69] all test pass --- src/components/containers/PlotlySection.js | 7 +++++-- src/lib/connectToContainer.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/containers/PlotlySection.js b/src/components/containers/PlotlySection.js index de42a5564..e1a366a24 100644 --- a/src/components/containers/PlotlySection.js +++ b/src/components/containers/PlotlySection.js @@ -14,6 +14,8 @@ export class Section extends Component { return null; } + const {context = {}} = this.props; + console.log(Object.keys(context)); return (
{this.props.name ? ( @@ -21,7 +23,7 @@ export class Section extends Component {
{this.props.name}
) : null} - {recursiveMap(this.props.children, this.props.context)} + {recursiveMap(this.props.children, context)}
); } @@ -47,7 +49,8 @@ export default class PlotlySection extends Section { } determineVisibility(nextProps) { - const {context, ...props} = nextProps; + const {context = {}, ...props} = nextProps; + console.log(Object.keys(context)); const {isVisible} = unpackPlotProps(props, context); this.sectionVisible = Boolean(isVisible); diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index 60ab7f1c2..c3aa648fd 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -46,7 +46,7 @@ export default function connectToContainer(WrappedComponent, config = {}) { } setLocals(props) { - const {context, ...rest} = props; + const {context = {}, ...rest} = props; this.plotProps = unpackPlotProps(rest, context); this.attr = rest.attr; @@ -65,7 +65,7 @@ export default function connectToContainer(WrappedComponent, config = {}) { // props. However pass plotProps as a specific prop in case inner component // is also wrapped by a component that `unpackPlotProps`. That way inner // component can skip computation as it can see plotProps is already defined. - const {context, ...rest} = this.props; + const {context = {}, ...rest} = this.props; const {plotProps = this.plotProps, ...props} = Object.assign({}, this.plotProps, rest); const newContext = {...context, ...this.provideValue()}; From 7579cae0162758870651de21ecca9fb23e323e12 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 20 Nov 2018 22:17:55 +0900 Subject: [PATCH 31/69] remove contextTypes --- src/components/containers/PanelHeader.js | 8 -- src/components/containers/PlotlyFold.js | 11 --- src/components/containers/PlotlySection.js | 3 - .../containers/TraceMarkerSection.js | 5 -- .../containers/TransformAccordion.js | 33 +++++-- src/components/fields/AxesCreator.js | 2 + src/components/fields/Field.js | 6 -- src/components/fields/LocationSelector.js | 9 -- src/lib/connectAggregationToTransform.js | 46 +++++----- src/lib/connectAnnotationToLayout.js | 4 +- src/lib/connectAxesToLayout.js | 37 +------- src/lib/connectCartesianSubplotToLayout.js | 87 +++++++++++-------- src/lib/connectImageToLayout.js | 80 ++++++++++------- src/lib/connectNonCartesianSubplotToLayout.js | 79 ++++++++++------- src/lib/connectRangeSelectorToAxis.js | 86 ++++++++++-------- src/lib/connectShapeToLayout.js | 68 +++++++++------ src/lib/connectSliderToLayout.js | 71 +++++++++------ src/lib/connectToContainer.js | 5 -- src/lib/connectTraceToPlot.js | 10 --- src/lib/connectTransformToTrace.js | 82 ++++++++++------- src/lib/recursiveMap.js | 16 ++-- 21 files changed, 405 insertions(+), 343 deletions(-) diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js index 76353ac2e..54ea67205 100644 --- a/src/components/containers/PanelHeader.js +++ b/src/components/containers/PanelHeader.js @@ -104,14 +104,6 @@ PanelHeader.requireContext = { updateContainer: PropTypes.func, }; -// PanelHeader.contextTypes = { -// layout: PropTypes.object, -// onUpdate: PropTypes.func, -// localize: PropTypes.func, -// fullContainer: PropTypes.object, -// updateContainer: PropTypes.func, -// }; - PanelHeader.propTypes = { addAction: PropTypes.object, allowCollapse: PropTypes.bool, diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index baba2a337..b6b461a61 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -132,10 +132,6 @@ Fold.requireContext = { deleteContainer: PropTypes.func, }; -// Fold.contextTypes = { -// deleteContainer: PropTypes.func, -// }; - Fold.childContextTypes = { foldInfo: PropTypes.object, }; @@ -192,11 +188,4 @@ PlotlyFold.requireContext = Object.assign( containerConnectedContextTypes ); -// PlotlyFold.contextTypes = Object.assign( -// { -// deleteContainer: PropTypes.func, -// }, -// containerConnectedContextTypes -// ); - export default PlotlyFold; diff --git a/src/components/containers/PlotlySection.js b/src/components/containers/PlotlySection.js index e1a366a24..f94f92524 100644 --- a/src/components/containers/PlotlySection.js +++ b/src/components/containers/PlotlySection.js @@ -15,7 +15,6 @@ export class Section extends Component { } const {context = {}} = this.props; - console.log(Object.keys(context)); return (
{this.props.name ? ( @@ -50,7 +49,6 @@ export default class PlotlySection extends Section { determineVisibility(nextProps) { const {context = {}, ...props} = nextProps; - console.log(Object.keys(context)); const {isVisible} = unpackPlotProps(props, context); this.sectionVisible = Boolean(isVisible); @@ -79,4 +77,3 @@ export default class PlotlySection extends Section { PlotlySection.plotly_editor_traits = {no_visibility_forcing: true}; PlotlySection.requireContext = containerConnectedContextTypes; -// PlotlySection.contextTypes = containerConnectedContextTypes; diff --git a/src/components/containers/TraceMarkerSection.js b/src/components/containers/TraceMarkerSection.js index 71db8d36c..662d5ecb9 100644 --- a/src/components/containers/TraceMarkerSection.js +++ b/src/components/containers/TraceMarkerSection.js @@ -40,9 +40,4 @@ TraceMarkerSection.requireContext = { fullContainer: PropTypes.object, }; -// TraceMarkerSection.contextTypes = { -// fullContainer: PropTypes.object, -// localize: PropTypes.func, -// }; - export default TraceMarkerSection; diff --git a/src/components/containers/TransformAccordion.js b/src/components/containers/TransformAccordion.js index 32168731a..f566c7120 100644 --- a/src/components/containers/TransformAccordion.js +++ b/src/components/containers/TransformAccordion.js @@ -4,18 +4,27 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectTransformToTrace} from 'lib'; import {PanelMessage} from './PanelEmpty'; +import {EditorControlsContext} from '../../context'; +import {recursiveMap} from '../../lib/recursiveMap'; const TransformFold = connectTransformToTrace(PlotlyFold); class TransformAccordion extends Component { render() { const { - fullContainer: {transforms = []}, + // fullContainer: {transforms = []}, localize: _, - container, + // container, dataSourceOptions, } = this.context; - const {children} = this.props; + const { + children, + context: { + fullContainer: {transforms = []}, + container, + }, + } = this.props; + console.log(container, transforms); const transformTypes = [ {label: _('Filter'), type: 'filter'}, @@ -50,8 +59,9 @@ class TransformAccordion extends Component { name={`${transformTypes.filter(({type}) => type === tr.type)[0].label}${transformBy && transformBy[i]}`} canDelete={true} + context={this.props.context} > - {children} + {recursiveMap(children, this.props.context)} )); @@ -133,15 +143,22 @@ class TransformAccordion extends Component { } } -TransformAccordion.contextTypes = { - fullContainer: PropTypes.object, - localize: PropTypes.func, +TransformAccordion.requireContext = { container: PropTypes.object, - dataSourceOptions: PropTypes.array, + fullContainer: PropTypes.object, }; +TransformAccordion.contextType = EditorControlsContext; +// TransformAccordion.contextTypes = { +// fullContainer: PropTypes.object, +// localize: PropTypes.func, +// container: PropTypes.object, +// dataSourceOptions: PropTypes.array, +// }; + TransformAccordion.propTypes = { children: PropTypes.node, + context: PropTypes.object, }; export default TransformAccordion; diff --git a/src/components/fields/AxesCreator.js b/src/components/fields/AxesCreator.js index 68ca61b5d..ba8d5e6d4 100644 --- a/src/components/fields/AxesCreator.js +++ b/src/components/fields/AxesCreator.js @@ -104,6 +104,7 @@ UnconnectedAxisCreator.propTypes = { container: PropTypes.object, fullContainer: PropTypes.object, updateContainer: PropTypes.func, + context: PropTypes.object, }; UnconnectedAxisCreator.contextType = EditorControlsContext; @@ -162,6 +163,7 @@ class UnconnectedAxesCreator extends Component { UnconnectedAxesCreator.propTypes = { container: PropTypes.object, fullContainer: PropTypes.object, + context: PropTypes.object, }; UnconnectedAxesCreator.contextType = EditorControlsContext; diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index a8f90341c..e19bf3c53 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -112,12 +112,6 @@ Field.requireContext = { attr: PropTypes.string, }; -// Field.contextTypes = { -// // ConnectToContainer -// description: PropTypes.string, -// attr: PropTypes.string, -// }; - Field.defaultProps = { center: false, multiValued: false, diff --git a/src/components/fields/LocationSelector.js b/src/components/fields/LocationSelector.js index d51301751..84c9d7278 100644 --- a/src/components/fields/LocationSelector.js +++ b/src/components/fields/LocationSelector.js @@ -53,10 +53,6 @@ UnconnectedLocation.requireContext = { updateContainer: PropTypes.func, }; -// UnconnectedLocation.contextTypes = { -// updateContainer: PropTypes.func, -// }; - const Location = connectToContainer(UnconnectedLocation); class UnconnectedLocationSelector extends Component { @@ -150,9 +146,4 @@ UnconnectedLocationSelector.requireContext = { updateContainer: PropTypes.func, }; -// UnconnectedLocationSelector.contextTypes = { -// container: PropTypes.object, -// updateContainer: PropTypes.func, -// }; - export default connectToContainer(UnconnectedLocationSelector); diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index fd2a44e7d..2985ff362 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; +import {recursiveMap} from './recursiveMap'; export default function connectAggregationToTransform(WrappedComponent) { class AggregationConnectedComponent extends Component { @@ -24,15 +25,15 @@ export default function connectAggregationToTransform(WrappedComponent) { this.fullContainer = fullAggregations[aggregationIndex]; } - getChildContext() { - return { - getValObject: attr => - !this.props.getValObject ? null : this.props.getValObject(`aggregations[].${attr}`), - updateContainer: this.updateAggregation, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.props.getValObject ? null : this.props.getValObject(`aggregations[].${attr}`), + // updateContainer: this.updateAggregation, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { @@ -52,11 +53,19 @@ export default function connectAggregationToTransform(WrappedComponent) { } newUpdate[`${path}.target`] = this.fullContainer.target; newUpdate[`${path}.enabled`] = true; - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -75,23 +84,14 @@ export default function connectAggregationToTransform(WrappedComponent) { getValObject: PropTypes.func, }; - // AggregationConnectedComponent.contextTypes = { + // AggregationConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, // container: PropTypes.object, // fullContainer: PropTypes.object, - // data: PropTypes.array, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, // getValObject: PropTypes.func, // }; - AggregationConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; - const {plotly_editor_traits} = WrappedComponent; AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectAnnotationToLayout.js b/src/lib/connectAnnotationToLayout.js index 2e6322e08..98c50fc57 100644 --- a/src/lib/connectAnnotationToLayout.js +++ b/src/lib/connectAnnotationToLayout.js @@ -32,7 +32,9 @@ export default function connectAnnotationToLayout(WrappedComponent) { provideValue() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`annotations[].${attr}`), + !this.props.context.getValObject + ? null + : this.props.context.getValObject(`annotations[].${attr}`), updateContainer: this.updateAnnotation, deleteContainer: this.deleteAnnotation, container: this.container, diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index 633f4fa4d..f62a66da5 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -91,22 +91,6 @@ export default function connectAxesToLayout(WrappedComponent) { } } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject - // ? null - // : this.context.getValObject(`${this.state.axesTarget}.${attr}`), - // axesOptions: this.axesOptions, - // axesTarget: this.state.axesTarget, - // axesTargetHandler: this.axesTargetHandler, - // container: this.container, - // defaultContainer: this.defaultContainer, - // fullContainer: this.fullContainer, - // updateContainer: this.updateContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -159,7 +143,7 @@ export default function connectAxesToLayout(WrappedComponent) { const newProps = {...this.props, context: this.provideValue()}; if (this.props.children) { return ( - + {recursiveMap(this.props.children, this.provideValue())} ); @@ -178,25 +162,6 @@ export default function connectAxesToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - // AxesConnectedComponent.contextTypes = { - // container: PropTypes.object.isRequired, - // fullContainer: PropTypes.object.isRequired, - // updateContainer: PropTypes.func, - // localize: PropTypes.func, - // getValObject: PropTypes.func, - // }; - - // AxesConnectedComponent.childContextTypes = { - // axesOptions: PropTypes.array, - // axesTarget: PropTypes.string, - // axesTargetHandler: PropTypes.func, - // container: PropTypes.object, - // defaultContainer: PropTypes.object, - // fullContainer: PropTypes.object, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - const {plotly_editor_traits} = WrappedComponent; AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectCartesianSubplotToLayout.js b/src/lib/connectCartesianSubplotToLayout.js index 0fb56e022..290c2154e 100644 --- a/src/lib/connectCartesianSubplotToLayout.js +++ b/src/lib/connectCartesianSubplotToLayout.js @@ -1,22 +1,24 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; +import {recursiveMap} from './recursiveMap'; export default function connectCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.updateSubplot = this.updateSubplot.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {xaxis, yaxis, traceIndexes} = props; + setLocals(props) { + const {context, ...newProps} = props; + const {xaxis, yaxis, traceIndexes} = newProps; const {container, fullContainer, data} = context; this.container = { @@ -37,27 +39,27 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { } } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject - ? null - : this.context.getValObject( - attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis) - ), - updateContainer: this.updateSubplot, - deleteContainer: this.deleteSubplot, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject + // ? null + // : this.context.getValObject( + // attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis) + // ), + // updateContainer: this.updateSubplot, + // deleteContainer: this.deleteSubplot, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject + !this.props.context.getValObject ? null - : this.context.getValObject( + : this.props.context.getValObject( attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis) ), updateContainer: this.updateSubplot, @@ -73,11 +75,19 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { const newKey = key.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis); newUpdate[newKey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -88,7 +98,7 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { yaxis: PropTypes.string.isRequired, }; - SubplotConnectedComponent.contextTypes = { + SubplotConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, data: PropTypes.array, @@ -97,14 +107,23 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { updateContainer: PropTypes.func, getValObject: PropTypes.func, }; - - SubplotConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; + // SubplotConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // data: PropTypes.array, + // fullData: PropTypes.array, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + + // SubplotConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectImageToLayout.js b/src/lib/connectImageToLayout.js index a68b00ea8..6316c8163 100644 --- a/src/lib/connectImageToLayout.js +++ b/src/lib/connectImageToLayout.js @@ -2,23 +2,24 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {recursiveMap} from './recursiveMap'; export default function connectImageToLayout(WrappedComponent) { class ImageConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.deleteImage = this.deleteImage.bind(this); this.updateImage = this.updateImage.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {imageIndex} = props; + setLocals(props) { + const {context, imageIndex} = props; const {container, fullContainer} = context; const images = container.images || []; @@ -27,21 +28,23 @@ export default function connectImageToLayout(WrappedComponent) { this.fullContainer = fullImages[imageIndex]; } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`), - updateContainer: this.updateImage, - deleteContainer: this.deleteImage, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`), + // updateContainer: this.updateImage, + // deleteContainer: this.deleteImage, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`), + !this.props.context.getValObject + ? null + : this.props.context.getValObject(`images[].${attr}`), updateContainer: this.updateImage, deleteContainer: this.deleteImage, container: this.container, @@ -56,12 +59,12 @@ export default function connectImageToLayout(WrappedComponent) { const newkey = `images[${imageIndex}].${key}`; newUpdate[newkey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } deleteImage() { - if (this.context.onUpdate) { - this.context.onUpdate({ + if (this.props.context.onUpdate) { + this.props.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_IMAGE, payload: {imageIndex: this.props.imageIndex}, }); @@ -69,7 +72,15 @@ export default function connectImageToLayout(WrappedComponent) { } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -79,7 +90,7 @@ export default function connectImageToLayout(WrappedComponent) { imageIndex: PropTypes.number.isRequired, }; - ImageConnectedComponent.contextTypes = { + ImageConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, data: PropTypes.array, @@ -88,13 +99,22 @@ export default function connectImageToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - ImageConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; + // ImageConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // data: PropTypes.array, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + // + // ImageConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectNonCartesianSubplotToLayout.js b/src/lib/connectNonCartesianSubplotToLayout.js index f1c91630d..e376b7116 100644 --- a/src/lib/connectNonCartesianSubplotToLayout.js +++ b/src/lib/connectNonCartesianSubplotToLayout.js @@ -1,22 +1,23 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; +import {recursiveMap} from './recursiveMap'; export default function connectNonCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.updateSubplot = this.updateSubplot.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {subplot, traceIndexes} = props; + setLocals(props) { + const {subplot, traceIndexes, context} = props; const {container, fullContainer, data} = context; this.container = container[subplot] || {}; @@ -31,24 +32,24 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { } } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject - ? null - : this.context.getValObject(`${this.props.subplot}.${attr}`), - updateContainer: this.updateSubplot, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject + // ? null + // : this.context.getValObject(`${this.props.subplot}.${attr}`), + // updateContainer: this.updateSubplot, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject + !this.props.context.getValObject ? null - : this.context.getValObject(`${this.props.subplot}.${attr}`), + : this.props.context.getValObject(`${this.props.subplot}.${attr}`), updateContainer: this.updateSubplot, container: this.container, fullContainer: this.fullContainer, @@ -60,11 +61,19 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { for (const key in update) { newUpdate[`${this.props.subplot}.${key}`] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } render() { - return ; + const newProps = {...this.props, ...{context: this.provideValue()}}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -74,7 +83,7 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { subplot: PropTypes.string.isRequired, }; - SubplotConnectedComponent.contextTypes = { + SubplotConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, data: PropTypes.array, @@ -84,13 +93,23 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - SubplotConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; + // SubplotConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // data: PropTypes.array, + // fullData: PropTypes.array, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + // + // SubplotConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectRangeSelectorToAxis.js b/src/lib/connectRangeSelectorToAxis.js index 8e891c9f3..9878b77d5 100644 --- a/src/lib/connectRangeSelectorToAxis.js +++ b/src/lib/connectRangeSelectorToAxis.js @@ -2,23 +2,24 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {recursiveMap} from './recursiveMap'; export default function connectRangeSelectorToAxis(WrappedComponent) { class RangeSelectorConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.deleteRangeselector = this.deleteRangeselector.bind(this); this.updateRangeselector = this.updateRangeselector.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {rangeselectorIndex} = props; + setLocals(props) { + const {context, rangeselectorIndex} = props; const {container, fullContainer} = context; const rangeselectors = container.rangeselector ? container.rangeselector.buttons || [] : []; @@ -29,25 +30,25 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { this.fullContainer = fullRangeselectors[rangeselectorIndex]; } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject - ? null - : this.context.getValObject(`rangeselector.buttons[].${attr}`), - updateContainer: this.updateRangeselector, - deleteContainer: this.deleteRangeselector, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject + // ? null + // : this.context.getValObject(`rangeselector.buttons[].${attr}`), + // updateContainer: this.updateRangeselector, + // deleteContainer: this.deleteRangeselector, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject + !this.props.context.getValObject ? null - : this.context.getValObject(`rangeselector.buttons[].${attr}`), + : this.props.context.getValObject(`rangeselector.buttons[].${attr}`), updateContainer: this.updateRangeselector, deleteContainer: this.deleteRangeselector, container: this.container, @@ -62,15 +63,15 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { const newkey = `rangeselector.buttons[${rangeselectorIndex}].${key}`; newUpdate[newkey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } deleteRangeselector() { - if (this.context.onUpdate) { - this.context.onUpdate({ + if (this.props.context.onUpdate) { + this.props.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_RANGESELECTOR, payload: { - axisId: this.context.fullContainer._name, + axisId: this.props.context.fullContainer._name, rangeselectorIndex: this.props.rangeselectorIndex, }, }); @@ -78,7 +79,15 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -90,7 +99,7 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { rangeselectorIndex: PropTypes.number.isRequired, }; - RangeSelectorConnectedComponent.contextTypes = { + RangeSelectorConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, data: PropTypes.array, @@ -99,13 +108,22 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { getValObject: PropTypes.func, }; - RangeSelectorConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; + // RangeSelectorConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // data: PropTypes.array, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + + // RangeSelectorConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectShapeToLayout.js b/src/lib/connectShapeToLayout.js index 441ffe7a8..ca306f72a 100644 --- a/src/lib/connectShapeToLayout.js +++ b/src/lib/connectShapeToLayout.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {recursiveMap} from './recursiveMap'; export default function connectShapeToLayout(WrappedComponent) { class ShapeConnectedComponent extends Component { @@ -27,21 +28,23 @@ export default function connectShapeToLayout(WrappedComponent) { this.fullContainer = fullShapes[shapeIndex]; } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`), - updateContainer: this.updateShape, - deleteContainer: this.deleteShape, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`), + // updateContainer: this.updateShape, + // deleteContainer: this.deleteShape, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`), + !this.props.context.getValObject + ? null + : this.props.context.getValObject(`shapes[].${attr}`), updateContainer: this.updateShape, deleteContainer: this.deleteShape, container: this.container, @@ -56,12 +59,12 @@ export default function connectShapeToLayout(WrappedComponent) { const newkey = `shapes[${shapeIndex}].${key}`; newUpdate[newkey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } deleteShape() { - if (this.context.onUpdate) { - this.context.onUpdate({ + if (this.props.context.onUpdate) { + this.props.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_SHAPE, payload: {shapeIndex: this.props.shapeIndex}, }); @@ -69,7 +72,15 @@ export default function connectShapeToLayout(WrappedComponent) { } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -78,8 +89,7 @@ export default function connectShapeToLayout(WrappedComponent) { ShapeConnectedComponent.propTypes = { shapeIndex: PropTypes.number.isRequired, }; - - ShapeConnectedComponent.contextTypes = { + ShapeConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, data: PropTypes.array, @@ -87,14 +97,22 @@ export default function connectShapeToLayout(WrappedComponent) { updateContainer: PropTypes.func, getValObject: PropTypes.func, }; - - ShapeConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; + // ShapeConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // data: PropTypes.array, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + + // ShapeConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectSliderToLayout.js b/src/lib/connectSliderToLayout.js index 4c1d582b2..8ff4aefee 100644 --- a/src/lib/connectSliderToLayout.js +++ b/src/lib/connectSliderToLayout.js @@ -1,21 +1,22 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; +import {recursiveMap} from './recursiveMap'; export default function connectSliderToLayout(WrappedComponent) { class SliderConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.updateSlider = this.updateSlider.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {sliderIndex} = props; + setLocals(props) { + const {context, sliderIndex} = props; const {container, fullContainer} = context; const sliders = container.sliders || []; @@ -24,20 +25,22 @@ export default function connectSliderToLayout(WrappedComponent) { this.fullContainer = fullSliders[sliderIndex]; } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`), - updateContainer: this.updateSlider, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`), + // updateContainer: this.updateSlider, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`), + !this.props.context.getValObject + ? null + : this.props.context.getValObject(`sliders[].${attr}`), updateContainer: this.updateSlider, container: this.container, fullContainer: this.fullContainer, @@ -51,11 +54,19 @@ export default function connectSliderToLayout(WrappedComponent) { const newkey = `sliders[${sliderIndex}].${key}`; newUpdate[newkey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -65,7 +76,7 @@ export default function connectSliderToLayout(WrappedComponent) { sliderIndex: PropTypes.number.isRequired, }; - SliderConnectedComponent.contextTypes = { + SliderConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, onUpdate: PropTypes.func, @@ -73,12 +84,20 @@ export default function connectSliderToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - SliderConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; + // SliderConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + // + // SliderConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index c3aa648fd..a37f427e4 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -98,12 +98,7 @@ export default function connectToContainer(WrappedComponent, config = {}) { } ContainerConnectedComponent.displayName = `ContainerConnected${getDisplayName(WrappedComponent)}`; - // ContainerConnectedComponent.contextTypes = containerConnectedContextTypes; ContainerConnectedComponent.requireContext = containerConnectedContextTypes; - // ContainerConnectedComponent.childContextTypes = { - // description: PropTypes.string, - // attr: PropTypes.string, - // }; const {plotly_editor_traits} = WrappedComponent; ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index 4e29170f4..cfb90fcb3 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -213,16 +213,6 @@ export default function connectTraceToPlot(WrappedComponent) { TraceConnectedComponent.contextType = EditorControlsContext; - // TraceConnectedComponent.childContextTypes = { - // getValObject: PropTypes.func, - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // defaultContainer: PropTypes.object, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // traceIndexes: PropTypes.array, - // }; - const {plotly_editor_traits} = WrappedComponent; TraceConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectTransformToTrace.js b/src/lib/connectTransformToTrace.js index 10a7d9372..f5b67cd75 100644 --- a/src/lib/connectTransformToTrace.js +++ b/src/lib/connectTransformToTrace.js @@ -2,23 +2,24 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; +import {recursiveMap} from './recursiveMap'; export default function connectTransformToTrace(WrappedComponent) { class TransformConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.deleteTransform = this.deleteTransform.bind(this); this.updateTransform = this.updateTransform.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {transformIndex} = props; + setLocals(props) { + const {context, transformIndex} = props; const {container, fullContainer} = context; const transforms = container.transforms || []; @@ -27,21 +28,23 @@ export default function connectTransformToTrace(WrappedComponent) { this.fullContainer = fullTransforms[transformIndex]; } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`), - updateContainer: this.updateTransform, - deleteContainer: this.deleteTransform, - container: this.container, - fullContainer: this.fullContainer, - }; - } + // getChildContext() { + // return { + // getValObject: attr => + // !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`), + // updateContainer: this.updateTransform, + // deleteContainer: this.deleteTransform, + // container: this.container, + // fullContainer: this.fullContainer, + // }; + // } provideValue() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`), + !this.props.context.getValObject + ? null + : this.props.context.getValObject(`transforms[].${attr}`), updateContainer: this.updateTransform, deleteContainer: this.deleteTransform, container: this.container, @@ -56,15 +59,15 @@ export default function connectTransformToTrace(WrappedComponent) { const newkey = `transforms[${transformIndex}].${key}`; newUpdate[newkey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } deleteTransform() { - if (this.context.onUpdate) { - this.context.onUpdate({ + if (this.props.context.onUpdate) { + this.props.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_TRANSFORM, payload: { - traceIndex: this.context.fullContainer.index, + traceIndex: this.props.context.fullContainer.index, transformIndex: this.props.transformIndex, }, }); @@ -72,7 +75,15 @@ export default function connectTransformToTrace(WrappedComponent) { } render() { - return ; + const newProps = {...this.props, context: this.provideValue()}; + if (this.props.children) { + return ( + + {recursiveMap(this.props.children, this.provideValue())} + + ); + } + return ; } } @@ -82,7 +93,7 @@ export default function connectTransformToTrace(WrappedComponent) { transformIndex: PropTypes.number.isRequired, }; - TransformConnectedComponent.contextTypes = { + TransformConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, data: PropTypes.array, @@ -91,13 +102,22 @@ export default function connectTransformToTrace(WrappedComponent) { getValObject: PropTypes.func, }; - TransformConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - deleteContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; + // TransformConnectedComponent.contextTypes = { + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // data: PropTypes.array, + // onUpdate: PropTypes.func, + // updateContainer: PropTypes.func, + // getValObject: PropTypes.func, + // }; + // + // TransformConnectedComponent.childContextTypes = { + // updateContainer: PropTypes.func, + // deleteContainer: PropTypes.func, + // container: PropTypes.object, + // fullContainer: PropTypes.object, + // getValObject: PropTypes.func, + // }; const {plotly_editor_traits} = WrappedComponent; TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/recursiveMap.js b/src/lib/recursiveMap.js index dce401b94..72daaa6d8 100644 --- a/src/lib/recursiveMap.js +++ b/src/lib/recursiveMap.js @@ -7,14 +7,14 @@ export function recursiveMap(children, context) { return child; } - if ( - child.type && - child.type.displayName && - (child.type.displayName.indexOf('LayoutConnected') === 0 || - child.type.displayName.indexOf('TraceConnected') === 0) - ) { - return newChild; - } + // if ( + // child.type && + // child.type.displayName && + // (child.type.displayName.indexOf('LayoutConnected') === 0 || + // child.type.displayName.indexOf('TraceConnected') === 0) + // ) { + // return newChild; + // } if (child.type.requireContext) { const requireContext = {}; From 71aadd0ba43c9dc19242ecbea07fab28eb7fcf3c Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 21 Nov 2018 02:38:33 +0900 Subject: [PATCH 32/69] remove contextTypes and getChildContext --- .../containers/AnnotationAccordion.js | 2 +- src/components/containers/PlotlyFold.js | 24 ++++++++++++------- src/components/containers/PlotlyPanel.js | 1 - .../containers/TraceRequiredPanel.js | 2 -- src/components/containers/derived.js | 13 ++++++---- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/components/containers/AnnotationAccordion.js b/src/components/containers/AnnotationAccordion.js index 1d547fa04..514d78a41 100644 --- a/src/components/containers/AnnotationAccordion.js +++ b/src/components/containers/AnnotationAccordion.js @@ -21,7 +21,7 @@ class AnnotationAccordion extends Component { annotations.length && annotations.map((ann, i) => ( - {recursiveMap(children, this.context)} + {children} )); diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index b6b461a61..fea58016d 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -4,6 +4,7 @@ import React, {Component} from 'react'; import classnames from 'classnames'; import {CloseIcon, AngleDownIcon} from 'plotly-icons'; import {unpackPlotProps, containerConnectedContextTypes, striptags} from 'lib'; +import {recursiveMap} from '../../lib/recursiveMap'; export class Fold extends Component { constructor() { @@ -11,11 +12,11 @@ export class Fold extends Component { this.foldVisible = true; } - getChildContext() { - return { - foldInfo: this.props.foldInfo ? this.props.foldInfo : null, - }; - } + // getChildContext() { + // return { + // foldInfo: this.props.foldInfo ? this.props.foldInfo : null, + // }; + // } provideValue() { return { @@ -91,7 +92,12 @@ export class Fold extends Component { let foldContent = null; if (!folded) { if (this.foldVisible) { - foldContent =
{children}
; + foldContent = ( +
+ {/*{recursiveMap(children, {...this.props.context, ...this.provideValue()})}*/} + {children} +
+ ); } else { foldContent = (
@@ -132,9 +138,9 @@ Fold.requireContext = { deleteContainer: PropTypes.func, }; -Fold.childContextTypes = { - foldInfo: PropTypes.object, -}; +// Fold.childContextTypes = { +// foldInfo: PropTypes.object, +// }; class PlotlyFold extends Fold { constructor(props) { diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index 2080d343d..c56adfee1 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -129,7 +129,6 @@ Panel.propTypes = { deleteAction: PropTypes.func, noPadding: PropTypes.bool, showExpandCollapse: PropTypes.bool, - context: PropTypes.object, }; Panel.defaultProps = { diff --git a/src/components/containers/TraceRequiredPanel.js b/src/components/containers/TraceRequiredPanel.js index 5dffe5ec6..745062e0e 100644 --- a/src/components/containers/TraceRequiredPanel.js +++ b/src/components/containers/TraceRequiredPanel.js @@ -44,8 +44,6 @@ TraceRequiredPanel.defaultProps = { visible: true, }; -TraceRequiredPanel.context = LayoutPanel.context; - TraceRequiredPanel.contextType = EditorControlsContext; export default TraceRequiredPanel; diff --git a/src/components/containers/derived.js b/src/components/containers/derived.js index 2a2608f28..de631cb2c 100644 --- a/src/components/containers/derived.js +++ b/src/components/containers/derived.js @@ -8,9 +8,13 @@ import {connectLayoutToPlot, containerConnectedContextTypes} from 'lib'; const LayoutPanel = connectLayoutToPlot(PlotlyPanel); const LayoutSection = connectLayoutToPlot(PlotlySection); -const TraceTypeSection = (props, context) => { - const {fullContainer, fullData} = context; - const {mode, traceTypes} = props; +const TraceTypeSection = props => { + // const {fullContainer, fullData} = context; + const { + mode, + traceTypes, + context: {fullContainer, fullData}, + } = props; const ifConnectedToTrace = mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type); @@ -24,8 +28,7 @@ const TraceTypeSection = (props, context) => { return null; }; - -TraceTypeSection.contextTypes = containerConnectedContextTypes; +TraceTypeSection.requireContext = containerConnectedContextTypes; TraceTypeSection.propTypes = { children: PropTypes.node, name: PropTypes.string, From ebeb8b35aebee95976dc5dacfcfa6dd75bde8216 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 21 Nov 2018 15:26:14 +0900 Subject: [PATCH 33/69] fix TransformAccordion --- src/components/containers/PanelHeader.js | 1 + src/components/containers/PlotlyPanel.js | 1 + src/components/containers/TransformAccordion.js | 9 +++++---- src/default_panels/GraphTransformsPanel.js | 9 +++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js index 54ea67205..1bb994920 100644 --- a/src/components/containers/PanelHeader.js +++ b/src/components/containers/PanelHeader.js @@ -26,6 +26,7 @@ class PanelHeader extends Component { updateContainer: context.updateContainer, }; } + const handleArgs = { layout, onUpdate, diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index c56adfee1..2080d343d 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -129,6 +129,7 @@ Panel.propTypes = { deleteAction: PropTypes.func, noPadding: PropTypes.bool, showExpandCollapse: PropTypes.bool, + context: PropTypes.object, }; Panel.defaultProps = { diff --git a/src/components/containers/TransformAccordion.js b/src/components/containers/TransformAccordion.js index f566c7120..40f0c5f11 100644 --- a/src/components/containers/TransformAccordion.js +++ b/src/components/containers/TransformAccordion.js @@ -5,7 +5,7 @@ import React, {Component} from 'react'; import {connectTransformToTrace} from 'lib'; import {PanelMessage} from './PanelEmpty'; import {EditorControlsContext} from '../../context'; -import {recursiveMap} from '../../lib/recursiveMap'; +// import {recursiveMap} from '../../lib/recursiveMap'; const TransformFold = connectTransformToTrace(PlotlyFold); @@ -24,7 +24,6 @@ class TransformAccordion extends Component { container, }, } = this.props; - console.log(container, transforms); const transformTypes = [ {label: _('Filter'), type: 'filter'}, @@ -61,7 +60,7 @@ class TransformAccordion extends Component { canDelete={true} context={this.props.context} > - {recursiveMap(children, this.props.context)} + {children} )); @@ -78,6 +77,7 @@ class TransformAccordion extends Component { return { label, handler: context => { + console.log('addAction', context); const {fullContainer, updateContainer} = context; if (updateContainer) { const transformIndex = Array.isArray(fullContainer.transforms) @@ -106,7 +106,7 @@ class TransformAccordion extends Component { }; return ( - + {content ? ( content ) : ( @@ -146,6 +146,7 @@ class TransformAccordion extends Component { TransformAccordion.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, + updateContainer: PropTypes.func, }; TransformAccordion.contextType = EditorControlsContext; diff --git a/src/default_panels/GraphTransformsPanel.js b/src/default_panels/GraphTransformsPanel.js index 462b207bb..f387cba6a 100644 --- a/src/default_panels/GraphTransformsPanel.js +++ b/src/default_panels/GraphTransformsPanel.js @@ -20,7 +20,7 @@ export class Aggregations extends Component { render() { const { fullContainer: {aggregations = []}, - } = this.context; + } = this.props.context; const {localize: _} = this.context; if (aggregations.length === 0) { return null; @@ -60,10 +60,15 @@ export class Aggregations extends Component { } Aggregations.plotly_editor_traits = {no_visibility_forcing: true}; -Aggregations.contextTypes = { +Aggregations.contextType = EditorControlsContext; +Aggregations.requireContext = { fullContainer: PropTypes.object, localize: PropTypes.func, }; +// Aggregations.contextTypes = { +// fullContainer: PropTypes.object, +// localize: PropTypes.func, +// }; const GraphTransformsPanel = () => { return ( From b4461baf3a376637ec3bdb2320a8095f5844fad0 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 21 Nov 2018 17:12:16 +0900 Subject: [PATCH 34/69] remove comment out --- .../containers/AnnotationAccordion.js | 1 - src/components/containers/AxesFold.js | 4 +- src/components/containers/PlotlyFold.js | 14 +------ src/components/containers/SubplotAccordion.js | 1 - .../containers/TraceMarkerSection.js | 12 +++--- .../containers/TransformAccordion.js | 7 ---- src/components/fields/AxesSelector.js | 13 +++--- src/components/fields/ColorscalePicker.js | 2 +- src/components/fields/DropdownCustom.js | 6 +-- src/components/fields/DualNumeric.js | 5 ++- src/components/fields/Field.js | 1 + src/components/fields/FilterOperation.js | 17 ++++---- src/components/fields/FontSelector.js | 6 +-- src/components/fields/LineSelectors.js | 2 +- src/components/fields/MarkerColor.js | 15 ++++--- src/components/fields/MarkerSize.js | 9 ++-- src/components/fields/MultiColorPicker.js | 12 +++--- src/components/fields/PieColorscalePicker.js | 4 +- src/components/fields/RectanglePositioner.js | 12 +++--- src/components/fields/SymbolSelector.js | 20 +++++---- src/components/fields/VisibilitySelect.js | 7 ++-- src/components/fields/derived.js | 4 +- src/default_panels/GraphTransformsPanel.js | 8 ++-- src/default_panels/StyleAxesPanel.js | 7 +--- src/lib/connectCartesianSubplotToLayout.js | 34 +-------------- src/lib/connectImageToLayout.js | 28 ------------- src/lib/connectNonCartesianSubplotToLayout.js | 32 +-------------- src/lib/connectRangeSelectorToAxis.js | 30 -------------- src/lib/connectShapeToLayout.js | 41 ++++--------------- src/lib/connectSliderToLayout.js | 25 ----------- src/lib/connectToContainer.js | 18 ++++---- src/lib/connectTransformToTrace.js | 28 ------------- src/lib/connectUpdateMenuToLayout.js | 35 +++++----------- src/lib/localize.js | 6 +-- 34 files changed, 127 insertions(+), 339 deletions(-) diff --git a/src/components/containers/AnnotationAccordion.js b/src/components/containers/AnnotationAccordion.js index 514d78a41..bba399ce1 100644 --- a/src/components/containers/AnnotationAccordion.js +++ b/src/components/containers/AnnotationAccordion.js @@ -5,7 +5,6 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {connectAnnotationToLayout} from 'lib'; import {EditorControlsContext} from '../../context'; -import {recursiveMap} from '../../lib/recursiveMap'; const AnnotationFold = connectAnnotationToLayout(PlotlyFold); diff --git a/src/components/containers/AxesFold.js b/src/components/containers/AxesFold.js index fc23005fb..d13b1c69c 100644 --- a/src/components/containers/AxesFold.js +++ b/src/components/containers/AxesFold.js @@ -10,7 +10,9 @@ class AxesFold extends Component { const {children, options} = this.props; return options.length && children ? ( - {options.length === 1 ? null : } + {options.length === 1 ? null : ( + + )} {recursiveMap(children, this.props.context)} ) : null; diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index fea58016d..7da196843 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -4,7 +4,6 @@ import React, {Component} from 'react'; import classnames from 'classnames'; import {CloseIcon, AngleDownIcon} from 'plotly-icons'; import {unpackPlotProps, containerConnectedContextTypes, striptags} from 'lib'; -import {recursiveMap} from '../../lib/recursiveMap'; export class Fold extends Component { constructor() { @@ -12,12 +11,6 @@ export class Fold extends Component { this.foldVisible = true; } - // getChildContext() { - // return { - // foldInfo: this.props.foldInfo ? this.props.foldInfo : null, - // }; - // } - provideValue() { return { foldInfo: this.props.foldInfo ? this.props.foldInfo : null, @@ -92,12 +85,7 @@ export class Fold extends Component { let foldContent = null; if (!folded) { if (this.foldVisible) { - foldContent = ( -
- {/*{recursiveMap(children, {...this.props.context, ...this.provideValue()})}*/} - {children} -
- ); + foldContent =
{children}
; } else { foldContent = (
diff --git a/src/components/containers/SubplotAccordion.js b/src/components/containers/SubplotAccordion.js index f2e5326ab..2d361fae3 100644 --- a/src/components/containers/SubplotAccordion.js +++ b/src/components/containers/SubplotAccordion.js @@ -139,7 +139,6 @@ class SubplotAccordion extends Component { ); } }); - return {subplotFolds}; } } diff --git a/src/components/containers/TraceMarkerSection.js b/src/components/containers/TraceMarkerSection.js index 662d5ecb9..28954b1ba 100644 --- a/src/components/containers/TraceMarkerSection.js +++ b/src/components/containers/TraceMarkerSection.js @@ -6,16 +6,16 @@ import {EditorControlsContext} from '../../context'; class TraceMarkerSection extends Component { constructor(props, context) { super(props, context); - this.setLocals(props); + this.setLocals(props, context); } - componentWillReceiveProps(nextProps) { - this.setLocals(nextProps); + componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); } - setLocals(context) { - const _ = this.context.localize; - const traceType = context.fullContainer.type; + setLocals(props, context) { + const _ = context.localize; + const traceType = props.context.fullContainer.type; if (['bar', 'histogram'].includes(traceType)) { this.name = _('Bars'); } else if (traceType === 'pie') { diff --git a/src/components/containers/TransformAccordion.js b/src/components/containers/TransformAccordion.js index 40f0c5f11..6e662311b 100644 --- a/src/components/containers/TransformAccordion.js +++ b/src/components/containers/TransformAccordion.js @@ -77,7 +77,6 @@ class TransformAccordion extends Component { return { label, handler: context => { - console.log('addAction', context); const {fullContainer, updateContainer} = context; if (updateContainer) { const transformIndex = Array.isArray(fullContainer.transforms) @@ -150,12 +149,6 @@ TransformAccordion.requireContext = { }; TransformAccordion.contextType = EditorControlsContext; -// TransformAccordion.contextTypes = { -// fullContainer: PropTypes.object, -// localize: PropTypes.func, -// container: PropTypes.object, -// dataSourceOptions: PropTypes.array, -// }; TransformAccordion.propTypes = { children: PropTypes.node, diff --git a/src/components/fields/AxesSelector.js b/src/components/fields/AxesSelector.js index 4f06a7895..84fcf960c 100644 --- a/src/components/fields/AxesSelector.js +++ b/src/components/fields/AxesSelector.js @@ -3,19 +3,21 @@ import PropTypes from 'prop-types'; import Dropdown from '../widgets/Dropdown'; import RadioBlocks from '../widgets/RadioBlocks'; import React, {Component} from 'react'; +import {EditorControlsContext} from '../../context'; class AxesSelector extends Component { constructor(props, context) { super(props, context); const {localize: _} = context; - if (!context.axesTargetHandler) { + if (!props.context.axesTargetHandler) { throw new Error(_('AxesSelector must be nested within a connectAxesToPlot component')); } } render() { - const {axesTargetHandler, axesTarget, fullLayout, localize: _} = this.context; + const {localize: _} = this.context; + const {axesTargetHandler, axesTarget, fullLayout} = this.props.context; const {axesOptions} = this.props; const maxCharsThatFitInRadio = 27; const maxOptions = axesOptions.length > 4; // eslint-disable-line @@ -60,16 +62,17 @@ class AxesSelector extends Component { ); } } - -AxesSelector.contextTypes = { +AxesSelector.requireContext = { axesTargetHandler: PropTypes.func, axesTarget: PropTypes.string, fullLayout: PropTypes.object, - localize: PropTypes.func, }; +AxesSelector.contextType = EditorControlsContext; + AxesSelector.propTypes = { axesOptions: PropTypes.array, + context: PropTypes.object, }; export default AxesSelector; diff --git a/src/components/fields/ColorscalePicker.js b/src/components/fields/ColorscalePicker.js index cd0ce32e0..34575fd91 100644 --- a/src/components/fields/ColorscalePicker.js +++ b/src/components/fields/ColorscalePicker.js @@ -48,7 +48,7 @@ UnconnectedColorscalePicker.propTypes = { ...Field.propTypes, }; -UnconnectedColorscalePicker.contextTypes = { +UnconnectedColorscalePicker.requireContext = { container: PropTypes.object, graphDiv: PropTypes.object, }; diff --git a/src/components/fields/DropdownCustom.js b/src/components/fields/DropdownCustom.js index 49d44c994..35b695dca 100644 --- a/src/components/fields/DropdownCustom.js +++ b/src/components/fields/DropdownCustom.js @@ -7,8 +7,8 @@ import DropdownWidget from '../widgets/Dropdown'; import Text from './Text'; export class UnconnectedDropdownCustom extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.setValue = this.setValue.bind(this); this.setLocals = this.setLocals.bind(this); @@ -91,7 +91,7 @@ UnconnectedDropdownCustom.propTypes = { ...Field.propTypes, }; -UnconnectedDropdownCustom.contextTypes = { +UnconnectedDropdownCustom.requireContext = { updateContainer: PropTypes.func, }; diff --git a/src/components/fields/DualNumeric.js b/src/components/fields/DualNumeric.js index ce406ddc7..28e4e9ed1 100644 --- a/src/components/fields/DualNumeric.js +++ b/src/components/fields/DualNumeric.js @@ -25,7 +25,7 @@ export class UnconnectedDualNumericFraction extends Component { render() { const {percentage, multiValued, attr2, step, min, max} = this.props; let fullValue = percentage ? Math.round(100 * this.props.fullValue) : this.props.fullValue; - let fullValue2 = nestedProperty(this.context.fullContainer, attr2).get(); + let fullValue2 = nestedProperty(this.props.context.fullContainer, attr2).get(); if (percentage) { fullValue2 = Math.round(100 * fullValue2); } @@ -83,10 +83,11 @@ UnconnectedDualNumericFraction.propTypes = { updatePlot: PropTypes.func, attr2: PropTypes.any, percentage: PropTypes.bool, + context: PropTypes.object, ...Field.propTypes, }; -UnconnectedDualNumericFraction.contextTypes = { +UnconnectedDualNumericFraction.requireContext = { fullContainer: PropTypes.object, }; diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index e19bf3c53..46af53946 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -105,6 +105,7 @@ Field.propTypes = { children: PropTypes.node, extraComponent: PropTypes.any, fieldContainerClassName: PropTypes.string, + context: PropTypes.object, }; Field.requireContext = { diff --git a/src/components/fields/FilterOperation.js b/src/components/fields/FilterOperation.js index a154de697..44b9df0f8 100644 --- a/src/components/fields/FilterOperation.js +++ b/src/components/fields/FilterOperation.js @@ -4,6 +4,7 @@ import React, {Component} from 'react'; import DropdownWidget from '../widgets/Dropdown'; import TextInput from '../widgets/TextInput'; import {connectToContainer} from 'lib'; +import {EditorControlsContext} from '../../context'; const operations = _ => ({ inequality: [ @@ -124,9 +125,8 @@ UnconnectedFilterOperation.propTypes = { updatePlot: PropTypes.func, ...Field.propTypes, }; -UnconnectedFilterOperation.contextTypes = { - localize: PropTypes.func, -}; + +UnconnectedFilterOperation.contextType = EditorControlsContext; class UnconnectedFilterValue extends Component { constructor(props, context) { @@ -139,7 +139,8 @@ class UnconnectedFilterValue extends Component { } setValue(v) { - const {localize: _, container} = this.context; + const {localize: _} = this.context; + const {container} = this.props.context; const op = findOperation(container.operation, _); this.setState({value: v}); let val; @@ -157,7 +158,8 @@ class UnconnectedFilterValue extends Component { } render() { - const {localize: _, container} = this.context; + const {localize: _} = this.context; + const {container} = this.props.context; const operation = container && container.operation ? container.operation : '='; @@ -201,10 +203,11 @@ UnconnectedFilterValue.propTypes = { defaultValue: PropTypes.string, fullValue: PropTypes.any, updatePlot: PropTypes.func, + context: PropTypes.object, ...Field.propTypes, }; -UnconnectedFilterValue.contextTypes = { - localize: PropTypes.func, +UnconnectedFilterValue.contextType = EditorControlsContext; +UnconnectedFilterValue.requireContext = { container: PropTypes.object, }; diff --git a/src/components/fields/FontSelector.js b/src/components/fields/FontSelector.js index 94237dc53..737ef6af9 100644 --- a/src/components/fields/FontSelector.js +++ b/src/components/fields/FontSelector.js @@ -6,11 +6,11 @@ import PropTypes from 'prop-types'; const styledRenderer = ({value, label}) => {label}; /* eslint-enable react/prop-types */ -const FontSelector = (props, context) => { +const FontSelector = props => { return ( @@ -25,7 +25,7 @@ FontSelector.defaultProps = { clearable: false, }; -FontSelector.contextTypes = { +FontSelector.requireContext = { fontOptions: PropTypes.array, }; diff --git a/src/components/fields/LineSelectors.js b/src/components/fields/LineSelectors.js index 62e6b53aa..cb557cce5 100644 --- a/src/components/fields/LineSelectors.js +++ b/src/components/fields/LineSelectors.js @@ -113,6 +113,6 @@ LineSelector.defaultProps = { clearable: false, }; -LineSelector.contextTypes = { +LineSelector.requireContext = { fullContainer: PropTypes.object, }; diff --git a/src/components/fields/MarkerColor.js b/src/components/fields/MarkerColor.js index e054ce2ad..807158cd6 100644 --- a/src/components/fields/MarkerColor.js +++ b/src/components/fields/MarkerColor.js @@ -11,6 +11,7 @@ import Info from './Info'; import DataSelector from './DataSelector'; import VisibilitySelect from './VisibilitySelect'; import {MULTI_VALUED, COLORS} from 'lib/constants'; +import {EditorControlsContext} from '../../context'; class UnconnectedMarkerColor extends Component { constructor(props, context) { @@ -48,14 +49,14 @@ class UnconnectedMarkerColor extends Component { this.setState({type: type}); this.props.updatePlot(this.state.value[type]); if (type === 'constant') { - this.context.updateContainer({ + this.props.context.updateContainer({ ['marker.colorsrc']: null, ['marker.colorscale']: null, ['marker.showscale']: null, }); this.setState({colorscale: null}); } else { - this.context.updateContainer({ + this.props.context.updateContainer({ ['marker.color']: null, ['marker.colorsrc']: null, ['marker.colorscale']: [], @@ -75,7 +76,7 @@ class UnconnectedMarkerColor extends Component { setColorScale(inputValue) { this.setState({colorscale: inputValue}); - this.context.updateContainer({['marker.colorscale']: inputValue}); + this.props.context.updateContainer({['marker.colorscale']: inputValue}); } isMultiValued() { @@ -142,7 +143,8 @@ class UnconnectedMarkerColor extends Component { render() { const {attr} = this.props; - const {localize: _, container} = this.context; + const {localize: _} = this.context; + const {container} = this.props.context; // TO DO: https://github.com/plotly/react-chart-editor/issues/654 const noSplitsPresent = @@ -219,8 +221,9 @@ UnconnectedMarkerColor.propTypes = { ...Field.propTypes, }; -UnconnectedMarkerColor.contextTypes = { - localize: PropTypes.func, +UnconnectedMarkerColor.contextType = EditorControlsContext; + +UnconnectedMarkerColor.requireContext = { updateContainer: PropTypes.func, traceIndexes: PropTypes.array, container: PropTypes.object, diff --git a/src/components/fields/MarkerSize.js b/src/components/fields/MarkerSize.js index def878e00..9a4794583 100644 --- a/src/components/fields/MarkerSize.js +++ b/src/components/fields/MarkerSize.js @@ -6,6 +6,7 @@ import RadioBlocks from '../widgets/RadioBlocks'; import Numeric from './Numeric'; import DataSelector from './DataSelector'; import {MULTI_VALUED} from 'lib/constants'; +import {EditorControlsContext} from '../../context'; class UnconnectedMarkerSize extends Component { constructor(props, context) { @@ -39,9 +40,9 @@ class UnconnectedMarkerSize extends Component { this.setState({type: type}); this.props.updatePlot(this.state.value[type]); if (type === 'constant') { - this.context.updateContainer({['marker.sizesrc']: null}); + this.props.context.updateContainer({['marker.sizesrc']: null}); } else { - this.context.updateContainer({ + this.props.context.updateContainer({ ['marker.size']: null, ['marker.sizesrc']: null, }); @@ -91,9 +92,9 @@ UnconnectedMarkerSize.propTypes = { updatePlot: PropTypes.func, ...Field.propTypes, }; +UnconnectedMarkerSize.contextType = EditorControlsContext; -UnconnectedMarkerSize.contextTypes = { - localize: PropTypes.func, +UnconnectedMarkerSize.requireContext = { updateContainer: PropTypes.func, }; diff --git a/src/components/fields/MultiColorPicker.js b/src/components/fields/MultiColorPicker.js index d5d6657fd..b17a54367 100644 --- a/src/components/fields/MultiColorPicker.js +++ b/src/components/fields/MultiColorPicker.js @@ -7,6 +7,7 @@ import RadioBlocks from '../widgets/RadioBlocks'; import React, {Component} from 'react'; import nestedProperty from 'plotly.js/src/lib/nested_property'; import {adjustColorscale, connectToContainer} from 'lib'; +import {EditorControlsContext} from '../../context'; const CustomColorscalePicker = connectToContainer(UnconnectedColorscalePicker, { modifyPlotProps: (props, context, plotProps) => { @@ -31,7 +32,7 @@ class UnconnectedMultiColorPicker extends Component { super(props, context); this.state = { selectedConstantColorOption: - context.traceIndexes.length > 1 && + props.context.traceIndexes.length > 1 && props.fullValue && props.fullValue.every(v => v[1] === props.fullValue[0][1]) ? 'single' @@ -67,7 +68,7 @@ class UnconnectedMultiColorPicker extends Component { [this.props.attr]: color, })); - this.context.updateContainer(updates); + this.props.context.updateContainer(updates); } render() { @@ -88,7 +89,7 @@ class UnconnectedMultiColorPicker extends Component { ? this.props.singleColorMessage : _('All will be colored in the same color.'); - if (this.context.traceIndexes.length > 1) { + if (this.props.context.traceIndexes.length > 1) { return ( { const min = (attrMeta && attrMeta.min) || 0; const max = (attrMeta && attrMeta.max) || 1; if (isNumeric(fullValue)) { - plotProps.fullValue = Math.round(100 * (fullValue - min) / (max - min)); + plotProps.fullValue = Math.round((100 * (fullValue - min)) / (max - min)); } plotProps.updatePlot = v => { if (isNumeric(v)) { - updatePlot(v / 100 * (max - min) + min); + updatePlot((v / 100) * (max - min) + min); } else { updatePlot(v); } diff --git a/src/default_panels/GraphTransformsPanel.js b/src/default_panels/GraphTransformsPanel.js index f387cba6a..50bf373a0 100644 --- a/src/default_panels/GraphTransformsPanel.js +++ b/src/default_panels/GraphTransformsPanel.js @@ -63,12 +63,10 @@ Aggregations.plotly_editor_traits = {no_visibility_forcing: true}; Aggregations.contextType = EditorControlsContext; Aggregations.requireContext = { fullContainer: PropTypes.object, - localize: PropTypes.func, }; -// Aggregations.contextTypes = { -// fullContainer: PropTypes.object, -// localize: PropTypes.func, -// }; +Aggregations.propTypes = { + context: PropTypes.object, +}; const GraphTransformsPanel = () => { return ( diff --git a/src/default_panels/StyleAxesPanel.js b/src/default_panels/StyleAxesPanel.js index 1f6fc0a53..40c1a6b73 100644 --- a/src/default_panels/StyleAxesPanel.js +++ b/src/default_panels/StyleAxesPanel.js @@ -1,5 +1,4 @@ import React, {Component} from 'react'; -import PropTypes from 'prop-types'; import { AxesRange, DTicks, @@ -21,6 +20,7 @@ import { DropdownCustom, TickFormat, } from '../components'; +import {EditorControlsContext} from '../context'; class StyleAxesPanel extends Component { render() { @@ -407,9 +407,6 @@ class StyleAxesPanel extends Component { } } -StyleAxesPanel.contextTypes = { - fullLayout: PropTypes.object, - localize: PropTypes.func, -}; +StyleAxesPanel.contextType = EditorControlsContext; export default StyleAxesPanel; diff --git a/src/lib/connectCartesianSubplotToLayout.js b/src/lib/connectCartesianSubplotToLayout.js index 290c2154e..421c923b0 100644 --- a/src/lib/connectCartesianSubplotToLayout.js +++ b/src/lib/connectCartesianSubplotToLayout.js @@ -39,21 +39,6 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { } } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject - // ? null - // : this.context.getValObject( - // attr.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis) - // ), - // updateContainer: this.updateSubplot, - // deleteContainer: this.deleteSubplot, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -66,6 +51,7 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { deleteContainer: this.deleteSubplot, container: this.container, fullContainer: this.fullContainer, + fullLayout: this.props.context.fullLayout, }; } @@ -103,27 +89,11 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { fullContainer: PropTypes.object, data: PropTypes.array, fullData: PropTypes.array, + fullLayout: PropTypes.object, onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; - // SubplotConnectedComponent.contextTypes = { - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // data: PropTypes.array, - // fullData: PropTypes.array, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - - // SubplotConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; const {plotly_editor_traits} = WrappedComponent; SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectImageToLayout.js b/src/lib/connectImageToLayout.js index 6316c8163..0a586471e 100644 --- a/src/lib/connectImageToLayout.js +++ b/src/lib/connectImageToLayout.js @@ -28,17 +28,6 @@ export default function connectImageToLayout(WrappedComponent) { this.fullContainer = fullImages[imageIndex]; } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject ? null : this.context.getValObject(`images[].${attr}`), - // updateContainer: this.updateImage, - // deleteContainer: this.deleteImage, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -99,23 +88,6 @@ export default function connectImageToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - // ImageConnectedComponent.contextTypes = { - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // data: PropTypes.array, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - // - // ImageConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; - const {plotly_editor_traits} = WrappedComponent; ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectNonCartesianSubplotToLayout.js b/src/lib/connectNonCartesianSubplotToLayout.js index e376b7116..6e377dea6 100644 --- a/src/lib/connectNonCartesianSubplotToLayout.js +++ b/src/lib/connectNonCartesianSubplotToLayout.js @@ -32,18 +32,6 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { } } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject - // ? null - // : this.context.getValObject(`${this.props.subplot}.${attr}`), - // updateContainer: this.updateSubplot, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -53,6 +41,7 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { updateContainer: this.updateSubplot, container: this.container, fullContainer: this.fullContainer, + fullLayout: this.props.context.fullLayout, }; } @@ -86,6 +75,7 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { SubplotConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, + fullLayout: PropTypes.object, data: PropTypes.array, fullData: PropTypes.array, onUpdate: PropTypes.func, @@ -93,24 +83,6 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - // SubplotConnectedComponent.contextTypes = { - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // data: PropTypes.array, - // fullData: PropTypes.array, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - // - // SubplotConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; - const {plotly_editor_traits} = WrappedComponent; SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectRangeSelectorToAxis.js b/src/lib/connectRangeSelectorToAxis.js index 9878b77d5..eab6607ba 100644 --- a/src/lib/connectRangeSelectorToAxis.js +++ b/src/lib/connectRangeSelectorToAxis.js @@ -30,19 +30,6 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { this.fullContainer = fullRangeselectors[rangeselectorIndex]; } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject - // ? null - // : this.context.getValObject(`rangeselector.buttons[].${attr}`), - // updateContainer: this.updateRangeselector, - // deleteContainer: this.deleteRangeselector, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -108,23 +95,6 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { getValObject: PropTypes.func, }; - // RangeSelectorConnectedComponent.contextTypes = { - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // data: PropTypes.array, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - - // RangeSelectorConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; - const {plotly_editor_traits} = WrappedComponent; RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectShapeToLayout.js b/src/lib/connectShapeToLayout.js index ca306f72a..5bfc68085 100644 --- a/src/lib/connectShapeToLayout.js +++ b/src/lib/connectShapeToLayout.js @@ -6,20 +6,20 @@ import {recursiveMap} from './recursiveMap'; export default function connectShapeToLayout(WrappedComponent) { class ShapeConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.deleteShape = this.deleteShape.bind(this); this.updateShape = this.updateShape.bind(this); - this.setLocals(props, context); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(props, context) { - const {shapeIndex} = props; + setLocals(props) { + const {shapeIndex, context} = props; const {container, fullContainer} = context; const shapes = container.shapes || []; @@ -28,17 +28,6 @@ export default function connectShapeToLayout(WrappedComponent) { this.fullContainer = fullShapes[shapeIndex]; } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject ? null : this.context.getValObject(`shapes[].${attr}`), - // updateContainer: this.updateShape, - // deleteContainer: this.deleteShape, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -97,22 +86,6 @@ export default function connectShapeToLayout(WrappedComponent) { updateContainer: PropTypes.func, getValObject: PropTypes.func, }; - // ShapeConnectedComponent.contextTypes = { - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // data: PropTypes.array, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - - // ShapeConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; const {plotly_editor_traits} = WrappedComponent; ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectSliderToLayout.js b/src/lib/connectSliderToLayout.js index 8ff4aefee..57f5f71e5 100644 --- a/src/lib/connectSliderToLayout.js +++ b/src/lib/connectSliderToLayout.js @@ -25,16 +25,6 @@ export default function connectSliderToLayout(WrappedComponent) { this.fullContainer = fullSliders[sliderIndex]; } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject ? null : this.context.getValObject(`sliders[].${attr}`), - // updateContainer: this.updateSlider, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -84,21 +74,6 @@ export default function connectSliderToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - // SliderConnectedComponent.contextTypes = { - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - // - // SliderConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; - const {plotly_editor_traits} = WrappedComponent; SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index a37f427e4..944f4f1fc 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import unpackPlotProps from './unpackPlotProps'; import {getDisplayName} from '../lib'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export const containerConnectedContextTypes = { // EditorControlsContext @@ -36,21 +37,23 @@ export default function connectToContainer(WrappedComponent, config = {}) { } } - constructor(props) { + constructor(props, context) { super(props); - this.setLocals(props); + this.setLocals(props, context); } - componentWillReceiveProps(nextProps) { - this.setLocals(nextProps); + componentWillReceiveProps(nextProps, nextContext) { + this.setLocals(nextProps, nextContext); } - setLocals(props) { + setLocals(props, classContext) { const {context = {}, ...rest} = props; + const {localize} = classContext; - this.plotProps = unpackPlotProps(rest, context); + const newContext = {...context, localize}; + this.plotProps = unpackPlotProps(rest, newContext); this.attr = rest.attr; - ContainerConnectedComponent.modifyPlotProps(rest, context, this.plotProps); + ContainerConnectedComponent.modifyPlotProps(rest, newContext, this.plotProps); } provideValue() { @@ -99,6 +102,7 @@ export default function connectToContainer(WrappedComponent, config = {}) { ContainerConnectedComponent.displayName = `ContainerConnected${getDisplayName(WrappedComponent)}`; ContainerConnectedComponent.requireContext = containerConnectedContextTypes; + ContainerConnectedComponent.contextType = EditorControlsContext; const {plotly_editor_traits} = WrappedComponent; ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectTransformToTrace.js b/src/lib/connectTransformToTrace.js index f5b67cd75..7fe87489c 100644 --- a/src/lib/connectTransformToTrace.js +++ b/src/lib/connectTransformToTrace.js @@ -28,17 +28,6 @@ export default function connectTransformToTrace(WrappedComponent) { this.fullContainer = fullTransforms[transformIndex]; } - // getChildContext() { - // return { - // getValObject: attr => - // !this.context.getValObject ? null : this.context.getValObject(`transforms[].${attr}`), - // updateContainer: this.updateTransform, - // deleteContainer: this.deleteTransform, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -102,23 +91,6 @@ export default function connectTransformToTrace(WrappedComponent) { getValObject: PropTypes.func, }; - // TransformConnectedComponent.contextTypes = { - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // data: PropTypes.array, - // onUpdate: PropTypes.func, - // updateContainer: PropTypes.func, - // getValObject: PropTypes.func, - // }; - // - // TransformConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; - const {plotly_editor_traits} = WrappedComponent; TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectUpdateMenuToLayout.js b/src/lib/connectUpdateMenuToLayout.js index 05adffe73..f9a587cac 100644 --- a/src/lib/connectUpdateMenuToLayout.js +++ b/src/lib/connectUpdateMenuToLayout.js @@ -4,18 +4,18 @@ import {getDisplayName} from '../lib'; export default function connectUpdateMenuToLayout(WrappedComponent) { class UpdateMenuConnectedComponent extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.updateUpdateMenu = this.updateUpdateMenu.bind(this); - this.setLocals(props, context); + this.setLocals(props); } componentWillReceiveProps(nextProps, nextContext) { this.setLocals(nextProps, nextContext); } - setLocals(props, context) { - const {updateMenuIndex} = props; + setLocals(props) { + const {updateMenuIndex, context} = props; const {container, fullContainer} = context; const updatemenus = container.updatemenus || []; @@ -24,20 +24,12 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { this.fullContainer = fullUpdateMenus[updateMenuIndex]; } - getChildContext() { - return { - getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`updatemenus[].${attr}`), - updateContainer: this.updateUpdateMenu, - container: this.container, - fullContainer: this.fullContainer, - }; - } - provideValue() { return { getValObject: attr => - !this.context.getValObject ? null : this.context.getValObject(`updatemenus[].${attr}`), + !this.props.context.getValObject + ? null + : this.props.context.getValObject(`updatemenus[].${attr}`), updateContainer: this.updateUpdateMenu, container: this.container, fullContainer: this.fullContainer, @@ -51,7 +43,7 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { const newkey = `updatemenus[${updateMenuIndex}].${key}`; newUpdate[newkey] = update[key]; } - this.context.updateContainer(newUpdate); + this.props.context.updateContainer(newUpdate); } render() { @@ -67,7 +59,7 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { updateMenuIndex: PropTypes.number.isRequired, }; - UpdateMenuConnectedComponent.contextTypes = { + UpdateMenuConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, onUpdate: PropTypes.func, @@ -75,13 +67,6 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { getValObject: PropTypes.func, }; - UpdateMenuConnectedComponent.childContextTypes = { - updateContainer: PropTypes.func, - container: PropTypes.object, - fullContainer: PropTypes.object, - getValObject: PropTypes.func, - }; - const {plotly_editor_traits} = WrappedComponent; UpdateMenuConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/localize.js b/src/lib/localize.js index 08635b72a..0887420f5 100644 --- a/src/lib/localize.js +++ b/src/lib/localize.js @@ -20,9 +20,9 @@ export default function localize(Comp) { } } LocalizedComponent.displayName = `Localized${getDisplayName(Comp)}`; - LocalizedComponent.contextTypes = LocalizedComponent.contextTypes || {}; - LocalizedComponent.contextTypes.dictionaries = PropTypes.object; - LocalizedComponent.contextTypes.locale = PropTypes.string; + LocalizedComponent.requireContext = LocalizedComponent.requireContext || {}; + LocalizedComponent.requireContext.dictionaries = PropTypes.object; + LocalizedComponent.requireContext.locale = PropTypes.string; LocalizedComponent.plotly_editor_traits = Comp.plotly_editor_traits; From 1434b269df8c9ef30bf520fe46650dfb6272abf7 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 21 Nov 2018 17:16:57 +0900 Subject: [PATCH 35/69] complete remove contextTypes and getChildContext --- src/EditorControls.js | 62 ------------------------ src/lib/connectAggregationToTransform.js | 18 ------- src/lib/connectTraceToPlot.js | 4 -- 3 files changed, 84 deletions(-) diff --git a/src/EditorControls.js b/src/EditorControls.js index 5503f0775..3d3fd321f 100644 --- a/src/EditorControls.js +++ b/src/EditorControls.js @@ -40,37 +40,6 @@ class EditorControls extends Component { } } - getChildContext() { - const gd = this.props.graphDiv || {}; - return { - advancedTraceTypeSelector: this.props.advancedTraceTypeSelector, - config: gd._context, - srcConverters: this.props.srcConverters, - data: gd.data, - dataSources: this.props.dataSources, - dataSourceOptions: this.props.dataSourceOptions, - dataSourceValueRenderer: this.props.dataSourceValueRenderer, - dataSourceOptionRenderer: this.props.dataSourceOptionRenderer, - dictionaries: this.props.dictionaries || {}, - localize: this.localize, - frames: gd._transitionData ? gd._transitionData._frames : [], - fullData: gd._fullData, - fullLayout: gd._fullLayout, - graphDiv: gd, - layout: gd.layout, - locale: this.props.locale, - onUpdate: this.handleUpdate.bind(this), - plotSchema: this.plotSchema, - plotly: this.props.plotly, - traceTypesConfig: this.props.traceTypesConfig, - showFieldTooltips: this.props.showFieldTooltips, - glByDefault: this.props.glByDefault, - mapBoxAccess: this.props.mapBoxAccess, - fontOptions: this.props.fontOptions, - chartHelp: this.props.chartHelp, - }; - } - provideValue() { const gd = this.props.graphDiv || {}; return { @@ -424,35 +393,4 @@ EditorControls.defaultProps = { fontOptions: DEFAULT_FONTS, }; -EditorControls.childContextTypes = { - advancedTraceTypeSelector: PropTypes.bool, - config: PropTypes.object, - srcConverters: PropTypes.shape({ - toSrc: PropTypes.func.isRequired, - fromSrc: PropTypes.func.isRequired, - }), - data: PropTypes.array, - dataSourceOptionRenderer: PropTypes.func, - dataSourceOptions: PropTypes.array, - dataSources: PropTypes.object, - dataSourceValueRenderer: PropTypes.func, - dictionaries: PropTypes.object, - frames: PropTypes.array, - fullData: PropTypes.array, - fullLayout: PropTypes.object, - graphDiv: PropTypes.any, - layout: PropTypes.object, - locale: PropTypes.string, - localize: PropTypes.func, - onUpdate: PropTypes.func, - plotly: PropTypes.object, - plotSchema: PropTypes.object, - traceTypesConfig: PropTypes.object, - showFieldTooltips: PropTypes.bool, - glByDefault: PropTypes.bool, - mapBoxAccess: PropTypes.bool, - fontOptions: PropTypes.array, - chartHelp: PropTypes.object, -}; - export default EditorControls; diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index 2985ff362..a17f8ef7c 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -25,16 +25,6 @@ export default function connectAggregationToTransform(WrappedComponent) { this.fullContainer = fullAggregations[aggregationIndex]; } - // getChildContext() { - // return { - // getValObject: attr => - // !this.props.getValObject ? null : this.props.getValObject(`aggregations[].${attr}`), - // updateContainer: this.updateAggregation, - // container: this.container, - // fullContainer: this.fullContainer, - // }; - // } - provideValue() { return { getValObject: attr => @@ -84,14 +74,6 @@ export default function connectAggregationToTransform(WrappedComponent) { getValObject: PropTypes.func, }; - // AggregationConnectedComponent.childContextTypes = { - // updateContainer: PropTypes.func, - // deleteContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // getValObject: PropTypes.func, - // }; - const {plotly_editor_traits} = WrappedComponent; AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index cfb90fcb3..a271e02a8 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -82,10 +82,6 @@ export default function connectTraceToPlot(WrappedComponent) { } } - // getChildContext() { - // return this.childContext; - // } - provideValue() { return this.childContext; } From d39719a3d6e0055aa0ebfc566fa04d69d92c76fa Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 21 Nov 2018 18:43:06 +0900 Subject: [PATCH 36/69] temporary checkin src in .npmignore --- .npmignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index 520eefd8c..573bf8da7 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,5 @@ test -src +# src build examples From 2d5d3c058ac641d5e4bf25f957352e68b0c86cdf Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 21 Nov 2018 19:19:12 +0900 Subject: [PATCH 37/69] remove optionalPanel --- .npmignore | 2 +- .../combined-translation-keys.txt | 272 +++++++++--------- scripts/translationKeys/translation-keys.txt | 272 +++++++++--------- src/EditorControls.js | 6 - 4 files changed, 273 insertions(+), 279 deletions(-) diff --git a/.npmignore b/.npmignore index 573bf8da7..520eefd8c 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,5 @@ test -# src +src build examples diff --git a/scripts/translationKeys/combined-translation-keys.txt b/scripts/translationKeys/combined-translation-keys.txt index cfc8b5167..f1e062207 100644 --- a/scripts/translationKeys/combined-translation-keys.txt +++ b/scripts/translationKeys/combined-translation-keys.txt @@ -28,14 +28,14 @@ Add shapes to a figure to highlight points or periods in time, thresholds, or ar Advanced (d3-format) // react-chart-editor: /components/fields/derived.js:152 Advanced (d3-time-format) // react-chart-editor: /components/fields/derived.js:146 Africa // react-chart-editor: /default_panels/GraphSubplotsPanel.js:107 -Aggregate // react-chart-editor: /components/containers/TransformAccordion.js:23 +Aggregate // react-chart-editor: /components/containers/TransformAccordion.js:31 Aggregations // react-chart-editor: /default_panels/GraphTransformsPanel.js:30 Aitoff // react-chart-editor: /default_panels/GraphSubplotsPanel.js:141 Albers USA // react-chart-editor: /default_panels/GraphSubplotsPanel.js:122 All // react-chart-editor: /default_panels/StyleAxesPanel.js:196 -All points in a trace are colored in the same color. // react-chart-editor: /components/fields/MarkerColor.js:168 -All traces will be colored in the the same color. // react-chart-editor: /components/fields/MarkerColor.js:110 -All will be colored in the same color. // react-chart-editor: /components/fields/MultiColorPicker.js:89 +All points in a trace are colored in the same color. // react-chart-editor: /components/fields/MarkerColor.js:170 +All traces will be colored in the the same color. // react-chart-editor: /components/fields/MarkerColor.js:111 +All will be colored in the same color. // react-chart-editor: /components/fields/MultiColorPicker.js:90 Ambient // react-chart-editor: /default_panels/StyleTracesPanel.js:530 Anchor // react-chart-editor: /default_panels/StyleColorbarsPanel.js:94 Anchor Point // react-chart-editor: /default_panels/StyleAxesPanel.js:354 @@ -49,7 +49,7 @@ Any Area // react-chart-editor: /default_panels/StyleTracesPanel.js:269 Arrow // react-chart-editor: /default_panels/StyleNotesPanel.js:30 Arrowhead // react-chart-editor: /default_panels/StyleNotesPanel.js:37 -Ascending // react-chart-editor: /default_panels/GraphTransformsPanel.js:88 +Ascending // react-chart-editor: /default_panels/GraphTransformsPanel.js:91 Asia // react-chart-editor: /default_panels/GraphSubplotsPanel.js:106 Aspect Ratio // react-chart-editor: /default_panels/GraphSubplotsPanel.js:42 Asymmetric // react-chart-editor: /components/fields/ErrorBars.js:79 @@ -58,13 +58,13 @@ Auto Auto margins // react-chart-editor: /default_panels/StyleAxesPanel.js:147 Autoscale // plotly.js: components/modebar/buttons.js:150 Average // react-chart-editor: /default_panels/GraphTransformsPanel.js:41 && react-chart-editor: /components/fields/derived.js:133 -Axes // react-chart-editor: /DefaultEditor.js:81 -Axes to Use // react-chart-editor: /components/fields/AxesCreator.js:146 -AxesSelector must be nested within a connectAxesToPlot component // react-chart-editor: /components/fields/AxesSelector.js:13 -Axis // react-chart-editor: /components/fields/AxesCreator.js:138 +Axes // react-chart-editor: /DefaultEditor.js:76 +Axes to Use // react-chart-editor: /components/fields/AxesCreator.js:147 +AxesSelector must be nested within a connectAxesToPlot component // react-chart-editor: /components/fields/AxesSelector.js:14 +Axis // react-chart-editor: /components/fields/AxesCreator.js:140 Axis Background // react-chart-editor: /default_panels/StyleAxesPanel.js:128 Axis Line // react-chart-editor: /default_panels/StyleAxesPanel.js:80 -Axis to Style // react-chart-editor: /components/fields/AxesSelector.js:44 +Axis to Style // react-chart-editor: /components/fields/AxesSelector.js:46 Azimuthal Equal Area // react-chart-editor: /default_panels/GraphSubplotsPanel.js:128 Azimuthal Equidistant // react-chart-editor: /default_panels/GraphSubplotsPanel.js:130 B // react-chart-editor: /components/fields/derived.js:552 @@ -79,7 +79,7 @@ Bar Padding Bar Position // react-chart-editor: /default_panels/StyleTracesPanel.js:212 Bar Size and Spacing // react-chart-editor: /default_panels/StyleTracesPanel.js:279 Bar Width // react-chart-editor: /default_panels/StyleTracesPanel.js:305 -Bars // react-chart-editor: /components/containers/TraceMarkerSection.js:19 +Bars // react-chart-editor: /components/containers/TraceMarkerSection.js:20 Base // react-chart-editor: /default_panels/StyleTracesPanel.js:213 Base Colors // react-chart-editor: /default_panels/StyleLayoutPanel.js:28 Basic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:80 @@ -112,7 +112,7 @@ Boxes and Points Button // react-chart-editor: /components/containers/RangeSelectorAccordion.js:39 Button Labels // react-chart-editor: /default_panels/StyleUpdateMenusPanel.js:24 Buttons // react-chart-editor: /components/containers/UpdateMenuAccordion.js:23 -By // react-chart-editor: /default_panels/GraphTransformsPanel.js:79 +By // react-chart-editor: /default_panels/GraphTransformsPanel.js:82 By Type // react-chart-editor: /components/containers/TraceAccordion.js:167 C // react-chart-editor: /components/fields/derived.js:553 Call out your data. // react-chart-editor: /components/containers/AnnotationAccordion.js:51 @@ -122,20 +122,20 @@ Carpet Carpet Contour // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:113 Carpet Scatter // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:109 Categorical // react-chart-editor: /default_panels/StyleAxesPanel.js:50 -Cell Options // react-chart-editor: /default_panels/GraphCreatePanel.js:146 +Cell Options // react-chart-editor: /default_panels/GraphCreatePanel.js:151 Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:168 Center // react-chart-editor: /default_panels/StyleAxesPanel.js:360 Center Latitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:91 Center Longitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:92 Center of Mass // react-chart-editor: /default_panels/StyleTracesPanel.js:76 Change // react-chart-editor: /default_panels/GraphTransformsPanel.js:50 -Charts like this by Plotly users. // react-chart-editor: /components/widgets/TraceTypeSelector.js:106 +Charts like this by Plotly users. // react-chart-editor: /components/widgets/TraceTypeSelector.js:232 Choropleth // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:77 Click // react-chart-editor: /default_panels/StyleLayoutPanel.js:108 Click Event // react-chart-editor: /default_panels/StyleLayoutPanel.js:113 Click on the + button above to add a shape. // react-chart-editor: /components/containers/ShapeAccordion.js:62 Click on the + button above to add a trace. // react-chart-editor: /components/containers/TraceAccordion.js:128 -Click on the + button above to add a transform. // react-chart-editor: /components/containers/TransformAccordion.js:128 +Click on the + button above to add a transform. // react-chart-editor: /components/containers/TransformAccordion.js:137 Click on the + button above to add an annotation. // react-chart-editor: /components/containers/AnnotationAccordion.js:57 Click on the + button above to add an image. // react-chart-editor: /components/containers/ImageAccordion.js:62 Click to enter Colorscale title // plotly.js: plots/plots.js:329 @@ -147,21 +147,21 @@ Click to enter X axis title Click to enter Y axis title // plotly.js: plots/plots.js:328 Click to enter radial axis title // plotly.js: plots/polar/polar.js:483 Clockwise // react-chart-editor: /components/fields/derived.js:102 -Close // react-chart-editor: /default_panels/GraphCreatePanel.js:106 +Close // react-chart-editor: /default_panels/GraphCreatePanel.js:111 Closest // react-chart-editor: /components/fields/derived.js:661 Coastlines // react-chart-editor: /default_panels/GraphSubplotsPanel.js:163 -Collapse All // react-chart-editor: /components/containers/PanelHeader.js:35 +Collapse All // react-chart-editor: /components/containers/PanelHeader.js:49 Color // react-chart-editor: /components/fields/ErrorBars.js:103 -Color Bar // react-chart-editor: /components/fields/MarkerColor.js:188 +Color Bar // react-chart-editor: /components/fields/MarkerColor.js:190 Color Bar Container // react-chart-editor: /default_panels/StyleColorbarsPanel.js:277 -Color Bars // react-chart-editor: /DefaultEditor.js:84 +Color Bars // react-chart-editor: /DefaultEditor.js:78 Coloring // react-chart-editor: /default_panels/StyleTracesPanel.js:352 Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:85 Colorscale // react-chart-editor: /default_panels/StyleTracesPanel.js:432 -Colorscale Direction // react-chart-editor: /components/fields/MarkerColor.js:183 -Colorscale Range // react-chart-editor: /components/fields/MarkerColor.js:193 -Column Options // react-chart-editor: /default_panels/GraphCreatePanel.js:152 -Columns // react-chart-editor: /default_panels/GraphCreatePanel.js:117 +Colorscale Direction // react-chart-editor: /components/fields/MarkerColor.js:185 +Colorscale Range // react-chart-editor: /components/fields/MarkerColor.js:195 +Column Options // react-chart-editor: /default_panels/GraphCreatePanel.js:157 +Columns // react-chart-editor: /default_panels/GraphCreatePanel.js:122 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // react-chart-editor: /lib/constants.js:24 Compare data on hover // plotly.js: components/modebar/buttons.js:178 Cone // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:65 @@ -190,14 +190,14 @@ Copy Z Style Count // react-chart-editor: /default_panels/GraphTransformsPanel.js:39 && react-chart-editor: /components/fields/derived.js:131 Counter Clockwise // react-chart-editor: /default_panels/StyleAxesPanel.js:73 Counterclockwise // react-chart-editor: /components/fields/derived.js:103 -Country Abbreviations (ISO-3) // react-chart-editor: /components/fields/LocationSelector.js:32 +Country Abbreviations (ISO-3) // react-chart-editor: /components/fields/LocationSelector.js:33 Country Borders // react-chart-editor: /default_panels/GraphSubplotsPanel.js:147 -Country Names // react-chart-editor: /components/fields/LocationSelector.js:31 +Country Names // react-chart-editor: /components/fields/LocationSelector.js:32 Crossbar Width // react-chart-editor: /components/fields/ErrorBars.js:105 Cube // react-chart-editor: /default_panels/GraphSubplotsPanel.js:47 Cumulative // react-chart-editor: /default_panels/StyleTracesPanel.js:125 Current Bin // react-chart-editor: /default_panels/StyleTracesPanel.js:140 -Custom // react-chart-editor: /components/fields/MarkerColor.js:195 +Custom // react-chart-editor: /components/fields/MarkerColor.js:197 Custom Data // react-chart-editor: /components/fields/ErrorBars.js:124 Dark // react-chart-editor: /default_panels/GraphSubplotsPanel.js:83 Data // react-chart-editor: /components/fields/ErrorBars.js:119 @@ -207,15 +207,15 @@ Decreasing Decreasing Trace Styles // react-chart-editor: /default_panels/StyleTracesPanel.js:555 Default // react-chart-editor: /components/fields/derived.js:145 Defaults // react-chart-editor: /default_panels/StyleLayoutPanel.js:25 -Degrees // react-chart-editor: /default_panels/GraphCreatePanel.js:129 +Degrees // react-chart-editor: /default_panels/GraphCreatePanel.js:134 Density // react-chart-editor: /default_panels/StyleTracesPanel.js:119 -Descending // react-chart-editor: /default_panels/GraphTransformsPanel.js:89 +Descending // react-chart-editor: /default_panels/GraphTransformsPanel.js:92 Diagonal // react-chart-editor: /default_panels/StyleLayoutPanel.js:103 Diameter // react-chart-editor: /default_panels/StyleTracesPanel.js:269 Diffuse // react-chart-editor: /default_panels/StyleTracesPanel.js:531 Direction // react-chart-editor: /default_panels/StyleAxesPanel.js:69 Disable // react-chart-editor: /components/fields/derived.js:664 -Disabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:76 +Disabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:79 Display // react-chart-editor: /default_panels/StyleTracesPanel.js:186 Distributions // react-chart-editor: /lib/traceTypes.js:21 Divergence // react-chart-editor: /components/fields/derived.js:574 @@ -227,9 +227,9 @@ Drag Drop the // react-chart-editor: /components/widgets/Dropzone.js:47 Dropdown // react-chart-editor: /components/containers/UpdateMenuAccordion.js:22 E+6 // react-chart-editor: /default_panels/StyleAxesPanel.js:185 -Each point in a trace is colored according to data. // react-chart-editor: /components/fields/MarkerColor.js:169 -Each trace will be colored according to the selected colorscale. // react-chart-editor: /components/fields/MarkerColor.js:109 -Each will be colored according to the selected colors. // react-chart-editor: /components/fields/MultiColorPicker.js:85 +Each point in a trace is colored according to data. // react-chart-editor: /components/fields/MarkerColor.js:171 +Each trace will be colored according to the selected colorscale. // react-chart-editor: /components/fields/MarkerColor.js:110 +Each will be colored according to the selected colors. // react-chart-editor: /components/fields/MultiColorPicker.js:86 Eckert 4 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:127 Edit in Chart Studio // plotly.js: components/modebar/buttons.js:87 Edit in HTML // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:30 @@ -237,7 +237,7 @@ Edit in Rich Text Ellipse // react-chart-editor: /default_panels/StyleShapesPanel.js:29 Embed images in your figure to make the data more readable or to brand your content. // react-chart-editor: /components/containers/ImageAccordion.js:59 Enable // react-chart-editor: /default_panels/StyleAxesPanel.js:65 -Enabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:76 +Enabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:79 End Point // react-chart-editor: /default_panels/StyleShapesPanel.js:36 Enter LaTeX formatted text // react-chart-editor: /components/fields/TextEditor.js:36 Enter Link URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:90 @@ -251,22 +251,22 @@ Error Bars Z Error Type // react-chart-editor: /components/fields/ErrorBars.js:113 Europe // react-chart-editor: /default_panels/GraphSubplotsPanel.js:105 Every label // react-chart-editor: /default_panels/StyleAxesPanel.js:222 -Exclude // react-chart-editor: /components/fields/FilterOperation.js:30 -Exclude Range // react-chart-editor: /components/fields/FilterOperation.js:79 -Exclude Values // react-chart-editor: /components/fields/FilterOperation.js:87 -Expand All // react-chart-editor: /components/containers/PanelHeader.js:40 +Exclude // react-chart-editor: /components/fields/FilterOperation.js:31 +Exclude Range // react-chart-editor: /components/fields/FilterOperation.js:80 +Exclude Values // react-chart-editor: /components/fields/FilterOperation.js:88 +Expand All // react-chart-editor: /components/containers/PanelHeader.js:54 Exponents // react-chart-editor: /default_panels/StyleAxesPanel.js:179 Extended Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:87 Face Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:536 -Facecolor // react-chart-editor: /default_panels/GraphCreatePanel.js:159 +Facecolor // react-chart-editor: /default_panels/GraphCreatePanel.js:164 False // react-chart-editor: /default_panels/StyleAxesPanel.js:149 File loaded! // react-chart-editor: /components/widgets/Dropzone.js:32 Fill // react-chart-editor: /default_panels/StyleImagesPanel.js:30 -Fill Color // react-chart-editor: /default_panels/GraphCreatePanel.js:141 +Fill Color // react-chart-editor: /default_panels/GraphCreatePanel.js:146 Fill to // react-chart-editor: /default_panels/StyleTracesPanel.js:443 Filled Area // react-chart-editor: /default_panels/StyleTracesPanel.js:442 Fills // react-chart-editor: /components/fields/derived.js:644 -Filter // react-chart-editor: /components/containers/TransformAccordion.js:21 +Filter // react-chart-editor: /components/containers/TransformAccordion.js:29 Finance // react-chart-editor: /lib/traceTypes.js:17 First // react-chart-editor: /default_panels/GraphTransformsPanel.js:48 First label // react-chart-editor: /default_panels/StyleAxesPanel.js:223 @@ -274,8 +274,8 @@ Fixed Width Fixed height // react-chart-editor: /default_panels/StyleLayoutPanel.js:73 Flatshading // react-chart-editor: /default_panels/StyleTracesPanel.js:197 Font // react-chart-editor: /default_panels/StyleSlidersPanel.js:30 -Font Color // react-chart-editor: /default_panels/GraphCreatePanel.js:142 -Font Size // react-chart-editor: /default_panels/GraphCreatePanel.js:143 +Font Color // react-chart-editor: /default_panels/GraphCreatePanel.js:147 +Font Size // react-chart-editor: /default_panels/GraphCreatePanel.js:148 Fraction // react-chart-editor: /default_panels/StyleTracesPanel.js:300 Fraction of Plot // react-chart-editor: /default_panels/StyleColorbarsPanel.js:71 Fraction of canvas // react-chart-editor: /default_panels/StyleSlidersPanel.js:41 @@ -285,12 +285,12 @@ Gap Between Groups Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:386 Gaps Between Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:510 Gaps in Data // react-chart-editor: /default_panels/StyleTracesPanel.js:519 -General // react-chart-editor: /DefaultEditor.js:79 +General // react-chart-editor: /DefaultEditor.js:74 Geo // react-chart-editor: /lib/constants.js:101 Gnomonic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:136 Go back // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:186 Go to the // react-chart-editor: /components/containers/TraceRequiredPanel.js:27 -Gradians // react-chart-editor: /default_panels/GraphCreatePanel.js:130 +Gradians // react-chart-editor: /default_panels/GraphCreatePanel.js:135 Grid Lines // react-chart-editor: /default_panels/StyleAxesPanel.js:98 Grid Spacing // react-chart-editor: /default_panels/StyleAxesPanel.js:109 Group // react-chart-editor: /default_panels/StyleTracesPanel.js:57 @@ -299,20 +299,20 @@ Half Hammer // react-chart-editor: /default_panels/GraphSubplotsPanel.js:139 Hard // react-chart-editor: /default_panels/StyleTracesPanel.js:579 Header // react-chart-editor: /default_panels/StyleTracesPanel.js:150 -Header Options // react-chart-editor: /default_panels/GraphCreatePanel.js:140 -Headers // react-chart-editor: /default_panels/GraphCreatePanel.js:116 +Header Options // react-chart-editor: /default_panels/GraphCreatePanel.js:145 +Headers // react-chart-editor: /default_panels/GraphCreatePanel.js:121 Heads up! // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:170 Heatmap // react-chart-editor: /default_panels/StyleTracesPanel.js:356 Heatmap GL // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:89 Height // react-chart-editor: /default_panels/StyleAxesPanel.js:299 -Hide // react-chart-editor: /components/fields/MarkerColor.js:190 -High // react-chart-editor: /default_panels/GraphCreatePanel.js:104 +Hide // react-chart-editor: /components/fields/MarkerColor.js:192 +High // react-chart-editor: /default_panels/GraphCreatePanel.js:109 Histogram // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:25 Histogram Function // react-chart-editor: /default_panels/StyleTracesPanel.js:112 Histogram Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:114 Hole // react-chart-editor: /default_panels/GraphSubplotsPanel.js:232 Hole Size // react-chart-editor: /default_panels/StyleTracesPanel.js:233 -Horizontal // react-chart-editor: /default_panels/GraphCreatePanel.js:71 +Horizontal // react-chart-editor: /default_panels/GraphCreatePanel.js:76 Horizontal Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:33 Horizontal Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:511 Horizontal Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:515 @@ -321,27 +321,27 @@ Hour Hover // react-chart-editor: /default_panels/StyleLayoutPanel.js:118 Hover Action // react-chart-editor: /default_panels/StyleTracesPanel.js:642 Hover on // react-chart-editor: /default_panels/StyleTracesPanel.js:643 -I (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:100 +I (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:105 IE only supports svg. Changing format to svg. // plotly.js: components/modebar/buttons.js:65 Icon Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:60 Image // react-chart-editor: /components/containers/ImageAccordion.js:22 -Images // react-chart-editor: /DefaultEditor.js:88 -Include // react-chart-editor: /components/fields/FilterOperation.js:29 -Include Range // react-chart-editor: /components/fields/FilterOperation.js:75 -Include Values // react-chart-editor: /components/fields/FilterOperation.js:83 +Images // react-chart-editor: /DefaultEditor.js:81 +Include // react-chart-editor: /components/fields/FilterOperation.js:30 +Include Range // react-chart-editor: /components/fields/FilterOperation.js:76 +Include Values // react-chart-editor: /components/fields/FilterOperation.js:84 Increasing // react-chart-editor: /default_panels/StyleTracesPanel.js:135 Increasing Trace Styles // react-chart-editor: /default_panels/StyleTracesPanel.js:543 Individually // react-chart-editor: /components/containers/TraceAccordion.js:166 -Inequality // react-chart-editor: /components/fields/FilterOperation.js:71 +Inequality // react-chart-editor: /components/fields/FilterOperation.js:72 Infer Zero // react-chart-editor: /default_panels/StyleTracesPanel.js:389 Inside // react-chart-editor: /components/fields/derived.js:492 -Intensity // react-chart-editor: /default_panels/GraphCreatePanel.js:158 +Intensity // react-chart-editor: /default_panels/GraphCreatePanel.js:163 Interactions // react-chart-editor: /default_panels/StyleLayoutPanel.js:81 Interpolate // react-chart-editor: /default_panels/StyleTracesPanel.js:390 Interpolate Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:524 -J (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:101 +J (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:106 Jitter // react-chart-editor: /default_panels/StyleTracesPanel.js:255 -K (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:102 +K (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:107 KDE // react-chart-editor: /components/fields/derived.js:637 Kavrayskiy 7 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:126 LaTeX // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:25 @@ -350,14 +350,14 @@ Label Label Format // react-chart-editor: /default_panels/StyleAxesPanel.js:168 Label Prefix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:171 Label Suffix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:197 -Labels // react-chart-editor: /default_panels/GraphCreatePanel.js:42 +Labels // react-chart-editor: /default_panels/GraphCreatePanel.js:47 Lakes // react-chart-editor: /default_panels/GraphSubplotsPanel.js:185 Land // react-chart-editor: /default_panels/GraphSubplotsPanel.js:178 Lasso // react-chart-editor: /default_panels/StyleLayoutPanel.js:90 Lasso Select // plotly.js: components/modebar/buttons.js:123 Last // react-chart-editor: /default_panels/GraphTransformsPanel.js:49 Last label // react-chart-editor: /default_panels/StyleAxesPanel.js:224 -Lat/Lon // react-chart-editor: /components/fields/LocationSelector.js:99 +Lat/Lon // react-chart-editor: /components/fields/LocationSelector.js:103 Latitude // react-chart-editor: /components/fields/derived.js:545 Layout // react-chart-editor: /default_panels/StyleLayoutPanel.js:64 Left // react-chart-editor: /components/fields/derived.js:91 @@ -378,18 +378,18 @@ Lines Lines, Rectangles and Ellipses. // react-chart-editor: /components/containers/ShapeAccordion.js:56 Loading... // react-chart-editor: /components/widgets/Dropzone.js:111 Location // react-chart-editor: /components/fields/derived.js:540 -Location Format // react-chart-editor: /components/fields/LocationSelector.js:27 -Locations // react-chart-editor: /components/fields/LocationSelector.js:25 +Location Format // react-chart-editor: /components/fields/LocationSelector.js:28 +Locations // react-chart-editor: /components/fields/LocationSelector.js:26 Log // react-chart-editor: /default_panels/StyleAxesPanel.js:48 Logos, watermarks and more. // react-chart-editor: /components/containers/ImageAccordion.js:56 Longitude // react-chart-editor: /components/fields/derived.js:545 Looks like there aren't any traces defined yet. // react-chart-editor: /components/containers/TraceRequiredPanel.js:25 -Low // react-chart-editor: /default_panels/GraphCreatePanel.js:105 -Lower < Target < Upper // react-chart-editor: /components/fields/FilterOperation.js:19 -Lower < Target ≤ Upper // react-chart-editor: /components/fields/FilterOperation.js:21 -Lower Bound // react-chart-editor: /components/fields/FilterOperation.js:169 -Lower ≤ Target < Upper // react-chart-editor: /components/fields/FilterOperation.js:20 -Lower ≤ Target ≤ Upper // react-chart-editor: /components/fields/FilterOperation.js:18 +Low // react-chart-editor: /default_panels/GraphCreatePanel.js:110 +Lower < Target < Upper // react-chart-editor: /components/fields/FilterOperation.js:20 +Lower < Target ≤ Upper // react-chart-editor: /components/fields/FilterOperation.js:22 +Lower Bound // react-chart-editor: /components/fields/FilterOperation.js:171 +Lower ≤ Target < Upper // react-chart-editor: /components/fields/FilterOperation.js:21 +Lower ≤ Target ≤ Upper // react-chart-editor: /components/fields/FilterOperation.js:19 Manual // react-chart-editor: /default_panels/GraphSubplotsPanel.js:49 Map Frame // react-chart-editor: /default_panels/GraphSubplotsPanel.js:201 Map Options // react-chart-editor: /default_panels/GraphSubplotsPanel.js:210 @@ -400,7 +400,7 @@ Mapbox Mapbox Style // react-chart-editor: /default_panels/GraphSubplotsPanel.js:77 Maps // react-chart-editor: /lib/traceTypes.js:25 Margin Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:27 -Max // react-chart-editor: /components/fields/MarkerColor.js:200 +Max // react-chart-editor: /components/fields/MarkerColor.js:202 Max Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:381 Max Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:377 Max Number of Labels // react-chart-editor: /default_panels/StyleAxesPanel.js:261 @@ -417,14 +417,14 @@ Meanline Meanline Color // react-chart-editor: /default_panels/StyleTracesPanel.js:621 Meanline Width // react-chart-editor: /default_panels/StyleTracesPanel.js:620 Median // react-chart-editor: /default_panels/GraphTransformsPanel.js:42 -Menus // react-chart-editor: /DefaultEditor.js:93 +Menus // react-chart-editor: /DefaultEditor.js:83 Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:119 Middle // react-chart-editor: /default_panels/StyleAxesPanel.js:374 Middle Center // react-chart-editor: /components/fields/derived.js:484 Middle Left // react-chart-editor: /components/fields/derived.js:483 Middle Right // react-chart-editor: /components/fields/derived.js:485 Miller // react-chart-editor: /default_panels/GraphSubplotsPanel.js:125 -Min // react-chart-editor: /components/fields/MarkerColor.js:199 +Min // react-chart-editor: /components/fields/MarkerColor.js:201 Min Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:380 Minimum // react-chart-editor: /components/fields/derived.js:134 Minimum Size // react-chart-editor: /default_panels/StyleTracesPanel.js:271 @@ -434,7 +434,7 @@ Mode Modebar // react-chart-editor: /default_panels/StyleLayoutPanel.js:54 Mollweide // react-chart-editor: /default_panels/GraphSubplotsPanel.js:138 Month // react-chart-editor: /default_panels/StyleAxesPanel.js:323 -Multiple // react-chart-editor: /components/fields/MultiColorPicker.js:77 +Multiple // react-chart-editor: /components/fields/MultiColorPicker.js:78 Multiple Values // react-chart-editor: /lib/constants.js:18 Name // react-chart-editor: /default_panels/StyleTracesPanel.js:48 Natural Earth // react-chart-editor: /default_panels/GraphSubplotsPanel.js:121 @@ -444,30 +444,30 @@ No Results None // react-chart-editor: /components/fields/derived.js:59 None label // react-chart-editor: /default_panels/StyleColorbarsPanel.js:192 Norm // react-chart-editor: /components/fields/derived.js:573 -Normal // react-chart-editor: /components/fields/MarkerColor.js:185 +Normal // react-chart-editor: /components/fields/MarkerColor.js:187 Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:296 North America // react-chart-editor: /default_panels/GraphSubplotsPanel.js:108 Note Text // react-chart-editor: /default_panels/StyleNotesPanel.js:23 -Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:93 -Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:84 -Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:75 +Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:98 +Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:89 +Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:80 Number format // react-chart-editor: /default_panels/StyleLayoutPanel.js:33 Number of Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:373 Number of Occurences // react-chart-editor: /default_panels/StyleTracesPanel.js:116 OHLC // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:117 Oceans // react-chart-editor: /default_panels/GraphSubplotsPanel.js:171 -Off // react-chart-editor: /components/fields/RectanglePositioner.js:87 +Off // react-chart-editor: /components/fields/RectanglePositioner.js:88 Offset // react-chart-editor: /default_panels/StyleTracesPanel.js:214 -On // react-chart-editor: /components/fields/RectanglePositioner.js:87 +On // react-chart-editor: /components/fields/RectanglePositioner.js:88 On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:623 Opacity // react-chart-editor: /default_panels/StyleShapesPanel.js:51 -Open // react-chart-editor: /default_panels/GraphCreatePanel.js:103 -Operator // react-chart-editor: /default_panels/GraphTransformsPanel.js:82 -Options // react-chart-editor: /default_panels/GraphCreatePanel.js:157 +Open // react-chart-editor: /default_panels/GraphCreatePanel.js:108 +Operator // react-chart-editor: /default_panels/GraphTransformsPanel.js:85 +Options // react-chart-editor: /default_panels/GraphCreatePanel.js:162 Orbit // react-chart-editor: /default_panels/StyleLayoutPanel.js:91 Orbital rotation // plotly.js: components/modebar/buttons.js:287 -Order // react-chart-editor: /default_panels/GraphCreatePanel.js:154 -Orientation // react-chart-editor: /default_panels/GraphCreatePanel.js:69 +Order // react-chart-editor: /default_panels/GraphCreatePanel.js:159 +Orientation // react-chart-editor: /default_panels/GraphCreatePanel.js:74 Orthographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:120 Outdoors // react-chart-editor: /default_panels/GraphSubplotsPanel.js:81 Outliers // react-chart-editor: /default_panels/StyleTracesPanel.js:238 @@ -479,14 +479,14 @@ Parallel Coordinates Percent // react-chart-editor: /components/fields/derived.js:561 Pie // react-chart-editor: /components/containers/SubplotAccordion.js:133 Pie Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:83 -Pie Segments // react-chart-editor: /components/containers/TraceMarkerSection.js:21 +Pie Segments // react-chart-editor: /components/containers/TraceMarkerSection.js:22 Pie Title // react-chart-editor: /default_panels/StyleTracesPanel.js:93 Pitch // react-chart-editor: /default_panels/GraphSubplotsPanel.js:95 Pixels // react-chart-editor: /default_panels/StyleColorbarsPanel.js:72 Plot Background // react-chart-editor: /default_panels/GraphSubplotsPanel.js:63 Point Cloud // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:85 Point Opacity // react-chart-editor: /default_panels/StyleTracesPanel.js:258 -Points // react-chart-editor: /components/containers/TraceMarkerSection.js:23 +Points // react-chart-editor: /components/containers/TraceMarkerSection.js:24 Points and Fills // react-chart-editor: /components/fields/derived.js:645 Polar // react-chart-editor: /lib/constants.js:103 Polar Bar // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:133 @@ -505,12 +505,12 @@ Projection Pull // react-chart-editor: /default_panels/StyleTracesPanel.js:234 R // react-chart-editor: /components/fields/derived.js:556 RMS // react-chart-editor: /default_panels/GraphTransformsPanel.js:44 -Radians // react-chart-editor: /default_panels/GraphCreatePanel.js:128 -Radius // react-chart-editor: /default_panels/GraphCreatePanel.js:123 +Radians // react-chart-editor: /default_panels/GraphCreatePanel.js:133 +Radius // react-chart-editor: /default_panels/GraphCreatePanel.js:128 Range // react-chart-editor: /default_panels/GraphTransformsPanel.js:51 Range Slider // react-chart-editor: /default_panels/StyleAxesPanel.js:294 Rectangle // react-chart-editor: /default_panels/StyleShapesPanel.js:28 -Reference // react-chart-editor: /components/fields/FilterOperation.js:167 +Reference // react-chart-editor: /components/fields/FilterOperation.js:169 Region // react-chart-editor: /default_panels/GraphSubplotsPanel.js:100 Relative // react-chart-editor: /default_panels/StyleTracesPanel.js:291 Relative To // react-chart-editor: /default_panels/StyleImagesPanel.js:54 @@ -524,7 +524,7 @@ Reset camera to last save Reset view // plotly.js: components/modebar/buttons.js:592 Reset views // plotly.js: components/modebar/buttons.js:540 Resolution // react-chart-editor: /default_panels/GraphSubplotsPanel.js:212 -Reversed // react-chart-editor: /components/fields/MarkerColor.js:185 +Reversed // react-chart-editor: /components/fields/MarkerColor.js:187 Reversed and Grouped // react-chart-editor: /default_panels/StyleLegendPanel.js:75 Rich Text // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:20 Rich text is incompatible with LaTeX. // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:111 @@ -547,17 +547,17 @@ Scatter Scatter GL // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:81 Scene // react-chart-editor: /lib/constants.js:99 Second // react-chart-editor: /default_panels/StyleAxesPanel.js:327 -See a basic example. // react-chart-editor: /components/widgets/TraceTypeSelector.js:128 +See a basic example. // react-chart-editor: /components/widgets/TraceTypeSelector.js:256 Select // react-chart-editor: /default_panels/StyleLayoutPanel.js:88 Select Data Point // react-chart-editor: /default_panels/StyleLayoutPanel.js:114 Select Direction // react-chart-editor: /default_panels/StyleLayoutPanel.js:97 -Select Trace Type // react-chart-editor: /components/widgets/TraceTypeSelector.js:219 +Select Trace Type // react-chart-editor: /components/widgets/TraceTypeSelector.js:284 Select a Colorscale Type // react-chart-editor: /components/widgets/ColorscalePicker.js:55 Select an Option // react-chart-editor: /components/widgets/Dropdown.js:67 Separate Thousands // react-chart-editor: /default_panels/StyleAxesPanel.js:174 Shape // react-chart-editor: /components/containers/ShapeAccordion.js:23 -Shapes // react-chart-editor: /DefaultEditor.js:87 -Show // react-chart-editor: /components/fields/MarkerColor.js:190 +Shapes // react-chart-editor: /DefaultEditor.js:80 +Show // react-chart-editor: /components/fields/MarkerColor.js:192 Show All // react-chart-editor: /default_panels/StyleTracesPanel.js:237 Show Contour // react-chart-editor: /default_panels/StyleTracesPanel.js:632 Show Exponents // react-chart-editor: /default_panels/StyleAxesPanel.js:192 @@ -568,20 +568,20 @@ Show closest data on hover Show in Legend // react-chart-editor: /default_panels/StyleTracesPanel.js:52 Side // react-chart-editor: /default_panels/GraphSubplotsPanel.js:35 Simple // react-chart-editor: /components/fields/derived.js:151 -Single // react-chart-editor: /components/fields/MultiColorPicker.js:76 +Single // react-chart-editor: /components/fields/MultiColorPicker.js:77 Sinusoidal // react-chart-editor: /default_panels/GraphSubplotsPanel.js:142 Size // react-chart-editor: /default_panels/StyleColorbarsPanel.js:65 Size Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:63 Size Scale // react-chart-editor: /default_panels/StyleTracesPanel.js:261 Size and Positioning // react-chart-editor: /default_panels/StyleColorbarsPanel.js:64 Slider // react-chart-editor: /components/containers/SliderAccordion.js:21 -Sliders // react-chart-editor: /DefaultEditor.js:90 +Sliders // react-chart-editor: /DefaultEditor.js:82 Smoothing // react-chart-editor: /default_panels/StyleTracesPanel.js:435 -Snap to Grid // react-chart-editor: /components/fields/RectanglePositioner.js:82 +Snap to Grid // react-chart-editor: /components/fields/RectanglePositioner.js:83 Snapshot succeeded // plotly.js: components/modebar/buttons.js:77 Soft // react-chart-editor: /default_panels/StyleTracesPanel.js:578 Sorry, there was a problem downloading your snapshot! // plotly.js: components/modebar/buttons.js:80 -Sort // react-chart-editor: /components/containers/TransformAccordion.js:24 +Sort // react-chart-editor: /components/containers/TransformAccordion.js:32 Sorted // react-chart-editor: /default_panels/StyleTracesPanel.js:222 South America // react-chart-editor: /default_panels/GraphSubplotsPanel.js:109 Span // react-chart-editor: /default_panels/StyleTracesPanel.js:584 @@ -589,7 +589,7 @@ Span Mode Specialized // react-chart-editor: /lib/traceTypes.js:29 Specular // react-chart-editor: /default_panels/StyleTracesPanel.js:532 Spike Lines // react-chart-editor: /default_panels/StyleAxesPanel.js:383 -Split // react-chart-editor: /components/containers/TransformAccordion.js:22 +Split // react-chart-editor: /components/containers/TransformAccordion.js:30 Split labels // react-chart-editor: /default_panels/StyleTracesPanel.js:626 Stack // react-chart-editor: /default_panels/GraphSubplotsPanel.js:70 Stacking // react-chart-editor: /default_panels/StyleTracesPanel.js:383 @@ -602,10 +602,10 @@ Stepmode Stereographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:137 Streamtube // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:69 Stretch // react-chart-editor: /default_panels/StyleImagesPanel.js:31 -Structure // react-chart-editor: /DefaultEditor.js:74 +Structure // react-chart-editor: /DefaultEditor.js:69 Style // react-chart-editor: /default_panels/StyleAxesPanel.js:346 Sub-Country Unit Borders // react-chart-editor: /default_panels/GraphSubplotsPanel.js:155 -Subplots // react-chart-editor: /components/fields/AxesCreator.js:152 +Subplots // react-chart-editor: /components/fields/AxesCreator.js:153 Subplots to Use // react-chart-editor: /components/fields/SubplotCreator.js:122 Suffix // react-chart-editor: /default_panels/StyleAxesPanel.js:229 Sum // react-chart-editor: /default_panels/GraphSubplotsPanel.js:226 && react-chart-editor: /components/fields/derived.js:132 @@ -617,13 +617,13 @@ Symmetric Table // react-chart-editor: /components/containers/SubplotAccordion.js:134 Tail // react-chart-editor: /default_panels/StyleTracesPanel.js:74 Taking snapshot - this may take a few seconds // plotly.js: components/modebar/buttons.js:62 -Target // react-chart-editor: /default_panels/GraphTransformsPanel.js:81 -Target < Reference // react-chart-editor: /components/fields/FilterOperation.js:11 -Target = Reference // react-chart-editor: /components/fields/FilterOperation.js:13 -Target > Reference // react-chart-editor: /components/fields/FilterOperation.js:14 -Target ≠ Reference // react-chart-editor: /components/fields/FilterOperation.js:10 -Target ≤ Reference // react-chart-editor: /components/fields/FilterOperation.js:12 -Target ≥ Reference // react-chart-editor: /components/fields/FilterOperation.js:15 +Target // react-chart-editor: /default_panels/GraphTransformsPanel.js:84 +Target < Reference // react-chart-editor: /components/fields/FilterOperation.js:12 +Target = Reference // react-chart-editor: /components/fields/FilterOperation.js:14 +Target > Reference // react-chart-editor: /components/fields/FilterOperation.js:15 +Target ≠ Reference // react-chart-editor: /components/fields/FilterOperation.js:11 +Target ≤ Reference // react-chart-editor: /components/fields/FilterOperation.js:13 +Target ≥ Reference // react-chart-editor: /components/fields/FilterOperation.js:16 Ternary // react-chart-editor: /default_panels/GraphSubplotsPanel.js:225 Ternary Scatter // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:45 Text // react-chart-editor: /components/fields/derived.js:513 @@ -631,10 +631,10 @@ Text Alignment Text Attributes // react-chart-editor: /default_panels/StyleTracesPanel.js:446 Text Position // react-chart-editor: /default_panels/StyleTracesPanel.js:467 Theta // react-chart-editor: /components/fields/derived.js:556 -Theta Unit // react-chart-editor: /default_panels/GraphCreatePanel.js:126 +Theta Unit // react-chart-editor: /default_panels/GraphCreatePanel.js:131 Thickness // react-chart-editor: /components/fields/ErrorBars.js:104 This input has multiple values associated with it. Changing this setting will override these custom inputs. // react-chart-editor: /lib/constants.js:20 -This panel could not be displayed due to an error. // react-chart-editor: /components/containers/PlotlyPanel.js:16 +This panel could not be displayed due to an error. // react-chart-editor: /components/containers/PlotlyPanel.js:17 Tick Labels // react-chart-editor: /default_panels/StyleAxesPanel.js:137 Tick Markers // react-chart-editor: /default_panels/StyleAxesPanel.js:265 Tick Spacing // react-chart-editor: /default_panels/StyleAxesPanel.js:254 @@ -662,37 +662,37 @@ Trace name Trace your data. // react-chart-editor: /components/containers/TraceAccordion.js:119 Traces // react-chart-editor: /components/containers/TraceRequiredPanel.js:28 Traces of various types like bar and line are the building blocks of your figure. // react-chart-editor: /components/containers/TraceAccordion.js:121 -Transform // react-chart-editor: /components/containers/TransformAccordion.js:66 -Transforms // react-chart-editor: /DefaultEditor.js:77 -Transpose // react-chart-editor: /default_panels/GraphCreatePanel.js:162 +Transform // react-chart-editor: /components/containers/TransformAccordion.js:75 +Transforms // react-chart-editor: /DefaultEditor.js:72 +Transpose // react-chart-editor: /default_panels/GraphCreatePanel.js:167 Transverse Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:140 True // react-chart-editor: /default_panels/StyleAxesPanel.js:149 Try again with a // react-chart-editor: /components/widgets/Dropzone.js:130 Try again with a supported file format: // react-chart-editor: /components/widgets/Dropzone.js:74 Turntable // react-chart-editor: /default_panels/StyleLayoutPanel.js:92 Turntable rotation // plotly.js: components/modebar/buttons.js:296 -Type // react-chart-editor: /default_panels/GraphCreatePanel.js:37 +Type // react-chart-editor: /default_panels/GraphCreatePanel.js:43 Typeface // react-chart-editor: /default_panels/StyleAxesPanel.js:35 U // react-chart-editor: /components/fields/derived.js:570 URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:91 USA // react-chart-editor: /default_panels/GraphSubplotsPanel.js:104 -USA State Abbreviations (e.g. NY) // react-chart-editor: /components/fields/LocationSelector.js:34 +USA State Abbreviations (e.g. NY) // react-chart-editor: /components/fields/LocationSelector.js:35 Unsorted // react-chart-editor: /default_panels/StyleTracesPanel.js:222 -Upper Bound // react-chart-editor: /components/fields/FilterOperation.js:187 +Upper Bound // react-chart-editor: /components/fields/FilterOperation.js:189 V // react-chart-editor: /components/fields/derived.js:571 Value // react-chart-editor: /components/fields/derived.js:508 Value (-) // react-chart-editor: /components/fields/ErrorBars.js:144 Values // react-chart-editor: /components/fields/derived.js:540 Values Shown On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:624 -Variable // react-chart-editor: /components/fields/MarkerColor.js:156 +Variable // react-chart-editor: /components/fields/MarkerColor.js:158 Vertex Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:535 -Vertexcolor // react-chart-editor: /default_panels/GraphCreatePanel.js:160 -Vertical // react-chart-editor: /default_panels/GraphCreatePanel.js:71 +Vertexcolor // react-chart-editor: /default_panels/GraphCreatePanel.js:165 +Vertical // react-chart-editor: /default_panels/GraphCreatePanel.js:76 Vertical Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:39 Vertical Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:512 Vertical Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:516 Vertical Positioning // react-chart-editor: /default_panels/StyleAxesPanel.js:366 -View tutorials on this chart type. // react-chart-editor: /components/widgets/TraceTypeSelector.js:120 +View tutorials on this chart type. // react-chart-editor: /components/widgets/TraceTypeSelector.js:248 Violin // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:49 Violin Mode // react-chart-editor: /default_panels/StyleTracesPanel.js:326 Violin Padding // react-chart-editor: /default_panels/StyleTracesPanel.js:334 @@ -704,9 +704,9 @@ Violins, Points and KDE Visible Sides // react-chart-editor: /default_panels/StyleTracesPanel.js:587 W // react-chart-editor: /components/fields/derived.js:572 WebGL // react-chart-editor: /components/fields/TraceSelector.js:101 -Well this is embarrassing. // react-chart-editor: /components/containers/PlotlyPanel.js:15 +Well this is embarrassing. // react-chart-editor: /components/containers/PlotlyPanel.js:16 Whisker Width // react-chart-editor: /default_panels/StyleTracesPanel.js:338 -Width // react-chart-editor: /default_panels/GraphCreatePanel.js:153 +Width // react-chart-editor: /default_panels/GraphCreatePanel.js:158 Winkel Tripel // react-chart-editor: /default_panels/GraphSubplotsPanel.js:123 World // react-chart-editor: /default_panels/GraphSubplotsPanel.js:103 X // react-chart-editor: /components/fields/derived.js:523 @@ -718,9 +718,9 @@ X Bin Size X Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:202 X Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:39 X Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:26 -X Values // react-chart-editor: /default_panels/GraphCreatePanel.js:46 +X Values // react-chart-editor: /default_panels/GraphCreatePanel.js:51 X Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:41 -X start // react-chart-editor: /default_panels/GraphCreatePanel.js:113 +X start // react-chart-editor: /default_panels/GraphCreatePanel.js:118 Y // react-chart-editor: /components/fields/derived.js:523 Y = 0 // react-chart-editor: /components/fields/derived.js:594 Y Anchor // react-chart-editor: /default_panels/GraphSubplotsPanel.js:37 @@ -730,21 +730,21 @@ Y Bin Size Y Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:207 Y Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:40 Y Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:27 -Y Values // react-chart-editor: /default_panels/GraphCreatePanel.js:54 +Y Values // react-chart-editor: /default_panels/GraphCreatePanel.js:59 Y Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:42 -Y start // react-chart-editor: /default_panels/GraphCreatePanel.js:114 +Y start // react-chart-editor: /default_panels/GraphCreatePanel.js:119 Year // react-chart-editor: /default_panels/StyleAxesPanel.js:322 Yes // react-chart-editor: /components/fields/ErrorBars.js:96 Yikes! An error occurred while parsing this file. // react-chart-editor: /components/widgets/Dropzone.js:73 Yikes! This doesn't look like a valid // react-chart-editor: /components/widgets/Dropzone.js:128 Yikes! You can only upload one file at a time. // react-chart-editor: /components/widgets/Dropzone.js:102 You can add as many as you like, mixing and matching types and arranging them into subplots. // react-chart-editor: /components/containers/TraceAccordion.js:125 -You can style and position your axes in the // react-chart-editor: /components/fields/AxesCreator.js:151 +You can style and position your axes in the // react-chart-editor: /components/fields/AxesCreator.js:152 You can style and position your subplots in the // react-chart-editor: /components/fields/SubplotCreator.js:132 You need to provide a component for the modal to open! // react-chart-editor: /components/containers/ModalProvider.js:34 Z // react-chart-editor: /components/fields/derived.js:538 -Z Values // react-chart-editor: /default_panels/GraphCreatePanel.js:63 -Z start // react-chart-editor: /default_panels/GraphCreatePanel.js:115 +Z Values // react-chart-editor: /default_panels/GraphCreatePanel.js:68 +Z start // react-chart-editor: /default_panels/GraphCreatePanel.js:120 Zero Line // react-chart-editor: /default_panels/StyleAxesPanel.js:119 Zoom // plotly.js: components/modebar/buttons.js:96 && react-chart-editor: /default_panels/StyleLayoutPanel.js:87 Zoom Interactivity // react-chart-editor: /default_panels/StyleAxesPanel.js:62 @@ -777,8 +777,8 @@ new text open: // plotly.js: traces/ohlc/calc.js:100 outgoing flow count: // plotly.js: traces/sankey/plot.js:147 panel under Structure to define traces. // react-chart-editor: /components/containers/TraceRequiredPanel.js:29 -panel under Style. If Y values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:79 -panel. // react-chart-editor: /components/fields/AxesCreator.js:153 +panel under Style. If Y values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:84 +panel. // react-chart-editor: /components/fields/AxesCreator.js:154 q1: // plotly.js: traces/box/calc.js:137 q3: // plotly.js: traces/box/calc.js:138 scaled // react-chart-editor: /default_panels/StyleTracesPanel.js:65 @@ -787,12 +787,12 @@ target: to upload here or click to choose a file from your computer. // react-chart-editor: /components/widgets/Dropzone.js:49 to us. // react-chart-editor: /components/widgets/Dropzone.js:128 trace // plotly.js: plots/plots.js:332 -transforms allow you to create multiple traces from one source trace, so as to style them differently. // react-chart-editor: /components/containers/TransformAccordion.js:112 -transforms allow you to filter data out from a trace. // react-chart-editor: /components/containers/TransformAccordion.js:107 -transforms allow you to sort a trace, so as to control marker overlay or line connection order. // react-chart-editor: /components/containers/TransformAccordion.js:124 -transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // react-chart-editor: /components/containers/TransformAccordion.js:118 -under Style panel. If X values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:88 -under Style panel. If Z values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:97 +transforms allow you to create multiple traces from one source trace, so as to style them differently. // react-chart-editor: /components/containers/TransformAccordion.js:121 +transforms allow you to filter data out from a trace. // react-chart-editor: /components/containers/TransformAccordion.js:116 +transforms allow you to sort a trace, so as to control marker overlay or line connection order. // react-chart-editor: /components/containers/TransformAccordion.js:133 +transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // react-chart-editor: /components/containers/TransformAccordion.js:127 +under Style panel. If X values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:93 +under Style panel. If Z values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:102 upper fence: // plotly.js: traces/box/calc.js:142 x // react-chart-editor: /default_panels/StyleAxesPanel.js:208 x10^6 // react-chart-editor: /default_panels/StyleAxesPanel.js:186 diff --git a/scripts/translationKeys/translation-keys.txt b/scripts/translationKeys/translation-keys.txt index 6d614b1c6..9f08f11b5 100644 --- a/scripts/translationKeys/translation-keys.txt +++ b/scripts/translationKeys/translation-keys.txt @@ -1,15 +1,15 @@ - Axis // /components/fields/AxesCreator.js:138 + Axis // /components/fields/AxesCreator.js:140 panel under Structure to define traces. // /components/containers/TraceRequiredPanel.js:29 - panel under Style. If Y values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:79 - panel. // /components/fields/AxesCreator.js:153 + panel under Style. If Y values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:84 + panel. // /components/fields/AxesCreator.js:154 to upload here or click to choose a file from your computer. // /components/widgets/Dropzone.js:49 to us. // /components/widgets/Dropzone.js:128 - transforms allow you to create multiple traces from one source trace, so as to style them differently. // /components/containers/TransformAccordion.js:112 - transforms allow you to filter data out from a trace. // /components/containers/TransformAccordion.js:107 - transforms allow you to sort a trace, so as to control marker overlay or line connection order. // /components/containers/TransformAccordion.js:124 - transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // /components/containers/TransformAccordion.js:118 - under Style panel. If X values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:88 - under Style panel. If Z values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:97 + transforms allow you to create multiple traces from one source trace, so as to style them differently. // /components/containers/TransformAccordion.js:121 + transforms allow you to filter data out from a trace. // /components/containers/TransformAccordion.js:116 + transforms allow you to sort a trace, so as to control marker overlay or line connection order. // /components/containers/TransformAccordion.js:133 + transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // /components/containers/TransformAccordion.js:127 + under Style panel. If X values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:93 + under Style panel. If Z values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:102 # // /default_panels/StyleAxesPanel.js:210 $ // /default_panels/StyleAxesPanel.js:209 % // /components/fields/derived.js:509 @@ -40,14 +40,14 @@ Add shapes to a figure to highlight points or periods in time, thresholds, or ar Advanced (d3-format) // /components/fields/derived.js:152 Advanced (d3-time-format) // /components/fields/derived.js:146 Africa // /default_panels/GraphSubplotsPanel.js:107 -Aggregate // /components/containers/TransformAccordion.js:23 +Aggregate // /components/containers/TransformAccordion.js:31 Aggregations // /default_panels/GraphTransformsPanel.js:30 Aitoff // /default_panels/GraphSubplotsPanel.js:141 Albers USA // /default_panels/GraphSubplotsPanel.js:122 All // /default_panels/StyleAxesPanel.js:196 -All points in a trace are colored in the same color. // /components/fields/MarkerColor.js:168 -All traces will be colored in the the same color. // /components/fields/MarkerColor.js:110 -All will be colored in the same color. // /components/fields/MultiColorPicker.js:89 +All points in a trace are colored in the same color. // /components/fields/MarkerColor.js:170 +All traces will be colored in the the same color. // /components/fields/MarkerColor.js:111 +All will be colored in the same color. // /components/fields/MultiColorPicker.js:90 Ambient // /default_panels/StyleTracesPanel.js:530 Anchor // /default_panels/StyleColorbarsPanel.js:94 Anchor Point // /default_panels/StyleAxesPanel.js:354 @@ -61,7 +61,7 @@ Any Area // /default_panels/StyleTracesPanel.js:269 Arrow // /default_panels/StyleNotesPanel.js:30 Arrowhead // /default_panels/StyleNotesPanel.js:37 -Ascending // /default_panels/GraphTransformsPanel.js:88 +Ascending // /default_panels/GraphTransformsPanel.js:91 Asia // /default_panels/GraphSubplotsPanel.js:106 Aspect Ratio // /default_panels/GraphSubplotsPanel.js:42 Asymmetric // /components/fields/ErrorBars.js:79 @@ -70,12 +70,12 @@ Auto Auto margins // /default_panels/StyleAxesPanel.js:147 Average // /default_panels/GraphTransformsPanel.js:41 Average // /components/fields/derived.js:133 -Axes // /DefaultEditor.js:81 -Axes to Use // /components/fields/AxesCreator.js:146 -AxesSelector must be nested within a connectAxesToPlot component // /components/fields/AxesSelector.js:13 +Axes // /DefaultEditor.js:76 +Axes to Use // /components/fields/AxesCreator.js:147 +AxesSelector must be nested within a connectAxesToPlot component // /components/fields/AxesSelector.js:14 Axis Background // /default_panels/StyleAxesPanel.js:128 Axis Line // /default_panels/StyleAxesPanel.js:80 -Axis to Style // /components/fields/AxesSelector.js:44 +Axis to Style // /components/fields/AxesSelector.js:46 Azimuthal Equal Area // /default_panels/GraphSubplotsPanel.js:128 Azimuthal Equidistant // /default_panels/GraphSubplotsPanel.js:130 B // /components/fields/derived.js:552 @@ -90,7 +90,7 @@ Bar Padding Bar Position // /default_panels/StyleTracesPanel.js:212 Bar Size and Spacing // /default_panels/StyleTracesPanel.js:279 Bar Width // /default_panels/StyleTracesPanel.js:305 -Bars // /components/containers/TraceMarkerSection.js:19 +Bars // /components/containers/TraceMarkerSection.js:20 Base // /default_panels/StyleTracesPanel.js:213 Base Colors // /default_panels/StyleLayoutPanel.js:28 Basic // /default_panels/GraphSubplotsPanel.js:80 @@ -122,7 +122,7 @@ Boxes and Points Button // /components/containers/RangeSelectorAccordion.js:39 Button Labels // /default_panels/StyleUpdateMenusPanel.js:24 Buttons // /components/containers/UpdateMenuAccordion.js:23 -By // /default_panels/GraphTransformsPanel.js:79 +By // /default_panels/GraphTransformsPanel.js:82 By Type // /components/containers/TraceAccordion.js:167 C // /components/fields/derived.js:553 Call out your data. // /components/containers/AnnotationAccordion.js:51 @@ -132,38 +132,38 @@ Carpet Carpet Contour // /lib/computeTraceOptionsFromSchema.js:113 Carpet Scatter // /lib/computeTraceOptionsFromSchema.js:109 Categorical // /default_panels/StyleAxesPanel.js:50 -Cell Options // /default_panels/GraphCreatePanel.js:146 +Cell Options // /default_panels/GraphCreatePanel.js:151 Cells // /default_panels/StyleTracesPanel.js:168 Center // /default_panels/StyleAxesPanel.js:360 Center Latitude // /default_panels/GraphSubplotsPanel.js:91 Center Longitude // /default_panels/GraphSubplotsPanel.js:92 Center of Mass // /default_panels/StyleTracesPanel.js:76 Change // /default_panels/GraphTransformsPanel.js:50 -Charts like this by Plotly users. // /components/widgets/TraceTypeSelector.js:106 +Charts like this by Plotly users. // /components/widgets/TraceTypeSelector.js:232 Choropleth // /lib/computeTraceOptionsFromSchema.js:77 Click // /default_panels/StyleLayoutPanel.js:108 Click Event // /default_panels/StyleLayoutPanel.js:113 Click on the + button above to add a shape. // /components/containers/ShapeAccordion.js:62 Click on the + button above to add a trace. // /components/containers/TraceAccordion.js:128 -Click on the + button above to add a transform. // /components/containers/TransformAccordion.js:128 +Click on the + button above to add a transform. // /components/containers/TransformAccordion.js:137 Click on the + button above to add an annotation. // /components/containers/AnnotationAccordion.js:57 Click on the + button above to add an image. // /components/containers/ImageAccordion.js:62 Clockwise // /components/fields/derived.js:102 -Close // /default_panels/GraphCreatePanel.js:106 +Close // /default_panels/GraphCreatePanel.js:111 Closest // /components/fields/derived.js:661 Coastlines // /default_panels/GraphSubplotsPanel.js:163 -Collapse All // /components/containers/PanelHeader.js:35 +Collapse All // /components/containers/PanelHeader.js:49 Color // /components/fields/ErrorBars.js:103 -Color Bar // /components/fields/MarkerColor.js:188 +Color Bar // /components/fields/MarkerColor.js:190 Color Bar Container // /default_panels/StyleColorbarsPanel.js:277 -Color Bars // /DefaultEditor.js:84 +Color Bars // /DefaultEditor.js:78 Coloring // /default_panels/StyleTracesPanel.js:352 Colors // /default_panels/StyleTracesPanel.js:85 Colorscale // /default_panels/StyleTracesPanel.js:432 -Colorscale Direction // /components/fields/MarkerColor.js:183 -Colorscale Range // /components/fields/MarkerColor.js:193 -Column Options // /default_panels/GraphCreatePanel.js:152 -Columns // /default_panels/GraphCreatePanel.js:117 +Colorscale Direction // /components/fields/MarkerColor.js:185 +Colorscale Range // /components/fields/MarkerColor.js:195 +Column Options // /default_panels/GraphCreatePanel.js:157 +Columns // /default_panels/GraphCreatePanel.js:122 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // /lib/constants.js:24 Cone // /lib/computeTraceOptionsFromSchema.js:65 Cone Anchor // /default_panels/StyleTracesPanel.js:71 @@ -192,14 +192,14 @@ Count Count // /components/fields/derived.js:131 Counter Clockwise // /default_panels/StyleAxesPanel.js:73 Counterclockwise // /components/fields/derived.js:103 -Country Abbreviations (ISO-3) // /components/fields/LocationSelector.js:32 +Country Abbreviations (ISO-3) // /components/fields/LocationSelector.js:33 Country Borders // /default_panels/GraphSubplotsPanel.js:147 -Country Names // /components/fields/LocationSelector.js:31 +Country Names // /components/fields/LocationSelector.js:32 Crossbar Width // /components/fields/ErrorBars.js:105 Cube // /default_panels/GraphSubplotsPanel.js:47 Cumulative // /default_panels/StyleTracesPanel.js:125 Current Bin // /default_panels/StyleTracesPanel.js:140 -Custom // /components/fields/MarkerColor.js:195 +Custom // /components/fields/MarkerColor.js:197 Custom Data // /components/fields/ErrorBars.js:124 Dark // /default_panels/GraphSubplotsPanel.js:83 Data // /components/fields/ErrorBars.js:119 @@ -209,15 +209,15 @@ Decreasing Decreasing Trace Styles // /default_panels/StyleTracesPanel.js:555 Default // /components/fields/derived.js:145 Defaults // /default_panels/StyleLayoutPanel.js:25 -Degrees // /default_panels/GraphCreatePanel.js:129 +Degrees // /default_panels/GraphCreatePanel.js:134 Density // /default_panels/StyleTracesPanel.js:119 -Descending // /default_panels/GraphTransformsPanel.js:89 +Descending // /default_panels/GraphTransformsPanel.js:92 Diagonal // /default_panels/StyleLayoutPanel.js:103 Diameter // /default_panels/StyleTracesPanel.js:269 Diffuse // /default_panels/StyleTracesPanel.js:531 Direction // /default_panels/StyleAxesPanel.js:69 Disable // /components/fields/derived.js:664 -Disabled // /default_panels/GraphTransformsPanel.js:76 +Disabled // /default_panels/GraphTransformsPanel.js:79 Display // /default_panels/StyleTracesPanel.js:186 Distributions // /lib/traceTypes.js:21 Divergence // /components/fields/derived.js:574 @@ -225,16 +225,16 @@ Drag Drop the // /components/widgets/Dropzone.js:47 Dropdown // /components/containers/UpdateMenuAccordion.js:22 E+6 // /default_panels/StyleAxesPanel.js:185 -Each point in a trace is colored according to data. // /components/fields/MarkerColor.js:169 -Each trace will be colored according to the selected colorscale. // /components/fields/MarkerColor.js:109 -Each will be colored according to the selected colors. // /components/fields/MultiColorPicker.js:85 +Each point in a trace is colored according to data. // /components/fields/MarkerColor.js:171 +Each trace will be colored according to the selected colorscale. // /components/fields/MarkerColor.js:110 +Each will be colored according to the selected colors. // /components/fields/MultiColorPicker.js:86 Eckert 4 // /default_panels/GraphSubplotsPanel.js:127 Edit in HTML // /components/widgets/text_editors/MultiFormat.js:30 Edit in Rich Text // /components/widgets/text_editors/MultiFormat.js:225 Ellipse // /default_panels/StyleShapesPanel.js:29 Embed images in your figure to make the data more readable or to brand your content. // /components/containers/ImageAccordion.js:59 Enable // /default_panels/StyleAxesPanel.js:65 -Enabled // /default_panels/GraphTransformsPanel.js:76 +Enabled // /default_panels/GraphTransformsPanel.js:79 End Point // /default_panels/StyleShapesPanel.js:36 Enter LaTeX formatted text // /components/fields/TextEditor.js:36 Enter Link URL // /components/widgets/text_editors/RichText/LinkEditor.js:90 @@ -248,22 +248,22 @@ Error Bars Z Error Type // /components/fields/ErrorBars.js:113 Europe // /default_panels/GraphSubplotsPanel.js:105 Every label // /default_panels/StyleAxesPanel.js:222 -Exclude // /components/fields/FilterOperation.js:30 -Exclude Range // /components/fields/FilterOperation.js:79 -Exclude Values // /components/fields/FilterOperation.js:87 -Expand All // /components/containers/PanelHeader.js:40 +Exclude // /components/fields/FilterOperation.js:31 +Exclude Range // /components/fields/FilterOperation.js:80 +Exclude Values // /components/fields/FilterOperation.js:88 +Expand All // /components/containers/PanelHeader.js:54 Exponents // /default_panels/StyleAxesPanel.js:179 Extended Colors // /default_panels/StyleTracesPanel.js:87 Face Normal // /default_panels/StyleTracesPanel.js:536 -Facecolor // /default_panels/GraphCreatePanel.js:159 +Facecolor // /default_panels/GraphCreatePanel.js:164 False // /default_panels/StyleAxesPanel.js:149 File loaded! // /components/widgets/Dropzone.js:32 Fill // /default_panels/StyleImagesPanel.js:30 -Fill Color // /default_panels/GraphCreatePanel.js:141 +Fill Color // /default_panels/GraphCreatePanel.js:146 Fill to // /default_panels/StyleTracesPanel.js:443 Filled Area // /default_panels/StyleTracesPanel.js:442 Fills // /components/fields/derived.js:644 -Filter // /components/containers/TransformAccordion.js:21 +Filter // /components/containers/TransformAccordion.js:29 Finance // /lib/traceTypes.js:17 First // /default_panels/GraphTransformsPanel.js:48 First label // /default_panels/StyleAxesPanel.js:223 @@ -271,8 +271,8 @@ Fixed Width Fixed height // /default_panels/StyleLayoutPanel.js:73 Flatshading // /default_panels/StyleTracesPanel.js:197 Font // /default_panels/StyleSlidersPanel.js:30 -Font Color // /default_panels/GraphCreatePanel.js:142 -Font Size // /default_panels/GraphCreatePanel.js:143 +Font Color // /default_panels/GraphCreatePanel.js:147 +Font Size // /default_panels/GraphCreatePanel.js:148 Fraction // /default_panels/StyleTracesPanel.js:300 Fraction of Plot // /default_panels/StyleColorbarsPanel.js:71 Fraction of canvas // /default_panels/StyleSlidersPanel.js:41 @@ -282,12 +282,12 @@ Gap Between Groups Gaps // /default_panels/StyleTracesPanel.js:386 Gaps Between Cells // /default_panels/StyleTracesPanel.js:510 Gaps in Data // /default_panels/StyleTracesPanel.js:519 -General // /DefaultEditor.js:79 +General // /DefaultEditor.js:74 Geo // /lib/constants.js:101 Gnomonic // /default_panels/GraphSubplotsPanel.js:136 Go back // /components/widgets/text_editors/MultiFormat.js:186 Go to the // /components/containers/TraceRequiredPanel.js:27 -Gradians // /default_panels/GraphCreatePanel.js:130 +Gradians // /default_panels/GraphCreatePanel.js:135 Grid Lines // /default_panels/StyleAxesPanel.js:98 Grid Spacing // /default_panels/StyleAxesPanel.js:109 Group // /default_panels/StyleTracesPanel.js:57 @@ -296,20 +296,20 @@ Half Hammer // /default_panels/GraphSubplotsPanel.js:139 Hard // /default_panels/StyleTracesPanel.js:579 Header // /default_panels/StyleTracesPanel.js:150 -Header Options // /default_panels/GraphCreatePanel.js:140 -Headers // /default_panels/GraphCreatePanel.js:116 +Header Options // /default_panels/GraphCreatePanel.js:145 +Headers // /default_panels/GraphCreatePanel.js:121 Heads up! // /components/widgets/text_editors/MultiFormat.js:170 Heatmap // /default_panels/StyleTracesPanel.js:356 Heatmap GL // /lib/computeTraceOptionsFromSchema.js:89 Height // /default_panels/StyleAxesPanel.js:299 -Hide // /components/fields/MarkerColor.js:190 -High // /default_panels/GraphCreatePanel.js:104 +Hide // /components/fields/MarkerColor.js:192 +High // /default_panels/GraphCreatePanel.js:109 Histogram // /lib/computeTraceOptionsFromSchema.js:25 Histogram Function // /default_panels/StyleTracesPanel.js:112 Histogram Normalization // /default_panels/StyleTracesPanel.js:114 Hole // /default_panels/GraphSubplotsPanel.js:232 Hole Size // /default_panels/StyleTracesPanel.js:233 -Horizontal // /default_panels/GraphCreatePanel.js:71 +Horizontal // /default_panels/GraphCreatePanel.js:76 Horizontal Boundaries // /default_panels/StyleShapesPanel.js:33 Horizontal Gap // /default_panels/StyleTracesPanel.js:511 Horizontal Gaps // /default_panels/StyleTracesPanel.js:515 @@ -318,26 +318,26 @@ Hour Hover // /default_panels/StyleLayoutPanel.js:118 Hover Action // /default_panels/StyleTracesPanel.js:642 Hover on // /default_panels/StyleTracesPanel.js:643 -I (Optional) // /default_panels/GraphCreatePanel.js:100 +I (Optional) // /default_panels/GraphCreatePanel.js:105 Icon Color // /default_panels/StyleLayoutPanel.js:60 Image // /components/containers/ImageAccordion.js:22 -Images // /DefaultEditor.js:88 -Include // /components/fields/FilterOperation.js:29 -Include Range // /components/fields/FilterOperation.js:75 -Include Values // /components/fields/FilterOperation.js:83 +Images // /DefaultEditor.js:81 +Include // /components/fields/FilterOperation.js:30 +Include Range // /components/fields/FilterOperation.js:76 +Include Values // /components/fields/FilterOperation.js:84 Increasing // /default_panels/StyleTracesPanel.js:135 Increasing Trace Styles // /default_panels/StyleTracesPanel.js:543 Individually // /components/containers/TraceAccordion.js:166 -Inequality // /components/fields/FilterOperation.js:71 +Inequality // /components/fields/FilterOperation.js:72 Infer Zero // /default_panels/StyleTracesPanel.js:389 Inside // /components/fields/derived.js:492 -Intensity // /default_panels/GraphCreatePanel.js:158 +Intensity // /default_panels/GraphCreatePanel.js:163 Interactions // /default_panels/StyleLayoutPanel.js:81 Interpolate // /default_panels/StyleTracesPanel.js:390 Interpolate Gaps // /default_panels/StyleTracesPanel.js:524 -J (Optional) // /default_panels/GraphCreatePanel.js:101 +J (Optional) // /default_panels/GraphCreatePanel.js:106 Jitter // /default_panels/StyleTracesPanel.js:255 -K (Optional) // /default_panels/GraphCreatePanel.js:102 +K (Optional) // /default_panels/GraphCreatePanel.js:107 KDE // /components/fields/derived.js:637 Kavrayskiy 7 // /default_panels/GraphSubplotsPanel.js:126 LaTeX // /components/widgets/text_editors/MultiFormat.js:25 @@ -346,13 +346,13 @@ Label Label Format // /default_panels/StyleAxesPanel.js:168 Label Prefix // /default_panels/StyleColorbarsPanel.js:171 Label Suffix // /default_panels/StyleColorbarsPanel.js:197 -Labels // /default_panels/GraphCreatePanel.js:42 +Labels // /default_panels/GraphCreatePanel.js:47 Lakes // /default_panels/GraphSubplotsPanel.js:185 Land // /default_panels/GraphSubplotsPanel.js:178 Lasso // /default_panels/StyleLayoutPanel.js:90 Last // /default_panels/GraphTransformsPanel.js:49 Last label // /default_panels/StyleAxesPanel.js:224 -Lat/Lon // /components/fields/LocationSelector.js:99 +Lat/Lon // /components/fields/LocationSelector.js:103 Latitude // /components/fields/derived.js:545 Layout // /default_panels/StyleLayoutPanel.js:64 Left // /components/fields/derived.js:91 @@ -373,18 +373,18 @@ Lines Lines, Rectangles and Ellipses. // /components/containers/ShapeAccordion.js:56 Loading... // /components/widgets/Dropzone.js:111 Location // /components/fields/derived.js:540 -Location Format // /components/fields/LocationSelector.js:27 -Locations // /components/fields/LocationSelector.js:25 +Location Format // /components/fields/LocationSelector.js:28 +Locations // /components/fields/LocationSelector.js:26 Log // /default_panels/StyleAxesPanel.js:48 Logos, watermarks and more. // /components/containers/ImageAccordion.js:56 Longitude // /components/fields/derived.js:545 Looks like there aren't any traces defined yet. // /components/containers/TraceRequiredPanel.js:25 -Low // /default_panels/GraphCreatePanel.js:105 -Lower < Target < Upper // /components/fields/FilterOperation.js:19 -Lower < Target ≤ Upper // /components/fields/FilterOperation.js:21 -Lower Bound // /components/fields/FilterOperation.js:169 -Lower ≤ Target < Upper // /components/fields/FilterOperation.js:20 -Lower ≤ Target ≤ Upper // /components/fields/FilterOperation.js:18 +Low // /default_panels/GraphCreatePanel.js:110 +Lower < Target < Upper // /components/fields/FilterOperation.js:20 +Lower < Target ≤ Upper // /components/fields/FilterOperation.js:22 +Lower Bound // /components/fields/FilterOperation.js:171 +Lower ≤ Target < Upper // /components/fields/FilterOperation.js:21 +Lower ≤ Target ≤ Upper // /components/fields/FilterOperation.js:19 Manual // /default_panels/GraphSubplotsPanel.js:49 Map Frame // /default_panels/GraphSubplotsPanel.js:201 Map Options // /default_panels/GraphSubplotsPanel.js:210 @@ -395,7 +395,7 @@ Mapbox Mapbox Style // /default_panels/GraphSubplotsPanel.js:77 Maps // /lib/traceTypes.js:25 Margin Color // /default_panels/StyleLayoutPanel.js:27 -Max // /components/fields/MarkerColor.js:200 +Max // /components/fields/MarkerColor.js:202 Max Contour // /default_panels/StyleTracesPanel.js:381 Max Contours // /default_panels/StyleTracesPanel.js:377 Max Number of Labels // /default_panels/StyleAxesPanel.js:261 @@ -412,14 +412,14 @@ Meanline Meanline Color // /default_panels/StyleTracesPanel.js:621 Meanline Width // /default_panels/StyleTracesPanel.js:620 Median // /default_panels/GraphTransformsPanel.js:42 -Menus // /DefaultEditor.js:93 +Menus // /DefaultEditor.js:83 Mercator // /default_panels/GraphSubplotsPanel.js:119 Middle // /default_panels/StyleAxesPanel.js:374 Middle Center // /components/fields/derived.js:484 Middle Left // /components/fields/derived.js:483 Middle Right // /components/fields/derived.js:485 Miller // /default_panels/GraphSubplotsPanel.js:125 -Min // /components/fields/MarkerColor.js:199 +Min // /components/fields/MarkerColor.js:201 Min Contour // /default_panels/StyleTracesPanel.js:380 Minimum // /components/fields/derived.js:134 Minimum Size // /default_panels/StyleTracesPanel.js:271 @@ -429,7 +429,7 @@ Mode Modebar // /default_panels/StyleLayoutPanel.js:54 Mollweide // /default_panels/GraphSubplotsPanel.js:138 Month // /default_panels/StyleAxesPanel.js:323 -Multiple // /components/fields/MultiColorPicker.js:77 +Multiple // /components/fields/MultiColorPicker.js:78 Multiple Values // /lib/constants.js:18 Name // /default_panels/StyleTracesPanel.js:48 Natural Earth // /default_panels/GraphSubplotsPanel.js:121 @@ -439,29 +439,29 @@ No Results None // /components/fields/derived.js:59 None label // /default_panels/StyleColorbarsPanel.js:192 Norm // /components/fields/derived.js:573 -Normal // /components/fields/MarkerColor.js:185 +Normal // /components/fields/MarkerColor.js:187 Normalization // /default_panels/StyleTracesPanel.js:296 North America // /default_panels/GraphSubplotsPanel.js:108 Note Text // /default_panels/StyleNotesPanel.js:23 -Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:93 -Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:84 -Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:75 +Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:98 +Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:89 +Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:80 Number format // /default_panels/StyleLayoutPanel.js:33 Number of Contours // /default_panels/StyleTracesPanel.js:373 Number of Occurences // /default_panels/StyleTracesPanel.js:116 OHLC // /lib/computeTraceOptionsFromSchema.js:117 Oceans // /default_panels/GraphSubplotsPanel.js:171 -Off // /components/fields/RectanglePositioner.js:87 +Off // /components/fields/RectanglePositioner.js:88 Offset // /default_panels/StyleTracesPanel.js:214 -On // /components/fields/RectanglePositioner.js:87 +On // /components/fields/RectanglePositioner.js:88 On Hover // /default_panels/StyleTracesPanel.js:623 Opacity // /default_panels/StyleShapesPanel.js:51 -Open // /default_panels/GraphCreatePanel.js:103 -Operator // /default_panels/GraphTransformsPanel.js:82 -Options // /default_panels/GraphCreatePanel.js:157 +Open // /default_panels/GraphCreatePanel.js:108 +Operator // /default_panels/GraphTransformsPanel.js:85 +Options // /default_panels/GraphCreatePanel.js:162 Orbit // /default_panels/StyleLayoutPanel.js:91 -Order // /default_panels/GraphCreatePanel.js:154 -Orientation // /default_panels/GraphCreatePanel.js:69 +Order // /default_panels/GraphCreatePanel.js:159 +Orientation // /default_panels/GraphCreatePanel.js:74 Orthographic // /default_panels/GraphSubplotsPanel.js:120 Outdoors // /default_panels/GraphSubplotsPanel.js:81 Outliers // /default_panels/StyleTracesPanel.js:238 @@ -473,14 +473,14 @@ Parallel Coordinates Percent // /components/fields/derived.js:561 Pie // /components/containers/SubplotAccordion.js:133 Pie Colors // /default_panels/StyleTracesPanel.js:83 -Pie Segments // /components/containers/TraceMarkerSection.js:21 +Pie Segments // /components/containers/TraceMarkerSection.js:22 Pie Title // /default_panels/StyleTracesPanel.js:93 Pitch // /default_panels/GraphSubplotsPanel.js:95 Pixels // /default_panels/StyleColorbarsPanel.js:72 Plot Background // /default_panels/GraphSubplotsPanel.js:63 Point Cloud // /lib/computeTraceOptionsFromSchema.js:85 Point Opacity // /default_panels/StyleTracesPanel.js:258 -Points // /components/containers/TraceMarkerSection.js:23 +Points // /components/containers/TraceMarkerSection.js:24 Points and Fills // /components/fields/derived.js:645 Polar // /lib/constants.js:103 Polar Bar // /lib/computeTraceOptionsFromSchema.js:133 @@ -498,12 +498,12 @@ Projection Pull // /default_panels/StyleTracesPanel.js:234 R // /components/fields/derived.js:556 RMS // /default_panels/GraphTransformsPanel.js:44 -Radians // /default_panels/GraphCreatePanel.js:128 -Radius // /default_panels/GraphCreatePanel.js:123 +Radians // /default_panels/GraphCreatePanel.js:133 +Radius // /default_panels/GraphCreatePanel.js:128 Range // /default_panels/GraphTransformsPanel.js:51 Range Slider // /default_panels/StyleAxesPanel.js:294 Rectangle // /default_panels/StyleShapesPanel.js:28 -Reference // /components/fields/FilterOperation.js:167 +Reference // /components/fields/FilterOperation.js:169 Region // /default_panels/GraphSubplotsPanel.js:100 Relative // /default_panels/StyleTracesPanel.js:291 Relative To // /default_panels/StyleImagesPanel.js:54 @@ -511,7 +511,7 @@ Relative to Relative to Grid // /default_panels/StyleImagesPanel.js:36 Rendering // /components/fields/TraceSelector.js:140 Resolution // /default_panels/GraphSubplotsPanel.js:212 -Reversed // /components/fields/MarkerColor.js:185 +Reversed // /components/fields/MarkerColor.js:187 Reversed and Grouped // /default_panels/StyleLegendPanel.js:75 Rich Text // /components/widgets/text_editors/MultiFormat.js:20 Rich text is incompatible with LaTeX. // /components/widgets/text_editors/MultiFormat.js:111 @@ -534,17 +534,17 @@ Scatter Scatter GL // /lib/computeTraceOptionsFromSchema.js:81 Scene // /lib/constants.js:99 Second // /default_panels/StyleAxesPanel.js:327 -See a basic example. // /components/widgets/TraceTypeSelector.js:128 +See a basic example. // /components/widgets/TraceTypeSelector.js:256 Select // /default_panels/StyleLayoutPanel.js:88 Select Data Point // /default_panels/StyleLayoutPanel.js:114 Select Direction // /default_panels/StyleLayoutPanel.js:97 -Select Trace Type // /components/widgets/TraceTypeSelector.js:219 +Select Trace Type // /components/widgets/TraceTypeSelector.js:284 Select a Colorscale Type // /components/widgets/ColorscalePicker.js:55 Select an Option // /components/widgets/Dropdown.js:67 Separate Thousands // /default_panels/StyleAxesPanel.js:174 Shape // /components/containers/ShapeAccordion.js:23 -Shapes // /DefaultEditor.js:87 -Show // /components/fields/MarkerColor.js:190 +Shapes // /DefaultEditor.js:80 +Show // /components/fields/MarkerColor.js:192 Show All // /default_panels/StyleTracesPanel.js:237 Show Contour // /default_panels/StyleTracesPanel.js:632 Show Exponents // /default_panels/StyleAxesPanel.js:192 @@ -554,18 +554,18 @@ Show Suffix Show in Legend // /default_panels/StyleTracesPanel.js:52 Side // /default_panels/GraphSubplotsPanel.js:35 Simple // /components/fields/derived.js:151 -Single // /components/fields/MultiColorPicker.js:76 +Single // /components/fields/MultiColorPicker.js:77 Sinusoidal // /default_panels/GraphSubplotsPanel.js:142 Size // /default_panels/StyleColorbarsPanel.js:65 Size Mode // /default_panels/StyleTracesPanel.js:63 Size Scale // /default_panels/StyleTracesPanel.js:261 Size and Positioning // /default_panels/StyleColorbarsPanel.js:64 Slider // /components/containers/SliderAccordion.js:21 -Sliders // /DefaultEditor.js:90 +Sliders // /DefaultEditor.js:82 Smoothing // /default_panels/StyleTracesPanel.js:435 -Snap to Grid // /components/fields/RectanglePositioner.js:82 +Snap to Grid // /components/fields/RectanglePositioner.js:83 Soft // /default_panels/StyleTracesPanel.js:578 -Sort // /components/containers/TransformAccordion.js:24 +Sort // /components/containers/TransformAccordion.js:32 Sorted // /default_panels/StyleTracesPanel.js:222 South America // /default_panels/GraphSubplotsPanel.js:109 Span // /default_panels/StyleTracesPanel.js:584 @@ -573,7 +573,7 @@ Span Mode Specialized // /lib/traceTypes.js:29 Specular // /default_panels/StyleTracesPanel.js:532 Spike Lines // /default_panels/StyleAxesPanel.js:383 -Split // /components/containers/TransformAccordion.js:22 +Split // /components/containers/TransformAccordion.js:30 Split labels // /default_panels/StyleTracesPanel.js:626 Stack // /default_panels/GraphSubplotsPanel.js:70 Stacking // /default_panels/StyleTracesPanel.js:383 @@ -586,10 +586,10 @@ Stepmode Stereographic // /default_panels/GraphSubplotsPanel.js:137 Streamtube // /lib/computeTraceOptionsFromSchema.js:69 Stretch // /default_panels/StyleImagesPanel.js:31 -Structure // /DefaultEditor.js:74 +Structure // /DefaultEditor.js:69 Style // /default_panels/StyleAxesPanel.js:346 Sub-Country Unit Borders // /default_panels/GraphSubplotsPanel.js:155 -Subplots // /components/fields/AxesCreator.js:152 +Subplots // /components/fields/AxesCreator.js:153 Subplots to Use // /components/fields/SubplotCreator.js:122 Suffix // /default_panels/StyleAxesPanel.js:229 Sum // /default_panels/GraphSubplotsPanel.js:226 @@ -601,13 +601,13 @@ Symbol Symmetric // /components/fields/ErrorBars.js:78 Table // /components/containers/SubplotAccordion.js:134 Tail // /default_panels/StyleTracesPanel.js:74 -Target // /default_panels/GraphTransformsPanel.js:81 -Target < Reference // /components/fields/FilterOperation.js:11 -Target = Reference // /components/fields/FilterOperation.js:13 -Target > Reference // /components/fields/FilterOperation.js:14 -Target ≠ Reference // /components/fields/FilterOperation.js:10 -Target ≤ Reference // /components/fields/FilterOperation.js:12 -Target ≥ Reference // /components/fields/FilterOperation.js:15 +Target // /default_panels/GraphTransformsPanel.js:84 +Target < Reference // /components/fields/FilterOperation.js:12 +Target = Reference // /components/fields/FilterOperation.js:14 +Target > Reference // /components/fields/FilterOperation.js:15 +Target ≠ Reference // /components/fields/FilterOperation.js:11 +Target ≤ Reference // /components/fields/FilterOperation.js:13 +Target ≥ Reference // /components/fields/FilterOperation.js:16 Ternary // /default_panels/GraphSubplotsPanel.js:225 Ternary Scatter // /lib/computeTraceOptionsFromSchema.js:45 Text // /components/fields/derived.js:513 @@ -615,10 +615,10 @@ Text Alignment Text Attributes // /default_panels/StyleTracesPanel.js:446 Text Position // /default_panels/StyleTracesPanel.js:467 Theta // /components/fields/derived.js:556 -Theta Unit // /default_panels/GraphCreatePanel.js:126 +Theta Unit // /default_panels/GraphCreatePanel.js:131 Thickness // /components/fields/ErrorBars.js:104 This input has multiple values associated with it. Changing this setting will override these custom inputs. // /lib/constants.js:20 -This panel could not be displayed due to an error. // /components/containers/PlotlyPanel.js:16 +This panel could not be displayed due to an error. // /components/containers/PlotlyPanel.js:17 Tick Labels // /default_panels/StyleAxesPanel.js:137 Tick Markers // /default_panels/StyleAxesPanel.js:265 Tick Spacing // /default_panels/StyleAxesPanel.js:254 @@ -644,36 +644,36 @@ Trace name Trace your data. // /components/containers/TraceAccordion.js:119 Traces // /components/containers/TraceRequiredPanel.js:28 Traces of various types like bar and line are the building blocks of your figure. // /components/containers/TraceAccordion.js:121 -Transform // /components/containers/TransformAccordion.js:66 -Transforms // /DefaultEditor.js:77 -Transpose // /default_panels/GraphCreatePanel.js:162 +Transform // /components/containers/TransformAccordion.js:75 +Transforms // /DefaultEditor.js:72 +Transpose // /default_panels/GraphCreatePanel.js:167 Transverse Mercator // /default_panels/GraphSubplotsPanel.js:140 True // /default_panels/StyleAxesPanel.js:149 Try again with a // /components/widgets/Dropzone.js:130 Try again with a supported file format: // /components/widgets/Dropzone.js:74 Turntable // /default_panels/StyleLayoutPanel.js:92 -Type // /default_panels/GraphCreatePanel.js:37 +Type // /default_panels/GraphCreatePanel.js:43 Typeface // /default_panels/StyleAxesPanel.js:35 U // /components/fields/derived.js:570 URL // /components/widgets/text_editors/RichText/LinkEditor.js:91 USA // /default_panels/GraphSubplotsPanel.js:104 -USA State Abbreviations (e.g. NY) // /components/fields/LocationSelector.js:34 +USA State Abbreviations (e.g. NY) // /components/fields/LocationSelector.js:35 Unsorted // /default_panels/StyleTracesPanel.js:222 -Upper Bound // /components/fields/FilterOperation.js:187 +Upper Bound // /components/fields/FilterOperation.js:189 V // /components/fields/derived.js:571 Value // /components/fields/derived.js:508 Value (-) // /components/fields/ErrorBars.js:144 Values // /components/fields/derived.js:540 Values Shown On Hover // /default_panels/StyleTracesPanel.js:624 -Variable // /components/fields/MarkerColor.js:156 +Variable // /components/fields/MarkerColor.js:158 Vertex Normal // /default_panels/StyleTracesPanel.js:535 -Vertexcolor // /default_panels/GraphCreatePanel.js:160 -Vertical // /default_panels/GraphCreatePanel.js:71 +Vertexcolor // /default_panels/GraphCreatePanel.js:165 +Vertical // /default_panels/GraphCreatePanel.js:76 Vertical Boundaries // /default_panels/StyleShapesPanel.js:39 Vertical Gap // /default_panels/StyleTracesPanel.js:512 Vertical Gaps // /default_panels/StyleTracesPanel.js:516 Vertical Positioning // /default_panels/StyleAxesPanel.js:366 -View tutorials on this chart type. // /components/widgets/TraceTypeSelector.js:120 +View tutorials on this chart type. // /components/widgets/TraceTypeSelector.js:248 Violin // /lib/computeTraceOptionsFromSchema.js:49 Violin Mode // /default_panels/StyleTracesPanel.js:326 Violin Padding // /default_panels/StyleTracesPanel.js:334 @@ -685,9 +685,9 @@ Violins, Points and KDE Visible Sides // /default_panels/StyleTracesPanel.js:587 W // /components/fields/derived.js:572 WebGL // /components/fields/TraceSelector.js:101 -Well this is embarrassing. // /components/containers/PlotlyPanel.js:15 +Well this is embarrassing. // /components/containers/PlotlyPanel.js:16 Whisker Width // /default_panels/StyleTracesPanel.js:338 -Width // /default_panels/GraphCreatePanel.js:153 +Width // /default_panels/GraphCreatePanel.js:158 Winkel Tripel // /default_panels/GraphSubplotsPanel.js:123 World // /default_panels/GraphSubplotsPanel.js:103 X // /components/fields/derived.js:523 @@ -699,9 +699,9 @@ X Bin Size X Bin Start // /default_panels/StyleTracesPanel.js:202 X Offset // /default_panels/StyleNotesPanel.js:39 X Overlay // /default_panels/GraphSubplotsPanel.js:26 -X Values // /default_panels/GraphCreatePanel.js:46 +X Values // /default_panels/GraphCreatePanel.js:51 X Vector // /default_panels/StyleNotesPanel.js:41 -X start // /default_panels/GraphCreatePanel.js:113 +X start // /default_panels/GraphCreatePanel.js:118 Y // /components/fields/derived.js:523 Y = 0 // /components/fields/derived.js:594 Y Anchor // /default_panels/GraphSubplotsPanel.js:37 @@ -711,21 +711,21 @@ Y Bin Size Y Bin Start // /default_panels/StyleTracesPanel.js:207 Y Offset // /default_panels/StyleNotesPanel.js:40 Y Overlay // /default_panels/GraphSubplotsPanel.js:27 -Y Values // /default_panels/GraphCreatePanel.js:54 +Y Values // /default_panels/GraphCreatePanel.js:59 Y Vector // /default_panels/StyleNotesPanel.js:42 -Y start // /default_panels/GraphCreatePanel.js:114 +Y start // /default_panels/GraphCreatePanel.js:119 Year // /default_panels/StyleAxesPanel.js:322 Yes // /components/fields/ErrorBars.js:96 Yikes! An error occurred while parsing this file. // /components/widgets/Dropzone.js:73 Yikes! This doesn't look like a valid // /components/widgets/Dropzone.js:128 Yikes! You can only upload one file at a time. // /components/widgets/Dropzone.js:102 You can add as many as you like, mixing and matching types and arranging them into subplots. // /components/containers/TraceAccordion.js:125 -You can style and position your axes in the // /components/fields/AxesCreator.js:151 +You can style and position your axes in the // /components/fields/AxesCreator.js:152 You can style and position your subplots in the // /components/fields/SubplotCreator.js:132 You need to provide a component for the modal to open! // /components/containers/ModalProvider.js:34 Z // /components/fields/derived.js:538 -Z Values // /default_panels/GraphCreatePanel.js:63 -Z start // /default_panels/GraphCreatePanel.js:115 +Z Values // /default_panels/GraphCreatePanel.js:68 +Z start // /default_panels/GraphCreatePanel.js:120 Zero Line // /default_panels/StyleAxesPanel.js:119 Zoom // /default_panels/StyleLayoutPanel.js:87 Zoom Interactivity // /default_panels/StyleAxesPanel.js:62 diff --git a/src/EditorControls.js b/src/EditorControls.js index 3d3fd321f..cdd942bf2 100644 --- a/src/EditorControls.js +++ b/src/EditorControls.js @@ -325,10 +325,6 @@ class EditorControls extends Component { this.props.graphDiv._fullLayout && (this.props.children ? ( recursiveMap(this.props.children, this.provideValue()) - ) : this.props.optionalPanel ? ( - - {this.props.optionalPanel} - ) : ( ))} @@ -377,8 +373,6 @@ EditorControls.propTypes = { mapBoxAccess: PropTypes.bool, fontOptions: PropTypes.array, chartHelp: PropTypes.object, - optionalPanel: PropTypes.node, - menuPanelOrder: PropTypes.array, updatePayload: PropTypes.array, }; From b5081211039417e6277bbdaf586a7e65daab5834 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Wed, 21 Nov 2018 21:20:12 +0900 Subject: [PATCH 38/69] remove unnecessary requireContext --- src/default_panels/GraphCreatePanel.js | 6 ----- src/default_panels/GraphTransformsPanel.js | 4 ++- src/lib/connectAggregationToTransform.js | 3 ++- src/lib/connectAnnotationToLayout.js | 9 ++++--- src/lib/connectAxesToLayout.js | 26 ++++++++++++------- src/lib/connectCartesianSubplotToLayout.js | 24 ++++++++--------- src/lib/connectImageToLayout.js | 9 ++++--- src/lib/connectNonCartesianSubplotToLayout.js | 26 +++++++++---------- src/lib/connectRangeSelectorToAxis.js | 9 ++++--- src/lib/connectShapeToLayout.js | 8 +++--- src/lib/connectSliderToLayout.js | 4 ++- src/lib/connectTransformToTrace.js | 8 +++--- src/lib/connectUpdateMenuToLayout.js | 4 ++- 13 files changed, 77 insertions(+), 63 deletions(-) diff --git a/src/default_panels/GraphCreatePanel.js b/src/default_panels/GraphCreatePanel.js index 160c5f827..ff122a4a3 100644 --- a/src/default_panels/GraphCreatePanel.js +++ b/src/default_panels/GraphCreatePanel.js @@ -18,12 +18,6 @@ import { Histogram2d, } from '../components/fields/derived'; import {EditorControlsContext, ModalProviderContext} from '../context'; -// import {combineContext} from '../lib/mixContext'; -// -// const {Provide, Subscribe} = combineContext({ -// editor: , -// modal: , -// }); const GraphCreatePanel = () => { return ( diff --git a/src/default_panels/GraphTransformsPanel.js b/src/default_panels/GraphTransformsPanel.js index 50bf373a0..3801a0382 100644 --- a/src/default_panels/GraphTransformsPanel.js +++ b/src/default_panels/GraphTransformsPanel.js @@ -22,12 +22,13 @@ export class Aggregations extends Component { fullContainer: {aggregations = []}, } = this.props.context; const {localize: _} = this.context; + if (aggregations.length === 0) { return null; } return ( - + {aggregations .filter(aggr => aggr.target && aggr.target.match(/transforms\[\d*\]\./gi) === null) .map(({target}, i) => ( @@ -51,6 +52,7 @@ export class Aggregations extends Component { {label: _('Range'), value: 'range'}, ]} clearable={false} + context={this.props.context} /> ))} diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index a17f8ef7c..331beeeeb 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -17,7 +17,8 @@ export default function connectAggregationToTransform(WrappedComponent) { } setLocals(props) { - const {aggregationIndex, container, fullContainer} = props; + const {container, fullContainer} = props.context; + const {aggregationIndex} = props; const aggregations = (container && container.aggregations) || []; const fullAggregations = fullContainer.aggregations || []; diff --git a/src/lib/connectAnnotationToLayout.js b/src/lib/connectAnnotationToLayout.js index 98c50fc57..e51af975e 100644 --- a/src/lib/connectAnnotationToLayout.js +++ b/src/lib/connectAnnotationToLayout.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectAnnotationToLayout(WrappedComponent) { class AnnotationConnectedComponent extends Component { @@ -53,8 +54,8 @@ export default function connectAnnotationToLayout(WrappedComponent) { } deleteAnnotation() { - if (this.props.context.onUpdate) { - this.props.context.onUpdate({ + if (this.context.onUpdate) { + this.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_ANNOTATION, payload: {annotationIndex: this.props.annotationIndex}, }); @@ -82,11 +83,11 @@ export default function connectAnnotationToLayout(WrappedComponent) { annotationIndex: PropTypes.number.isRequired, }; + AnnotationConnectedComponent.contextType = EditorControlsContext; + AnnotationConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - data: PropTypes.array, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index f62a66da5..28c155942 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -4,6 +4,7 @@ import nestedProperty from 'plotly.js/src/lib/nested_property'; import {deepCopyPublic, setMultiValuedContainer} from './multiValues'; import {capitalize, getAllAxes, getDisplayName, getAxisTitle} from '../lib'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; function computeAxesOptions(axes, props, context) { const _ = context.localize; @@ -34,12 +35,15 @@ function computeAxesOptions(axes, props, context) { export default function connectAxesToLayout(WrappedComponent) { class AxesConnectedComponent extends Component { - constructor(props) { + constructor(props, context) { super(props); - const {context, ...newProps} = props; - this.axes = getAllAxes(context.fullContainer); - this.axesOptions = computeAxesOptions(this.axes, newProps, context); + const {context: propContext, ...newProps} = props; + this.axes = getAllAxes(propContext.fullContainer); + this.axesOptions = computeAxesOptions(this.axes, newProps, { + ...propContext, + localize: context.localize, + }); // this.axesOptions can be an empty array when we have a filter on an AxesFold // and no axes correspond to the condition @@ -58,15 +62,18 @@ export default function connectAxesToLayout(WrappedComponent) { this.axesTargetHandler = this.axesTargetHandler.bind(this); this.updateContainer = this.updateContainer.bind(this); - this.setLocals(newProps, this.state, context); + this.setLocals(newProps, this.state, propContext); } componentWillUpdate(nextProps, nextState) { - const {context: nextContext, ...newProps} = nextProps; - this.axes = getAllAxes(nextContext.fullContainer); - this.axesOptions = computeAxesOptions(this.axes, nextProps, nextContext); + const {context: propContext, ...newProps} = nextProps; + this.axes = getAllAxes(propContext.fullContainer); + this.axesOptions = computeAxesOptions(this.axes, nextProps, { + ...propContext, + localize: this.context.localize, + }); // This is not enough, what if plotly.js adds new axes... - this.setLocals(newProps, nextState, nextContext); + this.setLocals(newProps, nextState, propContext); } setLocals(nextProps, nextState, nextContext) { @@ -153,6 +160,7 @@ export default function connectAxesToLayout(WrappedComponent) { } AxesConnectedComponent.displayName = `AxesConnected${getDisplayName(WrappedComponent)}`; + AxesConnectedComponent.contextType = EditorControlsContext; AxesConnectedComponent.requireContext = { container: PropTypes.object.isRequired, diff --git a/src/lib/connectCartesianSubplotToLayout.js b/src/lib/connectCartesianSubplotToLayout.js index 421c923b0..b0b30db4a 100644 --- a/src/lib/connectCartesianSubplotToLayout.js +++ b/src/lib/connectCartesianSubplotToLayout.js @@ -2,24 +2,26 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { - constructor(props) { - super(props); + constructor(props, context) { + super(props, context); this.updateSubplot = this.updateSubplot.bind(this); - this.setLocals(props); + this.setLocals(props, context); } componentWillReceiveProps(nextProps) { - this.setLocals(nextProps); + this.setLocals(nextProps, this.context); } - setLocals(props) { - const {context, ...newProps} = props; + setLocals(props, context) { + const {context: propContext, ...newProps} = props; const {xaxis, yaxis, traceIndexes} = newProps; - const {container, fullContainer, data} = context; + const {data} = context; + const {container, fullContainer} = propContext; this.container = { xaxis: container[xaxis], @@ -51,7 +53,7 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { deleteContainer: this.deleteSubplot, container: this.container, fullContainer: this.fullContainer, - fullLayout: this.props.context.fullLayout, + fullLayout: this.context.fullLayout, }; } @@ -84,13 +86,11 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { yaxis: PropTypes.string.isRequired, }; + SubplotConnectedComponent.contextType = EditorControlsContext; + SubplotConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - data: PropTypes.array, - fullData: PropTypes.array, - fullLayout: PropTypes.object, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; diff --git a/src/lib/connectImageToLayout.js b/src/lib/connectImageToLayout.js index 0a586471e..c0124619e 100644 --- a/src/lib/connectImageToLayout.js +++ b/src/lib/connectImageToLayout.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectImageToLayout(WrappedComponent) { class ImageConnectedComponent extends Component { @@ -52,8 +53,8 @@ export default function connectImageToLayout(WrappedComponent) { } deleteImage() { - if (this.props.context.onUpdate) { - this.props.context.onUpdate({ + if (this.context.onUpdate) { + this.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_IMAGE, payload: {imageIndex: this.props.imageIndex}, }); @@ -79,11 +80,11 @@ export default function connectImageToLayout(WrappedComponent) { imageIndex: PropTypes.number.isRequired, }; + ImageConnectedComponent.contextType = EditorControlsContext; + ImageConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - data: PropTypes.array, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; diff --git a/src/lib/connectNonCartesianSubplotToLayout.js b/src/lib/connectNonCartesianSubplotToLayout.js index 6e377dea6..34f5eb892 100644 --- a/src/lib/connectNonCartesianSubplotToLayout.js +++ b/src/lib/connectNonCartesianSubplotToLayout.js @@ -2,29 +2,31 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName, plotlyTraceToCustomTrace, renderTraceIcon, getFullTrace} from '../lib'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectNonCartesianSubplotToLayout(WrappedComponent) { class SubplotConnectedComponent extends Component { - constructor(props) { - super(props); + constructor(props, context) { + super(props, context); this.updateSubplot = this.updateSubplot.bind(this); - this.setLocals(props); + this.setLocals(props, context); } componentWillReceiveProps(nextProps) { - this.setLocals(nextProps); + this.setLocals(nextProps, this.context); } - setLocals(props) { - const {subplot, traceIndexes, context} = props; - const {container, fullContainer, data} = context; + setLocals(props, context) { + const {subplot, traceIndexes, context: propContext} = props; + const {data, fullData} = context; + const {container, fullContainer} = propContext; this.container = container[subplot] || {}; this.fullContainer = fullContainer[subplot] || {}; const trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {}; - const fullTrace = getFullTrace(props, context); + const fullTrace = getFullTrace(props, {...propContext, data, fullData}); if (trace && fullTrace) { this.icon = renderTraceIcon(plotlyTraceToCustomTrace(trace)); @@ -41,7 +43,7 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { updateContainer: this.updateSubplot, container: this.container, fullContainer: this.fullContainer, - fullLayout: this.props.context.fullLayout, + fullLayout: this.context.fullLayout, }; } @@ -72,13 +74,11 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { subplot: PropTypes.string.isRequired, }; + SubplotConnectedComponent.contextType = EditorControlsContext; + SubplotConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - fullLayout: PropTypes.object, - data: PropTypes.array, - fullData: PropTypes.array, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; diff --git a/src/lib/connectRangeSelectorToAxis.js b/src/lib/connectRangeSelectorToAxis.js index eab6607ba..2a12d7e92 100644 --- a/src/lib/connectRangeSelectorToAxis.js +++ b/src/lib/connectRangeSelectorToAxis.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectRangeSelectorToAxis(WrappedComponent) { class RangeSelectorConnectedComponent extends Component { @@ -54,8 +55,8 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { } deleteRangeselector() { - if (this.props.context.onUpdate) { - this.props.context.onUpdate({ + if (this.context.onUpdate) { + this.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_RANGESELECTOR, payload: { axisId: this.props.context.fullContainer._name, @@ -86,11 +87,11 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { rangeselectorIndex: PropTypes.number.isRequired, }; + RangeSelectorConnectedComponent.contextType = EditorControlsContext; + RangeSelectorConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - data: PropTypes.array, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; diff --git a/src/lib/connectShapeToLayout.js b/src/lib/connectShapeToLayout.js index 5bfc68085..2580dd88c 100644 --- a/src/lib/connectShapeToLayout.js +++ b/src/lib/connectShapeToLayout.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectShapeToLayout(WrappedComponent) { class ShapeConnectedComponent extends Component { @@ -52,8 +53,8 @@ export default function connectShapeToLayout(WrappedComponent) { } deleteShape() { - if (this.props.context.onUpdate) { - this.props.context.onUpdate({ + if (this.context.onUpdate) { + this.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_SHAPE, payload: {shapeIndex: this.props.shapeIndex}, }); @@ -78,11 +79,10 @@ export default function connectShapeToLayout(WrappedComponent) { ShapeConnectedComponent.propTypes = { shapeIndex: PropTypes.number.isRequired, }; + ShapeConnectedComponent.contextType = EditorControlsContext; ShapeConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - data: PropTypes.array, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; diff --git a/src/lib/connectSliderToLayout.js b/src/lib/connectSliderToLayout.js index 57f5f71e5..ffbc20da4 100644 --- a/src/lib/connectSliderToLayout.js +++ b/src/lib/connectSliderToLayout.js @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectSliderToLayout(WrappedComponent) { class SliderConnectedComponent extends Component { @@ -66,10 +67,11 @@ export default function connectSliderToLayout(WrappedComponent) { sliderIndex: PropTypes.number.isRequired, }; + SliderConnectedComponent.contextType = EditorControlsContext; + SliderConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; diff --git a/src/lib/connectTransformToTrace.js b/src/lib/connectTransformToTrace.js index 7fe87489c..b3c10b818 100644 --- a/src/lib/connectTransformToTrace.js +++ b/src/lib/connectTransformToTrace.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; import {recursiveMap} from './recursiveMap'; +import {EditorControlsContext} from '../context'; export default function connectTransformToTrace(WrappedComponent) { class TransformConnectedComponent extends Component { @@ -52,8 +53,8 @@ export default function connectTransformToTrace(WrappedComponent) { } deleteTransform() { - if (this.props.context.onUpdate) { - this.props.context.onUpdate({ + if (this.context.onUpdate) { + this.context.onUpdate({ type: EDITOR_ACTIONS.DELETE_TRANSFORM, payload: { traceIndex: this.props.context.fullContainer.index, @@ -82,10 +83,11 @@ export default function connectTransformToTrace(WrappedComponent) { transformIndex: PropTypes.number.isRequired, }; + TransformConnectedComponent.contextType = EditorControlsContext; + TransformConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - data: PropTypes.array, onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, diff --git a/src/lib/connectUpdateMenuToLayout.js b/src/lib/connectUpdateMenuToLayout.js index f9a587cac..8c0b341c3 100644 --- a/src/lib/connectUpdateMenuToLayout.js +++ b/src/lib/connectUpdateMenuToLayout.js @@ -1,6 +1,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {getDisplayName} from '../lib'; +import {EditorControlsContext} from '../context'; export default function connectUpdateMenuToLayout(WrappedComponent) { class UpdateMenuConnectedComponent extends Component { @@ -59,10 +60,11 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { updateMenuIndex: PropTypes.number.isRequired, }; + UpdateMenuConnectedComponent.contextType = EditorControlsContext; + UpdateMenuConnectedComponent.requireContext = { container: PropTypes.object, fullContainer: PropTypes.object, - onUpdate: PropTypes.func, updateContainer: PropTypes.func, getValObject: PropTypes.func, }; From 805ef946e8ef6bd82cf7049570030c4ee1a56c40 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 22 Nov 2018 16:00:42 +0900 Subject: [PATCH 39/69] fix prop-types error --- .../combined-translation-keys.txt | 124 +++++++++--------- scripts/translationKeys/translation-keys.txt | 124 +++++++++--------- src/components/containers/AxesFold.js | 2 +- src/components/containers/PanelHeader.js | 2 +- src/components/containers/PlotlyFold.js | 10 +- src/components/containers/PlotlyPanel.js | 2 +- src/components/containers/PlotlySection.js | 2 +- .../containers/TransformAccordion.js | 2 +- src/components/containers/derived.js | 1 + src/components/fields/AxesCreator.js | 4 +- src/components/fields/AxesSelector.js | 2 +- src/components/fields/DualNumeric.js | 2 +- src/components/fields/Field.js | 2 +- src/components/fields/FilterOperation.js | 2 +- src/components/fields/VisibilitySelect.js | 2 +- src/default_panels/GraphTransformsPanel.js | 2 +- src/lib/connectAggregationToTransform.js | 5 + src/lib/connectAnnotationToLayout.js | 5 + src/lib/connectAxesToLayout.js | 6 +- src/lib/connectCartesianSubplotToLayout.js | 12 +- src/lib/connectImageToLayout.js | 10 +- src/lib/connectLayoutToPlot.js | 12 +- src/lib/connectNonCartesianSubplotToLayout.js | 10 +- src/lib/connectRangeSelectorToAxis.js | 10 +- src/lib/connectShapeToLayout.js | 9 +- src/lib/connectSliderToLayout.js | 9 +- src/lib/connectToContainer.js | 4 + src/lib/connectTraceToPlot.js | 1 + src/lib/connectTransformToTrace.js | 10 +- src/lib/connectUpdateMenuToLayout.js | 10 +- 30 files changed, 218 insertions(+), 180 deletions(-) diff --git a/scripts/translationKeys/combined-translation-keys.txt b/scripts/translationKeys/combined-translation-keys.txt index f1e062207..a8eda3018 100644 --- a/scripts/translationKeys/combined-translation-keys.txt +++ b/scripts/translationKeys/combined-translation-keys.txt @@ -29,7 +29,7 @@ Advanced (d3-format) Advanced (d3-time-format) // react-chart-editor: /components/fields/derived.js:146 Africa // react-chart-editor: /default_panels/GraphSubplotsPanel.js:107 Aggregate // react-chart-editor: /components/containers/TransformAccordion.js:31 -Aggregations // react-chart-editor: /default_panels/GraphTransformsPanel.js:30 +Aggregations // react-chart-editor: /default_panels/GraphTransformsPanel.js:31 Aitoff // react-chart-editor: /default_panels/GraphSubplotsPanel.js:141 Albers USA // react-chart-editor: /default_panels/GraphSubplotsPanel.js:122 All // react-chart-editor: /default_panels/StyleAxesPanel.js:196 @@ -49,7 +49,7 @@ Any Area // react-chart-editor: /default_panels/StyleTracesPanel.js:269 Arrow // react-chart-editor: /default_panels/StyleNotesPanel.js:30 Arrowhead // react-chart-editor: /default_panels/StyleNotesPanel.js:37 -Ascending // react-chart-editor: /default_panels/GraphTransformsPanel.js:91 +Ascending // react-chart-editor: /default_panels/GraphTransformsPanel.js:93 Asia // react-chart-editor: /default_panels/GraphSubplotsPanel.js:106 Aspect Ratio // react-chart-editor: /default_panels/GraphSubplotsPanel.js:42 Asymmetric // react-chart-editor: /components/fields/ErrorBars.js:79 @@ -57,7 +57,7 @@ Atlas Map Auto // react-chart-editor: /components/fields/derived.js:494 Auto margins // react-chart-editor: /default_panels/StyleAxesPanel.js:147 Autoscale // plotly.js: components/modebar/buttons.js:150 -Average // react-chart-editor: /default_panels/GraphTransformsPanel.js:41 && react-chart-editor: /components/fields/derived.js:133 +Average // react-chart-editor: /default_panels/GraphTransformsPanel.js:42 && react-chart-editor: /components/fields/derived.js:133 Axes // react-chart-editor: /DefaultEditor.js:76 Axes to Use // react-chart-editor: /components/fields/AxesCreator.js:147 AxesSelector must be nested within a connectAxesToPlot component // react-chart-editor: /components/fields/AxesSelector.js:14 @@ -112,7 +112,7 @@ Boxes and Points Button // react-chart-editor: /components/containers/RangeSelectorAccordion.js:39 Button Labels // react-chart-editor: /default_panels/StyleUpdateMenusPanel.js:24 Buttons // react-chart-editor: /components/containers/UpdateMenuAccordion.js:23 -By // react-chart-editor: /default_panels/GraphTransformsPanel.js:82 +By // react-chart-editor: /default_panels/GraphTransformsPanel.js:84 By Type // react-chart-editor: /components/containers/TraceAccordion.js:167 C // react-chart-editor: /components/fields/derived.js:553 Call out your data. // react-chart-editor: /components/containers/AnnotationAccordion.js:51 @@ -122,13 +122,13 @@ Carpet Carpet Contour // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:113 Carpet Scatter // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:109 Categorical // react-chart-editor: /default_panels/StyleAxesPanel.js:50 -Cell Options // react-chart-editor: /default_panels/GraphCreatePanel.js:151 +Cell Options // react-chart-editor: /default_panels/GraphCreatePanel.js:145 Cells // react-chart-editor: /default_panels/StyleTracesPanel.js:168 Center // react-chart-editor: /default_panels/StyleAxesPanel.js:360 Center Latitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:91 Center Longitude // react-chart-editor: /default_panels/GraphSubplotsPanel.js:92 Center of Mass // react-chart-editor: /default_panels/StyleTracesPanel.js:76 -Change // react-chart-editor: /default_panels/GraphTransformsPanel.js:50 +Change // react-chart-editor: /default_panels/GraphTransformsPanel.js:51 Charts like this by Plotly users. // react-chart-editor: /components/widgets/TraceTypeSelector.js:232 Choropleth // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:77 Click // react-chart-editor: /default_panels/StyleLayoutPanel.js:108 @@ -147,7 +147,7 @@ Click to enter X axis title Click to enter Y axis title // plotly.js: plots/plots.js:328 Click to enter radial axis title // plotly.js: plots/polar/polar.js:483 Clockwise // react-chart-editor: /components/fields/derived.js:102 -Close // react-chart-editor: /default_panels/GraphCreatePanel.js:111 +Close // react-chart-editor: /default_panels/GraphCreatePanel.js:105 Closest // react-chart-editor: /components/fields/derived.js:661 Coastlines // react-chart-editor: /default_panels/GraphSubplotsPanel.js:163 Collapse All // react-chart-editor: /components/containers/PanelHeader.js:49 @@ -160,8 +160,8 @@ Colors Colorscale // react-chart-editor: /default_panels/StyleTracesPanel.js:432 Colorscale Direction // react-chart-editor: /components/fields/MarkerColor.js:185 Colorscale Range // react-chart-editor: /components/fields/MarkerColor.js:195 -Column Options // react-chart-editor: /default_panels/GraphCreatePanel.js:157 -Columns // react-chart-editor: /default_panels/GraphCreatePanel.js:122 +Column Options // react-chart-editor: /default_panels/GraphCreatePanel.js:151 +Columns // react-chart-editor: /default_panels/GraphCreatePanel.js:116 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // react-chart-editor: /lib/constants.js:24 Compare data on hover // plotly.js: components/modebar/buttons.js:178 Cone // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:65 @@ -187,7 +187,7 @@ Contour Width Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:342 Copy Y Style // react-chart-editor: /components/fields/ErrorBars.js:94 Copy Z Style // react-chart-editor: /components/fields/ErrorBars.js:99 -Count // react-chart-editor: /default_panels/GraphTransformsPanel.js:39 && react-chart-editor: /components/fields/derived.js:131 +Count // react-chart-editor: /default_panels/GraphTransformsPanel.js:40 && react-chart-editor: /components/fields/derived.js:131 Counter Clockwise // react-chart-editor: /default_panels/StyleAxesPanel.js:73 Counterclockwise // react-chart-editor: /components/fields/derived.js:103 Country Abbreviations (ISO-3) // react-chart-editor: /components/fields/LocationSelector.js:33 @@ -207,15 +207,15 @@ Decreasing Decreasing Trace Styles // react-chart-editor: /default_panels/StyleTracesPanel.js:555 Default // react-chart-editor: /components/fields/derived.js:145 Defaults // react-chart-editor: /default_panels/StyleLayoutPanel.js:25 -Degrees // react-chart-editor: /default_panels/GraphCreatePanel.js:134 +Degrees // react-chart-editor: /default_panels/GraphCreatePanel.js:128 Density // react-chart-editor: /default_panels/StyleTracesPanel.js:119 -Descending // react-chart-editor: /default_panels/GraphTransformsPanel.js:92 +Descending // react-chart-editor: /default_panels/GraphTransformsPanel.js:94 Diagonal // react-chart-editor: /default_panels/StyleLayoutPanel.js:103 Diameter // react-chart-editor: /default_panels/StyleTracesPanel.js:269 Diffuse // react-chart-editor: /default_panels/StyleTracesPanel.js:531 Direction // react-chart-editor: /default_panels/StyleAxesPanel.js:69 Disable // react-chart-editor: /components/fields/derived.js:664 -Disabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:79 +Disabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:81 Display // react-chart-editor: /default_panels/StyleTracesPanel.js:186 Distributions // react-chart-editor: /lib/traceTypes.js:21 Divergence // react-chart-editor: /components/fields/derived.js:574 @@ -237,7 +237,7 @@ Edit in Rich Text Ellipse // react-chart-editor: /default_panels/StyleShapesPanel.js:29 Embed images in your figure to make the data more readable or to brand your content. // react-chart-editor: /components/containers/ImageAccordion.js:59 Enable // react-chart-editor: /default_panels/StyleAxesPanel.js:65 -Enabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:79 +Enabled // react-chart-editor: /default_panels/GraphTransformsPanel.js:81 End Point // react-chart-editor: /default_panels/StyleShapesPanel.js:36 Enter LaTeX formatted text // react-chart-editor: /components/fields/TextEditor.js:36 Enter Link URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:90 @@ -258,24 +258,24 @@ Expand All Exponents // react-chart-editor: /default_panels/StyleAxesPanel.js:179 Extended Colors // react-chart-editor: /default_panels/StyleTracesPanel.js:87 Face Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:536 -Facecolor // react-chart-editor: /default_panels/GraphCreatePanel.js:164 +Facecolor // react-chart-editor: /default_panels/GraphCreatePanel.js:158 False // react-chart-editor: /default_panels/StyleAxesPanel.js:149 File loaded! // react-chart-editor: /components/widgets/Dropzone.js:32 Fill // react-chart-editor: /default_panels/StyleImagesPanel.js:30 -Fill Color // react-chart-editor: /default_panels/GraphCreatePanel.js:146 +Fill Color // react-chart-editor: /default_panels/GraphCreatePanel.js:140 Fill to // react-chart-editor: /default_panels/StyleTracesPanel.js:443 Filled Area // react-chart-editor: /default_panels/StyleTracesPanel.js:442 Fills // react-chart-editor: /components/fields/derived.js:644 Filter // react-chart-editor: /components/containers/TransformAccordion.js:29 Finance // react-chart-editor: /lib/traceTypes.js:17 -First // react-chart-editor: /default_panels/GraphTransformsPanel.js:48 +First // react-chart-editor: /default_panels/GraphTransformsPanel.js:49 First label // react-chart-editor: /default_panels/StyleAxesPanel.js:223 Fixed Width // react-chart-editor: /default_panels/StyleLayoutPanel.js:72 Fixed height // react-chart-editor: /default_panels/StyleLayoutPanel.js:73 Flatshading // react-chart-editor: /default_panels/StyleTracesPanel.js:197 Font // react-chart-editor: /default_panels/StyleSlidersPanel.js:30 -Font Color // react-chart-editor: /default_panels/GraphCreatePanel.js:147 -Font Size // react-chart-editor: /default_panels/GraphCreatePanel.js:148 +Font Color // react-chart-editor: /default_panels/GraphCreatePanel.js:141 +Font Size // react-chart-editor: /default_panels/GraphCreatePanel.js:142 Fraction // react-chart-editor: /default_panels/StyleTracesPanel.js:300 Fraction of Plot // react-chart-editor: /default_panels/StyleColorbarsPanel.js:71 Fraction of canvas // react-chart-editor: /default_panels/StyleSlidersPanel.js:41 @@ -290,7 +290,7 @@ Geo Gnomonic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:136 Go back // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:186 Go to the // react-chart-editor: /components/containers/TraceRequiredPanel.js:27 -Gradians // react-chart-editor: /default_panels/GraphCreatePanel.js:135 +Gradians // react-chart-editor: /default_panels/GraphCreatePanel.js:129 Grid Lines // react-chart-editor: /default_panels/StyleAxesPanel.js:98 Grid Spacing // react-chart-editor: /default_panels/StyleAxesPanel.js:109 Group // react-chart-editor: /default_panels/StyleTracesPanel.js:57 @@ -299,20 +299,20 @@ Half Hammer // react-chart-editor: /default_panels/GraphSubplotsPanel.js:139 Hard // react-chart-editor: /default_panels/StyleTracesPanel.js:579 Header // react-chart-editor: /default_panels/StyleTracesPanel.js:150 -Header Options // react-chart-editor: /default_panels/GraphCreatePanel.js:145 -Headers // react-chart-editor: /default_panels/GraphCreatePanel.js:121 +Header Options // react-chart-editor: /default_panels/GraphCreatePanel.js:139 +Headers // react-chart-editor: /default_panels/GraphCreatePanel.js:115 Heads up! // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:170 Heatmap // react-chart-editor: /default_panels/StyleTracesPanel.js:356 Heatmap GL // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:89 Height // react-chart-editor: /default_panels/StyleAxesPanel.js:299 Hide // react-chart-editor: /components/fields/MarkerColor.js:192 -High // react-chart-editor: /default_panels/GraphCreatePanel.js:109 +High // react-chart-editor: /default_panels/GraphCreatePanel.js:103 Histogram // react-chart-editor: /lib/computeTraceOptionsFromSchema.js:25 Histogram Function // react-chart-editor: /default_panels/StyleTracesPanel.js:112 Histogram Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:114 Hole // react-chart-editor: /default_panels/GraphSubplotsPanel.js:232 Hole Size // react-chart-editor: /default_panels/StyleTracesPanel.js:233 -Horizontal // react-chart-editor: /default_panels/GraphCreatePanel.js:76 +Horizontal // react-chart-editor: /default_panels/GraphCreatePanel.js:70 Horizontal Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:33 Horizontal Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:511 Horizontal Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:515 @@ -321,7 +321,7 @@ Hour Hover // react-chart-editor: /default_panels/StyleLayoutPanel.js:118 Hover Action // react-chart-editor: /default_panels/StyleTracesPanel.js:642 Hover on // react-chart-editor: /default_panels/StyleTracesPanel.js:643 -I (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:105 +I (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:99 IE only supports svg. Changing format to svg. // plotly.js: components/modebar/buttons.js:65 Icon Color // react-chart-editor: /default_panels/StyleLayoutPanel.js:60 Image // react-chart-editor: /components/containers/ImageAccordion.js:22 @@ -335,13 +335,13 @@ Individually Inequality // react-chart-editor: /components/fields/FilterOperation.js:72 Infer Zero // react-chart-editor: /default_panels/StyleTracesPanel.js:389 Inside // react-chart-editor: /components/fields/derived.js:492 -Intensity // react-chart-editor: /default_panels/GraphCreatePanel.js:163 +Intensity // react-chart-editor: /default_panels/GraphCreatePanel.js:157 Interactions // react-chart-editor: /default_panels/StyleLayoutPanel.js:81 Interpolate // react-chart-editor: /default_panels/StyleTracesPanel.js:390 Interpolate Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:524 -J (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:106 +J (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:100 Jitter // react-chart-editor: /default_panels/StyleTracesPanel.js:255 -K (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:107 +K (Optional) // react-chart-editor: /default_panels/GraphCreatePanel.js:101 KDE // react-chart-editor: /components/fields/derived.js:637 Kavrayskiy 7 // react-chart-editor: /default_panels/GraphSubplotsPanel.js:126 LaTeX // react-chart-editor: /components/widgets/text_editors/MultiFormat.js:25 @@ -350,12 +350,12 @@ Label Label Format // react-chart-editor: /default_panels/StyleAxesPanel.js:168 Label Prefix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:171 Label Suffix // react-chart-editor: /default_panels/StyleColorbarsPanel.js:197 -Labels // react-chart-editor: /default_panels/GraphCreatePanel.js:47 +Labels // react-chart-editor: /default_panels/GraphCreatePanel.js:41 Lakes // react-chart-editor: /default_panels/GraphSubplotsPanel.js:185 Land // react-chart-editor: /default_panels/GraphSubplotsPanel.js:178 Lasso // react-chart-editor: /default_panels/StyleLayoutPanel.js:90 Lasso Select // plotly.js: components/modebar/buttons.js:123 -Last // react-chart-editor: /default_panels/GraphTransformsPanel.js:49 +Last // react-chart-editor: /default_panels/GraphTransformsPanel.js:50 Last label // react-chart-editor: /default_panels/StyleAxesPanel.js:224 Lat/Lon // react-chart-editor: /components/fields/LocationSelector.js:103 Latitude // react-chart-editor: /components/fields/derived.js:545 @@ -384,7 +384,7 @@ Log Logos, watermarks and more. // react-chart-editor: /components/containers/ImageAccordion.js:56 Longitude // react-chart-editor: /components/fields/derived.js:545 Looks like there aren't any traces defined yet. // react-chart-editor: /components/containers/TraceRequiredPanel.js:25 -Low // react-chart-editor: /default_panels/GraphCreatePanel.js:110 +Low // react-chart-editor: /default_panels/GraphCreatePanel.js:104 Lower < Target < Upper // react-chart-editor: /components/fields/FilterOperation.js:20 Lower < Target ≤ Upper // react-chart-editor: /components/fields/FilterOperation.js:22 Lower Bound // react-chart-editor: /components/fields/FilterOperation.js:171 @@ -416,7 +416,7 @@ Mean & SD Meanline // react-chart-editor: /default_panels/StyleTracesPanel.js:615 Meanline Color // react-chart-editor: /default_panels/StyleTracesPanel.js:621 Meanline Width // react-chart-editor: /default_panels/StyleTracesPanel.js:620 -Median // react-chart-editor: /default_panels/GraphTransformsPanel.js:42 +Median // react-chart-editor: /default_panels/GraphTransformsPanel.js:43 Menus // react-chart-editor: /DefaultEditor.js:83 Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:119 Middle // react-chart-editor: /default_panels/StyleAxesPanel.js:374 @@ -430,7 +430,7 @@ Minimum Minimum Size // react-chart-editor: /default_panels/StyleTracesPanel.js:271 Minute // react-chart-editor: /default_panels/StyleAxesPanel.js:326 Mirror Axis // react-chart-editor: /default_panels/StyleAxesPanel.js:92 -Mode // react-chart-editor: /default_panels/GraphTransformsPanel.js:43 +Mode // react-chart-editor: /default_panels/GraphTransformsPanel.js:44 Modebar // react-chart-editor: /default_panels/StyleLayoutPanel.js:54 Mollweide // react-chart-editor: /default_panels/GraphSubplotsPanel.js:138 Month // react-chart-editor: /default_panels/StyleAxesPanel.js:323 @@ -448,9 +448,9 @@ Normal Normalization // react-chart-editor: /default_panels/StyleTracesPanel.js:296 North America // react-chart-editor: /default_panels/GraphSubplotsPanel.js:108 Note Text // react-chart-editor: /default_panels/StyleNotesPanel.js:23 -Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:98 -Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:89 -Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:80 +Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:92 +Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:83 +Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // react-chart-editor: /default_panels/GraphCreatePanel.js:74 Number format // react-chart-editor: /default_panels/StyleLayoutPanel.js:33 Number of Contours // react-chart-editor: /default_panels/StyleTracesPanel.js:373 Number of Occurences // react-chart-editor: /default_panels/StyleTracesPanel.js:116 @@ -461,13 +461,13 @@ Offset On // react-chart-editor: /components/fields/RectanglePositioner.js:88 On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:623 Opacity // react-chart-editor: /default_panels/StyleShapesPanel.js:51 -Open // react-chart-editor: /default_panels/GraphCreatePanel.js:108 -Operator // react-chart-editor: /default_panels/GraphTransformsPanel.js:85 -Options // react-chart-editor: /default_panels/GraphCreatePanel.js:162 +Open // react-chart-editor: /default_panels/GraphCreatePanel.js:102 +Operator // react-chart-editor: /default_panels/GraphTransformsPanel.js:87 +Options // react-chart-editor: /default_panels/GraphCreatePanel.js:156 Orbit // react-chart-editor: /default_panels/StyleLayoutPanel.js:91 Orbital rotation // plotly.js: components/modebar/buttons.js:287 -Order // react-chart-editor: /default_panels/GraphCreatePanel.js:159 -Orientation // react-chart-editor: /default_panels/GraphCreatePanel.js:74 +Order // react-chart-editor: /default_panels/GraphCreatePanel.js:153 +Orientation // react-chart-editor: /default_panels/GraphCreatePanel.js:68 Orthographic // react-chart-editor: /default_panels/GraphSubplotsPanel.js:120 Outdoors // react-chart-editor: /default_panels/GraphSubplotsPanel.js:81 Outliers // react-chart-editor: /default_panels/StyleTracesPanel.js:238 @@ -504,10 +504,10 @@ Produced with Plotly Projection // react-chart-editor: /default_panels/GraphSubplotsPanel.js:114 Pull // react-chart-editor: /default_panels/StyleTracesPanel.js:234 R // react-chart-editor: /components/fields/derived.js:556 -RMS // react-chart-editor: /default_panels/GraphTransformsPanel.js:44 -Radians // react-chart-editor: /default_panels/GraphCreatePanel.js:133 -Radius // react-chart-editor: /default_panels/GraphCreatePanel.js:128 -Range // react-chart-editor: /default_panels/GraphTransformsPanel.js:51 +RMS // react-chart-editor: /default_panels/GraphTransformsPanel.js:45 +Radians // react-chart-editor: /default_panels/GraphCreatePanel.js:127 +Radius // react-chart-editor: /default_panels/GraphCreatePanel.js:122 +Range // react-chart-editor: /default_panels/GraphTransformsPanel.js:52 Range Slider // react-chart-editor: /default_panels/StyleAxesPanel.js:294 Rectangle // react-chart-editor: /default_panels/StyleShapesPanel.js:28 Reference // react-chart-editor: /components/fields/FilterOperation.js:169 @@ -593,7 +593,7 @@ Split Split labels // react-chart-editor: /default_panels/StyleTracesPanel.js:626 Stack // react-chart-editor: /default_panels/GraphSubplotsPanel.js:70 Stacking // react-chart-editor: /default_panels/StyleTracesPanel.js:383 -Standard Deviation // react-chart-editor: /default_panels/GraphTransformsPanel.js:45 +Standard Deviation // react-chart-editor: /default_panels/GraphTransformsPanel.js:46 Start Point // react-chart-editor: /default_panels/StyleShapesPanel.js:35 Step // react-chart-editor: /default_panels/StyleAxesPanel.js:318 Step Offset // react-chart-editor: /default_panels/StyleAxesPanel.js:114 @@ -617,7 +617,7 @@ Symmetric Table // react-chart-editor: /components/containers/SubplotAccordion.js:134 Tail // react-chart-editor: /default_panels/StyleTracesPanel.js:74 Taking snapshot - this may take a few seconds // plotly.js: components/modebar/buttons.js:62 -Target // react-chart-editor: /default_panels/GraphTransformsPanel.js:84 +Target // react-chart-editor: /default_panels/GraphTransformsPanel.js:86 Target < Reference // react-chart-editor: /components/fields/FilterOperation.js:12 Target = Reference // react-chart-editor: /components/fields/FilterOperation.js:14 Target > Reference // react-chart-editor: /components/fields/FilterOperation.js:15 @@ -631,7 +631,7 @@ Text Alignment Text Attributes // react-chart-editor: /default_panels/StyleTracesPanel.js:446 Text Position // react-chart-editor: /default_panels/StyleTracesPanel.js:467 Theta // react-chart-editor: /components/fields/derived.js:556 -Theta Unit // react-chart-editor: /default_panels/GraphCreatePanel.js:131 +Theta Unit // react-chart-editor: /default_panels/GraphCreatePanel.js:125 Thickness // react-chart-editor: /components/fields/ErrorBars.js:104 This input has multiple values associated with it. Changing this setting will override these custom inputs. // react-chart-editor: /lib/constants.js:20 This panel could not be displayed due to an error. // react-chart-editor: /components/containers/PlotlyPanel.js:17 @@ -664,14 +664,14 @@ Traces Traces of various types like bar and line are the building blocks of your figure. // react-chart-editor: /components/containers/TraceAccordion.js:121 Transform // react-chart-editor: /components/containers/TransformAccordion.js:75 Transforms // react-chart-editor: /DefaultEditor.js:72 -Transpose // react-chart-editor: /default_panels/GraphCreatePanel.js:167 +Transpose // react-chart-editor: /default_panels/GraphCreatePanel.js:161 Transverse Mercator // react-chart-editor: /default_panels/GraphSubplotsPanel.js:140 True // react-chart-editor: /default_panels/StyleAxesPanel.js:149 Try again with a // react-chart-editor: /components/widgets/Dropzone.js:130 Try again with a supported file format: // react-chart-editor: /components/widgets/Dropzone.js:74 Turntable // react-chart-editor: /default_panels/StyleLayoutPanel.js:92 Turntable rotation // plotly.js: components/modebar/buttons.js:296 -Type // react-chart-editor: /default_panels/GraphCreatePanel.js:43 +Type // react-chart-editor: /default_panels/GraphCreatePanel.js:37 Typeface // react-chart-editor: /default_panels/StyleAxesPanel.js:35 U // react-chart-editor: /components/fields/derived.js:570 URL // react-chart-editor: /components/widgets/text_editors/RichText/LinkEditor.js:91 @@ -686,8 +686,8 @@ Values Values Shown On Hover // react-chart-editor: /default_panels/StyleTracesPanel.js:624 Variable // react-chart-editor: /components/fields/MarkerColor.js:158 Vertex Normal // react-chart-editor: /default_panels/StyleTracesPanel.js:535 -Vertexcolor // react-chart-editor: /default_panels/GraphCreatePanel.js:165 -Vertical // react-chart-editor: /default_panels/GraphCreatePanel.js:76 +Vertexcolor // react-chart-editor: /default_panels/GraphCreatePanel.js:159 +Vertical // react-chart-editor: /default_panels/GraphCreatePanel.js:70 Vertical Boundaries // react-chart-editor: /default_panels/StyleShapesPanel.js:39 Vertical Gap // react-chart-editor: /default_panels/StyleTracesPanel.js:512 Vertical Gaps // react-chart-editor: /default_panels/StyleTracesPanel.js:516 @@ -706,7 +706,7 @@ W WebGL // react-chart-editor: /components/fields/TraceSelector.js:101 Well this is embarrassing. // react-chart-editor: /components/containers/PlotlyPanel.js:16 Whisker Width // react-chart-editor: /default_panels/StyleTracesPanel.js:338 -Width // react-chart-editor: /default_panels/GraphCreatePanel.js:158 +Width // react-chart-editor: /default_panels/GraphCreatePanel.js:152 Winkel Tripel // react-chart-editor: /default_panels/GraphSubplotsPanel.js:123 World // react-chart-editor: /default_panels/GraphSubplotsPanel.js:103 X // react-chart-editor: /components/fields/derived.js:523 @@ -718,9 +718,9 @@ X Bin Size X Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:202 X Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:39 X Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:26 -X Values // react-chart-editor: /default_panels/GraphCreatePanel.js:51 +X Values // react-chart-editor: /default_panels/GraphCreatePanel.js:45 X Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:41 -X start // react-chart-editor: /default_panels/GraphCreatePanel.js:118 +X start // react-chart-editor: /default_panels/GraphCreatePanel.js:112 Y // react-chart-editor: /components/fields/derived.js:523 Y = 0 // react-chart-editor: /components/fields/derived.js:594 Y Anchor // react-chart-editor: /default_panels/GraphSubplotsPanel.js:37 @@ -730,9 +730,9 @@ Y Bin Size Y Bin Start // react-chart-editor: /default_panels/StyleTracesPanel.js:207 Y Offset // react-chart-editor: /default_panels/StyleNotesPanel.js:40 Y Overlay // react-chart-editor: /default_panels/GraphSubplotsPanel.js:27 -Y Values // react-chart-editor: /default_panels/GraphCreatePanel.js:59 +Y Values // react-chart-editor: /default_panels/GraphCreatePanel.js:53 Y Vector // react-chart-editor: /default_panels/StyleNotesPanel.js:42 -Y start // react-chart-editor: /default_panels/GraphCreatePanel.js:119 +Y start // react-chart-editor: /default_panels/GraphCreatePanel.js:113 Year // react-chart-editor: /default_panels/StyleAxesPanel.js:322 Yes // react-chart-editor: /components/fields/ErrorBars.js:96 Yikes! An error occurred while parsing this file. // react-chart-editor: /components/widgets/Dropzone.js:73 @@ -743,8 +743,8 @@ You can style and position your axes in the You can style and position your subplots in the // react-chart-editor: /components/fields/SubplotCreator.js:132 You need to provide a component for the modal to open! // react-chart-editor: /components/containers/ModalProvider.js:34 Z // react-chart-editor: /components/fields/derived.js:538 -Z Values // react-chart-editor: /default_panels/GraphCreatePanel.js:68 -Z start // react-chart-editor: /default_panels/GraphCreatePanel.js:120 +Z Values // react-chart-editor: /default_panels/GraphCreatePanel.js:62 +Z start // react-chart-editor: /default_panels/GraphCreatePanel.js:114 Zero Line // react-chart-editor: /default_panels/StyleAxesPanel.js:119 Zoom // plotly.js: components/modebar/buttons.js:96 && react-chart-editor: /default_panels/StyleLayoutPanel.js:87 Zoom Interactivity // react-chart-editor: /default_panels/StyleAxesPanel.js:62 @@ -777,7 +777,7 @@ new text open: // plotly.js: traces/ohlc/calc.js:100 outgoing flow count: // plotly.js: traces/sankey/plot.js:147 panel under Structure to define traces. // react-chart-editor: /components/containers/TraceRequiredPanel.js:29 -panel under Style. If Y values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:84 +panel under Style. If Y values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:78 panel. // react-chart-editor: /components/fields/AxesCreator.js:154 q1: // plotly.js: traces/box/calc.js:137 q3: // plotly.js: traces/box/calc.js:138 @@ -791,8 +791,8 @@ transforms allow you to create multiple traces from one source trace, so as to s transforms allow you to filter data out from a trace. // react-chart-editor: /components/containers/TransformAccordion.js:116 transforms allow you to sort a trace, so as to control marker overlay or line connection order. // react-chart-editor: /components/containers/TransformAccordion.js:133 transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // react-chart-editor: /components/containers/TransformAccordion.js:127 -under Style panel. If X values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:93 -under Style panel. If Z values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:102 +under Style panel. If X values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:87 +under Style panel. If Z values are omitted, the histogram function defaults to Count. // react-chart-editor: /default_panels/GraphCreatePanel.js:96 upper fence: // plotly.js: traces/box/calc.js:142 x // react-chart-editor: /default_panels/StyleAxesPanel.js:208 x10^6 // react-chart-editor: /default_panels/StyleAxesPanel.js:186 diff --git a/scripts/translationKeys/translation-keys.txt b/scripts/translationKeys/translation-keys.txt index 9f08f11b5..14ad0cd44 100644 --- a/scripts/translationKeys/translation-keys.txt +++ b/scripts/translationKeys/translation-keys.txt @@ -1,6 +1,6 @@ Axis // /components/fields/AxesCreator.js:140 panel under Structure to define traces. // /components/containers/TraceRequiredPanel.js:29 - panel under Style. If Y values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:84 + panel under Style. If Y values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:78 panel. // /components/fields/AxesCreator.js:154 to upload here or click to choose a file from your computer. // /components/widgets/Dropzone.js:49 to us. // /components/widgets/Dropzone.js:128 @@ -8,8 +8,8 @@ transforms allow you to filter data out from a trace. // /components/containers/TransformAccordion.js:116 transforms allow you to sort a trace, so as to control marker overlay or line connection order. // /components/containers/TransformAccordion.js:133 transforms allow you to summarize a trace using an aggregate function like "average" or "minimum". // /components/containers/TransformAccordion.js:127 - under Style panel. If X values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:93 - under Style panel. If Z values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:102 + under Style panel. If X values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:87 + under Style panel. If Z values are omitted, the histogram function defaults to Count. // /default_panels/GraphCreatePanel.js:96 # // /default_panels/StyleAxesPanel.js:210 $ // /default_panels/StyleAxesPanel.js:209 % // /components/fields/derived.js:509 @@ -41,7 +41,7 @@ Advanced (d3-format) Advanced (d3-time-format) // /components/fields/derived.js:146 Africa // /default_panels/GraphSubplotsPanel.js:107 Aggregate // /components/containers/TransformAccordion.js:31 -Aggregations // /default_panels/GraphTransformsPanel.js:30 +Aggregations // /default_panels/GraphTransformsPanel.js:31 Aitoff // /default_panels/GraphSubplotsPanel.js:141 Albers USA // /default_panels/GraphSubplotsPanel.js:122 All // /default_panels/StyleAxesPanel.js:196 @@ -61,14 +61,14 @@ Any Area // /default_panels/StyleTracesPanel.js:269 Arrow // /default_panels/StyleNotesPanel.js:30 Arrowhead // /default_panels/StyleNotesPanel.js:37 -Ascending // /default_panels/GraphTransformsPanel.js:91 +Ascending // /default_panels/GraphTransformsPanel.js:93 Asia // /default_panels/GraphSubplotsPanel.js:106 Aspect Ratio // /default_panels/GraphSubplotsPanel.js:42 Asymmetric // /components/fields/ErrorBars.js:79 Atlas Map // /lib/computeTraceOptionsFromSchema.js:73 Auto // /components/fields/derived.js:494 Auto margins // /default_panels/StyleAxesPanel.js:147 -Average // /default_panels/GraphTransformsPanel.js:41 +Average // /default_panels/GraphTransformsPanel.js:42 Average // /components/fields/derived.js:133 Axes // /DefaultEditor.js:76 Axes to Use // /components/fields/AxesCreator.js:147 @@ -122,7 +122,7 @@ Boxes and Points Button // /components/containers/RangeSelectorAccordion.js:39 Button Labels // /default_panels/StyleUpdateMenusPanel.js:24 Buttons // /components/containers/UpdateMenuAccordion.js:23 -By // /default_panels/GraphTransformsPanel.js:82 +By // /default_panels/GraphTransformsPanel.js:84 By Type // /components/containers/TraceAccordion.js:167 C // /components/fields/derived.js:553 Call out your data. // /components/containers/AnnotationAccordion.js:51 @@ -132,13 +132,13 @@ Carpet Carpet Contour // /lib/computeTraceOptionsFromSchema.js:113 Carpet Scatter // /lib/computeTraceOptionsFromSchema.js:109 Categorical // /default_panels/StyleAxesPanel.js:50 -Cell Options // /default_panels/GraphCreatePanel.js:151 +Cell Options // /default_panels/GraphCreatePanel.js:145 Cells // /default_panels/StyleTracesPanel.js:168 Center // /default_panels/StyleAxesPanel.js:360 Center Latitude // /default_panels/GraphSubplotsPanel.js:91 Center Longitude // /default_panels/GraphSubplotsPanel.js:92 Center of Mass // /default_panels/StyleTracesPanel.js:76 -Change // /default_panels/GraphTransformsPanel.js:50 +Change // /default_panels/GraphTransformsPanel.js:51 Charts like this by Plotly users. // /components/widgets/TraceTypeSelector.js:232 Choropleth // /lib/computeTraceOptionsFromSchema.js:77 Click // /default_panels/StyleLayoutPanel.js:108 @@ -149,7 +149,7 @@ Click on the + button above to add a transform. Click on the + button above to add an annotation. // /components/containers/AnnotationAccordion.js:57 Click on the + button above to add an image. // /components/containers/ImageAccordion.js:62 Clockwise // /components/fields/derived.js:102 -Close // /default_panels/GraphCreatePanel.js:111 +Close // /default_panels/GraphCreatePanel.js:105 Closest // /components/fields/derived.js:661 Coastlines // /default_panels/GraphSubplotsPanel.js:163 Collapse All // /components/containers/PanelHeader.js:49 @@ -162,8 +162,8 @@ Colors Colorscale // /default_panels/StyleTracesPanel.js:432 Colorscale Direction // /components/fields/MarkerColor.js:185 Colorscale Range // /components/fields/MarkerColor.js:195 -Column Options // /default_panels/GraphCreatePanel.js:157 -Columns // /default_panels/GraphCreatePanel.js:122 +Column Options // /default_panels/GraphCreatePanel.js:151 +Columns // /default_panels/GraphCreatePanel.js:116 Common Case: An 'All' tab might display this message because the X and Y tabs contain different settings. // /lib/constants.js:24 Cone // /lib/computeTraceOptionsFromSchema.js:65 Cone Anchor // /default_panels/StyleTracesPanel.js:71 @@ -188,7 +188,7 @@ Contour Width Contours // /default_panels/StyleTracesPanel.js:342 Copy Y Style // /components/fields/ErrorBars.js:94 Copy Z Style // /components/fields/ErrorBars.js:99 -Count // /default_panels/GraphTransformsPanel.js:39 +Count // /default_panels/GraphTransformsPanel.js:40 Count // /components/fields/derived.js:131 Counter Clockwise // /default_panels/StyleAxesPanel.js:73 Counterclockwise // /components/fields/derived.js:103 @@ -209,15 +209,15 @@ Decreasing Decreasing Trace Styles // /default_panels/StyleTracesPanel.js:555 Default // /components/fields/derived.js:145 Defaults // /default_panels/StyleLayoutPanel.js:25 -Degrees // /default_panels/GraphCreatePanel.js:134 +Degrees // /default_panels/GraphCreatePanel.js:128 Density // /default_panels/StyleTracesPanel.js:119 -Descending // /default_panels/GraphTransformsPanel.js:92 +Descending // /default_panels/GraphTransformsPanel.js:94 Diagonal // /default_panels/StyleLayoutPanel.js:103 Diameter // /default_panels/StyleTracesPanel.js:269 Diffuse // /default_panels/StyleTracesPanel.js:531 Direction // /default_panels/StyleAxesPanel.js:69 Disable // /components/fields/derived.js:664 -Disabled // /default_panels/GraphTransformsPanel.js:79 +Disabled // /default_panels/GraphTransformsPanel.js:81 Display // /default_panels/StyleTracesPanel.js:186 Distributions // /lib/traceTypes.js:21 Divergence // /components/fields/derived.js:574 @@ -234,7 +234,7 @@ Edit in Rich Text Ellipse // /default_panels/StyleShapesPanel.js:29 Embed images in your figure to make the data more readable or to brand your content. // /components/containers/ImageAccordion.js:59 Enable // /default_panels/StyleAxesPanel.js:65 -Enabled // /default_panels/GraphTransformsPanel.js:79 +Enabled // /default_panels/GraphTransformsPanel.js:81 End Point // /default_panels/StyleShapesPanel.js:36 Enter LaTeX formatted text // /components/fields/TextEditor.js:36 Enter Link URL // /components/widgets/text_editors/RichText/LinkEditor.js:90 @@ -255,24 +255,24 @@ Expand All Exponents // /default_panels/StyleAxesPanel.js:179 Extended Colors // /default_panels/StyleTracesPanel.js:87 Face Normal // /default_panels/StyleTracesPanel.js:536 -Facecolor // /default_panels/GraphCreatePanel.js:164 +Facecolor // /default_panels/GraphCreatePanel.js:158 False // /default_panels/StyleAxesPanel.js:149 File loaded! // /components/widgets/Dropzone.js:32 Fill // /default_panels/StyleImagesPanel.js:30 -Fill Color // /default_panels/GraphCreatePanel.js:146 +Fill Color // /default_panels/GraphCreatePanel.js:140 Fill to // /default_panels/StyleTracesPanel.js:443 Filled Area // /default_panels/StyleTracesPanel.js:442 Fills // /components/fields/derived.js:644 Filter // /components/containers/TransformAccordion.js:29 Finance // /lib/traceTypes.js:17 -First // /default_panels/GraphTransformsPanel.js:48 +First // /default_panels/GraphTransformsPanel.js:49 First label // /default_panels/StyleAxesPanel.js:223 Fixed Width // /default_panels/StyleLayoutPanel.js:72 Fixed height // /default_panels/StyleLayoutPanel.js:73 Flatshading // /default_panels/StyleTracesPanel.js:197 Font // /default_panels/StyleSlidersPanel.js:30 -Font Color // /default_panels/GraphCreatePanel.js:147 -Font Size // /default_panels/GraphCreatePanel.js:148 +Font Color // /default_panels/GraphCreatePanel.js:141 +Font Size // /default_panels/GraphCreatePanel.js:142 Fraction // /default_panels/StyleTracesPanel.js:300 Fraction of Plot // /default_panels/StyleColorbarsPanel.js:71 Fraction of canvas // /default_panels/StyleSlidersPanel.js:41 @@ -287,7 +287,7 @@ Geo Gnomonic // /default_panels/GraphSubplotsPanel.js:136 Go back // /components/widgets/text_editors/MultiFormat.js:186 Go to the // /components/containers/TraceRequiredPanel.js:27 -Gradians // /default_panels/GraphCreatePanel.js:135 +Gradians // /default_panels/GraphCreatePanel.js:129 Grid Lines // /default_panels/StyleAxesPanel.js:98 Grid Spacing // /default_panels/StyleAxesPanel.js:109 Group // /default_panels/StyleTracesPanel.js:57 @@ -296,20 +296,20 @@ Half Hammer // /default_panels/GraphSubplotsPanel.js:139 Hard // /default_panels/StyleTracesPanel.js:579 Header // /default_panels/StyleTracesPanel.js:150 -Header Options // /default_panels/GraphCreatePanel.js:145 -Headers // /default_panels/GraphCreatePanel.js:121 +Header Options // /default_panels/GraphCreatePanel.js:139 +Headers // /default_panels/GraphCreatePanel.js:115 Heads up! // /components/widgets/text_editors/MultiFormat.js:170 Heatmap // /default_panels/StyleTracesPanel.js:356 Heatmap GL // /lib/computeTraceOptionsFromSchema.js:89 Height // /default_panels/StyleAxesPanel.js:299 Hide // /components/fields/MarkerColor.js:192 -High // /default_panels/GraphCreatePanel.js:109 +High // /default_panels/GraphCreatePanel.js:103 Histogram // /lib/computeTraceOptionsFromSchema.js:25 Histogram Function // /default_panels/StyleTracesPanel.js:112 Histogram Normalization // /default_panels/StyleTracesPanel.js:114 Hole // /default_panels/GraphSubplotsPanel.js:232 Hole Size // /default_panels/StyleTracesPanel.js:233 -Horizontal // /default_panels/GraphCreatePanel.js:76 +Horizontal // /default_panels/GraphCreatePanel.js:70 Horizontal Boundaries // /default_panels/StyleShapesPanel.js:33 Horizontal Gap // /default_panels/StyleTracesPanel.js:511 Horizontal Gaps // /default_panels/StyleTracesPanel.js:515 @@ -318,7 +318,7 @@ Hour Hover // /default_panels/StyleLayoutPanel.js:118 Hover Action // /default_panels/StyleTracesPanel.js:642 Hover on // /default_panels/StyleTracesPanel.js:643 -I (Optional) // /default_panels/GraphCreatePanel.js:105 +I (Optional) // /default_panels/GraphCreatePanel.js:99 Icon Color // /default_panels/StyleLayoutPanel.js:60 Image // /components/containers/ImageAccordion.js:22 Images // /DefaultEditor.js:81 @@ -331,13 +331,13 @@ Individually Inequality // /components/fields/FilterOperation.js:72 Infer Zero // /default_panels/StyleTracesPanel.js:389 Inside // /components/fields/derived.js:492 -Intensity // /default_panels/GraphCreatePanel.js:163 +Intensity // /default_panels/GraphCreatePanel.js:157 Interactions // /default_panels/StyleLayoutPanel.js:81 Interpolate // /default_panels/StyleTracesPanel.js:390 Interpolate Gaps // /default_panels/StyleTracesPanel.js:524 -J (Optional) // /default_panels/GraphCreatePanel.js:106 +J (Optional) // /default_panels/GraphCreatePanel.js:100 Jitter // /default_panels/StyleTracesPanel.js:255 -K (Optional) // /default_panels/GraphCreatePanel.js:107 +K (Optional) // /default_panels/GraphCreatePanel.js:101 KDE // /components/fields/derived.js:637 Kavrayskiy 7 // /default_panels/GraphSubplotsPanel.js:126 LaTeX // /components/widgets/text_editors/MultiFormat.js:25 @@ -346,11 +346,11 @@ Label Label Format // /default_panels/StyleAxesPanel.js:168 Label Prefix // /default_panels/StyleColorbarsPanel.js:171 Label Suffix // /default_panels/StyleColorbarsPanel.js:197 -Labels // /default_panels/GraphCreatePanel.js:47 +Labels // /default_panels/GraphCreatePanel.js:41 Lakes // /default_panels/GraphSubplotsPanel.js:185 Land // /default_panels/GraphSubplotsPanel.js:178 Lasso // /default_panels/StyleLayoutPanel.js:90 -Last // /default_panels/GraphTransformsPanel.js:49 +Last // /default_panels/GraphTransformsPanel.js:50 Last label // /default_panels/StyleAxesPanel.js:224 Lat/Lon // /components/fields/LocationSelector.js:103 Latitude // /components/fields/derived.js:545 @@ -379,7 +379,7 @@ Log Logos, watermarks and more. // /components/containers/ImageAccordion.js:56 Longitude // /components/fields/derived.js:545 Looks like there aren't any traces defined yet. // /components/containers/TraceRequiredPanel.js:25 -Low // /default_panels/GraphCreatePanel.js:110 +Low // /default_panels/GraphCreatePanel.js:104 Lower < Target < Upper // /components/fields/FilterOperation.js:20 Lower < Target ≤ Upper // /components/fields/FilterOperation.js:22 Lower Bound // /components/fields/FilterOperation.js:171 @@ -411,7 +411,7 @@ Mean & SD Meanline // /default_panels/StyleTracesPanel.js:615 Meanline Color // /default_panels/StyleTracesPanel.js:621 Meanline Width // /default_panels/StyleTracesPanel.js:620 -Median // /default_panels/GraphTransformsPanel.js:42 +Median // /default_panels/GraphTransformsPanel.js:43 Menus // /DefaultEditor.js:83 Mercator // /default_panels/GraphSubplotsPanel.js:119 Middle // /default_panels/StyleAxesPanel.js:374 @@ -425,7 +425,7 @@ Minimum Minimum Size // /default_panels/StyleTracesPanel.js:271 Minute // /default_panels/StyleAxesPanel.js:326 Mirror Axis // /default_panels/StyleAxesPanel.js:92 -Mode // /default_panels/GraphTransformsPanel.js:43 +Mode // /default_panels/GraphTransformsPanel.js:44 Modebar // /default_panels/StyleLayoutPanel.js:54 Mollweide // /default_panels/GraphSubplotsPanel.js:138 Month // /default_panels/StyleAxesPanel.js:323 @@ -443,9 +443,9 @@ Normal Normalization // /default_panels/StyleTracesPanel.js:296 North America // /default_panels/GraphSubplotsPanel.js:108 Note Text // /default_panels/StyleNotesPanel.js:23 -Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:98 -Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:89 -Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:80 +Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:92 +Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:83 +Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the // /default_panels/GraphCreatePanel.js:74 Number format // /default_panels/StyleLayoutPanel.js:33 Number of Contours // /default_panels/StyleTracesPanel.js:373 Number of Occurences // /default_panels/StyleTracesPanel.js:116 @@ -456,12 +456,12 @@ Offset On // /components/fields/RectanglePositioner.js:88 On Hover // /default_panels/StyleTracesPanel.js:623 Opacity // /default_panels/StyleShapesPanel.js:51 -Open // /default_panels/GraphCreatePanel.js:108 -Operator // /default_panels/GraphTransformsPanel.js:85 -Options // /default_panels/GraphCreatePanel.js:162 +Open // /default_panels/GraphCreatePanel.js:102 +Operator // /default_panels/GraphTransformsPanel.js:87 +Options // /default_panels/GraphCreatePanel.js:156 Orbit // /default_panels/StyleLayoutPanel.js:91 -Order // /default_panels/GraphCreatePanel.js:159 -Orientation // /default_panels/GraphCreatePanel.js:74 +Order // /default_panels/GraphCreatePanel.js:153 +Orientation // /default_panels/GraphCreatePanel.js:68 Orthographic // /default_panels/GraphSubplotsPanel.js:120 Outdoors // /default_panels/GraphSubplotsPanel.js:81 Outliers // /default_panels/StyleTracesPanel.js:238 @@ -497,10 +497,10 @@ Probability Density Projection // /default_panels/GraphSubplotsPanel.js:114 Pull // /default_panels/StyleTracesPanel.js:234 R // /components/fields/derived.js:556 -RMS // /default_panels/GraphTransformsPanel.js:44 -Radians // /default_panels/GraphCreatePanel.js:133 -Radius // /default_panels/GraphCreatePanel.js:128 -Range // /default_panels/GraphTransformsPanel.js:51 +RMS // /default_panels/GraphTransformsPanel.js:45 +Radians // /default_panels/GraphCreatePanel.js:127 +Radius // /default_panels/GraphCreatePanel.js:122 +Range // /default_panels/GraphTransformsPanel.js:52 Range Slider // /default_panels/StyleAxesPanel.js:294 Rectangle // /default_panels/StyleShapesPanel.js:28 Reference // /components/fields/FilterOperation.js:169 @@ -577,7 +577,7 @@ Split Split labels // /default_panels/StyleTracesPanel.js:626 Stack // /default_panels/GraphSubplotsPanel.js:70 Stacking // /default_panels/StyleTracesPanel.js:383 -Standard Deviation // /default_panels/GraphTransformsPanel.js:45 +Standard Deviation // /default_panels/GraphTransformsPanel.js:46 Start Point // /default_panels/StyleShapesPanel.js:35 Step // /default_panels/StyleAxesPanel.js:318 Step Offset // /default_panels/StyleAxesPanel.js:114 @@ -601,7 +601,7 @@ Symbol Symmetric // /components/fields/ErrorBars.js:78 Table // /components/containers/SubplotAccordion.js:134 Tail // /default_panels/StyleTracesPanel.js:74 -Target // /default_panels/GraphTransformsPanel.js:84 +Target // /default_panels/GraphTransformsPanel.js:86 Target < Reference // /components/fields/FilterOperation.js:12 Target = Reference // /components/fields/FilterOperation.js:14 Target > Reference // /components/fields/FilterOperation.js:15 @@ -615,7 +615,7 @@ Text Alignment Text Attributes // /default_panels/StyleTracesPanel.js:446 Text Position // /default_panels/StyleTracesPanel.js:467 Theta // /components/fields/derived.js:556 -Theta Unit // /default_panels/GraphCreatePanel.js:131 +Theta Unit // /default_panels/GraphCreatePanel.js:125 Thickness // /components/fields/ErrorBars.js:104 This input has multiple values associated with it. Changing this setting will override these custom inputs. // /lib/constants.js:20 This panel could not be displayed due to an error. // /components/containers/PlotlyPanel.js:17 @@ -646,13 +646,13 @@ Traces Traces of various types like bar and line are the building blocks of your figure. // /components/containers/TraceAccordion.js:121 Transform // /components/containers/TransformAccordion.js:75 Transforms // /DefaultEditor.js:72 -Transpose // /default_panels/GraphCreatePanel.js:167 +Transpose // /default_panels/GraphCreatePanel.js:161 Transverse Mercator // /default_panels/GraphSubplotsPanel.js:140 True // /default_panels/StyleAxesPanel.js:149 Try again with a // /components/widgets/Dropzone.js:130 Try again with a supported file format: // /components/widgets/Dropzone.js:74 Turntable // /default_panels/StyleLayoutPanel.js:92 -Type // /default_panels/GraphCreatePanel.js:43 +Type // /default_panels/GraphCreatePanel.js:37 Typeface // /default_panels/StyleAxesPanel.js:35 U // /components/fields/derived.js:570 URL // /components/widgets/text_editors/RichText/LinkEditor.js:91 @@ -667,8 +667,8 @@ Values Values Shown On Hover // /default_panels/StyleTracesPanel.js:624 Variable // /components/fields/MarkerColor.js:158 Vertex Normal // /default_panels/StyleTracesPanel.js:535 -Vertexcolor // /default_panels/GraphCreatePanel.js:165 -Vertical // /default_panels/GraphCreatePanel.js:76 +Vertexcolor // /default_panels/GraphCreatePanel.js:159 +Vertical // /default_panels/GraphCreatePanel.js:70 Vertical Boundaries // /default_panels/StyleShapesPanel.js:39 Vertical Gap // /default_panels/StyleTracesPanel.js:512 Vertical Gaps // /default_panels/StyleTracesPanel.js:516 @@ -687,7 +687,7 @@ W WebGL // /components/fields/TraceSelector.js:101 Well this is embarrassing. // /components/containers/PlotlyPanel.js:16 Whisker Width // /default_panels/StyleTracesPanel.js:338 -Width // /default_panels/GraphCreatePanel.js:158 +Width // /default_panels/GraphCreatePanel.js:152 Winkel Tripel // /default_panels/GraphSubplotsPanel.js:123 World // /default_panels/GraphSubplotsPanel.js:103 X // /components/fields/derived.js:523 @@ -699,9 +699,9 @@ X Bin Size X Bin Start // /default_panels/StyleTracesPanel.js:202 X Offset // /default_panels/StyleNotesPanel.js:39 X Overlay // /default_panels/GraphSubplotsPanel.js:26 -X Values // /default_panels/GraphCreatePanel.js:51 +X Values // /default_panels/GraphCreatePanel.js:45 X Vector // /default_panels/StyleNotesPanel.js:41 -X start // /default_panels/GraphCreatePanel.js:118 +X start // /default_panels/GraphCreatePanel.js:112 Y // /components/fields/derived.js:523 Y = 0 // /components/fields/derived.js:594 Y Anchor // /default_panels/GraphSubplotsPanel.js:37 @@ -711,9 +711,9 @@ Y Bin Size Y Bin Start // /default_panels/StyleTracesPanel.js:207 Y Offset // /default_panels/StyleNotesPanel.js:40 Y Overlay // /default_panels/GraphSubplotsPanel.js:27 -Y Values // /default_panels/GraphCreatePanel.js:59 +Y Values // /default_panels/GraphCreatePanel.js:53 Y Vector // /default_panels/StyleNotesPanel.js:42 -Y start // /default_panels/GraphCreatePanel.js:119 +Y start // /default_panels/GraphCreatePanel.js:113 Year // /default_panels/StyleAxesPanel.js:322 Yes // /components/fields/ErrorBars.js:96 Yikes! An error occurred while parsing this file. // /components/widgets/Dropzone.js:73 @@ -724,8 +724,8 @@ You can style and position your axes in the You can style and position your subplots in the // /components/fields/SubplotCreator.js:132 You need to provide a component for the modal to open! // /components/containers/ModalProvider.js:34 Z // /components/fields/derived.js:538 -Z Values // /default_panels/GraphCreatePanel.js:68 -Z start // /default_panels/GraphCreatePanel.js:120 +Z Values // /default_panels/GraphCreatePanel.js:62 +Z start // /default_panels/GraphCreatePanel.js:114 Zero Line // /default_panels/StyleAxesPanel.js:119 Zoom // /default_panels/StyleLayoutPanel.js:87 Zoom Interactivity // /default_panels/StyleAxesPanel.js:62 diff --git a/src/components/containers/AxesFold.js b/src/components/containers/AxesFold.js index d13b1c69c..38180a2e0 100644 --- a/src/components/containers/AxesFold.js +++ b/src/components/containers/AxesFold.js @@ -22,7 +22,7 @@ class AxesFold extends Component { AxesFold.propTypes = { children: PropTypes.any, options: PropTypes.array, - context: PropTypes.object, + context: PlotlyFold.requireContext, }; AxesFold.plotly_editor_traits = {foldable: true}; diff --git a/src/components/containers/PanelHeader.js b/src/components/containers/PanelHeader.js index 1bb994920..1cdeeccac 100644 --- a/src/components/containers/PanelHeader.js +++ b/src/components/containers/PanelHeader.js @@ -111,7 +111,7 @@ PanelHeader.propTypes = { children: PropTypes.node, hasOpen: PropTypes.bool, toggleFolds: PropTypes.func, - context: PropTypes.object, + context: PropTypes.any, }; export default PanelHeader; diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index 7da196843..3734c272b 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -4,6 +4,7 @@ import React, {Component} from 'react'; import classnames from 'classnames'; import {CloseIcon, AngleDownIcon} from 'plotly-icons'; import {unpackPlotProps, containerConnectedContextTypes, striptags} from 'lib'; +import {recursiveMap} from '../../lib/recursiveMap'; export class Fold extends Component { constructor() { @@ -85,7 +86,11 @@ export class Fold extends Component { let foldContent = null; if (!folded) { if (this.foldVisible) { - foldContent =
{children}
; + foldContent = ( +
+ {recursiveMap(children, {...this.props.context, ...this.provideValue()})} +
+ ); } else { foldContent = (
@@ -119,11 +124,12 @@ Fold.propTypes = { icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), messageIfEmpty: PropTypes.string, name: PropTypes.string, - context: PropTypes.object, + context: PropTypes.any, }; Fold.requireContext = { deleteContainer: PropTypes.func, + ...containerConnectedContextTypes, }; // Fold.childContextTypes = { diff --git a/src/components/containers/PlotlyPanel.js b/src/components/containers/PlotlyPanel.js index 2080d343d..8862732a8 100644 --- a/src/components/containers/PlotlyPanel.js +++ b/src/components/containers/PlotlyPanel.js @@ -129,7 +129,7 @@ Panel.propTypes = { deleteAction: PropTypes.func, noPadding: PropTypes.bool, showExpandCollapse: PropTypes.bool, - context: PropTypes.object, + context: PropTypes.any, }; Panel.defaultProps = { diff --git a/src/components/containers/PlotlySection.js b/src/components/containers/PlotlySection.js index f94f92524..4164339f5 100644 --- a/src/components/containers/PlotlySection.js +++ b/src/components/containers/PlotlySection.js @@ -33,7 +33,7 @@ Section.propTypes = { children: PropTypes.node, name: PropTypes.string, attr: PropTypes.string, - context: PropTypes.object, + context: PropTypes.any, }; Section.requireContext = containerConnectedContextTypes; diff --git a/src/components/containers/TransformAccordion.js b/src/components/containers/TransformAccordion.js index f6b58dce9..f7148e716 100644 --- a/src/components/containers/TransformAccordion.js +++ b/src/components/containers/TransformAccordion.js @@ -152,7 +152,7 @@ TransformAccordion.contextType = EditorControlsContext; TransformAccordion.propTypes = { children: PropTypes.node, - context: PropTypes.object, + context: PropTypes.any, }; export default TransformAccordion; diff --git a/src/components/containers/derived.js b/src/components/containers/derived.js index de631cb2c..d11e1561c 100644 --- a/src/components/containers/derived.js +++ b/src/components/containers/derived.js @@ -34,6 +34,7 @@ TraceTypeSection.propTypes = { name: PropTypes.string, traceTypes: PropTypes.array, mode: PropTypes.string, + context: PropTypes.any, }; TraceTypeSection.defaultProps = { diff --git a/src/components/fields/AxesCreator.js b/src/components/fields/AxesCreator.js index ba8d5e6d4..bedad412b 100644 --- a/src/components/fields/AxesCreator.js +++ b/src/components/fields/AxesCreator.js @@ -104,7 +104,7 @@ UnconnectedAxisCreator.propTypes = { container: PropTypes.object, fullContainer: PropTypes.object, updateContainer: PropTypes.func, - context: PropTypes.object, + context: PropTypes.any, }; UnconnectedAxisCreator.contextType = EditorControlsContext; @@ -163,7 +163,7 @@ class UnconnectedAxesCreator extends Component { UnconnectedAxesCreator.propTypes = { container: PropTypes.object, fullContainer: PropTypes.object, - context: PropTypes.object, + context: PropTypes.any, }; UnconnectedAxesCreator.contextType = EditorControlsContext; diff --git a/src/components/fields/AxesSelector.js b/src/components/fields/AxesSelector.js index 84fcf960c..233d00585 100644 --- a/src/components/fields/AxesSelector.js +++ b/src/components/fields/AxesSelector.js @@ -72,7 +72,7 @@ AxesSelector.contextType = EditorControlsContext; AxesSelector.propTypes = { axesOptions: PropTypes.array, - context: PropTypes.object, + context: PropTypes.any, }; export default AxesSelector; diff --git a/src/components/fields/DualNumeric.js b/src/components/fields/DualNumeric.js index 28e4e9ed1..4b788cfaa 100644 --- a/src/components/fields/DualNumeric.js +++ b/src/components/fields/DualNumeric.js @@ -83,7 +83,7 @@ UnconnectedDualNumericFraction.propTypes = { updatePlot: PropTypes.func, attr2: PropTypes.any, percentage: PropTypes.bool, - context: PropTypes.object, + context: PropTypes.any, ...Field.propTypes, }; diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index 46af53946..9f1884d68 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -105,7 +105,7 @@ Field.propTypes = { children: PropTypes.node, extraComponent: PropTypes.any, fieldContainerClassName: PropTypes.string, - context: PropTypes.object, + context: PropTypes.any, }; Field.requireContext = { diff --git a/src/components/fields/FilterOperation.js b/src/components/fields/FilterOperation.js index 44b9df0f8..75f31ee0f 100644 --- a/src/components/fields/FilterOperation.js +++ b/src/components/fields/FilterOperation.js @@ -203,7 +203,7 @@ UnconnectedFilterValue.propTypes = { defaultValue: PropTypes.string, fullValue: PropTypes.any, updatePlot: PropTypes.func, - context: PropTypes.object, + context: PropTypes.any, ...Field.propTypes, }; UnconnectedFilterValue.contextType = EditorControlsContext; diff --git a/src/components/fields/VisibilitySelect.js b/src/components/fields/VisibilitySelect.js index 0b4a1234f..5d6bd1fdc 100644 --- a/src/components/fields/VisibilitySelect.js +++ b/src/components/fields/VisibilitySelect.js @@ -76,7 +76,7 @@ UnconnectedVisibilitySelect.propTypes = { defaultOpt: PropTypes.oneOfType([PropTypes.number, PropTypes.bool, PropTypes.string]), label: PropTypes.string, attr: PropTypes.string, - context: PropTypes.object, + context: PropTypes.any, ...Field.propTypes, }; diff --git a/src/default_panels/GraphTransformsPanel.js b/src/default_panels/GraphTransformsPanel.js index 3801a0382..3ae59c775 100644 --- a/src/default_panels/GraphTransformsPanel.js +++ b/src/default_panels/GraphTransformsPanel.js @@ -67,7 +67,7 @@ Aggregations.requireContext = { fullContainer: PropTypes.object, }; Aggregations.propTypes = { - context: PropTypes.object, + context: PropTypes.any, }; const GraphTransformsPanel = () => { diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index 331beeeeb..5a64510b5 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -75,6 +75,11 @@ export default function connectAggregationToTransform(WrappedComponent) { getValObject: PropTypes.func, }; + AggregationConnectedComponent.propTypes = { + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectAnnotationToLayout.js b/src/lib/connectAnnotationToLayout.js index e51af975e..35f686ffc 100644 --- a/src/lib/connectAnnotationToLayout.js +++ b/src/lib/connectAnnotationToLayout.js @@ -92,6 +92,11 @@ export default function connectAnnotationToLayout(WrappedComponent) { getValObject: PropTypes.func, }; + AnnotationConnectedComponent.propTypes = { + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; AnnotationConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index 28c155942..37b650cd1 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -166,10 +166,14 @@ export default function connectAxesToLayout(WrappedComponent) { container: PropTypes.object.isRequired, fullContainer: PropTypes.object.isRequired, updateContainer: PropTypes.func, - localize: PropTypes.func, getValObject: PropTypes.func, }; + AxesConnectedComponent.propTypes = { + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectCartesianSubplotToLayout.js b/src/lib/connectCartesianSubplotToLayout.js index b0b30db4a..0498ddb4e 100644 --- a/src/lib/connectCartesianSubplotToLayout.js +++ b/src/lib/connectCartesianSubplotToLayout.js @@ -81,11 +81,6 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { SubplotConnectedComponent.displayName = `SubplotConnected${getDisplayName(WrappedComponent)}`; - SubplotConnectedComponent.propTypes = { - xaxis: PropTypes.string.isRequired, - yaxis: PropTypes.string.isRequired, - }; - SubplotConnectedComponent.contextType = EditorControlsContext; SubplotConnectedComponent.requireContext = { @@ -95,6 +90,13 @@ export default function connectCartesianSubplotToLayout(WrappedComponent) { getValObject: PropTypes.func, }; + SubplotConnectedComponent.propTypes = { + xaxis: PropTypes.string.isRequired, + yaxis: PropTypes.string.isRequired, + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectImageToLayout.js b/src/lib/connectImageToLayout.js index c0124619e..d380ebf70 100644 --- a/src/lib/connectImageToLayout.js +++ b/src/lib/connectImageToLayout.js @@ -76,10 +76,6 @@ export default function connectImageToLayout(WrappedComponent) { ImageConnectedComponent.displayName = `ImageConnected${getDisplayName(WrappedComponent)}`; - ImageConnectedComponent.propTypes = { - imageIndex: PropTypes.number.isRequired, - }; - ImageConnectedComponent.contextType = EditorControlsContext; ImageConnectedComponent.requireContext = { @@ -89,6 +85,12 @@ export default function connectImageToLayout(WrappedComponent) { getValObject: PropTypes.func, }; + ImageConnectedComponent.propTypes = { + imageIndex: PropTypes.number.isRequired, + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectLayoutToPlot.js b/src/lib/connectLayoutToPlot.js index 884aa00f3..2deaa8fdf 100644 --- a/src/lib/connectLayoutToPlot.js +++ b/src/lib/connectLayoutToPlot.js @@ -4,7 +4,7 @@ import {getDisplayName} from '../lib'; import {EDITOR_ACTIONS} from './constants'; import {EditorControlsContext} from '../context'; import {recursiveMap} from './recursiveMap'; -// import PropTypes from "prop-types"; +import PropTypes from 'prop-types'; export default function connectLayoutToPlot(WrappedComponent) { class LayoutConnectedComponent extends Component { @@ -67,13 +67,9 @@ export default function connectLayoutToPlot(WrappedComponent) { LayoutConnectedComponent.displayName = `LayoutConnected${getDisplayName(WrappedComponent)}`; LayoutConnectedComponent.contextType = EditorControlsContext; - - // LayoutConnectedComponent.childContextTypes = { - // getValObject: PropTypes.func, - // updateContainer: PropTypes.func, - // container: PropTypes.object, - // fullContainer: PropTypes.object, - // }; + LayoutConnectedComponent.propTypes = { + children: PropTypes.node, + }; const {plotly_editor_traits} = WrappedComponent; LayoutConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectNonCartesianSubplotToLayout.js b/src/lib/connectNonCartesianSubplotToLayout.js index 34f5eb892..f9d0317ab 100644 --- a/src/lib/connectNonCartesianSubplotToLayout.js +++ b/src/lib/connectNonCartesianSubplotToLayout.js @@ -70,10 +70,6 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { SubplotConnectedComponent.displayName = `SubplotConnected${getDisplayName(WrappedComponent)}`; - SubplotConnectedComponent.propTypes = { - subplot: PropTypes.string.isRequired, - }; - SubplotConnectedComponent.contextType = EditorControlsContext; SubplotConnectedComponent.requireContext = { @@ -83,6 +79,12 @@ export default function connectNonCartesianSubplotToLayout(WrappedComponent) { getValObject: PropTypes.func, }; + SubplotConnectedComponent.propTypes = { + subplot: PropTypes.string.isRequired, + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectRangeSelectorToAxis.js b/src/lib/connectRangeSelectorToAxis.js index 2a12d7e92..a9a19066d 100644 --- a/src/lib/connectRangeSelectorToAxis.js +++ b/src/lib/connectRangeSelectorToAxis.js @@ -83,10 +83,6 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { WrappedComponent )}`; - RangeSelectorConnectedComponent.propTypes = { - rangeselectorIndex: PropTypes.number.isRequired, - }; - RangeSelectorConnectedComponent.contextType = EditorControlsContext; RangeSelectorConnectedComponent.requireContext = { @@ -96,6 +92,12 @@ export default function connectRangeSelectorToAxis(WrappedComponent) { getValObject: PropTypes.func, }; + RangeSelectorConnectedComponent.propTypes = { + rangeselectorIndex: PropTypes.number.isRequired, + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectShapeToLayout.js b/src/lib/connectShapeToLayout.js index 2580dd88c..ab72a6fda 100644 --- a/src/lib/connectShapeToLayout.js +++ b/src/lib/connectShapeToLayout.js @@ -76,9 +76,6 @@ export default function connectShapeToLayout(WrappedComponent) { ShapeConnectedComponent.displayName = `ShapeConnected${getDisplayName(WrappedComponent)}`; - ShapeConnectedComponent.propTypes = { - shapeIndex: PropTypes.number.isRequired, - }; ShapeConnectedComponent.contextType = EditorControlsContext; ShapeConnectedComponent.requireContext = { container: PropTypes.object, @@ -87,6 +84,12 @@ export default function connectShapeToLayout(WrappedComponent) { getValObject: PropTypes.func, }; + ShapeConnectedComponent.propTypes = { + shapeIndex: PropTypes.number.isRequired, + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectSliderToLayout.js b/src/lib/connectSliderToLayout.js index ffbc20da4..4db015762 100644 --- a/src/lib/connectSliderToLayout.js +++ b/src/lib/connectSliderToLayout.js @@ -63,10 +63,6 @@ export default function connectSliderToLayout(WrappedComponent) { SliderConnectedComponent.displayName = `SliderConnected${getDisplayName(WrappedComponent)}`; - SliderConnectedComponent.propTypes = { - sliderIndex: PropTypes.number.isRequired, - }; - SliderConnectedComponent.contextType = EditorControlsContext; SliderConnectedComponent.requireContext = { @@ -75,6 +71,11 @@ export default function connectSliderToLayout(WrappedComponent) { updateContainer: PropTypes.func, getValObject: PropTypes.func, }; + SliderConnectedComponent.propTypes = { + sliderIndex: PropTypes.number.isRequired, + children: PropTypes.node, + context: PropTypes.any, + }; const {plotly_editor_traits} = WrappedComponent; SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectToContainer.js b/src/lib/connectToContainer.js index 944f4f1fc..527825ad5 100644 --- a/src/lib/connectToContainer.js +++ b/src/lib/connectToContainer.js @@ -103,6 +103,10 @@ export default function connectToContainer(WrappedComponent, config = {}) { ContainerConnectedComponent.displayName = `ContainerConnected${getDisplayName(WrappedComponent)}`; ContainerConnectedComponent.requireContext = containerConnectedContextTypes; ContainerConnectedComponent.contextType = EditorControlsContext; + ContainerConnectedComponent.propTypes = { + children: PropTypes.node, + context: PropTypes.any, + }; const {plotly_editor_traits} = WrappedComponent; ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectTraceToPlot.js b/src/lib/connectTraceToPlot.js index a271e02a8..5920a56d9 100644 --- a/src/lib/connectTraceToPlot.js +++ b/src/lib/connectTraceToPlot.js @@ -205,6 +205,7 @@ export default function connectTraceToPlot(WrappedComponent) { TraceConnectedComponent.propTypes = { traceIndexes: PropTypes.arrayOf(PropTypes.number).isRequired, fullDataArrayPosition: PropTypes.arrayOf(PropTypes.number), + children: PropTypes.node, }; TraceConnectedComponent.contextType = EditorControlsContext; diff --git a/src/lib/connectTransformToTrace.js b/src/lib/connectTransformToTrace.js index b3c10b818..eec8a5faa 100644 --- a/src/lib/connectTransformToTrace.js +++ b/src/lib/connectTransformToTrace.js @@ -79,10 +79,6 @@ export default function connectTransformToTrace(WrappedComponent) { TransformConnectedComponent.displayName = `TransformConnected${getDisplayName(WrappedComponent)}`; - TransformConnectedComponent.propTypes = { - transformIndex: PropTypes.number.isRequired, - }; - TransformConnectedComponent.contextType = EditorControlsContext; TransformConnectedComponent.requireContext = { @@ -93,6 +89,12 @@ export default function connectTransformToTrace(WrappedComponent) { getValObject: PropTypes.func, }; + TransformConnectedComponent.propTypes = { + transformIndex: PropTypes.number.isRequired, + children: PropTypes.node, + context: TransformConnectedComponent.requireContext, + }; + const {plotly_editor_traits} = WrappedComponent; TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits; diff --git a/src/lib/connectUpdateMenuToLayout.js b/src/lib/connectUpdateMenuToLayout.js index 8c0b341c3..894761dbc 100644 --- a/src/lib/connectUpdateMenuToLayout.js +++ b/src/lib/connectUpdateMenuToLayout.js @@ -56,10 +56,6 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { WrappedComponent )}`; - UpdateMenuConnectedComponent.propTypes = { - updateMenuIndex: PropTypes.number.isRequired, - }; - UpdateMenuConnectedComponent.contextType = EditorControlsContext; UpdateMenuConnectedComponent.requireContext = { @@ -69,6 +65,12 @@ export default function connectUpdateMenuToLayout(WrappedComponent) { getValObject: PropTypes.func, }; + UpdateMenuConnectedComponent.propTypes = { + updateMenuIndex: PropTypes.number.isRequired, + children: PropTypes.node, + context: PropTypes.any, + }; + const {plotly_editor_traits} = WrappedComponent; UpdateMenuConnectedComponent.plotly_editor_traits = plotly_editor_traits; From c505ba674e7af4700352963bbf8711a554b0aad4 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 22 Nov 2018 16:03:43 +0900 Subject: [PATCH 40/69] fix prop-types in aggregationToTransform --- src/lib/connectAggregationToTransform.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/connectAggregationToTransform.js b/src/lib/connectAggregationToTransform.js index 5a64510b5..13ec22bfb 100644 --- a/src/lib/connectAggregationToTransform.js +++ b/src/lib/connectAggregationToTransform.js @@ -29,7 +29,9 @@ export default function connectAggregationToTransform(WrappedComponent) { provideValue() { return { getValObject: attr => - !this.props.getValObject ? null : this.props.getValObject(`aggregations[].${attr}`), + !this.props.context.getValObject + ? null + : this.props.context.getValObject(`aggregations[].${attr}`), updateContainer: this.updateAggregation, container: this.container, fullContainer: this.fullContainer, From 27cd1fb2d6ede9230bd5311f182340c2f29b8426 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Thu, 22 Nov 2018 16:23:57 +0900 Subject: [PATCH 41/69] update devDependency --- package.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fd876bd4c..a6f826aa3 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,7 @@ "immutability-helper": "^2.7.1", "plotly-icons": "1.2.2", "plotly.js": "^1.42.5", - "prop-types": "^15.5.10", "raf": "^3.4.0", - "react-adopt": "^0.6.0", "react-color": "^2.13.8", "react-colorscales": "0.7.2", "react-dropzone": "^5.0.1", @@ -46,8 +44,8 @@ "babel-traverse": "^6.26.0", "css-loader": "^0.28.11", "cssnano": "^3.10.0", - "enzyme": "^3.1.0", - "enzyme-adapter-react-16": "^1.0.4", + "enzyme": "^3.7.0", + "enzyme-adapter-react-16": "^1.7.0", "eslint": "^5.4.0", "eslint-config-prettier": "^3.0.1", "eslint-plugin-import": "^2.8.0", @@ -65,9 +63,10 @@ "postcss-custom-properties": "^6.3.1", "postcss-remove-root": "^0.0.2", "prettier": "^1.14.2", - "react": "^16.6.0", + "prop-types": "^15.6.2", + "react": "^16.6.3", "react-ace": "^6.1.4", - "react-dom": "^16.6.0", + "react-dom": "^16.6.3", "react-hot-loader": "^4.3.12", "react-inspector": "^2.2.2", "react-percy": "^0.3.0", From 68fe3561df5a08e56fe4807011e041f2eea26f1c Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 02:54:53 +0900 Subject: [PATCH 42/69] update percy --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a6f826aa3..49554faca 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "tinycolor2": "^1.4.1" }, "devDependencies": { - "@percy/react": "^0.4.3", + "@percy/react": "^0.4.6", "autoprefixer": "^9.1.3", "babel-cli": "^6.26.0", "babel-core": "^6.26.0", From 2c8e276d4ee5f00827fd6f2175a62a596e3e69e6 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 14:11:33 +0900 Subject: [PATCH 43/69] fix UnconnectedVisibilitySelect --- package.json | 2 +- src/components/containers/AxesFold.js | 2 +- src/components/fields/FontSelector.js | 37 ++++++++++++++--------- src/components/fields/VisibilitySelect.js | 7 +++-- src/lib/connectAxesToLayout.js | 2 +- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 49554faca..eb8f2c74c 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "test:js": "jest --setupTestFrameworkScriptFile=raf/polyfill", "test:lint": "eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:pretty": "prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", - "test:percy": "react-percy", + "test:percy": "PERCY_TOKEN=6650afd4ff3ff3088a6ea4c5b14c12f802f15b4ef30f6160a03b2927aee8c398 react-percy", "test:percy-local": "react-percy --debug", "watch": "babel src --watch --out-dir lib --source-maps | node-sass -w src/styles/main.scss lib/react-chart-editor.css", "watch-test": "jest --watch" diff --git a/src/components/containers/AxesFold.js b/src/components/containers/AxesFold.js index 38180a2e0..1bd71dc8e 100644 --- a/src/components/containers/AxesFold.js +++ b/src/components/containers/AxesFold.js @@ -22,7 +22,7 @@ class AxesFold extends Component { AxesFold.propTypes = { children: PropTypes.any, options: PropTypes.array, - context: PlotlyFold.requireContext, + context: PropTypes.any, }; AxesFold.plotly_editor_traits = {foldable: true}; diff --git a/src/components/fields/FontSelector.js b/src/components/fields/FontSelector.js index 737ef6af9..f324cacea 100644 --- a/src/components/fields/FontSelector.js +++ b/src/components/fields/FontSelector.js @@ -1,21 +1,29 @@ import Dropdown from './Dropdown'; -import React from 'react'; -import PropTypes from 'prop-types'; +import React, {Component} from 'react'; +import {EditorControlsContext} from '../../context'; +import {containerConnectedContextTypes} from '../../lib'; +// import PropTypes from 'prop-types'; /* eslint-disable react/prop-types */ const styledRenderer = ({value, label}) => {label}; /* eslint-enable react/prop-types */ -const FontSelector = props => { - return ( - - ); -}; +class FontSelector extends Component { + constructor(props) { + super(props); + } + + render() { + return ( + + ); + } +} FontSelector.propTypes = { ...Dropdown.propTypes, @@ -25,8 +33,7 @@ FontSelector.defaultProps = { clearable: false, }; -FontSelector.requireContext = { - fontOptions: PropTypes.array, -}; +FontSelector.contextType = EditorControlsContext; +FontSelector.requireContext = containerConnectedContextTypes; export default FontSelector; diff --git a/src/components/fields/VisibilitySelect.js b/src/components/fields/VisibilitySelect.js index 5d6bd1fdc..00af43f82 100644 --- a/src/components/fields/VisibilitySelect.js +++ b/src/components/fields/VisibilitySelect.js @@ -5,6 +5,7 @@ import {MULTI_VALUED_PLACEHOLDER} from 'lib/constants'; import Field from './Field'; import Radio from './Radio'; import Dropdown from './Dropdown'; +import {recursiveMap} from '../../lib/recursiveMap'; export class UnconnectedVisibilitySelect extends Component { constructor(props) { @@ -28,7 +29,7 @@ export class UnconnectedVisibilitySelect extends Component { } setMode(mode) { - this.props.updateContainer({[this.props.attr]: mode}); + this.props.context.updateContainer({[this.props.attr]: mode}); } render() { @@ -44,6 +45,7 @@ export class UnconnectedVisibilitySelect extends Component { fullValue={this.mode} updatePlot={this.setMode} clearable={clearable} + context={this.props.context} /> ) : ( )} {(Array.isArray(showOn) && showOn.includes(this.mode)) || this.mode === showOn - ? this.props.children + ? recursiveMap(this.props.children, this.props.context) : null} ); diff --git a/src/lib/connectAxesToLayout.js b/src/lib/connectAxesToLayout.js index 37b650cd1..473342c83 100644 --- a/src/lib/connectAxesToLayout.js +++ b/src/lib/connectAxesToLayout.js @@ -36,7 +36,7 @@ function computeAxesOptions(axes, props, context) { export default function connectAxesToLayout(WrappedComponent) { class AxesConnectedComponent extends Component { constructor(props, context) { - super(props); + super(props, context); const {context: propContext, ...newProps} = props; this.axes = getAllAxes(propContext.fullContainer); From 97b4117623c637f0f4b287c6e4c2d1e178a56518 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 15:33:07 +0900 Subject: [PATCH 44/69] fix RangeSelectorAccordion --- .../containers/RangeSelectorAccordion.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/containers/RangeSelectorAccordion.js b/src/components/containers/RangeSelectorAccordion.js index 2f188550c..ee356d31e 100644 --- a/src/components/containers/RangeSelectorAccordion.js +++ b/src/components/containers/RangeSelectorAccordion.js @@ -10,21 +10,21 @@ const RangeSelectorFold = connectRangeSelectorToAxis(PlotlyFold); class RangeSelectorAccordion extends Component { render() { if ( - !this.context.fullContainer || - !this.context.fullContainer.rangeselector || - !this.context.fullContainer.rangeselector.visible || + !this.props.context.fullContainer || + !this.props.context.fullContainer.rangeselector || + !this.props.context.fullContainer.rangeselector.visible || // next line checks for "all" case - this.context.fullContainer._axisGroup === 0 + this.props.context.fullContainer._axisGroup === 0 ) { return null; } + const {localize: _} = this.context; const { fullContainer: { rangeselector: {buttons = []}, }, - localize: _, - } = this.context; + } = this.props.context; const {children} = this.props; const content = @@ -51,14 +51,26 @@ class RangeSelectorAccordion extends Component { }, }; - return {content ? content : null}; + return ( + + {content ? content : null} + + ); } } RangeSelectorAccordion.contextType = EditorControlsContext; +RangeSelectorAccordion.requireContext = { + container: PropTypes.object, + fullContainer: PropTypes.object, + updateContainer: PropTypes.func, + getValObject: PropTypes.func, +}; + RangeSelectorAccordion.propTypes = { children: PropTypes.node, + context: PropTypes.any, }; RangeSelectorAccordion.plotly_editor_traits = { From 75e9679697c6eefec2f614da7f75e8af6c46163d Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 16:36:17 +0900 Subject: [PATCH 45/69] fix ImageStyles --- src/components/fields/derived.js | 4 ++-- src/lib/connectImageToLayout.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/fields/derived.js b/src/components/fields/derived.js index fb6848e58..603bfd807 100644 --- a/src/components/fields/derived.js +++ b/src/components/fields/derived.js @@ -236,12 +236,12 @@ const numericFractionModifyPlotProps = (props, context, plotProps) => { const min = (attrMeta && attrMeta.min) || 0; const max = (attrMeta && attrMeta.max) || 1; if (isNumeric(fullValue)) { - plotProps.fullValue = Math.round((100 * (fullValue - min)) / (max - min)); + plotProps.fullValue = Math.round(100 * (fullValue - min) / (max - min)); } plotProps.updatePlot = v => { if (isNumeric(v)) { - updatePlot((v / 100) * (max - min) + min); + updatePlot(v / 100 * (max - min) + min); } else { updatePlot(v); } diff --git a/src/lib/connectImageToLayout.js b/src/lib/connectImageToLayout.js index d380ebf70..73b05fa66 100644 --- a/src/lib/connectImageToLayout.js +++ b/src/lib/connectImageToLayout.js @@ -62,11 +62,17 @@ export default function connectImageToLayout(WrappedComponent) { } render() { - const newProps = {...this.props, context: this.provideValue()}; + const newProps = { + ...this.props, + context: {...this.provideValue(), fullLayout: this.context.fullLayout}, + }; if (this.props.children) { return ( - {recursiveMap(this.props.children, this.provideValue())} + {recursiveMap(this.props.children, { + ...this.provideValue(), + fullLayout: this.context.fullLayout, + })} ); } From 7d4ecc15935fae3d26806fcaf02955e078c41364 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 19:47:57 +0900 Subject: [PATCH 46/69] fix some context pass --- src/components/containers/PlotlyFold.js | 4 ++ src/components/containers/derived.js | 40 ++++++++++------- src/components/fields/ArrowSelector.js | 13 ++++-- src/components/fields/GroupCreator.js | 3 ++ src/components/fields/LineSelectors.js | 60 +++++++++++++++---------- src/components/fields/derived.js | 4 +- src/lib/connectAnnotationToLayout.js | 10 ++++- src/lib/connectShapeToLayout.js | 10 ++++- src/lib/recursiveMap.js | 9 ---- 9 files changed, 94 insertions(+), 59 deletions(-) diff --git a/src/components/containers/PlotlyFold.js b/src/components/containers/PlotlyFold.js index 3734c272b..25080daa4 100644 --- a/src/components/containers/PlotlyFold.js +++ b/src/components/containers/PlotlyFold.js @@ -181,6 +181,10 @@ PlotlyFold.plotly_editor_traits = { foldable: true, }; +PlotlyFold.propTypes = { + context: PropTypes.any, +}; + PlotlyFold.requireContext = Object.assign( { deleteContainer: PropTypes.func, diff --git a/src/components/containers/derived.js b/src/components/containers/derived.js index d11e1561c..ec33ee97a 100644 --- a/src/components/containers/derived.js +++ b/src/components/containers/derived.js @@ -1,34 +1,40 @@ -import React from 'react'; +import React, {Component} from 'react'; import PlotlyPanel from './PlotlyPanel'; import PlotlySection from './PlotlySection'; import PropTypes from 'prop-types'; - import {connectLayoutToPlot, containerConnectedContextTypes} from 'lib'; +import {EditorControlsContext} from '../../context'; const LayoutPanel = connectLayoutToPlot(PlotlyPanel); const LayoutSection = connectLayoutToPlot(PlotlySection); -const TraceTypeSection = props => { - // const {fullContainer, fullData} = context; - const { - mode, - traceTypes, - context: {fullContainer, fullData}, - } = props; +class TraceTypeSection extends Component { + render() { + const { + mode, + traceTypes, + context: {fullContainer}, + } = this.props; + const {fullData} = this.context; + + const ifConnectedToTrace = + mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type); - const ifConnectedToTrace = - mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type); + const ifConnectedToLayout = + mode === 'layout' && fullData && fullData.some(t => traceTypes.includes(t.type)); - const ifConnectedToLayout = - mode === 'layout' && fullData && fullData.some(t => traceTypes.includes(t.type)); + if (ifConnectedToTrace || ifConnectedToLayout) { + const {context, ...rest} = this.props; + const newContext = {...context, ...this.context}; + return ; + } - if (ifConnectedToTrace || ifConnectedToLayout) { - return ; + return null; } +} - return null; -}; TraceTypeSection.requireContext = containerConnectedContextTypes; +TraceTypeSection.contextType = EditorControlsContext; TraceTypeSection.propTypes = { children: PropTypes.node, name: PropTypes.string, diff --git a/src/components/fields/ArrowSelector.js b/src/components/fields/ArrowSelector.js index cd7c1a5b6..883988040 100644 --- a/src/components/fields/ArrowSelector.js +++ b/src/components/fields/ArrowSelector.js @@ -1,6 +1,7 @@ import Dropdown from './Dropdown'; -import React from 'react'; +import React, {Component} from 'react'; import ARROW_PATHS from 'plotly.js/src/components/annotations/arrow_paths'; +import {containerConnectedContextTypes} from '../../lib'; const ARROW_OPTIONS = ARROW_PATHS.map(({path}, index) => { const label = ( @@ -29,9 +30,11 @@ const ARROW_OPTIONS = ARROW_PATHS.map(({path}, index) => { }; }); -const ArrowSelector = props => { - return ; -}; +class ArrowSelector extends Component { + render() { + return ; + } +} ArrowSelector.propTypes = { ...Dropdown.propTypes, @@ -41,4 +44,6 @@ ArrowSelector.defaultProps = { clearable: false, }; +ArrowSelector.requireContext = containerConnectedContextTypes; + export default ArrowSelector; diff --git a/src/components/fields/GroupCreator.js b/src/components/fields/GroupCreator.js index c4a279679..ef1685169 100644 --- a/src/components/fields/GroupCreator.js +++ b/src/components/fields/GroupCreator.js @@ -7,6 +7,7 @@ import Button from '../widgets/Button'; import {PlusIcon} from 'plotly-icons'; import {MULTI_VALUED} from 'lib/constants'; import {EditorControlsContext} from '../../context'; +import {containerConnectedContextTypes} from '../../lib/connectToContainer'; class UnconnectedGroupCreator extends Component { getAllGroups() { @@ -64,6 +65,7 @@ class UnconnectedGroupCreator extends Component { options={options} updatePlot={updatePlot} extraComponent={addButton} + context={this.props.context} /> ); } @@ -77,5 +79,6 @@ UnconnectedGroupCreator.propTypes = { }; UnconnectedGroupCreator.contextType = EditorControlsContext; +UnconnectedGroupCreator.requireContext = containerConnectedContextTypes; export default connectToContainer(UnconnectedGroupCreator); diff --git a/src/components/fields/LineSelectors.js b/src/components/fields/LineSelectors.js index cb557cce5..bd86cd2fe 100644 --- a/src/components/fields/LineSelectors.js +++ b/src/components/fields/LineSelectors.js @@ -52,38 +52,52 @@ const computeOptions = (strokeData, stroke) => value, })); -export const LineShapeSelector = props => { - return ; +export class LineShapeSelector extends Component { + render() { + return ( + + ); + } +} +LineShapeSelector.requireContext = { + fullContainer: PropTypes.object, }; -export const LineDashSelector = props => { - return ( - - computeOptions(strokeDashes, lineColor).concat([ - { - label: '', - value: null, - }, - ]) - } - /> - ); +export class LineDashSelector extends Component { + render() { + return ( + + computeOptions(strokeDashes, lineColor).concat([ + { + label: '', + value: null, + }, + ]) + } + /> + ); + } +} + +LineDashSelector.requireContext = { + fullContainer: PropTypes.object, }; class LineSelector extends Component { - constructor(props, context) { - super(props, context); - this.setLocals(props, context); + constructor(props) { + super(props); + this.setLocals(props); } - componentWillReceiveProps(nextProps, nextContext) { - this.setLocals(nextProps, nextContext); + componentWillReceiveProps(nextProps) { + this.setLocals(nextProps); } - setLocals(nextProps, nextContext) { - const {fullContainer} = nextContext; + setLocals(nextProps) { + const {context = {}} = nextProps; + const {fullContainer} = context; const lineColor = nestedProperty(fullContainer, 'line.color').get(); if (!this.options || this.lineColor !== lineColor) { this.options = this.props.computeOptions(lineColor); diff --git a/src/components/fields/derived.js b/src/components/fields/derived.js index 603bfd807..fb6848e58 100644 --- a/src/components/fields/derived.js +++ b/src/components/fields/derived.js @@ -236,12 +236,12 @@ const numericFractionModifyPlotProps = (props, context, plotProps) => { const min = (attrMeta && attrMeta.min) || 0; const max = (attrMeta && attrMeta.max) || 1; if (isNumeric(fullValue)) { - plotProps.fullValue = Math.round(100 * (fullValue - min) / (max - min)); + plotProps.fullValue = Math.round((100 * (fullValue - min)) / (max - min)); } plotProps.updatePlot = v => { if (isNumeric(v)) { - updatePlot(v / 100 * (max - min) + min); + updatePlot((v / 100) * (max - min) + min); } else { updatePlot(v); } diff --git a/src/lib/connectAnnotationToLayout.js b/src/lib/connectAnnotationToLayout.js index 35f686ffc..72c0a0d4f 100644 --- a/src/lib/connectAnnotationToLayout.js +++ b/src/lib/connectAnnotationToLayout.js @@ -63,11 +63,17 @@ export default function connectAnnotationToLayout(WrappedComponent) { } render() { - const newProps = {...this.props, context: this.provideValue()}; + const newProps = { + ...this.props, + context: {...this.provideValue(), fullLayout: this.context.fullLayout}, + }; if (this.props.children) { return ( - {recursiveMap(this.props.children, this.provideValue())} + {recursiveMap(this.props.children, { + ...this.provideValue(), + fullLayout: this.context.fullLayout, + })} ); } diff --git a/src/lib/connectShapeToLayout.js b/src/lib/connectShapeToLayout.js index ab72a6fda..1200dd9af 100644 --- a/src/lib/connectShapeToLayout.js +++ b/src/lib/connectShapeToLayout.js @@ -62,11 +62,17 @@ export default function connectShapeToLayout(WrappedComponent) { } render() { - const newProps = {...this.props, context: this.provideValue()}; + const newProps = { + ...this.props, + context: {...this.provideValue(), fullLayout: this.context.fullLayout}, + }; if (this.props.children) { return ( - {recursiveMap(this.props.children, this.provideValue())} + {recursiveMap(this.props.children, { + ...this.provideValue(), + fullLayout: this.context.fullLayout, + })} ); } diff --git a/src/lib/recursiveMap.js b/src/lib/recursiveMap.js index 72daaa6d8..1a6138eb8 100644 --- a/src/lib/recursiveMap.js +++ b/src/lib/recursiveMap.js @@ -7,15 +7,6 @@ export function recursiveMap(children, context) { return child; } - // if ( - // child.type && - // child.type.displayName && - // (child.type.displayName.indexOf('LayoutConnected') === 0 || - // child.type.displayName.indexOf('TraceConnected') === 0) - // ) { - // return newChild; - // } - if (child.type.requireContext) { const requireContext = {}; const newChildren = {}; From 0cf1f13023442b36174fa1a3d71aabc258948926 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 22:53:48 +0900 Subject: [PATCH 47/69] fix colors in processing --- .../containers/TraceMarkerSection.js | 12 ++++++++---- src/components/fields/MarkerColor.js | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/containers/TraceMarkerSection.js b/src/components/containers/TraceMarkerSection.js index 28954b1ba..01278e16c 100644 --- a/src/components/containers/TraceMarkerSection.js +++ b/src/components/containers/TraceMarkerSection.js @@ -2,6 +2,7 @@ import PlotlySection from './PlotlySection'; import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {EditorControlsContext} from '../../context'; +import {containerConnectedContextTypes} from '../../lib/connectToContainer'; class TraceMarkerSection extends Component { constructor(props, context) { @@ -26,18 +27,21 @@ class TraceMarkerSection extends Component { } render() { - return {this.props.children}; + return ( + + {this.props.children} + + ); } } TraceMarkerSection.propTypes = { children: PropTypes.node, + context: PropTypes.any, name: PropTypes.string, }; TraceMarkerSection.contextType = EditorControlsContext; -TraceMarkerSection.requireContext = { - fullContainer: PropTypes.object, -}; +TraceMarkerSection.requireContext = containerConnectedContextTypes; export default TraceMarkerSection; diff --git a/src/components/fields/MarkerColor.js b/src/components/fields/MarkerColor.js index 807158cd6..471d4b6fc 100644 --- a/src/components/fields/MarkerColor.js +++ b/src/components/fields/MarkerColor.js @@ -12,6 +12,7 @@ import DataSelector from './DataSelector'; import VisibilitySelect from './VisibilitySelect'; import {MULTI_VALUED, COLORS} from 'lib/constants'; import {EditorControlsContext} from '../../context'; +import {containerConnectedContextTypes} from '../../lib/connectToContainer'; class UnconnectedMarkerColor extends Component { constructor(props, context) { @@ -113,6 +114,7 @@ class UnconnectedMarkerColor extends Component { setColorScale={this.setColorScale} onConstantColorOptionChange={this.onConstantColorOptionChange} parentSelectedConstantColorOption={this.state.selectedConstantColorOption} + context={this.props.context} /> ); } @@ -125,8 +127,9 @@ class UnconnectedMarkerColor extends Component { this.props.container.marker.colorscale === MULTI_VALUED) || (this.props.container.marker.colorsrc && this.props.container.marker.colorsrc === MULTI_VALUED)); + return ( - + {this.props.container.marker && this.props.container.marker.colorscale === MULTI_VALUED ? null : ( @@ -160,7 +163,7 @@ class UnconnectedMarkerColor extends Component { return ( - + @@ -197,6 +200,7 @@ class UnconnectedMarkerColor extends Component { options={[{label: _('Auto'), value: true}, {label: _('Custom'), value: false}]} showOn={false} defaultOpt={true} + context={this.props.context} > @@ -223,10 +227,11 @@ UnconnectedMarkerColor.propTypes = { UnconnectedMarkerColor.contextType = EditorControlsContext; -UnconnectedMarkerColor.requireContext = { - updateContainer: PropTypes.func, - traceIndexes: PropTypes.array, - container: PropTypes.object, -}; +UnconnectedMarkerColor.requireContext = containerConnectedContextTypes; +// { +// updateContainer: PropTypes.func, +// traceIndexes: PropTypes.array, +// container: PropTypes.object, +// }; export default connectToContainer(UnconnectedMarkerColor); From f89d10c61139b508ded6ae555fb4f68a4e1722ee Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 22:54:33 +0900 Subject: [PATCH 48/69] remove key --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb8f2c74c..49554faca 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "test:js": "jest --setupTestFrameworkScriptFile=raf/polyfill", "test:lint": "eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:pretty": "prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", - "test:percy": "PERCY_TOKEN=6650afd4ff3ff3088a6ea4c5b14c12f802f15b4ef30f6160a03b2927aee8c398 react-percy", + "test:percy": "react-percy", "test:percy-local": "react-percy --debug", "watch": "babel src --watch --out-dir lib --source-maps | node-sass -w src/styles/main.scss lib/react-chart-editor.css", "watch-test": "jest --watch" From ad1effc0b8616774c8f218b5ef40a8a0a4f9e9e4 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Sun, 25 Nov 2018 23:09:18 +0900 Subject: [PATCH 49/69] change pacakge.json prop-types --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49554faca..07e03b539 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "draft-js-utils": "^1.2.0", "fast-isnumeric": "^1.1.1", "immutability-helper": "^2.7.1", + "prop-types": "^15.6.2", "plotly-icons": "1.2.2", "plotly.js": "^1.42.5", "raf": "^3.4.0", @@ -63,7 +64,6 @@ "postcss-custom-properties": "^6.3.1", "postcss-remove-root": "^0.0.2", "prettier": "^1.14.2", - "prop-types": "^15.6.2", "react": "^16.6.3", "react-ace": "^6.1.4", "react-dom": "^16.6.3", From fbdc732bc6a0cc7a5bca6f8f2061e8c6c08a9213 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 26 Nov 2018 00:29:43 +0900 Subject: [PATCH 50/69] fix StyleTracePanel --- src/components/fields/ColorscalePicker.js | 4 ++++ src/components/fields/DataSelector.js | 6 ++++-- src/components/fields/Field.js | 5 +++++ src/components/fields/MarkerColor.js | 2 ++ src/components/fields/MultiColorPicker.js | 14 ++++++++++++-- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/components/fields/ColorscalePicker.js b/src/components/fields/ColorscalePicker.js index 34575fd91..394ea9a6c 100644 --- a/src/components/fields/ColorscalePicker.js +++ b/src/components/fields/ColorscalePicker.js @@ -50,6 +50,10 @@ UnconnectedColorscalePicker.propTypes = { UnconnectedColorscalePicker.requireContext = { container: PropTypes.object, + defaultContainer: PropTypes.object, + fullContainer: PropTypes.object, + updateContainer: PropTypes.func, + traceIndexes: PropTypes.array, graphDiv: PropTypes.object, }; diff --git a/src/components/fields/DataSelector.js b/src/components/fields/DataSelector.js index 4ca4b1d8c..2b410714d 100644 --- a/src/components/fields/DataSelector.js +++ b/src/components/fields/DataSelector.js @@ -54,7 +54,7 @@ export class UnconnectedDataSelector extends Component { } updatePlot(value) { - if (!this.props.updateContainer) { + if (!this.props.context.updateContainer) { return; } @@ -72,7 +72,7 @@ export class UnconnectedDataSelector extends Component { fromSrc: this.context.srcConverters ? this.context.srcConverters.fromSrc : null, }); - this.props.updateContainer(update); + this.props.context.updateContainer(update); } render() { @@ -112,11 +112,13 @@ UnconnectedDataSelector.propTypes = { fullValue: PropTypes.any, updatePlot: PropTypes.func, container: PropTypes.object, + context: PropTypes.any, ...Field.propTypes, }; UnconnectedDataSelector.requireContext = { container: PropTypes.object, + updateContainer: PropTypes.func, description: PropTypes.string, attr: PropTypes.string, }; diff --git a/src/components/fields/Field.js b/src/components/fields/Field.js index 9f1884d68..e74363b0b 100644 --- a/src/components/fields/Field.js +++ b/src/components/fields/Field.js @@ -109,6 +109,11 @@ Field.propTypes = { }; Field.requireContext = { + container: PropTypes.object, + defaultContainer: PropTypes.object, + fullContainer: PropTypes.object, + updateContainer: PropTypes.func, + traceIndexes: PropTypes.array, description: PropTypes.string, attr: PropTypes.string, }; diff --git a/src/components/fields/MarkerColor.js b/src/components/fields/MarkerColor.js index 471d4b6fc..f60e91565 100644 --- a/src/components/fields/MarkerColor.js +++ b/src/components/fields/MarkerColor.js @@ -188,11 +188,13 @@ class UnconnectedMarkerColor extends Component { label={_('Colorscale Direction')} attr="marker.reversescale" options={[{label: _('Normal'), value: false}, {label: _('Reversed'), value: true}]} + context={this.props.context} /> {selectedConstantColorOption === 'single' ? singleMessage : multiMessage} {selectedConstantColorOption === 'single' ? ( - + ) : ( )} @@ -118,7 +123,12 @@ class UnconnectedMultiColorPicker extends Component { } return ( - + ); } } From 18bee1da20fdf79ba70cb94f8a6eefa177357084 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 26 Nov 2018 00:33:51 +0900 Subject: [PATCH 51/69] remove Field text --- src/components/fields/ErrorBars.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/fields/ErrorBars.js b/src/components/fields/ErrorBars.js index b630cd871..7c92cc27b 100644 --- a/src/components/fields/ErrorBars.js +++ b/src/components/fields/ErrorBars.js @@ -159,7 +159,6 @@ class ErrorBars extends Component { render() { return ( - Field {this.renderModeSelector()} {this.renderErrorBarControls()} From c03d55b705f78728ca59e72fc40155a57d5ccad3 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 26 Nov 2018 00:58:14 +0900 Subject: [PATCH 52/69] add RecursiveComponent --- dev/App.js | 93 ++---------------------------- package.json | 2 +- src/components/fields/ErrorBars.js | 17 +++--- src/lib/recursiveMap.js | 17 +++++- 4 files changed, 31 insertions(+), 98 deletions(-) diff --git a/dev/App.js b/dev/App.js index b46cb424c..ad2d615fa 100644 --- a/dev/App.js +++ b/dev/App.js @@ -6,7 +6,7 @@ import 'react-select/dist/react-select.css'; import brace from 'brace'; // eslint-disable-line no-unused-vars import AceEditor from 'react-ace'; import Select from 'react-select'; -import PlotlyEditor, {DefaultEditor, Panel} from '../src'; +import PlotlyEditor, {DefaultEditor, Panel, StyleNotesPanel, StyleColorbarsPanel} from '../src'; import Inspector from 'react-inspector'; import dataSources from './dataSources'; import 'brace/mode/json'; @@ -163,73 +163,6 @@ class App extends Component { } render() { - const optionalPanel = [ - -
- + - + ); if (mode === 'symmetric') { return ( - + ) : null} {styleAttrs} - + ); } if (mode === 'asymmetric') { return ( - + ) : null} {styleAttrs} - + ); } @@ -170,8 +171,10 @@ ErrorBars.propTypes = { attr: PropTypes.string, fullValue: PropTypes.object, updatePlot: PropTypes.func, + context: PropTypes.any, }; ErrorBars.contextType = EditorControlsContext; +ErrorBars.requireContext = containerConnectedContextTypes; export default connectToContainer(ErrorBars); diff --git a/src/lib/recursiveMap.js b/src/lib/recursiveMap.js index 1a6138eb8..b5df94603 100644 --- a/src/lib/recursiveMap.js +++ b/src/lib/recursiveMap.js @@ -1,4 +1,6 @@ -import React from 'react'; +import React, {Component, Fragment} from 'react'; +import PropTypes from 'prop-types'; +import {containerConnectedContextTypes} from './connectToContainer'; export function recursiveMap(children, context) { return React.Children.map(children, child => { @@ -29,3 +31,16 @@ export function recursiveMap(children, context) { return newChild; }); } + +export class RecursiveComponent extends Component { + render() { + return {recursiveMap(this.props.children, this.props.context)}; + } +} + +RecursiveComponent.propTypes = { + context: PropTypes.any, + children: PropTypes.any, +}; + +RecursiveComponent.requireContext = containerConnectedContextTypes; From 0d12c922fe7d2fb00b67c536a9dc134d752c685d Mon Sep 17 00:00:00 2001 From: oprstchn Date: Mon, 26 Nov 2018 19:34:34 +0900 Subject: [PATCH 53/69] fix UpdateMenuPanel --- dev/App.js | 2 ++ package.json | 2 +- src/components/fields/UpdateMenuButtons.js | 12 +++++++++++- src/lib/connectAxesToLayout.js | 1 + src/lib/connectUpdateMenuToLayout.js | 11 ++++++++++- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dev/App.js b/dev/App.js index ad2d615fa..fabf50ecd 100644 --- a/dev/App.js +++ b/dev/App.js @@ -7,6 +7,7 @@ import brace from 'brace'; // eslint-disable-line no-unused-vars import AceEditor from 'react-ace'; import Select from 'react-select'; import PlotlyEditor, {DefaultEditor, Panel, StyleNotesPanel, StyleColorbarsPanel} from '../src'; +import {StyleUpdateMenusPanel} from '../src/default_panels'; import Inspector from 'react-inspector'; import dataSources from './dataSources'; import 'brace/mode/json'; @@ -208,6 +209,7 @@ class App extends Component { +
+ {dropdown ? ( ) : ( )} {(Array.isArray(showOn) && showOn.includes(this.mode)) || this.mode === showOn ? recursiveMap(this.props.children, this.props.context) : null} - + ); } } @@ -84,6 +82,9 @@ UnconnectedVisibilitySelect.propTypes = { }; UnconnectedVisibilitySelect.requireContext = { + container: PropTypes.object, + defaultContainer: PropTypes.object, + fullContainer: PropTypes.object, updateContainer: PropTypes.func, }; diff --git a/src/default_panels/StyleColorbarsPanel.js b/src/default_panels/StyleColorbarsPanel.js index 6a2a854d8..8a17e80c8 100644 --- a/src/default_panels/StyleColorbarsPanel.js +++ b/src/default_panels/StyleColorbarsPanel.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, {Component} from 'react'; // import PropTypes from 'prop-types'; import { @@ -21,281 +21,526 @@ export const traceHasColorbar = (trace, fullTrace) => (fullTrace.marker && fullTrace.marker.showscale !== undefined) || // eslint-disable-line no-undefined fullTrace.showscale !== undefined; // eslint-disable-line no-undefined -const StyleColorBarsPanel = () => { - return ( - - {({localize: _}) => ( - - {['', 'marker.'].map(prefix => { - return ( - - - - +class StyleColorBarsPanel extends Component { + render() { + const prefixes = ['', 'marker.']; + const content = prefixes.map(prefix => { + const _ = this.context.localize; + return ( + + + + - - - - - - - - + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + - ); - })} - - )} - - ); -}; + + + + + + + + + + + + + + + ); + }); + return {content}; + } +} +StyleColorBarsPanel.contextType = EditorControlsContext; + +// const StyleColorBarsPanel = () => { +// return ( +// +// {({localize: _}) => ( +// +// {['', 'marker.'].map(prefix => { +// return ( +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// ); +// })} +// +// )} +// +// ); +// }; export default StyleColorBarsPanel; diff --git a/src/lib/connectTransformToTrace.js b/src/lib/connectTransformToTrace.js index eec8a5faa..6f268afcf 100644 --- a/src/lib/connectTransformToTrace.js +++ b/src/lib/connectTransformToTrace.js @@ -92,7 +92,7 @@ export default function connectTransformToTrace(WrappedComponent) { TransformConnectedComponent.propTypes = { transformIndex: PropTypes.number.isRequired, children: PropTypes.node, - context: TransformConnectedComponent.requireContext, + context: PropTypes.any, }; const {plotly_editor_traits} = WrappedComponent; From 36b5fa596e6abb9571c0c9b2f1791535e9a2c321 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 02:50:51 +0900 Subject: [PATCH 55/69] move circleci.yml to .circleci/config.yml --- circle.yml => .circleci/config.yml | 5 +++-- .gitignore | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) rename circle.yml => .circleci/config.yml (77%) diff --git a/circle.yml b/.circleci/config.yml similarity index 77% rename from circle.yml rename to .circleci/config.yml index 2a0ad6504..fef713f45 100644 --- a/circle.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: docker: # specify the version you desire here - - image: circleci/node:8.9 + - image: circleci/node:8.11 working_directory: ~/react-chart-editor @@ -13,7 +13,8 @@ jobs: keys: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - + - run: apt-get update -y && \ + apt-get install xserver-xorg-dev libxi-dev libxext-dev -y - run: npm install - save_cache: diff --git a/.gitignore b/.gitignore index 153fc08e8..0c257dd3f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ npm-debug.log* .* !.gitignore !.gitattributes +!.circleci !.npmignore !.eslintrc !.eslintignore From 17380d3fe667abeef2ffcb575c0facacfcabfebb Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:01:52 +0900 Subject: [PATCH 56/69] add sudo --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fef713f45..2ee228a8c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,8 +13,8 @@ jobs: keys: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - - run: apt-get update -y && \ - apt-get install xserver-xorg-dev libxi-dev libxext-dev -y + - run: sudo apt-get update -y && \ + sudo apt-get install xserver-xorg-dev libxi-dev libxext-dev -y - run: npm install - save_cache: From b11f046151a0810466262aefb8ea2d37ddf05b54 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:03:37 +0900 Subject: [PATCH 57/69] apt-get install --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ee228a8c..1a11d01c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ jobs: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - run: sudo apt-get update -y && \ - sudo apt-get install xserver-xorg-dev libxi-dev libxext-dev -y + apt-get install xserver-xorg-dev libxi-dev libxext-dev -y - run: npm install - save_cache: From b7b7c3bf91bddcdf870f4d8f782834e92a54cae4 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:04:53 +0900 Subject: [PATCH 58/69] split apt --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a11d01c5..7b7dc191e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,8 +13,8 @@ jobs: keys: - v1-dependencies-{{ checksum "package.json" }} - v1-dependencies- - - run: sudo apt-get update -y && \ - apt-get install xserver-xorg-dev libxi-dev libxext-dev -y + - run: sudo apt-get update -y + - run: sudo apt-get install xserver-xorg-dev libxi-dev libxext-dev -y - run: npm install - save_cache: From 4f27c4a4069c2da57b9dcd652b6d054aa0ecc01d Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:16:51 +0900 Subject: [PATCH 59/69] update prettier --- package.json | 2 +- src/components/PanelMenuWrapper.js | 14 ++++---- src/components/fields/AxesSelector.js | 15 ++++---- src/components/fields/MarkerColor.js | 4 +-- src/components/fields/derived.js | 4 +-- src/components/widgets/TraceTypeSelector.js | 29 ++++++++------- .../text_editors/RichText/DraftCommands.js | 6 ++-- .../text_editors/RichText/LinkEditor.js | 6 ++-- .../text_editors/RichText/configuration.js | 16 ++++----- .../widgets/text_editors/RichText/index.js | 36 +++++++++---------- 10 files changed, 64 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 07e03b539..936cb31fa 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "postcss-combine-duplicated-selectors": "^6.0.2", "postcss-custom-properties": "^6.3.1", "postcss-remove-root": "^0.0.2", - "prettier": "^1.14.2", + "prettier": "^1.15.2", "react": "^16.6.3", "react-ace": "^6.1.4", "react-dom": "^16.6.3", diff --git a/src/components/PanelMenuWrapper.js b/src/components/PanelMenuWrapper.js index 36df008f5..355392674 100644 --- a/src/components/PanelMenuWrapper.js +++ b/src/components/PanelMenuWrapper.js @@ -93,14 +93,12 @@ class PanelsWithSidebar extends Component {
{menuOpts.map(this.renderSection)}
- {React.Children.map( - this.props.children, - (child, i) => - child === null || - this.state.group !== child.props.group || - this.state.panel !== child.props.name - ? null - : cloneElement(child, {key: i}) + {React.Children.map(this.props.children, (child, i) => + child === null || + this.state.group !== child.props.group || + this.state.panel !== child.props.name + ? null + : cloneElement(child, {key: i}) )}
diff --git a/src/components/fields/AxesSelector.js b/src/components/fields/AxesSelector.js index 233d00585..f005fbeb1 100644 --- a/src/components/fields/AxesSelector.js +++ b/src/components/fields/AxesSelector.js @@ -28,14 +28,13 @@ class AxesSelector extends Component { Object.values(fullLayout._subplots).some(s => s.length > 1); const options = multipleSublots - ? axesOptions.map( - option => - option.value === 'allaxes' - ? option - : { - label: option.title, - value: option.value, - } + ? axesOptions.map(option => + option.value === 'allaxes' + ? option + : { + label: option.title, + value: option.value, + } ) : axesOptions; diff --git a/src/components/fields/MarkerColor.js b/src/components/fields/MarkerColor.js index f60e91565..de6c30079 100644 --- a/src/components/fields/MarkerColor.js +++ b/src/components/fields/MarkerColor.js @@ -179,8 +179,8 @@ class UnconnectedMarkerColor extends Component { {!type ? null : type === 'constant' - ? this.renderConstantControls() - : this.renderVariableControls()} + ? this.renderConstantControls() + : this.renderVariableControls()} {type === 'constant' ? null : ( diff --git a/src/components/fields/derived.js b/src/components/fields/derived.js index fb6848e58..a0afcdafd 100644 --- a/src/components/fields/derived.js +++ b/src/components/fields/derived.js @@ -125,8 +125,8 @@ export const BinningDropdown = connectToContainer(UnconnectedDropdown, { plotProps.fullContainer.type === 'histogram2d' ? 'Z' : plotProps.fullContainer.orientation === 'v' - ? 'Y' - : 'X'; + ? 'Y' + : 'X'; plotProps.options = [ {label: _('Count ') + axis, value: 'count'}, {label: _('Sum ') + axis, value: 'sum'}, diff --git a/src/components/widgets/TraceTypeSelector.js b/src/components/widgets/TraceTypeSelector.js index 8a1e726f2..271e01559 100644 --- a/src/components/widgets/TraceTypeSelector.js +++ b/src/components/widgets/TraceTypeSelector.js @@ -8,21 +8,20 @@ import {EditorControlsContext, ModalProviderContext} from '../../context'; const renderActionItems = (actionItems, item) => actionItems - ? actionItems(item).map( - (action, i) => - !action.onClick ? null : ( - - {action.icon} - - ) + ? actionItems(item).map((action, i) => + !action.onClick ? null : ( + + {action.icon} + + ) ) : null; diff --git a/src/components/widgets/text_editors/RichText/DraftCommands.js b/src/components/widgets/text_editors/RichText/DraftCommands.js index 9cc997daf..888657805 100644 --- a/src/components/widgets/text_editors/RichText/DraftCommands.js +++ b/src/components/widgets/text_editors/RichText/DraftCommands.js @@ -145,9 +145,9 @@ export function insertSoftNewline(editorState) { */ export function toggleInlineStyle(editorState, inlineStyle) { /* - * TODO tech-debt. Link toggles should not go via toggleInlineStyle. - * https://github.com/plotly/streambed/issues/6354 - */ + * TODO tech-debt. Link toggles should not go via toggleInlineStyle. + * https://github.com/plotly/streambed/issues/6354 + */ if (inlineStyle === LINK) { return toggleLink(editorState); diff --git a/src/components/widgets/text_editors/RichText/LinkEditor.js b/src/components/widgets/text_editors/RichText/LinkEditor.js index bf1956a9b..c279cdae4 100644 --- a/src/components/widgets/text_editors/RichText/LinkEditor.js +++ b/src/components/widgets/text_editors/RichText/LinkEditor.js @@ -60,9 +60,9 @@ class LinkEditor extends Component { onInputKeyDown(ev) { /* - * `KeyboardEvent.key` enjoys excellent cross-browser support. - * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key - */ + * `KeyboardEvent.key` enjoys excellent cross-browser support. + * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key + */ const {key} = ev; if (key === RETURN_KEY) { diff --git a/src/components/widgets/text_editors/RichText/configuration.js b/src/components/widgets/text_editors/RichText/configuration.js index 4f756305a..b303e1def 100644 --- a/src/components/widgets/text_editors/RichText/configuration.js +++ b/src/components/widgets/text_editors/RichText/configuration.js @@ -26,10 +26,10 @@ export const STYLE_MAP = { }, [SUBSCRIPT]: { /* - * Can't use text-align; IE renders `text-bottom` properly, but - * FF doesn't (same height as `bottom`). Chrome doesn't understand - * `text-align: bottom`. Use relative positioning instead. - */ + * Can't use text-align; IE renders `text-bottom` properly, but + * FF doesn't (same height as `bottom`). Chrome doesn't understand + * `text-align: bottom`. Use relative positioning instead. + */ lineHeight: 0, fontSize: '65%', position: 'relative', @@ -37,10 +37,10 @@ export const STYLE_MAP = { }, [SUPERSCRIPT]: { /* - * Can't use text-align; IE renders `text-top` properly, but - * FF doesn't (same height as `top`). Chrome doesn't understand - * `text-align: top`. Use relative positioning instead. - */ + * Can't use text-align; IE renders `text-top` properly, but + * FF doesn't (same height as `top`). Chrome doesn't understand + * `text-align: top`. Use relative positioning instead. + */ lineHeight: 0, fontSize: '65%', position: 'relative', diff --git a/src/components/widgets/text_editors/RichText/index.js b/src/components/widgets/text_editors/RichText/index.js index 3db86b479..f3902d664 100644 --- a/src/components/widgets/text_editors/RichText/index.js +++ b/src/components/widgets/text_editors/RichText/index.js @@ -37,12 +37,12 @@ class RichText extends Component { super(props, context); /* - * Initially set state based on the plotly.js annotation content. - * After this, as long as this component is mounted, it owns the source - * of truth for the annotation value via `this.state.editorState`. - * This state may be updated externally via a prop update. - * See `componentWillReceiveProps`. - */ + * Initially set state based on the plotly.js annotation content. + * After this, as long as this component is mounted, it owns the source + * of truth for the annotation value via `this.state.editorState`. + * This state may be updated externally via a prop update. + * See `componentWillReceiveProps`. + */ this.state = { editorState: props.value.toString().trim().length ? this.createEditorStateFromHTML(props.value) @@ -71,13 +71,13 @@ class RichText extends Component { const {linkEditorFocus, editorFocus} = this.state; /* - * Don't worry about what plotly.js thinks the annotation value - * should be while we're using our editor, for these reasons: - * - * 1. The editor should be considered the source of truth, unless the - * user is actually editing the annotation inline, in the chart. - * 2. Sometimes we get updates with stale values. - */ + * Don't worry about what plotly.js thinks the annotation value + * should be while we're using our editor, for these reasons: + * + * 1. The editor should be considered the source of truth, unless the + * user is actually editing the annotation inline, in the chart. + * 2. Sometimes we get updates with stale values. + */ if (linkEditorFocus || editorFocus) { return; } @@ -241,11 +241,11 @@ class RichText extends Component { */ onLinkEditorClose() { /* - * Focus on editor immediately to avoid error that occurs when - * `selection.extend` is called and another element has focus. - * https://bugzilla.mozilla.org/show_bug.cgi?id=921444 - * https://github.com/facebook/draft-js/blob/342576bf7186d07c82a41d9ca8169130669747d6/src/component/selection/setDraftEditorSelection.js#L128-L134 - */ + * Focus on editor immediately to avoid error that occurs when + * `selection.extend` is called and another element has focus. + * https://bugzilla.mozilla.org/show_bug.cgi?id=921444 + * https://github.com/facebook/draft-js/blob/342576bf7186d07c82a41d9ca8169130669747d6/src/component/selection/setDraftEditorSelection.js#L128-L134 + */ this.focus(); // Hide the editor. From 1c0f6abbe1990a0ee7e3c9a3cd508023e84ed677 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:27:59 +0900 Subject: [PATCH 60/69] remove react-percy in package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 936cb31fa..38fff038e 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,6 @@ "react-dom": "^16.6.3", "react-hot-loader": "^4.3.12", "react-inspector": "^2.2.2", - "react-percy": "^0.3.0", "react-test-renderer": "^16.2.0", "rimraf": "2.6.2", "sass-loader": "^7.1.0", From 04bee5297ee86e217d31d60124a5baf8de96e4d3 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:35:52 +0900 Subject: [PATCH 61/69] update percy --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 38fff038e..1a0b57d60 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "eslint-config-prettier": "^3.0.1", "eslint-plugin-import": "^2.8.0", "eslint-plugin-react": "^7.4.0", - "eslint-plugin-react-percy": "^0.2.1", + "eslint-plugin-react-percy": "^0.2.4", "fs": "^0.0.1-security", "gl": "^4.0.4", "glob": "^7.1.2", @@ -116,12 +116,13 @@ "make:lib": "rimraf lib && mkdir lib && npm run make:lib:js && npm run make:lib:css && npm run make:combined-translation-keys", "make:translation-keys": "node scripts/findTranslationKeys.js", "prepublishOnly": "npm run make:lib", + "percy": "react-percy", "start": "webpack-dev-server --hot", "test": "npm run test:lint && npm run test:pretty && npm run test:js", "test:js": "jest --setupTestFrameworkScriptFile=raf/polyfill", "test:lint": "eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:pretty": "prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", - "test:percy": "react-percy", + "test:percy": "npm run percy", "test:percy-local": "react-percy --debug", "watch": "babel src --watch --out-dir lib --source-maps | node-sass -w src/styles/main.scss lib/react-chart-editor.css", "watch-test": "jest --watch" From 1f61ee6c76c22ff26c664f1752ac18742415d01b Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:41:35 +0900 Subject: [PATCH 62/69] avoid percy --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b7dc191e..1d681771a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,4 +23,4 @@ jobs: key: v1-dependencies-{{ checksum "package.json" }} - run: npm test - - run: npm run test:percy +# - run: npm run test:percy From 6ca0995ac0a10e983b2b22edf7ab2db62e76ac47 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:49:10 +0900 Subject: [PATCH 63/69] add @percy/react-percy-ci --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 1a0b57d60..14eb71a9a 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "devDependencies": { "@percy/react": "^0.4.6", + "@percy/react-percy-ci": "^0.4.6", "autoprefixer": "^9.1.3", "babel-cli": "^6.26.0", "babel-core": "^6.26.0", From 70d238105e5a22585bb49e658beb46b20a737884 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:49:55 +0900 Subject: [PATCH 64/69] add percy-test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d681771a..7b7dc191e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,4 +23,4 @@ jobs: key: v1-dependencies-{{ checksum "package.json" }} - run: npm test -# - run: npm run test:percy + - run: npm run test:percy From 1fd7113d33653f691e0b7a9baa90928c4ced11db Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 03:56:18 +0900 Subject: [PATCH 65/69] avoid react-percy in circleci --- .circleci/config.yml | 2 +- package.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b7dc191e..1d681771a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,4 +23,4 @@ jobs: key: v1-dependencies-{{ checksum "package.json" }} - run: npm test - - run: npm run test:percy +# - run: npm run test:percy diff --git a/package.json b/package.json index 14eb71a9a..1a0b57d60 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ }, "devDependencies": { "@percy/react": "^0.4.6", - "@percy/react-percy-ci": "^0.4.6", "autoprefixer": "^9.1.3", "babel-cli": "^6.26.0", "babel-core": "^6.26.0", From 47dd6bfc2da59d42e9efb306bfb5851bca74d9e9 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 15:08:36 +0900 Subject: [PATCH 66/69] fix --- .circleci/config.yml | 3 ++- package.json | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d681771a..f04a11876 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,7 @@ jobs: - run: sudo apt-get update -y - run: sudo apt-get install xserver-xorg-dev libxi-dev libxext-dev -y - run: npm install + - run: npm rebuild node-sass - save_cache: paths: @@ -23,4 +24,4 @@ jobs: key: v1-dependencies-{{ checksum "package.json" }} - run: npm test -# - run: npm run test:percy + - run: npm run test:percy diff --git a/package.json b/package.json index 1a0b57d60..a1d9bb2ee 100644 --- a/package.json +++ b/package.json @@ -116,13 +116,12 @@ "make:lib": "rimraf lib && mkdir lib && npm run make:lib:js && npm run make:lib:css && npm run make:combined-translation-keys", "make:translation-keys": "node scripts/findTranslationKeys.js", "prepublishOnly": "npm run make:lib", - "percy": "react-percy", "start": "webpack-dev-server --hot", "test": "npm run test:lint && npm run test:pretty && npm run test:js", "test:js": "jest --setupTestFrameworkScriptFile=raf/polyfill", "test:lint": "eslint \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", "test:pretty": "prettier -l \"src/**/*.js\" && echo -e '\\033[0;32m'PASS'\\033[0m'", - "test:percy": "npm run percy", + "test:percy": "react-percy", "test:percy-local": "react-percy --debug", "watch": "babel src --watch --out-dir lib --source-maps | node-sass -w src/styles/main.scss lib/react-chart-editor.css", "watch-test": "jest --watch" From dbf7fda7e83a4d1829495c06b08634f0a094da6e Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 15:11:57 +0900 Subject: [PATCH 67/69] test circleci --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f04a11876..5394a603b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,7 @@ jobs: - run: sudo apt-get update -y - run: sudo apt-get install xserver-xorg-dev libxi-dev libxext-dev -y - run: npm install + - run: npm install @percy/react - run: npm rebuild node-sass - save_cache: From d0e1777605060b5d5e3589923f1202002d590a45 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 15:24:51 +0900 Subject: [PATCH 68/69] fix npm install order --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5394a603b..d009e6915 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,8 +15,8 @@ jobs: - v1-dependencies- - run: sudo apt-get update -y - run: sudo apt-get install xserver-xorg-dev libxi-dev libxext-dev -y + - run: npm install -g @percy/react - run: npm install - - run: npm install @percy/react - run: npm rebuild node-sass - save_cache: From 4eaf045df5b8fd9d23fb63eae70b6d684abd1ae3 Mon Sep 17 00:00:00 2001 From: oprstchn Date: Tue, 27 Nov 2018 15:26:31 +0900 Subject: [PATCH 69/69] fix --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d009e6915..f0196e480 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,8 +15,8 @@ jobs: - v1-dependencies- - run: sudo apt-get update -y - run: sudo apt-get install xserver-xorg-dev libxi-dev libxext-dev -y - - run: npm install -g @percy/react - run: npm install + - run: npm install --save-dev @percy/react - run: npm rebuild node-sass - save_cache: