expo-sharing 11.9.0 → 12.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/CHANGELOG.md +13 -0
- package/android/build.gradle +7 -93
- package/build/ExpoSharing.web.d.ts +0 -1
- package/build/ExpoSharing.web.d.ts.map +1 -1
- package/build/ExpoSharing.web.js +0 -3
- package/build/ExpoSharing.web.js.map +1 -1
- package/build/Sharing.js.map +1 -1
- package/ios/SharingModule.swift +2 -7
- package/package.json +2 -2
- package/src/ExpoSharing.web.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 12.0.0 — 2024-04-18
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- drop unused web `name` property. ([#27437](https://github.com/expo/expo/pull/27437) by [@EvanBacon](https://github.com/EvanBacon))
|
|
18
|
+
- Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
|
|
19
|
+
|
|
20
|
+
## 11.10.0 — 2023-12-12
|
|
21
|
+
|
|
22
|
+
### 💡 Others
|
|
23
|
+
|
|
24
|
+
- [iOS] Replace legacy `FileSystem` interfaces usage with core `FileSystemUtilities`. ([#25495](https://github.com/expo/expo/pull/25495) by [@alanhughes](https://github.com/alanjhughes))
|
|
25
|
+
|
|
13
26
|
## 11.9.0 — 2023-11-14
|
|
14
27
|
|
|
15
28
|
### 🛠 Breaking changes
|
package/android/build.gradle
CHANGED
|
@@ -1,109 +1,23 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
|
-
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven-publish'
|
|
4
2
|
|
|
5
3
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '
|
|
4
|
+
version = '12.0.0'
|
|
7
5
|
|
|
8
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
useExpoPublishing()
|
|
15
|
-
useCoreDependencies()
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
buildscript {
|
|
20
|
-
// Simple helper that allows the root project to override versions declared by this library.
|
|
21
|
-
ext.safeExtGet = { prop, fallback ->
|
|
22
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Ensures backward compatibility
|
|
26
|
-
ext.getKotlinVersion = {
|
|
27
|
-
if (ext.has("kotlinVersion")) {
|
|
28
|
-
ext.kotlinVersion()
|
|
29
|
-
} else {
|
|
30
|
-
ext.safeExtGet("kotlinVersion", "1.8.10")
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
repositories {
|
|
35
|
-
mavenCentral()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
dependencies {
|
|
39
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
44
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
45
|
-
afterEvaluate {
|
|
46
|
-
publishing {
|
|
47
|
-
publications {
|
|
48
|
-
release(MavenPublication) {
|
|
49
|
-
from components.release
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
repositories {
|
|
53
|
-
maven {
|
|
54
|
-
url = mavenLocal().url
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
7
|
+
apply from: expoModulesCorePlugin
|
|
8
|
+
applyKotlinExpoModulesCorePlugin()
|
|
9
|
+
useCoreDependencies()
|
|
10
|
+
useDefaultAndroidSdkVersions()
|
|
11
|
+
useExpoPublishing()
|
|
60
12
|
|
|
61
13
|
android {
|
|
62
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
63
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
64
|
-
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
65
|
-
|
|
66
|
-
defaultConfig {
|
|
67
|
-
minSdkVersion safeExtGet("minSdkVersion", 23)
|
|
68
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
publishing {
|
|
72
|
-
singleVariant("release") {
|
|
73
|
-
withSourcesJar()
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
lintOptions {
|
|
78
|
-
abortOnError false
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
83
|
-
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
|
|
84
|
-
compileOptions {
|
|
85
|
-
sourceCompatibility JavaVersion.VERSION_11
|
|
86
|
-
targetCompatibility JavaVersion.VERSION_11
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
kotlinOptions {
|
|
90
|
-
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
14
|
namespace "expo.modules.sharing"
|
|
95
15
|
defaultConfig {
|
|
96
16
|
versionCode 16
|
|
97
|
-
versionName '
|
|
17
|
+
versionName '12.0.0'
|
|
98
18
|
}
|
|
99
19
|
}
|
|
100
20
|
|
|
101
21
|
dependencies {
|
|
102
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
103
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
104
|
-
implementation project(':expo-modules-core')
|
|
105
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
106
|
-
}
|
|
107
|
-
|
|
108
22
|
api "androidx.legacy:legacy-support-v4:1.0.0"
|
|
109
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSharing.web.d.ts","sourceRoot":"","sources":["../src/ExpoSharing.web.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC
|
|
1
|
+
{"version":3,"file":"ExpoSharing.web.d.ts","sourceRoot":"","sources":["../src/ExpoSharing.web.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;;wBAGxC,OAAO,CAAC,OAAO,CAAC;oBAOpB,MAAM,YAAW,YAAY,GAAQ,OAAO,CAAC,IAAI,CAAC;;AAR1E,wBAgBE"}
|
package/build/ExpoSharing.web.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSharing.web.js","sourceRoot":"","sources":["../src/ExpoSharing.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,eAAe;IACb,
|
|
1
|
+
{"version":3,"file":"ExpoSharing.web.js","sourceRoot":"","sources":["../src/ExpoSharing.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,eAAe;IACb,KAAK,CAAC,gBAAgB;QACpB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;YACrC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,UAAU,CAAC,GAAW,EAAE,UAAwB,EAAE;QACtD,sDAAsD;QACtD,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YACpB,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\ntype ShareOptions = { title?: string; text?: string; url?: string };\n\nexport default {\n async isAvailableAsync(): Promise<boolean> {\n if (typeof navigator === 'undefined') {\n return false;\n }\n\n return !!navigator.share;\n },\n async shareAsync(url: string, options: ShareOptions = {}): Promise<void> {\n // NOTE: `navigator.share` is only available via HTTPS\n if (navigator.share) {\n await navigator.share({ ...options, url });\n } else {\n throw new UnavailabilityError('navigator', 'share');\n }\n },\n};\n"]}
|
package/build/Sharing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sharing.js","sourceRoot":"","sources":["../src/Sharing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,OAAO,MAAM,eAAe,CAAC;AAuBpC,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"Sharing.js","sourceRoot":"","sources":["../src/Sharing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,OAAO,MAAM,eAAe,CAAC;AAuBpC,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC7B,OAAO,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC1C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,UAA0B,EAAE;IACxE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACpC,MAAM,IAAI,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport Sharing from './ExpoSharing';\n\n// @needsAudit\nexport type SharingOptions = {\n /**\n * Sets `mimeType` for `Intent`.\n * @platform android\n */\n mimeType?: string;\n /**\n * [Uniform Type Identifier](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html)\n * - the type of the target file.\n * @platform ios\n */\n UTI?: string;\n /**\n * Sets share dialog title.\n * @platform android\n * @platform web\n */\n dialogTitle?: string;\n};\n\n// @needsAudit\n/**\n * Determine if the sharing API can be used in this app.\n * @return A promise that fulfills with `true` if the sharing API can be used, and `false` otherwise.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n if (Sharing) {\n if (Sharing.isAvailableAsync) {\n return await Sharing.isAvailableAsync();\n }\n return true;\n }\n\n return false;\n}\n\n// @needsAudit\n/**\n * Opens action sheet to share file to different applications which can handle this type of file.\n * @param url Local file URL to share.\n * @param options A map of share options.\n */\nexport async function shareAsync(url: string, options: SharingOptions = {}): Promise<void> {\n if (!Sharing || !Sharing.shareAsync) {\n throw new UnavailabilityError('Sharing', 'shareAsync');\n }\n return await Sharing.shareAsync(url, options);\n}\n"]}
|
package/ios/SharingModule.swift
CHANGED
|
@@ -6,14 +6,9 @@ public final class SharingModule: Module {
|
|
|
6
6
|
Name("ExpoSharing")
|
|
7
7
|
|
|
8
8
|
AsyncFunction("shareAsync") { (url: URL, options: SharingOptions, promise: Promise) in
|
|
9
|
-
|
|
10
|
-
appContext?.legacyModule(implementing: EXFilePermissionModuleInterface.self)
|
|
11
|
-
else {
|
|
12
|
-
throw FilePermissionModuleException()
|
|
13
|
-
}
|
|
9
|
+
let grantedPermissions = FileSystemUtilities.permissions(appContext, for: url)
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
guard grantedPermissions.rawValue >= EXFileSystemPermissionFlags.read.rawValue else {
|
|
11
|
+
guard grantedPermissions.contains(.read) else {
|
|
17
12
|
throw FilePermissionException()
|
|
18
13
|
}
|
|
19
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-sharing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "ExpoSharing standalone module",
|
|
5
5
|
"main": "build/Sharing.js",
|
|
6
6
|
"types": "build/Sharing.d.ts",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"expo": "*"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "4165b8d72e1b9a1889c2767534cc619e21468110"
|
|
41
41
|
}
|
package/src/ExpoSharing.web.ts
CHANGED
|
@@ -3,9 +3,6 @@ import { UnavailabilityError } from 'expo-modules-core';
|
|
|
3
3
|
type ShareOptions = { title?: string; text?: string; url?: string };
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
get name(): string {
|
|
7
|
-
return 'ExpoSharing';
|
|
8
|
-
},
|
|
9
6
|
async isAvailableAsync(): Promise<boolean> {
|
|
10
7
|
if (typeof navigator === 'undefined') {
|
|
11
8
|
return false;
|