@vectoriox/iox-ui 5.114.0 → 5.115.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.
@@ -16,7 +16,12 @@ export const SPEC_SITE_PLAN_SHAPE = {
16
16
  "globals": "globals",
17
17
  "film?": "film — the owner's film as pictures (SC6b), set by the build and placed by placeFilm; never a model's",
18
18
  "artDirection?": "artDirection — what every picture made for the site shares (M7): set by the generation from the business type and the look (generation-core artDirectionFor); never a model's",
19
- "direction?": "direction — what the site is built around (M8 gate 2): written with the pages, shown on the Plan step; every composed page serves it"
19
+ "direction?": "direction — what the site is built around (M8 gate 2): written with the pages, shown on the Plan step; every composed page serves it",
20
+ "mixes?": "mixes — the header and footer as mixes of ingredients (ingredients.md); a mix wins over its globals pattern"
21
+ },
22
+ "mixes": {
23
+ "header?": "string[] — the header as <ingredient>:<word> words (site.layout.header; header ingredients HI1)",
24
+ "footer?": "string[] — the footer as <ingredient>:<word> words (site.layout.footer; list ingredients LI5)"
20
25
  },
21
26
  "direction": {
22
27
  "idea": "string — one sentence: what this site is about and how it should feel",
@@ -1615,12 +1620,12 @@ export const SPEC_SITE_PATTERNS = {
1615
1620
  {
1616
1621
  "t": "Text",
1617
1622
  "es": "small",
1618
- "ph": "phone"
1623
+ "ph": "email"
1619
1624
  },
1620
1625
  {
1621
1626
  "t": "Text",
1622
1627
  "es": "small",
1623
- "ph": "email"
1628
+ "ph": "phone"
1624
1629
  }
1625
1630
  ]
1626
1631
  }
@@ -5287,6 +5292,210 @@ export const SPEC_SITE_PATTERNS = {
5287
5292
  }
5288
5293
  } as const;
5289
5294
 
