@oxy.so/services 15.0.1 → 15.0.2

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 (91) hide show
  1. package/android/src/main/java/so/oxy/security/OxyCallerPolicy.kt +0 -2
  2. package/lib/commonjs/ui/components/OxyProvider.js +8 -1
  3. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  4. package/lib/commonjs/ui/components/accountDialogHost.js +48 -0
  5. package/lib/commonjs/ui/components/accountDialogHost.js.map +1 -0
  6. package/lib/commonjs/ui/components/authChooser/primitives.js +5 -3
  7. package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
  8. package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js +28 -25
  9. package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js.map +1 -1
  10. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js +63 -23
  11. package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -1
  12. package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js +94 -26
  13. package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js.map +1 -1
  14. package/lib/commonjs/ui/hooks/useUsernameAvailability.js +21 -7
  15. package/lib/commonjs/ui/hooks/useUsernameAvailability.js.map +1 -1
  16. package/lib/commonjs/ui/screens/OxyOneScreen.js +2 -2
  17. package/lib/commonjs/ui/screens/OxyOneScreen.js.map +1 -1
  18. package/lib/commonjs/ui/utils/handlePreview.js +20 -0
  19. package/lib/commonjs/ui/utils/handlePreview.js.map +1 -0
  20. package/lib/commonjs/ui/utils/usernameLookupBudget.js +95 -0
  21. package/lib/commonjs/ui/utils/usernameLookupBudget.js.map +1 -0
  22. package/lib/module/ui/components/OxyProvider.js +8 -1
  23. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  24. package/lib/module/ui/components/accountDialogHost.js +42 -0
  25. package/lib/module/ui/components/accountDialogHost.js.map +1 -0
  26. package/lib/module/ui/components/authChooser/primitives.js +5 -3
  27. package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
  28. package/lib/module/ui/components/signIn/InlineCommonsQr.js +28 -25
  29. package/lib/module/ui/components/signIn/InlineCommonsQr.js.map +1 -1
  30. package/lib/module/ui/components/signIn/OxySignInPanel.js +64 -24
  31. package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -1
  32. package/lib/module/ui/components/signIn/OxySignUpPanel.js +95 -27
  33. package/lib/module/ui/components/signIn/OxySignUpPanel.js.map +1 -1
  34. package/lib/module/ui/hooks/useUsernameAvailability.js +21 -7
  35. package/lib/module/ui/hooks/useUsernameAvailability.js.map +1 -1
  36. package/lib/module/ui/screens/OxyOneScreen.js +2 -2
  37. package/lib/module/ui/screens/OxyOneScreen.js.map +1 -1
  38. package/lib/module/ui/utils/handlePreview.js +16 -0
  39. package/lib/module/ui/utils/handlePreview.js.map +1 -0
  40. package/lib/module/ui/utils/usernameLookupBudget.js +88 -0
  41. package/lib/module/ui/utils/usernameLookupBudget.js.map +1 -0
  42. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/ui/components/accountDialogHost.d.ts +24 -0
  44. package/lib/typescript/commonjs/ui/components/accountDialogHost.d.ts.map +1 -0
  45. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +5 -3
  46. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts +6 -0
  48. package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts +4 -2
  50. package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts +12 -2
  52. package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/ui/hooks/useUsernameAvailability.d.ts +15 -1
  54. package/lib/typescript/commonjs/ui/hooks/useUsernameAvailability.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/ui/types/navigation.d.ts +14 -0
  56. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/ui/utils/handlePreview.d.ts +10 -0
  58. package/lib/typescript/commonjs/ui/utils/handlePreview.d.ts.map +1 -0
  59. package/lib/typescript/commonjs/ui/utils/usernameLookupBudget.d.ts +36 -0
  60. package/lib/typescript/commonjs/ui/utils/usernameLookupBudget.d.ts.map +1 -0
  61. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  62. package/lib/typescript/module/ui/components/accountDialogHost.d.ts +24 -0
  63. package/lib/typescript/module/ui/components/accountDialogHost.d.ts.map +1 -0
  64. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +5 -3
  65. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -1
  66. package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts +6 -0
  67. package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -1
  68. package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts +4 -2
  69. package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
  70. package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts +12 -2
  71. package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -1
  72. package/lib/typescript/module/ui/hooks/useUsernameAvailability.d.ts +15 -1
  73. package/lib/typescript/module/ui/hooks/useUsernameAvailability.d.ts.map +1 -1
  74. package/lib/typescript/module/ui/types/navigation.d.ts +14 -0
  75. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  76. package/lib/typescript/module/ui/utils/handlePreview.d.ts +10 -0
  77. package/lib/typescript/module/ui/utils/handlePreview.d.ts.map +1 -0
  78. package/lib/typescript/module/ui/utils/usernameLookupBudget.d.ts +36 -0
  79. package/lib/typescript/module/ui/utils/usernameLookupBudget.d.ts.map +1 -0
  80. package/package.json +3 -3
  81. package/src/ui/components/OxyProvider.tsx +11 -1
  82. package/src/ui/components/accountDialogHost.tsx +54 -0
  83. package/src/ui/components/authChooser/primitives.tsx +5 -3
  84. package/src/ui/components/signIn/InlineCommonsQr.tsx +24 -18
  85. package/src/ui/components/signIn/OxySignInPanel.tsx +64 -22
  86. package/src/ui/components/signIn/OxySignUpPanel.tsx +115 -26
  87. package/src/ui/hooks/useUsernameAvailability.ts +42 -7
  88. package/src/ui/screens/OxyOneScreen.tsx +2 -2
  89. package/src/ui/types/navigation.ts +14 -0
  90. package/src/ui/utils/handlePreview.ts +16 -0
  91. package/src/ui/utils/usernameLookupBudget.ts +91 -0
@@ -10,8 +10,10 @@
10
10
  * The email is confirmed before the account exists, and it is how the account
11
11
  * signs in (a code or a link each time). A password and an authenticator app
12
12
  * are added later, in the account's security settings. Commons stays the way to
13
- * hold your own key: "Create it in Commons instead" — and linking Commons later
14
- * makes the account self-custodied and deletes the email.
13
+ * hold your own key: the username step says what that means, then "Create it in
14
+ * Commons instead" — and linking Commons later makes the account self-custodied
15
+ * and deletes the email. A host may preview the profile the username becomes
16
+ * (`handlePreviewTemplate`); this screen never names an app's domain itself.
15
17
  */
16
18
  import type React from 'react';
17
19
  export interface OxySignUpPanelProps {
@@ -24,6 +26,14 @@ export interface OxySignUpPanelProps {
24
26
  * this screen (`signInFlowStore`). `page` — a page of its own.
25
27
  */
26
28
  host?: 'dialog' | 'page';
29
+ /**
30
+ * Preview of the public profile this username becomes. `{username}` is
31
+ * replaced with the typed handle. The host writes its own origin, for
32
+ * example `{base}/@{username}` with that base already filled in. Omitted,
33
+ * the screen uses the template from `OxyProvider`, or shows none. Wins over
34
+ * the provider when both are set.
35
+ */
36
+ handlePreviewTemplate?: string | null;
27
37
  }
28
38
  export declare const OxySignUpPanel: React.FC<OxySignUpPanelProps>;
29
39
  //# sourceMappingURL=OxySignUpPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OxySignUpPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/OxySignUpPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8C/B,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC1B;AAYD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0SxD,CAAC"}
1
+ {"version":3,"file":"OxySignUpPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/OxySignUpPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuD/B,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAYD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmWxD,CAAC"}
@@ -1,5 +1,19 @@
1
+ export interface UsernameAvailabilityOptions {
2
+ /**
3
+ * When true (the default), a handle that already belongs to the signed-in
4
+ * account is "unchanged" and is not sent to the server. Signup passes false:
5
+ * a new account needs its own free handle, even on a device that is signed in.
6
+ */
7
+ matchCurrentUser?: boolean;
8
+ /**
9
+ * Count preview lookups against the production ten-a-minute quota and stop
10
+ * one short of it. Signup sets this so Continue still has a lookup left.
11
+ * Profile editing leaves it off: saving there does not look the name up again.
12
+ */
13
+ reserveSubmit?: boolean;
14
+ }
1
15
  /** Debounced server check; a response only applies to the draft that requested it. */
2
- export declare function useUsernameAvailability(value: string, enabled: boolean): {
16
+ export declare function useUsernameAvailability(value: string, enabled: boolean, options?: UsernameAvailabilityOptions): {
3
17
  candidate: string;
4
18
  status: string;
5
19
  invalid: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useUsernameAvailability.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useUsernameAvailability.ts"],"names":[],"mappings":"AAOA,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;;;;;;EAmDtE"}
1
+ {"version":3,"file":"useUsernameAvailability.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useUsernameAvailability.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,2BAA2B;;;;;;EAgEtC"}
@@ -65,6 +65,20 @@ export interface OxyProviderProps {
65
65
  * flow cannot start.
66
66
  */
67
67
  clientId?: string;
68
+ /**
69
+ * The app this provider's account dialog is signing into. When set, the
70
+ * sign-in screen says that one Oxy account works across this app and the
71
+ * others. Omitted, the line stays generic and names no app.
72
+ */
73
+ appName?: string;
74
+ /**
75
+ * Preview of the public profile a new username becomes, shown while signing
76
+ * up. `{username}` is replaced with the typed handle. Pass the host's own
77
+ * profile path, for example `{base}/@{username}` with the host's origin
78
+ * already written in place of `{base}` (`https://example.com/@{username}`).
79
+ * This SDK does not know or insert an app's domain.
80
+ */
81
+ handlePreviewTemplate?: string;
68
82
  baseURL?: string;
69
83
  authWebUrl?: string;
70
84
  authRedirectUri?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAE9B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACxE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAGrC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAGlC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,SAAS,CA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CAAC;IAC7B,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAC9C;AAED,MAAM,WAAW,iBAAiB;IAChC,6FAA6F;IAC7F,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,kEAAkE;IAClE,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The public profile a typed username would have, from a host template.
3
+ *
4
+ * `{username}` is the only token. The host writes its own origin into the
5
+ * template — `{base}/@{username}` means that host's base, not a domain this
6
+ * SDK knows. An empty handle, or a template with no `{username}`, previews
7
+ * nothing.
8
+ */
9
+ export declare function renderHandlePreview(template: string | null | undefined, username: string): string | null;
10
+ //# sourceMappingURL=handlePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlePreview.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/handlePreview.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAIf"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Shared budget for `GET /auth/check-username`.
3
+ *
4
+ * Outside development that route allows ten lookups a minute per IP
5
+ * (`checkLimiter` in `packages/api/src/routes/auth.ts`). Signup spends the
6
+ * same budget on a debounced preview while a name is typed and again when
7
+ * Continue confirms it. Preview stops one short of the limit, so typing
8
+ * cannot take the request Continue needs. A lookup already in flight or
9
+ * already answered for the same name is reused. Creating the account still
10
+ * checks uniqueness on its own.
11
+ */
12
+ /** Production ceiling of `checkLimiter`. Development's higher cap is ignored. */
13
+ export declare const USERNAME_LOOKUP_LIMIT = 10;
14
+ /** How long `checkLimiter` remembers a lookup. */
15
+ export declare const USERNAME_LOOKUP_WINDOW_MS = 60000;
16
+ /**
17
+ * Preview lookups a single window may start. One slot stays for an explicit
18
+ * submit (`Continue`), which is the request typing must not spend.
19
+ */
20
+ export declare const USERNAME_LOOKUP_BACKGROUND_MAX: number;
21
+ export type UsernameLookupPurpose = 'background' | 'submit';
22
+ /** Tests start from an empty window. */
23
+ export declare function resetUsernameLookupBudget(): void;
24
+ /** Seconds until a full window will accept another explicit lookup. `0` when it already can. */
25
+ export declare function usernameLookupCooldownSeconds(now?: number): number;
26
+ /**
27
+ * One network lookup per name at a time, counted against the production quota.
28
+ * `'deferred'` means this call would have been one past the purpose's room, so
29
+ * the caller must not hit the API (a 429 counts against the same window).
30
+ */
31
+ export declare function shareUsernameLookup(username: string, purpose: UsernameLookupPurpose, check: (username: string) => Promise<{
32
+ available: boolean;
33
+ }>): Promise<{
34
+ available: boolean;
35
+ } | 'deferred'>;
36
+ //# sourceMappingURL=usernameLookupBudget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usernameLookupBudget.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/usernameLookupBudget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,kDAAkD;AAClD,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,8BAA8B,QAA4B,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAQ5D,wCAAwC;AACxC,wBAAgB,yBAAyB,IAAI,IAAI,CAIhD;AAcD,gGAAgG;AAChG,wBAAgB,6BAA6B,CAAC,GAAG,SAAa,GAAG,MAAM,CAMtE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,qBAAqB,EAC9B,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,GAC3D,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,UAAU,CAAC,CAqB9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"OxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAqB,CAAC;AA+B5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAuKrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"OxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAqB,CAAC;AAgC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAgLrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * What the hosting app told the account dialog about itself.
3
+ *
4
+ * Both fields are optional. Without an app name the sign-in line stays
5
+ * generic, and without a handle template signup shows no profile preview.
6
+ * `OxyProvider` sets this; a screen mounted on its own (auth.oxy.so's
7
+ * `/login`) can pass the same facts as props, which win.
8
+ */
9
+ import { type ReactNode } from 'react';
10
+ export interface AccountDialogHost {
11
+ /** The app this dialog signs into, when the host named it. */
12
+ appName?: string | null;
13
+ /**
14
+ * Preview of the public profile a new username becomes. `{username}` is
15
+ * replaced with the typed handle. The host writes its own origin.
16
+ */
17
+ handlePreviewTemplate?: string | null;
18
+ }
19
+ export declare const AccountDialogHostProvider: React.FC<AccountDialogHost & {
20
+ children: ReactNode;
21
+ }>;
22
+ /** The hosting app's name and profile-preview template, or neither. */
23
+ export declare function useAccountDialogHost(): AccountDialogHost;
24
+ //# sourceMappingURL=accountDialogHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accountDialogHost.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/accountDialogHost.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAcD,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAe3F,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD"}
@@ -8,9 +8,11 @@ import type React from 'react';
8
8
  * A SUBORDINATE action: a small centred text link, never a button.
9
9
  *
10
10
  * This is the single visual grammar for everything that is not the surface's one
11
- * primary action (issue #691) — the sign-up entry, and every alternative revealed
12
- * behind "Having trouble?". Keeping them all on one component is what stops an
13
- * alternative from quietly growing into a co-equal button again.
11
+ * primary action (issue #691) — every alternative revealed behind "Having trouble?".
12
+ * Keeping them all on one component is what stops an alternative from quietly
13
+ * growing into a co-equal button again. "Create account" on the sign-in screen is
14
+ * the exception: it is a full-width button, because a text link was too easy for
15
+ * a new person to miss.
14
16
  *
15
17
  * Bloom's plain `Button` in the secondary link tone at `sm`: no fill or border, the
16
18
  * secondary text colour, underlined under a pointer, and Bloom's link hit slop
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/authChooser/primitives.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAaA,CAAC"}
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/authChooser/primitives.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAaA,CAAC"}
@@ -14,6 +14,12 @@
14
14
  */
15
15
  import type React from 'react';
16
16
  import type { AccountDialogController } from '@oxy.so/core/session';
17
+ /**
18
+ * The caption over the photo carousel. 16px white on a dark plate: the old
19
+ * 12px white line with a text shadow was not readable on the photos.
20
+ */
21
+ export declare const QR_CAPTION_FONT_SIZE = 16;
22
+ export declare const QR_CAPTION_SCRIM = "rgba(0, 0, 0, 0.78)";
17
23
  export declare const InlineCommonsQr: React.FC<{
18
24
  controller: AccountDialogController | null;
19
25
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"InlineCommonsQr.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/InlineCommonsQr.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAapE,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,UAAU,EAAE,uBAAuB,GAAG,IAAI,CAAA;CAAE,CA6EpF,CAAC"}
1
+ {"version":3,"file":"InlineCommonsQr.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/InlineCommonsQr.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAYpE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,UAAU,EAAE,uBAAuB,GAAG,IAAI,CAAA;CAAE,CA+EpF,CAAC"}
@@ -4,8 +4,10 @@
4
4
  * differs (`host`). Sign-in happens IN it, on every origin: no window opens.
5
5
  *
6
6
  * picker a returning device: "Choose an account", then "Use another account"
7
- * identifier the header, the Commons way in, and "Email or username" with its
8
- * Continue. On the web, from `md`, the screen is Bloom `AuthCard`'s
7
+ * identifier the header (what an Oxy account is, naming the host app when the
8
+ * dialog knows it), the Commons way in, and "Email or username"
9
+ * with its Continue, then a Create account button. On the web,
10
+ * from `md`, the screen is Bloom `AuthCard`'s
9
11
  * split card and the Commons way in is the embedded QR over its
10
12
  * photo carousel, in the right column (the account dialog grows to
11
13
  * that card); below `md` it is "Continue with Oxy" at the top. A
@@ -1 +1 @@
1
- {"version":3,"file":"OxySignInPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/OxySignInPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8D/B,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,wDAAwD;AACxD,eAAO,MAAM,6BAA6B,KAAK,CAAC;AA4BhD,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAqvBxD,CAAC"}
1
+ {"version":3,"file":"OxySignInPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/OxySignInPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+D/B,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,wDAAwD;AACxD,eAAO,MAAM,6BAA6B,KAAK,CAAC;AA4BhD,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+wBxD,CAAC"}
@@ -10,8 +10,10 @@
10
10
  * The email is confirmed before the account exists, and it is how the account
11
11
  * signs in (a code or a link each time). A password and an authenticator app
12
12
  * are added later, in the account's security settings. Commons stays the way to
13
- * hold your own key: "Create it in Commons instead" — and linking Commons later
14
- * makes the account self-custodied and deletes the email.
13
+ * hold your own key: the username step says what that means, then "Create it in
14
+ * Commons instead" — and linking Commons later makes the account self-custodied
15
+ * and deletes the email. A host may preview the profile the username becomes
16
+ * (`handlePreviewTemplate`); this screen never names an app's domain itself.
15
17
  */
16
18
  import type React from 'react';
17
19
  export interface OxySignUpPanelProps {
@@ -24,6 +26,14 @@ export interface OxySignUpPanelProps {
24
26
  * this screen (`signInFlowStore`). `page` — a page of its own.
25
27
  */
26
28
  host?: 'dialog' | 'page';
29
+ /**
30
+ * Preview of the public profile this username becomes. `{username}` is
31
+ * replaced with the typed handle. The host writes its own origin, for
32
+ * example `{base}/@{username}` with that base already filled in. Omitted,
33
+ * the screen uses the template from `OxyProvider`, or shows none. Wins over
34
+ * the provider when both are set.
35
+ */
36
+ handlePreviewTemplate?: string | null;
27
37
  }
28
38
  export declare const OxySignUpPanel: React.FC<OxySignUpPanelProps>;
29
39
  //# sourceMappingURL=OxySignUpPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OxySignUpPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/OxySignUpPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8C/B,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC1B;AAYD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0SxD,CAAC"}
1
+ {"version":3,"file":"OxySignUpPanel.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/signIn/OxySignUpPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuD/B,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAYD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmWxD,CAAC"}
@@ -1,5 +1,19 @@
1
+ export interface UsernameAvailabilityOptions {
2
+ /**
3
+ * When true (the default), a handle that already belongs to the signed-in
4
+ * account is "unchanged" and is not sent to the server. Signup passes false:
5
+ * a new account needs its own free handle, even on a device that is signed in.
6
+ */
7
+ matchCurrentUser?: boolean;
8
+ /**
9
+ * Count preview lookups against the production ten-a-minute quota and stop
10
+ * one short of it. Signup sets this so Continue still has a lookup left.
11
+ * Profile editing leaves it off: saving there does not look the name up again.
12
+ */
13
+ reserveSubmit?: boolean;
14
+ }
1
15
  /** Debounced server check; a response only applies to the draft that requested it. */
2
- export declare function useUsernameAvailability(value: string, enabled: boolean): {
16
+ export declare function useUsernameAvailability(value: string, enabled: boolean, options?: UsernameAvailabilityOptions): {
3
17
  candidate: string;
4
18
  status: string;
5
19
  invalid: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useUsernameAvailability.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useUsernameAvailability.ts"],"names":[],"mappings":"AAOA,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;;;;;;EAmDtE"}
1
+ {"version":3,"file":"useUsernameAvailability.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useUsernameAvailability.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,2BAA2B;;;;;;EAgEtC"}
@@ -65,6 +65,20 @@ export interface OxyProviderProps {
65
65
  * flow cannot start.
66
66
  */
67
67
  clientId?: string;
68
+ /**
69
+ * The app this provider's account dialog is signing into. When set, the
70
+ * sign-in screen says that one Oxy account works across this app and the
71
+ * others. Omitted, the line stays generic and names no app.
72
+ */
73
+ appName?: string;
74
+ /**
75
+ * Preview of the public profile a new username becomes, shown while signing
76
+ * up. `{username}` is replaced with the typed handle. Pass the host's own
77
+ * profile path, for example `{base}/@{username}` with the host's origin
78
+ * already written in place of `{base}` (`https://example.com/@{username}`).
79
+ * This SDK does not know or insert an app's domain.
80
+ */
81
+ handlePreviewTemplate?: string;
68
82
  baseURL?: string;
69
83
  authWebUrl?: string;
70
84
  authRedirectUri?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAA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,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The public profile a typed username would have, from a host template.
3
+ *
4
+ * `{username}` is the only token. The host writes its own origin into the
5
+ * template — `{base}/@{username}` means that host's base, not a domain this
6
+ * SDK knows. An empty handle, or a template with no `{username}`, previews
7
+ * nothing.
8
+ */
9
+ export declare function renderHandlePreview(template: string | null | undefined, username: string): string | null;
10
+ //# sourceMappingURL=handlePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlePreview.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/handlePreview.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAIf"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Shared budget for `GET /auth/check-username`.
3
+ *
4
+ * Outside development that route allows ten lookups a minute per IP
5
+ * (`checkLimiter` in `packages/api/src/routes/auth.ts`). Signup spends the
6
+ * same budget on a debounced preview while a name is typed and again when
7
+ * Continue confirms it. Preview stops one short of the limit, so typing
8
+ * cannot take the request Continue needs. A lookup already in flight or
9
+ * already answered for the same name is reused. Creating the account still
10
+ * checks uniqueness on its own.
11
+ */
12
+ /** Production ceiling of `checkLimiter`. Development's higher cap is ignored. */
13
+ export declare const USERNAME_LOOKUP_LIMIT = 10;
14
+ /** How long `checkLimiter` remembers a lookup. */
15
+ export declare const USERNAME_LOOKUP_WINDOW_MS = 60000;
16
+ /**
17
+ * Preview lookups a single window may start. One slot stays for an explicit
18
+ * submit (`Continue`), which is the request typing must not spend.
19
+ */
20
+ export declare const USERNAME_LOOKUP_BACKGROUND_MAX: number;
21
+ export type UsernameLookupPurpose = 'background' | 'submit';
22
+ /** Tests start from an empty window. */
23
+ export declare function resetUsernameLookupBudget(): void;
24
+ /** Seconds until a full window will accept another explicit lookup. `0` when it already can. */
25
+ export declare function usernameLookupCooldownSeconds(now?: number): number;
26
+ /**
27
+ * One network lookup per name at a time, counted against the production quota.
28
+ * `'deferred'` means this call would have been one past the purpose's room, so
29
+ * the caller must not hit the API (a 429 counts against the same window).
30
+ */
31
+ export declare function shareUsernameLookup(username: string, purpose: UsernameLookupPurpose, check: (username: string) => Promise<{
32
+ available: boolean;
33
+ }>): Promise<{
34
+ available: boolean;
35
+ } | 'deferred'>;
36
+ //# sourceMappingURL=usernameLookupBudget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usernameLookupBudget.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/usernameLookupBudget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,kDAAkD;AAClD,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,8BAA8B,QAA4B,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAQ5D,wCAAwC;AACxC,wBAAgB,yBAAyB,IAAI,IAAI,CAIhD;AAcD,gGAAgG;AAChG,wBAAgB,6BAA6B,CAAC,GAAG,SAAa,GAAG,MAAM,CAMtE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,qBAAqB,EAC9B,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,GAC3D,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,UAAU,CAAC,CAqB9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/services",
3
- "version": "15.0.1",
3
+ "version": "15.0.2",
4
4
  "description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -176,14 +176,14 @@
176
176
  "delete-dts.js": "find ./lib/commonjs ./lib/module \\( -name '*.d.js*' -o -name '*.d.ts' \\) -delete"
177
177
  },
178
178
  "dependencies": {
179
- "@oxy.so/contracts": "^7.5.0",
179
+ "@oxy.so/contracts": "^7.7.0",
180
180
  "color": "^5.0.3",
181
181
  "@peable.to/sdk": "^4.0.0"
182
182
  },
183
183
  "devDependencies": {
184
184
  "@expo/app-integrity": "~58.0.2",
185
185
  "@expo/vector-icons": "^15.1.1",
186
- "@oxy.so/core": "7.56.0",
186
+ "@oxy.so/core": "7.60.1",
187
187
  "@react-native-async-storage/async-storage": "^3.1.1",
188
188
  "@react-native-community/netinfo": "^12.0.1",
189
189
  "@react-native/babel-preset": "^0.88.1",
@@ -23,6 +23,7 @@ import { ProductAnalyticsObserver } from '../analytics/productAnalytics';
23
23
  import { AccountLanguageBoundary } from './AccountLanguageBoundary';
24
24
  import { BloomLocaleBridge } from './BloomLocaleBridge';
25
25
  import { SupervisionStateObserver } from '../hooks/queries/useSupervision';
26
+ import { AccountDialogHostProvider } from './accountDialogHost';
26
27
 
27
28
  const bootStyles = StyleSheet.create({
28
29
  providerRoot: {
@@ -94,6 +95,8 @@ const OxyProvider: FC<OxyProviderProps> = ({
94
95
  productAnalytics,
95
96
  storageKeyPrefix,
96
97
  clientId,
98
+ appName,
99
+ handlePreviewTemplate,
97
100
  baseURL,
98
101
  authWebUrl,
99
102
  authRedirectUri,
@@ -246,7 +249,14 @@ const OxyProvider: FC<OxyProviderProps> = ({
246
249
  return (
247
250
  <GestureHandlerRootView style={bootStyles.providerRoot}>
248
251
  <SafeAreaRoot>
249
- <KeyboardBoundary>{coreContent}</KeyboardBoundary>
252
+ <KeyboardBoundary>
253
+ <AccountDialogHostProvider
254
+ appName={appName}
255
+ handlePreviewTemplate={handlePreviewTemplate}
256
+ >
257
+ {coreContent}
258
+ </AccountDialogHostProvider>
259
+ </KeyboardBoundary>
250
260
  </SafeAreaRoot>
251
261
  </GestureHandlerRootView>
252
262
  );
@@ -0,0 +1,54 @@
1
+ /**
2
+ * What the hosting app told the account dialog about itself.
3
+ *
4
+ * Both fields are optional. Without an app name the sign-in line stays
5
+ * generic, and without a handle template signup shows no profile preview.
6
+ * `OxyProvider` sets this; a screen mounted on its own (auth.oxy.so's
7
+ * `/login`) can pass the same facts as props, which win.
8
+ */
9
+
10
+ import { createContext, useContext, useMemo, type ReactNode } from 'react';
11
+
12
+ export interface AccountDialogHost {
13
+ /** The app this dialog signs into, when the host named it. */
14
+ appName?: string | null;
15
+ /**
16
+ * Preview of the public profile a new username becomes. `{username}` is
17
+ * replaced with the typed handle. The host writes its own origin.
18
+ */
19
+ handlePreviewTemplate?: string | null;
20
+ }
21
+
22
+ const EMPTY_ACCOUNT_DIALOG_HOST: AccountDialogHost = {
23
+ appName: null,
24
+ handlePreviewTemplate: null,
25
+ };
26
+
27
+ const AccountDialogHostContext = createContext<AccountDialogHost>(EMPTY_ACCOUNT_DIALOG_HOST);
28
+
29
+ function blankToNull(value: string | null | undefined): string | null {
30
+ const trimmed = value?.trim();
31
+ return trimmed ? trimmed : null;
32
+ }
33
+
34
+ export const AccountDialogHostProvider: React.FC<AccountDialogHost & { children: ReactNode }> = ({
35
+ appName,
36
+ handlePreviewTemplate,
37
+ children,
38
+ }) => {
39
+ const value = useMemo<AccountDialogHost>(
40
+ () => ({
41
+ appName: blankToNull(appName),
42
+ handlePreviewTemplate: blankToNull(handlePreviewTemplate),
43
+ }),
44
+ [appName, handlePreviewTemplate],
45
+ );
46
+ return (
47
+ <AccountDialogHostContext.Provider value={value}>{children}</AccountDialogHostContext.Provider>
48
+ );
49
+ };
50
+
51
+ /** The hosting app's name and profile-preview template, or neither. */
52
+ export function useAccountDialogHost(): AccountDialogHost {
53
+ return useContext(AccountDialogHostContext);
54
+ }
@@ -12,9 +12,11 @@ import { authChooserStyles as styles } from './styles';
12
12
  * A SUBORDINATE action: a small centred text link, never a button.
13
13
  *
14
14
  * This is the single visual grammar for everything that is not the surface's one
15
- * primary action (issue #691) — the sign-up entry, and every alternative revealed
16
- * behind "Having trouble?". Keeping them all on one component is what stops an
17
- * alternative from quietly growing into a co-equal button again.
15
+ * primary action (issue #691) — every alternative revealed behind "Having trouble?".
16
+ * Keeping them all on one component is what stops an alternative from quietly
17
+ * growing into a co-equal button again. "Create account" on the sign-in screen is
18
+ * the exception: it is a full-width button, because a text link was too easy for
19
+ * a new person to miss.
18
20
  *
19
21
  * Bloom's plain `Button` in the secondary link tone at `sm`: no fill or border, the
20
22
  * secondary text colour, underlined under a pointer, and Bloom's link hit slop
@@ -15,7 +15,7 @@
15
15
 
16
16
  import type React from 'react';
17
17
  import { useEffect, useState } from 'react';
18
- import { Platform, StyleSheet, View } from 'react-native';
18
+ import { StyleSheet, View } from 'react-native';
19
19
  import QRCode from 'react-native-qrcode-svg';
20
20
  import { Button } from '@oxy.so/bloom/button';
21
21
  import { RiCheckboxCircleLine } from '@oxy.so/bloom/icons/RiCheckboxCircleLine';
@@ -35,6 +35,12 @@ const PLATE_PADDING = 8;
35
35
  const PLATE_SIZE = QR_SIZE + PLATE_PADDING * 2;
36
36
  /** The spinner while a code is on its way: React Native's `large` indicator size. */
37
37
  const SPINNER_SIZE = 36;
38
+ /**
39
+ * The caption over the photo carousel. 16px white on a dark plate: the old
40
+ * 12px white line with a text shadow was not readable on the photos.
41
+ */
42
+ export const QR_CAPTION_FONT_SIZE = 16;
43
+ export const QR_CAPTION_SCRIM = 'rgba(0, 0, 0, 0.78)';
38
44
 
39
45
  export const InlineCommonsQr: React.FC<{ controller: AccountDialogController | null }> = ({
40
46
  controller,
@@ -110,16 +116,17 @@ export const InlineCommonsQr: React.FC<{ controller: AccountDialogController | n
110
116
  }}
111
117
  >
112
118
  <View style={[styles.plate, { borderColor: theme.colors.border }]}>{plate}</View>
113
- <Text style={[styles.caption, styles.captionOnMedia]}>{t('signin.qr.caption')}</Text>
119
+ <View style={styles.captionPlate} testID="signin-qr-caption">
120
+ <Text style={styles.caption}>{t('signin.qr.caption')}</Text>
121
+ </View>
114
122
  </View>
115
123
  );
116
124
  };
117
125
 
118
126
  const styles = StyleSheet.create({
119
127
  block: {
120
- width: PLATE_SIZE,
121
128
  alignItems: 'center',
122
- gap: 6,
129
+ gap: 10,
123
130
  },
124
131
  plate: {
125
132
  width: PLATE_SIZE,
@@ -131,21 +138,20 @@ const styles = StyleSheet.create({
131
138
  alignItems: 'center',
132
139
  justifyContent: 'center',
133
140
  },
134
- caption: {
135
- fontSize: 12,
136
- lineHeight: 16,
137
- textAlign: 'center',
141
+ // A dark plate, not a 12px white line over the photo: the carousel behind
142
+ // this caption changes, and a shadow on the glyphs was not enough to read.
143
+ captionPlate: {
144
+ maxWidth: 260,
145
+ backgroundColor: QR_CAPTION_SCRIM,
146
+ borderRadius: 10,
147
+ paddingVertical: 8,
148
+ paddingHorizontal: 12,
138
149
  },
139
- captionOnMedia: {
150
+ caption: {
140
151
  color: '#FFFFFF',
141
- fontWeight: '500',
142
- ...Platform.select({
143
- web: { textShadow: '0px 1px 4px rgba(0, 0, 0, 0.6)' },
144
- default: {
145
- textShadowColor: 'rgba(0, 0, 0, 0.6)',
146
- textShadowOffset: { width: 0, height: 1 },
147
- textShadowRadius: 4,
148
- },
149
- }),
152
+ fontSize: QR_CAPTION_FONT_SIZE,
153
+ lineHeight: 22,
154
+ fontWeight: '600',
155
+ textAlign: 'center',
150
156
  },
151
157
  });