Skip to content

Commit ecb5b7e

Browse files
committed
Merge branch 'main' of github.com:microdotblog/microblog-react into develop
# Conflicts: # src/screens/share/post.js # src/stores/App.js
2 parents a6784f9 + 059cb56 commit ecb5b7e

27 files changed

+427
-272
lines changed

ios/MicroBlog_RN.xcodeproj/project.pbxproj

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
4B1233D429ECCC0100174307 /* MBHighlightingTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B1233D329ECCC0100174307 /* MBHighlightingTextManager.m */; };
2121
4B1233D729ECD7D200174307 /* MBHighlightingTextStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B1233D529ECD7D200174307 /* MBHighlightingTextStorage.m */; };
2222
4B1233D829ECD7D200174307 /* MBHighlightingTextStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B1233D529ECD7D200174307 /* MBHighlightingTextStorage.m */; };
23+
4B3498672AE86AA900233BA2 /* RCTInputAccessoryShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3498662AE86AA900233BA2 /* RCTInputAccessoryShadowView.m */; };
24+
4B3498682AE86AA900233BA2 /* RCTInputAccessoryShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3498662AE86AA900233BA2 /* RCTInputAccessoryShadowView.m */; };
2325
4B7619D129EC9E7A0030A495 /* MBHighlightingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B7619D029EC9E7A0030A495 /* MBHighlightingTextView.m */; };
2426
4B7619D229EC9E7A0030A495 /* MBHighlightingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B7619D029EC9E7A0030A495 /* MBHighlightingTextView.m */; };
2527
4B8CE8AB2A1FCC69006D79CF /* GetURL.js in Resources */ = {isa = PBXBuildFile; fileRef = 4B8CE8AA2A1FCC69006D79CF /* GetURL.js */; };
@@ -90,6 +92,8 @@
9092
4B1233D329ECCC0100174307 /* MBHighlightingTextManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MBHighlightingTextManager.m; path = MicroBlog_RN/MBHighlightingTextManager.m; sourceTree = "<group>"; };
9193
4B1233D529ECD7D200174307 /* MBHighlightingTextStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBHighlightingTextStorage.m; path = MicroBlog_RN/MBHighlightingTextStorage.m; sourceTree = "<group>"; };
9294
4B1233D629ECD7D200174307 /* MBHighlightingTextStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBHighlightingTextStorage.h; path = MicroBlog_RN/MBHighlightingTextStorage.h; sourceTree = "<group>"; };
95+
4B3498652AE86AA900233BA2 /* RCTInputAccessoryShadowView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RCTInputAccessoryShadowView.h; path = MicroBlog_RN/RCTInputAccessoryShadowView.h; sourceTree = "<group>"; };
96+
4B3498662AE86AA900233BA2 /* RCTInputAccessoryShadowView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RCTInputAccessoryShadowView.m; path = MicroBlog_RN/RCTInputAccessoryShadowView.m; sourceTree = "<group>"; };
9397
4B7619CF29EC9E7A0030A495 /* MBHighlightingTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MBHighlightingTextView.h; path = MicroBlog_RN/MBHighlightingTextView.h; sourceTree = "<group>"; };
9498
4B7619D029EC9E7A0030A495 /* MBHighlightingTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MBHighlightingTextView.m; path = MicroBlog_RN/MBHighlightingTextView.m; sourceTree = "<group>"; };
9599
4B8CE8AA2A1FCC69006D79CF /* GetURL.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = GetURL.js; sourceTree = "<group>"; };
@@ -177,6 +181,8 @@
177181
4B1233D529ECD7D200174307 /* MBHighlightingTextStorage.m */,
178182
4B06FCA629FABD0800E97371 /* UIScrollViewDelegate+Zooming.h */,
179183
4B06FCA729FABD0800E97371 /* UIScrollViewDelegate+Zooming.m */,
184+
4B3498652AE86AA900233BA2 /* RCTInputAccessoryShadowView.h */,
185+
4B3498662AE86AA900233BA2 /* RCTInputAccessoryShadowView.m */,
180186
13B07FB51A68108700A75B9A /* Images.xcassets */,
181187
13B07FB61A68108700A75B9A /* Info.plist */,
182188
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
@@ -603,6 +609,7 @@
603609
files = (
604610
0221AB3829D4327B00838597 /* ReactShareViewController.swift in Sources */,
605611
4B7619D229EC9E7A0030A495 /* MBHighlightingTextView.m in Sources */,
612+
4B3498682AE86AA900233BA2 /* RCTInputAccessoryShadowView.m in Sources */,
606613
4B1233D829ECD7D200174307 /* MBHighlightingTextStorage.m in Sources */,
607614
0221AB3529D42CE500838597 /* ShareViewController.swift in Sources */,
608615
4BAA745E2A24E56500953D91 /* MBHighlightingTextManager.m in Sources */,
@@ -619,6 +626,7 @@
619626
4B1233D429ECCC0100174307 /* MBHighlightingTextManager.m in Sources */,
620627
0251EE462716191A00B475D5 /* File.swift in Sources */,
621628
4B06FCA829FABD0800E97371 /* UIScrollViewDelegate+Zooming.m in Sources */,
629+
4B3498672AE86AA900233BA2 /* RCTInputAccessoryShadowView.m in Sources */,
622630
13B07FC11A68108700A75B9A /* main.m in Sources */,
623631
);
624632
runOnlyForDeploymentPostprocessing = 0;
@@ -674,6 +682,10 @@
674682
);
675683
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
676684
PRODUCT_NAME = "$(TARGET_NAME)";
685+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
686+
SUPPORTS_MACCATALYST = YES;
687+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
688+
TARGETED_DEVICE_FAMILY = 1;
677689
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MicroBlog_RN.app/MicroBlog_RN";
678690
};
679691
name = Debug;
@@ -699,6 +711,10 @@
699711
);
700712
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
701713
PRODUCT_NAME = "$(TARGET_NAME)";
714+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
715+
SUPPORTS_MACCATALYST = YES;
716+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
717+
TARGETED_DEVICE_FAMILY = 1;
702718
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MicroBlog_RN.app/MicroBlog_RN";
703719
};
704720
name = Release;
@@ -716,7 +732,7 @@
716732
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
717733
CODE_SIGN_ENTITLEMENTS = MicroBlog_Share/MicroBlog_Share.entitlements;
718734
CODE_SIGN_STYLE = Automatic;
719-
CURRENT_PROJECT_VERSION = 301;
735+
CURRENT_PROJECT_VERSION = 302;
720736
DEBUG_INFORMATION_FORMAT = dwarf;
721737
DEVELOPMENT_TEAM = 3F9MDJ6K4E;
722738
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -730,12 +746,15 @@
730746
"@executable_path/Frameworks",
731747
"@executable_path/../../Frameworks",
732748
);
733-
MARKETING_VERSION = 3.2.1;
749+
MARKETING_VERSION = 3.2.2;
734750
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
735751
MTL_FAST_MATH = YES;
736752
PRODUCT_BUNDLE_IDENTIFIER = "blog.micro.ios.MicroBlog-Share";
737753
PRODUCT_NAME = "$(TARGET_NAME)";
738754
SKIP_INSTALL = YES;
755+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
756+
SUPPORTS_MACCATALYST = NO;
757+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
739758
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
740759
SWIFT_EMIT_LOC_STRINGS = YES;
741760
SWIFT_OBJC_BRIDGING_HEADER = "MicroBlog_Share/MicroBlog_Share-Bridging-Header.h";
@@ -759,7 +778,7 @@
759778
CODE_SIGN_ENTITLEMENTS = MicroBlog_Share/MicroBlog_Share.entitlements;
760779
CODE_SIGN_STYLE = Automatic;
761780
COPY_PHASE_STRIP = NO;
762-
CURRENT_PROJECT_VERSION = 301;
781+
CURRENT_PROJECT_VERSION = 302;
763782
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
764783
DEVELOPMENT_TEAM = 3F9MDJ6K4E;
765784
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -773,11 +792,14 @@
773792
"@executable_path/Frameworks",
774793
"@executable_path/../../Frameworks",
775794
);
776-
MARKETING_VERSION = 3.2.1;
795+
MARKETING_VERSION = 3.2.2;
777796
MTL_FAST_MATH = YES;
778797
PRODUCT_BUNDLE_IDENTIFIER = "blog.micro.ios.MicroBlog-Share";
779798
PRODUCT_NAME = "$(TARGET_NAME)";
780799
SKIP_INSTALL = YES;
800+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
801+
SUPPORTS_MACCATALYST = NO;
802+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
781803
SWIFT_COMPILATION_MODE = wholemodule;
782804
SWIFT_EMIT_LOC_STRINGS = YES;
783805
SWIFT_OBJC_BRIDGING_HEADER = "MicroBlog_Share/MicroBlog_Share-Bridging-Header.h";
@@ -795,22 +817,25 @@
795817
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
796818
CLANG_ENABLE_MODULES = YES;
797819
CODE_SIGN_ENTITLEMENTS = MicroBlog_RN/MicroBlog_RN.entitlements;
798-
CURRENT_PROJECT_VERSION = 301;
820+
CURRENT_PROJECT_VERSION = 308;
799821
DEVELOPMENT_TEAM = 3F9MDJ6K4E;
800822
ENABLE_BITCODE = NO;
801823
INFOPLIST_FILE = MicroBlog_RN/Info.plist;
802824
LD_RUNPATH_SEARCH_PATHS = (
803825
"$(inherited)",
804826
"@executable_path/Frameworks",
805827
);
806-
MARKETING_VERSION = 3.2.1;
828+
MARKETING_VERSION = 3.2.3;
807829
OTHER_LDFLAGS = (
808830
"$(inherited)",
809831
"-ObjC",
810832
"-lc++",
811833
);
812834
PRODUCT_BUNDLE_IDENTIFIER = blog.micro.ios;
813835
PRODUCT_NAME = MicroBlog_RN;
836+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
837+
SUPPORTS_MACCATALYST = NO;
838+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
814839
SWIFT_OBJC_BRIDGING_HEADER = "MicroBlog_RN-Bridging-Header.h";
815840
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
816841
SWIFT_VERSION = 5.0;
@@ -827,21 +852,24 @@
827852
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
828853
CLANG_ENABLE_MODULES = YES;
829854
CODE_SIGN_ENTITLEMENTS = MicroBlog_RN/MicroBlog_RN.entitlements;
830-
CURRENT_PROJECT_VERSION = 301;
855+
CURRENT_PROJECT_VERSION = 308;
831856
DEVELOPMENT_TEAM = 3F9MDJ6K4E;
832857
INFOPLIST_FILE = MicroBlog_RN/Info.plist;
833858
LD_RUNPATH_SEARCH_PATHS = (
834859
"$(inherited)",
835860
"@executable_path/Frameworks",
836861
);
837-
MARKETING_VERSION = 3.2.1;
862+
MARKETING_VERSION = 3.2.3;
838863
OTHER_LDFLAGS = (
839864
"$(inherited)",
840865
"-ObjC",
841866
"-lc++",
842867
);
843868
PRODUCT_BUNDLE_IDENTIFIER = blog.micro.ios;
844869
PRODUCT_NAME = MicroBlog_RN;
870+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
871+
SUPPORTS_MACCATALYST = NO;
872+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
845873
SWIFT_OBJC_BRIDGING_HEADER = "MicroBlog_RN-Bridging-Header.h";
846874
SWIFT_VERSION = 5.0;
847875
TARGETED_DEVICE_FAMILY = "1,2";

