@momo-kits/native-kits 0.160.6 → 0.160.7-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(yarn react-native:*)",
|
|
5
|
+
"Read(//Users/phuc/.claude/skills/ai-skill-generator/**)",
|
|
6
|
+
"Bash(python3 scripts/install_skill.py --update)",
|
|
7
|
+
"Bash(cd /Users/phuc/momo-kits/.claude/skills/design-system-kits && mkdir -p .claude/skills/design-system-kits && mv SKILL.md README.md references .claude/skills/design-system-kits/)",
|
|
8
|
+
"Bash(mv .claude/skills/design-system-kits/* . && rmdir .claude/skills/design-system-kits && rmdir .claude/skills)",
|
|
9
|
+
"Bash(python3 scripts/migrate_screen.py --dry-run sample/shared/src/commonMain/kotlin/screens/ScreenUsage.kt)",
|
|
10
|
+
"Bash(python3 scripts/migrate_screen.py --dry-run sample/shared/src/commonMain/kotlin/screens/AnimatedHeaderUsage.kt sample/shared/src/commonMain/kotlin/screens/SnackBarScreenUsage.kt 2>&1)",
|
|
11
|
+
"Bash(python3 scripts/migrate_screen.py --dry-run sample/shared/src/commonMain/kotlin/screens/SnackBarScreenUsage.kt)",
|
|
12
|
+
"Bash(cp sample/shared/src/commonMain/kotlin/screens/SnackBarScreenUsage.kt /tmp/SnackBarScreenUsage.kt.orig && python3 scripts/migrate_screen.py sample/shared/src/commonMain/kotlin/screens/SnackBarScreenUsage.kt)",
|
|
13
|
+
"Bash(cp -r /Users/phuc/.claude/skills/migrate-screen-to-navigation-container /Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container)",
|
|
14
|
+
"Bash(mkdir -p /Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/scripts && mv /Users/phuc/momo-native-kits-2/momo-native-kits/scripts/migrate_screen.py /Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/scripts/migrate_screen.py)",
|
|
15
|
+
"Bash(python3 .claude/skills/migrate-screen-to-navigation-container/scripts/generate_eval_cases.py)",
|
|
16
|
+
"Bash(SKILL=\".claude/skills/migrate-screen-to-navigation-container\" && python3 $SKILL/scripts/migrate_screen.py $SKILL/eval/input/ 2>&1 | tail -20)",
|
|
17
|
+
"Bash(SKILL=\".claude/skills/migrate-screen-to-navigation-container\" && cp -r $SKILL/eval/input $SKILL/eval/output && python3 $SKILL/scripts/migrate_screen.py $SKILL/eval/output/ 2>&1 | tail -20)",
|
|
18
|
+
"Bash(SKILL=\".claude/skills/migrate-screen-to-navigation-container\" && cp -r $SKILL/eval/input $SKILL/eval/output && python3 $SKILL/scripts/migrate_screen.py $SKILL/eval/output/ 2>&1 | tail -25)",
|
|
19
|
+
"Bash(SKILL=\".claude/skills/migrate-screen-to-navigation-container\" && cp -r \"$SKILL/eval/input\" \"$SKILL/eval/output\" && python3 \"$SKILL/scripts/migrate_screen.py\" \"$SKILL/eval/output/\" 2>&1 | tail -25)",
|
|
20
|
+
"Bash(SKILL=\"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container\"\ncp -r \"$SKILL/eval/input\" \"$SKILL/eval/output\"\npython3 \"$SKILL/scripts/migrate_screen.py\" \"$SKILL/eval/output/\" 2>&1 | tail -25)",
|
|
21
|
+
"Bash(cd \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container\" && python3 scripts/eval_migration.py 2>&1 | tail -80)",
|
|
22
|
+
"Bash(cd \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container\" && python3 scripts/eval_migration.py 2>&1 | head -30)",
|
|
23
|
+
"Bash(SKILL=\"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container\" && rm -rf \"$SKILL/eval/output\" && cp -r \"$SKILL/eval/input\" \"$SKILL/eval/output\" && python3 \"$SKILL/scripts/migrate_screen.py\" \"$SKILL/eval/output/\" 2>&1 | tail -5)",
|
|
24
|
+
"Bash(SKILL=\"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container\"; rm -rf \"${SKILL}/eval/output\"; cp -r \"${SKILL}/eval/input\" \"${SKILL}/eval/output\" && python3 \"${SKILL}/scripts/migrate_screen.py\" \"${SKILL}/eval/output/\" 2>&1 | tail -5)",
|
|
25
|
+
"Bash(rm -rf \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/eval/output\" && cp -r \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/eval/input\" \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/eval/output\" && python3 \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/scripts/migrate_screen.py\" \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/eval/output/\" 2>&1 | tail -5)",
|
|
26
|
+
"Bash(python3 \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/scripts/eval_migration.py\" 2>&1 | head -35)",
|
|
27
|
+
"Bash(python3 \"/Users/phuc/momo-native-kits-2/momo-native-kits/.claude/skills/migrate-screen-to-navigation-container/scripts/eval_migration.py\" 2>&1 | grep -E \"^=|Files eval|Passed|Failed|A0[0-9]|Per-Group|Failures\" | head -40)",
|
|
28
|
+
"Bash(find /Users/phuc/momo-kits -name \"*.kt\" 2>/dev/null | head -20)"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
+
|
|
5
|
+
/// Posts `MoMoStatusBarTap.notificationName` on every status-bar tap.
|
|
6
|
+
/// The swizzle installs automatically at framework load (`+load`) — calling
|
|
7
|
+
/// `install` is a no-op kept for explicit/manual triggering.
|
|
8
|
+
@interface MoMoStatusBarTap : NSObject
|
|
9
|
+
@property (class, nonatomic, readonly) NSNotificationName notificationName;
|
|
10
|
+
+ (void)install;
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
#import <objc/message.h>
|
|
3
|
+
#import <objc/runtime.h>
|
|
4
|
+
#import "StatusBarTap.h"
|
|
5
|
+
|
|
6
|
+
// Performs the actual swizzle once per process. Safe to call multiple times.
|
|
7
|
+
static void mm_installStatusBarTapSwizzleOnce(void) {
|
|
8
|
+
static dispatch_once_t onceToken;
|
|
9
|
+
dispatch_once(&onceToken, ^{
|
|
10
|
+
Class cls = [UIStatusBarManager class];
|
|
11
|
+
SEL originalSelector = NSSelectorFromString(@"handleTapAction:");
|
|
12
|
+
SEL swizzledSelector = NSSelectorFromString(@"mm_handleTapAction:");
|
|
13
|
+
|
|
14
|
+
Method originalMethod = class_getInstanceMethod(cls, originalSelector);
|
|
15
|
+
Method swizzledMethod = class_getInstanceMethod(cls, swizzledSelector);
|
|
16
|
+
if (!originalMethod || !swizzledMethod) return;
|
|
17
|
+
|
|
18
|
+
// Verify the original method matches the (id) -> void shape we expect.
|
|
19
|
+
// Encoding may include byte offsets (e.g. "v32@0:8@16") so we filter
|
|
20
|
+
// digits out before comparing.
|
|
21
|
+
const char *encPtr = method_getTypeEncoding(originalMethod);
|
|
22
|
+
if (encPtr) {
|
|
23
|
+
NSMutableString *enc = [NSMutableString string];
|
|
24
|
+
for (const char *p = encPtr; *p; p++) {
|
|
25
|
+
if (!(*p >= '0' && *p <= '9')) [enc appendFormat:@"%c", *p];
|
|
26
|
+
}
|
|
27
|
+
if (![enc isEqualToString:@"v@:@"]) return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
BOOL didAdd = class_addMethod(cls,
|
|
31
|
+
originalSelector,
|
|
32
|
+
method_getImplementation(swizzledMethod),
|
|
33
|
+
method_getTypeEncoding(swizzledMethod));
|
|
34
|
+
if (didAdd) {
|
|
35
|
+
class_replaceMethod(cls,
|
|
36
|
+
swizzledSelector,
|
|
37
|
+
method_getImplementation(originalMethod),
|
|
38
|
+
method_getTypeEncoding(originalMethod));
|
|
39
|
+
} else {
|
|
40
|
+
method_exchangeImplementations(originalMethod, swizzledMethod);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@implementation MoMoStatusBarTap
|
|
46
|
+
+ (NSNotificationName)notificationName { return @"statusBarSelected"; }
|
|
47
|
+
+ (void)install { mm_installStatusBarTapSwizzleOnce(); }
|
|
48
|
+
@end
|
|
49
|
+
|
|
50
|
+
// MARK: - Swizzle target on UIStatusBarManager
|
|
51
|
+
// `mm_handleTapAction:` is the replacement IMP. After the add/exchange,
|
|
52
|
+
// this selector points at the original UIKit IMP — calling it inside
|
|
53
|
+
// the body invokes UIKit's real handler so UIScrollView.scrollsToTop
|
|
54
|
+
// and any other side effects continue to work.
|
|
55
|
+
|
|
56
|
+
@interface UIStatusBarManager (MoMoStatusBarTap)
|
|
57
|
+
@end
|
|
58
|
+
|
|
59
|
+
@implementation UIStatusBarManager (MoMoStatusBarTap)
|
|
60
|
+
|
|
61
|
+
// Auto-install at framework load. Commented out so the swizzle stays
|
|
62
|
+
// opt-in via `[MoMoStatusBarTap install]`. Uncomment to revert to
|
|
63
|
+
// auto-installation before main().
|
|
64
|
+
//
|
|
65
|
+
// + (void)load {
|
|
66
|
+
// mm_installStatusBarTapSwizzleOnce();
|
|
67
|
+
// }
|
|
68
|
+
|
|
69
|
+
- (void)mm_handleTapAction:(id)action {
|
|
70
|
+
[self mm_handleTapAction:action];
|
|
71
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:MoMoStatusBarTap.notificationName
|
|
72
|
+
object:nil];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@end
|
package/ios/native-kits.podspec
CHANGED
|
@@ -10,7 +10,8 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.ios.deployment_target = '15.0'
|
|
11
11
|
s.swift_version = '5.0'
|
|
12
12
|
|
|
13
|
-
s.source_files = "**/*.swift"
|
|
13
|
+
s.source_files = "**/*.{swift,m,h}"
|
|
14
|
+
s.public_header_files = "StatusBarTap/*.h"
|
|
14
15
|
s.framework = 'SwiftUI', 'Combine'
|
|
15
16
|
s.dependency 'SDWebImageSwiftUI'
|
|
16
17
|
s.dependency 'lottie-ios'
|