@symbiote-native/sharing 0.1.0 → 0.3.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 +23 -23
- package/build-ngc/core/native-module.js.map +1 -1
- package/build-ngc/core/sharing.js.map +1 -1
- package/package.json +46 -18
- package/src/core/native-module.ts +3 -1
- package/src/core/sharing.ts +7 -2
- package/build/react/index.d.ts +0 -1
- package/build/react/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 -6
- package/src/vue/index.ts +0 -4
package/README.md
CHANGED
|
@@ -13,10 +13,10 @@ autolinking picks up the native module).
|
|
|
13
13
|
|
|
14
14
|
`expo-sharing` has two halves. This package ships one of them.
|
|
15
15
|
|
|
16
|
-
| Half
|
|
17
|
-
|
|
18
|
-
| **Outgoing** — hand a local file to another app
|
|
19
|
-
| **Incoming** — receive files other apps share
|
|
16
|
+
| Half | Upstream API | Here |
|
|
17
|
+
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ----------------- |
|
|
18
|
+
| **Outgoing** — hand a local file to another app | `shareAsync`, `isAvailableAsync` | ✅ ported in full |
|
|
19
|
+
| **Incoming** — receive files other apps share _into_ your app | `useIncomingShare`, `getSharedPayloads`, `getResolvedSharedPayloadsAsync`, `clearSharedPayloads` | ❌ not ported |
|
|
20
20
|
|
|
21
21
|
The incoming half is not a thinner JS surface — it needs a whole **iOS Share Extension target**.
|
|
22
22
|
Upstream's config plugin (`plugin/src/ios/*`) generates one: a second Xcode target with its own
|
|
@@ -46,12 +46,12 @@ Unlike a plain RN native module, `expo-sharing`'s native code is discovered by
|
|
|
46
46
|
`expo-modules-autolinking` — this needs wiring into the native host app **once**, covering this
|
|
47
47
|
package and every other `expo-modules-core` package with zero further changes:
|
|
48
48
|
|
|
49
|
-
| Platform | Touches
|
|
50
|
-
|
|
51
|
-
| iOS
|
|
52
|
-
| iOS
|
|
53
|
-
| Android
|
|
54
|
-
| Android
|
|
49
|
+
| Platform | Touches |
|
|
50
|
+
| -------- | ------------------------------------------------------------------------------------- |
|
|
51
|
+
| iOS | `ios/Podfile` — add `use_expo_modules!` |
|
|
52
|
+
| iOS | `AppDelegate.swift` — Expo's runtime-bootstrap hook |
|
|
53
|
+
| Android | `settings.gradle` / `app/build.gradle` — resolve and include the Expo Gradle projects |
|
|
54
|
+
| Android | `MainApplication.kt` — Expo's bootstrap hook, plus a native-module name map |
|
|
55
55
|
|
|
56
56
|
Full mechanics live in the `symbiote-expo-native-module` skill. The per-package half of that
|
|
57
57
|
table — the Gradle dependency and the module map entry — is generated by
|
|
@@ -68,18 +68,18 @@ automatically once the Gradle project is included — nothing to declare by hand
|
|
|
68
68
|
```
|
|
69
69
|
src/core/ the whole API: isAvailableAsync + shareAsync. native-module.ts
|
|
70
70
|
resolves ExpoSharing through expo-modules-core's requireNativeModule.
|
|
71
|
-
src/react/ @symbiote-native/sharing/react
|
|
72
|
-
src/vue/ @symbiote-native/sharing/vue
|
|
73
71
|
src/angular/ @symbiote-native/sharing/angular
|
|
74
72
|
```
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
or service to wrap, the same
|
|
79
|
-
|
|
80
|
-
one; it is the reason this package has no
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
`./react`, `./vue`, and `./svelte` are `exports`-map aliases straight onto `src/core/` — no
|
|
75
|
+
physical per-framework file. Both exports are stateless free functions — no per-instance state,
|
|
76
|
+
no event stream — so there is nothing for a hook, composable, or service to wrap, the same
|
|
77
|
+
reason [`@symbiote-native/secure-store`](../secure-store) does the same. (The incoming-share half
|
|
78
|
+
above is exactly the part that _would_ have needed one; it is the reason this package has no
|
|
79
|
+
`hooks/`, `composables/`, or `services/` folder.) `./angular` stays a physical file/subpath since
|
|
80
|
+
Angular ships through a separate `ngc`/AOT build (`build-ngc/`). Import from
|
|
81
|
+
`@symbiote-native/sharing` directly if you don't care which adapter you're on; the per-adapter
|
|
82
|
+
subpaths exist so every wrapper package has the same import surface.
|
|
83
83
|
|
|
84
84
|
## Use it
|
|
85
85
|
|
|
@@ -104,10 +104,10 @@ await shareAsync(localFileUri, {
|
|
|
104
104
|
|
|
105
105
|
## API
|
|
106
106
|
|
|
107
|
-
| Export
|
|
108
|
-
|
|
109
|
-
| `isAvailableAsync` | `() => Promise<boolean>`
|
|
110
|
-
| `shareAsync`
|
|
107
|
+
| Export | Signature | Notes |
|
|
108
|
+
| ------------------ | ---------------------------------- | -------------------------------------------------------------------------------------- |
|
|
109
|
+
| `isAvailableAsync` | `() => Promise<boolean>` | `true` on Android and iOS. Reports on the native module, not on any device capability. |
|
|
110
|
+
| `shareAsync` | `(url, options?) => Promise<void>` | Opens the share sheet for a local file. Resolves when the sheet is dismissed. |
|
|
111
111
|
|
|
112
112
|
`ISharingOptions`: `mimeType` (Android), `UTI` (iOS), `dialogTitle`, `anchor` (iOS iPad).
|
|
113
113
|
`ISharingAnchor`: `x`, `y`, `width`, `height`, all optional, all in points.
|
|
@@ -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;AAGxD,MAAM,wBAAwB,GAAG,aAAa,CAAC;AAkB/C,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,wBAAwB,GAAG,aAAa,CAAC;AAkB/C,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAC5C,wBAAwB,CACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharing.js","sourceRoot":"","sources":["../../src/core/sharing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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S,kBAAkB,CAAC,GAAW;IACrC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/sharing",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "expo-sharing wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters. Opens the platform share sheet for a local file.",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "expo-sharing wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Opens the platform share sheet for a local file.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,12 +23,20 @@
|
|
|
23
23
|
"default": "./build/core/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./vue": {
|
|
26
|
-
"types": "./build/
|
|
27
|
-
"default": "./build/
|
|
26
|
+
"types": "./build/core/index.d.ts",
|
|
27
|
+
"default": "./build/core/index.js"
|
|
28
28
|
},
|
|
29
29
|
"./react": {
|
|
30
|
-
"types": "./build/
|
|
31
|
-
"default": "./build/
|
|
30
|
+
"types": "./build/core/index.d.ts",
|
|
31
|
+
"default": "./build/core/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./svelte": {
|
|
34
|
+
"types": "./build/core/index.d.ts",
|
|
35
|
+
"default": "./build/core/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./solid": {
|
|
38
|
+
"types": "./build/core/index.d.ts",
|
|
39
|
+
"default": "./build/core/index.js"
|
|
32
40
|
},
|
|
33
41
|
"./angular": {
|
|
34
42
|
"types": "./build-ngc/angular/index.d.ts",
|
|
@@ -53,15 +61,19 @@
|
|
|
53
61
|
"expo-modules-core": "57.0.5"
|
|
54
62
|
},
|
|
55
63
|
"peerDependencies": {
|
|
64
|
+
"@symbiote-native/angular": ">=0.6.2",
|
|
56
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",
|
|
57
70
|
"@angular/core": ">=20",
|
|
58
71
|
"@vue/runtime-core": "^3.5.13",
|
|
59
72
|
"react": ">=19.0.0",
|
|
60
73
|
"react-native": ">=0.86",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"@symbiote-native/vue": "0.3.8"
|
|
74
|
+
"solid-js": ">=1.9.0",
|
|
75
|
+
"svelte": ">=5.56.0",
|
|
76
|
+
"vue": ">=3.5.0"
|
|
65
77
|
},
|
|
66
78
|
"peerDependenciesMeta": {
|
|
67
79
|
"@symbiote-native/angular": {
|
|
@@ -70,6 +82,12 @@
|
|
|
70
82
|
"@symbiote-native/react": {
|
|
71
83
|
"optional": true
|
|
72
84
|
},
|
|
85
|
+
"@symbiote-native/solid": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"@symbiote-native/svelte": {
|
|
89
|
+
"optional": true
|
|
90
|
+
},
|
|
73
91
|
"@symbiote-native/vue": {
|
|
74
92
|
"optional": true
|
|
75
93
|
},
|
|
@@ -82,24 +100,34 @@
|
|
|
82
100
|
"react": {
|
|
83
101
|
"optional": true
|
|
84
102
|
},
|
|
103
|
+
"solid-js": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"svelte": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
85
109
|
"vue": {
|
|
86
110
|
"optional": true
|
|
87
111
|
}
|
|
88
112
|
},
|
|
89
113
|
"devDependencies": {
|
|
90
|
-
"@angular/compiler": "
|
|
91
|
-
"@angular/compiler-cli": "
|
|
92
|
-
"@angular/core": "
|
|
114
|
+
"@angular/compiler": "~22.0.8",
|
|
115
|
+
"@angular/compiler-cli": "~22.0.8",
|
|
116
|
+
"@angular/core": "~22.0.8",
|
|
93
117
|
"@types/node": "^26.0.0",
|
|
94
118
|
"@types/react": "^19.2.0",
|
|
95
119
|
"@vue/runtime-core": "^3.5.13",
|
|
96
120
|
"react": "19.2.3",
|
|
121
|
+
"solid-js": "^1.9.14",
|
|
122
|
+
"svelte": "^5.56.0",
|
|
97
123
|
"typescript": "~6.0.0",
|
|
98
|
-
"@symbiote-native/angular": "0.
|
|
99
|
-
"@symbiote-native/engine": "0.
|
|
100
|
-
"@symbiote-native/react": "0.
|
|
101
|
-
"@symbiote-native/
|
|
102
|
-
"@symbiote-native/
|
|
124
|
+
"@symbiote-native/angular": "0.8.0",
|
|
125
|
+
"@symbiote-native/engine": "0.3.0",
|
|
126
|
+
"@symbiote-native/react": "0.4.0",
|
|
127
|
+
"@symbiote-native/solid": "0.1.0",
|
|
128
|
+
"@symbiote-native/svelte": "0.3.0",
|
|
129
|
+
"@symbiote-native/test-utils": "0.2.0",
|
|
130
|
+
"@symbiote-native/vue": "0.5.0"
|
|
103
131
|
},
|
|
104
132
|
"scripts": {
|
|
105
133
|
"typecheck": "tsc --build",
|
|
@@ -19,4 +19,6 @@ export type INativeSharingModule = {
|
|
|
19
19
|
shareAsync?(url: string, options: ISharingOptions): Promise<void>;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export const expoSharing = requireNativeModule<INativeSharingModule>(
|
|
22
|
+
export const expoSharing = requireNativeModule<INativeSharingModule>(
|
|
23
|
+
EXPO_SHARING_MODULE_NAME,
|
|
24
|
+
);
|
package/src/core/sharing.ts
CHANGED
|
@@ -27,7 +27,10 @@ export async function isAvailableAsync(): Promise<boolean> {
|
|
|
27
27
|
* instead. Resolves once the sheet is dismissed, whether or not the user picked anything: no
|
|
28
28
|
* platform reports which app received the file, so a resolved promise is not a delivery receipt.
|
|
29
29
|
*/
|
|
30
|
-
export async function shareAsync(
|
|
30
|
+
export async function shareAsync(
|
|
31
|
+
url: string,
|
|
32
|
+
options: ISharingOptions = {},
|
|
33
|
+
): Promise<void> {
|
|
31
34
|
ensureShareableUrl(url);
|
|
32
35
|
if (!expoSharing.shareAsync) {
|
|
33
36
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'shareAsync');
|
|
@@ -41,6 +44,8 @@ export async function shareAsync(url: string, options: ISharingOptions = {}): Pr
|
|
|
41
44
|
// caller's own argument named.
|
|
42
45
|
function ensureShareableUrl(url: string): void {
|
|
43
46
|
if (typeof url !== 'string' || url.length === 0) {
|
|
44
|
-
throw new Error(
|
|
47
|
+
throw new Error(
|
|
48
|
+
'Invalid url provided to Sharing. Pass a non-empty local file URI or path.',
|
|
49
|
+
);
|
|
45
50
|
}
|
|
46
51
|
}
|
package/build/react/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/react/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/sharing/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Both exports are stateless free functions — no per-instance state, no event stream, nothing a
|
|
3
|
-
// hook could own or clean up — so this is a plain re-export, the same shape
|
|
4
|
-
// packages/secure-store's React entry has for the same reason. The one part of expo-sharing that
|
|
5
|
-
// WOULD need a hook (incoming share) is out of scope here; see the README.
|
|
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,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/sharing/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Both exports are stateless free functions — no per-instance state, no event stream, nothing a
|
|
3
|
-
// hook could own or clean up — so this is a plain re-export, the same shape
|
|
4
|
-
// packages/secure-store's React entry has for the same reason. The one part of expo-sharing that
|
|
5
|
-
// WOULD need a hook (incoming share) is out of scope here; see the README.
|
|
6
|
-
export * from '../core';
|
package/src/vue/index.ts
DELETED