@vectoriox/iox-ui 5.152.0 → 5.154.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.
@@ -38,10 +38,35 @@ export enum AiStep {
38
38
  AssistEdit = 'assistEdit',
39
39
  /** AI Assist: photos read into content (≤ 6 a request, S3). */
40
40
  AssistRead = 'assistRead',
41
+ /**
42
+ * AI Assist, Files box ▸ Generate (S7, AI6): a picture the OWNER asked for. The SAME call as `MakePictures` — one
43
+ * generator — as a step of Assist's own, so the Assist feature alone allows it (Doron, 2026-11-24) and its ledger
44
+ * rows read as Assist's. It has no model row of its own: `AI_STEP_RUNS_AS`.
45
+ */
46
+ AssistPicture = 'assistPicture',
47
+ /** AI Assist, Files box ▸ Generate: the look at a made picture — the same call as `CheckPictures`. */
48
+ AssistPictureReview = 'assistPictureReview',
41
49
  }
42
50
 
43
51
  export const AI_STEPS: ReadonlyArray<AiStep> = Object.values(AiStep);
44
52
 
53
+ /**
54
+ * A step that is another step's CALL under a different feature and ledger name: it runs on that step's model (the
55
+ * studio's choice in Settings ▸ AI ▸ Models, the vetted list's `steps` / `recommendedFor`) and has no row of its own.
56
+ */
57
+ export const AI_STEP_RUNS_AS: Readonly<Partial<Record<AiStep, AiStep>>> = {
58
+ [AiStep.AssistPicture]: AiStep.MakePictures,
59
+ [AiStep.AssistPictureReview]: AiStep.CheckPictures,
60
+ };
61
+
62
+ /** The step whose model a step runs on — itself, unless it is another step's call (`AI_STEP_RUNS_AS`). */
63
+ export function aiModelStep(step: AiStep): AiStep {
64
+ return AI_STEP_RUNS_AS[step] ?? step;
65
+ }
66
+
67
+ /** The steps a model is CHOSEN for — the rows of Settings ▸ AI ▸ Models and of the vetted list. */
68
+ export const AI_MODEL_STEPS: ReadonlyArray<AiStep> = AI_STEPS.filter(step => !(step in AI_STEP_RUNS_AS));
69
+
45
70
  /** Each step's name on the wire (the control plane's `label`, the console) — the screens translate their own. */
46
71
  export const AI_STEP_LABELS: Readonly<Record<AiStep, string>> = {
47
72
  [AiStep.ReadMessage]: 'Read your message',
@@ -54,6 +79,8 @@ export const AI_STEP_LABELS: Readonly<Record<AiStep, string>> = {
54
79
  [AiStep.AssistRoute]: 'Understand your request',
55
80
  [AiStep.AssistEdit]: 'Make the change',
56
81
  [AiStep.AssistRead]: 'Read your photos',
82
+ [AiStep.AssistPicture]: 'Make a picture',
83
+ [AiStep.AssistPictureReview]: 'Check the picture',
57
84
  };
58
85
 
59
86
  /** What a model must be able to do for a step to run on it. */
@@ -74,6 +101,8 @@ export const AI_STEP_NEEDS: Readonly<Record<AiStep, ReadonlyArray<AiCapability>>
74
101
  [AiStep.AssistRoute]: [AiCapability.StructuredOutput],
75
102
  [AiStep.AssistEdit]: [AiCapability.StructuredOutput],
76
103
  [AiStep.AssistRead]: [AiCapability.StructuredOutput, AiCapability.ImageInput],
104
+ [AiStep.AssistPicture]: [AiCapability.ImageOutput],
105
+ [AiStep.AssistPictureReview]: [AiCapability.StructuredOutput, AiCapability.ImageInput],
77
106
  };
78
107
 
