@tbvjaos510/react-native-paste-input 0.9.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.
Files changed (108) hide show
  1. package/.circleci/config.yml +130 -0
  2. package/LICENSE +21 -0
  3. package/README.md +73 -0
  4. package/android/.project +17 -0
  5. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  6. package/android/build.gradle +94 -0
  7. package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerDelegate.java +236 -0
  8. package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerInterface.java +84 -0
  9. package/android/generated/jni/CMakeLists.txt +36 -0
  10. package/android/generated/jni/PasteTextInputSpecs-generated.cpp +27 -0
  11. package/android/generated/jni/PasteTextInputSpecs.h +28 -0
  12. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.cpp +22 -0
  13. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.h +166 -0
  14. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.cpp +183 -0
  15. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.h +148 -0
  16. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI-generated.cpp +17 -0
  17. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI.h +19 -0
  18. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.cpp +640 -0
  19. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.h +144 -0
  20. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.cpp +247 -0
  21. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.h +95 -0
  22. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.cpp +14 -0
  23. package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.h +19 -0
  24. package/android/gradle.properties +6 -0
  25. package/android/src/main/java/com/mattermost/pasteinputtext/IPasteInputListener.kt +8 -0
  26. package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputActionCallback.kt +72 -0
  27. package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputEditText.kt +60 -0
  28. package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputFileFromUrl.kt +50 -0
  29. package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputListener.kt +84 -0
  30. package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputManager.kt +72 -0
  31. package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputPackage.kt +14 -0
  32. package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputPasteEvent.java +41 -0
  33. package/android/src/main/java/com/mattermost/pasteinputtext/RealPathUtil.kt +174 -0
  34. package/ios/NSData+MimeType.h +20 -0
  35. package/ios/NSData+MimeType.m +59 -0
  36. package/ios/PasteInput-Bridging-Header.h +1 -0
  37. package/ios/PasteInput.xcodeproj/project.pbxproj +319 -0
  38. package/ios/PasteInputTextView.h +20 -0
  39. package/ios/PasteInputTextView.m +68 -0
  40. package/ios/PasteInputView.h +18 -0
  41. package/ios/PasteInputView.m +96 -0
  42. package/ios/PasteTextInput.h +13 -0
  43. package/ios/PasteTextInput.mm +726 -0
  44. package/ios/PasteTextInputManager.mm +171 -0
  45. package/ios/Swime/MimeType.h +70 -0
  46. package/ios/Swime/MimeType.m +701 -0
  47. package/ios/Swime/Swime.h +14 -0
  48. package/ios/Swime/Swime.m +28 -0
  49. package/ios/Swime/SwimeProxy.h +18 -0
  50. package/ios/Swime/SwimeProxy.m +66 -0
  51. package/ios/Swime/SwimeUtils.h +12 -0
  52. package/ios/Swime/SwimeUtils.m +23 -0
  53. package/ios/UIImage+ImageEffects.h +112 -0
  54. package/ios/UIImage+ImageEffects.m +310 -0
  55. package/ios/UIImage+vImageScaling.h +16 -0
  56. package/ios/UIImage+vImageScaling.m +48 -0
  57. package/ios/UIPasteboard+GetImageInfo.h +19 -0
  58. package/ios/UIPasteboard+GetImageInfo.m +98 -0
  59. package/ios/generated/PasteTextInputSpecs/ComponentDescriptors.cpp +22 -0
  60. package/ios/generated/PasteTextInputSpecs/ComponentDescriptors.h +42 -0
  61. package/ios/generated/PasteTextInputSpecs/EventEmitters.cpp +41 -0
  62. package/ios/generated/PasteTextInputSpecs/EventEmitters.h +37 -0
  63. package/ios/generated/PasteTextInputSpecs/PasteTextInputSpecs-generated.mm +16 -0
  64. package/ios/generated/PasteTextInputSpecs/PasteTextInputSpecs.h +38 -0
  65. package/ios/generated/PasteTextInputSpecs/Props.cpp +142 -0
  66. package/ios/generated/PasteTextInputSpecs/Props.h +81 -0
  67. package/ios/generated/PasteTextInputSpecs/RCTComponentViewHelpers.h +106 -0
  68. package/ios/generated/PasteTextInputSpecs/ShadowNodes.cpp +127 -0
  69. package/ios/generated/PasteTextInputSpecs/ShadowNodes.h +85 -0
  70. package/ios/generated/PasteTextInputSpecs/States.cpp +16 -0
  71. package/ios/generated/PasteTextInputSpecs/States.h +53 -0
  72. package/ios/generated/PasteTextInputSpecsJSI-generated.cpp +17 -0
  73. package/ios/generated/PasteTextInputSpecsJSI.h +19 -0
  74. package/lib/commonjs/PasteTextInput.js +446 -0
  75. package/lib/commonjs/PasteTextInput.js.map +1 -0
  76. package/lib/commonjs/PasteTextInputNativeComponent.ts +277 -0
  77. package/lib/commonjs/index.js +25 -0
  78. package/lib/commonjs/index.js.map +1 -0
  79. package/lib/commonjs/module.d.js +2 -0
  80. package/lib/commonjs/module.d.js.map +1 -0
  81. package/lib/commonjs/package.json +1 -0
  82. package/lib/commonjs/types.js +6 -0
  83. package/lib/commonjs/types.js.map +1 -0
  84. package/lib/module/PasteTextInput.js +440 -0
  85. package/lib/module/PasteTextInput.js.map +1 -0
  86. package/lib/module/PasteTextInputNativeComponent.ts +277 -0
  87. package/lib/module/index.js +9 -0
  88. package/lib/module/index.js.map +1 -0
  89. package/lib/module/module.d.js +2 -0
  90. package/lib/module/module.d.js.map +1 -0
  91. package/lib/module/types.js +4 -0
  92. package/lib/module/types.js.map +1 -0
  93. package/lib/typescript/src/PasteTextInput.d.ts +5 -0
  94. package/lib/typescript/src/PasteTextInput.d.ts.map +1 -0
  95. package/lib/typescript/src/PasteTextInputNativeComponent.d.ts +168 -0
  96. package/lib/typescript/src/PasteTextInputNativeComponent.d.ts.map +1 -0
  97. package/lib/typescript/src/index.d.ts +6 -0
  98. package/lib/typescript/src/index.d.ts.map +1 -0
  99. package/lib/typescript/src/types.d.ts +56 -0
  100. package/lib/typescript/src/types.d.ts.map +1 -0
  101. package/package.json +140 -0
  102. package/react-native-paste-input.podspec +20 -0
  103. package/react-native.config.js +13 -0
  104. package/src/PasteTextInput.tsx +615 -0
  105. package/src/PasteTextInputNativeComponent.ts +277 -0
  106. package/src/index.ts +13 -0
  107. package/src/module.d.ts +4 -0
  108. package/src/types.ts +71 -0
