@oxy.so/services 15.0.1 → 15.1.0
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/android/src/main/java/so/oxy/security/OxyCallerPolicy.kt +0 -2
- package/lib/commonjs/ui/components/OxyProvider.js +8 -1
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/accountDialogHost.js +48 -0
- package/lib/commonjs/ui/components/accountDialogHost.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js +5 -3
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js +28 -25
- package/lib/commonjs/ui/components/signIn/InlineCommonsQr.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxySignInPanel.js +63 -23
- package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js +97 -27
- package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js.map +1 -1
- package/lib/commonjs/ui/hooks/useUsernameAvailability.js +31 -11
- package/lib/commonjs/ui/hooks/useUsernameAvailability.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +6 -3
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyOneScreen.js +2 -2
- package/lib/commonjs/ui/screens/OxyOneScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/handlePreview.js +20 -0
- package/lib/commonjs/ui/utils/handlePreview.js.map +1 -0
- package/lib/commonjs/ui/utils/usernameLookupBudget.js +95 -0
- package/lib/commonjs/ui/utils/usernameLookupBudget.js.map +1 -0
- package/lib/commonjs/ui/utils/usernamePolicy.js +7 -2
- package/lib/commonjs/ui/utils/usernamePolicy.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +8 -1
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/accountDialogHost.js +42 -0
- package/lib/module/ui/components/accountDialogHost.js.map +1 -0
- package/lib/module/ui/components/authChooser/primitives.js +5 -3
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/module/ui/components/signIn/InlineCommonsQr.js +28 -25
- package/lib/module/ui/components/signIn/InlineCommonsQr.js.map +1 -1
- package/lib/module/ui/components/signIn/OxySignInPanel.js +64 -24
- package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxySignUpPanel.js +98 -28
- package/lib/module/ui/components/signIn/OxySignUpPanel.js.map +1 -1
- package/lib/module/ui/hooks/useUsernameAvailability.js +32 -12
- package/lib/module/ui/hooks/useUsernameAvailability.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +6 -3
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyOneScreen.js +2 -2
- package/lib/module/ui/screens/OxyOneScreen.js.map +1 -1
- package/lib/module/ui/utils/handlePreview.js +16 -0
- package/lib/module/ui/utils/handlePreview.js.map +1 -0
- package/lib/module/ui/utils/usernameLookupBudget.js +88 -0
- package/lib/module/ui/utils/usernameLookupBudget.js.map +1 -0
- package/lib/module/ui/utils/usernamePolicy.js +8 -3
- package/lib/module/ui/utils/usernamePolicy.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/accountDialogHost.d.ts +24 -0
- package/lib/typescript/commonjs/ui/components/accountDialogHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +5 -3
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts +6 -0
- package/lib/typescript/commonjs/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts +4 -2
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts +12 -2
- package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useUsernameAvailability.d.ts +15 -1
- package/lib/typescript/commonjs/ui/hooks/useUsernameAvailability.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +14 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/handlePreview.d.ts +10 -0
- package/lib/typescript/commonjs/ui/utils/handlePreview.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/usernameLookupBudget.d.ts +36 -0
- package/lib/typescript/commonjs/ui/utils/usernameLookupBudget.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/usernamePolicy.d.ts +6 -1
- package/lib/typescript/commonjs/ui/utils/usernamePolicy.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/accountDialogHost.d.ts +24 -0
- package/lib/typescript/module/ui/components/accountDialogHost.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +5 -3
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts +6 -0
- package/lib/typescript/module/ui/components/signIn/InlineCommonsQr.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts +4 -2
- package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts +12 -2
- package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useUsernameAvailability.d.ts +15 -1
- package/lib/typescript/module/ui/hooks/useUsernameAvailability.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +14 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/handlePreview.d.ts +10 -0
- package/lib/typescript/module/ui/utils/handlePreview.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/usernameLookupBudget.d.ts +36 -0
- package/lib/typescript/module/ui/utils/usernameLookupBudget.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/usernamePolicy.d.ts +6 -1
- package/lib/typescript/module/ui/utils/usernamePolicy.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/ui/components/OxyProvider.tsx +11 -1
- package/src/ui/components/accountDialogHost.tsx +54 -0
- package/src/ui/components/authChooser/primitives.tsx +5 -3
- package/src/ui/components/signIn/InlineCommonsQr.tsx +24 -18
- package/src/ui/components/signIn/OxySignInPanel.tsx +64 -22
- package/src/ui/components/signIn/OxySignUpPanel.tsx +117 -27
- package/src/ui/hooks/useUsernameAvailability.ts +57 -14
- package/src/ui/screens/CreateAccountScreen.tsx +6 -3
- package/src/ui/screens/OxyOneScreen.tsx +2 -2
- package/src/ui/types/navigation.ts +14 -0
- package/src/ui/utils/handlePreview.ts +16 -0
- package/src/ui/utils/usernameLookupBudget.ts +91 -0
- package/src/ui/utils/usernamePolicy.ts +8 -3
|
@@ -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) —
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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
|
|
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;
|
|
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
|
|
8
|
-
*
|
|
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
|
|
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:
|
|
14
|
-
* makes the account self-custodied
|
|
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
|
|
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,CAoWxD,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":"
|
|
1
|
+
{"version":3,"file":"useUsernameAvailability.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useUsernameAvailability.ts"],"names":[],"mappings":"AAYA,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;;;;;;EAuEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/CreateAccountScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAkF3D;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"CreateAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/CreateAccountScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAkF3D;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoZlD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -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;AACl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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"}
|
|
@@ -18,7 +18,12 @@ export type UsernameDraftResult = {
|
|
|
18
18
|
error: string;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
|
-
* Hold a typed username to the policy for `kind` (`bot`
|
|
21
|
+
* Hold a typed username to the SHAPE the policy requires for `kind` (`bot`
|
|
22
|
+
* handles end in `bot`).
|
|
23
|
+
*
|
|
24
|
+
* Reserved names are not judged here: the list belongs to the server, which
|
|
25
|
+
* answers for them (see {@link describeUsernameRefusal}), so a name it has
|
|
26
|
+
* released is never refused by a bundle that predates the release.
|
|
22
27
|
* On success `username` is the trimmed handle to send; on failure `error` is
|
|
23
28
|
* the localized reason, specific to the rule that failed.
|
|
24
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usernamePolicy.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/usernamePolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAWhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAkB,CAAC;AAGlD,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG
|
|
1
|
+
{"version":3,"file":"usernamePolicy.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/usernamePolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAWhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAkB,CAAC;AAGlD,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,CAAC,EAAE,SAAS,EACZ,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,GACxB,mBAAmB,CAMrB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,MAAM,EAChB,CAAC,EAAE,SAAS,GACX,MAAM,GAAG,IAAI,CAMf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/services",
|
|
3
|
-
"version": "15.0
|
|
3
|
+
"version": "15.1.0",
|
|
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.
|
|
179
|
+
"@oxy.so/contracts": "^7.8.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.
|
|
186
|
+
"@oxy.so/core": "7.61.0",
|
|
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>
|
|
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) —
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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 {
|
|
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
|
-
<
|
|
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:
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
150
|
+
caption: {
|
|
140
151
|
color: '#FFFFFF',
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
});
|
|
@@ -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
|
|
8
|
-
*
|
|
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
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
|
|
30
32
|
import type React from 'react';
|
|
31
33
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
32
|
-
import { Linking, Platform,
|
|
34
|
+
import { Linking, Platform, StyleSheet, View } from 'react-native';
|
|
33
35
|
import { AuthMediaCarousel } from '@oxy.so/bloom/auth-card';
|
|
34
36
|
import { Button } from '@oxy.so/bloom/button';
|
|
35
37
|
import { Divider } from '@oxy.so/bloom/divider';
|
|
@@ -61,6 +63,7 @@ import { useSurfaceFrameWidth } from '../../hooks/useSurfaceFrameWidth';
|
|
|
61
63
|
import { getCommonsAcquisitionUrl } from '../../utils/commonsStoreLinks';
|
|
62
64
|
import { resolveSignInDevice } from '../../utils/signInDevice';
|
|
63
65
|
import { SubtleLink } from '../authChooser/primitives';
|
|
66
|
+
import { useAccountDialogHost } from '../accountDialogHost';
|
|
64
67
|
import { SIGN_IN_SLIDES } from './artwork';
|
|
65
68
|
import { InlineCommonsQr } from './InlineCommonsQr';
|
|
66
69
|
import { OxyAccountPicker } from './OxyAccountPicker';
|
|
@@ -147,6 +150,9 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
|
|
|
147
150
|
}) => {
|
|
148
151
|
const theme = useTheme();
|
|
149
152
|
const { t } = useI18n();
|
|
153
|
+
const hostDialog = useAccountDialogHost();
|
|
154
|
+
// A prop wins; otherwise the hosting app's `OxyProvider`. Blank names none.
|
|
155
|
+
const resolvedAppName = (appName ?? hostDialog.appName)?.trim() || null;
|
|
150
156
|
const {
|
|
151
157
|
accountDialogController: controller,
|
|
152
158
|
openAccountDialog,
|
|
@@ -528,7 +534,7 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
|
|
|
528
534
|
return (
|
|
529
535
|
<OxyAccountPicker
|
|
530
536
|
principals={principals}
|
|
531
|
-
appName={
|
|
537
|
+
appName={resolvedAppName}
|
|
532
538
|
signedOut={!snapshot.hasSession}
|
|
533
539
|
pendingContextId={snapshot.activatingContextId}
|
|
534
540
|
isLoading={snapshot.activatingContextId !== null}
|
|
@@ -781,9 +787,12 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
|
|
|
781
787
|
const title = adding ? t('signin.addAccountTitle') : t('signin.title');
|
|
782
788
|
const description = adding
|
|
783
789
|
? t('signin.addAccountSubtitle')
|
|
784
|
-
:
|
|
785
|
-
? t('signin.subtitleToApp', { app:
|
|
790
|
+
: resolvedAppName
|
|
791
|
+
? t('signin.subtitleToApp', { app: resolvedAppName })
|
|
786
792
|
: t('signin.subtitle');
|
|
793
|
+
const oneAccount = resolvedAppName
|
|
794
|
+
? t('signin.oneAccountInApp', { app: resolvedAppName })
|
|
795
|
+
: t('signin.oneAccount');
|
|
787
796
|
|
|
788
797
|
const continueWithOxyButton = (
|
|
789
798
|
<Button
|
|
@@ -801,7 +810,22 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
|
|
|
801
810
|
|
|
802
811
|
form = (
|
|
803
812
|
<OxyAuthScreen inSplit={splits}>
|
|
804
|
-
<OxyAuthScreenHeader
|
|
813
|
+
<OxyAuthScreenHeader
|
|
814
|
+
title={title}
|
|
815
|
+
description={
|
|
816
|
+
<View style={styles.intro}>
|
|
817
|
+
<Text style={[styles.introLine, { color: theme.colors.textSecondary }]}>
|
|
818
|
+
{description}
|
|
819
|
+
</Text>
|
|
820
|
+
<Text
|
|
821
|
+
testID="signin-one-account"
|
|
822
|
+
style={[styles.oneAccount, { color: theme.colors.textSecondary }]}
|
|
823
|
+
>
|
|
824
|
+
{oneAccount}
|
|
825
|
+
</Text>
|
|
826
|
+
</View>
|
|
827
|
+
}
|
|
828
|
+
/>
|
|
805
829
|
|
|
806
830
|
{/* The Commons way in, then the email. On the web from `md` the QR
|
|
807
831
|
beside the form IS the Commons way in; below `md` this screen is
|
|
@@ -855,17 +879,6 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
|
|
|
855
879
|
autoFocus={device !== 'phone'}
|
|
856
880
|
testID="signin-identifier"
|
|
857
881
|
/>
|
|
858
|
-
<Text style={[styles.note, styles.noAccount, { color: theme.colors.textSecondary }]}>
|
|
859
|
-
{t('signin.noAccount')}{' '}
|
|
860
|
-
<RNText
|
|
861
|
-
accessibilityRole="link"
|
|
862
|
-
onPress={onCreateAccount}
|
|
863
|
-
style={[styles.noAccountLink, { color: theme.colors.text }]}
|
|
864
|
-
testID="create-account-link"
|
|
865
|
-
>
|
|
866
|
-
{t('signin.createAccount')}
|
|
867
|
-
</RNText>
|
|
868
|
-
</Text>
|
|
869
882
|
{rateLimitNotice}
|
|
870
883
|
<AccountFlowAction
|
|
871
884
|
label={t('signin.actions.continue')}
|
|
@@ -874,6 +887,22 @@ export const OxySignInPanel: React.FC<OxySignInPanelProps> = ({
|
|
|
874
887
|
disabled={rateLimitSeconds > 0}
|
|
875
888
|
testID="signin-identifier-continue"
|
|
876
889
|
/>
|
|
890
|
+
<View style={styles.createAccount}>
|
|
891
|
+
<Text style={[styles.createAccountPrompt, { color: theme.colors.textSecondary }]}>
|
|
892
|
+
{t('signin.noAccount')}
|
|
893
|
+
</Text>
|
|
894
|
+
<Button
|
|
895
|
+
appearance="outline"
|
|
896
|
+
tone="neutral"
|
|
897
|
+
size="lg"
|
|
898
|
+
fullWidth
|
|
899
|
+
onPress={onCreateAccount}
|
|
900
|
+
accessibilityLabel={t('signin.createAccount')}
|
|
901
|
+
testID="create-account-link"
|
|
902
|
+
>
|
|
903
|
+
{t('signin.createAccount')}
|
|
904
|
+
</Button>
|
|
905
|
+
</View>
|
|
877
906
|
</View>
|
|
878
907
|
<OxyAuthTerms />
|
|
879
908
|
</OxyAuthScreen>
|
|
@@ -911,10 +940,23 @@ const styles = StyleSheet.create({
|
|
|
911
940
|
lineHeight: 20,
|
|
912
941
|
textAlign: 'center',
|
|
913
942
|
},
|
|
914
|
-
|
|
915
|
-
|
|
943
|
+
intro: {
|
|
944
|
+
gap: 8,
|
|
945
|
+
},
|
|
946
|
+
introLine: {
|
|
947
|
+
fontSize: 18,
|
|
948
|
+
lineHeight: 28,
|
|
916
949
|
},
|
|
917
|
-
|
|
918
|
-
|
|
950
|
+
oneAccount: {
|
|
951
|
+
fontSize: 16,
|
|
952
|
+
lineHeight: 24,
|
|
953
|
+
},
|
|
954
|
+
createAccount: {
|
|
955
|
+
gap: 8,
|
|
956
|
+
},
|
|
957
|
+
createAccountPrompt: {
|
|
958
|
+
fontSize: 16,
|
|
959
|
+
lineHeight: 22,
|
|
960
|
+
textAlign: 'center',
|
|
919
961
|
},
|
|
920
962
|
});
|