@vectoriox/iox-ui 5.132.0 → 5.134.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/commerce-core/index.d.ts +12 -1
- package/composite-core/index.d.ts +44 -22
- package/design-core/index.d.ts +436 -35
- package/domain-core/index.d.ts +353 -0
- package/domain-core/package.json +3 -0
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +2 -0
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +6 -48
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs +21 -0
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +118 -62
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +895 -416
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-domain-core.mjs +422 -0
- package/fesm2022/vectoriox-iox-ui-domain-core.mjs.map +1 -0
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +13974 -12036
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +9 -3
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-mail-core.mjs +288 -2
- package/fesm2022/vectoriox-iox-ui-mail-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +290 -16
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1419 -379
- package/harness-core/index.d.ts +6 -1
- package/index.d.ts +139 -10
- package/mail-core/index.d.ts +315 -39
- package/package.json +5 -1
- package/src/actions-core/element-actions.ts +2 -0
- package/src/assist-core/page-sections.ts +7 -37
- package/src/commerce-core/shop-display.ts +21 -0
- package/src/composite-core/consent.ts +6 -2
- package/src/composite-core/shop-runtime.ts +47 -3
- package/src/composite-core/shop.ts +76 -57
- package/src/design-core/design-settings.ts +16 -0
- package/src/design-core/design-token.model.ts +7 -1
- package/src/design-core/flavor-spec.generated.ts +374 -35
- package/src/design-core/flavor-tokens.ts +12 -1
- package/src/design-core/header-behaviour.ts +32 -0
- package/src/design-core/motion-language.ts +115 -0
- package/src/design-core/public-api.ts +1 -0
- package/src/design-core/style-presets.ts +3 -0
- package/src/domain-core/domain-vocabulary.ts +125 -0
- package/src/domain-core/domain-wire.ts +95 -0
- package/src/domain-core/org-path-redirect.ts +105 -0
- package/src/domain-core/public-api.ts +12 -0
- package/src/domain-core/web-domain.ts +251 -0
- package/src/generation-core/carry-fill.ts +36 -0
- package/src/generation-core/carry.ts +398 -0
- package/src/generation-core/check-carry.ts +216 -0
- package/src/generation-core/check-layout.ts +71 -5
- package/src/generation-core/compose-layout.ts +187 -28
- package/src/generation-core/compose-site.ts +154 -31
- package/src/generation-core/entrances.ts +66 -10
- package/src/generation-core/header-edit.ts +299 -0
- package/src/generation-core/header-mix.ts +64 -5
- package/src/generation-core/layout-fingerprint.ts +5 -1
- package/src/generation-core/layout-language.ts +20 -1
- package/src/generation-core/layout-space.ts +4 -4
- package/src/generation-core/layout-wire.ts +36 -1
- package/src/generation-core/node-baselines.generated.ts +1 -0
- package/src/generation-core/public-api.ts +7 -0
- package/src/generation-core/redesign-additions.ts +273 -0
- package/src/generation-core/redesign-run.ts +364 -0
- package/src/generation-core/refit-page.ts +151 -0
- package/src/generation-core/section-stamp.ts +4 -4
- package/src/generation-core/shop-plan.ts +15 -0
- package/src/generation-core/site-build-run.ts +20 -3
- package/src/generation-core/site-spec.generated.ts +194 -94
- package/src/generation-core/site-tree.ts +19 -5
- package/src/generation-core/validate-site-plan.ts +37 -3
- package/src/harness-core/motion.ts +13 -3
- package/src/harness-core/starting-design.ts +1 -1
- package/src/mail-core/mail-domain.ts +305 -0
- package/src/mail-core/mail-standing.ts +58 -0
- package/src/mail-core/mail-vocabulary.ts +3 -0
- package/src/mail-core/mail-wire.ts +70 -1
- package/src/mail-core/public-api.ts +6 -1
- package/styles/iox-design.css +44 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DesignMotion, SPEC_AXES, STYLE_PRESETS, StylePreset } from '@vectoriox/iox-ui/design-core';
|
|
1
|
+
import { DesignMotion, MotionWordTier, motionWordTier, SPEC_AXES, STYLE_PRESETS, StylePreset } from '@vectoriox/iox-ui/design-core';
|
|
2
2
|
|
|
3
3
|
import { BUSINESS_TYPES, BusinessType } from './business-types';
|
|
4
4
|
import { READ_ANIMATE, StyleRead } from './rank';
|
|
@@ -8,6 +8,9 @@ import { READ_ANIMATE, StyleRead } from './rank';
|
|
|
8
8
|
* Scrolling and Between pages are the BUSINESS's (a spa scrolls softly whatever its look); How animated is the
|
|
9
9
|
* CALMER of the business's (or what the references show) and the style's — so a quiet serif look never gets
|
|
10
10
|
* bouncing cards. The owner's "little movement" caps all three. No matching type → the style's own.
|
|
11
|
+
* A style whose language names a COVER (AW4: Flood, Wipe, Circle, Veil, Line, Controls) plays it between pages whatever
|
|
12
|
+
* the business — the cover is the style's, like its Feel — except for a calm business (its ceiling below Standard) and
|
|
13
|
+
* under "little movement". A lower plan wears it as Fade (`motionLanguageForPlan`).
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
16
|
export interface MotionInput {
|
|
@@ -27,6 +30,8 @@ export interface MotionBasis {
|
|
|
27
30
|
littleMovement: boolean;
|
|
28
31
|
/** SC6: How animated was held at the type's ceiling (a law firm stays calm whatever the style or references). */
|
|
29
32
|
ceiling: boolean;
|
|
33
|
+
/** AW4: Between pages is the style's own cover. */
|
|
34
|
+
styleCover?: boolean;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
export interface MotionStart extends DesignMotion {
|
|
@@ -41,6 +46,7 @@ export const LITTLE_MOVEMENT_AVOID = 'lots-of-motion';
|
|
|
41
46
|
export const LITTLE_MOVEMENT_CAP: Readonly<DesignMotion> = { scroll: 'smooth', animate: 'subtle', between: 'fade' };
|
|
42
47
|
|
|
43
48
|
type Axis = keyof DesignMotion;
|
|
49
|
+
const STANDARD = 'standard' as DesignMotion['animate'];
|
|
44
50
|
const TABLES = { scroll: SPEC_AXES.scrolls, animate: SPEC_AXES.animations, between: SPEC_AXES.betweens } as const;
|
|
45
51
|
const ORDER: Readonly<Record<Axis, ReadonlyArray<string>>> = {
|
|
46
52
|
scroll: Object.keys(SPEC_AXES.scrolls), animate: Object.keys(SPEC_AXES.animations), between: Object.keys(SPEC_AXES.betweens),
|
|
@@ -66,9 +72,13 @@ export function motionFor(
|
|
|
66
72
|
const base = type ? type.moves : preset.moves;
|
|
67
73
|
const ref = read?.motion ? READ_ANIMATE[read.motion] : null;
|
|
68
74
|
const wanted = ref ?? base.animate;
|
|
69
|
-
|
|
75
|
+
const calmType = !!type && calmerChoice('animate', type.ceiling, STANDARD) !== STANDARD;
|
|
76
|
+
const styleCover = !!type && !calmType && preset.moves.between !== base.between
|
|
77
|
+
&& motionWordTier('cover', preset.moves.between) === MotionWordTier.Pro;
|
|
78
|
+
let out: DesignMotion = { scroll: base.scroll, animate: calmerChoice('animate', wanted, preset.moves.animate), between: styleCover ? preset.moves.between : base.between };
|
|
70
79
|
const why = [type ? `${type.label}: ${triple(base)}` : `${preset.name}: the style's own`];
|
|
71
|
-
|
|
80
|
+
if (styleCover) why.push(`${preset.name} changes pages by its own cover (${label('between', preset.moves.between)})`);
|
|
81
|
+
const basis: MotionBasis = { type: type?.id ?? null, calmerStyle: out.animate !== wanted, references: !!(ref && type), littleMovement: false, ceiling: false, ...(styleCover ? { styleCover } : {}) };
|
|
72
82
|
if (basis.calmerStyle) why.push(`${preset.name} moves less (${label('animate', preset.moves.animate)})`);
|
|
73
83
|
if (basis.references) why.push(`your references: ${label('animate', ref!)}`);
|
|
74
84
|
if (type && calmerChoice('animate', out.animate, type.ceiling) !== out.animate) {
|
|
@@ -20,7 +20,7 @@ import { referenceSeed } from './reference-colour';
|
|
|
20
20
|
export function presetDesign(
|
|
21
21
|
presetId: string,
|
|
22
22
|
input: MotionInput | string | null,
|
|
23
|
-
kept: Partial<Pick<DesignChoices, 'scroll' | 'animate' | 'between' | 'motion'>> = {},
|
|
23
|
+
kept: Partial<Pick<DesignChoices, 'scroll' | 'animate' | 'between' | 'motion' | 'feel' | 'headings'>> = {},
|
|
24
24
|
read: StyleRead | null = null,
|
|
25
25
|
): DesignChoices | null {
|
|
26
26
|
const base = presetChoices(presetId);
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A studio's OWN sending domain (iox-mail-plan ML4, ML-D2 (b), R-ML3): the owner names an address on its domain, adds the
|
|
3
|
+
* DNS records Mailjet gives, and IOX mail switches the From to that address only once Mailjet says the sender is active
|
|
4
|
+
* AND SPF AND DKIM are ok — never before, and back to `mail.iox.studio` the moment a recheck finds a record gone.
|
|
5
|
+
*
|
|
6
|
+
* ONE judge of Mailjet's `sender` + `dns` answers (`mailSenderProblems`), used by the relay for an IOX-mail domain and by
|
|
7
|
+
* iox-cms for a studio's own Mailjet key (commerce E4's sender check) — the two used to be one private copy each.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Where a studio's own sending domain stands — what Settings ▸ Email ▸ "Send from my own domain" shows. */
|
|
11
|
+
export enum MailDomainState {
|
|
12
|
+
/** no own domain — mail goes from `<studio>@mail.iox.studio` */
|
|
13
|
+
NotSet = 'not-set',
|
|
14
|
+
/** named; Mailjet has not checked its records yet (never asked, or a check is running) */
|
|
15
|
+
Waiting = 'waiting',
|
|
16
|
+
/** the sender is active and SPF + DKIM are ok — mail goes from the studio's own address */
|
|
17
|
+
Verified = 'verified',
|
|
18
|
+
/** checked, and a record is missing or wrong — mail keeps going from `mail.iox.studio` */
|
|
19
|
+
Failed = 'failed',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Why a sender is not verified — Mailjet's answers read (the values are commerce E4's, unchanged on the wire). */
|
|
23
|
+
export enum MailSenderProblem {
|
|
24
|
+
/** no sender address at all */
|
|
25
|
+
NoAddress = 'no-address',
|
|
26
|
+
/** Mailjet does not know the address as a sender, or has not activated it (the ownership record) */
|
|
27
|
+
SenderInactive = 'sender-inactive',
|
|
28
|
+
/** the address's domain is not added to Mailjet */
|
|
29
|
+
DomainMissing = 'domain-missing',
|
|
30
|
+
SpfMissing = 'spf-missing',
|
|
31
|
+
DkimMissing = 'dkim-missing',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The three records a domain needs — each one TXT. */
|
|
35
|
+
export enum MailDnsRecordRole {
|
|
36
|
+
/** proves the domain is the studio's: Mailjet's ownership token */
|
|
37
|
+
Ownership = 'ownership',
|
|
38
|
+
/** lets Mailjet's servers send for the domain */
|
|
39
|
+
Spf = 'spf',
|
|
40
|
+
/** signs every message with the domain's key */
|
|
41
|
+
Dkim = 'dkim',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** One record to copy into the domain's DNS. */
|
|
45
|
+
export interface MailDnsRecord {
|
|
46
|
+
role: MailDnsRecordRole;
|
|
47
|
+
type: 'TXT';
|
|
48
|
+
/** the full name — `mailjet._domainkey.alma.co.il` */
|
|
49
|
+
name: string;
|
|
50
|
+
/** the name as most DNS screens want it, relative to the domain (`mailjet._domainkey`; `@` for the domain itself) */
|
|
51
|
+
host: string;
|
|
52
|
+
value: string;
|
|
53
|
+
/** Mailjet's last word on it: true ok · false wrong or missing · null not checked yet */
|
|
54
|
+
ok: boolean | null;
|
|
55
|
+
/** what Mailjet found wrong, in its words (bounded) */
|
|
56
|
+
error?: string | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Why an address cannot become the studio's sending address. */
|
|
60
|
+
export enum MailDomainRefusal {
|
|
61
|
+
/** not one plain address */
|
|
62
|
+
NotAnAddress = 'not-an-address',
|
|
63
|
+
/** `iox.studio` or any domain under it — IOX's own */
|
|
64
|
+
PlatformDomain = 'platform-domain',
|
|
65
|
+
/** a public mailbox (gmail.com, outlook.com…) — nobody but its provider can add records there */
|
|
66
|
+
PublicMailbox = 'public-mailbox',
|
|
67
|
+
/** another studio sends from this domain */
|
|
68
|
+
Taken = 'taken',
|
|
69
|
+
/** IOX mail is not on (no key, or the plan has none) */
|
|
70
|
+
NotEnabled = 'not-enabled',
|
|
71
|
+
/** Mailjet could not be asked — try again */
|
|
72
|
+
Upstream = 'upstream',
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Mailjet's sender row (v3 REST `sender`) — only what is read. */
|
|
76
|
+
export interface MailjetSenderRow {
|
|
77
|
+
ID?: number;
|
|
78
|
+
Email?: string;
|
|
79
|
+
/** `Inactive` · `Active` · `Deleted` */
|
|
80
|
+
Status?: string;
|
|
81
|
+
/** -1 while inactive */
|
|
82
|
+
DNSID?: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Mailjet's DNS row (v3 REST `dns/{id}`). Statuses: SPF `OK` · `Error` · `Not checked` · `Not found`; DKIM `OK` · `Error` · `Not checked`. */
|
|
86
|
+
export interface MailjetDnsRow {
|
|
87
|
+
ID?: number;
|
|
88
|
+
Domain?: string;
|
|
89
|
+
SPFStatus?: string;
|
|
90
|
+
SPFRecordValue?: string;
|
|
91
|
+
DKIMStatus?: string;
|
|
92
|
+
DKIMRecordName?: string;
|
|
93
|
+
DKIMRecordValue?: string;
|
|
94
|
+
OwnerShipToken?: string;
|
|
95
|
+
OwnerShipTokenRecordName?: string;
|
|
96
|
+
IsCheckInProgress?: boolean;
|
|
97
|
+
LastCheckAt?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Mailjet's `dns/{id}/check` answer — `OK` · `Error`, with its words. */
|
|
101
|
+
export interface MailjetDnsCheckRow {
|
|
102
|
+
SPFStatus?: string;
|
|
103
|
+
SPFErrors?: string;
|
|
104
|
+
DKIMStatus?: string;
|
|
105
|
+
DKIMErrors?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const ACTIVE = 'active';
|
|
109
|
+
const OK = 'ok';
|
|
110
|
+
const NOT_CHECKED = new Set(['not checked', '']);
|
|
111
|
+
const MAX_ERROR = 300;
|
|
112
|
+
|
|
113
|
+
/** Mailjet's SPF include — merged into a domain's existing SPF record, never a second record beside it. */
|
|
114
|
+
export const MAILJET_SPF_INCLUDE = 'include:spf.mailjet.com';
|
|
115
|
+
|
|
116
|
+
/** How often the owner's "Check DNS" really asks Mailjet; a sooner press answers the last check. */
|
|
117
|
+
export const MAIL_DOMAIN_CHECK_MIN_MS = 30_000;
|
|
118
|
+
/** A verified domain is checked again this often — a removed record moves the From back to `mail.iox.studio`. */
|
|
119
|
+
export const MAIL_DOMAIN_RECHECK_MS = 24 * 60 * 60 * 1000;
|
|
120
|
+
|
|
121
|
+
/** Domains IOX itself sends from — never a studio's own. */
|
|
122
|
+
export const PLATFORM_MAIL_DOMAINS: readonly string[] = ['iox.studio'];
|
|
123
|
+
|
|
124
|
+
/** Public mailbox providers: an address there can never be verified by the studio (no access to the DNS). */
|
|
125
|
+
export const PUBLIC_MAILBOX_DOMAINS: readonly string[] = [
|
|
126
|
+
'gmail.com', 'googlemail.com', 'outlook.com', 'hotmail.com', 'live.com', 'msn.com', 'yahoo.com', 'ymail.com',
|
|
127
|
+
'icloud.com', 'me.com', 'mac.com', 'aol.com', 'proton.me', 'protonmail.com', 'gmx.com', 'gmx.net', 'zoho.com',
|
|
128
|
+
'yandex.com', 'mail.com', 'walla.co.il', 'walla.com',
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
/** The lower-cased domain of an address, or null. */
|
|
132
|
+
export function mailDomainOf(email: string | null | undefined): string | null {
|
|
133
|
+
const at = String(email ?? '').lastIndexOf('@');
|
|
134
|
+
const domain = at > 0 ? String(email).slice(at + 1).trim().toLowerCase().replace(/\.$/, '') : '';
|
|
135
|
+
return domain || null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const under = (domain: string, parent: string) => domain === parent || domain.endsWith(`.${parent}`);
|
|
139
|
+
|
|
140
|
+
/** Why this address cannot be the studio's own sending address — null when it can (the relay adds `Taken`). */
|
|
141
|
+
export function ownAddressRefusal(address: unknown, platformDomains: readonly string[] = PLATFORM_MAIL_DOMAINS): MailDomainRefusal | null {
|
|
142
|
+
if (typeof address !== 'string' || !isPlainAddress(address)) return MailDomainRefusal.NotAnAddress;
|
|
143
|
+
const domain = mailDomainOf(address)!;
|
|
144
|
+
if (platformDomains.some((p) => under(domain, p.toLowerCase()))) return MailDomainRefusal.PlatformDomain;
|
|
145
|
+
if (PUBLIC_MAILBOX_DOMAINS.some((p) => under(domain, p))) return MailDomainRefusal.PublicMailbox;
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const PLAIN_ADDRESS = /^[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/;
|
|
150
|
+
|
|
151
|
+
function isPlainAddress(value: string): boolean {
|
|
152
|
+
const v = value.trim();
|
|
153
|
+
return v.length <= 254 && PLAIN_ADDRESS.test(v) && /\.[A-Za-z]{2,}$/.test(v);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* THE judge of Mailjet's answers for one address: verified only with an active sender AND SPF ok AND DKIM ok.
|
|
158
|
+
* An empty list is verified. (commerce E4's sender check and the relay's own-domain check both ask this.)
|
|
159
|
+
*/
|
|
160
|
+
export function mailSenderProblems(email: string | null, sender: MailjetSenderRow | null, dns: MailjetDnsRow | null): MailSenderProblem[] {
|
|
161
|
+
const problems: MailSenderProblem[] = [];
|
|
162
|
+
if (!email || !mailDomainOf(email)) return [MailSenderProblem.NoAddress];
|
|
163
|
+
if (String(sender?.Status ?? '').toLowerCase() !== ACTIVE) problems.push(MailSenderProblem.SenderInactive);
|
|
164
|
+
if (!dns) problems.push(MailSenderProblem.DomainMissing);
|
|
165
|
+
else {
|
|
166
|
+
if (String(dns.SPFStatus ?? '').toLowerCase() !== OK) problems.push(MailSenderProblem.SpfMissing);
|
|
167
|
+
if (String(dns.DKIMStatus ?? '').toLowerCase() !== OK) problems.push(MailSenderProblem.DkimMissing);
|
|
168
|
+
}
|
|
169
|
+
return problems;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** A record's name relative to its domain — `@` for the domain itself. */
|
|
173
|
+
export function relativeDnsHost(name: string | null | undefined, domain: string): string {
|
|
174
|
+
const full = String(name ?? '').trim().toLowerCase().replace(/\.$/, '');
|
|
175
|
+
if (!full || full === domain) return '@';
|
|
176
|
+
return full.endsWith(`.${domain}`) ? full.slice(0, -(domain.length + 1)) : full;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The SPF record to publish: the domain's existing `v=spf1` record with Mailjet's include added before its `all` term
|
|
181
|
+
* (a domain may hold only ONE SPF record — a second one fails both), or Mailjet's own value when there is none.
|
|
182
|
+
*/
|
|
183
|
+
export function mergedSpf(existing: string | null | undefined, mailjetValue = `v=spf1 ${MAILJET_SPF_INCLUDE} ~all`): string {
|
|
184
|
+
const current = String(existing ?? '').trim().replace(/^"|"$/g, '');
|
|
185
|
+
if (!/^v=spf1(\s|$)/i.test(current)) return mailjetValue;
|
|
186
|
+
const terms = current.split(/\s+/);
|
|
187
|
+
if (terms.some((t) => t.toLowerCase() === MAILJET_SPF_INCLUDE)) return terms.join(' ');
|
|
188
|
+
const all = terms.findIndex((t, i) => i > 0 && /^[-~?+]?all$/i.test(t));
|
|
189
|
+
if (all < 0) return [...terms, MAILJET_SPF_INCLUDE].join(' ');
|
|
190
|
+
return [...terms.slice(0, all), MAILJET_SPF_INCLUDE, ...terms.slice(all)].join(' ');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const bounded = (words: string | null | undefined) => {
|
|
194
|
+
const w = String(words ?? '').replace(/\s+/g, ' ').trim();
|
|
195
|
+
return w ? w.slice(0, MAX_ERROR) : null;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const statusOk = (status: string | undefined): boolean | null => {
|
|
199
|
+
const s = String(status ?? '').trim().toLowerCase();
|
|
200
|
+
if (NOT_CHECKED.has(s)) return null;
|
|
201
|
+
return s === OK;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/** The three records to copy, each with Mailjet's last word on it. `existingSpf` = the domain's own SPF, when read. */
|
|
205
|
+
export function mailDnsRecords(
|
|
206
|
+
domain: string,
|
|
207
|
+
sender: MailjetSenderRow | null,
|
|
208
|
+
dns: MailjetDnsRow | null,
|
|
209
|
+
check?: MailjetDnsCheckRow | null,
|
|
210
|
+
existingSpf?: string | null,
|
|
211
|
+
): MailDnsRecord[] {
|
|
212
|
+
if (!dns) return [];
|
|
213
|
+
const record = (role: MailDnsRecordRole, name: string, value: string, ok: boolean | null, error?: string | null): MailDnsRecord =>
|
|
214
|
+
({ role, type: 'TXT', name, host: relativeDnsHost(name, domain), value, ok, error: ok === false ? bounded(error) : null });
|
|
215
|
+
const records: MailDnsRecord[] = [];
|
|
216
|
+
if (dns.OwnerShipToken) {
|
|
217
|
+
const name = String(dns.OwnerShipTokenRecordName || domain).replace(/\.$/, '');
|
|
218
|
+
// a fresh sender is Inactive by birth: the ownership row reads "wrong" only after a check found it so
|
|
219
|
+
const active = String(sender?.Status ?? '').toLowerCase() === ACTIVE;
|
|
220
|
+
records.push(record(MailDnsRecordRole.Ownership, name, dns.OwnerShipToken, active ? true : check ? false : null, check ? 'Mailjet has not found this record yet' : null));
|
|
221
|
+
}
|
|
222
|
+
records.push(record(MailDnsRecordRole.Spf, domain, mergedSpf(existingSpf, dns.SPFRecordValue || undefined), statusOk(check?.SPFStatus ?? dns.SPFStatus), check?.SPFErrors));
|
|
223
|
+
if (dns.DKIMRecordName && dns.DKIMRecordValue) {
|
|
224
|
+
records.push(record(MailDnsRecordRole.Dkim, String(dns.DKIMRecordName).replace(/\.$/, ''), dns.DKIMRecordValue, statusOk(check?.DKIMStatus ?? dns.DKIMStatus), check?.DKIMErrors));
|
|
225
|
+
}
|
|
226
|
+
return records;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** `GET /instances/me/mail/domain` (and every domain call's answer). Dates are ISO strings on the wire. */
|
|
230
|
+
export interface MailDomainAnswer {
|
|
231
|
+
/** the owner's chosen sending address on its domain — `shop@alma.co.il`; null when none is set */
|
|
232
|
+
address: string | null;
|
|
233
|
+
domain: string | null;
|
|
234
|
+
state: MailDomainState;
|
|
235
|
+
records: MailDnsRecord[];
|
|
236
|
+
problems: MailSenderProblem[];
|
|
237
|
+
/** when Mailjet last checked the records */
|
|
238
|
+
checkedAt: string | null;
|
|
239
|
+
/** when the domain was first found verified */
|
|
240
|
+
verifiedAt: string | null;
|
|
241
|
+
/** set when a domain that WAS verified failed a later check — the From went back to `mail.iox.studio` */
|
|
242
|
+
lostAt: string | null;
|
|
243
|
+
/**
|
|
244
|
+
* The studio's IOX address (`<studio>@mail.iox.studio`) — where mail goes whenever the own domain does not send, so
|
|
245
|
+
* the screen can say it even while the domain is verified (when both Froms are the own address). Absent from a relay
|
|
246
|
+
* older than this field.
|
|
247
|
+
*/
|
|
248
|
+
ioxAddress?: string | null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** iox-cms's answer to Settings ▸ Email (`…/connectors/mailer/domain`): the relay's, plus who may change it. */
|
|
252
|
+
export interface MailDomainView extends MailDomainAnswer {
|
|
253
|
+
/** the signed-in person may set or stop using the address — the INSTANCE owner (ML4-D2); admins read and Check DNS */
|
|
254
|
+
mayChange: boolean;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* A verified domain that a later check failed (ML4-D5): mail went back to the IOX address. THE rule for the bell's
|
|
259
|
+
* "Your own email domain stopped working" and the card's "DNS changed" — `lostAt` stays until it is verified again.
|
|
260
|
+
*/
|
|
261
|
+
export function mailDomainLost(answer: Pick<MailDomainAnswer, 'state' | 'lostAt'> | null | undefined): boolean {
|
|
262
|
+
return !!answer?.lostAt && answer.state !== MailDomainState.Verified;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** No own domain. */
|
|
266
|
+
export const NO_MAIL_DOMAIN: MailDomainAnswer = Object.freeze({
|
|
267
|
+
address: null, domain: null, state: MailDomainState.NotSet, records: [], problems: [], checkedAt: null, verifiedAt: null, lostAt: null,
|
|
268
|
+
}) as MailDomainAnswer;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* THE state rule: verified when nothing is wrong; waiting while nothing was checked yet (or Mailjet is checking now);
|
|
272
|
+
* failed once a check found a record missing or wrong.
|
|
273
|
+
*/
|
|
274
|
+
export function mailDomainState(problems: readonly MailSenderProblem[], checked: boolean, inProgress = false): MailDomainState {
|
|
275
|
+
if (!problems.length) return MailDomainState.Verified;
|
|
276
|
+
if (inProgress || !checked) return MailDomainState.Waiting;
|
|
277
|
+
return MailDomainState.Failed;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** May mail go from this domain now? Only a verified answer for exactly this address's domain (R-ML3). */
|
|
281
|
+
export function mailDomainSends(answer: Pick<MailDomainAnswer, 'state' | 'address'> | null | undefined): string | null {
|
|
282
|
+
return answer?.state === MailDomainState.Verified && answer.address ? answer.address.trim().toLowerCase() : null;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** Is a verified domain due its daily recheck? */
|
|
286
|
+
export function mailDomainRecheckDue(answer: Pick<MailDomainAnswer, 'state' | 'checkedAt'> | null | undefined, now: number): boolean {
|
|
287
|
+
if (answer?.state !== MailDomainState.Verified) return false;
|
|
288
|
+
const at = answer.checkedAt ? Date.parse(answer.checkedAt) : NaN;
|
|
289
|
+
return !Number.isFinite(at) || now - at >= MAIL_DOMAIN_RECHECK_MS;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** The relay's own-domain routes. */
|
|
293
|
+
export const RELAY_MAIL_DOMAIN_PATH = '/instances/me/mail/domain';
|
|
294
|
+
export const RELAY_MAIL_DOMAIN_CHECK_PATH = '/instances/me/mail/domain/check';
|
|
295
|
+
|
|
296
|
+
/** `PUT /instances/me/mail/domain` — the address mail should come from. */
|
|
297
|
+
export interface RelayDomainRequest {
|
|
298
|
+
address: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** A refused domain call: `{ code, message }` with 400 (`not-an-address` · `platform-domain` · `public-mailbox`), 409 (`taken`), 403/503 (`not-enabled`), 502 (`upstream`). */
|
|
302
|
+
export interface RelayDomainRefusalBody {
|
|
303
|
+
code: MailDomainRefusal;
|
|
304
|
+
message: string;
|
|
305
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RelayUsage } from './mail-wire';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Where a studio's IOX mail stands this month (iox-mail-plan ML-D5, the ML3 board's E2). ONE reading of the relay's
|
|
5
|
+
* usage: the admin's pill, meter and note, System Health, Home and the bell (iox-cms's reconciler) all ask this — none
|
|
6
|
+
* of them compares counts with a quota on its own.
|
|
7
|
+
*/
|
|
8
|
+
export enum MailStanding {
|
|
9
|
+
/** sending, under 80% of the month */
|
|
10
|
+
Healthy = 'healthy',
|
|
11
|
+
/** 80% of the month's emails used — reminders still go */
|
|
12
|
+
Low = 'low',
|
|
13
|
+
/** the month's emails used: reminders are paused, receipts and codes continue up to twice the month */
|
|
14
|
+
Full = 'full',
|
|
15
|
+
/** twice the month's emails sent: nothing more goes until the month resets */
|
|
16
|
+
Ceiling = 'ceiling',
|
|
17
|
+
/** reminders paused by complaints, bounces or the operator (ML-D7) — receipts and codes unaffected */
|
|
18
|
+
Paused = 'paused',
|
|
19
|
+
/** IOX mail does not send for this studio: the relay never answered, holds no key, or the plan has none */
|
|
20
|
+
Off = 'off',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The meter turns low — and the bell says so — once this share of the month is used (ML3-D2). */
|
|
24
|
+
export const MAIL_LOW_SHARE = 0.8;
|
|
25
|
+
|
|
26
|
+
/** The month's emails used so far (both kinds — what the quota counts). */
|
|
27
|
+
export function mailEmailsUsed(usage: RelayUsage | null | undefined): number {
|
|
28
|
+
return Math.max(0, Number(usage?.month?.total ?? 0) || 0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Emails left this month before reminders pause; null = unlimited (or no usage). */
|
|
32
|
+
export function mailEmailsLeft(usage: RelayUsage | null | undefined): number | null {
|
|
33
|
+
if (!usage || usage.quota === null || usage.quota === undefined) return null;
|
|
34
|
+
return Math.max(usage.quota - mailEmailsUsed(usage), 0);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** THE standing rule. The worst line crossed wins: off → ceiling → full → paused → low → healthy. */
|
|
38
|
+
export function mailStandingOf(usage: RelayUsage | null | undefined): MailStanding {
|
|
39
|
+
if (!usage || !usage.enabled || !usage.configured) return MailStanding.Off;
|
|
40
|
+
const used = mailEmailsUsed(usage);
|
|
41
|
+
if (usage.ceiling !== null && usage.ceiling !== undefined && used >= usage.ceiling) return MailStanding.Ceiling;
|
|
42
|
+
if (usage.quota !== null && usage.quota !== undefined && used >= usage.quota) return MailStanding.Full;
|
|
43
|
+
if (usage.marketingPaused) return MailStanding.Paused;
|
|
44
|
+
if (usage.quota !== null && usage.quota !== undefined && used >= MAIL_LOW_SHARE * usage.quota) return MailStanding.Low;
|
|
45
|
+
return MailStanding.Healthy;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Reminders do not go in this standing (receipts and codes still do, except at the ceiling). */
|
|
49
|
+
export function remindersStopped(standing: MailStanding): boolean {
|
|
50
|
+
return standing === MailStanding.Full || standing === MailStanding.Ceiling || standing === MailStanding.Paused;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const MAIL_ADDRESS = /^[^\s@<>(),;:"]+@[^\s@<>(),;:"]+\.[^\s@<>(),;:".]{2,}$/;
|
|
54
|
+
|
|
55
|
+
/** A plain address a Reply-To may carry (`name@domain.tld`), trimmed — the admin's field and iox-cms's save both ask it. */
|
|
56
|
+
export function isMailAddress(value: unknown): boolean {
|
|
57
|
+
return typeof value === 'string' && value.trim().length <= 254 && MAIL_ADDRESS.test(value.trim());
|
|
58
|
+
}
|
|
@@ -34,6 +34,8 @@ export enum MailSender {
|
|
|
34
34
|
FormDelivery = 'form-delivery',
|
|
35
35
|
/** the `sendEmail` element action — to the author's fixed address */
|
|
36
36
|
SendEmailAction = 'send-email-action',
|
|
37
|
+
/** Settings ▸ Email ▸ Send a test email — to the signed-in person's own address only (ML3-D3) */
|
|
38
|
+
TestEmail = 'test-email',
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
/** ONE table: what kind of mail each sender sends (R-ML1). Only reminders are marketing. */
|
|
@@ -45,6 +47,7 @@ export const MAIL_KIND_OF_SENDER: Readonly<Record<MailSender, MailKind>> = {
|
|
|
45
47
|
[MailSender.Reminder]: MailKind.Marketing,
|
|
46
48
|
[MailSender.FormDelivery]: MailKind.Transactional,
|
|
47
49
|
[MailSender.SendEmailAction]: MailKind.Transactional,
|
|
50
|
+
[MailSender.TestEmail]: MailKind.Transactional,
|
|
48
51
|
};
|
|
49
52
|
|
|
50
53
|
export function mailKindOf(sender: MailSender): MailKind {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { MailKind, MailRefusal, MailResultStatus, MailSenderState, MarketingPauseReason } from './mail-vocabulary';
|
|
1
|
+
import { MailKind, MailMode, MailRefusal, MailResultStatus, MailSenderState, MarketingPauseReason } from './mail-vocabulary';
|
|
2
|
+
import type { MailRoute } from './mail-route';
|
|
3
|
+
import type { MailStanding } from './mail-standing';
|
|
4
|
+
import type { MailDomainAnswer } from './mail-domain';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* The relay's wire (iox-control-plane `src/mail/`, its `openapi.json` tag `instances`). The studio calls back with its
|
|
@@ -85,9 +88,75 @@ export interface RelayUsage {
|
|
|
85
88
|
month: RelayMonth;
|
|
86
89
|
suppressions: number;
|
|
87
90
|
marketingPaused: { at: string; reason: MarketingPauseReason | string } | null;
|
|
91
|
+
/** where the studio's owner changes its plan (the portal's studio page); absent/null = nowhere to send them */
|
|
92
|
+
upgradeUrl?: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* The studio's own sending domain (ML4) — absent from a relay older than ML4. While it is verified, both Froms above
|
|
95
|
+
* are its address (`mailDomainSends`).
|
|
96
|
+
*/
|
|
97
|
+
domain?: MailDomainAnswer | null;
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
export interface RelayResponse {
|
|
91
101
|
results: RelayResult[];
|
|
92
102
|
usage: RelayUsage;
|
|
93
103
|
}
|
|
104
|
+
|
|
105
|
+
/** The mailer row's Reply-To (ML3-D1) — absent/blank = the relay's default, the studio's owner. */
|
|
106
|
+
export const MAILER_REPLY_TO_KEY = 'replyTo';
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* What the MAILER connector reports about itself (its E3 `details`), read by Settings ▸ Email, System Health and Home
|
|
110
|
+
* (iox-mail-plan ML3). Never a key. Own mode carries `mode` alone (plus what Mailjet's check found).
|
|
111
|
+
*/
|
|
112
|
+
export interface MailerDetails {
|
|
113
|
+
mode: MailMode;
|
|
114
|
+
/** IOX mode only: `mailStandingOf(usage)` */
|
|
115
|
+
standing?: MailStanding;
|
|
116
|
+
senderState?: MailSenderState;
|
|
117
|
+
/** the transactional From — `<studio>@mail.iox.studio` */
|
|
118
|
+
from?: string | null;
|
|
119
|
+
/** the reminders' From — `<studio>@news.mail.iox.studio` */
|
|
120
|
+
marketingFrom?: string | null;
|
|
121
|
+
/** where replies go now: the row's `replyTo`, else the relay's default (the owner) */
|
|
122
|
+
replyTo?: string | null;
|
|
123
|
+
/** the row's own Reply-To, as typed — null when it uses the default */
|
|
124
|
+
replyToSet?: string | null;
|
|
125
|
+
quota?: number | null;
|
|
126
|
+
ceiling?: number | null;
|
|
127
|
+
periodStart?: string | null;
|
|
128
|
+
periodEnd?: string | null;
|
|
129
|
+
month?: RelayMonth | null;
|
|
130
|
+
suppressions?: number;
|
|
131
|
+
marketingPaused?: RelayUsage['marketingPaused'];
|
|
132
|
+
/** this studio's emails refused for good in the last seven days (the outbox's own count) */
|
|
133
|
+
notSentThisWeek?: number;
|
|
134
|
+
upgradeUrl?: string | null;
|
|
135
|
+
/** IOX mode only: the own sending domain (ML4) — `NO_MAIL_DOMAIN` when none is set */
|
|
136
|
+
domain?: MailDomainAnswer | null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** At most this many test emails an hour, per studio (ML3-D3) — each counts against the month like any email. */
|
|
140
|
+
export const MAIL_TEST_PER_HOUR = 5;
|
|
141
|
+
|
|
142
|
+
/** What became of a test email. */
|
|
143
|
+
export enum MailTestOutcome {
|
|
144
|
+
/** handed to IOX mail's relay or the studio's own Mailjet, which took it */
|
|
145
|
+
Sent = 'sent',
|
|
146
|
+
/** stored in IOX mail's outbox — the relay could not take it now; it goes when it can */
|
|
147
|
+
Queued = 'queued',
|
|
148
|
+
/** refused: no route, the relay's reason, Mailjet's words */
|
|
149
|
+
Refused = 'refused',
|
|
150
|
+
/** this hour's test emails are used */
|
|
151
|
+
Limited = 'limited',
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** `POST admin/api/org/:orgId/connectors/mailer/test-email` — the answer Settings ▸ Email shows in place. */
|
|
155
|
+
export interface MailTestAnswer {
|
|
156
|
+
outcome: MailTestOutcome;
|
|
157
|
+
/** the signed-in person's own address — the only one a test goes to */
|
|
158
|
+
to: string;
|
|
159
|
+
route: MailRoute;
|
|
160
|
+
/** the relay's reason, or Mailjet's words — never a stack */
|
|
161
|
+
detail: string | null;
|
|
162
|
+
}
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
* @vectoriox/iox-ui/mail-core — IOX Mail's shared, FRAMEWORK-FREE vocabulary (iox-mail-plan ML2): a message's kind,
|
|
3
3
|
* who sends it, the relay's wire (`POST /instances/me/mail`, its usage) and refusals, and the ONE route rule — the
|
|
4
4
|
* studio's own active mailer wins, else IOX mail when the plan has it. The control plane (the relay), iox-cms (the
|
|
5
|
-
* transport and the MAILER connector) and the admin (Settings ▸ Email, ML3) speak it
|
|
5
|
+
* transport and the MAILER connector) and the admin (Settings ▸ Email, ML3) speak it — and ML3 adds the ONE reading
|
|
6
|
+
* of a studio's month (`mailStandingOf`: low at 80%, full, the 2× ceiling, paused, off), the connector's `MailerDetails`,
|
|
7
|
+
* the Reply-To check and the test email's answer; ML4 the studio's own sending domain (`mail-domain`: ONE judge of
|
|
8
|
+
* Mailjet's sender + DNS answers, the records to copy, the state rule). It imports nothing.
|
|
6
9
|
* ⚠️ Not re-exported from the main entry. Consumers wire the usual trio — ng-package raw-ts assets, jest
|
|
7
10
|
* moduleNameMapper, tsconfig paths — or `nest start` dies with ERR_REQUIRE_ESM.
|
|
8
11
|
*/
|
|
9
12
|
export * from './mail-vocabulary';
|
|
10
13
|
export * from './mail-wire';
|
|
11
14
|
export * from './mail-route';
|
|
15
|
+
export * from './mail-standing';
|
|
16
|
+
export * from './mail-domain';
|
package/styles/iox-design.css
CHANGED
|
@@ -393,7 +393,8 @@ dialog[data-iox-dialog].iox-es[data-iox-dialog-placement='start'] {
|
|
|
393
393
|
· entering (`@starting-style`) and leaving (`data-iox-closing`, set by actions-core `closeDialogAnimated`
|
|
394
394
|
for the whole exit, and `:not([open])` for a browser that closes it natively) — the drawer off its edge,
|
|
395
395
|
any other placement faded 12px toward where it sits, the scrim clear.
|
|
396
|
-
Entering
|
|
396
|
+
Entering lands on the look's arrival (ease-enter) and leaving on its leave (ease-exit — a fast ease-out on every
|
|
397
|
+
look since AW3, Motion board MB-D1: a leave never eases in), arriving over dur-base and leaving in half of it (AW4) — the look's motion
|
|
397
398
|
tokens, which the reduced-motion token block collapses to 0ms: under reduced motion it simply appears and
|
|
398
399
|
goes. `overlay`/`display` allow-discrete keep a natively closed dialog in the top layer for its exit. */
|
|
399
400
|
dialog[data-iox-dialog].iox-es {
|
|
@@ -420,6 +421,8 @@ dialog[data-iox-dialog].iox-es:is([data-iox-closing], :not([open])) {
|
|
|
420
421
|
translate: var(--dialog-exit-x) var(--dialog-exit-y);
|
|
421
422
|
opacity: var(--dialog-exit-opacity);
|
|
422
423
|
transition-timing-function: var(--iox-ease-exit);
|
|
424
|
+
/* AW4 (MB-D1, the contract's leaveShare 0.5): a leave takes half its entrance's time — Emil: exits faster. */
|
|
425
|
+
transition-duration: calc(var(--iox-dur-base) * 0.5);
|
|
423
426
|
}
|
|
424
427
|
@starting-style {
|
|
425
428
|
dialog[data-iox-dialog].iox-es[open] {
|
|
@@ -436,6 +439,7 @@ dialog[data-iox-dialog].iox-es::backdrop {
|
|
|
436
439
|
dialog[data-iox-dialog].iox-es:is([data-iox-closing], :not([open]))::backdrop {
|
|
437
440
|
opacity: 0;
|
|
438
441
|
transition-timing-function: var(--iox-ease-exit);
|
|
442
|
+
transition-duration: calc(var(--iox-dur-base) * 0.5);
|
|
439
443
|
}
|
|
440
444
|
@starting-style {
|
|
441
445
|
dialog[data-iox-dialog].iox-es[open]::backdrop { opacity: 0; }
|
|
@@ -458,6 +462,16 @@ dialog[data-iox-dialog] {
|
|
|
458
462
|
overscroll-behavior: contain;
|
|
459
463
|
}
|
|
460
464
|
|
|
465
|
+
/* iox-ui#95: a dialog that shows its ✕ keeps room for it. The ✕ sits 10px in from the top-end corner (28px on the site,
|
|
466
|
+
26px on the canvas), and nothing else knew it was there — the consent banner's Reject and its heading ran under it.
|
|
467
|
+
The close side's padding is at least 48px (10 + 28 + a 10px gap), never less than the look's own; logical, so a
|
|
468
|
+
Hebrew dialog keeps the room on its left. A dialog with no ✕ (a navigation drawer closes from its own button) is
|
|
469
|
+
untouched. The engine's <dialog> and the canvas twin's surface, one rule. */
|
|
470
|
+
dialog[data-iox-dialog]:has(> .iox-dialog-close),
|
|
471
|
+
.dialog-surface:has(> .dialog-close) {
|
|
472
|
+
padding-inline-end: max(var(--iox-dialog-pad, 0px), 48px);
|
|
473
|
+
}
|
|
474
|
+
|
|
461
475
|
/* A navigation's link lists (board 1): no underline at rest — the current page's link is the one
|
|
462
476
|
underlined (the link's `current` state, link-current-decoration). Keyed on the list's ROLE, so a
|
|
463
477
|
composed or adopted header and its drawer read it and no Link holds a literal over its element style.
|
|
@@ -470,6 +484,31 @@ dialog[data-iox-dialog] {
|
|
|
470
484
|
--iox-link-underline-rest: 0;
|
|
471
485
|
}
|
|
472
486
|
|
|
487
|
+
/* vectoriox/iox-ui#98 — a header on a PHONE is one row, and its name is held whole on one or two lines. The controls (the
|
|
488
|
+
menu button, the bag, the account, a pinned page, the cells holding them) keep their size and sit at half the look's gap;
|
|
489
|
+
the name takes the room the hidden pages leave and wraps balanced, a word too long for the room breaking rather than
|
|
490
|
+
running under a control; a long name (design-core `brandNameAttributes` — `data-iox-name`) steps down the look's own
|
|
491
|
+
type scale: `size-lead`, then `size-body`. Nothing is cut off, so nothing is hidden from a visitor. Two classes, so it
|
|
492
|
+
holds over the parts' own rules (one class each); the canvas sizes by its frame (`@container iox-canvas`). */
|
|
493
|
+
@media (max-width: 767px) {
|
|
494
|
+
.iox-es.iox-role-nav { column-gap: calc(var(--iox-space-gap) / 2); }
|
|
495
|
+
.iox-role-nav .iox-role-nav-cell { min-width: auto; column-gap: calc(var(--iox-space-gap) / 2); }
|
|
496
|
+
.iox-role-nav :is(.iox-role-nav-menu-button, .iox-role-shop-cart-button, .iox-role-account, .iox-role-nav-pinned, .iox-role-nav-actions, .iox-role-nav-cell) { flex-shrink: 0; }
|
|
497
|
+
.iox-role-nav .iox-role-nav-brand { min-width: 0; }
|
|
498
|
+
.iox-role-nav .iox-role-nav-brand :is(h1, h2, h3, h4, h5, h6, p) { text-wrap: balance; overflow-wrap: break-word; }
|
|
499
|
+
.iox-role-nav .iox-role-nav-brand[data-iox-name='long'] :is(h1, h2, h3, h4, h5, h6, p) { font-size: var(--iox-size-lead); }
|
|
500
|
+
.iox-role-nav .iox-role-nav-brand[data-iox-name='longer'] :is(h1, h2, h3, h4, h5, h6, p) { font-size: var(--iox-size-body); }
|
|
501
|
+
}
|
|
502
|
+
@container iox-canvas (max-width: 767px) {
|
|
503
|
+
.iox-es.iox-role-nav { column-gap: calc(var(--iox-space-gap) / 2); }
|
|
504
|
+
.iox-role-nav .iox-role-nav-cell { min-width: auto; column-gap: calc(var(--iox-space-gap) / 2); }
|
|
505
|
+
.iox-role-nav :is(.iox-role-nav-menu-button, .iox-role-shop-cart-button, .iox-role-account, .iox-role-nav-pinned, .iox-role-nav-actions, .iox-role-nav-cell) { flex-shrink: 0; }
|
|
506
|
+
.iox-role-nav .iox-role-nav-brand { min-width: 0; }
|
|
507
|
+
.iox-role-nav .iox-role-nav-brand :is(h1, h2, h3, h4, h5, h6, p) { text-wrap: balance; overflow-wrap: break-word; }
|
|
508
|
+
.iox-role-nav .iox-role-nav-brand[data-iox-name='long'] :is(h1, h2, h3, h4, h5, h6, p) { font-size: var(--iox-size-lead); }
|
|
509
|
+
.iox-role-nav .iox-role-nav-brand[data-iox-name='longer'] :is(h1, h2, h3, h4, h5, h6, p) { font-size: var(--iox-size-body); }
|
|
510
|
+
}
|
|
511
|
+
|
|
473
512
|
/* ── Header ingredients HI2a: the MENU's forms, reveals, buttons and hover (header-builder board v2, HB-D1/HB-D2) ─────────
|
|
474
513
|
A menu is the navigation's drawer Dialog wearing design-core `menuDialogAttributes`; its button and its Close wear
|
|
475
514
|
`menuButtonAttributes`. A menu with none of them is the drawer it always was (R-H4). Board 2: only transform, opacity,
|
|
@@ -1577,7 +1616,10 @@ html:has(.iox-bar-reserve) .iox-toasts[data-iox-edge='bottom'] { bottom: calc(16
|
|
|
1577
1616
|
/* An empty bag: no count on the bag button; the drawer shows its "empty" words and nothing else of the bag. */
|
|
1578
1617
|
.iox-role-shop-cart-button[data-iox-cart-empty] .iox-role-shop-cart-count { display: none !important; }
|
|
1579
1618
|
.iox-role-shop-cart-drawer[data-iox-cart-empty] :is(.iox-role-shop-cart-lines, .iox-role-shop-cart-summary, .iox-role-shop-cart-vat-note,
|
|
1580
|
-
.iox-role-shop-
|
|
1619
|
+
.iox-role-shop-cart-shipping-note) { display: none !important; }
|
|
1620
|
+
/* …and no Check out — unless this browser holds an unpaid order (client-engine#23): then Check out reads "Continue to
|
|
1621
|
+
payment" and goes back to the order (the shop runtime swaps its words). */
|
|
1622
|
+
.iox-role-shop-cart-drawer[data-iox-cart-empty]:not([data-iox-cart-waiting]) .iox-role-shop-checkout { display: none !important; }
|
|
1581
1623
|
.iox-role-shop-cart-drawer:not([data-iox-cart-empty]) .iox-role-shop-cart-empty { display: none !important; }
|
|
1582
1624
|
/* The bag button anchors its count to its corner (the count is positioned by its own node). */
|
|
1583
1625
|
.iox-role-shop-cart-count { pointer-events: none; }
|