@paymanai/payman-ask-sdk 1.2.16 → 1.2.18
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/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +354 -152
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +356 -154
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.js +119 -102
- package/dist/index.native.js.map +1 -1
- package/dist/styles.css +393 -36
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.native.js
CHANGED
|
@@ -37,6 +37,7 @@ var VOICE_THEME_RGBA = "rgba(0, 133, 141, 0.6)";
|
|
|
37
37
|
var VOICE_THEME_RGBA_LIGHT = "rgba(0, 133, 141, 0.2)";
|
|
38
38
|
var VOICE_BAR_BG = "#f0f9f9";
|
|
39
39
|
var VOICE_BAR_BORDER = "rgba(0, 133, 141, 0.35)";
|
|
40
|
+
var AI_DISCLAIMER_TEXT = "AI can make mistakes. Please double-check responses.";
|
|
40
41
|
var VoiceWaveformBar = React.memo(
|
|
41
42
|
({
|
|
42
43
|
index,
|
|
@@ -205,7 +206,7 @@ function ChatInput({
|
|
|
205
206
|
);
|
|
206
207
|
onCancelRecording?.();
|
|
207
208
|
};
|
|
208
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
209
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
209
210
|
reactNative.View,
|
|
210
211
|
{
|
|
211
212
|
style: [
|
|
@@ -213,111 +214,114 @@ function ChatInput({
|
|
|
213
214
|
layout === "centered" && s.outerBarCentered,
|
|
214
215
|
showVoiceBar && s.outerBarVoiceMargin
|
|
215
216
|
],
|
|
216
|
-
children:
|
|
217
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
218
|
-
/* @__PURE__ */ jsxRuntime.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
opacity: animOpacity,
|
|
247
|
-
transform: [{ scale: animScale }]
|
|
248
|
-
}
|
|
249
|
-
],
|
|
250
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s.voiceBar, children: [
|
|
251
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
252
|
-
reactNative.Pressable,
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s.column, children: [
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [s.inputWrap, showVoiceBar && s.inputWrapRelative], children: [
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
reactNative.TextInput,
|
|
222
|
+
{
|
|
223
|
+
ref: inputRef,
|
|
224
|
+
value,
|
|
225
|
+
onChangeText: onChange,
|
|
226
|
+
onPress: onClick,
|
|
227
|
+
editable: !isInputDisabled,
|
|
228
|
+
placeholder: getPlaceholder(),
|
|
229
|
+
placeholderTextColor: "#9CA3AF",
|
|
230
|
+
multiline: true,
|
|
231
|
+
style: [
|
|
232
|
+
s.input,
|
|
233
|
+
isInputDisabled && s.inputDisabled,
|
|
234
|
+
showVoiceBar && s.inputHiddenKeepFocus
|
|
235
|
+
],
|
|
236
|
+
returnKeyType: "default",
|
|
237
|
+
blurOnSubmit: false,
|
|
238
|
+
onSubmitEditing: handleSubmit
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
showVoiceBar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
242
|
+
reactNative.Animated.View,
|
|
243
|
+
{
|
|
244
|
+
pointerEvents: "box-none",
|
|
245
|
+
style: [
|
|
246
|
+
s.voiceBarContainer,
|
|
253
247
|
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
s.voiceBarCancelBtn,
|
|
257
|
-
pressed && s.btnPressed
|
|
258
|
-
],
|
|
259
|
-
accessibilityLabel: "Cancel recording",
|
|
260
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.X, { size: 20, color: VOICE_THEME_COLOR, strokeWidth: 2.5 })
|
|
248
|
+
opacity: animOpacity,
|
|
249
|
+
transform: [{ scale: animScale }]
|
|
261
250
|
}
|
|
262
|
-
|
|
263
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s.
|
|
264
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
-
|
|
251
|
+
],
|
|
252
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s.voiceBar, children: [
|
|
253
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
254
|
+
reactNative.Pressable,
|
|
266
255
|
{
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
reactNative.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
256
|
+
onPress: handleCancelRecording,
|
|
257
|
+
style: ({ pressed }) => [
|
|
258
|
+
s.voiceBarCancelBtn,
|
|
259
|
+
pressed && s.btnPressed
|
|
260
|
+
],
|
|
261
|
+
accessibilityLabel: "Cancel recording",
|
|
262
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.X, { size: 20, color: VOICE_THEME_COLOR, strokeWidth: 2.5 })
|
|
263
|
+
}
|
|
264
|
+
),
|
|
265
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s.voiceBarCenter, children: [
|
|
266
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s.voiceBarDots, children: Array.from({ length: VOICE_DOT_COUNT }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
267
|
+
VoiceWaveformBar,
|
|
268
|
+
{
|
|
269
|
+
index: i,
|
|
270
|
+
isActive: isUserSpeaking,
|
|
271
|
+
barColor: VOICE_THEME_RGBA
|
|
272
|
+
},
|
|
273
|
+
i
|
|
274
|
+
)) }),
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s.voiceBarTimer, children: formatDuration(recordingDurationSeconds) })
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
278
|
+
reactNative.Pressable,
|
|
279
|
+
{
|
|
280
|
+
onPress: handleConfirmRecording,
|
|
281
|
+
style: ({ pressed }) => [
|
|
282
|
+
s.voiceBarConfirmBtn,
|
|
283
|
+
pressed && s.btnPressed
|
|
284
|
+
],
|
|
285
|
+
accessibilityLabel: "Confirm and send recording",
|
|
286
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.Check, { size: 22, color: VOICE_THEME_COLOR, strokeWidth: 2.5 })
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
] })
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] }),
|
|
293
|
+
!showVoiceBar && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s.actionsRow, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: s.rightActions, children: [
|
|
294
|
+
showVoiceButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
295
|
+
reactNative.Pressable,
|
|
296
|
+
{
|
|
297
|
+
onPress: onVoicePress,
|
|
298
|
+
disabled: isVoiceButtonDisabled,
|
|
299
|
+
style: ({ pressed }) => [
|
|
300
|
+
s.iconBtn,
|
|
301
|
+
pressed && s.btnPressed,
|
|
302
|
+
isVoiceButtonDisabled && s.btnDisabled
|
|
303
|
+
],
|
|
304
|
+
accessibilityLabel: "Voice input",
|
|
305
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s.iconBtnInner, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.Mic, { size: 22, color: "#6B7280", strokeWidth: 2 }) })
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
309
|
+
reactNative.Pressable,
|
|
310
|
+
{
|
|
311
|
+
onPress: onSend,
|
|
312
|
+
disabled: !canSend,
|
|
313
|
+
style: ({ pressed }) => [
|
|
314
|
+
s.sendBtn,
|
|
315
|
+
!canSend && s.btnDisabled,
|
|
316
|
+
pressed && s.btnPressed
|
|
317
|
+
],
|
|
318
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s.sendBtnInner, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.Send, { size: 18, color: "#FFFFFF" }) })
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
] }) })
|
|
290
322
|
] }),
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
reactNative.Pressable,
|
|
294
|
-
{
|
|
295
|
-
onPress: onVoicePress,
|
|
296
|
-
disabled: isVoiceButtonDisabled,
|
|
297
|
-
style: ({ pressed }) => [
|
|
298
|
-
s.iconBtn,
|
|
299
|
-
pressed && s.btnPressed,
|
|
300
|
-
isVoiceButtonDisabled && s.btnDisabled
|
|
301
|
-
],
|
|
302
|
-
accessibilityLabel: "Voice input",
|
|
303
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s.iconBtnInner, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.Mic, { size: 22, color: "#6B7280", strokeWidth: 2 }) })
|
|
304
|
-
}
|
|
305
|
-
),
|
|
306
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
-
reactNative.Pressable,
|
|
308
|
-
{
|
|
309
|
-
onPress: onSend,
|
|
310
|
-
disabled: !canSend,
|
|
311
|
-
style: ({ pressed }) => [
|
|
312
|
-
s.sendBtn,
|
|
313
|
-
!canSend && s.btnDisabled,
|
|
314
|
-
pressed && s.btnPressed
|
|
315
|
-
],
|
|
316
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s.sendBtnInner, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReactNative.Send, { size: 18, color: "#FFFFFF" }) })
|
|
317
|
-
}
|
|
318
|
-
)
|
|
319
|
-
] }) })
|
|
320
|
-
] })
|
|
323
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: s.disclaimerWrap, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: s.disclaimerText, children: AI_DISCLAIMER_TEXT }) })
|
|
324
|
+
]
|
|
321
325
|
}
|
|
322
326
|
);
|
|
323
327
|
}
|
|
@@ -334,6 +338,19 @@ var s = reactNative.StyleSheet.create({
|
|
|
334
338
|
borderTopRightRadius: 20
|
|
335
339
|
},
|
|
336
340
|
outerBarCentered: { alignItems: "center" },
|
|
341
|
+
disclaimerWrap: {
|
|
342
|
+
maxWidth: 672,
|
|
343
|
+
width: "100%",
|
|
344
|
+
alignSelf: "center",
|
|
345
|
+
paddingHorizontal: 12,
|
|
346
|
+
marginTop: 2
|
|
347
|
+
},
|
|
348
|
+
disclaimerText: {
|
|
349
|
+
fontSize: 11,
|
|
350
|
+
lineHeight: 15,
|
|
351
|
+
color: "#6B7280",
|
|
352
|
+
textAlign: "center"
|
|
353
|
+
},
|
|
337
354
|
column: {
|
|
338
355
|
maxWidth: 672,
|
|
339
356
|
width: "100%",
|