@momo-kits/foundation 0.169.16-beta.6 → 0.169.16-beta.8

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.
Files changed (47) hide show
  1. package/Application/BottomSheet.tsx +2 -2
  2. package/Application/BottomTab/BottomTabBar.styles.ts +1 -1
  3. package/Application/BottomTab/DuoTabBar.styles.ts +1 -1
  4. package/Application/BottomTab/Legacy/TabScreen.tsx +22 -16
  5. package/Application/BottomTab/Legacy/hooks.ts +1 -1
  6. package/Application/BottomTab/Legacy/index.tsx +1 -5
  7. package/Application/BottomTab/TabBarIcon.tsx +1 -1
  8. package/Application/BottomTab/TabScreen.tsx +22 -12
  9. package/Application/BottomTab/index.tsx +1 -1
  10. package/Application/Components/HeaderLeft.tsx +2 -2
  11. package/Application/Components/SearchHeader.tsx +2 -2
  12. package/Application/Components/SwipeBackHaptic.tsx +1 -1
  13. package/Application/Components/useToolkitActions.tsx +64 -34
  14. package/Application/ModalScreen.tsx +4 -4
  15. package/Application/NavigationContainer.tsx +18 -22
  16. package/Application/Navigator.ts +2 -7
  17. package/Application/StackScreen.tracking.ts +12 -22
  18. package/Application/StackScreen.tsx +34 -26
  19. package/Application/TooltipPortal.tsx +3 -3
  20. package/Application/WidgetContainer.tsx +77 -83
  21. package/Application/hooks.ts +1 -16
  22. package/Application/index.ts +0 -4
  23. package/Application/types.ts +3 -14
  24. package/Button/index.tsx +2 -2
  25. package/Divider/DashDivider.tsx +2 -2
  26. package/Divider/index.tsx +3 -3
  27. package/FoundationList/index.tsx +1 -1
  28. package/Icon/types.ts +2 -1
  29. package/Image/index.tsx +7 -62
  30. package/Image/styles.ts +0 -2
  31. package/Image/types.ts +1 -9
  32. package/Input/Input.tsx +2 -2
  33. package/Input/InputMoney.tsx +2 -7
  34. package/Input/InputMoneyView.tsx +2 -2
  35. package/Input/InputOTP.tsx +2 -2
  36. package/Input/InputPhoneNumber.tsx +2 -2
  37. package/Input/InputSearch.tsx +2 -2
  38. package/Input/InputTextArea.tsx +2 -2
  39. package/Input/SearchTextTyping.tsx +2 -2
  40. package/Input/SystemTextInput.tsx +1 -2
  41. package/Input/TextTyping.tsx +2 -7
  42. package/Pagination/types.ts +2 -6
  43. package/package.json +26 -28
  44. package/Application/KitsBindingProvider.tsx +0 -22
  45. package/Application/KitsHost.ts +0 -182
  46. package/Application/__tests__/KitsHost.test.ts +0 -76
  47. package/Application/types.binding.ts +0 -134
