Skip to content

Commit

Permalink
total cleanup (will reconstruct repo from scratch)
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Mar 1, 2019
1 parent 8e2ea1e commit 97d60f5
Show file tree
Hide file tree
Showing 62 changed files with 196 additions and 7,744 deletions.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**Do you want to request a _feature_ or report a _bug_?**

**What is the current behavior?**

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than `react-scrollbars-custom`. Paste the link to your JSFiddle (https://jsfiddle.net/) example below:**

**What is the expected behavior?**

**Which versions of `react-scrollbars-custom`, React, and which browser / OS are affected by this issue? Did this work in previous versions of `react-scrollbars-custom`?**
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**Before submitting a pull request,** please make sure the following is done:

1. Fork [the repository](https://github.com/xobotyi/react-scrollbars-custom) and create your branch from `master`.
2. Run `npm i` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`npm run test`). Tip: `npm run test:watch` is helpful in development.
5. Format your code with [prettier](https://github.com/prettier/prettier) (`npm run format`).
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules/
coverage/
.idea/
examples/static/
.idea
.rpt2_cache
package-lock.json
dist/
types/
node_modules
coverage
dist
19 changes: 9 additions & 10 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
coverage/
tests/
examples/
src/
.idea/
.idea
.rpt2_cache
package-lock.json
node_modules
coverage
src
tests
.gitignore
.prettierignore
.prettierrc
.travis.yml
CODE_OF_CONDUCT.md
ISSUE_TEMPLATE.md
karma.*
tsconfig.*.json
rollup.config.js
tsconfig.json
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
node_js:
- "stable"
- "9"
- "10"

sudo: true
Expand Down
29 changes: 0 additions & 29 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +0,0 @@
# CHANGELOG

## v3.2.0 (tba)
**General:**
- Component rewritten with typescript
- ESM bundle support

**Bugfixes:**
- https://github.com/xobotyi/react-scrollbars-custom/issues/41
- https://github.com/xobotyi/react-scrollbars-custom/issues/39
- https://github.com/xobotyi/react-scrollbars-custom/issues/38
- https://github.com/xobotyi/react-scrollbars-custom/issues/29

**API changes**
- `Scrollbar.scrollTo(y, x)` -> `Scrollbar.scrollTo(x, y)`
- `Scrollbar.centerAt(y, x)` -> `Scrollbar.centerAt(x, y)`
- `Scrollbar.props.minimalThumbsSize` -> `Scrollbar.props.minimalThumbSize`
- `Scrollbar.props.tagName` -> removed
- `Scrollbar.props.wrapperRenderer` -> `Scrollbar.props.wrapperProps.renderer`
- `Scrollbar.props.contentRenderer` -> `Scrollbar.props.contentProps.renderer`
- `Scrollbar.props.trackXRenderer` -> `Scrollbar.props.trackXProps.renderer`
- `Scrollbar.props.trackYRenderer` -> `Scrollbar.props.trackYProps.renderer`
- `Scrollbar.props.thumbXRenderer` -> `Scrollbar.props.thumbXProps.renderer`
- `Scrollbar.props.thumbYRenderer` -> `Scrollbar.props.thumbYProps.renderer`
- `Scrollbar.state.isRtl` -> `Scrollbar.state.isRTL`
- new `Scrollbar.props.elementRef`
- new `Scrollbar.props.renderer`
- `Track.props.type` -> `Track.props.axis`
- `Thumb.props.type` -> `Thumb.props.axis`
77 changes: 70 additions & 7 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,76 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
## Our Pledge

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, 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.

Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
## Our Standards

Project maintainers 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. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Examples of behavior that contributes to creating a positive environment
include:

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
Examples of unacceptable behavior by participants include:

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

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers 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, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

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

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
9 changes: 0 additions & 9 deletions ISSUE_TEMPLATE.md

This file was deleted.

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) 2018 Anton Zinovyev
Copyright (c) 2019 Anton Zinovyev

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
67 changes: 0 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +0,0 @@
<h1 align="center">react-scrollbars-custom</h1>
<p align="center">
<a href="https://www.npmjs.com/package/react-scrollbars-custom"><img src="https://img.shields.io/badge/npm-react--scrollbars--custom-brightgreen.svg" /></a>
<a href="https://www.npmjs.com/package/react-scrollbars-custom"><img src="https://img.shields.io/npm/v/react-scrollbars-custom.svg" /></a>
<a href="https://www.npmjs.com/package/react-scrollbars-custom"><img src="https://img.shields.io/npm/dt/react-scrollbars-custom.svg" /></a>
<a href="https://www.npmjs.com/package/react-scrollbars-custom"><img src="https://img.shields.io/travis/xobotyi/react-scrollbars-custom.svg" /></a>
<a href="https://www.codacy.com/app/xobotyi/react-scrollbars-custom"><img src="https://api.codacy.com/project/badge/Grade/f0875490cea1497a9eca9c25f3f7774e"/></a>
<a href="https://www.codacy.com/app/xobotyi/react-scrollbars-custom"><img src="https://api.codacy.com/project/badge/Coverage/f0875490cea1497a9eca9c25f3f7774e"/></a>
<a href="https://www.npmjs.com/package/react-scrollbars-custom"><img src="https://img.shields.io/npm/l/react-scrollbars-custom.svg" /></a>
</p>
<p align="center">
<strong><a href="https://xobotyi.github.io/react-scrollbars-custom/">DEMO</a> · <a href="https://github.com/xobotyi/react-scrollbars-custom/tree/master/docs">DOCUMENTATION</a></strong>
</p>

* Native browser scrolling behaviour - component don't emulate scrolling, only showing custom scrollbars
* Ultimate performance - 60 fps with help of RAF loop
* Desktop or mobile - scrollbars looks the same on any device
* No extra stylesheets required - minimum inline styles out of the box
* Fully customizable - want a hippo as a scrollbar thumb? Well.. I don't judge you
* No matter what changes the content - scrollbars always stay actual
* Total tests coverage
* Scrollbars nesting
* RTL support ([read more](https://github.com/xobotyi/react-scrollbars-custom/blob/master/docs/USAGE.md#rtl-support))
* momentum scrolling for iOS

>**IMPORTANT:** default component styles uses [Flexible Box Layout](https://developer.mozilla.org/ru/docs/Web/CSS/CSS_Flexible_Box_Layout) for proper scrollbars display.
>But you can customize it with help pf inline or linked styles as you wish ([see docs](https://github.com/xobotyi/react-scrollbars-custom/blob/master/docs/CUSTOMISATION.md)).
## Installation
```bash
npm i --save react-scrollbars-custom
```

## Usage
Minimal configuration
```javascript
class App extends Component
{
render() {
return (
<Scrollbar style={ {width: '100%', height: '100%', minHeight: 300} } >
<p>Hello world!</p>
</Scrollbar>
);
}
}
```
All properties and methods are in the [API Documentation](https://github.com/xobotyi/react-scrollbars-custom/tree/master/docs/API.md)

## Examples
Run the example, it will install dependencies, build current component version and run local web-server listening `localhost:3000` (browser window will open automatically)
```bash
# install dependencies if you haven't yet
npm install
npm run examples
```

## Tests
```bash
# install dependencies if you haven't yet
npm install
npm run test
```

## Credits
Big thanks to [@malte-wessel](https://github.com/malte-wessel) with his [react-custom-scrollbars](https://github.com/malte-wessel/react-custom-scrollbars) which I used before writing this component.
So don't be wondered that repos and code look similar in some places, his package used as ethalon. And for the users convenience i've tried to make API's seamless as much as it possible.
Loading

0 comments on commit 97d60f5

Please sign in to comment.