Skip to content

Commit 8097fbd

Browse files
authored
Merge pull request #1172 from plotly/refresh
Refresh
2 parents 5baa87d + d27b1b8 commit 8097fbd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1648
-1960
lines changed

circle.yml renamed to .circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ jobs:
33
build:
44
docker:
55
# specify the version you desire here
6-
- image: circleci/node:12.13.1-browsers
6+
- image: cimg/node:20.6.0-browsers
77

88
working_directory: ~/react-chart-editor
99

@@ -14,12 +14,12 @@ jobs:
1414
- v2-dependencies-{{ checksum "package.json" }}
1515
- v2-dependencies-
1616

17-
- run: npm install
17+
- run: yarn install
1818

1919
- save_cache:
2020
paths:
2121
- node_modules
2222
key: v2-dependencies-{{ checksum "package.json" }}
2323

24-
- run: npm test
25-
- run: npm run test:percy
24+
- run: yarn test
25+
- run: yarn test:percy

.eslintrc

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"extends": ["eslint:recommended", "prettier"],
3-
"parser": "babel-eslint",
3+
"parser": "@babel/eslint-parser",
44
"parserOptions": {
5-
"ecmaVersion": 6,
5+
"ecmaVersion": 13,
66
"sourceType": "module",
77
"ecmaFeatures": {
88
"arrowFunctions": true,
@@ -15,6 +15,9 @@
1515
"modules": true,
1616
"templateStrings": true,
1717
"jsx": true
18+
},
19+
"babelOptions": {
20+
"presets": ["@babel/preset-react"]
1821
}
1922
},
2023
"settings": {
@@ -25,24 +28,18 @@
2528
},
2629
"env": {
2730
"browser": true,
28-
"es6": true,
31+
"es2021": true,
2932
"jasmine": true,
3033
"jest": true,
3134
"node": true
3235
},
3336
"globals": {
3437
"jest": true
3538
},
36-
"plugins": [
37-
"react",
38-
"import",
39-
"react-percy"
40-
],
39+
"plugins": ["react", "import", "react-percy", "jsx"],
4140
"overrides": [
4241
{
43-
"files": [
44-
"**/*.percy.{js,jsx}"
45-
],
42+
"files": ["**/*.percy.{js,jsx}"],
4643
"env": {
4744
"react-percy/globals": true
4845
}
@@ -120,20 +117,30 @@
120117
"react/prop-types": "error",
121118
"valid-jsdoc": ["error"],
122119
"yoda": ["error"],
123-
"spaced-comment": ["error", "always", {
124-
"block": {
125-
"exceptions": ["*"]
120+
"spaced-comment": [
121+
"error",
122+
"always",
123+
{
124+
"block": {
125+
"exceptions": ["*"]
126+
}
126127
}
127-
}],
128-
"no-unused-vars": ["error", {
128+
],
129+
"no-unused-vars": [
130+
"error",
131+
{
129132
"args": "after-used",
130133
"argsIgnorePattern": "^_",
131134
"caughtErrorsIgnorePattern": "^e$"
132-
}],
133-
"no-magic-numbers": ["error", {
134-
"ignoreArrayIndexes": true,
135+
}
136+
],
137+
"no-magic-numbers": [
138+
"error",
139+
{
140+
"ignoreArrayIndexes": true,
135141
"ignore": [-1, 0, 1, 2, 3, 100, 10, 0.5]
136-
}],
142+
}
143+
],
137144
"no-underscore-dangle": ["off"]
138145
}
139146
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ npm-debug.log*
1010
!.npmignore
1111
!.eslintrc
1212
!.eslintignore
13+
!.percy.yml
14+
!.circleci
1315

1416
example/dist
1517

.npmignore

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
1+
# Almost all .gitignore content
2+
3+
npm-debug.log*
4+
*.sublime*
5+
accessTokens.js
6+
yarn.lock
7+
yarn-error.log
8+
package-lock.json
9+
storybook-static
10+
11+
12+
# Additionally:
13+
114
test
215
src
316
build
417
examples
518

6-
circle.yml
7-
819
.ackrc
920
.agignore
21+
.circleci
22+
.github
23+
.storybook
1024
.babelrc
1125
.eslintrc
1226
.gitattributes
27+
.percy.yml
1328
.prettierrc
1429
.git
30+
babel.config.json
31+
postcss.config.js
32+
renovate.json
1533

1634
npm-debug.log

.percy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
snapshot:
3+
widths:
4+
- 500
5+
minHeight: 600
6+
percyCSS: ""
7+
discovery:
8+
allowedHostnames: []
9+
disallowedHostnames: []
10+
networkIdleTimeout: 100
11+
upload:
12+
files: "**/*.{png,jpg,jpeg}"
13+
ignore: ""
14+
stripExtensions: false

.storybook/main.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
module.exports = {
2-
stories: ['../src/__stories__/index.js'],
2+
stories: ['../src/__stories__/*.stories.js'],
3+
core: {
4+
disableTelemetry: true, // Disables telemetry
5+
},
6+
framework: {
7+
name: '@storybook/react-webpack5',
8+
options: {},
9+
},
10+
docs: {
11+
autodocs: false,
12+
},
313
};

.storybook/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22

3-
module.exports = async ({config, mode}) => {
3+
module.exports = async ({config}) => {
44
config.module.rules.push({
55
test: /\.scss$/,
66
use: ['style-loader', 'css-loader', 'sass-loader'],

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Check out the demo of the latest release of the `DefaultEditor` at https://plotl
1818
git clone [this repo]
1919
cd react-chart-editor
2020
cd examples/demo
21-
npm install
22-
npm start
21+
yarn install
22+
yarn watch
2323
```
2424

2525
See more examples
@@ -41,10 +41,10 @@ This repo contains a [dev app](https://github.com/plotly/react-chart-editor/tree
4141

4242
```
4343
cp accessTokens.tpl.js accessTokens.js # and edit to taste
44-
npm install
45-
npm start
44+
yarn install
45+
yarn watch
4646
# hacking happens here
47-
npm test
47+
yarn test
4848
```
4949

5050
## Built-in Components

THEMING.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,3 @@ Here is a sample theme to change the UI from light to dark. We attach all of our
7777
You can inspect the editor and see a full listing of all variables that you can override:
7878

7979
![see-css-variables-inspector](https://user-images.githubusercontent.com/11803153/34531018-7e24bbba-f076-11e7-90cd-a35fe5eae84d.png)
80-
81-
## Caveats
82-
83-
CSS custom properties are not supported in IE11. However, you can use a [PostCSS](https://github.com/postcss/postcss) plugin to convert the css properties to their true value when they are used. We are using [PostCSS Custom Properties](https://github.com/postcss/postcss-custom-properties).
84-
85-
The PostCSS plugin we are using only applies to variables that are in the `:root{}` scope. If you'd like to both theme and use your styles to support IE11, you would need to import the unminified IE styles we ship with the editor:
86-
`import react-chart-editor/lib/react-chart-editor.ie.css` (this stylesheet has the variables attached to the `:root{}` scope).
87-
88-
Then, rather than applying your custom properties to `.theme--dark .plotly-editor--theme-provider`, you would apply your overrides to `:root{}`.
89-
90-
Finally, you would pipe in the PostCSS plugin(s) to your project and produce a css file with the properties applied as their true value. It's recommended to use the [PostCSS Remove Root](https://github.com/cbracco/postcss-remove-root) plugin after you have converted all of the properties.
91-
92-
You can see our PostCSS scripts [here](https://github.com/plotly/react-chart-editor/tree/master/scripts/postcss.js).

babel.config.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"env": {
3+
"development": {"comments": false, "minified": true},
4+
"production": {"comments": true, "minified": false}
5+
},
6+
"presets": [
7+
[
8+
"@babel/preset-react",
9+
{
10+
"runtime": "automatic"
11+
}
12+
],
13+
"@babel/env"
14+
],
15+
"plugins": [
16+
"react-hot-loader/babel",
17+
"@babel/plugin-proposal-object-rest-spread",
18+
[
19+
"module-resolver",
20+
{
21+
"root": ["./"],
22+
"alias": {
23+
"components": "./src/components",
24+
"lib": "./src/lib",
25+
"styles": "./src/styles"
26+
}
27+
}
28+
]
29+
]
30+
}

0 commit comments

Comments
 (0)