@vectoriox/iox-ui 5.99.0 → 5.101.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/actions-core/index.d.ts +7 -4
- package/commerce-core/index.d.ts +2 -0
- package/composite-core/index.d.ts +238 -2
- package/design-core/index.d.ts +334 -1
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +16 -7
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs +3 -0
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +1005 -256
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +416 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs +3 -24
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +23 -13
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-identity-core.mjs +300 -22
- package/fesm2022/vectoriox-iox-ui-identity-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +7 -61
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/forms-core/index.d.ts +2 -23
- package/generation-core/index.d.ts +3 -1
- package/identity-core/index.d.ts +190 -14
- package/index.d.ts +0 -12
- package/package.json +1 -1
- package/src/actions-core/action.model.ts +1 -1
- package/src/actions-core/element-actions.ts +16 -6
- package/src/commerce-core/site-checkout.ts +3 -0
- package/src/composite-core/account-runtime.ts +461 -0
- package/src/composite-core/account.ts +309 -0
- package/src/composite-core/public-api.ts +2 -0
- package/src/composite-core/recipe-parts.ts +48 -0
- package/src/composite-core/shop.ts +6 -26
- package/src/design-core/field-classes.ts +65 -0
- package/src/design-core/flavor-spec.generated.ts +346 -0
- package/src/design-core/public-api.ts +1 -0
- package/src/forms-core/field-markup.ts +2 -22
- package/src/generation-core/compose-site.ts +19 -9
- package/src/generation-core/nav-shape.ts +4 -4
- package/src/identity-core/provider-marks.ts +60 -0
- package/src/identity-core/public-api.ts +3 -0
- package/src/identity-core/sign-in.ts +43 -6
- package/src/identity-core/site-auth-transport.ts +142 -0
- package/src/identity-core/site-auth.ts +36 -0
- package/src/identity-core/site-methods.ts +78 -0
- package/src/identity-core/words.ts +60 -17
- package/styles/iox-design.css +38 -0
|
@@ -14,10 +14,11 @@ export enum SignInPurpose {
|
|
|
14
14
|
Portal = 'portal',
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
/** A provider the broker runs.
|
|
17
|
+
/** A provider the broker runs (board 18). The enum's order is the order every sign-in shows them in. Each id is the path
|
|
18
|
+
* segment of the ONE address registered with that provider: `https://auth.iox.studio/<id>/callback`. */
|
|
18
19
|
export enum SignInProvider {
|
|
19
20
|
Google = 'google',
|
|
20
|
-
|
|
21
|
+
Facebook = 'facebook',
|
|
21
22
|
GitHub = 'github',
|
|
22
23
|
LinkedIn = 'linkedin',
|
|
23
24
|
}
|
|
@@ -32,17 +33,21 @@ export interface SignInProviderSpec {
|
|
|
32
33
|
readonly protocol: SignInProtocol;
|
|
33
34
|
/** The answer is signed, so a studio can check it itself — the only kind an admin may sign in with (C-D6). */
|
|
34
35
|
readonly signedAnswer: boolean;
|
|
35
|
-
/**
|
|
36
|
+
/** The broker has an adapter for it. Whether it is ON (both keys in the broker's env) is the broker's answer to
|
|
37
|
+
* `BrokerApiRoute.Providers`, read at run time — never a release. */
|
|
36
38
|
readonly live: boolean;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export const SIGN_IN_PROVIDER_SPECS: Readonly<Record<SignInProvider, SignInProviderSpec>> = Object.freeze({
|
|
40
42
|
[SignInProvider.Google]: { protocol: SignInProtocol.Oidc, signedAnswer: true, live: true },
|
|
41
|
-
[SignInProvider.
|
|
42
|
-
[SignInProvider.
|
|
43
|
-
[SignInProvider.
|
|
43
|
+
[SignInProvider.Facebook]: { protocol: SignInProtocol.OAuth2, signedAnswer: false, live: true },
|
|
44
|
+
[SignInProvider.GitHub]: { protocol: SignInProtocol.OAuth2, signedAnswer: false, live: true },
|
|
45
|
+
[SignInProvider.LinkedIn]: { protocol: SignInProtocol.Oidc, signedAnswer: true, live: true },
|
|
44
46
|
});
|
|
45
47
|
|
|
48
|
+
/** Every provider, in the order a sign-in shows them. */
|
|
49
|
+
export const SIGN_IN_PROVIDERS: ReadonlyArray<SignInProvider> = Object.freeze(Object.values(SignInProvider));
|
|
50
|
+
|
|
46
51
|
export function isSignInProvider(value: unknown): value is SignInProvider {
|
|
47
52
|
return typeof value === 'string' && (Object.values(SignInProvider) as string[]).includes(value);
|
|
48
53
|
}
|
|
@@ -72,8 +77,29 @@ export const SIGN_IN_HANDOFF_TTL_SECONDS = 60;
|
|
|
72
77
|
export enum BrokerApiRoute {
|
|
73
78
|
Tickets = 'instances/me/sign-in/tickets',
|
|
74
79
|
Redeem = 'instances/me/sign-in/redeem',
|
|
80
|
+
/** `GET` → only the providers that are ON: `{ "google": true }` (`SignInProvidersAnswer`). */
|
|
81
|
+
Providers = 'instances/me/sign-in/providers',
|
|
75
82
|
}
|
|
76
83
|
|
|
84
|
+
/** `GET instances/me/sign-in/providers` — each provider that is ON, `true`; an off one is absent. */
|
|
85
|
+
export type SignInProvidersAnswer = Partial<Record<SignInProvider, true>>;
|
|
86
|
+
|
|
87
|
+
/** The providers ON in a broker's answer, in the order a sign-in shows them; anything else in the body is ignored. */
|
|
88
|
+
export function providersOn(answer: unknown): SignInProvider[] {
|
|
89
|
+
if (!answer || typeof answer !== 'object' || Array.isArray(answer)) return [];
|
|
90
|
+
const on = answer as Record<string, unknown>;
|
|
91
|
+
return SIGN_IN_PROVIDERS.filter(p => on[p] === true);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The providers ON at the broker that may serve `purpose` (C-D6: a team member only with a signed answer). */
|
|
95
|
+
export function providersServing(on: readonly SignInProvider[], purpose: SignInPurpose): SignInProvider[] {
|
|
96
|
+
const set = new Set(on);
|
|
97
|
+
return SIGN_IN_PROVIDERS.filter(p => set.has(p) && SIGN_IN_PROVIDER_SPECS[p].live && providerServes(p, purpose));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** How long a studio or the portal may keep the broker's providers answer before asking again. */
|
|
101
|
+
export const SIGN_IN_PROVIDERS_CACHE_SECONDS = 60;
|
|
102
|
+
|
|
77
103
|
/** The browser's routes on `auth.iox.studio`, one pair per provider. */
|
|
78
104
|
export enum BrokerBrowserRoute {
|
|
79
105
|
Start = 'start',
|
|
@@ -150,6 +176,8 @@ export enum BrokerRefusalCode {
|
|
|
150
176
|
CodeUsedOrExpired = 'code-used-or-expired',
|
|
151
177
|
/** 403 — another tenant's code. */
|
|
152
178
|
NotYours = 'not-yours',
|
|
179
|
+
/** 400 — a purpose this asker may not use, or a provider that may not serve it (C-D6). */
|
|
180
|
+
InvalidRequest = 'invalid-request',
|
|
153
181
|
}
|
|
154
182
|
|
|
155
183
|
export const BROKER_REFUSAL_STATUS: Readonly<Record<BrokerRefusalCode, number>> = Object.freeze({
|
|
@@ -159,6 +187,7 @@ export const BROKER_REFUSAL_STATUS: Readonly<Record<BrokerRefusalCode, number>>
|
|
|
159
187
|
[BrokerRefusalCode.CodeUnknown]: 404,
|
|
160
188
|
[BrokerRefusalCode.CodeUsedOrExpired]: 410,
|
|
161
189
|
[BrokerRefusalCode.NotYours]: 403,
|
|
190
|
+
[BrokerRefusalCode.InvalidRequest]: 400,
|
|
162
191
|
});
|
|
163
192
|
|
|
164
193
|
export function isBrokerRefusalCode(value: unknown): value is BrokerRefusalCode {
|
|
@@ -171,6 +200,14 @@ export function isBrokerRefusalCode(value: unknown): value is BrokerRefusalCode
|
|
|
171
200
|
export const SIGN_IN_HANDOFF_PARAM = 'iox_signin';
|
|
172
201
|
/** The failure's query parameter on the return address. */
|
|
173
202
|
export const SIGN_IN_ERROR_PARAM = 'iox_signin_error';
|
|
203
|
+
/** Beside a failure a studio sends back: the provider it was (`?iox_signin_via=github`), so the words can name it. */
|
|
204
|
+
export const SIGN_IN_VIA_PARAM = 'iox_signin_via';
|
|
205
|
+
/**
|
|
206
|
+
* The binding parameter on every return address a studio or the portal asks the broker for: `iox_sb=<sha256 of the
|
|
207
|
+
* random value in the starting browser's httpOnly cookie>`. The redeemed `returnUrl` must carry THIS browser's hash — a
|
|
208
|
+
* hand-off started in another browser is refused (login CSRF).
|
|
209
|
+
*/
|
|
210
|
+
export const SIGN_IN_BINDING_PARAM = 'iox_sb';
|
|
174
211
|
|
|
175
212
|
/** Why the browser came back without a person. */
|
|
176
213
|
export enum SignInReturnError {
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { isSameOriginPath } from './guards';
|
|
2
|
+
import { isEmailCodeShape, normalizeEmailCode, normalizeSignInEmail, SiteCustomer } from './site-auth';
|
|
3
|
+
import { brokerStartUrl, SIGN_IN_PROVIDERS, SignInProvider } from './sign-in';
|
|
4
|
+
import { EMAIL_CODE_PROVIDER, SITE_SIGN_IN_METHODS, SiteSignInMethod } from './site-methods';
|
|
5
|
+
import { SiteSignInRefusalCode, siteSignInCodeOf } from './words';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* THE TRANSPORT a site's sign-in parts speak (commerce E3a, the `CartTransport` rule): the parts own no HTTP. The engine
|
|
9
|
+
* implements it over iox-cms's site routes (`siteAuthPath`, `siteProviderPath`, the cookie carried by the browser); the
|
|
10
|
+
* builder canvas uses `simulatedSiteAuthTransport` — the ADMIN's browser is never a buyer, so nothing is sent and no
|
|
11
|
+
* session exists.
|
|
12
|
+
*/
|
|
13
|
+
export interface SiteAuthTransport {
|
|
14
|
+
/** The signed-in buyer, or null. */
|
|
15
|
+
me(): Promise<SiteCustomer | null>;
|
|
16
|
+
/** Ask the studio to start a provider's sign-in; the answer is the address the browser goes to next. */
|
|
17
|
+
startProvider(provider: SignInProvider, returnPath: string): Promise<{ startUrl: string }>;
|
|
18
|
+
/** Send a code to `email` (the studio always accepts — it never says whether the email is known). */
|
|
19
|
+
sendCode(email: string): Promise<void>;
|
|
20
|
+
/** Check the code; the signed-in buyer. */
|
|
21
|
+
verifyCode(email: string, code: string): Promise<SiteCustomer>;
|
|
22
|
+
signOut(): Promise<void>;
|
|
23
|
+
/** The ways this site lets a buyer sign in (`SiteAuthRoute.Methods`). Absent = the parts hide nothing. */
|
|
24
|
+
methods?(): Promise<SiteSignInMethod[]>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A refused transport call, carrying the code the visitor's words come from (`signInRefusal`). */
|
|
28
|
+
export class SiteAuthError extends Error {
|
|
29
|
+
readonly code: SiteSignInRefusalCode;
|
|
30
|
+
|
|
31
|
+
constructor(code: unknown) {
|
|
32
|
+
const known = siteSignInCodeOf(code);
|
|
33
|
+
super(known);
|
|
34
|
+
this.name = 'SiteAuthError';
|
|
35
|
+
this.code = known;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The code any thrown value carries: a `SiteAuthError`'s own, else `network` (the call never answered). */
|
|
40
|
+
export function siteAuthErrorCode(error: unknown): SiteSignInRefusalCode {
|
|
41
|
+
return error instanceof SiteAuthError ? error.code : SiteSignInRefusalCode.Network;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The sample buyer the canvas signs in as. */
|
|
45
|
+
export const SAMPLE_CUSTOMER: Readonly<SiteCustomer> = Object.freeze({ id: 'sample-customer', email: 'noa.levi@example.com', name: 'Noa Levi' });
|
|
46
|
+
|
|
47
|
+
/** The one code the simulated transport accepts (any other six digits are "not right" — so the error can be designed). */
|
|
48
|
+
export const SIMULATED_SIGN_IN_CODE = '123456';
|
|
49
|
+
|
|
50
|
+
export interface SimulatedSiteAuthTransport extends SiteAuthTransport {
|
|
51
|
+
/** Who is signed in on the canvas right now. */
|
|
52
|
+
readonly customer: SiteCustomer | null;
|
|
53
|
+
setCustomer(customer: SiteCustomer | null): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The canvas' transport: in memory, nothing sent. A code is "sent" to any well-formed email; `123456` signs in as the
|
|
58
|
+
* sample buyer under the typed email, any other six digits are `code-wrong`; a provider's start answers the broker's
|
|
59
|
+
* address with a sample ticket (the canvas host never follows it).
|
|
60
|
+
*/
|
|
61
|
+
export function simulatedSiteAuthTransport(start: SiteCustomer | null = null,
|
|
62
|
+
methods: readonly SiteSignInMethod[] = SITE_SIGN_IN_METHODS): SimulatedSiteAuthTransport {
|
|
63
|
+
let customer: SiteCustomer | null = start;
|
|
64
|
+
const sentTo = new Set<string>();
|
|
65
|
+
return {
|
|
66
|
+
get customer() {
|
|
67
|
+
return customer;
|
|
68
|
+
},
|
|
69
|
+
setCustomer(next) {
|
|
70
|
+
customer = next;
|
|
71
|
+
},
|
|
72
|
+
async me() {
|
|
73
|
+
return customer;
|
|
74
|
+
},
|
|
75
|
+
async startProvider(provider, returnPath) {
|
|
76
|
+
if (!isSameOriginPath(returnPath)) throw new SiteAuthError(SiteSignInRefusalCode.Failed);
|
|
77
|
+
return { startUrl: brokerStartUrl(provider, 'sample-ticket') };
|
|
78
|
+
},
|
|
79
|
+
async sendCode(email) {
|
|
80
|
+
const key = normalizeSignInEmail(email);
|
|
81
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(key)) throw new SiteAuthError(SiteSignInRefusalCode.InvalidEmail);
|
|
82
|
+
sentTo.add(key);
|
|
83
|
+
},
|
|
84
|
+
async verifyCode(email, code) {
|
|
85
|
+
const key = normalizeSignInEmail(email);
|
|
86
|
+
const digits = normalizeEmailCode(code);
|
|
87
|
+
if (!sentTo.has(key) || !isEmailCodeShape(digits)) throw new SiteAuthError(SiteSignInRefusalCode.CodeWrong);
|
|
88
|
+
if (digits !== SIMULATED_SIGN_IN_CODE) throw new SiteAuthError(SiteSignInRefusalCode.CodeWrong);
|
|
89
|
+
customer = { ...SAMPLE_CUSTOMER, email: key };
|
|
90
|
+
return customer;
|
|
91
|
+
},
|
|
92
|
+
async signOut() {
|
|
93
|
+
customer = null;
|
|
94
|
+
},
|
|
95
|
+
async methods() {
|
|
96
|
+
return [EMAIL_CODE_PROVIDER, ...SIGN_IN_PROVIDERS.filter(p => methods.includes(p))];
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** A transport that has nothing to reach: `me` is null, every change refused as `network`. */
|
|
102
|
+
export const NO_SITE_AUTH_TRANSPORT: SiteAuthTransport = Object.freeze({
|
|
103
|
+
me: async () => null,
|
|
104
|
+
startProvider: async () => { throw new SiteAuthError(SiteSignInRefusalCode.ProviderUnavailable); },
|
|
105
|
+
sendCode: async () => { throw new SiteAuthError(SiteSignInRefusalCode.Network); },
|
|
106
|
+
verifyCode: async () => { throw new SiteAuthError(SiteSignInRefusalCode.Network); },
|
|
107
|
+
signOut: async () => undefined,
|
|
108
|
+
methods: async () => [EMAIL_CODE_PROVIDER],
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// ── what a page shows of the buyer ───────────────────────────────────────────────────────────
|
|
112
|
+
|
|
113
|
+
/** The context slot the account parts bind to (`$customer.initial`, `$customer.name`). */
|
|
114
|
+
export const CUSTOMER_SLOT = '$customer';
|
|
115
|
+
|
|
116
|
+
/** `$customer` — what a page may show of the buyer: never the id. */
|
|
117
|
+
export interface CustomerSlot {
|
|
118
|
+
signedIn: boolean;
|
|
119
|
+
name: string;
|
|
120
|
+
/** The first letter of the name, else of the email; '' when signed out. */
|
|
121
|
+
initial: string;
|
|
122
|
+
email: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The first visible letter of a name or an email, upper-cased where the script has case. */
|
|
126
|
+
export function customerInitial(customer: Pick<SiteCustomer, 'name' | 'email'> | null | undefined): string {
|
|
127
|
+
const source = (customer?.name ?? '').trim() || (customer?.email ?? '').trim();
|
|
128
|
+
const first = Array.from(source)[0] ?? '';
|
|
129
|
+
return first.toLocaleUpperCase();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** The name a page greets with: the buyer's own, else the email's local part. */
|
|
133
|
+
export function customerDisplayName(customer: Pick<SiteCustomer, 'name' | 'email'> | null | undefined): string {
|
|
134
|
+
const name = (customer?.name ?? '').trim();
|
|
135
|
+
if (name) return name;
|
|
136
|
+
return (customer?.email ?? '').split('@')[0] ?? '';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function customerSlotOf(customer: SiteCustomer | null | undefined): CustomerSlot {
|
|
140
|
+
if (!customer) return { signedIn: false, name: '', initial: '', email: '' };
|
|
141
|
+
return { signedIn: true, name: customerDisplayName(customer), initial: customerInitial(customer), email: customer.email };
|
|
142
|
+
}
|
|
@@ -17,6 +17,8 @@ export enum SiteAuthRoute {
|
|
|
17
17
|
/** `GET` → `{ customer }` (null when signed out). */
|
|
18
18
|
Me = 'me',
|
|
19
19
|
MyOrders = 'me/orders',
|
|
20
|
+
/** `GET` → `{ methods }` — the ways this site lets a buyer sign in right now (`siteSignInMethods`). Public. */
|
|
21
|
+
Methods = 'auth/methods',
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/** Every route a site's sign-in calls, by name (the provider pair is per provider — `siteProviderPath`). */
|
|
@@ -136,6 +138,17 @@ export function signInStateCookieName(orgId: string): string {
|
|
|
136
138
|
return `${SIGN_IN_STATE_COOKIE_PREFIX}${orgId}`;
|
|
137
139
|
}
|
|
138
140
|
|
|
141
|
+
/**
|
|
142
|
+
* A cookie no sibling host can plant (vectoriox/iox-cms#73 — cookie tossing from another `*.iox.studio`): over https the
|
|
143
|
+
* name takes the `__Host-` prefix, which a browser accepts only `Secure`, with `Path=/` and no `Domain`. A server that
|
|
144
|
+
* sets one with this name must set exactly those; plain http (local development) keeps the bare name.
|
|
145
|
+
*/
|
|
146
|
+
export const HOST_ONLY_COOKIE_PREFIX = '__Host-';
|
|
147
|
+
|
|
148
|
+
export function hostOnlyCookieName(name: string, secure: boolean): string {
|
|
149
|
+
return secure ? `${HOST_ONLY_COOKIE_PREFIX}${name}` : name;
|
|
150
|
+
}
|
|
151
|
+
|
|
139
152
|
// ── the email code ─────────────────────────────────────────────────────────────────────────────
|
|
140
153
|
|
|
141
154
|
export const EMAIL_CODE_LENGTH = 6;
|
|
@@ -170,3 +183,26 @@ export function emailCodeExpired(sentAt: number | Date, now: number | Date): boo
|
|
|
170
183
|
export function emailCodeTriesLeft(wrongTries: number): number {
|
|
171
184
|
return Math.max(0, EMAIL_CODE_MAX_TRIES - Math.max(0, Math.floor(wrongTries || 0)));
|
|
172
185
|
}
|
|
186
|
+
|
|
187
|
+
// ── the fixed account page (C-D3: fixed like checkout, the look's dress) ────────────────────────
|
|
188
|
+
|
|
189
|
+
export const ACCOUNT_PATH = 'account';
|
|
190
|
+
|
|
191
|
+
/** The buyer's account page — their orders: `/<orgLabel>/account` (the engine answers it on every studio). */
|
|
192
|
+
export function accountHref(orgLabel?: string | null): string {
|
|
193
|
+
const label = String(orgLabel ?? '').replace(/^\/+|\/+$/g, '');
|
|
194
|
+
return label ? `/${encodeURIComponent(label)}/${ACCOUNT_PATH}` : `/${ACCOUNT_PATH}`;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** The account page's segment for one order: `/<orgLabel>/account/orders/<number>`. */
|
|
198
|
+
export const ACCOUNT_ORDERS_SEGMENT = 'orders';
|
|
199
|
+
|
|
200
|
+
/** One of the signed-in buyer's own orders, under the account page — read by the session, never by a link token. */
|
|
201
|
+
export function accountOrderHref(orgLabel: string | null | undefined, orderNumber: string | number): string {
|
|
202
|
+
return `${accountHref(orgLabel)}/${ACCOUNT_ORDERS_SEGMENT}/${encodeURIComponent(String(orderNumber))}`;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** `GET /api/site/<org>/me/orders/<number>` — one order of the signed-in buyer (404 for anyone else's). */
|
|
206
|
+
export function siteMyOrderPath(orgId: string, orderNumber: string | number): string {
|
|
207
|
+
return `${siteAuthPath(orgId, SiteAuthRoute.MyOrders)}/${encodeURIComponent(String(orderNumber))}`;
|
|
208
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { providersServing, SIGN_IN_PROVIDERS, SignInProvider, SignInPurpose } from './sign-in';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Which ways a studio's SITE lets a buyer sign in (Settings ▸ Sign-in, board 18): the email code always, and each
|
|
5
|
+
* provider the owner switched on — while the broker has it ON and it may serve a buyer (C-D6). ONE rule for the studio
|
|
6
|
+
* that enforces it (iox-cms), the site that shows it (the engine, the canvas) and the screen that sets it (cms-client).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** The email code — a `customerIdentities.provider` value beside the broker's providers; it never touches the broker. */
|
|
10
|
+
export const EMAIL_CODE_PROVIDER = 'email-code' as const;
|
|
11
|
+
export type EmailCodeProvider = typeof EMAIL_CODE_PROVIDER;
|
|
12
|
+
|
|
13
|
+
/** A way a buyer signs in, and the `customerIdentities.provider` it is stored as. */
|
|
14
|
+
export type SiteSignInMethod = EmailCodeProvider | SignInProvider;
|
|
15
|
+
|
|
16
|
+
/** Every method, in the order a sign-in shows them. */
|
|
17
|
+
export const SITE_SIGN_IN_METHODS: ReadonlyArray<SiteSignInMethod> = Object.freeze([EMAIL_CODE_PROVIDER, ...SIGN_IN_PROVIDERS]);
|
|
18
|
+
|
|
19
|
+
export function isSiteSignInMethod(value: unknown): value is SiteSignInMethod {
|
|
20
|
+
return typeof value === 'string' && (SITE_SIGN_IN_METHODS as readonly string[]).includes(value);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The settings type a studio's org stores its choice under (`settings` collection, one row per org). */
|
|
24
|
+
export const SITE_SIGN_IN_SETTINGS_TYPE = 'signIn';
|
|
25
|
+
|
|
26
|
+
/** What the owner chose: each provider on or off for buyers. The email code is not a choice — it is always on. */
|
|
27
|
+
export interface SiteSignInSettings {
|
|
28
|
+
providers: Record<SignInProvider, boolean>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** A studio that never chose: Google on (C-D6 — "Google on by default, the others as owner switches"). */
|
|
32
|
+
export const DEFAULT_SITE_SIGN_IN_SETTINGS: Readonly<SiteSignInSettings> = Object.freeze({
|
|
33
|
+
providers: Object.freeze({
|
|
34
|
+
[SignInProvider.Google]: true,
|
|
35
|
+
[SignInProvider.Facebook]: false,
|
|
36
|
+
[SignInProvider.GitHub]: false,
|
|
37
|
+
[SignInProvider.LinkedIn]: false,
|
|
38
|
+
}) as Record<SignInProvider, boolean>,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/** Any stored or posted value as a whole setting: every provider present, booleans only, unknown keys dropped. */
|
|
42
|
+
export function normalizeSiteSignInSettings(raw: unknown): SiteSignInSettings {
|
|
43
|
+
const given = raw && typeof raw === 'object' ? (raw as { providers?: unknown }).providers : undefined;
|
|
44
|
+
const map = given && typeof given === 'object' && !Array.isArray(given) ? given as Record<string, unknown> : {};
|
|
45
|
+
const providers = {} as Record<SignInProvider, boolean>;
|
|
46
|
+
for (const p of SIGN_IN_PROVIDERS) providers[p] = typeof map[p] === 'boolean' ? map[p] as boolean : DEFAULT_SITE_SIGN_IN_SETTINGS.providers[p];
|
|
47
|
+
return { providers };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The methods a site offers right now: the email code, then every provider the owner switched on that the broker has
|
|
51
|
+
* ON (`brokerOn`) and that may serve a buyer. */
|
|
52
|
+
export function siteSignInMethods(settings: unknown, brokerOn: readonly SignInProvider[]): SiteSignInMethod[] {
|
|
53
|
+
const chosen = normalizeSiteSignInSettings(settings).providers;
|
|
54
|
+
return [EMAIL_CODE_PROVIDER, ...providersServing(brokerOn, SignInPurpose.Site).filter(p => chosen[p])];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** May a buyer start `provider` on this site right now? */
|
|
58
|
+
export function siteOffersProvider(settings: unknown, brokerOn: readonly SignInProvider[], provider: SignInProvider): boolean {
|
|
59
|
+
return siteSignInMethods(settings, brokerOn).includes(provider);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** `GET api/site/<org>/auth/methods` — public, cacheable. */
|
|
63
|
+
export interface SiteSignInMethodsAnswer {
|
|
64
|
+
methods: SiteSignInMethod[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** The methods in an answer (unknown values dropped, in the shown order); the email code is always one of them. */
|
|
68
|
+
export function siteSignInMethodsOf(answer: unknown): SiteSignInMethod[] {
|
|
69
|
+
const listed = answer && typeof answer === 'object' ? (answer as { methods?: unknown }).methods : undefined;
|
|
70
|
+
const set = new Set(Array.isArray(listed) ? listed.filter(isSiteSignInMethod) : []);
|
|
71
|
+
set.add(EMAIL_CODE_PROVIDER);
|
|
72
|
+
return SITE_SIGN_IN_METHODS.filter(m => set.has(m));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The providers among a site's methods. */
|
|
76
|
+
export function siteSignInProviders(methods: readonly SiteSignInMethod[]): SignInProvider[] {
|
|
77
|
+
return SIGN_IN_PROVIDERS.filter(p => methods.includes(p));
|
|
78
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { signInProviderName } from './provider-marks';
|
|
2
|
+
import { BrokerRefusalCode, isSignInProvider, readSignInReturn, SIGN_IN_ERROR_PARAM, SIGN_IN_VIA_PARAM, SignInProvider, SignInReturnError } from './sign-in';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The sign-in dialog's words and its refusals, in English and Hebrew. A string-rendered site has no translation
|
|
@@ -29,7 +30,8 @@ export enum SignInWord {
|
|
|
29
30
|
SignIn = 'signIn',
|
|
30
31
|
SignInTo = 'signInTo',
|
|
31
32
|
Why = 'why',
|
|
32
|
-
|
|
33
|
+
/** `{provider}` = the brand's own name (`signInProviderName`), never translated. */
|
|
34
|
+
ContinueWith = 'continueWith',
|
|
33
35
|
Or = 'or',
|
|
34
36
|
Email = 'email',
|
|
35
37
|
EmailPlaceholder = 'emailPlaceholder',
|
|
@@ -49,6 +51,12 @@ export enum SignInWord {
|
|
|
49
51
|
SignedIn = 'signedIn',
|
|
50
52
|
SignedOut = 'signedOut',
|
|
51
53
|
NoPassword = 'noPassword',
|
|
54
|
+
/** Before the checkout's "Sign in". */
|
|
55
|
+
HaveAccount = 'haveAccount',
|
|
56
|
+
/** The account page with no orders. */
|
|
57
|
+
NoOrders = 'noOrders',
|
|
58
|
+
/** An order row on the account page: `{date}`. */
|
|
59
|
+
PlacedOn = 'placedOn',
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
/** `{site}`, `{email}`, `{name}`, `{minutes}` are filled by `signInWord`. */
|
|
@@ -56,7 +64,7 @@ export const SIGN_IN_WORDS: Readonly<Record<SignInWord, SignInLabel>> = Object.f
|
|
|
56
64
|
[SignInWord.SignIn]: { en: 'Sign in', he: 'התחברות' },
|
|
57
65
|
[SignInWord.SignInTo]: { en: 'Sign in to {site}', he: 'התחברות ל־{site}' },
|
|
58
66
|
[SignInWord.Why]: { en: 'See your orders and check out faster.', he: 'לראות את ההזמנות שלך ולשלם מהר יותר.' },
|
|
59
|
-
[SignInWord.
|
|
67
|
+
[SignInWord.ContinueWith]: { en: 'Continue with {provider}', he: 'המשך עם {provider}' },
|
|
60
68
|
[SignInWord.Or]: { en: 'or', he: 'או' },
|
|
61
69
|
[SignInWord.Email]: { en: 'Email', he: 'אימייל' },
|
|
62
70
|
[SignInWord.EmailPlaceholder]: { en: 'name@example.com', he: 'name@example.com' },
|
|
@@ -76,6 +84,9 @@ export const SIGN_IN_WORDS: Readonly<Record<SignInWord, SignInLabel>> = Object.f
|
|
|
76
84
|
[SignInWord.SignedIn]: { en: 'You are signed in.', he: 'התחברת.' },
|
|
77
85
|
[SignInWord.SignedOut]: { en: 'You are signed out.', he: 'התנתקת.' },
|
|
78
86
|
[SignInWord.NoPassword]: { en: 'No password — we email you a code.', he: 'בלי סיסמה — נשלח לך קוד במייל.' },
|
|
87
|
+
[SignInWord.HaveAccount]: { en: 'Have an account?', he: 'יש לך חשבון?' },
|
|
88
|
+
[SignInWord.NoOrders]: { en: 'No orders yet.', he: 'עדיין אין הזמנות.' },
|
|
89
|
+
[SignInWord.PlacedOn]: { en: 'Placed {date}', he: 'בוצעה ב־{date}' },
|
|
79
90
|
});
|
|
80
91
|
|
|
81
92
|
export function signInWord(word: SignInWord, lang: string | null | undefined, fill: Readonly<Record<string, string | number>> = {}): string {
|
|
@@ -88,7 +99,7 @@ export function signInWord(word: SignInWord, lang: string | null | undefined, fi
|
|
|
88
99
|
export enum SignInSlot {
|
|
89
100
|
Email = 'email',
|
|
90
101
|
Code = 'code',
|
|
91
|
-
/** Under "Continue with Google". */
|
|
102
|
+
/** Under the provider buttons ("Continue with Google"). */
|
|
92
103
|
Provider = 'provider',
|
|
93
104
|
/** The dialog as a whole. */
|
|
94
105
|
Dialog = 'dialog',
|
|
@@ -114,6 +125,8 @@ export enum SiteSignInRefusalCode {
|
|
|
114
125
|
StateMismatch = 'state-mismatch',
|
|
115
126
|
Blocked = 'blocked',
|
|
116
127
|
NotSignedIn = 'not-signed-in',
|
|
128
|
+
/** The studio has no working mailer, so it cannot send a code (it never says whether the email is known). */
|
|
129
|
+
EmailUnavailable = 'email-unavailable',
|
|
117
130
|
Network = 'network',
|
|
118
131
|
}
|
|
119
132
|
|
|
@@ -122,7 +135,8 @@ interface SignInRefusalRule {
|
|
|
122
135
|
readonly label: SignInLabel;
|
|
123
136
|
}
|
|
124
137
|
|
|
125
|
-
|
|
138
|
+
/** `{provider}` is the brand's name (`signInRefusal`'s `provider`), else a neutral word. */
|
|
139
|
+
const TRY_PROVIDER_AGAIN: SignInLabel = { en: 'Signing in with {provider} did not work. Try again, or use an email code.', he: 'ההתחברות עם {provider} לא הצליחה. נסו שוב, או התחברו עם קוד במייל.' };
|
|
126
140
|
const SEND_NEW_CODE: SignInLabel = { en: 'This code has expired. Send a new one.', he: 'תוקף הקוד פג. שלחו קוד חדש.' };
|
|
127
141
|
|
|
128
142
|
export const SIGN_IN_REFUSALS: Readonly<Record<SiteSignInRefusalCode, SignInRefusalRule>> = Object.freeze({
|
|
@@ -131,14 +145,15 @@ export const SIGN_IN_REFUSALS: Readonly<Record<SiteSignInRefusalCode, SignInRefu
|
|
|
131
145
|
[SiteSignInRefusalCode.CodeExpired]: { slot: SignInSlot.Code, label: SEND_NEW_CODE },
|
|
132
146
|
[SiteSignInRefusalCode.TooManyTries]: { slot: SignInSlot.Code, label: { en: 'Too many wrong codes. Send a new one.', he: 'יותר מדי קודים שגויים. שלחו קוד חדש.' } },
|
|
133
147
|
[SiteSignInRefusalCode.RateLimited]: { slot: SignInSlot.Dialog, label: { en: 'Too many tries. Wait a minute and try again.', he: 'יותר מדי ניסיונות. המתינו דקה ונסו שוב.' } },
|
|
134
|
-
[SiteSignInRefusalCode.ProviderUnavailable]: { slot: SignInSlot.Provider, label: { en: '
|
|
135
|
-
[SiteSignInRefusalCode.Cancelled]: { slot: SignInSlot.Provider, label: { en: '
|
|
136
|
-
[SiteSignInRefusalCode.Refused]: { slot: SignInSlot.Provider, label: { en: '
|
|
148
|
+
[SiteSignInRefusalCode.ProviderUnavailable]: { slot: SignInSlot.Provider, label: { en: 'Signing in with {provider} is not available right now. Use an email code.', he: 'ההתחברות עם {provider} לא זמינה כרגע. התחברו עם קוד במייל.' } },
|
|
149
|
+
[SiteSignInRefusalCode.Cancelled]: { slot: SignInSlot.Provider, label: { en: 'Signing in with {provider} was cancelled.', he: 'ההתחברות עם {provider} בוטלה.' } },
|
|
150
|
+
[SiteSignInRefusalCode.Refused]: { slot: SignInSlot.Provider, label: { en: '{provider} could not confirm this account. Use an email code.', he: '{provider} לא אישר את החשבון הזה. התחברו עם קוד במייל.' } },
|
|
137
151
|
[SiteSignInRefusalCode.Expired]: { slot: SignInSlot.Provider, label: { en: 'The sign-in took too long. Try again.', he: 'ההתחברות ארכה יותר מדי. נסו שוב.' } },
|
|
138
|
-
[SiteSignInRefusalCode.Failed]: { slot: SignInSlot.Provider, label:
|
|
139
|
-
[SiteSignInRefusalCode.StateMismatch]: { slot: SignInSlot.Provider, label:
|
|
152
|
+
[SiteSignInRefusalCode.Failed]: { slot: SignInSlot.Provider, label: TRY_PROVIDER_AGAIN },
|
|
153
|
+
[SiteSignInRefusalCode.StateMismatch]: { slot: SignInSlot.Provider, label: TRY_PROVIDER_AGAIN },
|
|
140
154
|
[SiteSignInRefusalCode.Blocked]: { slot: SignInSlot.Dialog, label: { en: 'This account cannot sign in here. Contact the business.', he: 'החשבון הזה לא יכול להתחבר כאן. פנו לעסק.' } },
|
|
141
155
|
[SiteSignInRefusalCode.NotSignedIn]: { slot: SignInSlot.Dialog, label: { en: 'You are signed out. Sign in again.', he: 'התנתקת. התחברו שוב.' } },
|
|
156
|
+
[SiteSignInRefusalCode.EmailUnavailable]: { slot: SignInSlot.Email, label: { en: 'This site cannot send sign-in codes right now. Try again later.', he: 'האתר לא יכול לשלוח קודי התחברות כרגע. נסו שוב מאוחר יותר.' } },
|
|
142
157
|
[SiteSignInRefusalCode.Network]: { slot: SignInSlot.Dialog, label: { en: 'We could not reach the site. Try again.', he: 'לא הצלחנו להגיע לאתר. נסו שוב.' } },
|
|
143
158
|
});
|
|
144
159
|
|
|
@@ -154,6 +169,7 @@ const FROM_BROKER: Readonly<Record<BrokerRefusalCode, SiteSignInRefusalCode>> =
|
|
|
154
169
|
[BrokerRefusalCode.CodeUnknown]: SiteSignInRefusalCode.Expired,
|
|
155
170
|
[BrokerRefusalCode.CodeUsedOrExpired]: SiteSignInRefusalCode.Expired,
|
|
156
171
|
[BrokerRefusalCode.NotYours]: SiteSignInRefusalCode.Failed,
|
|
172
|
+
[BrokerRefusalCode.InvalidRequest]: SiteSignInRefusalCode.ProviderUnavailable,
|
|
157
173
|
});
|
|
158
174
|
|
|
159
175
|
const FROM_RETURN: Readonly<Record<SignInReturnError, SiteSignInRefusalCode>> = Object.freeze({
|
|
@@ -177,18 +193,45 @@ export interface SignInRefusal {
|
|
|
177
193
|
words: string;
|
|
178
194
|
}
|
|
179
195
|
|
|
180
|
-
/**
|
|
181
|
-
|
|
196
|
+
/** A provider refusal names no brand when the provider is not known. */
|
|
197
|
+
const ANY_PROVIDER: SignInLabel = { en: 'this account', he: 'החשבון' };
|
|
198
|
+
const NO_PROVIDER_LABEL: Partial<Record<SiteSignInRefusalCode, SignInLabel>> = {
|
|
199
|
+
[SiteSignInRefusalCode.Refused]: { en: 'The provider could not confirm this account. Use an email code.', he: 'הספק לא אישר את החשבון הזה. התחברו עם קוד במייל.' },
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/** One refusal, on its slot, in the visitor's words; a provider's refusal names it (`provider`). */
|
|
203
|
+
export function signInRefusal(code: unknown, lang: string | null | undefined, provider?: SignInProvider | null): SignInRefusal {
|
|
182
204
|
const known = siteSignInCodeOf(code);
|
|
183
205
|
const rule = SIGN_IN_REFUSALS[known];
|
|
184
|
-
|
|
206
|
+
const language = signInLanguage(lang);
|
|
207
|
+
const name = signInProviderName(provider);
|
|
208
|
+
const label = !name && NO_PROVIDER_LABEL[known] ? NO_PROVIDER_LABEL[known]! : rule.label;
|
|
209
|
+
return { code: known, slot: rule.slot, words: fillIn(label[language], { provider: name || ANY_PROVIDER[language] }) };
|
|
185
210
|
}
|
|
186
211
|
|
|
187
212
|
/** A refused call's body (`{ code }`) — or nothing at all (`network`) — as one refusal. The body's `message` is a log
|
|
188
213
|
* line and is never shown. A 429 with no code is `rate-limited`. */
|
|
189
|
-
export function signInRefusalOf(body: unknown, lang: string | null | undefined, status?: number | null
|
|
214
|
+
export function signInRefusalOf(body: unknown, lang: string | null | undefined, status?: number | null,
|
|
215
|
+
provider?: SignInProvider | null): SignInRefusal {
|
|
190
216
|
const code = body && typeof body === 'object' ? (body as { code?: unknown }).code : undefined;
|
|
191
|
-
if (code !== undefined) return signInRefusal(code, lang);
|
|
192
|
-
if (status === 429) return signInRefusal(SiteSignInRefusalCode.RateLimited, lang);
|
|
193
|
-
return signInRefusal(body === undefined || body === null ? SiteSignInRefusalCode.Network : SiteSignInRefusalCode.Failed, lang);
|
|
217
|
+
if (code !== undefined) return signInRefusal(code, lang, provider);
|
|
218
|
+
if (status === 429) return signInRefusal(SiteSignInRefusalCode.RateLimited, lang, provider);
|
|
219
|
+
return signInRefusal(body === undefined || body === null ? SiteSignInRefusalCode.Network : SiteSignInRefusalCode.Failed, lang, provider);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** A provider sign-in that came back refused to a site's page: the site's own code (a studio's `blocked`,
|
|
223
|
+
* `state-mismatch`… kept; a broker return error mapped) and the provider it was (`?iox_signin_via=`), or null. */
|
|
224
|
+
export interface SiteSignInReturnRefusal {
|
|
225
|
+
code: SiteSignInRefusalCode;
|
|
226
|
+
provider: SignInProvider | null;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function siteSignInReturnRefusal(search: string | URLSearchParams | null | undefined): SiteSignInReturnRefusal | null {
|
|
230
|
+
const params = typeof search === 'string' ? new URLSearchParams(search.startsWith('?') ? search.slice(1) : search) : search;
|
|
231
|
+
if (!params) return null;
|
|
232
|
+
const raw = params.get(SIGN_IN_ERROR_PARAM);
|
|
233
|
+
if (raw === null) return null;
|
|
234
|
+
const via = params.get(SIGN_IN_VIA_PARAM);
|
|
235
|
+
const code = isSiteSignInRefusalCode(raw) ? raw : siteSignInCodeOf(readSignInReturn(params)?.error);
|
|
236
|
+
return { code, provider: isSignInProvider(via) ? via : null };
|
|
194
237
|
}
|
package/styles/iox-design.css
CHANGED
|
@@ -1081,3 +1081,41 @@ dialog[data-iox-dialog].iox-es.iox-role-shop-cart-drawer:is([data-iox-closing],
|
|
|
1081
1081
|
}
|
|
1082
1082
|
dialog[data-iox-dialog].iox-es.iox-role-shop-cart-drawer:is([data-iox-closing], :not([open])) { transition-duration: 150ms; }
|
|
1083
1083
|
}
|
|
1084
|
+
|
|
1085
|
+
/* ── Commerce E3a: the account parts (commerce board 12, C-D6; composite-core account.ts / account-runtime.ts) ─────── */
|
|
1086
|
+
[data-iox-account-hidden] { display: none !important; }
|
|
1087
|
+
|
|
1088
|
+
/* The entry's two faces share ONE grid cell, so it never changes size as the buyer signs in (Emil: in place); the face
|
|
1089
|
+
that is not the buyer's state is hidden from sight and from assistive technology (the entry carries its own name).
|
|
1090
|
+
A transition of opacity only, so a sign-in mid-swap reverses from where it is and reduced motion needs nothing else. */
|
|
1091
|
+
.iox-role-account-entry > * { transition: opacity var(--iox-dur-fast) var(--iox-ease-standard), visibility var(--iox-dur-fast); }
|
|
1092
|
+
.iox-role-account-entry:not([data-iox-signed-in]) > :has(.iox-role-account-avatar),
|
|
1093
|
+
.iox-role-account-entry[data-iox-signed-in] > :has(.iox-role-account-sign-in-label) { opacity: 0; visibility: hidden; }
|
|
1094
|
+
.iox-role-account-entry[aria-busy='true'] { cursor: progress; }
|
|
1095
|
+
.iox-role-account-avatar { pointer-events: none; }
|
|
1096
|
+
.iox-role-account-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1097
|
+
/* On a phone the entry is its icon or the initial alone — the header keeps it beside the bag (its name stays the
|
|
1098
|
+
entry's aria-label). The canvas sizes by the frame (`@container iox-canvas`). */
|
|
1099
|
+
@media (max-width: 479px) {
|
|
1100
|
+
.iox-role-account-entry :is(.iox-role-account-sign-in-label, .iox-role-account-name) { display: none !important; }
|
|
1101
|
+
}
|
|
1102
|
+
@container iox-canvas (max-width: 479px) {
|
|
1103
|
+
.iox-role-account-entry :is(.iox-role-account-sign-in-label, .iox-role-account-name) { display: none !important; }
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
/* The dialog asks one thing at a time: the email (Google beside it), then the code just sent. */
|
|
1107
|
+
.iox-role-account-sign-in:not([data-iox-sign-in-step='code']) .iox-role-account-code-step { display: none !important; }
|
|
1108
|
+
.iox-role-account-sign-in[data-iox-sign-in-step='code'] :is(.iox-role-account-email-step, .iox-role-account-providers,
|
|
1109
|
+
.iox-role-account-google, .iox-role-account-or, .iox-role-account-provider-error, .iox-role-account-why) { display: none !important; }
|
|
1110
|
+
.iox-role-account-sign-in[aria-busy='true'] :is(.iox-role-account-google, .iox-role-account-facebook, .iox-role-account-github,
|
|
1111
|
+
.iox-role-account-linkedin, .iox-role-account-send-code, .iox-role-account-verify, .iox-role-account-send-again)[aria-busy='true'] { cursor: progress; }
|
|
1112
|
+
.iox-role-account-sign-in :is(.iox-role-account-google, .iox-role-account-facebook, .iox-role-account-github, .iox-role-account-linkedin,
|
|
1113
|
+
.iox-role-account-send-code, .iox-role-account-verify, .iox-role-account-send-again)[aria-disabled='true'] { pointer-events: none; }
|
|
1114
|
+
/* The code reads as a code: digits spaced, the same left-to-right in a Hebrew site. */
|
|
1115
|
+
.iox-role-account-code .iox-field__control { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; direction: ltr; }
|
|
1116
|
+
|
|
1117
|
+
/* The live region the account speaks in ("You are signed in."): read, never seen. */
|
|
1118
|
+
.iox-account-live {
|
|
1119
|
+
position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
|
|
1120
|
+
clip-path: inset(50%); white-space: nowrap; border: 0;
|
|
1121
|
+
}
|