79
108
  /**
@@ -121,19 +150,22 @@ export const AI_PLAN_REASKED_PART: PlanPart = PlanPart.Pages;
121
150
  * Tokens a typical use of a step reads and writes (plan §3d "Where credits go") — what a shown estimate is made of. A
122
151
  * step asked in parts is every part's request together, so the estimate (and a generation's start gate) counts them all.
123
152
  */
153
+ // A 1 K picture is 1,120 image tokens (Google's figure for Nano Banana 2) — I-D4. In: the prompt, at most 700 tokens
154
+ // (the longest any site asks, its words in Hebrew — pictures.spec holds it). Out: the model's own text and thinking
155
+ // beside the picture — the live run of 2026-11-07 paid $0.0366–$0.0369 a picture at OpenRouter's $1.50 / $7.50 /
156
+ // $30 per million, ≈ 300 tokens of it; 600 are counted so the cost shown stays above what is charged.
157
+ const PICTURE_TOKENS: AiTokenCounts = { input: 700, output: 600, cacheWrite: 0, cacheRead: 0, imageOutput: 1_120 };
158
+ // M7: one picture downscaled to 512 px, the instructions, the slot's whole prompt and the format, and a short
159
+ // structured answer — the live run paid $0.00025–$0.0004 a review on Haiku 5.5 ($0.10 / $0.50): 3,600 in, 300 out
160
+ // keep the estimate above it.
161
+ const PICTURE_REVIEW_TOKENS: AiTokenCounts = { input: 3_600, output: 300, cacheWrite: 0, cacheRead: 0 };
162
+
124
163
  export const AI_STEP_TYPICAL_TOKENS: Readonly<Record<AiStep, AiTokenCounts>> = {
125
164
  [AiStep.ReadMessage]: { input: 8_800, output: 1_500, cacheWrite: 0, cacheRead: 0 },
126
165
  [AiStep.PlanSite]: addTokens(partsTotal(AiStep.PlanSite), AI_STEP_PART_TOKENS[AiStep.PlanSite]![AI_PLAN_REASKED_PART]),
127
166
  [AiStep.ChangePlan]: partsTotal(AiStep.ChangePlan),
128
- // A 1 K picture is 1,120 image tokens (Google's figure for Nano Banana 2) — I-D4. In: the prompt, at most 700 tokens
129
- // (the longest any site asks, its words in Hebrew — pictures.spec holds it). Out: the model's own text and thinking
130
- // beside the picture — the live run of 2026-11-07 paid $0.0366–$0.0369 a picture at OpenRouter's $1.50 / $7.50 /
131
- // $30 per million, ≈ 300 tokens of it; 600 are counted so the cost shown stays above what is charged.
132
- [AiStep.MakePictures]: { input: 700, output: 600, cacheWrite: 0, cacheRead: 0, imageOutput: 1_120 },
133
- // M7: one picture downscaled to 512 px, the instructions, the slot's whole prompt and the format, and a short
134
- // structured answer — the live run paid $0.00025–$0.0004 a review on Haiku 5.5 ($0.10 / $0.50): 3,600 in, 300 out
135
- // keep the estimate above it.
136
- [AiStep.CheckPictures]: { input: 3_600, output: 300, cacheWrite: 0, cacheRead: 0 },
167
+ [AiStep.MakePictures]: PICTURE_TOKENS,
168
+ [AiStep.CheckPictures]: PICTURE_REVIEW_TOKENS,
137
169
  [AiStep.NameStructures]: { input: 80_000, output: 10_000, cacheWrite: 0, cacheRead: 0 },
138
170
  // M8 gate 2: two composed pages, each with its one repair (`AI_COMPOSED_PAGES_ESTIMATED`). Measured on the live u2band
139
171
  // run (2026-11-16, Opus 5.5): Home 8.8k in / 8.7k out, its repair 9.4k / 3.9k, the next page 8.7k / 5.6k — ≈ 58 credits
@@ -146,6 +178,9 @@ export const AI_STEP_TYPICAL_TOKENS: Readonly<Record<AiStep, AiTokenCounts>> = {
146
178
  [AiStep.AssistRoute]: { input: 3_000, output: 300, cacheWrite: 0, cacheRead: 0 },
147
179
  [AiStep.AssistEdit]: { input: 8_000, output: 2_000, cacheWrite: 0, cacheRead: 0 },
148
180
  [AiStep.AssistRead]: { input: 12_000, output: 2_000, cacheWrite: 0, cacheRead: 0 },
181
+ // Files box ▸ Generate: the very calls of the two picture steps, so the very counts.
182
+ [AiStep.AssistPicture]: PICTURE_TOKENS,
183
+ [AiStep.AssistPictureReview]: PICTURE_REVIEW_TOKENS,
149
184
  };
150
185
 
151
186
  /** Tokens by the class a provider prices them in. */
@@ -337,6 +372,8 @@ export const AI_STEP_FEATURE: Readonly<Record<AiStep, AiFeature>> = {
337
372
  [AiStep.AssistRoute]: AiFeature.Assist,
338
373
  [AiStep.AssistEdit]: AiFeature.Assist,
339
374
  [AiStep.AssistRead]: AiFeature.Assist,
375
+ [AiStep.AssistPicture]: AiFeature.Assist,
376
+ [AiStep.AssistPictureReview]: AiFeature.Assist,
340
377
  };
341
378
 
342
379
  export enum AiLimit {
@@ -0,0 +1,142 @@
1
+ import { LayoutPage, LayoutSection, LayoutSectionKind } from './layout-language';
2
+ import { FingerprintedPage, fingerprintOf, LAYOUT_READY_MADE_TOKEN, LayoutFingerprint } from './layout-fingerprint';
3
+ import { footerMixOfPlan } from './footer-mix';
4
+ import { wornHeaderOfPlan } from './header-mix';
5
+ import { PatternNode, patternById, patternNeedsBinding, patternNodes, SITE_LIBRARY, SitePattern } from './patterns';
6
+ import { PagePlan, PageSectionPlan } from './site-plan.model';
7
+
8
+ /**
9
+ * A PAGE BUILT FROM ITS SECTIONS IN THE STUDIO'S MEMORY (vectoriox/iox-ui#119, option C — Doron, 2026-11-23). A composed
10
+ * page that falls back whole is stamped from the plan's ready-made sections, and four of six J10 Homes did — two hero
11
+ * patterns between them, so six businesses wore two skeletons while the memory held none of them (only a model's layout
12
+ * was fingerprinted). Here a fallen page is fingerprinted too, by the sections it is built from, and before it is built
13
+ * its opening is moved away from the ready-made openings the studio's other sites already wear, when another hero of the
14
+ * library can carry every word the plan wrote for it. The closed layout language only: free sections get no sameness
15
+ * gate (Doron). Pure.
16
+ */
17
+
18
+ /** A ready-made section's token in a fallen page's sequence: `ready-made:<pattern>`. A composed page's swapped section stays
19
+ * `ready-made` (its place in the model's order); a whole page of them is told apart by which sections they are. */
20
+ export function readyMadeToken(pattern: string): string {
21
+ return `${LAYOUT_READY_MADE_TOKEN}:${pattern}`;
22
+ }
23
+
24
+ /** The sections as the fingerprint reads them: a ready-made stub per place (as `fallBackBySection` writes one). */
25
+ function readyMadePage(sections: ReadonlyArray<Pick<PageSectionPlan, 'pattern'>>): LayoutPage {
26
+ return {
27
+ sections: sections.map((s, at): LayoutSection => ({
28
+ id: `ready-made-${at}`, kind: LayoutSectionKind.Content, screens: 1, rows: 1, layers: [], phone: [], readyMade: { at, pattern: s.pattern },
29
+ })),
30
+ } as LayoutPage;
31
+ }
32
+
33
+ /**
34
+ * A page built from its sections, as the studio remembers it: it opens on its first section's pattern
35
+ * (`ready-made:hero.split`), its sequence is its patterns in order, its signature holds the screen (a ready-made page has
36
+ * no signature section). The rest — ground, preset, header, footer — as `fingerprintOf`.
37
+ */
38
+ export function fallbackFingerprintOf(sections: ReadonlyArray<Pick<PageSectionPlan, 'pattern'>>, preset: string, mode: 'light' | 'dark', plan?: Parameters<typeof wornHeaderOfPlan>[0] & Parameters<typeof footerMixOfPlan>[0]): LayoutFingerprint {
39
+ const base = fingerprintOf(readyMadePage(sections), preset, mode, plan ? wornHeaderOfPlan(plan).mix : undefined, plan ? footerMixOfPlan(plan) : undefined);
40
+ return { ...base, sequence: sections.map(s => readyMadeToken(s.pattern)) };
41
+ }
42
+
43
+ /** A plan page built from its sections (it fell back whole, or was never asked) — the ONE call a reader of a plan makes. */
44
+ export function fallbackFingerprintOfPlanPage(page: Pick<PagePlan, 'sections'>, preset: string, mode: 'light' | 'dark', plan: Parameters<typeof wornHeaderOfPlan>[0] & Parameters<typeof footerMixOfPlan>[0]): LayoutFingerprint {
45
+ return fallbackFingerprintOf(page.sections, preset, mode, plan);
46
+ }
47
+
48
+ /** What a slot is, by the element style its node wears (`display`, `lead`, `button-primary`…), else its type. */
49
+ interface SlotKind {
50
+ slot: string;
51
+ kind: string;
52
+ /** It reads well left empty: it takes the business's own value, or it shows its own words and links nowhere. */
53
+ fillsItself: boolean;
54
+ }
55
+
56
+ function slotKinds(pattern: SitePattern): SlotKind[] {
57
+ const out = new Map<string, SlotKind>();
58
+ for (const n of patternNodes(pattern)) {
59
+ if (!n.slot || out.has(n.slot)) continue;
60
+ out.set(n.slot, { slot: n.slot, kind: n.es ?? n.t, fillsItself: fillsItself(n) });
61
+ }
62
+ return [...out.values()];
63
+ }
64
+
65
+ const fillsItself = (n: PatternNode): boolean => !!n.fromBusiness || (n.ph === undefined && n.href === undefined && n.text !== undefined);
66
+
67
+ const filled = (value: string | undefined): boolean => typeof value === 'string' && value.trim() !== '';
68
+
69
+ /** May the pattern stand in for another at a fallen page's opening — a plain section of the same family. */
70
+ function mayStandIn(id: string, family: string): boolean {
71
+ const p = patternById(id);
72
+ return !!p && p.family === family && !p.scene && !p.film && !p.shop && !p.global && !patternNeedsBinding(p);
73
+ }
74
+
75
+ /**
76
+ * The plan section moved onto `to`, every word and link it holds carried to `to`'s slot of the same kind — or null when
77
+ * one of them has nowhere to go, `to` would show a placeholder or a link to nowhere where the section said nothing, or the
78
+ * section holds what only its own pattern knows (a list, a form, parts left out).
79
+ */
80
+ export function carrySection(section: PageSectionPlan, to: string): PageSectionPlan | null {
81
+ const from = patternById(section.pattern);
82
+ const target = patternById(to);
83
+ if (!from || !target || section.binding || section.form || section.without?.length) return null;
84
+ const theirs = slotKinds(target);
85
+ const taken = new Set<string>();
86
+ const slots: Record<string, string> = {};
87
+ const links: Record<string, string> = {};
88
+ for (const mine of slotKinds(from)) {
89
+ const value = section.slots?.[mine.slot];
90
+ if (!filled(value)) continue;
91
+ const home = theirs.find(t => t.kind === mine.kind && !taken.has(t.slot));
92
+ if (!home) return null;
93
+ taken.add(home.slot);
94
+ slots[home.slot] = value!;
95
+ const link = section.links?.[mine.slot];
96
+ if (link) links[home.slot] = link;
97
+ }
98
+ if (theirs.some(t => !taken.has(t.slot) && !t.fillsItself)) return null;
99
+ return {
100
+ pattern: to,
101
+ ...(Object.keys(slots).length ? { slots } : {}),
102
+ ...(Object.keys(links).length ? { links } : {}),
103
+ ...(section.enter ? { enter: section.enter } : {}),
104
+ };
105
+ }
106
+
107
+ /** Why a fallen page's opening stayed as the plan wrote it. */
108
+ export enum FallbackOpeningKept {
109
+ /** No other site of the studio opens on it. */
110
+ Free = 'free',
111
+ /** Every hero that could carry the plan's words is already worn as another site's opening (or none can carry them). */
112
+ NoneFree = 'none-free',
113
+ }
114
+
115
+ export interface DistinctFallback {
116
+ sections: PageSectionPlan[];
117
+ /** Set when the opening moved: the pattern the plan wrote and the one it is built from now. */
118
+ moved?: { from: string; to: string };
119
+ /** Set when it did not move. */
120
+ kept?: `${FallbackOpeningKept}`;
121
+ }
122
+
123
+ /**
124
+ * A page about to be built from its sections, opened away from what the studio's other sites open on (option C). Only the
125
+ * opening moves — the first screen is what makes two sites read as one — and only to a library pattern of the same family
126
+ * that carries every word and link the plan wrote (`carrySection`), in the library's order. This site's own pages
127
+ * (`sameSite`) and the demos are never a reason: every page of a site may open alike, and a demo is not a site.
128
+ */
129
+ export function distinctFallbackSections(sections: ReadonlyArray<PageSectionPlan>, others: ReadonlyArray<FingerprintedPage>): DistinctFallback {
130
+ const all = [...sections];
131
+ const first = all[0];
132
+ const worn = new Set(others.filter(o => !o.sameSite && !o.demo).map(o => o.fingerprint.opening));
133
+ if (!first || !worn.has(readyMadeToken(first.pattern))) return { sections: all, kept: FallbackOpeningKept.Free };
134
+ const family = patternById(first.pattern)?.family;
135
+ if (!family) return { sections: all, kept: FallbackOpeningKept.NoneFree };
136
+ for (const { id } of SITE_LIBRARY) {
137
+ if (id === first.pattern || worn.has(readyMadeToken(id)) || !mayStandIn(id, family)) continue;
138
+ const moved = carrySection(first, id);
139
+ if (moved) return { sections: [moved, ...all.slice(1)], moved: { from: first.pattern, to: id } };
140
+ }
141
+ return { sections: all, kept: FallbackOpeningKept.NoneFree };
142
+ }
@@ -70,6 +70,7 @@ export * from './layout-space';
70
70
  export * from './list-space';
71
71
  export * from './list-panel';
72
72
  export * from './layout-fingerprint';
73
+ export * from './fallback-memory';
73
74
  export * from './header-mix';
74
75
  export * from './header-edit';
75
76
  export * from './opening-mix';
@@ -81,6 +81,13 @@ iox-gallery.iox-es-media[data-iox-empty] > .iox-gallery {
81
81
  .iox-role-scene-stage {
82
82
  container-type: size;
83
83
  }
84
+ /* A Scene never makes the page wider than the screen (vectoriox/iox-ui#126). Its stage clips what its layers move, but on
85
+ a phone the stage flows (`display: contents` — it draws no box), so its clip holds nothing and a deck's waiting cards (laid
86
+ out and turned, if unseen) or a screen-sized word widened a Hebrew page by 58px. The section clips sideways, as every
87
+ other composed section does; `clip` is never a scroll container, so the stage still pins (sticky) where it holds. */
88
+ .iox-role-scene {
89
+ overflow-x: clip;
90
+ }
84
91
 
85
92
  /* ── Card v2 (composite T23; complex-components board 8) ──────────────────────────────────────────
86
93
  The parts are ordinary nodes; `nodeDesignClasses` writes `iox-role-<role>` on each, so these rules are
@@ -1718,14 +1725,25 @@ span.iox-video__play { pointer-events: none; }
1718
1725
  :is(.iox-role-list-tilted-two, .iox-role-list-tilted-two > .repeater-wrapper) > .repeater-root { grid-template-columns: repeat(2, minmax(0, 1fr)); }
1719
1726
  }
1720
1727
  /* Two across on a phone, a tile is half the content column (147px at 390): its title steps down to the lead size, as a
1721
- bento's half tile does (#116) — at the heading's size a long word ran out of its card (CW2). */
1728
+ bento's half tile does (#116) — at the heading's size a long word ran out of its card (CW2).
1729
+ A product's price is one unbreakable line (the money pipe joins number and currency with a no-break space) at the price
1730
+ style's heading size, inside a card padded as a full-width one: at 320 a half tile kept 46px for its words, and the
1731
+ price ran 9px past its card at 390, 24 at 360, the ₪ cut by the card's clip (vectoriox/iox-ui#127). In a half tile a
1732
+ card that sells keeps half its padding (only it: a turned or colour-block card keeps its own), and the price is sized to the room it has — what is left of half the list (50cqi of the
1733
+ `iox-list` container, less half the gap and the card's two half paddings) over the ~5.2em an eleven-glyph price stands
1734
+ (`1,249.00 ₪`) — never above the lead size, never under the small one. */
1722
1735
  @container iox-list (max-width: 640px) {
1723
1736
  :is(.iox-role-list-grid-two, .iox-role-list-tilted-two, .iox-role-list-grid-two > .repeater-wrapper, .iox-role-list-tilted-two > .repeater-wrapper) > .repeater-root .iox-role-card-title { font-size: var(--iox-size-lead); }
1737
+ :is(.iox-role-list-grid-two, .iox-role-list-tilted-two, .iox-role-list-grid-two > .repeater-wrapper, .iox-role-list-tilted-two > .repeater-wrapper) > .repeater-root .iox-role-card:has(.iox-role-shop-price-amount) { padding: calc(var(--iox-card-pad) / 2); }
1738
+ :is(.iox-role-list-grid-two, .iox-role-list-tilted-two, .iox-role-list-grid-two > .repeater-wrapper, .iox-role-list-tilted-two > .repeater-wrapper) > .repeater-root .iox-role-shop-price-amount { font-size: clamp(var(--iox-size-small), calc((50cqi - var(--iox-space-gap) / 2 - var(--iox-card-pad)) * 0.19), var(--iox-size-lead)); }
1724
1739
  }
1725
1740
  @container iox-strips (max-width: 640px) {
1726
1741
  :is(.iox-role-list-strips-two, .iox-role-list-strips-two > .repeater-wrapper) > .repeater-root .iox-role-card-title { font-size: var(--iox-size-lead); }
1742
+ :is(.iox-role-list-strips-two, .iox-role-list-strips-two > .repeater-wrapper) > .repeater-root .iox-role-card:has(.iox-role-shop-price-amount) { padding: calc(var(--iox-card-pad) / 2); }
1743
+ :is(.iox-role-list-strips-two, .iox-role-list-strips-two > .repeater-wrapper) > .repeater-root .iox-role-shop-price-amount { font-size: clamp(var(--iox-size-small), calc((50cqi - var(--iox-space-gap) / 2 - var(--iox-card-pad)) * 0.19), var(--iox-size-lead)); }
1727
1744
  }
1728
1745
 
1746
+
1729
1747
  /* ITEM WORDS — what each item is, carried by the frame (`iox-list-item-<word>`). */
1730
1748
  /* Packshot: the thing on the look's plain tile (`list-tile`), whole (never cropped), grown 6% under a mouse. */
1731
1749
  .iox-list-item-packshot :is(.iox-role-card-media, .iox-role-list-item) { background: var(--iox-list-tile); aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--iox-card-radius); }