@@ -1,134 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { ToolGroup } from './types.header';
3
-
4
- /** `current` closes only this mini app; `all` goes back to the host home. */
5
- export type KitsDismissTarget = 'current' | 'all';
6
-
7
- /** Pending host call. Idempotent; the kit drops late callbacks after cancel. */
8
- export type KitsRequest = {
9
- cancel: () => void;
10
- };
11
-
12
- /** Host listener the kit removes on unmount. */
13
- export type KitsSubscription = {
14
- remove: () => void;
15
- };
16
-
17
- /** Mini app context as the kit holds it (`MiniAppContext`). */
18
- export type KitsMiniAppContext = Record<string, unknown>;
19
-
20
- /** Localized `{ vi, en }` text or a plain string, as in the mini app context. */
21
- export type KitsLocalizedText = string | { vi?: string; en?: string };
22
-
23
- /** Mini app shown in the help center sheet, mirroring native. */
24
- export type KitsHelpCenterRequest = {
25
- appId?: string;
26
- code?: string;
27
- name?: KitsLocalizedText;
28
- icon?: string;
29
- description?: KitsLocalizedText;
30
- };
31
-
32
- /** Tools of the header "more" sheet; `context` is the calling mini app. */
33
- export type KitsToolkitRequest = {
34
- tools: ToolGroup[];
35
- useSystemTools: boolean;
36
- context: KitsMiniAppContext;
37
- };
38
-
39
- /** Screen the host last recorded as shown, shared across mini apps. */
40
- export type KitsCurrentScreen = {
41
- screenName?: string;
42
- startTime?: number;
43
- };
44
-
45
- /** Performance trace of a screen: until loaded, or until interactive. */
46
- export type KitsScreenTraceKind = 'load' | 'interaction';
47
-
48
- /** Developer toast with a tracking event, shown only in debug hosts. */
49
- export type KitsDebugToast = {
50
- appId?: string;
51
- message: string;
52
- type: string;
53
- };
54
-
55
- /** Host notice popup with a single dismiss action. */
56
- export type KitsNoticePopup = {
57
- title: string;
58
- message: string;
59
- };
60
-
61
- /** Web page the host opens in its in-app browser. */
62
- export type KitsOpenWebRequest = {
63
- url: string;
64
- title?: string;
65
- };
66
-
67
- /**
68
- * Host services the kit calls, mirroring native `KitsBinding`. A method left out
69
- * falls back to the one installed in `KitsHost`, then to a no-op.
70
- * Callbacks fire only on success; containers borrow the binding and never close it.
71
- */
72
- export interface KitsBinding {
73
- dismiss?(target: KitsDismissTarget, data?: unknown): void;
74
- trackEvent?(eventName: string, attributes: Record<string, unknown>): void;
75
- getLanguage?(callback: (language: string) => void): KitsRequest;
76
- vibrateLight?(): void;
77
- checkFavorite?(
78
- appCode: string | undefined,
79
- callback: (isFavorite: boolean) => void,
80
- ): KitsRequest;
81
- /** `callback` gets whether the app is a favorite afterwards. */
82
- toggleFavorite?(
83
- appCode: string | undefined,
84
- callback: (isFavorite: boolean) => void,
85
- ): KitsRequest;
86
- showToolkit?(
87
- request: KitsToolkitRequest,
88
- onAction: (actionKey: string) => void,
89
- ): KitsRequest;
90
- /** The request stays open while the sheet may still emit events. */
91
- showHelpCenter?(request: KitsHelpCenterRequest): KitsRequest;
92
- logError?(message: string): void;
93
- /** RN only: host config by key, e.g. `font_scale_config`. */
94
- observeConfig?(
95
- key: string,
96
- callback: (value: unknown) => void,
97
- ): KitsSubscription;
98
- /** RN only: app codes on the home favorites after each home sync. */
99
- observeFavorites?(callback: (appCodes: string[]) => void): KitsSubscription;
100
- /** RN only. */
101
- getCurrentScreen?(
102
- callback: (screen: KitsCurrentScreen | undefined) => void,
103
- ): KitsRequest;
104
- /** RN only. */
105
- setCurrentScreen?(screen: KitsCurrentScreen): void;
106
- /** RN only: the mini app comes back to the foreground. */
107
- onFocusApp?(listener: () => void): KitsSubscription;
108
- /** RN only: `callback` gets the trace id to pass to `stopTrace`. */
109
- startScreenTrace?(
110
- kind: KitsScreenTraceKind,
111
- screenName: string,
112
- context: KitsMiniAppContext,
113
- callback: (traceId: string) => void,
114
- ): KitsRequest;
115
- /** RN only: `value` is the measured duration in seconds. */
116
- stopTrace?(traceId: string, value: number): void;
117
- /** RN only. */
118
- showToastDebug?(toast: KitsDebugToast): void;
119
- /** RN only. */
120
- showNoticePopup?(popup: KitsNoticePopup): void;
121
- /** RN only. */
122
- openWeb?(request: KitsOpenWebRequest): void;
123
- /** RN only. */
124
- startFeatureCode?(featureCode: string, params: Record<string, unknown>): void;
125
- }
126
-
127
- /** A binding with every method present, as containers resolve it. */
128
- export type ResolvedKitsBinding = Required<KitsBinding>;
129
-
130
- /** Props of `KitsBindingProvider`. */
131
- export type KitsBindingProviderProps = {
132
- binding: KitsBinding;
133
- children: ReactNode;
134
- };