@mereb/app-messaging 0.0.5 → 0.0.6
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/dist/native.js +11 -8
- package/package.json +4 -1
package/dist/native.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
3
|
import { Text, View } from 'react-native';
|
|
4
|
+
import { tokens } from '@mereb/tokens/native';
|
|
4
5
|
import { createInMemoryMessagingStore } from './store.js';
|
|
5
6
|
export function MessagesScreen() {
|
|
7
|
+
const { color, radius, shadow, spacing } = tokens;
|
|
6
8
|
const store = useMemo(() => createInMemoryMessagingStore(), []);
|
|
7
9
|
const [version, setVersion] = useState(0);
|
|
8
10
|
const conversations = store.getConversations();
|
|
9
|
-
return (_jsxs(View, { style: { flex: 1, padding:
|
|
10
|
-
padding:
|
|
11
|
-
borderRadius:
|
|
11
|
+
return (_jsxs(View, { style: { flex: 1, padding: spacing.xxl, gap: spacing.lg, backgroundColor: color.surfaceAlt }, children: [_jsx(Text, { style: { fontWeight: '700', fontSize: 18, marginBottom: 8, color: color.text }, children: "Messaging" }), conversations.map((conversation) => (_jsxs(View, { style: {
|
|
12
|
+
padding: spacing.md,
|
|
13
|
+
borderRadius: radius.sm,
|
|
12
14
|
borderWidth: 1,
|
|
13
|
-
borderColor:
|
|
14
|
-
backgroundColor:
|
|
15
|
-
gap:
|
|
16
|
-
|
|
15
|
+
borderColor: color.borderStrong,
|
|
16
|
+
backgroundColor: color.surface,
|
|
17
|
+
gap: spacing.xxs,
|
|
18
|
+
...shadow.sm
|
|
19
|
+
}, children: [_jsx(Text, { style: { fontWeight: '600', fontSize: 16, color: color.text }, children: conversation.title }), _jsx(Text, { style: { color: color.textMuted }, children: conversation.lastMessage?.body ?? 'No messages yet' }), _jsxs(Text, { style: { color: color.textSubdued, fontSize: 12 }, children: ["Unread: ", conversation.unreadCount] })] }, conversation.id))), _jsx(Text, { onPress: () => {
|
|
17
20
|
store.sendMessage(conversations[0]?.id ?? 'conv-1', 'Sent from mobile preview', {
|
|
18
21
|
id: 'mobile-user',
|
|
19
22
|
name: 'You'
|
|
20
23
|
});
|
|
21
24
|
setVersion((v) => v + 1);
|
|
22
|
-
}, style: { color:
|
|
25
|
+
}, style: { color: color.primary, fontWeight: '600' }, children: "Send a quick test message" }), _jsxs(Text, { style: { color: color.textSubdued, fontSize: 12 }, children: ["Version ", version, " \u2022 This preview uses the package's local in-memory store. Web now uses the real messaging service."] })] }));
|
|
23
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mereb/app-messaging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Messaging experience primitives for Mereb applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
"dist",
|
|
37
37
|
"package.json"
|
|
38
38
|
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@mereb/tokens": "^0.0.8"
|
|
41
|
+
},
|
|
39
42
|
"peerDependencies": {
|
|
40
43
|
"expo-router": ">=3.0.0",
|
|
41
44
|
"react": ">=18.2.0",
|