Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<br>
</h1>

<h4 align="center"> Modern, lightweight, robust and extensible user interaction resolver </h4>
<h4 align="center"> modern, lightweight, robust and extensible user gesture recognizer </h4>

<p align="center">
<a href="https://github.com/hesprs/pointeract/actions">
Expand Down Expand Up @@ -72,26 +72,17 @@ $ pnpm add pointeract

# yarn
$ yarn add pointeract

# bun
$ bun add pointeract
```

Or include the following lines directly in your HTML file:

```html
<script type="module">
import { Pointeract } from 'https://unpkg.com/pointeract/dist/index.js';
import { Pointeract } from 'https://unpkg.com/pointeract';
</script>
```

This link ships the latest ESM version by default, to access CJS version or earlier versions, try using a different URL like:

```html
<script src="https://unpkg.com/pointeract@1.0.1/dist/index.cjs"></script>
```

The link above ships version 1.0.1 in CJS.
This link ships the latest ESM version by default.

Then simply grab the core class and a module:

Expand Down Expand Up @@ -124,15 +115,15 @@ Missing your desired interaction? [Write your own module](https://pointeract.con

There're already plenty of interaction libraries out there, most famous ones are `Interact.js` and `Hammer.js`, but Pointeract is different.

| Criteria | Pointeract | [Hammer.js](https://hammerjs.github.io) | [Interact.js](https://interactjs.io) |
| :--------------------------------------------------------------------------------------- | :---------------------------------------------------: | :----------------------------------------------: | :-------------------------------------------------: |
| Written in TypeScript? | ✅ | ❌ | ✅ |
| Tree-shakeable? | [✅](https://bundlephobia.com/package/pointeract) | [❌](https://bundlephobia.com/package/hammerjs) | [❌](https://bundlephobia.com/package/interactjs) |
| Bundle Size (Minified + Gzipped) | 👑 [3KB](https://bundlephobia.com/package/pointeract) | [7KB](https://bundlephobia.com/package/hammerjs) | [28KB](https://bundlephobia.com/package/interactjs) |
| Last Updated | 👑 Actively Maintained | 2015 | 2023 |
| Features | Pointer and Wheel Related | Pointer Related | 👑 Pointer and Wheel Related + Comprehensive Utils |
| Robust? (See [Testing](https://pointeract.consensia.cc/development/testing#monkey-test)) | ✅ | ❌ Element Jerks | ❌ Element Ignores the Second Touch |
| Extensible? | ✅ | ❌ | ❌ |
| Criteria | Pointeract | [Hammer.js](https://hammerjs.github.io) | [Interact.js](https://interactjs.io) |
| :-------------------------------------------------------- | :---------------------------------------------------: | :----------------------------------------------: | :-------------------------------------------------: |
| Written in TypeScript? | ✅ | ❌ | ✅ |
| Tree-shakeable? | [✅](https://bundlephobia.com/package/pointeract) | [❌](https://bundlephobia.com/package/hammerjs) | [❌](https://bundlephobia.com/package/interactjs) |
| Total Bundle Size (Minified + Gzipped) | 👑 [3KB](https://bundlephobia.com/package/pointeract) | [7KB](https://bundlephobia.com/package/hammerjs) | [28KB](https://bundlephobia.com/package/interactjs) |
| Last Updated | 👑 Actively Maintained | 2015 | 2023 |
| Features | Pointer and Wheel Related + Some Utils | Pointer Related | 👑 Pointer and Wheel Related + Comprehensive Utils |
| Robust? (See [Testing](/development/testing#monkey-test)) | ✅ | ❌ Element Jerks | ❌ Element Ignores the Second Touch |
| Extensible? | ✅ | ❌ | ❌ |

## Get Involved

Expand Down
14 changes: 4 additions & 10 deletions docs/en/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- Supported Browsers: **All Modern Browsers (IE11+)**
- Supported Frameworks: **All**
- Supported Module Standards: **ESM**, **CJS**
- Supported Module Standards: **ESM**

## Installation

Expand All @@ -30,19 +30,13 @@ Or include the following lines directly in your HTML file:

```html
<script type="module">
import { Pointeract } from 'https://unpkg.com/pointeract/dist/index.js';
import { Pointeract } from 'https://unpkg.com/pointeract';
</script>
```

This link ships the latest ESM version by default, to access CJS version or earlier versions, try using a different URL like:
This link ships the latest ESM version by default.

```html
<script src="https://unpkg.com/pointeract@1.0.1/dist/index.cjs"></script>
```

The link above ships version 1.0.1 in CJS.

## Kickstart
## Start

Simply grab the core class and a module:

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pointeract",
"version": "1.1.0",
"version": "1.1.1",
"description": "Modern, lightweight, robust and extensible user gesture recognizer.",
"keywords": [
"frontend",
Expand All @@ -26,9 +26,11 @@
],
"type": "module",
"sideEffects": false,
"main": "./dist/index.cjs",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/types/index.d.ts",
"unpkg": "./dist/index.js",
"jsdelivr": "./dist/index.js",
"publishConfig": {
"access": "public",
"provenance": true
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default defineConfig({
index: resolve(__dirname, 'src'),
},
name: 'Pointeract',
formats: ['es', 'cjs'],
fileName: (format) => `index.${format === 'cjs' ? 'cjs' : 'js'}`,
formats: ['es'],
fileName: `index.js`,
},
},
test: {
Expand Down