@symbiote-native/sharing 0.2.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 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 | 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 |
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 | `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 |
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
- All three adapter entries are plain re-exports of `core/`. Both exports are stateless free
77
- functions — no per-instance state, no event stream — so there is nothing for a hook, composable,
78
- or service to wrap, the same reason [`@symbiote-native/secure-store`](../secure-store) re-exports
79
- rather than wraps. (The incoming-share half above is exactly the part that *would* have needed
80
- one; it is the reason this package has no `hooks/`, `composables/`, or `services/` folder.)
81
- Import from `@symbiote-native/sharing` directly if you don't care which adapter you're on; the
82
- per-adapter subpaths exist so every wrapper package has the same import surface.
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 | 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. |
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,CAAuB,wBAAwB,CAAC,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;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,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,KA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UAAU,UAAU,CAC9B,GAAW,EACX,UAA2B,EAAE;IAE7B,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;QAC5B,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,WAAW,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,8FAA8F;AAC9F,iGAAiG;AACjG,2FAA2F;AAC3F,+BAA+B;AAC/B,SAAS,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.2.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,16 +23,20 @@
23
23
  "default": "./build/core/index.js"
24
24
  },
25
25
  "./vue": {
26
- "types": "./build/vue/index.d.ts",
27
- "default": "./build/vue/index.js"
26
+ "types": "./build/core/index.d.ts",
27
+ "default": "./build/core/index.js"
28
28
  },
29
29
  "./react": {
30
- "types": "./build/react/index.d.ts",
31
- "default": "./build/react/index.js"
30
+ "types": "./build/core/index.d.ts",
31
+ "default": "./build/core/index.js"
32
32
  },
33
33
  "./svelte": {
34
- "types": "./build/svelte/index.d.ts",
35
- "default": "./build/svelte/index.js"
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"
36
40
  },
37
41
  "./angular": {
38
42
  "types": "./build-ngc/angular/index.d.ts",
@@ -60,12 +64,14 @@
60
64
  "@symbiote-native/angular": ">=0.6.2",
61
65
  "@symbiote-native/engine": ">=0.1.7",
62
66
  "@symbiote-native/react": ">=0.2.8",
67
+ "@symbiote-native/solid": ">=0.0.1",
63
68
  "@symbiote-native/svelte": ">=0.1.0",
64
69
  "@symbiote-native/vue": ">=0.3.8",
65
70
  "@angular/core": ">=20",
66
71
  "@vue/runtime-core": "^3.5.13",
67
72
  "react": ">=19.0.0",
68
73
  "react-native": ">=0.86",
74
+ "solid-js": ">=1.9.0",
69
75
  "svelte": ">=5.56.0",
70
76
  "vue": ">=3.5.0"
71
77
  },
@@ -76,6 +82,9 @@
76
82
  "@symbiote-native/react": {
77
83
  "optional": true
78
84
  },
85
+ "@symbiote-native/solid": {
86
+ "optional": true
87
+ },
79
88
  "@symbiote-native/svelte": {
80
89
  "optional": true
81
90
  },
@@ -91,6 +100,9 @@
91
100
  "react": {
92
101
  "optional": true
93
102
  },
103
+ "solid-js": {
104
+ "optional": true
105
+ },
94
106
  "svelte": {
95
107
  "optional": true
96
108
  },
@@ -106,14 +118,16 @@
106
118
  "@types/react": "^19.2.0",
107
119
  "@vue/runtime-core": "^3.5.13",
108
120
  "react": "19.2.3",
121
+ "solid-js": "^1.9.14",
109
122
  "svelte": "^5.56.0",
110
123
  "typescript": "~6.0.0",
111
- "@symbiote-native/angular": "0.7.0",
112
- "@symbiote-native/engine": "0.2.0",
113
- "@symbiote-native/react": "0.3.0",
114
- "@symbiote-native/svelte": "0.2.0",
115
- "@symbiote-native/test-utils": "0.1.6",
116
- "@symbiote-native/vue": "0.4.0"
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"
117
131
  },
118
132
  "scripts": {
119
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>(EXPO_SHARING_MODULE_NAME);
22
+ export const expoSharing = requireNativeModule<INativeSharingModule>(
23
+ EXPO_SHARING_MODULE_NAME,
24
+ );
@@ -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(url: string, options: ISharingOptions = {}): Promise<void> {
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('Invalid url provided to Sharing. Pass a non-empty local file URI or path.');
47
+ throw new Error(
48
+ 'Invalid url provided to Sharing. Pass a non-empty local file URI or path.',
49
+ );
45
50
  }
46
51
  }
@@ -1 +0,0 @@
1
- export * from '../core';
@@ -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';
@@ -1 +0,0 @@
1
- export * from '../core';
@@ -1,7 +0,0 @@
1
- // @symbiote-native/sharing/svelte: the Svelte entry over the framework-agnostic core.
2
- // Both exports are stateless free functions — no per-instance state, no event stream, nothing a
3
- // rune could own or clean up — so this is a plain re-export. The one part of expo-sharing that
4
- // WOULD need lifecycle (incoming share) is out of scope here; see the README. Svelte's lifecycle
5
- // bucket is `runes/` (adapters/svelte/src/runes — never React's `hooks` or Vue's
6
- // `composables`), and this package has none to fill.
7
- export * from '../core/index.js';
@@ -1 +0,0 @@
1
- export * from '../core';
@@ -1,4 +0,0 @@
1
- // @symbiote-native/sharing/vue: the Vue entry over the framework-agnostic core. Same reasoning
2
- // as the React entry — no per-instance state or event stream to wire onto Vue's reactivity, so
3
- // this is a plain re-export.
4
- export * from '../core/index.js';
@@ -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';
@@ -1,7 +0,0 @@
1
- // @symbiote-native/sharing/svelte: the Svelte entry over the framework-agnostic core.
2
- // Both exports are stateless free functions — no per-instance state, no event stream, nothing a
3
- // rune could own or clean up — so this is a plain re-export. The one part of expo-sharing that
4
- // WOULD need lifecycle (incoming share) is out of scope here; see the README. Svelte's lifecycle
5
- // bucket is `runes/` (adapters/svelte/src/runes — never React's `hooks` or Vue's
6
- // `composables`), and this package has none to fill.
7
- export * from '../core';
package/src/vue/index.ts DELETED
@@ -1,4 +0,0 @@
1
- // @symbiote-native/sharing/vue: the Vue entry over the framework-agnostic core. Same reasoning
2
- // as the React entry — no per-instance state or event stream to wire onto Vue's reactivity, so
3
- // this is a plain re-export.
4
- export * from '../core';