@onekeyfe/react-native-auto-size-input 1.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/AutoSizeInput.podspec +29 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +128 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/autosizeinput/AutoSizeInput.kt +565 -0
- package/android/src/main/java/com/margelo/nitro/autosizeinput/AutoSizeInputPackage.kt +29 -0
- package/ios/AutoSizeInput.swift +620 -0
- package/lib/module/AutoSizeInput.nitro.js +4 -0
- package/lib/module/AutoSizeInput.nitro.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/nitrogen/generated/android/autosizeinput+autolinking.cmake +83 -0
- package/lib/nitrogen/generated/android/autosizeinput+autolinking.gradle +27 -0
- package/lib/nitrogen/generated/android/autosizeinputOnLoad.cpp +50 -0
- package/lib/nitrogen/generated/android/autosizeinputOnLoad.hpp +25 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +317 -0
- package/lib/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +117 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +156 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp +49 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt +80 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt +80 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +239 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt +35 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt +50 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt +23 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput+autolinking.rb +60 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp +49 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp +173 -0
- package/lib/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp +46 -0
- package/lib/nitrogen/generated/ios/AutoSizeInputAutolinking.mm +33 -0
- package/lib/nitrogen/generated/ios/AutoSizeInputAutolinking.swift +25 -0
- package/lib/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp +11 -0
- package/lib/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +263 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +221 -0
- package/lib/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +82 -0
- package/lib/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +764 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +74 -0
- package/lib/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +116 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +387 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +133 -0
- package/lib/nitrogen/generated/shared/json/AutoSizeInputConfig.json +35 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/AutoSizeInput.nitro.d.ts +35 -0
- package/lib/typescript/src/AutoSizeInput.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/autosizeinput+autolinking.cmake +83 -0
- package/nitrogen/generated/android/autosizeinput+autolinking.gradle +27 -0
- package/nitrogen/generated/android/autosizeinputOnLoad.cpp +50 -0
- package/nitrogen/generated/android/autosizeinputOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +317 -0
- package/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +117 -0
- package/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +156 -0
- package/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +239 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/AutoSizeInput+autolinking.rb +60 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp +173 -0
- package/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp +46 -0
- package/nitrogen/generated/ios/AutoSizeInputAutolinking.mm +33 -0
- package/nitrogen/generated/ios/AutoSizeInputAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +263 -0
- package/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +221 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +82 -0
- package/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +764 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +74 -0
- package/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +387 -0
- package/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +133 -0
- package/nitrogen/generated/shared/json/AutoSizeInputConfig.json +35 -0
- package/package.json +170 -0
- package/src/AutoSizeInput.nitro.ts +56 -0
- package/src/index.tsx +13 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridAutoSizeInputComponent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <optional>
|
|
11
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
12
|
+
#include <NitroModules/NitroHash.hpp>
|
|
13
|
+
#include <NitroModules/CachedProp.hpp>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
18
|
+
|
|
19
|
+
#include <string>
|
|
20
|
+
#include <optional>
|
|
21
|
+
#include <functional>
|
|
22
|
+
#include <memory>
|
|
23
|
+
#include "HybridAutoSizeInputSpec.hpp"
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::autosizeinput::views {
|
|
26
|
+
|
|
27
|
+
using namespace facebook;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The name of the actual native View.
|
|
31
|
+
*/
|
|
32
|
+
extern const char HybridAutoSizeInputComponentName[];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Props for the "AutoSizeInput" View.
|
|
36
|
+
*/
|
|
37
|
+
class HybridAutoSizeInputProps final: public react::ViewProps {
|
|
38
|
+
public:
|
|
39
|
+
HybridAutoSizeInputProps() = default;
|
|
40
|
+
HybridAutoSizeInputProps(const HybridAutoSizeInputProps&);
|
|
41
|
+
HybridAutoSizeInputProps(const react::PropsParserContext& context,
|
|
42
|
+
const HybridAutoSizeInputProps& sourceProps,
|
|
43
|
+
const react::RawProps& rawProps);
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
CachedProp<std::optional<std::string>> text;
|
|
47
|
+
CachedProp<std::optional<std::string>> prefix;
|
|
48
|
+
CachedProp<std::optional<std::string>> suffix;
|
|
49
|
+
CachedProp<std::optional<std::string>> placeholder;
|
|
50
|
+
CachedProp<std::optional<double>> fontSize;
|
|
51
|
+
CachedProp<std::optional<double>> minFontSize;
|
|
52
|
+
CachedProp<std::optional<bool>> multiline;
|
|
53
|
+
CachedProp<std::optional<double>> maxNumberOfLines;
|
|
54
|
+
CachedProp<std::optional<std::string>> textColor;
|
|
55
|
+
CachedProp<std::optional<std::string>> prefixColor;
|
|
56
|
+
CachedProp<std::optional<std::string>> suffixColor;
|
|
57
|
+
CachedProp<std::optional<std::string>> placeholderColor;
|
|
58
|
+
CachedProp<std::optional<std::string>> textAlign;
|
|
59
|
+
CachedProp<std::optional<std::string>> fontFamily;
|
|
60
|
+
CachedProp<std::optional<std::string>> fontWeight;
|
|
61
|
+
CachedProp<std::optional<bool>> editable;
|
|
62
|
+
CachedProp<std::optional<std::string>> keyboardType;
|
|
63
|
+
CachedProp<std::optional<std::string>> returnKeyType;
|
|
64
|
+
CachedProp<std::optional<bool>> autoCorrect;
|
|
65
|
+
CachedProp<std::optional<std::string>> autoCapitalize;
|
|
66
|
+
CachedProp<std::optional<std::string>> selectionColor;
|
|
67
|
+
CachedProp<std::optional<double>> prefixMarginRight;
|
|
68
|
+
CachedProp<std::optional<double>> suffixMarginLeft;
|
|
69
|
+
CachedProp<std::optional<std::function<void(const std::string& /* text */)>>> onChangeText;
|
|
70
|
+
CachedProp<std::optional<std::function<void()>>> onFocus;
|
|
71
|
+
CachedProp<std::optional<std::function<void()>>> onBlur;
|
|
72
|
+
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridAutoSizeInputSpec>& /* ref */)>>> hybridRef;
|
|
73
|
+
|
|
74
|
+
private:
|
|
75
|
+
static bool filterObjectKeys(const std::string& propName);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* State for the "AutoSizeInput" View.
|
|
80
|
+
*/
|
|
81
|
+
class HybridAutoSizeInputState final {
|
|
82
|
+
public:
|
|
83
|
+
HybridAutoSizeInputState() = default;
|
|
84
|
+
|
|
85
|
+
public:
|
|
86
|
+
void setProps(const HybridAutoSizeInputProps& props) { _props.emplace(props); }
|
|
87
|
+
const std::optional<HybridAutoSizeInputProps>& getProps() const { return _props; }
|
|
88
|
+
|
|
89
|
+
public:
|
|
90
|
+
#ifdef ANDROID
|
|
91
|
+
HybridAutoSizeInputState(const HybridAutoSizeInputState& /* previousState */, folly::dynamic /* data */) {}
|
|
92
|
+
folly::dynamic getDynamic() const {
|
|
93
|
+
throw std::runtime_error("HybridAutoSizeInputState does not support folly!");
|
|
94
|
+
}
|
|
95
|
+
react::MapBuffer getMapBuffer() const {
|
|
96
|
+
throw std::runtime_error("HybridAutoSizeInputState does not support MapBuffer!");
|
|
97
|
+
};
|
|
98
|
+
#endif
|
|
99
|
+
|
|
100
|
+
private:
|
|
101
|
+
std::optional<HybridAutoSizeInputProps> _props;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The Shadow Node for the "AutoSizeInput" View.
|
|
106
|
+
*/
|
|
107
|
+
using HybridAutoSizeInputShadowNode = react::ConcreteViewShadowNode<HybridAutoSizeInputComponentName /* "HybridAutoSizeInput" */,
|
|
108
|
+
HybridAutoSizeInputProps /* custom props */,
|
|
109
|
+
react::ViewEventEmitter /* default */,
|
|
110
|
+
HybridAutoSizeInputState /* custom state */>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The Component Descriptor for the "AutoSizeInput" View.
|
|
114
|
+
*/
|
|
115
|
+
class HybridAutoSizeInputComponentDescriptor final: public react::ConcreteComponentDescriptor<HybridAutoSizeInputShadowNode> {
|
|
116
|
+
public:
|
|
117
|
+
HybridAutoSizeInputComponentDescriptor(const react::ComponentDescriptorParameters& parameters);
|
|
118
|
+
|
|
119
|
+
public:
|
|
120
|
+
/**
|
|
121
|
+
* A faster path for cloning props - reuses the caching logic from `HybridAutoSizeInputProps`.
|
|
122
|
+
*/
|
|
123
|
+
std::shared_ptr<const react::Props> cloneProps(const react::PropsParserContext& context,
|
|
124
|
+
const std::shared_ptr<const react::Props>& props,
|
|
125
|
+
react::RawProps rawProps) const override;
|
|
126
|
+
#ifdef ANDROID
|
|
127
|
+
void adopt(react::ShadowNode& shadowNode) const override;
|
|
128
|
+
#endif
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/* The actual view for "AutoSizeInput" needs to be implemented in platform-specific code. */
|
|
132
|
+
|
|
133
|
+
} // namespace margelo::nitro::autosizeinput::views
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uiViewClassName": "AutoSizeInput",
|
|
3
|
+
"supportsRawText": false,
|
|
4
|
+
"bubblingEventTypes": {},
|
|
5
|
+
"directEventTypes": {},
|
|
6
|
+
"validAttributes": {
|
|
7
|
+
"text": true,
|
|
8
|
+
"prefix": true,
|
|
9
|
+
"suffix": true,
|
|
10
|
+
"placeholder": true,
|
|
11
|
+
"fontSize": true,
|
|
12
|
+
"minFontSize": true,
|
|
13
|
+
"multiline": true,
|
|
14
|
+
"maxNumberOfLines": true,
|
|
15
|
+
"textColor": true,
|
|
16
|
+
"prefixColor": true,
|
|
17
|
+
"suffixColor": true,
|
|
18
|
+
"placeholderColor": true,
|
|
19
|
+
"textAlign": true,
|
|
20
|
+
"fontFamily": true,
|
|
21
|
+
"fontWeight": true,
|
|
22
|
+
"editable": true,
|
|
23
|
+
"keyboardType": true,
|
|
24
|
+
"returnKeyType": true,
|
|
25
|
+
"autoCorrect": true,
|
|
26
|
+
"autoCapitalize": true,
|
|
27
|
+
"selectionColor": true,
|
|
28
|
+
"prefixMarginRight": true,
|
|
29
|
+
"suffixMarginLeft": true,
|
|
30
|
+
"onChangeText": true,
|
|
31
|
+
"onFocus": true,
|
|
32
|
+
"onBlur": true,
|
|
33
|
+
"hybridRef": true
|
|
34
|
+
}
|
|
35
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@onekeyfe/react-native-auto-size-input",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Auto-sizing text input with font scaling, prefix and suffix support",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"nitrogen",
|
|
22
|
+
"nitro.json",
|
|
23
|
+
"*.podspec",
|
|
24
|
+
"react-native.config.js",
|
|
25
|
+
"!ios/build",
|
|
26
|
+
"!android/build",
|
|
27
|
+
"!android/gradle",
|
|
28
|
+
"!android/gradlew",
|
|
29
|
+
"!android/gradlew.bat",
|
|
30
|
+
"!android/local.properties",
|
|
31
|
+
"!**/__tests__",
|
|
32
|
+
"!**/__fixtures__",
|
|
33
|
+
"!**/__mocks__",
|
|
34
|
+
"!**/.*"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
38
|
+
"prepare": "rm -rf lib && bob build && cp -r nitrogen lib/nitrogen",
|
|
39
|
+
"nitrogen": "nitrogen",
|
|
40
|
+
"typecheck": "tsc",
|
|
41
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
42
|
+
"test": "jest",
|
|
43
|
+
"release": "yarn nitrogen && yarn prepare && npm whoami && npm publish --access public"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"react-native",
|
|
47
|
+
"ios",
|
|
48
|
+
"android"
|
|
49
|
+
],
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules.git"
|
|
53
|
+
},
|
|
54
|
+
"author": "@onekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules#readme",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"registry": "https://registry.npmjs.org/"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
65
|
+
"@eslint/compat": "^1.3.2",
|
|
66
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
67
|
+
"@eslint/js": "^9.35.0",
|
|
68
|
+
"@react-native/babel-preset": "0.83.0",
|
|
69
|
+
"@react-native/eslint-config": "0.83.0",
|
|
70
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
71
|
+
"@types/jest": "^29.5.14",
|
|
72
|
+
"@types/react": "^19.2.0",
|
|
73
|
+
"commitlint": "^19.8.1",
|
|
74
|
+
"del-cli": "^6.0.0",
|
|
75
|
+
"eslint": "^9.35.0",
|
|
76
|
+
"eslint-config-prettier": "^10.1.8",
|
|
77
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
78
|
+
"jest": "^29.7.0",
|
|
79
|
+
"lefthook": "^2.0.3",
|
|
80
|
+
"nitrogen": "0.31.10",
|
|
81
|
+
"prettier": "^2.8.8",
|
|
82
|
+
"react": "19.2.0",
|
|
83
|
+
"react-native": "0.83.0",
|
|
84
|
+
"react-native-builder-bob": "^0.40.13",
|
|
85
|
+
"react-native-nitro-modules": "0.33.2",
|
|
86
|
+
"release-it": "^19.0.4",
|
|
87
|
+
"turbo": "^2.5.6",
|
|
88
|
+
"typescript": "^5.9.2"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"react": "*",
|
|
92
|
+
"react-native": "*",
|
|
93
|
+
"react-native-nitro-modules": "0.33.2"
|
|
94
|
+
},
|
|
95
|
+
"packageManager": "yarn@4.11.0",
|
|
96
|
+
"react-native-builder-bob": {
|
|
97
|
+
"source": "src",
|
|
98
|
+
"output": "lib",
|
|
99
|
+
"targets": [
|
|
100
|
+
[
|
|
101
|
+
"custom",
|
|
102
|
+
{
|
|
103
|
+
"script": "nitrogen",
|
|
104
|
+
"clean": "nitrogen/"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
"module",
|
|
109
|
+
{
|
|
110
|
+
"esm": true
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"typescript",
|
|
115
|
+
{
|
|
116
|
+
"project": "tsconfig.build.json"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"prettier": {
|
|
122
|
+
"quoteProps": "consistent",
|
|
123
|
+
"singleQuote": true,
|
|
124
|
+
"tabWidth": 2,
|
|
125
|
+
"trailingComma": "es5",
|
|
126
|
+
"useTabs": false
|
|
127
|
+
},
|
|
128
|
+
"jest": {
|
|
129
|
+
"preset": "react-native",
|
|
130
|
+
"modulePathIgnorePatterns": [
|
|
131
|
+
"<rootDir>/example/node_modules",
|
|
132
|
+
"<rootDir>/lib/"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"commitlint": {
|
|
136
|
+
"extends": [
|
|
137
|
+
"@commitlint/config-conventional"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"release-it": {
|
|
141
|
+
"git": {
|
|
142
|
+
"commitMessage": "chore: release ${version}",
|
|
143
|
+
"tagName": "v${version}"
|
|
144
|
+
},
|
|
145
|
+
"npm": {
|
|
146
|
+
"publish": true
|
|
147
|
+
},
|
|
148
|
+
"github": {
|
|
149
|
+
"release": true
|
|
150
|
+
},
|
|
151
|
+
"plugins": {
|
|
152
|
+
"@release-it/conventional-changelog": {
|
|
153
|
+
"preset": {
|
|
154
|
+
"name": "angular"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"create-react-native-library": {
|
|
160
|
+
"type": "nitro-view",
|
|
161
|
+
"languages": "kotlin-swift",
|
|
162
|
+
"tools": [
|
|
163
|
+
"eslint",
|
|
164
|
+
"jest",
|
|
165
|
+
"lefthook",
|
|
166
|
+
"release-it"
|
|
167
|
+
],
|
|
168
|
+
"version": "0.56.0"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
HybridView,
|
|
3
|
+
HybridViewMethods,
|
|
4
|
+
HybridViewProps,
|
|
5
|
+
} from 'react-native-nitro-modules';
|
|
6
|
+
|
|
7
|
+
export interface AutoSizeInputProps extends HybridViewProps {
|
|
8
|
+
// Text content
|
|
9
|
+
text?: string;
|
|
10
|
+
prefix?: string;
|
|
11
|
+
suffix?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
|
|
14
|
+
// Font size control
|
|
15
|
+
fontSize?: number;
|
|
16
|
+
minFontSize?: number;
|
|
17
|
+
|
|
18
|
+
// Multiline support
|
|
19
|
+
multiline?: boolean;
|
|
20
|
+
maxNumberOfLines?: number;
|
|
21
|
+
|
|
22
|
+
// Styles
|
|
23
|
+
textColor?: string;
|
|
24
|
+
prefixColor?: string;
|
|
25
|
+
suffixColor?: string;
|
|
26
|
+
placeholderColor?: string;
|
|
27
|
+
textAlign?: string;
|
|
28
|
+
fontFamily?: string;
|
|
29
|
+
fontWeight?: string;
|
|
30
|
+
|
|
31
|
+
// Editable
|
|
32
|
+
editable?: boolean;
|
|
33
|
+
|
|
34
|
+
// Keyboard & input behavior
|
|
35
|
+
keyboardType?: string;
|
|
36
|
+
returnKeyType?: string;
|
|
37
|
+
autoCorrect?: boolean;
|
|
38
|
+
autoCapitalize?: string;
|
|
39
|
+
selectionColor?: string;
|
|
40
|
+
|
|
41
|
+
// Spacing
|
|
42
|
+
prefixMarginRight?: number;
|
|
43
|
+
suffixMarginLeft?: number;
|
|
44
|
+
|
|
45
|
+
// Event callbacks
|
|
46
|
+
onChangeText?: (text: string) => void;
|
|
47
|
+
onFocus?: () => void;
|
|
48
|
+
onBlur?: () => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface AutoSizeInputMethods extends HybridViewMethods {
|
|
52
|
+
focus(): void;
|
|
53
|
+
blur(): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type AutoSizeInput = HybridView<AutoSizeInputProps, AutoSizeInputMethods>;
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getHostComponent } from 'react-native-nitro-modules';
|
|
2
|
+
const AutoSizeInputConfig = require('../nitrogen/generated/shared/json/AutoSizeInputConfig.json');
|
|
3
|
+
import type {
|
|
4
|
+
AutoSizeInputMethods,
|
|
5
|
+
AutoSizeInputProps,
|
|
6
|
+
} from './AutoSizeInput.nitro';
|
|
7
|
+
|
|
8
|
+
export type { AutoSizeInputMethods, AutoSizeInputProps };
|
|
9
|
+
|
|
10
|
+
export const AutoSizeInputView = getHostComponent<
|
|
11
|
+
AutoSizeInputProps,
|
|
12
|
+
AutoSizeInputMethods
|
|
13
|
+
>('AutoSizeInput', () => AutoSizeInputConfig);
|