react-zoom-pan-pinch 3.0.5 → 3.0.6

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/jest.config.ts ADDED
@@ -0,0 +1,45 @@
1
+ import type { Config } from "@jest/types";
2
+
3
+ const config: Config.InitialOptions = {
4
+ cacheDirectory: "../../node_modules/.cache/rhf/jest",
5
+ testEnvironment: "jsdom",
6
+ preset: "ts-jest",
7
+ testRegex: [".spec.ts"],
8
+ roots: ["<rootDir>/node_modules", "<rootDir>/src", "<rootDir>/__tests__"],
9
+ coverageProvider: "v8",
10
+ coverageReporters: [
11
+ ["lcov", { projectRoot: "../.." }],
12
+ "clover",
13
+ "json",
14
+ "text",
15
+ ],
16
+ collectCoverageFrom: ["<rootDir>/src/**/*.ts", "<rootDir>/src/**/*.tsx"],
17
+ coveragePathIgnorePatterns: [
18
+ ".spec",
19
+ "test",
20
+ "tests",
21
+ "types",
22
+ "constants",
23
+ "index.ts",
24
+ ".d.ts",
25
+ ],
26
+ moduleDirectories: ["node_modules", "src"],
27
+ transform: {
28
+ "^.+\\.tsx?$": [
29
+ "ts-jest",
30
+ {
31
+ tsconfig: "./tsconfig.json",
32
+ isolatedModules: true,
33
+ },
34
+ ],
35
+ },
36
+ moduleNameMapper: {
37
+ "\\.(css|less|scss|sss|styl)$": "<rootDir>/node_modules/jest-css-modules",
38
+ },
39
+ watchPlugins: [
40
+ "jest-watch-typeahead/filename",
41
+ "jest-watch-typeahead/testname",
42
+ ],
43
+ setupFilesAfterEnv: ["jest-extended/all"],
44
+ };
45
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-zoom-pan-pinch",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "Zoom and pan html elements in easy way",
5
5
  "author": "prc5",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "commitlint": "^17.0.2",
62
62
  "cross-env": "^7.0.3",
63
63
  "eslint": "^8.17.0",
64
- "eslint-config-airbnb": "^18.2.1",
64
+ "eslint-config-airbnb": "^19.0.4",
65
65
  "eslint-config-airbnb-typescript": "^17.0.0",
66
66
  "eslint-config-next": "12.1.6",
67
67
  "eslint-config-prettier": "^8.5.0",
@@ -94,10 +94,6 @@
94
94
  "webpack": "5",
95
95
  "webpack-cli": "^5.0.1"
96
96
  },
97
- "files": [
98
- "dist",
99
- "src"
100
- ],
101
97
  "engines": {
102
98
  "node": ">=8",
103
99
  "npm": ">=5"
@@ -0,0 +1,51 @@
1
+ import babel from "@rollup/plugin-babel";
2
+ import external from "rollup-plugin-peer-deps-external";
3
+ import del from "rollup-plugin-delete";
4
+ import typescript from "@rollup/plugin-typescript";
5
+ import postcss from "rollup-plugin-postcss";
6
+ import dts from "rollup-plugin-dts";
7
+ import pkg from "./package.json";
8
+
9
+ export default [
10
+ {
11
+ input: pkg.source,
12
+ output: [
13
+ {
14
+ file: pkg.main,
15
+ format: "cjs",
16
+ exports: "named",
17
+ sourcemap: true,
18
+ },
19
+ {
20
+ file: pkg.module,
21
+ format: "es",
22
+ exports: "named",
23
+ sourcemap: true,
24
+ },
25
+ ],
26
+ plugins: [
27
+ external(),
28
+ babel({
29
+ exclude: "node_modules/**",
30
+ }),
31
+ del({ targets: ["dist/*"] }),
32
+ typescript({ sourceMap: false }),
33
+ postcss({
34
+ modules: true,
35
+ }),
36
+ ],
37
+ external: Object.keys(pkg.peerDependencies || {}),
38
+ },
39
+ {
40
+ input: pkg.source,
41
+ output: [{ file: pkg.types, format: "es" }],
42
+ plugins: [
43
+ external(),
44
+ dts({
45
+ compilerOptions: {
46
+ baseUrl: "./src",
47
+ },
48
+ }),
49
+ ],
50
+ },
51
+ ];
@@ -6,7 +6,7 @@ export const useTransformContext = () => {
6
6
  const libraryContext = useContext(Context);
7
7
 
8
8
  if (!libraryContext) {
9
- throw new Error("Transform context mus be placed inside TransformWrapper");
9
+ throw new Error("Transform context must be placed inside TransformWrapper");
10
10
  }
11
11
 
12
12
  return libraryContext;
package/tsconfig.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "module": "esnext",
5
+ "target": "es5",
6
+ "sourceMap": true,
7
+ "allowJs": false,
8
+ "jsx": "react",
9
+ "declaration": true,
10
+ "moduleResolution": "node",
11
+ "forceConsistentCasingInFileNames": true,
12
+ "noImplicitReturns": true,
13
+ "noImplicitThis": true,
14
+ "noImplicitAny": true,
15
+ "strictNullChecks": true,
16
+ "suppressImplicitAnyIndexErrors": true,
17
+ "noUnusedLocals": true,
18
+ "noUnusedParameters": true,
19
+ "allowSyntheticDefaultImports": true,
20
+ "baseUrl": "src",
21
+ "lib": ["dom", "dom.iterable", "esnext"],
22
+ "skipLibCheck": true,
23
+ "esModuleInterop": true,
24
+ "strict": true,
25
+ "noFallthroughCasesInSwitch": true,
26
+ "resolveJsonModule": true,
27
+ "isolatedModules": true,
28
+ "noEmit": true
29
+ },
30
+ "include": ["src", "__tests__"],
31
+ "exclude": ["node_modules", "build", "dist", "rollup.config.js"]
32
+ }