ios/MicroBlog_RN/AppDelegate.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,21 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3636

3737
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
3838
[ReactNativeNavigation bootstrapWithBridge:bridge];
39-
40-
39+
4140
return YES;
4241
}
4342

43+
#if 0
44+
- (NSArray *) keyCommands
45+
{
46+
UIKeyCommand* cmd = [UIKeyCommand keyCommandWithInput:@"N" modifierFlags:UIKeyModifierCommand action:@selector(handleKeyCommand:) discoverabilityTitle:@"New Post"];
47+
return @[ cmd ];
48+
}
49+
#endif
50+
51+
- (void) handleKeyCommand:(UIKeyCommand *)command
52+
{
53+
}
4454

4555
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
4656
return [ReactNativeNavigation extraModulesForBridge:bridge];

ios/MicroBlog_RN/MBHighlightingTextManager.m

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,36 @@ @implementation MBHighlightingTextManager
4646
}
4747
}
4848

49+
RCT_CUSTOM_VIEW_PROPERTY(selection, NSString, MBHighlightingTextView)
50+
{
51+
if (json) {
52+
NSInteger start_pos = 0;
53+
NSInteger end_pos = 0;
54+
55+
NSString* s = [RCTConvert NSString:json];
56+
if (s.length > 0) {
57+
// start/end separated by a space, e.g. "0 5"
58+
NSArray* pieces = [s componentsSeparatedByString:@" "];
59+
start_pos = [[pieces firstObject] integerValue];
60+
end_pos = [[pieces lastObject] integerValue];
61+
}
62+
63+
self.textView.selectedRange = NSMakeRange(start_pos, end_pos - start_pos);
64+
}
65+
}
66+
67+
RCT_CUSTOM_VIEW_PROPERTY(autoFocus, BOOL, MBHighlightingTextView)
68+
{
69+
if (json) {
70+
BOOL needs_focus = [RCTConvert BOOL:json];
71+
if (needs_focus) {
72+
[self.textView becomeFirstResponder];
73+
}
74+
}
75+
}
76+
77+
#pragma mark -
78+
4979
+ (CGFloat) preferredTimelineFontSize
5080
{
5181
UIFont* font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
@@ -109,7 +139,7 @@ - (UIView *) view
109139
};
110140
NSAttributedString* attr_s = [[NSAttributedString alloc] initWithString:s attributes:attr_info];
111141
self.textView.attributedText = attr_s;
112-
self.textView.textContainerInset = UIEdgeInsetsMake (8, 5, 8, 5);
142+
self.textView.textContainerInset = UIEdgeInsetsMake (10, 5, 10, 5);
113143
self.textView.font = [UIFont systemFontOfSize:[[self class] preferredPostingFontSize]];
114144
[self.textStorage setAttributedString:attr_s];
115145

