Skip to content

Commit edba02e

Browse files
committed
docs: finalize migration of docs by removing the old ones
1 parent 403267a commit edba02e

File tree

8 files changed

+29
-669
lines changed

8 files changed

+29
-669
lines changed

.github/CONTRIBUTING.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
## Contribution Guidelines
22

3-
### Issue
3+
### Opening an issue
44

55
* Make sure you're using the latest version, check [releases](https://github.com/simonwep/viselect/releases/tag/2.1.2) for that.
66
* [Use the search](https://github.com/simonwep/viselect/search?type=Issues), maybe there is already an answer.
77
* If not found, [create an issue](https://github.com/simonwep/viselect/issues/new), please don't forget to carefully describe it how to reproduce it / pay attention to the issue-template.
88

99
***
1010

11-
### Pull Request
11+
### Opening a pull request
1212

1313
* Pull requests only into the [master](https://github.com/simonwep/viselect/tree/master) branch.
14+
* Run `pnpm test:ci` before opening a pull request to verify that everything is working as expected.
1415
* Make sure to use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/):
15-
- `docs: ` - for changes in the documentation.
16-
- `feat([package]): ` - for new features in the corresponding package.
17-
- `fix([package]): ` - for bug fixes in the corresponding package.
18-
- `refactor([package]): ` - for changes in the code that neither fixes a bug nor adds a feature.
19-
- `chore: ` - for changes in the build process or auxiliary tools.
16+
- `docs: ` - for changes in the documentation.
17+
- `feat([package]): ` - for new features in the corresponding package.
18+
- `fix([package]): ` - for bug fixes in the corresponding package.
19+
- `refactor([package]): ` - for changes in the code that neither fixes a bug nor adds a feature.
20+
- `chore: ` - for changes in the build process or auxiliary tools.
2021

2122
***
2223

@@ -27,9 +28,12 @@ This project requires [pnpm](https://pnpm.io) and [node](https://nodejs.org/en/)
2728
1. Fork this repo on [GitHub](https://github.com/simonwep/viselect).
2829
2. Check out the master locally.
2930
3. From your local repro run `pnpm install`.
30-
4. Run `pnpm start dev` to start a dev server for all packages.
31+
4. Run `pnpm dev` to start a dev server for all packages.
32+
5. Make sure to run `pnpm test:ci` before opening a pull request, to verify that everything is working as expected.
3133

32-
#### Working on the docs
34+
***
35+
36+
### Working on the docs
3337

3438
This project uses [vitepress](https://vitepress.dev/) for the documentation.
3539
Use the `docs:` commands to work on the documentation.

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
github: Simonwep
1+
github: simonwep
22
patreon: simonwep
33
custom: ["paypal.me/simonreinisch", "buymeacoffee.com/aVc3krbXQ"]

README.md

+8-53
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h3 align="center">
2-
<img alt="Logo" src="https://user-images.githubusercontent.com/30767528/123517467-622b0f80-d6a1-11eb-9bf3-abcb4928a89e.png" width="400"/>
2+
<img alt="Logo" src="https://user-images.githubusercontent.com/30767528/123517467-622b0f80-d6a1-11eb-9bf3-abcb4928a89e.png" width="350"/>
33
</h3>
44

55
<h3 align="center">
@@ -19,9 +19,12 @@
1919
<a href="https://www.buymeacoffee.com/aVc3krbXQ"><img
2020
alt="Buy me a coffee"
2121
src="https://img.shields.io/badge/%F0%9F%8D%BA-buy%20me%20a%20beer-%23FFDD00"></a>
22-
<a href="https://github.com/simonwep/viselect/actions?query=workflow%3ACI"><img
22+
<a href="https://github.com/simonwep/viselect/actions/workflows/main.yml"><img
2323
alt="Build Status"
24-
src="https://github.com/simonwep/viselect/workflows/CI/badge.svg"></a>
24+
src="https://github.com/simonwep/viselect/actions/workflows/main.yml/badge.svg"></a>
25+
<a href="https://github.com/simonwep/viselect/actions/workflows/deploy.yml"><img
26+
alt="Docs"
27+
src="https://github.com/simonwep/viselect/actions/workflows/deploy.yml/badge.svg"></a>
2528
<img alt="gzip size" src="https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@viselect/vanilla/dist/viselect.umd.js?compression=gzip">
2629
<img alt="brotli size" src="https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@viselect/vanilla/dist/viselect.umd.js?compression=brotli">
2730
<a href="https://v3.vuejs.org"><img
@@ -33,9 +36,6 @@
3336
<a href="https://reactjs.org"><img
3437
alt="React support"
3538
src="https://img.shields.io/badge/✔-react-%2359D7FF"></a>
36-
<a href="https://svelte.dev"><img
37-
alt="Svelte support"
38-
src="https://img.shields.io/badge/%E2%9A%99-svelte-%23F83C00"></a>
3939
</p>
4040

4141
### Features 🤘
@@ -47,56 +47,11 @@
4747
* ✔ Zero dependencies
4848
* 📱 Mobile / touch support
4949
* 🖱 Vertical and horizontal scroll support
50-
* 💪 Hardened (over 3 years old and used in many apps)
50+
* 💪 Battle tested (over 6 years old and used in many apps)
5151

5252
### Getting started
5353

54-
> [!NOTE]
55-
> I'm currently in the middle of moving the migration from readmes to a new docs websites.
56-
> Stay tuned for a better, more detailed documentation in the coming weeks!
57-
58-
Check out the documentation for the package you want to use:
59-
60-
* [@viselect/vanilla](packages/vanilla) - To be used with plain [JavaScript](http://vanilla-js.com/) or [TypeScript](https://www.typescriptlang.org/).
61-
* [@viselect/preact](packages/preact) - [Preact](https://preactjs.com/) wrapper.
62-
* [@viselect/react](packages/react) - [React](https://reactjs.org/) wrapper.
63-
* [@viselect/vue](packages/vue) - [Vue3](https://v3.vuejs.org/) wrapper.
64-
65-
> Check out [recipes](packages/vanilla/recipes.md) for commonly asked questions and how to solve them using the standard library!
66-
> For information about events and more check out the [vanilla readme](packages/vanilla/README.md)!
67-
68-
### Browser support
69-
70-
This library will always produce an ESNext bundle.
71-
If you want to support legacy browsers, please use the feature of your bundler to transpile dependencies.
72-
In case of webpack and babel (give [vite](https://vitejs.dev/) a try, it's awesome) you'll have to install corresponding plugins such as [babel-plugin-proposal-optional-chaining](https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining) and include the dependency from `node_modules` which is normally entirely excluded from being processed.
73-
74-
I do this to provide maximum flexibility and give those who target ESNext a chance to make full use of how this library is bundled.
75-
Everything else is just a matter of configuration :)
76-
77-
### Is this library the right choice for me?
78-
79-
Viselect primarily focuses on being a high-performant engine to select elements with various boundaries, behaviors, and modes in your browser.
80-
Viselect is to "full-blown libraries" what is [popper.js](https://popper.js.org/) to [tippy.js](https://atomiks.github.io/tippyjs/) - the _core_ of your feature.
81-
82-
### Development
83-
84-
Use the following commands to work on this locally (we use [lerna](https://lerna.js.org/) to manage this):
85-
86-
* `npm run dev` _- Spawns a dev-server for all packages. Every framework-dependent package is bundled with the vanilla version._
87-
* `npm run build` _- Builds all packages in parallel._
88-
* `npm run lint:fix` _- Lints and fixes all errors in all packages._
89-
90-
For the development servers [vite](https://vitejs.dev/) is used. It's superb, you should give it a try.
91-
To bundle it, we use [rollup](https://rollupjs.org/) (which is btw also used by vite behind the scenes) to have full control over how the bundle looks like.
92-
93-
### Releasing a new version
94-
95-
This project is managed via [lerna](https://lerna.js.org/).
96-
To bump the version and publish a new one run the following commands:
97-
98-
* `lerna version`
99-
* `lerna publish from-package`
54+
Head over to [the documentation](https://simonwep.github.io/viselect) to get started 🚀
10055

10156
### You want to contribute?
10257

packages/preact/README.md

+2-82
Original file line numberDiff line numberDiff line change
@@ -45,86 +45,6 @@
4545

4646
<br>
4747

48-
> [!NOTE]
49-
> This is merely a convenience wrapper around [@viselect/vanilla](https://github.com/simonwep/viselect/tree/master/packages/vanilla).
50-
> The core API is fairly simple, if you want to have full control over it, you should roll out your own wrapper in your app.
48+
### Getting started
5149

52-
### Installation
53-
54-
Install using your package manager of choice:
55-
56-
```
57-
npm install @viselect/preact
58-
```
59-
60-
Last but not least, you'll need to add some basic styles to make your selection-area visible:
61-
62-
```css
63-
.selection-area {
64-
background: rgba(46, 115, 252, 0.11);
65-
border: 2px solid rgba(98, 155, 255, 0.81);
66-
border-radius: 0.1em;
67-
}
68-
```
69-
70-
Additionally, to not interfere with text-selection, selection-js won't prevent any default events anymore (as of `v2.0.3`).
71-
This, however, can cause problems with the actual selection ("introduced" by [#99](https://github.com/simonwep/viselect/pull/99), reported in [#103](https://github.com/simonwep/viselect/issues/103)).
72-
If you don't care about text-selection, add the following to the container where all your selectables are located:
73-
74-
```css
75-
.container {
76-
user-select: none;
77-
}
78-
```
79-
80-
### Usage
81-
82-
> [!NOTE]
83-
> All options are exposed as props.
84-
> They're a one-to-one mapping of the original options found in the [vanilla](../vanilla#configuration) version!
85-
86-
```tsx
87-
import {SelectionArea, SelectionEvent} from '@viselect/preact';
88-
import {FunctionalComponent} from 'preact';
89-
import {useState} from 'preact/hooks';
90-
91-
const App: FunctionComponent = () => {
92-
const [selected, setSelected] = useState<Set<number>>(() => new Set());
93-
94-
const extractIds = (els: Element[]): number[] =>
95-
els.map(v => v.getAttribute('data-key'))
96-
.filter(Boolean)
97-
.map(Number);
98-
99-
const onStart = ({event, selection}: SelectionEvent) => {
100-
if (!event?.ctrlKey && !event?.metaKey) {
101-
selection.clearSelection();
102-
setSelected(() => new Set());
103-
}
104-
};
105-
106-
const onMove = ({store: {changed: {added, removed}}}: SelectionEvent) => {
107-
setSelected(prev => {
108-
const next = new Set(prev);
109-
extractIds(added).forEach(id => next.add(id));
110-
extractIds(removed).forEach(id => next.delete(id));
111-
return next;
112-
});
113-
};
114-
115-
return (
116-
<>
117-
<SelectionArea className="container"
118-
onStart={onStart}
119-
onMove={onMove}
120-
selectables=".selectable">
121-
{new Array(42).fill(0).map((_, index) => (
122-
<div className={selected.has(index) ? 'selected selectable' : 'selectable'}
123-
data-key={index}
124-
key={index}/>
125-
))}
126-
</SelectionArea>
127-
</>
128-
);
129-
}
130-
```
50+
Head over to [the documentation](https://simonwep.github.io/viselect) to get started 🚀

packages/react/README.md

+2-84
Original file line numberDiff line numberDiff line change
@@ -45,88 +45,6 @@
4545

4646
<br>
4747

48-
> [!NOTE]
49-
> This is merely a convenience wrapper around [@viselect/vanilla](https://github.com/simonwep/viselect/tree/master/packages/vanilla).
50-
> The core API is fairly simple, if you want to have full control over it, you should roll out your own wrapper in your app.
48+
### Getting started
5149

52-
### Installation
53-
54-
Install using your package manager of choice:
55-
56-
```
57-
npm install @viselect/react
58-
```
59-
60-
> If you're (still) using CRA, you may run into issues while using the bundle provided.
61-
> See [this comment](https://github.com/facebook/create-react-app/issues/8445#issuecomment-588545858) for how to fix it.
62-
63-
Last but not least, you'll need to add some basic styles to make your selection-area visible:
64-
65-
```css
66-
.selection-area {
67-
background: rgba(46, 115, 252, 0.11);
68-
border: 2px solid rgba(98, 155, 255, 0.81);
69-
border-radius: 0.1em;
70-
}
71-
```
72-
73-
Additionally, to not interfere with text-selection, selection-js won't prevent any default events anymore (as of `v2.0.3`).
74-
This, however, can cause problems with the actual selection ("introduced" by [#99](https://github.com/simonwep/viselect/pull/99), reported in [#103](https://github.com/simonwep/viselect/issues/103)).
75-
If you don't care about text-selection, add the following to the container where all your selectables are located:
76-
77-
```css
78-
.container {
79-
user-select: none;
80-
}
81-
```
82-
83-
### Usage
84-
85-
> [!NOTE]
86-
> All options are exposed as props.
87-
> They're a one-to-one mapping of the original options found in the [vanilla](../vanilla#configuration) version!
88-
89-
```tsx
90-
import {SelectionArea, SelectionEvent} from '@viselect/react';
91-
import React, {FunctionComponent, useState} from 'react';
92-
93-
const App: FunctionComponent = () => {
94-
const [selected, setSelected] = useState<Set<number>>(() => new Set());
95-
96-
const extractIds = (els: Element[]): number[] =>
97-
els.map(v => v.getAttribute('data-key'))
98-
.filter(Boolean)
99-
.map(Number);
100-
101-
const onStart = ({event, selection}: SelectionEvent) => {
102-
if (!event?.ctrlKey && !event?.metaKey) {
103-
selection.clearSelection();
104-
setSelected(() => new Set());
105-
}
106-
};
107-
108-
const onMove = ({store: {changed: {added, removed}}}: SelectionEvent) => {
109-
setSelected(prev => {
110-
const next = new Set(prev);
111-
extractIds(added).forEach(id => next.add(id));
112-
extractIds(removed).forEach(id => next.delete(id));
113-
return next;
114-
});
115-
};
116-
117-
return (
118-
<>
119-
<SelectionArea className="container"
120-
onStart={onStart}
121-
onMove={onMove}
122-
selectables=".selectable">
123-
{new Array(42).fill(0).map((_, index) => (
124-
<div className={selected.has(index) ? 'selected selectable' : 'selectable'}
125-
data-key={index}
126-
key={index}/>
127-
))}
128-
</SelectionArea>
129-
</>
130-
);
131-
}
132-
```
50+
Head over to [the documentation](https://simonwep.github.io/viselect) to get started 🚀

0 commit comments

Comments
 (0)