react-native-enriched 0.2.0 → 0.3.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/README.md +16 -17
- package/android/build.gradle +77 -72
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerDelegate.java +21 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedTextInputViewManagerInterface.java +7 -0
- package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/EventEmitters.cpp +156 -0
- package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/EventEmitters.h +147 -0
- package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/Props.cpp +10 -0
- package/android/generated/jni/react/renderer/components/RNEnrichedTextInputViewSpec/Props.h +194 -0
- package/android/lint.gradle +70 -0
- package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputConnectionWrapper.kt +140 -0
- package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputView.kt +304 -83
- package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewLayoutManager.kt +3 -1
- package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewManager.kt +166 -51
- package/android/src/main/java/com/swmansion/enriched/EnrichedTextInputViewPackage.kt +1 -3
- package/android/src/main/java/com/swmansion/enriched/MeasurementStore.kt +70 -21
- package/android/src/main/java/com/swmansion/enriched/events/MentionHandler.kt +21 -11
- package/android/src/main/java/com/swmansion/enriched/events/OnChangeHtmlEvent.kt +8 -9
- package/android/src/main/java/com/swmansion/enriched/events/OnChangeSelectionEvent.kt +10 -9
- package/android/src/main/java/com/swmansion/enriched/events/OnChangeStateDeprecatedEvent.kt +21 -0
- package/android/src/main/java/com/swmansion/enriched/events/OnChangeStateEvent.kt +9 -12
- package/android/src/main/java/com/swmansion/enriched/events/OnChangeTextEvent.kt +10 -10
- package/android/src/main/java/com/swmansion/enriched/events/OnInputBlurEvent.kt +7 -9
- package/android/src/main/java/com/swmansion/enriched/events/OnInputFocusEvent.kt +7 -9
- package/android/src/main/java/com/swmansion/enriched/events/OnInputKeyPressEvent.kt +27 -0
- package/android/src/main/java/com/swmansion/enriched/events/OnLinkDetectedEvent.kt +13 -11
- package/android/src/main/java/com/swmansion/enriched/events/OnMentionDetectedEvent.kt +10 -9
- package/android/src/main/java/com/swmansion/enriched/events/OnMentionEvent.kt +9 -8
- package/android/src/main/java/com/swmansion/enriched/events/OnRequestHtmlResultEvent.kt +32 -0
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedBlockQuoteSpan.kt +24 -5
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedBoldSpan.kt +8 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedCodeBlockSpan.kt +10 -2
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH1Span.kt +8 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH2Span.kt +8 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH3Span.kt +8 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH4Span.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH5Span.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedH6Span.kt +24 -0
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedImageSpan.kt +34 -17
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedInlineCodeSpan.kt +8 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedItalicSpan.kt +7 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedLinkSpan.kt +10 -4
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedMentionSpan.kt +14 -11
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedOrderedListSpan.kt +18 -11
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedSpans.kt +174 -72
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedStrikeThroughSpan.kt +7 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedUnderlineSpan.kt +7 -1
- package/android/src/main/java/com/swmansion/enriched/spans/EnrichedUnorderedListSpan.kt +11 -5
- package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedBlockSpan.kt +3 -2
- package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedHeadingSpan.kt +1 -2
- package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedInlineSpan.kt +1 -2
- package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedParagraphSpan.kt +3 -2
- package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedSpan.kt +5 -0
- package/android/src/main/java/com/swmansion/enriched/spans/interfaces/EnrichedZeroWidthSpaceSpan.kt +1 -2
- package/android/src/main/java/com/swmansion/enriched/spans/utils/ForceRedrawSpan.kt +2 -1
- package/android/src/main/java/com/swmansion/enriched/styles/HtmlStyle.kt +155 -20
- package/android/src/main/java/com/swmansion/enriched/styles/InlineStyles.kt +25 -8
- package/android/src/main/java/com/swmansion/enriched/styles/ListStyles.kt +60 -20
- package/android/src/main/java/com/swmansion/enriched/styles/ParagraphStyles.kt +161 -25
- package/android/src/main/java/com/swmansion/enriched/styles/ParametrizedStyles.kt +128 -52
- package/android/src/main/java/com/swmansion/enriched/utils/AsyncDrawable.kt +10 -7
- package/android/src/main/java/com/swmansion/enriched/utils/EnrichedConstants.kt +11 -0
- package/android/src/main/java/com/swmansion/enriched/utils/EnrichedEditableFactory.kt +17 -0
- package/android/src/main/java/com/swmansion/enriched/utils/EnrichedParser.java +136 -87
- package/android/src/main/java/com/swmansion/enriched/utils/EnrichedSelection.kt +71 -42
- package/android/src/main/java/com/swmansion/enriched/utils/EnrichedSpanState.kt +183 -48
- package/android/src/main/java/com/swmansion/enriched/utils/EnrichedSpannable.kt +82 -0
- package/android/src/main/java/com/swmansion/enriched/utils/EnrichedSpannableStringBuilder.kt +15 -0
- package/android/src/main/java/com/swmansion/enriched/utils/Utils.kt +0 -70
- package/android/src/main/java/com/swmansion/enriched/watchers/EnrichedSpanWatcher.kt +46 -14
- package/android/src/main/java/com/swmansion/enriched/watchers/EnrichedTextWatcher.kt +34 -11
- package/android/src/main/new_arch/CMakeLists.txt +6 -0
- package/android/src/main/new_arch/RNEnrichedTextInputViewSpec.cpp +6 -6
- package/android/src/main/new_arch/RNEnrichedTextInputViewSpec.h +6 -6
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputComponentDescriptor.h +19 -19
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.cpp +40 -51
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputMeasurementManager.h +13 -15
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.cpp +23 -21
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputShadowNode.h +35 -36
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.cpp +4 -4
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/EnrichedTextInputState.h +13 -14
- package/android/src/main/new_arch/react/renderer/components/RNEnrichedTextInputViewSpec/conversions.h +33 -14
- package/ios/EnrichedTextInputView.h +26 -14
- package/ios/EnrichedTextInputView.mm +1209 -586
- package/ios/config/InputConfig.h +24 -6
- package/ios/config/InputConfig.mm +154 -38
- package/ios/{utils → extensions}/ColorExtension.mm +7 -5
- package/ios/extensions/FontExtension.mm +106 -0
- package/ios/{utils → extensions}/LayoutManagerExtension.h +1 -1
- package/ios/extensions/LayoutManagerExtension.mm +396 -0
- package/ios/{utils → extensions}/StringExtension.mm +19 -16
- package/ios/generated/RNEnrichedTextInputViewSpec/EventEmitters.cpp +156 -0
- package/ios/generated/RNEnrichedTextInputViewSpec/EventEmitters.h +147 -0
- package/ios/generated/RNEnrichedTextInputViewSpec/Props.cpp +10 -0
- package/ios/generated/RNEnrichedTextInputViewSpec/Props.h +194 -0
- package/ios/generated/RNEnrichedTextInputViewSpec/RCTComponentViewHelpers.h +95 -0
- package/ios/inputParser/InputParser.h +5 -5
- package/ios/inputParser/InputParser.mm +864 -380
- package/ios/inputTextView/InputTextView.h +1 -1
- package/ios/inputTextView/InputTextView.mm +100 -59
- package/ios/{utils → interfaces}/BaseStyleProtocol.h +2 -2
- package/ios/interfaces/ImageAttachment.h +10 -0
- package/ios/interfaces/ImageAttachment.mm +36 -0
- package/ios/interfaces/LinkRegexConfig.h +19 -0
- package/ios/interfaces/LinkRegexConfig.mm +37 -0
- package/ios/interfaces/MediaAttachment.h +23 -0
- package/ios/interfaces/MediaAttachment.mm +31 -0
- package/ios/{utils → interfaces}/MentionParams.h +0 -1
- package/ios/{utils → interfaces}/MentionStyleProps.mm +27 -20
- package/ios/{utils → interfaces}/StyleHeaders.h +37 -15
- package/ios/{utils → interfaces}/StyleTypeEnum.h +3 -0
- package/ios/internals/EnrichedTextInputViewComponentDescriptor.h +11 -9
- package/ios/internals/EnrichedTextInputViewShadowNode.h +28 -25
- package/ios/internals/EnrichedTextInputViewShadowNode.mm +45 -40
- package/ios/internals/EnrichedTextInputViewState.h +3 -1
- package/ios/styles/BlockQuoteStyle.mm +189 -118
- package/ios/styles/BoldStyle.mm +110 -63
- package/ios/styles/CodeBlockStyle.mm +204 -128
- package/ios/styles/H1Style.mm +10 -4
- package/ios/styles/H2Style.mm +10 -4
- package/ios/styles/H3Style.mm +10 -4
- package/ios/styles/H4Style.mm +17 -0
- package/ios/styles/H5Style.mm +17 -0
- package/ios/styles/H6Style.mm +17 -0
- package/ios/styles/HeadingStyleBase.mm +148 -86
- package/ios/styles/ImageStyle.mm +75 -73
- package/ios/styles/InlineCodeStyle.mm +162 -88
- package/ios/styles/ItalicStyle.mm +76 -52
- package/ios/styles/LinkStyle.mm +411 -232
- package/ios/styles/MentionStyle.mm +363 -246
- package/ios/styles/OrderedListStyle.mm +171 -106
- package/ios/styles/StrikethroughStyle.mm +52 -35
- package/ios/styles/UnderlineStyle.mm +68 -46
- package/ios/styles/UnorderedListStyle.mm +169 -106
- package/ios/utils/OccurenceUtils.h +42 -42
- package/ios/utils/OccurenceUtils.mm +142 -119
- package/ios/utils/ParagraphAttributesUtils.h +10 -2
- package/ios/utils/ParagraphAttributesUtils.mm +182 -71
- package/ios/utils/ParagraphsUtils.h +2 -1
- package/ios/utils/ParagraphsUtils.mm +41 -27
- package/ios/utils/TextInsertionUtils.h +13 -2
- package/ios/utils/TextInsertionUtils.mm +38 -20
- package/ios/utils/WordsUtils.h +2 -1
- package/ios/utils/WordsUtils.mm +32 -22
- package/ios/utils/ZeroWidthSpaceUtils.h +3 -1
- package/ios/utils/ZeroWidthSpaceUtils.mm +145 -79
- package/lib/module/EnrichedTextInput.js +61 -2
- package/lib/module/EnrichedTextInput.js.map +1 -1
- package/lib/module/EnrichedTextInputNativeComponent.ts +149 -12
- package/lib/module/{normalizeHtmlStyle.js → utils/normalizeHtmlStyle.js} +12 -0
- package/lib/module/utils/normalizeHtmlStyle.js.map +1 -0
- package/lib/module/utils/regexParser.js +46 -0
- package/lib/module/utils/regexParser.js.map +1 -0
- package/lib/typescript/src/EnrichedTextInput.d.ts +24 -14
- package/lib/typescript/src/EnrichedTextInput.d.ts.map +1 -1
- package/lib/typescript/src/EnrichedTextInputNativeComponent.d.ts +129 -12
- package/lib/typescript/src/EnrichedTextInputNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts +4 -0
- package/lib/typescript/src/utils/normalizeHtmlStyle.d.ts.map +1 -0
- package/lib/typescript/src/utils/regexParser.d.ts +3 -0
- package/lib/typescript/src/utils/regexParser.d.ts.map +1 -0
- package/package.json +17 -6
- package/src/EnrichedTextInput.tsx +96 -13
- package/src/EnrichedTextInputNativeComponent.ts +149 -12
- package/src/index.tsx +2 -0
- package/src/{normalizeHtmlStyle.ts → utils/normalizeHtmlStyle.ts} +14 -2
- package/src/utils/regexParser.ts +56 -0
- package/ios/utils/FontExtension.mm +0 -91
- package/ios/utils/LayoutManagerExtension.mm +0 -286
- package/lib/module/normalizeHtmlStyle.js.map +0 -1
- package/lib/typescript/src/normalizeHtmlStyle.d.ts +0 -4
- package/lib/typescript/src/normalizeHtmlStyle.d.ts.map +0 -1
- package/ios/{utils → extensions}/ColorExtension.h +0 -0
- package/ios/{utils → extensions}/FontExtension.h +0 -0
- package/ios/{utils → extensions}/StringExtension.h +1 -1
- package/ios/{utils → interfaces}/ImageData.h +0 -0
- package/ios/{utils → interfaces}/ImageData.mm +0 -0
- package/ios/{utils → interfaces}/LinkData.h +0 -0
- package/ios/{utils → interfaces}/LinkData.mm +0 -0
- package/ios/{utils → interfaces}/MentionParams.mm +0 -0
- package/ios/{utils → interfaces}/MentionStyleProps.h +1 -1
- /package/ios/{utils → interfaces}/StylePair.h +0 -0
- /package/ios/{utils → interfaces}/StylePair.mm +0 -0
- /package/ios/{utils → interfaces}/TextDecorationLineEnum.h +0 -0
- /package/ios/{utils → interfaces}/TextDecorationLineEnum.mm +0 -0
|
@@ -1,114 +1,155 @@
|
|
|
1
1
|
#import "InputTextView.h"
|
|
2
2
|
#import "EnrichedTextInputView.h"
|
|
3
3
|
#import "StringExtension.h"
|
|
4
|
-
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
|
|
5
4
|
#import "TextInsertionUtils.h"
|
|
5
|
+
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
|
|
6
6
|
|
|
7
7
|
@implementation InputTextView
|
|
8
8
|
|
|
9
9
|
- (void)copy:(id)sender {
|
|
10
10
|
EnrichedTextInputView *typedInput = (EnrichedTextInputView *)_input;
|
|
11
|
-
if(typedInput == nullptr) {
|
|
12
|
-
|
|
11
|
+
if (typedInput == nullptr) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
13
15
|
// remove zero width spaces before copying the text
|
|
14
|
-
NSString *plainText = [typedInput->textView.textStorage.string
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
NSString *plainText = [typedInput->textView.textStorage.string
|
|
17
|
+
substringWithRange:typedInput->textView.selectedRange];
|
|
18
|
+
NSString *fixedPlainText =
|
|
19
|
+
[plainText stringByReplacingOccurrencesOfString:@"\u200B" withString:@""];
|
|
20
|
+
|
|
21
|
+
NSString *parsedHtml = [typedInput->parser
|
|
22
|
+
parseToHtmlFromRange:typedInput->textView.selectedRange];
|
|
23
|
+
|
|
24
|
+
NSMutableAttributedString *attrStr = [[typedInput->textView.textStorage
|
|
25
|
+
attributedSubstringFromRange:typedInput->textView.selectedRange]
|
|
26
|
+
mutableCopy];
|
|
20
27
|
NSRange fullAttrStrRange = NSMakeRange(0, attrStr.length);
|
|
21
|
-
[attrStr.mutableString replaceOccurrencesOfString:@"\u200B"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
[attrStr.mutableString replaceOccurrencesOfString:@"\u200B"
|
|
29
|
+
withString:@""
|
|
30
|
+
options:0
|
|
31
|
+
range:fullAttrStrRange];
|
|
32
|
+
|
|
33
|
+
NSData *rtfData =
|
|
34
|
+
[attrStr dataFromRange:NSMakeRange(0, attrStr.length)
|
|
35
|
+
documentAttributes:@{
|
|
36
|
+
NSDocumentTypeDocumentAttribute : NSRTFTextDocumentType
|
|
37
|
+
}
|
|
38
|
+
error:nullptr];
|
|
39
|
+
|
|
28
40
|
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
|
29
|
-
[pasteboard setItems:@[@{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
[pasteboard setItems:@[ @{
|
|
42
|
+
UTTypeUTF8PlainText.identifier : fixedPlainText,
|
|
43
|
+
UTTypeHTML.identifier : parsedHtml,
|
|
44
|
+
UTTypeRTF.identifier : rtfData
|
|
45
|
+
} ]];
|
|
34
46
|
}
|
|
35
47
|
|
|
36
48
|
- (void)paste:(id)sender {
|
|
37
49
|
EnrichedTextInputView *typedInput = (EnrichedTextInputView *)_input;
|
|
38
|
-
if(typedInput == nullptr) {
|
|
50
|
+
if (typedInput == nullptr) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
39
53
|
|
|
40
54
|
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
|
41
55
|
NSArray<NSString *> *pasteboardTypes = pasteboard.pasteboardTypes;
|
|
42
56
|
NSRange currentRange = typedInput->textView.selectedRange;
|
|
43
|
-
|
|
44
|
-
if([pasteboardTypes containsObject:UTTypeHTML.identifier]) {
|
|
57
|
+
|
|
58
|
+
if ([pasteboardTypes containsObject:UTTypeHTML.identifier]) {
|
|
45
59
|
// we try processing the html contents
|
|
46
|
-
|
|
60
|
+
|
|
47
61
|
NSString *htmlString;
|
|
48
62
|
id htmlValue = [pasteboard valueForPasteboardType:UTTypeHTML.identifier];
|
|
49
|
-
|
|
50
|
-
if([htmlValue isKindOfClass:[NSData class]]) {
|
|
51
|
-
htmlString = [[NSString alloc]initWithData:htmlValue
|
|
52
|
-
|
|
63
|
+
|
|
64
|
+
if ([htmlValue isKindOfClass:[NSData class]]) {
|
|
65
|
+
htmlString = [[NSString alloc] initWithData:htmlValue
|
|
66
|
+
encoding:NSUTF8StringEncoding];
|
|
67
|
+
} else if ([htmlValue isKindOfClass:[NSString class]]) {
|
|
53
68
|
htmlString = htmlValue;
|
|
54
69
|
}
|
|
55
|
-
|
|
70
|
+
|
|
56
71
|
// validate the html
|
|
57
|
-
NSString *initiallyProcessedHtml =
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
NSString *initiallyProcessedHtml =
|
|
73
|
+
[typedInput->parser initiallyProcessHtml:htmlString];
|
|
74
|
+
|
|
75
|
+
if (initiallyProcessedHtml != nullptr) {
|
|
60
76
|
// valid html, let's apply it
|
|
61
77
|
currentRange.length > 0
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
? [typedInput->parser replaceFromHtml:initiallyProcessedHtml
|
|
79
|
+
range:currentRange]
|
|
80
|
+
: [typedInput->parser insertFromHtml:initiallyProcessedHtml
|
|
81
|
+
location:currentRange.location];
|
|
64
82
|
} else {
|
|
65
83
|
// fall back to plain text, otherwise do nothing
|
|
66
|
-
[self tryHandlingPlainTextItemsIn:pasteboard
|
|
84
|
+
[self tryHandlingPlainTextItemsIn:pasteboard
|
|
85
|
+
range:currentRange
|
|
86
|
+
input:typedInput];
|
|
67
87
|
}
|
|
68
88
|
} else {
|
|
69
|
-
[self tryHandlingPlainTextItemsIn:pasteboard
|
|
89
|
+
[self tryHandlingPlainTextItemsIn:pasteboard
|
|
90
|
+
range:currentRange
|
|
91
|
+
input:typedInput];
|
|
70
92
|
}
|
|
71
|
-
|
|
93
|
+
|
|
72
94
|
[typedInput anyTextMayHaveBeenModified];
|
|
73
95
|
}
|
|
74
96
|
|
|
75
|
-
- (void)tryHandlingPlainTextItemsIn:(UIPasteboard *)pasteboard
|
|
97
|
+
- (void)tryHandlingPlainTextItemsIn:(UIPasteboard *)pasteboard
|
|
98
|
+
range:(NSRange)range
|
|
99
|
+
input:(EnrichedTextInputView *)input {
|
|
76
100
|
NSArray *existingTypes = pasteboard.pasteboardTypes;
|
|
77
|
-
NSArray *handledTypes = @[
|
|
101
|
+
NSArray *handledTypes = @[
|
|
102
|
+
UTTypeUTF8PlainText.identifier, UTTypePlainText.identifier,
|
|
103
|
+
UTTypeURL.identifier
|
|
104
|
+
];
|
|
78
105
|
NSString *plainText;
|
|
79
|
-
|
|
80
|
-
for(NSString *type in handledTypes) {
|
|
81
|
-
if(![existingTypes containsObject:type]) {
|
|
106
|
+
|
|
107
|
+
for (NSString *type in handledTypes) {
|
|
108
|
+
if (![existingTypes containsObject:type]) {
|
|
82
109
|
continue;
|
|
83
110
|
}
|
|
84
|
-
|
|
111
|
+
|
|
85
112
|
id value = [pasteboard valueForPasteboardType:type];
|
|
86
|
-
|
|
87
|
-
if([value isKindOfClass:[NSData class]]) {
|
|
88
|
-
plainText = [[NSString alloc]initWithData:value
|
|
89
|
-
|
|
113
|
+
|
|
114
|
+
if ([value isKindOfClass:[NSData class]]) {
|
|
115
|
+
plainText = [[NSString alloc] initWithData:value
|
|
116
|
+
encoding:NSUTF8StringEncoding];
|
|
117
|
+
} else if ([value isKindOfClass:[NSString class]]) {
|
|
90
118
|
plainText = (NSString *)value;
|
|
91
|
-
} else if([value isKindOfClass:[NSURL class]]) {
|
|
119
|
+
} else if ([value isKindOfClass:[NSURL class]]) {
|
|
92
120
|
plainText = [(NSURL *)value absoluteString];
|
|
93
121
|
}
|
|
94
122
|
}
|
|
95
|
-
|
|
96
|
-
if(!plainText) {
|
|
123
|
+
|
|
124
|
+
if (!plainText) {
|
|
97
125
|
return;
|
|
98
126
|
}
|
|
99
|
-
|
|
100
|
-
range.length > 0
|
|
101
|
-
|
|
102
|
-
|
|
127
|
+
|
|
128
|
+
range.length > 0 ? [TextInsertionUtils replaceText:plainText
|
|
129
|
+
at:range
|
|
130
|
+
additionalAttributes:nullptr
|
|
131
|
+
input:input
|
|
132
|
+
withSelection:YES]
|
|
133
|
+
: [TextInsertionUtils insertText:plainText
|
|
134
|
+
at:range.location
|
|
135
|
+
additionalAttributes:nullptr
|
|
136
|
+
input:input
|
|
137
|
+
withSelection:YES];
|
|
103
138
|
}
|
|
104
139
|
|
|
105
140
|
- (void)cut:(id)sender {
|
|
106
141
|
EnrichedTextInputView *typedInput = (EnrichedTextInputView *)_input;
|
|
107
|
-
if(typedInput == nullptr) {
|
|
108
|
-
|
|
142
|
+
if (typedInput == nullptr) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
109
146
|
[self copy:sender];
|
|
110
|
-
[TextInsertionUtils replaceText:@""
|
|
111
|
-
|
|
147
|
+
[TextInsertionUtils replaceText:@""
|
|
148
|
+
at:typedInput->textView.selectedRange
|
|
149
|
+
additionalAttributes:nullptr
|
|
150
|
+
input:typedInput
|
|
151
|
+
withSelection:YES];
|
|
152
|
+
|
|
112
153
|
[typedInput anyTextMayHaveBeenModified];
|
|
113
154
|
}
|
|
114
155
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#pragma once
|
|
2
|
-
#import "StyleTypeEnum.h"
|
|
3
2
|
#import "StylePair.h"
|
|
3
|
+
#import "StyleTypeEnum.h"
|
|
4
4
|
|
|
5
5
|
@protocol BaseStyleProtocol <NSObject>
|
|
6
6
|
+ (StyleType)getStyleType;
|
|
7
7
|
+ (BOOL)isParagraphStyle;
|
|
8
8
|
- (instancetype _Nonnull)initWithInput:(id _Nonnull)input;
|
|
9
9
|
- (void)applyStyle:(NSRange)range;
|
|
10
|
-
- (void)addAttributes:(NSRange)range;
|
|
10
|
+
- (void)addAttributes:(NSRange)range withTypingAttr:(BOOL)withTypingAttr;
|
|
11
11
|
- (void)removeAttributes:(NSRange)range;
|
|
12
12
|
- (void)addTypingAttributes;
|
|
13
13
|
- (void)removeTypingAttributes;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#import "ImageAttachment.h"
|
|
2
|
+
|
|
3
|
+
@implementation ImageAttachment
|
|
4
|
+
|
|
5
|
+
- (instancetype)initWithImageData:(ImageData *)data {
|
|
6
|
+
self = [super initWithURI:data.uri width:data.width height:data.height];
|
|
7
|
+
if (!self)
|
|
8
|
+
return nil;
|
|
9
|
+
|
|
10
|
+
_imageData = data;
|
|
11
|
+
self.image = [UIImage new];
|
|
12
|
+
|
|
13
|
+
[self loadAsync];
|
|
14
|
+
return self;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
- (void)loadAsync {
|
|
18
|
+
NSURL *url = [NSURL URLWithString:self.uri];
|
|
19
|
+
if (!url) {
|
|
20
|
+
self.image = [UIImage systemImageNamed:@"file"];
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
|
25
|
+
NSData *bytes = [NSData dataWithContentsOfURL:url];
|
|
26
|
+
UIImage *img = bytes ? [UIImage imageWithData:bytes]
|
|
27
|
+
: [UIImage systemImageNamed:@"file"];
|
|
28
|
+
|
|
29
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
30
|
+
self.image = img;
|
|
31
|
+
[self notifyUpdate];
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#import <ReactNativeEnriched/Props.h>
|
|
3
|
+
#import <UIKit/UIKit.h>
|
|
4
|
+
|
|
5
|
+
using namespace facebook::react;
|
|
6
|
+
|
|
7
|
+
@interface LinkRegexConfig : NSObject
|
|
8
|
+
|
|
9
|
+
@property NSString *pattern;
|
|
10
|
+
@property BOOL caseInsensitive;
|
|
11
|
+
@property BOOL dotAll;
|
|
12
|
+
@property BOOL isDisabled;
|
|
13
|
+
@property BOOL isDefault;
|
|
14
|
+
|
|
15
|
+
- (instancetype)initWithLinkRegexProp:
|
|
16
|
+
(EnrichedTextInputViewLinkRegexStruct)prop;
|
|
17
|
+
- (BOOL)isEqualToConfig:(LinkRegexConfig *)otherObj;
|
|
18
|
+
|
|
19
|
+
@end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#import "LinkRegexConfig.h"
|
|
2
|
+
#import "StringExtension.h"
|
|
3
|
+
|
|
4
|
+
@implementation LinkRegexConfig
|
|
5
|
+
|
|
6
|
+
- (instancetype)initWithLinkRegexProp:
|
|
7
|
+
(EnrichedTextInputViewLinkRegexStruct)prop {
|
|
8
|
+
if (!self)
|
|
9
|
+
return nil;
|
|
10
|
+
|
|
11
|
+
_pattern = [NSString fromCppString:prop.pattern];
|
|
12
|
+
_caseInsensitive = prop.caseInsensitive;
|
|
13
|
+
_dotAll = prop.dotAll;
|
|
14
|
+
_isDefault = prop.isDefault;
|
|
15
|
+
_isDisabled = prop.isDisabled;
|
|
16
|
+
|
|
17
|
+
return self;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
- (id)copyWithZone:(NSZone *)zone {
|
|
21
|
+
LinkRegexConfig *copy = [[[self class] allocWithZone:zone] init];
|
|
22
|
+
copy->_pattern = [_pattern copy];
|
|
23
|
+
copy->_caseInsensitive = _caseInsensitive;
|
|
24
|
+
copy->_dotAll = _dotAll;
|
|
25
|
+
copy->_isDefault = _isDefault;
|
|
26
|
+
copy->_isDisabled = _isDisabled;
|
|
27
|
+
return copy;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (BOOL)isEqualToConfig:(LinkRegexConfig *)otherObj {
|
|
31
|
+
return [_pattern isEqualToString:otherObj.pattern] &&
|
|
32
|
+
_caseInsensitive == otherObj.caseInsensitive &&
|
|
33
|
+
_dotAll == otherObj.dotAll && _isDefault == otherObj.isDefault &&
|
|
34
|
+
_isDisabled == otherObj.isDisabled;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
@class MediaAttachment;
|
|
4
|
+
|
|
5
|
+
@protocol MediaAttachmentDelegate <NSObject>
|
|
6
|
+
- (void)mediaAttachmentDidUpdate:(MediaAttachment *)attachment;
|
|
7
|
+
@end
|
|
8
|
+
|
|
9
|
+
@interface MediaAttachment : NSTextAttachment
|
|
10
|
+
|
|
11
|
+
@property(nonatomic, weak) id<MediaAttachmentDelegate> delegate;
|
|
12
|
+
@property(nonatomic, strong) NSString *uri;
|
|
13
|
+
@property(nonatomic, assign) CGFloat width;
|
|
14
|
+
@property(nonatomic, assign) CGFloat height;
|
|
15
|
+
|
|
16
|
+
- (instancetype)initWithURI:(NSString *)uri
|
|
17
|
+
width:(CGFloat)width
|
|
18
|
+
height:(CGFloat)height;
|
|
19
|
+
|
|
20
|
+
- (void)loadAsync;
|
|
21
|
+
- (void)notifyUpdate;
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#import "MediaAttachment.h"
|
|
2
|
+
|
|
3
|
+
@implementation MediaAttachment
|
|
4
|
+
|
|
5
|
+
- (instancetype)initWithURI:(NSString *)uri
|
|
6
|
+
width:(CGFloat)width
|
|
7
|
+
height:(CGFloat)height {
|
|
8
|
+
self = [super init];
|
|
9
|
+
if (!self)
|
|
10
|
+
return nil;
|
|
11
|
+
|
|
12
|
+
_uri = uri;
|
|
13
|
+
_width = width;
|
|
14
|
+
_height = height;
|
|
15
|
+
|
|
16
|
+
self.bounds = CGRectMake(0, 0, width, height);
|
|
17
|
+
|
|
18
|
+
return self;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
- (void)loadAsync {
|
|
22
|
+
// no-op for base
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (void)notifyUpdate {
|
|
26
|
+
if ([self.delegate respondsToSelector:@selector(mediaAttachmentDidUpdate:)]) {
|
|
27
|
+
[self.delegate mediaAttachmentDidUpdate:self];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@end
|
|
@@ -1,56 +1,63 @@
|
|
|
1
1
|
#import "MentionStyleProps.h"
|
|
2
|
-
#import <React/RCTConversions.h>
|
|
3
2
|
#import "StringExtension.h"
|
|
3
|
+
#import <React/RCTConversions.h>
|
|
4
4
|
|
|
5
5
|
@implementation MentionStyleProps
|
|
6
6
|
|
|
7
|
-
+ (MentionStyleProps *)getSingleMentionStylePropsFromFollyDynamic:
|
|
7
|
+
+ (MentionStyleProps *)getSingleMentionStylePropsFromFollyDynamic:
|
|
8
|
+
(folly::dynamic)folly {
|
|
8
9
|
MentionStyleProps *nativeProps = [[MentionStyleProps alloc] init];
|
|
9
|
-
|
|
10
|
-
if(folly["color"].isNumber()) {
|
|
11
|
-
facebook::react::SharedColor color = facebook::react::SharedColor(
|
|
10
|
+
|
|
11
|
+
if (folly["color"].isNumber()) {
|
|
12
|
+
facebook::react::SharedColor color = facebook::react::SharedColor(
|
|
13
|
+
facebook::react::Color(int32_t(folly["color"].asInt())));
|
|
12
14
|
nativeProps.color = RCTUIColorFromSharedColor(color);
|
|
13
15
|
} else {
|
|
14
16
|
nativeProps.color = [UIColor blueColor];
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
if(folly["backgroundColor"].isNumber()) {
|
|
18
|
-
facebook::react::SharedColor bgColor = facebook::react::SharedColor(
|
|
18
|
+
|
|
19
|
+
if (folly["backgroundColor"].isNumber()) {
|
|
20
|
+
facebook::react::SharedColor bgColor = facebook::react::SharedColor(
|
|
21
|
+
facebook::react::Color(int32_t(folly["backgroundColor"].asInt())));
|
|
19
22
|
nativeProps.backgroundColor = RCTUIColorFromSharedColor(bgColor);
|
|
20
23
|
} else {
|
|
21
24
|
nativeProps.backgroundColor = [UIColor yellowColor];
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
if(folly["textDecorationLine"].isString()) {
|
|
26
|
+
|
|
27
|
+
if (folly["textDecorationLine"].isString()) {
|
|
25
28
|
std::string textDecorationLine = folly["textDecorationLine"].asString();
|
|
26
|
-
nativeProps.decorationLine = [[NSString fromCppString:textDecorationLine]
|
|
29
|
+
nativeProps.decorationLine = [[NSString fromCppString:textDecorationLine]
|
|
30
|
+
isEqualToString:DecorationUnderline]
|
|
31
|
+
? DecorationUnderline
|
|
32
|
+
: DecorationNone;
|
|
27
33
|
} else {
|
|
28
34
|
nativeProps.decorationLine = DecorationUnderline;
|
|
29
35
|
}
|
|
30
|
-
|
|
36
|
+
|
|
31
37
|
return nativeProps;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
+ (NSDictionary *)getSinglePropsFromFollyDynamic:(folly::dynamic)folly {
|
|
35
|
-
MentionStyleProps *nativeProps =
|
|
41
|
+
MentionStyleProps *nativeProps =
|
|
42
|
+
[MentionStyleProps getSingleMentionStylePropsFromFollyDynamic:folly];
|
|
36
43
|
// the single props need to be somehow distinguishable in config
|
|
37
|
-
NSDictionary *dict = @{@"all": nativeProps};
|
|
44
|
+
NSDictionary *dict = @{@"all" : nativeProps};
|
|
38
45
|
return dict;
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
+ (NSDictionary *)getComplexPropsFromFollyDynamic:(folly::dynamic)folly {
|
|
42
49
|
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
|
|
43
|
-
|
|
44
|
-
for(const auto&
|
|
45
|
-
if(obj.first.isString() && obj.second.isObject()) {
|
|
50
|
+
|
|
51
|
+
for (const auto &obj : folly.items()) {
|
|
52
|
+
if (obj.first.isString() && obj.second.isObject()) {
|
|
46
53
|
std::string key = obj.first.asString();
|
|
47
|
-
MentionStyleProps *props = [MentionStyleProps
|
|
54
|
+
MentionStyleProps *props = [MentionStyleProps
|
|
55
|
+
getSingleMentionStylePropsFromFollyDynamic:obj.second];
|
|
48
56
|
dict[[NSString fromCppString:key]] = props;
|
|
49
57
|
}
|
|
50
58
|
}
|
|
51
|
-
|
|
59
|
+
|
|
52
60
|
return dict;
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
@end
|
|
56
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
#import "BaseStyleProtocol.h"
|
|
3
|
+
#import "ImageData.h"
|
|
3
4
|
#import "LinkData.h"
|
|
4
5
|
#import "MentionParams.h"
|
|
5
|
-
#import "ImageData.h"
|
|
6
6
|
|
|
7
7
|
@interface BoldStyle : NSObject <BaseStyleProtocol>
|
|
8
8
|
@end
|
|
@@ -21,35 +21,44 @@
|
|
|
21
21
|
@end
|
|
22
22
|
|
|
23
23
|
@interface LinkStyle : NSObject <BaseStyleProtocol>
|
|
24
|
-
- (void)addLink:(NSString*)text
|
|
24
|
+
- (void)addLink:(NSString *)text
|
|
25
|
+
url:(NSString *)url
|
|
26
|
+
range:(NSRange)range
|
|
27
|
+
manual:(BOOL)manual
|
|
28
|
+
withSelection:(BOOL)withSelection;
|
|
25
29
|
- (LinkData *)getLinkDataAt:(NSUInteger)location;
|
|
26
30
|
- (NSRange)getFullLinkRangeAt:(NSUInteger)location;
|
|
27
31
|
- (void)manageLinkTypingAttributes;
|
|
28
32
|
- (void)handleAutomaticLinks:(NSString *)word inRange:(NSRange)wordRange;
|
|
29
33
|
- (void)handleManualLinks:(NSString *)word inRange:(NSRange)wordRange;
|
|
30
|
-
- (BOOL)handleLeadingLinkReplacement:(NSRange)range
|
|
34
|
+
- (BOOL)handleLeadingLinkReplacement:(NSRange)range
|
|
35
|
+
replacementText:(NSString *)text;
|
|
31
36
|
@end
|
|
32
37
|
|
|
33
|
-
@interface MentionStyle : NSObject<BaseStyleProtocol>
|
|
34
|
-
- (void)addMention:(NSString *)indicator
|
|
38
|
+
@interface MentionStyle : NSObject <BaseStyleProtocol>
|
|
39
|
+
- (void)addMention:(NSString *)indicator
|
|
40
|
+
text:(NSString *)text
|
|
41
|
+
attributes:(NSString *)attributes;
|
|
35
42
|
- (void)addMentionAtRange:(NSRange)range params:(MentionParams *)params;
|
|
36
43
|
- (void)startMentionWithIndicator:(NSString *)indicator;
|
|
37
44
|
- (void)handleExistingMentions;
|
|
38
45
|
- (void)manageMentionEditing;
|
|
39
46
|
- (void)manageMentionTypingAttributes;
|
|
40
|
-
- (BOOL)handleLeadingMentionReplacement:(NSRange)range
|
|
47
|
+
- (BOOL)handleLeadingMentionReplacement:(NSRange)range
|
|
48
|
+
replacementText:(NSString *)text;
|
|
41
49
|
- (MentionParams *)getMentionParamsAt:(NSUInteger)location;
|
|
42
50
|
- (NSRange)getFullMentionRangeAt:(NSUInteger)location;
|
|
43
51
|
- (NSValue *)getActiveMentionRange;
|
|
44
52
|
@end
|
|
45
53
|
|
|
46
|
-
@interface HeadingStyleBase : NSObject<BaseStyleProtocol> {
|
|
54
|
+
@interface HeadingStyleBase : NSObject <BaseStyleProtocol> {
|
|
47
55
|
id input;
|
|
48
56
|
}
|
|
49
57
|
- (CGFloat)getHeadingFontSize;
|
|
50
58
|
- (BOOL)isHeadingBold;
|
|
51
59
|
- (BOOL)handleNewlinesInRange:(NSRange)range replacementText:(NSString *)text;
|
|
52
60
|
- (void)handleImproperHeadings;
|
|
61
|
+
@property(nonatomic, assign) CGFloat lastAppliedFontSize;
|
|
53
62
|
@end
|
|
54
63
|
|
|
55
64
|
@interface H1Style : HeadingStyleBase
|
|
@@ -61,28 +70,41 @@
|
|
|
61
70
|
@interface H3Style : HeadingStyleBase
|
|
62
71
|
@end
|
|
63
72
|
|
|
64
|
-
@interface
|
|
73
|
+
@interface H4Style : HeadingStyleBase
|
|
74
|
+
@end
|
|
75
|
+
|
|
76
|
+
@interface H5Style : HeadingStyleBase
|
|
77
|
+
@end
|
|
78
|
+
|
|
79
|
+
@interface H6Style : HeadingStyleBase
|
|
80
|
+
@end
|
|
81
|
+
|
|
82
|
+
@interface UnorderedListStyle : NSObject <BaseStyleProtocol>
|
|
65
83
|
- (BOOL)handleBackspaceInRange:(NSRange)range replacementText:(NSString *)text;
|
|
66
|
-
- (BOOL)tryHandlingListShorcutInRange:(NSRange)range
|
|
84
|
+
- (BOOL)tryHandlingListShorcutInRange:(NSRange)range
|
|
85
|
+
replacementText:(NSString *)text;
|
|
67
86
|
@end
|
|
68
87
|
|
|
69
|
-
@interface OrderedListStyle : NSObject<BaseStyleProtocol>
|
|
88
|
+
@interface OrderedListStyle : NSObject <BaseStyleProtocol>
|
|
70
89
|
- (BOOL)handleBackspaceInRange:(NSRange)range replacementText:(NSString *)text;
|
|
71
|
-
- (BOOL)tryHandlingListShorcutInRange:(NSRange)range
|
|
90
|
+
- (BOOL)tryHandlingListShorcutInRange:(NSRange)range
|
|
91
|
+
replacementText:(NSString *)text;
|
|
72
92
|
@end
|
|
73
93
|
|
|
74
|
-
@interface BlockQuoteStyle : NSObject<BaseStyleProtocol>
|
|
94
|
+
@interface BlockQuoteStyle : NSObject <BaseStyleProtocol>
|
|
75
95
|
- (BOOL)handleBackspaceInRange:(NSRange)range replacementText:(NSString *)text;
|
|
76
96
|
- (void)manageBlockquoteColor;
|
|
77
97
|
@end
|
|
78
98
|
|
|
79
|
-
@interface CodeBlockStyle : NSObject<BaseStyleProtocol>
|
|
99
|
+
@interface CodeBlockStyle : NSObject <BaseStyleProtocol>
|
|
80
100
|
- (void)manageCodeBlockFontAndColor;
|
|
81
101
|
- (BOOL)handleBackspaceInRange:(NSRange)range replacementText:(NSString *)text;
|
|
82
102
|
@end
|
|
83
103
|
|
|
84
|
-
@interface ImageStyle : NSObject<BaseStyleProtocol>
|
|
104
|
+
@interface ImageStyle : NSObject <BaseStyleProtocol>
|
|
85
105
|
- (void)addImage:(NSString *)uri width:(CGFloat)width height:(CGFloat)height;
|
|
86
|
-
- (void)addImageAtRange:(NSRange)range
|
|
106
|
+
- (void)addImageAtRange:(NSRange)range
|
|
107
|
+
imageData:(ImageData *)imageData
|
|
108
|
+
withSelection:(BOOL)withSelection;
|
|
87
109
|
- (ImageData *)getImageDataAt:(NSUInteger)location;
|
|
88
110
|
@end
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
#pragma once
|
|
2
|
-
#include <
|
|
2
|
+
#include <ReactNativeEnriched/EnrichedTextInputViewShadowNode.h>
|
|
3
3
|
#include <ReactNativeEnriched/Props.h>
|
|
4
|
+
#include <react/debug/react_native_assert.h>
|
|
4
5
|
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
5
|
-
#include <ReactNativeEnriched/EnrichedTextInputViewShadowNode.h>
|
|
6
6
|
|
|
7
7
|
namespace facebook::react {
|
|
8
|
-
class EnrichedTextInputViewComponentDescriptor final
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
class EnrichedTextInputViewComponentDescriptor final
|
|
9
|
+
: public ConcreteComponentDescriptor<EnrichedTextInputViewShadowNode> {
|
|
10
|
+
public:
|
|
11
|
+
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
|
|
12
|
+
void adopt(ShadowNode &shadowNode) const override {
|
|
13
|
+
react_native_assert(
|
|
14
|
+
dynamic_cast<EnrichedTextInputViewShadowNode *>(&shadowNode));
|
|
15
|
+
ConcreteComponentDescriptor::adopt(shadowNode);
|
|
16
|
+
}
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
} // namespace facebook::react
|