use-mashing 1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 nakataki
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # useMashing
2
+
3
+ 指定した回数連打されたときにコールバックを呼び出すReactカスタムフックです。
4
+
5
+ A React hook for detecting multiple repeated clicks/taps within a specified time interval.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install use-mashing
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```tsx
16
+ import { useMashing } from "use-mashing";
17
+
18
+ function MyComponent() {
19
+ const handlers = useMashing(
20
+ (event) => {
21
+ console.log("3回連打されました!");
22
+ },
23
+ 3, // 連打とみなす回数
24
+ {
25
+ interval: 300, // 連打とみなす間隔の最大値(ミリ秒)
26
+ onStart: (event) => console.log("連打開始"),
27
+ onCancel: (event) => console.log("連打キャンセル(遅すぎた)"),
28
+ }
29
+ );
30
+
31
+ return <button {...handlers}>3回クリックしてね!</button>;
32
+ }
33
+ ```
34
+
35
+ ## API
36
+
37
+ ### `useMashing(callback, repeatCount, options)`
38
+
39
+ #### Parameters
40
+
41
+ - `callback`: `(event: React.MouseEvent | React.TouchEvent) => void`
42
+ - 指定回数の連打が検出されたときに呼び出される関数
43
+ - `repeatCount`: `number`
44
+ - 連打とみなす回数(必須)
45
+ - `options`: `object` (optional)
46
+ - `interval`: `number` - 連打とみなす間隔の最大値(ミリ秒、デフォルト: 300)
47
+ - `onStart`: `(event) => void` - 新しい連打シーケンスが始まったときのコールバック
48
+ - `onCancel`: `(event) => void` - 連打がキャンセルされたとき(タイムアウト)のコールバック
49
+
50
+ #### Returns
51
+
52
+ `onMouseDown`と`onTouchStart`ハンドラーを含むオブジェクト。任意の要素にスプレッド展開できます。
53
+
54
+ ## Features
55
+
56
+ - マウスクリックとタッチ操作の両方に対応
57
+ - TypeScript完全対応
58
+ - 軽量(依存関係なし)
59
+ - React 16.8以上で動作
60
+
61
+ ## License
62
+
63
+ MIT
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+
3
+ declare function useMashing(callback: (event: React.MouseEvent | React.TouchEvent) => void, repeatCount: number, // 連打とみなす回数(必須)
4
+ options?: {
5
+ interval?: number;
6
+ onStart?: (event: React.MouseEvent | React.TouchEvent) => void;
7
+ onCancel?: (event: React.MouseEvent | React.TouchEvent) => void;
8
+ }): {};
9
+
10
+ export { useMashing };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+
3
+ declare function useMashing(callback: (event: React.MouseEvent | React.TouchEvent) => void, repeatCount: number, // 連打とみなす回数(必須)
4
+ options?: {
5
+ interval?: number;
6
+ onStart?: (event: React.MouseEvent | React.TouchEvent) => void;
7
+ onCancel?: (event: React.MouseEvent | React.TouchEvent) => void;
8
+ }): {};
9
+
10
+ export { useMashing };
package/dist/index.js ADDED
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ useMashing: () => useMashing
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+ var React = __toESM(require("react"));
37
+ var isMouseEvent = (event) => {
38
+ return "button" in event;
39
+ };
40
+ var isTouchEvent = (event) => {
41
+ return "touches" in event;
42
+ };
43
+ function useMashing(callback, repeatCount, options = {}) {
44
+ const { interval = 300, onStart, onCancel } = options;
45
+ const lastClickTimeRef = React.useRef(null);
46
+ const clickCountRef = React.useRef(0);
47
+ const resetTimerRef = React.useRef(null);
48
+ return React.useMemo(() => {
49
+ if (typeof callback !== "function") {
50
+ return {};
51
+ }
52
+ const handleClick = (event) => {
53
+ if (!isMouseEvent(event) && !isTouchEvent(event)) return;
54
+ const currentTime = Date.now();
55
+ const lastClickTime = lastClickTimeRef.current;
56
+ if (lastClickTime !== null && currentTime - lastClickTime <= interval) {
57
+ clickCountRef.current += 1;
58
+ if (clickCountRef.current >= repeatCount) {
59
+ callback(event);
60
+ clickCountRef.current = 0;
61
+ lastClickTimeRef.current = null;
62
+ if (resetTimerRef.current) {
63
+ window.clearTimeout(resetTimerRef.current);
64
+ resetTimerRef.current = null;
65
+ }
66
+ return;
67
+ }
68
+ } else {
69
+ clickCountRef.current = 1;
70
+ if (onStart) {
71
+ onStart(event);
72
+ }
73
+ }
74
+ lastClickTimeRef.current = currentTime;
75
+ if (resetTimerRef.current) {
76
+ window.clearTimeout(resetTimerRef.current);
77
+ }
78
+ resetTimerRef.current = window.setTimeout(() => {
79
+ if (clickCountRef.current > 0 && clickCountRef.current < repeatCount) {
80
+ if (onCancel) {
81
+ onCancel(event);
82
+ }
83
+ }
84
+ clickCountRef.current = 0;
85
+ lastClickTimeRef.current = null;
86
+ }, interval);
87
+ };
88
+ const mouseHandlers = {
89
+ onMouseDown: handleClick
90
+ };
91
+ const touchHandlers = {
92
+ onTouchStart: handleClick
93
+ };
94
+ return {
95
+ ...mouseHandlers,
96
+ ...touchHandlers
97
+ };
98
+ }, [callback, repeatCount, interval, onStart, onCancel]);
99
+ }
100
+ // Annotate the CommonJS export names for ESM import in node:
101
+ 0 && (module.exports = {
102
+ useMashing
103
+ });
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nconst isMouseEvent = (\n event: React.MouseEvent | React.TouchEvent\n): event is React.MouseEvent => {\n return \"button\" in event;\n};\n\nconst isTouchEvent = (\n event: React.MouseEvent | React.TouchEvent\n): event is React.TouchEvent => {\n return \"touches\" in event;\n};\n\n/* 指定回数連打されたときにcallbackを呼び出す */\nexport function useMashing(\n callback: (event: React.MouseEvent | React.TouchEvent) => void,\n repeatCount: number, // 連打とみなす回数(必須)\n options: {\n interval?: number; // 連打とみなす間隔の最大値(ミリ秒)\n onStart?: (event: React.MouseEvent | React.TouchEvent) => void;\n onCancel?: (event: React.MouseEvent | React.TouchEvent) => void;\n } = {}\n) {\n const { interval = 300, onStart, onCancel } = options;\n\n // 更新されても再レンダリングを発火させたくないのでuseStateは使わない\n const lastClickTimeRef = React.useRef<number | null>(null);\n const clickCountRef = React.useRef<number>(0);\n const resetTimerRef = React.useRef<number | null>(null);\n\n return React.useMemo(() => {\n if (typeof callback !== \"function\") {\n return {};\n }\n\n const handleClick = (event: React.MouseEvent | React.TouchEvent) => {\n if (!isMouseEvent(event) && !isTouchEvent(event)) return;\n\n const currentTime = Date.now();\n const lastClickTime = lastClickTimeRef.current;\n\n // 前回のクリックとの間隔をチェック\n if (lastClickTime !== null && currentTime - lastClickTime <= interval) {\n // 連打継続中\n clickCountRef.current += 1;\n\n // 指定回数に達したらcallbackを呼び出す\n if (clickCountRef.current >= repeatCount) {\n callback(event);\n // カウントをリセット\n clickCountRef.current = 0;\n lastClickTimeRef.current = null;\n if (resetTimerRef.current) {\n window.clearTimeout(resetTimerRef.current);\n resetTimerRef.current = null;\n }\n return;\n }\n } else {\n // 新しい連打シーケンスの開始\n clickCountRef.current = 1;\n if (onStart) {\n onStart(event);\n }\n }\n\n // 現在のクリック時刻を記録\n lastClickTimeRef.current = currentTime;\n\n // 既存のリセットタイマーをクリア\n if (resetTimerRef.current) {\n window.clearTimeout(resetTimerRef.current);\n }\n\n // interval経過後にカウントをリセット\n resetTimerRef.current = window.setTimeout(() => {\n if (clickCountRef.current > 0 && clickCountRef.current < repeatCount) {\n if (onCancel) {\n onCancel(event);\n }\n }\n clickCountRef.current = 0;\n lastClickTimeRef.current = null;\n }, interval);\n };\n\n const mouseHandlers = {\n onMouseDown: handleClick,\n };\n\n const touchHandlers = {\n onTouchStart: handleClick,\n };\n\n return {\n ...mouseHandlers,\n ...touchHandlers,\n };\n }, [callback, repeatCount, interval, onStart, onCancel]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AAEvB,IAAM,eAAe,CACnB,UAC8B;AAC9B,SAAO,YAAY;AACrB;AAEA,IAAM,eAAe,CACnB,UAC8B;AAC9B,SAAO,aAAa;AACtB;AAGO,SAAS,WACd,UACA,aACA,UAII,CAAC,GACL;AACA,QAAM,EAAE,WAAW,KAAK,SAAS,SAAS,IAAI;AAG9C,QAAM,mBAAyB,aAAsB,IAAI;AACzD,QAAM,gBAAsB,aAAe,CAAC;AAC5C,QAAM,gBAAsB,aAAsB,IAAI;AAEtD,SAAa,cAAQ,MAAM;AACzB,QAAI,OAAO,aAAa,YAAY;AAClC,aAAO,CAAC;AAAA,IACV;AAEA,UAAM,cAAc,CAAC,UAA+C;AAClE,UAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa,KAAK,EAAG;AAElD,YAAM,cAAc,KAAK,IAAI;AAC7B,YAAM,gBAAgB,iBAAiB;AAGvC,UAAI,kBAAkB,QAAQ,cAAc,iBAAiB,UAAU;AAErE,sBAAc,WAAW;AAGzB,YAAI,cAAc,WAAW,aAAa;AACxC,mBAAS,KAAK;AAEd,wBAAc,UAAU;AACxB,2BAAiB,UAAU;AAC3B,cAAI,cAAc,SAAS;AACzB,mBAAO,aAAa,cAAc,OAAO;AACzC,0BAAc,UAAU;AAAA,UAC1B;AACA;AAAA,QACF;AAAA,MACF,OAAO;AAEL,sBAAc,UAAU;AACxB,YAAI,SAAS;AACX,kBAAQ,KAAK;AAAA,QACf;AAAA,MACF;AAGA,uBAAiB,UAAU;AAG3B,UAAI,cAAc,SAAS;AACzB,eAAO,aAAa,cAAc,OAAO;AAAA,MAC3C;AAGA,oBAAc,UAAU,OAAO,WAAW,MAAM;AAC9C,YAAI,cAAc,UAAU,KAAK,cAAc,UAAU,aAAa;AACpE,cAAI,UAAU;AACZ,qBAAS,KAAK;AAAA,UAChB;AAAA,QACF;AACA,sBAAc,UAAU;AACxB,yBAAiB,UAAU;AAAA,MAC7B,GAAG,QAAQ;AAAA,IACb;AAEA,UAAM,gBAAgB;AAAA,MACpB,aAAa;AAAA,IACf;AAEA,UAAM,gBAAgB;AAAA,MACpB,cAAc;AAAA,IAChB;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,EACF,GAAG,CAAC,UAAU,aAAa,UAAU,SAAS,QAAQ,CAAC;AACzD;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1,69 @@
1
+ // src/index.ts
2
+ import * as React from "react";
3
+ var isMouseEvent = (event) => {
4
+ return "button" in event;
5
+ };
6
+ var isTouchEvent = (event) => {
7
+ return "touches" in event;
8
+ };
9
+ function useMashing(callback, repeatCount, options = {}) {
10
+ const { interval = 300, onStart, onCancel } = options;
11
+ const lastClickTimeRef = React.useRef(null);
12
+ const clickCountRef = React.useRef(0);
13
+ const resetTimerRef = React.useRef(null);
14
+ return React.useMemo(() => {
15
+ if (typeof callback !== "function") {
16
+ return {};
17
+ }
18
+ const handleClick = (event) => {
19
+ if (!isMouseEvent(event) && !isTouchEvent(event)) return;
20
+ const currentTime = Date.now();
21
+ const lastClickTime = lastClickTimeRef.current;
22
+ if (lastClickTime !== null && currentTime - lastClickTime <= interval) {
23
+ clickCountRef.current += 1;
24
+ if (clickCountRef.current >= repeatCount) {
25
+ callback(event);
26
+ clickCountRef.current = 0;
27
+ lastClickTimeRef.current = null;
28
+ if (resetTimerRef.current) {
29
+ window.clearTimeout(resetTimerRef.current);
30
+ resetTimerRef.current = null;
31
+ }
32
+ return;
33
+ }
34
+ } else {
35
+ clickCountRef.current = 1;
36
+ if (onStart) {
37
+ onStart(event);
38
+ }
39
+ }
40
+ lastClickTimeRef.current = currentTime;
41
+ if (resetTimerRef.current) {
42
+ window.clearTimeout(resetTimerRef.current);
43
+ }
44
+ resetTimerRef.current = window.setTimeout(() => {
45
+ if (clickCountRef.current > 0 && clickCountRef.current < repeatCount) {
46
+ if (onCancel) {
47
+ onCancel(event);
48
+ }
49
+ }
50
+ clickCountRef.current = 0;
51
+ lastClickTimeRef.current = null;
52
+ }, interval);
53
+ };
54
+ const mouseHandlers = {
55
+ onMouseDown: handleClick
56
+ };
57
+ const touchHandlers = {
58
+ onTouchStart: handleClick
59
+ };
60
+ return {
61
+ ...mouseHandlers,
62
+ ...touchHandlers
63
+ };
64
+ }, [callback, repeatCount, interval, onStart, onCancel]);
65
+ }
66
+ export {
67
+ useMashing
68
+ };
69
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nconst isMouseEvent = (\n event: React.MouseEvent | React.TouchEvent\n): event is React.MouseEvent => {\n return \"button\" in event;\n};\n\nconst isTouchEvent = (\n event: React.MouseEvent | React.TouchEvent\n): event is React.TouchEvent => {\n return \"touches\" in event;\n};\n\n/* 指定回数連打されたときにcallbackを呼び出す */\nexport function useMashing(\n callback: (event: React.MouseEvent | React.TouchEvent) => void,\n repeatCount: number, // 連打とみなす回数(必須)\n options: {\n interval?: number; // 連打とみなす間隔の最大値(ミリ秒)\n onStart?: (event: React.MouseEvent | React.TouchEvent) => void;\n onCancel?: (event: React.MouseEvent | React.TouchEvent) => void;\n } = {}\n) {\n const { interval = 300, onStart, onCancel } = options;\n\n // 更新されても再レンダリングを発火させたくないのでuseStateは使わない\n const lastClickTimeRef = React.useRef<number | null>(null);\n const clickCountRef = React.useRef<number>(0);\n const resetTimerRef = React.useRef<number | null>(null);\n\n return React.useMemo(() => {\n if (typeof callback !== \"function\") {\n return {};\n }\n\n const handleClick = (event: React.MouseEvent | React.TouchEvent) => {\n if (!isMouseEvent(event) && !isTouchEvent(event)) return;\n\n const currentTime = Date.now();\n const lastClickTime = lastClickTimeRef.current;\n\n // 前回のクリックとの間隔をチェック\n if (lastClickTime !== null && currentTime - lastClickTime <= interval) {\n // 連打継続中\n clickCountRef.current += 1;\n\n // 指定回数に達したらcallbackを呼び出す\n if (clickCountRef.current >= repeatCount) {\n callback(event);\n // カウントをリセット\n clickCountRef.current = 0;\n lastClickTimeRef.current = null;\n if (resetTimerRef.current) {\n window.clearTimeout(resetTimerRef.current);\n resetTimerRef.current = null;\n }\n return;\n }\n } else {\n // 新しい連打シーケンスの開始\n clickCountRef.current = 1;\n if (onStart) {\n onStart(event);\n }\n }\n\n // 現在のクリック時刻を記録\n lastClickTimeRef.current = currentTime;\n\n // 既存のリセットタイマーをクリア\n if (resetTimerRef.current) {\n window.clearTimeout(resetTimerRef.current);\n }\n\n // interval経過後にカウントをリセット\n resetTimerRef.current = window.setTimeout(() => {\n if (clickCountRef.current > 0 && clickCountRef.current < repeatCount) {\n if (onCancel) {\n onCancel(event);\n }\n }\n clickCountRef.current = 0;\n lastClickTimeRef.current = null;\n }, interval);\n };\n\n const mouseHandlers = {\n onMouseDown: handleClick,\n };\n\n const touchHandlers = {\n onTouchStart: handleClick,\n };\n\n return {\n ...mouseHandlers,\n ...touchHandlers,\n };\n }, [callback, repeatCount, interval, onStart, onCancel]);\n}\n"],"mappings":";AAAA,YAAY,WAAW;AAEvB,IAAM,eAAe,CACnB,UAC8B;AAC9B,SAAO,YAAY;AACrB;AAEA,IAAM,eAAe,CACnB,UAC8B;AAC9B,SAAO,aAAa;AACtB;AAGO,SAAS,WACd,UACA,aACA,UAII,CAAC,GACL;AACA,QAAM,EAAE,WAAW,KAAK,SAAS,SAAS,IAAI;AAG9C,QAAM,mBAAyB,aAAsB,IAAI;AACzD,QAAM,gBAAsB,aAAe,CAAC;AAC5C,QAAM,gBAAsB,aAAsB,IAAI;AAEtD,SAAa,cAAQ,MAAM;AACzB,QAAI,OAAO,aAAa,YAAY;AAClC,aAAO,CAAC;AAAA,IACV;AAEA,UAAM,cAAc,CAAC,UAA+C;AAClE,UAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa,KAAK,EAAG;AAElD,YAAM,cAAc,KAAK,IAAI;AAC7B,YAAM,gBAAgB,iBAAiB;AAGvC,UAAI,kBAAkB,QAAQ,cAAc,iBAAiB,UAAU;AAErE,sBAAc,WAAW;AAGzB,YAAI,cAAc,WAAW,aAAa;AACxC,mBAAS,KAAK;AAEd,wBAAc,UAAU;AACxB,2BAAiB,UAAU;AAC3B,cAAI,cAAc,SAAS;AACzB,mBAAO,aAAa,cAAc,OAAO;AACzC,0BAAc,UAAU;AAAA,UAC1B;AACA;AAAA,QACF;AAAA,MACF,OAAO;AAEL,sBAAc,UAAU;AACxB,YAAI,SAAS;AACX,kBAAQ,KAAK;AAAA,QACf;AAAA,MACF;AAGA,uBAAiB,UAAU;AAG3B,UAAI,cAAc,SAAS;AACzB,eAAO,aAAa,cAAc,OAAO;AAAA,MAC3C;AAGA,oBAAc,UAAU,OAAO,WAAW,MAAM;AAC9C,YAAI,cAAc,UAAU,KAAK,cAAc,UAAU,aAAa;AACpE,cAAI,UAAU;AACZ,qBAAS,KAAK;AAAA,UAChB;AAAA,QACF;AACA,sBAAc,UAAU;AACxB,yBAAiB,UAAU;AAAA,MAC7B,GAAG,QAAQ;AAAA,IACb;AAEA,UAAM,gBAAgB;AAAA,MACpB,aAAa;AAAA,IACf;AAEA,UAAM,gBAAgB;AAAA,MACpB,cAAc;AAAA,IAChB;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,EACF,GAAG,CAAC,UAAU,aAAa,UAAU,SAAS,QAAQ,CAAC;AACzD;","names":[]}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "use-mashing",
3
+ "version": "1.0.0",
4
+ "description": "A hook for detecting multiple repeated clicks/taps",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "react",
24
+ "hooks",
25
+ "click",
26
+ "tap",
27
+ "multiple",
28
+ "repeat",
29
+ "mashing"
30
+ ],
31
+ "author": "nakataki",
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/nakataki/useMashing.git"
36
+ },
37
+ "peerDependencies": {
38
+ "react": ">=18.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/react": "^19.2.7",
42
+ "prettier": "^3.7.4",
43
+ "react": "^19.2.3",
44
+ "tsup": "^8.5.1",
45
+ "typescript": "^5.9.3"
46
+ }
47
+ }