@proulr/sdui-components 0.1.20 → 0.1.22
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/package.json +1 -1
- package/src/bdc/components/native-blocks.tsx +8 -4
- package/src/bdc/index.ts +5 -4
- package/src/catalog/app-icon-names.ts +1 -0
- package/src/renderer/blocks/SduiDiscoverBlocks.tsx +5 -0
- package/src/renderer/blocks/SduiNativeDomainBlocks.tsx +31 -20
- package/src/renderer/sdui-component-registry.tsx +10 -8
- package/src/renderer/sdui-hybrid-renderer-context.tsx +5 -4
- package/src/renderer/ui/app-icon.tsx +2 -0
- package/src/renderer/ui/compose-glyphs.tsx +38 -0
package/package.json
CHANGED
|
@@ -10,19 +10,17 @@ type NativeBlockProps = {
|
|
|
10
10
|
postIdRef?: string;
|
|
11
11
|
albumIdRef?: string;
|
|
12
12
|
profileIdRef?: string;
|
|
13
|
+
/** Wire `settings_page` — id da página filha (about, privacy, …). */
|
|
14
|
+
page?: string;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
function nativeBlock(type: string, props: NativeBlockProps): BdcElement {
|
|
16
18
|
return { type, props: { ...props }, children: [] };
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export const FlashInboxList: BdcComponent = (props) => nativeBlock('flash_inbox_list', props);
|
|
20
|
-
export const ChatInboxList: BdcComponent = (props) => nativeBlock('chat_inbox_list', props);
|
|
21
|
-
export const ProfileVisitsList: BdcComponent = (props) => nativeBlock('profile_visits_list', props);
|
|
22
21
|
export const ChatThread: BdcComponent = (props) => nativeBlock('chat_thread', props);
|
|
23
22
|
export const SocialPostFeed: BdcComponent = (props) => nativeBlock('social_post_feed', props);
|
|
24
23
|
export const ThoughtFeed: BdcComponent = (props) => nativeBlock('thought_feed', props);
|
|
25
|
-
export const VerticalVideoPager: BdcComponent = (props) => nativeBlock('vertical_video_pager', props);
|
|
26
24
|
export const ProfileView: BdcComponent = (props) => nativeBlock('profile_view', props);
|
|
27
25
|
export const ProfileSelf: BdcComponent = (props) => nativeBlock('profile_self', props);
|
|
28
26
|
export const ProfileSetup: BdcComponent = (props) => nativeBlock('profile_setup', props);
|
|
@@ -34,4 +32,10 @@ export const NewStoryComposer: BdcComponent = (props) => nativeBlock('new_story_
|
|
|
34
32
|
export const PostComments: BdcComponent = (props) => nativeBlock('post_comments', props);
|
|
35
33
|
export const SocialProfile: BdcComponent = (props) => nativeBlock('social_profile', props);
|
|
36
34
|
export const SettingsHome: BdcComponent = (props) => nativeBlock('settings_home', props);
|
|
35
|
+
export const SettingsPage: BdcComponent = (props) => nativeBlock('settings_page', props);
|
|
36
|
+
export const ChatGroupCreate: BdcComponent = (props) => nativeBlock('chat_group_create', props);
|
|
37
|
+
export const ChatGroupInfo: BdcComponent = (props) => nativeBlock('chat_group_info', props);
|
|
38
|
+
export const ChatGroupAddMembers: BdcComponent = (props) =>
|
|
39
|
+
nativeBlock('chat_group_add_members', props);
|
|
40
|
+
export const ChatGroupInvite: BdcComponent = (props) => nativeBlock('chat_group_invite', props);
|
|
37
41
|
export const DiscoverBrowseLocation: BdcComponent = (props) => nativeBlock('discover_browse_location', props);
|
package/src/bdc/index.ts
CHANGED
|
@@ -32,10 +32,7 @@ export { ProfileCompletionBanner, StoryRail } from './components/social';
|
|
|
32
32
|
export {
|
|
33
33
|
AlbumDetail,
|
|
34
34
|
AlbumGrid,
|
|
35
|
-
ChatInboxList,
|
|
36
35
|
ChatThread,
|
|
37
|
-
FlashInboxList,
|
|
38
|
-
ProfileVisitsList,
|
|
39
36
|
NewPostComposer,
|
|
40
37
|
NewStoryComposer,
|
|
41
38
|
PostComments,
|
|
@@ -46,9 +43,13 @@ export {
|
|
|
46
43
|
SocialPostFeed,
|
|
47
44
|
SocialProfile,
|
|
48
45
|
SettingsHome,
|
|
46
|
+
SettingsPage,
|
|
47
|
+
ChatGroupCreate,
|
|
48
|
+
ChatGroupInfo,
|
|
49
|
+
ChatGroupAddMembers,
|
|
50
|
+
ChatGroupInvite,
|
|
49
51
|
DiscoverBrowseLocation,
|
|
50
52
|
ThoughtFeed,
|
|
51
|
-
VerticalVideoPager,
|
|
52
53
|
} from './components/native-blocks';
|
|
53
54
|
export type { BdcElement } from './jsx-runtime';
|
|
54
55
|
export type { ScreenProps } from './components/ui';
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
13
13
|
import type { SduiBlock } from '@proulr/sdui-contract';
|
|
14
14
|
import { TextField as UiTextField } from '../ui/TextField';
|
|
15
|
+
import { AppIcon } from '../ui/app-icon';
|
|
15
16
|
import { colors, fonts, gradients, m3Colors, m3Elevation, m3Shape, spacing } from '../theme/proulr-theme';
|
|
16
17
|
import { resolveDataRef, resolveDataRefString } from '../lib/resolve-data-ref';
|
|
17
18
|
import { useSduiHybridRenderer } from '../sdui-hybrid-renderer-context';
|
|
@@ -128,6 +129,7 @@ export function SduiDiscoverProfileCardBlock({ block, data, onAction }: SduiBloc
|
|
|
128
129
|
) : null}
|
|
129
130
|
{person.traveling ? (
|
|
130
131
|
<View style={[styles.travelBadge, person.has_new_media ? styles.travelBadgeOffset : null]}>
|
|
132
|
+
<AppIcon name="travel" size={11} color={m3Colors.onSecondaryContainer} />
|
|
131
133
|
<Text style={styles.travelBadgeText}>Viajando</Text>
|
|
132
134
|
</View>
|
|
133
135
|
) : null}
|
|
@@ -411,6 +413,9 @@ const styles = StyleSheet.create({
|
|
|
411
413
|
position: 'absolute',
|
|
412
414
|
top: spacing.sm,
|
|
413
415
|
right: spacing.sm,
|
|
416
|
+
flexDirection: 'row',
|
|
417
|
+
alignItems: 'center',
|
|
418
|
+
gap: 4,
|
|
414
419
|
backgroundColor: m3Colors.secondaryContainer,
|
|
415
420
|
paddingHorizontal: 8,
|
|
416
421
|
paddingVertical: 3,
|
|
@@ -18,13 +18,9 @@ function NativeBlockShell({
|
|
|
18
18
|
fallbackLabel,
|
|
19
19
|
}: SduiBlockRenderProps & {
|
|
20
20
|
rendererKey:
|
|
21
|
-
| 'renderFlashInboxList'
|
|
22
|
-
| 'renderChatInboxList'
|
|
23
|
-
| 'renderProfileVisitsList'
|
|
24
21
|
| 'renderChatThread'
|
|
25
22
|
| 'renderSocialPostFeed'
|
|
26
23
|
| 'renderThoughtFeed'
|
|
27
|
-
| 'renderVerticalVideoPager'
|
|
28
24
|
| 'renderProfileView'
|
|
29
25
|
| 'renderProfileSelf'
|
|
30
26
|
| 'renderProfileSetup'
|
|
@@ -36,6 +32,11 @@ function NativeBlockShell({
|
|
|
36
32
|
| 'renderPostComments'
|
|
37
33
|
| 'renderSocialProfile'
|
|
38
34
|
| 'renderSettingsHome'
|
|
35
|
+
| 'renderSettingsPage'
|
|
36
|
+
| 'renderChatGroupCreate'
|
|
37
|
+
| 'renderChatGroupInfo'
|
|
38
|
+
| 'renderChatGroupAddMembers'
|
|
39
|
+
| 'renderChatGroupInvite'
|
|
39
40
|
| 'renderDiscoverBrowseLocation';
|
|
40
41
|
fallbackLabel: string;
|
|
41
42
|
}) {
|
|
@@ -68,18 +69,6 @@ function NativeBlockShell({
|
|
|
68
69
|
);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
export function SduiFlashInboxListBlock(props: SduiBlockRenderProps) {
|
|
72
|
-
return <NativeBlockShell {...props} rendererKey="renderFlashInboxList" fallbackLabel="Flashes" />;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function SduiChatInboxListBlock(props: SduiBlockRenderProps) {
|
|
76
|
-
return <NativeBlockShell {...props} rendererKey="renderChatInboxList" fallbackLabel="Chat" />;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function SduiProfileVisitsListBlock(props: SduiBlockRenderProps) {
|
|
80
|
-
return <NativeBlockShell {...props} rendererKey="renderProfileVisitsList" fallbackLabel="Visitas" />;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
72
|
export function SduiChatThreadBlock(props: SduiBlockRenderProps) {
|
|
84
73
|
return <NativeBlockShell {...props} rendererKey="renderChatThread" fallbackLabel="Conversa" />;
|
|
85
74
|
}
|
|
@@ -92,10 +81,6 @@ export function SduiThoughtFeedBlock(props: SduiBlockRenderProps) {
|
|
|
92
81
|
return <NativeBlockShell {...props} rendererKey="renderThoughtFeed" fallbackLabel="Vibes" />;
|
|
93
82
|
}
|
|
94
83
|
|
|
95
|
-
export function SduiVerticalVideoPagerBlock(props: SduiBlockRenderProps) {
|
|
96
|
-
return <NativeBlockShell {...props} rendererKey="renderVerticalVideoPager" fallbackLabel="Clips" />;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
84
|
export function SduiProfileViewBlock(props: SduiBlockRenderProps) {
|
|
100
85
|
return <NativeBlockShell {...props} rendererKey="renderProfileView" fallbackLabel="Perfil" />;
|
|
101
86
|
}
|
|
@@ -140,6 +125,32 @@ export function SduiSettingsHomeBlock(props: SduiBlockRenderProps) {
|
|
|
140
125
|
return <NativeBlockShell {...props} rendererKey="renderSettingsHome" fallbackLabel="Configurações" />;
|
|
141
126
|
}
|
|
142
127
|
|
|
128
|
+
export function SduiSettingsPageBlock(props: SduiBlockRenderProps) {
|
|
129
|
+
return <NativeBlockShell {...props} rendererKey="renderSettingsPage" fallbackLabel="Configurações" />;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function SduiChatGroupCreateBlock(props: SduiBlockRenderProps) {
|
|
133
|
+
return <NativeBlockShell {...props} rendererKey="renderChatGroupCreate" fallbackLabel="Novo grupo" />;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function SduiChatGroupInfoBlock(props: SduiBlockRenderProps) {
|
|
137
|
+
return <NativeBlockShell {...props} rendererKey="renderChatGroupInfo" fallbackLabel="Grupo" />;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function SduiChatGroupAddMembersBlock(props: SduiBlockRenderProps) {
|
|
141
|
+
return (
|
|
142
|
+
<NativeBlockShell
|
|
143
|
+
{...props}
|
|
144
|
+
rendererKey="renderChatGroupAddMembers"
|
|
145
|
+
fallbackLabel="Adicionar membros"
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function SduiChatGroupInviteBlock(props: SduiBlockRenderProps) {
|
|
151
|
+
return <NativeBlockShell {...props} rendererKey="renderChatGroupInvite" fallbackLabel="Convite" />;
|
|
152
|
+
}
|
|
153
|
+
|
|
143
154
|
export function SduiDiscoverBrowseLocationBlock(props: SduiBlockRenderProps) {
|
|
144
155
|
return (
|
|
145
156
|
<NativeBlockShell
|
|
@@ -43,10 +43,7 @@ import { SduiNativeAdBlock } from './blocks/SduiNativeAdBlock';
|
|
|
43
43
|
import {
|
|
44
44
|
SduiAlbumDetailBlock,
|
|
45
45
|
SduiAlbumGridBlock,
|
|
46
|
-
SduiChatInboxListBlock,
|
|
47
46
|
SduiChatThreadBlock,
|
|
48
|
-
SduiFlashInboxListBlock,
|
|
49
|
-
SduiProfileVisitsListBlock,
|
|
50
47
|
SduiNewPostComposerBlock,
|
|
51
48
|
SduiNewStoryComposerBlock,
|
|
52
49
|
SduiPostCommentsBlock,
|
|
@@ -57,9 +54,13 @@ import {
|
|
|
57
54
|
SduiSocialPostFeedBlock,
|
|
58
55
|
SduiSocialProfileBlock,
|
|
59
56
|
SduiSettingsHomeBlock,
|
|
57
|
+
SduiSettingsPageBlock,
|
|
58
|
+
SduiChatGroupCreateBlock,
|
|
59
|
+
SduiChatGroupInfoBlock,
|
|
60
|
+
SduiChatGroupAddMembersBlock,
|
|
61
|
+
SduiChatGroupInviteBlock,
|
|
60
62
|
SduiDiscoverBrowseLocationBlock,
|
|
61
63
|
SduiThoughtFeedBlock,
|
|
62
|
-
SduiVerticalVideoPagerBlock,
|
|
63
64
|
} from './blocks/SduiNativeDomainBlocks';
|
|
64
65
|
|
|
65
66
|
export type { SduiBlockRenderProps };
|
|
@@ -95,13 +96,9 @@ const REGISTRY: Record<string, SduiBlockComponent> = {
|
|
|
95
96
|
text_field: SduiTextFieldBlock,
|
|
96
97
|
story_rail: SduiStoryRailBlock,
|
|
97
98
|
profile_completion_banner: SduiProfileCompletionBannerBlock,
|
|
98
|
-
flash_inbox_list: SduiFlashInboxListBlock,
|
|
99
|
-
chat_inbox_list: SduiChatInboxListBlock,
|
|
100
|
-
profile_visits_list: SduiProfileVisitsListBlock,
|
|
101
99
|
chat_thread: SduiChatThreadBlock,
|
|
102
100
|
social_post_feed: SduiSocialPostFeedBlock,
|
|
103
101
|
thought_feed: SduiThoughtFeedBlock,
|
|
104
|
-
vertical_video_pager: SduiVerticalVideoPagerBlock,
|
|
105
102
|
profile_view: SduiProfileViewBlock,
|
|
106
103
|
profile_self: SduiProfileSelfBlock,
|
|
107
104
|
profile_setup: SduiProfileSetupBlock,
|
|
@@ -113,6 +110,11 @@ const REGISTRY: Record<string, SduiBlockComponent> = {
|
|
|
113
110
|
post_comments: SduiPostCommentsBlock,
|
|
114
111
|
social_profile: SduiSocialProfileBlock,
|
|
115
112
|
settings_home: SduiSettingsHomeBlock,
|
|
113
|
+
settings_page: SduiSettingsPageBlock,
|
|
114
|
+
chat_group_create: SduiChatGroupCreateBlock,
|
|
115
|
+
chat_group_info: SduiChatGroupInfoBlock,
|
|
116
|
+
chat_group_add_members: SduiChatGroupAddMembersBlock,
|
|
117
|
+
chat_group_invite: SduiChatGroupInviteBlock,
|
|
116
118
|
discover_browse_location: SduiDiscoverBrowseLocationBlock,
|
|
117
119
|
};
|
|
118
120
|
|
|
@@ -54,13 +54,9 @@ export type SduiHybridRenderers = {
|
|
|
54
54
|
onSubmit: () => void;
|
|
55
55
|
}) => ReactNode;
|
|
56
56
|
onDiscoverMapCenterChange?: (coords: { lat: number; lng: number }) => void;
|
|
57
|
-
renderFlashInboxList?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
58
|
-
renderChatInboxList?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
59
|
-
renderProfileVisitsList?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
60
57
|
renderChatThread?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
61
58
|
renderSocialPostFeed?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
62
59
|
renderThoughtFeed?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
63
|
-
renderVerticalVideoPager?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
64
60
|
renderProfileView?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
65
61
|
renderProfileSelf?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
66
62
|
renderProfileSetup?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
@@ -72,6 +68,11 @@ export type SduiHybridRenderers = {
|
|
|
72
68
|
renderPostComments?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
73
69
|
renderSocialProfile?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
74
70
|
renderSettingsHome?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
71
|
+
renderSettingsPage?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
72
|
+
renderChatGroupCreate?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
73
|
+
renderChatGroupInfo?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
74
|
+
renderChatGroupAddMembers?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
75
|
+
renderChatGroupInvite?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
75
76
|
renderDiscoverBrowseLocation?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
76
77
|
renderSegmentedTabs?: (props: {
|
|
77
78
|
block: SduiBlock;
|
|
@@ -76,6 +76,7 @@ import {
|
|
|
76
76
|
ComposeGalleryGlyph,
|
|
77
77
|
ComposeGlobeGlyph,
|
|
78
78
|
ComposeMentionGlyph,
|
|
79
|
+
ComposeTravelGlyph,
|
|
79
80
|
ComposeTrashGlyph,
|
|
80
81
|
ComposeVideoGlyph,
|
|
81
82
|
} from './compose-glyphs';
|
|
@@ -102,6 +103,7 @@ const ICON_REGISTRY: Record<AppIconName, ComponentType<AppChromeGlyphProps>> = {
|
|
|
102
103
|
camera: ComposeCameraGlyph,
|
|
103
104
|
trash: ComposeTrashGlyph,
|
|
104
105
|
globe: ComposeGlobeGlyph,
|
|
106
|
+
travel: ComposeTravelGlyph,
|
|
105
107
|
'tab-discover': AppChromeTabDiscoverGlyph,
|
|
106
108
|
'tab-vibes': AppChromeTabVibesGlyph,
|
|
107
109
|
'tab-flash': AppChromeTabFlashGlyph,
|
|
@@ -160,6 +160,44 @@ export function ComposeGlobeGlyph({ color = m3Colors.primary, size = 16 }: Glyph
|
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
/** Mala / viagem — chrome badge. */
|
|
164
|
+
export function ComposeTravelGlyph({ color = m3Colors.primary, size = 24 }: GlyphProps) {
|
|
165
|
+
const stroke = Math.max(1.4, size * 0.07);
|
|
166
|
+
const bodyW = size * 0.72;
|
|
167
|
+
const bodyH = size * 0.52;
|
|
168
|
+
const handleW = size * 0.34;
|
|
169
|
+
const handleH = size * 0.18;
|
|
170
|
+
return (
|
|
171
|
+
<View style={{ width: size, height: size, alignItems: 'center', justifyContent: 'center' }}>
|
|
172
|
+
<View
|
|
173
|
+
style={{
|
|
174
|
+
width: handleW,
|
|
175
|
+
height: handleH,
|
|
176
|
+
borderTopLeftRadius: handleW * 0.35,
|
|
177
|
+
borderTopRightRadius: handleW * 0.35,
|
|
178
|
+
borderWidth: stroke,
|
|
179
|
+
borderBottomWidth: 0,
|
|
180
|
+
borderColor: color,
|
|
181
|
+
marginBottom: -stroke,
|
|
182
|
+
}}
|
|
183
|
+
/>
|
|
184
|
+
<View
|
|
185
|
+
style={{
|
|
186
|
+
width: bodyW,
|
|
187
|
+
height: bodyH,
|
|
188
|
+
borderRadius: size * 0.1,
|
|
189
|
+
borderWidth: stroke,
|
|
190
|
+
borderColor: color,
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
justifyContent: 'center',
|
|
193
|
+
}}
|
|
194
|
+
>
|
|
195
|
+
<View style={{ width: stroke, height: bodyH * 0.55, backgroundColor: color, borderRadius: 1 }} />
|
|
196
|
+
</View>
|
|
197
|
+
</View>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
163
201
|
export function ComposeFollowersGlyph({ color = m3Colors.onPrimary, size = 20 }: GlyphProps) {
|
|
164
202
|
const head = size * 0.22;
|
|
165
203
|
return (
|