expo-clipboard 2.0.1 → 2.1.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 +12 -0
- package/android/build.gradle +16 -18
- package/expo-module.config.json +7 -0
- package/ios/EXClipboard/ClipboardModule.swift +42 -0
- package/ios/EXClipboard.podspec +8 -4
- package/package.json +6 -5
- package/unimodule.json +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 2.1.1 — 2022-02-01
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
## 2.1.0 — 2021-12-03
|
|
20
|
+
|
|
21
|
+
### 🎉 New features
|
|
22
|
+
|
|
23
|
+
- Native module on iOS is now written in Swift using [Sweet API](https://blog.expo.dev/a-peek-into-the-upcoming-sweet-expo-module-api-6de6b9aca492). ([#14959](https://github.com/expo/expo/pull/14959) by [@tsapeta](https://github.com/tsapeta))
|
|
24
|
+
|
|
13
25
|
## 2.0.1 — 2021-10-01
|
|
14
26
|
|
|
15
27
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven'
|
|
3
|
+
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '2.
|
|
6
|
+
version = '2.1.1'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
@@ -20,27 +20,25 @@ buildscript {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
// Upload android library to maven with javadoc and android sources
|
|
24
|
-
configurations {
|
|
25
|
-
deployerJars
|
|
26
|
-
}
|
|
27
|
-
|
|
28
23
|
// Creating sources with comments
|
|
29
24
|
task androidSourcesJar(type: Jar) {
|
|
30
25
|
classifier = 'sources'
|
|
31
26
|
from android.sourceSets.main.java.srcDirs
|
|
32
27
|
}
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
afterEvaluate {
|
|
30
|
+
publishing {
|
|
31
|
+
publications {
|
|
32
|
+
release(MavenPublication) {
|
|
33
|
+
from components.release
|
|
34
|
+
// Add additional sourcesJar to artifacts
|
|
35
|
+
artifact(androidSourcesJar)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
repositories {
|
|
39
|
+
maven {
|
|
40
|
+
url = mavenLocal().url
|
|
41
|
+
}
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
}
|
|
@@ -57,7 +55,7 @@ android {
|
|
|
57
55
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
58
56
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
59
57
|
versionCode 3
|
|
60
|
-
versionName '2.
|
|
58
|
+
versionName '2.1.1'
|
|
61
59
|
}
|
|
62
60
|
lintOptions {
|
|
63
61
|
abortOnError false
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright 2018-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
|
|
5
|
+
let onClipboardChanged = "onClipboardChanged"
|
|
6
|
+
|
|
7
|
+
public class ClipboardModule: Module {
|
|
8
|
+
public func definition() -> ModuleDefinition {
|
|
9
|
+
name("ExpoClipboard")
|
|
10
|
+
|
|
11
|
+
function("getStringAsync") { () -> String in
|
|
12
|
+
return UIPasteboard.general.string ?? ""
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function("setString") { (content: String?) in
|
|
16
|
+
UIPasteboard.general.string = content ?? ""
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
events(onClipboardChanged)
|
|
20
|
+
|
|
21
|
+
onStartObserving {
|
|
22
|
+
NotificationCenter.default.removeObserver(self, name: UIPasteboard.changedNotification, object: nil)
|
|
23
|
+
NotificationCenter.default.addObserver(
|
|
24
|
+
self,
|
|
25
|
+
selector: #selector(self.clipboardChangedListener),
|
|
26
|
+
name: UIPasteboard.changedNotification,
|
|
27
|
+
object: nil
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
onStopObserving {
|
|
32
|
+
NotificationCenter.default.removeObserver(self, name: UIPasteboard.changedNotification, object: nil)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@objc
|
|
37
|
+
func clipboardChangedListener() {
|
|
38
|
+
sendEvent(onClipboardChanged, [
|
|
39
|
+
"content": UIPasteboard.general.string ?? ""
|
|
40
|
+
])
|
|
41
|
+
}
|
|
42
|
+
}
|
package/ios/EXClipboard.podspec
CHANGED
|
@@ -11,18 +11,22 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
13
|
s.platform = :ios, '12.0'
|
|
14
|
+
s.swift_version = '5.4'
|
|
14
15
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
15
16
|
s.static_framework = true
|
|
16
|
-
s.source_files = 'EXClipboard/**/*.{h,m}'
|
|
17
|
-
s.preserve_paths = 'EXClipboard/**/*.{h,m}'
|
|
18
|
-
s.requires_arc = true
|
|
19
17
|
|
|
20
18
|
s.dependency 'ExpoModulesCore'
|
|
21
19
|
|
|
20
|
+
# Swift/Objective-C compatibility
|
|
21
|
+
s.pod_target_xcconfig = {
|
|
22
|
+
'DEFINES_MODULE' => 'YES',
|
|
23
|
+
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
|
|
23
27
|
s.source_files = "#{s.name}/**/*.h"
|
|
24
28
|
s.vendored_frameworks = "#{s.name}.xcframework"
|
|
25
29
|
else
|
|
26
|
-
s.source_files = "#{s.name}/**/*.{h,m}"
|
|
30
|
+
s.source_files = "#{s.name}/**/*.{h,m,swift}"
|
|
27
31
|
end
|
|
28
32
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-clipboard",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "ExpoClipboard standalone module",
|
|
5
5
|
"main": "build/Clipboard.js",
|
|
6
6
|
"types": "build/Clipboard.d.ts",
|
|
@@ -29,14 +29,15 @@
|
|
|
29
29
|
"author": "650 Industries, Inc.",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/clipboard",
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"expo-modules-core": "~0.4.2"
|
|
34
|
-
},
|
|
32
|
+
"dependencies": {},
|
|
35
33
|
"devDependencies": {
|
|
36
34
|
"expo-module-scripts": "^2.0.0"
|
|
37
35
|
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"expo": "*"
|
|
38
|
+
},
|
|
38
39
|
"jest": {
|
|
39
40
|
"preset": "expo-module-scripts/universal"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "ba24eba18bf4f4d4b0d54828992d81a2bb18246a"
|
|
42
43
|
}
|
package/unimodule.json
DELETED