@vinaverse/react-native 0.1.0-alpha.7 → 0.1.0-alpha.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.
@@ -320,7 +320,7 @@ function ListingCard(props) {
320
320
  );
321
321
  const hero = photoUrl === failed ? null : photoUrl;
322
322
  const Img = slots.Image ?? Image;
323
- const rating = card.rating ? `\u2605 ${ratingText(card.rating.value_ppm, locale)} (${card.rating.count})` : null;
323
+ const rating = card.rating ? `\u2605 ${ratingText(card.rating.value_ppm, locale)} (${card.rating.count})` : t("ratingNone") || null;
324
324
  const price = card.price_from ? t("priceFrom", {
325
325
  price: formatMoney(
326
326
  card.price_from.amount,
@@ -349,7 +349,7 @@ function ListingCard(props) {
349
349
  accessible: false,
350
350
  testID: `vinaverse-photo-${card.id}`
351
351
  }
352
- ) : imagePolicy?.Placeholder ? /* @__PURE__ */ jsx(View, { style: photo, testID: `vinaverse-placeholder-${card.id}`, children: /* @__PURE__ */ jsx(imagePolicy.Placeholder, { title: card.title }) }) : /* @__PURE__ */ jsx(
352
+ ) : imagePolicy?.Placeholder ? /* @__PURE__ */ jsx(View, { style: photo, testID: `vinaverse-placeholder-${card.id}`, children: /* @__PURE__ */ jsx(imagePolicy.Placeholder, { title: card.title, kind: card.kind }) }) : /* @__PURE__ */ jsx(
353
353
  View,
354
354
  {
355
355
  accessible: false,
@@ -504,7 +504,9 @@ function ProposalCard(props) {
504
504
  props.card.id,
505
505
  () => onProposal(props.card, decision)
506
506
  ).catch(
507
- (error) => handlers.current?.onWarning?.(`Vinaverse proposal: ${String(error)}`)
507
+ (error) => handlers.current?.onWarning?.(`Vinaverse proposal: ${String(error)}`, {
508
+ code: "proposal_failed"
509
+ })
508
510
  );
509
511
  };
510
512
  const fields = proposal.fields.map((f) => {
@@ -626,7 +628,9 @@ function QuestionCard(props) {
626
628
  try {
627
629
  store.answer(held.id, questionId, answer);
628
630
  } catch (error) {
629
- handlers.current?.onWarning?.(`Vinaverse answer: ${String(error)}`);
631
+ handlers.current?.onWarning?.(`Vinaverse answer: ${String(error)}`, {
632
+ code: "answer_failed"
633
+ });
630
634
  }
631
635
  };
632
636
  const locked = held.locked.includes(question.question_id);
@@ -737,7 +741,8 @@ function Answer(props) {
737
741
  if (picked) send({ upload_ref: picked.upload_ref });
738
742
  }).catch(
739
743
  (error) => handlers.current?.onWarning?.(
740
- `Vinaverse photo: ${String(error)}`
744
+ `Vinaverse photo: ${String(error)}`,
745
+ { code: "photo_failed" }
741
746
  )
742
747
  );
743
748
  }
@@ -2198,10 +2203,11 @@ function VinaverseChatProvider(props) {
2198
2203
  useEffect(() => {
2199
2204
  if (!onWarning) return;
2200
2205
  for (const problem of themeProblems(theme))
2201
- onWarning(`Vinaverse theme: ${problem}`);
2206
+ onWarning(`Vinaverse theme: ${problem}`, { code: "theme" });
2202
2207
  for (const key of bannedWordsIn(copy ?? {}))
2203
2208
  onWarning(
2204
- `Vinaverse copy: "${key}" says assistant, bot or crew; the copy says agent.`
2209
+ `Vinaverse copy: "${key}" says assistant, bot or crew; the copy says agent.`,
2210
+ { code: "copy" }
2205
2211
  );
2206
2212
  }, [onWarning, theme, copy]);
2207
2213
  return /* @__PURE__ */ jsx(CopyProvider, { locale: props.locale, copy: props.copy, children: /* @__PURE__ */ jsx(ThemeProvider, { theme: props.theme, colorScheme: props.colorScheme, children: /* @__PURE__ */ jsx(ChatContextProvider, { value, children: props.children }) }) });
@@ -2225,7 +2231,7 @@ function Layout(props) {
2225
2231
  const { direction } = useCopy();
2226
2232
  const { onError } = props;
2227
2233
  const reportError = useMemo(
2228
- () => onError ? (e) => onError(String(e)) : void 0,
2234
+ () => onError ? (e) => onError(String(e), { code: "send_failed" }) : void 0,
2229
2235
  [onError]
2230
2236
  );
2231
2237
  return /* @__PURE__ */ jsxs(
@@ -2558,5 +2564,5 @@ function AgentFooter(props) {
2558
2564
  }
2559
2565
 
2560
2566
  export { ActivityLine, AgentChat, AgentFooter, Avatar, Button, CardActions, CardCarousel, CardFrame, CardView, ChatHeader, ChatSkeleton, Composer, DefaultBubble, DefaultComposer, DefaultEnded, DefaultHeader, DefaultTurnFailed, DefaultUnavailable, DefaultUnavailableScreen, DefaultUnreachable, DisclosureBar, FailureActionButton, InfoCard, LinksCard, ListingCard, MessageBubble, MessageList, NextStepCard, ProposalCard, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, TimeSlotsCard, VinaverseChat, VinaverseChatProvider, Welcome, allowedImage, answerText, carousels, defaultCard, fieldText, itemType, monogram, newestWholeReply, ratingText, useChat };
2561
- //# sourceMappingURL=chunk-HTUXHZ7X.js.map
2562
- //# sourceMappingURL=chunk-HTUXHZ7X.js.map
2567
+ //# sourceMappingURL=chunk-NXGLI4Y7.js.map
2568
+ //# sourceMappingURL=chunk-NXGLI4Y7.js.map