Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 183 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"url": "https://github.com/plotly/react-plotly.js-editor/issues"
},
"scripts": {
"find-strings": "babel-node utils/findLocaleStrings.js",
"make:lib": "mkdirp lib && babel src --out-dir lib --ignore=__tests__/* --source-maps && npm run make:lib:css",
"make:lib:css": "mkdirp lib && node-sass src/styles/main.scss > lib/react-plotly.js-editor.css",
"make:dist": "mkdirp dist && browserify src/PlotlyEditor.js -o ./dist/PlotlyEditor.js -t [ babelify --presets [ es2015 react ] ] -t browserify-global-shim --standalone createPlotlyComponent && uglifyjs ./dist/PlotlyEditor.js --compress --mangle --output ./dist/PlotlyEditor.min.js --source-map filename=dist/PlotlyEditor.min.js.map && make:dist:css",
Expand All @@ -39,10 +40,13 @@
],
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.2",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babel-traverse": "^6.26.0",
"babelify": "^7.3.0",
"browserify": "^14.5.0",
"classnames": "^2.2.5",
Expand Down
2 changes: 1 addition & 1 deletion src/DefaultEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class DefaultEditor extends Component {
<Info>
{_(
'The positioning inputs are relative to the ' +
'anchor points on the text box'
'anchor points on the text box.'
)}
</Info>
<Radio
Expand Down
12 changes: 7 additions & 5 deletions src/components/fields/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, {Component} from 'react';
import MenuPanel from '../containers/MenuPanel';
import classnames from 'classnames';
import {bem, localize} from '../../lib';
import {multiValueText} from '../../lib/constants';
import {getMultiValueText} from '../../lib/constants';

class Field extends Component {
renderPostfix() {
Expand Down Expand Up @@ -48,10 +48,12 @@ class Field extends Component {
<div className={fieldClass}>
{children}
{multiValued ? (
<MenuPanel label={_(multiValueText.title)} ownline question>
<div className="info__title">{_(multiValueText.title)}</div>
<div className="info__text">{_(multiValueText.text)}</div>
<div className="info__sub-text">{_(multiValueText.subText)}</div>
<MenuPanel label={getMultiValueText('title', _)} ownline question>
<div className="info__title">{getMultiValueText('title', _)}</div>
<div className="info__text">{getMultiValueText('text', _)}</div>
<div className="info__sub-text">
{getMultiValueText('subText', _)}
</div>
</MenuPanel>
) : null}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/ColorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CustomColorPicker = localize(
return (
<div>
<div>
<p className="colorpicker__title">{_('Custom colors')}</p>
<p className="colorpicker__title">{_('Custom Colors')}</p>
<div className="colorpicker__saturation">
<Saturation {...props} />
</div>
Expand All @@ -72,7 +72,7 @@ const CustomColorPicker = localize(
</div>
</div>
<div>
<p className="colorpicker__title">{_('Default colors')}</p>
<p className="colorpicker__title">{_('Default Colors')}</p>
<div className="colorpicker__preset-colors">
<PresetColors colors={defaultColors} onClick={onChangeComplete} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/text_editors/RichText/LinkEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class LinkEditor extends Component {
render() {
const {position} = this.state;
const {onBlur, onFocus, linkURL, localize: _} = this.props;
const placeholderText = _('Enter link URL');
const placeholderText = _('Enter Link URL');
const urlText = _('URL');

return (
Expand Down
21 changes: 13 additions & 8 deletions src/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ export const MULTI_VALUED = '\x1bMIXED_VALUES';
// how mixed values are represented in text inputs
export const MULTI_VALUED_PLACEHOLDER = '---';

export const 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.',
export const getMultiValueText = (key, _) => {
const 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];
};

export const EDITOR_ACTIONS = {
Expand Down
Loading