react-tooltip 4.5.0 → 5.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.editorconfig +25 -0
  2. package/.eslintrc.json +94 -0
  3. package/.gitattributes +3 -0
  4. package/.github/FUNDING.yml +13 -0
  5. package/.github/workflows/lint.yaml +35 -0
  6. package/.github/workflows/pull-request.yaml +11 -0
  7. package/.github/workflows/release.yaml +30 -0
  8. package/.husky/pre-commit +6 -0
  9. package/.prettierrc.json +10 -0
  10. package/.stylelintrc.json +19 -0
  11. package/.vscode/settings.json +27 -0
  12. package/bower.json +26 -0
  13. package/build/dist/react-tooltip.cjs.js +2909 -0
  14. package/build/dist/react-tooltip.cjs.min.js +6 -0
  15. package/build/dist/react-tooltip.css +73 -0
  16. package/build/dist/react-tooltip.esm.js +2901 -0
  17. package/build/dist/react-tooltip.esm.min.js +6 -0
  18. package/build/dist/react-tooltip.min.css +1 -0
  19. package/build/dist/react-tooltip.umd.js +2913 -0
  20. package/build/dist/react-tooltip.umd.min.js +6 -0
  21. package/build/index.css +79 -0
  22. package/build/index.html +19 -0
  23. package/build/index.js +36190 -0
  24. package/cli.js +30 -0
  25. package/contributing.md +40 -0
  26. package/dist/react-tooltip.cjs.js +2932 -0
  27. package/dist/react-tooltip.cjs.min.js +6 -0
  28. package/dist/react-tooltip.css +73 -0
  29. package/dist/react-tooltip.esm.js +2924 -0
  30. package/dist/react-tooltip.esm.min.js +6 -0
  31. package/dist/react-tooltip.min.css +1 -0
  32. package/dist/react-tooltip.umd.js +2936 -0
  33. package/dist/react-tooltip.umd.min.js +6 -0
  34. package/docs/README.md +50 -0
  35. package/docs/babel.config.js +3 -0
  36. package/docs/docs/examples/_category_.json +7 -0
  37. package/docs/docs/examples/basic-examples.mdx +68 -0
  38. package/docs/docs/examples/children.mdx +67 -0
  39. package/docs/docs/examples/content.mdx +80 -0
  40. package/docs/docs/examples/delay.mdx +84 -0
  41. package/docs/docs/examples/events.mdx +85 -0
  42. package/docs/docs/examples/get-content.mdx +58 -0
  43. package/docs/docs/examples/html.mdx +75 -0
  44. package/docs/docs/examples/multiline.mdx +91 -0
  45. package/docs/docs/examples/offset.mdx +69 -0
  46. package/docs/docs/examples/place.mdx +55 -0
  47. package/docs/docs/examples/state.mdx +331 -0
  48. package/docs/docs/examples/styling.mdx +388 -0
  49. package/docs/docs/examples/variant.mdx +100 -0
  50. package/docs/docs/getting-started.md +70 -0
  51. package/docs/docs/options.mdx +105 -0
  52. package/docs/docs/upgrade-guide/_category_.json +7 -0
  53. package/docs/docs/upgrade-guide/basic-examples-v4-v5.mdx +119 -0
  54. package/docs/docs/upgrade-guide/changelog-v4-v5.md +85 -0
  55. package/docs/docusaurus.config.js +126 -0
  56. package/docs/package.json +47 -0
  57. package/docs/sidebars.js +33 -0
  58. package/docs/src/components/HomepageFeatures/index.tsx +70 -0
  59. package/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  60. package/docs/src/css/custom.css +74 -0
  61. package/docs/src/pages/index.module.css +35 -0
  62. package/docs/src/pages/index.tsx +42 -0
  63. package/docs/src/pages/markdown-page.md +7 -0
  64. package/docs/static/.nojekyll +0 -0
  65. package/docs/static/img/docusaurus.png +0 -0
  66. package/docs/static/img/favicon.ico +0 -0
  67. package/docs/static/img/logo.svg +1 -0
  68. package/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  69. package/docs/static/img/undraw_docusaurus_react.svg +170 -0
  70. package/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  71. package/docs/tsconfig.json +7 -0
  72. package/docs/yarn.lock +7579 -0
  73. package/example-v5/package.json +21 -0
  74. package/example-v5/public/index.html +20 -0
  75. package/example-v5/public/manifest.json +8 -0
  76. package/example-v5/src/App.jsx +908 -0
  77. package/example-v5/src/index.css +238 -0
  78. package/example-v5/src/index.js +15 -0
  79. package/example-v5/src/index.scss +251 -0
  80. package/package.json +94 -146
  81. package/public/index.html +19 -0
  82. package/rollup.config.dev.js +88 -0
  83. package/rollup.config.prod.js +104 -0
  84. package/rollup.config.types.js +7 -0
  85. package/tsconfig.json +109 -0
  86. package/dist/index.es.js +0 -3185
  87. package/dist/index.es.js.map +0 -1
  88. package/dist/index.js +0 -3192
  89. package/dist/index.js.map +0 -1
  90. package/dist/react-tooltip.d.ts +0 -124
