vdb-ai-chat 1.0.7 → 1.0.8
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/chat-widget.js +1 -1
- package/lib/commonjs/components/BetaNotice.js +13 -12
- package/lib/commonjs/components/BetaNotice.js.map +1 -1
- package/lib/commonjs/components/ChatInput.js +59 -49
- package/lib/commonjs/components/ChatInput.js.map +1 -1
- package/lib/commonjs/components/ChatWidget.js +72 -59
- package/lib/commonjs/components/ChatWidget.js.map +1 -1
- package/lib/commonjs/components/MessageBubble.js +67 -52
- package/lib/commonjs/components/MessageBubble.js.map +1 -1
- package/lib/commonjs/components/MessageMetaRow.js +50 -31
- package/lib/commonjs/components/MessageMetaRow.js.map +1 -1
- package/lib/commonjs/components/ProductsListView.js +232 -153
- package/lib/commonjs/components/ProductsListView.js.map +1 -1
- package/lib/commonjs/components/SuggestionsRow.js +27 -24
- package/lib/commonjs/components/SuggestionsRow.js.map +1 -1
- package/lib/commonjs/contexts/ThemeProvider.js +80 -0
- package/lib/commonjs/contexts/ThemeProvider.js.map +1 -0
- package/lib/commonjs/contexts/utils.js +142 -0
- package/lib/commonjs/contexts/utils.js.map +1 -0
- package/lib/module/components/BetaNotice.js +14 -13
- package/lib/module/components/BetaNotice.js.map +1 -1
- package/lib/module/components/ChatInput.js +61 -50
- package/lib/module/components/ChatInput.js.map +1 -1
- package/lib/module/components/ChatWidget.js +76 -61
- package/lib/module/components/ChatWidget.js.map +1 -1
- package/lib/module/components/MessageBubble.js +69 -52
- package/lib/module/components/MessageBubble.js.map +1 -1
- package/lib/module/components/MessageMetaRow.js +52 -32
- package/lib/module/components/MessageMetaRow.js.map +1 -1
- package/lib/module/components/ProductsListView.js +234 -154
- package/lib/module/components/ProductsListView.js.map +1 -1
- package/lib/module/components/SuggestionsRow.js +29 -25
- package/lib/module/components/SuggestionsRow.js.map +1 -1
- package/lib/module/contexts/ThemeProvider.js +75 -0
- package/lib/module/contexts/ThemeProvider.js.map +1 -0
- package/lib/module/contexts/utils.js +136 -0
- package/lib/module/contexts/utils.js.map +1 -0
- package/lib/typescript/components/BetaNotice.d.ts.map +1 -1
- package/lib/typescript/components/ChatInput.d.ts.map +1 -1
- package/lib/typescript/components/ChatWidget.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble.d.ts +1 -1
- package/lib/typescript/components/MessageBubble.d.ts.map +1 -1
- package/lib/typescript/components/MessageMetaRow.d.ts.map +1 -1
- package/lib/typescript/components/ProductsListView.d.ts.map +1 -1
- package/lib/typescript/components/SuggestionsRow.d.ts.map +1 -1
- package/lib/typescript/contexts/ThemeProvider.d.ts +7 -0
- package/lib/typescript/contexts/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/contexts/utils.d.ts +136 -0
- package/lib/typescript/contexts/utils.d.ts.map +1 -0
- package/package.json +6 -2
- package/src/components/BetaNotice.tsx +15 -13
- package/src/components/ChatInput.tsx +63 -62
- package/src/components/ChatWidget.tsx +238 -206
- package/src/components/MessageBubble.tsx +113 -74
- package/src/components/MessageMetaRow.tsx +80 -50
- package/src/components/ProductsListView.tsx +242 -183
- package/src/components/SuggestionsRow.tsx +40 -25
- package/src/contexts/ThemeProvider.tsx +87 -0
- package/src/contexts/utils.ts +135 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","Image","Platform","FeedbackAction","fetchConversationId","formatToTime","useTheme","styled","css","ImageComponent","OS","ExpoImage","require","MessageMetaRow","message","priceMode","handleFeedbackAction","theme","isUser","role","conversationId","setConversationId","useState","useEffect","fetchId","id","isValidMessageId","length","startsWith","canFeedback","isLoading","createElement","style","styles","rowContainer","alignRight","alignLeft","timeContainer","TimeText","createdAt","likeDislikeContainer","LikeButton","type","state","hovered","borderButtonHover","reaction","onPress","LIKE","String","disabled","source","uri","resizeMode","width","height","tintColor","DISLIKE","Pressable","Text","create","flexDirection","justifyContent","alignItems","gap","marginHorizontal","marginTop","marginBottom","alignSelf","margin","backgroundColor"],"sourceRoot":"../../../src","sources":["components/MessageMetaRow.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,cAAc;AAEhE,SAASC,cAAc,EAAEC,mBAAmB,EAAEC,YAAY,QAAQ,SAAS;AAC3E,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,OAAOC,MAAM,MAAM,0BAA0B;AAE7C,SAASC,GAAG,QAAQ,0BAA0B;AAE9C,IAAIC,cAA4B,GAAGR,KAAK;AACxC,IAAIC,QAAQ,CAACQ,EAAE,KAAK,KAAK,EAAE;EACzB,IAAI;IACF,MAAMC,SAAS,GAAGC,OAAO,CAAC,YAAY,CAAC,CAACX,KAAK;IAC7C,IAAIU,SAAS,EAAEF,cAAc,GAAGE,SAAS;EAC3C,CAAC,CAAC,MAAM,CAAC;AACX;AAeA,OAAO,MAAME,cAA+B,GAAGA,CAAC;EAC9CC,OAAO;EACPC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAMC,KAAK,GAAGX,QAAQ,CAAC,CAAC;EACxB,MAAMY,MAAM,GAAGJ,OAAO,CAACK,IAAI,KAAK,MAAM;EACtC,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGvB,KAAK,CAACwB,QAAQ,CACxD,IACF,CAAC;EAEDxB,KAAK,CAACyB,SAAS,CAAC,MAAM;IACpB,MAAMC,OAAO,GAAG,MAAAA,CAAA,KAAY;MAC1B,MAAMC,EAAE,GAAG,MAAMrB,mBAAmB,CAACW,SAAS,CAAC;MAC/CM,iBAAiB,CAACI,EAAE,CAAC;IACvB,CAAC;IACDD,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAACT,SAAS,CAAC,CAAC;EAEf,MAAMW,gBAAgB,GACpB,OAAOZ,OAAO,CAACW,EAAE,KAAK,QAAQ,IAC9BX,OAAO,CAACW,EAAE,C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
1
1
|
import React, { memo, useEffect, useState } from "react";
|
|
2
|
-
import { View, StyleSheet,
|
|
2
|
+
import { View, StyleSheet, ScrollView, Platform, Image, Pressable } from "react-native";
|
|
3
3
|
import { getUserCurrencySymbol } from "./utils";
|
|
4
|
+
import { useTheme } from "styled-components/native";
|
|
5
|
+
import styled from "styled-components/native";
|
|
4
6
|
let ImageComponent = Image;
|
|
5
7
|
if (Platform.OS !== "web") {
|
|
6
8
|
try {
|
|
@@ -10,6 +12,171 @@ if (Platform.OS !== "web") {
|
|
|
10
12
|
// expo-image not installed, use React Native Image
|
|
11
13
|
}
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
// Token configuration for diamond details display
|
|
17
|
+
|
|
18
|
+
const DIAMOND_TOKENS = [
|
|
19
|
+
// Row 1: Basic specs
|
|
20
|
+
{
|
|
21
|
+
type: "field",
|
|
22
|
+
field: "shape_long",
|
|
23
|
+
style: "primary"
|
|
24
|
+
}, {
|
|
25
|
+
type: "fieldWithSuffix",
|
|
26
|
+
field: "size",
|
|
27
|
+
style: "secondary",
|
|
28
|
+
suffix: "ct",
|
|
29
|
+
showCurrencyIf: "price_per_carat"
|
|
30
|
+
}, {
|
|
31
|
+
type: "field",
|
|
32
|
+
field: "color",
|
|
33
|
+
style: "primary"
|
|
34
|
+
}, {
|
|
35
|
+
type: "field",
|
|
36
|
+
field: "clarity_short",
|
|
37
|
+
style: "primary"
|
|
38
|
+
}, {
|
|
39
|
+
type: "separator"
|
|
40
|
+
}, {
|
|
41
|
+
type: "group",
|
|
42
|
+
items: [{
|
|
43
|
+
type: "field",
|
|
44
|
+
field: "cut_short",
|
|
45
|
+
style: "primary"
|
|
46
|
+
}, {
|
|
47
|
+
type: "field",
|
|
48
|
+
field: "polish_short",
|
|
49
|
+
style: "primary",
|
|
50
|
+
prefix: "/"
|
|
51
|
+
}, {
|
|
52
|
+
type: "field",
|
|
53
|
+
field: "symmetry_short",
|
|
54
|
+
style: "primary",
|
|
55
|
+
prefix: "/"
|
|
56
|
+
}]
|
|
57
|
+
}, {
|
|
58
|
+
type: "separator"
|
|
59
|
+
}, {
|
|
60
|
+
type: "field",
|
|
61
|
+
field: "fluorescence_intensity_short",
|
|
62
|
+
style: "primary"
|
|
63
|
+
}, {
|
|
64
|
+
type: "separator"
|
|
65
|
+
}, {
|
|
66
|
+
type: "field",
|
|
67
|
+
field: "lab_short",
|
|
68
|
+
style: "primary"
|
|
69
|
+
}, {
|
|
70
|
+
type: "separator"
|
|
71
|
+
}, {
|
|
72
|
+
type: "field",
|
|
73
|
+
field: "discount_percent",
|
|
74
|
+
style: "secondary",
|
|
75
|
+
format: "percent"
|
|
76
|
+
},
|
|
77
|
+
// Row 2: Measurements & Pricing
|
|
78
|
+
{
|
|
79
|
+
type: "lineBreak"
|
|
80
|
+
}, {
|
|
81
|
+
type: "field",
|
|
82
|
+
field: "depth_percent",
|
|
83
|
+
style: "secondary",
|
|
84
|
+
prefix: "D",
|
|
85
|
+
format: "percent"
|
|
86
|
+
}, {
|
|
87
|
+
type: "separator"
|
|
88
|
+
}, {
|
|
89
|
+
type: "field",
|
|
90
|
+
field: "table_percent",
|
|
91
|
+
style: "secondary",
|
|
92
|
+
prefix: "T",
|
|
93
|
+
format: "percent"
|
|
94
|
+
}, {
|
|
95
|
+
type: "separator"
|
|
96
|
+
}, {
|
|
97
|
+
type: "field",
|
|
98
|
+
field: "measurement",
|
|
99
|
+
style: "secondary"
|
|
100
|
+
}, {
|
|
101
|
+
type: "separator"
|
|
102
|
+
}, {
|
|
103
|
+
type: "priceField",
|
|
104
|
+
field: "price_per_carat",
|
|
105
|
+
style: "secondary",
|
|
106
|
+
suffix: "PC"
|
|
107
|
+
}, {
|
|
108
|
+
type: "priceField",
|
|
109
|
+
field: "total_sales_price",
|
|
110
|
+
style: "secondary",
|
|
111
|
+
prefix: " ="
|
|
112
|
+
}];
|
|
113
|
+
const renderToken = (token, item, userCurrency, index) => {
|
|
114
|
+
const TextView = token.style === "secondary" ? TextStyleTwo : TextStyleOne;
|
|
115
|
+
const currency = userCurrency || "$";
|
|
116
|
+
const theme = useTheme();
|
|
117
|
+
switch (token.type) {
|
|
118
|
+
case "separator":
|
|
119
|
+
return /*#__PURE__*/React.createElement(TextView, {
|
|
120
|
+
key: index,
|
|
121
|
+
theme: theme
|
|
122
|
+
}, "·");
|
|
123
|
+
case "lineBreak":
|
|
124
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
125
|
+
key: index,
|
|
126
|
+
style: styles.lineBreak
|
|
127
|
+
});
|
|
128
|
+
case "field":
|
|
129
|
+
{
|
|
130
|
+
let value = item[token.field] ?? "-";
|
|
131
|
+
if (token.format === "percent" && value !== "-") {
|
|
132
|
+
value = `${value}%`;
|
|
133
|
+
}
|
|
134
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
135
|
+
key: index
|
|
136
|
+
}, token.prefix && /*#__PURE__*/React.createElement(TextView, {
|
|
137
|
+
theme: theme
|
|
138
|
+
}, token.prefix), /*#__PURE__*/React.createElement(TextView, {
|
|
139
|
+
theme: theme
|
|
140
|
+
}, value));
|
|
141
|
+
}
|
|
142
|
+
case "fieldWithSuffix":
|
|
143
|
+
{
|
|
144
|
+
const value = item[token.field] ?? "-";
|
|
145
|
+
const showSuffix = token.showCurrencyIf ? item[token.showCurrencyIf] : true;
|
|
146
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
147
|
+
key: index,
|
|
148
|
+
style: styles.rowCenter
|
|
149
|
+
}, /*#__PURE__*/React.createElement(TextView, {
|
|
150
|
+
theme: theme
|
|
151
|
+
}, value), showSuffix && token.suffix && /*#__PURE__*/React.createElement(TextView, {
|
|
152
|
+
theme: theme
|
|
153
|
+
}, token.suffix));
|
|
154
|
+
}
|
|
155
|
+
case "priceField":
|
|
156
|
+
{
|
|
157
|
+
const value = item[token.field];
|
|
158
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
159
|
+
key: index,
|
|
160
|
+
style: styles.rowCenter
|
|
161
|
+
}, token.prefix && /*#__PURE__*/React.createElement(TextView, {
|
|
162
|
+
theme: theme
|
|
163
|
+
}, token.prefix), value && /*#__PURE__*/React.createElement(TextView, {
|
|
164
|
+
theme: theme
|
|
165
|
+
}, currency), /*#__PURE__*/React.createElement(TextView, {
|
|
166
|
+
theme: theme
|
|
167
|
+
}, value ?? "-"), token.suffix && /*#__PURE__*/React.createElement(TextView, {
|
|
168
|
+
theme: theme
|
|
169
|
+
}, token.suffix));
|
|
170
|
+
}
|
|
171
|
+
case "group":
|
|
172
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
173
|
+
key: index,
|
|
174
|
+
style: styles.rowCenter
|
|
175
|
+
}, token.items?.map((subToken, subIndex) => renderToken(subToken, item, userCurrency, subIndex)));
|
|
176
|
+
default:
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
13
180
|
const ProductsListViewComponent = ({
|
|
14
181
|
data,
|
|
15
182
|
totalResults,
|
|
@@ -18,6 +185,7 @@ const ProductsListViewComponent = ({
|
|
|
18
185
|
item
|
|
19
186
|
}) => {
|
|
20
187
|
if (!data || !data.length) return null;
|
|
188
|
+
const theme = useTheme();
|
|
21
189
|
const [userCurrency, setUserCurrency] = useState(null);
|
|
22
190
|
useEffect(() => {
|
|
23
191
|
const fetchCurrency = async () => {
|
|
@@ -26,118 +194,29 @@ const ProductsListViewComponent = ({
|
|
|
26
194
|
};
|
|
27
195
|
fetchCurrency();
|
|
28
196
|
}, []);
|
|
29
|
-
return /*#__PURE__*/React.createElement(
|
|
30
|
-
|
|
197
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
198
|
+
theme: theme
|
|
31
199
|
}, /*#__PURE__*/React.createElement(ScrollView, {
|
|
32
200
|
showsVerticalScrollIndicator: false,
|
|
33
201
|
contentContainerStyle: styles.listContent
|
|
34
|
-
}, data.map((
|
|
35
|
-
key:
|
|
36
|
-
onPress: () => onItemPress?.(
|
|
202
|
+
}, data.map((dataItem, index) => /*#__PURE__*/React.createElement(Pressable, {
|
|
203
|
+
key: dataItem.id,
|
|
204
|
+
onPress: () => onItemPress?.(dataItem)
|
|
37
205
|
// @ts-ignore - hovered is available on web
|
|
38
206
|
,
|
|
39
207
|
style: ({
|
|
40
208
|
hovered
|
|
41
209
|
}) => [styles.itemContainer, hovered && styles.itemHover]
|
|
42
|
-
}, /*#__PURE__*/React.createElement(View,
|
|
210
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
43
211
|
style: styles.left
|
|
44
212
|
}, /*#__PURE__*/React.createElement(View, {
|
|
45
213
|
style: styles.serialContainer
|
|
46
|
-
}, /*#__PURE__*/React.createElement(
|
|
47
|
-
style: styles.serial
|
|
48
|
-
}, index + 1, ".")), /*#__PURE__*/React.createElement(View, {
|
|
214
|
+
}, /*#__PURE__*/React.createElement(Serial, null, index + 1, ".")), /*#__PURE__*/React.createElement(View, {
|
|
49
215
|
style: styles.tokens
|
|
50
|
-
}, /*#__PURE__*/React.createElement(
|
|
51
|
-
style: styles.textStyleOne
|
|
52
|
-
}, item.shape_long ?? "-"), /*#__PURE__*/React.createElement(View, {
|
|
53
|
-
style: {
|
|
54
|
-
flexDirection: "row",
|
|
55
|
-
alignItems: "center"
|
|
56
|
-
}
|
|
57
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
58
|
-
style: styles.textStyleTwo
|
|
59
|
-
}, item.size ?? "-"), item.price_per_carat ? /*#__PURE__*/React.createElement(Text, {
|
|
60
|
-
style: styles.textStyleOne
|
|
61
|
-
}, "ct") : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(Text, {
|
|
62
|
-
style: styles.textStyleOne
|
|
63
|
-
}, item.color ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
64
|
-
style: styles.textStyleOne
|
|
65
|
-
}, item.clarity_short ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
66
|
-
style: styles.textStyleOne
|
|
67
|
-
}, "·"), /*#__PURE__*/React.createElement(View, {
|
|
68
|
-
style: {
|
|
69
|
-
flexDirection: "row",
|
|
70
|
-
alignItems: "center"
|
|
71
|
-
}
|
|
72
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
73
|
-
style: styles.textStyleOne
|
|
74
|
-
}, item.cut_short ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
75
|
-
style: styles.textStyleOne
|
|
76
|
-
}, "/"), /*#__PURE__*/React.createElement(Text, {
|
|
77
|
-
style: styles.textStyleOne
|
|
78
|
-
}, item.polish_short ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
79
|
-
style: styles.textStyleOne
|
|
80
|
-
}, "/"), /*#__PURE__*/React.createElement(Text, {
|
|
81
|
-
style: styles.textStyleOne
|
|
82
|
-
}, item.symmetry_short ?? "-")), /*#__PURE__*/React.createElement(Text, {
|
|
83
|
-
style: styles.textStyleOne
|
|
84
|
-
}, "·"), /*#__PURE__*/React.createElement(Text, {
|
|
85
|
-
style: styles.textStyleOne
|
|
86
|
-
}, item.fluorescence_intensity_short ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
87
|
-
style: styles.textStyleOne
|
|
88
|
-
}, "·"), /*#__PURE__*/React.createElement(Text, {
|
|
89
|
-
style: styles.textStyleOne
|
|
90
|
-
}, item.lab_short ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
91
|
-
style: styles.textStyleOne
|
|
92
|
-
}, "·"), /*#__PURE__*/React.createElement(Text, {
|
|
93
|
-
style: styles.textStyleTwo
|
|
94
|
-
}, item.discount_percent ? item.discount_percent + "%" : "-"), /*#__PURE__*/React.createElement(View, {
|
|
95
|
-
style: styles.lineBreak
|
|
96
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
97
|
-
style: styles.textStyleOne
|
|
98
|
-
}, "D"), /*#__PURE__*/React.createElement(Text, {
|
|
99
|
-
style: styles.textStyleTwo
|
|
100
|
-
}, item.depth_percent ? item.depth_percent + "%" : "-"), /*#__PURE__*/React.createElement(Text, {
|
|
101
|
-
style: styles.textStyleOne
|
|
102
|
-
}, "·"), /*#__PURE__*/React.createElement(Text, {
|
|
103
|
-
style: styles.textStyleOne
|
|
104
|
-
}, "T"), /*#__PURE__*/React.createElement(Text, {
|
|
105
|
-
style: styles.textStyleTwo
|
|
106
|
-
}, item.table_percent ? item.table_percent + "%" : "-"), /*#__PURE__*/React.createElement(Text, {
|
|
107
|
-
style: styles.textStyleOne
|
|
108
|
-
}, "·"), /*#__PURE__*/React.createElement(Text, {
|
|
109
|
-
style: styles.textStyleTwo
|
|
110
|
-
}, item.measurement ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
111
|
-
style: styles.textStyleOne
|
|
112
|
-
}, "·"), /*#__PURE__*/React.createElement(View, {
|
|
113
|
-
style: {
|
|
114
|
-
flexDirection: "row",
|
|
115
|
-
alignItems: "center"
|
|
116
|
-
}
|
|
117
|
-
}, item.price_per_carat ? /*#__PURE__*/React.createElement(Text, {
|
|
118
|
-
style: styles.textStyleTwo
|
|
119
|
-
}, userCurrency ? userCurrency : "$") : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(Text, {
|
|
120
|
-
style: styles.textStyleTwo
|
|
121
|
-
}, item.price_per_carat ?? "-"), /*#__PURE__*/React.createElement(Text, {
|
|
122
|
-
style: styles.textStyleOne
|
|
123
|
-
}, "PC")), /*#__PURE__*/React.createElement(View, {
|
|
124
|
-
style: {
|
|
125
|
-
flexDirection: "row",
|
|
126
|
-
alignItems: "center"
|
|
127
|
-
}
|
|
128
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
129
|
-
style: styles.textStyleOne
|
|
130
|
-
}, " ="), item.total_sales_price ? /*#__PURE__*/React.createElement(Text, {
|
|
131
|
-
style: styles.textStyleTwo
|
|
132
|
-
}, userCurrency ? userCurrency : "$") : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(Text, {
|
|
133
|
-
style: styles.textStyleTwo
|
|
134
|
-
}, item.total_sales_price ?? "-")))))))), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
135
|
-
style: styles.button,
|
|
216
|
+
}, DIAMOND_TOKENS.map((token, tokenIndex) => renderToken(token, dataItem, userCurrency, tokenIndex))))))), /*#__PURE__*/React.createElement(ButtonView, {
|
|
136
217
|
activeOpacity: 0.8,
|
|
137
218
|
onPress: () => onViewAll(item)
|
|
138
|
-
}, /*#__PURE__*/React.createElement(
|
|
139
|
-
style: styles.buttonText
|
|
140
|
-
}, `View All ${totalResults} Results`), /*#__PURE__*/React.createElement(ImageComponent, {
|
|
219
|
+
}, /*#__PURE__*/React.createElement(ButtonText, null, `View All ${totalResults} Results`), /*#__PURE__*/React.createElement(ImageComponent, {
|
|
141
220
|
source: {
|
|
142
221
|
uri: "https://cdn.vdbapp.com/ai/chat-widget/assets/img/right.svg"
|
|
143
222
|
},
|
|
@@ -145,24 +224,66 @@ const ProductsListViewComponent = ({
|
|
|
145
224
|
style: {
|
|
146
225
|
width: 20,
|
|
147
226
|
height: 20,
|
|
148
|
-
tintColor: "#
|
|
227
|
+
tintColor: theme["primary-cont"] || "#ffffff"
|
|
149
228
|
}
|
|
150
229
|
})));
|
|
151
230
|
};
|
|
231
|
+
const Wrapper = styled.View`
|
|
232
|
+
padding-horizontal: 8px;
|
|
233
|
+
`;
|
|
234
|
+
const Serial = styled.Text`
|
|
235
|
+
font-size: 13px;
|
|
236
|
+
color: ${({
|
|
237
|
+
theme
|
|
238
|
+
}) => theme["core-05"] || "#020001"};
|
|
239
|
+
font-weight: 500;
|
|
240
|
+
`;
|
|
241
|
+
const TextStyleOne = styled.Text`
|
|
242
|
+
font-size: 13px;
|
|
243
|
+
color: ${({
|
|
244
|
+
theme
|
|
245
|
+
}) => theme["core-06"] || "#4F4E57"};
|
|
246
|
+
font-weight: 400;
|
|
247
|
+
font-family: "Roboto";
|
|
248
|
+
font-style: normal;
|
|
249
|
+
`;
|
|
250
|
+
const TextStyleTwo = styled.Text`
|
|
251
|
+
font-size: 13px;
|
|
252
|
+
color: ${({
|
|
253
|
+
theme
|
|
254
|
+
}) => theme["core-05"] || "#020001"};
|
|
255
|
+
font-weight: 500;
|
|
256
|
+
font-family: "Roboto";
|
|
257
|
+
font-style: normal;
|
|
258
|
+
`;
|
|
259
|
+
const ButtonView = styled.TouchableOpacity`
|
|
260
|
+
margin-top: 12px;
|
|
261
|
+
margin-horizontal: 12px;
|
|
262
|
+
align-self: center;
|
|
263
|
+
padding-horizontal: 16px;
|
|
264
|
+
padding-vertical: 6px;
|
|
265
|
+
background-color: ${({
|
|
266
|
+
theme
|
|
267
|
+
}) => theme["primary-bg-static"] || "#292735"};
|
|
268
|
+
border-radius: 8px;
|
|
269
|
+
align-items: center;
|
|
270
|
+
gap: 16px;
|
|
271
|
+
width: 100%;
|
|
272
|
+
flex-direction: row;
|
|
273
|
+
justify-content: center;
|
|
274
|
+
align-content: center;
|
|
275
|
+
`;
|
|
276
|
+
const ButtonText = styled.Text`
|
|
277
|
+
color: ${({
|
|
278
|
+
theme
|
|
279
|
+
}) => theme["primary-cont"] || "#ffffff"};
|
|
280
|
+
font-size: 14px;
|
|
281
|
+
font-weight: 600;
|
|
282
|
+
`;
|
|
152
283
|
const styles = StyleSheet.create({
|
|
153
|
-
wrapper: {
|
|
154
|
-
paddingHorizontal: 8
|
|
155
|
-
},
|
|
156
284
|
listContent: {
|
|
157
285
|
gap: 8
|
|
158
286
|
},
|
|
159
|
-
row: {
|
|
160
|
-
flexDirection: "row",
|
|
161
|
-
justifyContent: "space-between",
|
|
162
|
-
alignItems: "center",
|
|
163
|
-
paddingVertical: 6,
|
|
164
|
-
backgroundColor: "#fff"
|
|
165
|
-
},
|
|
166
287
|
left: {
|
|
167
288
|
flexDirection: "row",
|
|
168
289
|
alignItems: "flex-start",
|
|
@@ -184,30 +305,9 @@ const styles = StyleSheet.create({
|
|
|
184
305
|
width: "100%",
|
|
185
306
|
height: 0
|
|
186
307
|
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
fontWeight: "500"
|
|
191
|
-
},
|
|
192
|
-
textStyleOne: {
|
|
193
|
-
fontFamily: "Roboto",
|
|
194
|
-
fontSize: 13,
|
|
195
|
-
fontStyle: "normal",
|
|
196
|
-
fontWeight: "400",
|
|
197
|
-
color: "#4F4E57"
|
|
198
|
-
},
|
|
199
|
-
textStyleTwo: {
|
|
200
|
-
fontFamily: "Roboto",
|
|
201
|
-
fontSize: 13,
|
|
202
|
-
fontStyle: "normal",
|
|
203
|
-
fontWeight: "500",
|
|
204
|
-
color: "#020001"
|
|
205
|
-
},
|
|
206
|
-
price: {
|
|
207
|
-
fontSize: 13,
|
|
208
|
-
fontWeight: "500",
|
|
209
|
-
color: "#020001",
|
|
210
|
-
textAlign: "left"
|
|
308
|
+
rowCenter: {
|
|
309
|
+
flexDirection: "row",
|
|
310
|
+
alignItems: "center"
|
|
211
311
|
},
|
|
212
312
|
priceContainer: {
|
|
213
313
|
alignItems: "flex-start",
|
|
@@ -218,26 +318,6 @@ const styles = StyleSheet.create({
|
|
|
218
318
|
},
|
|
219
319
|
itemHover: {
|
|
220
320
|
backgroundColor: "#EDEDF2"
|
|
221
|
-
},
|
|
222
|
-
button: {
|
|
223
|
-
marginTop: 12,
|
|
224
|
-
marginHorizontal: 12,
|
|
225
|
-
alignSelf: "center",
|
|
226
|
-
paddingHorizontal: 16,
|
|
227
|
-
paddingVertical: 6,
|
|
228
|
-
backgroundColor: "#292735",
|
|
229
|
-
borderRadius: 8,
|
|
230
|
-
alignItems: "center",
|
|
231
|
-
gap: 16,
|
|
232
|
-
width: "100%",
|
|
233
|
-
flexDirection: "row",
|
|
234
|
-
justifyContent: "center",
|
|
235
|
-
alignContent: "center"
|
|
236
|
-
},
|
|
237
|
-
buttonText: {
|
|
238
|
-
color: "#fff",
|
|
239
|
-
fontSize: 14,
|
|
240
|
-
fontWeight: "600"
|
|
241
321
|
}
|
|
242
322
|
});
|
|
243
323
|
const ProductsListView = /*#__PURE__*/memo(ProductsListViewComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useEffect","useState","View","StyleSheet","
|
|
1
|
+
{"version":3,"names":["React","memo","useEffect","useState","View","StyleSheet","ScrollView","Platform","Image","Pressable","getUserCurrencySymbol","useTheme","styled","ImageComponent","OS","ExpoImage","require","DIAMOND_TOKENS","type","field","style","suffix","showCurrencyIf","items","prefix","format","renderToken","token","item","userCurrency","index","TextView","TextStyleTwo","TextStyleOne","currency","theme","createElement","key","styles","lineBreak","value","Fragment","showSuffix","rowCenter","map","subToken","subIndex","ProductsListViewComponent","data","totalResults","onViewAll","onItemPress","length","setUserCurrency","fetchCurrency","Wrapper","showsVerticalScrollIndicator","contentContainerStyle","listContent","dataItem","id","onPress","hovered","itemContainer","itemHover","left","serialContainer","Serial","tokens","tokenIndex","ButtonView","activeOpacity","ButtonText","source","uri","resizeMode","width","height","tintColor","Text","TouchableOpacity","create","gap","flexDirection","alignItems","minWidth","justifyContent","marginRight","flexWrap","flex","priceContainer","paddingVertical","backgroundColor","ProductsListView"],"sourceRoot":"../../../src","sources":["components/ProductsListView.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SACEC,IAAI,EACJC,UAAU,EAGVC,UAAU,EACVC,QAAQ,EACRC,KAAK,EACLC,SAAS,QACJ,cAAc;AACrB,SAASC,qBAAqB,QAAQ,SAAS;AAC/C,SAASC,QAAQ,QAAQ,0BAA0B;AAEnD,OAAOC,MAAM,MAAM,0BAA0B;AAE7C,IAAIC,cAA4B,GAAGL,KAAK;AACxC,IAAID,QAAQ,CAACO,EAAE,KAAK,KAAK,EAAE;EACzB,IAAI;IACF,MAAMC,SAAS,GAAGC,OAAO,CAAC,YAAY,CAAC,CAACR,KAAK;IAC7C,IAAIO,SAAS,EAAEF,cAAc,GAAGE,SAAS;EAC3C,CAAC,CAAC,MAAM;IACN;EAAA;AAEJ;;AAEA;;AAqBA,MAAME,cAA6B,GAAG;AACp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S;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMqC,UAAU,GAAG5D,MAAM,CAACmE,IAA6B;AACvD,WAAW,CAAC;EAAE5C;AAA+B,CAAC,KAC1CA,KAAK,CAAC,cAAc,CAAC,IAAI,SAAS;AACtC;AACA;AACA,CAAC;AAED,MAAMG,MAAM,GAAGjC,UAAU,CAAC4E,MAAM,CAAC;EAC/BvB,WAAW,EAAE;IACXwB,GAAG,EAAE;EACP,CAAC;EACDjB,IAAI,EAAE;IACJkB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,YAAY;IACxBC,QAAQ,EAAE;EACZ,CAAC;EAEDnB,eAAe,EAAE;IACfkB,UAAU,EAAE,YAAY;IACxBE,cAAc,EAAE,QAAQ;IACxBC,WAAW,EAAE;EACf,CAAC;EAEDnB,MAAM,EAAE;IACNe,aAAa,EAAE,KAAK;IACpBK,QAAQ,EAAE,MAAM;IAChBN,GAAG,EAAE,CAAC;IACNO,IAAI,EAAE,CAAC;IACPJ,QAAQ,EAAE;EACZ,CAAC;EACD9C,SAAS,EAAE;IACTqC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDlC,SAAS,EAAE;IACTwC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDM,cAAc,EAAE;IACdN,UAAU,EAAE,YAAY;IACxBE,cAAc,EAAE;EAClB,CAAC;EAEDvB,aAAa,EAAE;IACb4B,eAAe,EAAE;EACnB,CAAC;EAED3B,SAAS,EAAE;IACT4B,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,MAAMC,gBAAgB,gBAAG5F,IAAI,CAAC8C,yBAAyB,CAAC;AACxD,eAAe8C,gBAAgB","ignoreList":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { memo } from "react";
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, StyleSheet, ScrollView } from "react-native";
|
|
3
|
+
import styled from "styled-components/native";
|
|
4
|
+
import { useTheme } from "styled-components/native";
|
|
3
5
|
const SuggestionsRowComponent = ({
|
|
4
6
|
suggestions,
|
|
5
7
|
onSelect,
|
|
@@ -7,21 +9,42 @@ const SuggestionsRowComponent = ({
|
|
|
7
9
|
}) => {
|
|
8
10
|
if (!suggestions.length) return null;
|
|
9
11
|
const ScrollViewComponent = variant === "inline" ? View : ScrollView;
|
|
12
|
+
const theme = useTheme();
|
|
10
13
|
return /*#__PURE__*/React.createElement(ScrollViewComponent, {
|
|
11
14
|
showsVerticalScrollIndicator: false,
|
|
12
15
|
contentContainerStyle: [styles.container, variant === "inline" && styles.containerInline],
|
|
13
16
|
style: [styles.scroll, variant === "inline" && styles.scrollInline]
|
|
14
|
-
}, suggestions.map((s, index) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
17
|
+
}, suggestions.map((s, index) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ChipButton, {
|
|
15
18
|
key: `${s}-${index}`,
|
|
16
|
-
|
|
19
|
+
theme: theme,
|
|
20
|
+
variant: variant,
|
|
17
21
|
onPress: () => onSelect(s),
|
|
18
22
|
activeOpacity: 0.75
|
|
19
|
-
}, /*#__PURE__*/React.createElement(
|
|
20
|
-
style: styles.chipText
|
|
21
|
-
}, s)), index < suggestions.length - 1 && /*#__PURE__*/React.createElement(View, {
|
|
23
|
+
}, /*#__PURE__*/React.createElement(ChipText, null, s)), index < suggestions.length - 1 && /*#__PURE__*/React.createElement(View, {
|
|
22
24
|
style: styles.spacer
|
|
23
25
|
}))));
|
|
24
26
|
};
|
|
27
|
+
const ChipButton = styled.TouchableOpacity`
|
|
28
|
+
background-color: ${({
|
|
29
|
+
theme,
|
|
30
|
+
variant
|
|
31
|
+
}) => variant === "inline" ? theme["core-01"] || "#FFFFFF" : theme["core-02"] || "#EDEDF2"};
|
|
32
|
+
border-radius: 6px;
|
|
33
|
+
padding-horizontal: 8px;
|
|
34
|
+
padding-vertical: 6px;
|
|
35
|
+
width: 100%;
|
|
36
|
+
align-self: stretch;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: flex-start;
|
|
39
|
+
`;
|
|
40
|
+
const ChipText = styled.Text`
|
|
41
|
+
color: ${({
|
|
42
|
+
theme
|
|
43
|
+
}) => theme["core-05"] || "#1A1A1A"};
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
text-align: left;
|
|
47
|
+
`;
|
|
25
48
|
const styles = StyleSheet.create({
|
|
26
49
|
scroll: {
|
|
27
50
|
maxWidth: "80%",
|
|
@@ -46,25 +69,6 @@ const styles = StyleSheet.create({
|
|
|
46
69
|
// inside bubble, rely on bubble background
|
|
47
70
|
gap: 6
|
|
48
71
|
},
|
|
49
|
-
chip: {
|
|
50
|
-
backgroundColor: "#EDEDF2",
|
|
51
|
-
borderRadius: 6,
|
|
52
|
-
paddingHorizontal: 8,
|
|
53
|
-
paddingVertical: 6,
|
|
54
|
-
width: "100%",
|
|
55
|
-
alignSelf: "stretch",
|
|
56
|
-
justifyContent: "center",
|
|
57
|
-
alignItems: "flex-start"
|
|
58
|
-
},
|
|
59
|
-
chipInline: {
|
|
60
|
-
backgroundColor: "#FFFFFF"
|
|
61
|
-
},
|
|
62
|
-
chipText: {
|
|
63
|
-
fontSize: 14,
|
|
64
|
-
color: "#1A1A1A",
|
|
65
|
-
fontWeight: "500",
|
|
66
|
-
textAlign: "left"
|
|
67
|
-
},
|
|
68
72
|
spacer: {
|
|
69
73
|
width: 4,
|
|
70
74
|
height: 4
|