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,14 +1,18 @@
|
|
|
1
|
-
#import "StyleHeaders.h"
|
|
2
1
|
#import "EnrichedTextInputView.h"
|
|
3
2
|
#import "OccurenceUtils.h"
|
|
3
|
+
#import "StyleHeaders.h"
|
|
4
4
|
|
|
5
5
|
@implementation UnderlineStyle {
|
|
6
6
|
EnrichedTextInputView *_input;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
+ (StyleType)getStyleType {
|
|
9
|
+
+ (StyleType)getStyleType {
|
|
10
|
+
return Underline;
|
|
11
|
+
}
|
|
10
12
|
|
|
11
|
-
+ (BOOL)isParagraphStyle {
|
|
13
|
+
+ (BOOL)isParagraphStyle {
|
|
14
|
+
return NO;
|
|
15
|
+
}
|
|
12
16
|
|
|
13
17
|
- (instancetype)initWithInput:(id)input {
|
|
14
18
|
self = [super init];
|
|
@@ -17,58 +21,68 @@
|
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
- (void)applyStyle:(NSRange)range {
|
|
20
|
-
BOOL isStylePresent = [self detectStyle:
|
|
21
|
-
if(range.length >= 1) {
|
|
22
|
-
isStylePresent ? [self removeAttributes:range]
|
|
24
|
+
BOOL isStylePresent = [self detectStyle:range];
|
|
25
|
+
if (range.length >= 1) {
|
|
26
|
+
isStylePresent ? [self removeAttributes:range]
|
|
27
|
+
: [self addAttributes:range withTypingAttr:YES];
|
|
23
28
|
} else {
|
|
24
29
|
isStylePresent ? [self removeTypingAttributes] : [self addTypingAttributes];
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
- (void)addAttributes:(NSRange)range {
|
|
29
|
-
[_input->textView.textStorage addAttribute:NSUnderlineStyleAttributeName
|
|
33
|
+
- (void)addAttributes:(NSRange)range withTypingAttr:(BOOL)withTypingAttr {
|
|
34
|
+
[_input->textView.textStorage addAttribute:NSUnderlineStyleAttributeName
|
|
35
|
+
value:@(NSUnderlineStyleSingle)
|
|
36
|
+
range:range];
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
- (void)addTypingAttributes {
|
|
33
|
-
NSMutableDictionary *newTypingAttrs =
|
|
40
|
+
NSMutableDictionary *newTypingAttrs =
|
|
41
|
+
[_input->textView.typingAttributes mutableCopy];
|
|
34
42
|
newTypingAttrs[NSUnderlineStyleAttributeName] = @(NSUnderlineStyleSingle);
|
|
35
43
|
_input->textView.typingAttributes = newTypingAttrs;
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
- (void)removeAttributes:(NSRange)range {
|
|
39
|
-
[_input->textView.textStorage removeAttribute:NSUnderlineStyleAttributeName
|
|
47
|
+
[_input->textView.textStorage removeAttribute:NSUnderlineStyleAttributeName
|
|
48
|
+
range:range];
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
- (void)removeTypingAttributes {
|
|
43
|
-
NSMutableDictionary *newTypingAttrs =
|
|
44
|
-
|
|
52
|
+
NSMutableDictionary *newTypingAttrs =
|
|
53
|
+
[_input->textView.typingAttributes mutableCopy];
|
|
54
|
+
[newTypingAttrs removeObjectForKey:NSUnderlineStyleAttributeName];
|
|
45
55
|
_input->textView.typingAttributes = newTypingAttrs;
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
- (BOOL)underlinedLinkConflictsInRange:(NSRange)range {
|
|
49
59
|
BOOL conflicted = NO;
|
|
50
|
-
if([_input->config linkDecorationLine] == DecorationUnderline) {
|
|
60
|
+
if ([_input->config linkDecorationLine] == DecorationUnderline) {
|
|
51
61
|
LinkStyle *linkStyle = _input->stylesDict[@([LinkStyle getStyleType])];
|
|
52
|
-
conflicted = range.length > 0
|
|
53
|
-
|
|
54
|
-
: [linkStyle detectStyle:range];
|
|
62
|
+
conflicted = range.length > 0 ? [linkStyle anyOccurence:range]
|
|
63
|
+
: [linkStyle detectStyle:range];
|
|
55
64
|
}
|
|
56
65
|
return conflicted;
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
- (BOOL)underlinedMentionConflictsInRange:(NSRange)range {
|
|
60
69
|
BOOL conflicted = NO;
|
|
61
|
-
MentionStyle *mentionStyle =
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
MentionStyle *mentionStyle =
|
|
71
|
+
_input->stylesDict[@([MentionStyle getStyleType])];
|
|
72
|
+
if (range.length == 0) {
|
|
73
|
+
if ([mentionStyle detectStyle:range]) {
|
|
64
74
|
MentionParams *params = [mentionStyle getMentionParamsAt:range.location];
|
|
65
|
-
conflicted =
|
|
75
|
+
conflicted =
|
|
76
|
+
[_input->config mentionStylePropsForIndicator:params.indicator]
|
|
77
|
+
.decorationLine == DecorationUnderline;
|
|
66
78
|
}
|
|
67
79
|
} else {
|
|
68
80
|
NSArray *occurences = [mentionStyle findAllOccurences:range];
|
|
69
|
-
for(StylePair *pair in occurences) {
|
|
70
|
-
MentionParams *params = [mentionStyle
|
|
71
|
-
|
|
81
|
+
for (StylePair *pair in occurences) {
|
|
82
|
+
MentionParams *params = [mentionStyle
|
|
83
|
+
getMentionParamsAt:[pair.rangeValue rangeValue].location];
|
|
84
|
+
if ([_input->config mentionStylePropsForIndicator:params.indicator]
|
|
85
|
+
.decorationLine == DecorationUnderline) {
|
|
72
86
|
conflicted = YES;
|
|
73
87
|
break;
|
|
74
88
|
}
|
|
@@ -77,41 +91,49 @@
|
|
|
77
91
|
return conflicted;
|
|
78
92
|
}
|
|
79
93
|
|
|
80
|
-
- (BOOL)styleCondition:(id _Nullable)value :(NSRange)range {
|
|
94
|
+
- (BOOL)styleCondition:(id _Nullable)value range:(NSRange)range {
|
|
81
95
|
NSNumber *underlineStyle = (NSNumber *)value;
|
|
82
|
-
return underlineStyle != nullptr &&
|
|
96
|
+
return underlineStyle != nullptr &&
|
|
97
|
+
[underlineStyle intValue] != NSUnderlineStyleNone &&
|
|
98
|
+
![self underlinedLinkConflictsInRange:range] &&
|
|
99
|
+
![self underlinedMentionConflictsInRange:range];
|
|
83
100
|
}
|
|
84
101
|
|
|
85
102
|
- (BOOL)detectStyle:(NSRange)range {
|
|
86
|
-
if(range.length >= 1) {
|
|
87
|
-
return [OccurenceUtils detect:NSUnderlineStyleAttributeName
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
if (range.length >= 1) {
|
|
104
|
+
return [OccurenceUtils detect:NSUnderlineStyleAttributeName
|
|
105
|
+
withInput:_input
|
|
106
|
+
inRange:range
|
|
107
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
108
|
+
return [self styleCondition:value range:range];
|
|
109
|
+
}];
|
|
92
110
|
} else {
|
|
93
|
-
return [OccurenceUtils detect:NSUnderlineStyleAttributeName
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
return [OccurenceUtils detect:NSUnderlineStyleAttributeName
|
|
112
|
+
withInput:_input
|
|
113
|
+
atIndex:range.location
|
|
114
|
+
checkPrevious:NO
|
|
115
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
116
|
+
return [self styleCondition:value range:range];
|
|
117
|
+
}];
|
|
98
118
|
}
|
|
99
119
|
}
|
|
100
120
|
|
|
101
121
|
- (BOOL)anyOccurence:(NSRange)range {
|
|
102
|
-
return [OccurenceUtils any:NSUnderlineStyleAttributeName
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
return [OccurenceUtils any:NSUnderlineStyleAttributeName
|
|
123
|
+
withInput:_input
|
|
124
|
+
inRange:range
|
|
125
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
126
|
+
return [self styleCondition:value range:range];
|
|
127
|
+
}];
|
|
107
128
|
}
|
|
108
129
|
|
|
109
130
|
- (NSArray<StylePair *> *_Nullable)findAllOccurences:(NSRange)range {
|
|
110
|
-
return [OccurenceUtils all:NSUnderlineStyleAttributeName
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
131
|
+
return [OccurenceUtils all:NSUnderlineStyleAttributeName
|
|
132
|
+
withInput:_input
|
|
133
|
+
inRange:range
|
|
134
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
135
|
+
return [self styleCondition:value range:range];
|
|
136
|
+
}];
|
|
115
137
|
}
|
|
116
138
|
|
|
117
139
|
@end
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
#import "StyleHeaders.h"
|
|
2
1
|
#import "EnrichedTextInputView.h"
|
|
3
2
|
#import "FontExtension.h"
|
|
4
3
|
#import "OccurenceUtils.h"
|
|
5
4
|
#import "ParagraphsUtils.h"
|
|
5
|
+
#import "StyleHeaders.h"
|
|
6
6
|
#import "TextInsertionUtils.h"
|
|
7
7
|
|
|
8
8
|
@implementation UnorderedListStyle {
|
|
9
9
|
EnrichedTextInputView *_input;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
+ (StyleType)getStyleType {
|
|
12
|
+
+ (StyleType)getStyleType {
|
|
13
|
+
return UnorderedList;
|
|
14
|
+
}
|
|
13
15
|
|
|
14
|
-
+ (BOOL)isParagraphStyle {
|
|
16
|
+
+ (BOOL)isParagraphStyle {
|
|
17
|
+
return YES;
|
|
18
|
+
}
|
|
15
19
|
|
|
16
20
|
- (CGFloat)getHeadIndent {
|
|
17
21
|
// lists are drawn manually
|
|
18
22
|
// margin before bullet + gap between bullet and paragraph
|
|
19
|
-
return [_input->config unorderedListMarginLeft] +
|
|
23
|
+
return [_input->config unorderedListMarginLeft] +
|
|
24
|
+
[_input->config unorderedListGapWidth];
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
- (instancetype)initWithInput:(id)input {
|
|
@@ -27,99 +32,135 @@
|
|
|
27
32
|
|
|
28
33
|
- (void)applyStyle:(NSRange)range {
|
|
29
34
|
BOOL isStylePresent = [self detectStyle:range];
|
|
30
|
-
if(range.length >= 1) {
|
|
31
|
-
isStylePresent ? [self removeAttributes:range]
|
|
35
|
+
if (range.length >= 1) {
|
|
36
|
+
isStylePresent ? [self removeAttributes:range]
|
|
37
|
+
: [self addAttributes:range withTypingAttr:YES];
|
|
32
38
|
} else {
|
|
33
39
|
isStylePresent ? [self removeTypingAttributes] : [self addTypingAttributes];
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
// we assume correct paragraph range is already given
|
|
38
|
-
- (void)addAttributes:(NSRange)range {
|
|
39
|
-
NSTextList *bullet =
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
- (void)addAttributes:(NSRange)range withTypingAttr:(BOOL)withTypingAttr {
|
|
45
|
+
NSTextList *bullet =
|
|
46
|
+
[[NSTextList alloc] initWithMarkerFormat:NSTextListMarkerDisc options:0];
|
|
47
|
+
NSArray *paragraphs =
|
|
48
|
+
[ParagraphsUtils getSeparateParagraphsRangesIn:_input->textView
|
|
49
|
+
range:range];
|
|
50
|
+
// if we fill empty lines with zero width spaces, we need to offset later
|
|
51
|
+
// ranges
|
|
42
52
|
NSInteger offset = 0;
|
|
43
53
|
// needed for range adjustments
|
|
44
54
|
NSRange preModificationRange = _input->textView.selectedRange;
|
|
45
|
-
|
|
55
|
+
|
|
46
56
|
// let's not emit some weird selection changes or text/html changes
|
|
47
57
|
_input->blockEmitting = YES;
|
|
48
|
-
|
|
49
|
-
for(NSValue *value in paragraphs) {
|
|
58
|
+
|
|
59
|
+
for (NSValue *value in paragraphs) {
|
|
50
60
|
// take previous offsets into consideration
|
|
51
|
-
NSRange fixedRange = NSMakeRange([value rangeValue].location + offset,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
NSRange fixedRange = NSMakeRange([value rangeValue].location + offset,
|
|
62
|
+
[value rangeValue].length);
|
|
63
|
+
|
|
64
|
+
// length 0 with first line, length 1 and newline with some empty lines in
|
|
65
|
+
// the middle
|
|
66
|
+
if (fixedRange.length == 0 ||
|
|
67
|
+
(fixedRange.length == 1 &&
|
|
68
|
+
[[NSCharacterSet newlineCharacterSet]
|
|
69
|
+
characterIsMember:[_input->textView.textStorage.string
|
|
70
|
+
characterAtIndex:fixedRange.location]])) {
|
|
71
|
+
[TextInsertionUtils insertText:@"\u200B"
|
|
72
|
+
at:fixedRange.location
|
|
73
|
+
additionalAttributes:nullptr
|
|
74
|
+
input:_input
|
|
75
|
+
withSelection:NO];
|
|
59
76
|
fixedRange = NSMakeRange(fixedRange.location, fixedRange.length + 1);
|
|
60
77
|
offset += 1;
|
|
61
78
|
}
|
|
62
|
-
|
|
63
|
-
[_input->textView.textStorage
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
|
|
80
|
+
[_input->textView.textStorage
|
|
81
|
+
enumerateAttribute:NSParagraphStyleAttributeName
|
|
82
|
+
inRange:fixedRange
|
|
83
|
+
options:0
|
|
84
|
+
usingBlock:^(id _Nullable value, NSRange range,
|
|
85
|
+
BOOL *_Nonnull stop) {
|
|
86
|
+
NSMutableParagraphStyle *pStyle =
|
|
87
|
+
[(NSParagraphStyle *)value mutableCopy];
|
|
88
|
+
pStyle.textLists = @[ bullet ];
|
|
89
|
+
pStyle.headIndent = [self getHeadIndent];
|
|
90
|
+
pStyle.firstLineHeadIndent = [self getHeadIndent];
|
|
91
|
+
[_input->textView.textStorage
|
|
92
|
+
addAttribute:NSParagraphStyleAttributeName
|
|
93
|
+
value:pStyle
|
|
94
|
+
range:range];
|
|
95
|
+
}];
|
|
72
96
|
}
|
|
73
|
-
|
|
97
|
+
|
|
74
98
|
// back to emitting
|
|
75
99
|
_input->blockEmitting = NO;
|
|
76
|
-
|
|
77
|
-
if(preModificationRange.length == 0) {
|
|
78
|
-
// fix selection if only one line was possibly made a list and filled with a
|
|
100
|
+
|
|
101
|
+
if (preModificationRange.length == 0) {
|
|
102
|
+
// fix selection if only one line was possibly made a list and filled with a
|
|
103
|
+
// space
|
|
79
104
|
_input->textView.selectedRange = preModificationRange;
|
|
80
105
|
} else {
|
|
81
106
|
// in other cases, fix the selection with newly made offsets
|
|
82
|
-
_input->textView.selectedRange = NSMakeRange(
|
|
107
|
+
_input->textView.selectedRange = NSMakeRange(
|
|
108
|
+
preModificationRange.location, preModificationRange.length + offset);
|
|
83
109
|
}
|
|
84
|
-
|
|
110
|
+
|
|
85
111
|
// also add typing attributes
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
112
|
+
if (withTypingAttr) {
|
|
113
|
+
NSMutableDictionary *typingAttrs =
|
|
114
|
+
[_input->textView.typingAttributes mutableCopy];
|
|
115
|
+
NSMutableParagraphStyle *pStyle =
|
|
116
|
+
[typingAttrs[NSParagraphStyleAttributeName] mutableCopy];
|
|
117
|
+
pStyle.textLists = @[ bullet ];
|
|
118
|
+
pStyle.headIndent = [self getHeadIndent];
|
|
119
|
+
pStyle.firstLineHeadIndent = [self getHeadIndent];
|
|
120
|
+
typingAttrs[NSParagraphStyleAttributeName] = pStyle;
|
|
121
|
+
_input->textView.typingAttributes = typingAttrs;
|
|
122
|
+
}
|
|
93
123
|
}
|
|
94
124
|
|
|
95
125
|
// does pretty much the same as normal addAttributes, just need to get the range
|
|
96
126
|
- (void)addTypingAttributes {
|
|
97
|
-
[self addAttributes:_input->textView.selectedRange];
|
|
127
|
+
[self addAttributes:_input->textView.selectedRange withTypingAttr:YES];
|
|
98
128
|
}
|
|
99
129
|
|
|
100
130
|
- (void)removeAttributes:(NSRange)range {
|
|
101
|
-
NSArray *paragraphs =
|
|
102
|
-
|
|
131
|
+
NSArray *paragraphs =
|
|
132
|
+
[ParagraphsUtils getSeparateParagraphsRangesIn:_input->textView
|
|
133
|
+
range:range];
|
|
134
|
+
|
|
103
135
|
[_input->textView.textStorage beginEditing];
|
|
104
|
-
|
|
105
|
-
for(NSValue *value in paragraphs) {
|
|
136
|
+
|
|
137
|
+
for (NSValue *value in paragraphs) {
|
|
106
138
|
NSRange range = [value rangeValue];
|
|
107
|
-
[_input->textView.textStorage
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
139
|
+
[_input->textView.textStorage
|
|
140
|
+
enumerateAttribute:NSParagraphStyleAttributeName
|
|
141
|
+
inRange:range
|
|
142
|
+
options:0
|
|
143
|
+
usingBlock:^(id _Nullable value, NSRange range,
|
|
144
|
+
BOOL *_Nonnull stop) {
|
|
145
|
+
NSMutableParagraphStyle *pStyle =
|
|
146
|
+
[(NSParagraphStyle *)value mutableCopy];
|
|
147
|
+
pStyle.textLists = @[];
|
|
148
|
+
pStyle.headIndent = 0;
|
|
149
|
+
pStyle.firstLineHeadIndent = 0;
|
|
150
|
+
[_input->textView.textStorage
|
|
151
|
+
addAttribute:NSParagraphStyleAttributeName
|
|
152
|
+
value:pStyle
|
|
153
|
+
range:range];
|
|
154
|
+
}];
|
|
116
155
|
}
|
|
117
|
-
|
|
156
|
+
|
|
118
157
|
[_input->textView.textStorage endEditing];
|
|
119
|
-
|
|
158
|
+
|
|
120
159
|
// also remove typing attributes
|
|
121
|
-
NSMutableDictionary *typingAttrs =
|
|
122
|
-
|
|
160
|
+
NSMutableDictionary *typingAttrs =
|
|
161
|
+
[_input->textView.typingAttributes mutableCopy];
|
|
162
|
+
NSMutableParagraphStyle *pStyle =
|
|
163
|
+
[typingAttrs[NSParagraphStyleAttributeName] mutableCopy];
|
|
123
164
|
pStyle.textLists = @[];
|
|
124
165
|
pStyle.headIndent = 0;
|
|
125
166
|
pStyle.firstLineHeadIndent = 0;
|
|
@@ -127,24 +168,28 @@
|
|
|
127
168
|
_input->textView.typingAttributes = typingAttrs;
|
|
128
169
|
}
|
|
129
170
|
|
|
130
|
-
// needed for the sake of style conflicts, needs to do exactly the same as
|
|
171
|
+
// needed for the sake of style conflicts, needs to do exactly the same as
|
|
172
|
+
// removeAttribtues
|
|
131
173
|
- (void)removeTypingAttributes {
|
|
132
174
|
[self removeAttributes:_input->textView.selectedRange];
|
|
133
175
|
}
|
|
134
176
|
|
|
135
177
|
- (BOOL)handleBackspaceInRange:(NSRange)range replacementText:(NSString *)text {
|
|
136
|
-
if([self detectStyle:_input->textView.selectedRange] && text.length == 0) {
|
|
178
|
+
if ([self detectStyle:_input->textView.selectedRange] && text.length == 0) {
|
|
137
179
|
// backspace while the style is active
|
|
138
|
-
|
|
139
|
-
NSRange paragraphRange = [_input->textView.textStorage.string
|
|
140
|
-
|
|
141
|
-
|
|
180
|
+
|
|
181
|
+
NSRange paragraphRange = [_input->textView.textStorage.string
|
|
182
|
+
paragraphRangeForRange:_input->textView.selectedRange];
|
|
183
|
+
|
|
184
|
+
if (NSEqualRanges(_input->textView.selectedRange, NSMakeRange(0, 0))) {
|
|
142
185
|
// a backspace on the very first input's line list point
|
|
143
|
-
// it doesn't run textVieDidChange so we need to manually remove
|
|
186
|
+
// it doesn't run textVieDidChange so we need to manually remove
|
|
187
|
+
// attributes
|
|
144
188
|
[self removeAttributes:paragraphRange];
|
|
145
189
|
return YES;
|
|
146
|
-
} else if(range.location == paragraphRange.location - 1) {
|
|
147
|
-
// same case in other lines; here, the removed range location will be
|
|
190
|
+
} else if (range.location == paragraphRange.location - 1) {
|
|
191
|
+
// same case in other lines; here, the removed range location will be
|
|
192
|
+
// exactly 1 less than paragraph range location
|
|
148
193
|
[self removeAttributes:paragraphRange];
|
|
149
194
|
return YES;
|
|
150
195
|
}
|
|
@@ -152,24 +197,36 @@
|
|
|
152
197
|
return NO;
|
|
153
198
|
}
|
|
154
199
|
|
|
155
|
-
- (BOOL)tryHandlingListShorcutInRange:(NSRange)range
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
200
|
+
- (BOOL)tryHandlingListShorcutInRange:(NSRange)range
|
|
201
|
+
replacementText:(NSString *)text {
|
|
202
|
+
NSRange paragraphRange =
|
|
203
|
+
[_input->textView.textStorage.string paragraphRangeForRange:range];
|
|
204
|
+
// space was added - check if we are both at the paragraph beginning + 1
|
|
205
|
+
// character (which we want to be a dash)
|
|
206
|
+
if ([text isEqualToString:@" "] &&
|
|
207
|
+
range.location - 1 == paragraphRange.location) {
|
|
208
|
+
unichar charBefore = [_input->textView.textStorage.string
|
|
209
|
+
characterAtIndex:range.location - 1];
|
|
210
|
+
if (charBefore == '-') {
|
|
161
211
|
// we got a match - add a list if possible
|
|
162
|
-
if([_input handleStyleBlocksAndConflicts:[[self class] getStyleType]
|
|
212
|
+
if ([_input handleStyleBlocksAndConflicts:[[self class] getStyleType]
|
|
213
|
+
range:paragraphRange]) {
|
|
163
214
|
// don't emit during the replacing
|
|
164
215
|
_input->blockEmitting = YES;
|
|
165
|
-
|
|
216
|
+
|
|
166
217
|
// remove the dash
|
|
167
|
-
[TextInsertionUtils replaceText:@""
|
|
168
|
-
|
|
218
|
+
[TextInsertionUtils replaceText:@""
|
|
219
|
+
at:NSMakeRange(paragraphRange.location, 1)
|
|
220
|
+
additionalAttributes:nullptr
|
|
221
|
+
input:_input
|
|
222
|
+
withSelection:YES];
|
|
223
|
+
|
|
169
224
|
_input->blockEmitting = NO;
|
|
170
|
-
|
|
225
|
+
|
|
171
226
|
// add attributes on the dashless paragraph
|
|
172
|
-
[self addAttributes:NSMakeRange(paragraphRange.location,
|
|
227
|
+
[self addAttributes:NSMakeRange(paragraphRange.location,
|
|
228
|
+
paragraphRange.length - 1)
|
|
229
|
+
withTypingAttr:YES];
|
|
173
230
|
return YES;
|
|
174
231
|
}
|
|
175
232
|
}
|
|
@@ -177,41 +234,47 @@
|
|
|
177
234
|
return NO;
|
|
178
235
|
}
|
|
179
236
|
|
|
180
|
-
- (BOOL)styleCondition:(id _Nullable)value :(NSRange)range {
|
|
237
|
+
- (BOOL)styleCondition:(id _Nullable)value range:(NSRange)range {
|
|
181
238
|
NSParagraphStyle *paragraph = (NSParagraphStyle *)value;
|
|
182
|
-
return paragraph != nullptr && paragraph.textLists.count == 1 &&
|
|
239
|
+
return paragraph != nullptr && paragraph.textLists.count == 1 &&
|
|
240
|
+
paragraph.textLists.firstObject.markerFormat == NSTextListMarkerDisc;
|
|
183
241
|
}
|
|
184
242
|
|
|
185
243
|
- (BOOL)detectStyle:(NSRange)range {
|
|
186
|
-
if(range.length >= 1) {
|
|
187
|
-
return [OccurenceUtils detect:NSParagraphStyleAttributeName
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
244
|
+
if (range.length >= 1) {
|
|
245
|
+
return [OccurenceUtils detect:NSParagraphStyleAttributeName
|
|
246
|
+
withInput:_input
|
|
247
|
+
inRange:range
|
|
248
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
249
|
+
return [self styleCondition:value range:range];
|
|
250
|
+
}];
|
|
192
251
|
} else {
|
|
193
|
-
return [OccurenceUtils detect:NSParagraphStyleAttributeName
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
252
|
+
return [OccurenceUtils detect:NSParagraphStyleAttributeName
|
|
253
|
+
withInput:_input
|
|
254
|
+
atIndex:range.location
|
|
255
|
+
checkPrevious:YES
|
|
256
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
257
|
+
return [self styleCondition:value range:range];
|
|
258
|
+
}];
|
|
198
259
|
}
|
|
199
260
|
}
|
|
200
261
|
|
|
201
262
|
- (BOOL)anyOccurence:(NSRange)range {
|
|
202
|
-
return [OccurenceUtils any:NSParagraphStyleAttributeName
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
263
|
+
return [OccurenceUtils any:NSParagraphStyleAttributeName
|
|
264
|
+
withInput:_input
|
|
265
|
+
inRange:range
|
|
266
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
267
|
+
return [self styleCondition:value range:range];
|
|
268
|
+
}];
|
|
207
269
|
}
|
|
208
270
|
|
|
209
271
|
- (NSArray<StylePair *> *_Nullable)findAllOccurences:(NSRange)range {
|
|
210
|
-
return [OccurenceUtils all:NSParagraphStyleAttributeName
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
272
|
+
return [OccurenceUtils all:NSParagraphStyleAttributeName
|
|
273
|
+
withInput:_input
|
|
274
|
+
inRange:range
|
|
275
|
+
withCondition:^BOOL(id _Nullable value, NSRange range) {
|
|
276
|
+
return [self styleCondition:value range:range];
|
|
277
|
+
}];
|
|
215
278
|
}
|
|
216
279
|
|
|
217
280
|
@end
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
#pragma once
|
|
2
|
-
#import "StylePair.h"
|
|
3
2
|
#import "EnrichedTextInputView.h"
|
|
4
|
-
|
|
3
|
+
#import "StylePair.h"
|
|
5
4
|
|
|
6
5
|
@interface OccurenceUtils : NSObject
|
|
7
|
-
+ (BOOL)detect
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
+ (BOOL)detect
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
+ (BOOL)detectMultiple
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
+ (BOOL)any
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
+ (BOOL)anyMultiple
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
+ (NSArray<StylePair *> *_Nullable)all
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
6
|
+
+ (BOOL)detect:(NSAttributedStringKey _Nonnull)key
|
|
7
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
8
|
+
inRange:(NSRange)range
|
|
9
|
+
withCondition:(BOOL(NS_NOESCAPE ^ _Nonnull)(id _Nullable value,
|
|
10
|
+
NSRange range))condition;
|
|
11
|
+
+ (BOOL)detect:(NSAttributedStringKey _Nonnull)key
|
|
12
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
13
|
+
atIndex:(NSUInteger)index
|
|
14
|
+
checkPrevious:(BOOL)check
|
|
15
|
+
withCondition:(BOOL(NS_NOESCAPE ^ _Nonnull)(id _Nullable value,
|
|
16
|
+
NSRange range))condition;
|
|
17
|
+
+ (BOOL)detectMultiple:(NSArray<NSAttributedStringKey> *_Nonnull)keys
|
|
18
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
19
|
+
inRange:(NSRange)range
|
|
20
|
+
withCondition:(BOOL(NS_NOESCAPE ^ _Nonnull)(id _Nullable value,
|
|
21
|
+
NSRange range))condition;
|
|
22
|
+
+ (BOOL)any:(NSAttributedStringKey _Nonnull)key
|
|
23
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
24
|
+
inRange:(NSRange)range
|
|
25
|
+
withCondition:(BOOL(NS_NOESCAPE ^ _Nonnull)(id _Nullable value,
|
|
26
|
+
NSRange range))condition;
|
|
27
|
+
+ (BOOL)anyMultiple:(NSArray<NSAttributedStringKey> *_Nonnull)keys
|
|
28
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
29
|
+
inRange:(NSRange)range
|
|
30
|
+
withCondition:(BOOL(NS_NOESCAPE ^ _Nonnull)(id _Nullable value,
|
|
31
|
+
NSRange range))condition;
|
|
32
|
+
+ (NSArray<StylePair *> *_Nullable)all:(NSAttributedStringKey _Nonnull)key
|
|
33
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
34
|
+
inRange:(NSRange)range
|
|
35
|
+
withCondition:(BOOL(NS_NOESCAPE ^
|
|
36
|
+
_Nonnull)(id _Nullable value,
|
|
37
|
+
NSRange range))condition;
|
|
38
|
+
+ (NSArray<StylePair *> *_Nullable)
|
|
39
|
+
allMultiple:(NSArray<NSAttributedStringKey> *_Nonnull)keys
|
|
40
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
41
|
+
inRange:(NSRange)range
|
|
42
|
+
withCondition:(BOOL(NS_NOESCAPE ^ _Nonnull)(id _Nullable value,
|
|
43
|
+
NSRange range))condition;
|
|
44
|
+
+ (NSArray *_Nonnull)getRangesWithout:(NSArray<NSNumber *> *_Nonnull)types
|
|
45
|
+
withInput:(EnrichedTextInputView *_Nonnull)input
|
|
46
|
+
inRange:(NSRange)range;
|
|
47
47
|
@end
|