expo-clipboard 5.0.0 → 5.0.1
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 +4 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/clipboard/ClipboardExceptions.kt +1 -1
- package/android/src/main/java/expo/modules/clipboard/ClipboardFileProvider.kt +6 -3
- package/android/src/main/java/expo/modules/clipboard/ClipboardImage.kt +2 -2
- package/android/src/main/java/expo/modules/clipboard/ClipboardOptions.kt +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '5.0.
|
|
6
|
+
version = '5.0.1'
|
|
7
7
|
|
|
8
8
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
9
|
if (expoModulesCorePlugin.exists()) {
|
|
@@ -94,7 +94,7 @@ android {
|
|
|
94
94
|
namespace "expo.modules.clipboard"
|
|
95
95
|
defaultConfig {
|
|
96
96
|
versionCode 3
|
|
97
|
-
versionName '5.0.
|
|
97
|
+
versionName '5.0.1'
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -17,7 +17,7 @@ internal class CopyFailureException(cause: Throwable?, kind: String = "item") :
|
|
|
17
17
|
internal class InvalidImageException(image: String, cause: Throwable?) :
|
|
18
18
|
CodedException(
|
|
19
19
|
"Invalid base64 image: ${
|
|
20
|
-
|
|
20
|
+
image.run { substring(0, minOf(length, 32)) + if (length > 32) "..." else ""}
|
|
21
21
|
}",
|
|
22
22
|
cause
|
|
23
23
|
)
|
|
@@ -93,6 +93,7 @@ class ClipboardFileProvider : ContentProvider() {
|
|
|
93
93
|
columns[i] = OpenableColumns.DISPLAY_NAME
|
|
94
94
|
values[i++] = file.name
|
|
95
95
|
}
|
|
96
|
+
|
|
96
97
|
OpenableColumns.SIZE -> {
|
|
97
98
|
columns[i] = OpenableColumns.SIZE
|
|
98
99
|
values[i++] = file.length()
|
|
@@ -223,10 +224,12 @@ class ClipboardFileProvider : ContentProvider() {
|
|
|
223
224
|
val externalFilesDirs: Array<File> = context.getExternalFilesDirs(null)
|
|
224
225
|
externalFilesDirs.takeIf { it.isNotEmpty() }?.let { it[0] }
|
|
225
226
|
}
|
|
227
|
+
|
|
226
228
|
TAG_EXTERNAL_CACHE -> {
|
|
227
229
|
val externalCacheDirs: Array<File> = context.externalCacheDirs
|
|
228
230
|
externalCacheDirs.takeIf { it.isNotEmpty() }?.let { it[0] }
|
|
229
231
|
}
|
|
232
|
+
|
|
230
233
|
else -> null
|
|
231
234
|
}
|
|
232
235
|
|
|
@@ -309,9 +312,9 @@ class ClipboardFileProvider : ContentProvider() {
|
|
|
309
312
|
for (root in roots.entries) {
|
|
310
313
|
val rootPath = root.value.path
|
|
311
314
|
if (path.startsWith(rootPath) && (
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
+
mostSpecific == null ||
|
|
316
|
+
rootPath.length > mostSpecific.value.path.length
|
|
317
|
+
)
|
|
315
318
|
) {
|
|
316
319
|
mostSpecific = root
|
|
317
320
|
}
|
|
@@ -32,7 +32,7 @@ data class ImageResult(
|
|
|
32
32
|
"size" to bundleOf(
|
|
33
33
|
"width" to width,
|
|
34
34
|
"height" to height
|
|
35
|
-
)
|
|
35
|
+
)
|
|
36
36
|
)
|
|
37
37
|
}
|
|
38
38
|
// endregion
|
|
@@ -93,7 +93,7 @@ internal suspend fun imageFromContentUri(
|
|
|
93
93
|
internal suspend fun clipDataFromBase64Image(
|
|
94
94
|
context: Context,
|
|
95
95
|
base64Image: String,
|
|
96
|
-
clipboardCacheDir: File
|
|
96
|
+
clipboardCacheDir: File
|
|
97
97
|
): ClipData {
|
|
98
98
|
// 1. Get bitmap from base64 string
|
|
99
99
|
val bitmap = bitmapFromBase64String(base64Image)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-clipboard",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "ExpoClipboard standalone module",
|
|
5
5
|
"main": "build/Clipboard.js",
|
|
6
6
|
"types": "build/Clipboard.d.ts",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"jest": {
|
|
40
40
|
"preset": "expo-module-scripts/universal"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "43f1b4f8a5a9bca649e4e7ca6e4155482a162431"
|
|
43
43
|
}
|