react-zoom-pan-pinch 2.6.1 → 3.0.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.
- package/.eslintignore +6 -0
- package/.github/CODEOWNERS +36 -0
- package/.github/FUNDING.yml +13 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/workflows/docs.yml +27 -0
- package/.github/workflows/release.yml +46 -0
- package/.github/workflows/tests.yml +42 -0
- package/.prettierrc +10 -0
- package/.releaserc.json +63 -0
- package/CHANGELOG.md +12 -0
- package/Code_of_Conduct.md +61 -0
- package/Contributing.md +236 -0
- package/README.md +119 -88
- package/commitlint.config.js +1 -0
- package/dist/index.cjs.js +206 -35
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +100 -77
- package/dist/index.esm.js +203 -37
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/index.d.ts +4 -0
- package/dist/src/components/mini-map/mini-map.d.ts +7 -0
- package/dist/{components → src/components/transform-component}/transform-component.d.ts +1 -1
- package/dist/{components → src/components/transform-wrapper}/transform-wrapper.d.ts +3 -4
- package/dist/{core → src/core}/instance.core.d.ts +5 -0
- package/dist/src/hooks/index.d.ts +4 -0
- package/dist/src/hooks/use-controls.d.ts +2 -0
- package/dist/src/hooks/use-transform-context.d.ts +1 -0
- package/dist/src/hooks/use-transform-effect.d.ts +2 -0
- package/dist/src/hooks/use-transform-init.d.ts +2 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/{models → src/models}/context.model.d.ts +6 -2
- package/dist/src/utils/context.utils.d.ts +4 -0
- package/package.json +35 -15
- package/rollup.config.js +51 -0
- package/src/components/index.ts +4 -0
- package/src/components/{keep-scale.tsx → keep-scale/keep-scale.tsx} +2 -2
- package/src/components/mini-map/mini-map.tsx +155 -0
- package/src/components/{transform-component.tsx → transform-component/transform-component.tsx} +1 -3
- package/src/components/transform-wrapper/transform-wrapper.tsx +39 -0
- package/src/core/instance.core.ts +18 -1
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use-controls.tsx +9 -0
- package/src/hooks/use-transform-context.tsx +4 -15
- package/src/hooks/use-transform-effect.tsx +22 -0
- package/src/hooks/use-transform-init.tsx +29 -0
- package/src/index.ts +2 -4
- package/src/models/context.model.ts +11 -2
- package/src/utils/context.utils.ts +24 -3
- package/tsconfig.json +32 -0
- package/dist/hooks/use-transform-context.d.ts +0 -3
- package/dist/stories/docs/handlers.d.ts +0 -12
- package/dist/stories/docs/props.d.ts +0 -14
- package/dist/stories/examples/content-rerendering/example.d.ts +0 -2
- package/dist/stories/examples/keep-scale/example.d.ts +0 -2
- package/dist/stories/examples/stress/example.d.ts +0 -2
- package/dist/stories/examples/svg-zoom-to-element/example.d.ts +0 -2
- package/dist/stories/examples/zoom-to-element/example.d.ts +0 -2
- package/dist/stories/types/args.types.d.ts +0 -268
- package/dist/stories/utils/args.utils.d.ts +0 -3
- package/dist/stories/utils/code.utils.d.ts +0 -6
- package/dist/stories/utils/controls.utils.d.ts +0 -3
- package/dist/stories/utils/index.d.ts +0 -3
- package/dist/utils/context.utils.d.ts +0 -2
- package/src/components/transform-wrapper.tsx +0 -56
- package/src/stories/assets/big-image.jpeg +0 -0
- package/src/stories/assets/map.jpg +0 -0
- package/src/stories/assets/medium-image.jpg +0 -0
- package/src/stories/assets/pin.svg +0 -1
- package/src/stories/assets/small-image.jpg +0 -0
- package/src/stories/assets/svg-example.svg +0 -14
- package/src/stories/docs/Introduction.stories.mdx +0 -97
- package/src/stories/docs/handlers.stories.mdx +0 -48
- package/src/stories/docs/handlers.tsx +0 -107
- package/src/stories/docs/props.stories.mdx +0 -92
- package/src/stories/docs/props.tsx +0 -496
- package/src/stories/examples/content/content.stories.mdx +0 -122
- package/src/stories/examples/content-rerendering/content-updating.stories.mdx +0 -45
- package/src/stories/examples/content-rerendering/example.tsx +0 -74
- package/src/stories/examples/controls/controls.stories.mdx +0 -72
- package/src/stories/examples/image-big/image-big.stories.mdx +0 -44
- package/src/stories/examples/image-medium/image-medium.stories.mdx +0 -42
- package/src/stories/examples/image-small/image-small.stories.mdx +0 -42
- package/src/stories/examples/image-zoomed-out/image-zoomed-out.stories.mdx +0 -47
- package/src/stories/examples/keep-scale/example.tsx +0 -94
- package/src/stories/examples/keep-scale/keep-scale.stories.mdx +0 -45
- package/src/stories/examples/stress/example.tsx +0 -24
- package/src/stories/examples/stress/stress-test.stories.mdx +0 -28
- package/src/stories/examples/svg-zoom-to-element/creativity.svg +0 -143
- package/src/stories/examples/svg-zoom-to-element/example.tsx +0 -57
- package/src/stories/examples/svg-zoom-to-element/svg-zoom-to-element.stories.mdx +0 -28
- package/src/stories/examples/zoom-to-element/example.tsx +0 -95
- package/src/stories/examples/zoom-to-element/zoom-to-element.stories.mdx +0 -28
- package/src/stories/types/args.types.ts +0 -201
- package/src/stories/utils/args.utils.ts +0 -34
- package/src/stories/utils/code.utils.tsx +0 -22
- package/src/stories/utils/controls.utils.tsx +0 -43
- package/src/stories/utils/index.ts +0 -3
- package/src/stories/utils/styles.module.css +0 -34
- /package/dist/{components → src/components/keep-scale}/keep-scale.d.ts +0 -0
- /package/dist/{constants → src/constants}/state.constants.d.ts +0 -0
- /package/dist/{core → src/core}/animations/animations.constants.d.ts +0 -0
- /package/dist/{core → src/core}/animations/animations.utils.d.ts +0 -0
- /package/dist/{core → src/core}/bounds/bounds.types.d.ts +0 -0
- /package/dist/{core → src/core}/bounds/bounds.utils.d.ts +0 -0
- /package/dist/{core → src/core}/double-click/double-click.logic.d.ts +0 -0
- /package/dist/{core → src/core}/handlers/handlers.logic.d.ts +0 -0
- /package/dist/{core → src/core}/handlers/handlers.utils.d.ts +0 -0
- /package/dist/{core → src/core}/pan/panning.logic.d.ts +0 -0
- /package/dist/{core → src/core}/pan/panning.utils.d.ts +0 -0
- /package/dist/{core → src/core}/pan/velocity.logic.d.ts +0 -0
- /package/dist/{core → src/core}/pan/velocity.utils.d.ts +0 -0
- /package/dist/{core → src/core}/pinch/pinch.logic.d.ts +0 -0
- /package/dist/{core → src/core}/pinch/pinch.utils.d.ts +0 -0
- /package/dist/{core → src/core}/wheel/wheel.logic.d.ts +0 -0
- /package/dist/{core → src/core}/wheel/wheel.utils.d.ts +0 -0
- /package/dist/{core → src/core}/zoom/zoom.logic.d.ts +0 -0
- /package/dist/{core → src/core}/zoom/zoom.utils.d.ts +0 -0
- /package/dist/{models → src/models}/calculations.model.d.ts +0 -0
- /package/dist/{models → src/models}/helpers.model.d.ts +0 -0
- /package/dist/{models → src/models}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/calculations.utils.d.ts +0 -0
- /package/dist/{utils → src/utils}/callback.utils.d.ts +0 -0
- /package/dist/{utils → src/utils}/event.utils.d.ts +0 -0
- /package/dist/{utils → src/utils}/helpers.utils.d.ts +0 -0
- /package/dist/{utils → src/utils}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/ref.utils.d.ts +0 -0
- /package/dist/{utils → src/utils}/state.utils.d.ts +0 -0
- /package/dist/{utils → src/utils}/styles.utils.d.ts +0 -0
- /package/src/components/{transform-component.module.css → transform-component/transform-component.module.css} +0 -0
package/.eslintignore
ADDED
|
@@ -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,27 @@
|
|
|
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: Deploy docs
|
|
25
|
+
run: yarn deploy
|
|
26
|
+
env:
|
|
27
|
+
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
package/.releaserc.json
ADDED
|
@@ -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
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
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
|
+
|
|
3
15
|
## Version: 2.1.3
|
|
4
16
|
|
|
5
17
|
##### Published: 24.07.2021
|
|
@@ -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
|
package/Contributing.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
# Contributing to Zoom Pan Pinch
|
|
4
|
+
|
|
5
|
+
First off, thanks for taking the time to contribute! ❤️
|
|
6
|
+
|
|
7
|
+
All types of contributions are encouraged and valued. See the
|
|
8
|
+
[Table of Contents](#table-of-contents) for different ways to help and details
|
|
9
|
+
about how this project handles them. Please make sure to read the relevant
|
|
10
|
+
section before making your contribution. It will make it a lot easier for us
|
|
11
|
+
maintainers and smooth out the experience for all involved. The community looks
|
|
12
|
+
forward to your contributions. 🎉
|
|
13
|
+
|
|
14
|
+
> And if you like the project, but just don't have time to contribute, that's
|
|
15
|
+
> fine. There are other easy ways to support the project and show your
|
|
16
|
+
> appreciation, which we would also be very happy about:
|
|
17
|
+
>
|
|
18
|
+
> - Star the project
|
|
19
|
+
> - Tweet about it
|
|
20
|
+
> - Refer this project in your project's readme
|
|
21
|
+
> - Mention the project at local meetups and tell your friends/colleagues
|
|
22
|
+
|
|
23
|
+
<!-- omit in toc -->
|
|
24
|
+
|
|
25
|
+
## Table of Contents
|
|
26
|
+
|
|
27
|
+
- [Contributing to Zoom Pan Pinch](#contributing-to-zoom-pan-pinch)
|
|
28
|
+
- [Table of Contents](#table-of-contents)
|
|
29
|
+
- [I Have a Question](#i-have-a-question)
|
|
30
|
+
- [I Want To Contribute](#i-want-to-contribute)
|
|
31
|
+
- [Reporting Bugs](#reporting-bugs)
|
|
32
|
+
- [Before Submitting a Bug Report](#before-submitting-a-bug-report)
|
|
33
|
+
- [How Do I Submit a Good Bug Report?](#how-do-i-submit-a-good-bug-report)
|
|
34
|
+
- [Suggesting Enhancements](#suggesting-enhancements)
|
|
35
|
+
- [Before Submitting an Enhancement](#before-submitting-an-enhancement)
|
|
36
|
+
- [How Do I Submit a Good Enhancement Suggestion?](#how-do-i-submit-a-good-enhancement-suggestion)
|
|
37
|
+
- [Your First Code Contribution](#your-first-code-contribution)
|
|
38
|
+
- [Improving The Documentation](#improving-the-documentation)
|
|
39
|
+
- [Styleguides](#styleguides)
|
|
40
|
+
- [Commit Messages](#commit-messages)
|
|
41
|
+
- [Join The Project Team](#join-the-project-team)
|
|
42
|
+
- [Attribution](#attribution)
|
|
43
|
+
|
|
44
|
+
## I Have a Question
|
|
45
|
+
|
|
46
|
+
> If you want to ask a question, we assume that you have read the available
|
|
47
|
+
> [Documentation](https://prc5.github.io/react-zoom-pan-pinch/).
|
|
48
|
+
|
|
49
|
+
Before you ask a question, it is best to search for existing
|
|
50
|
+
[Issues](https://github.com/prc5/react-zoom-pan-pinch/issues) that might help
|
|
51
|
+
you. In case you have found a suitable issue and still need clarification, you
|
|
52
|
+
can write your question in this issue. It is also advisable to search the
|
|
53
|
+
internet for answers first.
|
|
54
|
+
|
|
55
|
+
If you then still feel the need to ask a question and need clarification, we
|
|
56
|
+
recommend the following:
|
|
57
|
+
|
|
58
|
+
- Open an [Issue](https://github.com/prc5/react-zoom-pan-pinch/issues/new).
|
|
59
|
+
- Provide as much context as you can about what you're running into.
|
|
60
|
+
- Provide project and platform versions (nodejs, npm, etc), depending on what
|
|
61
|
+
seems relevant.
|
|
62
|
+
|
|
63
|
+
We will then take care of the issue as soon as possible.
|
|
64
|
+
|
|
65
|
+
<!--
|
|
66
|
+
You might want to create a separate issue tag for questions and include it in this description. People should then tag their issues accordingly.
|
|
67
|
+
|
|
68
|
+
Depending on how large the project is, you may want to outsource the questioning, e.g. to Stack Overflow or Gitter. You may add additional contact and information possibilities:
|
|
69
|
+
- IRC
|
|
70
|
+
- Slack
|
|
71
|
+
- Gitter
|
|
72
|
+
- Stack Overflow tag
|
|
73
|
+
- Blog
|
|
74
|
+
- FAQ
|
|
75
|
+
- Roadmap
|
|
76
|
+
- E-Mail List
|
|
77
|
+
- Forum
|
|
78
|
+
-->
|
|
79
|
+
|
|
80
|
+
## I Want To Contribute
|
|
81
|
+
|
|
82
|
+
> ### Legal Notice <!-- omit in toc -->
|
|
83
|
+
>
|
|
84
|
+
> When contributing to this project, you must agree that you have authored 100%
|
|
85
|
+
> of the content, that you have the necessary rights to the content and that the
|
|
86
|
+
> content you contribute may be provided under the project license.
|
|
87
|
+
|
|
88
|
+
### Reporting Bugs
|
|
89
|
+
|
|
90
|
+
<!-- omit in toc -->
|
|
91
|
+
|
|
92
|
+
#### Before Submitting a Bug Report
|
|
93
|
+
|
|
94
|
+
A good bug report shouldn't leave others needing to chase you up for more
|
|
95
|
+
information. Therefore, we ask you to investigate carefully, collect information
|
|
96
|
+
and describe the issue in detail in your report. Please complete the following
|
|
97
|
+
steps in advance to help us fix any potential bug as fast as possible.
|
|
98
|
+
|
|
99
|
+
- Make sure that you are using the latest version.
|
|
100
|
+
- Determine if your bug is really a bug and not an error on your side e.g. using
|
|
101
|
+
incompatible environment components/versions (Make sure that you have read the
|
|
102
|
+
[documentation](https://prc5.github.io/react-zoom-pan-pinch/). If you are
|
|
103
|
+
looking for support, you might want to check
|
|
104
|
+
[this section](#i-have-a-question)).
|
|
105
|
+
- To see if other users have experienced (and potentially already solved) the
|
|
106
|
+
same issue you are having, check if there is not already a bug report existing
|
|
107
|
+
for your bug or error in the
|
|
108
|
+
[bug tracker](https://github.com/prc5/react-zoom-pan-pinchissues?q=label%3Abug).
|
|
109
|
+
- Also make sure to search the internet (including Stack Overflow) to see if
|
|
110
|
+
users outside of the GitHub community have discussed the issue.
|
|
111
|
+
- Collect information about the bug:
|
|
112
|
+
- Stack trace (Traceback)
|
|
113
|
+
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
|
|
114
|
+
- Version of the interpreter, compiler, SDK, runtime environment, package
|
|
115
|
+
manager, depending on what seems relevant.
|
|
116
|
+
- Possibly your input and the output
|
|
117
|
+
- Can you reliably reproduce the issue? And can you also reproduce it with older
|
|
118
|
+
versions?
|
|
119
|
+
|
|
120
|
+
<!-- omit in toc -->
|
|
121
|
+
|
|
122
|
+
#### How Do I Submit a Good Bug Report?
|
|
123
|
+
|
|
124
|
+
> You must never report security related issues, vulnerabilities or bugs
|
|
125
|
+
> including sensitive information to the issue tracker, or elsewhere in public.
|
|
126
|
+
> Instead sensitive bugs must be sent by email to <>.
|
|
127
|
+
|
|
128
|
+
<!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
|
|
129
|
+
|
|
130
|
+
We use GitHub issues to track bugs and errors. If you run into an issue with the
|
|
131
|
+
project:
|
|
132
|
+
|
|
133
|
+
- Open an [Issue](https://github.com/prc5/react-zoom-pan-pinch/issues/new).
|
|
134
|
+
(Since we can't be sure at this point whether it is a bug or not, we ask you
|
|
135
|
+
not to talk about a bug yet and not to label the issue.)
|
|
136
|
+
- Explain the behavior you would expect and the actual behavior.
|
|
137
|
+
- Please provide as much context as possible and describe the _reproduction
|
|
138
|
+
steps_ that someone else can follow to recreate the issue on their own. This
|
|
139
|
+
usually includes your code. For good bug reports you should isolate the
|
|
140
|
+
problem and create a reduced test case.
|
|
141
|
+
- Provide the information you collected in the previous section.
|
|
142
|
+
|
|
143
|
+
Once it's filed:
|
|
144
|
+
|
|
145
|
+
- The project team will label the issue accordingly.
|
|
146
|
+
- A team member will try to reproduce the issue with your provided steps. If
|
|
147
|
+
there are no reproduction steps or no obvious way to reproduce the issue, the
|
|
148
|
+
team will ask you for those steps and mark the issue as `needs-repro`. Bugs
|
|
149
|
+
with the `needs-repro` tag will not be addressed until they are reproduced.
|
|
150
|
+
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as
|
|
151
|
+
well as possibly other tags (such as `critical`), and the issue will be left
|
|
152
|
+
to be [implemented by someone](#your-first-code-contribution).
|
|
153
|
+
|
|
154
|
+
<!-- You might want to create an issue template for bugs and errors that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
|
|
155
|
+
|
|
156
|
+
### Suggesting Enhancements
|
|
157
|
+
|
|
158
|
+
This section guides you through submitting an enhancement suggestion for Zoom
|
|
159
|
+
Pan Pinch, **including completely new features and minor improvements to
|
|
160
|
+
existing functionality**. Following these guidelines will help maintainers and
|
|
161
|
+
the community to understand your suggestion and find related suggestions.
|
|
162
|
+
|
|
163
|
+
<!-- omit in toc -->
|
|
164
|
+
|
|
165
|
+
#### Before Submitting an Enhancement
|
|
166
|
+
|
|
167
|
+
- Make sure that you are using the latest version.
|
|
168
|
+
- Read the [documentation](https://prc5.github.io/react-zoom-pan-pinch/)
|
|
169
|
+
carefully and find out if the functionality is already covered, maybe by an
|
|
170
|
+
individual configuration.
|
|
171
|
+
- Perform a [search](https://github.com/prc5/react-zoom-pan-pinch/issues) to see
|
|
172
|
+
if the enhancement has already been suggested. If it has, add a comment to the
|
|
173
|
+
existing issue instead of opening a new one.
|
|
174
|
+
- Find out whether your idea fits with the scope and aims of the project. It's
|
|
175
|
+
up to you to make a strong case to convince the project's developers of the
|
|
176
|
+
merits of this feature. Keep in mind that we want features that will be useful
|
|
177
|
+
to the majority of our users and not just a small subset. If you're just
|
|
178
|
+
targeting a minority of users, consider writing an add-on/plugin library.
|
|
179
|
+
|
|
180
|
+
<!-- omit in toc -->
|
|
181
|
+
|
|
182
|
+
#### How Do I Submit a Good Enhancement Suggestion?
|
|
183
|
+
|
|
184
|
+
Enhancement suggestions are tracked as
|
|
185
|
+
[GitHub issues](https://github.com/prc5/react-zoom-pan-pinch/issues).
|
|
186
|
+
|
|
187
|
+
- Use a **clear and descriptive title** for the issue to identify the
|
|
188
|
+
suggestion.
|
|
189
|
+
- Provide a **step-by-step description of the suggested enhancement** in as many
|
|
190
|
+
details as possible.
|
|
191
|
+
- **Describe the current behavior** and **explain which behavior you expected to
|
|
192
|
+
see instead** and why. At this point you can also tell which alternatives do
|
|
193
|
+
not work for you.
|
|
194
|
+
- You may want to **include screenshots and animated GIFs** which help you
|
|
195
|
+
demonstrate the steps or point out the part which the suggestion is related
|
|
196
|
+
to.
|
|
197
|
+
- **Explain why this enhancement would be useful** to most Zoom Pan Pinch users.
|
|
198
|
+
You may also want to point out the other projects that solved it better and
|
|
199
|
+
which could serve as inspiration.
|
|
200
|
+
|
|
201
|
+
### Your First Code Contribution
|
|
202
|
+
|
|
203
|
+
Checkout
|
|
204
|
+
[this tutorial](https://github.com/firstcontributions/first-contributions) of
|
|
205
|
+
how to contribute to any project.
|
|
206
|
+
|
|
207
|
+
### Improving The Documentation
|
|
208
|
+
|
|
209
|
+
Anyone can help improve the documentation - it is in this repository and is
|
|
210
|
+
available to everyone - if you have an idea how to improve it - send us a pull
|
|
211
|
+
request and we will try to consider it as soon as possible!
|
|
212
|
+
|
|
213
|
+
## Styleguides
|
|
214
|
+
|
|
215
|
+
Each contribution must meet the conditions of our linter and formatter. When
|
|
216
|
+
these criteria are not met, the creator will get the appropriate status from
|
|
217
|
+
github actions, if issues are not corrected within two weeks, the pull request
|
|
218
|
+
will be rejected and closed immediately.
|
|
219
|
+
|
|
220
|
+
### Commit Messages
|
|
221
|
+
|
|
222
|
+
Commit messages must follow the
|
|
223
|
+
[conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
|
|
224
|
+
and present the best possible description of the changes made, which will later
|
|
225
|
+
be automatically placed in the release notes. They must not contain curses or
|
|
226
|
+
offensive sentences.
|
|
227
|
+
|
|
228
|
+
## Join The Project Team
|
|
229
|
+
|
|
230
|
+
Do you want to have a greater impact on the development of the library? Get in
|
|
231
|
+
touch with us!
|
|
232
|
+
|
|
233
|
+
## Attribution
|
|
234
|
+
|
|
235
|
+
This guide is based on the **contributing-gen**.
|
|
236
|
+
[Make your own](https://github.com/bttger/contributing-gen)!
|