react-zoom-pan-pinch 3.0.5 → 3.0.7

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/.eslintignore ADDED
@@ -0,0 +1,6 @@
1
+ dist
2
+ node_modules
3
+ storybook-static
4
+ .storybook
5
+ coverage
6
+ rollup.config.js
@@ -0,0 +1,36 @@
1
+ # This is a comment.
2
+ # Each line is a file pattern followed by one or more owners.
3
+
4
+ # These owners will be the default owners for everything in
5
+ # the repo. Unless a later match takes precedence, they will
6
+ # be requested for review when someone opens a pull request.
7
+ * @prc5
8
+
9
+ # Order is important; the last matching pattern takes the most
10
+ # precedence. When someone opens a pull request that only
11
+ # modifies JS files, only @js-owner and not the global
12
+ # owner(s) will be requested for a review.
13
+ # *.js @js-owner
14
+
15
+ # You can also use email addresses if you prefer. They'll be
16
+ # used to look up users just like we do for commit author
17
+ # emails.
18
+ # *.go docs@example.com
19
+
20
+ # In this example, @doctocat owns any files in the build/logs
21
+ # directory at the root of the repository and any of its
22
+ # subdirectories.
23
+ # /build/logs/ @doctocat
24
+
25
+ # The `docs/*` pattern will match files like
26
+ # `docs/getting-started.md` but not further nested files like
27
+ # `docs/build-app/troubleshooting.md`.
28
+ # docs/* docs@example.com
29
+
30
+ # In this example, @octocat owns any file in an apps directory
31
+ # anywhere in your repository.
32
+ # apps/ @octocat
33
+
34
+ # In this example, @doctocat owns any file in the `/docs`
35
+ # directory in the root of your repository.
36
+ # /docs/ @doctocat
@@ -0,0 +1,13 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [prc5] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,34 @@
1
+ name: Deploy docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v3
14
+
15
+ - name: Set up Node
16
+ uses: actions/setup-node@v3
17
+ with:
18
+ node-version: "16"
19
+ cache: "yarn"
20
+
21
+ - name: Install packages
22
+ run: yarn install
23
+
24
+ - name: Build docs
25
+ run: yarn build:docs
26
+ env:
27
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28
+
29
+ - name: Deploy
30
+ run: |
31
+ git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
32
+ npx gh-pages -d storybook-static -u "github-actions-bot <support+actions@github.com>"
33
+ env:
34
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,46 @@
1
+ name: Release packages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - beta
8
+ - alpha
9
+
10
+ defaults:
11
+ run:
12
+ shell: sh
13
+
14
+ jobs:
15
+ release:
16
+ name: Release
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Wait on tests
20
+ uses: lewagon/wait-on-check-action@v1.1.2
21
+ with:
22
+ ref: ${{ github.ref }}
23
+ check-name: "Run tests"
24
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
25
+ wait-interval: 10
26
+
27
+ - name: Checkout
28
+ uses: actions/checkout@v3
29
+
30
+ - name: Set up Node
31
+ uses: actions/setup-node@v3
32
+ with:
33
+ node-version: "16"
34
+ cache: "yarn"
35
+
36
+ - name: Install packages
37
+ run: yarn install
38
+
39
+ - name: Build
40
+ run: yarn build
41
+
42
+ - name: Publish
43
+ run: yarn release
44
+ env:
45
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,42 @@
1
+ name: Tests
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ tests:
7
+ name: Run tests
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Checkout
11
+ uses: actions/checkout@v3
12
+
13
+ - name: Set up Node.js
14
+ uses: actions/setup-node@v3
15
+ with:
16
+ node-version: "16"
17
+ cache: "yarn"
18
+
19
+ - name: Install packages
20
+ run: yarn install
21
+
22
+ - name: Build
23
+ run: yarn build
24
+
25
+ - name: Lint
26
+ run: yarn lint
27
+
28
+ - name: Typecheck
29
+ run: yarn typecheck
30
+
31
+ - name: Clear Jest
32
+ run: yarn jest --clearCache
33
+
34
+ - name: Test
35
+ run: yarn test --coverage
36
+
37
+ # - name: Send Report
38
+ # uses: paambaati/codeclimate-action@v3.0.0
39
+ # env:
40
+ # CC_TEST_REPORTER_ID: 7d1e3713df373ab2c9efce24b85c16efa2bd953aae32bd9d278004784d71291e
41
+ # with:
42
+ # coverageLocations: ${{github.workspace}}/coverage/lcov.info:lcov
package/.prettierrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "useTabs": false,
4
+ "semi": true,
5
+ "singleQuote": false,
6
+ "trailingComma": "all",
7
+ "bracketSpacing": true,
8
+ "jsxBracketSameLine": false,
9
+ "proseWrap": "always"
10
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "branches": [
3
+ "+([0-9])?(.{+([0-9]),x}).x",
4
+ {
5
+ "name": "master"
6
+ },
7
+ {
8
+ "name": "beta",
9
+ "prerelease": true
10
+ },
11
+ {
12
+ "name": "alpha",
13
+ "prerelease": true
14
+ }
15
+ ],
16
+ "release": {
17
+ "plugins": [
18
+ [
19
+ "@semantic-release/commit-analyzer",
20
+ {
21
+ "releaseRules": [
22
+ {
23
+ "scope": "no-release",
24
+ "release": false
25
+ },
26
+ {
27
+ "breaking": true,
28
+ "release": "major"
29
+ },
30
+ {
31
+ "type": "feat",
32
+ "release": "minor"
33
+ },
34
+ {
35
+ "type": "refactor",
36
+ "scope": "core-*",
37
+ "release": "minor"
38
+ },
39
+ {
40
+ "type": "*",
41
+ "release": "patch"
42
+ }
43
+ ]
44
+ }
45
+ ],
46
+ [
47
+ "@semantic-release/changelog",
48
+ {
49
+ "changelogFile": "CHANGELOG.md"
50
+ }
51
+ ],
52
+ "@semantic-release/release-notes-generator",
53
+ "@semantic-release/npm",
54
+ [
55
+ "@semantic-release/git",
56
+ {
57
+ "assets": ["CHANGELOG.md"]
58
+ }
59
+ ],
60
+ "@semantic-release/github"
61
+ ]
62
+ }
63
+ }
@@ -0,0 +1,23 @@
1
+ module.exports = {
2
+ stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|ts|tsx)"],
3
+ addons: [
4
+ "@storybook/addon-links",
5
+ "@storybook/addon-essentials",
6
+ "@storybook/preset-create-react-app",
7
+ "@storybook/addon-storysource",
8
+ "@storybook/addon-a11y",
9
+ ],
10
+ core: {
11
+ builder: "webpack5",
12
+ },
13
+ framework: "@storybook/react",
14
+ webpackFinal: (webpackConfig) => {
15
+ const scopePluginIndex = webpackConfig.resolve.plugins.findIndex(
16
+ ({ constructor }) =>
17
+ constructor && constructor.name === "ModuleScopePlugin",
18
+ );
19
+
20
+ webpackConfig.resolve.plugins.splice(scopePluginIndex, 1);
21
+ return webpackConfig;
22
+ },
23
+ };
@@ -0,0 +1,5 @@
1
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
2
+ <link
3
+ href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100&display=swap"
4
+ rel="stylesheet"
5
+ />
@@ -0,0 +1,11 @@
1
+ import "./theme-overrides.css";
2
+
3
+ export const parameters = {
4
+ actions: { argTypesRegex: "^on[A-Z].*" },
5
+ controls: {
6
+ matchers: {
7
+ color: /(background|color)$/i,
8
+ date: /Date$/,
9
+ },
10
+ },
11
+ };
@@ -0,0 +1,49 @@
1
+ body {
2
+ font-family: "Poppins", sans-serif;
3
+ font-style: normal;
4
+ font-weight: normal;
5
+ font-size: 13px;
6
+ line-height: 130%;
7
+ font-style: normal;
8
+ -webkit-font-smoothing: antialiased;
9
+ -moz-osx-font-smoothing: grayscale;
10
+ }
11
+
12
+ body .sbdocs {
13
+ max-width: unset;
14
+ }
15
+
16
+ .react-transform-wrapper {
17
+ background-color: rgba(0, 0, 0, 0.3);
18
+ }
19
+
20
+ body td > pre.prism-code {
21
+ background: transparent !important;
22
+ overflow: auto;
23
+ }
24
+
25
+ .props-table {
26
+ width: 100%;
27
+ }
28
+
29
+ .props-table th {
30
+ text-align: left;
31
+ }
32
+
33
+ .is-object-row td {
34
+ background: #d8e2f5;
35
+ border-top: 2px solid rgb(173 173 173) !important;
36
+ }
37
+
38
+ .react-transform-wrapper {
39
+ max-width: 80vw;
40
+ max-height: 80vh;
41
+ }
42
+
43
+ .handlers-table {
44
+ width: 100%;
45
+ }
46
+
47
+ .handlers-table th {
48
+ text-align: left;
49
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ # CHANGELOG
2
+
3
+ ## Version: 3.0.0
4
+
5
+ - Removed render props performance issues. I've removed state from render props,
6
+ now if we want to listen to it's changes we need to use useTransformEffect
7
+ hook
8
+ - Created helper hooks for handling controls, transform state and context
9
+ without performance issues with rerendering
10
+ - Added KeepScale, MiniMap components
11
+ - Added documentation about new hooks
12
+ - New readme
13
+ - Semantic release
14
+
15
+ ## Version: 2.1.3
16
+
17
+ ##### Published: 24.07.2021
18
+
19
+ 1. Alignment animation size changes:
20
+
21
+ - "padding" size is not longer calculated based on the wrapper size - it's now
22
+ represented by pixels
23
+ - you can set separate "padding" values for X and Y
24
+
25
+ 2. Storybook docs fix - prevented to log every action callback since it was
26
+ killing performance
@@ -0,0 +1,61 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make
6
+ participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
7
+ disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
8
+ socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
9
+
10
+ ## Our Standards
11
+
12
+ Examples of behavior that contributes to creating a positive environment include:
13
+
14
+ - Using welcoming and inclusive language
15
+ - Being respectful of differing viewpoints and experiences
16
+ - Gracefully accepting constructive criticism
17
+ - Focusing on what is best for the community
18
+ - Showing empathy towards other community members
19
+
20
+ Examples of unacceptable behavior by participants include:
21
+
22
+ - The use of sexualized language or imagery and unwelcome sexual attention or advances
23
+ - Trolling, insulting/derogatory comments, and personal or political attacks
24
+ - Public or private harassment
25
+ - Publishing others' private information, such as a physical or electronic address, without explicit permission
26
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
27
+
28
+ ## Our Responsibilities
29
+
30
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
31
+ appropriate and fair corrective action in response to any instances of unacceptable behavior.
32
+
33
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
34
+ issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
35
+ contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
36
+
37
+ ## Scope
38
+
39
+ This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the
40
+ project or its community in public spaces. Examples of representing a project or community include using an official
41
+ project e-mail address, posting via an official social media account, or acting as an appointed representative at an
42
+ online or offline event. Representation of a project may be further defined and clarified by project maintainers.
43
+
44
+ ## Enforcement
45
+
46
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
47
+ maciekpyrc@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed
48
+ necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to
49
+ the reporter of an incident. Further details of specific enforcement policies may be posted separately.
50
+
51
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
52
+ repercussions as determined by other members of the project's leadership.
53
+
54
+ ## Attribution
55
+
56
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
57
+ https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
58
+
59
+ [homepage]: https://www.contributor-covenant.org
60
+
61
+ For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq