@adminide-stack/yantra-mobile 12.0.194-alpha.0 → 12.0.194

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.
Files changed (132) hide show
  1. package/lib/bridge/handlers/NavigationBridgeHandler.js +6 -9
  2. package/lib/bridge/handlers/NavigationBridgeHandler.js.map +1 -1
  3. package/lib/components/BrandBar/BrandBarBackground.js +27 -0
  4. package/lib/components/BrandBar/BrandBarBackground.js.map +1 -0
  5. package/lib/components/BrandBar/MenuToggle.js +73 -0
  6. package/lib/components/BrandBar/MenuToggle.js.map +1 -0
  7. package/lib/components/CustomDrawer.js +6 -6
  8. package/lib/components/CustomDrawer.js.map +1 -1
  9. package/lib/components/GatewayConnector/GatewayConnector.js +3 -2
  10. package/lib/components/GatewayConnector/GatewayConnector.js.map +1 -1
  11. package/lib/components/GatewayToolbarButtonMobile.js +12 -2
  12. package/lib/components/GatewayToolbarButtonMobile.js.map +1 -1
  13. package/lib/components/NavigationHeader/HeaderChip.js +76 -0
  14. package/lib/components/NavigationHeader/HeaderChip.js.map +1 -0
  15. package/lib/components/NavigationHeader/HeaderSkillsButton.js +4 -3
  16. package/lib/components/NavigationHeader/HeaderSkillsButton.js.map +1 -1
  17. package/lib/components/NavigationHeader/HeaderTasksButton.js +4 -3
  18. package/lib/components/NavigationHeader/HeaderTasksButton.js.map +1 -1
  19. package/lib/components/NavigationHeader/NavigationHeader.js +96 -41
  20. package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -1
  21. package/lib/components/YantraTopBar/YantraTopBar.js +98 -0
  22. package/lib/components/YantraTopBar/YantraTopBar.js.map +1 -0
  23. package/lib/compute.js +18 -25
  24. package/lib/compute.js.map +1 -1
  25. package/lib/features/apps/AppsCatalog.js +7 -4
  26. package/lib/features/apps/AppsCatalog.js.map +1 -1
  27. package/lib/features/apps/MarketplaceGallery.js +6 -3
  28. package/lib/features/apps/MarketplaceGallery.js.map +1 -1
  29. package/lib/features/apps/nativeSurfaceTwin.js +1 -1
  30. package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
  31. package/lib/features/apps/useMarketplaceApps.js +6 -2
  32. package/lib/features/apps/useMarketplaceApps.js.map +1 -1
  33. package/lib/features/attachments/useImageAttachments.js +44 -1
  34. package/lib/features/attachments/useImageAttachments.js.map +1 -1
  35. package/lib/features/credits/FreeCreditsPhoneStepHost.js +67 -0
  36. package/lib/features/credits/FreeCreditsPhoneStepHost.js.map +1 -0
  37. package/lib/features/credits/freeCredits.js +52 -13
  38. package/lib/features/credits/freeCredits.js.map +1 -1
  39. package/lib/features/credits/freeCreditsPhoneStep.js +55 -0
  40. package/lib/features/credits/freeCreditsPhoneStep.js.map +1 -0
  41. package/lib/features/credits/useFreeCredits.js +29 -3
  42. package/lib/features/credits/useFreeCredits.js.map +1 -1
  43. package/lib/features/links/openInApp.js +3 -6
  44. package/lib/features/links/openInApp.js.map +1 -1
  45. package/lib/features/webbuilder/WebBuilderExperience.js +88 -28
  46. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  47. package/lib/features/webbuilder/appPreview.js +70 -0
  48. package/lib/features/webbuilder/appPreview.js.map +1 -0
  49. package/lib/features/webbuilder/buildFragments.js +33 -12
  50. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  51. package/lib/features/webbuilder/components/AppPhoneSheet.js +127 -0
  52. package/lib/features/webbuilder/components/AppPhoneSheet.js.map +1 -0
  53. package/lib/features/webbuilder/components/BottomTabs.js +32 -21
  54. package/lib/features/webbuilder/components/BottomTabs.js.map +1 -1
  55. package/lib/features/webbuilder/components/Composer.js +144 -47
  56. package/lib/features/webbuilder/components/Composer.js.map +1 -1
  57. package/lib/features/webbuilder/components/PreviewFrame.js +1 -1
  58. package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
  59. package/lib/features/webbuilder/components/PreviewScreen.js +9 -4
  60. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  61. package/lib/features/webbuilder/components/ProjectSheets.js +76 -22
  62. package/lib/features/webbuilder/components/ProjectSheets.js.map +1 -1
  63. package/lib/features/webbuilder/components/ProjectsScreen.js +30 -12
  64. package/lib/features/webbuilder/components/ProjectsScreen.js.map +1 -1
  65. package/lib/features/webbuilder/components/PublishSheet.js +2 -2
  66. package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
  67. package/lib/features/webbuilder/components/SiteUploadSheet.js +17 -2
  68. package/lib/features/webbuilder/components/SiteUploadSheet.js.map +1 -1
  69. package/lib/features/webbuilder/components/SocialExportPicker.js +253 -0
  70. package/lib/features/webbuilder/components/SocialExportPicker.js.map +1 -0
  71. package/lib/features/webbuilder/components/StudioHome.js +300 -185
  72. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  73. package/lib/features/webbuilder/components/TemplateCard.js +13 -5
  74. package/lib/features/webbuilder/components/TemplateCard.js.map +1 -1
  75. package/lib/features/webbuilder/connectorTemplates.js +3 -2
  76. package/lib/features/webbuilder/connectorTemplates.js.map +1 -1
  77. package/lib/features/webbuilder/liveSiteDelete.js +58 -0
  78. package/lib/features/webbuilder/liveSiteDelete.js.map +1 -0
  79. package/lib/features/webbuilder/publishTools.js +3 -1
  80. package/lib/features/webbuilder/publishTools.js.map +1 -1
  81. package/lib/features/webbuilder/socialExportFile.js +84 -0
  82. package/lib/features/webbuilder/socialExportFile.js.map +1 -0
  83. package/lib/features/webbuilder/stepLabels.js +7 -7
  84. package/lib/features/webbuilder/stepLabels.js.map +1 -1
  85. package/lib/features/webbuilder/thumbSources.js +17 -3
  86. package/lib/features/webbuilder/thumbSources.js.map +1 -1
  87. package/lib/features/webbuilder/useVoiceTyping.js +169 -0
  88. package/lib/features/webbuilder/useVoiceTyping.js.map +1 -0
  89. package/lib/features/webbuilder/web/chat/connectRequest.js +17 -0
  90. package/lib/features/webbuilder/web/chat/connectRequest.js.map +1 -0
  91. package/lib/features/webbuilder/web/notify/turnDone.js +20 -0
  92. package/lib/features/webbuilder/web/notify/turnDone.js.map +1 -0
  93. package/lib/features/webbuilder/web/project/coverRequest.js +22 -0
  94. package/lib/features/webbuilder/web/project/coverRequest.js.map +1 -0
  95. package/lib/features/webbuilder/web/project/deleteFlow.js +57 -0
  96. package/lib/features/webbuilder/web/project/deleteFlow.js.map +1 -0
  97. package/lib/features/webbuilder/web/publish/siteAddress.js +5 -1
  98. package/lib/features/webbuilder/web/publish/siteAddress.js.map +1 -1
  99. package/lib/features/webbuilder/web/upload/sitePhotos.js +2 -2
  100. package/lib/features/webbuilder/web/upload/sitePhotos.js.map +1 -1
  101. package/lib/features/webbuilder/web/upload/socialExport.js +191 -0
  102. package/lib/features/webbuilder/web/upload/socialExport.js.map +1 -0
  103. package/lib/features/webbuilder/web/upload/zipRandomAccess.js +64 -0
  104. package/lib/features/webbuilder/web/upload/zipRandomAccess.js.map +1 -0
  105. package/lib/features/webbuilder/web/webServices.js +27 -3
  106. package/lib/features/webbuilder/web/webServices.js.map +1 -1
  107. package/lib/hooks/useHeaderProfile.js +25 -0
  108. package/lib/hooks/useHeaderProfile.js.map +1 -0
  109. package/lib/index.js +1 -1
  110. package/lib/index.js.map +1 -1
  111. package/lib/routes.json +21 -29
  112. package/lib/screens/Account/AccountSheets.js +140 -74
  113. package/lib/screens/Account/AccountSheets.js.map +1 -1
  114. package/lib/screens/Account/index.js +3 -3
  115. package/lib/screens/Account/index.js.map +1 -1
  116. package/lib/screens/Apps/index.js +1 -1
  117. package/lib/screens/Apps/index.js.map +1 -1
  118. package/lib/screens/ChatHistory/index.js +1 -1
  119. package/lib/screens/ChatHistory/index.js.map +1 -1
  120. package/lib/screens/ExpensesNative/index.js +3 -3
  121. package/lib/screens/ExpensesNative/index.js.map +1 -1
  122. package/lib/screens/Home/HomeScreen.js +11 -0
  123. package/lib/screens/Home/HomeScreen.js.map +1 -1
  124. package/lib/screens/Home/components/ChatHistoryLanding.js +3 -2
  125. package/lib/screens/Home/components/ChatHistoryLanding.js.map +1 -1
  126. package/lib/screens/WebBuilderNative/index.js +3 -2
  127. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  128. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +2 -2
  129. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  130. package/lib/utils/drawerRoutes.js +13 -0
  131. package/lib/utils/drawerRoutes.js.map +1 -0
  132. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useRef,useEffect,useMemo,useCallback}from'react';import {View,StyleSheet,Image,ActivityIndicator,Pressable,TextInput,ScrollView,Modal,Platform}from'react-native';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useLazyQuery,gql}from'@apollo/client/index.js';import {useDispatch}from'react-redux';import {updateUserProfile}from'@adminide-stack/user-auth0-client';import {useAccountProfileQuery,useCreateFileUploadLinksMutation,useUploadAccountProfilePhotoMutation,useDeleteAccountProfilePhotoMutation,useSetNameMutation,useUpdateUserProfileMutation,useIsUsernameAvailableLazyQuery,useSetGenderMutation,useSetDobMutation,useSetEmailAddressMutation,useSendEmailOtpMutation,useAddPhoneNumberMutation,useRemovePhoneNumberMutation,useSendPhoneOtpMutation}from'common/graphql';import {AppKeyboardAvoidingView}from'../../components/AppKeyboardAvoidingView.js';import {mobileTokens}from'../../theme/mobileTokens.js';import {USERNAME_HINT,GENDER_OPTIONS,savedDay,MONTHS,daysInMonth,isNewEmail,VERIFICATION_CODE_LENGTH,formatPhoneCode,looksLikePhoneNumber,USERNAME_SHAPE,USERNAME_INVALID,USERNAME_TAKEN,USERNAME_SAVE_FAILED,dobValue,RESEND_AFTER_SECONDS,contactCodeError,retryAfterSeconds,CODE_TTL_MINUTES}from'./accountRules.js';var __defProp = Object.defineProperty;
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useRef,useEffect,useMemo,useCallback}from'react';import {View,StyleSheet,Image,ActivityIndicator,Pressable,Modal,ScrollView,Platform,TextInput}from'react-native';import {Ionicons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useLazyQuery,gql}from'@apollo/client/index.js';import {useDispatch}from'react-redux';import {updateUserProfile}from'@adminide-stack/user-auth0-client';import {useAccountProfileQuery,useCreateFileUploadLinksMutation,useUploadAccountProfilePhotoMutation,useDeleteAccountProfilePhotoMutation,useSetNameMutation,useUpdateUserProfileMutation,useIsUsernameAvailableLazyQuery,useSetGenderMutation,useSetDobMutation,useSetEmailAddressMutation,useSendEmailOtpMutation,useRemovePhoneNumberMutation,useAddPhoneNumberMutation,useSendPhoneOtpMutation}from'common/graphql';import {AppKeyboardAvoidingView}from'../../components/AppKeyboardAvoidingView.js';import {mobileTokens}from'../../theme/mobileTokens.js';import {USERNAME_HINT,GENDER_OPTIONS,savedDay,MONTHS,daysInMonth,isNewEmail,VERIFICATION_CODE_LENGTH,USERNAME_SHAPE,USERNAME_INVALID,USERNAME_TAKEN,USERNAME_SAVE_FAILED,dobValue,RESEND_AFTER_SECONDS,contactCodeError,retryAfterSeconds,CODE_TTL_MINUTES,formatPhoneCode,looksLikePhoneNumber}from'./accountRules.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -60,6 +60,7 @@ function Sheet({
60
60
  onClose,
61
61
  onSave,
62
62
  saveLabel = "Save",
63
+ cancelLabel,
63
64
  saveDisabled,
64
65
  busy,
65
66
  children
@@ -79,7 +80,7 @@ function Sheet({
79
80
  /* @__PURE__ */ jsxs(View, { style: styles.actions, children: [
80
81
  /* @__PURE__ */ jsx(Pressable, { onPress: onClose, style: styles.ghost, accessibilityRole: "button", children: /* @__PURE__ */ jsx(Text, { style: [styles.ghostLabel, {
81
82
  color: colors.textMuted
82
- }], children: onSave ? "Cancel" : "Done" }) }),
83
+ }], children: cancelLabel != null ? cancelLabel : onSave ? "Cancel" : "Done" }) }),
83
84
  onSave ? /* @__PURE__ */ jsx(Pressable, { onPress: onSave, disabled: saveDisabled || busy, accessibilityRole: "button", accessibilityLabel: saveLabel, style: [styles.primary, (saveDisabled || busy) && styles.dim], children: busy ? /* @__PURE__ */ jsx(ActivityIndicator, { color: "#fff" }) : /* @__PURE__ */ jsx(Text, { style: styles.primaryLabel, children: saveLabel }) }) : null
84
85
  ] })
85
86
  ] })
@@ -509,15 +510,15 @@ function EmailSheet({
509
510
  ] }) : /* @__PURE__ */ jsx(CodeStep, { sentTo: trimmed, code, onChange: (next) => {
510
511
  setCode(next);
511
512
  setRefused(false);
512
- }, invalid: refused, secondsLeft: resend.secondsLeft, busy, onResend: () => void sendCode(), onBack: () => setStep("enter"), colors })
513
+ }, invalid: refused, secondsLeft: resend.secondsLeft, busy, onResend: () => {
514
+ sendCode();
515
+ }, onBack: () => setStep("enter"), colors })
513
516
  ] });
514
517
  }
515
- function PhoneSheet({
518
+ function useAccountPhoneVerification({
516
519
  visible,
517
- colors,
518
- numbers,
519
520
  countries,
520
- onClose
521
+ onVerified
521
522
  }) {
522
523
  const [countryIndex, setCountryIndex] = useState(0);
523
524
  const [pickingCountry, setPickingCountry] = useState(false);
@@ -530,7 +531,6 @@ function PhoneSheet({
530
531
  const [busy, setBusy] = useState(false);
531
532
  const resend = useResendCountdown();
532
533
  const [addPhoneNumber] = useAddPhoneNumberMutation();
533
- const [removePhoneNumber] = useRemovePhoneNumberMutation();
534
534
  const [sendPhoneOtp] = useSendPhoneOtpMutation();
535
535
  useEffect(() => {
536
536
  if (!countries.length) return;
@@ -560,10 +560,6 @@ function PhoneSheet({
560
560
  item
561
561
  }) => item.name.toLowerCase().includes(query) || formatPhoneCode(item.phoneCode).includes(query)) : all;
562
562
  }, [countries, countryQuery]);
563
- const codeFor = (countryCode) => {
564
- var _a;
565
- return formatPhoneCode((_a = countries.find((item) => item.id === countryCode)) == null ? void 0 : _a.phoneCode) || countryCode;
566
- };
567
563
  const phoneInput = () => ({
568
564
  countryCode: country == null ? void 0 : country.id,
569
565
  phoneNumber: number
@@ -605,7 +601,7 @@ function PhoneSheet({
605
601
  },
606
602
  refetchQueries: REFETCH
607
603
  });
608
- onClose();
604
+ onVerified();
609
605
  } catch (err) {
610
606
  setRefused(true);
611
607
  setError(contactCodeError(err, "We couldn't check that code. Try again."));
@@ -613,8 +609,112 @@ function PhoneSheet({
613
609
  setBusy(false);
614
610
  }
615
611
  };
612
+ return {
613
+ step,
614
+ setStep,
615
+ country,
616
+ countryIndex,
617
+ setCountryIndex,
618
+ dialCode,
619
+ pickingCountry,
620
+ setPickingCountry,
621
+ countryQuery,
622
+ setCountryQuery,
623
+ visibleCountries,
624
+ number,
625
+ setNumber,
626
+ code,
627
+ setCode,
628
+ refused,
629
+ setRefused,
630
+ error,
631
+ setError,
632
+ busy,
633
+ resendSecondsLeft: resend.secondsLeft,
634
+ sendCode,
635
+ verify,
636
+ /** The sheet's main button: send the code, or check it. */
637
+ submit: step === "enter" ? sendCode : verify,
638
+ canSubmit: step === "enter" ? Boolean(country) && looksLikePhoneNumber(number) : code.length === VERIFICATION_CODE_LENGTH
639
+ };
640
+ }
641
+ function PhoneFields({
642
+ phone,
643
+ colors
644
+ }) {
645
+ if (phone.step === "verify") {
646
+ return /* @__PURE__ */ jsx(CodeStep, { sentTo: `${phone.dialCode} ${phone.number}`, code: phone.code, onChange: (next) => {
647
+ phone.setCode(next);
648
+ phone.setRefused(false);
649
+ }, invalid: phone.refused, secondsLeft: phone.resendSecondsLeft, busy: phone.busy, onResend: () => {
650
+ phone.sendCode();
651
+ }, onBack: () => phone.setStep("enter"), colors });
652
+ }
653
+ const {
654
+ country,
655
+ dialCode,
656
+ pickingCountry
657
+ } = phone;
658
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
659
+ /* @__PURE__ */ jsx(Text, { style: [styles.fieldLabel, {
660
+ color: colors.textMuted
661
+ }], children: "Country code" }),
662
+ /* @__PURE__ */ jsxs(Pressable, { onPress: () => phone.setPickingCountry((open) => !open), accessibilityRole: "button", style: [styles.input, styles.select, {
663
+ backgroundColor: colors.surfaceMuted,
664
+ borderColor: colors.border
665
+ }], children: [
666
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.optionLabel, {
667
+ color: colors.text
668
+ }], children: country ? `${country.name} (${dialCode})` : "Loading\u2026" }),
669
+ /* @__PURE__ */ jsx(Ionicons, { name: pickingCountry ? "chevron-up" : "chevron-down", size: 16, color: colors.textMuted })
670
+ ] }),
671
+ pickingCountry ? /* @__PURE__ */ jsxs(View, { style: [styles.countryBox, {
672
+ borderColor: colors.border
673
+ }], children: [
674
+ /* @__PURE__ */ jsx(TextInput, { value: phone.countryQuery, onChangeText: phone.setCountryQuery, placeholder: "Search countries", placeholderTextColor: colors.textMuted, autoCorrect: false, style: [styles.countrySearch, {
675
+ color: colors.text,
676
+ borderColor: colors.border
677
+ }] }),
678
+ /* @__PURE__ */ jsx(ScrollView, { style: styles.countryList, nestedScrollEnabled: true, keyboardShouldPersistTaps: "handled", children: phone.visibleCountries.map(({
679
+ item,
680
+ index
681
+ }) => /* @__PURE__ */ jsxs(Pressable, { onPress: () => {
682
+ phone.setCountryIndex(index);
683
+ phone.setPickingCountry(false);
684
+ phone.setCountryQuery("");
685
+ }, style: [styles.option, index === phone.countryIndex && {
686
+ backgroundColor: colors.primarySoft
687
+ }], children: [
688
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.optionLabel, {
689
+ color: colors.text
690
+ }], children: item.name }),
691
+ /* @__PURE__ */ jsx(Text, { style: [styles.hint, {
692
+ color: colors.textMuted
693
+ }], children: formatPhoneCode(item.phoneCode) })
694
+ ] }, item.id)) })
695
+ ] }) : null,
696
+ /* @__PURE__ */ jsx(Field, { label: "Phone number", colors, value: phone.number, onChangeText: (text) => phone.setNumber(text.replace(/\D/g, "")), keyboardType: "phone-pad", autoComplete: "tel", maxLength: 15 })
697
+ ] });
698
+ }
699
+ function PhoneSheet({
700
+ visible,
701
+ colors,
702
+ numbers,
703
+ countries,
704
+ onClose
705
+ }) {
706
+ const phone = useAccountPhoneVerification({
707
+ visible,
708
+ countries,
709
+ onVerified: onClose
710
+ });
711
+ const [removePhoneNumber] = useRemovePhoneNumberMutation();
712
+ const codeFor = (countryCode) => {
713
+ var _a;
714
+ return formatPhoneCode((_a = countries.find((item) => item.id === countryCode)) == null ? void 0 : _a.phoneCode) || countryCode;
715
+ };
616
716
  const remove = async (saved) => {
617
- setError(null);
717
+ phone.setError(null);
618
718
  try {
619
719
  await removePhoneNumber({
620
720
  variables: {
@@ -626,71 +726,31 @@ function PhoneSheet({
626
726
  refetchQueries: REFETCH
627
727
  });
628
728
  } catch (e) {
629
- setError("We couldn't remove that number. Try again.");
729
+ phone.setError("We couldn't remove that number. Try again.");
630
730
  }
631
731
  };
632
- return /* @__PURE__ */ jsxs(Sheet, { visible, title: step === "verify" ? "Verify phone number" : "Phone Number", colors, onClose, onSave: step === "enter" ? sendCode : verify, saveLabel: step === "enter" ? "Next" : "Verify", saveDisabled: step === "enter" ? !country || !looksLikePhoneNumber(number) : code.length !== VERIFICATION_CODE_LENGTH, busy, children: [
633
- /* @__PURE__ */ jsx(Problem, { text: error }),
634
- step === "verify" ? /* @__PURE__ */ jsx(CodeStep, { sentTo: `${dialCode} ${number}`, code, onChange: (next) => {
635
- setCode(next);
636
- setRefused(false);
637
- }, invalid: refused, secondsLeft: resend.secondsLeft, busy, onResend: () => void sendCode(), onBack: () => setStep("enter"), colors }) : /* @__PURE__ */ jsxs(Fragment, { children: [
638
- numbers.length ? /* @__PURE__ */ jsxs(View, { style: styles.field, children: [
639
- /* @__PURE__ */ jsx(Text, { style: [styles.fieldLabel, {
640
- color: colors.textMuted
641
- }], children: "Registered numbers" }),
642
- numbers.map((saved) => /* @__PURE__ */ jsxs(View, { style: [styles.saved, {
643
- borderColor: colors.border
644
- }], children: [
645
- /* @__PURE__ */ jsxs(Text, { style: [styles.optionLabel, {
646
- color: colors.text
647
- }], children: [
648
- codeFor(saved.countryCode),
649
- " ",
650
- saved.phoneNumber
651
- ] }),
652
- /* @__PURE__ */ jsx(Pressable, { onPress: () => void remove(saved), hitSlop: 10, accessibilityRole: "button", accessibilityLabel: `Remove ${saved.phoneNumber}`, children: /* @__PURE__ */ jsx(Ionicons, { name: "trash-outline", size: 18, color: "#ef4444" }) })
653
- ] }, `${saved.countryCode}-${saved.phoneNumber}`))
654
- ] }) : null,
732
+ return /* @__PURE__ */ jsxs(Sheet, { visible, title: phone.step === "verify" ? "Verify phone number" : "Phone Number", colors, onClose, onSave: phone.submit, saveLabel: phone.step === "enter" ? "Next" : "Verify", saveDisabled: !phone.canSubmit, busy: phone.busy, children: [
733
+ /* @__PURE__ */ jsx(Problem, { text: phone.error }),
734
+ phone.step === "enter" && numbers.length ? /* @__PURE__ */ jsxs(View, { style: styles.field, children: [
655
735
  /* @__PURE__ */ jsx(Text, { style: [styles.fieldLabel, {
656
736
  color: colors.textMuted
657
- }], children: "Country code" }),
658
- /* @__PURE__ */ jsxs(Pressable, { onPress: () => setPickingCountry((open) => !open), accessibilityRole: "button", style: [styles.input, styles.select, {
659
- backgroundColor: colors.surfaceMuted,
737
+ }], children: "Registered numbers" }),
738
+ numbers.map((saved) => /* @__PURE__ */ jsxs(View, { style: [styles.saved, {
660
739
  borderColor: colors.border
661
740
  }], children: [
662
- /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.optionLabel, {
741
+ /* @__PURE__ */ jsxs(Text, { style: [styles.optionLabel, {
663
742
  color: colors.text
664
- }], children: country ? `${country.name} (${dialCode})` : "Loading\u2026" }),
665
- /* @__PURE__ */ jsx(Ionicons, { name: pickingCountry ? "chevron-up" : "chevron-down", size: 16, color: colors.textMuted })
666
- ] }),
667
- pickingCountry ? /* @__PURE__ */ jsxs(View, { style: [styles.countryBox, {
668
- borderColor: colors.border
669
- }], children: [
670
- /* @__PURE__ */ jsx(TextInput, { value: countryQuery, onChangeText: setCountryQuery, placeholder: "Search countries", placeholderTextColor: colors.textMuted, autoCorrect: false, style: [styles.countrySearch, {
671
- color: colors.text,
672
- borderColor: colors.border
673
- }] }),
674
- /* @__PURE__ */ jsx(ScrollView, { style: styles.countryList, nestedScrollEnabled: true, keyboardShouldPersistTaps: "handled", children: visibleCountries.map(({
675
- item,
676
- index
677
- }) => /* @__PURE__ */ jsxs(Pressable, { onPress: () => {
678
- setCountryIndex(index);
679
- setPickingCountry(false);
680
- setCountryQuery("");
681
- }, style: [styles.option, index === countryIndex && {
682
- backgroundColor: colors.primarySoft
683
743
  }], children: [
684
- /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.optionLabel, {
685
- color: colors.text
686
- }], children: item.name }),
687
- /* @__PURE__ */ jsx(Text, { style: [styles.hint, {
688
- color: colors.textMuted
689
- }], children: formatPhoneCode(item.phoneCode) })
690
- ] }, item.id)) })
691
- ] }) : null,
692
- /* @__PURE__ */ jsx(Field, { label: "Phone number", colors, value: number, onChangeText: (text) => setNumber(text.replace(/\D/g, "")), keyboardType: "phone-pad", autoComplete: "tel", maxLength: 15 })
693
- ] })
744
+ codeFor(saved.countryCode),
745
+ " ",
746
+ saved.phoneNumber
747
+ ] }),
748
+ /* @__PURE__ */ jsx(Pressable, { onPress: () => {
749
+ remove(saved);
750
+ }, hitSlop: 10, accessibilityRole: "button", accessibilityLabel: `Remove ${saved.phoneNumber}`, children: /* @__PURE__ */ jsx(Ionicons, { name: "trash-outline", size: 18, color: "#ef4444" }) })
751
+ ] }, `${saved.countryCode}-${saved.phoneNumber}`))
752
+ ] }) : null,
753
+ /* @__PURE__ */ jsx(PhoneFields, { phone, colors })
694
754
  ] });
695
755
  }
696
756
  const ACCEPTED_TYPES = ["image/jpeg", "image/png", "image/webp"];
@@ -815,6 +875,8 @@ function AvatarSheet({
815
875
  }
816
876
  }
817
877
  };
878
+ let uploadLabel = photos.length ? "Change photo" : "Upload photo";
879
+ if (busy === "upload") uploadLabel = "Uploading\u2026";
818
880
  const remove = async () => {
819
881
  setBusy("remove");
820
882
  setError(null);
@@ -835,8 +897,12 @@ function AvatarSheet({
835
897
  busy === "upload" ? /* @__PURE__ */ jsx(View, { style: styles.avatarBusy, children: /* @__PURE__ */ jsx(ActivityIndicator, { color: "#fff" }) }) : null
836
898
  ] }),
837
899
  /* @__PURE__ */ jsxs(View, { style: styles.avatarActions, children: [
838
- /* @__PURE__ */ jsx(Pressable, { onPress: () => void pick(), disabled: !!busy || !profile, accessibilityRole: "button", style: [styles.primary, (!!busy || !profile) && styles.dim], children: /* @__PURE__ */ jsx(Text, { style: styles.primaryLabel, children: busy === "upload" ? "Uploading\u2026" : photos.length ? "Change photo" : "Upload photo" }) }),
839
- photos.length ? /* @__PURE__ */ jsx(Pressable, { onPress: () => void remove(), disabled: !!busy, accessibilityRole: "button", style: styles.ghost, children: /* @__PURE__ */ jsx(Text, { style: styles.removeLabel, children: busy === "remove" ? "Removing\u2026" : "Remove" }) }) : null
900
+ /* @__PURE__ */ jsx(Pressable, { onPress: () => {
901
+ pick();
902
+ }, disabled: !!busy || !profile, accessibilityRole: "button", style: [styles.primary, (!!busy || !profile) && styles.dim], children: /* @__PURE__ */ jsx(Text, { style: styles.primaryLabel, children: uploadLabel }) }),
903
+ photos.length ? /* @__PURE__ */ jsx(Pressable, { onPress: () => {
904
+ remove();
905
+ }, disabled: !!busy, accessibilityRole: "button", style: styles.ghost, children: /* @__PURE__ */ jsx(Text, { style: styles.removeLabel, children: busy === "remove" ? "Removing\u2026" : "Remove" }) }) : null
840
906
  ] }),
841
907
  /* @__PURE__ */ jsx(Text, { style: [styles.hint, styles.centered, {
842
908
  color: colors.textMuted
@@ -1046,4 +1112,4 @@ const styles = StyleSheet.create({
1046
1112
  centered: {
1047
1113
  textAlign: "center"
1048
1114
  }
1049
- });export{AvatarSheet,DobSheet,EmailSheet,GenderSheet,NameSheet,OptionList,PhoneSheet,PickerSheet,Sheet,UsernameSheet};//# sourceMappingURL=AccountSheets.js.map
1115
+ });export{AvatarSheet,DobSheet,EmailSheet,GenderSheet,NameSheet,OptionList,PhoneFields,PhoneSheet,PickerSheet,Problem,Sheet,UsernameSheet,useAccountPhoneVerification};//# sourceMappingURL=AccountSheets.js.map