@samirify/messenger 0.1.2 → 0.1.4
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/index.cjs +136 -17
- package/dist/native/index.cjs.map +1 -1
- package/dist/native/index.js +136 -17
- package/dist/native/index.js.map +1 -1
- package/package.json +4 -2
package/dist/native/index.cjs
CHANGED
|
@@ -278,6 +278,113 @@ function MessageBubble({ message }) {
|
|
|
278
278
|
}
|
|
279
279
|
);
|
|
280
280
|
}
|
|
281
|
+
function AttachImageIcon({
|
|
282
|
+
color,
|
|
283
|
+
size = 22,
|
|
284
|
+
style
|
|
285
|
+
}) {
|
|
286
|
+
const frame = size * 0.82;
|
|
287
|
+
const mountain = size * 0.28;
|
|
288
|
+
const sun = Math.max(3, size * 0.16);
|
|
289
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
290
|
+
reactNative.View,
|
|
291
|
+
{
|
|
292
|
+
style: [
|
|
293
|
+
{
|
|
294
|
+
width: size,
|
|
295
|
+
height: size,
|
|
296
|
+
alignItems: "center",
|
|
297
|
+
justifyContent: "center"
|
|
298
|
+
},
|
|
299
|
+
style
|
|
300
|
+
],
|
|
301
|
+
accessibilityElementsHidden: true,
|
|
302
|
+
importantForAccessibility: "no-hide-descendants",
|
|
303
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
304
|
+
reactNative.View,
|
|
305
|
+
{
|
|
306
|
+
style: {
|
|
307
|
+
width: frame,
|
|
308
|
+
height: frame * 0.78,
|
|
309
|
+
borderWidth: 1.75,
|
|
310
|
+
borderColor: color,
|
|
311
|
+
borderRadius: 3,
|
|
312
|
+
overflow: "hidden",
|
|
313
|
+
justifyContent: "flex-end"
|
|
314
|
+
},
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
317
|
+
reactNative.View,
|
|
318
|
+
{
|
|
319
|
+
style: {
|
|
320
|
+
position: "absolute",
|
|
321
|
+
top: size * 0.12,
|
|
322
|
+
left: size * 0.14,
|
|
323
|
+
width: sun,
|
|
324
|
+
height: sun,
|
|
325
|
+
borderRadius: sun / 2,
|
|
326
|
+
backgroundColor: color
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
),
|
|
330
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
331
|
+
reactNative.View,
|
|
332
|
+
{
|
|
333
|
+
style: {
|
|
334
|
+
alignSelf: "flex-start",
|
|
335
|
+
marginLeft: size * 0.08,
|
|
336
|
+
width: 0,
|
|
337
|
+
height: 0,
|
|
338
|
+
borderStyle: "solid",
|
|
339
|
+
borderLeftWidth: mountain * 0.55,
|
|
340
|
+
borderRightWidth: mountain * 0.55,
|
|
341
|
+
borderBottomWidth: mountain,
|
|
342
|
+
borderLeftColor: "transparent",
|
|
343
|
+
borderRightColor: "transparent",
|
|
344
|
+
borderBottomColor: color,
|
|
345
|
+
opacity: 0.9
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
function SendChevronIcon({
|
|
356
|
+
color,
|
|
357
|
+
size = 14
|
|
358
|
+
}) {
|
|
359
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
360
|
+
reactNative.View,
|
|
361
|
+
{
|
|
362
|
+
style: {
|
|
363
|
+
width: size,
|
|
364
|
+
height: size,
|
|
365
|
+
alignItems: "center",
|
|
366
|
+
justifyContent: "center"
|
|
367
|
+
},
|
|
368
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
369
|
+
reactNative.View,
|
|
370
|
+
{
|
|
371
|
+
style: {
|
|
372
|
+
width: 0,
|
|
373
|
+
height: 0,
|
|
374
|
+
marginLeft: size * 0.12,
|
|
375
|
+
borderStyle: "solid",
|
|
376
|
+
borderTopWidth: size * 0.38,
|
|
377
|
+
borderBottomWidth: size * 0.38,
|
|
378
|
+
borderLeftWidth: size * 0.55,
|
|
379
|
+
borderTopColor: "transparent",
|
|
380
|
+
borderBottomColor: "transparent",
|
|
381
|
+
borderLeftColor: color
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
}
|
|
281
388
|
function Composer({
|
|
282
389
|
sending,
|
|
283
390
|
onSend
|
|
@@ -298,12 +405,13 @@ function Composer({
|
|
|
298
405
|
await onSend(text, null);
|
|
299
406
|
setBody("");
|
|
300
407
|
}
|
|
408
|
+
const canSend = Boolean(body.trim()) && !sending;
|
|
301
409
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
302
410
|
reactNative.View,
|
|
303
411
|
{
|
|
304
412
|
style: {
|
|
305
413
|
flexDirection: isRtl ? "row-reverse" : "row",
|
|
306
|
-
alignItems: "
|
|
414
|
+
alignItems: "center",
|
|
307
415
|
gap: 8,
|
|
308
416
|
paddingHorizontal: 12,
|
|
309
417
|
paddingVertical: 10,
|
|
@@ -312,7 +420,25 @@ function Composer({
|
|
|
312
420
|
paddingBottom: reactNative.Platform.OS === "ios" ? 28 : 12
|
|
313
421
|
},
|
|
314
422
|
children: [
|
|
315
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
423
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
424
|
+
reactNative.TouchableOpacity,
|
|
425
|
+
{
|
|
426
|
+
onPress: onPick,
|
|
427
|
+
hitSlop: 10,
|
|
428
|
+
disabled: sending,
|
|
429
|
+
accessibilityRole: "button",
|
|
430
|
+
accessibilityLabel: "Attach image",
|
|
431
|
+
style: {
|
|
432
|
+
width: 40,
|
|
433
|
+
height: 40,
|
|
434
|
+
borderRadius: 20,
|
|
435
|
+
alignItems: "center",
|
|
436
|
+
justifyContent: "center",
|
|
437
|
+
opacity: sending ? 0.45 : 1
|
|
438
|
+
},
|
|
439
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(AttachImageIcon, { color: accentColor, size: 22 })
|
|
440
|
+
}
|
|
441
|
+
),
|
|
316
442
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
317
443
|
reactNative.TextInput,
|
|
318
444
|
{
|
|
@@ -327,11 +453,12 @@ function Composer({
|
|
|
327
453
|
style: {
|
|
328
454
|
flex: 1,
|
|
329
455
|
maxHeight: 100,
|
|
456
|
+
minHeight: 40,
|
|
330
457
|
borderWidth: 1,
|
|
331
458
|
borderColor: colors.border,
|
|
332
|
-
borderRadius:
|
|
459
|
+
borderRadius: 20,
|
|
333
460
|
paddingHorizontal: 14,
|
|
334
|
-
paddingVertical: 10,
|
|
461
|
+
paddingVertical: reactNative.Platform.OS === "ios" ? 10 : 8,
|
|
335
462
|
color: colors.text,
|
|
336
463
|
fontFamily: fonts.body,
|
|
337
464
|
textAlign: isRtl ? "right" : "left",
|
|
@@ -343,26 +470,18 @@ function Composer({
|
|
|
343
470
|
reactNative.TouchableOpacity,
|
|
344
471
|
{
|
|
345
472
|
onPress: onPressSend,
|
|
346
|
-
disabled:
|
|
473
|
+
disabled: !canSend,
|
|
474
|
+
accessibilityRole: "button",
|
|
475
|
+
accessibilityLabel: "Send message",
|
|
347
476
|
style: {
|
|
348
477
|
width: 40,
|
|
349
478
|
height: 40,
|
|
350
479
|
borderRadius: 20,
|
|
351
|
-
backgroundColor:
|
|
480
|
+
backgroundColor: canSend ? accentColor : colors.surfaceSecondary,
|
|
352
481
|
alignItems: "center",
|
|
353
482
|
justifyContent: "center"
|
|
354
483
|
},
|
|
355
|
-
children: sending ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: "#FFF", size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
356
|
-
reactNative.Text,
|
|
357
|
-
{
|
|
358
|
-
style: {
|
|
359
|
-
color: body.trim() ? "#FFF" : colors.textMuted,
|
|
360
|
-
fontSize: 16,
|
|
361
|
-
fontWeight: "700"
|
|
362
|
-
},
|
|
363
|
-
children: "\u27A4"
|
|
364
|
-
}
|
|
365
|
-
)
|
|
484
|
+
children: sending ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: "#FFF", size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(SendChevronIcon, { color: canSend ? "#FFF" : colors.textMuted, size: 14 })
|
|
366
485
|
}
|
|
367
486
|
)
|
|
368
487
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/native/InboxScreen.tsx","../../src/native/MessageBubble.tsx","../../src/native/Composer.tsx","../../src/native/ThreadScreen.tsx"],"names":["useMessengerConfig","jsx","Fragment","jsxs","View","Text","MessengerI18n","TouchableOpacity","useThreads","useOpenThread","ScrollView","RefreshControl","ActivityIndicator","Image","useState","Platform","TextInput","FeatureOff","useRef","useThread","useSendMessage","KeyboardAvoidingView","FlatList"],"mappings":";;;;;;;AAeA,SAAS,UAAA,GAAa;AACpB,EAAA,MAAM,EAAE,CAAA,EAAG,KAAA,EAAO,UAAA,EAAY,YAAA,KAAiBA,oCAAA,EAAmB;AAClE,EAAA,IAAI,YAAA,EAAc,uBAAOC,cAAA,CAAAC,mBAAA,EAAA,EAAG,QAAA,EAAA,YAAA,EAAa,EAAE,CAAA;AAC3C,EAAA,MAAM,EAAE,MAAA,EAAQ,WAAA,EAAY,GAAI,KAAA;AAChC,EAAA,uBACEC,eAAA;AAAA,IAACC,gBAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO;AAAA,QACL,IAAA,EAAM,CAAA;AAAA,QACN,iBAAiB,MAAA,CAAO,UAAA;AAAA,QACxB,UAAA,EAAY,QAAA;AAAA,QACZ,cAAA,EAAgB,QAAA;AAAA,QAChB,OAAA,EAAS;AAAA,OACX;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAAH,cAAA,CAACI,oBAAK,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,CAAO,WAAW,SAAA,EAAW,QAAA,EAAS,EACzD,QAAA,EAAA,CAAA,CAAEC,gC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CAAA;AAAA,YAElD,oCACErB,cAAAA;AAAA,cAACI,gBAAAA;AAAA,cAAA;AAAA,gBACC,KAAA,EAAO;AAAA,kBACL,OAAO,MAAA,CAAO,SAAA;AAAA,kBACd,SAAA,EAAW,QAAA;AAAA,kBACX,SAAA,EAAW,EAAA;AAAA,kBACX,YAAY,KAAA,CAAM;AAAA,iBACpB;AAAA,gBAEC,QAAA,EAAA,CAAA;AAAA,kBACCC,gCAAc,iBAAA,CAAkB,GAAA;AAAA,kBAChCA,gCAAc,iBAAA,CAAkB;AAAA;AAClC;AAAA,aACF;AAAA,YAEF,UAAA,EAAY,CAAC,EAAE,IAAA,uBACbL,cAAAA,CAAC,aAAA,EAAA,EAAc,OAAA,EAAS,IAAA,EAAM;AAAA;AAAA,SAElC;AAAA,wBAGFA,cAAAA,CAAC,QAAA,EAAA,EAAS,SAAS,YAAA,CAAa,SAAA,EAAW,QAAQ,UAAA,EAAY;AAAA;AAAA;AAAA,GACjE;AAEJ","file":"index.cjs","sourcesContent":["import React from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n ScrollView,\n RefreshControl,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThreads } from \"../hooks/useThreads\";\nimport { useOpenThread } from \"../hooks/useOpenThread\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { MessageThread } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, navigation, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n const { colors, accentColor } = theme;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 24,\n }}\n >\n <Text style={{ color: colors.textMuted, textAlign: \"center\" }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n <TouchableOpacity onPress={navigation.goBack} style={{ marginTop: 16 }}>\n <Text style={{ color: accentColor }}>\n {t(MessengerI18n.back.key, MessengerI18n.back.fallback)}\n </Text>\n </TouchableOpacity>\n </View>\n );\n}\n\nfunction ThreadRow({ thread }: { thread: MessageThread }) {\n const { user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const unread = Number(thread.unread_count ?? 0);\n\n return (\n <TouchableOpacity\n onPress={() => navigation.openThread(thread.id)}\n activeOpacity={0.8}\n >\n <View\n style={{\n marginBottom: 10,\n padding: 14,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <View style={{ flex: 1 }}>\n <Text\n style={{\n color: colors.text,\n fontFamily: fonts.displaySemiBold,\n fontWeight: \"600\",\n fontSize: 16,\n }}\n >\n {user?.role === \"admin\"\n ? thread.client_name ??\n t(MessengerI18n.client.key, MessengerI18n.client.fallback)\n : t(\n MessengerI18n.yourCoach.key,\n MessengerI18n.yourCoach.fallback\n )}\n </Text>\n <Text\n style={{\n color: colors.textSecondary,\n fontFamily: fonts.body,\n fontSize: 13,\n marginTop: 4,\n }}\n numberOfLines={1}\n >\n {thread.last_body ||\n (thread.last_image_url\n ? t(MessengerI18n.photo.key, MessengerI18n.photo.fallback)\n : t(\n MessengerI18n.noMessages.key,\n MessengerI18n.noMessages.fallback\n ))}\n </Text>\n </View>\n {unread > 0 && (\n <View\n style={{\n minWidth: 22,\n height: 22,\n borderRadius: 11,\n backgroundColor: accentColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n paddingHorizontal: 6,\n }}\n >\n <Text\n style={{\n color: \"#FFF\",\n fontSize: 11,\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {unread}\n </Text>\n </View>\n )}\n </View>\n </View>\n </TouchableOpacity>\n );\n}\n\nexport function InboxScreen() {\n const { enabled, user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const threadsQuery = useThreads();\n const openThread = useOpenThread();\n\n if (!enabled) return <FeatureOff />;\n\n const threads = threadsQuery.data ?? [];\n const loading = threadsQuery.isLoading && threads.length === 0;\n\n return (\n <View style={{ flex: 1, backgroundColor: colors.background }}>\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 22,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.inbox.key, MessengerI18n.inbox.fallback)}\n </Text>\n </View>\n\n <ScrollView\n contentContainerStyle={{ paddingHorizontal: 16, paddingBottom: 32 }}\n refreshControl={\n <RefreshControl\n refreshing={threadsQuery.isRefetching}\n onRefresh={() => void threadsQuery.refetch()}\n tintColor={accentColor}\n />\n }\n >\n {user?.role === \"client\" && threads.length === 0 && (\n <TouchableOpacity\n onPress={() => openThread.mutate(undefined)}\n disabled={openThread.isPending}\n style={{\n marginBottom: 14,\n paddingVertical: 14,\n borderRadius: 12,\n backgroundColor: accentColor,\n alignItems: \"center\",\n }}\n >\n {openThread.isPending ? (\n <ActivityIndicator color=\"#FFF\" />\n ) : (\n <Text\n style={{\n color: \"#FFF\",\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {t(\n MessengerI18n.messageCoach.key,\n MessengerI18n.messageCoach.fallback\n )}\n </Text>\n )}\n </TouchableOpacity>\n )}\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : threads.length === 0 ? (\n <View\n style={{\n alignItems: \"center\",\n paddingVertical: 40,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <Text style={{ fontSize: 28, color: colors.textMuted }}>···</Text>\n <Text\n style={{\n color: colors.textMuted,\n marginTop: 12,\n fontFamily: fonts.body,\n textAlign: \"center\",\n }}\n >\n {t(MessengerI18n.empty.key, MessengerI18n.empty.fallback)}\n </Text>\n </View>\n ) : (\n threads.map((th: MessageThread) => (\n <ThreadRow key={th.id} thread={th} />\n ))\n )}\n </ScrollView>\n </View>\n );\n}\n","import React from \"react\";\nimport { View, Text, Image } from \"react-native\";\nimport type { ChatMessage } from \"../types\";\nimport { useMessengerConfig } from \"../provider\";\n\nexport function MessageBubble({ message }: { message: ChatMessage }) {\n const { user, isRtl, theme } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const mine = message.sender_user_id === user?.id;\n\n return (\n <View\n style={{\n alignSelf: mine\n ? isRtl\n ? \"flex-start\"\n : \"flex-end\"\n : isRtl\n ? \"flex-end\"\n : \"flex-start\",\n maxWidth: \"80%\",\n marginBottom: 10,\n backgroundColor: mine ? accentColor : colors.surfaceSecondary,\n borderRadius: 16,\n paddingHorizontal: 12,\n paddingVertical: 10,\n }}\n >\n {message.image_url ? (\n <Image\n source={{ uri: message.image_url }}\n style={{\n width: 180,\n height: 180,\n borderRadius: 10,\n marginBottom: message.body ? 8 : 0,\n }}\n />\n ) : null}\n {message.body ? (\n <Text\n style={{\n color: mine ? \"#FFF\" : colors.text,\n fontFamily: fonts.body,\n fontSize: 15,\n }}\n >\n {message.body}\n </Text>\n ) : null}\n </View>\n );\n}\n","import React, { useState } from \"react\";\nimport {\n View,\n Text,\n TextInput,\n TouchableOpacity,\n ActivityIndicator,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { PickedImage } from \"../types\";\n\nexport function Composer({\n sending,\n onSend,\n}: {\n sending: boolean;\n onSend: (body: string, image?: PickedImage | null) => void | Promise<void>;\n}) {\n const { t, isRtl, theme, pickImage } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const [body, setBody] = useState(\"\");\n\n async function onPick() {\n const image = await pickImage();\n if (image) {\n await onSend(body, image);\n setBody(\"\");\n }\n }\n\n async function onPressSend() {\n if (!body.trim() || sending) return;\n const text = body;\n await onSend(text, null);\n setBody(\"\");\n }\n\n return (\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"flex-end\",\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 10,\n borderTopWidth: 1,\n borderTopColor: colors.border,\n paddingBottom: Platform.OS === \"ios\" ? 28 : 12,\n }}\n >\n <TouchableOpacity onPress={onPick} hitSlop={8} disabled={sending}>\n <Text style={{ fontSize: 22, color: accentColor }}>▣</Text>\n </TouchableOpacity>\n <TextInput\n value={body}\n onChangeText={setBody}\n placeholder={t(\n MessengerI18n.typeMessage.key,\n MessengerI18n.typeMessage.fallback\n )}\n placeholderTextColor={colors.textMuted}\n multiline\n style={{\n flex: 1,\n maxHeight: 100,\n borderWidth: 1,\n borderColor: colors.border,\n borderRadius: 16,\n paddingHorizontal: 14,\n paddingVertical: 10,\n color: colors.text,\n fontFamily: fonts.body,\n textAlign: isRtl ? \"right\" : \"left\",\n backgroundColor: colors.surface,\n }}\n />\n <TouchableOpacity\n onPress={onPressSend}\n disabled={sending || !body.trim()}\n style={{\n width: 40,\n height: 40,\n borderRadius: 20,\n backgroundColor: body.trim()\n ? accentColor\n : colors.surfaceSecondary,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {sending ? (\n <ActivityIndicator color=\"#FFF\" size=\"small\" />\n ) : (\n <Text\n style={{\n color: body.trim() ? \"#FFF\" : colors.textMuted,\n fontSize: 16,\n fontWeight: \"700\",\n }}\n >\n ➤\n </Text>\n )}\n </TouchableOpacity>\n </View>\n );\n}\n","import React, { useRef } from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n FlatList,\n KeyboardAvoidingView,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThread } from \"../hooks/useThread\";\nimport { useSendMessage } from \"../hooks/useSendMessage\";\nimport { MessageBubble } from \"./MessageBubble\";\nimport { Composer } from \"./Composer\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { ChatMessage, PickedImage } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: theme.colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Text style={{ color: theme.colors.textMuted }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n </View>\n );\n}\n\nexport function ThreadScreen({ threadId }: { threadId: number }) {\n const { enabled, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const listRef = useRef<FlatList<ChatMessage> | null>(null);\n const threadQuery = useThread(threadId);\n const sendMutation = useSendMessage(threadId);\n\n if (!enabled) return <FeatureOff />;\n\n const messages = threadQuery.data?.messages ?? [];\n const loading = threadQuery.isLoading && messages.length === 0;\n\n async function handleSend(body: string, image?: PickedImage | null) {\n if ((!body.trim() && !image) || sendMutation.isPending) return;\n await sendMutation.mutateAsync({ body, image });\n setTimeout(() => listRef.current?.scrollToEnd({ animated: true }), 100);\n }\n\n return (\n <KeyboardAvoidingView\n style={{ flex: 1, backgroundColor: colors.background }}\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n keyboardVerticalOffset={0}\n >\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.border,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 18,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.chat.key, MessengerI18n.chat.fallback)}\n </Text>\n </View>\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : (\n <FlatList\n ref={listRef}\n data={messages}\n keyExtractor={(m: ChatMessage) => String(m.id)}\n contentContainerStyle={{ padding: 16, paddingBottom: 8 }}\n onContentSizeChange={() =>\n listRef.current?.scrollToEnd({ animated: false })\n }\n ListEmptyComponent={\n <Text\n style={{\n color: colors.textMuted,\n textAlign: \"center\",\n marginTop: 40,\n fontFamily: fonts.body,\n }}\n >\n {t(\n MessengerI18n.startConversation.key,\n MessengerI18n.startConversation.fallback\n )}\n </Text>\n }\n renderItem={({ item }: { item: ChatMessage }) => (\n <MessageBubble message={item} />\n )}\n />\n )}\n\n <Composer sending={sendMutation.isPending} onSend={handleSend} />\n </KeyboardAvoidingView>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/native/InboxScreen.tsx","../../src/native/MessageBubble.tsx","../../src/native/icons.tsx","../../src/native/Composer.tsx","../../src/native/ThreadScreen.tsx"],"names":["useMessengerConfig","jsx","Fragment","jsxs","View","Text","MessengerI18n","TouchableOpacity","useThreads","useOpenThread","ScrollView","RefreshControl","ActivityIndicator","Image","useState","Platform","TextInput","FeatureOff","useRef","useThread","useSendMessage","KeyboardAvoidingView","FlatList"],"mappings":";;;;;;;AAeA,SAAS,UAAA,GAAa;AACpB,EAAA,MAAM,EAAE,CAAA,EAAG,KAAA,EAAO,UAAA,EAAY,YAAA,KAAiBA,oCAAA,EAAmB;AAClE,EAAA,IAAI,YAAA,EAAc,uBAAOC,cAAA,CAAAC,mBAAA,EAAA,EAAG,QAAA,EAAA,YAAA,EAAa,EAAE,CAAA;AAC3C,EAAA,MAAM,EAAE,MAAA,EAAQ,WAAA,EAAY,GAA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AAAA;AAAA,SAElC;AAAA,wBAGFA,cAAAA,CAAC,QAAA,EAAA,EAAS,SAAS,YAAA,CAAa,SAAA,EAAW,QAAQ,UAAA,EAAY;AAAA;AAAA;AAAA,GACjE;AAEJ","file":"index.cjs","sourcesContent":["import React from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n ScrollView,\n RefreshControl,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThreads } from \"../hooks/useThreads\";\nimport { useOpenThread } from \"../hooks/useOpenThread\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { MessageThread } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, navigation, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n const { colors, accentColor } = theme;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 24,\n }}\n >\n <Text style={{ color: colors.textMuted, textAlign: \"center\" }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n <TouchableOpacity onPress={navigation.goBack} style={{ marginTop: 16 }}>\n <Text style={{ color: accentColor }}>\n {t(MessengerI18n.back.key, MessengerI18n.back.fallback)}\n </Text>\n </TouchableOpacity>\n </View>\n );\n}\n\nfunction ThreadRow({ thread }: { thread: MessageThread }) {\n const { user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const unread = Number(thread.unread_count ?? 0);\n\n return (\n <TouchableOpacity\n onPress={() => navigation.openThread(thread.id)}\n activeOpacity={0.8}\n >\n <View\n style={{\n marginBottom: 10,\n padding: 14,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <View style={{ flex: 1 }}>\n <Text\n style={{\n color: colors.text,\n fontFamily: fonts.displaySemiBold,\n fontWeight: \"600\",\n fontSize: 16,\n }}\n >\n {user?.role === \"admin\"\n ? thread.client_name ??\n t(MessengerI18n.client.key, MessengerI18n.client.fallback)\n : t(\n MessengerI18n.yourCoach.key,\n MessengerI18n.yourCoach.fallback\n )}\n </Text>\n <Text\n style={{\n color: colors.textSecondary,\n fontFamily: fonts.body,\n fontSize: 13,\n marginTop: 4,\n }}\n numberOfLines={1}\n >\n {thread.last_body ||\n (thread.last_image_url\n ? t(MessengerI18n.photo.key, MessengerI18n.photo.fallback)\n : t(\n MessengerI18n.noMessages.key,\n MessengerI18n.noMessages.fallback\n ))}\n </Text>\n </View>\n {unread > 0 && (\n <View\n style={{\n minWidth: 22,\n height: 22,\n borderRadius: 11,\n backgroundColor: accentColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n paddingHorizontal: 6,\n }}\n >\n <Text\n style={{\n color: \"#FFF\",\n fontSize: 11,\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {unread}\n </Text>\n </View>\n )}\n </View>\n </View>\n </TouchableOpacity>\n );\n}\n\nexport function InboxScreen() {\n const { enabled, user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const threadsQuery = useThreads();\n const openThread = useOpenThread();\n\n if (!enabled) return <FeatureOff />;\n\n const threads = threadsQuery.data ?? [];\n const loading = threadsQuery.isLoading && threads.length === 0;\n\n return (\n <View style={{ flex: 1, backgroundColor: colors.background }}>\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 22,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.inbox.key, MessengerI18n.inbox.fallback)}\n </Text>\n </View>\n\n <ScrollView\n contentContainerStyle={{ paddingHorizontal: 16, paddingBottom: 32 }}\n refreshControl={\n <RefreshControl\n refreshing={threadsQuery.isRefetching}\n onRefresh={() => void threadsQuery.refetch()}\n tintColor={accentColor}\n />\n }\n >\n {user?.role === \"client\" && threads.length === 0 && (\n <TouchableOpacity\n onPress={() => openThread.mutate(undefined)}\n disabled={openThread.isPending}\n style={{\n marginBottom: 14,\n paddingVertical: 14,\n borderRadius: 12,\n backgroundColor: accentColor,\n alignItems: \"center\",\n }}\n >\n {openThread.isPending ? (\n <ActivityIndicator color=\"#FFF\" />\n ) : (\n <Text\n style={{\n color: \"#FFF\",\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {t(\n MessengerI18n.messageCoach.key,\n MessengerI18n.messageCoach.fallback\n )}\n </Text>\n )}\n </TouchableOpacity>\n )}\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : threads.length === 0 ? (\n <View\n style={{\n alignItems: \"center\",\n paddingVertical: 40,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <Text style={{ fontSize: 28, color: colors.textMuted }}>···</Text>\n <Text\n style={{\n color: colors.textMuted,\n marginTop: 12,\n fontFamily: fonts.body,\n textAlign: \"center\",\n }}\n >\n {t(MessengerI18n.empty.key, MessengerI18n.empty.fallback)}\n </Text>\n </View>\n ) : (\n threads.map((th: MessageThread) => (\n <ThreadRow key={th.id} thread={th} />\n ))\n )}\n </ScrollView>\n </View>\n );\n}\n","import React from \"react\";\nimport { View, Text, Image } from \"react-native\";\nimport type { ChatMessage } from \"../types\";\nimport { useMessengerConfig } from \"../provider\";\n\nexport function MessageBubble({ message }: { message: ChatMessage }) {\n const { user, isRtl, theme } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const mine = message.sender_user_id === user?.id;\n\n return (\n <View\n style={{\n alignSelf: mine\n ? isRtl\n ? \"flex-start\"\n : \"flex-end\"\n : isRtl\n ? \"flex-end\"\n : \"flex-start\",\n maxWidth: \"80%\",\n marginBottom: 10,\n backgroundColor: mine ? accentColor : colors.surfaceSecondary,\n borderRadius: 16,\n paddingHorizontal: 12,\n paddingVertical: 10,\n }}\n >\n {message.image_url ? (\n <Image\n source={{ uri: message.image_url }}\n style={{\n width: 180,\n height: 180,\n borderRadius: 10,\n marginBottom: message.body ? 8 : 0,\n }}\n />\n ) : null}\n {message.body ? (\n <Text\n style={{\n color: mine ? \"#FFF\" : colors.text,\n fontFamily: fonts.body,\n fontSize: 15,\n }}\n >\n {message.body}\n </Text>\n ) : null}\n </View>\n );\n}\n","import React from \"react\";\nimport { View, type StyleProp, type ViewStyle } from \"react-native\";\n\n/** Landscape image glyph — no emoji / unicode font dependency. */\nexport function AttachImageIcon({\n color,\n size = 22,\n style,\n}: {\n color: string;\n size?: number;\n style?: StyleProp<ViewStyle>;\n}) {\n const frame = size * 0.82;\n const mountain = size * 0.28;\n const sun = Math.max(3, size * 0.16);\n\n return (\n <View\n style={[\n {\n width: size,\n height: size,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n style,\n ]}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n >\n <View\n style={{\n width: frame,\n height: frame * 0.78,\n borderWidth: 1.75,\n borderColor: color,\n borderRadius: 3,\n overflow: \"hidden\",\n justifyContent: \"flex-end\",\n }}\n >\n <View\n style={{\n position: \"absolute\",\n top: size * 0.12,\n left: size * 0.14,\n width: sun,\n height: sun,\n borderRadius: sun / 2,\n backgroundColor: color,\n }}\n />\n <View\n style={{\n alignSelf: \"flex-start\",\n marginLeft: size * 0.08,\n width: 0,\n height: 0,\n borderStyle: \"solid\",\n borderLeftWidth: mountain * 0.55,\n borderRightWidth: mountain * 0.55,\n borderBottomWidth: mountain,\n borderLeftColor: \"transparent\",\n borderRightColor: \"transparent\",\n borderBottomColor: color,\n opacity: 0.9,\n }}\n />\n </View>\n </View>\n );\n}\n\n/** Send chevron drawn with Views so it aligns in the circular button. */\nexport function SendChevronIcon({\n color,\n size = 14,\n}: {\n color: string;\n size?: number;\n}) {\n return (\n <View\n style={{\n width: size,\n height: size,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <View\n style={{\n width: 0,\n height: 0,\n marginLeft: size * 0.12,\n borderStyle: \"solid\",\n borderTopWidth: size * 0.38,\n borderBottomWidth: size * 0.38,\n borderLeftWidth: size * 0.55,\n borderTopColor: \"transparent\",\n borderBottomColor: \"transparent\",\n borderLeftColor: color,\n }}\n />\n </View>\n );\n}\n","import React, { useState } from \"react\";\nimport {\n View,\n TextInput,\n TouchableOpacity,\n ActivityIndicator,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { PickedImage } from \"../types\";\nimport { AttachImageIcon, SendChevronIcon } from \"./icons\";\n\nexport function Composer({\n sending,\n onSend,\n}: {\n sending: boolean;\n onSend: (body: string, image?: PickedImage | null) => void | Promise<void>;\n}) {\n const { t, isRtl, theme, pickImage } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const [body, setBody] = useState(\"\");\n\n async function onPick() {\n const image = await pickImage();\n if (image) {\n await onSend(body, image);\n setBody(\"\");\n }\n }\n\n async function onPressSend() {\n if (!body.trim() || sending) return;\n const text = body;\n await onSend(text, null);\n setBody(\"\");\n }\n\n const canSend = Boolean(body.trim()) && !sending;\n\n return (\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 10,\n borderTopWidth: 1,\n borderTopColor: colors.border,\n paddingBottom: Platform.OS === \"ios\" ? 28 : 12,\n }}\n >\n <TouchableOpacity\n onPress={onPick}\n hitSlop={10}\n disabled={sending}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Attach image\"\n style={{\n width: 40,\n height: 40,\n borderRadius: 20,\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: sending ? 0.45 : 1,\n }}\n >\n <AttachImageIcon color={accentColor} size={22} />\n </TouchableOpacity>\n <TextInput\n value={body}\n onChangeText={setBody}\n placeholder={t(\n MessengerI18n.typeMessage.key,\n MessengerI18n.typeMessage.fallback\n )}\n placeholderTextColor={colors.textMuted}\n multiline\n style={{\n flex: 1,\n maxHeight: 100,\n minHeight: 40,\n borderWidth: 1,\n borderColor: colors.border,\n borderRadius: 20,\n paddingHorizontal: 14,\n paddingVertical: Platform.OS === \"ios\" ? 10 : 8,\n color: colors.text,\n fontFamily: fonts.body,\n textAlign: isRtl ? \"right\" : \"left\",\n backgroundColor: colors.surface,\n }}\n />\n <TouchableOpacity\n onPress={onPressSend}\n disabled={!canSend}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Send message\"\n style={{\n width: 40,\n height: 40,\n borderRadius: 20,\n backgroundColor: canSend ? accentColor : colors.surfaceSecondary,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {sending ? (\n <ActivityIndicator color=\"#FFF\" size=\"small\" />\n ) : (\n <SendChevronIcon color={canSend ? \"#FFF\" : colors.textMuted} size={14} />\n )}\n </TouchableOpacity>\n </View>\n );\n}\n","import React, { useRef } from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n FlatList,\n KeyboardAvoidingView,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThread } from \"../hooks/useThread\";\nimport { useSendMessage } from \"../hooks/useSendMessage\";\nimport { MessageBubble } from \"./MessageBubble\";\nimport { Composer } from \"./Composer\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { ChatMessage, PickedImage } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: theme.colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Text style={{ color: theme.colors.textMuted }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n </View>\n );\n}\n\nexport function ThreadScreen({ threadId }: { threadId: number }) {\n const { enabled, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const listRef = useRef<FlatList<ChatMessage> | null>(null);\n const threadQuery = useThread(threadId);\n const sendMutation = useSendMessage(threadId);\n\n if (!enabled) return <FeatureOff />;\n\n const messages = threadQuery.data?.messages ?? [];\n const loading = threadQuery.isLoading && messages.length === 0;\n\n async function handleSend(body: string, image?: PickedImage | null) {\n if ((!body.trim() && !image) || sendMutation.isPending) return;\n await sendMutation.mutateAsync({ body, image });\n setTimeout(() => listRef.current?.scrollToEnd({ animated: true }), 100);\n }\n\n return (\n <KeyboardAvoidingView\n style={{ flex: 1, backgroundColor: colors.background }}\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n keyboardVerticalOffset={0}\n >\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.border,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 18,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.chat.key, MessengerI18n.chat.fallback)}\n </Text>\n </View>\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : (\n <FlatList\n ref={listRef}\n data={messages}\n keyExtractor={(m: ChatMessage) => String(m.id)}\n contentContainerStyle={{ padding: 16, paddingBottom: 8 }}\n onContentSizeChange={() =>\n listRef.current?.scrollToEnd({ animated: false })\n }\n ListEmptyComponent={\n <Text\n style={{\n color: colors.textMuted,\n textAlign: \"center\",\n marginTop: 40,\n fontFamily: fonts.body,\n }}\n >\n {t(\n MessengerI18n.startConversation.key,\n MessengerI18n.startConversation.fallback\n )}\n </Text>\n }\n renderItem={({ item }: { item: ChatMessage }) => (\n <MessageBubble message={item} />\n )}\n />\n )}\n\n <Composer sending={sendMutation.isPending} onSend={handleSend} />\n </KeyboardAvoidingView>\n );\n}\n"]}
|
package/dist/native/index.js
CHANGED
|
@@ -276,6 +276,113 @@ function MessageBubble({ message }) {
|
|
|
276
276
|
}
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
|
+
function AttachImageIcon({
|
|
280
|
+
color,
|
|
281
|
+
size = 22,
|
|
282
|
+
style
|
|
283
|
+
}) {
|
|
284
|
+
const frame = size * 0.82;
|
|
285
|
+
const mountain = size * 0.28;
|
|
286
|
+
const sun = Math.max(3, size * 0.16);
|
|
287
|
+
return /* @__PURE__ */ jsx(
|
|
288
|
+
View,
|
|
289
|
+
{
|
|
290
|
+
style: [
|
|
291
|
+
{
|
|
292
|
+
width: size,
|
|
293
|
+
height: size,
|
|
294
|
+
alignItems: "center",
|
|
295
|
+
justifyContent: "center"
|
|
296
|
+
},
|
|
297
|
+
style
|
|
298
|
+
],
|
|
299
|
+
accessibilityElementsHidden: true,
|
|
300
|
+
importantForAccessibility: "no-hide-descendants",
|
|
301
|
+
children: /* @__PURE__ */ jsxs(
|
|
302
|
+
View,
|
|
303
|
+
{
|
|
304
|
+
style: {
|
|
305
|
+
width: frame,
|
|
306
|
+
height: frame * 0.78,
|
|
307
|
+
borderWidth: 1.75,
|
|
308
|
+
borderColor: color,
|
|
309
|
+
borderRadius: 3,
|
|
310
|
+
overflow: "hidden",
|
|
311
|
+
justifyContent: "flex-end"
|
|
312
|
+
},
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ jsx(
|
|
315
|
+
View,
|
|
316
|
+
{
|
|
317
|
+
style: {
|
|
318
|
+
position: "absolute",
|
|
319
|
+
top: size * 0.12,
|
|
320
|
+
left: size * 0.14,
|
|
321
|
+
width: sun,
|
|
322
|
+
height: sun,
|
|
323
|
+
borderRadius: sun / 2,
|
|
324
|
+
backgroundColor: color
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
/* @__PURE__ */ jsx(
|
|
329
|
+
View,
|
|
330
|
+
{
|
|
331
|
+
style: {
|
|
332
|
+
alignSelf: "flex-start",
|
|
333
|
+
marginLeft: size * 0.08,
|
|
334
|
+
width: 0,
|
|
335
|
+
height: 0,
|
|
336
|
+
borderStyle: "solid",
|
|
337
|
+
borderLeftWidth: mountain * 0.55,
|
|
338
|
+
borderRightWidth: mountain * 0.55,
|
|
339
|
+
borderBottomWidth: mountain,
|
|
340
|
+
borderLeftColor: "transparent",
|
|
341
|
+
borderRightColor: "transparent",
|
|
342
|
+
borderBottomColor: color,
|
|
343
|
+
opacity: 0.9
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
function SendChevronIcon({
|
|
354
|
+
color,
|
|
355
|
+
size = 14
|
|
356
|
+
}) {
|
|
357
|
+
return /* @__PURE__ */ jsx(
|
|
358
|
+
View,
|
|
359
|
+
{
|
|
360
|
+
style: {
|
|
361
|
+
width: size,
|
|
362
|
+
height: size,
|
|
363
|
+
alignItems: "center",
|
|
364
|
+
justifyContent: "center"
|
|
365
|
+
},
|
|
366
|
+
children: /* @__PURE__ */ jsx(
|
|
367
|
+
View,
|
|
368
|
+
{
|
|
369
|
+
style: {
|
|
370
|
+
width: 0,
|
|
371
|
+
height: 0,
|
|
372
|
+
marginLeft: size * 0.12,
|
|
373
|
+
borderStyle: "solid",
|
|
374
|
+
borderTopWidth: size * 0.38,
|
|
375
|
+
borderBottomWidth: size * 0.38,
|
|
376
|
+
borderLeftWidth: size * 0.55,
|
|
377
|
+
borderTopColor: "transparent",
|
|
378
|
+
borderBottomColor: "transparent",
|
|
379
|
+
borderLeftColor: color
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
}
|
|
279
386
|
function Composer({
|
|
280
387
|
sending,
|
|
281
388
|
onSend
|
|
@@ -296,12 +403,13 @@ function Composer({
|
|
|
296
403
|
await onSend(text, null);
|
|
297
404
|
setBody("");
|
|
298
405
|
}
|
|
406
|
+
const canSend = Boolean(body.trim()) && !sending;
|
|
299
407
|
return /* @__PURE__ */ jsxs(
|
|
300
408
|
View,
|
|
301
409
|
{
|
|
302
410
|
style: {
|
|
303
411
|
flexDirection: isRtl ? "row-reverse" : "row",
|
|
304
|
-
alignItems: "
|
|
412
|
+
alignItems: "center",
|
|
305
413
|
gap: 8,
|
|
306
414
|
paddingHorizontal: 12,
|
|
307
415
|
paddingVertical: 10,
|
|
@@ -310,7 +418,25 @@ function Composer({
|
|
|
310
418
|
paddingBottom: Platform.OS === "ios" ? 28 : 12
|
|
311
419
|
},
|
|
312
420
|
children: [
|
|
313
|
-
/* @__PURE__ */ jsx(
|
|
421
|
+
/* @__PURE__ */ jsx(
|
|
422
|
+
TouchableOpacity,
|
|
423
|
+
{
|
|
424
|
+
onPress: onPick,
|
|
425
|
+
hitSlop: 10,
|
|
426
|
+
disabled: sending,
|
|
427
|
+
accessibilityRole: "button",
|
|
428
|
+
accessibilityLabel: "Attach image",
|
|
429
|
+
style: {
|
|
430
|
+
width: 40,
|
|
431
|
+
height: 40,
|
|
432
|
+
borderRadius: 20,
|
|
433
|
+
alignItems: "center",
|
|
434
|
+
justifyContent: "center",
|
|
435
|
+
opacity: sending ? 0.45 : 1
|
|
436
|
+
},
|
|
437
|
+
children: /* @__PURE__ */ jsx(AttachImageIcon, { color: accentColor, size: 22 })
|
|
438
|
+
}
|
|
439
|
+
),
|
|
314
440
|
/* @__PURE__ */ jsx(
|
|
315
441
|
TextInput,
|
|
316
442
|
{
|
|
@@ -325,11 +451,12 @@ function Composer({
|
|
|
325
451
|
style: {
|
|
326
452
|
flex: 1,
|
|
327
453
|
maxHeight: 100,
|
|
454
|
+
minHeight: 40,
|
|
328
455
|
borderWidth: 1,
|
|
329
456
|
borderColor: colors.border,
|
|
330
|
-
borderRadius:
|
|
457
|
+
borderRadius: 20,
|
|
331
458
|
paddingHorizontal: 14,
|
|
332
|
-
paddingVertical: 10,
|
|
459
|
+
paddingVertical: Platform.OS === "ios" ? 10 : 8,
|
|
333
460
|
color: colors.text,
|
|
334
461
|
fontFamily: fonts.body,
|
|
335
462
|
textAlign: isRtl ? "right" : "left",
|
|
@@ -341,26 +468,18 @@ function Composer({
|
|
|
341
468
|
TouchableOpacity,
|
|
342
469
|
{
|
|
343
470
|
onPress: onPressSend,
|
|
344
|
-
disabled:
|
|
471
|
+
disabled: !canSend,
|
|
472
|
+
accessibilityRole: "button",
|
|
473
|
+
accessibilityLabel: "Send message",
|
|
345
474
|
style: {
|
|
346
475
|
width: 40,
|
|
347
476
|
height: 40,
|
|
348
477
|
borderRadius: 20,
|
|
349
|
-
backgroundColor:
|
|
478
|
+
backgroundColor: canSend ? accentColor : colors.surfaceSecondary,
|
|
350
479
|
alignItems: "center",
|
|
351
480
|
justifyContent: "center"
|
|
352
481
|
},
|
|
353
|
-
children: sending ? /* @__PURE__ */ jsx(ActivityIndicator, { color: "#FFF", size: "small" }) : /* @__PURE__ */ jsx(
|
|
354
|
-
Text,
|
|
355
|
-
{
|
|
356
|
-
style: {
|
|
357
|
-
color: body.trim() ? "#FFF" : colors.textMuted,
|
|
358
|
-
fontSize: 16,
|
|
359
|
-
fontWeight: "700"
|
|
360
|
-
},
|
|
361
|
-
children: "\u27A4"
|
|
362
|
-
}
|
|
363
|
-
)
|
|
482
|
+
children: sending ? /* @__PURE__ */ jsx(ActivityIndicator, { color: "#FFF", size: "small" }) : /* @__PURE__ */ jsx(SendChevronIcon, { color: canSend ? "#FFF" : colors.textMuted, size: 14 })
|
|
364
483
|
}
|
|
365
484
|
)
|
|
366
485
|
]
|
package/dist/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/native/InboxScreen.tsx","../../src/native/MessageBubble.tsx","../../src/native/Composer.tsx","../../src/native/ThreadScreen.tsx"],"names":["jsxs","View","jsx","Text","TouchableOpacity","ActivityIndicator","FeatureOff","Fragment","Platform"],"mappings":";;;;;AAeA,SAAS,UAAA,GAAa;AACpB,EAAA,MAAM,EAAE,CAAA,EAAG,KAAA,EAAO,UAAA,EAAY,YAAA,KAAiB,kBAAA,EAAmB;AAClE,EAAA,IAAI,YAAA,EAAc,uBAAO,GAAA,CAAA,QAAA,EAAA,EAAG,QAAA,EAAA,YAAA,EAAa,EAAE,CAAA;AAC3C,EAAA,MAAM,EAAE,MAAA,EAAQ,WAAA,EAAY,GAAI,KAAA;AAChC,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO;AAAA,QACL,IAAA,EAAM,CAAA;AAAA,QACN,iBAAiB,MAAA,CAAO,UAAA;AAAA,QACxB,UAAA,EAAY,QAAA;AAAA,QACZ,cAAA,EAAgB,QAAA;AAAA,QAChB,OAAA,EAAS;AAAA,OACX;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,QAAK,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,CAAO,WAAW,SAAA,EAAW,QAAA,EAAS,EACzD,QAAA,EAAA,CAAA,CAAE,cAAc,GAAA,CAAI,GAAA,EAAK,aAAA,CAAc,GAAA,CAAI,QAAQ,CAAA,EACtD,CAAA;AAAA,wBACA,GAAA,CAAC,gBAAA,EAAA,EAAiB,OAAA,EAAS,UAAA,CAAW,MAAA,EAAQ,OAAO,EAAE,SAAA,EAAW,EAAA,EAAG,EAC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AA,YAEF,UAAA,EAAY,CAAC,EAAE,IAAA,uBACbD,GAAAA,CAAC,aAAA,EAAA,EAAc,OAAA,EAAS,IAAA,EAAM;AAAA;AAAA,SAElC;AAAA,wBAGFA,GAAAA,CAAC,QAAA,EAAA,EAAS,SAAS,YAAA,CAAa,SAAA,EAAW,QAAQ,UAAA,EAAY;AAAA;AAAA;AAAA,GACjE;AAEJ","file":"index.js","sourcesContent":["import React from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n ScrollView,\n RefreshControl,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThreads } from \"../hooks/useThreads\";\nimport { useOpenThread } from \"../hooks/useOpenThread\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { MessageThread } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, navigation, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n const { colors, accentColor } = theme;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 24,\n }}\n >\n <Text style={{ color: colors.textMuted, textAlign: \"center\" }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n <TouchableOpacity onPress={navigation.goBack} style={{ marginTop: 16 }}>\n <Text style={{ color: accentColor }}>\n {t(MessengerI18n.back.key, MessengerI18n.back.fallback)}\n </Text>\n </TouchableOpacity>\n </View>\n );\n}\n\nfunction ThreadRow({ thread }: { thread: MessageThread }) {\n const { user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const unread = Number(thread.unread_count ?? 0);\n\n return (\n <TouchableOpacity\n onPress={() => navigation.openThread(thread.id)}\n activeOpacity={0.8}\n >\n <View\n style={{\n marginBottom: 10,\n padding: 14,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <View style={{ flex: 1 }}>\n <Text\n style={{\n color: colors.text,\n fontFamily: fonts.displaySemiBold,\n fontWeight: \"600\",\n fontSize: 16,\n }}\n >\n {user?.role === \"admin\"\n ? thread.client_name ??\n t(MessengerI18n.client.key, MessengerI18n.client.fallback)\n : t(\n MessengerI18n.yourCoach.key,\n MessengerI18n.yourCoach.fallback\n )}\n </Text>\n <Text\n style={{\n color: colors.textSecondary,\n fontFamily: fonts.body,\n fontSize: 13,\n marginTop: 4,\n }}\n numberOfLines={1}\n >\n {thread.last_body ||\n (thread.last_image_url\n ? t(MessengerI18n.photo.key, MessengerI18n.photo.fallback)\n : t(\n MessengerI18n.noMessages.key,\n MessengerI18n.noMessages.fallback\n ))}\n </Text>\n </View>\n {unread > 0 && (\n <View\n style={{\n minWidth: 22,\n height: 22,\n borderRadius: 11,\n backgroundColor: accentColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n paddingHorizontal: 6,\n }}\n >\n <Text\n style={{\n color: \"#FFF\",\n fontSize: 11,\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {unread}\n </Text>\n </View>\n )}\n </View>\n </View>\n </TouchableOpacity>\n );\n}\n\nexport function InboxScreen() {\n const { enabled, user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const threadsQuery = useThreads();\n const openThread = useOpenThread();\n\n if (!enabled) return <FeatureOff />;\n\n const threads = threadsQuery.data ?? [];\n const loading = threadsQuery.isLoading && threads.length === 0;\n\n return (\n <View style={{ flex: 1, backgroundColor: colors.background }}>\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 22,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.inbox.key, MessengerI18n.inbox.fallback)}\n </Text>\n </View>\n\n <ScrollView\n contentContainerStyle={{ paddingHorizontal: 16, paddingBottom: 32 }}\n refreshControl={\n <RefreshControl\n refreshing={threadsQuery.isRefetching}\n onRefresh={() => void threadsQuery.refetch()}\n tintColor={accentColor}\n />\n }\n >\n {user?.role === \"client\" && threads.length === 0 && (\n <TouchableOpacity\n onPress={() => openThread.mutate(undefined)}\n disabled={openThread.isPending}\n style={{\n marginBottom: 14,\n paddingVertical: 14,\n borderRadius: 12,\n backgroundColor: accentColor,\n alignItems: \"center\",\n }}\n >\n {openThread.isPending ? (\n <ActivityIndicator color=\"#FFF\" />\n ) : (\n <Text\n style={{\n color: \"#FFF\",\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {t(\n MessengerI18n.messageCoach.key,\n MessengerI18n.messageCoach.fallback\n )}\n </Text>\n )}\n </TouchableOpacity>\n )}\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : threads.length === 0 ? (\n <View\n style={{\n alignItems: \"center\",\n paddingVertical: 40,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <Text style={{ fontSize: 28, color: colors.textMuted }}>···</Text>\n <Text\n style={{\n color: colors.textMuted,\n marginTop: 12,\n fontFamily: fonts.body,\n textAlign: \"center\",\n }}\n >\n {t(MessengerI18n.empty.key, MessengerI18n.empty.fallback)}\n </Text>\n </View>\n ) : (\n threads.map((th: MessageThread) => (\n <ThreadRow key={th.id} thread={th} />\n ))\n )}\n </ScrollView>\n </View>\n );\n}\n","import React from \"react\";\nimport { View, Text, Image } from \"react-native\";\nimport type { ChatMessage } from \"../types\";\nimport { useMessengerConfig } from \"../provider\";\n\nexport function MessageBubble({ message }: { message: ChatMessage }) {\n const { user, isRtl, theme } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const mine = message.sender_user_id === user?.id;\n\n return (\n <View\n style={{\n alignSelf: mine\n ? isRtl\n ? \"flex-start\"\n : \"flex-end\"\n : isRtl\n ? \"flex-end\"\n : \"flex-start\",\n maxWidth: \"80%\",\n marginBottom: 10,\n backgroundColor: mine ? accentColor : colors.surfaceSecondary,\n borderRadius: 16,\n paddingHorizontal: 12,\n paddingVertical: 10,\n }}\n >\n {message.image_url ? (\n <Image\n source={{ uri: message.image_url }}\n style={{\n width: 180,\n height: 180,\n borderRadius: 10,\n marginBottom: message.body ? 8 : 0,\n }}\n />\n ) : null}\n {message.body ? (\n <Text\n style={{\n color: mine ? \"#FFF\" : colors.text,\n fontFamily: fonts.body,\n fontSize: 15,\n }}\n >\n {message.body}\n </Text>\n ) : null}\n </View>\n );\n}\n","import React, { useState } from \"react\";\nimport {\n View,\n Text,\n TextInput,\n TouchableOpacity,\n ActivityIndicator,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { PickedImage } from \"../types\";\n\nexport function Composer({\n sending,\n onSend,\n}: {\n sending: boolean;\n onSend: (body: string, image?: PickedImage | null) => void | Promise<void>;\n}) {\n const { t, isRtl, theme, pickImage } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const [body, setBody] = useState(\"\");\n\n async function onPick() {\n const image = await pickImage();\n if (image) {\n await onSend(body, image);\n setBody(\"\");\n }\n }\n\n async function onPressSend() {\n if (!body.trim() || sending) return;\n const text = body;\n await onSend(text, null);\n setBody(\"\");\n }\n\n return (\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"flex-end\",\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 10,\n borderTopWidth: 1,\n borderTopColor: colors.border,\n paddingBottom: Platform.OS === \"ios\" ? 28 : 12,\n }}\n >\n <TouchableOpacity onPress={onPick} hitSlop={8} disabled={sending}>\n <Text style={{ fontSize: 22, color: accentColor }}>▣</Text>\n </TouchableOpacity>\n <TextInput\n value={body}\n onChangeText={setBody}\n placeholder={t(\n MessengerI18n.typeMessage.key,\n MessengerI18n.typeMessage.fallback\n )}\n placeholderTextColor={colors.textMuted}\n multiline\n style={{\n flex: 1,\n maxHeight: 100,\n borderWidth: 1,\n borderColor: colors.border,\n borderRadius: 16,\n paddingHorizontal: 14,\n paddingVertical: 10,\n color: colors.text,\n fontFamily: fonts.body,\n textAlign: isRtl ? \"right\" : \"left\",\n backgroundColor: colors.surface,\n }}\n />\n <TouchableOpacity\n onPress={onPressSend}\n disabled={sending || !body.trim()}\n style={{\n width: 40,\n height: 40,\n borderRadius: 20,\n backgroundColor: body.trim()\n ? accentColor\n : colors.surfaceSecondary,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {sending ? (\n <ActivityIndicator color=\"#FFF\" size=\"small\" />\n ) : (\n <Text\n style={{\n color: body.trim() ? \"#FFF\" : colors.textMuted,\n fontSize: 16,\n fontWeight: \"700\",\n }}\n >\n ➤\n </Text>\n )}\n </TouchableOpacity>\n </View>\n );\n}\n","import React, { useRef } from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n FlatList,\n KeyboardAvoidingView,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThread } from \"../hooks/useThread\";\nimport { useSendMessage } from \"../hooks/useSendMessage\";\nimport { MessageBubble } from \"./MessageBubble\";\nimport { Composer } from \"./Composer\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { ChatMessage, PickedImage } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: theme.colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Text style={{ color: theme.colors.textMuted }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n </View>\n );\n}\n\nexport function ThreadScreen({ threadId }: { threadId: number }) {\n const { enabled, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const listRef = useRef<FlatList<ChatMessage> | null>(null);\n const threadQuery = useThread(threadId);\n const sendMutation = useSendMessage(threadId);\n\n if (!enabled) return <FeatureOff />;\n\n const messages = threadQuery.data?.messages ?? [];\n const loading = threadQuery.isLoading && messages.length === 0;\n\n async function handleSend(body: string, image?: PickedImage | null) {\n if ((!body.trim() && !image) || sendMutation.isPending) return;\n await sendMutation.mutateAsync({ body, image });\n setTimeout(() => listRef.current?.scrollToEnd({ animated: true }), 100);\n }\n\n return (\n <KeyboardAvoidingView\n style={{ flex: 1, backgroundColor: colors.background }}\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n keyboardVerticalOffset={0}\n >\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.border,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 18,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.chat.key, MessengerI18n.chat.fallback)}\n </Text>\n </View>\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : (\n <FlatList\n ref={listRef}\n data={messages}\n keyExtractor={(m: ChatMessage) => String(m.id)}\n contentContainerStyle={{ padding: 16, paddingBottom: 8 }}\n onContentSizeChange={() =>\n listRef.current?.scrollToEnd({ animated: false })\n }\n ListEmptyComponent={\n <Text\n style={{\n color: colors.textMuted,\n textAlign: \"center\",\n marginTop: 40,\n fontFamily: fonts.body,\n }}\n >\n {t(\n MessengerI18n.startConversation.key,\n MessengerI18n.startConversation.fallback\n )}\n </Text>\n }\n renderItem={({ item }: { item: ChatMessage }) => (\n <MessageBubble message={item} />\n )}\n />\n )}\n\n <Composer sending={sendMutation.isPending} onSend={handleSend} />\n </KeyboardAvoidingView>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/native/InboxScreen.tsx","../../src/native/MessageBubble.tsx","../../src/native/icons.tsx","../../src/native/Composer.tsx","../../src/native/ThreadScreen.tsx"],"names":["jsxs","View","jsx","Text","TouchableOpacity","ActivityIndicator","FeatureOff","Fragment","Platform"],"mappings":";;;;;AAeA,SAAS,UAAA,GAAa;AACpB,EAAA,MAAM,EAAE,CAAA,EAAG,KAAA,EAAO,UAAA,EAAY,YAAA,KAAiB,kBAAA,EAAmB;AAClE,EAAA,IAAI,YAAA,EAAc,uBAAO,GAAA,CAAA,QAAA,EAAA,EAAG,QAAA,EAAA,YAAA,EAAa,EAAE,CAAA;AAC3C,EAAA,MAAM,EAAE,MAAA,EAAQ,WAAA,EAAY,GAAI,KAAA;AAChC,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO;AAAA,QACL,IAAA,EAAM,CAAA;AAAA,QACN,iBAAiB,MAAA,CAAO,UAAA;AAAA,QACxB,UAAA,EAAY,QAAA;AAAA,QACZ,cAAA,EAAgB,QAAA;AAAA,QAChB,OAAA,EAAS;AAAA,OACX;AAAA,MAEA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,QAAK,KAAA,EAAO,EAAE,KAAA,EAAO,MAAA,CAAO,WAAW,SAAA,EAAW,QAAA,EAAS,EACzD,QAAA,EAAA,CAAA,CAAE,cAAc,GAAA,CAAI,GAAA,EAAK,aAAA,CAAc,GAAA,CAAI,QAAQ,CAAA,E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AAA,EAAI,eAAe,CAAA,EAAE;AAAA,YACvD,mBAAA,EAAqB,MACnB,OAAA,CAAQ,OAAA,EAAS,YAAY,EAAE,QAAA,EAAU,OAAO,CAAA;AAAA,YAElD,oCACEA,GAAAA;AAAA,cAACC,IAAAA;AAAA,cAAA;AAAA,gBACC,KAAA,EAAO;AAAA,kBACL,OAAO,MAAA,CAAO,SAAA;AAAA,kBACd,SAAA,EAAW,QAAA;AAAA,kBACX,SAAA,EAAW,EAAA;AAAA,kBACX,YAAY,KAAA,CAAM;AAAA,iBACpB;AAAA,gBAEC,QAAA,EAAA,CAAA;AAAA,kBACC,cAAc,iBAAA,CAAkB,GAAA;AAAA,kBAChC,cAAc,iBAAA,CAAkB;AAAA;AAClC;AAAA,aACF;AAAA,YAEF,UAAA,EAAY,CAAC,EAAE,IAAA,uBACbD,GAAAA,CAAC,aAAA,EAAA,EAAc,OAAA,EAAS,IAAA,EAAM;AAAA;AAAA,SAElC;AAAA,wBAGFA,GAAAA,CAAC,QAAA,EAAA,EAAS,SAAS,YAAA,CAAa,SAAA,EAAW,QAAQ,UAAA,EAAY;AAAA;AAAA;AAAA,GACjE;AAEJ","file":"index.js","sourcesContent":["import React from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n ScrollView,\n RefreshControl,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThreads } from \"../hooks/useThreads\";\nimport { useOpenThread } from \"../hooks/useOpenThread\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { MessageThread } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, navigation, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n const { colors, accentColor } = theme;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 24,\n }}\n >\n <Text style={{ color: colors.textMuted, textAlign: \"center\" }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n <TouchableOpacity onPress={navigation.goBack} style={{ marginTop: 16 }}>\n <Text style={{ color: accentColor }}>\n {t(MessengerI18n.back.key, MessengerI18n.back.fallback)}\n </Text>\n </TouchableOpacity>\n </View>\n );\n}\n\nfunction ThreadRow({ thread }: { thread: MessageThread }) {\n const { user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const unread = Number(thread.unread_count ?? 0);\n\n return (\n <TouchableOpacity\n onPress={() => navigation.openThread(thread.id)}\n activeOpacity={0.8}\n >\n <View\n style={{\n marginBottom: 10,\n padding: 14,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <View style={{ flex: 1 }}>\n <Text\n style={{\n color: colors.text,\n fontFamily: fonts.displaySemiBold,\n fontWeight: \"600\",\n fontSize: 16,\n }}\n >\n {user?.role === \"admin\"\n ? thread.client_name ??\n t(MessengerI18n.client.key, MessengerI18n.client.fallback)\n : t(\n MessengerI18n.yourCoach.key,\n MessengerI18n.yourCoach.fallback\n )}\n </Text>\n <Text\n style={{\n color: colors.textSecondary,\n fontFamily: fonts.body,\n fontSize: 13,\n marginTop: 4,\n }}\n numberOfLines={1}\n >\n {thread.last_body ||\n (thread.last_image_url\n ? t(MessengerI18n.photo.key, MessengerI18n.photo.fallback)\n : t(\n MessengerI18n.noMessages.key,\n MessengerI18n.noMessages.fallback\n ))}\n </Text>\n </View>\n {unread > 0 && (\n <View\n style={{\n minWidth: 22,\n height: 22,\n borderRadius: 11,\n backgroundColor: accentColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n paddingHorizontal: 6,\n }}\n >\n <Text\n style={{\n color: \"#FFF\",\n fontSize: 11,\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {unread}\n </Text>\n </View>\n )}\n </View>\n </View>\n </TouchableOpacity>\n );\n}\n\nexport function InboxScreen() {\n const { enabled, user, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const threadsQuery = useThreads();\n const openThread = useOpenThread();\n\n if (!enabled) return <FeatureOff />;\n\n const threads = threadsQuery.data ?? [];\n const loading = threadsQuery.isLoading && threads.length === 0;\n\n return (\n <View style={{ flex: 1, backgroundColor: colors.background }}>\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 22,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.inbox.key, MessengerI18n.inbox.fallback)}\n </Text>\n </View>\n\n <ScrollView\n contentContainerStyle={{ paddingHorizontal: 16, paddingBottom: 32 }}\n refreshControl={\n <RefreshControl\n refreshing={threadsQuery.isRefetching}\n onRefresh={() => void threadsQuery.refetch()}\n tintColor={accentColor}\n />\n }\n >\n {user?.role === \"client\" && threads.length === 0 && (\n <TouchableOpacity\n onPress={() => openThread.mutate(undefined)}\n disabled={openThread.isPending}\n style={{\n marginBottom: 14,\n paddingVertical: 14,\n borderRadius: 12,\n backgroundColor: accentColor,\n alignItems: \"center\",\n }}\n >\n {openThread.isPending ? (\n <ActivityIndicator color=\"#FFF\" />\n ) : (\n <Text\n style={{\n color: \"#FFF\",\n fontFamily: fonts.bodySemiBold,\n fontWeight: \"600\",\n }}\n >\n {t(\n MessengerI18n.messageCoach.key,\n MessengerI18n.messageCoach.fallback\n )}\n </Text>\n )}\n </TouchableOpacity>\n )}\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : threads.length === 0 ? (\n <View\n style={{\n alignItems: \"center\",\n paddingVertical: 40,\n borderRadius: 14,\n backgroundColor: colors.surface,\n borderWidth: 1,\n borderColor: colors.border,\n }}\n >\n <Text style={{ fontSize: 28, color: colors.textMuted }}>···</Text>\n <Text\n style={{\n color: colors.textMuted,\n marginTop: 12,\n fontFamily: fonts.body,\n textAlign: \"center\",\n }}\n >\n {t(MessengerI18n.empty.key, MessengerI18n.empty.fallback)}\n </Text>\n </View>\n ) : (\n threads.map((th: MessageThread) => (\n <ThreadRow key={th.id} thread={th} />\n ))\n )}\n </ScrollView>\n </View>\n );\n}\n","import React from \"react\";\nimport { View, Text, Image } from \"react-native\";\nimport type { ChatMessage } from \"../types\";\nimport { useMessengerConfig } from \"../provider\";\n\nexport function MessageBubble({ message }: { message: ChatMessage }) {\n const { user, isRtl, theme } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const mine = message.sender_user_id === user?.id;\n\n return (\n <View\n style={{\n alignSelf: mine\n ? isRtl\n ? \"flex-start\"\n : \"flex-end\"\n : isRtl\n ? \"flex-end\"\n : \"flex-start\",\n maxWidth: \"80%\",\n marginBottom: 10,\n backgroundColor: mine ? accentColor : colors.surfaceSecondary,\n borderRadius: 16,\n paddingHorizontal: 12,\n paddingVertical: 10,\n }}\n >\n {message.image_url ? (\n <Image\n source={{ uri: message.image_url }}\n style={{\n width: 180,\n height: 180,\n borderRadius: 10,\n marginBottom: message.body ? 8 : 0,\n }}\n />\n ) : null}\n {message.body ? (\n <Text\n style={{\n color: mine ? \"#FFF\" : colors.text,\n fontFamily: fonts.body,\n fontSize: 15,\n }}\n >\n {message.body}\n </Text>\n ) : null}\n </View>\n );\n}\n","import React from \"react\";\nimport { View, type StyleProp, type ViewStyle } from \"react-native\";\n\n/** Landscape image glyph — no emoji / unicode font dependency. */\nexport function AttachImageIcon({\n color,\n size = 22,\n style,\n}: {\n color: string;\n size?: number;\n style?: StyleProp<ViewStyle>;\n}) {\n const frame = size * 0.82;\n const mountain = size * 0.28;\n const sun = Math.max(3, size * 0.16);\n\n return (\n <View\n style={[\n {\n width: size,\n height: size,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n style,\n ]}\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n >\n <View\n style={{\n width: frame,\n height: frame * 0.78,\n borderWidth: 1.75,\n borderColor: color,\n borderRadius: 3,\n overflow: \"hidden\",\n justifyContent: \"flex-end\",\n }}\n >\n <View\n style={{\n position: \"absolute\",\n top: size * 0.12,\n left: size * 0.14,\n width: sun,\n height: sun,\n borderRadius: sun / 2,\n backgroundColor: color,\n }}\n />\n <View\n style={{\n alignSelf: \"flex-start\",\n marginLeft: size * 0.08,\n width: 0,\n height: 0,\n borderStyle: \"solid\",\n borderLeftWidth: mountain * 0.55,\n borderRightWidth: mountain * 0.55,\n borderBottomWidth: mountain,\n borderLeftColor: \"transparent\",\n borderRightColor: \"transparent\",\n borderBottomColor: color,\n opacity: 0.9,\n }}\n />\n </View>\n </View>\n );\n}\n\n/** Send chevron drawn with Views so it aligns in the circular button. */\nexport function SendChevronIcon({\n color,\n size = 14,\n}: {\n color: string;\n size?: number;\n}) {\n return (\n <View\n style={{\n width: size,\n height: size,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <View\n style={{\n width: 0,\n height: 0,\n marginLeft: size * 0.12,\n borderStyle: \"solid\",\n borderTopWidth: size * 0.38,\n borderBottomWidth: size * 0.38,\n borderLeftWidth: size * 0.55,\n borderTopColor: \"transparent\",\n borderBottomColor: \"transparent\",\n borderLeftColor: color,\n }}\n />\n </View>\n );\n}\n","import React, { useState } from \"react\";\nimport {\n View,\n TextInput,\n TouchableOpacity,\n ActivityIndicator,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { PickedImage } from \"../types\";\nimport { AttachImageIcon, SendChevronIcon } from \"./icons\";\n\nexport function Composer({\n sending,\n onSend,\n}: {\n sending: boolean;\n onSend: (body: string, image?: PickedImage | null) => void | Promise<void>;\n}) {\n const { t, isRtl, theme, pickImage } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const [body, setBody] = useState(\"\");\n\n async function onPick() {\n const image = await pickImage();\n if (image) {\n await onSend(body, image);\n setBody(\"\");\n }\n }\n\n async function onPressSend() {\n if (!body.trim() || sending) return;\n const text = body;\n await onSend(text, null);\n setBody(\"\");\n }\n\n const canSend = Boolean(body.trim()) && !sending;\n\n return (\n <View\n style={{\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 10,\n borderTopWidth: 1,\n borderTopColor: colors.border,\n paddingBottom: Platform.OS === \"ios\" ? 28 : 12,\n }}\n >\n <TouchableOpacity\n onPress={onPick}\n hitSlop={10}\n disabled={sending}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Attach image\"\n style={{\n width: 40,\n height: 40,\n borderRadius: 20,\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: sending ? 0.45 : 1,\n }}\n >\n <AttachImageIcon color={accentColor} size={22} />\n </TouchableOpacity>\n <TextInput\n value={body}\n onChangeText={setBody}\n placeholder={t(\n MessengerI18n.typeMessage.key,\n MessengerI18n.typeMessage.fallback\n )}\n placeholderTextColor={colors.textMuted}\n multiline\n style={{\n flex: 1,\n maxHeight: 100,\n minHeight: 40,\n borderWidth: 1,\n borderColor: colors.border,\n borderRadius: 20,\n paddingHorizontal: 14,\n paddingVertical: Platform.OS === \"ios\" ? 10 : 8,\n color: colors.text,\n fontFamily: fonts.body,\n textAlign: isRtl ? \"right\" : \"left\",\n backgroundColor: colors.surface,\n }}\n />\n <TouchableOpacity\n onPress={onPressSend}\n disabled={!canSend}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Send message\"\n style={{\n width: 40,\n height: 40,\n borderRadius: 20,\n backgroundColor: canSend ? accentColor : colors.surfaceSecondary,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {sending ? (\n <ActivityIndicator color=\"#FFF\" size=\"small\" />\n ) : (\n <SendChevronIcon color={canSend ? \"#FFF\" : colors.textMuted} size={14} />\n )}\n </TouchableOpacity>\n </View>\n );\n}\n","import React, { useRef } from \"react\";\nimport {\n View,\n Text,\n TouchableOpacity,\n ActivityIndicator,\n FlatList,\n KeyboardAvoidingView,\n Platform,\n} from \"react-native\";\nimport { useMessengerConfig } from \"../provider\";\nimport { useThread } from \"../hooks/useThread\";\nimport { useSendMessage } from \"../hooks/useSendMessage\";\nimport { MessageBubble } from \"./MessageBubble\";\nimport { Composer } from \"./Composer\";\nimport { MessengerI18n } from \"../i18nKeys\";\nimport type { ChatMessage, PickedImage } from \"../types\";\n\nfunction FeatureOff() {\n const { t, theme, onFeatureOff } = useMessengerConfig();\n if (onFeatureOff) return <>{onFeatureOff()}</>;\n return (\n <View\n style={{\n flex: 1,\n backgroundColor: theme.colors.background,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Text style={{ color: theme.colors.textMuted }}>\n {t(MessengerI18n.off.key, MessengerI18n.off.fallback)}\n </Text>\n </View>\n );\n}\n\nexport function ThreadScreen({ threadId }: { threadId: number }) {\n const { enabled, t, isRtl, theme, navigation } = useMessengerConfig();\n const { colors, accentColor, fonts } = theme;\n const listRef = useRef<FlatList<ChatMessage> | null>(null);\n const threadQuery = useThread(threadId);\n const sendMutation = useSendMessage(threadId);\n\n if (!enabled) return <FeatureOff />;\n\n const messages = threadQuery.data?.messages ?? [];\n const loading = threadQuery.isLoading && messages.length === 0;\n\n async function handleSend(body: string, image?: PickedImage | null) {\n if ((!body.trim() && !image) || sendMutation.isPending) return;\n await sendMutation.mutateAsync({ body, image });\n setTimeout(() => listRef.current?.scrollToEnd({ animated: true }), 100);\n }\n\n return (\n <KeyboardAvoidingView\n style={{ flex: 1, backgroundColor: colors.background }}\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n keyboardVerticalOffset={0}\n >\n <View\n style={{\n paddingTop: 56,\n paddingHorizontal: 16,\n paddingBottom: 12,\n flexDirection: isRtl ? \"row-reverse\" : \"row\",\n alignItems: \"center\",\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: colors.border,\n }}\n >\n <TouchableOpacity onPress={navigation.goBack} hitSlop={12}>\n <Text style={{ fontSize: 22, color: colors.text }}>\n {isRtl ? \"→\" : \"←\"}\n </Text>\n </TouchableOpacity>\n <Text\n style={{\n color: colors.text,\n fontSize: 18,\n fontFamily: fonts.displayBold,\n fontWeight: \"700\",\n flex: 1,\n }}\n >\n {t(MessengerI18n.chat.key, MessengerI18n.chat.fallback)}\n </Text>\n </View>\n\n {loading ? (\n <ActivityIndicator color={accentColor} style={{ marginTop: 40 }} />\n ) : (\n <FlatList\n ref={listRef}\n data={messages}\n keyExtractor={(m: ChatMessage) => String(m.id)}\n contentContainerStyle={{ padding: 16, paddingBottom: 8 }}\n onContentSizeChange={() =>\n listRef.current?.scrollToEnd({ animated: false })\n }\n ListEmptyComponent={\n <Text\n style={{\n color: colors.textMuted,\n textAlign: \"center\",\n marginTop: 40,\n fontFamily: fonts.body,\n }}\n >\n {t(\n MessengerI18n.startConversation.key,\n MessengerI18n.startConversation.fallback\n )}\n </Text>\n }\n renderItem={({ item }: { item: ChatMessage }) => (\n <MessageBubble message={item} />\n )}\n />\n )}\n\n <Composer sending={sendMutation.isPending} onSend={handleSend} />\n </KeyboardAvoidingView>\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samirify/messenger",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Trainer\u2194client messenger \u2014 React Query hooks + React Native + web DOM UI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Samirify",
|
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsup",
|
|
46
|
-
"
|
|
46
|
+
"assert-shared-context": "node scripts/assert-shared-context.mjs",
|
|
47
|
+
"test": "npm run assert-shared-context",
|
|
48
|
+
"prepublishOnly": "npm run build && npm run assert-shared-context",
|
|
47
49
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
48
50
|
},
|
|
49
51
|
"peerDependencies": {
|