ios/MicroBlog_RN/MBHighlightingTextView.m

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ - (void) setupAccessoryView
3535
self.reactAccessoryView = v;
3636

3737
if (self.inputAccessoryView == nil) {
38-
[self becomeFirstResponder];
38+
// [self becomeFirstResponder];
3939
self.inputAccessoryView = [self.reactAccessoryView inputAccessoryView];
4040
[self reloadInputViews];
4141
}
4242
}
4343
}
4444

4545
- (void) adjustHeightForKeyboardHeight:(CGFloat)keyboardHeight
46+
{
47+
[self adjustHeightForKeyboardHeight:keyboardHeight animated:YES];
48+
}
49+
50+
- (void) adjustHeightForKeyboardHeight:(CGFloat)keyboardHeight animated:(BOOL)animated
4651
{
4752
// adjust position and height taking into account other views
4853
UIView* parent = self.superview;
@@ -63,20 +68,36 @@ - (void) adjustHeightForKeyboardHeight:(CGFloat)keyboardHeight
6368
}
6469
}
6570
}
71+
72+
NSLayoutConstraint* height_c = nil;
73+
for (NSLayoutConstraint* c in [self constraints]) {
74+
if (c.firstAttribute == NSLayoutAttributeHeight) {
75+
height_c = c;
76+
}
77+
}
6678