package/package.json CHANGED
@@ -1,39 +1,37 @@
1
1
  {
2
2
  "name": "react-tooltip",
3
- "version": "4.5.0",
3
+ "version": "5.0.0-beta.0",
4
4
  "description": "react tooltip component",
5
- "private": false,
6
- "main": "dist/index.js",
7
- "types": "dist/react-tooltip.d.ts",
8
- "module": "dist/index.es.js",
9
- "jsnext:main": "dist/index.es.js",
10
- "engines": {
11
- "npm": ">=6.13"
12
- },
13
5
  "scripts": {
14
- "test": "npm-run-all test:unit",
15
- "pretest": "npm-run-all pretty:quick lint:staged",
16
- "eslint:fix": "./node_modules/.bin/eslint . --ignore-path ./.eslintignore --fix",
17
- "pretty:quick": "./node_modules/.bin/pretty-quick --staged",
18
- "lint:staged": "./node_modules/.bin/lint-staged",
19
- "test:unit": "mocha --require @babel/register --require ignore-styles test/*.spec.js",
20
- "clean": "rimraf dist",
21
- "build:rollup": "rollup -c",
22
- "build": "npm-run-all clean copy:types build:rollup",
23
- "build:watch": "rollup -c -w",
24
- "start": "npm-run-all clean build:watch",
25
- "gh-pages": "gh-pages -d example",
26
- "github-changes": "github-changes -o ReactTooltip -r react-tooltip -a --only-pulls --use-commit-body",
27
- "copy:types": "cpy ./react-tooltip.d.ts ./dist --parents --dot",
6
+ "dev": "node ./cli.js --env=development && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.dev.js --watch",
7
+ "build": "node ./cli.js --env=production && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.prod.js",
8
+ "types": "node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.types.js",
9
+ "eslint": "eslint --ext=js --ext=jsx --ext=ts --ext=tsx --fix ./src",
10
+ "stylelint": "stylelint \"src/**/*.css\"",
11
+ "prettier": "prettier --config ./.prettierrc.json --write \"src/**/*{.js,.jsx,.ts,.tsx,.css}\"",
28
12
  "cm": "git cz",
29
- "semantic-release": "semantic-release",
30
13
  "prepare": "husky install"
31
14
  },
32
- "config": {
33
- "commitizen": {
34
- "path": "node_modules/cz-conventional-changelog"
15
+ "main": "dist/react-tooltip.esm.js",
16
+ "buildFormats": [
17
+ {
18
+ "file": "dist/react-tooltip.umd.js",
19
+ "format": "umd"
20
+ },
21
+ {
22
+ "file": "dist/react-tooltip.cjs.js",
23
+ "format": "cjs"
24
+ },
25
+ {
26
+ "file": "dist/react-tooltip.esm.js",
27
+ "format": "es"
35
28
  }
36
- },
29
+ ],
30
+ "types": "dist/index.d.ts",
31
+ "type": "module",
32
+ "license": "MIT",
33
+ "private": false,
34
+ "author": "ReactTooltip",
37
35
  "repository": "https://github.com/ReactTooltip/react-tooltip",
38
36
  "keywords": [
39
37
  "react",
@@ -41,135 +39,85 @@
41
39
  "tooltip",
42
40
  "react-tooltip"
43
41
  ],
44
- "author": "ReactTooltip",
45
- "license": "MIT",
46
42
  "bugs": {
47
43
  "url": "https://github.com/ReactTooltip/react-tooltip/issues"
48
44
  },
49
45
  "homepage": "https://github.com/ReactTooltip/react-tooltip#readme",
50
- "browserify-shim": {
51
- "react": "global:React",
52
- "react-dom": "global:ReactDOM"
53
- },
54
- "peerDependencies": {
55
- "react": ">=16.0.0",
56
- "react-dom": ">=16.0.0"
57
- },
58
- "dependencies": {
59
- "prop-types": "^15.8.1",
60
- "uuid": "^7.0.3"
61
- },
62
46
  "devDependencies": {
63
- "@babel/cli": "7.19.3",
64
- "@babel/core": "7.19.3",
65
- "@babel/eslint-parser": "7.19.1",
66
- "@babel/plugin-proposal-class-properties": "^7.18.6",
67
- "@babel/plugin-proposal-decorators": "7.19.3",
68
- "@babel/plugin-proposal-json-strings": "^7.18.6",
69
- "@babel/plugin-proposal-object-rest-spread": "7.19.4",
70
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
71
- "@babel/plugin-syntax-import-meta": "^7.10.4",
72
- "@babel/preset-env": "^7.19.4",
73
- "@babel/preset-react": "^7.18.6",
74
- "@babel/register": "^7.18.9",
75
- "@commitlint/cli": "17.1.2",
76
- "@commitlint/config-conventional": "17.1.0",
77
- "@commitlint/travis-cli": "17.1.2",
78
- "@rollup/plugin-commonjs": "23.0.0",
79
- "@rollup/plugin-node-resolve": "^13.3.0",
80
- "@semantic-release/changelog": "^6.0.1",
81
- "@semantic-release/commit-analyzer": "^9.0.2",
82
- "@semantic-release/git": "^10.0.1",
83
- "@semantic-release/npm": "^9.0.1",
84
- "@semantic-release/release-notes-generator": "^10.0.3",
85
- "@svgr/rollup": "6.4.0",
86
- "@testing-library/react": "13.4.0",
87
- "babel-loader": "8.2.5",
88
- "babelify": "^10.0.0",
89
- "browserify": "^17.0.0",
90
- "browserify-shim": "^3.8.15",
91
- "chai": "^4.3.6",
92
- "chai-enzyme": "^1.0.0-beta.1",
93
- "chai-spies": "^1.0.0",
94
- "commitizen": "4.2.5",
95
- "concurrently": "7.4.0",
96
- "core-js": "3.25.5",
97
- "cpy-cli": "4.2.0",
47
+ "@rollup/plugin-commonjs": "22.0.2",
48
+ "@rollup/plugin-node-resolve": "14.1.0",
49
+ "@rollup/plugin-replace": "4.0.0",
50
+ "@rollup/plugin-typescript": "8.5.0",
51
+ "@types/css": "^0.0.33",
52
+ "@types/css-modules": "^1.0.2",
53
+ "@types/react": "^18.0.21",
54
+ "@types/react-dom": "^18.0.6",
55
+ "@typescript-eslint/eslint-plugin": "^5.42.1",
56
+ "@typescript-eslint/parser": "^5.42.1",
57
+ "commitizen": "^4.2.5",
58
+ "css-loader": "6.7.2",
98
59
  "cz-conventional-changelog": "^3.3.0",
99
- "enzyme": "^3.11.0",
100
- "enzyme-adapter-react-16": "^1.15.6",
101
- "eslint": "8.25.0",
102
- "eslint-config-jss": ">=5.0.1",
103
- "eslint-config-prettier": ">=8.5.0",
104
- "eslint-config-standard": "^17.0.0",
105
- "eslint-config-standard-react": ">=11.0.1",
106
- "eslint-plugin-import": ">=2.26.0",
107
- "eslint-plugin-node": ">=11.1.0",
108
- "eslint-plugin-prettier": "4.2.1",
109
- "eslint-plugin-promise": "6.1.0",
110
- "eslint-plugin-react": "7.31.10",
111
- "gh-pages": "4.0.0",
112
- "github-changes": "^2.0.3",
113
- "http-server": "^14.1.1",
114
- "husky": "^8.0.0",
115
- "ignore-styles": "5.0.1",
116
- "jsdom": "20.0.1",
117
- "lint-staged": "^13.0.3",
118
- "mocha": "^10.0.0",
119
- "mocha-each": "^2.0.1",
120
- "mocha-jsdom": "^2.0.0",
121
- "npm-run-all": "^4.1.5",
122
- "postcss-nested": "^5.0.6",
123
- "postcss-scss": "4.0.5",
124
- "postcss-simple-vars": "^6.0.3",
125
- "prettier": "2.7.1",
126
- "pretty-quick": "^3.1.3",
127
- "react": "^18.2.0",
128
- "react-addons-test-utils": "^15.1.0",
129
- "react-dom": "^18.2.0",
60
+ "eslint": "8.28.0",
61
+ "eslint-config-airbnb": "19.0.4",
62
+ "eslint-config-prettier": "^8.3.0",
63
+ "eslint-plugin-import": "^2.24.2",
64
+ "eslint-plugin-jsx-a11y": "^6.4.1",
65
+ "eslint-plugin-prettier": "^4.0.0",
66
+ "eslint-plugin-react": "7.31.11",
67
+ "eslint-plugin-react-hooks": "^4.2.0",
68
+ "husky": "^8.0.1",
69
+ "lint-staged": "13.0.3",
70
+ "postcss": "8.4.19",
71
+ "prettier": "^2.4.1",
72
+ "process": "^0.11.10",
73
+ "prop-types": "^15.7.2",
74
+ "react": "18.2.0",
75
+ "react-dom": "18.2.0",
76
+ "react-test-renderer": "18.2.0",
130
77
  "rimraf": "^3.0.2",
131
- "rollup": "^2.77.2",
132
- "rollup-plugin-babel": "^4.4.0",
133
- "rollup-plugin-eslint": "7.0.0",
134
- "rollup-plugin-peer-deps-external": "^2.2.4",
135
- "rollup-plugin-postcss": "^4.0.2",
136
- "rollup-plugin-sass": "1.12.16",
137
- "rollup-plugin-stylelint": "1.0.0",
138
- "rollup-plugin-url": "^3.0.1",
139
- "sass": "1.55.0",
140
- "semantic-release": "19.0.5",
141
- "snazzy": "^9.0.0",
142
- "standard": "^17.0.0",
143
- "stylelint": "14.13.0",
144
- "stylelint-config-standard": "26.0.0",
145
- "uglifyjs": "^2.4.10",
146
- "watchify": "^4.0.0"
78
+ "rollup": "2.79.1",
79
+ "rollup-plugin-analyzer": "^4.0.0",
80
+ "rollup-plugin-browsersync": "^1.3.3",
81
+ "rollup-plugin-copy": "^3.4.0",
82
+ "rollup-plugin-dts": "4.2.3",
83
+ "rollup-plugin-filesize": "^9.1.1",
84
+ "rollup-plugin-html-scaffold": "^0.2.0",
85
+ "rollup-plugin-postcss": "^4.0.1",
86
+ "rollup-plugin-progress": "^1.1.2",
87
+ "rollup-plugin-string": "^3.0.0",
88
+ "rollup-plugin-terser": "^7.0.2",
89
+ "rollup-plugin-visualizer": "^5.5.2",
90
+ "style-loader": "^3.3.0",
91
+ "stylelint": "^13.13.1",
92
+ "stylelint-config-prettier": "^8.0.2",
93
+ "stylelint-config-standard": "^22.0.0",
94
+ "typescript": "^4.8.4"
147
95
  },
148
- "files": [
149
- "dist"
150
- ],
151
- "release": {
152
- "plugins": [
153
- "@semantic-release/commit-analyzer",
154
- "@semantic-release/release-notes-generator",
155
- "@semantic-release/changelog",
156
- "@semantic-release/npm",
157
- "@semantic-release/git"
158
- ],
159
- "branch": "master"
96
+ "peerDependencies": {
97
+ "react": ">=18.0.0",
98
+ "react-dom": ">=18.0.0"
160
99
  },
161
- "commitlint": {
162
- "extends": [
163
- "@commitlint/config-conventional"
100
+ "browserslist": {
101
+ "production": [
102
+ ">0.2%",
103
+ "not dead",
104
+ "not op_mini all"
105
+ ],
106
+ "development": [
107
+ "last 1 chrome version",
108
+ "last 1 firefox version",
109
+ "last 1 safari version"
164
110
  ]
165
111
  },
166
- "lint-staged": {
167
- "*.{js,ts}": "yarn eslint:fix"
168
- },
169
- "husky": {
170
- "hooks": {
171
- "pre-commit": "yarn pretest",
172
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
112
+ "config": {
113
+ "commitizen": {
114
+ "path": "node_modules/cz-conventional-changelog"
173
115
  }
116
+ },
117
+ "dependencies": {
118
+ "@floating-ui/dom": "^1.0.4",
119
+ "@floating-ui/react-dom": "^1.0.0",
120
+ "@floating-ui/react-dom-interactions": "0.11.0",
121
+ "classnames": "^2.3.2"
174
122
  }
175
123
  }
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="theme-color" content="#009ee2" />
7
+
8
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
9
+ <title>Dev - React Tooltip</title>
10
+ <link rel="stylesheet" href="index.css" />
11
+ </head>
12
+ <body>
13
+ <noscript>You need to enable JavaScript to run this app. Please enable JavaScript 😭</noscript>
14
+
15
+ <div id="app"></div>
16
+
17
+ <script type="module" src="<%= appBundle %>"></script>
18
+ </body>
19
+ </html>
@@ -0,0 +1,88 @@
1
+ // import analyze from 'rollup-plugin-analyzer'
2
+ import commonjs from '@rollup/plugin-commonjs'
3
+ import filesize from 'rollup-plugin-filesize'
4
+ import postcss from 'rollup-plugin-postcss'
5
+ import progress from 'rollup-plugin-progress'
6
+ import browsersync from 'rollup-plugin-browsersync'
7
+ import html from 'rollup-plugin-html-scaffold'
8
+ import replace from '@rollup/plugin-replace'
9
+ import copy from 'rollup-plugin-copy'
10
+ import { nodeResolve } from '@rollup/plugin-node-resolve'
11
+ import ts from '@rollup/plugin-typescript'
12
+ import typescript from 'typescript'
13
+
14
+ const input = ['src/index-dev.tsx']
15
+
16
+ const name = 'ReactTooltip'
17
+
18
+ const globals = {
19
+ react: 'React',
20
+ 'react-dom': 'ReactDOM',
21
+ classnames: 'classNames',
22
+ 'prop-types': 'PropTypes',
23
+ }
24
+
25
+ const plugins = [
26
+ progress(),
27
+ html({
28
+ input: './public/index.html',
29
+ output: './build/index.html',
30
+ template: { appBundle: 'index.js' },
31
+ }),
32
+ replace({
33
+ preventAssignment: true,
34
+ values: {
35
+ 'process.env.NODE_ENV': JSON.stringify('development'),
36
+ },
37
+ }),
38
+ postcss({
39
+ extract: true,
40
+ autoModules: true,
41
+ include: '**/*.css',
42
+ extensions: ['.css'],
43
+ plugins: [],
44
+ }),
45
+ nodeResolve(),
46
+ ts({
47
+ typescript,
48
+ tsconfig: './tsconfig.json',
49
+ noEmitOnError: false,
50
+ // declaration: true,
51
+ // declarationDir: './build',
52
+ }),
53
+ commonjs({
54
+ include: 'node_modules/**',
55
+ }),
56
+ // analyze(), // to check diff of file size when bundle
57
+ filesize(),
58
+ copy({
59
+ // targets: [
60
+ // { src: 'src/assets', dest: 'build/' },
61
+ // { src: 'public/manifest.json', dest: 'build/' },
62
+ // { src: 'public/offline.html', dest: 'build/' },
63
+ // ],
64
+ targets: [{ src: 'dist/', dest: 'build/' }],
65
+ verbose: true,
66
+ }),
67
+ browsersync({
68
+ server: 'build',
69
+ watch: true,
70
+ ui: false,
71
+ open: false,
72
+ // port: 3000,
73
+ // ui: {
74
+ // port: 3001,
75
+ // },
76
+ }),
77
+ ]
78
+
79
+ export default {
80
+ input,
81
+ output: {
82
+ file: 'build/index.js',
83
+ format: 'umd',
84
+ name,
85
+ globals,
86
+ },
87
+ plugins,
88
+ }
@@ -0,0 +1,104 @@
1
+ import commonjs from '@rollup/plugin-commonjs'
2
+ import filesize from 'rollup-plugin-filesize'
3
+ import postcss from 'rollup-plugin-postcss'
4
+ import progress from 'rollup-plugin-progress'
5
+ import replace from '@rollup/plugin-replace'
6
+ import { nodeResolve } from '@rollup/plugin-node-resolve'
7
+ import ts from '@rollup/plugin-typescript'
8
+ import { terser } from 'rollup-plugin-terser'
9
+ import typescript from 'typescript'
10
+ import pkg from './package.json'
11
+
12
+ const input = ['src/index.tsx']
13
+
14
+ const name = 'ReactTooltip'
15
+
16
+ const external = ['react', 'react-dom', 'prop-types']
17
+
18
+ const globals = {
19
+ react: 'React',
20
+ 'react-dom': 'ReactDOM',
21
+ classnames: 'classNames',
22
+ 'prop-types': 'PropTypes',
23
+ }
24
+
25
+ // splitted to be reusable by minified css build and unminified css
26
+ const pluginsBeforePostCSS = [
27
+ progress(),
28
+ replace({
29
+ preventAssignment: true,
30
+ values: {
31
+ 'process.env.NODE_ENV': JSON.stringify('development'),
32
+ },
33
+ }),
34
+ ]
35
+
36
+ // splitted to be reusable by minified css build and unminified css
37
+ const pluginsAfterPostCSS = [
38
+ nodeResolve(),
39
+ ts({
40
+ typescript,
41
+ tsconfig: './tsconfig.json',
42
+ noEmitOnError: false,
43
+ // declaration: true,
44
+ // declarationDir: './build',
45
+ }),
46
+ commonjs({
47
+ include: 'node_modules/**',
48
+ }),
49
+ ]
50
+
51
+ const plugins = [
52
+ ...pluginsBeforePostCSS,
53
+ postcss({
54
+ // extract: true, // this will generate a css file based on output file name
55
+ extract: 'react-tooltip.css', // this will generate a specific file and override on multiples build, but the css will be the same
56
+ autoModules: true,
57
+ include: '**/*.css',
58
+ extensions: ['.css'],
59
+ plugins: [],
60
+ }),
61
+ ...pluginsAfterPostCSS,
62
+ ]
63
+
64
+ const pluginsForCSSMinification = [
65
+ ...pluginsBeforePostCSS,
66
+ postcss({
67
+ extract: 'react-tooltip.min.css', // this will generate a specific file and override on multiples build, but the css will be the same
68
+ autoModules: true,
69
+ include: '**/*.css',
70
+ extensions: ['.css'],
71
+ plugins: [],
72
+ minimize: true,
73
+ }),
74
+ ...pluginsAfterPostCSS,
75
+ ]
76
+
77
+ const defaultOutputData = pkg.buildFormats.map(({ file, format }) => ({
78
+ file,
79
+ format,
80
+ plugins: [...plugins, filesize()],
81
+ }))
82
+
83
+ // this step is just to build the minified css and es modules javascript
84
+ const minifiedOutputData = pkg.buildFormats.map(({ file, format }) => ({
85
+ file: file.replace('.js', '.min.js'),
86
+ format,
87
+ plugins: [...pluginsForCSSMinification, terser(), filesize()],
88
+ }))
89
+
90
+ const outputData = [...minifiedOutputData, ...defaultOutputData]
91
+
92
+ const config = outputData.map(({ file, format, plugins: specificPLugins }) => ({
93
+ input,
94
+ output: {
95
+ file,
96
+ format,
97
+ name,
98
+ globals,
99
+ },
100
+ external,
101
+ plugins: specificPLugins,
102
+ }))
103
+
104
+ export default config
@@ -0,0 +1,7 @@
1
+ import dts from 'rollup-plugin-dts'
2
+
3
+ export default {
4
+ input: './build/index.d.ts',
5
+ output: [{ file: 'build/index-builded.d.ts', format: 'es' }],
6
+ plugins: [dts()],
7
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "include": ["./global.d.ts", "./src/**/*.ts", "./src/**/*.js", "./src/**/*.tsx"],
3
+ "exclude": [],
4
+ "compilerOptions": {
5
+ /* Visit https://aka.ms/tsconfig to read more about this file */
6
+
7
+ /* Projects */
8
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
9
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
10
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
11
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
12
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
13
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
14
+
15
+ /* Language and Environment */
16
+ "target": "es2018" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
17
+ "lib": [
18
+ "es2017",
19
+ "ESNext",
20
+ "DOM"
21
+ ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
22
+ "jsx": "react-jsx" /* Specify what JSX code is generated. */,
23
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
24
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
25
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
26
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
27
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
28
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
29
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
30
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
31
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
32
+
33
+ /* Modules */
34
+ "module": "esnext" /* Specify what module code is generated. */,
35
+ // "rootDir": "./", /* Specify the root folder within your source files. */
36
+ "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
37
+ "baseUrl": "src" /* Specify the base directory to resolve non-relative module names. */,
38
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
39
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
40
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
41
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
42
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
43
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
44
+ "resolveJsonModule": true /* Enable importing .json files. */,
45
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
46
+
47
+ /* JavaScript Support */
48
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
49
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
50
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
51
+
52
+ /* Emit */
53
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
54
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
55
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
56
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
57
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
+ // "outDir": "./", /* Specify an output folder for all emitted files. */
59
+ // "removeComments": true, /* Disable emitting comments. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
67
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
68
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
69
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
70
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
71
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
72
+ "noEmitOnError": true /* Disable emitting files if any type checking errors are reported. */,
73
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
74
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
75
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
76
+
77
+ /* Interop Constraints */
78
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
79
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
81
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
83
+
84
+ /* Type Checking */
85
+ "strict": true /* Enable all strict type-checking options. */,
86
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
+
105
+ /* Completeness */
106
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
+ }
109
+ }