@symbiote-native/haptics 0.2.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 +103 -21
- package/build/core/haptics.js +1 -1
- package/build/core/index.d.ts +1 -1
- package/build/core/index.js +1 -1
- package/build-ngc/core/haptics.js +1 -1
- package/build-ngc/core/haptics.js.map +1 -1
- package/build-ngc/core/index.d.ts +1 -1
- package/build-ngc/core/index.js +1 -1
- package/build-ngc/core/index.js.map +1 -1
- package/build-ngc/core/native-module.js.map +1 -1
- package/package.json +46 -20
- package/src/core/haptics.ts +8 -2
- package/src/core/index.ts +5 -1
- package/src/core/native-module.ts +8 -2
- package/build/react/index.d.ts +0 -1
- package/build/react/index.js +0 -5
- package/build/svelte/index.d.ts +0 -1
- package/build/svelte/index.js +0 -6
- package/build/vue/index.d.ts +0 -1
- package/build/vue/index.js +0 -4
- package/src/react/index.ts +0 -5
- package/src/svelte/index.ts +0 -6
- package/src/vue/index.ts +0 -4
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
|
|
|
@@ -25,12 +25,12 @@ Unlike a plain RN native module, `expo-haptics`' native code is discovered by
|
|
|
25
25
|
wiring into the native host app **once**, covering this package and every other
|
|
26
26
|
`expo-modules-core` package with zero further changes:
|
|
27
27
|
|
|
28
|
-
| Platform | Touches
|
|
29
|
-
|
|
30
|
-
| iOS
|
|
31
|
-
| iOS
|
|
32
|
-
| Android
|
|
33
|
-
| Android
|
|
28
|
+
| Platform | Touches |
|
|
29
|
+
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| iOS | `ios/Podfile` — add `use_expo_modules!` |
|
|
31
|
+
| iOS | `AppDelegate.swift` — Expo's runtime-bootstrap hook |
|
|
32
|
+
| Android | `settings.gradle` / `app/build.gradle` — resolve and include the Expo Gradle projects |
|
|
33
|
+
| Android | `MainApplication.kt` — Expo's bootstrap hook, plus a hand-written native-module name map (there's no `expo` meta-package here to auto-generate one) |
|
|
34
34
|
|
|
35
35
|
Full mechanics live in the `symbiote-expo-native-module` project skill. Reference
|
|
36
36
|
implementation: `examples/expo-react/ios/Podfile` and
|
|
@@ -47,26 +47,38 @@ src/core/ notificationAsync / impactAsync / selectionAsync / performAndroidH
|
|
|
47
47
|
plus NotificationFeedbackType / ImpactFeedbackStyle / AndroidHaptics.
|
|
48
48
|
native-module.ts resolves the ExpoHaptics native module via
|
|
49
49
|
expo-modules-core's requireNativeModule.
|
|
50
|
-
src/react/ @symbiote-native/haptics/react — plain re-export of core.
|
|
51
|
-
src/vue/ @symbiote-native/haptics/vue — plain re-export of core.
|
|
52
50
|
src/angular/ @symbiote-native/haptics/angular — plain re-export of core.
|
|
53
51
|
```
|
|
54
52
|
|
|
55
53
|
Upstream ships four async functions and three enums, not a subscribable sensor — there's
|
|
56
|
-
nothing per-framework to add, so
|
|
57
|
-
`core
|
|
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/`).
|
|
58
58
|
|
|
59
59
|
## Use it
|
|
60
60
|
|
|
61
61
|
```tsx
|
|
62
62
|
// React — examples/expo-react/screens/HapticsScreen.tsx
|
|
63
|
-
import {
|
|
63
|
+
import {
|
|
64
|
+
impactAsync,
|
|
65
|
+
ImpactFeedbackStyle,
|
|
66
|
+
notificationAsync,
|
|
67
|
+
NotificationFeedbackType,
|
|
68
|
+
selectionAsync,
|
|
69
|
+
} from '@symbiote-native/haptics';
|
|
64
70
|
|
|
65
71
|
function HapticsScreen() {
|
|
66
72
|
return (
|
|
67
73
|
<>
|
|
68
|
-
<ActionButton
|
|
69
|
-
|
|
74
|
+
<ActionButton
|
|
75
|
+
title="Medium"
|
|
76
|
+
onPress={() => impactAsync(ImpactFeedbackStyle.Medium)}
|
|
77
|
+
/>
|
|
78
|
+
<ActionButton
|
|
79
|
+
title="Success"
|
|
80
|
+
onPress={() => notificationAsync(NotificationFeedbackType.Success)}
|
|
81
|
+
/>
|
|
70
82
|
<ActionButton title="Selection" onPress={() => selectionAsync()} />
|
|
71
83
|
</>
|
|
72
84
|
);
|
|
@@ -76,25 +88,92 @@ function HapticsScreen() {
|
|
|
76
88
|
```vue
|
|
77
89
|
<!-- Vue — examples/expo-vue-sfc/screens/HapticsScreen.vue -->
|
|
78
90
|
<script setup lang="ts">
|
|
79
|
-
import {
|
|
91
|
+
import {
|
|
92
|
+
impactAsync,
|
|
93
|
+
ImpactFeedbackStyle,
|
|
94
|
+
notificationAsync,
|
|
95
|
+
NotificationFeedbackType,
|
|
96
|
+
selectionAsync,
|
|
97
|
+
} from '@symbiote-native/haptics';
|
|
80
98
|
|
|
81
99
|
function fireImpact(style: ImpactFeedbackStyle): void {
|
|
82
100
|
void impactAsync(style);
|
|
83
101
|
}
|
|
84
102
|
</script>
|
|
85
103
|
<template>
|
|
86
|
-
<ActionButton
|
|
104
|
+
<ActionButton
|
|
105
|
+
title="Medium"
|
|
106
|
+
:onPress="() => fireImpact(ImpactFeedbackStyle.Medium)"
|
|
107
|
+
/>
|
|
87
108
|
</template>
|
|
88
109
|
```
|
|
89
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
|
+
|
|
90
161
|
```ts
|
|
91
162
|
// Angular — examples/expo-angular/src/screens/HapticsScreen.ts
|
|
92
163
|
import { Component } from '@angular/core';
|
|
93
|
-
import {
|
|
164
|
+
import {
|
|
165
|
+
impactAsync,
|
|
166
|
+
ImpactFeedbackStyle,
|
|
167
|
+
notificationAsync,
|
|
168
|
+
NotificationFeedbackType,
|
|
169
|
+
} from '@symbiote-native/haptics';
|
|
94
170
|
|
|
95
171
|
@Component({
|
|
96
172
|
selector: 'HapticsScreen',
|
|
97
|
-
template: `<ActionButton
|
|
173
|
+
template: `<ActionButton
|
|
174
|
+
title="Medium"
|
|
175
|
+
(press)="handleImpact()"
|
|
176
|
+
></ActionButton>`,
|
|
98
177
|
})
|
|
99
178
|
export class HapticsScreen {
|
|
100
179
|
handleImpact(): void {
|
|
@@ -134,6 +213,8 @@ import { impactAsync, ImpactFeedbackStyle } from '@symbiote-native/haptics';
|
|
|
134
213
|
// or the framework-scoped entry points — identical surface, re-exported verbatim:
|
|
135
214
|
import { impactAsync } from '@symbiote-native/haptics/react';
|
|
136
215
|
import { impactAsync } from '@symbiote-native/haptics/vue';
|
|
216
|
+
import { impactAsync } from '@symbiote-native/haptics/svelte';
|
|
217
|
+
import { impactAsync } from '@symbiote-native/haptics/solid';
|
|
137
218
|
import { impactAsync } from '@symbiote-native/haptics/angular';
|
|
138
219
|
```
|
|
139
220
|
|
|
@@ -145,8 +226,9 @@ Tests exercise the JS layer via a fake native module in place of the real
|
|
|
145
226
|
ViewConfig. Native rendering itself is verified on-device (see the parent
|
|
146
227
|
[README](../../README.md)).
|
|
147
228
|
|
|
148
|
-
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
|
|
149
230
|
3-layer registration in each app's `build.gradle`/`MainApplication.kt`/`AndroidManifest.xml`,
|
|
150
231
|
plus iOS Podfile/pod install) — not yet ported into the plain, non-Expo public canaries
|
|
151
|
-
(`examples/react`, `examples/vue-sfc`, `examples/vue-tsx`, `examples/
|
|
152
|
-
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/build/core/haptics.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Platform, UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
import { expoHaptics } from './native-module.js';
|
|
3
|
-
import { AndroidHaptics, ImpactFeedbackStyle, NotificationFeedbackType } from './types.js';
|
|
3
|
+
import { AndroidHaptics, ImpactFeedbackStyle, NotificationFeedbackType, } from './types.js';
|
|
4
4
|
const NATIVE_MODULE_NAME = 'expo-haptics';
|
|
5
5
|
/**
|
|
6
6
|
* The kind of notification response used in the feedback. On Android it is simulated using
|
package/build/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { notificationAsync, impactAsync, selectionAsync, performAndroidHapticsAsync, } from './haptics';
|
|
2
|
-
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics } from './types';
|
|
2
|
+
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics, } from './types';
|
package/build/core/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { notificationAsync, impactAsync, selectionAsync, performAndroidHapticsAsync, } from './haptics.js';
|
|
2
|
-
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics } from './types.js';
|
|
2
|
+
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics, } from './types.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Platform, UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
import { expoHaptics } from './native-module';
|
|
3
|
-
import { AndroidHaptics, ImpactFeedbackStyle, NotificationFeedbackType } from './types';
|
|
3
|
+
import { AndroidHaptics, ImpactFeedbackStyle, NotificationFeedbackType, } from './types';
|
|
4
4
|
const NATIVE_MODULE_NAME = 'expo-haptics';
|
|
5
5
|
/**
|
|
6
6
|
* The kind of notification response used in the feedback. On Android it is simulated using
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"haptics.js","sourceRoot":"","sources":["../../src/core/haptics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"haptics.js","sourceRoot":"","sources":["../../src/core/haptics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAiC,wBAAwB,CAAC,OAAO;IAEjE,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;QACnC,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IACzE,CAAC;IACD,MAAM,WAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAA6B,mBAAmB,CAAC,MAAM;IAEvD,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QAC7B,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC;IACnE,CAAC;IACD,MAAM,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;QAChC,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,WAAW,CAAC,cAAc,EAAE,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,IAAoB;IAEpB,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO;IACT,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC;QACrC,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { notificationAsync, impactAsync, selectionAsync, performAndroidHapticsAsync, } from './haptics';
|
|
2
|
-
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics } from './types';
|
|
2
|
+
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics, } from './types';
|
package/build-ngc/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { notificationAsync, impactAsync, selectionAsync, performAndroidHapticsAsync, } from './haptics';
|
|
2
|
-
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics } from './types';
|
|
2
|
+
export { NotificationFeedbackType, ImpactFeedbackStyle, AndroidHaptics, } from './types';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAOxD,MAAM,wBAAwB,GAAG,aAAa,CAAC;AAgB/C,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAC5C,wBAAwB,CACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/haptics",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "expo-haptics wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters. Impact/notification/selection vibration feedback via iOS's Taptic Engine and Android's Vibrator API.",
|
|
3
|
+
"version": "1.0.0",
|
|
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": {
|
|
7
7
|
"type": "git",
|
|
@@ -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",
|
|
@@ -23,16 +35,20 @@
|
|
|
23
35
|
"default": "./build/core/index.js"
|
|
24
36
|
},
|
|
25
37
|
"./vue": {
|
|
26
|
-
"types": "./build/
|
|
27
|
-
"default": "./build/
|
|
38
|
+
"types": "./build/core/index.d.ts",
|
|
39
|
+
"default": "./build/core/index.js"
|
|
28
40
|
},
|
|
29
41
|
"./react": {
|
|
30
|
-
"types": "./build/
|
|
31
|
-
"default": "./build/
|
|
42
|
+
"types": "./build/core/index.d.ts",
|
|
43
|
+
"default": "./build/core/index.js"
|
|
32
44
|
},
|
|
33
45
|
"./svelte": {
|
|
34
|
-
"types": "./build/
|
|
35
|
-
"default": "./build/
|
|
46
|
+
"types": "./build/core/index.d.ts",
|
|
47
|
+
"default": "./build/core/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./solid": {
|
|
50
|
+
"types": "./build/core/index.d.ts",
|
|
51
|
+
"default": "./build/core/index.js"
|
|
36
52
|
},
|
|
37
53
|
"./angular": {
|
|
38
54
|
"types": "./build-ngc/angular/index.d.ts",
|
|
@@ -57,17 +73,19 @@
|
|
|
57
73
|
"expo-modules-core": "57.0.5"
|
|
58
74
|
},
|
|
59
75
|
"peerDependencies": {
|
|
60
|
-
"@symbiote-native/angular": ">=0.6.2",
|
|
61
|
-
"@symbiote-native/engine": ">=0.1.7",
|
|
62
|
-
"@symbiote-native/react": ">=0.2.8",
|
|
63
|
-
"@symbiote-native/svelte": ">=0.1.0",
|
|
64
|
-
"@symbiote-native/vue": ">=0.3.8",
|
|
65
76
|
"@angular/core": ">=20",
|
|
66
77
|
"@vue/runtime-core": "^3.5.13",
|
|
67
78
|
"react": ">=19.0.0",
|
|
68
79
|
"react-native": ">=0.86",
|
|
80
|
+
"solid-js": ">=1.9.0",
|
|
69
81
|
"svelte": ">=5.56.0",
|
|
70
|
-
"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"
|
|
71
89
|
},
|
|
72
90
|
"peerDependenciesMeta": {
|
|
73
91
|
"@symbiote-native/angular": {
|
|
@@ -76,6 +94,9 @@
|
|
|
76
94
|
"@symbiote-native/react": {
|
|
77
95
|
"optional": true
|
|
78
96
|
},
|
|
97
|
+
"@symbiote-native/solid": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
79
100
|
"@symbiote-native/svelte": {
|
|
80
101
|
"optional": true
|
|
81
102
|
},
|
|
@@ -91,6 +112,9 @@
|
|
|
91
112
|
"react": {
|
|
92
113
|
"optional": true
|
|
93
114
|
},
|
|
115
|
+
"solid-js": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
94
118
|
"svelte": {
|
|
95
119
|
"optional": true
|
|
96
120
|
},
|
|
@@ -106,14 +130,16 @@
|
|
|
106
130
|
"@types/react": "^19.2.0",
|
|
107
131
|
"@vue/runtime-core": "^3.5.13",
|
|
108
132
|
"react": "19.2.3",
|
|
133
|
+
"solid-js": "^1.9.14",
|
|
109
134
|
"svelte": "^5.56.0",
|
|
110
135
|
"typescript": "~6.0.0",
|
|
111
|
-
"@symbiote-native/angular": "0.
|
|
112
|
-
"@symbiote-native/engine": "0.
|
|
113
|
-
"@symbiote-native/react": "0.
|
|
114
|
-
"@symbiote-native/
|
|
115
|
-
"@symbiote-native/
|
|
116
|
-
"@symbiote-native/
|
|
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"
|
|
117
143
|
},
|
|
118
144
|
"scripts": {
|
|
119
145
|
"typecheck": "tsc --build",
|
package/src/core/haptics.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Platform, UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
|
|
3
3
|
import { expoHaptics } from './native-module';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
AndroidHaptics,
|
|
6
|
+
ImpactFeedbackStyle,
|
|
7
|
+
NotificationFeedbackType,
|
|
8
|
+
} from './types';
|
|
5
9
|
|
|
6
10
|
const NATIVE_MODULE_NAME = 'expo-haptics';
|
|
7
11
|
|
|
@@ -49,7 +53,9 @@ export async function selectionAsync(): Promise<void> {
|
|
|
49
53
|
* every platform except Android.
|
|
50
54
|
* @platform android
|
|
51
55
|
*/
|
|
52
|
-
export async function performAndroidHapticsAsync(
|
|
56
|
+
export async function performAndroidHapticsAsync(
|
|
57
|
+
type: AndroidHaptics,
|
|
58
|
+
): Promise<void> {
|
|
53
59
|
if (Platform.OS !== 'android') {
|
|
54
60
|
return;
|
|
55
61
|
}
|
package/src/core/index.ts
CHANGED
|
@@ -4,4 +4,8 @@ export {
|
|
|
4
4
|
selectionAsync,
|
|
5
5
|
performAndroidHapticsAsync,
|
|
6
6
|
} from './haptics';
|
|
7
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
NotificationFeedbackType,
|
|
9
|
+
ImpactFeedbackStyle,
|
|
10
|
+
AndroidHaptics,
|
|
11
|
+
} from './types';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
AndroidHaptics,
|
|
4
|
+
ImpactFeedbackStyle,
|
|
5
|
+
NotificationFeedbackType,
|
|
6
|
+
} from './types';
|
|
3
7
|
|
|
4
8
|
const EXPO_HAPTICS_MODULE_NAME = 'ExpoHaptics';
|
|
5
9
|
|
|
@@ -17,4 +21,6 @@ export type INativeHapticsModule = {
|
|
|
17
21
|
performHapticsAsync?(type: AndroidHaptics): Promise<void>;
|
|
18
22
|
};
|
|
19
23
|
|
|
20
|
-
export const expoHaptics = requireNativeModule<INativeHapticsModule>(
|
|
24
|
+
export const expoHaptics = requireNativeModule<INativeHapticsModule>(
|
|
25
|
+
EXPO_HAPTICS_MODULE_NAME,
|
|
26
|
+
);
|
package/build/react/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/react/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/haptics/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and three enums, no per-instance state and no event
|
|
3
|
-
// stream (same shape as @symbiote-native/local-auth) — there is nothing for a hook to wrap, so
|
|
4
|
-
// this is a plain re-export.
|
|
5
|
-
export * from '../core/index.js';
|
package/build/svelte/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/svelte/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/haptics/svelte: the Svelte entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and three enums, no per-instance state and no event
|
|
3
|
-
// stream (same shape as @symbiote-native/local-auth) — there is nothing for a rune to wrap, so
|
|
4
|
-
// this is a plain re-export. Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes —
|
|
5
|
-
// never React's `hooks` or Vue's `composables`), and this package has none to fill.
|
|
6
|
-
export * from '../core/index.js';
|
package/build/vue/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/vue/index.js
DELETED
package/src/react/index.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/haptics/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and three enums, no per-instance state and no event
|
|
3
|
-
// stream (same shape as @symbiote-native/local-auth) — there is nothing for a hook to wrap, so
|
|
4
|
-
// this is a plain re-export.
|
|
5
|
-
export * from '../core';
|
package/src/svelte/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/haptics/svelte: the Svelte entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and three enums, no per-instance state and no event
|
|
3
|
-
// stream (same shape as @symbiote-native/local-auth) — there is nothing for a rune to wrap, so
|
|
4
|
-
// this is a plain re-export. Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes —
|
|
5
|
-
// never React's `hooks` or Vue's `composables`), and this package has none to fill.
|
|
6
|
-
export * from '../core';
|
package/src/vue/index.ts
DELETED