@vectoriox/iox-ui 5.131.0 → 5.133.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.
@@ -65,6 +65,10 @@ export interface FingerprintedPage {
65
65
  businessType?: string;
66
66
  /** A demo (the proof sites): its opening and signature are not to be repeated, its order of sections may be. */
67
67
  demo?: boolean;
68
+ /** This site's own page (a sibling): judged by its opening AND signature together and by its order of sections, never
69
+ * by the "same kind of business" clauses — every page of a site is the same kind of business (m8-gate2 §16;
70
+ * vectoriox/iox-ui#96: an award site's pages fell back, each refused against the site's own Workshops page). */
71
+ sameSite?: boolean;
68
72
  }
69
73
 
70
74
  const OPENING_SCREEN_WORD = 'screen-word';
@@ -189,7 +193,7 @@ const signatureWords = (id: string) => SPEC_SITE_LAYOUT.signatures.find(s => s.i
189
193
  /**
190
194
  * Refuses a page that repeats one already made (M8-G2-D7): most of the same sequence (`SPEC_SITE_LAYOUT.sameness.sequence`,
191
195
  * 6 of 7), or the same opening AND signature; against a page of the same business type, the same opening or the same
192
- * signature alone. The sequence is compared with real pages only — this studio's, other studios', this site's — never a
196
+ * signature alone — never a page of THIS site (`sameSite`), which is always the same kind. The sequence is compared with real pages only — this studio's, other studios', this site's — never a
193
197
  * demo's (Doron, 2026-11-09: the proof sites' order is the product's grammar, not someone's site). The look is the
194
198
  * owner's pick and is never a reason.
195
199
  */
@@ -200,7 +204,7 @@ export function samenessIssues(me: LayoutFingerprint, others: ReadonlyArray<Fing
200
204
  };
201
205
  for (const o of others) {
202
206
  const them = o.fingerprint;
203
- const sameType = !!businessType && o.businessType === businessType;
207
+ const sameType = !o.sameSite && !!businessType && o.businessType === businessType;
204
208
  const opening = me.opening === them.opening;
205
209
  const signature = me.signature === them.signature;
206
210
  if (opening && (signature || sameType)) add('sections[0]', `"${o.name}" already opens on ${openingWords(them.opening)}${sameType ? ', and it is the same kind of business' : ` with ${signatureWords(them.signature)}`} — open another way`);
@@ -1,5 +1,5 @@
1
1
  import { ComposedPlaceholder, ComposeIssue } from './compose-site';
2
- import { SitePlan, SitePlanSource } from './site-plan.model';
2
+ import { GenerationTier, SitePlan, SitePlanSource } from './site-plan.model';
3
3
  import { SitePlanIssueCode } from './validate-site-plan';
4
4
  import { planSells } from './shop-plan';
5
5
 
@@ -168,6 +168,9 @@ export interface SiteBuildRun {
168
168
  source: SitePlanSource;
169
169
  plan: SitePlan;
170
170
  year: number;
171
+ /** AW-D23: the tier its generation was made at; absent = Basic (`tierOf`). Every later compose of `plan` in the browser
172
+ * (Design ▸ Look's Re-fit) is given it — an award plan composed as Basic is refused (iox-cms-client#66). */
173
+ tier?: `${GenerationTier}`;
171
174
  status: SiteBuildStatus;
172
175
  active?: boolean;
173
176
  steps: BuildStepRecord[];
@@ -1,7 +1,8 @@
1
1
  import type { DesignChoices } from '@vectoriox/iox-ui/design-core';
2
2
  import type { FrameSequence } from '@vectoriox/iox-ui/media-core';
3
3
  import type {
4
- AiGenerationStage, AiRefusalCode, AiStep, LayoutFingerprint, LayoutIssue, LayoutPhotoAddress, MeasuredLayout, PictureRefusal, PlanChange, PlanEdit, SitePlan,
4
+ AiGenerationStage, AiRefusalCode, AiStep, GenerationTier, LayoutFingerprint, LayoutIssue, LayoutPhotoAddress, MeasuredLayout, PictureRefusal, PlanChange, PlanEdit,
5
+ SitePlan,
5
6
  } from '@vectoriox/iox-ui/generation-core';
6
7
 
7
8
  import type { StyleRead } from './rank';
@@ -167,6 +168,10 @@ export interface AiGenerationView {
167
168
  lastChange?: { sentence: string; outcome: `${PlanChangeOutcome}`; message?: string; at: string };
168
169
  };
169
170
  siteBuildId?: string;
171
+ /** AW-D23: the tier the generation was made at (the studio's plan when it started) — what every compose of its plan
172
+ * in the browser (the render check, the map) is given. The server's stored value; a client never chooses it. Absent
173
+ * (a generation from before AW-P): Basic — `tierOf`. */
174
+ tier?: `${GenerationTier}`;
170
175
  models: Partial<Record<`${AiStep}`, string>>;
171
176
  estimate: number;
172
177
  /** The plan's `aiCreditsPerGeneration` for the whole build, or null when it sets none (a step's own ceiling is
@@ -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,6 @@
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';
2
4
 
3
5
  /**
4
6
  * The relay's wire (iox-control-plane `src/mail/`, its `openapi.json` tag `instances`). The studio calls back with its
@@ -85,9 +87,68 @@ export interface RelayUsage {
85
87
  month: RelayMonth;
86
88
  suppressions: number;
87
89
  marketingPaused: { at: string; reason: MarketingPauseReason | string } | null;
90
+ /** where the studio's owner changes its plan (the portal's studio page); absent/null = nowhere to send them */
91
+ upgradeUrl?: string | null;
88
92
  }
89
93
 
90
94
  export interface RelayResponse {
91
95
  results: RelayResult[];
92
96
  usage: RelayUsage;
93
97
  }
98
+
99
+ /** The mailer row's Reply-To (ML3-D1) — absent/blank = the relay's default, the studio's owner. */
100
+ export const MAILER_REPLY_TO_KEY = 'replyTo';
101
+
102
+ /**
103
+ * What the MAILER connector reports about itself (its E3 `details`), read by Settings ▸ Email, System Health and Home
104
+ * (iox-mail-plan ML3). Never a key. Own mode carries `mode` alone (plus what Mailjet's check found).
105
+ */
106
+ export interface MailerDetails {
107
+ mode: MailMode;
108
+ /** IOX mode only: `mailStandingOf(usage)` */
109
+ standing?: MailStanding;
110
+ senderState?: MailSenderState;
111
+ /** the transactional From — `<studio>@mail.iox.studio` */
112
+ from?: string | null;
113
+ /** the reminders' From — `<studio>@news.mail.iox.studio` */
114
+ marketingFrom?: string | null;
115
+ /** where replies go now: the row's `replyTo`, else the relay's default (the owner) */
116
+ replyTo?: string | null;
117
+ /** the row's own Reply-To, as typed — null when it uses the default */
118
+ replyToSet?: string | null;
119
+ quota?: number | null;
120
+ ceiling?: number | null;
121
+ periodStart?: string | null;
122
+ periodEnd?: string | null;
123
+ month?: RelayMonth | null;
124
+ suppressions?: number;
125
+ marketingPaused?: RelayUsage['marketingPaused'];
126
+ /** this studio's emails refused for good in the last seven days (the outbox's own count) */
127
+ notSentThisWeek?: number;
128
+ upgradeUrl?: string | null;
129
+ }
130
+
131
+ /** At most this many test emails an hour, per studio (ML3-D3) — each counts against the month like any email. */
132
+ export const MAIL_TEST_PER_HOUR = 5;
133
+
134
+ /** What became of a test email. */
135
+ export enum MailTestOutcome {
136
+ /** handed to IOX mail's relay or the studio's own Mailjet, which took it */
137
+ Sent = 'sent',
138
+ /** stored in IOX mail's outbox — the relay could not take it now; it goes when it can */
139
+ Queued = 'queued',
140
+ /** refused: no route, the relay's reason, Mailjet's words */
141
+ Refused = 'refused',
142
+ /** this hour's test emails are used */
143
+ Limited = 'limited',
144
+ }
145
+
146
+ /** `POST admin/api/org/:orgId/connectors/mailer/test-email` — the answer Settings ▸ Email shows in place. */
147
+ export interface MailTestAnswer {
148
+ outcome: MailTestOutcome;
149
+ /** the signed-in person's own address — the only one a test goes to */
150
+ to: string;
151
+ route: MailRoute;
152
+ /** the relay's reason, or Mailjet's words — never a stack */
153
+ detail: string | null;
154
+ }
@@ -2,10 +2,13 @@
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. It imports nothing.
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. It imports nothing.
6
8
  * ⚠️ Not re-exported from the main entry. Consumers wire the usual trio — ng-package raw-ts assets, jest
7
9
  * moduleNameMapper, tsconfig paths — or `nest start` dies with ERR_REQUIRE_ESM.
8
10
  */
9
11
  export * from './mail-vocabulary';
10
12
  export * from './mail-wire';
11
13
  export * from './mail-route';
14
+ export * from './mail-standing';
@@ -458,6 +458,16 @@ dialog[data-iox-dialog] {
458
458
  overscroll-behavior: contain;
459
459
  }
460
460
 
461
+ /* 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,
462
+ 26px on the canvas), and nothing else knew it was there — the consent banner's Reject and its heading ran under it.
463
+ The close side's padding is at least 48px (10 + 28 + a 10px gap), never less than the look's own; logical, so a
464
+ Hebrew dialog keeps the room on its left. A dialog with no ✕ (a navigation drawer closes from its own button) is
465
+ untouched. The engine's <dialog> and the canvas twin's surface, one rule. */
466
+ dialog[data-iox-dialog]:has(> .iox-dialog-close),
467
+ .dialog-surface:has(> .dialog-close) {
468
+ padding-inline-end: max(var(--iox-dialog-pad, 0px), 48px);
469
+ }
470
+
461
471
  /* A navigation's link lists (board 1): no underline at rest — the current page's link is the one
462
472
  underlined (the link's `current` state, link-current-decoration). Keyed on the list's ROLE, so a
463
473
  composed or adopted header and its drawer read it and no Link holds a literal over its element style.
@@ -1577,7 +1587,10 @@ html:has(.iox-bar-reserve) .iox-toasts[data-iox-edge='bottom'] { bottom: calc(16
1577
1587
  /* An empty bag: no count on the bag button; the drawer shows its "empty" words and nothing else of the bag. */
1578
1588
  .iox-role-shop-cart-button[data-iox-cart-empty] .iox-role-shop-cart-count { display: none !important; }
1579
1589
  .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-checkout, .iox-role-shop-cart-shipping-note) { display: none !important; }
1590
+ .iox-role-shop-cart-shipping-note) { display: none !important; }
1591
+ /* …and no Check out — unless this browser holds an unpaid order (client-engine#23): then Check out reads "Continue to
1592
+ payment" and goes back to the order (the shop runtime swaps its words). */
1593
+ .iox-role-shop-cart-drawer[data-iox-cart-empty]:not([data-iox-cart-waiting]) .iox-role-shop-checkout { display: none !important; }
1581
1594
  .iox-role-shop-cart-drawer:not([data-iox-cart-empty]) .iox-role-shop-cart-empty { display: none !important; }
1582
1595
  /* The bag button anchors its count to its corner (the count is positioned by its own node). */
1583
1596
  .iox-role-shop-cart-count { pointer-events: none; }