react-tooltip 6.0.0-beta.1179.rc.2 → 6.0.0-beta.1179.rc.21

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.
package/.eslintrc.json DELETED
@@ -1,97 +0,0 @@
1
- {
2
- "extends": [
3
- "eslint-config-airbnb",
4
- "plugin:import/typescript",
5
- "plugin:@typescript-eslint/recommended",
6
- "prettier",
7
- "plugin:prettier/recommended"
8
- ],
9
- "env": {
10
- "browser": true,
11
- "jest": true
12
- },
13
- "parser": "@typescript-eslint/parser",
14
- "plugins": ["react", "react-hooks", "prettier", "@typescript-eslint"],
15
- "settings": {
16
- "import/resolver": {
17
- "node": {
18
- "extensions": [".js", ".jsx", ".ts", ".tsx"],
19
- "moduleDirectory": ["node_modules", "src/"]
20
- }
21
- }
22
- },
23
- "rules": {
24
- "operator-linebreak": [
25
- 2,
26
- "after",
27
- {
28
- "overrides": {
29
- "?": "before",
30
- ":": "before"
31
- }
32
- }
33
- ],
34
- "object-curly-newline": 0,
35
- "implicit-arrow-linebreak": 0,
36
- "semi": ["error", "never"],
37
- "quotes": [
38
- "error",
39
- "single",
40
- {
41
- "allowTemplateLiterals": true,
42
- "avoidEscape": true
43
- }
44
- ],
45
- "max-len": [
46
- "error",
47
- {
48
- "code": 100,
49
- "ignoreStrings": true,
50
- "ignoreTemplateLiterals": true
51
- }
52
- ],
53
- "import/no-extraneous-dependencies": [
54
- "error",
55
- {
56
- "devDependencies": true
57
- }
58
- ],
59
- "import/no-unresolved": [
60
- "error",
61
- {
62
- "commonjs": true,
63
- "amd": true
64
- }
65
- ],
66
- "react/jsx-filename-extension": ["off"],
67
- "react/prop-types": ["warn"],
68
- "react/button-has-type": 0,
69
- "jsx-a11y/href-no-hash": "off",
70
- "jsx-a11y/label-has-for": [
71
- "error",
72
- {
73
- "allowChildren": true
74
- }
75
- ],
76
- "jsx-a11y/anchor-is-valid": [
77
- "error",
78
- {
79
- "specialLink": ["to"]
80
- }
81
- ],
82
- "react/jsx-props-no-spreading": 0,
83
- "react/react-in-jsx-scope": "off",
84
- "prettier/prettier": "error",
85
- "import/extensions": 0,
86
- "@typescript-eslint/no-unused-vars": "error",
87
- "@typescript-eslint/no-explicit-any": "warn",
88
- "import/prefer-default-export": "off",
89
- "react/function-component-definition": "off",
90
- "@typescript-eslint/ban-ts-comment": "off",
91
- "dot-notation": "off",
92
- "no-shadow": "off",
93
- "@typescript-eslint/no-shadow": "error",
94
- "react-hooks/rules-of-hooks": "error",
95
- "react-hooks/exhaustive-deps": "warn"
96
- }
97
- }
package/.gitattributes DELETED
@@ -1,3 +0,0 @@
1
- # do not show lock files while doing git diff
2
- package-lock.json -diff
3
- yarn.lock -diff
package/.prettierrc.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "semi": false,
3
- "arrowParens": "always",
4
- "proseWrap": "preserve",
5
- "singleQuote": true,
6
- "trailingComma": "all",
7
- "tabWidth": 2,
8
- "printWidth": 100,
9
- "endOfLine": "auto"
10
- }
package/.stylelintrc.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": ["stylelint-config-standard", "stylelint-config-prettier"],
3
- "rules": {
4
- "declaration-no-important": true,
5
- "declaration-colon-newline-after": null,
6
- "selector-pseudo-class-no-unknown": [
7
- true,
8
- {
9
- "ignorePseudoClasses": ["global"]
10
- }
11
- ],
12
- "selector-pseudo-element-no-unknown": [
13
- true,
14
- {
15
- "ignorePseudoElements": ["global"]
16
- }
17
- ]
18
- }
19
- }
package/beta-release.js DELETED
@@ -1,81 +0,0 @@
1
- import util from 'util'
2
- import { exec as execCallback } from 'child_process'
3
- import minimist from 'minimist'
4
- import pkg from './package.json' assert { type: 'json' }
5
-
6
- const exec = util.promisify(execCallback)
7
-
8
- const args = minimist(process.argv.slice(2))
9
-
10
- console.log({ args })
11
-
12
- const issueNumber = args['issue']
13
-
14
- console.log({ issueNumber })
15
-
16
- const runCommand = async (command) => {
17
- return new Promise((resolve) => {
18
- exec(command, (error, stdout, stderr) => {
19
- resolve({ error, stdout, stderr })
20
- })
21
- })
22
- }
23
-
24
- const AutoBetaRelease = async () => {
25
- // get all the versions of the package from npm
26
- const { stdout } = await runCommand(`npm view . versions --json`)
27
-
28
- // show npm published versions of this package
29
- console.log(stdout)
30
-
31
- // check if there is a beta release with the same issue number on published versions
32
- const arrayOfBetaReleases = JSON.parse(stdout).filter((version) =>
33
- version.includes(`${pkg.version}-beta.${issueNumber}`),
34
- )
35
-
36
- let fullLastBetaRelease = null
37
-
38
- // if yes, get the latest beta release. Output: 1.0.0-beta.1.rc.0
39
- if (arrayOfBetaReleases.length) {
40
- fullLastBetaRelease = arrayOfBetaReleases[arrayOfBetaReleases.length - 1]
41
- }
42
-
43
- console.log('Last Beta Release: ', fullLastBetaRelease)
44
-
45
- let nextBetaReleaseVersion = 0
46
-
47
- if (fullLastBetaRelease) {
48
- const lastBetaReleaseRCVersionArray = fullLastBetaRelease.match(/rc.+[0-9]+/g)
49
-
50
- const lastBetaReleaseRCVersion =
51
- lastBetaReleaseRCVersionArray && lastBetaReleaseRCVersionArray.length
52
- ? lastBetaReleaseRCVersionArray[0]
53
- : null
54
-
55
- const lastBetaReleaseVersion = lastBetaReleaseRCVersion
56
- ? lastBetaReleaseRCVersion.split('.')[1]
57
- : 0
58
-
59
- nextBetaReleaseVersion = parseInt(lastBetaReleaseVersion, 10) + 1
60
- }
61
-
62
- // next beta release version. Output: 1.0.0-beta.1.rc.1
63
- const nextBetaReleaseVesionFull = `${pkg.version}-beta.${issueNumber}.rc.${nextBetaReleaseVersion}`
64
-
65
- // update the beta version on packageJson.json
66
- const { error } = await runCommand(
67
- `npm version ${nextBetaReleaseVesionFull} --no-git-tag-version`,
68
- )
69
-
70
- if (error) {
71
- console.error(error)
72
- return
73
- }
74
-
75
- // the beta version is already updated on package.json on the next line
76
- console.log('Next Beta version: ', `${nextBetaReleaseVesionFull}`)
77
-
78
- await runCommand(`echo "NEW_VERSION=${nextBetaReleaseVesionFull}" >> $GITHUB_ENV`)
79
- }
80
-
81
- AutoBetaRelease()
@@ -1,88 +0,0 @@
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
- clsx: 'clsx',
22
- 'prop-types': 'PropTypes',
23
- }
24
-
25
- const plugins = [
26
- progress(),
27
- html({
28
- input: './public/index-rollup.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
- }
@@ -1,126 +0,0 @@
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 replaceBeforeSaveFile from './rollup-plugins/replace-before-save-file.js'
11
- import pkg from './package.json' assert { type: 'json' }
12
-
13
- const input = ['src/index.tsx']
14
-
15
- const name = 'ReactTooltip'
16
-
17
- const banner = `
18
- /*
19
- * React Tooltip
20
- * {@link https://github.com/ReactTooltip/react-tooltip}
21
- * @copyright ReactTooltip Team
22
- * @license MIT
23
- */`
24
-
25
- const external = [
26
- ...Object.keys(pkg.peerDependencies ?? {}),
27
- ...Object.keys(pkg.dependencies ?? {}),
28
- ]
29
-
30
- const buildFormats = [
31
- {
32
- file: 'dist/react-tooltip.mjs',
33
- format: 'es',
34
- },
35
- {
36
- file: 'dist/react-tooltip.umd.js',
37
- format: 'umd',
38
- globals: {
39
- '@floating-ui/dom': 'FloatingUIDOM',
40
- react: 'React',
41
- 'react-dom': 'ReactDOM',
42
- clsx: 'clsx',
43
- 'prop-types': 'PropTypes',
44
- },
45
- },
46
- {
47
- file: 'dist/react-tooltip.cjs',
48
- format: 'cjs',
49
- },
50
- {
51
- file: 'dist/react-tooltip.mjs',
52
- format: 'es',
53
- },
54
- ]
55
-
56
- const sharedPlugins = [
57
- progress(),
58
- replace({
59
- preventAssignment: true,
60
- values: {
61
- 'process.env.NODE_ENV': JSON.stringify('development'),
62
- },
63
- }),
64
- nodeResolve(),
65
- ts({
66
- typescript,
67
- tsconfig: './tsconfig.json',
68
- noEmitOnError: false,
69
- }),
70
- commonjs({
71
- include: 'node_modules/**',
72
- }),
73
- ]
74
- // this step is just to build the minified javascript files
75
- const minifiedBuildFormats = buildFormats.map(({ file, ...rest }) => ({
76
- file: file.replace(/(\.[cm]?js)$/, '.min$1'),
77
- ...rest,
78
- minify: true,
79
- plugins: [terser({ compress: { directives: false } }), filesize()],
80
- }))
81
-
82
- const allBuildFormats = [...buildFormats, ...minifiedBuildFormats]
83
-
84
- const config = allBuildFormats.map(
85
- ({ file, format, globals, plugins: specificPlugins, minify }) => {
86
- const plugins = [
87
- ...sharedPlugins,
88
- postcss({
89
- extract: minify ? 'react-tooltip.min.css' : 'react-tooltip.css', // this will generate a specific file and override on multiples build, but the css will be the same
90
- autoModules: true,
91
- include: '**/*.css',
92
- extensions: ['.css'],
93
- plugins: [],
94
- minimize: Boolean(minify),
95
- }),
96
- replaceBeforeSaveFile({
97
- // this only works for the react-tooltip.css because it's the first file
98
- // writen in our build process before the javascript files.
99
- "'react-tooltip-css-placeholder'": 'file:react-tooltip.css',
100
- '"react-tooltip-css-placeholder"': 'file:react-tooltip.css',
101
- "'react-tooltip-core-css-placeholder'": 'file:react-tooltip.css',
102
- '"react-tooltip-core-css-placeholder"': 'file:react-tooltip.css',
103
- }),
104
- ]
105
-
106
- if (specificPlugins && specificPlugins.length) {
107
- plugins.push(...specificPlugins)
108
- }
109
-
110
- return {
111
- input,
112
- output: {
113
- file,
114
- format,
115
- name,
116
- globals,
117
- sourcemap: true,
118
- banner,
119
- },
120
- external,
121
- plugins,
122
- }
123
- },
124
- )
125
-
126
- export default config
@@ -1,21 +0,0 @@
1
- import dts from 'rollup-plugin-dts'
2
- import postcss from 'rollup-plugin-postcss'
3
-
4
- export default {
5
- input: './src/index.tsx',
6
- output: [{ file: 'dist/react-tooltip.d.ts', format: 'es' }],
7
- plugins: [
8
- postcss({
9
- extract: 'react-tooltip-tokens.css', // this will generate a specific file not being used, but we need this part of code
10
- autoModules: true,
11
- include: '**/*.css',
12
- extensions: ['.css'],
13
- plugins: [],
14
- }),
15
- dts({
16
- compilerOptions: {
17
- baseUrl: 'src',
18
- },
19
- }),
20
- ],
21
- }
package/tsconfig.json DELETED
@@ -1,109 +0,0 @@
1
- {
2
- "include": ["./global.d.ts", "./src/**/*.ts", "./src/**/*.js", "./src/**/*.tsx"],
3
- "exclude": ["src/test/**/*"],
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
- "es2018",
19
- "DOM",
20
- "DOM.iterable"
21
- ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
22
- "jsx": "react" /* 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": "react", /* 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": false /* Skip type checking all .d.ts files. */
108
- }
109
- }