Skip to content

Commit

Permalink
Merge pull request #10 from zattoo/release
Browse files Browse the repository at this point in the history
Release 1.0.0-alpha.0
  • Loading branch information
nitzanashi authored May 13, 2020
2 parents c127ae0 + 294d8eb commit daa6035
Show file tree
Hide file tree
Showing 16 changed files with 201 additions and 168 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This config defines repository maintainers
# and automatically requests reviews from them when a pull request changes any owned files
# For more details see https://github.com/blog/2392-introducing-code-owners

* @nitzanashi @godban @pverkhovskyi
75 changes: 75 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [support@zattoo.com](mailto:support@zattoo.com).
All complaints will be reviewed and investigated promptly and fairly.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available [here](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the [FAQ](https://www.contributor-covenant.org/faq). Translations are available [here](https://www.contributor-covenant.org/translations).
20 changes: 20 additions & 0 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Contributing

Thank you for contributing to this project

## Issues

Please report any issues found in this project.
We can't promise to solve it right away but will try to find some resources. Otherwise, feel free to contribute yourself.

## Pull Request

Try to bring a clear and comprehensive description of the PR body so it could help us better understand the proposed changes.

### Quality

Make sure your PR is passing our quality automation.

## Help wanted

If you want to support us, and don't know where to start, there might be some good issues under [help wanted](https://github.com/zattoo/use-double-click/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted) or [good first issue](https://github.com/zattoo/use-double-click/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue) labels.
16 changes: 16 additions & 0 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Acceptance

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
- run: npm ci
- run: npm run test:lint
- run: npm run test:types
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish

on:
push:
branches:
- production

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
- run: npm ci
- run: npm i @zattoo/zploy@1.0.0-rc.0 -g
- run: zploy --gh_token=${{ secrets.GH_TOKEN }} --npm_token=${{ secrets.NPM_TOKEN }}
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.0-alpha.0] - 09.05.2020
## 1.0.0-alpha.0 - 13.05.2020

- Initial implementation
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Zattoo
Copyright (c) 2020 Zattoo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
41 changes: 17 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,44 @@
# Zattoo use-double-click React Hook
React hook for combining double-click function into click event, as well as repeatable double-click.
# useDoubleClick

[React hook][0] for continuous double-clicks and combining click and double-click events

### Install

```shell
npm install @zattoo/use-double-click
npm i @zattoo/use-double-click --save --save-exact
```

Make sure you have at least version 16.8 of `react` and `react-dom` installed, or otherwise hooks won't work for you.

### Usage

```jsx
export const Example = () => {
const [doubleClickCount, setDoubleClickCount] = useState(0);
const [clickCount, setClickCount] = useState(0);

const hybridClick = useDoubleClick(
() => setDoubleClickCount(doubleClickCount + 1),
() => setClickCount(clickCount+1),
300
() => setClickCount(clickCount + 1),
);

return (
<div>
<section>
<p>You clicked {clickCount} times</p>
<p>You double-clicked {doubleClickCount} times</p>
<button onClick={hybridClick}>
<button
type="button"
onClick={hybridClick}
>
Click me
</button>
</div>
</section>
);
}
```

### Call Signature

```typescript
export function useDoubleClick(doubleClick: clickEvent, click?: clickEvent, timeout?: number): clickEvent;
export type clickEvent = (event?: import("react").SyntheticEvent<Element, Event>) => any;
```

### Parameters
- `doubleClick: (event? React.SyntheticEvent) => void`: double-click function to be executed when user double-clicks (single or multiple times) on the bounded component.
- `click?: (event? React.SyntheticEvent) => void`: click function to be executed when user clicks (single time) on the bounded component.
- `timeout?: number`: number of milliseconds to detect double-click event

### Found an issue or have a feature request?

Open up an issue or pull request and participate.
- `doubleClick: (event? React.SyntheticEvent) => void` - double-click function to be executed when user double-clicks (single or multiple times) on the bounded component.
- `click?: (event? React.SyntheticEvent) => void` - click function to be executed when user clicks (single time) on the bounded component.
- `options?: Object`
- `timeout?: number` - number of milliseconds to detect double-click event

[0]: https://reactjs.org/docs/hooks-intro.html
52 changes: 3 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit daa6035

Please sign in to comment.