react-native-transformer-text-input 0.1.0-alpha.3 → 0.1.0-alpha.5
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/README.md +0 -4
- package/RNTransformerTextInput.podspec +6 -0
- package/ios/TransformerTextInputDecoratorView.mm +13 -2
- package/ios/TransformerTextInputModule.mm +1 -1
- package/lib/module/formatters/phone-data.js +4844 -0
- package/lib/module/formatters/phone-data.js.map +1 -0
- package/lib/module/formatters/phone-number.js +323 -61
- package/lib/module/formatters/phone-number.js.map +1 -1
- package/lib/typescript/scripts/generate-phone-data.d.ts +7 -0
- package/lib/typescript/scripts/generate-phone-data.d.ts.map +1 -0
- package/lib/typescript/src/formatters/phone-data.d.ts +15 -0
- package/lib/typescript/src/formatters/phone-data.d.ts.map +1 -0
- package/lib/typescript/src/formatters/phone-number.d.ts +10 -4
- package/lib/typescript/src/formatters/phone-number.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/formatters/phone-data.ts +5665 -0
- package/src/formatters/phone-number.ts +326 -68
package/README.md
CHANGED
|
@@ -150,10 +150,6 @@ const phoneTransformer = new PhoneNumberTransformer({
|
|
|
150
150
|
/>
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
## AI Disclosure
|
|
154
|
-
|
|
155
|
-
Code in this repository is thought through and mostly written by humans, with AI used to improve clarity, consistency, and implementation details.
|
|
156
|
-
|
|
157
153
|
## Acknowledgments
|
|
158
154
|
|
|
159
155
|
- [react-native-live-markdown](https://github.com/Expensify/react-native-live-markdown) and [react-native-advanced-input-mask](https://github.com/IvanIhnatsiuk/react-native-advanced-input-mask) for examples of how to extend TextInput.
|
|
@@ -3,6 +3,11 @@ require "json"
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
4
|
|
|
5
5
|
pods_root = Pod::Config.instance.project_pods_root
|
|
6
|
+
|
|
7
|
+
react_native_node_modules_dir = File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`)
|
|
8
|
+
react_native_common_dir_absolute = File.join(react_native_node_modules_dir, 'ReactCommon')
|
|
9
|
+
react_native_common_dir = Pathname.new(react_native_common_dir_absolute).relative_path_from(pods_root).to_s
|
|
10
|
+
|
|
6
11
|
react_native_worklets_node_modules_dir = ENV['REACT_NATIVE_WORKLETS_NODE_MODULES_DIR'] ||
|
|
7
12
|
File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native-worklets/package.json')"`)
|
|
8
13
|
react_native_worklets_node_modules_dir_from_pods_root = Pathname.new(react_native_worklets_node_modules_dir).relative_path_from(pods_root).to_s
|
|
@@ -28,6 +33,7 @@ Pod::Spec.new do |s|
|
|
|
28
33
|
|
|
29
34
|
s.xcconfig = {
|
|
30
35
|
"HEADER_SEARCH_PATHS" => [
|
|
36
|
+
"\"$(PODS_ROOT)/#{react_native_common_dir}\"",
|
|
31
37
|
"\"$(PODS_ROOT)/#{react_native_worklets_node_modules_dir_from_pods_root}/apple\"",
|
|
32
38
|
"\"$(PODS_ROOT)/#{react_native_worklets_node_modules_dir_from_pods_root}/Common/cpp\"",
|
|
33
39
|
].join(' '),
|
|
@@ -150,7 +150,11 @@ struct RNTTITextState {
|
|
|
150
150
|
[textInputComponentView valueForKey:@"_backedTextInputView"];
|
|
151
151
|
|
|
152
152
|
_backedTextInput = backedTextInputView;
|
|
153
|
-
|
|
153
|
+
id<RCTBackedTextInputDelegate> currentDelegate = backedTextInputView.textInputDelegate;
|
|
154
|
+
// Guard against setting ourselves as baseDelegate (would cause infinite recursion)
|
|
155
|
+
if (currentDelegate != self) {
|
|
156
|
+
_baseDelegate = currentDelegate;
|
|
157
|
+
}
|
|
154
158
|
backedTextInputView.textInputDelegate = self;
|
|
155
159
|
|
|
156
160
|
_observersAdded = true;
|
|
@@ -158,6 +162,9 @@ struct RNTTITextState {
|
|
|
158
162
|
|
|
159
163
|
- (void)removeTextInputObservers
|
|
160
164
|
{
|
|
165
|
+
if (_backedTextInput && _baseDelegate) {
|
|
166
|
+
_backedTextInput.textInputDelegate = _baseDelegate;
|
|
167
|
+
}
|
|
161
168
|
_backedTextInput = nil;
|
|
162
169
|
_baseDelegate = nil;
|
|
163
170
|
_observersAdded = false;
|
|
@@ -204,7 +211,11 @@ struct RNTTITextState {
|
|
|
204
211
|
|
|
205
212
|
- (BOOL)textInputShouldBeginEditing
|
|
206
213
|
{
|
|
207
|
-
|
|
214
|
+
id<RCTBackedTextInputDelegate> delegate = _baseDelegate;
|
|
215
|
+
if (delegate == nil || delegate == self) {
|
|
216
|
+
return YES;
|
|
217
|
+
}
|
|
218
|
+
return [delegate textInputShouldBeginEditing];
|
|
208
219
|
}
|
|
209
220
|
|
|
210
221
|
- (nonnull NSString *)textInputShouldChangeText:(nonnull NSString *)text inRange:(NSRange)range
|