@vectoriox/iox-ui 5.200.0 → 5.202.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/design-core/index.d.ts +162 -5
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +216 -12
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2783 -1318
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +28 -12
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +85 -1
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +988 -245
- package/harness-core/index.d.ts +21 -13
- package/index.d.ts +50 -2
- package/package.json +1 -1
- package/src/design-core/brand-neutrals.ts +50 -7
- package/src/design-core/colour-words.ts +22 -5
- package/src/design-core/design-settings.ts +5 -0
- package/src/design-core/design-token.model.ts +3 -0
- package/src/design-core/flavor-fixtures.generated.ts +38 -2
- package/src/design-core/flavor-spec.generated.ts +143 -1
- package/src/design-core/flavor-tokens.ts +6 -2
- package/src/generation-core/check-free.ts +36 -16
- package/src/generation-core/colour-mix.ts +70 -14
- package/src/generation-core/compose-site.ts +145 -28
- package/src/generation-core/fallback-memory.ts +8 -5
- package/src/generation-core/footer-free.ts +439 -0
- package/src/generation-core/footer-mix.ts +130 -36
- package/src/generation-core/free-parts.ts +3 -0
- package/src/generation-core/free-slot-words.ts +3 -0
- package/src/generation-core/free-wire.ts +10 -2
- package/src/generation-core/header-mix.ts +128 -19
- package/src/generation-core/layout-fingerprint.ts +6 -4
- package/src/generation-core/opening-mix.ts +61 -0
- package/src/generation-core/plan-wire.ts +1 -0
- package/src/generation-core/public-api.ts +1 -0
- package/src/generation-core/redesign-run.ts +45 -2
- package/src/generation-core/site-plan.model.ts +6 -0
- package/src/generation-core/site-spec.generated.ts +599 -22
- package/src/generation-core/validate-site-plan.ts +39 -1
- package/src/harness-core/business-types.ts +3 -1
- package/src/harness-core/harness-spec.generated.ts +24 -12
- package/src/harness-core/run-compose-context.ts +8 -1
- package/styles/iox-design.css +7 -4
|
@@ -159,6 +159,9 @@ export enum FooterRole {
|
|
|
159
159
|
Before = 'footer.before',
|
|
160
160
|
/** AW12 newsletter: the sign-up block, the band and the closing — the forms-core `newsletter` preset beside its words. */
|
|
161
161
|
Newsletter = 'footer.newsletter',
|
|
162
|
+
/** FV2 (footer-v2 §4 rule 1): where a free footer placed the legal row — compose-site `legalRow` fills it (never a part:
|
|
163
|
+
* the slot only says where the ONE legal row goes). */
|
|
164
|
+
LegalPlace = 'footer.legal-place',
|
|
162
165
|
}
|
|
163
166
|
|
|
164
167
|
|
|
@@ -181,6 +184,8 @@ export class FooterMixError extends Error {}
|
|
|
181
184
|
const INGREDIENTS = F.ingredients as unknown as Readonly<Record<string, ReadonlyArray<string>>>;
|
|
182
185
|
const MEANINGS = F.meanings as Readonly<Record<string, string>>;
|
|
183
186
|
const MANY: ReadonlyArray<string> = F.many;
|
|
187
|
+
/** Every hold word of the table (a free footer's `holds` hint is filtered to these). */
|
|
188
|
+
const FOOTER_TABLE_HOLDS: ReadonlyArray<string> = F.ingredients.holds as unknown as ReadonlyArray<string>;
|
|
184
189
|
/** A word the product does not draw yet (award-ingredients-plan.md AW0): the phase it waits for and the built word it is
|
|
185
190
|
* drawn as meanwhile (null: drawn without it). */
|
|
186
191
|
export interface FooterWait { phase: string; drawnAs: string | null }
|
|
@@ -212,9 +217,11 @@ const partHolds = (holds: ReadonlyArray<string>): string[] => holds.filter(h =>
|
|
|
212
217
|
|
|
213
218
|
/** The words an ingredient may take — the DRAWN ones, the only ones the wire, the brief and the mender offer
|
|
214
219
|
* (ingredients.md §3.3: offering a waiting word would put its stand-in on every site that asked for it). The legal row
|
|
215
|
-
* is drawn on every footer, so it is never offered as a choice (`FOOTER_ROW_HOLDS`).
|
|
220
|
+
* is drawn on every footer, so it is never offered as a choice (`FOOTER_ROW_HOLDS`); FV2's `arrange.free` is the free
|
|
221
|
+
* request's footer (footer-free.ts), never a mix word. */
|
|
216
222
|
export function footerWords(ingredient: `${FooterIngredient}`): ReadonlyArray<string> {
|
|
217
|
-
return footerTableWords(ingredient).filter(w => !footerWait(ingredient, w) && !(ingredient === FooterIngredient.Holds && FOOTER_ROW_HOLDS.has(w))
|
|
223
|
+
return footerTableWords(ingredient).filter(w => !footerWait(ingredient, w) && !(ingredient === FooterIngredient.Holds && FOOTER_ROW_HOLDS.has(w))
|
|
224
|
+
&& !(ingredient === FooterIngredient.Arrange && w === FooterArrange.Free));
|
|
218
225
|
}
|
|
219
226
|
|
|
220
227
|
/** What a word means, as the brief and the builder say it. */
|
|
@@ -352,10 +359,13 @@ export function footerWordOffered(ingredient: `${FooterIngredient}`, word: strin
|
|
|
352
359
|
/** A footer token in words: `footer:columns/none/inverse` → "columns · none · inverse". */
|
|
353
360
|
export const footerTokenWords = (token: string): string => token.replace(`${FOOTER_TOKEN}:`, '').split('/').join(' · ');
|
|
354
361
|
|
|
355
|
-
/**
|
|
356
|
-
export
|
|
357
|
-
|
|
358
|
-
|
|
362
|
+
/** A reference footer's arrangement in the free footer's flat wire (FV2, FV-D6): its nodes, a key not written empty. */
|
|
363
|
+
export type FooterReferenceLayout = ReadonlyArray<Readonly<Record<string, unknown>>>;
|
|
364
|
+
|
|
365
|
+
/** Doron's reference footers, each as a whole mix — and, since FV2, its layout when it has one (footer-free.ts). */
|
|
366
|
+
export function footerReferences(): ReadonlyArray<{ id: string; after: string; added: string; mix: FooterMix; layout?: FooterReferenceLayout }> {
|
|
367
|
+
return (F.references as unknown as ReadonlyArray<{ id: string; after: string; added: string; mix: Partial<FooterMix>; layout?: FooterReferenceLayout }>)
|
|
368
|
+
.map(r => ({ id: r.id, after: r.after, added: r.added, mix: footerMix(r.mix), ...(r.layout ? { layout: r.layout } : {}) }));
|
|
359
369
|
}
|
|
360
370
|
|
|
361
371
|
// ── The check: any mix, judged and mended ──────────────────────────────────────────────────────────────────────────
|
|
@@ -409,6 +419,12 @@ export enum FooterRepairCode {
|
|
|
409
419
|
SignUpTwice = 'sign-up-twice',
|
|
410
420
|
/** AW12 newsletter: the sign-up first on a phone needs a sign-up block — none held: the blocks stack. */
|
|
411
421
|
FirstWithoutSignUp = 'first-without-sign-up',
|
|
422
|
+
/** FV2: `arrange:free` is a footer the model laid on the free request — a mix that names it with no laid footer is drawn
|
|
423
|
+
* as columns. */
|
|
424
|
+
FreeWithoutLayout = 'free-without-layout',
|
|
425
|
+
/** FV2 (FV-D12, R-H-FV3): a free footer that still broke a hard rule after its one repair — the nearest mix footer stands
|
|
426
|
+
* (`footerMixFromFree`), said "Composed for you". */
|
|
427
|
+
ComposedForYou = 'footer-composed-for-you',
|
|
412
428
|
}
|
|
413
429
|
|
|
414
430
|
export interface FooterRepair {
|
|
@@ -447,6 +463,9 @@ export interface FooterContext {
|
|
|
447
463
|
email?: string;
|
|
448
464
|
/** FV1b `holds.social`: the owner's social links as stated (the plan's `business.social`) — none, no social block. */
|
|
449
465
|
social?: ReadonlyArray<string>;
|
|
466
|
+
/** FV2 (rule 3): the owner's facts (the plan's `business.facts`) — given, a free footer's facts block shows only the lines
|
|
467
|
+
* the owner gave (none: the block is left out, said); absent, every line stands as the mix footer's does. */
|
|
468
|
+
facts?: Readonly<Partial<Record<string, string>>>;
|
|
450
469
|
/** The tier the site is built at. Since AW-D42 it mends no word (every tier wears every drawn word); kept so its
|
|
451
470
|
* callers still read. */
|
|
452
471
|
tier?: `${GenerationTier}`;
|
|
@@ -570,6 +589,41 @@ export const footerNameFits = (ctx: FooterContext): boolean => !overflowsPhone(n
|
|
|
570
589
|
const an = (word: string): string => `${/^[aeiou]/.test(word) ? 'an' : 'a'} ${word}`;
|
|
571
590
|
const capital = (said: string): string => said.charAt(0).toUpperCase() + said.slice(1);
|
|
572
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Why a closing cannot stand on this site, and what stands instead — the facts and the phone a closing needs: a statement
|
|
594
|
+
* is the owner's tagline (none, or too many lines on a phone: the call), the call word must stand on two lines at most
|
|
595
|
+
* (the call), the email is the owner's own address fitting a phone (none), the name must stand across a phone (none).
|
|
596
|
+
* Null: it stands. The mix judge (`checkFooter`) and the free footer (`footerPartNode`) ask this ONE rule. Pure.
|
|
597
|
+
*/
|
|
598
|
+
export function footerClosingRefusal(closing: string, ctx: FooterContext): { repair: FooterRepair; instead: string } | null {
|
|
599
|
+
const no = (code: FooterRepairCode, said: string, instead: string) => ({ repair: { code, said }, instead });
|
|
600
|
+
switch (closing) {
|
|
601
|
+
case FooterClosing.Statement: {
|
|
602
|
+
const tagline = ctx.tagline?.trim();
|
|
603
|
+
if (!tagline) return no(FooterRepairCode.StatementWithoutWords, 'a statement is the business\'s own line and it has none yet: the footer closes with a call', FooterClosing.Call);
|
|
604
|
+
if (statementPhoneLines(tagline, ctx) > rule('statementPhoneLines')) {
|
|
605
|
+
return no(FooterRepairCode.StatementTooLong, `"${tagline}" stands more than ${rule('statementPhoneLines')} lines on a phone: the footer closes with a call`, FooterClosing.Call);
|
|
606
|
+
}
|
|
607
|
+
return null;
|
|
608
|
+
}
|
|
609
|
+
case FooterClosing.Word:
|
|
610
|
+
return wordTooWide(footerCallWord(ctx.type, ctx.locale), ctx)
|
|
611
|
+
? no(FooterRepairCode.WordTooLong, `"${footerCallWord(ctx.type, ctx.locale)}" is too wide for a phone even on two lines: the footer closes with a call`, FooterClosing.Call)
|
|
612
|
+
: null;
|
|
613
|
+
case FooterClosing.Email: {
|
|
614
|
+
// FV1 (rule 3, footer-v2 §4): the address is the owner's fact, never made up and never a placeholder.
|
|
615
|
+
const email = ctx.email?.trim();
|
|
616
|
+
if (!email) return no(FooterRepairCode.EmailWithoutAddress, 'the email closing is the owner\'s own address and none was given: no closing', FooterClosing.None);
|
|
617
|
+
if (overflowsPhone(widthEm(email, ctx, 'link-display'), ctx)) return no(FooterRepairCode.EmailTooLong, `"${email}" does not fit a phone even at the smallest size: no closing`, FooterClosing.None);
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
case FooterClosing.Name:
|
|
621
|
+
return footerNameFits(ctx) ? null : no(FooterRepairCode.NameTooLong, `"${ctx.name}" is too long to stand across a phone: the footer closes with nothing`, FooterClosing.None);
|
|
622
|
+
default:
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
573
627
|
/**
|
|
574
628
|
* The ONE judge of a footer mix: what the table's rules refuse is mended to the nearest mix that keeps them, and each mend
|
|
575
629
|
* is said. Never throws on a well-formed mix. Pure.
|
|
@@ -596,40 +650,20 @@ export function checkFooter(given: FooterMix, ctx: FooterContext): { mix: Footer
|
|
|
596
650
|
say(FooterRepairCode.TypeNever, `this kind of business never stands its footer on ${an(ground)}: the dark band${why}`);
|
|
597
651
|
ground = FooterGround.Inverse;
|
|
598
652
|
}
|
|
653
|
+
if (arrange === FooterArrange.Free) {
|
|
654
|
+
say(FooterRepairCode.FreeWithoutLayout, 'a footer laid freely needs its layout and this one has none: drawn as columns');
|
|
655
|
+
arrange = FooterArrange.Columns;
|
|
656
|
+
}
|
|
599
657
|
if (arrange === FooterArrange.Line) {
|
|
600
658
|
const kept = holds.filter(h => (F.rules.lineHolds as ReadonlyArray<string>).includes(h) || BOTTOM_HOLDS.has(h));
|
|
601
659
|
const left = holds.filter(h => !kept.includes(h));
|
|
602
660
|
if (left.length) say(FooterRepairCode.LineHolds, `a one-line footer holds only ${F.rules.lineHolds.join(' and ')}: ${left.join(' and ')} left out`);
|
|
603
661
|
holds = kept;
|
|
604
662
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
closing = FooterClosing.Call;
|
|
610
|
-
} else if (statementPhoneLines(tagline, ctx) > rule('statementPhoneLines')) {
|
|
611
|
-
say(FooterRepairCode.StatementTooLong, `"${tagline}" stands more than ${rule('statementPhoneLines')} lines on a phone: the footer closes with a call`);
|
|
612
|
-
closing = FooterClosing.Call;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
if (closing === FooterClosing.Word && wordTooWide(footerCallWord(ctx.type, ctx.locale), ctx)) {
|
|
616
|
-
say(FooterRepairCode.WordTooLong, `"${footerCallWord(ctx.type, ctx.locale)}" is too wide for a phone even on two lines: the footer closes with a call`);
|
|
617
|
-
closing = FooterClosing.Call;
|
|
618
|
-
}
|
|
619
|
-
if (closing === FooterClosing.Email) {
|
|
620
|
-
// FV1 (rule 3, footer-v2 §4): the address is the owner's fact, never made up and never a placeholder.
|
|
621
|
-
const email = ctx.email?.trim();
|
|
622
|
-
if (!email) {
|
|
623
|
-
say(FooterRepairCode.EmailWithoutAddress, 'the email closing is the owner\'s own address and none was given: no closing');
|
|
624
|
-
closing = FooterClosing.None;
|
|
625
|
-
} else if (overflowsPhone(widthEm(email, ctx, 'link-display'), ctx)) {
|
|
626
|
-
say(FooterRepairCode.EmailTooLong, `"${email}" does not fit a phone even at the smallest size: no closing`);
|
|
627
|
-
closing = FooterClosing.None;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
if (closing === FooterClosing.Name && !footerNameFits(ctx)) {
|
|
631
|
-
say(FooterRepairCode.NameTooLong, `"${ctx.name}" is too long to stand across a phone: the footer closes with nothing`);
|
|
632
|
-
closing = FooterClosing.None;
|
|
663
|
+
const refused = footerClosingRefusal(closing, ctx);
|
|
664
|
+
if (refused) {
|
|
665
|
+
repairs.push(refused.repair);
|
|
666
|
+
closing = refused.instead;
|
|
633
667
|
}
|
|
634
668
|
if (closing === FooterClosing.NameAndAction) {
|
|
635
669
|
const left = holds.filter(h => !END_HOLDS.includes(h));
|
|
@@ -896,7 +930,7 @@ function endOf(mix: FooterMix, ctx: FooterContext): PatternNode[] {
|
|
|
896
930
|
}
|
|
897
931
|
|
|
898
932
|
/** What a ground draws as the footer's scheme (an inset card is the inverse band, shaped — `stampFooterMix`). */
|
|
899
|
-
const
|
|
933
|
+
export const FOOTER_GROUND_SCHEME: Readonly<Record<string, string | null>> = {
|
|
900
934
|
[FooterGround.Inverse]: 'inverse', [FooterGround.Subtle]: 'subtle', [FooterGround.Accent]: 'accent', [FooterGround.Plain]: null,
|
|
901
935
|
[FooterGround.Inset]: 'inverse',
|
|
902
936
|
// FV1: a framed footer stands on the page's own ground, in a ruled box (stampFooterMix + iox-design.css).
|
|
@@ -921,7 +955,7 @@ export function footerPattern(given: FooterMix, ctx: FooterContext): SitePattern
|
|
|
921
955
|
const c = [...(plain ? [part('rule')] : []), ...beforeBlock(mix, ctx), ...before, ...body, ...name];
|
|
922
956
|
// The contract's shell; a Section with one child does not stack it (the patterns' rule, build-spec "more than one child").
|
|
923
957
|
const { lay, ...shell } = part('section');
|
|
924
|
-
const scheme =
|
|
958
|
+
const scheme = FOOTER_GROUND_SCHEME[mix.ground] ?? null;
|
|
925
959
|
const node: PatternNode = { ...shell, ...(c.length > 1 && lay ? { lay } : {}), ...(scheme ? { scheme } : {}), c };
|
|
926
960
|
// A stored footer keeps its own name and intent (the composed root is labelled with it).
|
|
927
961
|
const stored = SITE_PATTERNS[footerPatternIdOf(mix) ?? ''];
|
|
@@ -934,6 +968,66 @@ export function footerPattern(given: FooterMix, ctx: FooterContext): SitePattern
|
|
|
934
968
|
};
|
|
935
969
|
}
|
|
936
970
|
|
|
971
|
+
// ── The parts one by one: what a free footer places (footer-free.ts) ────────────────────────────────────────────────
|
|
972
|
+
|
|
973
|
+
/** A part of the contract's `site.footerParts`, as it is (a fresh copy) — the free footer's shell, the © line. */
|
|
974
|
+
export const footerPart = (id: string): PatternNode => part(id);
|
|
975
|
+
|
|
976
|
+
/** How a free footer asks for one part (footer-free.ts reads the Slot's `opts` into this). */
|
|
977
|
+
export interface FooterPartAsk {
|
|
978
|
+
/** `closing.name`: how the name is worn (absent = plain). */
|
|
979
|
+
nameStyle?: string;
|
|
980
|
+
/** `holds.pages`: as one row of links (the line and centred footers' `pageRow`), not a labelled column. */
|
|
981
|
+
row?: boolean;
|
|
982
|
+
/** Centred through and through (every word node centred — a container's centring never reaches them). */
|
|
983
|
+
centred?: boolean;
|
|
984
|
+
/** The blocks the footer holds beside this one: how to reach the business leaves its city to the visit block. */
|
|
985
|
+
holds?: ReadonlyArray<string>;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/** A facts block's lines the owner never gave (rule 3): a `ph` line whose fact is missing, when the facts are given. */
|
|
989
|
+
const missingFact = (n: PatternNode, ctx: FooterContext): boolean => !!ctx.facts && !!n.ph && n.ph !== 'copy' && !String(ctx.facts[n.ph] ?? '').trim();
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* FV2 (footer-v2 §4): ONE part of the footer, as THE recipe makes it for the mix footer — the same brand block, columns,
|
|
993
|
+
* closings and facts — for a free footer to place where the model laid it. A part whose fact is missing, or that cannot
|
|
994
|
+
* stand on a phone, is left out with the reason (rule 3: never a placeholder in a live footer); the legal row is never a
|
|
995
|
+
* part (it is compose-site's, placed by `FooterRole.LegalPlace`), so `legal` makes no node. Pure.
|
|
996
|
+
*/
|
|
997
|
+
export function footerPartNode(id: string, ctx: FooterContext, ask: FooterPartAsk = {}): { node: PatternNode | null; leftOut?: FooterRepair } {
|
|
998
|
+
const centre = (node: PatternNode): PatternNode => (ask.centred ? centred(node) : node);
|
|
999
|
+
const out = (code: FooterRepairCode, said: string) => ({ node: null, leftOut: { code, said } });
|
|
1000
|
+
const closing = footerClosingRefusal(id, ctx);
|
|
1001
|
+
if (closing) return { node: null, leftOut: closing.repair };
|
|
1002
|
+
switch (id) {
|
|
1003
|
+
case 'brand': return { node: centre(brandPart(ctx)) };
|
|
1004
|
+
case FooterHold.Pages: return { node: ask.row ? laid(part('pageRow'), ask.centred ? { justifyContent: 'center' } : {}) : centre(part('pages')) };
|
|
1005
|
+
case FooterHold.Contact:
|
|
1006
|
+
case FooterHold.Visit: {
|
|
1007
|
+
const node = holdPart(id, footerMix({ holds: (ask.holds ?? []).filter(h => (FOOTER_TABLE_HOLDS as ReadonlyArray<string>).includes(h)) }), ctx);
|
|
1008
|
+
const kept = { ...node, c: (node.c ?? []).filter(n => !missingFact(n, ctx)) };
|
|
1009
|
+
if (!(kept.c ?? []).some(n => n.ph)) return out(FooterRepairCode.LeftOut, `the ${id} block shows the owner's own ${id === FooterHold.Visit ? 'address and hours' : 'email, phone and city'} and none was given: left out`);
|
|
1010
|
+
return { node: centre(kept) };
|
|
1011
|
+
}
|
|
1012
|
+
case FooterHold.Social:
|
|
1013
|
+
return footerSocialLinks(ctx.social).links.length ? { node: centre(socialPart(ctx)) } : out(FooterRepairCode.SocialWithoutLinks, 'the social block lists the owner\'s own links and none was stated: left out');
|
|
1014
|
+
case FooterHold.Top: return { node: part(FooterHold.Top) };
|
|
1015
|
+
// AW12 newsletter: the sign-up block — only with a reason to write (AW12-D6), else left out, said.
|
|
1016
|
+
case FooterHold.Newsletter:
|
|
1017
|
+
return ctx.writes === false
|
|
1018
|
+
? out(FooterRepairCode.NoReasonToWrite, 'a sign-up asks people to hear from the business, and this site has nothing to write about yet (no journal, events or shop): left out')
|
|
1019
|
+
: { node: centre(part(FooterHold.Newsletter)) };
|
|
1020
|
+
case FooterClosing.Call: return { node: ask.centred ? centred(callPart(ctx)) : callPart(ctx) };
|
|
1021
|
+
case FooterClosing.Name: return { node: closingName(ctx, footerMix({ closing: FooterClosing.Name, ...(ask.nameStyle ? { nameStyle: ask.nameStyle } : {}) })) };
|
|
1022
|
+
case FooterClosing.Statement: return { node: centre(part('statement')) };
|
|
1023
|
+
case FooterClosing.Word: return { node: callWord(ctx) };
|
|
1024
|
+
case FooterClosing.Email: return { node: emailLine(ctx.email!.trim(), ctx) };
|
|
1025
|
+
case FooterBefore.ContactForm: return { node: beforeBlock(footerMix({ before: FooterBefore.ContactForm }), ctx)[0] };
|
|
1026
|
+
case 'copyright': return { node: ask.centred ? laid(part('copyright'), { textAlign: 'center' }) : part('copyright') };
|
|
1027
|
+
default: return { node: null };
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
|
|
937
1031
|
/** The margin an inset footer stands at (AW12-D11): a card's padding outside the column, never closer than half the gutter
|
|
938
1032
|
* to the window; its words pad back onto the column (both resolve against the page). */
|
|
939
1033
|
export const FOOTER_INSET_STYLES: Readonly<Record<string, string>> = {
|
|
@@ -7,6 +7,7 @@ import { PatternRecipe } from './patterns';
|
|
|
7
7
|
import { recipeListBinds } from './recipe-fields';
|
|
8
8
|
import { SitePlan } from './site-plan.model';
|
|
9
9
|
import { FREE_OPEN_LIGHTBOX, FREE_SLOT_SEPARATOR, FreeSlotKind, freeSlotWord } from './free-slot-words';
|
|
10
|
+
import { freeFooterPartMeaning } from './footer-free';
|
|
10
11
|
|
|
11
12
|
export * from './free-slot-words';
|
|
12
13
|
|
|
@@ -78,6 +79,8 @@ const SLOT_MEANING: Readonly<Record<FreeSlotKind, (ref: string) => string>> = {
|
|
|
78
79
|
[FreeSlotKind.Accordion]: ref => `the ${ref} list as an accordion — each item a question that opens its answer`,
|
|
79
80
|
[FreeSlotKind.Tabs]: ref => `the ${ref} list as tabs — one item shown at a time`,
|
|
80
81
|
[FreeSlotKind.Quotes]: ref => `the ${ref} list as a testimonial carousel — the owner's real quotes, one at a time`,
|
|
82
|
+
// FV2: a part of the footer, placed only in the free footer section (footer-free.ts).
|
|
83
|
+
[FreeSlotKind.Footer]: ref => `the footer's ${freeFooterPartMeaning(ref)}`,
|
|
81
84
|
};
|
|
82
85
|
|
|
83
86
|
/** One line of the free brief for an offered part: its slot word, what it places, and its options. */
|
|
@@ -9,6 +9,9 @@ export enum FreeSlotKind {
|
|
|
9
9
|
Accordion = 'accordion',
|
|
10
10
|
Tabs = 'tabs',
|
|
11
11
|
Quotes = 'quotes',
|
|
12
|
+
/** FV2 (footer-v2 §4): a part of the site's footer (`footer:brand`, `footer:legal` — where the legal row goes), placed in
|
|
13
|
+
* a free footer only (`footer-free.ts`). */
|
|
14
|
+
Footer = 'footer',
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
/** The separator between a slot's kind and what it names (`list:projects`). */
|
|
@@ -47,6 +47,12 @@ export enum FreePurpose {
|
|
|
47
47
|
Process = 'process',
|
|
48
48
|
Contact = 'contact',
|
|
49
49
|
Closing = 'closing',
|
|
50
|
+
/**
|
|
51
|
+
* FV2 (footer-v2 §4): the site's footer, laid freely from the FOOTER parts — the LAST section of a free request that asks
|
|
52
|
+
* for it, split off before the page is judged (`splitFreeFooter`) and judged by itself (`checkFreeFooter`). It holds only
|
|
53
|
+
* Containers and `footer:<part>` Slots, and says its ground as `opts: ['ground:<word>']`.
|
|
54
|
+
*/
|
|
55
|
+
Footer = 'footer',
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
/**
|
|
@@ -152,9 +158,9 @@ export interface FreeNode {
|
|
|
152
158
|
src?: string;
|
|
153
159
|
/** A Button: a page route of the site, or `#<section id>`. */
|
|
154
160
|
href?: string;
|
|
155
|
-
/** A Slot: what stands here (`list:<alias>`, `form:<preset>`). */
|
|
161
|
+
/** A Slot: what stands here (`list:<alias>`, `form:<preset>`, a free footer's `footer:<part>`). */
|
|
156
162
|
slot?: string;
|
|
157
|
-
/** A Slot's options (a list's mix words, `arrange:grid`). */
|
|
163
|
+
/** A Slot's options (a list's mix words, `arrange:grid`); a free footer Section's ground (`ground:inverse`, FV2). */
|
|
158
164
|
opts?: string[];
|
|
159
165
|
styleProps: FreeStyle;
|
|
160
166
|
responsive?: Partial<Record<FreeLayer, FreeStyle>>;
|
|
@@ -339,6 +345,8 @@ export function expandFreeWire(wire: unknown): ExpandedFreeWire {
|
|
|
339
345
|
node.slot = str(raw['slot']);
|
|
340
346
|
node.opts = list(raw['opts']);
|
|
341
347
|
}
|
|
348
|
+
// FV2: a footer Section says its ground as a word (`ground:inverse`), never as a painted colour.
|
|
349
|
+
if (type === FreeNodeType.Section && node.purpose === FreePurpose.Footer && list(raw['opts']).length) node.opts = list(raw['opts']);
|
|
342
350
|
const responsive: Partial<Record<FreeLayer, FreeStyle>> = {};
|
|
343
351
|
for (const [key, layer] of [['phone', FreeLayer.Phone], ['tablet', FreeLayer.Tablet]] as const) {
|
|
344
352
|
const style = styleOf(raw[key], `${at}.${key}`, faults);
|
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
} from '@vectoriox/iox-ui/design-core';
|
|
5
5
|
|
|
6
6
|
import { menuCollectionsOfPlan, ShelfPlan } from './menu-shelves';
|
|
7
|
-
import { MenuSide, NavRole, NavShape } from './nav-shape';
|
|
7
|
+
import { BAR_ITEMS_MAX, MenuSide, NavRole, NavShape } from './nav-shape';
|
|
8
8
|
import { OpeningMixError, openingMixOfPlan, OpeningRole } from './opening-mix';
|
|
9
9
|
import { calmUnder, PhotoInventory } from './photo-inventory';
|
|
10
10
|
import { PatternGlobalPosition, PatternNode, SITE_PATTERNS, SitePattern } from './patterns';
|
|
11
11
|
import { planSells, ShopSourceRole, shopSourceAliases } from './shop-plan';
|
|
12
|
+
import { GenerationTier } from './site-plan.model';
|
|
12
13
|
import { SPEC_SITE_HEADER_PARTS, SPEC_SITE_LAYOUT } from './site-spec.generated';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -296,6 +297,14 @@ export enum HeaderRepairCode {
|
|
|
296
297
|
NoLogo = 'no-logo',
|
|
297
298
|
/** HI3-D25: a kind of business that keeps its header plain never takes islands or a late name. */
|
|
298
299
|
TypeNeverShape = 'type-never-shape',
|
|
300
|
+
/** HI-D Pro (Doron 2026-11-29): a Pro site's header floats — a pill or islands on the look's glass (`proHeader`). */
|
|
301
|
+
ProFloats = 'pro-floats',
|
|
302
|
+
/** HI-D Pro: a Pro site's phone has the bottom bar (`both` — the bar and a More — when its pages outnumber the bar). */
|
|
303
|
+
ProPhoneBar = 'pro-phone-bar',
|
|
304
|
+
/** HI-D Pro: a Pro site keeps the drawer on a phone only for a stated reason (a shelf menu, pages too many for the bar). */
|
|
305
|
+
ProPhoneMenu = 'pro-phone-menu',
|
|
306
|
+
/** HI-D Pro: a floating header carries one button where the site has a contact page to send it to. */
|
|
307
|
+
ProButton = 'pro-button',
|
|
299
308
|
/** HI2: pictured cards stand in a top panel, a full screen or a mega panel — never a drawer or a card: the page names. */
|
|
300
309
|
PicturesForm = 'pictures-form',
|
|
301
310
|
/** HI2: pictured cards need the site's main collections with pictures (`menuPicturesMin`): the page names. */
|
|
@@ -350,6 +359,9 @@ export interface HeaderContext {
|
|
|
350
359
|
/** HI2: the site's main collections with pictures (`menuCollectionsOfPlan`), in the navigation's order — what a
|
|
351
360
|
* `pictures` menu shows a card for. Absent: not judged. */
|
|
352
361
|
readonly collections?: ReadonlyArray<HeaderPage>;
|
|
362
|
+
/** HI-D Pro (Doron 2026-11-29): the generation's tier. On Pro (`award`) a floating header stands on any home — HI3-D25's
|
|
363
|
+
* "only over a full picture" is the Basic generator's rule. Absent: Basic. */
|
|
364
|
+
readonly tier?: `${GenerationTier}` | null;
|
|
353
365
|
}
|
|
354
366
|
|
|
355
367
|
const RULES = H.rules as unknown as Readonly<{
|
|
@@ -434,10 +446,13 @@ function mendShape(m: HeaderMix, ctx: HeaderContext, say: (code: HeaderRepairCod
|
|
|
434
446
|
if (m.brand === HeaderBrand.Later) m.brand = HeaderBrand.Fits;
|
|
435
447
|
say(HeaderRepairCode.TypeNeverShape, 'this kind of business keeps its header plain: one bar, the name always in it');
|
|
436
448
|
}
|
|
437
|
-
|
|
438
|
-
|
|
449
|
+
// HI-D Pro: on Pro a floating header needs no picture under it (it always stands on its ground, R-H-S1); a late name does.
|
|
450
|
+
const floatNeedsPicture = floats() && ctx.tier !== GenerationTier.Award;
|
|
451
|
+
if ((floatNeedsPicture || m.brand === HeaderBrand.Later) && ctx.opening !== undefined && !opensOnPicture(ctx.opening)) {
|
|
452
|
+
if (floatNeedsPicture) m.shape = HeaderShape.Bar;
|
|
439
453
|
if (m.brand === HeaderBrand.Later) m.brand = HeaderBrand.Fits;
|
|
440
|
-
say(HeaderRepairCode.FloatPlain, 'the home page does not open on a full picture: the header is a bar, its name in it from the top'
|
|
454
|
+
say(HeaderRepairCode.FloatPlain, floatNeedsPicture ? 'the home page does not open on a full picture: the header is a bar, its name in it from the top'
|
|
455
|
+
: 'the home page does not open on a full picture: the name is in the bar from the top');
|
|
441
456
|
}
|
|
442
457
|
if (m.shape === HeaderShape.Islands && (m.arrange === HeaderArrange.Centred || m.arrange === HeaderArrange.Between)) {
|
|
443
458
|
m.shape = HeaderShape.Pill;
|
|
@@ -475,6 +490,58 @@ export function opensOnPicture(opening: HeaderOpening | null | undefined): boole
|
|
|
475
490
|
return !!opening && RULES.overFrames.includes(opening.frame) && RULES.overMedia.includes(opening.media);
|
|
476
491
|
}
|
|
477
492
|
|
|
493
|
+
// ── HI-D Pro: a Pro site's header floats, and its phone has the bottom bar ──────────────────────────────────────────────
|
|
494
|
+
|
|
495
|
+
const CONTACT_ROUTE = '/contact';
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* HI-D Pro (Doron, 2026-11-29: "solid header is not for PRO, the floating header with the nice design shall be almost part
|
|
499
|
+
* of every generated pro site" + "I didn't see yet bottom bar navigation on mobile"). A Pro site's header, from its plan's
|
|
500
|
+
* mix (or its stored header), made into a FLOATING one at compose time — so a rebuild from a kept plan wears it, no model
|
|
501
|
+
* call:
|
|
502
|
+
* - the outline: a full-width bar becomes islands where the name stands at the start (split, name-and-menu — daylight's
|
|
503
|
+
* logo tile + pill) and one pill where it is centred (allerstudio's floating pill); a chosen pill or islands is kept;
|
|
504
|
+
* `checkHeader` then makes islands a pill for a kind of business that keeps its header plain (HI3-D18/D25);
|
|
505
|
+
* - the ground: the look's glass (its own outlined bar in Pop, HI3-D2), no scroll edge (HI3-D20) — over a picture opening
|
|
506
|
+
* it gives its height back, so the picture starts at the top of the page (HI3-D7/D17);
|
|
507
|
+
* - one button where the site has a contact page to send it to;
|
|
508
|
+
* - the phone: the BOTTOM BAR — its pages come out of the menu into the bar when they fit on a laptop, the bar holds Home
|
|
509
|
+
* and up to four pages (`bar`) or four and a More (`both`). The drawer alone stays only with its reason said: the menu
|
|
510
|
+
* is a shelf (pictures, big names, words and a card — HI2), or the pages are too many for the bar on a laptop.
|
|
511
|
+
* Each change is said. The Basic tier never asks it (its bar stays the full-width solid one). Pure.
|
|
512
|
+
*/
|
|
513
|
+
export function proHeader(mix: HeaderMix, ctx: HeaderContext): { mix: HeaderMix; repairs: HeaderRepair[] } {
|
|
514
|
+
const m = { ...mix };
|
|
515
|
+
const repairs: HeaderRepair[] = [];
|
|
516
|
+
const say = (code: HeaderRepairCode, said: string) => repairs.push({ code, said });
|
|
517
|
+
if (!headerShapeFloats(m.shape)) {
|
|
518
|
+
m.shape = m.arrange === HeaderArrange.Split || m.arrange === HeaderArrange.NameOnly ? HeaderShape.Islands : HeaderShape.Pill;
|
|
519
|
+
if (m.ground === HeaderGround.Solid) m.ground = lookHasGlass(ctx.design) ? HeaderGround.Glass : HeaderGround.Solid;
|
|
520
|
+
m.edge = 'none';
|
|
521
|
+
say(HeaderRepairCode.ProFloats, `a Pro site's header floats: ${m.shape === HeaderShape.Islands ? 'its parts as islands' : 'one pill'} on the look's ${lookHasGlass(ctx.design) ? 'glass' : 'own bar'}`);
|
|
522
|
+
}
|
|
523
|
+
if (m.action === HeaderAction.None && ctx.pages.some(p => p.route === CONTACT_ROUTE)) {
|
|
524
|
+
m.action = HeaderAction.Button;
|
|
525
|
+
say(HeaderRepairCode.ProButton, 'a floating header carries one button, to the contact page');
|
|
526
|
+
}
|
|
527
|
+
if (behindMenu(m) && menuShowsOf(m.menuShows) !== MenuShows.Links) {
|
|
528
|
+
say(HeaderRepairCode.ProPhoneMenu, 'the menu is a shelf: the phone opens it from the menu button');
|
|
529
|
+
return { mix: m, repairs };
|
|
530
|
+
}
|
|
531
|
+
if (behindMenu(m)) {
|
|
532
|
+
const inline = { ...m, pages: HeaderPages.Inline, arrange: m.arrange === HeaderArrange.NameOnly ? HeaderArrange.Split : m.arrange };
|
|
533
|
+
if (barWidthPx(inline, ctx) > RULES.inlineRoomPx) {
|
|
534
|
+
say(HeaderRepairCode.ProPhoneMenu, `${ctx.pages.length} pages do not fit in the bar on a laptop: the phone opens them from the menu`);
|
|
535
|
+
return { mix: m, repairs };
|
|
536
|
+
}
|
|
537
|
+
Object.assign(m, { pages: inline.pages, arrange: inline.arrange });
|
|
538
|
+
}
|
|
539
|
+
// Home and the pages: a bar holds them all, or four and a More (nav-shape BAR_ITEMS_MAX).
|
|
540
|
+
m.phone = ctx.pages.length + 1 <= BAR_ITEMS_MAX ? 'bar' : 'both';
|
|
541
|
+
say(HeaderRepairCode.ProPhoneBar, m.phone === 'bar' ? 'on a phone the pages stand in the bottom bar' : 'on a phone the bottom bar holds four pages and a More');
|
|
542
|
+
return { mix: m, repairs };
|
|
543
|
+
}
|
|
544
|
+
|
|
478
545
|
/** HI3-D5: what an over header stands on when its words do not read over the opening — the look's glass from the top,
|
|
479
546
|
* or its own solid bar in a look with no glass (Pop). The ONE answer `checkHeader` and a build's late mend share. */
|
|
480
547
|
export function headerGroundWhenUnreadable(design: Pick<DesignChoices, 'flavorId'>): HeaderGround {
|
|
@@ -766,14 +833,42 @@ export function headerRecipe(mix: HeaderMix, ctx: HeaderContext): HeaderRecipe {
|
|
|
766
833
|
// ── No sameness: another site's header is never worn again (§7, R-H2) ──────────────────────────────────────────────
|
|
767
834
|
|
|
768
835
|
/** The ingredients `distinctHeader` may change, in the order it tries them: how the pages are reached before where the
|
|
769
|
-
* name sits (the model chose the arrangement; the fingerprint sees both)
|
|
770
|
-
|
|
836
|
+
* name sits (the model chose the arrangement; the fingerprint sees both), then the bar's outline, its ground and its menu
|
|
837
|
+
* (the J10 header proof, 2026-11-29: with only those two before the menu's opening and button, seven of twelve sites came
|
|
838
|
+
* out the same bar at rest, "distinct" by a reveal nobody sees until the menu opens). */
|
|
839
|
+
const MEND_ORDER: ReadonlyArray<HeaderIngredient.Pages | HeaderIngredient.Arrange | HeaderIngredient.Shape | HeaderIngredient.Ground
|
|
840
|
+
| HeaderIngredient.Menu | HeaderIngredient.Reveal | HeaderIngredient.Button> = [
|
|
771
841
|
HeaderIngredient.Pages, HeaderIngredient.Arrange,
|
|
772
|
-
//
|
|
773
|
-
//
|
|
842
|
+
// What a visitor sees at rest or on the first tap: the outline (bar · pill · islands), the ground (over the opening,
|
|
843
|
+
// glass) and the menu's form (a full screen, a top panel, a card — a shelf). Each is judged by `checkHeader` as any
|
|
844
|
+
// other: a float only over a full picture, a ground the kind of business allows, glass only in a look that has it.
|
|
845
|
+
HeaderIngredient.Shape, HeaderIngredient.Ground, HeaderIngredient.Menu,
|
|
846
|
+
// HB-D6: how the menu opens and its button are in the fingerprint — the least visible change of all, tried last.
|
|
774
847
|
HeaderIngredient.Reveal, HeaderIngredient.Button,
|
|
775
848
|
];
|
|
776
849
|
|
|
850
|
+
/** The fingerprint's ingredients a visitor sees only once the menu opens — two headers that differ in these alone are the
|
|
851
|
+
* same header at rest. */
|
|
852
|
+
const UNSEEN_AT_REST: ReadonlySet<string> = new Set([HeaderIngredient.Reveal, HeaderIngredient.Button]);
|
|
853
|
+
|
|
854
|
+
/** A header token without what is unseen at rest: `header:centred/menu/drawer/solid/bar/none` for every reveal and
|
|
855
|
+
* button — and with its pages in the bar, no menu either (the menu's form is never seen on a laptop). */
|
|
856
|
+
export function headerRestTokenOf(mix: HeaderMix): string {
|
|
857
|
+
return restOfToken(headerTokenOf(mix));
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/** A token read back at rest (`headerRestTokenOf` on a taken token). */
|
|
861
|
+
function restOfToken(token: string): string {
|
|
862
|
+
const keys = H.fingerprint as ReadonlyArray<string>;
|
|
863
|
+
const words = token.replace(`${HEADER_TOKEN}:`, '').split('/');
|
|
864
|
+
const inline = words[keys.indexOf(HeaderIngredient.Pages)] === HeaderPages.Inline;
|
|
865
|
+
return `${HEADER_TOKEN}:${words.map((w, i) => (inline && keys[i] === HeaderIngredient.Menu ? '-' : w)).filter((_, i) => !UNSEEN_AT_REST.has(keys[i])).join('/')}`;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/** What a mend may bring with it and still be the mend it was: a floating or glass header draws no edge under it, and a
|
|
869
|
+
* look whose own bar is glass stands on glass — consequences of the outline or ground chosen, said by `checkHeader`. */
|
|
870
|
+
const MEND_CONSEQUENCES: ReadonlySet<string> = new Set([HeaderRepairCode.FloatEdge, HeaderRepairCode.GlassEdge, HeaderRepairCode.GlassOwnBar]);
|
|
871
|
+
|
|
777
872
|
/** The words of an ingredient the product draws. */
|
|
778
873
|
const drawnWords = (k: `${HeaderIngredient}`): string[] => headerWords(k).filter(w => !WAITS[`${k}.${w}`]);
|
|
779
874
|
|
|
@@ -782,18 +877,22 @@ const drawnWords = (k: `${HeaderIngredient}`): string[] => headerWords(k).filter
|
|
|
782
877
|
* ingredient before two, in `MEND_ORDER` — that the site can carry as it is (`checkHeader` mends nothing), and said. When
|
|
783
878
|
* every header is worn, the mix as it is. Pure, deterministic.
|
|
784
879
|
*/
|
|
785
|
-
export function distinctHeader(mix: HeaderMix, taken: ReadonlyArray<string>, ctx: HeaderContext
|
|
880
|
+
export function distinctHeader(mix: HeaderMix, taken: ReadonlyArray<string>, ctx: HeaderContext,
|
|
881
|
+
accept: (m: HeaderMix) => boolean = () => true): { mix: HeaderMix; repairs: HeaderRepair[] } {
|
|
786
882
|
const used = new Set(taken);
|
|
787
|
-
|
|
883
|
+
const usedAtRest = new Set(taken.map(restOfToken));
|
|
884
|
+
const free = (m: HeaderMix) => !used.has(headerTokenOf(m));
|
|
885
|
+
const freeAtRest = (m: HeaderMix) => free(m) && !usedAtRest.has(headerRestTokenOf(m));
|
|
886
|
+
if (freeAtRest(mix)) return { mix, repairs: [] };
|
|
788
887
|
const tries: HeaderMix[] = [];
|
|
789
888
|
for (const k of MEND_ORDER) for (const w of drawnWords(k)) tries.push({ ...mix, [k]: w });
|
|
790
889
|
for (const w of drawnWords(HeaderIngredient.Pages)) for (const a of drawnWords(HeaderIngredient.Arrange)) tries.push({ ...mix, pages: w, arrange: a });
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
}
|
|
796
|
-
return { mix, repairs: [] };
|
|
890
|
+
const carried = tries.map(t => checkHeader(t, ctx)).filter(c => c.repairs.every(r => MEND_CONSEQUENCES.has(r.code)) && accept(c.mix)).map(c => c.mix);
|
|
891
|
+
// A header no other site wears AT REST first; when every such one is taken (or the site carries none), one that differs
|
|
892
|
+
// at least in how its menu opens — and a mix already free that way stays as the model chose it.
|
|
893
|
+
const found = carried.find(freeAtRest) ?? (free(mix) ? null : carried.find(free));
|
|
894
|
+
if (!found) return { mix, repairs: [] };
|
|
895
|
+
return { mix: found, repairs: [{ code: HeaderRepairCode.Worn, said: `another site wears ${headerTokenWords(headerTokenOf(mix))}: this one is ${headerTokenWords(headerTokenOf(found))}` }] };
|
|
797
896
|
}
|
|
798
897
|
|
|
799
898
|
type HeaderPlan = ShelfPlan & {
|
|
@@ -814,6 +913,8 @@ export function shopPageOfPlan(plan: HeaderPlan): string | null {
|
|
|
814
913
|
export interface HeaderFacts {
|
|
815
914
|
readonly never?: HeaderNever | null;
|
|
816
915
|
readonly readableAtRest?: boolean | null;
|
|
916
|
+
/** HI-D Pro: the generation's tier (the compose context's) — a Pro site's header floats (`proHeader`). Absent: Basic. */
|
|
917
|
+
readonly tier?: `${GenerationTier}` | null;
|
|
817
918
|
}
|
|
818
919
|
|
|
819
920
|
/** HI3-D12: the plan's home opening as the header reads it — null when the plan names none (or one the table lacks). */
|
|
@@ -839,6 +940,7 @@ export function headerContextOfPlan(plan: HeaderPlan, shop?: string | null, fact
|
|
|
839
940
|
collections: menuCollectionsOfPlan(plan).map(c => ({ name: c.label, route: c.route })),
|
|
840
941
|
...(facts.never ? { never: facts.never } : {}),
|
|
841
942
|
...(facts.readableAtRest !== undefined && facts.readableAtRest !== null ? { readableAtRest: facts.readableAtRest } : {}),
|
|
943
|
+
...(facts.tier ? { tier: facts.tier } : {}),
|
|
842
944
|
};
|
|
843
945
|
}
|
|
844
946
|
|
|
@@ -851,8 +953,11 @@ export function wornHeaderOfPlan(plan: HeaderPlan & { readonly globals?: Readonl
|
|
|
851
953
|
facts: HeaderFacts = {}): { mix: HeaderMix; context: HeaderContext; said: string[] } {
|
|
852
954
|
const context = headerContextOfPlan(plan, undefined, facts);
|
|
853
955
|
const { drawn, gaps } = drawnHeaderMix(headerMixOfPlan(plan));
|
|
854
|
-
|
|
855
|
-
const
|
|
956
|
+
// HI-D Pro: a Pro site's header is a floating mix with the phone's bottom bar — its plan's mix (or stored header) made so.
|
|
957
|
+
const pro = context.tier === GenerationTier.Award ? proHeader(drawn, context) : null;
|
|
958
|
+
const checked = plan.mixes?.header?.length || pro ? checkHeader(pro?.mix ?? drawn, context) : { mix: drawn, repairs: [] };
|
|
959
|
+
const said = [...gaps.map(g => `the header's ${g.ingredient} "${g.word}" is drawn as "${g.drawnAs}" until ${g.phase}`),
|
|
960
|
+
...(pro?.repairs ?? []).map(r => r.said), ...checked.repairs.map(r => r.said)];
|
|
856
961
|
return { mix: checked.mix, context, said };
|
|
857
962
|
}
|
|
858
963
|
|
|
@@ -862,7 +967,11 @@ export function withDistinctHeader<P extends HeaderPlan & {
|
|
|
862
967
|
readonly globals?: Readonly<Record<string, string>>; readonly mixes?: { readonly header?: ReadonlyArray<string>; readonly footer?: ReadonlyArray<string> };
|
|
863
968
|
}>(plan: P, taken: ReadonlyArray<string>, facts: HeaderFacts = {}): { plan: P; repairs: HeaderRepair[] } {
|
|
864
969
|
const worn = wornHeaderOfPlan(plan, facts);
|
|
865
|
-
|
|
970
|
+
// HI-D Pro: a Pro site's header is mended within the floating ones — only to a mix the Pro rule wears as it is (so the
|
|
971
|
+
// composer, which asks `proHeader` again, keeps the mend).
|
|
972
|
+
const ctx = worn.context;
|
|
973
|
+
const keptByPro = (m: HeaderMix) => headerTokenOf(checkHeader(proHeader(m, ctx).mix, ctx).mix) === headerTokenOf(m);
|
|
974
|
+
const done = distinctHeader(worn.mix, taken, ctx, ctx.tier === GenerationTier.Award ? keptByPro : undefined);
|
|
866
975
|
if (!done.repairs.length) return { plan, repairs: [] };
|
|
867
976
|
return { plan: { ...plan, mixes: { ...(plan.mixes ?? {}), header: headerMixWords(done.mix) } }, repairs: done.repairs };
|
|
868
977
|
}
|
|
@@ -3,7 +3,7 @@ import { parseCssColour, relativeLuminance } from '@vectoriox/iox-ui/design-core
|
|
|
3
3
|
import { layoutPresetColours, splitSide } from './check-layout';
|
|
4
4
|
import { LayoutColour, LayoutEnter, LayoutIssue, LayoutIssueCode, LayoutLayerKind, LayoutListMix, LayoutListWho, LayoutPage, LayoutRole, LayoutSection, LayoutSectionKind, LayoutSize, LayoutTrackProp } from './layout-language';
|
|
5
5
|
import { FooterMix, footerMixOfPlan, footerTokenOf } from './footer-mix';
|
|
6
|
-
import { HeaderMix, headerTokenOf, wornHeaderOfPlan } from './header-mix';
|
|
6
|
+
import { HeaderFacts, HeaderMix, headerTokenOf, wornHeaderOfPlan } from './header-mix';
|
|
7
7
|
import { checkPopup, popupTokenOf } from './popup-plan';
|
|
8
8
|
import { SitePlan } from './site-plan.model';
|
|
9
9
|
import { listWordTier } from './list-table';
|
|
@@ -205,11 +205,13 @@ export function fingerprintOf(page: LayoutPage, preset: string, mode: 'light' |
|
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
/** A composed page's fingerprint under its site plan's header and footer — the ONE call every reader of a plan makes.
|
|
209
|
-
|
|
208
|
+
/** A composed page's fingerprint under its site plan's header and footer — the ONE call every reader of a plan makes.
|
|
209
|
+
* `facts.tier` (HI-D Pro): the generation's tier — a Pro site is recorded wearing its floating header, as it is composed. */
|
|
210
|
+
export function fingerprintOfPlanPage(page: LayoutPage, preset: string, mode: 'light' | 'dark', plan: Parameters<typeof wornHeaderOfPlan>[0] & Parameters<typeof footerMixOfPlan>[0],
|
|
211
|
+
facts: Pick<HeaderFacts, 'tier'> = {}): LayoutFingerprint {
|
|
210
212
|
// PU3: the popup the plan makes (`checkPopup` reads a whole plan; a part-plan a caller builds has no popup lines).
|
|
211
213
|
const popup = 'pages' in plan && Array.isArray((plan as SitePlan).pages) ? popupTokenOf(checkPopup(plan as SitePlan).popup) : null;
|
|
212
|
-
return fingerprintOf(page, preset, mode, wornHeaderOfPlan(plan).mix, footerMixOfPlan(plan), popup);
|
|
214
|
+
return fingerprintOf(page, preset, mode, wornHeaderOfPlan(plan, facts).mix, footerMixOfPlan(plan), popup);
|
|
213
215
|
}
|
|
214
216
|
|
|
215
217
|
/** The longest common subsequence of two sequences. */
|