5295
+ export const SPEC_SITE_FOOTER_PARTS = {
5296
+ "section": {
5297
+ "t": "Section",
5298
+ "es": "section",
5299
+ "lay": {
5300
+ "display": "flex",
5301
+ "flexDirection": "column",
5302
+ "gap": "32px"
5303
+ }
5304
+ },
5305
+ "brand": {
5306
+ "t": "Container",
5307
+ "es": "box",
5308
+ "lay": {
5309
+ "display": "flex",
5310
+ "flexDirection": "column",
5311
+ "gap": "8px"
5312
+ },
5313
+ "c": [
5314
+ {
5315
+ "t": "Heading",
5316
+ "es": "h3",
5317
+ "level": "h3",
5318
+ "slot": "brand",
5319
+ "max": 32,
5320
+ "fromBusiness": "name"
5321
+ },
5322
+ {
5323
+ "t": "Text",
5324
+ "es": "small",
5325
+ "slot": "tagline",
5326
+ "max": 120,
5327
+ "fromBusiness": "tagline",
5328
+ "ph": "copy"
5329
+ }
5330
+ ]
5331
+ },
5332
+ "pages": {
5333
+ "t": "Container",
5334
+ "es": "box",
5335
+ "lay": {
5336
+ "display": "flex",
5337
+ "flexDirection": "column",
5338
+ "gap": "8px"
5339
+ },
5340
+ "c": [
5341
+ {
5342
+ "t": "Heading",
5343
+ "es": "eyebrow",
5344
+ "level": "h4",
5345
+ "slot": "pagesLabel",
5346
+ "max": 40,
5347
+ "text": "Pages",
5348
+ "textHe": "עמודים"
5349
+ },
5350
+ {
5351
+ "t": "Link",
5352
+ "es": "link",
5353
+ "each": "$navPages",
5354
+ "bind": "page.name",
5355
+ "href": "$page.route"
5356
+ }
5357
+ ]
5358
+ },
5359
+ "pageRow": {
5360
+ "t": "Container",
5361
+ "es": "box",
5362
+ "lay": {
5363
+ "display": "flex",
5364
+ "flexWrap": "wrap",
5365
+ "gap": "var(--iox-space-gap)",
5366
+ "alignItems": "center",
5367
+ "width": "auto"
5368
+ },
5369
+ "c": [
5370
+ {
5371
+ "t": "Link",
5372
+ "es": "link",
5373
+ "each": "$navPages",
5374
+ "bind": "page.name",
5375
+ "href": "$page.route"
5376
+ }
5377
+ ]
5378
+ },
5379
+ "contact": {
5380
+ "t": "Container",
5381
+ "es": "box",
5382
+ "lay": {
5383
+ "display": "flex",
5384
+ "flexDirection": "column",
5385
+ "gap": "8px"
5386
+ },
5387
+ "c": [
5388
+ {
5389
+ "t": "Heading",
5390
+ "es": "eyebrow",
5391
+ "level": "h4",
5392
+ "slot": "contactLabel",
5393
+ "max": 40,
5394
+ "text": "Contact",
5395
+ "textHe": "יצירת קשר"
5396
+ },
5397
+ {
5398
+ "t": "Text",
5399
+ "es": "small",
5400
+ "ph": "email"
5401
+ },
5402
+ {
5403
+ "t": "Text",
5404
+ "es": "small",
5405
+ "ph": "phone"
5406
+ },
5407
+ {
5408
+ "t": "Text",
5409
+ "es": "small",
5410
+ "ph": "city"
5411
+ }
5412
+ ]
5413
+ },
5414
+ "visit": {
5415
+ "t": "Container",
5416
+ "es": "box",
5417
+ "lay": {
5418
+ "display": "flex",
5419
+ "flexDirection": "column",
5420
+ "gap": "8px"
5421
+ },
5422
+ "c": [
5423
+ {
5424
+ "t": "Heading",
5425
+ "es": "eyebrow",
5426
+ "level": "h4",
5427
+ "slot": "visitLabel",
5428
+ "max": 40,
5429
+ "text": "Visit",
5430
+ "textHe": "ביקור"
5431
+ },
5432
+ {
5433
+ "t": "Text",
5434
+ "es": "small",
5435
+ "ph": "address"
5436
+ },
5437
+ {
5438
+ "t": "Text",
5439
+ "es": "small",
5440
+ "ph": "hours"
5441
+ }
5442
+ ]
5443
+ },
5444
+ "call": {
5445
+ "t": "Container",
5446
+ "es": "box",
5447
+ "lay": {
5448
+ "display": "flex",
5449
+ "flexDirection": "column",
5450
+ "gap": "20px",
5451
+ "alignItems": "flex-start"
5452
+ },
5453
+ "c": [
5454
+ {
5455
+ "t": "Heading",
5456
+ "es": "h2",
5457
+ "level": "h2",
5458
+ "slot": "closing",
5459
+ "max": 44,
5460
+ "text": "Let's talk.",
5461
+ "textHe": "בואו נדבר."
5462
+ },
5463
+ {
5464
+ "t": "ButtonBlock",
5465
+ "es": "button-primary",
5466
+ "href": "/contact",
5467
+ "slot": "closingAction",
5468
+ "max": 24,
5469
+ "text": "Get in touch",
5470
+ "textHe": "צרו קשר"
5471
+ }
5472
+ ]
5473
+ },
5474
+ "name": {
5475
+ "t": "Heading",
5476
+ "es": "display",
5477
+ "level": "h2",
5478
+ "slot": "wordmark",
5479
+ "max": 32,
5480
+ "fromBusiness": "name",
5481
+ "lay": {
5482
+ "lineHeight": "0.9",
5483
+ "margin": "0px"
5484
+ }
5485
+ },
5486
+ "rule": {
5487
+ "t": "Divider",
5488
+ "es": "rule"
5489
+ },
5490
+ "copyright": {
5491
+ "t": "Text",
5492
+ "es": "small",
5493
+ "slot": "copyright",
5494
+ "max": 90,
5495
+ "text": "© {year} {business.name}"
5496
+ }
5497
+ } as const;
5498
+
5290
5499
  export const SPEC_SITE_TEMPLATES = {
5291
5500
  "studio": {
5292
5501
  "id": "studio",
@@ -7446,5 +7655,87 @@ export const SPEC_SITE_LAYOUT = {
7446
7655
  }
7447
7656
  }
7448
7657
  ]
7658
+ },
7659
+ "footer": {
7660
+ "ingredients": {
7661
+ "arrange": [
7662
+ "columns",
7663
+ "centred",
7664
+ "line"
7665
+ ],
7666
+ "holds": [
7667
+ "pages",
7668
+ "visit",
7669
+ "contact"
7670
+ ],
7671
+ "closing": [
7672
+ "none",
7673
+ "call",
7674
+ "name"
7675
+ ],
7676
+ "ground": [
7677
+ "inverse",
7678
+ "plain",
7679
+ "subtle",
7680
+ "accent"
7681
+ ]
7682
+ },
7683
+ "many": [
7684
+ "holds"
7685
+ ],
7686
+ "meanings": {
7687
+ "arrange.columns": "the name and its line at the start, a column for each block it holds",
7688
+ "arrange.centred": "everything centred, one block under another",
7689
+ "arrange.line": "one quiet line: the copyright beside the pages",
7690
+ "holds.pages": "the pages",
7691
+ "holds.contact": "how to reach the business (email, phone, city)",
7692
+ "holds.visit": "where and when to visit (address, hours) — for a place people come to",
7693
+ "closing.none": "nothing before the footer's blocks",
7694
+ "closing.call": "a closing line and one button, above the blocks",
7695
+ "closing.name": "the business name set huge across the width, under the blocks",
7696
+ "ground.inverse": "a dark band",
7697
+ "ground.plain": "the page's own ground, a hairline above",
7698
+ "ground.subtle": "a soft band",
7699
+ "ground.accent": "a band in the brand colour"
7700
+ },
7701
+ "waits": {},
7702
+ "defaults": {
7703
+ "arrange": "columns",
7704
+ "holds": [
7705
+ "pages",
7706
+ "contact"
7707
+ ],
7708
+ "closing": "none",
7709
+ "ground": "inverse"
7710
+ },
7711
+ "named": {
7712
+ "footer.three-column": {},
7713
+ "footer.mega": {
7714
+ "holds": [
7715
+ "pages",
7716
+ "visit",
7717
+ "contact"
7718
+ ]
7719
+ },
7720
+ "footer.minimal": {
7721
+ "arrange": "line",
7722
+ "holds": [
7723
+ "pages"
7724
+ ],
7725
+ "ground": "plain"
7726
+ }
7727
+ },
7728
+ "fingerprint": [
7729
+ "arrange",
7730
+ "closing",
7731
+ "ground"
7732
+ ],
7733
+ "rules": {
7734
+ "lineHolds": [
7735
+ "pages"
7736
+ ],
7737
+ "minHolds": 1
7738
+ },
7739
+ "references": []
7449
7740
  }
