gesture-kit-stylus 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/dist/StylusDrawGesture.d.ts +11 -0
- package/dist/StylusDrawGesture.js +18 -0
- package/dist/StylusHoverGesture.d.ts +11 -0
- package/dist/StylusHoverGesture.js +18 -0
- package/dist/StylusPressureGesture.d.ts +11 -0
- package/dist/StylusPressureGesture.js +18 -0
- package/dist/StylusTapGesture.d.ts +11 -0
- package/dist/StylusTapGesture.js +18 -0
- package/dist/StylusTiltGesture.d.ts +11 -0
- package/dist/StylusTiltGesture.js +18 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.js +13 -0
- package/dist/hooks/useStylusDraw.d.ts +10 -0
- package/dist/hooks/useStylusDraw.js +14 -0
- package/dist/hooks/useStylusHover.d.ts +10 -0
- package/dist/hooks/useStylusHover.js +14 -0
- package/dist/hooks/useStylusPressure.d.ts +10 -0
- package/dist/hooks/useStylusPressure.js +14 -0
- package/dist/hooks/useStylusTap.d.ts +10 -0
- package/dist/hooks/useStylusTap.js +14 -0
- package/dist/hooks/useStylusTilt.d.ts +10 -0
- package/dist/hooks/useStylusTilt.js +14 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +32 -0
- package/dist/types.d.ts +24 -0
- package/dist/types.js +5 -0
- package/package.json +27 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stylus Draw Gesture - Detects stylus drawing
|
|
3
|
+
* @module gestures
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface StylusDrawGestureProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export declare const StylusDrawGesture: React.FC<StylusDrawGestureProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Stylus Draw Gesture - Detects stylus drawing
|
|
4
|
+
* @module gestures
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StylusDrawGesture = void 0;
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const react_native_1 = require("react-native");
|
|
13
|
+
const StylusDrawGesture = ({ children, enabled = true, ...rest }) => {
|
|
14
|
+
// TODO: Implement Stylus Draw Gesture logic
|
|
15
|
+
return react_1.default.createElement(react_native_1.View, { ...rest }, children);
|
|
16
|
+
};
|
|
17
|
+
exports.StylusDrawGesture = StylusDrawGesture;
|
|
18
|
+
exports.StylusDrawGesture.displayName = 'StylusDrawGesture';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stylus Hover Gesture - Detects stylus hovering
|
|
3
|
+
* @module gestures
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface StylusHoverGestureProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export declare const StylusHoverGesture: React.FC<StylusHoverGestureProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Stylus Hover Gesture - Detects stylus hovering
|
|
4
|
+
* @module gestures
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StylusHoverGesture = void 0;
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const react_native_1 = require("react-native");
|
|
13
|
+
const StylusHoverGesture = ({ children, enabled = true, ...rest }) => {
|
|
14
|
+
// TODO: Implement Stylus Hover Gesture logic
|
|
15
|
+
return react_1.default.createElement(react_native_1.View, { ...rest }, children);
|
|
16
|
+
};
|
|
17
|
+
exports.StylusHoverGesture = StylusHoverGesture;
|
|
18
|
+
exports.StylusHoverGesture.displayName = 'StylusHoverGesture';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stylus Pressure Gesture - Detects stylus pressure
|
|
3
|
+
* @module gestures
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface StylusPressureGestureProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export declare const StylusPressureGesture: React.FC<StylusPressureGestureProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Stylus Pressure Gesture - Detects stylus pressure
|
|
4
|
+
* @module gestures
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StylusPressureGesture = void 0;
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const react_native_1 = require("react-native");
|
|
13
|
+
const StylusPressureGesture = ({ children, enabled = true, ...rest }) => {
|
|
14
|
+
// TODO: Implement Stylus Pressure Gesture logic
|
|
15
|
+
return react_1.default.createElement(react_native_1.View, { ...rest }, children);
|
|
16
|
+
};
|
|
17
|
+
exports.StylusPressureGesture = StylusPressureGesture;
|
|
18
|
+
exports.StylusPressureGesture.displayName = 'StylusPressureGesture';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stylus Tap Gesture - Detects stylus tap
|
|
3
|
+
* @module gestures
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface StylusTapGestureProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export declare const StylusTapGesture: React.FC<StylusTapGestureProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Stylus Tap Gesture - Detects stylus tap
|
|
4
|
+
* @module gestures
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StylusTapGesture = void 0;
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const react_native_1 = require("react-native");
|
|
13
|
+
const StylusTapGesture = ({ children, enabled = true, ...rest }) => {
|
|
14
|
+
// TODO: Implement Stylus Tap Gesture logic
|
|
15
|
+
return react_1.default.createElement(react_native_1.View, { ...rest }, children);
|
|
16
|
+
};
|
|
17
|
+
exports.StylusTapGesture = StylusTapGesture;
|
|
18
|
+
exports.StylusTapGesture.displayName = 'StylusTapGesture';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stylus Tilt Gesture - Detects stylus tilt angle
|
|
3
|
+
* @module gestures
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
export interface StylusTiltGestureProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export declare const StylusTiltGesture: React.FC<StylusTiltGestureProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Stylus Tilt Gesture - Detects stylus tilt angle
|
|
4
|
+
* @module gestures
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StylusTiltGesture = void 0;
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const react_native_1 = require("react-native");
|
|
13
|
+
const StylusTiltGesture = ({ children, enabled = true, ...rest }) => {
|
|
14
|
+
// TODO: Implement Stylus Tilt Gesture logic
|
|
15
|
+
return react_1.default.createElement(react_native_1.View, { ...rest }, children);
|
|
16
|
+
};
|
|
17
|
+
exports.StylusTiltGesture = StylusTiltGesture;
|
|
18
|
+
exports.StylusTiltGesture.displayName = 'StylusTiltGesture';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStylusDraw = exports.useStylusHover = exports.useStylusTilt = exports.useStylusPressure = exports.useStylusTap = void 0;
|
|
4
|
+
var useStylusTap_1 = require("./useStylusTap");
|
|
5
|
+
Object.defineProperty(exports, "useStylusTap", { enumerable: true, get: function () { return useStylusTap_1.useStylusTap; } });
|
|
6
|
+
var useStylusPressure_1 = require("./useStylusPressure");
|
|
7
|
+
Object.defineProperty(exports, "useStylusPressure", { enumerable: true, get: function () { return useStylusPressure_1.useStylusPressure; } });
|
|
8
|
+
var useStylusTilt_1 = require("./useStylusTilt");
|
|
9
|
+
Object.defineProperty(exports, "useStylusTilt", { enumerable: true, get: function () { return useStylusTilt_1.useStylusTilt; } });
|
|
10
|
+
var useStylusHover_1 = require("./useStylusHover");
|
|
11
|
+
Object.defineProperty(exports, "useStylusHover", { enumerable: true, get: function () { return useStylusHover_1.useStylusHover; } });
|
|
12
|
+
var useStylusDraw_1 = require("./useStylusDraw");
|
|
13
|
+
Object.defineProperty(exports, "useStylusDraw", { enumerable: true, get: function () { return useStylusDraw_1.useStylusDraw; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* useStylusDraw - useStylusDraw hook
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useStylusDraw = useStylusDraw;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
function useStylusDraw(options = {}) {
|
|
9
|
+
const { enabled = true } = options;
|
|
10
|
+
return (0, react_1.useMemo)(() => {
|
|
11
|
+
// TODO: Implement useStylusDraw logic
|
|
12
|
+
return { enabled };
|
|
13
|
+
}, [enabled]);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* useStylusHover - useStylusHover hook
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useStylusHover = useStylusHover;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
function useStylusHover(options = {}) {
|
|
9
|
+
const { enabled = true } = options;
|
|
10
|
+
return (0, react_1.useMemo)(() => {
|
|
11
|
+
// TODO: Implement useStylusHover logic
|
|
12
|
+
return { enabled };
|
|
13
|
+
}, [enabled]);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* useStylusPressure - useStylusPressure hook
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useStylusPressure = useStylusPressure;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
function useStylusPressure(options = {}) {
|
|
9
|
+
const { enabled = true } = options;
|
|
10
|
+
return (0, react_1.useMemo)(() => {
|
|
11
|
+
// TODO: Implement useStylusPressure logic
|
|
12
|
+
return { enabled };
|
|
13
|
+
}, [enabled]);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* useStylusTap - useStylusTap hook
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useStylusTap = useStylusTap;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
function useStylusTap(options = {}) {
|
|
9
|
+
const { enabled = true } = options;
|
|
10
|
+
return (0, react_1.useMemo)(() => {
|
|
11
|
+
// TODO: Implement useStylusTap logic
|
|
12
|
+
return { enabled };
|
|
13
|
+
}, [enabled]);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* useStylusTilt - useStylusTilt hook
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useStylusTilt = useStylusTilt;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
function useStylusTilt(options = {}) {
|
|
9
|
+
const { enabled = true } = options;
|
|
10
|
+
return (0, react_1.useMemo)(() => {
|
|
11
|
+
// TODO: Implement useStylusTilt logic
|
|
12
|
+
return { enabled };
|
|
13
|
+
}, [enabled]);
|
|
14
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { StylusTapGesture } from './StylusTapGesture';
|
|
3
|
+
export { StylusPressureGesture } from './StylusPressureGesture';
|
|
4
|
+
export { StylusTiltGesture } from './StylusTiltGesture';
|
|
5
|
+
export { StylusHoverGesture } from './StylusHoverGesture';
|
|
6
|
+
export { StylusDrawGesture } from './StylusDrawGesture';
|
|
7
|
+
export * from './hooks';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.StylusDrawGesture = exports.StylusHoverGesture = exports.StylusTiltGesture = exports.StylusPressureGesture = exports.StylusTapGesture = void 0;
|
|
18
|
+
// Types
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
20
|
+
// Components
|
|
21
|
+
var StylusTapGesture_1 = require("./StylusTapGesture");
|
|
22
|
+
Object.defineProperty(exports, "StylusTapGesture", { enumerable: true, get: function () { return StylusTapGesture_1.StylusTapGesture; } });
|
|
23
|
+
var StylusPressureGesture_1 = require("./StylusPressureGesture");
|
|
24
|
+
Object.defineProperty(exports, "StylusPressureGesture", { enumerable: true, get: function () { return StylusPressureGesture_1.StylusPressureGesture; } });
|
|
25
|
+
var StylusTiltGesture_1 = require("./StylusTiltGesture");
|
|
26
|
+
Object.defineProperty(exports, "StylusTiltGesture", { enumerable: true, get: function () { return StylusTiltGesture_1.StylusTiltGesture; } });
|
|
27
|
+
var StylusHoverGesture_1 = require("./StylusHoverGesture");
|
|
28
|
+
Object.defineProperty(exports, "StylusHoverGesture", { enumerable: true, get: function () { return StylusHoverGesture_1.StylusHoverGesture; } });
|
|
29
|
+
var StylusDrawGesture_1 = require("./StylusDrawGesture");
|
|
30
|
+
Object.defineProperty(exports, "StylusDrawGesture", { enumerable: true, get: function () { return StylusDrawGesture_1.StylusDrawGesture; } });
|
|
31
|
+
// Hooks
|
|
32
|
+
__exportStar(require("./hooks"), exports);
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for this gesture category.
|
|
3
|
+
*/
|
|
4
|
+
import type { BaseGestureEvent } from 'gesture-kit-core';
|
|
5
|
+
export interface StylusEvent extends BaseGestureEvent {
|
|
6
|
+
pressure: number;
|
|
7
|
+
tiltX: number;
|
|
8
|
+
tiltY: number;
|
|
9
|
+
}
|
|
10
|
+
export interface StylusTapEvent extends StylusEvent {
|
|
11
|
+
numberOfTaps: number;
|
|
12
|
+
}
|
|
13
|
+
export interface StylusDrawEvent extends StylusEvent {
|
|
14
|
+
path: Array<{
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
pressure: number;
|
|
18
|
+
}>;
|
|
19
|
+
strokeWidth: number;
|
|
20
|
+
}
|
|
21
|
+
export interface StylusHoverEvent extends BaseGestureEvent {
|
|
22
|
+
altitude: number;
|
|
23
|
+
azimuth: number;
|
|
24
|
+
}
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gesture-kit-stylus",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Stylus gestures for gesture-kit",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist", "README.md"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"prepare": "npm run build",
|
|
11
|
+
"typecheck": "tsc --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"react": ">=18.0.0",
|
|
15
|
+
"react-native": ">=0.71.0",
|
|
16
|
+
"react-native-gesture-handler": ">=2.10.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/react": "^18.2.0",
|
|
20
|
+
"react": "^18.2.0",
|
|
21
|
+
"react-native": "^0.73.11",
|
|
22
|
+
"react-native-gesture-handler": "^2.30.0",
|
|
23
|
+
"typescript": "^5.9.3"
|
|
24
|
+
},
|
|
25
|
+
"keywords": ["react-native", "gesture", "stylus"],
|
|
26
|
+
"license": "MIT"
|
|
27
|
+
}
|