@@ -0,0 +1,319 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 7FA49C9D255319CA00B359F2 /* PasteInputManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C8E255319CA00B359F2 /* PasteInputManager.m */; };
11
+ 7FA49C9E255319CA00B359F2 /* PasteInputTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C8F255319CA00B359F2 /* PasteInputTextView.m */; };
12
+ 7FA49C9F255319CA00B359F2 /* UIPasteboard+GetImageInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C90255319CA00B359F2 /* UIPasteboard+GetImageInfo.m */; };
13
+ 7FA49CA0255319CA00B359F2 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C92255319CA00B359F2 /* UIImage+ImageEffects.m */; };
14
+ 7FA49CA1255319CA00B359F2 /* PasteInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C97255319CA00B359F2 /* PasteInputView.m */; };
15
+ 7FA49CA2255319CA00B359F2 /* UIImage+vImageScaling.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C98255319CA00B359F2 /* UIImage+vImageScaling.m */; };
16
+ 7FA49CA3255319CA00B359F2 /* NSData+MimeType.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C9A255319CA00B359F2 /* NSData+MimeType.m */; };
17
+ 7FA49CA4255319CA00B359F2 /* SwimeProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FA49C9B255319CA00B359F2 /* SwimeProxy.swift */; };
18
+ /* End PBXBuildFile section */
19
+
20
+ /* Begin PBXCopyFilesBuildPhase section */
21
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
22
+ isa = PBXCopyFilesBuildPhase;
23
+ buildActionMask = 2147483647;
24
+ dstPath = "include/$(PRODUCT_NAME)";
25
+ dstSubfolderSpec = 16;
26
+ files = (
27
+ );
28
+ runOnlyForDeploymentPostprocessing = 0;
29
+ };
30
+ /* End PBXCopyFilesBuildPhase section */
31
+
32
+ /* Begin PBXFileReference section */
33
+ 134814201AA4EA6300B7C361 /* libPasteInput.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPasteInput.a; sourceTree = BUILT_PRODUCTS_DIR; };
34
+ 7FA49C8E255319CA00B359F2 /* PasteInputManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PasteInputManager.m; sourceTree = "<group>"; };
35
+ 7FA49C8F255319CA00B359F2 /* PasteInputTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PasteInputTextView.m; sourceTree = "<group>"; };
36
+ 7FA49C90255319CA00B359F2 /* UIPasteboard+GetImageInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIPasteboard+GetImageInfo.m"; sourceTree = "<group>"; };
37
+ 7FA49C91255319CA00B359F2 /* PasteInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteInputView.h; sourceTree = "<group>"; };
38
+ 7FA49C92255319CA00B359F2 /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ImageEffects.m"; sourceTree = "<group>"; };
39
+ 7FA49C93255319CA00B359F2 /* NSData+MimeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+MimeType.h"; sourceTree = "<group>"; };
40
+ 7FA49C94255319CA00B359F2 /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ImageEffects.h"; sourceTree = "<group>"; };
41
+ 7FA49C95255319CA00B359F2 /* PasteInputTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteInputTextView.h; sourceTree = "<group>"; };
42
+ 7FA49C96255319CA00B359F2 /* PasteInputManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteInputManager.h; sourceTree = "<group>"; };
43
+ 7FA49C97255319CA00B359F2 /* PasteInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PasteInputView.m; sourceTree = "<group>"; };
44
+ 7FA49C98255319CA00B359F2 /* UIImage+vImageScaling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+vImageScaling.m"; sourceTree = "<group>"; };
45
+ 7FA49C99255319CA00B359F2 /* UIPasteboard+GetImageInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIPasteboard+GetImageInfo.h"; sourceTree = "<group>"; };
46
+ 7FA49C9A255319CA00B359F2 /* NSData+MimeType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+MimeType.m"; sourceTree = "<group>"; };
47
+ 7FA49C9B255319CA00B359F2 /* SwimeProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwimeProxy.swift; sourceTree = "<group>"; };
48
+ 7FA49C9C255319CA00B359F2 /* UIImage+vImageScaling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+vImageScaling.h"; sourceTree = "<group>"; };
49
+ F4FF95D5245B92E700C19C63 /* PasteInput-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PasteInput-Bridging-Header.h"; sourceTree = "<group>"; };
50
+ /* End PBXFileReference section */
51
+
52
+ /* Begin PBXFrameworksBuildPhase section */
53
+ 58B511D81A9E6C8500147676 /* Frameworks */ = {
54
+ isa = PBXFrameworksBuildPhase;
55
+ buildActionMask = 2147483647;
56
+ files = (
57
+ );
58
+ runOnlyForDeploymentPostprocessing = 0;
59
+ };
60
+ /* End PBXFrameworksBuildPhase section */
61
+
62
+ /* Begin PBXGroup section */
63
+ 134814211AA4EA7D00B7C361 /* Products */ = {
64
+ isa = PBXGroup;
65
+ children = (
66
+ 134814201AA4EA6300B7C361 /* libPasteInput.a */,
67
+ );
68
+ name = Products;
69
+ sourceTree = "<group>";
70
+ };
71
+ 58B511D21A9E6C8500147676 = {
72
+ isa = PBXGroup;
73
+ children = (
74
+ 7FA49C93255319CA00B359F2 /* NSData+MimeType.h */,
75
+ 7FA49C9A255319CA00B359F2 /* NSData+MimeType.m */,
76
+ 7FA49C96255319CA00B359F2 /* PasteInputManager.h */,
77
+ 7FA49C8E255319CA00B359F2 /* PasteInputManager.m */,
78
+ 7FA49C95255319CA00B359F2 /* PasteInputTextView.h */,
79
+ 7FA49C8F255319CA00B359F2 /* PasteInputTextView.m */,
80
+ 7FA49C91255319CA00B359F2 /* PasteInputView.h */,
81
+ 7FA49C97255319CA00B359F2 /* PasteInputView.m */,
82
+ 7FA49C9B255319CA00B359F2 /* SwimeProxy.swift */,
83
+ 7FA49C94255319CA00B359F2 /* UIImage+ImageEffects.h */,
84
+ 7FA49C92255319CA00B359F2 /* UIImage+ImageEffects.m */,
85
+ 7FA49C9C255319CA00B359F2 /* UIImage+vImageScaling.h */,
86
+ 7FA49C98255319CA00B359F2 /* UIImage+vImageScaling.m */,
87
+ 7FA49C99255319CA00B359F2 /* UIPasteboard+GetImageInfo.h */,
88
+ 7FA49C90255319CA00B359F2 /* UIPasteboard+GetImageInfo.m */,
89
+ F4FF95D5245B92E700C19C63 /* PasteInput-Bridging-Header.h */,
90
+ 134814211AA4EA7D00B7C361 /* Products */,
91
+ );
92
+ sourceTree = "<group>";
93
+ };
94
+ /* End PBXGroup section */
95
+
96
+ /* Begin PBXNativeTarget section */
97
+ 58B511DA1A9E6C8500147676 /* PasteInput */ = {
98
+ isa = PBXNativeTarget;
99
+ buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "PasteInput" */;
100
+ buildPhases = (
101
+ 58B511D71A9E6C8500147676 /* Sources */,
102
+ 58B511D81A9E6C8500147676 /* Frameworks */,
103
+ 58B511D91A9E6C8500147676 /* CopyFiles */,
104
+ );
105
+ buildRules = (
106
+ );
107
+ dependencies = (
108
+ );
109
+ name = PasteInput;
110
+ productName = RCTDataManager;
111
+ productReference = 134814201AA4EA6300B7C361 /* libPasteInput.a */;
112
+ productType = "com.apple.product-type.library.static";
113
+ };
114
+ /* End PBXNativeTarget section */
115
+
116
+ /* Begin PBXProject section */
117
+ 58B511D31A9E6C8500147676 /* Project object */ = {
118
+ isa = PBXProject;
119
+ attributes = {
120
+ LastUpgradeCheck = 0920;
121
+ ORGANIZATIONNAME = Facebook;
122
+ TargetAttributes = {
123
+ 58B511DA1A9E6C8500147676 = {
124
+ CreatedOnToolsVersion = 6.1.1;
125
+ };
126
+ };
127
+ };
128
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "PasteInput" */;
129
+ compatibilityVersion = "Xcode 3.2";
130
+ developmentRegion = English;
131
+ hasScannedForEncodings = 0;
132
+ knownRegions = (
133
+ English,
134
+ en,
135
+ );
136
+ mainGroup = 58B511D21A9E6C8500147676;
137
+ productRefGroup = 58B511D21A9E6C8500147676;
138
+ projectDirPath = "";
139
+ projectRoot = "";
140
+ targets = (
141
+ 58B511DA1A9E6C8500147676 /* PasteInput */,
142
+ );
143
+ };
144
+ /* End PBXProject section */
145
+
146
+ /* Begin PBXSourcesBuildPhase section */
147
+ 58B511D71A9E6C8500147676 /* Sources */ = {
148
+ isa = PBXSourcesBuildPhase;
149
+ buildActionMask = 2147483647;
150
+ files = (
151
+ 7FA49CA3255319CA00B359F2 /* NSData+MimeType.m in Sources */,
152
+ 7FA49CA1255319CA00B359F2 /* PasteInputView.m in Sources */,
153
+ 7FA49CA4255319CA00B359F2 /* SwimeProxy.swift in Sources */,
154
+ 7FA49CA0255319CA00B359F2 /* UIImage+ImageEffects.m in Sources */,
155
+ 7FA49C9E255319CA00B359F2 /* PasteInputTextView.m in Sources */,
156
+ 7FA49C9F255319CA00B359F2 /* UIPasteboard+GetImageInfo.m in Sources */,
157
+ 7FA49CA2255319CA00B359F2 /* UIImage+vImageScaling.m in Sources */,
158
+ 7FA49C9D255319CA00B359F2 /* PasteInputManager.m in Sources */,
159
+ );
160
+ runOnlyForDeploymentPostprocessing = 0;
161
+ };
162
+ /* End PBXSourcesBuildPhase section */
163
+
164
+ /* Begin XCBuildConfiguration section */
165
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
166
+ isa = XCBuildConfiguration;
167
+ buildSettings = {
168
+ ALWAYS_SEARCH_USER_PATHS = NO;
169
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
170
+ CLANG_CXX_LIBRARY = "libc++";
171
+ CLANG_ENABLE_MODULES = YES;
172
+ CLANG_ENABLE_OBJC_ARC = YES;
173
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
174
+ CLANG_WARN_BOOL_CONVERSION = YES;
175
+ CLANG_WARN_COMMA = YES;
176
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
177
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
178
+ CLANG_WARN_EMPTY_BODY = YES;
179
+ CLANG_WARN_ENUM_CONVERSION = YES;
180
+ CLANG_WARN_INFINITE_RECURSION = YES;
181
+ CLANG_WARN_INT_CONVERSION = YES;
182
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
183
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
184
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
185
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
186
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
187
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
188
+ CLANG_WARN_UNREACHABLE_CODE = YES;
189
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
190
+ COPY_PHASE_STRIP = NO;
191
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
192
+ ENABLE_TESTABILITY = YES;
193
+ GCC_C_LANGUAGE_STANDARD = gnu99;
194
+ GCC_DYNAMIC_NO_PIC = NO;
195
+ GCC_NO_COMMON_BLOCKS = YES;
196
+ GCC_OPTIMIZATION_LEVEL = 0;
197
+ GCC_PREPROCESSOR_DEFINITIONS = (
198
+ "DEBUG=1",
199
+ "$(inherited)",
200
+ );
201
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
202
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
203
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
204
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
205
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
206
+ GCC_WARN_UNUSED_FUNCTION = YES;
207
+ GCC_WARN_UNUSED_VARIABLE = YES;
208
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
209
+ MTL_ENABLE_DEBUG_INFO = YES;
210
+ ONLY_ACTIVE_ARCH = YES;
211
+ SDKROOT = iphoneos;
212
+ };
213
+ name = Debug;
214
+ };
215
+ 58B511EE1A9E6C8500147676 /* Release */ = {
216
+ isa = XCBuildConfiguration;
217
+ buildSettings = {
218
+ ALWAYS_SEARCH_USER_PATHS = NO;
219
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
220
+ CLANG_CXX_LIBRARY = "libc++";
221
+ CLANG_ENABLE_MODULES = YES;
222
+ CLANG_ENABLE_OBJC_ARC = YES;
223
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
224
+ CLANG_WARN_BOOL_CONVERSION = YES;
225
+ CLANG_WARN_COMMA = YES;
226
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
227
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
228
+ CLANG_WARN_EMPTY_BODY = YES;
229
+ CLANG_WARN_ENUM_CONVERSION = YES;
230
+ CLANG_WARN_INFINITE_RECURSION = YES;
231
+ CLANG_WARN_INT_CONVERSION = YES;
232
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
233
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
234
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
235
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
236
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
237
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
238
+ CLANG_WARN_UNREACHABLE_CODE = YES;
239
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
240
+ COPY_PHASE_STRIP = YES;
241
+ ENABLE_NS_ASSERTIONS = NO;
242
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
243
+ GCC_C_LANGUAGE_STANDARD = gnu99;
244
+ GCC_NO_COMMON_BLOCKS = YES;
245
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
246
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
247
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
248
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
249
+ GCC_WARN_UNUSED_FUNCTION = YES;
250
+ GCC_WARN_UNUSED_VARIABLE = YES;
251
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
252
+ MTL_ENABLE_DEBUG_INFO = NO;
253
+ SDKROOT = iphoneos;
254
+ VALIDATE_PRODUCT = YES;
255
+ };
256
+ name = Release;
257
+ };
258
+ 58B511F01A9E6C8500147676 /* Debug */ = {
259
+ isa = XCBuildConfiguration;
260
+ buildSettings = {
261
+ HEADER_SEARCH_PATHS = (
262
+ "$(inherited)",
263
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
264
+ "$(SRCROOT)/../../../React/**",
265
+ "$(SRCROOT)/../../react-native/React/**",
266
+ );
267
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
268
+ OTHER_LDFLAGS = "-ObjC";
269
+ PRODUCT_NAME = PasteInput;
270
+ SKIP_INSTALL = YES;
271
+ SWIFT_OBJC_BRIDGING_HEADER = "PasteInput-Bridging-Header.h";
272
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
273
+ SWIFT_VERSION = 5.0;
274
+ };
275
+ name = Debug;
276
+ };
277
+ 58B511F11A9E6C8500147676 /* Release */ = {
278
+ isa = XCBuildConfiguration;
279
+ buildSettings = {
280
+ HEADER_SEARCH_PATHS = (
281
+ "$(inherited)",
282
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
283
+ "$(SRCROOT)/../../../React/**",
284
+ "$(SRCROOT)/../../react-native/React/**",
285
+ );
286
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
287
+ OTHER_LDFLAGS = "-ObjC";
288
+ PRODUCT_NAME = PasteInput;
289
+ SKIP_INSTALL = YES;
290
+ SWIFT_OBJC_BRIDGING_HEADER = "PasteInput-Bridging-Header.h";
291
+ SWIFT_VERSION = 5.0;
292
+ };
293
+ name = Release;
294
+ };
295
+ /* End XCBuildConfiguration section */
296
+
297
+ /* Begin XCConfigurationList section */
298
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "PasteInput" */ = {
299
+ isa = XCConfigurationList;
300
+ buildConfigurations = (
301
+ 58B511ED1A9E6C8500147676 /* Debug */,
302
+ 58B511EE1A9E6C8500147676 /* Release */,
303
+ );
304
+ defaultConfigurationIsVisible = 0;
305
+ defaultConfigurationName = Release;
306
+ };
307
+ 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "PasteInput" */ = {
308
+ isa = XCConfigurationList;
309
+ buildConfigurations = (
310
+ 58B511F01A9E6C8500147676 /* Debug */,
311
+ 58B511F11A9E6C8500147676 /* Release */,
312
+ );
313
+ defaultConfigurationIsVisible = 0;
314
+ defaultConfigurationName = Release;
315
+ };
316
+ /* End XCConfigurationList section */
317
+ };
318
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
319
+ }
@@ -0,0 +1,20 @@
1
+ //
2
+ // PasteInputTextView.h
3
+ // PasteInput
4
+ //
5
+ // Created by Elias Nahum on 04-11-20.
6
+ // Copyright © 2020 Facebook. All rights reserved.
7
+ //
8
+
9
+ #import <UIKit/UIKit.h>
10
+ #import <React/RCTUITextView.h>
11
+ #import <React/RCTComponent.h>
12
+
13
+ NS_ASSUME_NONNULL_BEGIN
14
+
15
+ @interface PasteInputTextView : RCTUITextView
16
+ @property (nonatomic, assign) BOOL disableCopyPaste;
17
+ @property (nonatomic, copy, nullable) RCTDirectEventBlock onPaste;
18
+ @end
19
+
20
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,68 @@
1
+ //
2
+ // PasteInputTextView.m
3
+ // PasteInput
4
+ //
5
+ // Created by Elias Nahum on 04-11-20.
6
+ // Copyright © 2020 Facebook. All rights reserved.
7
+ //
8
+
9
+ #import "PasteInputTextView.h"
10
+ #import "UIPasteboard+GetImageInfo.h"
11
+
12
+ @implementation PasteInputTextView
13
+
14
+ #pragma mark - Overrides
15
+
16
+ - (BOOL)canPerformAction:(SEL)action withSender:(id)sender
17
+ {
18
+ #pragma clang diagnostic push
19
+ #pragma clang diagnostic ignored "-Wundeclared-selector"
20
+ BOOL prevent = action == @selector(paste:) ||
21
+ action == @selector(copy:) ||
22
+ action == @selector(cut:) ||
23
+ action == @selector(_share:);
24
+ #pragma clang diagnostic pop
25
+
26
+ if (_disableCopyPaste && prevent) {
27
+ return NO;
28
+ }
29
+
30
+ if (action == @selector(paste:) && [UIPasteboard generalPasteboard].numberOfItems > 0) {
31
+ return true;
32
+ }
33
+
34
+ return [super canPerformAction:action withSender:sender];
35
+ }
36
+
37
+ -(void)paste:(id)sender {
38
+ [super paste:sender];
39
+
40
+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
41
+
42
+ BOOL hasStrings = pasteboard.hasStrings;
43
+ if (hasStrings) {
44
+ NSArray<NSString *> *strs = pasteboard.strings;
45
+ for (NSString *s in strs) {
46
+ hasStrings = [s length] != 0 && ![s containsString:@"<img src="];
47
+ }
48
+ }
49
+ if (pasteboard.hasURLs || hasStrings || pasteboard.hasColors) {
50
+ return;
51
+ }
52
+
53
+ if (_onPaste) {
54
+ NSArray<NSDictionary *> *files = [pasteboard getCopiedFiles];
55
+ if (files != nil && files.count > 0) {
56
+ _onPaste(@{
57
+ @"data": files,
58
+ });
59
+ } else {
60
+ return;
61
+ }
62
+ }
63
+
64
+ // Dismiss contextual menu
65
+ [self resignFirstResponder];
66
+ }
67
+
68
+ @end
@@ -0,0 +1,18 @@
1
+ //
2
+ // PasteInputView.h
3
+ // PasteInput
4
+ //
5
+ // Created by Elias Nahum on 04-11-20.
6
+ // Copyright © 2020 Facebook. All rights reserved.
7
+ //
8
+
9
+ #import <React/RCTMultilineTextInputView.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ @interface PasteInputView : RCTMultilineTextInputView
14
+ @property (nonatomic, assign) BOOL disableCopyPaste;
15
+ @property (nonatomic, copy, nullable) RCTDirectEventBlock onPaste;
16
+ @end
17
+
18
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,96 @@
1
+ //
2
+ // PasteInputView.m
3
+ // PasteInput
4
+ //
5
+ // Created by Elias Nahum on 04-11-20.
6
+ // Copyright © 2020 Facebook. All rights reserved.
7
+ //
8
+
9
+ #import "PasteInputView.h"
10
+ #import "PasteInputTextView.h"
11
+ #import <React/RCTUtils.h>
12
+
13
+ @implementation PasteInputView
14
+ {
15
+ PasteInputTextView *_backedTextInputView;
16
+ }
17
+
18
+ - (instancetype)initWithBridge:(RCTBridge *)bridge
19
+ {
20
+ if (self = [super initWithBridge:bridge]) {
21
+ _backedTextInputView = [[PasteInputTextView alloc] initWithFrame:self.bounds];
22
+ _backedTextInputView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
23
+ _backedTextInputView.textInputDelegate = self;
24
+
25
+ [self addSubview:_backedTextInputView];
26
+ }
27
+
28
+ return self;
29
+ }
30
+
31
+ - (id<RCTBackedTextInputViewProtocol>)backedTextInputView
32
+ {
33
+ return _backedTextInputView;
34
+ }
35
+
36
+ - (void)setDisableCopyPaste:(BOOL)disableCopyPaste {
37
+ _backedTextInputView.disableCopyPaste = disableCopyPaste;
38
+ }
39
+
40
+ - (void)setOnPaste:(RCTDirectEventBlock)onPaste {
41
+ _backedTextInputView.onPaste = onPaste;
42
+ }
43
+
44
+ - (void)setSmartPunctuation:(NSString *)smartPunctuation {
45
+ if ([smartPunctuation isEqualToString:@"enable"]) {
46
+ [_backedTextInputView setSmartDashesType:UITextSmartDashesTypeYes];
47
+ [_backedTextInputView setSmartQuotesType:UITextSmartQuotesTypeYes];
48
+ [_backedTextInputView setSmartInsertDeleteType:UITextSmartInsertDeleteTypeYes];
49
+ } else if ([smartPunctuation isEqualToString:@"disable"]) {
50
+ [_backedTextInputView setSmartDashesType:UITextSmartDashesTypeNo];
51
+ [_backedTextInputView setSmartQuotesType:UITextSmartQuotesTypeNo];
52
+ [_backedTextInputView setSmartInsertDeleteType:UITextSmartInsertDeleteTypeNo];
53
+ } else {
54
+ [_backedTextInputView setSmartDashesType:UITextSmartDashesTypeDefault];
55
+ [_backedTextInputView setSmartQuotesType:UITextSmartQuotesTypeDefault];
56
+ [_backedTextInputView setSmartInsertDeleteType:UITextSmartInsertDeleteTypeDefault];
57
+ }
58
+ }
59
+
60
+ #pragma mark - UIScrollViewDelegate
61
+
62
+ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
63
+ {
64
+ RCTDirectEventBlock onScroll = self.onScroll;
65
+
66
+ if (onScroll) {
67
+ CGPoint contentOffset = scrollView.contentOffset;
68
+ CGSize contentSize = scrollView.contentSize;
69
+ CGSize size = scrollView.bounds.size;
70
+ UIEdgeInsets contentInset = scrollView.contentInset;
71
+
72
+ onScroll(@{
73
+ @"contentOffset": @{
74
+ @"x": @(contentOffset.x),
75
+ @"y": @(contentOffset.y)
76
+ },
77
+ @"contentInset": @{
78
+ @"top": @(contentInset.top),
79
+ @"left": @(contentInset.left),
80
+ @"bottom": @(contentInset.bottom),
81
+ @"right": @(contentInset.right)
82
+ },
83
+ @"contentSize": @{
84
+ @"width": @(contentSize.width),
85
+ @"height": @(contentSize.height)
86
+ },
87
+ @"layoutMeasurement": @{
88
+ @"width": @(size.width),
89
+ @"height": @(size.height)
90
+ },
91
+ @"zoomScale": @(scrollView.zoomScale ?: 1),
92
+ });
93
+ }
94
+ }
95
+
96
+ @end
@@ -0,0 +1,13 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+ #import <React/RCTViewComponentView.h>
3
+ #import <UIKit/UIKit.h>
4
+
5
+ NS_ASSUME_NONNULL_BEGIN
6
+
7
+ @interface PasteTextInput : RCTViewComponentView
8
+
9
+ @end
10
+
11
+ NS_ASSUME_NONNULL_END
12
+
13
+ #endif