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
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
@implementation ZeroWidthSpaceUtils
|
|
8
8
|
+ (void)handleZeroWidthSpacesInInput:(id)input {
|
|
9
9
|
EnrichedTextInputView *typedInput = (EnrichedTextInputView *)input;
|
|
10
|
-
if(typedInput == nullptr) {
|
|
11
|
-
|
|
10
|
+
if (typedInput == nullptr) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
12
14
|
[self removeSpacesIfNeededinInput:typedInput];
|
|
13
15
|
[self addSpacesIfNeededinInput:typedInput];
|
|
14
16
|
}
|
|
@@ -17,155 +19,219 @@
|
|
|
17
19
|
NSMutableArray *indexesToBeRemoved = [[NSMutableArray alloc] init];
|
|
18
20
|
NSRange preRemoveSelection = input->textView.selectedRange;
|
|
19
21
|
|
|
20
|
-
for(int i = 0; i < input->textView.textStorage.string.length; i++) {
|
|
22
|
+
for (int i = 0; i < input->textView.textStorage.string.length; i++) {
|
|
21
23
|
unichar character = [input->textView.textStorage.string characterAtIndex:i];
|
|
22
|
-
if(character == 0x200B) {
|
|
24
|
+
if (character == 0x200B) {
|
|
23
25
|
NSRange characterRange = NSMakeRange(i, 1);
|
|
24
|
-
|
|
25
|
-
NSRange paragraphRange = [input->textView.textStorage.string
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
NSRange paragraphRange = [input->textView.textStorage.string
|
|
28
|
+
paragraphRangeForRange:characterRange];
|
|
29
|
+
// having paragraph longer than 1 character means someone most likely
|
|
30
|
+
// added something and we probably can remove the space
|
|
27
31
|
BOOL removeSpace = paragraphRange.length > 1;
|
|
28
32
|
// exception; 2 characters paragraph with zero width space + newline
|
|
29
33
|
// here, we still need zero width space to keep the empty list items
|
|
30
|
-
if(paragraphRange.length == 2 &&
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
if (paragraphRange.length == 2 && paragraphRange.location == i &&
|
|
35
|
+
[[NSCharacterSet newlineCharacterSet]
|
|
36
|
+
characterIsMember:[input->textView.textStorage.string
|
|
37
|
+
characterAtIndex:i + 1]]) {
|
|
34
38
|
removeSpace = NO;
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
if(removeSpace) {
|
|
40
|
+
|
|
41
|
+
if (removeSpace) {
|
|
38
42
|
[indexesToBeRemoved addObject:@(characterRange.location)];
|
|
39
43
|
continue;
|
|
40
44
|
}
|
|
41
|
-
|
|
42
|
-
UnorderedListStyle *ulStyle =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
|
|
46
|
+
UnorderedListStyle *ulStyle =
|
|
47
|
+
input->stylesDict[@([UnorderedListStyle getStyleType])];
|
|
48
|
+
OrderedListStyle *olStyle =
|
|
49
|
+
input->stylesDict[@([OrderedListStyle getStyleType])];
|
|
50
|
+
BlockQuoteStyle *bqStyle =
|
|
51
|
+
input->stylesDict[@([BlockQuoteStyle getStyleType])];
|
|
52
|
+
CodeBlockStyle *cbStyle =
|
|
53
|
+
input->stylesDict[@([CodeBlockStyle getStyleType])];
|
|
54
|
+
|
|
55
|
+
// zero width spaces with no lists/blockquotes/codeblocks on them get
|
|
56
|
+
// removed
|
|
57
|
+
if (![ulStyle detectStyle:characterRange] &&
|
|
58
|
+
![olStyle detectStyle:characterRange] &&
|
|
59
|
+
![bqStyle detectStyle:characterRange] &&
|
|
60
|
+
![cbStyle detectStyle:characterRange]) {
|
|
49
61
|
[indexesToBeRemoved addObject:@(characterRange.location)];
|
|
50
62
|
}
|
|
51
63
|
}
|
|
52
64
|
}
|
|
53
|
-
|
|
65
|
+
|
|
54
66
|
// do the removing
|
|
55
67
|
NSInteger offset = 0;
|
|
56
68
|
NSInteger postRemoveLocationOffset = 0;
|
|
57
69
|
NSInteger postRemoveLengthOffset = 0;
|
|
58
|
-
for(NSNumber *index in indexesToBeRemoved) {
|
|
70
|
+
for (NSNumber *index in indexesToBeRemoved) {
|
|
59
71
|
NSRange replaceRange = NSMakeRange([index integerValue] + offset, 1);
|
|
60
|
-
[TextInsertionUtils replaceText:@""
|
|
72
|
+
[TextInsertionUtils replaceText:@""
|
|
73
|
+
at:replaceRange
|
|
74
|
+
additionalAttributes:nullptr
|
|
75
|
+
input:input
|
|
76
|
+
withSelection:NO];
|
|
61
77
|
offset -= 1;
|
|
62
|
-
if([index integerValue] < preRemoveSelection.location) {
|
|
78
|
+
if ([index integerValue] < preRemoveSelection.location) {
|
|
63
79
|
postRemoveLocationOffset -= 1;
|
|
64
80
|
}
|
|
65
|
-
if([index integerValue] >= preRemoveSelection.location &&
|
|
81
|
+
if ([index integerValue] >= preRemoveSelection.location &&
|
|
82
|
+
[index integerValue] < NSMaxRange(preRemoveSelection)) {
|
|
66
83
|
postRemoveLengthOffset -= 1;
|
|
67
84
|
}
|
|
68
85
|
}
|
|
69
|
-
|
|
86
|
+
|
|
70
87
|
// fix the selection if needed
|
|
71
|
-
if([input->textView isFirstResponder]) {
|
|
72
|
-
input->textView.selectedRange =
|
|
88
|
+
if ([input->textView isFirstResponder]) {
|
|
89
|
+
input->textView.selectedRange =
|
|
90
|
+
NSMakeRange(preRemoveSelection.location + postRemoveLocationOffset,
|
|
91
|
+
preRemoveSelection.length + postRemoveLengthOffset);
|
|
73
92
|
}
|
|
74
93
|
}
|
|
75
94
|
|
|
76
95
|
+ (void)addSpacesIfNeededinInput:(EnrichedTextInputView *)input {
|
|
77
|
-
UnorderedListStyle *ulStyle =
|
|
78
|
-
|
|
79
|
-
|
|
96
|
+
UnorderedListStyle *ulStyle =
|
|
97
|
+
input->stylesDict[@([UnorderedListStyle getStyleType])];
|
|
98
|
+
OrderedListStyle *olStyle =
|
|
99
|
+
input->stylesDict[@([OrderedListStyle getStyleType])];
|
|
100
|
+
BlockQuoteStyle *bqStyle =
|
|
101
|
+
input->stylesDict[@([BlockQuoteStyle getStyleType])];
|
|
80
102
|
CodeBlockStyle *cbStyle = input->stylesDict[@([CodeBlockStyle getStyleType])];
|
|
81
103
|
NSMutableArray *indexesToBeInserted = [[NSMutableArray alloc] init];
|
|
82
104
|
NSRange preAddSelection = input->textView.selectedRange;
|
|
83
|
-
|
|
84
|
-
for(int i = 0; i < input->textView.textStorage.string.length; i++) {
|
|
105
|
+
|
|
106
|
+
for (int i = 0; i < input->textView.textStorage.string.length; i++) {
|
|
85
107
|
unichar character = [input->textView.textStorage.string characterAtIndex:i];
|
|
86
|
-
|
|
87
|
-
if([[NSCharacterSet newlineCharacterSet] characterIsMember:character]) {
|
|
108
|
+
|
|
109
|
+
if ([[NSCharacterSet newlineCharacterSet] characterIsMember:character]) {
|
|
88
110
|
NSRange characterRange = NSMakeRange(i, 1);
|
|
89
|
-
NSRange paragraphRange = [input->textView.textStorage.string
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
111
|
+
NSRange paragraphRange = [input->textView.textStorage.string
|
|
112
|
+
paragraphRangeForRange:characterRange];
|
|
113
|
+
|
|
114
|
+
if (paragraphRange.length == 1) {
|
|
115
|
+
if ([ulStyle detectStyle:characterRange] ||
|
|
116
|
+
[olStyle detectStyle:characterRange] ||
|
|
117
|
+
[bqStyle detectStyle:characterRange] ||
|
|
118
|
+
[cbStyle detectStyle:characterRange]) {
|
|
93
119
|
// we have an empty list or quote item with no space: add it!
|
|
94
120
|
[indexesToBeInserted addObject:@(paragraphRange.location)];
|
|
95
121
|
}
|
|
96
122
|
}
|
|
97
123
|
}
|
|
98
124
|
}
|
|
99
|
-
|
|
125
|
+
|
|
100
126
|
// do the replacing
|
|
101
127
|
NSInteger offset = 0;
|
|
102
128
|
NSInteger postAddLocationOffset = 0;
|
|
103
129
|
NSInteger postAddLengthOffset = 0;
|
|
104
|
-
for(NSNumber *index in indexesToBeInserted) {
|
|
130
|
+
for (NSNumber *index in indexesToBeInserted) {
|
|
105
131
|
NSRange replaceRange = NSMakeRange([index integerValue] + offset, 1);
|
|
106
|
-
[TextInsertionUtils replaceText:@"\u200B\n"
|
|
132
|
+
[TextInsertionUtils replaceText:@"\u200B\n"
|
|
133
|
+
at:replaceRange
|
|
134
|
+
additionalAttributes:nullptr
|
|
135
|
+
input:input
|
|
136
|
+
withSelection:NO];
|
|
107
137
|
offset += 1;
|
|
108
|
-
if([index integerValue] < preAddSelection.location) {
|
|
138
|
+
if ([index integerValue] < preAddSelection.location) {
|
|
109
139
|
postAddLocationOffset += 1;
|
|
110
140
|
}
|
|
111
|
-
if([index integerValue] >= preAddSelection.location &&
|
|
141
|
+
if ([index integerValue] >= preAddSelection.location &&
|
|
142
|
+
[index integerValue] < NSMaxRange(preAddSelection)) {
|
|
112
143
|
postAddLengthOffset += 1;
|
|
113
144
|
}
|
|
114
145
|
}
|
|
115
|
-
|
|
146
|
+
|
|
116
147
|
// additional check for last index of the input
|
|
117
148
|
NSRange lastRange = NSMakeRange(input->textView.textStorage.string.length, 0);
|
|
118
|
-
NSRange lastParagraphRange =
|
|
119
|
-
|
|
120
|
-
|
|
149
|
+
NSRange lastParagraphRange =
|
|
150
|
+
[input->textView.textStorage.string paragraphRangeForRange:lastRange];
|
|
151
|
+
if (lastParagraphRange.length == 0 &&
|
|
152
|
+
([ulStyle detectStyle:lastRange] || [olStyle detectStyle:lastRange] ||
|
|
153
|
+
[bqStyle detectStyle:lastRange] || [cbStyle detectStyle:lastRange])) {
|
|
154
|
+
[TextInsertionUtils insertText:@"\u200B"
|
|
155
|
+
at:lastRange.location
|
|
156
|
+
additionalAttributes:nullptr
|
|
157
|
+
input:input
|
|
158
|
+
withSelection:NO];
|
|
121
159
|
}
|
|
122
|
-
|
|
160
|
+
|
|
123
161
|
// fix the selection if needed
|
|
124
|
-
if([input->textView isFirstResponder]) {
|
|
125
|
-
input->textView.selectedRange =
|
|
162
|
+
if ([input->textView isFirstResponder]) {
|
|
163
|
+
input->textView.selectedRange =
|
|
164
|
+
NSMakeRange(preAddSelection.location + postAddLocationOffset,
|
|
165
|
+
preAddSelection.length + postAddLengthOffset);
|
|
126
166
|
}
|
|
127
167
|
}
|
|
128
168
|
|
|
129
|
-
+ (BOOL)handleBackspaceInRange:(NSRange)range
|
|
130
|
-
|
|
169
|
+
+ (BOOL)handleBackspaceInRange:(NSRange)range
|
|
170
|
+
replacementText:(NSString *)text
|
|
171
|
+
input:(id)input {
|
|
172
|
+
if (range.length != 1 || ![text isEqualToString:@""]) {
|
|
173
|
+
return NO;
|
|
174
|
+
}
|
|
131
175
|
EnrichedTextInputView *typedInput = (EnrichedTextInputView *)input;
|
|
132
|
-
if(typedInput == nullptr) {
|
|
133
|
-
|
|
134
|
-
|
|
176
|
+
if (typedInput == nullptr) {
|
|
177
|
+
return NO;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
unichar character =
|
|
181
|
+
[typedInput->textView.textStorage.string characterAtIndex:range.location];
|
|
135
182
|
// zero-width space got backspaced
|
|
136
|
-
if(character == 0x200B) {
|
|
183
|
+
if (character == 0x200B) {
|
|
137
184
|
// in such case: remove the whole line without the endline if there is one
|
|
138
|
-
|
|
139
|
-
NSRange paragraphRange =
|
|
185
|
+
|
|
186
|
+
NSRange paragraphRange =
|
|
187
|
+
[typedInput->textView.textStorage.string paragraphRangeForRange:range];
|
|
140
188
|
NSRange removalRange = paragraphRange;
|
|
141
189
|
// if whole paragraph gets removed then 0 length for style removal
|
|
142
190
|
NSRange styleRemovalRange = NSMakeRange(paragraphRange.location, 0);
|
|
143
|
-
|
|
144
|
-
if([[NSCharacterSet newlineCharacterSet]
|
|
191
|
+
|
|
192
|
+
if ([[NSCharacterSet newlineCharacterSet]
|
|
193
|
+
characterIsMember:[typedInput->textView.textStorage.string
|
|
194
|
+
characterAtIndex:NSMaxRange(paragraphRange) -
|
|
195
|
+
1]]) {
|
|
145
196
|
// if endline is there, don't remove it
|
|
146
|
-
removalRange =
|
|
197
|
+
removalRange =
|
|
198
|
+
NSMakeRange(paragraphRange.location, paragraphRange.length - 1);
|
|
147
199
|
// if endline is left then 1 length for style removal
|
|
148
200
|
styleRemovalRange = NSMakeRange(paragraphRange.location, 1);
|
|
149
201
|
}
|
|
150
|
-
|
|
202
|
+
|
|
151
203
|
// and then remove associated styling
|
|
152
|
-
|
|
153
|
-
UnorderedListStyle *ulStyle =
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
204
|
+
|
|
205
|
+
UnorderedListStyle *ulStyle =
|
|
206
|
+
typedInput->stylesDict[@([UnorderedListStyle getStyleType])];
|
|
207
|
+
OrderedListStyle *olStyle =
|
|
208
|
+
typedInput->stylesDict[@([OrderedListStyle getStyleType])];
|
|
209
|
+
BlockQuoteStyle *bqStyle =
|
|
210
|
+
typedInput->stylesDict[@([BlockQuoteStyle getStyleType])];
|
|
211
|
+
CodeBlockStyle *cbStyle =
|
|
212
|
+
typedInput->stylesDict[@([CodeBlockStyle getStyleType])];
|
|
213
|
+
|
|
214
|
+
if ([cbStyle detectStyle:removalRange]) {
|
|
215
|
+
// code blocks are being handled differently; we want to remove previous
|
|
216
|
+
// newline if there is a one
|
|
217
|
+
if (range.location > 0) {
|
|
218
|
+
removalRange =
|
|
219
|
+
NSMakeRange(removalRange.location - 1, removalRange.length + 1);
|
|
162
220
|
}
|
|
163
|
-
[TextInsertionUtils replaceText:@""
|
|
221
|
+
[TextInsertionUtils replaceText:@""
|
|
222
|
+
at:removalRange
|
|
223
|
+
additionalAttributes:nullptr
|
|
224
|
+
input:typedInput
|
|
225
|
+
withSelection:YES];
|
|
164
226
|
return YES;
|
|
165
227
|
}
|
|
166
|
-
|
|
167
|
-
[TextInsertionUtils replaceText:@""
|
|
168
|
-
|
|
228
|
+
|
|
229
|
+
[TextInsertionUtils replaceText:@""
|
|
230
|
+
at:removalRange
|
|
231
|
+
additionalAttributes:nullptr
|
|
232
|
+
input:typedInput
|
|
233
|
+
withSelection:YES];
|
|
234
|
+
|
|
169
235
|
if ([ulStyle detectStyle:styleRemovalRange]) {
|
|
170
236
|
[ulStyle removeAttributes:styleRemovalRange];
|
|
171
237
|
} else if ([olStyle detectStyle:styleRemovalRange]) {
|
|
@@ -173,7 +239,7 @@
|
|
|
173
239
|
} else if ([bqStyle detectStyle:styleRemovalRange]) {
|
|
174
240
|
[bqStyle removeAttributes:styleRemovalRange];
|
|
175
241
|
}
|
|
176
|
-
|
|
242
|
+
|
|
177
243
|
return YES;
|
|
178
244
|
}
|
|
179
245
|
return NO;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useImperativeHandle, useMemo, useRef } from 'react';
|
|
3
|
+
import { useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
4
|
import EnrichedTextInputNativeComponent, { Commands } from './EnrichedTextInputNativeComponent';
|
|
5
|
-
import { normalizeHtmlStyle } from "./normalizeHtmlStyle.js";
|
|
5
|
+
import { normalizeHtmlStyle } from "./utils/normalizeHtmlStyle.js";
|
|
6
|
+
import { toNativeRegexConfig } from "./utils/regexParser.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const nullthrows = value => {
|
|
8
9
|
if (value == null) {
|
|
@@ -26,23 +27,40 @@ export const EnrichedTextInput = ({
|
|
|
26
27
|
style,
|
|
27
28
|
autoCapitalize = 'sentences',
|
|
28
29
|
htmlStyle = {},
|
|
30
|
+
linkRegex: _linkRegex,
|
|
29
31
|
onFocus,
|
|
30
32
|
onBlur,
|
|
31
33
|
onChangeText,
|
|
32
34
|
onChangeHtml,
|
|
33
35
|
onChangeState,
|
|
36
|
+
onChangeStateDeprecated,
|
|
34
37
|
onLinkDetected,
|
|
35
38
|
onMentionDetected,
|
|
36
39
|
onStartMention,
|
|
37
40
|
onChangeMention,
|
|
38
41
|
onEndMention,
|
|
39
42
|
onChangeSelection,
|
|
43
|
+
onKeyPress,
|
|
40
44
|
androidExperimentalSynchronousEvents = false,
|
|
41
45
|
scrollEnabled = true,
|
|
42
46
|
...rest
|
|
43
47
|
}) => {
|
|
44
48
|
const nativeRef = useRef(null);
|
|
49
|
+
const nextHtmlRequestId = useRef(1);
|
|
50
|
+
const pendingHtmlRequests = useRef(new Map());
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const pendingRequests = pendingHtmlRequests.current;
|
|
53
|
+
return () => {
|
|
54
|
+
pendingRequests.forEach(({
|
|
55
|
+
reject
|
|
56
|
+
}) => {
|
|
57
|
+
reject(new Error('Component unmounted'));
|
|
58
|
+
});
|
|
59
|
+
pendingRequests.clear();
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
45
62
|
const normalizedHtmlStyle = useMemo(() => normalizeHtmlStyle(htmlStyle, mentionIndicators), [htmlStyle, mentionIndicators]);
|
|
63
|
+
const linkRegex = useMemo(() => toNativeRegexConfig(_linkRegex), [_linkRegex]);
|
|
46
64
|
useImperativeHandle(ref, () => ({
|
|
47
65
|
measureInWindow: callback => {
|
|
48
66
|
nullthrows(nativeRef.current).measureInWindow(callback);
|
|
@@ -65,6 +83,16 @@ export const EnrichedTextInput = ({
|
|
|
65
83
|
setValue: value => {
|
|
66
84
|
Commands.setValue(nullthrows(nativeRef.current), value);
|
|
67
85
|
},
|
|
86
|
+
getHTML: () => {
|
|
87
|
+
return new Promise((resolve, reject) => {
|
|
88
|
+
const requestId = nextHtmlRequestId.current++;
|
|
89
|
+
pendingHtmlRequests.current.set(requestId, {
|
|
90
|
+
resolve,
|
|
91
|
+
reject
|
|
92
|
+
});
|
|
93
|
+
Commands.requestHTML(nullthrows(nativeRef.current), requestId);
|
|
94
|
+
});
|
|
95
|
+
},
|
|
68
96
|
toggleBold: () => {
|
|
69
97
|
Commands.toggleBold(nullthrows(nativeRef.current));
|
|
70
98
|
},
|
|
@@ -89,6 +117,15 @@ export const EnrichedTextInput = ({
|
|
|
89
117
|
toggleH3: () => {
|
|
90
118
|
Commands.toggleH3(nullthrows(nativeRef.current));
|
|
91
119
|
},
|
|
120
|
+
toggleH4: () => {
|
|
121
|
+
Commands.toggleH4(nullthrows(nativeRef.current));
|
|
122
|
+
},
|
|
123
|
+
toggleH5: () => {
|
|
124
|
+
Commands.toggleH5(nullthrows(nativeRef.current));
|
|
125
|
+
},
|
|
126
|
+
toggleH6: () => {
|
|
127
|
+
Commands.toggleH6(nullthrows(nativeRef.current));
|
|
128
|
+
},
|
|
92
129
|
toggleCodeBlock: () => {
|
|
93
130
|
Commands.toggleCodeBlock(nullthrows(nativeRef.current));
|
|
94
131
|
},
|
|
@@ -117,6 +154,9 @@ export const EnrichedTextInput = ({
|
|
|
117
154
|
warnAboutMissconfiguredMentions(indicator);
|
|
118
155
|
}
|
|
119
156
|
Commands.startMention(nullthrows(nativeRef.current), indicator);
|
|
157
|
+
},
|
|
158
|
+
setSelection: (start, end) => {
|
|
159
|
+
Commands.setSelection(nullthrows(nativeRef.current), start, end);
|
|
120
160
|
}
|
|
121
161
|
}));
|
|
122
162
|
const handleMentionEvent = e => {
|
|
@@ -162,6 +202,20 @@ export const EnrichedTextInput = ({
|
|
|
162
202
|
attributes
|
|
163
203
|
});
|
|
164
204
|
};
|
|
205
|
+
const handleRequestHtmlResult = e => {
|
|
206
|
+
const {
|
|
207
|
+
requestId,
|
|
208
|
+
html
|
|
209
|
+
} = e.nativeEvent;
|
|
210
|
+
const pending = pendingHtmlRequests.current.get(requestId);
|
|
211
|
+
if (!pending) return;
|
|
212
|
+
if (html === null || typeof html !== 'string') {
|
|
213
|
+
pending.reject(new Error('Failed to parse HTML'));
|
|
214
|
+
} else {
|
|
215
|
+
pending.resolve(html);
|
|
216
|
+
}
|
|
217
|
+
pendingHtmlRequests.current.delete(requestId);
|
|
218
|
+
};
|
|
165
219
|
return /*#__PURE__*/_jsx(EnrichedTextInputNativeComponent, {
|
|
166
220
|
ref: nativeRef,
|
|
167
221
|
mentionIndicators: mentionIndicators,
|
|
@@ -175,16 +229,21 @@ export const EnrichedTextInput = ({
|
|
|
175
229
|
style: style,
|
|
176
230
|
autoCapitalize: autoCapitalize,
|
|
177
231
|
htmlStyle: normalizedHtmlStyle,
|
|
232
|
+
linkRegex: linkRegex,
|
|
178
233
|
onInputFocus: onFocus,
|
|
179
234
|
onInputBlur: onBlur,
|
|
180
235
|
onChangeText: onChangeText,
|
|
181
236
|
onChangeHtml: onChangeHtml,
|
|
182
237
|
isOnChangeHtmlSet: onChangeHtml !== undefined,
|
|
238
|
+
isOnChangeTextSet: onChangeText !== undefined,
|
|
183
239
|
onChangeState: onChangeState,
|
|
240
|
+
onChangeStateDeprecated: onChangeStateDeprecated,
|
|
184
241
|
onLinkDetected: handleLinkDetected,
|
|
185
242
|
onMentionDetected: handleMentionDetected,
|
|
186
243
|
onMention: handleMentionEvent,
|
|
187
244
|
onChangeSelection: onChangeSelection,
|
|
245
|
+
onRequestHtmlResult: handleRequestHtmlResult,
|
|
246
|
+
onInputKeyPress: onKeyPress,
|
|
188
247
|
androidExperimentalSynchronousEvents: androidExperimentalSynchronousEvents,
|
|
189
248
|
scrollEnabled: scrollEnabled,
|
|
190
249
|
...rest
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useImperativeHandle","useMemo","useRef","EnrichedTextInputNativeComponent","Commands","normalizeHtmlStyle","jsx","_jsx","nullthrows","value","Error","warnAboutMissconfiguredMentions","indicator","console","warn","EnrichedTextInput","ref","autoFocus","editable","mentionIndicators","defaultValue","placeholder","placeholderTextColor","cursorColor","selectionColor","style","autoCapitalize","htmlStyle","onFocus","onBlur","onChangeText","onChangeHtml","onChangeState","onLinkDetected","onMentionDetected","onStartMention","onChangeMention","onEndMention","onChangeSelection","androidExperimentalSynchronousEvents","scrollEnabled","rest","nativeRef","
|
|
1
|
+
{"version":3,"names":["useEffect","useImperativeHandle","useMemo","useRef","EnrichedTextInputNativeComponent","Commands","normalizeHtmlStyle","toNativeRegexConfig","jsx","_jsx","nullthrows","value","Error","warnAboutMissconfiguredMentions","indicator","console","warn","EnrichedTextInput","ref","autoFocus","editable","mentionIndicators","defaultValue","placeholder","placeholderTextColor","cursorColor","selectionColor","style","autoCapitalize","htmlStyle","linkRegex","_linkRegex","onFocus","onBlur","onChangeText","onChangeHtml","onChangeState","onChangeStateDeprecated","onLinkDetected","onMentionDetected","onStartMention","onChangeMention","onEndMention","onChangeSelection","onKeyPress","androidExperimentalSynchronousEvents","scrollEnabled","rest","nativeRef","nextHtmlRequestId","pendingHtmlRequests","Map","pendingRequests","current","forEach","reject","clear","normalizedHtmlStyle","measureInWindow","callback","measure","measureLayout","relativeToNativeComponentRef","onSuccess","onFail","setNativeProps","nativeProps","focus","blur","setValue","getHTML","Promise","resolve","requestId","set","requestHTML","toggleBold","toggleItalic","toggleUnderline","toggleStrikeThrough","toggleInlineCode","toggleH1","toggleH2","toggleH3","toggleH4","toggleH5","toggleH6","toggleCodeBlock","toggleBlockQuote","toggleOrderedList","toggleUnorderedList","setLink","start","end","text","url","addLink","setImage","uri","width","height","addImage","setMention","attributes","parsedAttributes","JSON","stringify","addMention","startMention","includes","setSelection","handleMentionEvent","e","mentionText","nativeEvent","mentionIndicator","handleLinkDetected","handleMentionDetected","payload","parse","handleRequestHtmlResult","html","pending","get","delete","onInputFocus","onInputBlur","isOnChangeHtmlSet","undefined","isOnChangeTextSet","onMention","onRequestHtmlResult","onInputKeyPress"],"sourceRoot":"../../src","sources":["EnrichedTextInput.tsx"],"mappings":";;AAAA,SAGEA,SAAS,EACTC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AACd,OAAOC,gCAAgC,IACrCC,QAAQ,QAcH,oCAAoC;AAa3C,SAASC,kBAAkB,QAAQ,+BAA4B;AAC/D,SAASC,mBAAmB,QAAQ,wBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkI1D,MAAMC,UAAU,GAAQC,KAA2B,IAAQ;EACzD,IAAIA,KAAK,IAAI,IAAI,EAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,oCAAoC,CAAC;EACvD;EAEA,OAAOD,KAAK;AACd,CAAC;AAED,MAAME,+BAA+B,GAAIC,SAAiB,IAAK;EAC7DC,OAAO,CAACC,IAAI,CACV,uCAAuCF,SAAS,8CAClD,CAAC;AACH,CAAC;AASD,OAAO,MAAMG,iBAAiB,GAAGA,CAAC;EAChCC,GAAG;EACHC,SAAS;EACTC,QAAQ,GAAG,IAAI;EACfC,iBAAiB,GAAG,CAAC,GAAG,CAAC;EACzBC,YAAY;EACZC,WAAW;EACXC,oBAAoB;EACpBC,WAAW;EACXC,cAAc;EACdC,KAAK;EACLC,cAAc,GAAG,WAAW;EAC5BC,SAAS,GAAG,CAAC,CAAC;EACdC,SAAS,EAAEC,UAAU;EACrBC,OAAO;EACPC,MAAM;EACNC,YAAY;EACZC,YAAY;EACZC,aAAa;EACbC,uBAAuB;EACvBC,cAAc;EACdC,iBAAiB;EACjBC,cAAc;EACdC,eAAe;EACfC,YAAY;EACZC,iBAAiB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