@proulr/sdui-components 0.1.0 → 0.1.3
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 +0 -1
- package/package.json +3 -1
- package/src/bdc/compile-bdc-to-wire.ts +14 -1
- package/src/bdc/components/native-blocks.tsx +1 -0
- package/src/bdc/index.ts +1 -0
- package/src/renderer/blocks/SduiNativeDomainBlocks.tsx +5 -0
- package/src/renderer/sdui-component-registry.tsx +2 -0
- package/src/renderer/sdui-hybrid-renderer-context.tsx +1 -0
- package/src/renderer/ui/app-glyphs.tsx +1246 -0
- package/src/renderer/ui/app-icon-size-catalog.ts +15 -0
- package/src/renderer/ui/app-icon.tsx +181 -0
- package/src/renderer/ui/compose-glyphs.tsx +22 -20
- package/src/renderer/ui/index.ts +49 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proulr/sdui-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"main": "./src/renderer/index.ts",
|
|
5
5
|
"types": "./src/renderer/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
"expo-linear-gradient": "~56.0.4",
|
|
56
56
|
"react": "19.2.3",
|
|
57
57
|
"react-native": "0.85.3",
|
|
58
|
+
"react-native-google-mobile-ads": "^16.3.4",
|
|
59
|
+
"react-native-safe-area-context": "~5.7.0",
|
|
58
60
|
"typescript": "~6.0.3"
|
|
59
61
|
}
|
|
60
62
|
}
|
|
@@ -44,6 +44,19 @@ function textFromChildren(children: BdcElement[]): string {
|
|
|
44
44
|
.trim();
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function mapHeaderToWire(header: Record<string, unknown>): SduiHeaderWire {
|
|
48
|
+
const wire: Record<string, unknown> = {};
|
|
49
|
+
for (const [key, value] of Object.entries(header)) {
|
|
50
|
+
if (key === 'slotBlocks' || key === 'slot_blocks' || key === 'headerSlot') continue;
|
|
51
|
+
if (key === 'headerSearch') {
|
|
52
|
+
wire.header_search = value;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
wire[camelToSnake(key)] = value;
|
|
56
|
+
}
|
|
57
|
+
return wire as SduiHeaderWire;
|
|
58
|
+
}
|
|
59
|
+
|
|
47
60
|
export function compileBdcBlock(element: BdcElement, path = '0'): SduiBlockWire {
|
|
48
61
|
return mapBlock(element, path);
|
|
49
62
|
}
|
|
@@ -105,7 +118,7 @@ export function compileBdcToWire(root: BdcElement): SduiScreenWire {
|
|
|
105
118
|
.filter((child) => child.type !== '_fragment')
|
|
106
119
|
.map((child, index) => mapBlock(child, String(index)));
|
|
107
120
|
|
|
108
|
-
const compiledHeader = header ?
|
|
121
|
+
const compiledHeader = header ? mapHeaderToWire(header as Record<string, unknown>) : undefined;
|
|
109
122
|
if (compiledHeader && headerSlot) {
|
|
110
123
|
const slotRoots = Array.isArray(headerSlot) ? headerSlot : [headerSlot];
|
|
111
124
|
compiledHeader.slot_blocks = slotRoots.map((slot, index) => mapBlock(slot, `header.${index}`));
|
|
@@ -29,6 +29,7 @@ export const ProfileOnboarding: BdcComponent = (props) => nativeBlock('profile_o
|
|
|
29
29
|
export const AlbumGrid: BdcComponent = (props) => nativeBlock('album_grid', props);
|
|
30
30
|
export const AlbumDetail: BdcComponent = (props) => nativeBlock('album_detail', props);
|
|
31
31
|
export const NewPostComposer: BdcComponent = (props) => nativeBlock('new_post_composer', props);
|
|
32
|
+
export const NewStoryComposer: BdcComponent = (props) => nativeBlock('new_story_composer', props);
|
|
32
33
|
export const PostComments: BdcComponent = (props) => nativeBlock('post_comments', props);
|
|
33
34
|
export const SocialProfile: BdcComponent = (props) => nativeBlock('social_profile', props);
|
|
34
35
|
export const SettingsHome: BdcComponent = (props) => nativeBlock('settings_home', props);
|
package/src/bdc/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ function NativeBlockShell({
|
|
|
31
31
|
| 'renderAlbumGrid'
|
|
32
32
|
| 'renderAlbumDetail'
|
|
33
33
|
| 'renderNewPostComposer'
|
|
34
|
+
| 'renderNewStoryComposer'
|
|
34
35
|
| 'renderPostComments'
|
|
35
36
|
| 'renderSocialProfile'
|
|
36
37
|
| 'renderSettingsHome'
|
|
@@ -118,6 +119,10 @@ export function SduiNewPostComposerBlock(props: SduiBlockRenderProps) {
|
|
|
118
119
|
return <NativeBlockShell {...props} rendererKey="renderNewPostComposer" fallbackLabel="Nova publicação" />;
|
|
119
120
|
}
|
|
120
121
|
|
|
122
|
+
export function SduiNewStoryComposerBlock(props: SduiBlockRenderProps) {
|
|
123
|
+
return <NativeBlockShell {...props} rendererKey="renderNewStoryComposer" fallbackLabel="Novo story" />;
|
|
124
|
+
}
|
|
125
|
+
|
|
121
126
|
export function SduiPostCommentsBlock(props: SduiBlockRenderProps) {
|
|
122
127
|
return <NativeBlockShell {...props} rendererKey="renderPostComments" fallbackLabel="Comentários" />;
|
|
123
128
|
}
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
SduiChatThreadBlock,
|
|
38
38
|
SduiFlashInboxListBlock,
|
|
39
39
|
SduiNewPostComposerBlock,
|
|
40
|
+
SduiNewStoryComposerBlock,
|
|
40
41
|
SduiPostCommentsBlock,
|
|
41
42
|
SduiProfileOnboardingBlock,
|
|
42
43
|
SduiProfileSelfBlock,
|
|
@@ -88,6 +89,7 @@ const REGISTRY: Record<string, SduiBlockComponent> = {
|
|
|
88
89
|
album_grid: SduiAlbumGridBlock,
|
|
89
90
|
album_detail: SduiAlbumDetailBlock,
|
|
90
91
|
new_post_composer: SduiNewPostComposerBlock,
|
|
92
|
+
new_story_composer: SduiNewStoryComposerBlock,
|
|
91
93
|
post_comments: SduiPostCommentsBlock,
|
|
92
94
|
social_profile: SduiSocialProfileBlock,
|
|
93
95
|
settings_home: SduiSettingsHomeBlock,
|
|
@@ -66,6 +66,7 @@ export type SduiHybridRenderers = {
|
|
|
66
66
|
renderAlbumGrid?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
67
67
|
renderAlbumDetail?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
68
68
|
renderNewPostComposer?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
69
|
+
renderNewStoryComposer?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
69
70
|
renderPostComments?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
70
71
|
renderSocialProfile?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
71
72
|
renderSettingsHome?: (props: SduiNativeBlockRenderProps) => ReactNode;
|