7450
7741
  } as const;
@@ -13,6 +13,7 @@ import { ContentFieldControl, FIELD_TYPE_OF_CONTROL,
13
13
  import { pricesIn } from './plan-words';
14
14
  import { isShopResource, planSells, SHOP_PRODUCTS_MAX, SHOP_SLUG_FIELD, shopContentType } from './shop-plan';
15
15
  import { artDirectionIssues } from './art-direction';
16
+ import { footerMixFromWords } from './footer-mix';
16
17
  import { patternListGap } from './recipe-fields';
17
18
  import { SPEC_SITE_LAYOUT, SPEC_SITE_PLAN_SHAPE } from './site-spec.generated';
18
19
  import {
@@ -47,6 +48,8 @@ export enum SitePlanIssueCode {
47
48
  RouteSource = 'route-source',
48
49
  UnknownPattern = 'unknown-pattern',
49
50
  GlobalPattern = 'global-pattern',
51
+ /** A header/footer mix (`mixes`) with a word its part's table lacks, or two words for a one-word ingredient. */
52
+ Mix = 'mix',
50
53
  UnknownSlot = 'unknown-slot',
51
54
  UnknownOptionalPart = 'unknown-optional-part',
52
55
  Binding = 'binding',
@@ -685,6 +688,22 @@ function validateGlobals(c: Collector, globals: unknown): void {
685
688
  }
686
689
  }
687
690
 
691
+ /** The parts a plan may carry as a mix, and how each reads its words (only the footer until header ingredients HI1). */
692
+ const MIX_READERS: Readonly<Record<string, (words: ReadonlyArray<string>) => unknown>> = { footer: footerMixFromWords };
693
+
694
+ /** `mixes`: each part's words parse in its table (list ingredients LI5); absent is fine. */
695
+ function validateMixes(c: Collector, mixes: unknown): void {
696
+ if (mixes === undefined) return;
697
+ if (!isObject(mixes)) return c.add(SitePlanIssueCode.Shape, 'mixes', 'must be an object');
698
+ c.keys(mixes, Object.keys(MIX_READERS), 'mixes');
699
+ for (const [part, read] of Object.entries(MIX_READERS)) {
700
+ const words = mixes[part];
701
+ if (words === undefined) continue;
702
+ if (!Array.isArray(words) || !words.every(w => typeof w === 'string')) { c.add(SitePlanIssueCode.Shape, `mixes.${part}`, 'a list of <ingredient>:<word> words'); continue; }
703
+ try { read(words); } catch (e) { c.add(SitePlanIssueCode.Mix, `mixes.${part}`, (e as Error).message); }
704
+ }
705
+ }
706
+
688
707
  /** Check a Site Plan against the plan shape and the pattern library. Never throws, never repairs. */
689
708
  export function validateSitePlan(plan: unknown, ctx: SitePlanContext = {}): SitePlanValidation {
690
709
  const c = new Collector();
@@ -705,6 +724,7 @@ export function validateSitePlan(plan: unknown, ctx: SitePlanContext = {}): Site
705
724
  validatePages(c, c.array(plan, 'pages', ''), withShopTypes(types, sources), sources, typeof design['density'] === 'string' ? design['density'] : null);
706
725
  if (sells) validateProductPage(c, c.array(plan, 'pages', ''), sources);
707
726
  validateGlobals(c, plan['globals']);
727
+ validateMixes(c, plan['mixes']);
708
728
  validateScenes(c, c.array(plan, 'pages', ''), typeof design['animate'] === 'string' ? design['animate'] : null);
709
729
  validateFilm(c, plan['film'], c.array(plan, 'pages', ''));
710
730
  validateArtDirection(c, plan['artDirection']);