@symbiote-native/haptics 0.3.0 → 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/README.md +61 -7
- package/package.json +27 -15
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Taptic Engine and Android's Vibrator API, plus a direct Android haptics-engine p
|
|
|
6
6
|
(`performAndroidHapticsAsync`). Built the same way as
|
|
7
7
|
[`@symbiote-native/local-auth`](../local-auth): an `expo-modules-core`-based wrapper, free
|
|
8
8
|
functions with no per-instance state and no event stream. Reachable from every adapter — React,
|
|
9
|
-
Vue, Angular — not just React.
|
|
9
|
+
Vue, Svelte, Solid, Angular — not just React.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -51,9 +51,10 @@ src/angular/ @symbiote-native/haptics/angular — plain re-export of core.
|
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Upstream ships four async functions and three enums, not a subscribable sensor — there's
|
|
54
|
-
nothing per-framework to add, so `./react`, `./vue`, and `./
|
|
55
|
-
straight onto `src/core/` (no physical per-framework file). `./angular`
|
|
56
|
-
file/subpath since Angular ships through a separate `ngc`/AOT build
|
|
54
|
+
nothing per-framework to add, so `./react`, `./vue`, `./svelte`, and `./solid` are
|
|
55
|
+
`exports`-map aliases straight onto `src/core/` (no physical per-framework file). `./angular`
|
|
56
|
+
stays a physical file/subpath since Angular ships through a separate `ngc`/AOT build
|
|
57
|
+
(`build-ngc/`).
|
|
57
58
|
|
|
58
59
|
## Use it
|
|
59
60
|
|
|
@@ -107,6 +108,56 @@ function fireImpact(style: ImpactFeedbackStyle): void {
|
|
|
107
108
|
</template>
|
|
108
109
|
```
|
|
109
110
|
|
|
111
|
+
```svelte
|
|
112
|
+
<!-- Svelte — examples/expo-svelte/screens/HapticsScreen.svelte -->
|
|
113
|
+
<script lang="ts">
|
|
114
|
+
import {
|
|
115
|
+
impactAsync,
|
|
116
|
+
ImpactFeedbackStyle,
|
|
117
|
+
notificationAsync,
|
|
118
|
+
NotificationFeedbackType,
|
|
119
|
+
selectionAsync,
|
|
120
|
+
} from '@symbiote-native/haptics';
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<ActionButton
|
|
124
|
+
title="Medium"
|
|
125
|
+
onPress={() => impactAsync(ImpactFeedbackStyle.Medium)}
|
|
126
|
+
/>
|
|
127
|
+
<ActionButton
|
|
128
|
+
title="Success"
|
|
129
|
+
onPress={() => notificationAsync(NotificationFeedbackType.Success)}
|
|
130
|
+
/>
|
|
131
|
+
<ActionButton title="Selection" onPress={() => selectionAsync()} />
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
// Solid — examples/expo-solid/screens/HapticsScreen.tsx
|
|
136
|
+
import {
|
|
137
|
+
impactAsync,
|
|
138
|
+
ImpactFeedbackStyle,
|
|
139
|
+
notificationAsync,
|
|
140
|
+
NotificationFeedbackType,
|
|
141
|
+
selectionAsync,
|
|
142
|
+
} from '@symbiote-native/haptics';
|
|
143
|
+
|
|
144
|
+
function HapticsScreen() {
|
|
145
|
+
return (
|
|
146
|
+
<>
|
|
147
|
+
<ActionButton
|
|
148
|
+
title="Medium"
|
|
149
|
+
onPress={() => impactAsync(ImpactFeedbackStyle.Medium)}
|
|
150
|
+
/>
|
|
151
|
+
<ActionButton
|
|
152
|
+
title="Success"
|
|
153
|
+
onPress={() => notificationAsync(NotificationFeedbackType.Success)}
|
|
154
|
+
/>
|
|
155
|
+
<ActionButton title="Selection" onPress={() => selectionAsync()} />
|
|
156
|
+
</>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
110
161
|
```ts
|
|
111
162
|
// Angular — examples/expo-angular/src/screens/HapticsScreen.ts
|
|
112
163
|
import { Component } from '@angular/core';
|
|
@@ -162,6 +213,8 @@ import { impactAsync, ImpactFeedbackStyle } from '@symbiote-native/haptics';
|
|
|
162
213
|
// or the framework-scoped entry points — identical surface, re-exported verbatim:
|
|
163
214
|
import { impactAsync } from '@symbiote-native/haptics/react';
|
|
164
215
|
import { impactAsync } from '@symbiote-native/haptics/vue';
|
|
216
|
+
import { impactAsync } from '@symbiote-native/haptics/svelte';
|
|
217
|
+
import { impactAsync } from '@symbiote-native/haptics/solid';
|
|
165
218
|
import { impactAsync } from '@symbiote-native/haptics/angular';
|
|
166
219
|
```
|
|
167
220
|
|
|
@@ -173,8 +226,9 @@ Tests exercise the JS layer via a fake native module in place of the real
|
|
|
173
226
|
ViewConfig. Native rendering itself is verified on-device (see the parent
|
|
174
227
|
[README](../../README.md)).
|
|
175
228
|
|
|
176
|
-
Native wiring for this package is done across all
|
|
229
|
+
Native wiring for this package is done across all six `examples/expo-*` canary apps (Android
|
|
177
230
|
3-layer registration in each app's `build.gradle`/`MainApplication.kt`/`AndroidManifest.xml`,
|
|
178
231
|
plus iOS Podfile/pod install) — not yet ported into the plain, non-Expo public canaries
|
|
179
|
-
(`examples/react`, `examples/vue-sfc`, `examples/vue-tsx`, `examples/
|
|
180
|
-
on-device/simulator automated (Detox) smoke test exists yet, only
|
|
232
|
+
(`examples/react`, `examples/vue-sfc`, `examples/vue-tsx`, `examples/svelte`, `examples/solid`,
|
|
233
|
+
`examples/angular`), and no on-device/simulator automated (Detox) smoke test exists yet, only
|
|
234
|
+
manual verification.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/haptics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "expo-haptics wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Impact/notification/selection vibration feedback via iOS's Taptic Engine and Android's Vibrator API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
"url": "https://github.com/OneEyed1366/symbiote-native/issues"
|
|
14
14
|
},
|
|
15
15
|
"author": "Andrey Prokopenko <psevdoproger@gmail.com>",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"react-native",
|
|
18
|
+
"symbiote-native",
|
|
19
|
+
"expo-haptics",
|
|
20
|
+
"react",
|
|
21
|
+
"vue",
|
|
22
|
+
"svelte",
|
|
23
|
+
"solid",
|
|
24
|
+
"angular",
|
|
25
|
+
"vibration",
|
|
26
|
+
"taptic-engine"
|
|
27
|
+
],
|
|
16
28
|
"type": "module",
|
|
17
29
|
"main": "./build/core/index.js",
|
|
18
30
|
"module": "./build/core/index.js",
|
|
@@ -61,19 +73,19 @@
|
|
|
61
73
|
"expo-modules-core": "57.0.5"
|
|
62
74
|
},
|
|
63
75
|
"peerDependencies": {
|
|
64
|
-
"@symbiote-native/angular": ">=0.6.2",
|
|
65
|
-
"@symbiote-native/engine": ">=0.1.7",
|
|
66
|
-
"@symbiote-native/react": ">=0.2.8",
|
|
67
|
-
"@symbiote-native/solid": ">=0.0.1",
|
|
68
|
-
"@symbiote-native/svelte": ">=0.1.0",
|
|
69
|
-
"@symbiote-native/vue": ">=0.3.8",
|
|
70
76
|
"@angular/core": ">=20",
|
|
71
77
|
"@vue/runtime-core": "^3.5.13",
|
|
72
78
|
"react": ">=19.0.0",
|
|
73
79
|
"react-native": ">=0.86",
|
|
74
80
|
"solid-js": ">=1.9.0",
|
|
75
81
|
"svelte": ">=5.56.0",
|
|
76
|
-
"vue": ">=3.5.0"
|
|
82
|
+
"vue": ">=3.5.0",
|
|
83
|
+
"@symbiote-native/angular": "^1.0.0",
|
|
84
|
+
"@symbiote-native/engine": "^0.4.0",
|
|
85
|
+
"@symbiote-native/react": "^1.0.0",
|
|
86
|
+
"@symbiote-native/solid": "^1.0.0",
|
|
87
|
+
"@symbiote-native/svelte": "^1.0.0",
|
|
88
|
+
"@symbiote-native/vue": "^1.0.0"
|
|
77
89
|
},
|
|
78
90
|
"peerDependenciesMeta": {
|
|
79
91
|
"@symbiote-native/angular": {
|
|
@@ -121,13 +133,13 @@
|
|
|
121
133
|
"solid-js": "^1.9.14",
|
|
122
134
|
"svelte": "^5.56.0",
|
|
123
135
|
"typescript": "~6.0.0",
|
|
124
|
-
"@symbiote-native/angular": "0.
|
|
125
|
-
"@symbiote-native/engine": "0.
|
|
126
|
-
"@symbiote-native/react": "0.
|
|
127
|
-
"@symbiote-native/solid": "
|
|
128
|
-
"@symbiote-native/svelte": "0.
|
|
129
|
-
"@symbiote-native/test-utils": "0.
|
|
130
|
-
"@symbiote-native/vue": "0.
|
|
136
|
+
"@symbiote-native/angular": "1.0.0",
|
|
137
|
+
"@symbiote-native/engine": "0.4.0",
|
|
138
|
+
"@symbiote-native/react": "1.0.0",
|
|
139
|
+
"@symbiote-native/solid": "1.0.0",
|
|
140
|
+
"@symbiote-native/svelte": "1.0.0",
|
|
141
|
+
"@symbiote-native/test-utils": "0.3.0",
|
|
142
|
+
"@symbiote-native/vue": "1.0.0"
|
|
131
143
|
},
|
|
132
144
|
"scripts": {
|
|
133
145
|
"typecheck": "tsc --build",
|