@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.
- package/.circleci/config.yml +130 -0
- package/LICENSE +21 -0
- package/README.md +73 -0
- package/android/.project +17 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build.gradle +94 -0
- package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerDelegate.java +236 -0
- package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerInterface.java +84 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/PasteTextInputSpecs-generated.cpp +27 -0
- package/android/generated/jni/PasteTextInputSpecs.h +28 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.cpp +22 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ComponentDescriptors.h +166 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.cpp +183 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/EventEmitters.h +148 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI-generated.cpp +17 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/PasteTextInputSpecsJSI.h +19 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.cpp +640 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/Props.h +144 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.cpp +247 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/ShadowNodes.h +95 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.cpp +14 -0
- package/android/generated/jni/react/renderer/components/PasteTextInputSpecs/States.h +19 -0
- package/android/gradle.properties +6 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/IPasteInputListener.kt +8 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputActionCallback.kt +72 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputEditText.kt +60 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputFileFromUrl.kt +50 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteInputListener.kt +84 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputManager.kt +72 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputPackage.kt +14 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/PasteTextInputPasteEvent.java +41 -0
- package/android/src/main/java/com/mattermost/pasteinputtext/RealPathUtil.kt +174 -0
- package/ios/NSData+MimeType.h +20 -0
- package/ios/NSData+MimeType.m +59 -0
- package/ios/PasteInput-Bridging-Header.h +1 -0
- package/ios/PasteInput.xcodeproj/project.pbxproj +319 -0
- package/ios/PasteInputTextView.h +20 -0
- package/ios/PasteInputTextView.m +68 -0
- package/ios/PasteInputView.h +18 -0
- package/ios/PasteInputView.m +96 -0
- package/ios/PasteTextInput.h +13 -0
- package/ios/PasteTextInput.mm +726 -0
- package/ios/PasteTextInputManager.mm +171 -0
- package/ios/Swime/MimeType.h +70 -0
- package/ios/Swime/MimeType.m +701 -0
- package/ios/Swime/Swime.h +14 -0
- package/ios/Swime/Swime.m +28 -0
- package/ios/Swime/SwimeProxy.h +18 -0
- package/ios/Swime/SwimeProxy.m +66 -0
- package/ios/Swime/SwimeUtils.h +12 -0
- package/ios/Swime/SwimeUtils.m +23 -0
- package/ios/UIImage+ImageEffects.h +112 -0
- package/ios/UIImage+ImageEffects.m +310 -0
- package/ios/UIImage+vImageScaling.h +16 -0
- package/ios/UIImage+vImageScaling.m +48 -0
- package/ios/UIPasteboard+GetImageInfo.h +19 -0
- package/ios/UIPasteboard+GetImageInfo.m +98 -0
- package/ios/generated/PasteTextInputSpecs/ComponentDescriptors.cpp +22 -0
- package/ios/generated/PasteTextInputSpecs/ComponentDescriptors.h +42 -0
- package/ios/generated/PasteTextInputSpecs/EventEmitters.cpp +41 -0
- package/ios/generated/PasteTextInputSpecs/EventEmitters.h +37 -0
- package/ios/generated/PasteTextInputSpecs/PasteTextInputSpecs-generated.mm +16 -0
- package/ios/generated/PasteTextInputSpecs/PasteTextInputSpecs.h +38 -0
- package/ios/generated/PasteTextInputSpecs/Props.cpp +142 -0
- package/ios/generated/PasteTextInputSpecs/Props.h +81 -0
- package/ios/generated/PasteTextInputSpecs/RCTComponentViewHelpers.h +106 -0
- package/ios/generated/PasteTextInputSpecs/ShadowNodes.cpp +127 -0
- package/ios/generated/PasteTextInputSpecs/ShadowNodes.h +85 -0
- package/ios/generated/PasteTextInputSpecs/States.cpp +16 -0
- package/ios/generated/PasteTextInputSpecs/States.h +53 -0
- package/ios/generated/PasteTextInputSpecsJSI-generated.cpp +17 -0
- package/ios/generated/PasteTextInputSpecsJSI.h +19 -0
- package/lib/commonjs/PasteTextInput.js +446 -0
- package/lib/commonjs/PasteTextInput.js.map +1 -0
- package/lib/commonjs/PasteTextInputNativeComponent.ts +277 -0
- package/lib/commonjs/index.js +25 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/module.d.js +2 -0
- package/lib/commonjs/module.d.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/PasteTextInput.js +440 -0
- package/lib/module/PasteTextInput.js.map +1 -0
- package/lib/module/PasteTextInputNativeComponent.ts +277 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/module.d.js +2 -0
- package/lib/module/module.d.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/src/PasteTextInput.d.ts +5 -0
- package/lib/typescript/src/PasteTextInput.d.ts.map +1 -0
- package/lib/typescript/src/PasteTextInputNativeComponent.d.ts +168 -0
- package/lib/typescript/src/PasteTextInputNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +56 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +140 -0
- package/react-native-paste-input.podspec +20 -0
- package/react-native.config.js +13 -0
- package/src/PasteTextInput.tsx +615 -0
- package/src/PasteTextInputNativeComponent.ts +277 -0
- package/src/index.ts +13 -0
- package/src/module.d.ts +4 -0
- package/src/types.ts +71 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
version: 2.1
|
|
2
|
+
|
|
3
|
+
executors:
|
|
4
|
+
default:
|
|
5
|
+
docker:
|
|
6
|
+
- image: circleci/node:14
|
|
7
|
+
working_directory: ~/project
|
|
8
|
+
|
|
9
|
+
commands:
|
|
10
|
+
attach_project:
|
|
11
|
+
steps:
|
|
12
|
+
- attach_workspace:
|
|
13
|
+
at: ~/project
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
install-dependencies:
|
|
17
|
+
executor: default
|
|
18
|
+
steps:
|
|
19
|
+
- checkout
|
|
20
|
+
- attach_project
|
|
21
|
+
- restore_cache:
|
|
22
|
+
keys:
|
|
23
|
+
- dependencies-{{ checksum "package.json" }}
|
|
24
|
+
- run:
|
|
25
|
+
name: Install dependencies
|
|
26
|
+
command: |
|
|
27
|
+
npm install
|
|
28
|
+
- save_cache:
|
|
29
|
+
key: dependencies-{{ checksum "package.json" }}
|
|
30
|
+
paths: node_modules
|
|
31
|
+
- persist_to_workspace:
|
|
32
|
+
root: .
|
|
33
|
+
paths: .
|
|
34
|
+
|
|
35
|
+
lint:
|
|
36
|
+
executor: default
|
|
37
|
+
steps:
|
|
38
|
+
- attach_project
|
|
39
|
+
- run:
|
|
40
|
+
name: Lint files
|
|
41
|
+
command: |
|
|
42
|
+
npm run lint
|
|
43
|
+
|
|
44
|
+
typescript:
|
|
45
|
+
executor: default
|
|
46
|
+
steps:
|
|
47
|
+
- attach_project
|
|
48
|
+
- run:
|
|
49
|
+
name: Typecheck files
|
|
50
|
+
command: |
|
|
51
|
+
npm run typescript
|
|
52
|
+
|
|
53
|
+
unit-tests:
|
|
54
|
+
executor: default
|
|
55
|
+
steps:
|
|
56
|
+
- attach_project
|
|
57
|
+
- run:
|
|
58
|
+
name: Run unit tests
|
|
59
|
+
command: |
|
|
60
|
+
npm test --coverage
|
|
61
|
+
- store_artifacts:
|
|
62
|
+
path: coverage
|
|
63
|
+
destination: coverage
|
|
64
|
+
|
|
65
|
+
build-package:
|
|
66
|
+
executor: default
|
|
67
|
+
steps:
|
|
68
|
+
- attach_project
|
|
69
|
+
- run:
|
|
70
|
+
name: Build package
|
|
71
|
+
command: |
|
|
72
|
+
npm run prepare
|
|
73
|
+
|
|
74
|
+
release:
|
|
75
|
+
executor: default
|
|
76
|
+
steps:
|
|
77
|
+
- attach_project
|
|
78
|
+
- run:
|
|
79
|
+
name: Release to GitHub
|
|
80
|
+
command: npm run release -- --ci
|
|
81
|
+
|
|
82
|
+
publish:
|
|
83
|
+
executor: default
|
|
84
|
+
steps:
|
|
85
|
+
- attach_project
|
|
86
|
+
- run:
|
|
87
|
+
name: Authenticate with registry
|
|
88
|
+
command: |
|
|
89
|
+
echo "//registry.npmjs.org/:authToken=$NPM_TOKEN" > ~/project/.npmrc
|
|
90
|
+
echo "scope=$NPM_SCOPE"
|
|
91
|
+
- run:
|
|
92
|
+
name: Publish package
|
|
93
|
+
run: npm publish --access public
|
|
94
|
+
|
|
95
|
+
workflows:
|
|
96
|
+
build:
|
|
97
|
+
jobs:
|
|
98
|
+
- install-dependencies
|
|
99
|
+
- lint:
|
|
100
|
+
requires:
|
|
101
|
+
- install-dependencies
|
|
102
|
+
- typescript:
|
|
103
|
+
requires:
|
|
104
|
+
- install-dependencies
|
|
105
|
+
- unit-tests:
|
|
106
|
+
requires:
|
|
107
|
+
- install-dependencies
|
|
108
|
+
- build-package:
|
|
109
|
+
requires:
|
|
110
|
+
- install-dependencies
|
|
111
|
+
- lint
|
|
112
|
+
- typescript
|
|
113
|
+
- unit-tests
|
|
114
|
+
- release:
|
|
115
|
+
context: mattermost-rn-libraries
|
|
116
|
+
requires:
|
|
117
|
+
- build-package
|
|
118
|
+
fliters:
|
|
119
|
+
branches:
|
|
120
|
+
only: /^release-\d+$/
|
|
121
|
+
- publish:
|
|
122
|
+
context: mattermost-rn-libraries
|
|
123
|
+
requires:
|
|
124
|
+
- build-package
|
|
125
|
+
filters:
|
|
126
|
+
tags:
|
|
127
|
+
only: /^v(\d+\.)(\d+\.)(\d+)(.*)?$/
|
|
128
|
+
branches:
|
|
129
|
+
ignore: /.*/
|
|
130
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Elias Nahum
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @mattermost/react-native-paste-input
|
|
2
|
+
|
|
3
|
+
React Native `TextInput` component have functionality to capture text input from a user
|
|
4
|
+
by using the soft and hardware keyboards but lacks the ability to restrict copy & paste options
|
|
5
|
+
as well as allwing pasting different files formats copied from other apps, like images & videos from
|
|
6
|
+
the Photos gallery app.
|
|
7
|
+
|
|
8
|
+
`PasteInput` is a `TextInput` replacement that solves this issues.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm i --save-exact @mattermost/react-native-paste-input
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Demo
|
|
17
|
+
| Android | iOS |
|
|
18
|
+
|-- |-- |
|
|
19
|
+
|||
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import React, { useRef } from 'react';
|
|
27
|
+
import PasteInput, { PastedFile, PasteInputRef } from "@mattermost/react-native-paste-input";
|
|
28
|
+
|
|
29
|
+
const YourTextInput = () => {
|
|
30
|
+
const inputRef = useRef<PasteInputRef>(null);
|
|
31
|
+
|
|
32
|
+
const onPaste = (
|
|
33
|
+
error: string | null | undefined,
|
|
34
|
+
files: Array<PastedFile>
|
|
35
|
+
) => {
|
|
36
|
+
console.log('ERROR', error);
|
|
37
|
+
console.log('PASTED FILES', files);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<PasteInput
|
|
42
|
+
ref={inputRef}
|
|
43
|
+
disableCopyPaste={false}
|
|
44
|
+
onPaste={onPaste}
|
|
45
|
+
multiline={true}
|
|
46
|
+
blurOnSubmit={false}
|
|
47
|
+
underlineColorAndroid="transparent"
|
|
48
|
+
keyboardType="default"
|
|
49
|
+
disableFullscreenUI={true}
|
|
50
|
+
textContentType="none"
|
|
51
|
+
autoCompleteType="off"
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Properties
|
|
58
|
+
All properties of the [TextInput](!https://reactnative.dev/docs/textinput) component plus:
|
|
59
|
+
|
|
60
|
+
##### `disableCopyPaste: boolean`
|
|
61
|
+
Indicates if the menu items for *cut*, *copy*, *paste* and *share* should not be present in the context menu.
|
|
62
|
+
|
|
63
|
+
##### `onPaste: (error, files) => void`
|
|
64
|
+
Callback that is called when the pasting files into the text input.
|
|
65
|
+
*Note: On Android this callback is also called when selecting and image / gif from the soft keyboard.*
|
|
66
|
+
|
|
67
|
+
## Contributing
|
|
68
|
+
|
|
69
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
package/android/.project
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<projectDescription>
|
|
3
|
+
<name>android_</name>
|
|
4
|
+
<comment>Project android_ created by Buildship.</comment>
|
|
5
|
+
<projects>
|
|
6
|
+
</projects>
|
|
7
|
+
<buildSpec>
|
|
8
|
+
<buildCommand>
|
|
9
|
+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
10
|
+
<arguments>
|
|
11
|
+
</arguments>
|
|
12
|
+
</buildCommand>
|
|
13
|
+
</buildSpec>
|
|
14
|
+
<natures>
|
|
15
|
+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
+
</natures>
|
|
17
|
+
</projectDescription>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
arguments=
|
|
2
|
+
auto.sync=false
|
|
3
|
+
build.scans.enabled=false
|
|
4
|
+
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0))
|
|
5
|
+
connection.project.dir=
|
|
6
|
+
eclipse.preferences.version=1
|
|
7
|
+
gradle.user.home=
|
|
8
|
+
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
|
|
9
|
+
jvm.arguments=
|
|
10
|
+
offline.mode=false
|
|
11
|
+
override.workspace.settings=true
|
|
12
|
+
show.console.view=true
|
|
13
|
+
show.executions.view=true
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativePasteInput_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
apply plugin: "com.android.library"
|
|
20
|
+
apply plugin: "kotlin-android"
|
|
21
|
+
|
|
22
|
+
apply plugin: "com.facebook.react"
|
|
23
|
+
|
|
24
|
+
def getExtOrIntegerDefault(name) {
|
|
25
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["TestItOut_" + name]).toInteger()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
android {
|
|
29
|
+
namespace "com.mattermost.pasteinputtext"
|
|
30
|
+
|
|
31
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
32
|
+
|
|
33
|
+
defaultConfig {
|
|
34
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
35
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
36
|
+
externalNativeBuild {
|
|
37
|
+
cmake {
|
|
38
|
+
cppFlags '-DBUILD_DEBUG'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
buildFeatures {
|
|
44
|
+
buildConfig true
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
buildTypes {
|
|
48
|
+
release {
|
|
49
|
+
minifyEnabled false
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
lintOptions {
|
|
54
|
+
disable "GradleCompatible"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
compileOptions {
|
|
58
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
59
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
sourceSets {
|
|
63
|
+
main {
|
|
64
|
+
java.srcDirs += [
|
|
65
|
+
"generated/java",
|
|
66
|
+
"generated/jni"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
externalNativeBuild {
|
|
72
|
+
cmake {
|
|
73
|
+
path file('generated/jni/CMakeLists.txt')
|
|
74
|
+
version '3.22.1'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
80
|
+
|
|
81
|
+
repositories {
|
|
82
|
+
mavenCentral()
|
|
83
|
+
google()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
dependencies {
|
|
87
|
+
implementation 'com.facebook.react:react-native:+'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
react {
|
|
91
|
+
jsRootDir = file("../src/")
|
|
92
|
+
libraryName = "react-native-paste-input"
|
|
93
|
+
codegenJavaPackageName = "com.mattermost.pastetextinput"
|
|
94
|
+
}
|
package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerDelegate.java
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.bridge.ColorPropConverter;
|
|
15
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
16
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
17
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
18
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
19
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
20
|
+
|
|
21
|
+
public class PasteTextInputManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PasteTextInputManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
22
|
+
public PasteTextInputManagerDelegate(U viewManager) {
|
|
23
|
+
super(viewManager);
|
|
24
|
+
}
|
|
25
|
+
@Override
|
|
26
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
27
|
+
switch (propName) {
|
|
28
|
+
case "allowFontScaling":
|
|
29
|
+
mViewManager.setAllowFontScaling(view, value == null ? false : (boolean) value);
|
|
30
|
+
break;
|
|
31
|
+
case "autoCapitalize":
|
|
32
|
+
mViewManager.setAutoCapitalize(view, (String) value);
|
|
33
|
+
break;
|
|
34
|
+
case "autoComplete":
|
|
35
|
+
mViewManager.setAutoComplete(view, (String) value);
|
|
36
|
+
break;
|
|
37
|
+
case "autoCorrect":
|
|
38
|
+
mViewManager.setAutoCorrect(view, value == null ? false : (boolean) value);
|
|
39
|
+
break;
|
|
40
|
+
case "autoFocus":
|
|
41
|
+
mViewManager.setAutoFocus(view, value == null ? false : (boolean) value);
|
|
42
|
+
break;
|
|
43
|
+
case "blurOnSubmit":
|
|
44
|
+
mViewManager.setBlurOnSubmit(view, value == null ? false : (boolean) value);
|
|
45
|
+
break;
|
|
46
|
+
case "caretHidden":
|
|
47
|
+
mViewManager.setCaretHidden(view, value == null ? false : (boolean) value);
|
|
48
|
+
break;
|
|
49
|
+
case "clearButtonMode":
|
|
50
|
+
mViewManager.setClearButtonMode(view, value == null ? null : (String) value);
|
|
51
|
+
break;
|
|
52
|
+
case "clearTextOnFocus":
|
|
53
|
+
mViewManager.setClearTextOnFocus(view, value == null ? false : (boolean) value);
|
|
54
|
+
break;
|
|
55
|
+
case "contextMenuHidden":
|
|
56
|
+
mViewManager.setContextMenuHidden(view, value == null ? false : (boolean) value);
|
|
57
|
+
break;
|
|
58
|
+
case "defaultValue":
|
|
59
|
+
mViewManager.setDefaultValue(view, value == null ? null : (String) value);
|
|
60
|
+
break;
|
|
61
|
+
case "disableCopyPaste":
|
|
62
|
+
mViewManager.setDisableCopyPaste(view, value == null ? false : (boolean) value);
|
|
63
|
+
break;
|
|
64
|
+
case "disableFullscreenUI":
|
|
65
|
+
mViewManager.setDisableFullscreenUI(view, value == null ? false : (boolean) value);
|
|
66
|
+
break;
|
|
67
|
+
case "editable":
|
|
68
|
+
mViewManager.setEditable(view, value == null ? false : (boolean) value);
|
|
69
|
+
break;
|
|
70
|
+
case "enablesReturnKeyAutomatically":
|
|
71
|
+
mViewManager.setEnablesReturnKeyAutomatically(view, value == null ? false : (boolean) value);
|
|
72
|
+
break;
|
|
73
|
+
case "importantForAutofill":
|
|
74
|
+
mViewManager.setImportantForAutofill(view, value == null ? null : (String) value);
|
|
75
|
+
break;
|
|
76
|
+
case "inlineImageLeft":
|
|
77
|
+
mViewManager.setInlineImageLeft(view, value == null ? null : (String) value);
|
|
78
|
+
break;
|
|
79
|
+
case "inlineImagePadding":
|
|
80
|
+
mViewManager.setInlineImagePadding(view, value == null ? 0 : ((Double) value).intValue());
|
|
81
|
+
break;
|
|
82
|
+
case "inputAccessoryViewID":
|
|
83
|
+
mViewManager.setInputAccessoryViewID(view, value == null ? null : (String) value);
|
|
84
|
+
break;
|
|
85
|
+
case "keyboardAppearance":
|
|
86
|
+
mViewManager.setKeyboardAppearance(view, value == null ? null : (String) value);
|
|
87
|
+
break;
|
|
88
|
+
case "keyboardType":
|
|
89
|
+
mViewManager.setKeyboardType(view, (String) value);
|
|
90
|
+
break;
|
|
91
|
+
case "maxFontSizeMultiplier":
|
|
92
|
+
mViewManager.setMaxFontSizeMultiplier(view, value == null ? 0f : ((Double) value).floatValue());
|
|
93
|
+
break;
|
|
94
|
+
case "maxLength":
|
|
95
|
+
mViewManager.setMaxLength(view, value == null ? 0 : ((Double) value).intValue());
|
|
96
|
+
break;
|
|
97
|
+
case "mostRecentEventCount":
|
|
98
|
+
mViewManager.setMostRecentEventCount(view, value == null ? 0 : ((Double) value).intValue());
|
|
99
|
+
break;
|
|
100
|
+
case "multiline":
|
|
101
|
+
mViewManager.setMultiline(view, value == null ? false : (boolean) value);
|
|
102
|
+
break;
|
|
103
|
+
case "numberOfLines":
|
|
104
|
+
mViewManager.setNumberOfLines(view, value == null ? 0 : ((Double) value).intValue());
|
|
105
|
+
break;
|
|
106
|
+
case "passwordRules":
|
|
107
|
+
mViewManager.setPasswordRules(view, value == null ? null : (String) value);
|
|
108
|
+
break;
|
|
109
|
+
case "placeholder":
|
|
110
|
+
mViewManager.setPlaceholder(view, value == null ? null : (String) value);
|
|
111
|
+
break;
|
|
112
|
+
case "placeholderTextColor":
|
|
113
|
+
mViewManager.setPlaceholderTextColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
114
|
+
break;
|
|
115
|
+
case "returnKeyLabel":
|
|
116
|
+
mViewManager.setReturnKeyLabel(view, value == null ? null : (String) value);
|
|
117
|
+
break;
|
|
118
|
+
case "returnKeyType":
|
|
119
|
+
mViewManager.setReturnKeyType(view, (String) value);
|
|
120
|
+
break;
|
|
121
|
+
case "scrollEnabled":
|
|
122
|
+
mViewManager.setScrollEnabled(view, value == null ? false : (boolean) value);
|
|
123
|
+
break;
|
|
124
|
+
case "secureTextEntry":
|
|
125
|
+
mViewManager.setSecureTextEntry(view, value == null ? false : (boolean) value);
|
|
126
|
+
break;
|
|
127
|
+
case "selection":
|
|
128
|
+
mViewManager.setSelection(view, (ReadableMap) value);
|
|
129
|
+
break;
|
|
130
|
+
case "selectionColor":
|
|
131
|
+
mViewManager.setSelectionColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
132
|
+
break;
|
|
133
|
+
case "selectionHandleColor":
|
|
134
|
+
mViewManager.setSelectionHandleColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
135
|
+
break;
|
|
136
|
+
case "selectTextOnFocus":
|
|
137
|
+
mViewManager.setSelectTextOnFocus(view, value == null ? false : (boolean) value);
|
|
138
|
+
break;
|
|
139
|
+
case "showSoftInputOnFocus":
|
|
140
|
+
mViewManager.setShowSoftInputOnFocus(view, value == null ? false : (boolean) value);
|
|
141
|
+
break;
|
|
142
|
+
case "smartInsertDelete":
|
|
143
|
+
mViewManager.setSmartInsertDelete(view, value == null ? false : (boolean) value);
|
|
144
|
+
break;
|
|
145
|
+
case "smartPunctuation":
|
|
146
|
+
mViewManager.setSmartPunctuation(view, value == null ? null : (String) value);
|
|
147
|
+
break;
|
|
148
|
+
case "spellCheck":
|
|
149
|
+
mViewManager.setSpellCheck(view, value == null ? false : (boolean) value);
|
|
150
|
+
break;
|
|
151
|
+
case "submitBehavior":
|
|
152
|
+
mViewManager.setSubmitBehavior(view, (String) value);
|
|
153
|
+
break;
|
|
154
|
+
case "text":
|
|
155
|
+
mViewManager.setText(view, value == null ? null : (String) value);
|
|
156
|
+
break;
|
|
157
|
+
case "textBreakStrategy":
|
|
158
|
+
mViewManager.setTextBreakStrategy(view, (String) value);
|
|
159
|
+
break;
|
|
160
|
+
case "textContentType":
|
|
161
|
+
mViewManager.setTextContentType(view, value == null ? null : (String) value);
|
|
162
|
+
break;
|
|
163
|
+
case "underlineColorAndroid":
|
|
164
|
+
mViewManager.setUnderlineColorAndroid(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
165
|
+
break;
|
|
166
|
+
case "value":
|
|
167
|
+
mViewManager.setValue(view, value == null ? null : (String) value);
|
|
168
|
+
break;
|
|
169
|
+
case "textShadowColor":
|
|
170
|
+
mViewManager.setTextShadowColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
171
|
+
break;
|
|
172
|
+
case "textShadowRadius":
|
|
173
|
+
mViewManager.setTextShadowRadius(view, value == null ? 0f : ((Double) value).floatValue());
|
|
174
|
+
break;
|
|
175
|
+
case "textDecorationLine":
|
|
176
|
+
mViewManager.setTextDecorationLine(view, value == null ? null : (String) value);
|
|
177
|
+
break;
|
|
178
|
+
case "fontStyle":
|
|
179
|
+
mViewManager.setFontStyle(view, value == null ? null : (String) value);
|
|
180
|
+
break;
|
|
181
|
+
case "textShadowOffset":
|
|
182
|
+
mViewManager.setTextShadowOffset(view, (ReadableMap) value);
|
|
183
|
+
break;
|
|
184
|
+
case "lineHeight":
|
|
185
|
+
mViewManager.setLineHeight(view, value == null ? 0f : ((Double) value).floatValue());
|
|
186
|
+
break;
|
|
187
|
+
case "textTransform":
|
|
188
|
+
mViewManager.setTextTransform(view, value == null ? null : (String) value);
|
|
189
|
+
break;
|
|
190
|
+
case "color":
|
|
191
|
+
mViewManager.setColor(view, value == null ? 0 : ((Double) value).intValue());
|
|
192
|
+
break;
|
|
193
|
+
case "letterSpacing":
|
|
194
|
+
mViewManager.setLetterSpacing(view, value == null ? 0f : ((Double) value).floatValue());
|
|
195
|
+
break;
|
|
196
|
+
case "fontSize":
|
|
197
|
+
mViewManager.setFontSize(view, value == null ? 0f : ((Double) value).floatValue());
|
|
198
|
+
break;
|
|
199
|
+
case "textAlign":
|
|
200
|
+
mViewManager.setTextAlign(view, value == null ? null : (String) value);
|
|
201
|
+
break;
|
|
202
|
+
case "includeFontPadding":
|
|
203
|
+
mViewManager.setIncludeFontPadding(view, value == null ? false : (boolean) value);
|
|
204
|
+
break;
|
|
205
|
+
case "fontWeight":
|
|
206
|
+
mViewManager.setFontWeight(view, value == null ? null : (String) value);
|
|
207
|
+
break;
|
|
208
|
+
case "fontFamily":
|
|
209
|
+
mViewManager.setFontFamily(view, value == null ? null : (String) value);
|
|
210
|
+
break;
|
|
211
|
+
case "textAlignVertical":
|
|
212
|
+
mViewManager.setTextAlignVertical(view, value == null ? null : (String) value);
|
|
213
|
+
break;
|
|
214
|
+
case "cursorColor":
|
|
215
|
+
mViewManager.setCursorColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
super.setProperty(view, propName, value);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@Override
|
|
223
|
+
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
|
|
224
|
+
switch (commandName) {
|
|
225
|
+
case "focus":
|
|
226
|
+
mViewManager.focus(view);
|
|
227
|
+
break;
|
|
228
|
+
case "blur":
|
|
229
|
+
mViewManager.blur(view);
|
|
230
|
+
break;
|
|
231
|
+
case "setTextAndSelection":
|
|
232
|
+
mViewManager.setTextAndSelection(view, args.getInt(0), args.getString(1), args.getInt(2), args.getInt(3));
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
package/android/generated/java/com/facebook/react/viewmanagers/PasteTextInputManagerInterface.java
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
15
|
+
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
16
|
+
|
|
17
|
+
public interface PasteTextInputManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
18
|
+
void setAllowFontScaling(T view, boolean value);
|
|
19
|
+
void setAutoCapitalize(T view, @Nullable String value);
|
|
20
|
+
void setAutoComplete(T view, @Nullable String value);
|
|
21
|
+
void setAutoCorrect(T view, boolean value);
|
|
22
|
+
void setAutoFocus(T view, boolean value);
|
|
23
|
+
void setBlurOnSubmit(T view, boolean value);
|
|
24
|
+
void setCaretHidden(T view, boolean value);
|
|
25
|
+
void setClearButtonMode(T view, @Nullable String value);
|
|
26
|
+
void setClearTextOnFocus(T view, boolean value);
|
|
27
|
+
void setContextMenuHidden(T view, boolean value);
|
|
28
|
+
void setDefaultValue(T view, @Nullable String value);
|
|
29
|
+
void setDisableCopyPaste(T view, boolean value);
|
|
30
|
+
void setDisableFullscreenUI(T view, boolean value);
|
|
31
|
+
void setEditable(T view, boolean value);
|
|
32
|
+
void setEnablesReturnKeyAutomatically(T view, boolean value);
|
|
33
|
+
void setImportantForAutofill(T view, @Nullable String value);
|
|
34
|
+
void setInlineImageLeft(T view, @Nullable String value);
|
|
35
|
+
void setInlineImagePadding(T view, int value);
|
|
36
|
+
void setInputAccessoryViewID(T view, @Nullable String value);
|
|
37
|
+
void setKeyboardAppearance(T view, @Nullable String value);
|
|
38
|
+
void setKeyboardType(T view, @Nullable String value);
|
|
39
|
+
void setMaxFontSizeMultiplier(T view, float value);
|
|
40
|
+
void setMaxLength(T view, int value);
|
|
41
|
+
void setMostRecentEventCount(T view, int value);
|
|
42
|
+
void setMultiline(T view, boolean value);
|
|
43
|
+
void setNumberOfLines(T view, int value);
|
|
44
|
+
void setPasswordRules(T view, @Nullable String value);
|
|
45
|
+
void setPlaceholder(T view, @Nullable String value);
|
|
46
|
+
void setPlaceholderTextColor(T view, @Nullable Integer value);
|
|
47
|
+
void setReturnKeyLabel(T view, @Nullable String value);
|
|
48
|
+
void setReturnKeyType(T view, @Nullable String value);
|
|
49
|
+
void setScrollEnabled(T view, boolean value);
|
|
50
|
+
void setSecureTextEntry(T view, boolean value);
|
|
51
|
+
void setSelection(T view, @Nullable ReadableMap value);
|
|
52
|
+
void setSelectionColor(T view, @Nullable Integer value);
|
|
53
|
+
void setSelectionHandleColor(T view, @Nullable Integer value);
|
|
54
|
+
void setSelectTextOnFocus(T view, boolean value);
|
|
55
|
+
void setShowSoftInputOnFocus(T view, boolean value);
|
|
56
|
+
void setSmartInsertDelete(T view, boolean value);
|
|
57
|
+
void setSmartPunctuation(T view, @Nullable String value);
|
|
58
|
+
void setSpellCheck(T view, boolean value);
|
|
59
|
+
void setSubmitBehavior(T view, @Nullable String value);
|
|
60
|
+
void setText(T view, @Nullable String value);
|
|
61
|
+
void setTextBreakStrategy(T view, @Nullable String value);
|
|
62
|
+
void setTextContentType(T view, @Nullable String value);
|
|
63
|
+
void setUnderlineColorAndroid(T view, @Nullable Integer value);
|
|
64
|
+
void setValue(T view, @Nullable String value);
|
|
65
|
+
void setTextShadowColor(T view, @Nullable Integer value);
|
|
66
|
+
void setTextShadowRadius(T view, float value);
|
|
67
|
+
void setTextDecorationLine(T view, @Nullable String value);
|
|
68
|
+
void setFontStyle(T view, @Nullable String value);
|
|
69
|
+
void setTextShadowOffset(T view, @Nullable ReadableMap value);
|
|
70
|
+
void setLineHeight(T view, float value);
|
|
71
|
+
void setTextTransform(T view, @Nullable String value);
|
|
72
|
+
void setColor(T view, int value);
|
|
73
|
+
void setLetterSpacing(T view, float value);
|
|
74
|
+
void setFontSize(T view, float value);
|
|
75
|
+
void setTextAlign(T view, @Nullable String value);
|
|
76
|
+
void setIncludeFontPadding(T view, boolean value);
|
|
77
|
+
void setFontWeight(T view, @Nullable String value);
|
|
78
|
+
void setFontFamily(T view, @Nullable String value);
|
|
79
|
+
void setTextAlignVertical(T view, @Nullable String value);
|
|
80
|
+
void setCursorColor(T view, @Nullable Integer value);
|
|
81
|
+
void focus(T view);
|
|
82
|
+
void blur(T view);
|
|
83
|
+
void setTextAndSelection(T view, int mostRecentEventCount, String value, int start, int end);
|
|
84
|
+
}
|