@vectoriox/iox-ui 5.199.0 → 5.200.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 +454 -52
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +640 -55
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs +5 -2
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +945 -159
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +441 -63
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +5 -2
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +434 -123
- package/harness-core/index.d.ts +282 -6
- package/package.json +1 -1
- package/src/design-core/brand-neutrals.ts +125 -3
- package/src/design-core/colour-words.ts +48 -0
- package/src/design-core/design-settings.ts +24 -5
- package/src/design-core/design-token.model.ts +8 -0
- package/src/design-core/flavor-fixtures.generated.ts +272 -2
- package/src/design-core/flavor-spec.generated.ts +310 -40
- package/src/design-core/flavor-tokens.ts +5 -1
- package/src/design-core/public-api.ts +2 -0
- package/src/design-core/signature-move.ts +107 -0
- package/src/design-core/style-presets.ts +9 -3
- package/src/design-core/token-css.ts +59 -1
- package/src/forms-core/form-presets.ts +5 -2
- package/src/generation-core/body-mix.ts +41 -0
- package/src/generation-core/check-layout.ts +17 -7
- package/src/generation-core/colour-mix.ts +53 -3
- package/src/generation-core/compose-site.ts +131 -32
- package/src/generation-core/composition.ts +320 -0
- package/src/generation-core/footer-mix.ts +43 -3
- package/src/generation-core/footer-sign-up.ts +51 -0
- package/src/generation-core/header-edit.ts +15 -0
- package/src/generation-core/opening-edit.ts +17 -3
- package/src/generation-core/opening-mix.ts +69 -5
- package/src/generation-core/plan-wire.ts +22 -5
- package/src/generation-core/public-api.ts +2 -0
- package/src/generation-core/site-build-run.ts +3 -0
- package/src/generation-core/site-plan.model.ts +3 -0
- package/src/generation-core/site-spec.generated.ts +250 -104
- package/src/generation-core/type-led.ts +4 -2
- package/src/generation-core/validate-site-plan.ts +2 -1
- package/src/harness-core/business-types.ts +27 -0
- package/src/harness-core/harness-spec.generated.ts +405 -56
- package/src/harness-core/motion.ts +19 -2
- package/src/harness-core/run-compose-context.ts +9 -3
- package/src/harness-core/starting-design.ts +15 -7
- package/styles/iox-design.css +10 -0
- package/styles/iox-forms.css +53 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { carryInto, swapParts, type PageCarry } from './carry';
|
|
2
2
|
import {
|
|
3
|
-
AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerBrandOf, headerGroundOf, headerInkOf, headerShapeOf,
|
|
3
|
+
AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, SignatureInput, withSignatureMove, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerBrandOf, headerGroundOf, headerInkOf, headerShapeOf,
|
|
4
4
|
columnWordOf, elementStyleById,
|
|
5
5
|
} from '@vectoriox/iox-ui/design-core';
|
|
6
6
|
import { fitSeoText, SEO_DESCRIPTION_MAX, SEO_TITLE_MAX, SeoRawDoc } from '@vectoriox/iox-ui/seo-core';
|
|
@@ -19,6 +19,7 @@ import { EntranceMark, EntrancePart, planEntrances } from './entrances';
|
|
|
19
19
|
import { scrubEntranceStamps } from './text-scroll';
|
|
20
20
|
import { filmOfPlan } from './film';
|
|
21
21
|
import { checkFooter, FooterArrange, footerMixOfPlan, FooterNever, footerPattern, FooterRole, stampFooterMix } from './footer-mix';
|
|
22
|
+
import { planWrites, withTypeSignUp } from './footer-sign-up';
|
|
22
23
|
import {
|
|
23
24
|
countryLegalFacts, FOOTER_LEGAL_ROLE, FORM_LEGAL_ROLE, formAsksPersonalData, formLegalFacts, LEGAL_PAGE_SETTING, LegalContext, LegalFact, LegalFacts,
|
|
24
25
|
legalFormLine, LegalKind, legalKindsFor, legalLabel, legalRoute, legalTitle, measuredCategories, siteMeasures,
|
|
@@ -27,8 +28,9 @@ import {
|
|
|
27
28
|
checkOpening, drawnOpeningMix, namedOpeningMix, OpeningContext, openingIsTypeLed, OpeningMedia, openingMix, OpeningMix, openingMixFromWords, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix,
|
|
28
29
|
stampOpeningMotion, TYPE_LED_OPTIONAL_PARTS, typeLedOpeningSection,
|
|
29
30
|
} from './opening-mix';
|
|
31
|
+
import { bodyWithColourBands, colourMixOfPlan, planDesignChoices } from './colour-mix';
|
|
30
32
|
import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, HeaderFacts, HeaderIngredient, HeaderNever, HeaderOpening, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
|
|
31
|
-
import { bodyMixOfPlan, checkBody, drawnBodyMix, joinPageHeader, wearBodyMix } from './body-mix';
|
|
33
|
+
import { bodyMixOfPlan, checkBody, drawnBodyMix, joinPageHeader, joinSameGround, wearBodyMix } from './body-mix';
|
|
32
34
|
import { checkPopup, composePopup, POPUP_GLOBAL_ID } from './popup-plan';
|
|
33
35
|
import { NODE_BASELINES } from './node-baselines.generated';
|
|
34
36
|
import {
|
|
@@ -40,6 +42,7 @@ import { CheckLayoutContext, withShownList } from './check-layout';
|
|
|
40
42
|
import { recipeListBinds } from './recipe-fields';
|
|
41
43
|
import { assertStyleSlots, ComposeError, createSerializedNode, SerializedBinding, SerializedNode, setStyleProps, walkSerialized } from './serialized-node';
|
|
42
44
|
import { refreshSectionStamps, stampSection } from './section-stamp';
|
|
45
|
+
import { archetypeRank, BorrowedSection, BorrowKind, baseOrder, composesPage, compositionBorrows, compositionSwaps, orderPlaces, pageKindOf, sectionSkeleton, skeletonOf } from './composition';
|
|
43
46
|
import { SitePlanSourceKind, ContentFieldControl, ContentFieldPlan,
|
|
44
47
|
ContentRole, ContentTypePlan, DataSourcePlan, DEFAULT_SITE_LOCALE, FactKey, FACT_KEYS, GlobalSlot, isRtlLocale, ITEM_PAGE_ONLY_ROLES, PagePlan, PageSectionPlan, PlanDataSourceMode,
|
|
45
48
|
PlanDataSourceType, RelativeOp, roleField, SiteLocale, SitePlan, SitePlanSource, siteFactLabel, SiteBusiness, GenerationTier,
|
|
@@ -139,6 +142,9 @@ export enum ComposeIssueCode {
|
|
|
139
142
|
PopupMended = 'popup-mended',
|
|
140
143
|
/** Popups PU3: the owner's popup line made no popup (a figure the owner's words do not hold, news too long): the detail says why. */
|
|
141
144
|
PopupRefused = 'popup-refused',
|
|
145
|
+
/** Composition (composition-plan.md): a pattern page borrowed a section the plan wrote on another page, or was reordered
|
|
146
|
+
* so no two neighbours share a skeleton (`composePlaces`): the detail says what. */
|
|
147
|
+
CompositionMended = 'composition-mended',
|
|
142
148
|
}
|
|
143
149
|
|
|
144
150
|
/** The issues that are a dangling link (a route the plan has no page for) and what was done about it. */
|
|
@@ -178,6 +184,9 @@ export interface ComposeContext {
|
|
|
178
184
|
/** AW12-D10: what that kind of business's footer never wears (harness-core `BusinessType.footer`) — `checkFooter`
|
|
179
185
|
* mends it, said. Absent = nothing refused. */
|
|
180
186
|
footerNever?: FooterNever;
|
|
187
|
+
/** AW12 newsletter: that kind of business's references close with a sign-up (harness-core `BusinessType.signUp`) — a
|
|
188
|
+
* footer that asks for none holds one (`withTypeSignUp`), and the type is a reason to write (`planWrites`). */
|
|
189
|
+
footerSignUp?: boolean;
|
|
181
190
|
/** HI3-D12: what that kind of business never stands its header on (harness-core `BusinessType.header`) — `checkHeader`
|
|
182
191
|
* mends it to its own ground, said. Absent = nothing refused. */
|
|
183
192
|
headerNever?: HeaderNever;
|
|
@@ -193,6 +202,10 @@ export interface ComposeContext {
|
|
|
193
202
|
/** #129: which picture slots a picture fills (the owner's, a made one, a stock one). Given, a section whose picture
|
|
194
203
|
* nothing fills is composed type-led (`type-led.ts`); absent, the plan composes exactly as it says. */
|
|
195
204
|
pictures?: PictureSupply;
|
|
205
|
+
/** Motion reach (MR-D1): what the kind of business says about its site's signature move (harness-core `signatureInputOf`,
|
|
206
|
+
* given by `businessComposeContext`) — the look is signed with design-core `withSignatureMove` before anything is
|
|
207
|
+
* stamped, so a rebuild from a kept plan signs too. Absent: the look composes as the plan writes it. */
|
|
208
|
+
signature?: SignatureInput;
|
|
196
209
|
/** Pictures first (harness `BusinessType.opening`, given by harness-core `businessComposeContext` only when a picture can
|
|
197
210
|
* come — the owner's photo, or stock where the type allows it, never against the owner's "no pictures"): the opening
|
|
198
211
|
* words a Home whose plan names no opening takes (`withTypeOpening`). Absent: the Home opens as its plan writes. */
|
|
@@ -423,8 +436,6 @@ interface Ctx {
|
|
|
423
436
|
keepButtons?: boolean;
|
|
424
437
|
/** M1-6b: the pattern's entrance parts as stamped, for `planEntrances` once the pattern is whole. */
|
|
425
438
|
entrances?: Array<Omit<EntranceMark, 'index'>>;
|
|
426
|
-
/** #129: the content types whose items have no picture at all — an optional `@image?` of theirs is left out. */
|
|
427
|
-
pictureless?: ReadonlySet<string>;
|
|
428
439
|
}
|
|
429
440
|
|
|
430
441
|
interface ShownWhen {
|
|
@@ -516,8 +527,9 @@ function resolveScopedPath(path: string, repeater: RepeaterScope | null, ctx: Ct
|
|
|
516
527
|
const { source, typeSource } = scopeOf(parsed.scope, path, repeater, ctx, nodeId);
|
|
517
528
|
if (!parsed.role) return { source, path: parsed.field || ITEM_VALUE_PATH };
|
|
518
529
|
const type = typeSource ? contentTypeOfSource(typeSource, ctx.plan) : undefined;
|
|
519
|
-
// #129: a list whose items have no picture
|
|
520
|
-
|
|
530
|
+
// #129 × iox-ui#191: a list whose items have no picture KEEPS its picture part, bound — the shared CSS draws a card
|
|
531
|
+
// without it wherever its own item has none (iox-design.css "A row's card with no picture"), so the owner's photos,
|
|
532
|
+
// added after the build, show the moment they are saved. Never decided here, at build time.
|
|
521
533
|
const field = roleField(type, parsed.role);
|
|
522
534
|
if (field) return { source, path: field };
|
|
523
535
|
if (parsed.optional) return null;
|
|
@@ -1741,6 +1753,82 @@ function composePageSeo(page: PagePlan, plan: SitePlan): SeoRawDoc {
|
|
|
1741
1753
|
return { ...(title ? { title } : {}), ...(description ? { description } : {}), ...(robots ? { robots } : {}) };
|
|
1742
1754
|
}
|
|
1743
1755
|
|
|
1756
|
+
/** A borrowed section stamped into its own placeholder and issue lists (a borrow that would add one is refused). */
|
|
1757
|
+
type BorrowStamp = (section: PageSectionPlan, id: string, sink: Pick<Ctx, 'placeholders' | 'issues'>) => SerializedNode;
|
|
1758
|
+
|
|
1759
|
+
/** A borrowed list shows its first `limit` items: the first Repeater (or a recipe holding a `limit`, the accordion's). */
|
|
1760
|
+
function cutList(root: SerializedNode, limit: number): void {
|
|
1761
|
+
let done = false;
|
|
1762
|
+
walkSerialized([root], n => {
|
|
1763
|
+
if (done) return;
|
|
1764
|
+
const held = n.props?.['limit'];
|
|
1765
|
+
if (n.type !== REPEATER && held === undefined) return;
|
|
1766
|
+
setProp(n, 'limit', typeof held === 'number' ? Math.min(held, limit) : limit);
|
|
1767
|
+
done = true;
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* Composition (composition-plan.md): a pattern page's places — its own sections, then what it borrows from the plan's
|
|
1773
|
+
* other pages (`compositionBorrows`, each stamped without a placeholder or an issue, its list cut to the borrow's
|
|
1774
|
+
* `limit`), in the order nearest the archetype's in which no two neighbours share a skeleton (`orderPlaces`). Plan
|
|
1775
|
+
* sections keep their node ids (`<page>-<i>`); a borrowed one is `<page>-borrowed-<n>`. Every borrow and reorder is said.
|
|
1776
|
+
*/
|
|
1777
|
+
function composePlaces(page: PagePlan, plan: SitePlan, own: SerializedNode[], stamp: BorrowStamp, issues: ComposeIssue[]): SerializedNode[] {
|
|
1778
|
+
// A template's item page, a page kind the table names no minimum for: its plan's order as written.
|
|
1779
|
+
if (!composesPage(page)) return own;
|
|
1780
|
+
const kind = pageKindOf(page);
|
|
1781
|
+
const stamped: SerializedNode[] = [];
|
|
1782
|
+
const borrowed = compositionBorrows(page, plan, (b: BorrowedSection) => {
|
|
1783
|
+
const sink = { placeholders: [] as ComposedPlaceholder[], issues: [] as ComposeIssue[] };
|
|
1784
|
+
let root: SerializedNode;
|
|
1785
|
+
try {
|
|
1786
|
+
root = stampSection(stamp(b.section, `${page.key}-borrowed-${stamped.length}`, sink), { pattern: b.section.pattern });
|
|
1787
|
+
} catch {
|
|
1788
|
+
return false;
|
|
1789
|
+
}
|
|
1790
|
+
if (sink.placeholders.length || sink.issues.length) return false;
|
|
1791
|
+
if (b.limit) cutList(root, b.limit);
|
|
1792
|
+
stamped.push(root);
|
|
1793
|
+
return true;
|
|
1794
|
+
});
|
|
1795
|
+
const last = page.sections.length - 1;
|
|
1796
|
+
const ownPlaces = page.sections.map((s, i) => ({
|
|
1797
|
+
skeleton: sectionSkeleton(s, i), rank: archetypeRank(kind, s.pattern), ask: i === last && patternById(s.pattern)?.family === 'cta',
|
|
1798
|
+
}));
|
|
1799
|
+
const borrowedPlaces = borrowed.map(b => ({ skeleton: b.skeleton, rank: archetypeRank(kind, b.section.pattern), ask: b.kind === BorrowKind.Ask }));
|
|
1800
|
+
const places = [...ownPlaces, ...borrowedPlaces];
|
|
1801
|
+
const base = baseOrder(ownPlaces, borrowedPlaces);
|
|
1802
|
+
const holdLast = places[base[base.length - 1]]?.ask === true;
|
|
1803
|
+
const order = orderPlaces(places, base, holdLast);
|
|
1804
|
+
const nodes = [...own, ...stamped];
|
|
1805
|
+
// The last mend: a sibling carrying every slot, for a pair no order clears — kept only when it stamps clean.
|
|
1806
|
+
for (const [i, swapped] of compositionSwaps(page.sections, order, places.map(p => p.skeleton), holdLast)) {
|
|
1807
|
+
const sink = { placeholders: [] as ComposedPlaceholder[], issues: [] as ComposeIssue[] };
|
|
1808
|
+
let root: SerializedNode;
|
|
1809
|
+
try {
|
|
1810
|
+
root = stampSection(stamp(swapped, nodes[i].id, sink), { pattern: swapped.pattern });
|
|
1811
|
+
} catch {
|
|
1812
|
+
continue;
|
|
1813
|
+
}
|
|
1814
|
+
if (sink.placeholders.length || sink.issues.length) continue;
|
|
1815
|
+
nodes[i] = root;
|
|
1816
|
+
places[i] = { ...places[i], skeleton: skeletonOf(swapped.pattern) };
|
|
1817
|
+
issues.push({
|
|
1818
|
+
code: ComposeIssueCode.CompositionMended, nodeId: root.id, owner: page.key,
|
|
1819
|
+
detail: `${page.name}: ${patternById(page.sections[i].pattern)?.label ?? page.sections[i].pattern} is worn as ${patternById(swapped.pattern)?.label ?? swapped.pattern} so no two neighbours share a skeleton`,
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
borrowed.forEach((b, j) => issues.push({ code: ComposeIssueCode.CompositionMended, nodeId: stamped[j].id, owner: page.key, detail: b.said }));
|
|
1823
|
+
if (order.some((v, i) => v !== base[i])) {
|
|
1824
|
+
issues.push({
|
|
1825
|
+
code: ComposeIssueCode.CompositionMended, nodeId: page.key, owner: page.key,
|
|
1826
|
+
detail: `${page.name}'s sections were reordered so no two neighbours share a skeleton (${order.map(i => places[i].skeleton).join(' · ')})`,
|
|
1827
|
+
});
|
|
1828
|
+
}
|
|
1829
|
+
return order.map(i => nodes[i]);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1744
1832
|
function composeDataSource(ds: DataSourcePlan): ComposedDataSource {
|
|
1745
1833
|
const id = `ds-${ds.alias}`;
|
|
1746
1834
|
if (ds.type === PlanDataSourceType.Cms) {
|
|
@@ -1854,39 +1942,29 @@ function composeLayoutPage(
|
|
|
1854
1942
|
const image = type && pictureless.has(type.name) ? undefined : roleField(type, 'image');
|
|
1855
1943
|
return image ? { image, ...(roleField(type, 'title') ? { title: roleField(type, 'title')! } : {}) } : null;
|
|
1856
1944
|
},
|
|
1857
|
-
listOf: alias =>
|
|
1945
|
+
listOf: alias => layoutListBinding(alias, plan),
|
|
1858
1946
|
...(context.carry?.[page.key] ? { carry: context.carry[page.key] } : {}),
|
|
1859
1947
|
});
|
|
1860
1948
|
fillPageFacts(nodes, page, plan, placeholders);
|
|
1861
1949
|
return nodes;
|
|
1862
1950
|
}
|
|
1863
1951
|
|
|
1864
|
-
/** How a model-laid page reads one list (`layoutListBinding`) — #129: a list whose items have no picture is read as a list
|
|
1865
|
-
* without one (its cards draw no picture part). */
|
|
1866
|
-
function pageListOf(alias: string, plan: SitePlan, pictureless: ReadonlySet<string>): LayoutListBinding | null {
|
|
1867
|
-
const binding = layoutListBinding(alias, plan);
|
|
1868
|
-
const type = contentTypeOfSource(alias, plan);
|
|
1869
|
-
if (!binding || !type || !pictureless.has(type.name) || !binding.roles[ContentRole.Image]) return binding;
|
|
1870
|
-
const { [ContentRole.Image]: _none, ...roles } = binding.roles;
|
|
1871
|
-
return { ...binding, roles };
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
1952
|
/**
|
|
1875
1953
|
* FS3: a free page — the model's own nodes, stamped by `composeFreePage` in the look's pace — with the site's facts
|
|
1876
1954
|
* written in as on a composed page; a section the fall back gave back is the plan's ready-made one.
|
|
1877
1955
|
*/
|
|
1878
1956
|
function composeFreePlanPage(
|
|
1879
|
-
page: PagePlan, free: FreePage, plan: SitePlan, context: ComposeContext, placeholders: ComposedPlaceholder[],
|
|
1957
|
+
page: PagePlan, free: FreePage, plan: SitePlan, context: ComposeContext, placeholders: ComposedPlaceholder[],
|
|
1880
1958
|
readyMade: (section: PageSectionPlan, id: string, at: number) => SerializedNode,
|
|
1881
1959
|
): SerializedNode[] {
|
|
1882
|
-
const nodes = composeFreePage(free, freeOptionsOf(page, plan, context,
|
|
1960
|
+
const nodes = composeFreePage(free, freeOptionsOf(page, plan, context, readyMade));
|
|
1883
1961
|
fillPageFacts(nodes, page, plan, placeholders);
|
|
1884
1962
|
return nodes;
|
|
1885
1963
|
}
|
|
1886
1964
|
|
|
1887
1965
|
/** What the free stamp reads of the site: its language, the look's pace, the owner's pictures, the plan's lists. */
|
|
1888
1966
|
function freeOptionsOf(
|
|
1889
|
-
page: PagePlan, plan: SitePlan, context: ComposeContext,
|
|
1967
|
+
page: PagePlan, plan: SitePlan, context: ComposeContext,
|
|
1890
1968
|
readyMade?: (section: PageSectionPlan, id: string, at: number) => SerializedNode,
|
|
1891
1969
|
): ComposeFreeOptions {
|
|
1892
1970
|
const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
|
|
@@ -1894,7 +1972,7 @@ function freeOptionsOf(
|
|
|
1894
1972
|
owner: page.key, locale, rtl: isRtlLocale(locale), motion: layoutMotionOf(layoutPresetOf(plan.design).id),
|
|
1895
1973
|
// iox-ui#180: a picture box is an empty picture (the build fills it), never an address.
|
|
1896
1974
|
photoSrc: id => (isFreeBox(id) ? '' : context.photoSrc?.(id) ?? ''), photoAlt: id => (isFreeBox(id) ? '' : context.photoAlt?.(id) ?? ''),
|
|
1897
|
-
listOf: alias =>
|
|
1975
|
+
listOf: alias => layoutListBinding(alias, plan),
|
|
1898
1976
|
listFields: alias => fieldsOf(listedContentType(alias, plan)),
|
|
1899
1977
|
quotes: quoteListOf(plan),
|
|
1900
1978
|
...(readyMade ? {
|
|
@@ -2039,14 +2117,17 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
|
|
|
2039
2117
|
const routes = new Set(plan.pages.map(p => p.route));
|
|
2040
2118
|
const relatives = new Map(plan.dataSources.map(d => [d.alias, d.type === PlanDataSourceType.Relative ? { type: d.type, of: d.of, op: d.op } : { type: d.type }]));
|
|
2041
2119
|
const email = nonEmpty(plan.business.facts?.email) ? plan.business.facts!.email!.trim() : null;
|
|
2042
|
-
const base = { plan, placeholders, issues, routes, year: context.year, email, navPage: null
|
|
2120
|
+
const base = { plan, placeholders, issues, routes, year: context.year, email, navPage: null };
|
|
2043
2121
|
|
|
2044
2122
|
// AW-D42: every plan wears the look's whole motion language (a lower plan's Pro words were drawn as its own, AW-D23).
|
|
2045
|
-
|
|
2123
|
+
// CV2: the plan's design with its colour words (`planDesignChoices`) — what the build's Look step writes; MR-D1: signed
|
|
2124
|
+
// by its kind of business (a preloader or By the scroll; a Still start lifted) — the build applies it.
|
|
2125
|
+
const design = withSignatureMove(motionLanguageForPlan(planDesignChoices(plan)), context?.signature).design;
|
|
2046
2126
|
const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
|
|
2047
2127
|
const rtl = isRtlLocale(locale);
|
|
2048
2128
|
// AW6: the plan's body (seams, inset cards) as the site may carry it — every mend said (`body-mended`).
|
|
2049
|
-
|
|
2129
|
+
// CV-D9: the colour's `bands.inset` is AW6's inset card, folded into the body before it is judged.
|
|
2130
|
+
const bodyMixAsked = bodyWithColourBands(bodyMixOfPlan(plan), colourMixOfPlan(plan));
|
|
2050
2131
|
const bodyChecked = bodyMixAsked ? checkBody(drawnBodyMix(bodyMixAsked).drawn, { calm: !!context?.calm }) : null;
|
|
2051
2132
|
for (const r of bodyChecked?.repairs ?? []) issues.push({ code: ComposeIssueCode.BodyMended, nodeId: 'body', owner: 'body', detail: r.said });
|
|
2052
2133
|
const body = bodyChecked?.mix ?? null;
|
|
@@ -2056,7 +2137,7 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
|
|
|
2056
2137
|
// FS3: the model's own page. Its opening is its own (the plan's opening is never worn over it) — but a ready-made
|
|
2057
2138
|
// opening (the fall back's, or the type-led round's when nothing fills its picture, iox-ui#180) is the plan's
|
|
2058
2139
|
// section, worn as every Home's is.
|
|
2059
|
-
const stamped = composeFreePlanPage(page, page.free, plan, context, placeholders,
|
|
2140
|
+
const stamped = composeFreePlanPage(page, page.free, plan, context, placeholders, (section, id, at) =>
|
|
2060
2141
|
composePattern(patternById(section.pattern) as SitePattern, id, { ...base, owner: page.key, page, section, nextAlias },
|
|
2061
2142
|
{ level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null, opening: at === 0 }));
|
|
2062
2143
|
const readyOpening = page.free.sections[0]?.readyMade;
|
|
@@ -2071,9 +2152,13 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
|
|
|
2071
2152
|
if (page.layout) {
|
|
2072
2153
|
// vectoriox/iox-ui#99: a composed page that is where the site lists the shop lists it (a stored layout too).
|
|
2073
2154
|
const layout = withShownList(page.layout, layoutListsContext(page, plan)) ?? page.layout;
|
|
2155
|
+
// A ready-made band on a composed page wears the look's By the scroll as the same pattern on a pattern page does
|
|
2156
|
+
// (found by AW-D42); the page's first screen plays on time (AW10-D8).
|
|
2157
|
+
const openingAt = layout.sections[0]?.readyMade?.at;
|
|
2074
2158
|
const stamped = stampLayoutSections(page, layout, composeLayoutPage(page, layout, plan, context, design, placeholders, (section, id) =>
|
|
2075
2159
|
composePattern(patternById(section.pattern) as SitePattern, id, { ...base, owner: page.key, page, section, nextAlias },
|
|
2076
|
-
{ level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null
|
|
2160
|
+
{ level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null,
|
|
2161
|
+
opening: openingAt !== undefined && page.sections[openingAt] === section }), pictureless));
|
|
2077
2162
|
// AW8: the plan's opening is the home page's first screen; a pinned or kept first place is never replaced.
|
|
2078
2163
|
const first = layout.sections[0];
|
|
2079
2164
|
const worn = wearPlanOpening(page, stamped, plan, context, design, placeholders, issues, !!(first?.pin || first?.carry),
|
|
@@ -2087,17 +2172,22 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
|
|
|
2087
2172
|
layout: joinPageHeader(wearBodyMix(worn, body)),
|
|
2088
2173
|
};
|
|
2089
2174
|
}
|
|
2090
|
-
const
|
|
2175
|
+
const own = page.sections.map((section, i) => {
|
|
2091
2176
|
const pattern = patternById(section.pattern) as SitePattern;
|
|
2092
2177
|
const motion: SectionMotion = { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null, opening: i === 0 };
|
|
2093
2178
|
// FS-D19: a free signature section stands in its place; its fall back is this pattern.
|
|
2094
2179
|
if (section.free) {
|
|
2095
|
-
const root = composeFreeSection(section.free, `${page.key}-${i}`, freeOptionsOf(page, plan, context
|
|
2180
|
+
const root = composeFreeSection(section.free, `${page.key}-${i}`, freeOptionsOf(page, plan, context));
|
|
2096
2181
|
fillPageFacts([root], page, plan, placeholders);
|
|
2097
2182
|
return root;
|
|
2098
2183
|
}
|
|
2099
2184
|
return stampSection(composePattern(pattern, `${page.key}-${i}`, { ...base, owner: page.key, page, section, nextAlias }, motion), { pattern: section.pattern });
|
|
2100
|
-
})
|
|
2185
|
+
});
|
|
2186
|
+
// Composition: what the page borrows from the plan's other pages, and the order no two neighbours share a skeleton in.
|
|
2187
|
+
const placed = composePlaces(page, plan, own, (section, id, sink) => composePattern(patternById(section.pattern) as SitePattern, id,
|
|
2188
|
+
{ ...base, ...sink, owner: page.key, page, section, nextAlias },
|
|
2189
|
+
{ level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null, opening: false }), issues);
|
|
2190
|
+
const layout = wearPlanOpening(page, placed, plan, context, design, placeholders, issues, false, page.sections[0]);
|
|
2101
2191
|
const opening = schemeOfFirst(layout);
|
|
2102
2192
|
return {
|
|
2103
2193
|
key: page.key,
|
|
@@ -2108,7 +2198,9 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
|
|
|
2108
2198
|
locale,
|
|
2109
2199
|
pageSettings: { designSystem: true, ...(opening ? { opening } : {}) },
|
|
2110
2200
|
seo: composePageSeo(page, plan),
|
|
2111
|
-
|
|
2201
|
+
// CO4: on a pattern page every two neighbours on one ground are one section space apart (the page header's join
|
|
2202
|
+
// is one case of it).
|
|
2203
|
+
layout: joinSameGround(wearBodyMix(layout, body)),
|
|
2112
2204
|
};
|
|
2113
2205
|
});
|
|
2114
2206
|
|
|
@@ -2125,8 +2217,11 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
|
|
|
2125
2217
|
...(context?.businessType ? { type: context.businessType } : {}), ...(context?.footerNever ? { never: context.footerNever } : {}),
|
|
2126
2218
|
// AW12-D13 (iox-ui#153): the build's tier — absent, Basic, as the body's — never wears an award word.
|
|
2127
2219
|
tier: context?.tier ?? GenerationTier.Basic,
|
|
2220
|
+
// AW12-D6: a sign-up only where the site has a reason to write (a journal, events, a shop, the type, the owner's tick).
|
|
2221
|
+
writes: planWrites(plan, context?.footerSignUp),
|
|
2128
2222
|
};
|
|
2129
|
-
|
|
2223
|
+
// AW12 newsletter: the kind of business's sign-up when the plan's footer asks for none — the same plan, the same footer.
|
|
2224
|
+
const footer = checkFooter(withTypeSignUp(footerMixOfPlan(plan), { signUp: context?.footerSignUp, writes: footerContext.writes }), footerContext);
|
|
2130
2225
|
for (const r of footer.repairs) issues.push({ code: ComposeIssueCode.FooterMended, nodeId: GlobalSlot.Footer, owner: GlobalSlot.Footer, detail: r.said });
|
|
2131
2226
|
// HI1: the header is the plan's header MIX (a stored pattern id is read as one), drawn as the product draws it, checked
|
|
2132
2227
|
// against the site and arranged from the contract's header parts; each mend is said.
|
|
@@ -2523,6 +2618,9 @@ export interface NavHeaderInput {
|
|
|
2523
2618
|
* `{ frame: 'full', media: 'photo' }`; null = it opens plain). Absent: not judged — a header over the opening is kept
|
|
2524
2619
|
* as chosen (the builder knows the page; a studio with no Site Plan has no plan opening to read). */
|
|
2525
2620
|
readonly opening?: HeaderOpening | null;
|
|
2621
|
+
/** HI3-D21: the brand has a logo picture (a hanging name needs one) — the builder reads the header's own brand
|
|
2622
|
+
* (`headerSiteFor`). Absent: none known, a hanging name fits. */
|
|
2623
|
+
readonly logo?: boolean | null;
|
|
2526
2624
|
}
|
|
2527
2625
|
|
|
2528
2626
|
export interface NavHeaderOptions {
|
|
@@ -2606,7 +2704,8 @@ function navHeaderPlan(input: Omit<NavHeaderInput, 'mix' | 'asAsked'>): SitePlan
|
|
|
2606
2704
|
/** What a studio's header is judged against (`checkHeader`) — the same context `composeNavHeader` checks with. */
|
|
2607
2705
|
export function navHeaderContext(input: Omit<NavHeaderInput, 'mix' | 'asAsked'>): HeaderContext {
|
|
2608
2706
|
const { opening: _plan, ...context } = headerContextOfPlan(navHeaderPlan(input), input.shop ?? null);
|
|
2609
|
-
|
|
2707
|
+
const withLogo = input.logo === undefined || input.logo === null ? context : { ...context, logo: input.logo };
|
|
2708
|
+
return input.opening === undefined ? withLogo : { ...withLogo, opening: input.opening };
|
|
2610
2709
|
}
|
|
2611
2710
|
|
|
2612
2711
|
export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOptions): ComposedNavHeader {
|