6779
CGRect r = parent.bounds;
6880
r.origin.y = top_views_height;
6981
r.size.height = r.size.height - bottom_views_height - keyboardHeight;
7082
self.frame = r;
71-
[self setContentOffset:CGPointZero animated:YES];
83+
84+
if (height_c) {
85+
// height_c.constant = r.size.height;
86+
}
87+
else {
88+
// height_c = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:r.size.height];
89+
// [self addConstraint:height_c];
90+
}
91+
92+
[self setContentOffset:CGPointZero animated:animated];
7293
}
7394
}
7495

7596
- (void) finishSetup
7697
{
7798
[self setupNotifications];
7899
[self setupAccessoryView];
79-
[self adjustHeightForKeyboardHeight:0];
100+
[self adjustHeightForKeyboardHeight:0 animated:NO];
80101
}
81102

82103
- (void) didSetProps:(NSArray<NSString *> *)changedProps
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// RCTInputAccessoryShadowView.h
3+
// MicroBlog_RN
4+
//
5+
// Created by Manton Reece on 10/24/23.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
#import <React/RCTInputAccessoryShadowView.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface RCTInputAccessoryShadowView (ScreenWidth)
14+
15+
@end
16+
17+
NS_ASSUME_NONNULL_END
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// RCTInputAccessoryShadowView.m
3+
// MicroBlog_RN
4+
//
5+
// Created by Manton Reece on 10/24/23.
6+
//
7+
8+
#import "RCTInputAccessoryShadowView.h"
9+
10+
@implementation RCTInputAccessoryShadowView (ScreenWidth)
11+
12+
- (void) insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex
13+
{
14+
[super insertReactSubview:subview atIndex:atIndex];
15+
16+
CGRect r = [[UIScreen mainScreen] bounds];
17+
subview.width = (YGValue) { r.size.width, YGUnitPoint };
18+
}
19+
20+
@end

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ target 'MicroBlog_RN' do
6363
config[:reactNativePath],
6464
:mac_catalyst_enabled => false
6565
)
66-
__apply_Xcode_12_5_M1_post_install_workaround(installer)
66+
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
6767
installer.pods_project.targets.each do |target|
6868
target.build_configurations.each do |config|
6969
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'

0 commit comments

Comments
 (0)