@usechat/react-native 1.0.10 → 1.0.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usechat/react-native",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Modular React Native Chat UI SDK with keyboard handling, customizable components, and rich features",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Lukasz Ko <hello@usechat.dev>",
@@ -1,64 +0,0 @@
1
- 'use client'
2
-
3
- // src/utils/clipboard.ts
4
- var copyToClipboard = async (text) => {
5
- console.log("copyToClipboard called with text:", text);
6
- try {
7
- try {
8
- const { setStringAsync } = await import("expo-clipboard");
9
- console.log("expo-clipboard imported successfully");
10
- console.log("setStringAsync function:", setStringAsync);
11
- await setStringAsync(text);
12
- console.log("Text copied to clipboard successfully");
13
- } catch (importError) {
14
- console.error("Failed to import expo-clipboard:", importError);
15
- throw new Error("expo-clipboard not available");
16
- }
17
- try {
18
- const toastModule = await import("react-native-toast-message");
19
- const Toast = toastModule.default || toastModule;
20
- console.log("react-native-toast-message imported successfully");
21
- Toast.show({
22
- type: "success",
23
- text1: "Copied to clipboard",
24
- text2: "Message copied successfully",
25
- position: "bottom",
26
- visibilityTime: 2e3
27
- });
28
- console.log("Toast shown successfully");
29
- } catch (toastError) {
30
- console.log("Toast not available, but message copied to clipboard");
31
- console.error("Toast import error:", toastError);
32
- }
33
- return true;
34
- } catch (error) {
35
- console.error("Failed to copy to clipboard:", error);
36
- try {
37
- const toastModule = await import("react-native-toast-message");
38
- const Toast = toastModule.default || toastModule;
39
- Toast.show({
40
- type: "error",
41
- text1: "Copy failed",
42
- text2: "Failed to copy message to clipboard",
43
- position: "bottom",
44
- visibilityTime: 2e3
45
- });
46
- } catch (toastError) {
47
- console.error("Copy failed: expo-clipboard not available");
48
- console.error("Toast import error:", toastError);
49
- }
50
- return false;
51
- }
52
- };
53
- var isClipboardAvailable = async () => {
54
- try {
55
- await import("expo-clipboard");
56
- return true;
57
- } catch {
58
- return false;
59
- }
60
- };
61
- export {
62
- copyToClipboard,
63
- isClipboardAvailable
64
- };